Headers for emWin lib
Dependents: DISCO-F746NG_rtos_test
Revision 0:1bf8f02b0770, committed 2016-03-26
- Comitter:
- redbird
- Date:
- Sat Mar 26 22:49:50 2016 +0000
- Commit message:
- new code integration
Changed in this revision
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/BUTTON.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/BUTTON.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,209 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : BUTTON.h +Purpose : BUTTON public header file (API) +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef BUTTON_H +#define BUTTON_H + +#include "WM.h" +#include "DIALOG_Intern.h" /* Req. for Create indirect data structure */ +#include "WIDGET.h" + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) + extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Create flags +*/ +/* For compatibility only ! */ +#define BUTTON_CF_HIDE WM_CF_HIDE +#define BUTTON_CF_SHOW WM_CF_SHOW +#define BUTTON_CF_MEMDEV WM_CF_MEMDEV + +/********************************************************************* +* +* Color indices +*/ +#define BUTTON_CI_UNPRESSED 0 +#define BUTTON_CI_PRESSED 1 +#define BUTTON_CI_DISABLED 2 + +/********************************************************************* +* +* Bitmap indices +*/ +#define BUTTON_BI_UNPRESSED 0 +#define BUTTON_BI_PRESSED 1 +#define BUTTON_BI_DISABLED 2 + +/********************************************************************* +* +* States +*/ +#define BUTTON_STATE_FOCUS WIDGET_STATE_FOCUS +#define BUTTON_STATE_PRESSED WIDGET_STATE_USER0 + +/********************************************************************* +* +* Skinning property indices +*/ +#define BUTTON_SKINFLEX_PI_PRESSED 0 +#define BUTTON_SKINFLEX_PI_FOCUSSED 1 +#define BUTTON_SKINFLEX_PI_ENABLED 2 +#define BUTTON_SKINFLEX_PI_DISABLED 3 + +/********************************************************************* +* +* Types +* +********************************************************************** +*/ +typedef WM_HMEM BUTTON_Handle; + +typedef struct { + GUI_COLOR aColorFrame[3]; + GUI_COLOR aColorUpper[2]; + GUI_COLOR aColorLower[2]; + int Radius; +} BUTTON_SKINFLEX_PROPS; + +/********************************************************************* +* +* Create function(s) + + Note: the parameters to a create function may vary. + Some widgets may have multiple create functions +*/ + +BUTTON_Handle BUTTON_Create (int x0, int y0, int xSize, int ySize, int ID, int Flags); +BUTTON_Handle BUTTON_CreateAsChild (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags); +BUTTON_Handle BUTTON_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id); +BUTTON_Handle BUTTON_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes); +BUTTON_Handle BUTTON_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); + +/********************************************************************* +* +* Standard member functions +* +********************************************************************** +*/ +GUI_COLOR BUTTON_GetDefaultBkColor (unsigned Index); +const GUI_FONT * BUTTON_GetDefaultFont (void); +int BUTTON_GetDefaultTextAlign (void); +GUI_COLOR BUTTON_GetDefaultTextColor (unsigned Index); +void BUTTON_SetDefaultBkColor (GUI_COLOR Color, unsigned Index); +GUI_COLOR BUTTON_SetDefaultFocusColor(GUI_COLOR Color); +void BUTTON_SetDefaultFont (const GUI_FONT * pFont); +void BUTTON_SetDefaultTextAlign (int Align); +void BUTTON_SetDefaultTextColor (GUI_COLOR Color, unsigned Index); + +#define BUTTON_EnableMemdev(hObj) WM_EnableMemdev (hObj) +#define BUTTON_DisableMemdev(hObj) WM_DisableMemdev (hObj) +#define BUTTON_Delete(hObj) WM_DeleteWindow (hObj) +#define BUTTON_Paint(hObj) WM_Paint (hObj) +#define BUTTON_Invalidate(hObj) WM_InvalidateWindow(hObj) + +/********************************************************************* +* +* The callback ... +* +* Do not call it directly ! It is only to be used from within an +* overwritten callback. +*/ +void BUTTON_Callback(WM_MESSAGE *pMsg); + +/********************************************************************* +* +* Member functions +* +********************************************************************** +*/ +GUI_COLOR BUTTON_GetBkColor (BUTTON_Handle hObj, unsigned int Index); +const GUI_BITMAP * BUTTON_GetBitmap(BUTTON_Handle hObj,unsigned int Index); +const GUI_FONT * BUTTON_GetFont (BUTTON_Handle hObj); +GUI_COLOR BUTTON_GetFrameColor (BUTTON_Handle hObj); +WIDGET * BUTTON_GetpWidget (BUTTON_Handle hObj); +void BUTTON_GetText (BUTTON_Handle hObj, char * pBuffer, int MaxLen); +GUI_COLOR BUTTON_GetTextColor (BUTTON_Handle hObj, unsigned int Index); +int BUTTON_GetTextAlign (BUTTON_Handle hObj); +int BUTTON_GetUserData (BUTTON_Handle hObj, void * pDest, int NumBytes); +unsigned BUTTON_IsPressed (BUTTON_Handle hObj); +void BUTTON_SetBitmap (BUTTON_Handle hObj, unsigned int Index, const GUI_BITMAP * pBitmap); +void BUTTON_SetBitmapEx (BUTTON_Handle hObj, unsigned int Index, const GUI_BITMAP * pBitmap, int x, int y); +void BUTTON_SetBkColor (BUTTON_Handle hObj, unsigned int Index, GUI_COLOR Color); +void BUTTON_SetBMP (BUTTON_Handle hObj, unsigned int Index, const void * pBitmap); +void BUTTON_SetBMPEx (BUTTON_Handle hObj, unsigned int Index, const void * pBitmap, int x, int y); +void BUTTON_SetFont (BUTTON_Handle hObj, const GUI_FONT * pfont); +void BUTTON_SetFrameColor (BUTTON_Handle hObj, GUI_COLOR Color); +void BUTTON_SetState (BUTTON_Handle hObj, int State); /* Not to be doc. */ +void BUTTON_SetPressed (BUTTON_Handle hObj, int State); +GUI_COLOR BUTTON_SetFocusColor (BUTTON_Handle hObj, GUI_COLOR Color); +void BUTTON_SetFocussable (BUTTON_Handle hObj, int State); +void BUTTON_SetStreamedBitmap (BUTTON_Handle hObj, unsigned int Index, const GUI_BITMAP_STREAM * pBitmap); +void BUTTON_SetStreamedBitmapEx(BUTTON_Handle hObj, unsigned int Index, const GUI_BITMAP_STREAM * pBitmap, int x, int y); +int BUTTON_SetText (BUTTON_Handle hObj, const char* s); +void BUTTON_SetTextAlign (BUTTON_Handle hObj, int Align); +void BUTTON_SetTextColor (BUTTON_Handle hObj, unsigned int Index, GUI_COLOR Color); +void BUTTON_SetTextOffset (BUTTON_Handle hObj, int xPos, int yPos); +void BUTTON_SetSelfDrawEx (BUTTON_Handle hObj, unsigned int Index, GUI_DRAW_SELF_CB * pDraw, int x, int y); /* Not to be doc. */ +void BUTTON_SetSelfDraw (BUTTON_Handle hObj, unsigned int Index, GUI_DRAW_SELF_CB * pDraw); /* Not to be doc. */ +void BUTTON_SetReactOnLevel (void); +void BUTTON_SetReactOnTouch (void); +int BUTTON_SetUserData (BUTTON_Handle hObj, const void * pSrc, int NumBytes); + +/********************************************************************* +* +* Member functions: Skinning +* +********************************************************************** +*/ +void BUTTON_GetSkinFlexProps (BUTTON_SKINFLEX_PROPS * pProps, int Index); +void BUTTON_SetSkinClassic (BUTTON_Handle hObj); +void BUTTON_SetSkin (BUTTON_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); +int BUTTON_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); +void BUTTON_SetSkinFlexProps (const BUTTON_SKINFLEX_PROPS * pProps, int Index); +void BUTTON_SetDefaultSkinClassic(void); +WIDGET_DRAW_ITEM_FUNC * BUTTON_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); + +#define BUTTON_SKIN_FLEX BUTTON_DrawSkinFlex + +#if defined(__cplusplus) + } +#endif + +#endif // GUI_WINSUPPORT +#endif // BUTTON_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/CALENDAR.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/CALENDAR.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,150 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : CALENDAR.h +Purpose : Message box interface +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef CALENDAR_H +#define CALENDAR_H + +#include "WM.h" + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) + extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Defines +* +********************************************************************** +*/ +#define CALENDAR_CI_WEEKEND 0 +#define CALENDAR_CI_WEEKDAY 1 +#define CALENDAR_CI_SEL 2 + +#define CALENDAR_CI_HEADER 3 +#define CALENDAR_CI_MONTH 4 +#define CALENDAR_CI_LABEL 5 +#define CALENDAR_CI_FRAME 6 + +#define CALENDAR_FI_CONTENT 0 +#define CALENDAR_FI_HEADER 1 + +#define CALENDAR_SI_HEADER 0 +#define CALENDAR_SI_CELL_X 1 +#define CALENDAR_SI_CELL_Y 2 + +/********************************************************************* +* +* Notification codes +* +* The following is the list of notification codes specific to this widget, +* Send with the WM_NOTIFY_PARENT message +*/ +#define CALENDAR_NOTIFICATION_MONTH_CLICKED (WM_NOTIFICATION_WIDGET + 0) +#define CALENDAR_NOTIFICATION_MONTH_RELEASED (WM_NOTIFICATION_WIDGET + 1) + +/********************************************************************* +* +* Types +* +********************************************************************** +*/ +/********************************************************************* +* +* CALENDAR_DATE +*/ +typedef struct { + int Year; + int Month; + int Day; +} CALENDAR_DATE; + +/********************************************************************* +* +* CALENDAR_SKINFLEX_PROPS +*/ +typedef struct { + GUI_COLOR aColorFrame[3]; // Frame colors of buttons + GUI_COLOR aColorUpper[2]; // Upper gradient colors of buttons + GUI_COLOR aColorLower[2]; // Lower gradient colors of buttons + GUI_COLOR ColorArrow; // Arrow colors +} CALENDAR_SKINFLEX_PROPS; + +/********************************************************************* +* +* Public code +* +********************************************************************** +*/ +WM_HWIN CALENDAR_Create (WM_HWIN hParent, int xPos, int yPos, unsigned Year, unsigned Month, unsigned Day, unsigned FirstDayOfWeek, int Id, int Flags); +void CALENDAR_GetDate (WM_HWIN hWin, CALENDAR_DATE * pDate); +void CALENDAR_GetSel (WM_HWIN hWin, CALENDAR_DATE * pDate); +void CALENDAR_SetDate (WM_HWIN hWin, CALENDAR_DATE * pDate); +void CALENDAR_SetSel (WM_HWIN hWin, CALENDAR_DATE * pDate); +void CALENDAR_ShowDate (WM_HWIN hWin, CALENDAR_DATE * pDate); + +/********************************************************************* +* +* Default related +*/ +void CALENDAR_SetDefaultBkColor(unsigned Index, GUI_COLOR Color); +void CALENDAR_SetDefaultColor (unsigned Index, GUI_COLOR Color); +void CALENDAR_SetDefaultDays (const char ** apDays); +void CALENDAR_SetDefaultFont (unsigned Index, const GUI_FONT * pFont); +void CALENDAR_SetDefaultMonths (const char ** apMonths); +void CALENDAR_SetDefaultSize (unsigned Index, unsigned Size); + +/********************************************************************* +* +* Skinning related +*/ +void CALENDAR_GetSkinFlexProps (CALENDAR_SKINFLEX_PROPS * pProps, int Index); +void CALENDAR_SetSkinFlexProps (const CALENDAR_SKINFLEX_PROPS * pProps, int Index); + +/********************************************************************* +* +* The callback ... +* +* Do not call it directly ! It is only to be used from within an +* overwritten callback. +*/ +void CALENDAR_Callback(WM_MESSAGE * pMsg); + +#if defined(__cplusplus) + } +#endif + +#endif // GUI_WINSUPPORT +#endif // CALENDAR_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/CHECKBOX.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/CHECKBOX.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,197 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : CHECKBOX.h +Purpose : CHECKBOX include +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef CHECKBOX_H +#define CHECKBOX_H + +#include "WM.h" +#include "DIALOG_Intern.h" /* Req. for Create indirect data structure */ +#include "WIDGET.h" + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) + extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Defines +* +********************************************************************** +*/ + +/********************************************************************* +* +* Color indices +*/ +#define CHECKBOX_CI_DISABLED 0 +#define CHECKBOX_CI_ENABLED 1 + +/********************************************************************* +* +* Bitmap indices +*/ +#define CHECKBOX_BI_INACTIV_UNCHECKED 0 +#define CHECKBOX_BI_ACTIV_UNCHECKED 1 +#define CHECKBOX_BI_INACTIV_CHECKED 2 +#define CHECKBOX_BI_ACTIV_CHECKED 3 +#define CHECKBOX_BI_INACTIV_3STATE 4 +#define CHECKBOX_BI_ACTIV_3STATE 5 + +/********************************************************************* +* +* Skinning property indices +*/ +#define CHECKBOX_SKINFLEX_PI_ENABLED 0 +#define CHECKBOX_SKINFLEX_PI_DISABLED 1 + +/********************************************************************* +* +* Public Types +* +********************************************************************** +*/ +typedef WM_HMEM CHECKBOX_Handle; + +typedef struct { + GUI_COLOR aColorFrame[3]; + GUI_COLOR aColorInner[2]; + GUI_COLOR ColorCheck; + int ButtonSize; +} CHECKBOX_SKINFLEX_PROPS; + +/********************************************************************* +* +* Create functions +* +********************************************************************** +*/ +CHECKBOX_Handle CHECKBOX_Create (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags); +CHECKBOX_Handle CHECKBOX_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id); +CHECKBOX_Handle CHECKBOX_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes); +CHECKBOX_Handle CHECKBOX_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); + +/********************************************************************* +* +* The callback ... +* +* Do not call it directly ! It is only to be used from within an +* overwritten callback. +*/ +void CHECKBOX_Callback(WM_MESSAGE * pMsg); + +/********************************************************************* +* +* Standard member functions +* +********************************************************************** +*/ + +int CHECKBOX_GetDefaultAlign (void); +GUI_COLOR CHECKBOX_GetDefaultBkColor (void); +const GUI_FONT * CHECKBOX_GetDefaultFont (void); +int CHECKBOX_GetDefaultSpacing (void); +int CHECKBOX_GetDefaultTextAlign (void); +GUI_COLOR CHECKBOX_GetDefaultTextColor (void); +int CHECKBOX_GetUserData (CHECKBOX_Handle hObj, void * pDest, int NumBytes); +void CHECKBOX_SetDefaultAlign (int Align); +void CHECKBOX_SetDefaultBkColor (GUI_COLOR Color); +GUI_COLOR CHECKBOX_SetDefaultFocusColor(GUI_COLOR Color); +void CHECKBOX_SetDefaultFont (const GUI_FONT * pFont); +void CHECKBOX_SetDefaultImage (const GUI_BITMAP * pBitmap, unsigned int Index); +void CHECKBOX_SetDefaultSpacing (int Spacing); +void CHECKBOX_SetDefaultTextAlign (int Align); +void CHECKBOX_SetDefaultTextColor (GUI_COLOR Color); +int CHECKBOX_SetUserData (CHECKBOX_Handle hObj, const void * pSrc, int NumBytes); + +/********************************************************************* +* +* Member functions +* +********************************************************************** +*/ + +int CHECKBOX_GetState (CHECKBOX_Handle hObj); +int CHECKBOX_GetText (CHECKBOX_Handle hObj, char * pBuffer, int MaxLen); +int CHECKBOX_IsChecked (CHECKBOX_Handle hObj); +void CHECKBOX_SetBkColor (CHECKBOX_Handle hObj, GUI_COLOR Color); +GUI_COLOR CHECKBOX_SetBoxBkColor(CHECKBOX_Handle hObj, GUI_COLOR Color, int Index); +GUI_COLOR CHECKBOX_SetFocusColor(CHECKBOX_Handle hObj, GUI_COLOR Color); +void CHECKBOX_SetFont (CHECKBOX_Handle hObj, const GUI_FONT * pFont); +void CHECKBOX_SetImage (CHECKBOX_Handle hObj, const GUI_BITMAP * pBitmap, unsigned int Index); +void CHECKBOX_SetNumStates (CHECKBOX_Handle hObj, unsigned NumStates); +void CHECKBOX_SetSpacing (CHECKBOX_Handle hObj, unsigned Spacing); +void CHECKBOX_SetState (CHECKBOX_Handle hObj, unsigned State); +void CHECKBOX_SetText (CHECKBOX_Handle hObj, const char * pText); +void CHECKBOX_SetTextAlign (CHECKBOX_Handle hObj, int Align); +void CHECKBOX_SetTextColor (CHECKBOX_Handle hObj, GUI_COLOR Color); + +/********************************************************************* +* +* Member functions: Skinning +* +********************************************************************** +*/ +void CHECKBOX_GetSkinFlexProps (CHECKBOX_SKINFLEX_PROPS * pProps, int Index); +void CHECKBOX_SetSkinClassic (CHECKBOX_Handle hObj); +void CHECKBOX_SetSkin (CHECKBOX_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); +int CHECKBOX_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); +void CHECKBOX_SetSkinFlexProps (const CHECKBOX_SKINFLEX_PROPS * pProps, int Index); +void CHECKBOX_SetDefaultSkinClassic (void); +int CHECKBOX_GetSkinFlexButtonSize (CHECKBOX_Handle hObj); +void CHECKBOX_SetSkinFlexButtonSize (CHECKBOX_Handle hObj, int ButtonSize); +WIDGET_DRAW_ITEM_FUNC * CHECKBOX_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); + +#define CHECKBOX_SKIN_FLEX CHECKBOX_DrawSkinFlex + +/********************************************************************* +* +* Macros for compatibility +* +********************************************************************** +*/ + +#define CHECKBOX_Check(hObj) CHECKBOX_SetState(hObj, 1) +#define CHECKBOX_Uncheck(hObj) CHECKBOX_SetState(hObj, 0) + +#define CHECKBOX_BI_INACTIV CHECKBOX_BI_INACTIV_CHECKED +#define CHECKBOX_BI_ACTIV CHECKBOX_BI_ACTIV_CHECKED + +#if defined(__cplusplus) + } +#endif + +#endif // GUI_WINSUPPORT +#endif // CHECKBOX_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/CHOOSECOLOR.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/CHOOSECOLOR.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,128 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : CHOOSECOLOR.h +Purpose : Message box interface +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef CHOOSECOLOR_H +#define CHOOSECOLOR_H + +#include "WM.h" + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Defines +* +********************************************************************** +*/ +#define CHOOSECOLOR_CF_MOVEABLE FRAMEWIN_CF_MOVEABLE + +#define CHOOSECOLOR_CI_FRAME 0 +#define CHOOSECOLOR_CI_FOCUS 1 + +/********************************************************************* +* +* Types +* +********************************************************************** +*/ +/********************************************************************* +* +* CHOOSECOLOR_PROPS +*/ +typedef struct { + unsigned aBorder[2]; + unsigned aSpace[2]; + unsigned aButtonSize[2]; + GUI_COLOR aColor[2]; +} CHOOSECOLOR_PROPS; + +/********************************************************************* +* +* CHOOSECOLOR_CONTEXT +*/ +typedef struct { + U32 LastColor; + const GUI_COLOR * pColor; + unsigned NumColors; + unsigned NumColorsPerLine; + int SelOld; + int Sel; + WM_HWIN hParent; + CHOOSECOLOR_PROPS Props; +} CHOOSECOLOR_CONTEXT; + +/********************************************************************* +* +* Public code +* +********************************************************************** +*/ +WM_HWIN CHOOSECOLOR_Create(WM_HWIN hParent, + int xPos, + int yPos, + int xSize, + int ySize, + const GUI_COLOR * pColor, + unsigned NumColors, + unsigned NumColorsPerLine, + int Sel, + const char * sCaption, + int Flags); + +int CHOOSECOLOR_GetSel(WM_HWIN hObj); +void CHOOSECOLOR_SetSel(WM_HWIN hObj, int Sel); + +void CHOOSECOLOR_SetDefaultColor (unsigned Index, GUI_COLOR Color); +void CHOOSECOLOR_SetDefaultSpace (unsigned Index, unsigned Space); +void CHOOSECOLOR_SetDefaultBorder (unsigned Index, unsigned Border); +void CHOOSECOLOR_SetDefaultButtonSize(unsigned Index, unsigned ButtonSize); + +/********************************************************************* +* +* The callback ... +* +* Do not call it directly ! It is only to be used from within an +* overwritten callback. +*/ +void CHOOSECOLOR_Callback(WM_MESSAGE * pMsg); + +#if defined(__cplusplus) + } +#endif + +#endif /* GUI_WINSUPPORT */ + +#endif /* CHOOSECOLOR_H */
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/CHOOSEFILE.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/CHOOSEFILE.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,123 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : CHOOSEFILE.h +Purpose : File dialog interface +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef CHOOSEFILE_H +#define CHOOSEFILE_H + +#include "WM.h" + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Defines +* +********************************************************************** +*/ +#define CHOOSEFILE_FINDFIRST 0 +#define CHOOSEFILE_FINDNEXT 1 + +#define CHOOSEFILE_FLAG_DIRECTORY (1 << 0) + +#ifndef CHOOSEFILE_MAXLEN + #define CHOOSEFILE_MAXLEN 256 +#endif + +#define CHOOSEFILE_BI_CANCEL 0 +#define CHOOSEFILE_BI_OK 1 +#define CHOOSEFILE_BI_UP 2 + +/********************************************************************* +* +* Types +* +********************************************************************** +*/ +/********************************************************************* +* +* CHOOSEFILE_INFO +*/ +typedef struct CHOOSEFILE_INFO CHOOSEFILE_INFO; + +struct CHOOSEFILE_INFO { + int Cmd; // Command for GetData() function + int Id; // Id of pressed button (for internal use only) + const char * pMask; // Mask to be used for searching files + char * pName; // (for internal use only) + char * pExt; // (for internal use only) + char * pAttrib; // (for internal use only) + WM_TOOLTIP_HANDLE hToolTip; // (for internal use only) + U32 SizeL; // FileSize low word + U32 SizeH; // FileSize high word + U32 Flags; // File flags + char pRoot[CHOOSEFILE_MAXLEN]; // Buffer used internally and for passing result + int (* pfGetData)(CHOOSEFILE_INFO * pInfo); // Pointer to GetData() function +}; + +/********************************************************************* +* +* Functions +* +********************************************************************** +*/ +WM_HWIN CHOOSEFILE_Create(WM_HWIN hParent, // Parent window + int xPos, // xPosition in window coordinates + int yPos, // yPosition in window coordinates + int xSize, // xSize in pixels + int ySize, // ySize in pixels + const char * apRoot[], // Pointers to root strings + int NumRoot, // Number of roots + int SelRoot, // Root to be selected at first + const char * sCaption, // Shown in title bar + int Flags, // Flags for FRAMEWINDOW + CHOOSEFILE_INFO * pInfo // Pointer to CHOOSEFILE_INFO structure + ); + +void CHOOSEFILE_Callback (WM_MESSAGE * pMsg); +void CHOOSEFILE_EnableToolTips (void); +void CHOOSEFILE_SetButtonText (WM_HWIN hWin, unsigned ButtonIndex, const char * pText); +void CHOOSEFILE_SetDefaultButtonText(unsigned ButtonIndex, const char * pText); +void CHOOSEFILE_SetDelim (char Delim); +void CHOOSEFILE_SetToolTips (const TOOLTIP_INFO * pInfo, int NumItems); +void CHOOSEFILE_SetTopMode (unsigned OnOff); + +#if defined(__cplusplus) + } +#endif + +#endif /* GUI_WINSUPPORT */ + +#endif /* CHOOSEFILE_H */
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/DIALOG.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/DIALOG.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,92 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : Dialog.h +Purpose : Dialog box include +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef DIALOG_H +#define DIALOG_H + +#include "WM.h" +#include "BUTTON.h" +#include "CALENDAR.h" +#include "CHECKBOX.h" +#include "CHOOSECOLOR.h" +#include "CHOOSEFILE.h" +#include "DROPDOWN.h" +#include "EDIT.h" +#include "FRAMEWIN.h" +#include "GRAPH.h" +#include "HEADER.h" +#include "ICONVIEW.h" +#include "IMAGE.h" +#include "LISTBOX.h" +#include "LISTVIEW.h" +#include "LISTWHEEL.h" +#include "MENU.h" +#include "MULTIEDIT.h" +#include "MULTIPAGE.h" +#include "PROGBAR.h" +#include "RADIO.h" +#include "SCROLLBAR.h" +#include "SLIDER.h" +#include "SPINBOX.h" +#include "TEXT.h" +#include "TREEVIEW.h" +#include "KNOB.h" + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) + extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* WINDOW API +*/ +WM_HWIN WINDOW_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, WM_CALLBACK * cb); +WM_HWIN WINDOW_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, WM_CALLBACK * cb, int NumExtraBytes); +WM_HWIN WINDOW_CreateIndirect (const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); +GUI_COLOR WINDOW_GetDefaultBkColor(void); +int WINDOW_GetUserData (WM_HWIN hObj, void * pDest, int NumBytes); +void WINDOW_SetBkColor (WM_HWIN hObj, GUI_COLOR Color); +void WINDOW_SetDefaultBkColor(GUI_COLOR Color); +int WINDOW_SetUserData (WM_HWIN hObj, const void * pSrc, int NumBytes); + +void WINDOW_Callback(WM_MESSAGE * pMsg); + +#if defined(__cplusplus) + } +#endif + +#endif // GUI_WINSUPPORT +#endif // DIALOG_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/DIALOG_Intern.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/DIALOG_Intern.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,99 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : Dialog.h +Purpose : Dialog box include +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef DIALOG_INTERN_H +#define DIALOG_INTERN_H + +#include "WM.h" + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) + extern "C" { // Make sure we have C-declarations in C++ programs +#endif + +/********************************************************************* +* +* Types +* +********************************************************************** +*/ +typedef struct GUI_WIDGET_CREATE_INFO_struct GUI_WIDGET_CREATE_INFO; +typedef WM_HWIN GUI_WIDGET_CREATE_FUNC (const GUI_WIDGET_CREATE_INFO * pCreate, WM_HWIN hWin, int x0, int y0, WM_CALLBACK * cb); + +/********************************************************************* +* +* Structures +* +********************************************************************** +*/ +struct GUI_WIDGET_CREATE_INFO_struct { + GUI_WIDGET_CREATE_FUNC * pfCreateIndirect; + const char * pName; // Text ... Not used on all widgets + I16 Id; // ID ... should be unique in a dialog + I16 x0; // x position + I16 y0; // y position + I16 xSize; // x size + I16 ySize; // y size + U16 Flags; // Widget specific create flags (opt.) + I32 Para; // Widget specific parameter (opt.) + U32 NumExtraBytes; // Number of extra bytes usable with <WIDGET>_SetUserData & <WIDGET>_GetUserData +}; + +/********************************************************************* +* +* Public API functions +* +********************************************************************** +*/ +WM_HWIN GUI_CreateDialogBox (const GUI_WIDGET_CREATE_INFO * paWidget, int NumWidgets, WM_CALLBACK * cb, WM_HWIN hParent, int x0, int y0); +void GUI_EndDialog (WM_HWIN hWin, int r); +int GUI_ExecDialogBox (const GUI_WIDGET_CREATE_INFO * paWidget, int NumWidgets, WM_CALLBACK * cb, WM_HWIN hParent, int x0, int y0); +int GUI_ExecCreatedDialog (WM_HWIN hDialog); +WM_DIALOG_STATUS * GUI_GetDialogStatusPtr(WM_HWIN hDialog); // Not to be documented +void GUI_SetDialogStatusPtr(WM_HWIN hDialog, WM_DIALOG_STATUS * pDialogStatus); // Not to be documented + +/********************************************************************* +* +* Obsolete +*/ +LCD_COLOR DIALOG_GetBkColor(void); +LCD_COLOR DIALOG_SetBkColor(LCD_COLOR BkColor); + +#if defined(__cplusplus) + } +#endif + +#endif // GUI_WINSUPPORT +#endif // DIALOG_INTERN_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/DROPDOWN.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/DROPDOWN.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,202 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : DROPDOWN.h +Purpose : Multiple choice object include +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef DROPDOWN_H +#define DROPDOWN_H + +#include "WM.h" +#include "DIALOG_Intern.h" /* Req. for Create indirect data structure */ +#include "LISTBOX.h" + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) + extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/************************************************************ +* +* Create flags +*/ +#define DROPDOWN_CF_AUTOSCROLLBAR (1 << 0) +#define DROPDOWN_CF_UP (1 << 1) + +/********************************************************************* +* +* Color indices +*/ +#define DROPDOWN_CI_UNSEL 0 +#define DROPDOWN_CI_SEL 1 +#define DROPDOWN_CI_SELFOCUS 2 + +#define DROPDOWN_CI_ARROW 0 +#define DROPDOWN_CI_BUTTON 1 + +/********************************************************************* +* +* Skinning property indices +*/ +#define DROPDOWN_SKINFLEX_PI_EXPANDED 0 +#define DROPDOWN_SKINFLEX_PI_FOCUSSED 1 +#define DROPDOWN_SKINFLEX_PI_ENABLED 2 +#define DROPDOWN_SKINFLEX_PI_DISABLED 3 + +/********************************************************************* +* +* Types +* +********************************************************************** +*/ +typedef WM_HMEM DROPDOWN_Handle; + +typedef struct { + GUI_COLOR aColorFrame[3]; + GUI_COLOR aColorUpper[2]; + GUI_COLOR aColorLower[2]; + GUI_COLOR ColorArrow; + GUI_COLOR ColorText; + GUI_COLOR ColorSep; + int Radius; +} DROPDOWN_SKINFLEX_PROPS; + +/********************************************************************* +* +* Standard member functions +* +********************************************************************** +*/ +#define DROPDOWN_EnableMemdev(hObj) WM_EnableMemdev(hObj) +#define DROPDOWN_DisableMemdev(hObj) WM_DisableMemdev(hObj) +#define DROPDOWN_Delete(hObj) WM_DeleteWindow(hObj) +#define DROPDOWN_Paint(hObj) WM_Paint(hObj) +#define DROPDOWN_Invalidate(hObj) WM_InvalidateWindow(hObj) + +/********************************************************************* +* +* Create functions +* +********************************************************************** +*/ +DROPDOWN_Handle DROPDOWN_Create (WM_HWIN hWinParent, int x0, int y0, int xSize, int ySize, int Flags); +DROPDOWN_Handle DROPDOWN_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id); +DROPDOWN_Handle DROPDOWN_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes); +DROPDOWN_Handle DROPDOWN_CreateIndirect(const GUI_WIDGET_CREATE_INFO* pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK* cb); + +/********************************************************************* +* +* The callback ... +* +* Do not call it directly ! It is only to be used from within an +* overwritten callback. +*/ +void DROPDOWN_Callback(WM_MESSAGE * pMsg); + +/********************************************************************* +* +* Member functions +* +********************************************************************** +*/ +void DROPDOWN_AddKey (DROPDOWN_Handle hObj, int Key); +void DROPDOWN_AddString (DROPDOWN_Handle hObj, const char* s); +void DROPDOWN_Collapse (DROPDOWN_Handle hObj); +void DROPDOWN_DecSel (DROPDOWN_Handle hObj); +void DROPDOWN_DecSelExp (DROPDOWN_Handle hObj); +void DROPDOWN_DeleteItem (DROPDOWN_Handle hObj, unsigned int Index); +void DROPDOWN_Expand (DROPDOWN_Handle hObj); +unsigned DROPDOWN_GetItemDisabled (DROPDOWN_Handle hObj, unsigned Index); +unsigned DROPDOWN_GetItemSpacing (DROPDOWN_Handle hObj); +int DROPDOWN_GetItemText (DROPDOWN_Handle hObj, unsigned Index, char * pBuffer, int MaxSize); +LISTBOX_Handle DROPDOWN_GetListbox (DROPDOWN_Handle hObj); +int DROPDOWN_GetNumItems (DROPDOWN_Handle hObj); +int DROPDOWN_GetSel (DROPDOWN_Handle hObj); +int DROPDOWN_GetSelExp (DROPDOWN_Handle hObj); +int DROPDOWN_GetUserData (DROPDOWN_Handle hObj, void * pDest, int NumBytes); +void DROPDOWN_IncSel (DROPDOWN_Handle hObj); +void DROPDOWN_IncSelExp (DROPDOWN_Handle hObj); +void DROPDOWN_InsertString (DROPDOWN_Handle hObj, const char* s, unsigned int Index); +void DROPDOWN_SetAutoScroll (DROPDOWN_Handle hObj, int OnOff); +void DROPDOWN_SetBkColor (DROPDOWN_Handle hObj, unsigned int Index, GUI_COLOR color); +void DROPDOWN_SetColor (DROPDOWN_Handle hObj, unsigned int Index, GUI_COLOR Color); +void DROPDOWN_SetFont (DROPDOWN_Handle hObj, const GUI_FONT * pfont); +void DROPDOWN_SetItemDisabled (DROPDOWN_Handle hObj, unsigned Index, int OnOff); +void DROPDOWN_SetItemSpacing (DROPDOWN_Handle hObj, unsigned Value); +int DROPDOWN_SetListHeight (DROPDOWN_Handle hObj, unsigned Height); +void DROPDOWN_SetScrollbarColor(DROPDOWN_Handle hObj, unsigned Index, GUI_COLOR Color); +void DROPDOWN_SetScrollbarWidth(DROPDOWN_Handle hObj, unsigned Width); +void DROPDOWN_SetSel (DROPDOWN_Handle hObj, int Sel); +void DROPDOWN_SetSelExp (DROPDOWN_Handle hObj, int Sel); +void DROPDOWN_SetTextAlign (DROPDOWN_Handle hObj, int Align); +void DROPDOWN_SetTextColor (DROPDOWN_Handle hObj, unsigned int index, GUI_COLOR color); +void DROPDOWN_SetTextHeight (DROPDOWN_Handle hObj, unsigned TextHeight); +int DROPDOWN_SetUpMode (DROPDOWN_Handle hObj, int OnOff); +int DROPDOWN_SetUserData (DROPDOWN_Handle hObj, const void * pSrc, int NumBytes); + +/********************************************************************* +* +* Member functions: Skinning +* +********************************************************************** +*/ +void DROPDOWN_GetSkinFlexProps (DROPDOWN_SKINFLEX_PROPS * pProps, int Index); +void DROPDOWN_SetSkinClassic (DROPDOWN_Handle hObj); +void DROPDOWN_SetSkin (DROPDOWN_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); +int DROPDOWN_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); +void DROPDOWN_SetSkinFlexProps (const DROPDOWN_SKINFLEX_PROPS * pProps, int Index); +void DROPDOWN_SetDefaultSkinClassic(void); +WIDGET_DRAW_ITEM_FUNC * DROPDOWN_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); + +#define DROPDOWN_SKIN_FLEX DROPDOWN_DrawSkinFlex + +/********************************************************************* +* +* Global functions +* +********************************************************************** +*/ +GUI_COLOR DROPDOWN_GetDefaultBkColor (int Index); +GUI_COLOR DROPDOWN_GetDefaultColor (int Index); +const GUI_FONT * DROPDOWN_GetDefaultFont (void); +GUI_COLOR DROPDOWN_GetDefaultScrollbarColor(int Index); +void DROPDOWN_SetDefaultFont (const GUI_FONT * pFont); +GUI_COLOR DROPDOWN_SetDefaultBkColor (int Index, GUI_COLOR Color); +GUI_COLOR DROPDOWN_SetDefaultColor (int Index, GUI_COLOR Color); +GUI_COLOR DROPDOWN_SetDefaultScrollbarColor(int Index, GUI_COLOR Color); + +#if defined(__cplusplus) + } +#endif + +#endif // GUI_WINSUPPORT +#endif // DROPDOWN_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/EDIT.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/EDIT.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,220 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : EDIT.h +Purpose : EDIT include +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef EDIT_H +#define EDIT_H + +#include "WM.h" +#include "DIALOG_Intern.h" // Required for Create indirect data structure + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) + extern "C" { // Make sure we have C-declarations in C++ programs +#endif + +/********************************************************************* +* +* Defaults for configuration switches +* +* The following are defaults for config switches which affect the +* interface specified in this module +* +********************************************************************** +*/ +/********************************************************************* +* +* Defines +* +********************************************************************** +*/ +/********************************************************************* +* +* Create / Status flags +*/ +#define EDIT_CF_LEFT GUI_TA_LEFT +#define EDIT_CF_RIGHT GUI_TA_RIGHT +#define EDIT_CF_HCENTER GUI_TA_HCENTER + +#define EDIT_CF_VCENTER GUI_TA_VCENTER +#define EDIT_CF_TOP GUI_TA_TOP +#define EDIT_CF_BOTTOM GUI_TA_BOTTOM + +/********************************************************************* +* +* Color indices +*/ +#define EDIT_CI_DISABLED 0 +#define EDIT_CI_ENABLED 1 + +/********************************************************************* +* +* Types +* +********************************************************************** +*/ +typedef WM_HMEM EDIT_Handle; +typedef void tEDIT_AddKeyEx (EDIT_Handle hObj, int Key); +typedef void tEDIT_UpdateBuffer(EDIT_Handle hObj); + +/********************************************************************* +* +* Create functions +*/ +EDIT_Handle EDIT_Create (int x0, int y0, int xSize, int ySize, int Id, int MaxLen, int Flags); +EDIT_Handle EDIT_CreateAsChild (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags, int MaxLen); +EDIT_Handle EDIT_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int MaxLen); +EDIT_Handle EDIT_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int MaxLen, int NumExtraBytes); +EDIT_Handle EDIT_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); + +/********************************************************************* +* +* The callback ... +* +* Do not call it directly ! It is only to be used from within an +* overwritten callback. +*/ +void EDIT_Callback(WM_MESSAGE * pMsg); + +/********************************************************************* +* +* Standard member functions +*/ +#define EDIT_EnableMemdev(hObj) WM_EnableMemdev(hObj) +#define EDIT_DisableMemdev(hObj) WM_DisableMemdev(hObj) +#define EDIT_Delete(hObj) WM_DeleteWindow(hObj) +#define EDIT_Paint(hObj) WM_Paint(hObj) +#define EDIT_Invalidate(hObj) WM_InvalidateWindow(hObj) + +/********************************************************************* +* +* Individual member functions +*/ +// +// Methods changing preferences +// +void EDIT_SetDefaultBkColor (unsigned int Index, GUI_COLOR Color); +void EDIT_SetDefaultFont (const GUI_FONT * pFont); +void EDIT_SetDefaultTextAlign(int Align); +void EDIT_SetDefaultTextColor(unsigned int Index, GUI_COLOR Color); +// +// Query preferences +// +GUI_COLOR EDIT_GetDefaultBkColor(unsigned int Index); +const GUI_FONT * EDIT_GetDefaultFont(void); +int EDIT_GetDefaultTextAlign(void); +GUI_COLOR EDIT_GetDefaultTextColor(unsigned int Index); +// +// Methods changing properties +// +void EDIT_AddKey (EDIT_Handle hObj, int Key); +void EDIT_EnableBlink (EDIT_Handle hObj, int Period, int OnOff); +GUI_COLOR EDIT_GetBkColor (EDIT_Handle hObj, unsigned int Index); +void EDIT_SetBkColor (EDIT_Handle hObj, unsigned int Index, GUI_COLOR color); +void EDIT_SetCursorAtChar (EDIT_Handle hObj, int Pos); +void EDIT_SetCursorAtPixel (EDIT_Handle hObj, int xPos); +void EDIT_SetFocussable (EDIT_Handle hObj, int State); +void EDIT_SetFont (EDIT_Handle hObj, const GUI_FONT * pfont); +int EDIT_SetInsertMode (EDIT_Handle hObj, int OnOff); +void EDIT_SetMaxLen (EDIT_Handle hObj, int MaxLen); +void EDIT_SetpfAddKeyEx (EDIT_Handle hObj, tEDIT_AddKeyEx * pfAddKeyEx); +void EDIT_SetpfUpdateBuffer(EDIT_Handle hObj, tEDIT_UpdateBuffer * pfUpdateBuffer); +void EDIT_SetText (EDIT_Handle hObj, const char* s); +void EDIT_SetTextAlign (EDIT_Handle hObj, int Align); +GUI_COLOR EDIT_GetTextColor(EDIT_Handle hObj, unsigned int Index); +void EDIT_SetTextColor (EDIT_Handle hObj, unsigned int Index, GUI_COLOR color); +void EDIT_SetSel (EDIT_Handle hObj, int FirstChar, int LastChar); +int EDIT_SetUserData (EDIT_Handle hObj, const void * pSrc, int NumBytes); +// +// Get/Set user input +// +int EDIT_GetCursorCharPos (EDIT_Handle hObj); +void EDIT_GetCursorPixelPos (EDIT_Handle hObj, int * pxPos, int * pyPos); +float EDIT_GetFloatValue (EDIT_Handle hObj); +const GUI_FONT * EDIT_GetFont(EDIT_Handle hObj); +int EDIT_GetNumChars (EDIT_Handle hObj); +void EDIT_GetText (EDIT_Handle hObj, char* sDest, int MaxLen); +I32 EDIT_GetValue (EDIT_Handle hObj); +void EDIT_SetFloatValue (EDIT_Handle hObj, float Value); +int EDIT_GetUserData (EDIT_Handle hObj, void * pDest, int NumBytes); +void EDIT_SetValue (EDIT_Handle hObj, I32 Value); + +/********************************************************************* +* +* Routines for editing values +* +********************************************************************** +*/ +void EDIT_SetHexMode (EDIT_Handle hEdit, U32 Value, U32 Min, U32 Max); +void EDIT_SetBinMode (EDIT_Handle hEdit, U32 Value, U32 Min, U32 Max); +void EDIT_SetDecMode (EDIT_Handle hEdit, I32 Value, I32 Min, I32 Max, int Shift, U8 Flags); +void EDIT_SetFloatMode(EDIT_Handle hEdit, float Value, float Min, float Max, int Shift, U8 Flags); +void EDIT_SetTextMode (EDIT_Handle hEdit); +void EDIT_SetUlongMode(EDIT_Handle hEdit, U32 Value, U32 Min, U32 Max); + +U32 GUI_EditHex (U32 Value, U32 Min, U32 Max, int Len, int xSize); +U32 GUI_EditBin (U32 Value, U32 Min, U32 Max, int Len, int xSize); +I32 GUI_EditDec (I32 Value, I32 Min, I32 Max, int Len, int xSize, int Shift, U8 Flags); +float GUI_EditFloat (float Value, float Min, float Max, int Len, int xSize, int Shift, U8 Flags); +void GUI_EditString (char * pString, int Len, int xSize); + +/********************************************************************* +* +* Flags +* +********************************************************************** +*/ +// +// Signed or normal mode +// +#define GUI_EDIT_NORMAL (0 << 0) +#define GUI_EDIT_SIGNED (1 << 0) +#define GUI_EDIT_SUPPRESS_LEADING_ZEROES (1 << 1) +// +// Edit modes +// +#define GUI_EDIT_MODE_INSERT 0 +#define GUI_EDIT_MODE_OVERWRITE 1 +// +// Compatibility macros +// +#define EDIT_CI_DISABELD EDIT_CI_DISABLED +#define EDIT_CI_ENABELD EDIT_CI_ENABLED + +#if defined(__cplusplus) + } +#endif + +#endif // GUI_WINSUPPORT +#endif // EDIT_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/FRAMEWIN.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/FRAMEWIN.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,267 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : FRAMEWIN.h +Purpose : Frame window include +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef FRAMEWIN_H +#define FRAMEWIN_H + +#include "WM.h" +#include "WIDGET.h" /* Req. for WIDGET_DRAW_ITEM_FUNC */ +#if GUI_WINSUPPORT +#include "DIALOG_Intern.h" /* Req. for Create indirect data structure */ + +#if defined(__cplusplus) + extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Defines +* +********************************************************************** +*/ +/********************************************************************* +* +* Configuration +*/ +#ifndef FRAMEWIN_ALLOW_DRAG_ON_FRAME + #define FRAMEWIN_ALLOW_DRAG_ON_FRAME 1 +#endif + +/********************************************************************* +* +* Color indices +*/ +#define FRAMEWIN_CI_INACTIVE 0 +#define FRAMEWIN_CI_ACTIVE 1 + +/********************************************************************* +* +* Create / Status flags +*/ +#define FRAMEWIN_CF_ACTIVE (1<<3) +#define FRAMEWIN_CF_MOVEABLE (1<<4) +#define FRAMEWIN_CF_TITLEVIS (1<<5) +#define FRAMEWIN_CF_MINIMIZED (1<<6) +#define FRAMEWIN_CF_MAXIMIZED (1<<7) +#define FRAMEWIN_CF_DRAGGING (1<<8) + +#define FRAMEWIN_SF_ACTIVE FRAMEWIN_CF_ACTIVE +#define FRAMEWIN_SF_MOVEABLE FRAMEWIN_CF_MOVEABLE +#define FRAMEWIN_SF_TITLEVIS FRAMEWIN_CF_TITLEVIS +#define FRAMEWIN_SF_MINIMIZED FRAMEWIN_CF_MINIMIZED +#define FRAMEWIN_SF_MAXIMIZED FRAMEWIN_CF_MAXIMIZED +#define FRAMEWIN_SF_DRAGGING FRAMEWIN_CF_DRAGGING + +/********************************************************************* +* +* BUTTON Flags +*/ +#define FRAMEWIN_BUTTON_RIGHT (1<<0) +#define FRAMEWIN_BUTTON_LEFT (1<<1) + +/********************************************************************* +* +* Skinning property indices +*/ +#define FRAMEWIN_SKINFLEX_PI_ACTIVE 0 +#define FRAMEWIN_SKINFLEX_PI_INACTIVE 1 + +/********************************************************************* +* +* Getting border size +*/ +#define FRAMEWIN_BORDERSIZE_T 0 +#define FRAMEWIN_BORDERSIZE_L 1 +#define FRAMEWIN_BORDERSIZE_B 2 +#define FRAMEWIN_BORDERSIZE_R 3 + +/********************************************************************* +* +* Types +* +********************************************************************** +*/ +typedef WM_HMEM FRAMEWIN_Handle; + +typedef struct { + GUI_COLOR aColorFrame[3]; + GUI_COLOR aColorTitle[2]; + int Radius; + int SpaceX; + int BorderSizeL; + int BorderSizeR; + int BorderSizeT; + int BorderSizeB; +} FRAMEWIN_SKINFLEX_PROPS; + +/********************************************************************* +* +* Create functions +* +********************************************************************** +*/ +FRAMEWIN_Handle FRAMEWIN_Create (const char * pTitle, WM_CALLBACK * cb, int Flags, int x0, int y0, int xSize, int ySize); +FRAMEWIN_Handle FRAMEWIN_CreateAsChild (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, const char * pText, WM_CALLBACK * cb, int Flags); +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); +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); +FRAMEWIN_Handle FRAMEWIN_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); + +/********************************************************************* +* +* The callback ... +* +* Do not call it directly ! It is only to be used from within an +* overwritten callback. +*/ +void FRAMEWIN_Callback(WM_MESSAGE * pMsg); + +/********************************************************************* +* +* Standard member functions +* +********************************************************************** +*/ +#define FRAMEWIN_EnableMemdev(hObj) WM_EnableMemdev(hObj) +#define FRAMEWIN_DisableMemdev(hObj) WM_DisableMemdev(hObj) +#define FRAMEWIN_Delete(hObj) WM_DeleteWindow(hObj) +#define FRAMEWIN_Paint(hObj) WM_Paint(hObj) +#define FRAMEWIN_Invalidate(hObj) WM_InvalidateWindow(hObj) + +WM_HWIN FRAMEWIN_AddButton (FRAMEWIN_Handle hObj, int Flags, int Off, int Id); +WM_HWIN FRAMEWIN_AddCloseButton(FRAMEWIN_Handle hObj, int Flags, int Off); +WM_HWIN FRAMEWIN_AddMaxButton (FRAMEWIN_Handle hObj, int Flags, int Off); +void FRAMEWIN_AddMenu (FRAMEWIN_Handle hObj, WM_HWIN hMenu); +WM_HWIN FRAMEWIN_AddMinButton (FRAMEWIN_Handle hObj, int Flags, int Off); + +void FRAMEWIN_Minimize (FRAMEWIN_Handle hObj); +void FRAMEWIN_Maximize (FRAMEWIN_Handle hObj); +void FRAMEWIN_Restore (FRAMEWIN_Handle hObj); + +/********************************************************************* +* +* Member functions: Set Properties +* +********************************************************************** +*/ +void FRAMEWIN_SetActive (FRAMEWIN_Handle hObj, int State); +void FRAMEWIN_SetBarColor (FRAMEWIN_Handle hObj, unsigned Index, GUI_COLOR Color); +void FRAMEWIN_SetBorderSize (FRAMEWIN_Handle hObj, unsigned Size); +void FRAMEWIN_SetClientColor (FRAMEWIN_Handle hObj, GUI_COLOR Color); +void FRAMEWIN_SetFont (FRAMEWIN_Handle hObj, const GUI_FONT * pFont); +void FRAMEWIN_SetMoveable (FRAMEWIN_Handle hObj, int State); +void FRAMEWIN_SetOwnerDraw (FRAMEWIN_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawItem); +void FRAMEWIN_SetResizeable (FRAMEWIN_Handle hObj, int State); +void FRAMEWIN_SetText (FRAMEWIN_Handle hObj, const char* s); +void FRAMEWIN_SetTextAlign (FRAMEWIN_Handle hObj, int Align); +void FRAMEWIN_SetTextColor (FRAMEWIN_Handle hObj, GUI_COLOR Color); +void FRAMEWIN_SetTextColorEx (FRAMEWIN_Handle hObj, unsigned Index, GUI_COLOR Color); +void FRAMEWIN_SetTitleVis (FRAMEWIN_Handle hObj, int Show); +int FRAMEWIN_SetTitleHeight (FRAMEWIN_Handle hObj, int Height); +int FRAMEWIN_SetUserData (FRAMEWIN_Handle hObj, const void * pSrc, int NumBytes); + +/********************************************************************* +* +* Member functions: Skinning +* +********************************************************************** +*/ +void FRAMEWIN_GetSkinFlexProps (FRAMEWIN_SKINFLEX_PROPS * pProps, int Index); +void FRAMEWIN_SetSkinClassic (FRAMEWIN_Handle hObj); +void FRAMEWIN_SetSkin (FRAMEWIN_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); +int FRAMEWIN_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); +void FRAMEWIN_SetSkinFlexProps (const FRAMEWIN_SKINFLEX_PROPS * pProps, int Index); +void FRAMEWIN_SetDefaultSkinClassic(void); +WIDGET_DRAW_ITEM_FUNC * FRAMEWIN_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); + +#define FRAMEWIN_SKIN_FLEX FRAMEWIN_DrawSkinFlex + +/********************************************************************* +* +* Member functions: Get Properties +* +********************************************************************** +*/ +const GUI_FONT * FRAMEWIN_GetFont(FRAMEWIN_Handle hObj); + +int FRAMEWIN_GetActive (FRAMEWIN_Handle hObj); +int FRAMEWIN_GetTitleHeight (FRAMEWIN_Handle hObj); +GUI_COLOR FRAMEWIN_GetBarColor (FRAMEWIN_Handle hObj, unsigned Index); +int FRAMEWIN_GetBorderSize (FRAMEWIN_Handle hObj); +int FRAMEWIN_GetBorderSizeEx(FRAMEWIN_Handle hObj, unsigned Edge); +void FRAMEWIN_GetText (FRAMEWIN_Handle hObj, char * pBuffer, int MaxLen); +int FRAMEWIN_GetTextAlign (FRAMEWIN_Handle hObj); +int FRAMEWIN_GetUserData (FRAMEWIN_Handle hObj, void * pDest, int NumBytes); +int FRAMEWIN_IsMinimized (FRAMEWIN_Handle hObj); +int FRAMEWIN_IsMaximized (FRAMEWIN_Handle hObj); + +/********************************************************************* +* +* Global functions +* +********************************************************************** +*/ +GUI_COLOR FRAMEWIN_GetDefaultBarColor (unsigned Index); +int FRAMEWIN_GetDefaultBorderSize (void); +int FRAMEWIN_GetDefaultTitleHeight(void); +GUI_COLOR FRAMEWIN_GetDefaultClientColor(void); +const GUI_FONT * FRAMEWIN_GetDefaultFont (void); +GUI_COLOR FRAMEWIN_GetDefaultTextColor (unsigned Index); +int FRAMEWIN_OwnerDraw (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); +void FRAMEWIN_SetDefaultBarColor (unsigned Index, GUI_COLOR Color); +void FRAMEWIN_SetDefaultBorderSize (int DefaultBorderSize); +void FRAMEWIN_SetDefaultTitleHeight(int DefaultTitleHeight); +void FRAMEWIN_SetDefaultClientColor(GUI_COLOR Color); +void FRAMEWIN_SetDefaultFont (const GUI_FONT * pFont); +int FRAMEWIN_SetDefaultTextAlign (int TextAlign); +void FRAMEWIN_SetDefaultTextColor (unsigned Index, GUI_COLOR Color); + +/********************************************************************* +* +* Macros for compatibility +* +********************************************************************** +*/ +#define FRAMEWIN_SetDefaultCaptionSize(Height) FRAMEWIN_SetDefaultTitleHeight(Height) +#define FRAMEWIN_GetDefaultCaptionSize() FRAMEWIN_GetDefaultTitleHeight() +#define FRAMEWIN_CreateButton(hObj, Flags, Off, Id) FRAMEWIN_AddButton(hObj, Flags, Off, Id) +#define FRAMEWIN_CreateCloseButton(hObj, Flags, Off) FRAMEWIN_AddCloseButton(hObj, Flags, Off) +#define FRAMEWIN_CreateMaxButton(hObj, Flags, Off) FRAMEWIN_AddMaxButton(hObj, Flags, Off) +#define FRAMEWIN_CreateMinButton(hObj, Flags, Off) FRAMEWIN_AddMinButton(hObj, Flags, Off) + +#if defined(__cplusplus) + } +#endif + +#endif // GUI_WINSUPPORT +#endif // FRAMEWIN_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GRAPH.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GRAPH.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,190 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GRAPH.h +Purpose : GRAPH include +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef GRAPH_H +#define GRAPH_H + +#include "WM.h" +#include "DIALOG_Intern.h" /* Req. for Create indirect data structure */ +#include "WIDGET.h" + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) + extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Defines +* +********************************************************************** +*/ +#define GRAPH_CI_BK 0 +#define GRAPH_CI_BORDER 1 +#define GRAPH_CI_FRAME 2 +#define GRAPH_CI_GRID 3 + +#define GRAPH_SCALE_CF_HORIZONTAL (0 << 0) +#define GRAPH_SCALE_CF_VERTICAL (1 << 0) + +#define GRAPH_SCALE_SF_HORIZONTAL GRAPH_SCALE_CF_HORIZONTAL +#define GRAPH_SCALE_SF_VERTICAL GRAPH_SCALE_CF_VERTICAL + +#define GRAPH_DRAW_FIRST 0 +#define GRAPH_DRAW_AFTER_BORDER 1 +#define GRAPH_DRAW_LAST 2 + +#define GRAPH_ALIGN_RIGHT (0 << 0) +#define GRAPH_ALIGN_LEFT (1 << 0) + +// +// Creation flags (ExFlags) +// +#define GRAPH_CF_GRID_FIXED_X (1 << 0) +#define GRAPH_CF_AVOID_SCROLLBAR_H (1 << 1) +#define GRAPH_CF_AVOID_SCROLLBAR_V (1 << 2) + +// +// Status flags +// +#define GRAPH_SF_AVOID_SCROLLBAR_H GRAPH_CF_AVOID_SCROLLBAR_H +#define GRAPH_SF_AVOID_SCROLLBAR_V GRAPH_CF_AVOID_SCROLLBAR_V + +/********************************************************************* +* +* Public Types +* +********************************************************************** +*/ +typedef WM_HMEM GRAPH_Handle; +typedef WM_HMEM GRAPH_DATA_Handle; +typedef WM_HMEM GRAPH_SCALE_Handle; + +/********************************************************************* +* +* Create functions +* +********************************************************************** +*/ + +GRAPH_Handle GRAPH_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id); +GRAPH_Handle GRAPH_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes); +GRAPH_Handle GRAPH_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); + +GRAPH_DATA_Handle GRAPH_DATA_XY_Create(GUI_COLOR Color, unsigned MaxNumItems, GUI_POINT * pData, unsigned NumItems); +GRAPH_DATA_Handle GRAPH_DATA_YT_Create(GUI_COLOR Color, unsigned MaxNumItems, I16 * pData, unsigned NumItems); +GRAPH_SCALE_Handle GRAPH_SCALE_Create (int Pos, int TextAlign, unsigned Flags, unsigned TickDist); + +/********************************************************************* +* +* The callback ... +* +* Do not call it directly ! It is only to be used from within an +* overwritten callback. +*/ +void GRAPH_Callback(WM_MESSAGE * pMsg); + +/********************************************************************* +* +* Standard member functions +* +********************************************************************** +*/ + +/********************************************************************* +* +* Member functions +* +********************************************************************** +*/ +void GRAPH_AttachData (GRAPH_Handle hObj, GRAPH_DATA_Handle hData); +void GRAPH_AttachScale (GRAPH_Handle hObj, GRAPH_SCALE_Handle hScale); +void GRAPH_DetachData (GRAPH_Handle hObj, GRAPH_DATA_Handle hData); +void GRAPH_DetachScale (GRAPH_Handle hObj, GRAPH_SCALE_Handle hScale); +I32 GRAPH_GetScrollValue (GRAPH_Handle hObj, U8 Coord); +int GRAPH_GetUserData (GRAPH_Handle hObj, void * pDest, int NumBytes); +void GRAPH_SetAutoScrollbar (GRAPH_Handle hObj, U8 Coord, U8 OnOff); +void GRAPH_SetBorder (GRAPH_Handle hObj, unsigned BorderL, unsigned BorderT, unsigned BorderR, unsigned BorderB); +GUI_COLOR GRAPH_SetColor (GRAPH_Handle hObj, GUI_COLOR Color, unsigned Index); +unsigned GRAPH_SetGridFixedX (GRAPH_Handle hObj, unsigned OnOff); +unsigned GRAPH_SetGridOffY (GRAPH_Handle hObj, unsigned Value); +unsigned GRAPH_SetGridVis (GRAPH_Handle hObj, unsigned OnOff); +unsigned GRAPH_SetGridDistX (GRAPH_Handle hObj, unsigned Value); +unsigned GRAPH_SetGridDistY (GRAPH_Handle hObj, unsigned Value); +U8 GRAPH_SetLineStyleH (GRAPH_Handle hObj, U8 Value); +U8 GRAPH_SetLineStyleV (GRAPH_Handle hObj, U8 Value); +void GRAPH_SetLineStyle (GRAPH_Handle hObj, U8 Value); +void GRAPH_SetScrollValue (GRAPH_Handle hObj, U8 Coord, U32 Value); +unsigned GRAPH_SetVSizeX (GRAPH_Handle hObj, unsigned Value); +unsigned GRAPH_SetVSizeY (GRAPH_Handle hObj, unsigned Value); +int GRAPH_SetUserData (GRAPH_Handle hObj, const void * pSrc, int NumBytes); +void GRAPH_SetUserDraw (GRAPH_Handle hObj, void (* pOwnerDraw)(WM_HWIN, int)); + +void GRAPH_DATA_YT_AddValue (GRAPH_DATA_Handle hDataObj, I16 Value); +void GRAPH_DATA_YT_Clear (GRAPH_DATA_Handle hDataObj); +void GRAPH_DATA_YT_Delete (GRAPH_DATA_Handle hDataObj); +void GRAPH_DATA_YT_SetAlign (GRAPH_DATA_Handle hDataObj, int Align); +void GRAPH_DATA_YT_SetOffY (GRAPH_DATA_Handle hDataObj, int Off); +void GRAPH_DATA_YT_MirrorX (GRAPH_DATA_Handle hDataObj, int OnOff); + +void GRAPH_DATA_XY_AddPoint (GRAPH_DATA_Handle hDataObj, GUI_POINT * pPoint); +void GRAPH_DATA_XY_Clear (GRAPH_DATA_Handle hDataObj); +void GRAPH_DATA_XY_Delete (GRAPH_DATA_Handle hDataObj); +unsigned GRAPH_DATA_XY_GetLineVis (GRAPH_DATA_Handle hDataObj); +unsigned GRAPH_DATA_XY_GetPointVis (GRAPH_DATA_Handle hDataObj); +void GRAPH_DATA_XY_SetLineStyle (GRAPH_DATA_Handle hDataObj, U8 LineStyle); +unsigned GRAPH_DATA_XY_SetLineVis (GRAPH_DATA_Handle hDataObj, unsigned OnOff); +void GRAPH_DATA_XY_SetOffX (GRAPH_DATA_Handle hDataObj, int Off); +void GRAPH_DATA_XY_SetOffY (GRAPH_DATA_Handle hDataObj, int Off); +void GRAPH_DATA_XY_SetPenSize (GRAPH_DATA_Handle hDataObj, U8 PenSize); +void GRAPH_DATA_XY_SetPointSize (GRAPH_DATA_Handle hDataObj, unsigned PointSize); +unsigned GRAPH_DATA_XY_SetPointVis (GRAPH_DATA_Handle hDataObj, unsigned OnOff); +void GRAPH_DATA_XY_SetOwnerDraw (GRAPH_DATA_Handle hDataObj, WIDGET_DRAW_ITEM_FUNC * pOwnerDraw); + +void GRAPH_SCALE_Delete (GRAPH_SCALE_Handle hScaleObj); +float GRAPH_SCALE_SetFactor (GRAPH_SCALE_Handle hScaleObj, float Factor); +const GUI_FONT * GRAPH_SCALE_SetFont (GRAPH_SCALE_Handle hScaleObj, const GUI_FONT * pFont); +int GRAPH_SCALE_SetNumDecs (GRAPH_SCALE_Handle hScaleObj, int NumDecs); +int GRAPH_SCALE_SetOff (GRAPH_SCALE_Handle hScaleObj, int Off); +int GRAPH_SCALE_SetPos (GRAPH_SCALE_Handle hScaleObj, int Pos); +GUI_COLOR GRAPH_SCALE_SetTextColor(GRAPH_SCALE_Handle hScaleObj, GUI_COLOR Color); +unsigned GRAPH_SCALE_SetTickDist (GRAPH_SCALE_Handle hScaleObj, unsigned Value); + +#if defined(__cplusplus) + } +#endif + +#endif // GUI_WINSUPPORT +#endif // GRAPH_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUI.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,2219 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUI.h +Purpose : GUI API include file +---------------------------END-OF-HEADER------------------------------ +*/ + +#ifndef GUI_H +#define GUI_H + +#include "GUI_ConfDefaults.h" +#include "GUI_Type.h" +#include "GUI_Version.h" + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Disable string function warning with newer MSVC versions +*/ +#if defined (_MSC_VER) + #if (_MSC_VER > 1200) + #pragma warning( disable : 4996) + #endif +#endif + +/********************************************************************* +* +* Macros, function replacement +*/ +#define GUI_COUNTOF(a) (sizeof(a) / sizeof(a[0])) +#define GUI_MIN(a,b) (((a) < (b)) ? (a) : (b)) +#define GUI_MAX(a,b) (((a) > (b)) ? (a) : (b)) +#define GUI_ZEROFILL(p, Size) (memset(p, 0, Size)) + +/********************************************************************* +* +* Support for multitasking systems (locking) +*/ +typedef struct GUI_CONTEXT GUI_CONTEXT; + +#if !GUI_OS + #define GUI_LOCK() + #define GUI_UNLOCK() + #define GUITASK_INIT() + #define GUITASK_COPY_CONTEXT() +#else + void GUI_Lock(void); + void GUI_Unlock(void); + void GUITASK_Init(void); + void GUITASK_CopyContext(void); + void GUITASK_SetMaxTask(int MaxTask); + GUI_CONTEXT * GUITASK_GetpContext(int Index); + #define GUI_LOCK() GUI_Lock() + #define GUI_UNLOCK() GUI_Unlock() + #define GUITASK_INIT() GUITASK_Init() + #define GUITASK_COPY_CONTEXT() GUITASK_CopyContext() +#endif + +/********************************************************************* +* +* API table of a display driver +*/ +struct GUI_DEVICE_API { + // + // Data + // + int DeviceClassIndex; + // + // Drawing functions + // + void (* pfDrawBitmap )(GUI_DEVICE * pDevice, int x0, int y0, int xsize, int ysize, int BitsPerPixel, int BytesPerLine, const U8 * pData, int Diff, const LCD_PIXELINDEX * pTrans); + void (* pfDrawHLine )(GUI_DEVICE * pDevice, int x0, int y0, int x1); + void (* pfDrawVLine )(GUI_DEVICE * pDevice, int x , int y0, int y1); + void (* pfFillRect )(GUI_DEVICE * pDevice, int x0, int y0, int x1, int y1); + unsigned (* pfGetPixelIndex)(GUI_DEVICE * pDevice, int x, int y); + void (* pfSetPixelIndex)(GUI_DEVICE * pDevice, int x, int y, int ColorIndex); + void (* pfXorPixel )(GUI_DEVICE * pDevice, int x, int y); + // + // Set origin + // + void (* pfSetOrg )(GUI_DEVICE * pDevice, int x, int y); + // + // Request information + // + void (*(* pfGetDevFunc) (GUI_DEVICE ** ppDevice, int Index))(void); + I32 (* pfGetDevProp )(GUI_DEVICE * pDevice, int Index); + void *(* pfGetDevData )(GUI_DEVICE * pDevice, int Index); + void (* pfGetRect )(GUI_DEVICE * pDevice, LCD_RECT * pRect); +}; + +/********************************************************************* +* +* Device classes +*/ +typedef enum { + DEVICE_CLASS_DRIVER = 0, + DEVICE_CLASS_DRIVER_MODIFIER, // Zoom or delta-pixel modifier + DEVICE_CLASS_VNC, + DEVICE_CLASS_SPRITE, + DEVICE_CLASS_MEMDEV, + DEVICE_CLASS_ALPHA, + DEVICE_CLASS_AUTOALPHA, + DEVICE_CLASS_MEASDEV +} DEVICE_CLASS; + +#define GUI_DEVICE_STAYONTOP 1 + +/********************************************************************* +* +* Display drivers +*/ +// +// Addresses +// +extern const GUI_DEVICE_API GUIDRV_Win_API; + +extern const GUI_DEVICE_API GUIDRV_Template_API; + +// +// Macros to be used in configuration files +// +#define GUIDRV_WIN32 &GUIDRV_Win_API + +#if defined(WIN32) && !defined(LCD_SIMCONTROLLER) + + #define GUIDRV_TEMPLATE &GUIDRV_Win_API + +#else + + #define GUIDRV_TEMPLATE &GUIDRV_Template_API + +#endif + +/********************************************************************* +* +* Definition of GUI_DEVICE structure +*/ +struct GUI_DEVICE { + // + // Linking + // + GUI_DEVICE * pNext; + GUI_DEVICE * pPrev; + // + // Data + // + union { + GUI_HMEM hContext; // Handle of payload data like sprite- or memory device context + void * pContext; // Pointer for context data in a fixed block + } u; + // + // API pointers + // + const GUI_DEVICE_API * pDeviceAPI; + const LCD_API_COLOR_CONV * pColorConvAPI; + U16 Flags; + int LayerIndex; +}; + +extern const GUI_DEVICE_API GUI_MEMDEV_DEVICE_1; +extern const GUI_DEVICE_API GUI_MEMDEV_DEVICE_8; +extern const GUI_DEVICE_API GUI_MEMDEV_DEVICE_16; +extern const GUI_DEVICE_API GUI_MEMDEV_DEVICE_32; + +/********************************************************************* +* +* GUI_CONTEXT +* +* This structure is public for one reason only: +* To allow the application to save and restore the context. +*/ +typedef union { + U8 aColorIndex8[2]; + U16 aColorIndex16[2]; + U32 aColorIndex32[2]; +} LCD_COLORINDEX_UNION; + +struct GUI_CONTEXT { + // + // Variables in LCD module + // + LCD_COLORINDEX_UNION uLCD; + LCD_RECT ClipRect; + U8 DrawMode; + U8 SelLayer; + U8 TextStyle; + // + // Variables in GL module + // + GUI_RECT * pClipRect_HL; // High level clip rectangle ... Speed optimization so drawing routines can optimize + U8 PenSize; + U8 PenShape; + U8 LineStyle; + // + // Variables in GUICHAR module + // + const GUI_FONT * pAFont; + I16P LBorder; + I16P DispPosX, DispPosY; + I16P DrawPosX, DrawPosY; + I16P TextMode, TextAlign; + GUI_COLOR Color, BkColor; // Required only when changing devices and for speed opt (caching) + // + // Pointer to color indices + // + LCD_PIXELINDEX * LCD_pBkColorIndex; + LCD_PIXELINDEX * LCD_pColorIndex; + LCD_PIXELINDEX * LCD_pAColorIndex; + // + // Variables in WM module + // + #if GUI_WINSUPPORT + const GUI_RECT * WM__pUserClipRect; + GUI_HWIN hAWin; + int xOff, yOff; + U8 WM_IsActive; + #endif + // + // Array of pointers to device chains + // + //GUI_DEVICE * apDevice[GUI_NUM_LAYERS]; + GUI_DEVICE * apDriver[GUI_NUM_LAYERS]; + // + // Variables in MEMDEV module (with memory devices only) + // + GUI_HMEM hDevData; + // + // Variables in Anitaliasing module + // + const tLCD_HL_APIList * pLCD_HL; // Required to reroute drawing (HLine & Pixel) to the AA module + U8 AA_Factor; + U8 AA_HiResEnable; + void (* AA_pfSetPixelAA)(int x, int y, U8 Intens); // Function to be used for drawing a single pixel +}; + +/* Rename GUI_SaveContext in order to avoid crashes if wrong GUIConf is used */ +#if (GUI_WINSUPPORT == 1) + #define GUI_SaveContext GUI_SaveContext_W +#else + #define GUI_SaveContext GUI_SaveContext_ +#endif + +/********************************************************************* +* +* Device management +*/ +GUI_DEVICE * GUI_DEVICE_Create (const GUI_DEVICE_API * pDeviceAPI, const LCD_API_COLOR_CONV * pColorConvAPI, U16 Flags, int LayerIndex); +GUI_DEVICE * GUI_DEVICE_CreateAndLink(const GUI_DEVICE_API * pDeviceAPI, const LCD_API_COLOR_CONV * pColorConvAPI, U16 Flags, int LayerIndex); +void GUI_DEVICE_Delete (GUI_DEVICE * pDevice); +int GUI_DEVICE_Link (GUI_DEVICE * pDevice); +void GUI_DEVICE_Unlink (GUI_DEVICE * pDevice); +GUI_DEVICE * GUI_DEVICE__GetpDriver (int LayerIndex); +GUI_DEVICE * GUI_DEVICE__GetpDevice (int LayerIndex, int DeviceClass); + +GUI_DEVICE * GUI_DEVICE_UnlinkTaskDevices(void); +void GUI_DEVICE_LinkDevices (GUI_DEVICE * pDevice); + +/********************************************************************* +* +* GUI_DIRTYDEVICE +*/ +typedef struct { + void * pData; // Pointer to first pixel + int x0, y0; // Coordinates of the upper left pixel + int xSize, ySize; // Size of dirty rectangle + int LineOff; // Virtual xSize in pixels + int BytesPerPixel; // Number of bytes required per pixel +} GUI_DIRTYDEVICE_INFO; + +int GUI_DIRTYDEVICE_Fetch (int LayerIndex, GUI_DIRTYDEVICE_INFO * pInfo); +int GUI_DIRTYDEVICE_Delete(int LayerIndex); +int GUI_DIRTYDEVICE_Create(int LayerIndex); + +/********************************************************************* +* +* General routines +*/ +int GUI_Init (void); +void GUI_Exit (void); +void GUI_SetDefaultFont (const GUI_FONT * pFont); +void GUI_SetDefault (void); +GUI_DRAWMODE GUI_SetDrawMode (GUI_DRAWMODE dm); +const char * GUI_GetVersionString (void); +void GUI_SaveContext ( GUI_CONTEXT * pContext); +void GUI_RestoreContext (const GUI_CONTEXT * pContext); +void GUI_SetScreenSizeX (int xSize); +void GUI_SetScreenSizeY (int ySize); +int GUI_GetScreenSizeX (void); +int GUI_GetScreenSizeY (void); +const GUI_RECT * GUI_SetClipRect (const GUI_RECT * pRect); + +void MainTask (void); + +/********************************************************************* +* +* Rectangle helper functions +*/ +int GUI_RectsIntersect(const GUI_RECT * pr0, const GUI_RECT * pr1); +void GUI_MoveRect (GUI_RECT * pRect, int x, int y); +void GUI_MergeRect (GUI_RECT * pDest, const GUI_RECT * pr0, const GUI_RECT * pr1); +int GUI__IntersectRects(GUI_RECT * pDest, const GUI_RECT * pr0, const GUI_RECT * pr1); +void GUI__IntersectRect (GUI_RECT * pDest, const GUI_RECT * pr0); +void GUI__ReduceRect (GUI_RECT * pDest, const GUI_RECT * pRect, int Dist); + +/********************************************************************* +* +* Misc helper functions +*/ +I32 GUI__ATan2(I32 x, I32 y, I32 * ph); +I32 GUI__ASinHQ(I32 SinHQ); +int GUI__CompactPixelIndices (LCD_PIXELINDEX * pBuffer, int NumPixels, int BitsPerPixel); +int GUI__CompactPixelIndicesEx(LCD_PIXELINDEX * pBuffer, int NumPixels, int BitsPerPixel, const LCD_API_COLOR_CONV * pColorConvAPI); +void GUI__Config(void); +I32 GUI__CosHQ(I32 Ang1000); +int GUI__DivideRound (int a, int b); +I32 GUI__DivideRound32 (I32 a, I32 b); +void GUI__ExpandPixelIndices (void * pBuffer, int NumPixels, int BitsPerPixel); +void GUI__ExpandPixelIndicesEx (void * pBuffer, int NumPixels, int BitsPerPixel, const LCD_API_COLOR_CONV * pColorConvAPI); +void GUI__memcpy(void * pDest, const void * pSrc, int NumBytes); +int GUI__SetText(GUI_HMEM * phText, const char * s); +I32 GUI__SinHQ(I32 Ang1000); +I32 GUI__sqrt32(I32 Square); +void GUI__DrawTwinArc2(int xl, int xr, int y0, int r, GUI_COLOR ColorR0, GUI_COLOR ColorR1, GUI_COLOR ColorFill); +void GUI__DrawTwinArc4(int x0, int y0, int x1, int y1, int r, GUI_COLOR ColorR0, GUI_COLOR ColorR1, GUI_COLOR ColorFill); +void GUI__FillTrippleArc(int x0, int y0, int Size, GUI_COLOR ColorR0, GUI_COLOR ColorR1, GUI_COLOR ColorR2, GUI_COLOR ColorFill); +void GUI__RegisterExit(GUI_REGISTER_EXIT * pRegisterExit); + +/********************************************************************* +* +* Get / Set Attributes +*/ +GUI_COLOR GUI_GetBkColor (void); +int GUI_GetBkColorIndex(void); +GUI_COLOR GUI_GetColor (void); +int GUI_GetColorIndex (void); +U8 GUI_GetLineStyle (void); +U8 GUI_GetPenSize (void); +U8 GUI_GetPenShape (void); +unsigned GUI_GetPixelIndex (int x, int y); + +void GUI_SetBkColor (GUI_COLOR); +void GUI_SetColor (GUI_COLOR); +void GUI_SetBkColorIndex(int Index); +void GUI_SetColorIndex(int Index); + +U8 GUI_SetPenSize (U8 Size); +U8 GUI_SetPenShape (U8 Shape); +U8 GUI_SetLineStyle (U8 Style); + +/* Get/Set Character used as decimal point (usually '.' or ',') */ +char GUI_GetDecChar(void); +char GUI_SetDecChar(char c); + +/********************************************************************* +* +* Color / Index related functions +*/ +int GUI_Color2Index(GUI_COLOR color); +GUI_COLOR GUI_Color2VisColor(GUI_COLOR color); +char GUI_ColorIsAvailable(GUI_COLOR color); +GUI_COLOR GUI_Index2Color(int Index); +U32 GUI_CalcColorDist (GUI_COLOR Color0, GUI_COLOR Color1); +U32 GUI_CalcVisColorError(GUI_COLOR color); + +/********************************************************************* +* +* Error handler +*/ +void GUI_SetOnErrorFunc(void (* pFunc)(const char * s)); + +/********************************************************************* +* +* Logging (for debugging primarily) +*/ +void GUI_Log (const char * s); +void GUI_Log1 (const char * s, I32 p0); +void GUI_Log2 (const char * s, I32 p0, I32 p1); +void GUI_Log3 (const char * s, I32 p0, I32 p1, I32 p2); +void GUI_Log4 (const char * s, I32 p0, I32 p1, I32 p2,I32 p3); +void GUI_Warn (const char * s); +void GUI_Warn1 (const char * s, I32 p0); +void GUI_Warn2 (const char * s, I32 p0, I32 p1); +void GUI_Warn3 (const char * s, I32 p0, I32 p1, I32 p2); +void GUI_Warn4 (const char * s, I32 p0, I32 p1, I32 p2, I32 p3); +void GUI_ErrorOut (const char * s); +void GUI_ErrorOut1(const char * s, I32 p0); +void GUI_ErrorOut2(const char * s, I32 p0, I32 p1); +void GUI_ErrorOut3(const char * s, I32 p0, I32 p1, I32 p2); +void GUI_ErrorOut4(const char * s, I32 p0, I32 p1, I32 p2, I32 p3); + +/********************************************************************* +* +* 2d - GL +*/ +void GUI_Clear (void); +void GUI_ClearRect (int x0, int y0, int x1, int y1); +void GUI_ClearRectEx (const GUI_RECT * pRect); +void GUI_CopyRect (int x0, int y0, int x1, int y1, int dx, int dy); +void GUI_DrawArc (int x0, int y0, int rx, int ry, int a0, int a1); +void GUI_DrawBitmap (const GUI_BITMAP * pBM, int x0, int y0); +void GUI_DrawBitmapMag (const GUI_BITMAP * pBM, int x0, int y0, int XMul, int YMul); +void GUI_DrawBitmapEx (const GUI_BITMAP * pBM, int x0, int y0, int xCenter, int yCenter, int xMag, int yMag); +void GUI_DrawBitmapExp (int x0, int y0, int XSize, int YSize, int XMul, int YMul, int BitsPerPixel, int BytesPerLine, const U8 * pData, const GUI_LOGPALETTE * pPal); +void GUI_DrawBitmapHWAlpha(const GUI_BITMAP * pBM, int x0, int y0); +void GUI_DrawCircle (int x0, int y0, int r); +void GUI_DrawEllipse (int x0, int y0, int rx, int ry); +void GUI_DrawGradientH (int x0, int y0, int x1, int y1, GUI_COLOR Color0, GUI_COLOR Color1); +void GUI_DrawGradientV (int x0, int y0, int x1, int y1, GUI_COLOR Color0, GUI_COLOR Color1); +void GUI_DrawGradientRoundedH(int x0, int y0, int x1, int y1, int rd, GUI_COLOR Color0, GUI_COLOR Color1); +void GUI_DrawGradientRoundedV(int x0, int y0, int x1, int y1, int rd, GUI_COLOR Color0, GUI_COLOR Color1); +void GUI_DrawGraph (I16 * pay, int NumPoints, int x0, int y0); +void GUI_DrawGraphEx (I16 * pay, int NumPoints, int x0, int y0, int Numerator, int Denominator, int MirrorX); +void GUI_DrawHLine (int y0, int x0, int x1); +void GUI_DrawLine (int x0, int y0, int x1, int y1); +void GUI_DrawLineRel (int dx, int dy); +void GUI_DrawLineTo (int x, int y); +void GUI_DrawPie (int x0, int y0, int r, int a0, int a1, int Type); +void GUI_DrawPixel (int x, int y); +void GUI_DrawPoint (int x, int y); +void GUI_DrawPolygon (const GUI_POINT * pPoints, int NumPoints, int x0, int y0); +void GUI_DrawPolyLine (const GUI_POINT * pPoints, int NumPoints, int x0, int y0); +void GUI_DrawFocusRect (const GUI_RECT * pRect, int Dist); +void GUI_DrawRect (int x0, int y0, int x1, int y1); +void GUI_DrawRectEx (const GUI_RECT * pRect); +void GUI_DrawRoundedFrame (int x0, int y0, int x1, int y1, int r, int w); +void GUI_DrawRoundedRect (int x0, int y0, int x1, int y1, int r); +void GUI_DrawVLine (int x0, int y0, int y1); +void GUI_FillCircle (int x0, int y0, int r); +void GUI_FillEllipse (int x0, int y0, int rx, int ry); +void GUI_FillPolygon (const GUI_POINT * pPoints, int NumPoints, int x0, int y0); +void GUI_FillRect (int x0, int y0, int x1, int y1); +void GUI_FillRectEx (const GUI_RECT * pRect); +void GUI_FillRoundedFrame (int x0, int y0, int x1, int y1, int r, int w); +void GUI_FillRoundedRect (int x0, int y0, int x1, int y1, int r); +void GUI_FillRoundedRectB (int x0, int y0, int x1, int y1, int r); +void GUI_FillRoundedRectT (int x0, int y0, int x1, int y1, int r); +void GUI_GetClientRect (GUI_RECT * pRect); +void GUI_InvertRect (int x0, int y0, int x1, int y1); +void GUI_MoveRel (int dx, int dy); +void GUI_MoveTo (int x, int y); + +/********************************************************************* +* +* Graphic file support +*/ +typedef int GUI_GET_DATA_FUNC(void * p, const U8 ** ppData, unsigned NumBytes, U32 Off); + +/********************************************************************* +* +* GIF file support +*/ +int GUI_GIF_Draw (const void * pGIF, U32 NumBytes, int x0, int y0); +int GUI_GIF_DrawEx (GUI_GET_DATA_FUNC * pfGetData, void * p, int x0, int y0); +int GUI_GIF_DrawSub (const void * pGIF, U32 NumBytes, int x0, int y0, int Index); +int GUI_GIF_DrawSubEx (GUI_GET_DATA_FUNC * pfGetData, void * p, int x0, int y0, int Index); +int GUI_GIF_DrawSubScaled (const void * pGIF, U32 NumBytes, int x0, int y0, int Index, int Num, int Denom); +int GUI_GIF_DrawSubScaledEx(GUI_GET_DATA_FUNC * pfGetData, void * p, int x0, int y0, int Index, int Num, int Denom); +int GUI_GIF_GetComment (const void * pGIF, U32 NumBytes, U8 * pBuffer, int MaxSize, int Index); +int GUI_GIF_GetCommentEx (GUI_GET_DATA_FUNC * pfGetData, void * p, U8 * pBuffer, int MaxSize, int Index); +int GUI_GIF_GetImageInfo (const void * pGIF, U32 NumBytes, GUI_GIF_IMAGE_INFO * pInfo, int Index); +int GUI_GIF_GetImageInfoEx (GUI_GET_DATA_FUNC * pfGetData, void * p, GUI_GIF_IMAGE_INFO * pInfo, int Index); +int GUI_GIF_GetInfo (const void * pGIF, U32 NumBytes, GUI_GIF_INFO * pInfo); +int GUI_GIF_GetInfoEx (GUI_GET_DATA_FUNC * pfGetData, void * p, GUI_GIF_INFO * pInfo); +int GUI_GIF_GetXSize (const void * pGIF); +int GUI_GIF_GetXSizeEx (GUI_GET_DATA_FUNC * pfGetData, void * p); +int GUI_GIF_GetYSize (const void * pGIF); +int GUI_GIF_GetYSizeEx (GUI_GET_DATA_FUNC * pfGetData, void * p); +int GUI_GIF_SetFillTrans (int OnOff); + +/********************************************************************* +* +* BMP file support +*/ +int GUI_BMP_Draw (const void * pFileData, int x0, int y0); +int GUI_BMP_DrawEx (GUI_GET_DATA_FUNC * pfGetData, void * p, int x0, int y0); +int GUI_BMP_DrawScaled (const void * pFileData, int x0, int y0, int Num, int Denom); +int GUI_BMP_DrawScaledEx(GUI_GET_DATA_FUNC * pfGetData, void * p, int x0, int y0, int Num, int Denom); +int GUI_BMP_GetXSize (const void * pFileData); +int GUI_BMP_GetXSizeEx (GUI_GET_DATA_FUNC * pfGetData, void * p); +int GUI_BMP_GetYSize (const void * pFileData); +int GUI_BMP_GetYSizeEx (GUI_GET_DATA_FUNC * pfGetData, void * p); +void GUI_BMP_EnableAlpha (void); +void GUI_BMP_DisableAlpha(void); + +/********************************************************************* +* +* PNG file support +*/ +int GUI_PNG_Draw (const void * pFileData, int DataSize, int x0, int y0); +int GUI_PNG_DrawEx (GUI_GET_DATA_FUNC * pfGetData, void * p, int x0, int y0); +int GUI_PNG_GetXSize (const void * pFileData, int FileSize); +int GUI_PNG_GetXSizeEx(GUI_GET_DATA_FUNC * pfGetData, void * p); +int GUI_PNG_GetYSize (const void * pFileData, int FileSize); +int GUI_PNG_GetYSizeEx(GUI_GET_DATA_FUNC * pfGetData, void * p); + +/********************************************************************* +* +* JPEG file support +*/ +typedef struct { + int XSize; + int YSize; +} GUI_JPEG_INFO; + +int GUI_JPEG_Draw (const void * pFileData, int DataSize, int x0, int y0); +int GUI_JPEG_DrawEx (GUI_GET_DATA_FUNC * pfGetData, void * p, int x0, int y0); +int GUI_JPEG_DrawScaled (const void * pFileData, int DataSize, int x0, int y0, int Num, int Denom); +int GUI_JPEG_DrawScaledEx(GUI_GET_DATA_FUNC * pfGetData, void * p, int x0, int y0, int Num, int Denom); +int GUI_JPEG_GetInfo (const void * pFileData, int DataSize, GUI_JPEG_INFO * pInfo); +int GUI_JPEG_GetInfoEx (GUI_GET_DATA_FUNC * pfGetData, void * p, GUI_JPEG_INFO * pInfo); + +/********************************************************************* +* +* MOVIE file support +*/ +#define GUI_MOVIE_NOTIFICATION_PREDRAW 0 // Immediately before frame is drawn +#define GUI_MOVIE_NOTIFICATION_POSTDRAW 1 // Immediately after a frame is drawn +#define GUI_MOVIE_NOTIFICATION_START 2 // Send when start playing a movie +#define GUI_MOVIE_NOTIFICATION_STOP 3 // Movie has stopped +#define GUI_MOVIE_NOTIFICATION_DELETE 4 // Movie has been deleted + +typedef GUI_HMEM GUI_MOVIE_HANDLE; + +typedef void GUI_MOVIE_FUNC(GUI_MOVIE_HANDLE hMovie, int Notification, U32 CurrentFrame); + +typedef struct { + int xSize; // X-size of images + int ySize; // Y-size of images + int msPerFrame; // Default duration of 1 frame + U32 NumFrames; // Number of frames +} GUI_MOVIE_INFO; + +GUI_MOVIE_HANDLE GUI_MOVIE_Create (const void * pFileData, U32 FileSize, GUI_MOVIE_FUNC * pfNotify); +GUI_MOVIE_HANDLE GUI_MOVIE_CreateEx (GUI_GET_DATA_FUNC * pfGetData, void * pParam, GUI_MOVIE_FUNC * pfNotify); +int GUI_MOVIE_Delete (GUI_MOVIE_HANDLE hMovie); +U32 GUI_MOVIE_GetFrameIndex(GUI_MOVIE_HANDLE hMovie); +int GUI_MOVIE_GetInfo (const void * pFileData, U32 FileSize, GUI_MOVIE_INFO * pInfo); +int GUI_MOVIE_GetInfoEx (GUI_GET_DATA_FUNC * pfGetData, void * pParam, GUI_MOVIE_INFO * pInfo); +int GUI_MOVIE_GetPos (GUI_MOVIE_HANDLE hMovie, int * pxPos, int * pyPos, int * pxSize, int * pySize); +int GUI_MOVIE_GotoFrame (GUI_MOVIE_HANDLE hMovie, U32 Frame); +int GUI_MOVIE_Pause (GUI_MOVIE_HANDLE hMovie); +int GUI_MOVIE_Play (GUI_MOVIE_HANDLE hMovie); +int GUI_MOVIE_SetPeriod (GUI_MOVIE_HANDLE hMovie, unsigned Period); +int GUI_MOVIE_SetPos (GUI_MOVIE_HANDLE hMovie, int xPos, int yPos); +int GUI_MOVIE_Show (GUI_MOVIE_HANDLE hMovie, int xPos, int yPos, int DoLoop); + +/********************************************************************* +* +* Cursor routines +*/ +#define GUI_CURSOR_SHOW 0 +#define GUI_CURSOR_HIDE 1 + +typedef struct { + const GUI_BITMAP * pBitmap; + int xHot; + int yHot; +} GUI_CURSOR; + +typedef struct { + const GUI_BITMAP ** ppBm; + int xHot; + int yHot; + unsigned Period; + const unsigned * pPeriod; + int NumItems; +} GUI_CURSOR_ANIM; + +#if GUI_SUPPORT_CURSOR + int GUI_CURSOR_GetState (void); + int GUI_CURSOR_GetStateEx (int Layer); + void GUI_CURSOR_Hide (void); + void GUI_CURSOR_HideEx (int Layer); + const GUI_CURSOR * GUI_CURSOR_Select (const GUI_CURSOR * pCursor); + const GUI_CURSOR * GUI_CURSOR_SelectEx (const GUI_CURSOR * pCursor, int Layer); + int GUI_CURSOR_SelectAnim (const GUI_CURSOR_ANIM * pCursorAnim); + int GUI_CURSOR_SelectAnimEx (const GUI_CURSOR_ANIM * pCursorAnim, int LayerIndex); + int GUI_CURSOR_SetBitmap (const GUI_BITMAP * pBM); + int GUI_CURSOR_SetBitmapEx (const GUI_BITMAP * pBM, int Layer); + void GUI_CURSOR_SetPosition (int x, int y); + void GUI_CURSOR_SetPositionEx(int xNewPos, int yNewPos, int Layer); + void GUI_CURSOR_Show (void); + void GUI_CURSOR_ShowEx (int Layer); + GUI_HSPRITE GUI_CURSOR__GetSpriteEx (int LayerIndex, int * pxPos, int * pyPos); + void GUI_CURSOR__SetSpriteEx (GUI_HSPRITE hSprite, const GUI_CURSOR * pCursor, int LayerIndex); +#else + #define GUI_CURSOR_Show(); + #define GUI_CURSOR_Clear(); +#endif + +/********************************************************************* +* +* Sprite support +*/ +#define GUI_SPRITE_CF_STAYONTOP (1 << 0) +#define GUI_SPRITE_CF_SHOW (1 << 1) + +#define GUI_SPRITE_SHOW 0 +#define GUI_SPRITE_HIDE 1 + +GUI_HSPRITE GUI_SPRITE__CreateEx (const GUI_BITMAP * pBM, int x, int y, int Layer, U16 Flags); /* Not to be documented, only used by cursor modul */ +void GUI_SPRITE__SetCallback (GUI_HSPRITE hSprite, GUI_HMEM hContext, void (* pCB)(GUI_HSPRITE, int)); +GUI_HSPRITE GUI_SPRITE_Create (const GUI_BITMAP * pBM, int x, int y); +GUI_HSPRITE GUI_SPRITE_CreateAnim (const GUI_BITMAP ** ppBm, int x, int y, unsigned Period, const unsigned * pPeriod, int NumItems); +GUI_HSPRITE GUI_SPRITE_CreateEx (const GUI_BITMAP * pBM, int x, int y, int Layer); +GUI_HSPRITE GUI_SPRITE_CreateExAnim (const GUI_BITMAP ** ppBm, int x, int y, unsigned Period, const unsigned * pPeriod, int NumItems, int LayerIndex); +GUI_HSPRITE GUI_SPRITE_CreateHidden (const GUI_BITMAP * pBM, int x, int y); +GUI_HSPRITE GUI_SPRITE_CreateHiddenEx (const GUI_BITMAP * pBM, int x, int y, int Layer); +void GUI_SPRITE_Delete (GUI_HSPRITE hSprite); +int GUI_SPRITE_GetState (GUI_HSPRITE hSprite); +void GUI_SPRITE_Hide (GUI_HSPRITE hSprite); +int GUI_SPRITE_SetBitmap (GUI_HSPRITE hSprite, const GUI_BITMAP * pBM); +int GUI_SPRITE_SetBitmapAndPosition(GUI_HSPRITE hSprite, const GUI_BITMAP * pBM, int x, int y); +int GUI_SPRITE_SetLoop (GUI_HSPRITE hSprite, int OnOff); +void GUI_SPRITE_SetPosition (GUI_HSPRITE hSprite, int x, int y); +int GUI_SPRITE_StartAnim (GUI_HSPRITE hSprite); +int GUI_SPRITE_StopAnim (GUI_HSPRITE hSprite); +void GUI_SPRITE_Show (GUI_HSPRITE hSprite); + +/********************************************************************* +* +* Cursors and their bitmaps +*/ +extern GUI_CONST_STORAGE GUI_CURSOR GUI_CursorArrowS, GUI_CursorArrowSI; +extern GUI_CONST_STORAGE GUI_CURSOR GUI_CursorArrowM, GUI_CursorArrowMI; +extern GUI_CONST_STORAGE GUI_CURSOR GUI_CursorArrowL, GUI_CursorArrowLI; +extern GUI_CONST_STORAGE GUI_CURSOR GUI_CursorCrossS, GUI_CursorCrossSI; +extern GUI_CONST_STORAGE GUI_CURSOR GUI_CursorCrossM, GUI_CursorCrossMI; +extern GUI_CONST_STORAGE GUI_CURSOR GUI_CursorCrossL, GUI_CursorCrossLI; +extern GUI_CONST_STORAGE GUI_CURSOR GUI_CursorHeaderM, GUI_CursorHeaderMI; + +extern GUI_CONST_STORAGE GUI_BITMAP GUI_BitmapArrowS, GUI_BitmapArrowSI; +extern GUI_CONST_STORAGE GUI_BITMAP GUI_BitmapArrowM, GUI_BitmapArrowMI; +extern GUI_CONST_STORAGE GUI_BITMAP GUI_BitmapArrowL, GUI_BitmapArrowLI; +extern GUI_CONST_STORAGE GUI_BITMAP GUI_BitmapCrossS, GUI_BitmapCrossSI; +extern GUI_CONST_STORAGE GUI_BITMAP GUI_BitmapCrossM, GUI_BitmapCrossMI; +extern GUI_CONST_STORAGE GUI_BITMAP GUI_BitmapCrossL, GUI_BitmapCrossLI; + +extern GUI_CONST_STORAGE GUI_CURSOR_ANIM GUI_CursorAnimHourglassM; + +/********************************************************************* +* +* Wrap modes +*/ +typedef enum { GUI_WRAPMODE_NONE, GUI_WRAPMODE_WORD, GUI_WRAPMODE_CHAR } GUI_WRAPMODE; + +/********************************************************************* +* +* Text related routines +*/ +void GUI_DispCEOL (void); +void GUI_DispChar (U16 c); +void GUI_DispCharAt (U16 c, I16P x, I16P y); +void GUI_DispChars (U16 c, int Cnt); +void GUI_DispNextLine (void); +void GUI_DispString (const char * s); +void GUI_DispStringAt (const char * s, int x, int y); +void GUI_DispStringAtCEOL (const char * s, int x, int y); +void GUI_DispStringHCenterAt (const char * s, int x, int y); +void GUI__DispStringInRect (const char * s, GUI_RECT * pRect, int TextAlign, int MaxNumChars); +void GUI_DispStringInRect (const char * s, GUI_RECT * pRect, int TextAlign); +#if GUI_SUPPORT_ROTATION + void GUI_DispStringInRectEx (const char * s, GUI_RECT * pRect, int TextAlign, int MaxLen, const GUI_ROTATION * pLCD_Api); +#endif +void GUI_DispStringInRectMax (const char * s, GUI_RECT * pRect, int TextAlign, int MaxLen); /* Not to be doc. */ +void GUI_DispStringInRectWrap (const char * s, GUI_RECT * pRect, int TextAlign, GUI_WRAPMODE WrapMode); /* Not to be doc. */ +void GUI_DispStringLen (const char * s, int Len); +void GUI_GetTextExtend (GUI_RECT* pRect, const char * s, int Len); +int GUI_GetYAdjust (void); +int GUI_GetDispPosX (void); +int GUI_GetDispPosY (void); +const GUI_FONT * GUI_GetFont(void); +int GUI_GetCharDistX (U16 c); +int GUI_GetCharDistXEx (U16 c, int * pSizeX); +int GUI_GetStringDistX (const char * s); +GUI_DRAWMODE GUI_GetDrawMode (void); +int GUI_GetFontDistY (void); +int GUI_GetFontSizeY (void); +void GUI_GetFontInfo (const GUI_FONT * pFont, GUI_FONTINFO * pfi); +void GUI_GetOrg (int * px, int * py); +int GUI_GetYSizeOfFont (const GUI_FONT * pFont); +int GUI_GetYDistOfFont (const GUI_FONT * pFont); +int GUI_GetTextAlign (void); +int GUI_GetTextMode (void); +char GUI_IsInFont (const GUI_FONT * pFont, U16 c); +int GUI_SetTextAlign (int Align); +int GUI_SetTextMode (int Mode); +char GUI_SetTextStyle (char Style); +int GUI_SetLBorder (int x); +const GUI_FONT * GUI_SetFont(const GUI_FONT * pNewFont); +char GUI_GotoXY (int x, int y); +char GUI_GotoX (int x); +char GUI_GotoY (int y); +int GUI_WrapGetNumLines (const char * pText, int xSize, GUI_WRAPMODE WrapMode); + +int GUI_GetLeadingBlankCols (U16 c); +int GUI_GetTrailingBlankCols(U16 c); + + +/********************************************************************* +* +* System independent fonts (SIF) +*/ +void GUI_SIF_CreateFont(const void * pFontData, GUI_FONT * pFont, const GUI_SIF_TYPE * pFontType); +void GUI_SIF_DeleteFont(GUI_FONT * pFont); + +/********************************************************************* +* +* External binary fonts (XBF) +*/ +int GUI_XBF_CreateFont(GUI_FONT * pFont, GUI_XBF_DATA * pXBF, const GUI_XBF_TYPE * pFontType, GUI_XBF_GET_DATA_FUNC * pfGetData, void * pVoid); +void GUI_XBF_DeleteFont(GUI_FONT * pFont); + +/********************************************************************* +* +* TrueType support (TTF) +*/ +int GUI_TTF_CreateFont (GUI_FONT * pFont, GUI_TTF_CS * pCS); +int GUI_TTF_CreateFontAA (GUI_FONT * pFont, GUI_TTF_CS * pCS); +void GUI_TTF_DestroyCache (void); +void GUI_TTF_Done (void); +int GUI_TTF_GetFamilyName(GUI_FONT * pFont, char * pBuffer, int NumBytes); +int GUI_TTF_GetStyleName (GUI_FONT * pFont, char * pBuffer, int NumBytes); +void GUI_TTF_SetCacheSize (unsigned MaxFaces, unsigned MaxSizes, U32 MaxBytes); + +/********************************************************************* +* +* Resource file support +*/ +int GUI_LANG_GetNumItems (int IndexLang); +const char * GUI_LANG_GetText (int IndexText); +int GUI_LANG_GetTextBuffered (int IndexText, char * pBuffer, int SizeOfBuffer); +int GUI_LANG_GetTextBufferedEx(int IndexText, int IndexLang, char * pBuffer, int SizeOfBuffer); +const char * GUI_LANG_GetTextEx (int IndexText, int IndexLang); +int GUI_LANG_LoadCSV (U8 * pFileData, U32 FileSize); +int GUI_LANG_LoadCSVEx (GUI_GET_DATA_FUNC * pfGetData, void * p); +int GUI_LANG_LoadText (U8 * pFileData, U32 FileSize, int IndexLang); +int GUI_LANG_LoadTextEx (GUI_GET_DATA_FUNC * pfGetData, void * p, int IndexLang); +int GUI_LANG_SetLang (int IndexLang); +unsigned GUI_LANG_SetMaxNumLang (unsigned MaxNumLang); +U16 GUI_LANG_SetSep (U16 Sep); + +/********************************************************************* +* +* Unicode support +*/ +int GUI_UC_ConvertUC2UTF8 (const U16 * s, int Len, char * pBuffer, int BufferSize); +int GUI_UC_ConvertUTF82UC (const char * s, int Len, U16 * pBuffer, int BufferSize); +int GUI_UC_Encode (char * s, U16 Char); +int GUI_UC_GetCharSize (const char * s); +U16 GUI_UC_GetCharCode (const char * s); +void GUI_UC_SetEncodeNone (void); +void GUI_UC_SetEncodeUTF8 (void); +int GUI_UC_EnableBIDI (int OnOff); + +void GUI_UC_DispString(const U16 * s); +void GUI_UC2DB (U16 Code, U8 * pOut); +U16 GUI_DB2UC (U8 Byte0, U8 Byte1); + +/********************************************************************* +* +* Drawing of binary, decimal and hexadecimal values +*/ +void GUI_DispBin (U32 v, U8 Len); +void GUI_DispBinAt(U32 v, I16P x, I16P y, U8 Len); +void GUI_DispDec (I32 v, U8 Len); +void GUI_DispDecAt (I32 v, I16P x, I16P y, U8 Len); +void GUI_DispDecMin(I32 v); +void GUI_DispDecShift(I32 v, U8 Len, U8 Shift); +void GUI_DispDecSpace(I32 v, U8 MaxDigits); +void GUI_DispHex (U32 v, U8 Len); +void GUI_DispHexAt(U32 v, I16P x, I16P y, U8 Len); +void GUI_DispSDec(I32 v, U8 Len); +void GUI_DispSDecShift(I32 v, U8 Len, U8 Shift); + +/********************************************************************* +* +* Drawing of floating point values +*/ +void GUI_DispFloat (float v, char Len); +void GUI_DispFloatFix (float v, char Len, char Fract); +void GUI_DispFloatMin (float v, char Fract); +void GUI_DispSFloatFix(float v, char Len, char Fract); +void GUI_DispSFloatMin(float v, char Fract); + +/********************************************************************* +* +* Dynamic memory management +*/ +#if !defined(GUI_ALLOC_ALLOC) + /* diagnostics */ + GUI_ALLOC_DATATYPE GUI_ALLOC_GetNumFreeBlocks(void); + GUI_ALLOC_DATATYPE GUI_ALLOC_GetNumFreeBytes (void); + GUI_ALLOC_DATATYPE GUI_ALLOC_GetNumUsedBlocks(void); + GUI_ALLOC_DATATYPE GUI_ALLOC_GetNumUsedBytes (void); +#else + #define GUI_ALLOC_GetNumFreeBlocks() 0 + #define GUI_ALLOC_GetNumFreeBytes() 0 + #define GUI_ALLOC_GetNumUsedBlocks() 0 + #define GUI_ALLOC_GetNumUsedBytes() 0 +#endif + +GUI_HMEM GUI_ALLOC_AllocInit (const void * pInitData, GUI_ALLOC_DATATYPE Size); +GUI_HMEM GUI_ALLOC_AllocNoInit (GUI_ALLOC_DATATYPE size); +GUI_HMEM GUI_ALLOC_AllocZero (GUI_ALLOC_DATATYPE size); +void GUI_ALLOC_AssignMemory (void * p, U32 NumBytes); +void GUI_ALLOC_Free (GUI_HMEM hMem); +void GUI_ALLOC_FreeFixedBlock (void * p); +void GUI_ALLOC_FreePtrArray (GUI_HMEM * pArray, int NumElems); +void GUI_ALLOC_FreePtr (GUI_HMEM * phMem); +void * GUI_ALLOC_GetFixedBlock (GUI_ALLOC_DATATYPE Size); +GUI_ALLOC_DATATYPE GUI_ALLOC_GetMaxSize (void); +GUI_ALLOC_DATATYPE GUI_ALLOC_GetSize (GUI_HMEM hMem); +void * GUI_ALLOC_h2p (GUI_HMEM hMem); +GUI_HMEM GUI_ALLOC_p2h (void * p); +void GUI_ALLOC_Init (void); +void GUI_ALLOC_Lock (void); +void * GUI_ALLOC_LockH (GUI_HMEM hMem); +GUI_HMEM GUI_ALLOC_Realloc (GUI_HMEM hOld, int NewSize); +GUI_ALLOC_DATATYPE GUI_ALLOC_RequestSize (void); +void GUI_ALLOC_SetAvBlockSize (U32 BlockSize); +void GUI_ALLOC_Unlock (void); +void * GUI_ALLOC_UnlockH (void ** pp); +int GUI_ALLOC_SetMaxPercentage(int MaxPercentage); + + +/********************************************************************* +* +* Memory devices: GUI_MEMDEV +*/ +#define GUI_MEMDEV_HASTRANS 0 +#define GUI_MEMDEV_NOTRANS (1<<0) + +typedef GUI_HMEM GUI_MEMDEV_Handle; +typedef void GUI_CALLBACK_VOID_P (void * p); +typedef int GUI_ANIMATION_CALLBACK_FUNC(int TimeRem, void * pVoid); + +extern GUI_ANIMATION_CALLBACK_FUNC * GUI_MEMDEV__pCbAnimation; +extern void * GUI_MEMDEV__pVoid; + +typedef struct { + GUI_RECT rView, rPrev; + char FirstCall; +} GUI_AUTODEV; + +typedef struct { + char DrawFixed; + char IsMeasurement; +} GUI_AUTODEV_INFO; + +int GUI_MEMDEV_CreateAuto(GUI_AUTODEV * pAutoDev); +void GUI_MEMDEV_DeleteAuto(GUI_AUTODEV * pAutoDev); +int GUI_MEMDEV_DrawAuto (GUI_AUTODEV * pAutoDev, GUI_AUTODEV_INFO * pAutoDevInfo, GUI_CALLBACK_VOID_P * pfDraw, void * pData); + +/* Create a memory device which is compatible to the selected LCD */ +GUI_MEMDEV_Handle GUI_MEMDEV_Create (int x0, int y0, int xSize, int ySize); +GUI_MEMDEV_Handle GUI_MEMDEV_CreateEx (int x0, int y0, int xSize, int ySize, int Flags); +GUI_MEMDEV_Handle GUI_MEMDEV_CreateFixed (int x0, int y0, int xSize, int ySize, int Flags, + const GUI_DEVICE_API * pDeviceAPI, + const LCD_API_COLOR_CONV * pColorConvAPI); +GUI_MEMDEV_Handle GUI_MEMDEV_CreateFixed32(int x0, int y0, int xSize, int ySize); + +void GUI_MEMDEV_Clear (GUI_MEMDEV_Handle hMem); +int GUI_MEMDEV_ClearAlpha (GUI_MEMDEV_Handle hMemData, GUI_MEMDEV_Handle hMemMask); +void GUI_MEMDEV_CopyFromLCD (GUI_MEMDEV_Handle hMem); +void GUI_MEMDEV_CopyFromLCDAA (GUI_MEMDEV_Handle hMem); +void GUI_MEMDEV_CopyToLCD (GUI_MEMDEV_Handle hMem); +void GUI_MEMDEV_CopyToLCDAA (GUI_MEMDEV_Handle hMem); +void GUI_MEMDEV_CopyToLCDAt (GUI_MEMDEV_Handle hMem, int x, int y); +int GUI_MEMDEV_CompareWithLCD (GUI_MEMDEV_Handle hMem, int * px, int * py, int * pExp, int * pAct); +void GUI_MEMDEV_Delete (GUI_MEMDEV_Handle MemDev); +void GUI_MEMDEV_DrawPerspectiveX (GUI_MEMDEV_Handle hMem, int x, int y, int h0, int h1, int dx, int dy); +int GUI_MEMDEV_GetXPos (GUI_MEMDEV_Handle hMem); +int GUI_MEMDEV_GetXSize (GUI_MEMDEV_Handle hMem); +int GUI_MEMDEV_GetYPos (GUI_MEMDEV_Handle hMem); +int GUI_MEMDEV_GetYSize (GUI_MEMDEV_Handle hMem); +void GUI_MEMDEV_MarkDirty (GUI_MEMDEV_Handle hMem, int x0, int y0, int x1, int y1); +void GUI_MEMDEV_ReduceYSize (GUI_MEMDEV_Handle hMem, int YSize); +void GUI_MEMDEV_Rotate (GUI_MEMDEV_Handle hSrc, GUI_MEMDEV_Handle hDst, int dx, int dy, int a, int Mag); +void GUI_MEMDEV_RotateHR (GUI_MEMDEV_Handle hSrc, GUI_MEMDEV_Handle hDst, I32 dx, I32 dy, int a, int Mag); +void GUI_MEMDEV__Rotate (GUI_MEMDEV_Handle hSrc, GUI_MEMDEV_Handle hDst, int dx, int dy, int a, int Mag, U32 AndMask); +void GUI_MEMDEV__RotateHR (GUI_MEMDEV_Handle hSrc, GUI_MEMDEV_Handle hDst, I32 dx, I32 dy, int a, int Mag, U32 AndMask); +void GUI_MEMDEV_RotateHQ (GUI_MEMDEV_Handle hSrc, GUI_MEMDEV_Handle hDst, int dx, int dy, int a, int Mag); +void GUI_MEMDEV_RotateHQHR (GUI_MEMDEV_Handle hSrc, GUI_MEMDEV_Handle hDst, I32 dx, I32 dy, int a, int Mag); +void GUI_MEMDEV_RotateHQT (GUI_MEMDEV_Handle hSrc, GUI_MEMDEV_Handle hDst, int dx, int dy, int a, int Mag); +GUI_MEMDEV_Handle GUI_MEMDEV_Select (GUI_MEMDEV_Handle hMem); /* Select (activate) a particular memory device. */ +void GUI_MEMDEV_SetOrg (GUI_MEMDEV_Handle hMem, int x0, int y0); +void GUI_MEMDEV_WriteAt (GUI_MEMDEV_Handle hMem, int x, int y); +void GUI_MEMDEV_Write (GUI_MEMDEV_Handle hMem); +void GUI_MEMDEV_WriteAlphaAt (GUI_MEMDEV_Handle hMem, int Alpha, int x, int y); +void GUI_MEMDEV_WriteAlpha (GUI_MEMDEV_Handle hMem, int Alpha); +void GUI_MEMDEV_WriteExAt (GUI_MEMDEV_Handle hMem, int x, int y, int xMag, int yMag, int Alpha); +void GUI_MEMDEV_WriteEx (GUI_MEMDEV_Handle hMem, int xMag, int yMag, int Alpha); +int GUI_MEMDEV_Draw (GUI_RECT * pRect, GUI_CALLBACK_VOID_P * pfDraw, void * pData, int NumLines, int Flags); +void* GUI_MEMDEV_GetDataPtr (GUI_MEMDEV_Handle hMem); +void GUI_MEMDEV_SetColorConv (GUI_MEMDEV_Handle hMem, const LCD_API_COLOR_CONV * pColorConvAPI); +const LCD_API_COLOR_CONV * GUI_MEMDEV_GetColorConv(GUI_MEMDEV_Handle hMemDev); +int GUI_MEMDEV_GetBitsPerPixel (GUI_MEMDEV_Handle hMemDev); +int GUI_MEMDEV_FadeDevices (GUI_MEMDEV_Handle hMem0, GUI_MEMDEV_Handle hMem1, int Period); +void GUI_MEMDEV_SerializeBMP (GUI_MEMDEV_Handle hDev, GUI_CALLBACK_VOID_U8_P * pfSerialize, void * p); +void GUI_MEMDEV_SetAnimationCallback(GUI_ANIMATION_CALLBACK_FUNC * pCbAnimation, void * pVoid); +void GUI_MEMDEV__FadeDevice (GUI_MEMDEV_Handle hMemWin, GUI_MEMDEV_Handle hMemBk, GUI_MEMDEV_Handle hMemDst, U8 Intens); +void GUI_MEMDEV__FadeDeviceEx (GUI_MEMDEV_Handle hMemWin, GUI_MEMDEV_Handle hMemBk, GUI_MEMDEV_Handle hMemDst, U8 Intens, int xPosWin, int yPosWin); +int GUI_MEMDEV_PunchOutDevice (GUI_MEMDEV_Handle hMemData, GUI_MEMDEV_Handle hMemMask); +void GUI_SelectLCD(void); + +GUI_MEMDEV_Handle GUI_MEMDEV_CreateBlurredDevice32 (GUI_MEMDEV_Handle hMem, U8 Depth); +GUI_MEMDEV_Handle GUI_MEMDEV_CreateBlurredDevice32HQ(GUI_MEMDEV_Handle hMem, U8 Depth); +GUI_MEMDEV_Handle GUI_MEMDEV_CreateBlurredDevice32LQ(GUI_MEMDEV_Handle hMem, U8 Depth); +void GUI_MEMDEV_SetBlurHQ (void); +void GUI_MEMDEV_SetBlurLQ (void); +int GUI_MEMDEV_BlendColor32 (GUI_MEMDEV_Handle hMem, U32 BlendColor, U8 BlendIntens); + +/********************************************************************* +* +* Alpha blending +*/ +typedef struct { + U32 UserAlpha; +} GUI_ALPHA_STATE; + +#define GUI_MAKE_ALPHA(Alpha, Color) ((U32)(((U32)Alpha << 24) | Color)) + +unsigned GUI_EnableAlpha (unsigned OnOff); +U32 GUI_RestoreUserAlpha (GUI_ALPHA_STATE * pAlphaState); +unsigned GUI_SetAlpha (U8 Alpha); +U32 GUI_SetUserAlpha (GUI_ALPHA_STATE * pAlphaState, U32 UserAlpha); +void GUI_SetFuncAlphaBlending(void (* pfAlphaBlending)(LCD_COLOR *, LCD_COLOR *, LCD_COLOR *, U32)); +void GUI_SetFuncMixColors (LCD_COLOR (* pFunc)(LCD_COLOR Color, LCD_COLOR BkColor, U8 Intens)); +void GUI_SetFuncMixColorsBulk(void (* pFunc)(U32 * pFG, U32 * pBG, U32 * pDst, unsigned OffFG, unsigned OffBG, unsigned OffDest, unsigned xSize, unsigned ySize, U8 Intens)); + +/********************************************************************* +* +* Multi layer support +*/ +unsigned GUI_SelectLayer(unsigned Index); +unsigned GUI_GetSelLayer(void); + +int GUI_SetLayerPosEx (unsigned Index, int xPos, int yPos); +int GUI_SetLayerSizeEx (unsigned Index, int xSize, int ySize); +int GUI_SetLayerVisEx (unsigned Index, int OnOff); +int GUI_SetLayerAlphaEx(unsigned Index, int Alpha); +void GUI_GetLayerPosEx (unsigned Index, int * pxPos, int * pyPos); + +void GUI_AssignCursorLayer(unsigned Index, unsigned CursorLayer); +unsigned GUI_GetCursorLayer (unsigned Index); + +/********************************************************************* +* +* Multiple buffers and display origin +*/ +void GUI_SetOrg(int x, int y); + +void GUI_MULTIBUF_Begin (void); +void GUI_MULTIBUF_BeginEx (int LayerIndex); +void GUI_MULTIBUF_End (void); +void GUI_MULTIBUF_EndEx (int LayerIndex); +void GUI_MULTIBUF_Config (int NumBuffers); +void GUI_MULTIBUF_ConfigEx (int LayerIndex, int NumBuffers); +void GUI_MULTIBUF_Confirm (int Index); +void GUI_MULTIBUF_ConfirmEx (int LayerIndex, int BufferIndex); +int GUI_MULTIBUF_GetNumBuffers (void); +int GUI_MULTIBUF_GetNumBuffersEx(int LayerIndex); +void GUI_MULTIBUF_UseSingleBuffer(void); + +/********************************************************************* +* +* Display orientation +*/ +/********************************************************************* +* +* GUI_ORIENTATION_API +*/ +typedef struct { + void (* pfDrawBitmap )(GUI_DEVICE * pDevice, int x0, int y0, int xsize, int ysize, int BitsPerPixel, int BytesPerLine, const U8 * pData, int Diff, const LCD_PIXELINDEX * pTrans); + void (* pfDrawHLine )(GUI_DEVICE * pDevice, int x0, int y0, int x1); + void (* pfDrawVLine )(GUI_DEVICE * pDevice, int x , int y0, int y1); + void (* pfFillRect )(GUI_DEVICE * pDevice, int x0, int y0, int x1, int y1); + unsigned (* pfGetPixelIndex)(GUI_DEVICE * pDevice, int x, int y); + void (* pfSetPixelIndex)(GUI_DEVICE * pDevice, int x, int y, int ColorIndex); + void (* pfXorPixel )(GUI_DEVICE * pDevice, int x, int y); + int BytesPerPixel; +} GUI_ORIENTATION_API; + +extern const GUI_ORIENTATION_API GUI_OrientationAPI_C0; +extern const GUI_ORIENTATION_API GUI_OrientationAPI_C8; +extern const GUI_ORIENTATION_API GUI_OrientationAPI_C16; +extern const GUI_ORIENTATION_API GUI_OrientationAPI_C32; + +#define GUI_ORIENTATION_C0 &GUI_OrientationAPI_C0 +#define GUI_ORIENTATION_C8 &GUI_OrientationAPI_C8 +#define GUI_ORIENTATION_C16 &GUI_OrientationAPI_C16 +#define GUI_ORIENTATION_C32 &GUI_OrientationAPI_C32 + +int GUI_SetOrientation (int Orientation); +int GUI_SetOrientationEx (int Orientation, int LayerIndex); +int GUI_SetOrientationExCached(int Orientation, int LayerIndex, const GUI_ORIENTATION_API * pAPI); + +/********************************************************************* +* +* Measure device: GUI_MEASDEV +*/ +typedef GUI_HMEM GUI_MEASDEV_Handle; + +GUI_MEASDEV_Handle GUI_MEASDEV_Create (void); +void GUI_MEASDEV_Delete (GUI_MEASDEV_Handle hMemDev); +void GUI_MEASDEV_Select (GUI_MEASDEV_Handle hMem); +void GUI_MEASDEV_GetRect(GUI_MEASDEV_Handle hMem, GUI_RECT * pRect); +void GUI_MEASDEV_ClearRect(GUI_MEASDEV_Handle hMem); + +/********************************************************************* +* +* Polygon helpers +*/ +void GUI_RotatePolygon (GUI_POINT * pDest, const GUI_POINT * pSrc, int NumPoints, float Angle); +void GUI_MagnifyPolygon(GUI_POINT * pDest, const GUI_POINT * pSrc, int NumPoints, int Mag); +void GUI_EnlargePolygon(GUI_POINT * pDest, const GUI_POINT * pSrc, int NumPoints, int Len); + +/********************************************************************* +* +* Streamed bitmaps +*/ +#define GUI_BITMAPSTREAM_GET_BUFFER 1 +#define GUI_BITMAPSTREAM_RELEASE_BUFFER 2 +#define GUI_BITMAPSTREAM_MODIFY_PALETTE 3 + +#define DECLARE_CREATE_FROM_STREAM(ID) int GUI_CreateBitmapFromStream##ID(GUI_BITMAP * pBMP, GUI_LOGPALETTE * pPAL, const void * p); + +DECLARE_CREATE_FROM_STREAM(IDX) +DECLARE_CREATE_FROM_STREAM(RLE4) +DECLARE_CREATE_FROM_STREAM(RLE8) +DECLARE_CREATE_FROM_STREAM(565) +DECLARE_CREATE_FROM_STREAM(M565) +DECLARE_CREATE_FROM_STREAM(555) +DECLARE_CREATE_FROM_STREAM(M555) +DECLARE_CREATE_FROM_STREAM(A565) +DECLARE_CREATE_FROM_STREAM(AM565) +DECLARE_CREATE_FROM_STREAM(A555) +DECLARE_CREATE_FROM_STREAM(AM555) +DECLARE_CREATE_FROM_STREAM(RLE16) +DECLARE_CREATE_FROM_STREAM(RLEM16) +DECLARE_CREATE_FROM_STREAM(24) +DECLARE_CREATE_FROM_STREAM(Alpha) +DECLARE_CREATE_FROM_STREAM(RLEAlpha) +DECLARE_CREATE_FROM_STREAM(RLE32) +DECLARE_CREATE_FROM_STREAM(444_12) +DECLARE_CREATE_FROM_STREAM(M444_12) +DECLARE_CREATE_FROM_STREAM(444_12_1) +DECLARE_CREATE_FROM_STREAM(M444_12_1) +DECLARE_CREATE_FROM_STREAM(444_16) +DECLARE_CREATE_FROM_STREAM(M444_16) + +int GUI_CreateBitmapFromStream (GUI_BITMAP * pBMP, GUI_LOGPALETTE * pPAL, const void * p); +void GUI_DrawStreamedBitmap (const void * p, int x, int y); +void GUI_DrawStreamedBitmapAuto (const void * p, int x, int y); +int GUI_DrawStreamedBitmapEx (GUI_GET_DATA_FUNC * pfGetData, const void * p, int x, int y); +int GUI_DrawStreamedBitmapExAuto (GUI_GET_DATA_FUNC * pfGetData, const void * p, int x, int y); +int GUI_DrawStreamedBitmap555Ex (GUI_GET_DATA_FUNC * pfGetData, const void * p, int x, int y); +int GUI_DrawStreamedBitmapM555Ex (GUI_GET_DATA_FUNC * pfGetData, const void * p, int x, int y); +int GUI_DrawStreamedBitmap565Ex (GUI_GET_DATA_FUNC * pfGetData, const void * p, int x, int y); +int GUI_DrawStreamedBitmapM565Ex (GUI_GET_DATA_FUNC * pfGetData, const void * p, int x, int y); +int GUI_DrawStreamedBitmapA555Ex (GUI_GET_DATA_FUNC * pfGetData, const void * p, int x, int y); +int GUI_DrawStreamedBitmapAM555Ex(GUI_GET_DATA_FUNC * pfGetData, const void * p, int x, int y); +int GUI_DrawStreamedBitmapA565Ex (GUI_GET_DATA_FUNC * pfGetData, const void * p, int x, int y); +int GUI_DrawStreamedBitmapAM565Ex(GUI_GET_DATA_FUNC * pfGetData, const void * p, int x, int y); +int GUI_DrawStreamedBitmap24Ex (GUI_GET_DATA_FUNC * pfGetData, const void * p, int x, int y); +void GUI_GetStreamedBitmapInfo (const void * p, GUI_BITMAPSTREAM_INFO * pInfo); +int GUI_GetStreamedBitmapInfoEx (GUI_GET_DATA_FUNC * pfGetData, const void * p, GUI_BITMAPSTREAM_INFO * pInfo); +void GUI_SetStreamedBitmapHook (GUI_BITMAPSTREAM_CALLBACK pfStreamedBitmapHook); + +void LCD__RLE4_SetFunc (GUI_GET_DATA_FUNC * pfGetData, void * pVoid, U32 Off, const LCD_LOGPALETTE * pLogPal); +void LCD__RLE8_SetFunc (GUI_GET_DATA_FUNC * pfGetData, void * pVoid, U32 Off, const LCD_LOGPALETTE * pLogPal); +void LCD__RLE16_SetFunc(GUI_GET_DATA_FUNC * pfGetData, void * pVoid, U32 Off); +void LCD__RLE32_SetFunc(GUI_GET_DATA_FUNC * pfGetData, void * pVoid, U32 Off); + +/********************************************************************* +* +* BMP-export +*/ +void GUI_BMP_Serialize (GUI_CALLBACK_VOID_U8_P * pfSerialize, void * p); +void GUI_BMP_SerializeEx (GUI_CALLBACK_VOID_U8_P * pfSerialize, int x0, int y0, int xSize, int ySize, void * p); +void GUI_BMP_SerializeExBpp(GUI_CALLBACK_VOID_U8_P * pfSerialize, int x0, int y0, int xSize, int ySize, void * p, int BitsPerPixel); + +/********************************************************************* +* +* Time / execution related routines +*/ +void GUI_Delay (int Period); +GUI_TIMER_TIME GUI_GetTime(void); +int GUI_Exec(void); /* Execute all jobs ... Return 0 if nothing was done. */ +int GUI_Exec1(void); /* Execute one job ... Return 0 if nothing was done. */ + +/********************************************************************* +* +* MessageBox +*/ +int GUI_MessageBox (const char * sMessage, const char * sCaption, int Flags); +#define GUI_MESSAGEBOX_CF_MOVEABLE (1 << 0) +#define GUI_MESSAGEBOX_CF_MODAL (1 << 1) + +#define GUI_MB_OK 20 +#define GUI_MB_WARNING 21 + +/********************************************************************* +* +* GUI_TIMER module +*/ +#define GUI_TIMER_CF_WINDOW (1 << 0) +#define GUI_TIMER_CF_CURSOR (1 << 1) + +typedef GUI_HMEM GUI_TIMER_HANDLE; + +typedef struct { + GUI_TIMER_TIME Time; + U32 Context; + GUI_TIMER_HANDLE hTimer; +} GUI_TIMER_MESSAGE; + +typedef void GUI_TIMER_CALLBACK(/*const*/ GUI_TIMER_MESSAGE* pTM); + +GUI_TIMER_HANDLE GUI_TIMER_Create (GUI_TIMER_CALLBACK * cb, GUI_TIMER_TIME Time, U32 Context, U16 Flags); +void GUI_TIMER_Delete (GUI_TIMER_HANDLE hObj); + +/* Methods changing properties */ +GUI_TIMER_TIME GUI_TIMER_GetPeriod(GUI_TIMER_HANDLE hObj); +void GUI_TIMER_SetPeriod(GUI_TIMER_HANDLE hObj, GUI_TIMER_TIME Period); +void GUI_TIMER_SetTime (GUI_TIMER_HANDLE hObj, GUI_TIMER_TIME Period); +void GUI_TIMER_SetDelay (GUI_TIMER_HANDLE hObj, GUI_TIMER_TIME Delay); +void GUI_TIMER_Restart (GUI_TIMER_HANDLE hObj); +int GUI_TIMER_GetFlag (GUI_TIMER_HANDLE hObj, int Flag); /* Not to be documented */ +int GUI_TIMER_Exec (void); + +/********************************************************************* +* +* Anti Aliasing +*/ +#define GUI_AA_TRANS 0 // Foreground color mixed up with current content of framebuffer +#define GUI_AA_NOTRANS 1 // Foreground color mixed up with current background color + +void GUI_AA_DisableHiRes (void); +void GUI_AA_EnableHiRes (void); +int GUI_AA_GetFactor (void); +void GUI_AA_SetFactor (int Factor); +void GUI_AA_DrawArc (int x0, int y0, int rx, int ry, int a0, int a1); +void GUI_AA_DrawLine (int x0, int y0, int x1, int y1); +void GUI_AA_DrawPolyOutline (const GUI_POINT * pSrc, int NumPoints, int Thickness, int x, int y); +void GUI_AA_DrawPolyOutlineEx(const GUI_POINT * pSrc, int NumPoints, int Thickness, int x, int y, GUI_POINT * pBuffer); +void GUI_AA_DrawRoundedRect (int x0, int y0, int x1, int y1, int r); +void GUI_AA_DrawRoundedRectEx(GUI_RECT * pRect, int r); +void GUI_AA_FillCircle (int x0, int y0, int r); +void GUI_AA_FillPolygon (GUI_POINT * pPoints, int NumPoints, int x0, int y0); +void GUI_AA_FillRoundedRect (int x0, int y0, int x1, int y1, int r); +void GUI_AA_FillRoundedRectEx(GUI_RECT * pRect, int r); +int GUI_AA_PreserveTrans (int OnOff); +int GUI_AA_SetDrawMode (int Mode); + +/********************************************************************* +* +* Keyboard +*/ +/* Message layer */ +void GUI_StoreKeyMsg(int Key, int Pressed); +void GUI_SendKeyMsg (int Key, int Pressed); +int GUI_PollKeyMsg (void); +void GUI_GetKeyState(GUI_KEY_STATE * pState); + +/* Application layer */ +int GUI_GetKey(void); +int GUI_WaitKey(void); +void GUI_StoreKey(int c); +void GUI_ClearKeyBuffer(void); + +/********************************************************************* +* +* Task synchronization +*/ +void GUI_WaitEvent (void); +void GUI_SignalEvent (void); +void GUI_SetSignalEventFunc (GUI_SIGNAL_EVENT_FUNC pfSignalEvent); +void GUI_SetWaitEventFunc (GUI_WAIT_EVENT_FUNC pfWaitEvent); +void GUI_SetWaitEventTimedFunc(GUI_WAIT_EVENT_TIMED_FUNC pfWaitEventTimed); + +/********************************************************************* +* +* Joystick, generic +*/ +void GUI_JOYSTICK_StoreState(const GUI_PID_STATE * pState); + +/********************************************************************* +* +* PID (Pointer input device ... mouse/touch) +*/ +void GUI_PID_StoreState (const GUI_PID_STATE * pState); +int GUI_PID_GetState ( GUI_PID_STATE * pState); +void GUI_PID_GetCurrentState( GUI_PID_STATE * pState); +int GUI_PID_IsEmpty (void); +int GUI_PID_IsPressed (void); + +/********************************************************************* +* +* Mouse, generic +*/ +int GUI_MOUSE_GetState ( GUI_PID_STATE * pState); +void GUI_MOUSE_StoreState(const GUI_PID_STATE * pState); + +/********************************************************************* +* +* TOUCH screen, generic +*/ +int GUI_TOUCH_GetState (GUI_PID_STATE * pState); +void GUI_TOUCH_GetUnstable (int * px, int * py); /* for diagnostics only */ +void GUI_TOUCH_SetLayer (int Layer); +void GUI_TOUCH_StoreState (int x, int y); +void GUI_TOUCH_StoreStateEx (const GUI_PID_STATE * pState); +void GUI_TOUCH_StoreUnstable(int x, int y); + +/********************************************************************* +* +* Mouse, PS2 driver +*/ +void GUI_MOUSE_DRIVER_PS2_Init(void); /* optional */ +void GUI_MOUSE_DRIVER_PS2_OnRx(unsigned char Data); + +/********************************************************************* +* +* TOUCH screen, analog driver +*/ +void GUI_TOUCH_Exec (void); +int GUI_TOUCH_Calibrate (int Coord, int Log0, int Log1, int Phys0, int Phys1); +void GUI_TOUCH_SetDefaultCalibration(void); +int GUI_TOUCH_GetxPhys (void); /* for diagnostics only */ +int GUI_TOUCH_GetyPhys (void); /* for diagnostics only */ +void GUI_TOUCH_GetCalData (int Coord, int * pMin, int * pMax); +void GUI_TOUCH_SetOrientation (unsigned Orientation); +void GUI_TOUCH_SetOrientationPhys (unsigned Orientation); + +/********************************************************************* +* +* TOUCH: imports +* +* Please note: The following functions are required by the module. +* They need to be part of your application software (or rather, part +* of the hardware-layer of your software). +*/ +void GUI_TOUCH_X_ActivateX(void); +void GUI_TOUCH_X_ActivateY(void); +void GUI_TOUCH_X_Disable (void); +int GUI_TOUCH_X_MeasureX (void); +int GUI_TOUCH_X_MeasureY (void); + +/********************************************************************* +* +* GUI_X_ +* +* Externals, to be defined by application +* +* The externals defined below should be defined by the +* application. They are per default contained in the module +* GUI_X.c. +* Note that a lot if not all of these are not required in most target +* systems. +* For this module, samples are available for configurations +* with or without operating system. +*/ + +// +// Configuration +// +void GUI_X_Config(void); +void GUI_X_Init (void); + +// +// Timing routines +// +GUI_TIMER_TIME GUI_X_GetTime(void); +void GUI_X_Delay (int Period); + +// +// Multitask routines - required only if multitasking is used (#define GUI_OS 1) +// +void GUI_X_Unlock (void); +void GUI_X_Lock (void); +U32 GUI_X_GetTaskId(void); +void GUI_X_InitOS (void); + +// +// Event driving (optional with multitasking) +// +void GUI_X_ExecIdle (void); +void GUI_X_WaitEvent (void); +void GUI_X_WaitEventTimed(int Period); +void GUI_X_SignalEvent (void); + +// +// Recording (logs/warnings and errors) - required only for higher levels +// +void GUI_X_Log (const char * s); +void GUI_X_Warn (const char * s); +void GUI_X_ErrorOut(const char * s); + +/********************************************************************* +* +* Constants for fonts and bitmaps +*/ +extern const GUI_BITMAP_METHODS GUI_BitmapMethodsRLE4; +extern const GUI_BITMAP_METHODS GUI_BitmapMethodsRLE4Ex; +extern const GUI_BITMAP_METHODS GUI_BitmapMethodsRLE8; +extern const GUI_BITMAP_METHODS GUI_BitmapMethodsRLE8Ex; +extern const GUI_BITMAP_METHODS GUI_BitmapMethodsRLE16; +extern const GUI_BITMAP_METHODS GUI_BitmapMethodsRLE16Ex; +extern const GUI_BITMAP_METHODS GUI_BitmapMethodsRLEM16; +extern const GUI_BITMAP_METHODS GUI_BitmapMethodsRLEM16Ex; +extern const GUI_BITMAP_METHODS GUI_BitmapMethodsRLE32; +extern const GUI_BITMAP_METHODS GUI_BitmapMethodsRLE32Ex; +extern const GUI_BITMAP_METHODS GUI_BitmapMethodsRLEAlpha; + +extern const GUI_BITMAP_METHODS GUI_BitmapMethods444_12; +extern const GUI_BITMAP_METHODS GUI_BitmapMethodsM444_12; +extern const GUI_BITMAP_METHODS GUI_BitmapMethods444_12_1; +extern const GUI_BITMAP_METHODS GUI_BitmapMethodsM444_12_1; +extern const GUI_BITMAP_METHODS GUI_BitmapMethods444_16; +extern const GUI_BITMAP_METHODS GUI_BitmapMethodsM444_16; +extern const GUI_BITMAP_METHODS GUI_BitmapMethods555; +extern const GUI_BITMAP_METHODS GUI_BitmapMethodsM555; +extern const GUI_BITMAP_METHODS GUI_BitmapMethods565; +extern const GUI_BITMAP_METHODS GUI_BitmapMethodsM565; +extern const GUI_BITMAP_METHODS GUI_BitmapMethods24; +extern const GUI_BITMAP_METHODS GUI_BitmapMethods888; +extern const GUI_BITMAP_METHODS GUI_BitmapMethodsM888; +extern const GUI_BITMAP_METHODS GUI_BitmapMethods8888; +extern const GUI_BITMAP_METHODS GUI_BitmapMethodsA565; +extern const GUI_BITMAP_METHODS GUI_BitmapMethodsAM565; +extern const GUI_BITMAP_METHODS GUI_BitmapMethodsA555; +extern const GUI_BITMAP_METHODS GUI_BitmapMethodsAM555; + +#define GUI_COMPRESS_RLE4 0 +#define GUI_COMPRESS_RLE8 0 + +#define GUI_DRAW_RLE4 &GUI_BitmapMethodsRLE4 /* Method table ! */ +#define GUI_DRAW_RLE8 &GUI_BitmapMethodsRLE8 /* Method table ! */ +#define GUI_DRAW_RLE16 &GUI_BitmapMethodsRLE16 /* Method table ! */ +#define GUI_DRAW_RLEM16 &GUI_BitmapMethodsRLEM16 /* Method table ! */ +#define GUI_DRAW_RLE32 &GUI_BitmapMethodsRLE32 /* Method table ! */ +#define GUI_DRAW_RLEALPHA &GUI_BitmapMethodsRLEAlpha /* Method table ! */ + +#define GUI_DRAW_BMP444_12 &GUI_BitmapMethods444_12 /* Method table ! */ +#define GUI_DRAW_BMPM444_12 &GUI_BitmapMethodsM444_12 /* Method table ! */ +#define GUI_DRAW_BMP444_12_1 &GUI_BitmapMethods444_12_1 /* Method table ! */ +#define GUI_DRAW_BMPM444_12_1 &GUI_BitmapMethodsM444_12_1 /* Method table ! */ +#define GUI_DRAW_BMP444_16 &GUI_BitmapMethods444_16 /* Method table ! */ +#define GUI_DRAW_BMPM444_16 &GUI_BitmapMethodsM444_16 /* Method table ! */ +#define GUI_DRAW_BMP555 &GUI_BitmapMethods555 /* Method table ! */ +#define GUI_DRAW_BMPM555 &GUI_BitmapMethodsM555 /* Method table ! */ +#define GUI_DRAW_BMP565 &GUI_BitmapMethods565 /* Method table ! */ +#define GUI_DRAW_BMPM565 &GUI_BitmapMethodsM565 /* Method table ! */ +#define GUI_DRAW_BMP24 &GUI_BitmapMethods24 /* Method table ! */ +#define GUI_DRAW_BMP888 &GUI_BitmapMethods888 /* Method table ! */ +#define GUI_DRAW_BMPM888 &GUI_BitmapMethodsM888 /* Method table ! */ +#define GUI_DRAW_BMP8888 &GUI_BitmapMethods8888 /* Method table ! */ +#define GUI_DRAW_BMPA555 &GUI_BitmapMethodsA555 /* Method table ! */ +#define GUI_DRAW_BMPAM555 &GUI_BitmapMethodsAM555 /* Method table ! */ +#define GUI_DRAW_BMPA565 &GUI_BitmapMethodsA565 /* Method table ! */ +#define GUI_DRAW_BMPAM565 &GUI_BitmapMethodsAM565 /* Method table ! */ + +extern const tGUI_SIF_APIList GUI_SIF_APIList_Prop; +extern const tGUI_SIF_APIList GUI_SIF_APIList_Prop_Ext; +extern const tGUI_SIF_APIList GUI_SIF_APIList_Prop_Frm; +extern const tGUI_SIF_APIList GUI_SIF_APIList_Prop_AA2; +extern const tGUI_SIF_APIList GUI_SIF_APIList_Prop_AA4; +extern const tGUI_SIF_APIList GUI_SIF_APIList_Prop_AA2_EXT; +extern const tGUI_SIF_APIList GUI_SIF_APIList_Prop_AA4_EXT; + +extern const tGUI_XBF_APIList GUI_XBF_APIList_Prop; +extern const tGUI_XBF_APIList GUI_XBF_APIList_Prop_Ext; +extern const tGUI_XBF_APIList GUI_XBF_APIList_Prop_Frm; +extern const tGUI_XBF_APIList GUI_XBF_APIList_Prop_AA2_Ext; +extern const tGUI_XBF_APIList GUI_XBF_APIList_Prop_AA4_Ext; + +/********************************************************************* +* +* GUI_KEY_... +* +* These ID values are basically meant to be used with widgets +* Note that we have chosen the values to be close to existing +* "standards", so do not change them unless forced to. +* +*/ +#define GUI_KEY_BACKSPACE 8 /* ASCII: BACKSPACE Crtl-H */ +#define GUI_KEY_TAB 9 /* ASCII: TAB Crtl-I */ +#define GUI_KEY_BACKTAB 10 +#define GUI_KEY_ENTER 13 /* ASCII: ENTER Crtl-M */ +#define GUI_KEY_LEFT 16 +#define GUI_KEY_UP 17 +#define GUI_KEY_RIGHT 18 +#define GUI_KEY_DOWN 19 +#define GUI_KEY_HOME 23 +#define GUI_KEY_END 24 +#define GUI_KEY_SHIFT 25 +#define GUI_KEY_CONTROL 26 +#define GUI_KEY_ESCAPE 27 /* ASCII: ESCAPE 0x1b */ +#define GUI_KEY_INSERT 29 +#define GUI_KEY_DELETE 30 +#define GUI_KEY_SPACE 32 +#define GUI_KEY_PGUP 33 +#define GUI_KEY_PGDOWN 34 + +#define GUI_KEY_F1 40 +#define GUI_KEY_F2 41 + +/********************************************************************* +* +* Dialog item IDs +* +* The IDs below are arbitrary values. They just have to be unique +* within the dialog. +* +* If you use your own Ids, we recommend to use values above GUI_ID_USER. +*/ +#define GUI_ID_OK 1 +#define GUI_ID_CANCEL 2 +#define GUI_ID_YES 3 +#define GUI_ID_NO 4 +#define GUI_ID_CLOSE 5 +#define GUI_ID_HELP 6 +#define GUI_ID_MAXIMIZE 7 +#define GUI_ID_MINIMIZE 8 + +#define GUI_ID_VSCROLL 0xFE +#define GUI_ID_HSCROLL 0xFF + +#define GUI_ID_EDIT0 0x100 +#define GUI_ID_EDIT1 0x101 +#define GUI_ID_EDIT2 0x102 +#define GUI_ID_EDIT3 0x103 +#define GUI_ID_EDIT4 0x104 +#define GUI_ID_EDIT5 0x105 +#define GUI_ID_EDIT6 0x106 +#define GUI_ID_EDIT7 0x107 +#define GUI_ID_EDIT8 0x108 +#define GUI_ID_EDIT9 0x109 + +#define GUI_ID_LISTBOX0 0x110 +#define GUI_ID_LISTBOX1 0x111 +#define GUI_ID_LISTBOX2 0x112 +#define GUI_ID_LISTBOX3 0x113 +#define GUI_ID_LISTBOX4 0x114 +#define GUI_ID_LISTBOX5 0x115 +#define GUI_ID_LISTBOX6 0x116 +#define GUI_ID_LISTBOX7 0x117 +#define GUI_ID_LISTBOX8 0x118 +#define GUI_ID_LISTBOX9 0x119 + +#define GUI_ID_CHECK0 0x120 +#define GUI_ID_CHECK1 0x121 +#define GUI_ID_CHECK2 0x122 +#define GUI_ID_CHECK3 0x123 +#define GUI_ID_CHECK4 0x124 +#define GUI_ID_CHECK5 0x125 +#define GUI_ID_CHECK6 0x126 +#define GUI_ID_CHECK7 0x127 +#define GUI_ID_CHECK8 0x128 +#define GUI_ID_CHECK9 0x129 + +#define GUI_ID_SLIDER0 0x130 +#define GUI_ID_SLIDER1 0x131 +#define GUI_ID_SLIDER2 0x132 +#define GUI_ID_SLIDER3 0x133 +#define GUI_ID_SLIDER4 0x134 +#define GUI_ID_SLIDER5 0x135 +#define GUI_ID_SLIDER6 0x136 +#define GUI_ID_SLIDER7 0x137 +#define GUI_ID_SLIDER8 0x138 +#define GUI_ID_SLIDER9 0x139 + +#define GUI_ID_SCROLLBAR0 0x140 +#define GUI_ID_SCROLLBAR1 0x141 +#define GUI_ID_SCROLLBAR2 0x142 +#define GUI_ID_SCROLLBAR3 0x143 + +#define GUI_ID_RADIO0 0x150 +#define GUI_ID_RADIO1 0x151 +#define GUI_ID_RADIO2 0x152 +#define GUI_ID_RADIO3 0x153 +#define GUI_ID_RADIO4 0x154 +#define GUI_ID_RADIO5 0x155 +#define GUI_ID_RADIO6 0x156 +#define GUI_ID_RADIO7 0x157 + +#define GUI_ID_TEXT0 0x160 +#define GUI_ID_TEXT1 0x161 +#define GUI_ID_TEXT2 0x162 +#define GUI_ID_TEXT3 0x163 +#define GUI_ID_TEXT4 0x164 +#define GUI_ID_TEXT5 0x165 +#define GUI_ID_TEXT6 0x166 +#define GUI_ID_TEXT7 0x167 +#define GUI_ID_TEXT8 0x168 +#define GUI_ID_TEXT9 0x169 + +#define GUI_ID_BUTTON0 0x170 +#define GUI_ID_BUTTON1 0x171 +#define GUI_ID_BUTTON2 0x172 +#define GUI_ID_BUTTON3 0x173 +#define GUI_ID_BUTTON4 0x174 +#define GUI_ID_BUTTON5 0x175 +#define GUI_ID_BUTTON6 0x176 +#define GUI_ID_BUTTON7 0x177 +#define GUI_ID_BUTTON8 0x178 +#define GUI_ID_BUTTON9 0x179 + +#define GUI_ID_DROPDOWN0 0x180 +#define GUI_ID_DROPDOWN1 0x181 +#define GUI_ID_DROPDOWN2 0x182 +#define GUI_ID_DROPDOWN3 0x183 + +#define GUI_ID_MULTIEDIT0 0x190 +#define GUI_ID_MULTIEDIT1 0x191 +#define GUI_ID_MULTIEDIT2 0x192 +#define GUI_ID_MULTIEDIT3 0x193 + +#define GUI_ID_LISTVIEW0 0x200 +#define GUI_ID_LISTVIEW1 0x201 +#define GUI_ID_LISTVIEW2 0x202 +#define GUI_ID_LISTVIEW3 0x203 + +#define GUI_ID_PROGBAR0 0x210 +#define GUI_ID_PROGBAR1 0x211 +#define GUI_ID_PROGBAR2 0x212 +#define GUI_ID_PROGBAR3 0x213 + +#define GUI_ID_GRAPH0 0x220 +#define GUI_ID_GRAPH1 0x221 +#define GUI_ID_GRAPH2 0x222 +#define GUI_ID_GRAPH3 0x223 + +#define GUI_ID_MULTIPAGE0 0x230 +#define GUI_ID_MULTIPAGE1 0x231 +#define GUI_ID_MULTIPAGE2 0x232 +#define GUI_ID_MULTIPAGE3 0x233 + +#define GUI_ID_TREEVIEW0 0x240 +#define GUI_ID_TREEVIEW1 0x241 +#define GUI_ID_TREEVIEW2 0x242 +#define GUI_ID_TREEVIEW3 0x243 + +#define GUI_ID_ICONVIEW0 0x250 +#define GUI_ID_ICONVIEW1 0x251 +#define GUI_ID_ICONVIEW2 0x252 +#define GUI_ID_ICONVIEW3 0x253 + +#define GUI_ID_LISTWHEEL0 0x260 +#define GUI_ID_LISTWHEEL1 0x261 +#define GUI_ID_LISTWHEEL2 0x262 +#define GUI_ID_LISTWHEEL3 0x263 + +#define GUI_ID_IMAGE0 0x270 +#define GUI_ID_IMAGE1 0x271 +#define GUI_ID_IMAGE2 0x272 +#define GUI_ID_IMAGE3 0x273 +#define GUI_ID_IMAGE4 0x274 +#define GUI_ID_IMAGE5 0x275 +#define GUI_ID_IMAGE6 0x276 +#define GUI_ID_IMAGE7 0x277 +#define GUI_ID_IMAGE8 0x278 +#define GUI_ID_IMAGE9 0x279 + +#define GUI_ID_SPINBOX0 0x280 +#define GUI_ID_SPINBOX1 0x281 +#define GUI_ID_SPINBOX2 0x282 +#define GUI_ID_SPINBOX3 0x283 +#define GUI_ID_SPINBOX4 0x284 +#define GUI_ID_SPINBOX5 0x285 +#define GUI_ID_SPINBOX6 0x286 +#define GUI_ID_SPINBOX7 0x287 +#define GUI_ID_SPINBOX8 0x288 +#define GUI_ID_SPINBOX9 0x289 + +#define GUI_ID_CALENDAR0 0x290 + +#define GUI_ID_KNOB0 0x300 +#define GUI_ID_KNOB1 0x301 +#define GUI_ID_KNOB2 0x302 +#define GUI_ID_KNOB3 0x303 +#define GUI_ID_KNOB4 0x304 +#define GUI_ID_KNOB5 0x305 +#define GUI_ID_KNOB6 0x306 +#define GUI_ID_KNOB7 0x307 +#define GUI_ID_KNOB8 0x308 +#define GUI_ID_KNOB9 0x309 + +#define GUI_ID_USER 0x800 + +/********************************************************************* +* +* Mouse buttons +*/ +#define GUI_LBUTTON (1 << 0) /* Left button */ +#define GUI_RBUTTON (1 << 1) /* Right button */ +#define GUI_MBUTTON (1 << 2) /* Middle button */ +#define GUI_DBUTTON (1 << 7) /* Double-click button */ + +/********************************************************************* +* +* Text styles +*/ +#define GUI_TS_NORMAL (0) +#define GUI_TS_UNDERLINE (1 << 0) +#define GUI_TS_STRIKETHRU (1 << 1) +#define GUI_TS_OVERLINE (1 << 2) + +/********************************************************************* +* +* Line styles +*/ +#define GUI_LS_SOLID (0) +#define GUI_LS_DASH (1) +#define GUI_LS_DOT (2) +#define GUI_LS_DASHDOT (3) +#define GUI_LS_DASHDOTDOT (4) + +/********************************************************************* +* +* Pen shapes +*/ +#define GUI_PS_ROUND (0) +#define GUI_PS_FLAT (1) +#define GUI_PS_SQUARE (2) + +/********************************************************************* +* +* Standard colors +*/ +#define GUI_BLUE 0x00FF0000 +#define GUI_GREEN 0x0000FF00 +#define GUI_RED 0x000000FF +#define GUI_CYAN 0x00FFFF00 +#define GUI_MAGENTA 0x00FF00FF +#define GUI_YELLOW 0x0000FFFF +#define GUI_LIGHTBLUE 0x00FF8080 +#define GUI_LIGHTGREEN 0x0080FF80 +#define GUI_LIGHTRED 0x008080FF +#define GUI_LIGHTCYAN 0x00FFFF80 +#define GUI_LIGHTMAGENTA 0x00FF80FF +#define GUI_LIGHTYELLOW 0x0080FFFF +#define GUI_DARKBLUE 0x00800000 +#define GUI_DARKGREEN 0x00008000 +#define GUI_DARKRED 0x00000080 +#define GUI_DARKCYAN 0x00808000 +#define GUI_DARKMAGENTA 0x00800080 +#define GUI_DARKYELLOW 0x00008080 +#define GUI_WHITE 0x00FFFFFF +#define GUI_LIGHTGRAY 0x00D3D3D3 +#define GUI_GRAY 0x00808080 +#define GUI_DARKGRAY 0x00404040 +#define GUI_BLACK 0x00000000 +#define GUI_BROWN 0x002A2AA5 +#define GUI_ORANGE 0x0000A5FF +#define GUI_TRANSPARENT 0xFF000000 + +#define GUI_INVALID_COLOR 0xFFFFFFF /* Invalid color - more than 24 bits */ + +/********************************************************************* +* +* MultiTouch-Support +*/ +// +// Defines +// +#define GUI_MTOUCH_FLAG_DOWN (1 << 0) +#define GUI_MTOUCH_FLAG_MOVE (1 << 1) +#define GUI_MTOUCH_FLAG_UP (1 << 2) + +// +// Variables +// +extern T_GUI_MTOUCH_STOREEVENT GUI_MTOUCH__pStoreEvent; + +// +// Interface +// +void GUI_MTOUCH_Enable (int OnOff); +int GUI_MTOUCH_GetEvent (GUI_MTOUCH_EVENT * pEvent); +int GUI_MTOUCH_GetTouchInput (GUI_MTOUCH_EVENT * pEvent, GUI_MTOUCH_INPUT * pBuffer, unsigned Index); +int GUI_MTOUCH_IsEmpty (void); +void GUI_MTOUCH_SetOrientation (int Orientation); +void GUI_MTOUCH_SetOrientationEx(int Orientation, int LayerIndex); +void GUI_MTOUCH_StoreEvent (GUI_MTOUCH_EVENT * pEvent, GUI_MTOUCH_INPUT * pInput); + +/********************************************************************* +* +* Coordinates used in touch driver +*/ +#define GUI_COORD_X 0 +#define GUI_COORD_Y 1 + +/********************************************************************* +* +* Addresses of standard fonts +*/ +// +// Proportional fonts +// +extern GUI_CONST_STORAGE GUI_FONT GUI_Font8_ASCII, GUI_Font8_1; +extern GUI_CONST_STORAGE GUI_FONT GUI_Font10S_ASCII, GUI_Font10S_1; +extern GUI_CONST_STORAGE GUI_FONT GUI_Font10_ASCII, GUI_Font10_1; +extern GUI_CONST_STORAGE GUI_FONT GUI_Font13_ASCII, GUI_Font13_1; +extern GUI_CONST_STORAGE GUI_FONT GUI_Font13B_ASCII, GUI_Font13B_1; +extern GUI_CONST_STORAGE GUI_FONT GUI_Font13H_ASCII, GUI_Font13H_1; +extern GUI_CONST_STORAGE GUI_FONT GUI_Font13HB_ASCII, GUI_Font13HB_1; +extern GUI_CONST_STORAGE GUI_FONT GUI_Font16_ASCII, GUI_Font16_1, GUI_Font16_HK, GUI_Font16_1HK; +extern GUI_CONST_STORAGE GUI_FONT GUI_Font16B_ASCII, GUI_Font16B_1; +extern GUI_CONST_STORAGE GUI_FONT GUI_Font20_ASCII, GUI_Font20_1; +extern GUI_CONST_STORAGE GUI_FONT GUI_Font20B_ASCII, GUI_Font20B_1; +extern GUI_CONST_STORAGE GUI_FONT GUI_Font24_ASCII, GUI_Font24_1; +extern GUI_CONST_STORAGE GUI_FONT GUI_Font24B_ASCII, GUI_Font24B_1; +extern GUI_CONST_STORAGE GUI_FONT GUI_Font32_ASCII, GUI_Font32_1; +extern GUI_CONST_STORAGE GUI_FONT GUI_Font32B_ASCII, GUI_Font32B_1; + +// +// Proportional fonts, framed +// +extern GUI_CONST_STORAGE GUI_FONT GUI_Font20F_ASCII; + +// +// Monospaced +// +extern GUI_CONST_STORAGE GUI_FONT GUI_Font4x6; +extern GUI_CONST_STORAGE GUI_FONT GUI_Font6x8, GUI_Font6x9; +extern GUI_CONST_STORAGE GUI_FONT GUI_Font6x8_ASCII, GUI_Font6x8_1; +extern GUI_CONST_STORAGE GUI_FONT GUI_Font8x8, GUI_Font8x9; +extern GUI_CONST_STORAGE GUI_FONT GUI_Font8x8_ASCII, GUI_Font8x8_1; +extern GUI_CONST_STORAGE GUI_FONT GUI_Font8x10_ASCII; +extern GUI_CONST_STORAGE GUI_FONT GUI_Font8x12_ASCII; +extern GUI_CONST_STORAGE GUI_FONT GUI_Font8x13_ASCII, GUI_Font8x13_1; +extern GUI_CONST_STORAGE GUI_FONT GUI_Font8x15B_ASCII, GUI_Font8x15B_1; +extern GUI_CONST_STORAGE GUI_FONT GUI_Font8x16, GUI_Font8x17, GUI_Font8x18; +extern GUI_CONST_STORAGE GUI_FONT GUI_Font8x16x1x2, GUI_Font8x16x2x2, GUI_Font8x16x3x3; +extern GUI_CONST_STORAGE GUI_FONT GUI_Font8x16_ASCII, GUI_Font8x16_1; + +// +// Digits +// +extern GUI_CONST_STORAGE GUI_FONT GUI_FontD24x32; +extern GUI_CONST_STORAGE GUI_FONT GUI_FontD32; +extern GUI_CONST_STORAGE GUI_FONT GUI_FontD36x48; +extern GUI_CONST_STORAGE GUI_FONT GUI_FontD48; +extern GUI_CONST_STORAGE GUI_FONT GUI_FontD48x64; +extern GUI_CONST_STORAGE GUI_FONT GUI_FontD64; +extern GUI_CONST_STORAGE GUI_FONT GUI_FontD60x80; +extern GUI_CONST_STORAGE GUI_FONT GUI_FontD80; + +// +// Comic fonts +// +extern GUI_CONST_STORAGE GUI_FONT GUI_FontComic18B_ASCII, GUI_FontComic18B_1; +extern GUI_CONST_STORAGE GUI_FONT GUI_FontComic24B_ASCII, GUI_FontComic24B_1; + +/********************************************************************* +* +* Macros to be used +*/ +// +// Proportional fonts +// +#define GUI_FONT_8_ASCII &GUI_Font8_ASCII +#define GUI_FONT_8_1 &GUI_Font8_1 +#define GUI_FONT_10S_ASCII &GUI_Font10S_ASCII +#define GUI_FONT_10S_1 &GUI_Font10S_1 +#define GUI_FONT_10_ASCII &GUI_Font10_ASCII +#define GUI_FONT_10_1 &GUI_Font10_1 +#define GUI_FONT_13_ASCII &GUI_Font13_ASCII +#define GUI_FONT_13_1 &GUI_Font13_1 +#define GUI_FONT_13B_ASCII &GUI_Font13B_ASCII +#define GUI_FONT_13B_1 &GUI_Font13B_1 +#define GUI_FONT_13H_ASCII &GUI_Font13H_ASCII +#define GUI_FONT_13H_1 &GUI_Font13H_1 +#define GUI_FONT_13HB_ASCII &GUI_Font13HB_ASCII +#define GUI_FONT_13HB_1 &GUI_Font13HB_1 +#define GUI_FONT_16_ASCII &GUI_Font16_ASCII +#define GUI_FONT_16_1 &GUI_Font16_1 +#define GUI_FONT_16_HK &GUI_Font16_HK +#define GUI_FONT_16_1HK &GUI_Font16_1HK +#define GUI_FONT_16B_ASCII &GUI_Font16B_ASCII +#define GUI_FONT_16B_1 &GUI_Font16B_1 +#define GUI_FONT_20_ASCII &GUI_Font20_ASCII +#define GUI_FONT_20_1 &GUI_Font20_1 +#define GUI_FONT_20B_ASCII &GUI_Font20B_ASCII +#define GUI_FONT_20B_1 &GUI_Font20B_1 +#define GUI_FONT_24_ASCII &GUI_Font24_ASCII +#define GUI_FONT_24_1 &GUI_Font24_1 +#define GUI_FONT_24B_ASCII &GUI_Font24B_ASCII +#define GUI_FONT_24B_1 &GUI_Font24B_1 +#define GUI_FONT_32_ASCII &GUI_Font32_ASCII +#define GUI_FONT_32_1 &GUI_Font32_1 +#define GUI_FONT_32B_ASCII &GUI_Font32B_ASCII +#define GUI_FONT_32B_1 &GUI_Font32B_1 + +// +// Proportional fonts, framed +// +#define GUI_FONT_20F_ASCII &GUI_Font20F_ASCII + +// +// Monospaced +// +#define GUI_FONT_4X6 &GUI_Font4x6 +#define GUI_FONT_6X8 &GUI_Font6x8 +#define GUI_FONT_6X8_ASCII &GUI_Font6x8_ASCII +#define GUI_FONT_6X8_1 &GUI_Font6x8_1 +#define GUI_FONT_6X9 &GUI_Font6x9 +#define GUI_FONT_8X8 &GUI_Font8x8 +#define GUI_FONT_8X8_ASCII &GUI_Font8x8_ASCII +#define GUI_FONT_8X8_1 &GUI_Font8x8_1 +#define GUI_FONT_8X9 &GUI_Font8x9 +#define GUI_FONT_8X10_ASCII &GUI_Font8x10_ASCII +#define GUI_FONT_8X12_ASCII &GUI_Font8x12_ASCII +#define GUI_FONT_8X13_ASCII &GUI_Font8x13_ASCII +#define GUI_FONT_8X13_1 &GUI_Font8x13_1 +#define GUI_FONT_8X15B_ASCII &GUI_Font8x15B_ASCII +#define GUI_FONT_8X15B_1 &GUI_Font8x15B_1 +#define GUI_FONT_8X16 &GUI_Font8x16 +#define GUI_FONT_8X17 &GUI_Font8x17 +#define GUI_FONT_8X18 &GUI_Font8x18 +#define GUI_FONT_8X16X1X2 &GUI_Font8x16x1x2 +#define GUI_FONT_8X16X2X2 &GUI_Font8x16x2x2 +#define GUI_FONT_8X16X3X3 &GUI_Font8x16x3x3 +#define GUI_FONT_8X16_ASCII &GUI_Font8x16_ASCII +#define GUI_FONT_8X16_1 &GUI_Font8x16_1 + +// +// Digits +// +#define GUI_FONT_D24X32 &GUI_FontD24x32 +#define GUI_FONT_D32 &GUI_FontD32 +#define GUI_FONT_D36X48 &GUI_FontD36x48 +#define GUI_FONT_D48 &GUI_FontD48 +#define GUI_FONT_D48X64 &GUI_FontD48x64 +#define GUI_FONT_D64 &GUI_FontD64 +#define GUI_FONT_D60X80 &GUI_FontD60x80 +#define GUI_FONT_D80 &GUI_FontD80 + +// +// Comic fonts +// +#define GUI_FONT_COMIC18B_ASCII &GUI_FontComic18B_ASCII +#define GUI_FONT_COMIC18B_1 &GUI_FontComic18B_1 +#define GUI_FONT_COMIC24B_ASCII &GUI_FontComic24B_ASCII +#define GUI_FONT_COMIC24B_1 &GUI_FontComic24B_1 + +/********************************************************************* +* +* Text and drawing modes +* +* These defines come in two flavors: the long version (.._DRAWMODE_..) +* and the short ones (.._DM_..). They are identical, feel free to use +* which ever one you like best. +*/ +#define GUI_DRAWMODE_NORMAL LCD_DRAWMODE_NORMAL +#define GUI_DRAWMODE_XOR LCD_DRAWMODE_XOR +#define GUI_DRAWMODE_TRANS LCD_DRAWMODE_TRANS +#define GUI_DRAWMODE_REV LCD_DRAWMODE_REV +#define GUI_DM_NORMAL LCD_DRAWMODE_NORMAL +#define GUI_DM_XOR LCD_DRAWMODE_XOR +#define GUI_DM_TRANS LCD_DRAWMODE_TRANS +#define GUI_DM_REV LCD_DRAWMODE_REV + +#define GUI_TEXTMODE_NORMAL LCD_DRAWMODE_NORMAL +#define GUI_TEXTMODE_XOR LCD_DRAWMODE_XOR +#define GUI_TEXTMODE_TRANS LCD_DRAWMODE_TRANS +#define GUI_TEXTMODE_REV LCD_DRAWMODE_REV +#define GUI_TM_NORMAL LCD_DRAWMODE_NORMAL +#define GUI_TM_XOR LCD_DRAWMODE_XOR +#define GUI_TM_TRANS LCD_DRAWMODE_TRANS +#define GUI_TM_REV LCD_DRAWMODE_REV + +/* Text alignment flags, horizontal */ +#define GUI_TA_HORIZONTAL (3<<0) +#define GUI_TA_LEFT (0<<0) +#define GUI_TA_RIGHT (1<<0) +#define GUI_TA_CENTER (2<<0) +#define GUI_TA_HCENTER GUI_TA_CENTER /* easier to remember :-) */ + +/* Text alignment flags, vertical */ +#define GUI_TA_VERTICAL (3<<2) +#define GUI_TA_TOP (0<<2) +#define GUI_TA_BOTTOM (1<<2) +#define GUI_TA_BASELINE (2<<2) +#define GUI_TA_VCENTER (3<<2) + +/* General orientation flags */ +#define GUI_MIRROR_X (1 << 0) +#define GUI_MIRROR_Y (1 << 1) +#define GUI_SWAP_XY (1 << 2) + +/********************************************************************* +* +* Min/Max coordinates +* +* Define minimum and maximum coordinates in x and y +*/ +#if 1 + #define GUI_XMIN -16383 + #define GUI_XMAX 16383 + #define GUI_YMIN -16383 + #define GUI_YMAX 16383 +#else + #define GUI_XMIN -4095 + #define GUI_XMAX 4095 + #define GUI_YMIN -4095 + #define GUI_YMAX 4095 +#endif + +/********************************************************************* +* +* Defines for constants +*/ +#define ________ 0x0 +#define _______X 0x1 +#define ______X_ 0x2 +#define ______XX 0x3 +#define _____X__ 0x4 +#define _____X_X 0x5 +#define _____XX_ 0x6 +#define _____XXX 0x7 +#define ____X___ 0x8 +#define ____X__X 0x9 +#define ____X_X_ 0xa +#define ____X_XX 0xb +#define ____XX__ 0xc +#define ____XX_X 0xd +#define ____XXX_ 0xe +#define ____XXXX 0xf +#define ___X____ 0x10 +#define ___X___X 0x11 +#define ___X__X_ 0x12 +#define ___X__XX 0x13 +#define ___X_X__ 0x14 +#define ___X_X_X 0x15 +#define ___X_XX_ 0x16 +#define ___X_XXX 0x17 +#define ___XX___ 0x18 +#define ___XX__X 0x19 +#define ___XX_X_ 0x1a +#define ___XX_XX 0x1b +#define ___XXX__ 0x1c +#define ___XXX_X 0x1d +#define ___XXXX_ 0x1e +#define ___XXXXX 0x1f +#define __X_____ 0x20 +#define __X____X 0x21 +#define __X___X_ 0x22 +#define __X___XX 0x23 +#define __X__X__ 0x24 +#define __X__X_X 0x25 +#define __X__XX_ 0x26 +#define __X__XXX 0x27 +#define __X_X___ 0x28 +#define __X_X__X 0x29 +#define __X_X_X_ 0x2a +#define __X_X_XX 0x2b +#define __X_XX__ 0x2c +#define __X_XX_X 0x2d +#define __X_XXX_ 0x2e +#define __X_XXXX 0x2f +#define __XX____ 0x30 +#define __XX___X 0x31 +#define __XX__X_ 0x32 +#define __XX__XX 0x33 +#define __XX_X__ 0x34 +#define __XX_X_X 0x35 +#define __XX_XX_ 0x36 +#define __XX_XXX 0x37 +#define __XXX___ 0x38 +#define __XXX__X 0x39 +#define __XXX_X_ 0x3a +#define __XXX_XX 0x3b +#define __XXXX__ 0x3c +#define __XXXX_X 0x3d +#define __XXXXX_ 0x3e +#define __XXXXXX 0x3f +#define _X______ 0x40 +#define _X_____X 0x41 +#define _X____X_ 0x42 +#define _X____XX 0x43 +#define _X___X__ 0x44 +#define _X___X_X 0x45 +#define _X___XX_ 0x46 +#define _X___XXX 0x47 +#define _X__X___ 0x48 +#define _X__X__X 0x49 +#define _X__X_X_ 0x4a +#define _X__X_XX 0x4b +#define _X__XX__ 0x4c +#define _X__XX_X 0x4d +#define _X__XXX_ 0x4e +#define _X__XXXX 0x4f +#define _X_X____ 0x50 +#define _X_X___X 0x51 +#define _X_X__X_ 0x52 +#define _X_X__XX 0x53 +#define _X_X_X__ 0x54 +#define _X_X_X_X 0x55 +#define _X_X_XX_ 0x56 +#define _X_X_XXX 0x57 +#define _X_XX___ 0x58 +#define _X_XX__X 0x59 +#define _X_XX_X_ 0x5a +#define _X_XX_XX 0x5b +#define _X_XXX__ 0x5c +#define _X_XXX_X 0x5d +#define _X_XXXX_ 0x5e +#define _X_XXXXX 0x5f +#define _XX_____ 0x60 +#define _XX____X 0x61 +#define _XX___X_ 0x62 +#define _XX___XX 0x63 +#define _XX__X__ 0x64 +#define _XX__X_X 0x65 +#define _XX__XX_ 0x66 +#define _XX__XXX 0x67 +#define _XX_X___ 0x68 +#define _XX_X__X 0x69 +#define _XX_X_X_ 0x6a +#define _XX_X_XX 0x6b +#define _XX_XX__ 0x6c +#define _XX_XX_X 0x6d +#define _XX_XXX_ 0x6e +#define _XX_XXXX 0x6f +#define _XXX____ 0x70 +#define _XXX___X 0x71 +#define _XXX__X_ 0x72 +#define _XXX__XX 0x73 +#define _XXX_X__ 0x74 +#define _XXX_X_X 0x75 +#define _XXX_XX_ 0x76 +#define _XXX_XXX 0x77 +#define _XXXX___ 0x78 +#define _XXXX__X 0x79 +#define _XXXX_X_ 0x7a +#define _XXXX_XX 0x7b +#define _XXXXX__ 0x7c +#define _XXXXX_X 0x7d +#define _XXXXXX_ 0x7e +#define _XXXXXXX 0x7f +#define X_______ 0x80 +#define X______X 0x81 +#define X_____X_ 0x82 +#define X_____XX 0x83 +#define X____X__ 0x84 +#define X____X_X 0x85 +#define X____XX_ 0x86 +#define X____XXX 0x87 +#define X___X___ 0x88 +#define X___X__X 0x89 +#define X___X_X_ 0x8a +#define X___X_XX 0x8b +#define X___XX__ 0x8c +#define X___XX_X 0x8d +#define X___XXX_ 0x8e +#define X___XXXX 0x8f +#define X__X____ 0x90 +#define X__X___X 0x91 +#define X__X__X_ 0x92 +#define X__X__XX 0x93 +#define X__X_X__ 0x94 +#define X__X_X_X 0x95 +#define X__X_XX_ 0x96 +#define X__X_XXX 0x97 +#define X__XX___ 0x98 +#define X__XX__X 0x99 +#define X__XX_X_ 0x9a +#define X__XX_XX 0x9b +#define X__XXX__ 0x9c +#define X__XXX_X 0x9d +#define X__XXXX_ 0x9e +#define X__XXXXX 0x9f +#define X_X_____ 0xa0 +#define X_X____X 0xa1 +#define X_X___X_ 0xa2 +#define X_X___XX 0xa3 +#define X_X__X__ 0xa4 +#define X_X__X_X 0xa5 +#define X_X__XX_ 0xa6 +#define X_X__XXX 0xa7 +#define X_X_X___ 0xa8 +#define X_X_X__X 0xa9 +#define X_X_X_X_ 0xaa +#define X_X_X_XX 0xab +#define X_X_XX__ 0xac +#define X_X_XX_X 0xad +#define X_X_XXX_ 0xae +#define X_X_XXXX 0xaf +#define X_XX____ 0xb0 +#define X_XX___X 0xb1 +#define X_XX__X_ 0xb2 +#define X_XX__XX 0xb3 +#define X_XX_X__ 0xb4 +#define X_XX_X_X 0xb5 +#define X_XX_XX_ 0xb6 +#define X_XX_XXX 0xb7 +#define X_XXX___ 0xb8 +#define X_XXX__X 0xb9 +#define X_XXX_X_ 0xba +#define X_XXX_XX 0xbb +#define X_XXXX__ 0xbc +#define X_XXXX_X 0xbd +#define X_XXXXX_ 0xbe +#define X_XXXXXX 0xbf +#define XX______ 0xc0 +#define XX_____X 0xc1 +#define XX____X_ 0xc2 +#define XX____XX 0xc3 +#define XX___X__ 0xc4 +#define XX___X_X 0xc5 +#define XX___XX_ 0xc6 +#define XX___XXX 0xc7 +#define XX__X___ 0xc8 +#define XX__X__X 0xc9 +#define XX__X_X_ 0xca +#define XX__X_XX 0xcb +#define XX__XX__ 0xcc +#define XX__XX_X 0xcd +#define XX__XXX_ 0xce +#define XX__XXXX 0xcf +#define XX_X____ 0xd0 +#define XX_X___X 0xd1 +#define XX_X__X_ 0xd2 +#define XX_X__XX 0xd3 +#define XX_X_X__ 0xd4 +#define XX_X_X_X 0xd5 +#define XX_X_XX_ 0xd6 +#define XX_X_XXX 0xd7 +#define XX_XX___ 0xd8 +#define XX_XX__X 0xd9 +#define XX_XX_X_ 0xda +#define XX_XX_XX 0xdb +#define XX_XXX__ 0xdc +#define XX_XXX_X 0xdd +#define XX_XXXX_ 0xde +#define XX_XXXXX 0xdf +#define XXX_____ 0xe0 +#define XXX____X 0xe1 +#define XXX___X_ 0xe2 +#define XXX___XX 0xe3 +#define XXX__X__ 0xe4 +#define XXX__X_X 0xe5 +#define XXX__XX_ 0xe6 +#define XXX__XXX 0xe7 +#define XXX_X___ 0xe8 +#define XXX_X__X 0xe9 +#define XXX_X_X_ 0xea +#define XXX_X_XX 0xeb +#define XXX_XX__ 0xec +#define XXX_XX_X 0xed +#define XXX_XXX_ 0xee +#define XXX_XXXX 0xef +#define XXXX____ 0xf0 +#define XXXX___X 0xf1 +#define XXXX__X_ 0xf2 +#define XXXX__XX 0xf3 +#define XXXX_X__ 0xf4 +#define XXXX_X_X 0xf5 +#define XXXX_XX_ 0xf6 +#define XXXX_XXX 0xf7 +#define XXXXX___ 0xf8 +#define XXXXX__X 0xf9 +#define XXXXX_X_ 0xfa +#define XXXXX_XX 0xfb +#define XXXXXX__ 0xfc +#define XXXXXX_X 0xfd +#define XXXXXXX_ 0xfe +#define XXXXXXXX 0xff + +/********************************************************************* +* +* Compatibility with older versions +*/ +#define GUI_DispString_UC GUI_UC_DispString +#define TOUCH_X_ActivateX GUI_TOUCH_X_ActivateX +#define TOUCH_X_ActivateY GUI_TOUCH_X_ActivateY +#define TOUCH_X_Disable GUI_TOUCH_X_Disable +#define TOUCH_X_MeasureX GUI_TOUCH_X_MeasureX +#define TOUCH_X_MeasureY GUI_TOUCH_X_MeasureY +#define GUI_SelLayer GUI_SelectLayer +#if defined(__cplusplus) +} +#endif + +#endif /* ifdef GUI_H */ + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUIDRV_BitPlains.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUIDRV_BitPlains.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,88 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUIDRV_Bitplains.h +Purpose : Interface definition for GUIDRV_Bitplains driver +---------------------------END-OF-HEADER------------------------------ +*/ + +#ifndef GUIDRV_BITPLAINS_H +#define GUIDRV_BITPLAINS_H + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Configuration structure +*/ +typedef struct { + int Mirror; +} CONFIG_BITPLAINS; + +typedef struct { + U8 * apVRAM[8]; +} CONFIG_VRAM_BITPLAINS; + +/********************************************************************* +* +* Display drivers +*/ +// +// Addresses +// +extern const GUI_DEVICE_API GUIDRV_Win_API; + +extern const GUI_DEVICE_API GUIDRV_BitPlains_API; + +// +// Macros to be used in configuration files +// +#if defined(WIN32) && !defined(LCD_SIMCONTROLLER) + + #define GUIDRV_BITPLAINS &GUIDRV_Win_API + +#else + + #define GUIDRV_BITPLAINS &GUIDRV_BitPlains_API + +#endif + +/********************************************************************* +* +* Public routines +*/ +void GUIDRV_BitPlains_Config(GUI_DEVICE * pDevice, CONFIG_BITPLAINS * pConfig); + +#if defined(__cplusplus) +} +#endif + +#endif /* GUIDRV_BITPLAINS_H */ + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUIDRV_DCache.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUIDRV_DCache.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,84 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUIDRV_DCache.h +Purpose : Interface definition for GUIDRV_DCache driver +---------------------------END-OF-HEADER------------------------------ +*/ + +#ifndef GUIDRV_DCACHE_H +#define GUIDRV_DCACHE_H + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Display driver +*/ +// +// Address +// +extern const GUI_DEVICE_API GUIDRV_DCache_API; + +// +// Macros to be used in configuration files +// +#if defined(WIN32) && !defined(LCD_SIMCONTROLLER) + + #define GUIDRV_DCACHE &GUIDRV_Win_API + +#else + + #define GUIDRV_DCACHE &GUIDRV_DCache_API + +#endif + +/********************************************************************* +* +* Public routines +*/ +#if defined(WIN32) && !defined(LCD_SIMCONTROLLER) + + #define GUIDRV_DCache_AddDriver(pDevice, pDriver) + #define GUIDRV_DCache_SetMode1bpp(pDevice) + +#else + + void GUIDRV_DCache_AddDriver (GUI_DEVICE * pDevice, GUI_DEVICE * pDriver); + void GUIDRV_DCache_SetMode1bpp(GUI_DEVICE * pDevice); + +#endif + +#if defined(__cplusplus) +} +#endif + +#endif /* GUIDRV_DCACHE_H */ + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUIDRV_Dist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUIDRV_Dist.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,82 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUIDRV_Dist.h +Purpose : Interface definition for GUIDRV_Dist driver +---------------------------END-OF-HEADER------------------------------ +*/ + +#ifndef GUIDRV_DIST_H +#define GUIDRV_DIST_H + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Display driver +*/ +// +// Address +// +extern const GUI_DEVICE_API GUIDRV_Dist_API; + +// +// Macros to be used in configuration files +// +#if defined(WIN32) && !defined(LCD_SIMCONTROLLER) + + #define GUIDRV_DIST &GUIDRV_Win_API + +#else + + #define GUIDRV_DIST &GUIDRV_Dist_API + +#endif + +/********************************************************************* +* +* Public routines +*/ +#if defined(WIN32) && !defined(LCD_SIMCONTROLLER) + + #define GUIDRV_Dist_AddDriver(pDevice, pDriver, pRect) + +#else + + void GUIDRV_Dist_AddDriver(GUI_DEVICE * pDevice, GUI_DEVICE * pDriver, GUI_RECT * pRect); + +#endif + +#if defined(__cplusplus) +} +#endif + +#endif /* GUIDRV_DIST_H */ + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUIDRV_FlexColor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUIDRV_FlexColor.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,262 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUIDRV_FlexColor.h +Purpose : Interface definition for GUIDRV_FlexColor driver +---------------------------END-OF-HEADER------------------------------ +*/ + +#ifndef GUIDRV_FLEXCOLOR_H +#define GUIDRV_FLEXCOLOR_H + +#include "GUI.h" + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Configuration macros +*/ +// +// Operation modes (16bpp) +// +#define GUIDRV_FLEXCOLOR_M16C0B8 GUIDRV_FlexColor_SetMode16bppC0B8 +#define GUIDRV_FLEXCOLOR_M16C1B8 GUIDRV_FlexColor_SetMode16bppC1B8 +#define GUIDRV_FLEXCOLOR_M16C0B16 GUIDRV_FlexColor_SetMode16bppC0B16 +#define GUIDRV_FLEXCOLOR_M16C1B16 GUIDRV_FlexColor_SetMode16bppC1B16 + +// +// Operation modes (18bpp) +// +#define GUIDRV_FLEXCOLOR_M18C0B9 GUIDRV_FlexColor_SetMode18bppC0B9 +#define GUIDRV_FLEXCOLOR_M18C1B9 GUIDRV_FlexColor_SetMode18bppC1B9 +#define GUIDRV_FLEXCOLOR_M18C0B18 GUIDRV_FlexColor_SetMode18bppC0B18 +#define GUIDRV_FLEXCOLOR_M18C1B18 GUIDRV_FlexColor_SetMode18bppC1B18 + +// +// Controller selection +// +#define GUIDRV_FLEXCOLOR_F66702 GUIDRV_FlexColor_SetFunc66702 +#define GUIDRV_FLEXCOLOR_F66708 GUIDRV_FlexColor_SetFunc66708 +#define GUIDRV_FLEXCOLOR_F66709 GUIDRV_FlexColor_SetFunc66709 +#define GUIDRV_FLEXCOLOR_F66712 GUIDRV_FlexColor_SetFunc66712 +#define GUIDRV_FLEXCOLOR_F66714 GUIDRV_FlexColor_SetFunc66714 +#define GUIDRV_FLEXCOLOR_F66715 GUIDRV_FlexColor_SetFunc66715 +#define GUIDRV_FLEXCOLOR_F66718 GUIDRV_FlexColor_SetFunc66718 +#define GUIDRV_FLEXCOLOR_F66719 GUIDRV_FlexColor_SetFunc66719 +#define GUIDRV_FLEXCOLOR_F66720 GUIDRV_FlexColor_SetFunc66720 +#define GUIDRV_FLEXCOLOR_F66721 GUIDRV_FlexColor_SetFunc66721 +#define GUIDRV_FLEXCOLOR_F66722 GUIDRV_FlexColor_SetFunc66722 +#define GUIDRV_FLEXCOLOR_F66772 GUIDRV_FlexColor_SetFunc66772 + +// +// Hardware interfaces +// +#define GUIDRV_FLEXCOLOR_IF_TYPE_I 0 +#define GUIDRV_FLEXCOLOR_IF_TYPE_II 1 + +// +// Reading interface +// +#define GUIDRV_FLEXCOLOR_READ_FUNC_I 0 +#define GUIDRV_FLEXCOLOR_READ_FUNC_II 1 +#define GUIDRV_FLEXCOLOR_READ_FUNC_III 2 + +/********************************************************************* +* +* Configuration structure +*/ +typedef struct { + // + // Driver specific configuration items + // + int FirstSEG; + int FirstCOM; + int Orientation; + U16 RegEntryMode; + int NumDummyReads; +} CONFIG_FLEXCOLOR; + +/********************************************************************* +* +* Display drivers +*/ +// +// Addresses +// +extern const GUI_DEVICE_API GUIDRV_Win_API; + +extern const GUI_DEVICE_API GUIDRV_FlexColor_API; + +// +// Macros to be used in configuration files +// +#if defined(WIN32) && !defined(LCD_SIMCONTROLLER) + + #define GUIDRV_FLEXCOLOR &GUIDRV_Win_API + +#else + + #define GUIDRV_FLEXCOLOR &GUIDRV_FlexColor_API + +#endif + +/********************************************************************* +* +* Configuration interface +*/ +#if !defined(WIN32) || defined(LCD_SIMCONTROLLER) + + // + // Display controller configuration + // + void GUIDRV_FlexColor_SetFunc66702 (GUI_DEVICE * pDevice); + void GUIDRV_FlexColor_SetFunc66708 (GUI_DEVICE * pDevice); + void GUIDRV_FlexColor_SetFunc66709 (GUI_DEVICE * pDevice); + void GUIDRV_FlexColor_SetFunc66712 (GUI_DEVICE * pDevice); + void GUIDRV_FlexColor_SetFunc66714 (GUI_DEVICE * pDevice); + void GUIDRV_FlexColor_SetFunc66715 (GUI_DEVICE * pDevice); + void GUIDRV_FlexColor_SetFunc66718 (GUI_DEVICE * pDevice); + void GUIDRV_FlexColor_SetFunc66719 (GUI_DEVICE * pDevice); + void GUIDRV_FlexColor_SetFunc66720 (GUI_DEVICE * pDevice); + void GUIDRV_FlexColor_SetFunc66721 (GUI_DEVICE * pDevice); + void GUIDRV_FlexColor_SetFunc66722 (GUI_DEVICE * pDevice); + void GUIDRV_FlexColor_SetFunc66772 (GUI_DEVICE * pDevice); + + // + // Operation mode configuration (16bpp) + // + void GUIDRV_FlexColor_SetMode16bppC0B8 (GUI_DEVICE * pDevice); + void GUIDRV_FlexColor_SetMode16bppC1B8 (GUI_DEVICE * pDevice); + void GUIDRV_FlexColor_SetMode16bppC0B16(GUI_DEVICE * pDevice); + void GUIDRV_FlexColor_SetMode16bppC1B16(GUI_DEVICE * pDevice); + + // + // Drawing mode configuration (18bpp) + // + void GUIDRV_FlexColor_SetMode18bppC0B9 (GUI_DEVICE * pDevice); + void GUIDRV_FlexColor_SetMode18bppC1B9 (GUI_DEVICE * pDevice); + void GUIDRV_FlexColor_SetMode18bppC0B18(GUI_DEVICE * pDevice); + void GUIDRV_FlexColor_SetMode18bppC1B18(GUI_DEVICE * pDevice); + + // + // User interface + // + void GUIDRV_FlexColor_SetFunc(GUI_DEVICE * pDevice, GUI_PORT_API * pHW_API, void (* pfFunc)(GUI_DEVICE *), void (* pfMode)(GUI_DEVICE *)); + void GUIDRV_FlexColor_Config (GUI_DEVICE * pDevice, CONFIG_FLEXCOLOR * pConfig); + + // + // Setting up hardware interface to be used + // + void GUIDRV_FlexColor_SetInterface66712_B9 (GUI_DEVICE * pDevice, int Type); + void GUIDRV_FlexColor_SetInterface66712_B18(GUI_DEVICE * pDevice, int Type); + #define GUIDRV_FlexColor_SetInterface66715_B9(pDevice, Type) GUIDRV_FlexColor_SetInterface66712_B9(pDevice, Type) + #define GUIDRV_FlexColor_SetInterface66715_B18(pDevice, Type) GUIDRV_FlexColor_SetInterface66712_B18(pDevice, Type) + + // + // Setting up interface for reading back data + // + void GUIDRV_FlexColor_SetReadFunc66709_B16(GUI_DEVICE * pDevice, int Func); + void GUIDRV_FlexColor_SetReadFunc66712_B9 (GUI_DEVICE * pDevice, int Func); + void GUIDRV_FlexColor_SetReadFunc66712_B16(GUI_DEVICE * pDevice, int Func); + #define GUIDRV_FlexColor_SetReadFunc66715_B9(pDevice, Func) GUIDRV_FlexColor_SetReadFunc66712_B9(pDevice, Func) + #define GUIDRV_FlexColor_SetReadFunc66715_B16(pDevice, Func) GUIDRV_FlexColor_SetReadFunc66712_B16(pDevice, Func) + void GUIDRV_FlexColor_SetReadFunc66720_B16(GUI_DEVICE * pDevice, int Func); + void GUIDRV_FlexColor_SetReadFunc66772_B8 (GUI_DEVICE * pDevice, int Func); + void GUIDRV_FlexColor_SetReadFunc66772_B16(GUI_DEVICE * pDevice, int Func); + +#else + + // + // Display controller configuration + // + #define GUIDRV_FlexColor_SetFunc66708(pDevice) + #define GUIDRV_FlexColor_SetFunc66709(pDevice) + #define GUIDRV_FlexColor_SetFunc66712(pDevice) + #define GUIDRV_FlexColor_SetFunc66714(pDevice) + #define GUIDRV_FlexColor_SetFunc66715(pDevice) + #define GUIDRV_FlexColor_SetFunc66718(pDevice) + #define GUIDRV_FlexColor_SetFunc66719(pDevice) + #define GUIDRV_FlexColor_SetFunc66720(pDevice) + #define GUIDRV_FlexColor_SetFunc66721(pDevice) + #define GUIDRV_FlexColor_SetFunc66722(pDevice) + #define GUIDRV_FlexColor_SetFunc66772(pDevice) + + // + // Operation mode configuration (16bpp) + // + #define GUIDRV_FlexColor_SetMode16bppC0B8(pDevice) + #define GUIDRV_FlexColor_SetMode16bppC1B8(pDevice) + #define GUIDRV_FlexColor_SetMode16bppC0B16(pDevice) + #define GUIDRV_FlexColor_SetMode16bppC1B16(pDevice) + + // + // Drawing mode configuration (18bpp) + // + #define GUIDRV_FlexColor_SetMode18bppC0B9(pDevice) + #define GUIDRV_FlexColor_SetMode18bppC1B9(pDevice) + #define GUIDRV_FlexColor_SetMode18bppC0B18(pDevice) + #define GUIDRV_FlexColor_SetMode18bppC1B18(pDevice) + + // + // User interface + // + #define GUIDRV_FlexColor_SetFunc(pDevice, pHW_API, pfFunc, pfMode) + #define GUIDRV_FlexColor_Config(pDevice, pConfig) + + // + // Setting up hardware interface to be used + // + #define GUIDRV_FlexColor_SetInterface66712_B9(pDevice, Type) + #define GUIDRV_FlexColor_SetInterface66712_B18(pDevice, Type) + #define GUIDRV_FlexColor_SetInterface66720_B18(pDevice, Type) + #define GUIDRV_FlexColor_SetInterface66715_B9(pDevice, Type) + #define GUIDRV_FlexColor_SetInterface66715_B18(pDevice, Type) + + // + // Setting up interface for reading back data + // + #define GUIDRV_FlexColor_SetReadFunc66709_B16(pDevice, Func) + #define GUIDRV_FlexColor_SetReadFunc66712_B9(pDevice, Func) + #define GUIDRV_FlexColor_SetReadFunc66712_B16(pDevice, Func) + #define GUIDRV_FlexColor_SetReadFunc66715_B9(pDevice, Func) + #define GUIDRV_FlexColor_SetReadFunc66715_B16(pDevice, Func) + #define GUIDRV_FlexColor_SetReadFunc66720_B16(pDevice, Func) + #define GUIDRV_FlexColor_SetReadFunc66772_B8(pDevice, Func) + #define GUIDRV_FlexColor_SetReadFunc66772_B16(pDevice, Func) + +#endif + +#if defined(__cplusplus) +} +#endif + +#endif /* GUIDRV_FLEXCOLOR_H */ + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUIDRV_Generic.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUIDRV_Generic.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,437 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUIDRV_Generic.h +Purpose : Adapter to be able to use the display drivers with simple + bus interface from emWin V4.18 +---------------------------END-OF-HEADER------------------------------ +*/ + +#include "LCD_ConfDefaults.h" + +#if defined(LCD_CONTROLLER) + +/********************************************************************* +* +* Defines +* +********************************************************************** +*/ +/********************************************************************* +* +* Remap old configuration macros to static data +*/ +#define LCD_XSIZE _xSize +#define LCD_YSIZE _ySize +#define LCD_VXSIZE _vxSize +#define LCD_VYSIZE _vySize +#define LCD_XSIZE_PHYS _xSizePhys +#define LCD_YSIZE_PHYS _ySizePhys +#define LCD_NUM_COLORS _NumColors + +/********************************************************************* +* +* Required renaming operations +*/ +#define LCD_On LCD_L0_On +#define LCD_Off LCD_L0_Off + +#ifdef __cplusplus +extern "C" { +#endif + +/********************************************************************* +* +* Prototypes of LCD_L0_xxx - functions +*/ +void LCD_L0_SetPixelIndex(int x, int y, int PixelIndex); +unsigned LCD_L0_GetPixelIndex(int x, int y); +void LCD_L0_XorPixel (int x, int y); +void LCD_L0_DrawHLine (int x0, int y, int x1); +void LCD_L0_DrawVLine (int x, int y0, int y1); +void LCD_L0_FillRect (int x0, int y0, int x1, int y1); +void LCD_L0_DrawBitmap (int x0, int y0, int xsize, int ysize, int BitsPerPixel, int BytesPerLine, const U8 * pData, int Diff, const LCD_PIXELINDEX * pTrans); +void LCD_L0_SetOrg (int x, int y); +void LCD_L0_On (void); +void LCD_L0_Off (void); +int LCD_L0_Init (void); +void LCD_L0_SetLUTEntry (U8 Pos, LCD_COLOR Color); +void (* LCD_L0_GetDevFunc (int Index))(void); + +/********************************************************************* +* +* Prototypes of SIM_xxx - functions +*/ +void SIM_SetVRAMSize(int LayerIndex, int xSize, int ySize); + +/********************************************************************* +* +* Static data +* +********************************************************************** +*/ +static int _xSize; +static int _ySize; +static int _vxSize; +static int _vySize; +static int _xSizePhys; +static int _ySizePhys; +static int _NumColors; + +/********************************************************************* +* +* Static code +* +********************************************************************** +*/ +/********************************************************************* +* +* __SetPixelIndex +*/ +static void __SetPixelIndex(GUI_DEVICE * pDevice, int x, int y, int PixelIndex) { + GUI_USE_PARA(pDevice); + LCD_L0_SetPixelIndex(x, y, PixelIndex); +} + +/********************************************************************* +* +* __GetPixelIndex +*/ +static unsigned int __GetPixelIndex(GUI_DEVICE * pDevice, int x, int y) { + GUI_USE_PARA(pDevice); + return LCD_L0_GetPixelIndex(x, y); +} + +/********************************************************************* +* +* __XorPixel +*/ +static void __XorPixel(GUI_DEVICE * pDevice, int x, int y) { + GUI_USE_PARA(pDevice); + LCD_L0_XorPixel(x, y); +} + +/********************************************************************* +* +* __DrawHLine +*/ +static void __DrawHLine(GUI_DEVICE * pDevice, int x0, int y, int x1) { + GUI_USE_PARA(pDevice); + LCD_L0_DrawHLine(x0, y, x1); +} + +/********************************************************************* +* +* __DrawVLine, not optimized +*/ +static void __DrawVLine(GUI_DEVICE * pDevice, int x, int y0, int y1) { + GUI_USE_PARA(pDevice); + LCD_L0_DrawVLine(x, y0, y1); +} + +/********************************************************************* +* +* __FillRect +*/ +static void __FillRect(GUI_DEVICE * pDevice, int x0, int y0, int x1, int y1) { + GUI_USE_PARA(pDevice); + LCD_L0_FillRect(x0, y0, x1, y1); +} + +/********************************************************************* +* +* __DrawBitmap +*/ +static void __DrawBitmap(GUI_DEVICE * pDevice, int x0, int y0, + int xSize, int ySize, + int BitsPerPixel, + int BytesPerLine, + const U8 * pData, int Diff, + const LCD_PIXELINDEX * pTrans) { + GUI_USE_PARA(pDevice); + LCD_L0_DrawBitmap(x0, y0, xSize, ySize, BitsPerPixel, BytesPerLine, pData, Diff, pTrans); +} + +/********************************************************************* +* +* __SetOrg +*/ +static void __SetOrg(GUI_DEVICE * pDevice, int x, int y) { + GUI_USE_PARA(pDevice); + LCD_L0_SetOrg(x, y); +} + +/********************************************************************* +* +* _SetVSize +*/ +static void _SetVSize(GUI_DEVICE * pDevice, int xSize, int ySize) { + LCD_VXSIZE = xSize; + LCD_VYSIZE = ySize; + #if defined(WIN32) | defined(LCD_SIMCONTROLLER) + SIM_SetVRAMSize(pDevice->LayerIndex, xSize, ySize); + #else + GUI_USE_PARA(pDevice); + #endif +} + +/********************************************************************* +* +* _SetSize +*/ +static void _SetSize(GUI_DEVICE * pDevice, int xSize, int ySize) { + GUI_USE_PARA(pDevice); + LCD_XSIZE = xSize; + LCD_YSIZE = ySize; + #if (LCD_SWAP_XY) + _xSizePhys = ySize; + _ySizePhys = xSize; + #else + _xSizePhys = xSize; + _ySizePhys = ySize; + #endif +} + +/********************************************************************* +* +* __ReadRect +*/ +static void __ReadRect(GUI_DEVICE * pDevice, int x0, int y0, int x1, int y1, LCD_PIXELINDEX * pBuffer) { + void (* pfReadRect)(int, int, int, int, LCD_PIXELINDEX *); + + GUI_USE_PARA(pDevice); + pfReadRect = (void (*)(int, int, int, int, LCD_PIXELINDEX *))LCD_L0_GetDevFunc(LCD_DEVFUNC_READRECT); + pfReadRect(x0, y0, x1, y1, pBuffer); +} + +/********************************************************************* +* +* _GetReadRect +*/ +static void (* _GetReadRect(void))(void) { + if (LCD_L0_GetDevFunc(LCD_DEVFUNC_READRECT)) { + return (void (*)(void))__ReadRect; + } + return NULL; +} + +/********************************************************************* +* +* __ControlCache +*/ +static int __ControlCache(GUI_DEVICE * pDevice, int Cmd) { + int (* pfControlCache)(int); + + GUI_USE_PARA(pDevice); + pfControlCache = (int (*)(int))LCD_L0_GetDevFunc(LCD_DEVFUNC_CONTROLCACHE); + return pfControlCache(Cmd); +} + +/********************************************************************* +* +* _GetControlCache +*/ +static void (* _GetControlCache(void))(void) { + if (LCD_L0_GetDevFunc(LCD_DEVFUNC_CONTROLCACHE)) { + return (void (*)(void))__ControlCache; + } + return NULL; +} + +/********************************************************************* +* +* __Refresh +*/ +static void __Refresh(GUI_DEVICE * pDevice) { + void (* pfRefresh)(void); + + GUI_USE_PARA(pDevice); + pfRefresh = (void (*)(void))LCD_L0_GetDevFunc(LCD_DEVFUNC_REFRESH); + pfRefresh(); +} + +/********************************************************************* +* +* _GetRefresh +*/ +static void (* _GetRefresh(void))(void) { + if (LCD_L0_GetDevFunc(LCD_DEVFUNC_REFRESH)) { + return (void (*)(void))__Refresh; + } + return NULL; +} + +/********************************************************************* +* +* _Init +*/ +static int _Init(GUI_DEVICE * pDevice) { + GUI_USE_PARA(pDevice); + return LCD_L0_Init(); +} + +/********************************************************************* +* +* __GetDevFunc +*/ +static void (* __GetDevFunc(GUI_DEVICE ** ppDevice, int Index))(void) { + GUI_USE_PARA(ppDevice); + switch (Index) { + case LCD_DEVFUNC_CONTROLCACHE: + return _GetControlCache(); + case LCD_DEVFUNC_REFRESH: + return _GetRefresh(); + case LCD_DEVFUNC_READRECT: + return _GetReadRect(); + case LCD_DEVFUNC_SET_VSIZE: + return (void (*)(void))_SetVSize; + case LCD_DEVFUNC_SET_SIZE: + return (void (*)(void))_SetSize; + case LCD_DEVFUNC_INIT: + return (void (*)(void))_Init; + default: + return (void (*)(void))LCD_L0_GetDevFunc(Index); + } +} + +/********************************************************************* +* +* __GetDevProp +*/ +static I32 __GetDevProp(GUI_DEVICE * pDevice, int Index) { + GUI_USE_PARA(pDevice); + switch (Index) { + case LCD_DEVCAP_XSIZE: + return LCD_XSIZE; + case LCD_DEVCAP_YSIZE: + return LCD_YSIZE; + case LCD_DEVCAP_VXSIZE: + return LCD_VXSIZE; + case LCD_DEVCAP_VYSIZE: + return LCD_VYSIZE; + case LCD_DEVCAP_BITSPERPIXEL: + return LCD_BITSPERPIXEL; + case LCD_DEVCAP_NUMCOLORS: + return 1 << LCD_BITSPERPIXEL; + case LCD_DEVCAP_XMAG: + return 1; + case LCD_DEVCAP_YMAG: + return 1; + case LCD_DEVCAP_MIRROR_X: + return LCD_MIRROR_X; + case LCD_DEVCAP_MIRROR_Y: + return LCD_MIRROR_Y; + case LCD_DEVCAP_SWAP_XY: + return LCD_SWAP_XY; + case LCD_DEVCAP_SWAP_RB: + return LCD_SWAP_RB; + } + return -1; +} + +/********************************************************************* +* +* __GetDevData +*/ +static void * __GetDevData(GUI_DEVICE * pDevice, int Index) { + GUI_USE_PARA(pDevice); + #if GUI_SUPPORT_MEMDEV + switch (Index) { + case LCD_DEVDATA_MEMDEV: + #if (LCD_BITSPERPIXEL == 1) + return (void *)&GUI_MEMDEV_DEVICE_1; + #elif (LCD_BITSPERPIXEL <= 8) + return (void *)&GUI_MEMDEV_DEVICE_8; + #elif (LCD_BITSPERPIXEL <= 16) + return (void *)&GUI_MEMDEV_DEVICE_16; + #else + return (void *)&GUI_MEMDEV_DEVICE_32; + #endif + } + #else + GUI_USE_PARA(Index); + #endif + return NULL; +} + +/********************************************************************* +* +* __GetRect +*/ +static void __GetRect(GUI_DEVICE * pDevice, LCD_RECT * pRect) { + GUI_USE_PARA(pDevice); + pRect->x0 = 0; + pRect->y0 = 0; + pRect->x1 = LCD_VXSIZE - 1; + pRect->y1 = LCD_VYSIZE - 1; +} + +/********************************************************************* +* +* Public data +* +********************************************************************** +*/ +/********************************************************************* +* +* GUI_DEVICE_API structure +*/ +const GUI_DEVICE_API DISPLAY_DRIVER_API = { + // + // Data + // + DEVICE_CLASS_DRIVER, + // + // Drawing functions + // + __DrawBitmap, + __DrawHLine, + __DrawVLine, + __FillRect, + __GetPixelIndex, + __SetPixelIndex, + __XorPixel, + // + // Set origin + // + __SetOrg, + // + // Request information + // + __GetDevFunc, + __GetDevProp, + __GetDevData, + __GetRect, +}; + +#ifdef __cplusplus +} +#endif + +#endif + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUIDRV_IST3088.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUIDRV_IST3088.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,95 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUIDRV_IST3088.h +Purpose : Interface definition for GUIDRV_IST3088 driver +---------------------------END-OF-HEADER------------------------------ +*/ + +#ifndef GUIDRV_IST3088_H +#define GUIDRV_IST3088_H + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Display drivers +*/ +// +// Addresses +// +extern const GUI_DEVICE_API GUIDRV_IST3088_4_API; +extern const GUI_DEVICE_API GUIDRV_IST3088_OY_4_API; +extern const GUI_DEVICE_API GUIDRV_IST3088_OX_4_API; +extern const GUI_DEVICE_API GUIDRV_IST3088_OXY_4_API; +extern const GUI_DEVICE_API GUIDRV_IST3088_OS_4_API; +extern const GUI_DEVICE_API GUIDRV_IST3088_OSY_4_API; +extern const GUI_DEVICE_API GUIDRV_IST3088_OSX_4_API; +extern const GUI_DEVICE_API GUIDRV_IST3088_OSXY_4_API; + +// +// Macros to be used in configuration files +// +#if defined(WIN32) && !defined(LCD_SIMCONTROLLER) + + #define GUIDRV_IST3088_4 &GUIDRV_Win_API + #define GUIDRV_IST3088_OY_4 &GUIDRV_Win_API + #define GUIDRV_IST3088_OX_4 &GUIDRV_Win_API + #define GUIDRV_IST3088_OXY_4 &GUIDRV_Win_API + #define GUIDRV_IST3088_OS_4 &GUIDRV_Win_API + #define GUIDRV_IST3088_OSY_4 &GUIDRV_Win_API + #define GUIDRV_IST3088_OSX_4 &GUIDRV_Win_API + #define GUIDRV_IST3088_OSXY_4 &GUIDRV_Win_API + +#else + + #define GUIDRV_IST3088_4 &GUIDRV_IST3088_4_API + #define GUIDRV_IST3088_OY_4 &GUIDRV_IST3088_OY_4_API + #define GUIDRV_IST3088_OX_4 &GUIDRV_IST3088_OX_4_API + #define GUIDRV_IST3088_OXY_4 &GUIDRV_IST3088_OXY_4_API + #define GUIDRV_IST3088_OS_4 &GUIDRV_IST3088_OS_4_API + #define GUIDRV_IST3088_OSY_4 &GUIDRV_IST3088_OSY_4_API + #define GUIDRV_IST3088_OSX_4 &GUIDRV_IST3088_OSX_4_API + #define GUIDRV_IST3088_OSXY_4 &GUIDRV_IST3088_OSXY_4_API + +#endif + +/********************************************************************* +* +* Public routines +*/ +void GUIDRV_IST3088_SetBus16(GUI_DEVICE * pDevice, GUI_PORT_API * pHW_API); + +#if defined(__cplusplus) +} +#endif + +#endif + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUIDRV_Lin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUIDRV_Lin.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,253 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUIDRV_Lin.h +Purpose : Interface definition for GUIDRV_Lin driver +---------------------------END-OF-HEADER------------------------------ +*/ + +#ifndef GUIDRV_LIN_H +#define GUIDRV_LIN_H + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Display drivers +*/ +// +// Addresses +// +extern const GUI_DEVICE_API GUIDRV_Win_API; + +extern const GUI_DEVICE_API GUIDRV_Lin_1_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OY_1_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OX_1_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OXY_1_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OS_1_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OSY_1_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OSX_1_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OSXY_1_API; + +extern const GUI_DEVICE_API GUIDRV_Lin_2_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OY_2_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OX_2_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OXY_2_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OS_2_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OSY_2_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OSX_2_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OSXY_2_API; + +extern const GUI_DEVICE_API GUIDRV_Lin_4_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OY_4_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OX_4_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OXY_4_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OS_4_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OSY_4_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OSX_4_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OSXY_4_API; + +extern const GUI_DEVICE_API GUIDRV_Lin_8_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OY_8_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OX_8_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OXY_8_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OS_8_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OSY_8_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OSX_8_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OSXY_8_API; + +extern const GUI_DEVICE_API GUIDRV_Lin_16_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OY_16_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OX_16_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OXY_16_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OS_16_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OSY_16_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OSX_16_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OSXY_16_API; + +extern const GUI_DEVICE_API GUIDRV_Lin_24_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OY_24_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OX_24_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OXY_24_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OS_24_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OSY_24_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OSX_24_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OSXY_24_API; + +extern const GUI_DEVICE_API GUIDRV_Lin_32_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OY_32_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OX_32_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OXY_32_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OS_32_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OSY_32_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OSX_32_API; +extern const GUI_DEVICE_API GUIDRV_Lin_OSXY_32_API; + +// +// Macros to be used in configuration files +// +#if defined(WIN32) && !defined(LCD_SIMCONTROLLER) + + #define GUIDRV_LIN_1 &GUIDRV_Win_API + #define GUIDRV_LIN_OY_1 &GUIDRV_Win_API + #define GUIDRV_LIN_OX_1 &GUIDRV_Win_API + #define GUIDRV_LIN_OXY_1 &GUIDRV_Win_API + #define GUIDRV_LIN_OS_1 &GUIDRV_Win_API + #define GUIDRV_LIN_OSY_1 &GUIDRV_Win_API + #define GUIDRV_LIN_OSX_1 &GUIDRV_Win_API + #define GUIDRV_LIN_OSXY_1 &GUIDRV_Win_API + + #define GUIDRV_LIN_2 &GUIDRV_Win_API + #define GUIDRV_LIN_OY_2 &GUIDRV_Win_API + #define GUIDRV_LIN_OX_2 &GUIDRV_Win_API + #define GUIDRV_LIN_OXY_2 &GUIDRV_Win_API + #define GUIDRV_LIN_OS_2 &GUIDRV_Win_API + #define GUIDRV_LIN_OSY_2 &GUIDRV_Win_API + #define GUIDRV_LIN_OSX_2 &GUIDRV_Win_API + #define GUIDRV_LIN_OSXY_2 &GUIDRV_Win_API + + #define GUIDRV_LIN_4 &GUIDRV_Win_API + #define GUIDRV_LIN_OY_4 &GUIDRV_Win_API + #define GUIDRV_LIN_OX_4 &GUIDRV_Win_API + #define GUIDRV_LIN_OXY_4 &GUIDRV_Win_API + #define GUIDRV_LIN_OS_4 &GUIDRV_Win_API + #define GUIDRV_LIN_OSY_4 &GUIDRV_Win_API + #define GUIDRV_LIN_OSX_4 &GUIDRV_Win_API + #define GUIDRV_LIN_OSXY_4 &GUIDRV_Win_API + + #define GUIDRV_LIN_8 &GUIDRV_Win_API + #define GUIDRV_LIN_OY_8 &GUIDRV_Win_API + #define GUIDRV_LIN_OX_8 &GUIDRV_Win_API + #define GUIDRV_LIN_OXY_8 &GUIDRV_Win_API + #define GUIDRV_LIN_OS_8 &GUIDRV_Win_API + #define GUIDRV_LIN_OSY_8 &GUIDRV_Win_API + #define GUIDRV_LIN_OSX_8 &GUIDRV_Win_API + #define GUIDRV_LIN_OSXY_8 &GUIDRV_Win_API + + #define GUIDRV_LIN_16 &GUIDRV_Win_API + #define GUIDRV_LIN_OY_16 &GUIDRV_Win_API + #define GUIDRV_LIN_OX_16 &GUIDRV_Win_API + #define GUIDRV_LIN_OXY_16 &GUIDRV_Win_API + #define GUIDRV_LIN_OS_16 &GUIDRV_Win_API + #define GUIDRV_LIN_OSY_16 &GUIDRV_Win_API + #define GUIDRV_LIN_OSX_16 &GUIDRV_Win_API + #define GUIDRV_LIN_OSXY_16 &GUIDRV_Win_API + + #define GUIDRV_LIN_24 &GUIDRV_Win_API + #define GUIDRV_LIN_OY_24 &GUIDRV_Win_API + #define GUIDRV_LIN_OX_24 &GUIDRV_Win_API + #define GUIDRV_LIN_OXY_24 &GUIDRV_Win_API + #define GUIDRV_LIN_OS_24 &GUIDRV_Win_API + #define GUIDRV_LIN_OSY_24 &GUIDRV_Win_API + #define GUIDRV_LIN_OSX_24 &GUIDRV_Win_API + #define GUIDRV_LIN_OSXY_24 &GUIDRV_Win_API + + #define GUIDRV_LIN_32 &GUIDRV_Win_API + #define GUIDRV_LIN_OY_32 &GUIDRV_Win_API + #define GUIDRV_LIN_OX_32 &GUIDRV_Win_API + #define GUIDRV_LIN_OXY_32 &GUIDRV_Win_API + #define GUIDRV_LIN_OS_32 &GUIDRV_Win_API + #define GUIDRV_LIN_OSY_32 &GUIDRV_Win_API + #define GUIDRV_LIN_OSX_32 &GUIDRV_Win_API + #define GUIDRV_LIN_OSXY_32 &GUIDRV_Win_API + +#else + + #define GUIDRV_LIN_1 &GUIDRV_Lin_1_API + #define GUIDRV_LIN_OY_1 &GUIDRV_Lin_OY_1_API + #define GUIDRV_LIN_OX_1 &GUIDRV_Lin_OX_1_API + #define GUIDRV_LIN_OXY_1 &GUIDRV_Lin_OXY_1_API + #define GUIDRV_LIN_OS_1 &GUIDRV_Lin_OS_1_API + #define GUIDRV_LIN_OSY_1 &GUIDRV_Lin_OSY_1_API + #define GUIDRV_LIN_OSX_1 &GUIDRV_Lin_OSX_1_API + #define GUIDRV_LIN_OSXY_1 &GUIDRV_Lin_OSXY_1_API + + #define GUIDRV_LIN_2 &GUIDRV_Lin_2_API + #define GUIDRV_LIN_OY_2 &GUIDRV_Lin_OY_2_API + #define GUIDRV_LIN_OX_2 &GUIDRV_Lin_OX_2_API + #define GUIDRV_LIN_OXY_2 &GUIDRV_Lin_OXY_2_API + #define GUIDRV_LIN_OS_2 &GUIDRV_Lin_OS_2_API + #define GUIDRV_LIN_OSY_2 &GUIDRV_Lin_OSY_2_API + #define GUIDRV_LIN_OSX_2 &GUIDRV_Lin_OSX_2_API + #define GUIDRV_LIN_OSXY_2 &GUIDRV_Lin_OSXY_2_API + + #define GUIDRV_LIN_4 &GUIDRV_Lin_4_API + #define GUIDRV_LIN_OY_4 &GUIDRV_Lin_OY_4_API + #define GUIDRV_LIN_OX_4 &GUIDRV_Lin_OX_4_API + #define GUIDRV_LIN_OXY_4 &GUIDRV_Lin_OXY_4_API + #define GUIDRV_LIN_OS_4 &GUIDRV_Lin_OS_4_API + #define GUIDRV_LIN_OSY_4 &GUIDRV_Lin_OSY_4_API + #define GUIDRV_LIN_OSX_4 &GUIDRV_Lin_OSX_4_API + #define GUIDRV_LIN_OSXY_4 &GUIDRV_Lin_OSXY_4_API + + #define GUIDRV_LIN_8 &GUIDRV_Lin_8_API + #define GUIDRV_LIN_OY_8 &GUIDRV_Lin_OY_8_API + #define GUIDRV_LIN_OX_8 &GUIDRV_Lin_OX_8_API + #define GUIDRV_LIN_OXY_8 &GUIDRV_Lin_OXY_8_API + #define GUIDRV_LIN_OS_8 &GUIDRV_Lin_OS_8_API + #define GUIDRV_LIN_OSY_8 &GUIDRV_Lin_OSY_8_API + #define GUIDRV_LIN_OSX_8 &GUIDRV_Lin_OSX_8_API + #define GUIDRV_LIN_OSXY_8 &GUIDRV_Lin_OSXY_8_API + + #define GUIDRV_LIN_16 &GUIDRV_Lin_16_API + #define GUIDRV_LIN_OY_16 &GUIDRV_Lin_OY_16_API + #define GUIDRV_LIN_OX_16 &GUIDRV_Lin_OX_16_API + #define GUIDRV_LIN_OXY_16 &GUIDRV_Lin_OXY_16_API + #define GUIDRV_LIN_OS_16 &GUIDRV_Lin_OS_16_API + #define GUIDRV_LIN_OSY_16 &GUIDRV_Lin_OSY_16_API + #define GUIDRV_LIN_OSX_16 &GUIDRV_Lin_OSX_16_API + #define GUIDRV_LIN_OSXY_16 &GUIDRV_Lin_OSXY_16_API + + #define GUIDRV_LIN_24 &GUIDRV_Lin_24_API + #define GUIDRV_LIN_OY_24 &GUIDRV_Lin_OY_24_API + #define GUIDRV_LIN_OX_24 &GUIDRV_Lin_OX_24_API + #define GUIDRV_LIN_OXY_24 &GUIDRV_Lin_OXY_24_API + #define GUIDRV_LIN_OS_24 &GUIDRV_Lin_OS_24_API + #define GUIDRV_LIN_OSY_24 &GUIDRV_Lin_OSY_24_API + #define GUIDRV_LIN_OSX_24 &GUIDRV_Lin_OSX_24_API + #define GUIDRV_LIN_OSXY_24 &GUIDRV_Lin_OSXY_24_API + + #define GUIDRV_LIN_32 &GUIDRV_Lin_32_API + #define GUIDRV_LIN_OY_32 &GUIDRV_Lin_OY_32_API + #define GUIDRV_LIN_OX_32 &GUIDRV_Lin_OX_32_API + #define GUIDRV_LIN_OXY_32 &GUIDRV_Lin_OXY_32_API + #define GUIDRV_LIN_OS_32 &GUIDRV_Lin_OS_32_API + #define GUIDRV_LIN_OSY_32 &GUIDRV_Lin_OSY_32_API + #define GUIDRV_LIN_OSX_32 &GUIDRV_Lin_OSX_32_API + #define GUIDRV_LIN_OSXY_32 &GUIDRV_Lin_OSXY_32_API + +#endif + +#if defined(__cplusplus) +} +#endif + +#endif + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUIDRV_Lin_Opt_16.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUIDRV_Lin_Opt_16.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,202 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUIDRV_Lin_Opt_16.h +Purpose : Optimized routines, included by GUIDRV_Lin_..._16.c +---------------------------END-OF-HEADER------------------------------ +*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/********************************************************************* +* +* Static functions +* +********************************************************************** +*/ +/********************************************************************* +* +* _FillRectOpt16 +* +* Purpose: +* Optimized filling routine for 16 bpp +*/ +static void _FillRectOpt16(GUI_DEVICE * pDevice, int x0, int y0, int x1, int y1) { + DRIVER_CONTEXT * pContext; + U32 * pDest; + U32 * pDest0; + U32 Off, OffLine; + int RemPixels, NumLines, RemLines, RemItems; + U32 Data, ColorMask; + LCD_PIXELINDEX ColorIndex; + + pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; + ColorIndex = LCD__GetColorIndex(); + Off = XY2OFF32(pContext->vxSizePhys, x0, y0); + pDest0 = OFF2PTR32(pContext->VRAMAddr, Off); + RemPixels = x1 - x0 + 1; + NumLines = y1 - y0 + 1; + OffLine = pContext->vxSizePhys >> 1; + pDest = NULL; + if (GUI_pContext->DrawMode & LCD_DRAWMODE_XOR) { + // + // First DWORD + // + if (x0 & 1) { + for (RemLines = NumLines, pDest = pDest0; RemLines; RemLines--) { + Data = READ_MEM32P(pDest); + #if (LCD_ENDIAN_BIG == 0) + Data ^= 0xFFFF0000; + #else + Data ^= 0xFFFF; + #endif + WRITE_MEM32P(pDest, Data); + pDest += OffLine; + } + pDest0++; + RemPixels--; + } + // + // Complete DWORDS + // + if (RemPixels >= 2) { + for (RemLines = NumLines; RemLines; RemLines--) { + RemItems = RemPixels; + pDest = pDest0 + OffLine * (RemLines - 1); + do { + Data = READ_MEM32P(pDest); + Data ^= 0xFFFFFFFF; + WRITE_MEM32P(pDest, Data); + pDest++; + RemItems -= 2; + } while (RemItems >= 2); + } + pDest0 = pDest; + RemPixels -= (RemPixels >> 1) << 1; + } + // + // Last DWORD + // + if (RemPixels > 0) { + for (RemLines = NumLines, pDest = pDest0; RemLines; RemLines--) { + Data = READ_MEM32P(pDest); + #if (LCD_ENDIAN_BIG == 0) + Data ^= 0xFFFF; + #else + Data ^= 0xFFFF0000; + #endif + WRITE_MEM32P(pDest, Data); + pDest += OffLine; + } + } + } else { + // + // First DWORD + // + if (x0 & 1) { + for (RemLines = NumLines, pDest = pDest0; RemLines; RemLines--) { + Data = READ_MEM32P(pDest); + #if (LCD_ENDIAN_BIG == 0) + Data &= 0xFFFF; + Data |= (((U32)ColorIndex) << 16); + #else + Data &= 0xFFFF0000; + Data |= ColorIndex; + #endif + WRITE_MEM32P(pDest, Data); + pDest += OffLine; + } + pDest0++; + RemPixels--; + } + // + // Complete DWORDS + // + ColorMask = ColorIndex * 0x00010001; + if (RemPixels >= 16) { + RemPixels -= 16; + + for (RemLines = NumLines; RemLines; RemLines--) { + RemItems = RemPixels; + pDest = pDest0 + OffLine * (RemLines - 1); + do { + WRITE_MEM32P(pDest, ColorMask); + WRITE_MEM32P(pDest + 1, ColorMask); + WRITE_MEM32P(pDest + 2, ColorMask); + WRITE_MEM32P(pDest + 3, ColorMask); + WRITE_MEM32P(pDest + 4, ColorMask); + WRITE_MEM32P(pDest + 5, ColorMask); + WRITE_MEM32P(pDest + 6, ColorMask); + WRITE_MEM32P(pDest + 7, ColorMask); + pDest += 8; + RemItems -= 16; + } while (RemItems >= 0); + } + pDest0 = pDest; + + RemPixels += 16; + RemPixels -= (RemPixels >> 4) << 4; + } + if (RemPixels >= 2) { + for (RemLines = NumLines; RemLines; RemLines--) { + RemItems = RemPixels; + pDest = pDest0 + OffLine * (RemLines - 1); + do { + WRITE_MEM32P(pDest, ColorMask); + pDest++; + RemItems -= 2; + } while (RemItems >= 2); + } + pDest0 = pDest; + RemPixels -= (RemPixels >> 1) << 1; + } + // + // Last DWORD + // + if (RemPixels > 0) { + for (RemLines = NumLines, pDest = pDest0; RemLines; RemLines--) { + Data = READ_MEM32P(pDest); + #if (LCD_ENDIAN_BIG == 0) + Data &= 0xFFFF0000; + Data |= ColorIndex; + #else + Data &= 0xFFFF; + Data |= (((U32)ColorIndex) << 16); + #endif + WRITE_MEM32P(pDest, Data); + pDest += OffLine; + } + } + } +} + +#ifdef __cplusplus +} +#endif +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUIDRV_Lin_Opt_24.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUIDRV_Lin_Opt_24.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,286 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUIDRV_Lin_Opt_24.h +Purpose : Optimized routines, included by GUIDRV_Lin_..._24.c +---------------------------END-OF-HEADER------------------------------ +*/ + +/********************************************************************* +* +* Static functions +* +********************************************************************** +*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/********************************************************************* +* +* _FillRectOpt24 +* +* Purpose: +* Optimized filling routine for 24 bpp +*/ +static void _FillRectOpt24(GUI_DEVICE * pDevice, int x0, int y0, int x1, int y1) { + DRIVER_CONTEXT * pContext; + U32 Off, Off0, OffLine; + int RemPixels, NumLines, RemLines, RemItems, Odd; + U32 Data, Data0, Data1, Data2; + LCD_PIXELINDEX ColorIndex; + + pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; + Off0 = XY2OFF32(pContext->vxSizePhys, x0, y0); + RemPixels = x1 - x0 + 1; + Odd = x0 & 3; + NumLines = y1 - y0 + 1; + OffLine = (pContext->vxSizePhys + pContext->vxSizePhys +pContext->vxSizePhys) >> 2; + RemItems = 0; + Off = 0; + if (GUI_pContext->DrawMode & LCD_DRAWMODE_XOR) { + // + // First triple DWORD + // + if (Odd) { + for (RemLines = NumLines; RemLines; RemLines--) { + RemItems = RemPixels; + Off = Off0 + OffLine * (RemLines - 1); + Data = READ_MEM32(pContext->VRAMAddr, Off); + switch (Odd) { + case 1: + Data ^= 0xFF000000; + WRITE_MEM32(pContext->VRAMAddr, Off, Data); + Off++; + Data = READ_MEM32(pContext->VRAMAddr, Off); + Data ^= 0x0000FFFF; + RemItems--; + if (!RemItems) { + WRITE_MEM32(pContext->VRAMAddr, Off, Data); + break; + } + // + // no break at this position required... + // + case 2: + Data ^= 0xFFFF0000; + WRITE_MEM32(pContext->VRAMAddr, Off, Data); + Off++; + Data = READ_MEM32(pContext->VRAMAddr, Off); + Data ^= 0x000000FF; + RemItems--; + if (!RemItems) { + WRITE_MEM32(pContext->VRAMAddr, Off, Data); + break; + } + // + // no break at this position required... + // + case 3: + Data ^= 0xFFFFFF00; + RemItems--; + WRITE_MEM32(pContext->VRAMAddr, Off, Data); + Off++; + } + } + Off0 = Off; + RemPixels -= (RemPixels - RemItems); + } + // + // Complete triple DWORDS + // + if (RemPixels >= 4) { + for (RemLines = NumLines; RemLines; RemLines--) { + RemItems = RemPixels; + Off = Off0 + OffLine * (RemLines - 1); + do { + Data = READ_MEM32(pContext->VRAMAddr, Off + 0); + Data ^= 0xFFFFFFFF; + WRITE_MEM32(pContext->VRAMAddr, Off + 0, Data); + Data = READ_MEM32(pContext->VRAMAddr, Off + 1); + Data ^= 0xFFFFFFFF; + WRITE_MEM32(pContext->VRAMAddr, Off + 1, Data); + Data = READ_MEM32(pContext->VRAMAddr, Off + 2); + Data ^= 0xFFFFFFFF; + WRITE_MEM32(pContext->VRAMAddr, Off + 2, Data); + Off += 3; + } while ((RemItems -= 4) >= 4); + } + Off0 = Off; + RemPixels -= (RemPixels >> 2) << 2; + } + // + // Last triple DWORD + // + if (RemPixels) { + for (RemLines = NumLines; RemLines; RemLines--) { + RemItems = RemPixels; + Off = Off0 + OffLine * (RemLines - 1); + Data = READ_MEM32(pContext->VRAMAddr, Off); + Data ^= 0x00FFFFFF; + RemItems--; + if (!RemItems) { + WRITE_MEM32(pContext->VRAMAddr, Off, Data); + continue; + } + Data ^= 0xFF000000; + WRITE_MEM32(pContext->VRAMAddr, Off, Data); + Off++; + Data = READ_MEM32(pContext->VRAMAddr, Off); + Data ^= 0x0000FFFF; + RemItems--; + if (!RemItems) { + WRITE_MEM32(pContext->VRAMAddr, Off, Data); + continue; + } + Data ^= 0xFFFF0000; + WRITE_MEM32(pContext->VRAMAddr, Off, Data); + Off++; + Data = READ_MEM32(pContext->VRAMAddr, Off); + Data ^= 0x000000FF; + WRITE_MEM32(pContext->VRAMAddr, Off, Data); + } + } + } else { + ColorIndex = LCD__GetColorIndex(); + // + // First triple DWORD + // + if (Odd) { + for (RemLines = NumLines; RemLines; RemLines--) { + RemItems = RemPixels; + Off = Off0 + OffLine * (RemLines - 1); + Data = READ_MEM32(pContext->VRAMAddr, Off); + switch (Odd) { + case 1: + Data &= 0x00FFFFFF; + Data |= ColorIndex << 24; + WRITE_MEM32(pContext->VRAMAddr, Off, Data); + Off++; + Data = READ_MEM32(pContext->VRAMAddr, Off); + Data &= 0xFFFF0000; + Data |= ColorIndex >> 8; + RemItems--; + if (!RemItems) { + WRITE_MEM32(pContext->VRAMAddr, Off, Data); + break; + } + // + // no break at this position required... + // + case 2: + Data &= 0x0000FFFF; + Data |= ColorIndex << 16; + WRITE_MEM32(pContext->VRAMAddr, Off, Data); + Off++; + Data = READ_MEM32(pContext->VRAMAddr, Off); + Data &= 0xFFFFFF00; + Data |= ColorIndex >> 16; + RemItems--; + if (!RemItems) { + WRITE_MEM32(pContext->VRAMAddr, Off, Data); + break; + } + // + // no break at this position required... + // + case 3: + Data &= 0x000000FF; + Data |= ColorIndex << 8; + RemItems--; + WRITE_MEM32(pContext->VRAMAddr, Off, Data); + Off++; + } + } + Off0 = Off; + RemPixels -= (RemPixels - RemItems); + } + // + // Complete triple DWORDS + // + if (RemPixels >= 4) { + for (RemLines = NumLines; RemLines; RemLines--) { + RemItems = RemPixels; + Off = Off0 + OffLine * (RemLines - 1); + Data0 = (ColorIndex ) | (ColorIndex << 24); + Data1 = (ColorIndex >> 8) | (ColorIndex << 16); + Data2 = (ColorIndex >> 16) | (ColorIndex << 8); + do { + WRITE_MEM32(pContext->VRAMAddr, Off + 0, Data0); + WRITE_MEM32(pContext->VRAMAddr, Off + 1, Data1); + WRITE_MEM32(pContext->VRAMAddr, Off + 2, Data2); + Off += 3; + } while ((RemItems -= 4) >= 4); + } + Off0 = Off; + RemPixels -= (RemPixels >> 2) << 2; + } + // + // Last triple DWORD + // + if (RemPixels) { + for (RemLines = NumLines; RemLines; RemLines--) { + RemItems = RemPixels; + Off = Off0 + OffLine * (RemLines - 1); + Data = READ_MEM32(pContext->VRAMAddr, Off); + Data &= 0xFF000000; + Data |= ColorIndex; + RemItems--; + if (!RemItems) { + WRITE_MEM32(pContext->VRAMAddr, Off, Data); + continue; + } + Data &= 0x00FFFFFF; + Data |= ColorIndex << 24; + WRITE_MEM32(pContext->VRAMAddr, Off, Data); + Off++; + Data = READ_MEM32(pContext->VRAMAddr, Off); + Data &= 0xFFFF0000; + Data |= ColorIndex >> 8; + RemItems--; + if (!RemItems) { + WRITE_MEM32(pContext->VRAMAddr, Off, Data); + continue; + } + Data &= 0x0000FFFF; + Data |= ColorIndex << 16; + WRITE_MEM32(pContext->VRAMAddr, Off, Data); + Off++; + Data = READ_MEM32(pContext->VRAMAddr, Off); + Data &= 0xFFFFFF00; + Data |= ColorIndex >> 16; + WRITE_MEM32(pContext->VRAMAddr, Off, Data); + } + } + } +} + +#ifdef __cplusplus +} +#endif +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUIDRV_Lin_Opt_32.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUIDRV_Lin_Opt_32.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,127 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUIDRV_Lin_Opt_32.h +Purpose : Optimized routines, included by GUIDRV_Lin_..._32.c +---------------------------END-OF-HEADER------------------------------ +*/ + +/********************************************************************* +* +* Static functions +* +********************************************************************** +*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/********************************************************************* +* +* _FillRectOpt32 +* +* Purpose: +* Optimized filling routine for 32 bpp +*/ +static void _FillRectOpt32(GUI_DEVICE * pDevice, int x0, int y0, int x1, int y1) { + DRIVER_CONTEXT * pContext; + register LCD_PIXELINDEX ColorIndex; + U32 * pDest; + U32 * pDest0; + U32 Off, Off0, RemPixels, NumLines, RemLines, OffLine, RemItems; + LCD_PIXELINDEX IndexMask; + + pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; + RemPixels = x1 - x0 + 1; + NumLines = y1 - y0 + 1; + OffLine = pContext->vxSizePhys; + pDest = NULL; + if (GUI_pContext->DrawMode & LCD_DRAWMODE_XOR) { + IndexMask = pDevice->pColorConvAPI->pfGetIndexMask(); + Off0 = XY2OFF32(pContext->vxSizePhys, x0, y0); + if (RemPixels) { + for (RemLines = NumLines; RemLines; RemLines--) { + RemItems = RemPixels; + Off = Off0 + OffLine * (RemLines - 1); + do { + ColorIndex = READ_MEM32(pContext->VRAMAddr, Off); + ColorIndex ^= IndexMask; + WRITE_MEM32(pContext->VRAMAddr, Off, ColorIndex); + Off++; + } while (--RemItems); + } + } + } else { + Off = XY2OFF32(pContext->vxSizePhys, x0, y0); + pDest0 = OFF2PTR32(pContext->VRAMAddr, Off); + ColorIndex = LCD__GetColorIndex(); + if (RemPixels >= 16) { + for (RemLines = NumLines; RemLines; RemLines--) { + RemItems = RemPixels; + pDest = pDest0 + OffLine * (RemLines - 1); + do { + WRITE_MEM32P(pDest , ColorIndex); + WRITE_MEM32P(pDest + 1, ColorIndex); + WRITE_MEM32P(pDest + 2, ColorIndex); + WRITE_MEM32P(pDest + 3, ColorIndex); + WRITE_MEM32P(pDest + 4, ColorIndex); + WRITE_MEM32P(pDest + 5, ColorIndex); + WRITE_MEM32P(pDest + 6, ColorIndex); + WRITE_MEM32P(pDest + 7, ColorIndex); + WRITE_MEM32P(pDest + 8, ColorIndex); + WRITE_MEM32P(pDest + 9, ColorIndex); + WRITE_MEM32P(pDest + 10, ColorIndex); + WRITE_MEM32P(pDest + 11, ColorIndex); + WRITE_MEM32P(pDest + 12, ColorIndex); + WRITE_MEM32P(pDest + 13, ColorIndex); + WRITE_MEM32P(pDest + 14, ColorIndex); + WRITE_MEM32P(pDest + 15, ColorIndex); + pDest += 16; + RemItems -= 16; + } while (RemItems >= 16); + } + pDest0 = pDest; + RemPixels -= (RemPixels >> 4) << 4; + } + if (RemPixels) { + for (RemLines = NumLines; RemLines; RemLines--) { + RemItems = RemPixels; + pDest = pDest0 + OffLine * (RemLines - 1); + do { + WRITE_MEM32P(pDest, ColorIndex); + pDest++; + } while (--RemItems); + } + } + } +} + +#ifdef __cplusplus +} +#endif +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUIDRV_Lin_Opt_8.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUIDRV_Lin_Opt_8.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,197 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUIDRV_Lin_Opt_8.h +Purpose : Optimized routines, included by GUIDRV_Lin_..._8.c +---------------------------END-OF-HEADER------------------------------ +*/ + +/********************************************************************* +* +* Static functions +* +********************************************************************** +*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/********************************************************************* +* +* _FillRectOpt8 +* +* Purpose: +* Optimized filling routine for 8 bpp +*/ +static void _FillRectOpt8(GUI_DEVICE * pDevice, int x0, int y0, int x1, int y1) { + DRIVER_CONTEXT * pContext; + U32 Data, ColorMask, AndMask, Off0, OffLine; + int NumPixel_0, NumPixel_1, RemPixels, NumLines, RemLines, RemItems; + LCD_PIXELINDEX ColorIndex; + U32 * pDest; + + pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; + ColorIndex = LCD__GetColorIndex(); + Off0 = XY2OFF32(pContext->vxSizePhys, x0, y0); + RemPixels = x1 - x0 + 1; + NumLines = y1 - y0 + 1; + OffLine = pContext->vxSizePhys >> 2; + NumPixel_0 = x0 & 3; + NumPixel_1 = x1 & 3; + if (GUI_pContext->DrawMode & LCD_DRAWMODE_XOR) { + // + // First DWORD + // + if (NumPixel_0) { + for (RemLines = NumLines; RemLines; RemLines--) { + pDest = ((U32 *)pContext->VRAMAddr) + Off0 + OffLine * (RemLines - 1); + AndMask = ~(0xFFFFFFFF << (8 * NumPixel_0)); + if ((RemPixels < 3) && (NumPixel_1)) { + AndMask |= ~(0xFFFFFFFF >> (8 * (3 - NumPixel_1))); + } + #if (LCD_ENDIAN_BIG == 1) + MIRROR(AndMask); + #endif + Data = READ_MEM32P(pDest); + Data ^= ~AndMask; + WRITE_MEM32P(pDest, Data); + } + Off0++; + RemPixels -= (4 - NumPixel_0); + } + // + // Complete DWORDS + // + if (RemPixels >= 4) { + for (RemLines = NumLines; RemLines; RemLines--) { + RemItems = RemPixels; + pDest = ((U32 *)pContext->VRAMAddr) + Off0 + OffLine * (RemLines - 1); + while (RemItems >= 4) { + Data = READ_MEM32P(pDest); + Data ^= 0xFFFFFFFF; + WRITE_MEM32P(pDest, Data); + pDest++; + RemItems -= 4; + } + } + Off0 += (RemPixels >> 2); + RemPixels -= (RemPixels >> 2) << 2; + } + // + // Last DWORD + // + if (RemPixels > 0) { + for (RemLines = NumLines; RemLines; RemLines--) { + pDest = ((U32 *)pContext->VRAMAddr) + Off0 + OffLine * (RemLines - 1); + AndMask = 0xFFFFFF00 << (8 * NumPixel_1); + #if (LCD_ENDIAN_BIG == 1) + MIRROR(AndMask); + #endif + Data = READ_MEM32P(pDest); + Data ^= ~AndMask; + WRITE_MEM32P(pDest, Data); + } + } + } else { + // + // First DWORD + // + if (NumPixel_0) { + for (RemLines = NumLines; RemLines; RemLines--) { + pDest = ((U32 *)pContext->VRAMAddr) + Off0 + OffLine * (RemLines - 1); + AndMask = ~(0xFFFFFFFF << (8 * NumPixel_0)); + if ((RemPixels < 3) && (NumPixel_1)) { + AndMask |= ~(0xFFFFFFFF >> (8 * (3 - NumPixel_1))); + } + ColorMask = (ColorIndex * 0x01010101) & ~AndMask; + #if (LCD_ENDIAN_BIG == 1) + MIRROR(AndMask); + MIRROR(ColorMask); + #endif + Data = READ_MEM32P(pDest); + Data &= AndMask; + Data |= ColorMask; + WRITE_MEM32P(pDest, Data); + } + Off0++; + RemPixels -= (4 - NumPixel_0); + } + // + // Complete DWORDS + // + if (RemPixels >= 4) { + ColorMask = ColorIndex * 0x01010101; + for (RemLines = NumLines; RemLines; RemLines--) { + RemItems = RemPixels; + pDest = ((U32 *)pContext->VRAMAddr) + Off0 + OffLine * (RemLines - 1);; + while (RemItems >= 32) { + WRITE_MEM32P(pDest , ColorMask); + WRITE_MEM32P(pDest + 1, ColorMask); + WRITE_MEM32P(pDest + 2, ColorMask); + WRITE_MEM32P(pDest + 3, ColorMask); + WRITE_MEM32P(pDest + 4, ColorMask); + WRITE_MEM32P(pDest + 5, ColorMask); + WRITE_MEM32P(pDest + 6, ColorMask); + WRITE_MEM32P(pDest + 7, ColorMask); + pDest += 8; + RemItems -= 32; + } + while (RemItems >= 4) { + WRITE_MEM32P(pDest, ColorMask); + pDest++; + RemItems -= 4; + } + } + Off0 += (RemPixels >> 2); + RemPixels -= (RemPixels >> 2) << 2; + } + // + // Last DWORD + // + if (RemPixels > 0) { + for (RemLines = NumLines; RemLines; RemLines--) { + pDest = ((U32 *)pContext->VRAMAddr) + Off0 + OffLine * (RemLines - 1); + AndMask = 0xFFFFFF00 << (8 * NumPixel_1); + ColorMask = (ColorIndex * 0x01010101) & ~AndMask; + #if (LCD_ENDIAN_BIG == 1) + MIRROR(AndMask); + MIRROR(ColorMask); + #endif + Data = READ_MEM32P(pDest); + Data &= AndMask; + Data |= ColorMask; + WRITE_MEM32P(pDest, Data); + } + } + } +} + +#ifdef __cplusplus +} +#endif +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUIDRV_NoOpt_1_8.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUIDRV_NoOpt_1_8.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,54 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUIDRV_NoOpt_1_8.h +Purpose : Interface definition for non optimized drawing functions +---------------------------END-OF-HEADER------------------------------ +*/ + +#include "GUI_Private.h" + +#ifndef GUIDRV_NOOPT_1_8_H +#define GUIDRV_NOOPT_1_8_H + +#ifdef __cplusplus +extern "C" { +#endif + +void GUIDRV__NoOpt_XorPixel (GUI_DEVICE * pDevice, int x, int y); +void GUIDRV__NoOpt_DrawHLine (GUI_DEVICE * pDevice, int x0, int y, int x1); +void GUIDRV__NoOpt_DrawVLine (GUI_DEVICE * pDevice, int x, int y0, int y1); +void GUIDRV__NoOpt_FillRect (GUI_DEVICE * pDevice, int x0, int y0, int x1, int y1); +void GUIDRV__NoOpt_DrawBitmap(GUI_DEVICE * pDevice, int x0, int y0, int xSize, int ySize, int BitsPerPixel, int BytesPerLine, const U8 * pData, int Diff, const LCD_PIXELINDEX * pTrans); + +#ifdef __cplusplus +} +#endif + +#endif + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUIDRV_S1D13748.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUIDRV_S1D13748.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,113 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUIDRV_S1D13748.h +Purpose : Interface definition for GUIDRV_S1D13748 driver +---------------------------END-OF-HEADER------------------------------ +*/ + +#ifndef GUIDRV_S1D13748_H +#define GUIDRV_S1D13748_H + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +#define GUIDRV_S1D13748_USE_MAIN 0 +#define GUIDRV_S1D13748_USE_PIP1 1 +#define GUIDRV_S1D13748_USE_PIP2 2 + +/********************************************************************* +* +* Configuration structure +*/ +typedef struct { + // + // Driver specific configuration items + // + U32 BufferOffset; + int UseLayer; + int WriteBufferSize; +} CONFIG_S1D13748; + +/********************************************************************* +* +* Display drivers +*/ +// +// Addresses +// +extern const GUI_DEVICE_API GUIDRV_S1D13748_16_API; +extern const GUI_DEVICE_API GUIDRV_S1D13748_OY_16_API; +extern const GUI_DEVICE_API GUIDRV_S1D13748_OX_16_API; +extern const GUI_DEVICE_API GUIDRV_S1D13748_OXY_16_API; +extern const GUI_DEVICE_API GUIDRV_S1D13748_OS_16_API; +extern const GUI_DEVICE_API GUIDRV_S1D13748_OSY_16_API; +extern const GUI_DEVICE_API GUIDRV_S1D13748_OSX_16_API; +extern const GUI_DEVICE_API GUIDRV_S1D13748_OSXY_16_API; + +// +// Macros to be used in configuration files +// +#if defined(WIN32) && !defined(LCD_SIMCONTROLLER) + + #define GUIDRV_S1D13748_16 &GUIDRV_Win_API + #define GUIDRV_S1D13748_OY_16 &GUIDRV_Win_API + #define GUIDRV_S1D13748_OX_16 &GUIDRV_Win_API + #define GUIDRV_S1D13748_OXY_16 &GUIDRV_Win_API + #define GUIDRV_S1D13748_OS_16 &GUIDRV_Win_API + #define GUIDRV_S1D13748_OSY_16 &GUIDRV_Win_API + #define GUIDRV_S1D13748_OSX_16 &GUIDRV_Win_API + #define GUIDRV_S1D13748_OSXY_16 &GUIDRV_Win_API + +#else + + #define GUIDRV_S1D13748_16 &GUIDRV_S1D13748_16_API + #define GUIDRV_S1D13748_OY_16 &GUIDRV_S1D13748_OY_16_API + #define GUIDRV_S1D13748_OX_16 &GUIDRV_S1D13748_OX_16_API + #define GUIDRV_S1D13748_OXY_16 &GUIDRV_S1D13748_OXY_16_API + #define GUIDRV_S1D13748_OS_16 &GUIDRV_S1D13748_OS_16_API + #define GUIDRV_S1D13748_OSY_16 &GUIDRV_S1D13748_OSY_16_API + #define GUIDRV_S1D13748_OSX_16 &GUIDRV_S1D13748_OSX_16_API + #define GUIDRV_S1D13748_OSXY_16 &GUIDRV_S1D13748_OSXY_16_API + +#endif + +/********************************************************************* +* +* Public routines +*/ +void GUIDRV_S1D13748_Config (GUI_DEVICE * pDevice, CONFIG_S1D13748 * pConfig); +void GUIDRV_S1D13748_SetBus16(GUI_DEVICE * pDevice, GUI_PORT_API * pHW_API); + +#if defined(__cplusplus) +} +#endif + +#endif + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUIDRV_S1D13781.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUIDRV_S1D13781.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,107 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUIDRV_S1D13781.h +Purpose : Interface definition for GUIDRV_S1D13781 driver +---------------------------END-OF-HEADER------------------------------ +*/ + +#ifndef GUIDRV_S1D13781_H +#define GUIDRV_S1D13781_H + +#define GUIDRV_S1D13781_USE_MAIN 0 +#define GUIDRV_S1D13781_USE_PIP1 1 +#define GUIDRV_S1D13781_USE_PIP2 2 + +#ifdef __cplusplus +extern "C" { +#endif + +/********************************************************************* +* +* Configuration structure +*/ +typedef struct { + // + // Driver specific configuration items + // + U32 BufferOffset; + int UseLayer; + int WriteBufferSize; + int WaitUntilVNDP; +} CONFIG_S1D13781; + +/********************************************************************* +* +* Display drivers +*/ +// +// Addresses +// +extern const GUI_DEVICE_API GUIDRV_S1D13781_8C0_API; +extern const GUI_DEVICE_API GUIDRV_S1D13781_OXY_8C0_API; +extern const GUI_DEVICE_API GUIDRV_S1D13781_OSY_8C0_API; +extern const GUI_DEVICE_API GUIDRV_S1D13781_OSX_8C0_API; + +// +// Macros to be used in configuration files +// +#if defined(WIN32) && !defined(LCD_SIMCONTROLLER) + + #define GUIDRV_S1D13781_8C0 &GUIDRV_Win_API + #define GUIDRV_S1D13781_OXY_8C0 &GUIDRV_Win_API + #define GUIDRV_S1D13781_OSY_8C0 &GUIDRV_Win_API + #define GUIDRV_S1D13781_OSX_8C0 &GUIDRV_Win_API + +#else + + #define GUIDRV_S1D13781_8C0 &GUIDRV_S1D13781_8C0_API + #define GUIDRV_S1D13781_OXY_8C0 &GUIDRV_S1D13781_OXY_8C0_API + #define GUIDRV_S1D13781_OSY_8C0 &GUIDRV_S1D13781_OSY_8C0_API + #define GUIDRV_S1D13781_OSX_8C0 &GUIDRV_S1D13781_OSX_8C0_API + +#endif + +/********************************************************************* +* +* Public routines +*/ +#if defined(WIN32) && !defined(LCD_SIMCONTROLLER) + #define GUIDRV_S1D13781_Config(pDevice, pConfig) + #define GUIDRV_S1D13781_SetBusSPI(pDevice, pHW_API) +#else + void GUIDRV_S1D13781_Config (GUI_DEVICE * pDevice, CONFIG_S1D13781 * pConfig); + void GUIDRV_S1D13781_SetBusSPI(GUI_DEVICE * pDevice, GUI_PORT_API * pHW_API); +#endif + +#ifdef __cplusplus +} +#endif + +#endif + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUIDRV_S1D15G00.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUIDRV_S1D15G00.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,91 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUIDRV_S1D15G00.h +Purpose : Interface definition for GUIDRV_S1D15G00 driver +---------------------------END-OF-HEADER------------------------------ +*/ + +#ifndef GUIDRV_S1D15G00_H +#define GUIDRV_S1D15G00_H + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Configuration structure +*/ +typedef struct { + // + // Driver specific configuration items + // + int FirstSEG; + int FirstCOM; + int Orientation; + int UseCache; +} CONFIG_S1D15G00; + +/********************************************************************* +* +* Display drivers +*/ +// +// Addresses +// +extern const GUI_DEVICE_API GUIDRV_Win_API; + +extern const GUI_DEVICE_API GUIDRV_S1D15G00_API; + +// +// Macros to be used in configuration files +// +#if defined(WIN32) && !defined(LCD_SIMCONTROLLER) + + #define GUIDRV_S1D15G00 &GUIDRV_Win_API + +#else + + #define GUIDRV_S1D15G00 &GUIDRV_S1D15G00_API + +#endif + +/********************************************************************* +* +* Public routines +*/ +void GUIDRV_S1D15G00_Config (GUI_DEVICE * pDevice, CONFIG_S1D15G00 * pConfig); +void GUIDRV_S1D15G00_SetBus8(GUI_DEVICE * pDevice, GUI_PORT_API * pHW_API); + +#if defined(__cplusplus) +} +#endif + +#endif + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUIDRV_SLin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUIDRV_SLin.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,160 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUIDRV_SLin.h +Purpose : Interface definition for GUIDRV_SLin driver +---------------------------END-OF-HEADER------------------------------ +*/ + +#ifndef GUIDRV_SLIN_H +#define GUIDRV_SLIN_H + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Configuration structure +*/ +typedef struct { + // + // Function pointers of hardware access routines + // + //HW_API_SLIN HW_API; + // + // Driver specific configuration items + // + int FirstSEG; + int FirstCOM; + int UseCache; + int UseMirror; // Only used for SSD1848 + int CheckBusy; + U8 UseDualScan; // Used for T6963 +} CONFIG_SLIN; + +/********************************************************************* +* +* Display drivers +*/ +// +// Addresses +// +extern const GUI_DEVICE_API GUIDRV_SLin_1_API; +extern const GUI_DEVICE_API GUIDRV_SLin_OY_1_API; +extern const GUI_DEVICE_API GUIDRV_SLin_OX_1_API; +extern const GUI_DEVICE_API GUIDRV_SLin_OXY_1_API; +extern const GUI_DEVICE_API GUIDRV_SLin_OS_1_API; +extern const GUI_DEVICE_API GUIDRV_SLin_OSY_1_API; +extern const GUI_DEVICE_API GUIDRV_SLin_OSX_1_API; +extern const GUI_DEVICE_API GUIDRV_SLin_OSXY_1_API; + +extern const GUI_DEVICE_API GUIDRV_SLin_2_API; +extern const GUI_DEVICE_API GUIDRV_SLin_OY_2_API; +extern const GUI_DEVICE_API GUIDRV_SLin_OX_2_API; +extern const GUI_DEVICE_API GUIDRV_SLin_OXY_2_API; +extern const GUI_DEVICE_API GUIDRV_SLin_OS_2_API; +extern const GUI_DEVICE_API GUIDRV_SLin_OSY_2_API; +extern const GUI_DEVICE_API GUIDRV_SLin_OSX_2_API; +extern const GUI_DEVICE_API GUIDRV_SLin_OSXY_2_API; + +// +// Macros to be used in configuration files +// +#if defined(WIN32) && !defined(LCD_SIMCONTROLLER) + + #define GUIDRV_SLIN_1 &GUIDRV_Win_API + #define GUIDRV_SLIN_OY_1 &GUIDRV_Win_API + #define GUIDRV_SLIN_OX_1 &GUIDRV_Win_API + #define GUIDRV_SLIN_OXY_1 &GUIDRV_Win_API + #define GUIDRV_SLIN_OS_1 &GUIDRV_Win_API + #define GUIDRV_SLIN_OSY_1 &GUIDRV_Win_API + #define GUIDRV_SLIN_OSX_1 &GUIDRV_Win_API + #define GUIDRV_SLIN_OSXY_1 &GUIDRV_Win_API + + #define GUIDRV_SLIN_2 &GUIDRV_Win_API + #define GUIDRV_SLIN_OY_2 &GUIDRV_Win_API + #define GUIDRV_SLIN_OX_2 &GUIDRV_Win_API + #define GUIDRV_SLIN_OXY_2 &GUIDRV_Win_API + #define GUIDRV_SLIN_OS_2 &GUIDRV_Win_API + #define GUIDRV_SLIN_OSY_2 &GUIDRV_Win_API + #define GUIDRV_SLIN_OSX_2 &GUIDRV_Win_API + #define GUIDRV_SLIN_OSXY_2 &GUIDRV_Win_API + +#else + + #define GUIDRV_SLIN_1 &GUIDRV_SLin_1_API + #define GUIDRV_SLIN_OY_1 &GUIDRV_SLin_OY_1_API + #define GUIDRV_SLIN_OX_1 &GUIDRV_SLin_OX_1_API + #define GUIDRV_SLIN_OXY_1 &GUIDRV_SLin_OXY_1_API + #define GUIDRV_SLIN_OS_1 &GUIDRV_SLin_OS_1_API + #define GUIDRV_SLIN_OSY_1 &GUIDRV_SLin_OSY_1_API + #define GUIDRV_SLIN_OSX_1 &GUIDRV_SLin_OSX_1_API + #define GUIDRV_SLIN_OSXY_1 &GUIDRV_SLin_OSXY_1_API + + #define GUIDRV_SLIN_2 &GUIDRV_SLin_2_API + #define GUIDRV_SLIN_OY_2 &GUIDRV_SLin_OY_2_API + #define GUIDRV_SLIN_OX_2 &GUIDRV_SLin_OX_2_API + #define GUIDRV_SLIN_OXY_2 &GUIDRV_SLin_OXY_2_API + #define GUIDRV_SLIN_OS_2 &GUIDRV_SLin_OS_2_API + #define GUIDRV_SLIN_OSY_2 &GUIDRV_SLin_OSY_2_API + #define GUIDRV_SLIN_OSX_2 &GUIDRV_SLin_OSX_2_API + #define GUIDRV_SLIN_OSXY_2 &GUIDRV_SLin_OSXY_2_API + +#endif + +/********************************************************************* +* +* Public routines +*/ +#if defined(WIN32) && !defined(LCD_SIMCONTROLLER) + + #define GUIDRV_SLin_Config(pDevice, pConfig) + #define GUIDRV_SLin_SetBus8(pDevice, pHW_API) + #define GUIDRV_SLin_SetS1D13700(pDevice) + #define GUIDRV_SLin_SetSSD1848(pDevice) + #define GUIDRV_SLin_SetT6963(pDevice) + #define GUIDRV_SLin_SetUC1617(pDevice) + +#else + + void GUIDRV_SLin_Config (GUI_DEVICE * pDevice, CONFIG_SLIN * pConfig); + void GUIDRV_SLin_SetBus8 (GUI_DEVICE * pDevice, GUI_PORT_API * pHW_API); + void GUIDRV_SLin_SetS1D13700(GUI_DEVICE * pDevice); + void GUIDRV_SLin_SetSSD1848 (GUI_DEVICE * pDevice); + void GUIDRV_SLin_SetT6963 (GUI_DEVICE * pDevice); + void GUIDRV_SLin_SetUC1617 (GUI_DEVICE * pDevice); + +#endif + +#if defined(__cplusplus) +} +#endif + +#endif + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUIDRV_SPage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUIDRV_SPage.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,270 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUIDRV_SPage.h +Purpose : Interface definition for GUIDRV_SPage driver +---------------------------END-OF-HEADER------------------------------ +*/ + +#ifndef GUIDRV_SPAGE_H +#define GUIDRV_SPAGE_H + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Configuration structure +*/ +typedef struct { + // + // Driver specific configuration items + // + int FirstSEG; + int FirstCOM; +} CONFIG_SPAGE; + +/********************************************************************* +* +* Display drivers +*/ +// +// Addresses +// +extern const GUI_DEVICE_API GUIDRV_SPage_1C0_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OY_1C0_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OX_1C0_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OXY_1C0_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OS_1C0_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OSY_1C0_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OSX_1C0_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OSXY_1C0_API; + +extern const GUI_DEVICE_API GUIDRV_SPage_1C1_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OY_1C1_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OX_1C1_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OXY_1C1_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OS_1C1_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OSY_1C1_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OSX_1C1_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OSXY_1C1_API; + +extern const GUI_DEVICE_API GUIDRV_SPage_2C0_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OY_2C0_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OX_2C0_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OXY_2C0_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OS_2C0_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OSY_2C0_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OSX_2C0_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OSXY_2C0_API; + +extern const GUI_DEVICE_API GUIDRV_SPage_2C1_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OY_2C1_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OX_2C1_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OXY_2C1_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OS_2C1_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OSY_2C1_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OSX_2C1_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OSXY_2C1_API; + +extern const GUI_DEVICE_API GUIDRV_SPage_4C0_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OY_4C0_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OX_4C0_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OXY_4C0_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OS_4C0_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OSY_4C0_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OSX_4C0_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OSXY_4C0_API; + +extern const GUI_DEVICE_API GUIDRV_SPage_4C1_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OY_4C1_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OX_4C1_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OXY_4C1_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OS_4C1_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OSY_4C1_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OSX_4C1_API; +extern const GUI_DEVICE_API GUIDRV_SPage_OSXY_4C1_API; + +// +// Macros to be used in configuration files +// +#if defined(WIN32) && !defined(LCD_SIMCONTROLLER) + + #define GUIDRV_SPAGE_1C0 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OY_1C0 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OX_1C0 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OXY_1C0 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OS_1C0 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OSY_1C0 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OSX_1C0 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OSXY_1C0 &GUIDRV_Win_API + + #define GUIDRV_SPAGE_1C1 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OY_1C1 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OX_1C1 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OXY_1C1 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OS_1C1 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OSY_1C1 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OSX_1C1 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OSXY_1C1 &GUIDRV_Win_API + + #define GUIDRV_SPAGE_2C0 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OY_2C0 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OX_2C0 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OXY_2C0 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OS_2C0 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OSY_2C0 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OSX_2C0 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OSXY_2C0 &GUIDRV_Win_API + + #define GUIDRV_SPAGE_2C1 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OY_2C1 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OX_2C1 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OXY_2C1 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OS_2C1 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OSY_2C1 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OSX_2C1 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OSXY_2C1 &GUIDRV_Win_API + + #define GUIDRV_SPAGE_4C0 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OY_4C0 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OX_4C0 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OXY_4C0 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OS_4C0 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OSY_4C0 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OSX_4C0 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OSXY_4C0 &GUIDRV_Win_API + + #define GUIDRV_SPAGE_4C1 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OY_4C1 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OX_4C1 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OXY_4C1 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OS_4C1 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OSY_4C1 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OSX_4C1 &GUIDRV_Win_API + #define GUIDRV_SPAGE_OSXY_4C1 &GUIDRV_Win_API + +#else + + #define GUIDRV_SPAGE_1C0 &GUIDRV_SPage_1C0_API + #define GUIDRV_SPAGE_OY_1C0 &GUIDRV_SPage_OY_1C0_API + #define GUIDRV_SPAGE_OX_1C0 &GUIDRV_SPage_OX_1C0_API + #define GUIDRV_SPAGE_OXY_1C0 &GUIDRV_SPage_OXY_1C0_API + #define GUIDRV_SPAGE_OS_1C0 &GUIDRV_SPage_OS_1C0_API + #define GUIDRV_SPAGE_OSY_1C0 &GUIDRV_SPage_OSY_1C0_API + #define GUIDRV_SPAGE_OSX_1C0 &GUIDRV_SPage_OSX_1C0_API + #define GUIDRV_SPAGE_OSXY_1C0 &GUIDRV_SPage_OSXY_1C0_API + + #define GUIDRV_SPAGE_1C1 &GUIDRV_SPage_1C1_API + #define GUIDRV_SPAGE_OY_1C1 &GUIDRV_SPage_OY_1C1_API + #define GUIDRV_SPAGE_OX_1C1 &GUIDRV_SPage_OX_1C1_API + #define GUIDRV_SPAGE_OXY_1C1 &GUIDRV_SPage_OXY_1C1_API + #define GUIDRV_SPAGE_OS_1C1 &GUIDRV_SPage_OS_1C1_API + #define GUIDRV_SPAGE_OSY_1C1 &GUIDRV_SPage_OSY_1C1_API + #define GUIDRV_SPAGE_OSX_1C1 &GUIDRV_SPage_OSX_1C1_API + #define GUIDRV_SPAGE_OSXY_1C1 &GUIDRV_SPage_OSXY_1C1_API + + #define GUIDRV_SPAGE_2C0 &GUIDRV_SPage_2C0_API + #define GUIDRV_SPAGE_OY_2C0 &GUIDRV_SPage_OY_2C0_API + #define GUIDRV_SPAGE_OX_2C0 &GUIDRV_SPage_OX_2C0_API + #define GUIDRV_SPAGE_OXY_2C0 &GUIDRV_SPage_OXY_2C0_API + #define GUIDRV_SPAGE_OS_2C0 &GUIDRV_SPage_OS_2C0_API + #define GUIDRV_SPAGE_OSY_2C0 &GUIDRV_SPage_OSY_2C0_API + #define GUIDRV_SPAGE_OSX_2C0 &GUIDRV_SPage_OSX_2C0_API + #define GUIDRV_SPAGE_OSXY_2C0 &GUIDRV_SPage_OSXY_2C0_API + + #define GUIDRV_SPAGE_2C1 &GUIDRV_SPage_2C1_API + #define GUIDRV_SPAGE_OY_2C1 &GUIDRV_SPage_OY_2C1_API + #define GUIDRV_SPAGE_OX_2C1 &GUIDRV_SPage_OX_2C1_API + #define GUIDRV_SPAGE_OXY_2C1 &GUIDRV_SPage_OXY_2C1_API + #define GUIDRV_SPAGE_OS_2C1 &GUIDRV_SPage_OS_2C1_API + #define GUIDRV_SPAGE_OSY_2C1 &GUIDRV_SPage_OSY_2C1_API + #define GUIDRV_SPAGE_OSX_2C1 &GUIDRV_SPage_OSX_2C1_API + #define GUIDRV_SPAGE_OSXY_2C1 &GUIDRV_SPage_OSXY_2C1_API + + #define GUIDRV_SPAGE_4C0 &GUIDRV_SPage_4C0_API + #define GUIDRV_SPAGE_OY_4C0 &GUIDRV_SPage_OY_4C0_API + #define GUIDRV_SPAGE_OX_4C0 &GUIDRV_SPage_OX_4C0_API + #define GUIDRV_SPAGE_OXY_4C0 &GUIDRV_SPage_OXY_4C0_API + #define GUIDRV_SPAGE_OS_4C0 &GUIDRV_SPage_OS_4C0_API + #define GUIDRV_SPAGE_OSY_4C0 &GUIDRV_SPage_OSY_4C0_API + #define GUIDRV_SPAGE_OSX_4C0 &GUIDRV_SPage_OSX_4C0_API + #define GUIDRV_SPAGE_OSXY_4C0 &GUIDRV_SPage_OSXY_4C0_API + + #define GUIDRV_SPAGE_4C1 &GUIDRV_SPage_4C1_API + #define GUIDRV_SPAGE_OY_4C1 &GUIDRV_SPage_OY_4C1_API + #define GUIDRV_SPAGE_OX_4C1 &GUIDRV_SPage_OX_4C1_API + #define GUIDRV_SPAGE_OXY_4C1 &GUIDRV_SPage_OXY_4C1_API + #define GUIDRV_SPAGE_OS_4C1 &GUIDRV_SPage_OS_4C1_API + #define GUIDRV_SPAGE_OSY_4C1 &GUIDRV_SPage_OSY_4C1_API + #define GUIDRV_SPAGE_OSX_4C1 &GUIDRV_SPage_OSX_4C1_API + #define GUIDRV_SPAGE_OSXY_4C1 &GUIDRV_SPage_OSXY_4C1_API + +#endif + +/********************************************************************* +* +* Public routines +*/ +#if defined(WIN32) && !defined(LCD_SIMCONTROLLER) + + #define GUIDRV_SPage_Config(pDevice, pConfig) + #define GUIDRV_SPage_SetBus8(pDevice, pHW_API) + #define GUIDRV_SPage_Set1502(pDevice) + #define GUIDRV_SPage_Set1510(pDevice) + #define GUIDRV_SPage_Set1512(pDevice) + #define GUIDRV_SPage_SetST7591(pDevice) + #define GUIDRV_SPage_SetUC1611(pDevice) + + // Obsolete + #define GUIDRV_SPage_SetS1D15(pDevice, Controller) + +#else + + void GUIDRV_SPage_Config (GUI_DEVICE * pDevice, CONFIG_SPAGE * pConfig); + void GUIDRV_SPage_SetBus8 (GUI_DEVICE * pDevice, GUI_PORT_API * pHW_API); + void GUIDRV_SPage_Set1502 (GUI_DEVICE * pDevice); + void GUIDRV_SPage_Set1510 (GUI_DEVICE * pDevice); + void GUIDRV_SPage_Set1512 (GUI_DEVICE * pDevice); + void GUIDRV_SPage_SetST7591(GUI_DEVICE * pDevice); + void GUIDRV_SPage_SetUC1611(GUI_DEVICE * pDevice); + + // Obsolete + void GUIDRV_SPage_SetS1D15 (GUI_DEVICE * pDevice, int Controller); + +#endif + +#if defined(__cplusplus) +} +#endif + +#endif + +/*************************** End of file ****************************/ + +
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUIDRV_SSD1926.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUIDRV_SSD1926.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,109 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUIDRV_SSD1926.h +Purpose : Interface definition for GUIDRV_SSD1926 driver +---------------------------END-OF-HEADER------------------------------ +*/ + +#ifndef GUIDRV_SSD1926_H +#define GUIDRV_SSD1926_H + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Configuration structure +*/ +typedef struct { + // + // Driver specific configuration items + // + int FirstSEG; + int FirstCOM; + int UseCache; +} CONFIG_SSD1926; + +/********************************************************************* +* +* Display drivers +*/ +// +// Addresses +// +extern const GUI_DEVICE_API GUIDRV_SSD1926_8_API; +extern const GUI_DEVICE_API GUIDRV_SSD1926_OY_8_API; +extern const GUI_DEVICE_API GUIDRV_SSD1926_OX_8_API; +extern const GUI_DEVICE_API GUIDRV_SSD1926_OXY_8_API; +extern const GUI_DEVICE_API GUIDRV_SSD1926_OS_8_API; +extern const GUI_DEVICE_API GUIDRV_SSD1926_OSY_8_API; +extern const GUI_DEVICE_API GUIDRV_SSD1926_OSX_8_API; +extern const GUI_DEVICE_API GUIDRV_SSD1926_OSXY_8_API; + +// +// Macros to be used in configuration files +// +#if defined(WIN32) && !defined(LCD_SIMCONTROLLER) + + #define GUIDRV_SSD1926_8 &GUIDRV_Win_API + #define GUIDRV_SSD1926_OY_8 &GUIDRV_Win_API + #define GUIDRV_SSD1926_OX_8 &GUIDRV_Win_API + #define GUIDRV_SSD1926_OXY_8 &GUIDRV_Win_API + #define GUIDRV_SSD1926_OS_8 &GUIDRV_Win_API + #define GUIDRV_SSD1926_OSY_8 &GUIDRV_Win_API + #define GUIDRV_SSD1926_OSX_8 &GUIDRV_Win_API + #define GUIDRV_SSD1926_OSXY_8 &GUIDRV_Win_API + +#else + + #define GUIDRV_SSD1926_8 &GUIDRV_SSD1926_8_API + #define GUIDRV_SSD1926_OY_8 &GUIDRV_SSD1926_OY_8_API + #define GUIDRV_SSD1926_OX_8 &GUIDRV_SSD1926_OX_8_API + #define GUIDRV_SSD1926_OXY_8 &GUIDRV_SSD1926_OXY_8_API + #define GUIDRV_SSD1926_OS_8 &GUIDRV_SSD1926_OS_8_API + #define GUIDRV_SSD1926_OSY_8 &GUIDRV_SSD1926_OSY_8_API + #define GUIDRV_SSD1926_OSX_8 &GUIDRV_SSD1926_OSX_8_API + #define GUIDRV_SSD1926_OSXY_8 &GUIDRV_SSD1926_OSXY_8_API + +#endif + +/********************************************************************* +* +* Public routines +*/ +void GUIDRV_SSD1926_Config (GUI_DEVICE * pDevice, CONFIG_SSD1926 * pConfig); +void GUIDRV_SSD1926_SetBus16(GUI_DEVICE * pDevice, GUI_PORT_API * pHW_API); + +#if defined(__cplusplus) +} +#endif + +#endif + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUIDRV_Template.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUIDRV_Template.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,70 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUIDRV_Template.h +Purpose : Interface definition for GUIDRV_Template driver +---------------------------END-OF-HEADER------------------------------ +*/ + +#ifndef GUIDRV_TEMPLATE_H +#define GUIDRV_TEMPLATE_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************************************************************* +* +* Display drivers +*/ +// +// Addresses +// +extern const GUI_DEVICE_API GUIDRV_Win_API; + +extern const GUI_DEVICE_API GUIDRV_Template_API; + +// +// Macros to be used in configuration files +// +#if defined(WIN32) && !defined(LCD_SIMCONTROLLER) + + #define GUIDRV_TEMPLATE &GUIDRV_Win_API + +#else + + #define GUIDRV_TEMPLATE &GUIDRV_Template_API + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUIDRV_TemplateI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUIDRV_TemplateI.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,108 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUIDRV_TemplateI.h +Purpose : Interface definition for GUIDRV_TemplateI driver +---------------------------END-OF-HEADER------------------------------ +*/ + +#ifndef GUIDRV_TEMPLATE_I_H +#define GUIDRV_TEMPLATE_I_H + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Configuration structure +*/ +typedef struct { + // + // Driver specific configuration items + // + int Dummy; +} CONFIG_TEMPLATE_I; + +/********************************************************************* +* +* Display drivers +*/ +// +// Addresses +// +extern const GUI_DEVICE_API GUIDRV_TEMPLATE_I_16_API; +extern const GUI_DEVICE_API GUIDRV_TEMPLATE_I_OY_16_API; +extern const GUI_DEVICE_API GUIDRV_TEMPLATE_I_OX_16_API; +extern const GUI_DEVICE_API GUIDRV_TEMPLATE_I_OXY_16_API; +extern const GUI_DEVICE_API GUIDRV_TEMPLATE_I_OS_16_API; +extern const GUI_DEVICE_API GUIDRV_TEMPLATE_I_OSY_16_API; +extern const GUI_DEVICE_API GUIDRV_TEMPLATE_I_OSX_16_API; +extern const GUI_DEVICE_API GUIDRV_TEMPLATE_I_OSXY_16_API; + +// +// Macros to be used in configuration files +// +#if defined(WIN32) && !defined(LCD_SIMCONTROLLER) + + #define GUIDRV_TEMPLATE_I_16 &GUIDRV_Win_API + #define GUIDRV_TEMPLATE_I_OY_16 &GUIDRV_Win_API + #define GUIDRV_TEMPLATE_I_OX_16 &GUIDRV_Win_API + #define GUIDRV_TEMPLATE_I_OXY_16 &GUIDRV_Win_API + #define GUIDRV_TEMPLATE_I_OS_16 &GUIDRV_Win_API + #define GUIDRV_TEMPLATE_I_OSY_16 &GUIDRV_Win_API + #define GUIDRV_TEMPLATE_I_OSX_16 &GUIDRV_Win_API + #define GUIDRV_TEMPLATE_I_OSXY_16 &GUIDRV_Win_API + +#else + + #define GUIDRV_TEMPLATE_I_16 &GUIDRV_TEMPLATE_I_16_API + #define GUIDRV_TEMPLATE_I_OY_16 &GUIDRV_TEMPLATE_I_OY_16_API + #define GUIDRV_TEMPLATE_I_OX_16 &GUIDRV_TEMPLATE_I_OX_16_API + #define GUIDRV_TEMPLATE_I_OXY_16 &GUIDRV_TEMPLATE_I_OXY_16_API + #define GUIDRV_TEMPLATE_I_OS_16 &GUIDRV_TEMPLATE_I_OS_16_API + #define GUIDRV_TEMPLATE_I_OSY_16 &GUIDRV_TEMPLATE_I_OSY_16_API + #define GUIDRV_TEMPLATE_I_OSX_16 &GUIDRV_TEMPLATE_I_OSX_16_API + #define GUIDRV_TEMPLATE_I_OSXY_16 &GUIDRV_TEMPLATE_I_OSXY_16_API + +#endif + +/********************************************************************* +* +* Public routines +*/ +void GUIDRV_TemplateI_Config (GUI_DEVICE * pDevice, CONFIG_TEMPLATE_I * pConfig); +void GUIDRV_TemplateI_SetBus_XXX(GUI_DEVICE * pDevice, GUI_PORT_API * pHW_API); +void GUIDRV_TemplateI_SetFuncXXX(GUI_DEVICE * pDevice); + +#if defined(__cplusplus) +} +#endif + +#endif + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUIMTDRV_TangoC32.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUIMTDRV_TangoC32.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,78 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUIMTDRV_TangoC32.h +Purpose : Interface definition for GUIMTDRV_TangoC32 driver +---------------------------END-OF-HEADER------------------------------ +*/ + +#ifndef GUIMTDRV_TANGOC32_H +#define GUIMTDRV_TANGOC32_H + +#include "GUI_Type.h" + +#if defined(__cplusplus) +//extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Types +* +********************************************************************** +*/ +typedef struct { + int LayerIndex; + // + // Initialization + // + void (* pf_I2C_Init)(unsigned char SlaveAddr); + // + // Read- and write access + // + int (* pf_I2C_Read )(unsigned char * pData, int Start, int Stop); + int (* pf_I2C_ReadM )(unsigned char * pData, int NumItems, int Start, int Stop); + int (* pf_I2C_Write )(unsigned char Data, int Start, int Stop); + int (* pf_I2C_WriteM)(unsigned char * pData, int NumItems, int Start, int Stop); + // + // 7-bit address to be used to address the I2C slave + // + U8 SlaveAddr; +} GUIMTDRV_TANGOC32_CONFIG; + +/********************************************************************* +* +* Interface +* +********************************************************************** +*/ +int GUIMTDRV_TangoC32_Init(GUIMTDRV_TANGOC32_CONFIG * pConfig); +int GUIMTDRV_TangoC32_Exec(void); + +#endif /* GUIMTDRV_TANGOC32_H */ + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUITDRV_ADS7846.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUITDRV_ADS7846.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,159 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUITDRV_ADS7846.h +Purpose : Touch screen driver include +---------------------------------------------------------------------- + +Notes +===== +(1) The driver needs some function pointer to be filled correctly to be able + to communicate with the external peripheral correctly. The correct assignment + of these function pointers is checked during driver configuration and leads + to an abort to GUI_Error() . + +(2) The driver needs some configuration variables filled in to be able to calculate + the logical screen coordinates from the physical AD values. + A description of the typical paramaters that have to be known by the driver is + listed below: + - Orientation: Orientation of the touch screen if not the same as the physical orientation. + A or-combination of the defines GUI_SWAP_XY, GUI_MIRROR_X and GUI_MIRROR_Y + can be used. + - xLog0 : Logical pixel value of horizontal reference point 0. Typically 0. + - xLog1 : Logical pixel value of horizontal reference point 1. Typically horizontal screen resolution -1. + - xPhys0 : Physical AD value of horizontal reference point 0. + - xPhys1 : Physical AD value of horizontal reference point 1. + - yLog0 : Logical pixel value of vertical reference point 0. Typically 0. + - yLog1 : Logical pixel value of vertical reference point 1. Typically vertical screen resolution -1. + - yPhys0 : Physical AD value of vertical reference point 0. + - yPhys1 : Physical AD value of vertical reference point 1. + +(3) If the PENIRQ line of the touch controller is connected to a port of the target hardware + a touch event can be detected by the driver. Upon polling the driver's exec routine the + driver can check if a touch event is ready to be sampled by checking the PENIRQ line. + Without PENIRQ line the driver will always try to sample a touch event even if no touch + happened which will consume time even if not necessary. + Without PENIRQ it is the responsibility of the user's pfGetResult() routine to return + 0xFFFF if the measured AD value is out of bounds. + If both, the PENIRQ and the touch pressure recognition are enabled first the PENIRQ will + signal that there is a touch event. Afterwards the touch pressure measurement is used to + confirm that this was a valid touch and the touch had enough pressure to deliver good + measurements. + +(4) The touch pressure measurement is activated by setting a value for PressureMin and + PressureMax . + To calculate the correct touch pressure the resistance of the X-plate has to be known. + This can be set via PlateResistanceX [Ohm]. + A touch event that we have measured with a pressure within these thresholds is confirmed + as valid touch event with good measurment samples. + If both, the PENIRQ and the touch pressure recognition are enabled first the PENIRQ will + signal that there is a touch event. Afterwards the touch pressure measurement is used to + confirm that this was a valid touch and the touch had enough pressure to deliver good + measurements. + If no PENIRQ line is connected this measurement takes place everytime the touch event is + polled regardless if there is a touch event or not as the driver will only know for sure + after calculating the touch pressure. + Setting the value for PlateResistanceX to 0 is invalid. The driver will internally use a + value of 1 instead. +*/ + +#ifndef GUITDRV_ADS7846_H /* Make sure we only include it once */ +#define GUITDRV_ADS7846_H + +#include "GUI_Type.h" + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Types +* +********************************************************************** +*/ + +typedef struct { + // + // Function pointer (1) + // + void (* pfSendCmd) (U8 Data); // Sends a 8-bit command to the peripheral + U16 (* pfGetResult) (void); // Retrieves the result of the AD conversion. 4 dummy bytes have to be shifted out to the left. + char (* pfGetBusy) (void); // Retrieves the status of the busy line. 0: Not busy; 1: Busy + void (* pfSetCS) (char OnOff); // Set chip select line. OnOff == 1 means peripheral selected + // + // Configuration (2) + // + unsigned Orientation; + int xLog0; + int xLog1; + int xPhys0; + int xPhys1; + int yLog0; + int yLog1; + int yPhys0; + int yPhys1; + // + // Optional, touch recognition via PENIRQ line (3) + // + char (* pfGetPENIRQ) (void); // Retrieves the status of the PENIRQ line to detect a touch event. + // + // Optional, touch recognition via touch pressure measurement (4) + // + int PressureMin; // Minimum pressure threshold. A measured pressure below this value means we do not have a valid touch event. + int PressureMax; // Maximum pressure threshold. A measured pressure above this value means we do not have a valid touch event. + int PlateResistanceX; // Resistance of the X-plate of the touch screen. This value is needed for calculation of the touch pressure. +} GUITDRV_ADS7846_CONFIG; + +typedef struct { + int xPhys; // Last measured x value + int yPhys; // Last measured y value + int z1Phys; // Last measured z1 value + int z2Phys; // Last measured z2 value + int PENIRQ; // Last sampled PENIRQ state if PENIRQ callback has been set + int Pressure; // Last measured touch pressure if touch pressure measurement is enabled +} GUITDRV_ADS7846_LAST_VAL; + +/********************************************************************* +* +* Prototypes +* +********************************************************************** +*/ + +void GUITDRV_ADS7846_Config (GUITDRV_ADS7846_CONFIG * pConfig); +char GUITDRV_ADS7846_Exec (void); +void GUITDRV_ADS7846_GetLastVal(GUITDRV_ADS7846_LAST_VAL * p); + +#if defined(__cplusplus) +} /* Make sure we have C-declarations in C++ programs */ +#endif + + +#endif /* GUITDRV_ADS7846_H */ + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUI_ARRAY.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUI_ARRAY.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,76 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUI_ARRAY.h +Purpose : Array handling routines +---------------------------END-OF-HEADER------------------------------ +*/ + +#ifndef GUI_ARRAY_H +#define GUI_ARRAY_H + +#include "WM_Intern.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if GUI_WINSUPPORT + +/********************************************************************* +* +* Public types +* +********************************************************************** +*/ +typedef WM_HMEM GUI_ARRAY; + +/********************************************************************* +* +* Public functions +* +********************************************************************** +*/ +GUI_ARRAY GUI_ARRAY_Create (void); +int GUI_ARRAY_AddItem (GUI_ARRAY hArray, const void * pNew, int Len); +void GUI_ARRAY_Delete (GUI_ARRAY hArray); +WM_HMEM GUI_ARRAY_GethItem (GUI_ARRAY hArray, unsigned int Index); +unsigned GUI_ARRAY_GetNumItems (GUI_ARRAY hArray); +void * GUI_ARRAY_GetpItemLocked (GUI_ARRAY hArray, unsigned int Index); +int GUI_ARRAY_SethItem (GUI_ARRAY hArray, unsigned int Index, WM_HMEM hItem); +WM_HMEM GUI_ARRAY_SetItem (GUI_ARRAY hArray, unsigned int Index, const void * pData, int Len); +void GUI_ARRAY_DeleteItem (GUI_ARRAY hArray, unsigned int Index); +char GUI_ARRAY_InsertBlankItem (GUI_ARRAY hArray, unsigned int Index); +WM_HMEM GUI_ARRAY_InsertItem (GUI_ARRAY hArray, unsigned int Index, int Len); +void * GUI_ARRAY_ResizeItemLocked(GUI_ARRAY hArray, unsigned int Index, int Len); + +#endif /* GUI_WINSUPPORT */ + +#ifdef __cplusplus +} +#endif +#endif /* GUI_ARRAY_H */
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUI_ConfDefaults.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUI_ConfDefaults.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,156 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUI_ConfDefaults.h +Purpose : Defaults for GUI config switches. +---------------------------END-OF-HEADER------------------------------ + +Attention : Do not modify this file ! If you do, you will not + be able do update to a later GUI version ! + +*/ + +#ifndef GUI_CONFDEFAULTS_H +#define GUI_CONFDEFAULTS_H + +#include "GUIConf.h" + +#ifndef LCD_MAX_LOG_COLORS + #define LCD_MAX_LOG_COLORS 256 +#else + #if (LCD_MAX_LOG_COLORS > 256) + #error The value of LCD_MAX_LOG_COLORS must be <= 256! + #endif +#endif + +#define LCD_PIXELINDEX U32 + +#ifndef LCD_YMAG + #define LCD_YMAG 1 +#endif +#ifndef LCD_XMAG + #define LCD_XMAG 1 +#endif + +/********************************************************************** +* +* Defaults for config switches +* +*********************************************************************** +*/ + +/* Define "universal pointer". Normally, this is not needed (define will expand to nothing) + However, on some systems (AVR - IAR compiler) it can be necessary ( -> __generic), + since a default pointer can access RAM only, not the built-in Flash +*/ +#ifndef GUI_UNI_PTR + #define GUI_UNI_PTR /* Remains only for compatibility purpose, no longer used in emWin */ +#endif + +/* Define const storage. Normally, this is not needed (define will expand to const) + However, on some systems (AVR - IAR compiler) it can be necessary ( -> __flash const), + since otherwise constants are copied into RAM +*/ +#ifndef GUI_CONST_STORAGE + #define GUI_CONST_STORAGE const +#endif + +#ifndef GUI_USE_MEMDEV_1BPP_FOR_SCREEN + #define GUI_USE_MEMDEV_1BPP_FOR_SCREEN 1 +#endif + +#ifndef GUI_BIDI_MAX_CHARS_PER_LINE + #define GUI_BIDI_MAX_CHARS_PER_LINE 80 +#endif + +#ifndef GUI_SUPPORT_TOUCH + #define GUI_SUPPORT_TOUCH 0 +#endif + +#ifndef GUI_SUPPORT_MOUSE + #define GUI_SUPPORT_MOUSE 0 +#endif + +#ifndef GUI_SUPPORT_MEMDEV + #define GUI_SUPPORT_MEMDEV 0 +#endif + +#ifndef GUI_OS + #define GUI_OS 0 +#endif + +#ifndef GUI_NUM_LAYERS + #define GUI_NUM_LAYERS 1 +#endif + +#ifndef GUI_SUPPORT_CURSOR + #define GUI_SUPPORT_CURSOR (GUI_SUPPORT_MOUSE | GUI_SUPPORT_TOUCH) +#endif + +#ifndef GUI_CURSOR_LAYER + #define GUI_CURSOR_LAYER 0 +#endif + +#ifndef GUI_MEMCPY + #define GUI_MEMCPY(pDest, pSrc, NumBytes) memcpy(pDest, pSrc, NumBytes) +#endif + +#ifndef GUI_SUPPORT_ROTATION + #define GUI_SUPPORT_ROTATION 1 +#endif + +/* In order to avoid warnings for undefined parameters */ +#ifndef GUI_USE_PARA + #if defined (__BORLANDC__) || defined(NC30) || defined(NC308) + #define GUI_USE_PARA(para) + #else + #define GUI_USE_PARA(para) (void)para + #endif +#endif + +/* Default for types */ +#ifndef GUI_TIMER_TIME + #define GUI_TIMER_TIME int /* default is to use 16 bits for 16 bit CPUs, + 32 bits on 32 bit CPUs for timing */ +#endif + +/* Types used for memory allocation */ +#define GUI_ALLOC_DATATYPE I32 +#define GUI_ALLOC_DATATYPE_U U32 + +#ifndef GUI_MAX_XBF_BYTES + #define GUI_MAX_XBF_BYTES 200 +#endif + +#ifndef GUI_MEMSET + #define GUI_MEMSET GUI__memset +#endif + + +#endif /* ifdef GUI_CONFDEFAULTS_H */ + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUI_Debug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUI_Debug.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,189 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUI_Debug.h +Purpose : Debug macros +---------------------------------------------------------------------- + Debug macros for logging + + In the GUI Simulation, all output is transferred into the log window. +*/ + +#ifndef GUI_DEBUG_H +#define GUI_DEBUG_H + +#include <stddef.h> + +#include "GUI.h" + +#define GUI_DEBUG_LEVEL_NOCHECK 0 /* No run time checks are performed */ +#define GUI_DEBUG_LEVEL_CHECK_PARA 1 /* Parameter checks are performed to avoid crashes */ +#define GUI_DEBUG_LEVEL_CHECK_ALL 2 /* Parameter checks and consistency checks are performed */ +#define GUI_DEBUG_LEVEL_LOG_ERRORS 3 /* Errors are recorded */ +#define GUI_DEBUG_LEVEL_LOG_WARNINGS 4 /* Errors & Warnings are recorded */ +#define GUI_DEBUG_LEVEL_LOG_ALL 5 /* Errors, Warnings and Messages are recorded. */ + +#ifndef GUI_DEBUG_LEVEL + #ifdef WIN32 + #define GUI_DEBUG_LEVEL GUI_DEBUG_LEVEL_LOG_WARNINGS /* Simulation should log all warnings */ + #else + #define GUI_DEBUG_LEVEL GUI_DEBUG_LEVEL_CHECK_PARA /* For most targets, min. size is important */ + #endif +#endif + +#define GUI_LOCK_H(hMem) GUI_ALLOC_LockH(hMem) +#define GUI_UNLOCK_H(pMem) GUI_ALLOC_UnlockH((void **)&pMem) + +/******************************************************************* +* +* Commandline +* +******************************************************************** +*/ + +#ifdef WIN32 + #define GUI_DEBUG_GETCMDLINE() SIM_GetCmdLine() +#else + #define GUI_DEBUG_GETCMDLINE() 0 +#endif + +/******************************************************************* +* +* Error macros +* +******************************************************************** +*/ + +/* Make sure the macros are actually defined */ + +#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_LOG_ERRORS + #define GUI_DEBUG_ERROROUT(s) GUI_ErrorOut(s) + #define GUI_DEBUG_ERROROUT1(s,p0) GUI_ErrorOut1(s,p0) + #define GUI_DEBUG_ERROROUT2(s,p0,p1) GUI_ErrorOut2(s,p0,p1) + #define GUI_DEBUG_ERROROUT3(s,p0,p1,p2) GUI_ErrorOut3(s,p0,p1,p2) + #define GUI_DEBUG_ERROROUT4(s,p0,p1,p2,p3) GUI_ErrorOut4(s,p0,p1,p2,p3) + #define GUI_DEBUG_ERROROUT_IF(exp,s) { if (exp) GUI_DEBUG_ERROROUT(s); } + #define GUI_DEBUG_ERROROUT1_IF(exp,s,p0) { if (exp) GUI_DEBUG_ERROROUT1(s,p0); } + #define GUI_DEBUG_ERROROUT2_IF(exp,s,p0,p1) { if (exp) GUI_DEBUG_ERROROUT2(s,p0,p1); } + #define GUI_DEBUG_ERROROUT3_IF(exp,s,p0,p1,p2) { if (exp) GUI_DEBUG_ERROROUT3(s,p0,p1,p2); } + #define GUI_DEBUG_ERROROUT4_IF(exp,s,p0,p1,p2,p3) { if (exp) GUI_DEBUG_ERROROUT4(s,p0,p1,p2,p3); } +#else + #define GUI_DEBUG_ERROROUT(s) + #define GUI_DEBUG_ERROROUT1(s,p0) + #define GUI_DEBUG_ERROROUT2(s,p0,p1) + #define GUI_DEBUG_ERROROUT3(s,p0,p1,p2) + #define GUI_DEBUG_ERROROUT4(s,p0,p1,p2,p3) + #define GUI_DEBUG_ERROROUT_IF(exp,s) + #define GUI_DEBUG_ERROROUT1_IF(exp,s,p0) + #define GUI_DEBUG_ERROROUT2_IF(exp,s,p0,p1) + #define GUI_DEBUG_ERROROUT3_IF(exp,s,p0,p1,p2) + #define GUI_DEBUG_ERROROUT4_IF(exp,s,p0,p1,p2,p3) +#endif + +/******************************************************************* +* +* Warning macros +* +******************************************************************** +*/ + +/* Make sure the macros are actually defined */ + +#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_LOG_WARNINGS + #define GUI_DEBUG_WARN(s) GUI_Warn(s) + #define GUI_DEBUG_WARN1(s,p0) GUI_Warn1(s,p0) + #define GUI_DEBUG_WARN2(s,p0,p1) GUI_Warn2(s,p0,p1) + #define GUI_DEBUG_WARN3(s,p0,p1,p2) GUI_Warn3(s,p0,p1,p2) + #define GUI_DEBUG_WARN4(s,p0,p1,p2,p3) GUI_Warn4(s,p0,p1,p2,p3) + #define GUI_DEBUG_WARN_IF(exp,s) { if (exp) GUI_DEBUG_WARN(s); } + #define GUI_DEBUG_WARN1_IF(exp,s,p0) { if (exp) GUI_DEBUG_WARN1(s,p0); } + #define GUI_DEBUG_WARN2_IF(exp,s,p0,p1) { if (exp) GUI_DEBUG_WARN2(s,p0,p1); } + #define GUI_DEBUG_WARN3_IF(exp,s,p0,p1,p2) { if (exp) GUI_DEBUG_WARN3(s,p0,p1,p2); } + #define GUI_DEBUG_WARN4_IF(exp,s,p0,p1,p2,p3) { if (exp) GUI_DEBUG_WARN4(s,p0,p1,p2,p3); } +#else + #define GUI_DEBUG_WARN(s) + #define GUI_DEBUG_WARN1(s,p0) + #define GUI_DEBUG_WARN2(s,p0,p1) + #define GUI_DEBUG_WARN3(s,p0,p1,p2) + #define GUI_DEBUG_WARN4(s,p0,p1,p2,p3) + #define GUI_DEBUG_WARN_IF(exp,s) + #define GUI_DEBUG_WARN1_IF(exp,s,p0) + #define GUI_DEBUG_WARN2_IF(exp,s,p0,p1) + #define GUI_DEBUG_WARN3_IF(exp,s,p0,p1,p2) + #define GUI_DEBUG_WARN4_IF(exp,s,p0,p1,p2,p3) +#endif + +/******************************************************************* +* +* Logging macros +* +******************************************************************** +*/ +/* Make sure the macros are actually defined */ + +#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_LOG_ALL + #define GUI_DEBUG_LOG(s) GUI_Log(s) + #define GUI_DEBUG_LOG1(s,p0) GUI_Log1(s,p0) + #define GUI_DEBUG_LOG2(s,p0,p1) GUI_Log2(s,p0,p1) + #define GUI_DEBUG_LOG3(s,p0,p1,p2) GUI_Log3(s,p0,p1,p2) + #define GUI_DEBUG_LOG4(s,p0,p1,p2,p3) GUI_Log4(s,p0,p1,p2,p3) + #define GUI_DEBUG_LOG_IF(exp,s) { if (exp) GUI_DEBUG_LOG(s); } + #define GUI_DEBUG_LOG1_IF(exp,s,p0) { if (exp) GUI_DEBUG_LOG1(s,p0); } + #define GUI_DEBUG_LOG2_IF(exp,s,p0,p1) { if (exp) GUI_DEBUG_LOG2(s,p0,p1); } + #define GUI_DEBUG_LOG3_IF(exp,s,p0,p1,p2) { if (exp) GUI_DEBUG_LOG3(s,p0,p1,p2); } + #define GUI_DEBUG_LOG4_IF(exp,s,p0,p1,p2,p3) { if (exp) GUI_DEBUG_LOG4(s,p0,p1,p2,p3); } +#else + #define GUI_DEBUG_LOG(s) + #define GUI_DEBUG_LOG1(s,p0) + #define GUI_DEBUG_LOG2(s,p0,p1) + #define GUI_DEBUG_LOG3(s,p0,p1,p2) + #define GUI_DEBUG_LOG4(s,p0,p1,p2,p3) + #define GUI_DEBUG_LOG_IF(exp,s) + #define GUI_DEBUG_LOG1_IF(exp,s,p0) + #define GUI_DEBUG_LOG2_IF(exp,s,p0,p1) + #define GUI_DEBUG_LOG3_IF(exp,s,p0,p1,p2) + #define GUI_DEBUG_LOG4_IF(exp,s,p0,p1,p2,p3) +#endif + +/******************************************************************* +* +* Asserts +* +******************************************************************** +*/ +#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_LOG_ERRORS + #define GUI_DEBUG_ASSERT(exp) { if (!exp) GUI_DEBUG_ERROROUT(#exp); } +#else + #define GUI_DEBUG_ASSERT(exp) +#endif + +#endif /* LCD_H */ + + + + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUI_FontIntern.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUI_FontIntern.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,83 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUI_FontIntern.h +Purpose : Internal decalrations used in font files +---------------------------END-OF-HEADER------------------------------ + +Attention : Do not modify this file ! If you do, you will not + be able do update to a later GUI version ! + +*/ + + +#ifndef GUI_FONTINTERN_H /* Guard against multiple inclusion */ +#define GUI_FONTINTERN_H + +#include "GUI.h" + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + + +extern GUI_CONST_STORAGE GUI_FONT_PROP GUI_Font8ASCII_Prop; +extern GUI_CONST_STORAGE GUI_FONT_PROP GUI_Font10S_ASCII_FontProp1; +extern GUI_CONST_STORAGE GUI_FONT_PROP GUI_Font10ASCIIProp1; +extern GUI_CONST_STORAGE GUI_FONT_PROP GUI_Font16ASCIIProp1; +extern GUI_CONST_STORAGE GUI_FONT_PROP GUI_Font16_1_FontProp1; + +extern GUI_CONST_STORAGE GUI_FONT_PROP GUI_Font20_ASCII_Prop1; +extern GUI_CONST_STORAGE GUI_CHARINFO GUI_Font20_ASCII_CharInfo[95]; +extern GUI_CONST_STORAGE GUI_FONT_PROP GUI_Font20B_ASCII_Prop1; +extern GUI_CONST_STORAGE GUI_CHARINFO GUI_Font20B_ASCII_CharInfo[95]; + +extern GUI_CONST_STORAGE GUI_FONT_PROP FontComic24BProp_ASCII; +extern GUI_CONST_STORAGE GUI_CHARINFO GUI_Font24B_ASCII_CharInfo[95]; +extern GUI_CONST_STORAGE GUI_CHARINFO GUI_Font24_ASCII_CharInfo[95]; +extern GUI_CONST_STORAGE GUI_CHARINFO GUI_Font32B_ASCII_CharInfo[95]; +extern GUI_CONST_STORAGE GUI_CHARINFO GUI_Font32_ASCII_CharInfo[95]; +extern GUI_CONST_STORAGE GUI_CHARINFO GUI_CharInfoF8x13_ASCII[96]; +extern GUI_CONST_STORAGE GUI_CHARINFO GUI_CharInfoF8x15B_ASCII[96]; +extern GUI_CONST_STORAGE GUI_CHARINFO CharInfo18B_ASCII[97]; +extern GUI_CONST_STORAGE GUI_CHARINFO CharInfo24B_ASCII[96]; +extern GUI_CONST_STORAGE GUI_FONT_PROP GUI_Font13ASCII_Prop1; +extern GUI_CONST_STORAGE GUI_FONT_PROP GUI_Font13B_ASCII_Prop1; +extern GUI_CONST_STORAGE GUI_CHARINFO GUI_Font13H_ASCII_CharInfo[95]; +extern GUI_CONST_STORAGE GUI_CHARINFO GUI_Font13HB_ASCII_CharInfo[95]; +extern GUI_CONST_STORAGE GUI_CHARINFO GUI_Font16_HK_CharInfo[169]; +extern GUI_CONST_STORAGE GUI_CHARINFO GUI_Font16B_ASCII_CharInfo[95]; + + +#if defined(__cplusplus) + } +#endif + + +#endif /* Guard against multiple inclusion */ + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUI_HOOK.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUI_HOOK.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,75 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUI_HOOK.h +Purpose : Hook handling routines +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef GUI_HOOK_H +#define GUI_HOOK_H + +#include "WM_Intern.h" + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Types +* +********************************************************************** +*/ + +typedef int GUI_HOOK_FUNC(WM_MESSAGE* pMsg); + +typedef struct GUI_HOOK { + struct GUI_HOOK* pNext; + GUI_HOOK_FUNC* pHookFunc; +} GUI_HOOK; + +/********************************************************************* +* +* Functions +* +********************************************************************** +*/ + +void GUI_HOOK_Add (GUI_HOOK** ppFirstHook, GUI_HOOK* pNewHook, GUI_HOOK_FUNC* pHookFunc); +void GUI_HOOK_Remove(GUI_HOOK** ppFirstHook, GUI_HOOK* pHook); + +#if defined(__cplusplus) + } +#endif + +#endif /* GUI_WINSUPPORT */ +#endif /* GUI_HOOK_H */ + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUI_Private.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUI_Private.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,645 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUI_Private.h +Purpose : GUI internal declarations +---------------------------END-OF-HEADER------------------------------ +*/ + +#ifndef GUI_PRIVATE_H +#define GUI_PRIVATE_H + +#include "GUI.h" +#include "LCD_Protected.h" +#include "GUI_Debug.h" +#if GUI_WINSUPPORT + #include "WM_GUI.h" +#endif + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Defaults for config switches +* +********************************************************************** + + The config switches below do not affect the interface in GUI.h and + are therefor not required to be in GUI.h. +*/ + +/* Short address area. + For most compilers, this is "near" or "__near" + We do not use this except for some CPUs which we know to always have some + near memory, because the GUI_Context and some other data will be declared + to be in this short address (near) memory area as it has a major effect + on performance. + Please define in GUIConf.h (if you want to use it) +*/ +#ifndef GUI_SADDR + #define GUI_SADDR +#endif + +#ifndef GUI_DEFAULT_FONT + #define GUI_DEFAULT_FONT &GUI_Font6x8 +#endif + +#ifndef GUI_DEFAULT_CURSOR + #define GUI_DEFAULT_CURSOR &GUI_CursorArrowM +#endif + +#ifndef GUI_DEFAULT_BKCOLOR + #define GUI_DEFAULT_BKCOLOR GUI_BLACK +#endif + +#ifndef GUI_DEFAULT_COLOR + #define GUI_DEFAULT_COLOR GUI_WHITE +#endif + +/********************************************************************* +* +* Angles +* +********************************************************************** +*/ +#define GUI_45DEG 512 +#define GUI_90DEG (2 * GUI_45DEG) +#define GUI_180DEG (4 * GUI_45DEG) +#define GUI_360DEG (8 * GUI_45DEG) + + +/********************************************************************* +* +* Locking checks +* +********************************************************************** +*/ +#if defined (WIN32) && defined (_DEBUG) && GUI_OS + #define GUI_ASSERT_LOCK() GUITASK_AssertLock() + #define GUI_ASSERT_NO_LOCK() GUITASK_AssertNoLock() + void GUITASK_AssertLock(void); + void GUITASK_AssertNoLock(void); +#else + #define GUI_ASSERT_LOCK() + #define GUI_ASSERT_NO_LOCK() +#endif + +/********************************************************************* +* +* Division tables +* +********************************************************************** +*/ +extern const U8 GUI__aConvert_15_255[(1 << 4)]; +extern const U8 GUI__aConvert_31_255[(1 << 5)]; +extern const U8 GUI__aConvert_63_255[(1 << 6)]; +extern const U8 GUI__aConvert_255_15[(1 << 8)]; +extern const U8 GUI__aConvert_255_31[(1 << 8)]; +extern const U8 GUI__aConvert_255_63[(1 << 8)]; + +/********************************************************************* +* +* Usage internals +* +********************************************************************** +*/ +typedef GUI_HMEM GUI_USAGE_Handle; +typedef struct tsUSAGE_APIList tUSAGE_APIList; +typedef struct GUI_Usage GUI_USAGE; +#define GUI_USAGE_h GUI_USAGE_Handle + + + +typedef GUI_USAGE_h tUSAGE_CreateCompatible(GUI_USAGE * p); +typedef void tUSAGE_AddPixel (GUI_USAGE * p, int x, int y); +typedef void tUSAGE_AddHLine (GUI_USAGE * p, int x0, int y0, int len); +typedef void tUSAGE_Clear (GUI_USAGE * p); +typedef void tUSAGE_Delete (GUI_USAGE_h h); +typedef int tUSAGE_GetNextDirty (GUI_USAGE * p, int * pxOff, int yOff); +#define GUI_USAGE_LOCK_H(h) ((GUI_USAGE *)GUI_LOCK_H(h)) + + +void GUI_USAGE_DecUseCnt(GUI_USAGE_Handle hUsage); + +GUI_USAGE_Handle GUI_USAGE_BM_Create(int x0, int y0, int xsize, int ysize, int Flags); +void GUI_USAGE_Select(GUI_USAGE_Handle hUsage); +void GUI_USAGE_AddRect(GUI_USAGE * pUsage, int x0, int y0, int xSize, int ySize); +#define GUI_USAGE_AddPixel(p, x,y) p->pAPI->pfAddPixel(p,x,y) +#define GUI_USAGE_AddHLine(p,x,y,len) p->pAPI->pfAddHLine(p,x,y,len) +#define GUI_USAGE_Clear(p) p->pAPI->pfClear(p) +#define GUI_USAGE_Delete(p) p->pAPI->pfDelete(p) +#define GUI_USAGE_GetNextDirty(p,pxOff, yOff) p->pAPI->pfGetNextDirty(p,pxOff, yOff) + +struct tsUSAGE_APIList { + tUSAGE_AddPixel * pfAddPixel; + tUSAGE_AddHLine * pfAddHLine; + tUSAGE_Clear * pfClear; + tUSAGE_CreateCompatible * pfCreateCompatible; + tUSAGE_Delete * pfDelete; + tUSAGE_GetNextDirty * pfGetNextDirty; +} ; + +struct GUI_Usage { + I16P x0, y0, XSize, YSize; + const tUSAGE_APIList * pAPI; + I16 UseCnt; +}; + + +/********************************************************************* +* +* GUI_MEMDEV +* +********************************************************************** +*/ +#if GUI_SUPPORT_MEMDEV + +typedef struct { + GUI_DEVICE * pDevice; + I16P x0, y0, XSize, YSize; + unsigned BytesPerLine; + unsigned BitsPerPixel; + GUI_HMEM hUsage; +} GUI_MEMDEV; + +#define GUI_MEMDEV_LOCK_H(h) ((GUI_MEMDEV *)GUI_LOCK_H(h)) + +void GUI_MEMDEV__CopyFromLCD (GUI_MEMDEV_Handle hMem); +void GUI_MEMDEV__GetRect (GUI_RECT * pRect); +unsigned GUI_MEMDEV__Color2Index (LCD_COLOR Color); +LCD_COLOR GUI_MEMDEV__Index2Color (int Index); +unsigned int GUI_MEMDEV__GetIndexMask(void); +void GUI_MEMDEV__SetAlphaCallback(unsigned(* pcbSetAlpha)(U8)); + +GUI_MEMDEV_Handle GUI_MEMDEV__CreateFixed(int x0, int y0, int xSize, int ySize, int Flags, + const GUI_DEVICE_API * pDeviceAPI, + const LCD_API_COLOR_CONV * pColorConvAPI); + +void GUI_MEMDEV__DrawSizedAt (GUI_MEMDEV_Handle hMem, int xPos, int yPos, int xSize, int ySize); +GUI_MEMDEV_Handle GUI_MEMDEV__GetEmptyCopy32 (GUI_MEMDEV_Handle hMem, int * pxSize, int * pySize, int * pxPos, int * pyPos); +void GUI_MEMDEV__ReadLine (int x0, int y, int x1, LCD_PIXELINDEX * pBuffer); +void GUI_MEMDEV__WriteToActiveAlpha (GUI_MEMDEV_Handle hMem,int x, int y); +void GUI_MEMDEV__WriteToActiveAt (GUI_MEMDEV_Handle hMem,int x, int y); +void GUI_MEMDEV__WriteToActiveOpaque(GUI_MEMDEV_Handle hMem,int x, int y); +void * GUI_MEMDEV__XY2PTR (int x,int y); +void * GUI_MEMDEV__XY2PTREx (GUI_MEMDEV * pDev, int x,int y); +void GUI_MEMDEV__BlendColor32 (GUI_MEMDEV_Handle hMem, U32 BlendColor, U8 BlendIntens); + +unsigned GUI__AlphaSuppressMixing(int OnOff); + +#define GUI_POS_AUTO -4095 /* Position value for auto-pos */ + +#endif + + +/********************************************************************* +* +* LCD_HL_ level defines +* +********************************************************************** +*/ +#define LCD_HL_DrawHLine GUI_pContext->pLCD_HL->pfDrawHLine +#define LCD_HL_DrawPixel GUI_pContext->pLCD_HL->pfDrawPixel + + +/********************************************************************* +* +* Helper functions +* +********************************************************************** +*/ +#define GUI_ZEROINIT(Obj) GUI_MEMSET(Obj, 0, sizeof(Obj)) +int GUI_cos(int angle); +int GUI_sin(int angle); +extern const U32 GUI_Pow10[10]; + +/* Multi-touch */ +void GUI_MTOUCH__ManagePID(int OnOff); + +/* Anti-aliased drawing */ +int GUI_AA_Init (int x0, int x1); +int GUI_AA_Init_HiRes (int x0, int x1); +void GUI_AA_Exit (void); +I16 GUI_AA_HiRes2Pixel(int HiRes); + +void GL_FillCircleAA_HiRes(int x0, int y0, int r); + +void GUI_AA__DrawCharAA2(int x0, int y0, int XSize, int YSize, int BytesPerLine, const U8 * pData); +void GUI_AA__DrawCharAA4(int x0, int y0, int XSize, int YSize, int BytesPerLine, const U8 * pData); +void GUI_AA__DrawCharAA8(int x0, int y0, int XSize, int YSize, int BytesPerLine, const U8 * pData); + +/* Alpha blending helper functions */ +int GUI__GetAlphaBuffer (U32 ** ppCurrent, U32 ** ppConvert, U32 ** ppData, int * pVXSizeMax); +int GUI__AllocAlphaBuffer(int AllocDataBuffer); +U32 * GUI__DoAlphaBlending (int x, int y, U32 * pData, int xSize, tLCDDEV_Index2Color * pfIndex2Color_DEV, int * pDone); +unsigned GUI__SetAlphaBufferSize(int xSize); + +/* System independent font routines */ +int GUI_SIF__GetCharDistX (U16P c, int * pSizeX); +void GUI_SIF__GetFontInfo (const GUI_FONT * pFont, GUI_FONTINFO * pfi); +char GUI_SIF__IsInFont (const GUI_FONT * pFont, U16 c); +const U8 * GUI_SIF__GetpCharInfo (const GUI_FONT * pFont, U16P c, unsigned SizeOfCharInfo); +int GUI_SIF__GetNumCharAreas (const GUI_FONT * pFont); +int GUI_SIF__GetCharDistX_ExtFrm(U16P c, int * pSizeX); +void GUI_SIF__GetFontInfo_ExtFrm (const GUI_FONT * pFont, GUI_FONTINFO * pfi); +char GUI_SIF__IsInFont_ExtFrm (const GUI_FONT * pFont, U16 c); +int GUI_SIF__GetCharInfo_ExtFrm (U16P c, GUI_CHARINFO_EXT * pInfo); +void GUI_SIF__ClearLine_ExtFrm (const char * s, int Len); + +/* External binary font routines */ +int GUI_XBF__GetOff (const GUI_XBF_DATA * pXBF_Data, unsigned c, U32 * pOff); +int GUI_XBF__GetOffAndSize(const GUI_XBF_DATA * pXBF_Data, unsigned c, U32 * pOff, U16 * pSize); +int GUI_XBF__GetCharDistX (U16P c, int * pSizeX); +void GUI_XBF__GetFontInfo (const GUI_FONT * pFont, GUI_FONTINFO * pInfo); +char GUI_XBF__IsInFont (const GUI_FONT * pFont, U16 c); +int GUI_XBF__GetCharInfo (U16P c, GUI_CHARINFO_EXT * pInfo); +void GUI_XBF__ClearLine (const char * s, int Len); + +/* Conversion routines */ +void GUI_AddHex (U32 v, U8 Len, char ** ps); +void GUI_AddBin (U32 v, U8 Len, char ** ps); +void GUI_AddDecMin (I32 v, char ** ps); +void GUI_AddDec (I32 v, U8 Len, char ** ps); +void GUI_AddDecShift(I32 v, U8 Len, U8 Shift, char ** ps); +long GUI_AddSign (long v, char ** ps); +int GUI_Long2Len (I32 v); + +#define GUI_UC__GetCharSize(sText) GUI_pUC_API->pfGetCharSize(sText) +#define GUI_UC__GetCharCode(sText) GUI_pUC_API->pfGetCharCode(sText) + +int GUI_UC__CalcSizeOfChar (U16 Char); +U16 GUI_UC__GetCharCodeInc (const char ** ps); +int GUI_UC__NumChars2NumBytes(const char * s, int NumChars); +int GUI_UC__NumBytes2NumChars(const char * s, int NumBytes); + +int GUI__GetLineNumChars (const char * s, int MaxNumChars); +int GUI__GetNumChars (const char * s); +int GUI__GetOverlap (U16 Char); +int GUI__GetLineDistX (const char * s, int Len); +int GUI__GetFontSizeY (void); +int GUI__HandleEOLine (const char ** ps); +void GUI__DispLine (const char * s, int Len, const GUI_RECT * pr); +void GUI__AddSpaceHex (U32 v, U8 Len, char ** ps); +void GUI__CalcTextRect (const char * pText, const GUI_RECT * pTextRectIn, GUI_RECT * pTextRectOut, int TextAlign); + +void GUI__ClearTextBackground(int xDist, int yDist); + +int GUI__WrapGetNumCharsDisp (const char * pText, int xSize, GUI_WRAPMODE WrapMode); +int GUI__WrapGetNumCharsToNextLine (const char * pText, int xSize, GUI_WRAPMODE WrapMode); +int GUI__WrapGetNumBytesToNextLine (const char * pText, int xSize, GUI_WRAPMODE WrapMode); +void GUI__memset (U8 * p, U8 Fill, int NumBytes); +void GUI__memset16 (U16 * p, U16 Fill, int NumWords); +int GUI__strlen (const char * s); +int GUI__strcmp (const char * s0, const char * s1); +int GUI__strcmp_hp (GUI_HMEM hs0, const char * s1); + +/* Get cursor position */ +int GUI__GetCursorPosX (const char * s, int Index, int MaxNumChars); +int GUI__GetCursorPosChar (const char * s, int x, int NumCharsToNextLine); +U16 GUI__GetCursorCharacter(const char * s, int Index, int MaxNumChars, int * pIsRTL); + +/* Arabic support (tbd) */ +U16 GUI__GetPresentationForm (U16 Char, U16 Next, U16 Prev, int * pIgnoreNext, const char * s); +int GUI__IsArabicCharacter (U16 c); + +/* BiDi support */ +int GUI__BIDI_Log2Vis (const char * s, int NumChars, char * pBuffer, int BufferSize); +int GUI__BIDI_GetCursorPosX (const char * s, int NumChars, int Index); +int GUI__BIDI_GetCursorPosChar (const char * s, int NumChars, int x); +U16 GUI__BIDI_GetLogChar (const char * s, int NumChars, int Index); +int GUI__BIDI_GetCharDir (const char * s, int NumChars, int Index); +int GUI__BIDI_IsNSM (U16 Char); +U16 GUI__BIDI_GetCursorCharacter(const char * s, int Index, int MaxNumChars, int * pIsRTL); +int GUI__BIDI_GetWordWrap (const char * s, int xSize, int * pxDist); +int GUI__BIDI_GetCharWrap (const char * s, int xSize); + +const char * GUI__BIDI_Log2VisBuffered(const char * s, int * pMaxNumChars); + +extern int GUI__BIDI_Enabled; + +extern int (* _pfGUI__BIDI_Log2Vis )(const char * s, int NumChars, char * pBuffer, int BufferSize); +extern int (* _pfGUI__BIDI_GetCursorPosX )(const char * s, int NumChars, int Index); +extern int (* _pfGUI__BIDI_GetCursorPosChar)(const char * s, int NumChars, int x); +extern U16 (* _pfGUI__BIDI_GetLogChar )(const char * s, int NumChars, int Index); +extern int (* _pfGUI__BIDI_GetCharDir )(const char * s, int NumChars, int Index); +extern int (* _pfGUI__BIDI_IsNSM )(U16 Char); + +/* BiDi-related function pointers */ +extern const char * (* GUI_CharLine_pfLog2Vis)(const char * s, int * pMaxNumChars); + +extern int (* GUI__GetCursorPos_pfGetPosX) (const char * s, int MaxNumChars, int Index); +extern int (* GUI__GetCursorPos_pfGetPosChar) (const char * s, int MaxNumChars, int x); +extern U16 (* GUI__GetCursorPos_pfGetCharacter)(const char * s, int MaxNumChars, int Index, int * pIsRTL); + +extern int (* GUI__Wrap_pfGetWordWrap)(const char * s, int xSize, int * pxDist); +extern int (* GUI__Wrap_pfGetCharWrap)(const char * s, int xSize); + +/* Proportional font support */ +const GUI_FONT_PROP * GUIPROP__FindChar(const GUI_FONT_PROP * pProp, U16P c); + +/* Extended proportional font support */ +const GUI_FONT_PROP_EXT * GUIPROP_EXT__FindChar(const GUI_FONT_PROP_EXT * pPropExt, U16P c); +void GUIPROP_EXT__DispLine (const char * s, int Len); +void GUIPROP_EXT__ClearLine (const char * s, int Len); +void GUIPROP_EXT__SetfpClearLine(void (* fpClearLine)(const char * s, int Len)); + +/* Reading data routines */ +U16 GUI__Read16(const U8 ** ppData); +U32 GUI__Read32(const U8 ** ppData); + +/* Virtual screen support */ +void GUI__GetOrg(int * px, int * py); +void GUI__SetOrgHook(void(* pfHook)(int x, int y)); + +/* Timer support */ +int GUI_TIMER__IsActive (void); +GUI_TIMER_TIME GUI_TIMER__GetPeriod (void); +GUI_TIMER_HANDLE GUI_TIMER__GetNextTimer (GUI_TIMER_HANDLE hTimer, U32 * pContext); +GUI_TIMER_HANDLE GUI_TIMER__GetFirstTimer (U32 * pContext); +GUI_TIMER_HANDLE GUI_TIMER__GetNextTimerLin(GUI_TIMER_HANDLE hTimer, U32 * pContext); + +/* Get function pointers for color conversion */ +tLCDDEV_Index2Color * GUI_GetpfIndex2ColorEx(int LayerIndex); +tLCDDEV_Color2Index * GUI_GetpfColor2IndexEx(int LayerIndex); + +int GUI_GetBitsPerPixelEx(int LayerIndex); + +LCD_PIXELINDEX * LCD_GetpPalConvTable (const LCD_LOGPALETTE * pLogPal); +LCD_PIXELINDEX * LCD_GetpPalConvTableUncached(const LCD_LOGPALETTE * pLogPal); +LCD_PIXELINDEX * LCD_GetpPalConvTableBM (const LCD_LOGPALETTE * pLogPal, const GUI_BITMAP * pBitmap, int LayerIndex); + +/* Setting a function for converting a color palette to an array of index values */ +void GUI_SetFuncGetpPalConvTable(LCD_PIXELINDEX * (* pFunc)(const LCD_LOGPALETTE * pLogPal, const GUI_BITMAP * pBitmap, int LayerIndex)); + +/********************************************************************* +* +* Format definitions used by streamed bitmaps +* +* IMPORTANT: DO NOT CHANGE THESE VALUES! +* THEY HAVE TO CORRESPOND TO THE DEFINITIONS WITHIN THE CODE OF THE BITMAPCONVERTER! +*/ +#define GUI_STREAM_FORMAT_INDEXED 100 /* DO NOT CHANGE */ +#define GUI_STREAM_FORMAT_RLE4 6 /* DO NOT CHANGE */ +#define GUI_STREAM_FORMAT_RLE8 7 /* DO NOT CHANGE */ +#define GUI_STREAM_FORMAT_565 8 /* DO NOT CHANGE */ +#define GUI_STREAM_FORMAT_M565 9 /* DO NOT CHANGE */ +#define GUI_STREAM_FORMAT_555 10 /* DO NOT CHANGE */ +#define GUI_STREAM_FORMAT_M555 11 /* DO NOT CHANGE */ +#define GUI_STREAM_FORMAT_RLE16 12 /* DO NOT CHANGE */ +#define GUI_STREAM_FORMAT_RLEM16 13 /* DO NOT CHANGE */ +#define GUI_STREAM_FORMAT_8888 16 /* DO NOT CHANGE */ +#define GUI_STREAM_FORMAT_RLE32 15 /* DO NOT CHANGE */ +#define GUI_STREAM_FORMAT_24 17 /* DO NOT CHANGE */ +#define GUI_STREAM_FORMAT_RLEALPHA 18 /* DO NOT CHANGE */ +#define GUI_STREAM_FORMAT_444_12 19 /* DO NOT CHANGE */ +#define GUI_STREAM_FORMAT_M444_12 20 /* DO NOT CHANGE */ +#define GUI_STREAM_FORMAT_444_12_1 21 /* DO NOT CHANGE */ +#define GUI_STREAM_FORMAT_M444_12_1 22 /* DO NOT CHANGE */ +#define GUI_STREAM_FORMAT_444_16 23 /* DO NOT CHANGE */ +#define GUI_STREAM_FORMAT_M444_16 24 /* DO NOT CHANGE */ + +void GUI__ReadHeaderFromStream (GUI_BITMAP_STREAM * pBitmapHeader, const U8 * pData); +void GUI__CreateBitmapFromStream(const GUI_BITMAP_STREAM * pBitmapHeader, const void * pData, GUI_BITMAP * pBMP, GUI_LOGPALETTE * pPAL, const GUI_BITMAP_METHODS * pMethods); + +/* Cache management */ +int GUI__ManageCache (int Cmd); +int GUI__ManageCacheEx(int LayerIndex, int Cmd); + +/********************************************************************* +* +* 2d - GL +* +********************************************************************** +*/ +void GL_DispChar (U16 c); +void GL_DrawArc (int x0, int y0, int rx, int ry, int a0, int a1); +void GL_DrawBitmap (const GUI_BITMAP * pBM, int x0, int y0); +void GL_DrawCircle (int x0, int y0, int r); +void GL_DrawEllipse (int x0, int y0, int rx, int ry, int w); +void GL_DrawHLine (int y0, int x0, int x1); +void GL_DrawPolygon (const GUI_POINT * pPoints, int NumPoints, int x0, int y0); +void GL_DrawPoint (int x, int y); +void GL_DrawLine1 (int x0, int y0, int x1, int y1); +void GL_DrawLine1Ex (int x0, int y0, int x1, int y1, unsigned * pPixelCnt); +void GL_DrawLineRel (int dx, int dy); +void GL_DrawLineTo (int x, int y); +void GL_DrawLineToEx (int x, int y, unsigned * pPixelCnt); +void GL_DrawLine (int x0, int y0, int x1, int y1); +void GL_DrawLineEx (int x0, int y0, int x1, int y1, unsigned * pPixelCnt); +void GL_MoveTo (int x, int y); +void GL_FillCircle (int x0, int y0, int r); +void GL_FillCircleAA (int x0, int y0, int r); +void GL_FillEllipse (int x0, int y0, int rx, int ry); +void GL_FillPolygon (const GUI_POINT * pPoints, int NumPoints, int x0, int y0); +void GL_SetDefault (void); + + +/********************************************************************* +* +* Callback pointers for dynamic linkage +* +********************************************************************** +Dynamic linkage pointers reduces configuration hassles. +*/ +typedef int GUI_tfTimer(void); +typedef int WM_tfHandlePID(void); + + +/********************************************************************* +* +* Cursors +* +********************************************************************** +*/ +extern GUI_CONST_STORAGE unsigned char GUI_Pixels_ArrowS[45]; +extern GUI_CONST_STORAGE unsigned char GUI_Pixels_ArrowM[60]; +extern GUI_CONST_STORAGE unsigned char GUI_Pixels_ArrowL[150]; +extern GUI_CONST_STORAGE unsigned char GUI_Pixels_CrossS[33]; +extern GUI_CONST_STORAGE unsigned char GUI_Pixels_CrossM[126]; +extern GUI_CONST_STORAGE unsigned char GUI_Pixels_CrossL[248]; +extern GUI_CONST_STORAGE unsigned char GUI_PixelsHeaderM[5 * 17]; + +extern GUI_CONST_STORAGE GUI_LOGPALETTE GUI_CursorPal; +extern GUI_CONST_STORAGE GUI_LOGPALETTE GUI_CursorPalI; + + +/********************************************************************* +* +* Text rotation +* +********************************************************************** +*/ +extern GUI_RECT GUI_RectDispString; /* Used by LCD_Rotate...() and GUI_DispStringInRect() */ + +/********************************************************************* +* +* Flag for setting transparency for 'EXT' fonts +* +********************************************************************** +*/ +extern U8 GUI__CharHasTrans; + +/********************************************************************* +* +* Multitasking support +* +********************************************************************** +*/ +extern int GUITASK__EntranceCnt; + +/********************************************************************* +* +* Bitmap related functions +* +********************************************************************** +*/ + +int GUI_GetBitmapPixelIndex(const GUI_BITMAP * pBMP, unsigned x, unsigned y); +GUI_COLOR GUI_GetBitmapPixelColor(const GUI_BITMAP * pBMP, unsigned x, unsigned y); +int GUI_GetBitmapPixelIndexEx(int BitsPerPixel, int BytesPerLine, const U8 * pData, unsigned x, unsigned y); + +void GUI__DrawBitmap16bpp (int x0, int y0, int xsize, int ysize, const U8 * pPixel, const LCD_LOGPALETTE * pLogPal, int xMag, int yMag, tLCDDEV_Index2Color * pfIndex2Color, const LCD_API_COLOR_CONV * pColorConvAPI); +void GUI__DrawBitmapA16bpp(int x0, int y0, int xSize, int ySize, const U8 * pPixel, const LCD_LOGPALETTE * pLogPal, int xMag, int yMag, tLCDDEV_Index2Color * pfIndex2Color); +void GUI__SetPixelAlpha (int x, int y, U8 Alpha, LCD_COLOR Color); +LCD_COLOR GUI__MixColors (LCD_COLOR Color, LCD_COLOR BkColor, U8 Intens); +void GUI__MixColorsBulk (U32 * pFG, U32 * pBG, U32 * pDst, unsigned OffFG, unsigned OffBG, unsigned OffDest, unsigned xSize, unsigned ySize, U8 Intens); + +extern const GUI_UC_ENC_APILIST GUI_UC_None; + +/********************************************************************* +* +* LCDDEV_L0_xxx +* +********************************************************************** +*/ +#define LCDDEV_L0_Color2Index GUI__apDevice[GUI_pContext->SelLayer]->pColorConvAPI->pfColor2Index +#define LCDDEV_L0_Index2Color GUI__apDevice[GUI_pContext->SelLayer]->pColorConvAPI->pfIndex2Color + +#define LCDDEV_L0_DrawBitmap GUI__apDevice[GUI_pContext->SelLayer]->pDeviceAPI->pfDrawBitmap +#define LCDDEV_L0_DrawHLine GUI__apDevice[GUI_pContext->SelLayer]->pDeviceAPI->pfDrawHLine +#define LCDDEV_L0_DrawVLine GUI__apDevice[GUI_pContext->SelLayer]->pDeviceAPI->pfDrawVLine +#define LCDDEV_L0_DrawPixel GUI__apDevice[GUI_pContext->SelLayer]->pDeviceAPI->pfDrawPixel +#define LCDDEV_L0_FillRect GUI__apDevice[GUI_pContext->SelLayer]->pDeviceAPI->pfFillRect +#define LCDDEV_L0_GetPixel GUI__apDevice[GUI_pContext->SelLayer]->pDeviceAPI->pfGetPixel +#define LCDDEV_L0_GetRect GUI__apDevice[GUI_pContext->SelLayer]->pDeviceAPI->pfGetRect +#define LCDDEV_L0_GetPixelIndex GUI__apDevice[GUI_pContext->SelLayer]->pDeviceAPI->pfGetPixelIndex +#define LCDDEV_L0_SetPixelIndex GUI__apDevice[GUI_pContext->SelLayer]->pDeviceAPI->pfSetPixelIndex +#define LCDDEV_L0_XorPixel GUI__apDevice[GUI_pContext->SelLayer]->pDeviceAPI->pfXorPixel +#define LCDDEV_L0_GetDevFunc GUI__apDevice[GUI_pContext->SelLayer]->pDeviceAPI->pfGetDevFunc + +void LCD_ReadRect (int x0, int y0, int x1, int y1, LCD_PIXELINDEX * pBuffer, GUI_DEVICE * pDevice); +void GUI_ReadRect (int x0, int y0, int x1, int y1, LCD_PIXELINDEX * pBuffer, GUI_DEVICE * pDevice); +void GUI_ReadRectEx(int x0, int y0, int x1, int y1, LCD_PIXELINDEX * pBuffer, GUI_DEVICE * pDevice); + +void LCD_ReadRectNoClip(int x0, int y0, int x1, int y1, LCD_PIXELINDEX * pBuffer, GUI_DEVICE * pDevice); + +/********************************************************************* +* +* Internal color management +* +********************************************************************** +*/ +typedef struct { + void (* pfSetColor) (LCD_COLOR Index); + void (* pfSetBkColor) (LCD_COLOR Index); + LCD_DRAWMODE (* pfSetDrawMode)(LCD_DRAWMODE dm); +} LCD_SET_COLOR_API; + +extern const LCD_SET_COLOR_API * LCD__pSetColorAPI; + +#define LCD__SetBkColorIndex(Index) (*GUI_pContext->LCD_pBkColorIndex = Index) +#define LCD__SetColorIndex(Index) (*GUI_pContext->LCD_pColorIndex = Index) +#define LCD__GetBkColorIndex() (*GUI_pContext->LCD_pBkColorIndex) +#define LCD__GetColorIndex() (*GUI_pContext->LCD_pColorIndex) + +/* The following 2 defines are only required for compatibility to older versions of the TTF library */ +#define LCD_BKCOLORINDEX (*GUI_pContext->LCD_pBkColorIndex) +#define LCD_COLORINDEX (*GUI_pContext->LCD_pColorIndex) + +/********************************************************************* +* +* EXTERNs for GL_CORE +* +********************************************************************** +*/ +extern const GUI_FONT * GUI__pFontDefault; + +extern GUI_SADDR GUI_CONTEXT * GUI_pContext; + +extern GUI_DEVICE * GUI__apDevice[GUI_NUM_LAYERS]; + +// +// Function pointer for converting a palette containing a color array into an index array +// +extern LCD_PIXELINDEX * (* GUI_pfGetpPalConvTable)(const LCD_LOGPALETTE * pLogPal, const GUI_BITMAP * pBitmap, int LayerIndex); + +// +// Function pointer for mixing up 2 colors +// +extern LCD_COLOR (* GUI__pfMixColors)(LCD_COLOR Color, LCD_COLOR BkColor, U8 Intens); + +// +// Function pointer for mixing up arrays of colors +// +extern void (* GUI__pfMixColorsBulk)(U32 * pFG, U32 * pBG, U32 * pDst, unsigned OffFG, unsigned OffBG, unsigned OffDest, unsigned xSize, unsigned ySize, U8 Intens); + +#ifdef GL_CORE_C + #define GUI_EXTERN +#else + #define GUI_EXTERN extern +#endif + +GUI_EXTERN const GUI_UC_ENC_APILIST * GUI_pUC_API; /* Unicode encoding API */ + +GUI_EXTERN GUI_SADDR char GUI_DecChar; +GUI_EXTERN GUI_tfTimer * GUI_pfTimerExec; +GUI_EXTERN WM_tfHandlePID * WM_pfHandlePID; +GUI_EXTERN void (* GUI_pfDispCharStyle)(U16 Char); + +GUI_EXTERN int GUI__BufferSize; // Required buffer size in pixels for alpha blending and/or antialiasing +GUI_EXTERN int GUI_AA__ClipX0; // x0-clipping value for AA module + +GUI_EXTERN I8 GUI__aNumBuffers[GUI_NUM_LAYERS]; // Number of buffers used per layer + +#if GUI_SUPPORT_ROTATION + GUI_EXTERN const tLCD_APIList * GUI_pLCD_APIList; /* Used for rotating text */ +#endif + +GUI_EXTERN I16 GUI_OrgX, GUI_OrgY; + +#undef GUI_EXTERN + + +#if defined(__cplusplus) +} +#endif + +#endif /* GUI_PRIVATE_H */ + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUI_SetOrientation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUI_SetOrientation.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,80 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUI_SetOrientation.h +Purpose : Private include file for GUI_SetOrientation_xxx +---------------------------END-OF-HEADER------------------------------ +*/ + +#ifndef GUI_SETORIENTATION_H +#define GUI_SETORIENTATION_H + +#include "GUI_Private.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/********************************************************************* +* +* Types +* +********************************************************************** +*/ +/********************************************************************* +* +* DRIVER_CONTEXT +*/ +typedef struct DRIVER_CONTEXT DRIVER_CONTEXT; + +struct DRIVER_CONTEXT { + void (* pfLog2Phys)(DRIVER_CONTEXT * pContext, int x, int y, int * px_phys, int * py_phys); + U8 * pData; + int BytesPerPixel; + int BytesPerLine; + int Orientation; + int xSize, ySize; + int vxSize, vySize; + int PixelOffset; + const GUI_ORIENTATION_API * pDrawingAPI; +}; + +/********************************************************************* +* +* Private interface +* +********************************************************************** +*/ +void GUI__Sort(int * p0, int * p1); + +#ifdef __cplusplus +} +#endif + +#endif /* GUI_SETORIENTATION_H */ + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUI_SetOrientationCX.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUI_SetOrientationCX.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,610 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUI_SetOrientationC0.c +Purpose : Runtime display orientation without cache +---------------------------END-OF-HEADER------------------------------ +*/ + +#include "GUI_SetOrientation.h" + +/********************************************************************* +* +* Defines +* +********************************************************************** +*/ +#define XY2PTR(x, y) (PIXEL *)(pContext->pData + y * pContext->BytesPerLine + x * pContext->pDrawingAPI->BytesPerPixel) + +#ifdef __cplusplus +extern "C" { +#endif + +/********************************************************************* +* +* Static code +* +********************************************************************** +*/ +/********************************************************************* +* +* Static code +* +********************************************************************** +*/ +/********************************************************************* +* +* _Sort +* +* Purpose: +* Sorts the values pointed by the given pointers. Please note that +* the same static function is also in GUI_SetOrientationC0.h +* to enable better compiler optimization. +*/ +static void _Sort(int * p0, int * p1) { + int temp; + + if (*p0 > *p1) { + temp = *p0; + *p0 = *p1; + *p1 = temp; + } +} + +/********************************************************************* +* +* Static code: Bitmap drawing routines +* +********************************************************************** +*/ +/********************************************************************* +* +* Draw Bitmap 1 BPP +*/ +static void _DrawBitLine1BPP(GUI_DEVICE * pDevice, unsigned x, unsigned y, U8 const * p, int Diff, int xsize, const LCD_PIXELINDEX * pTrans) { + LCD_PIXELINDEX IndexMask, Index0, Index1, Pixel; + unsigned (* pfGetPixelIndex)(GUI_DEVICE *, int, int); + PIXEL * pData; + int x_phys, y_phys; + DRIVER_CONTEXT * pContext; + + pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; + Index0 = *(pTrans + 0); + Index1 = *(pTrans + 1); + x += Diff; + pContext->pfLog2Phys(pContext, x, y, &x_phys, &y_phys); + pData = XY2PTR(x_phys, y_phys); + switch (GUI_pContext->DrawMode & (LCD_DRAWMODE_TRANS | LCD_DRAWMODE_XOR)) { + case 0: + do { + *pData = (PIXEL)(*p & (0x80 >> Diff)) ? Index1 : Index0; + pData += pContext->PixelOffset; + if (++Diff == 8) { + Diff = 0; + p++; + } + } while (--xsize); + break; + case LCD_DRAWMODE_TRANS: + do { + if (*p & (0x80 >> Diff)) { + *pData = Index1; + } + pData += pContext->PixelOffset; + if (++Diff == 8) { + Diff = 0; + p++; + } + } while (--xsize); + break; + case LCD_DRAWMODE_XOR | LCD_DRAWMODE_TRANS: + case LCD_DRAWMODE_XOR: + pfGetPixelIndex = pDevice->pDeviceAPI->pfGetPixelIndex; + IndexMask = pDevice->pColorConvAPI->pfGetIndexMask(); + do { + if (*p & (0x80 >> Diff)) { + Pixel = pfGetPixelIndex(pDevice, x, y); + Pixel ^= IndexMask; + *pData = Pixel; + } + pData += pContext->PixelOffset; + x++; + if (++Diff == 8) { + Diff = 0; + p++; + } + } while (--xsize); + break; + } +} + +/********************************************************************* +* +* Draw Bitmap 2 BPP +*/ +static void _DrawBitLine2BPP(GUI_DEVICE * pDevice, int x, int y, U8 const * p, int Diff, int xsize, const LCD_PIXELINDEX * pTrans) { + LCD_PIXELINDEX Pixels, PixelIndex; + int CurrentPixel, Shift, Index; + PIXEL * pData; + int x_phys, y_phys; + DRIVER_CONTEXT * pContext; + + pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; + Pixels = *p; + CurrentPixel = Diff; + x += Diff; + pContext->pfLog2Phys(pContext, x, y, &x_phys, &y_phys); + pData = XY2PTR(x_phys, y_phys); + switch (GUI_pContext->DrawMode & (LCD_DRAWMODE_TRANS | LCD_DRAWMODE_XOR)) { + case 0: + if (pTrans) { + do { + Shift = (3 - CurrentPixel) << 1; + Index = (Pixels & (0xC0 >> (6 - Shift))) >> Shift; + PixelIndex = *(pTrans + Index); + *pData = (PIXEL)PixelIndex; + pData += pContext->PixelOffset; + if (++CurrentPixel == 4) { + CurrentPixel = 0; + Pixels = *(++p); + } + } while (--xsize); + } else { + do { + Shift = (3 - CurrentPixel) << 1; + Index = (Pixels & (0xC0 >> (6 - Shift))) >> Shift; + *pData = (PIXEL)Index; + pData += pContext->PixelOffset; + if (++CurrentPixel == 4) { + CurrentPixel = 0; + Pixels = *(++p); + } + } while (--xsize); + } + break; + case LCD_DRAWMODE_TRANS: + if (pTrans) { + do { + Shift = (3 - CurrentPixel) << 1; + Index = (Pixels & (0xC0 >> (6 - Shift))) >> Shift; + if (Index) { + PixelIndex = *(pTrans + Index); + *pData = (PIXEL)PixelIndex; + } + pData += pContext->PixelOffset; + if (++CurrentPixel == 4) { + CurrentPixel = 0; + Pixels = *(++p); + } + } while (--xsize); + } else { + do { + Shift = (3 - CurrentPixel) << 1; + Index = (Pixels & (0xC0 >> (6 - Shift))) >> Shift; + if (Index) { + *pData = (PIXEL)Index; + } + pData += pContext->PixelOffset; + if (++CurrentPixel == 4) { + CurrentPixel = 0; + Pixels = *(++p); + } + } while (--xsize); + } + break; + } +} + +/********************************************************************* +* +* Draw Bitmap 4 BPP +*/ +static void _DrawBitLine4BPP(GUI_DEVICE * pDevice, int x, int y, U8 const * p, int Diff, int xsize, const LCD_PIXELINDEX * pTrans) { + LCD_PIXELINDEX Pixels, PixelIndex; + int CurrentPixel, Shift, Index; + PIXEL * pData; + int x_phys, y_phys; + DRIVER_CONTEXT * pContext; + + pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; + Pixels = *p; + CurrentPixel = Diff; + x += Diff; + pContext->pfLog2Phys(pContext, x, y, &x_phys, &y_phys); + pData = XY2PTR(x_phys, y_phys); + switch (GUI_pContext->DrawMode & (LCD_DRAWMODE_TRANS | LCD_DRAWMODE_XOR)) { + case 0: + if (pTrans) { + do { + Shift = (1 - CurrentPixel) << 2; + Index = (Pixels & (0xF0 >> (4 - Shift))) >> Shift; + PixelIndex = *(pTrans + Index); + *pData = (PIXEL)PixelIndex; + pData += pContext->PixelOffset; + if (++CurrentPixel == 2) { + CurrentPixel = 0; + Pixels = *(++p); + } + } while (--xsize); + } else { + do { + Shift = (1 - CurrentPixel) << 2; + Index = (Pixels & (0xF0 >> (4 - Shift))) >> Shift; + *pData = (PIXEL)Index; + pData += pContext->PixelOffset; + if (++CurrentPixel == 2) { + CurrentPixel = 0; + Pixels = *(++p); + } + } while (--xsize); + } + break; + case LCD_DRAWMODE_TRANS: + if (pTrans) { + do { + Shift = (1 - CurrentPixel) << 2; + Index = (Pixels & (0xF0 >> (4 - Shift))) >> Shift; + if (Index) { + PixelIndex = *(pTrans + Index); + *pData = (PIXEL)PixelIndex; + } + pData += pContext->PixelOffset; + if (++CurrentPixel == 2) { + CurrentPixel = 0; + Pixels = *(++p); + } + } while (--xsize); + } else { + do { + Shift = (1 - CurrentPixel) << 2; + Index = (Pixels & (0xF0 >> (4 - Shift))) >> Shift; + if (Index) { + *pData = (PIXEL)Index; + } + pData += pContext->PixelOffset; + if (++CurrentPixel == 2) { + CurrentPixel = 0; + Pixels = *(++p); + } + } while (--xsize); + } + break; + } +} + +/********************************************************************* +* +* Draw Bitmap 8 BPP +*/ +static void _DrawBitLine8BPP(GUI_DEVICE * pDevice, int x, int y, U8 const * p, int xsize, const LCD_PIXELINDEX * pTrans) { + LCD_PIXELINDEX Pixel; + PIXEL * pData; + int x_phys, y_phys; + DRIVER_CONTEXT * pContext; + + pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; + pContext->pfLog2Phys(pContext, x, y, &x_phys, &y_phys); + pData = XY2PTR(x_phys, y_phys); + switch (GUI_pContext->DrawMode & (LCD_DRAWMODE_TRANS | LCD_DRAWMODE_XOR)) { + case 0: + if (pTrans) { + do { + Pixel = *p++; + *pData = (PIXEL)*(pTrans + Pixel); + pData += pContext->PixelOffset; + } while (--xsize); + } else { + do { + *pData = (PIXEL)*p++; + pData += pContext->PixelOffset; + } while (--xsize); + } + break; + case LCD_DRAWMODE_TRANS: + if (pTrans) { + do { + Pixel = *p++; + if (Pixel) { + *pData = (PIXEL)*(pTrans + Pixel); + } + pData += pContext->PixelOffset; + } while (--xsize); + } else { + do { + Pixel = *p++; + if (Pixel) { + *pData = (PIXEL)Pixel; + } + pData += pContext->PixelOffset; + } while (--xsize); + } + break; + } +} + +/********************************************************************* +* +* Draw Bitmap 16 BPP +*/ +static void _DrawBitLine16BPP(GUI_DEVICE * pDevice, int x, int y, U16 const * p, int xsize) { + PIXEL * pData; + int x_phys, y_phys, PixelOffset; + DRIVER_CONTEXT * pContext; + + pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; + pContext->pfLog2Phys(pContext, x, y, &x_phys, &y_phys); + pData = XY2PTR(x_phys, y_phys); + PixelOffset = pContext->PixelOffset; + do { + *pData = (PIXEL)*p++; + pData += PixelOffset; + } while (--xsize); +} + +/********************************************************************* +* +* Draw Bitmap 32 BPP +*/ +static void _DrawBitLine32BPP(GUI_DEVICE * pDevice, int x, int y, U32 const * p, int xsize) { + PIXEL * pData; + int x_phys, y_phys, PixelOffset; + DRIVER_CONTEXT * pContext; + + pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; + pContext->pfLog2Phys(pContext, x, y, &x_phys, &y_phys); + pData = XY2PTR(x_phys, y_phys); + PixelOffset = pContext->PixelOffset; + do { + *pData = (PIXEL)*p++; + pData += PixelOffset; + } while (--xsize); +} + +/********************************************************************* +* +* Static code: API functions for drawing operations, no cache +* +********************************************************************** +*/ +/********************************************************************* +* +* _DrawBitmap_CX +*/ +static void _DrawBitmap_CX(GUI_DEVICE * pDevice, int x0, int y0, + int xSize, int ySize, + int BitsPerPixel, + int BytesPerLine, + const U8 * pData, int Diff, + const LCD_PIXELINDEX * pTrans) { + int x0_phys, y0_phys, x1_phys, y1_phys; + int i; + PIXEL * pDataBM; + DRIVER_CONTEXT * pContext; + + pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; + switch (BitsPerPixel) { + case 1: + for (i = 0; i < ySize; i++) { + _DrawBitLine1BPP(pDevice, x0, i + y0, pData, Diff, xSize, pTrans); + pData += BytesPerLine; + } + break; + case 2: + for (i = 0; i < ySize; i++) { + _DrawBitLine2BPP(pDevice, x0, i + y0, pData, Diff, xSize, pTrans); + pData += BytesPerLine; + } + break; + case 4: + for (i = 0; i < ySize; i++) { + _DrawBitLine4BPP(pDevice, x0, i + y0, pData, Diff, xSize, pTrans); + pData += BytesPerLine; + } + break; + case 8: + for (i = 0; i < ySize; i++) { + _DrawBitLine8BPP(pDevice, x0, i + y0, pData, xSize, pTrans); + pData += BytesPerLine; + } + break; + case 16: + for (i = 0; i < ySize; i++) { + _DrawBitLine16BPP(pDevice, x0, i + y0, (U16 *)pData, xSize); + pData += BytesPerLine; + } + break; + case 32: + for (i = 0; i < ySize; i++) { + _DrawBitLine32BPP(pDevice, x0, i + y0, (U32 *)pData, xSize); + pData += BytesPerLine; + } + break; + } + + pContext->pfLog2Phys(pContext, x0 + Diff, y0, &x0_phys, &y0_phys); + pContext->pfLog2Phys(pContext, x0 + Diff + xSize - 1, y0 + ySize - 1, &x1_phys, &y1_phys); + _Sort(&x0_phys, &x1_phys); + _Sort(&y0_phys, &y1_phys); + pDataBM = XY2PTR(x0_phys, y0_phys); + pDevice = pDevice->pNext; + pDevice->pDeviceAPI->pfDrawBitmap(pDevice, + x0_phys, y0_phys, + x1_phys - x0_phys + 1, + y1_phys - y0_phys + 1, + pContext->pDrawingAPI->BytesPerPixel << 3, + pContext->pDrawingAPI->BytesPerPixel * pContext->vxSize, + (U8 *)pDataBM, 0, NULL); +} + +/********************************************************************* +* +* _GetPixelIndex_CX +*/ +static unsigned int _GetPixelIndex_CX(GUI_DEVICE * pDevice, int x, int y) { + PIXEL * pData; + PIXEL Pixel; + int x_phys, y_phys; + DRIVER_CONTEXT * pContext; + + pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; + pContext->pfLog2Phys(pContext, x, y, &x_phys, &y_phys); + pData = XY2PTR(x_phys, y_phys); + Pixel = *pData; + return Pixel; +} + +/********************************************************************* +* +* _SetPixelIndex_CX +*/ +static void _SetPixelIndex_CX(GUI_DEVICE * pDevice, int x, int y, int PixelIndex) { + PIXEL * pData; + int x_phys, y_phys; + DRIVER_CONTEXT * pContext; + + pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; + pContext->pfLog2Phys(pContext, x, y, &x_phys, &y_phys); + pData = XY2PTR(x_phys, y_phys); + *pData = (PIXEL)PixelIndex; + pDevice = pDevice->pNext; + pDevice->pDeviceAPI->pfSetPixelIndex(pDevice, x_phys, y_phys, PixelIndex); +} + +/********************************************************************* +* +* _XorPixel_CX +*/ +static void _XorPixel_CX(GUI_DEVICE * pDevice, int x, int y) { + PIXEL Pixel, IndexMask; + + IndexMask = pDevice->pColorConvAPI->pfGetIndexMask(); + Pixel = pDevice->pDeviceAPI->pfGetPixelIndex(pDevice, x, y); + Pixel ^= IndexMask; + pDevice->pDeviceAPI->pfSetPixelIndex(pDevice, x, y, Pixel); +} + +/********************************************************************* +* +* _DrawHLine_CX +*/ +static void _DrawHLine_CX(GUI_DEVICE * pDevice, int x0, int y, int x1) { + pDevice->pDeviceAPI->pfFillRect(pDevice, x0, y, x1, y); +} + +/********************************************************************* +* +* _DrawVLine_CX +*/ +static void _DrawVLine_CX(GUI_DEVICE * pDevice, int x, int y0, int y1) { + pDevice->pDeviceAPI->pfFillRect(pDevice, x, y0, x, y1); +} + +/********************************************************************* +* +* _FillRect_CX +*/ +static void _FillRect_CX(GUI_DEVICE * pDevice, int x0, int y0, int x1, int y1) { + PIXEL * pData; + PIXEL * pLine; + PIXEL * pPixel; + PIXEL Pixel, IndexMask; + int x0_phys, y0_phys, x1_phys, y1_phys; + int NumPixels, NumLines; + DRIVER_CONTEXT * pContext; + + pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; + pContext->pfLog2Phys(pContext, x0, y0, &x0_phys, &y0_phys); + pContext->pfLog2Phys(pContext, x1, y1, &x1_phys, &y1_phys); + _Sort(&x0_phys, &x1_phys); + _Sort(&y0_phys, &y1_phys); + pData = pLine = XY2PTR(x0_phys, y0_phys); + NumLines = y1_phys - y0_phys + 1; + if (GUI_pContext->DrawMode & LCD_DRAWMODE_XOR) { + IndexMask = pDevice->pColorConvAPI->pfGetIndexMask(); + do { + pPixel = pLine; + NumPixels = x1_phys - x0_phys + 1; + do { + *pPixel++ ^= IndexMask; + } while (--NumPixels); + pLine += pContext->vxSize; + } while (--NumLines); + } else { + Pixel = (PIXEL)LCD__GetColorIndex(); + if (sizeof(Pixel) == 1) { + NumPixels = x1_phys - x0_phys + 1; + do { + GUI_MEMSET((U8 *)pLine, Pixel, NumPixels); + pLine += pContext->vxSize; + } while (--NumLines); + } else { + do { + pPixel = pLine; + NumPixels = x1_phys - x0_phys + 1; + do { + *pPixel++ = Pixel; + } while (--NumPixels); + pLine += pContext->vxSize; + } while (--NumLines); + } + } + pDevice = pDevice->pNext; + pDevice->pDeviceAPI->pfDrawBitmap(pDevice, + x0_phys, y0_phys, + x1_phys - x0_phys + 1, + y1_phys - y0_phys + 1, + pContext->pDrawingAPI->BytesPerPixel << 3, + pContext->pDrawingAPI->BytesPerPixel * pContext->vxSize, + (U8 *)pData, 0, NULL); +} + +/********************************************************************* +* +* Static data: Drawing API(s) +* +********************************************************************** +*/ +/********************************************************************* +* +* GUI_OrientationAPI_CX +*/ +const GUI_ORIENTATION_API API_NAME = { + _DrawBitmap_CX, + _DrawHLine_CX, + _DrawVLine_CX, + _FillRect_CX, + _GetPixelIndex_CX, + _SetPixelIndex_CX, + _XorPixel_CX, + BYTES_PER_PIXEL +}; + +#ifdef __cplusplus +} +#endif + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUI_Type.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUI_Type.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,634 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUI_Type.h +Purpose : Include file define the types used for GUI +---------------------------END-OF-HEADER------------------------------ + +Attention : Do not modify this file ! If you do, you will not + be able do update to a later GUI version ! + +*/ + +#ifndef GUITYPE_H_INCLUDED +#define GUITYPE_H_INCLUDED + +#include "LCD.h" +#include "GUIConf.h" + +/********************************************************************* +* +* Common types +*/ +typedef const char * GUI_ConstString; + +typedef LCD_COLOR GUI_COLOR; +typedef LCD_LOGPALETTE GUI_LOGPALETTE; +typedef LCD_DRAWMODE GUI_DRAWMODE; +typedef LCD_RECT GUI_RECT; + +typedef struct { + void (* pfDraw) (int x0, + int y0, + int xsize, + int ysize, + const U8 * pPixel, + const LCD_LOGPALETTE * pLogPal, + int xMag, + int yMag); + GUI_COLOR (* pfIndex2Color)(unsigned Index); + void (* pfDrawHW)(int x0, + int y0, + int xsize, + int ysize, + const U8 * pPixel, + const LCD_LOGPALETTE * pLogPal, + int xMag, + int yMag); + const LCD_API_COLOR_CONV * pColorConvAPI; +} GUI_BITMAP_METHODS; + +typedef struct { + U16P XSize; + U16P YSize; + U16P BytesPerLine; + U16P BitsPerPixel; + const U8 * pData; + const GUI_LOGPALETTE * pPal; + const GUI_BITMAP_METHODS * pMethods; +} GUI_BITMAP; + +/* This structure may not be changed because the data that it + expects is read in binary form (via any kind of interface, + at runtime). + This structure should therefor not be changed. +*/ +typedef struct { + U16 ID; + U16 Format; + U16 XSize; + U16 YSize; + U16 BytesPerLine; + U16 BitsPerPixel; + U16 NumColors; + U16 HasTrans; +} GUI_BITMAP_STREAM; + +typedef struct { + int Cmd; + U32 v; + void * p; +} GUI_BITMAPSTREAM_PARAM; + +typedef struct { + int XSize; + int YSize; + int BitsPerPixel; + int NumColors; + int HasTrans; +} GUI_BITMAPSTREAM_INFO; + +typedef void * (* GUI_BITMAPSTREAM_CALLBACK)(GUI_BITMAPSTREAM_PARAM * pParam); + +typedef struct { + int x,y; + U8 Pressed; + U8 Layer; +} GUI_PID_STATE; + +typedef struct { + int Key; + int Pressed; +} GUI_KEY_STATE; + +typedef struct { + int xPos; + int yPos; + int xSize; + int ySize; + int Delay; +} GUI_GIF_IMAGE_INFO; + +typedef struct { + int xSize; + int ySize; + int NumImages; +} GUI_GIF_INFO; + +typedef struct GUI_REGISTER_EXIT GUI_REGISTER_EXIT; + +struct GUI_REGISTER_EXIT { + void (* pfVoid)(void); + GUI_REGISTER_EXIT * pNext; +}; + +/********************************************************************* +* +* FONT structures +*/ + +/* Translation list. Translates a character code into up to 2 + indices of images to display on top of each other; + 'á' -> index('a'), index('´') */ +typedef struct { + I16P c0; + I16P c1; +} GUI_FONT_TRANSLIST; + +typedef struct { + U16P FirstChar; + U16P LastChar; + const GUI_FONT_TRANSLIST * pList; +} GUI_FONT_TRANSINFO; + +typedef struct { + U8 XSize; + U8 XDist; + U8 BytesPerLine; + const unsigned char * pData; +} GUI_CHARINFO; + +typedef struct { + U8 XSize; + U8 YSize; + I8 XPos; + I8 YPos; + U8 XDist; + const unsigned char * pData; +} GUI_CHARINFO_EXT; + +typedef struct GUI_FONT_PROP { + U16P First; /* First character */ + U16P Last; /* Last character */ + const GUI_CHARINFO * paCharInfo; /* Address of first character */ + const struct GUI_FONT_PROP * pNext; /* Pointer to next */ +} GUI_FONT_PROP; + +typedef struct GUI_FONT_PROP_EXT { + U16P First; /* First character */ + U16P Last; /* Last character */ + const GUI_CHARINFO_EXT * paCharInfo; /* Address of first character */ + const struct GUI_FONT_PROP_EXT * pNext; /* Pointer to next */ +} GUI_FONT_PROP_EXT; + +typedef struct { + const unsigned char * pData; + const U8 * pTransData; + const GUI_FONT_TRANSINFO * pTrans; + U16P FirstChar; + U16P LastChar; + U8 XSize; + U8 XDist; + U8 BytesPerLine; +} GUI_FONT_MONO; + +/********************************************************************* +* +* FONT structures +* +* This structure is used when retrieving information about a font. +* It is designed for future expansion without incompatibilities. +*/ +typedef struct { + U16 Flags; + U8 Baseline; + U8 LHeight; /* height of a small lower case character (a,x) */ + U8 CHeight; /* height of a small upper case character (A,X) */ +} GUI_FONTINFO; + +#define GUI_FONTINFO_FLAG_PROP (1 << 0) /* Is proportional */ +#define GUI_FONTINFO_FLAG_MONO (1 << 1) /* Is monospaced */ +#define GUI_FONTINFO_FLAG_AA (1 << 2) /* Is an antialiased font */ +#define GUI_FONTINFO_FLAG_AA2 (1 << 3) /* Is an antialiased font, 2bpp */ +#define GUI_FONTINFO_FLAG_AA4 (1 << 4) /* Is an antialiased font, 4bpp */ +#define GUI_FONTINFO_FLAG_PROPFRM (1 << 5) /* Is proportional, framed */ + +/********************************************************************* +* +* UNICODE Encoding +*/ +typedef U16 tGUI_GetCharCode (const char * s); +typedef int tGUI_GetCharSize (const char * s); +typedef int tGUI_CalcSizeOfChar(U16 Char); +typedef int tGUI_Encode (char * s, U16 Char); + +typedef struct { + tGUI_GetCharCode * pfGetCharCode; + tGUI_GetCharSize * pfGetCharSize; + tGUI_CalcSizeOfChar * pfCalcSizeOfChar; + tGUI_Encode * pfEncode; +} GUI_UC_ENC_APILIST; + +/********************************************************************* +* +* FONT Encoding +*/ +typedef int tGUI_GetLineDistX(const char * s, int Len); +typedef int tGUI_GetLineLen (const char * s, int MaxLen); +typedef void tGL_DispLine (const char * s, int Len); + +typedef struct { + tGUI_GetLineDistX * pfGetLineDistX; + tGUI_GetLineLen * pfGetLineLen; + tGL_DispLine * pfDispLine; +} tGUI_ENC_APIList; + +extern const tGUI_ENC_APIList GUI_ENC_APIList_SJIS; +extern const tGUI_ENC_APIList GUI_ENC_APIList_EXT; + +/********************************************************************* +* +* FONT methods +*/ +typedef struct GUI_FONT GUI_FONT; + +typedef void GUI_DISPCHAR (U16 c); +typedef int GUI_GETCHARDISTX(U16P c, int * pSizeX); +typedef void GUI_GETFONTINFO (const GUI_FONT * pFont, GUI_FONTINFO * pfi); +typedef char GUI_ISINFONT (const GUI_FONT * pFont, U16 c); +typedef int GUI_GETCHARINFO (U16P c, GUI_CHARINFO_EXT * pInfo); + +#define DECLARE_FONT(Type) \ +void GUI##Type##_DispChar (U16P c); \ +int GUI##Type##_GetCharDistX(U16P c, int * pSizeX); \ +void GUI##Type##_GetFontInfo (const GUI_FONT * pFont, GUI_FONTINFO * pfi); \ +char GUI##Type##_IsInFont (const GUI_FONT * pFont, U16 c); \ +int GUI##Type##_GetCharInfo (U16P c, GUI_CHARINFO_EXT * pInfo) + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +DECLARE_FONT(MONO); +DECLARE_FONT(PROP); +DECLARE_FONT(PROP_EXT); +DECLARE_FONT(PROP_FRM); +DECLARE_FONT(PROPAA); +DECLARE_FONT(PROP_AA2); +DECLARE_FONT(PROP_AA2_EXT); +DECLARE_FONT(PROP_AA4); +DECLARE_FONT(PROP_AA4_EXT); + +/* MONO: Monospaced fonts */ +#define GUI_FONTTYPE_MONO \ + GUIMONO_DispChar, \ + GUIMONO_GetCharDistX, \ + GUIMONO_GetFontInfo, \ + GUIMONO_IsInFont, \ + (GUI_GETCHARINFO *)0, \ + (tGUI_ENC_APIList*)0 + +/* PROP: Proportional fonts */ +#define GUI_FONTTYPE_PROP \ + GUIPROP_DispChar, \ + GUIPROP_GetCharDistX, \ + GUIPROP_GetFontInfo, \ + GUIPROP_IsInFont, \ + (GUI_GETCHARINFO *)0, \ + (tGUI_ENC_APIList*)0 + +/* PROP_EXT: Extended proportional fonts */ +#define GUI_FONTTYPE_PROP_EXT \ + GUIPROP_EXT_DispChar, \ + GUIPROP_EXT_GetCharDistX, \ + GUIPROP_EXT_GetFontInfo, \ + GUIPROP_EXT_IsInFont, \ + GUIPROP_EXT_GetCharInfo, \ + &GUI_ENC_APIList_EXT + +/* PROP_FRM: Extended proportional fonts, framed */ +#define GUI_FONTTYPE_PROP_FRM \ + GUIPROP_FRM_DispChar, \ + GUIPROP_FRM_GetCharDistX, \ + GUIPROP_FRM_GetFontInfo, \ + GUIPROP_FRM_IsInFont, \ + (GUI_GETCHARINFO *)0, \ + (tGUI_ENC_APIList*)0 + +/* PROP: Proportional fonts SJIS */ +#define GUI_FONTTYPE_PROP_SJIS \ + GUIPROP_DispChar, \ + GUIPROP_GetCharDistX, \ + GUIPROP_GetFontInfo, \ + GUIPROP_IsInFont, \ + (GUI_GETCHARINFO *)0, \ + &GUI_ENC_APIList_SJIS + +/* PROPAA: Proportional, antialiased fonts */ +#define GUI_FONTTYPE_PROPAA \ + GUIPROPAA_DispChar, \ + GUIPROPAA_GetCharDistX, \ + GUIPROPAA_GetFontInfo, \ + GUIPROPAA_IsInFont, \ + (GUI_GETCHARINFO *)0, \ + (tGUI_ENC_APIList*)0 + +/* PROP_AA2: Proportional, antialiased fonts, 2bpp */ +#define GUI_FONTTYPE_PROP_AA2 \ + GUIPROP_AA2_DispChar, \ + GUIPROP_AA2_GetCharDistX, \ + GUIPROP_AA2_GetFontInfo, \ + GUIPROP_AA2_IsInFont, \ + (GUI_GETCHARINFO *)0, \ + (tGUI_ENC_APIList*)0 + +/* PROP_AA2_EXT: Proportional, antialiased fonts, 2bpp, extended font information */ +#define GUI_FONTTYPE_PROP_AA2_EXT \ + GUIPROP_AA2_EXT_DispChar, \ + GUIPROP_EXT_GetCharDistX, \ + GUIPROP_EXT_GetFontInfo, \ + GUIPROP_EXT_IsInFont, \ + GUIPROP_EXT_GetCharInfo, \ + &GUI_ENC_APIList_EXT + +/* PROP_AA2: Proportional, antialiased fonts, 2bpp, SJIS encoding */ +#define GUI_FONTTYPE_PROP_AA2_SJIS \ + GUIPROP_AA2_DispChar, \ + GUIPROP_AA2_GetCharDistX, \ + GUIPROP_AA2_GetFontInfo, \ + GUIPROP_AA2_IsInFont, \ + (GUI_GETCHARINFO *)0, \ + GUI_ENCODE_SJIS + +/* PROP_AA4: Proportional, antialiased fonts, 4bpp */ +#define GUI_FONTTYPE_PROP_AA4 \ + GUIPROP_AA4_DispChar, \ + GUIPROP_AA4_GetCharDistX, \ + GUIPROP_AA4_GetFontInfo, \ + GUIPROP_AA4_IsInFont, \ + (GUI_GETCHARINFO *)0, \ + (tGUI_ENC_APIList*)0 + +/* PROP_AA4_EXT: Proportional, antialiased fonts, 4bpp, extended font information */ +#define GUI_FONTTYPE_PROP_AA4_EXT \ + GUIPROP_AA4_EXT_DispChar, \ + GUIPROP_EXT_GetCharDistX, \ + GUIPROP_EXT_GetFontInfo, \ + GUIPROP_EXT_IsInFont, \ + GUIPROP_EXT_GetCharInfo, \ + &GUI_ENC_APIList_EXT + +/* PROP_AA4: Proportional, antialiased fonts, 4bpp, SJIS encoding */ +#define GUI_FONTTYPE_PROP_AA4_SJIS \ + GUIPROP_AA4_DispChar, \ + GUIPROP_AA4_GetCharDistX, \ + GUIPROP_AA4_GetFontInfo, \ + GUIPROP_AA4_IsInFont, \ + (GUI_GETCHARINFO *)0, \ + GUI_ENCODE_SJIS + +#if defined(__cplusplus) + } +#endif + +struct GUI_FONT { + GUI_DISPCHAR * pfDispChar; + GUI_GETCHARDISTX * pfGetCharDistX; + GUI_GETFONTINFO * pfGetFontInfo; + GUI_ISINFONT * pfIsInFont; + GUI_GETCHARINFO * pfGetCharInfo; + const tGUI_ENC_APIList* pafEncode; + U8 YSize; + U8 YDist; + U8 XMag; + U8 YMag; + union { + const void * pFontData; + const GUI_FONT_MONO * pMono; + const GUI_FONT_PROP * pProp; + const GUI_FONT_PROP_EXT * pPropExt; + } p; + U8 Baseline; + U8 LHeight; /* Height of a small lower case character (a,x) */ + U8 CHeight; /* Height of a small upper case character (A,X) */ +}; + +/********************************************************************* +* +* Bitmap serialization (BMP) +*/ +typedef void GUI_CALLBACK_VOID_U8_P(U8 Data, void * p); + +/********************************************************************* +* +* System independent font structures (SIF) +*/ +typedef struct { + U32 ID; /* Font file ID */ + U16 YSize; /* Height of font */ + U16 YDist; /* Space of font Y */ + U16 Baseline; /* Index of baseline */ + U16 LHeight; /* Height of a small lower case character (a) */ + U16 CHeight; /* Height of a upper case character (A) */ + U16 NumAreas; /* Number of character areas */ +} GUI_SI_FONT; + +typedef struct { + U16 First; /* Index of first character */ + U16 Last; /* Index of last character */ +} GUI_SIF_CHAR_AREA; + +typedef struct { + U16 XSize; /* Size of bitmap data in X */ + U16 XDist; /* Number of pixels for increment cursor in X */ + U16 BytesPerLine; /* Number of bytes per line */ + U16 Dummy; + U32 OffData; /* Offset of pixel data */ +} GUI_SIF_CHARINFO; + +typedef struct { + U16 XSize; /* Size of bitmap data in X */ + U16 YSize; /* Size of bitmap data in X */ + I16 XOff; /* Display offset of bitmap data in X */ + I16 YOff; /* Display offset of bitmap data in Y */ + U16 XDist; /* Number of pixels for increment cursor in X */ + U16 Dummy; + U32 OffData; /* Offset of pixel data */ +} GUI_SIF_CHARINFO_EXT; + +typedef struct tGUI_SIF_APIList_struct { + GUI_DISPCHAR * pfDispChar; + GUI_GETCHARDISTX * pfGetCharDistX; + GUI_GETFONTINFO * pfGetFontInfo; + GUI_ISINFONT * pfIsInFont; + GUI_GETCHARINFO * pfGetCharInfo; + const tGUI_ENC_APIList* pafEncode; +} tGUI_SIF_APIList; + +#define GUI_SIF_TYPE tGUI_SIF_APIList +#define GUI_SIF_TYPE_PROP &GUI_SIF_APIList_Prop +#define GUI_SIF_TYPE_PROP_EXT &GUI_SIF_APIList_Prop_Ext +#define GUI_SIF_TYPE_PROP_FRM &GUI_SIF_APIList_Prop_Frm +#define GUI_SIF_TYPE_PROP_AA2 &GUI_SIF_APIList_Prop_AA2 +#define GUI_SIF_TYPE_PROP_AA4 &GUI_SIF_APIList_Prop_AA4 +#define GUI_SIF_TYPE_PROP_AA2_EXT &GUI_SIF_APIList_Prop_AA2_EXT +#define GUI_SIF_TYPE_PROP_AA4_EXT &GUI_SIF_APIList_Prop_AA4_EXT + +/********************************************************************* +* +* External binary font structures (XBF) +*/ +typedef int GUI_XBF_GET_DATA_FUNC(U32 Off, U16 NumBytes, void * pVoid, void * pBuffer); + +typedef struct { + U16 First; /* First character of font */ + U16 Last; /* Last character of font */ + void * pVoid; /* Void pointer passed to GetData-function */ + GUI_XBF_GET_DATA_FUNC * pfGetData; /* Pointer to callback function */ +} GUI_XBF_DATA; + +typedef struct tGUI_XBF_APIList_struct { + GUI_DISPCHAR * pfDispChar; + GUI_GETCHARDISTX * pfGetCharDistX; + GUI_GETFONTINFO * pfGetFontInfo; + GUI_ISINFONT * pfIsInFont; + GUI_GETCHARINFO * pfGetCharInfo; + const tGUI_ENC_APIList* pafEncode; +} tGUI_XBF_APIList; + +#define GUI_XBF_TYPE tGUI_XBF_APIList +#define GUI_XBF_TYPE_PROP &GUI_XBF_APIList_Prop +#define GUI_XBF_TYPE_PROP_EXT &GUI_XBF_APIList_Prop_Ext +#define GUI_XBF_TYPE_PROP_FRM &GUI_XBF_APIList_Prop_Frm +#define GUI_XBF_TYPE_PROP_AA2_EXT &GUI_XBF_APIList_Prop_AA2_Ext +#define GUI_XBF_TYPE_PROP_AA4_EXT &GUI_XBF_APIList_Prop_AA4_Ext + +/********************************************************************* +* +* TrueType support (TTF) +*/ +typedef struct { + const void * pData; /* Pointer to TTF font file in addressable memory area */ + U32 NumBytes; /* Size of file in bytes */ +} GUI_TTF_DATA; + +typedef struct { + GUI_TTF_DATA * pTTF; /* Pointer to GUI_TTF_DATA structure which contains location and size of font file */ + U32 aImageTypeBuffer[4]; /* Buffer for image type structure */ + int PixelHeight; /* Pixel height of new font. It means the height of the surrounding rectangle + * between the glyphs 'g' anf 'f'. Please notice that it is not the distance + * between two lines of text. With other words the value returned byGUI_GetFontSizeY() + * is not identically with this value. */ + int FaceIndex; /* Some font files can contain more than one font face. In case of more than one face + * this index specifies the zero based face index to be used to create the font. + * Usually 0. */ +} GUI_TTF_CS; + +/********************************************************************* +* +* Task synchronization +*/ +typedef void (* GUI_SIGNAL_EVENT_FUNC) (void); +typedef void (* GUI_WAIT_EVENT_FUNC) (void); +typedef void (* GUI_WAIT_EVENT_TIMED_FUNC)(int Period); + +/********************************************************************* +* +* Memory management +*/ +#ifndef GUI_HMEM + #define GUI_HMEM I32 +#endif +#define GUI_HMEM_NULL (0) +typedef GUI_HMEM GUI_HWIN; +typedef GUI_HMEM GUI_HSPRITE; + +/********************************************************************* +* +* Multi touch input +*/ +#ifndef GUI_MTOUCH_MAX_NUM_POINTS + #define GUI_MTOUCH_MAX_NUM_POINTS 10 +#endif + +typedef struct { + I32 x; + I32 y; + U32 Id; + U16 Flags; +} GUI_MTOUCH_INPUT; + +typedef struct { + int LayerIndex; + unsigned NumPoints; + GUI_TIMER_TIME TimeStamp; + GUI_HMEM hInput; +} GUI_MTOUCH_EVENT; + +typedef void (* T_GUI_MTOUCH_STOREEVENT)(GUI_MTOUCH_EVENT *, GUI_MTOUCH_INPUT * pInput); + +/********************************************************************* +* +* Hardware routines +*/ +typedef struct { + // + // 8 Bit access + // + void (* pfWrite8_A0) (U8 Data); + void (* pfWrite8_A1) (U8 Data); + void (* pfWriteM8_A0) (U8 * pData, int NumItems); + void (* pfWriteM8_A1) (U8 * pData, int NumItems); + U8 (* pfRead8_A0) (void); + U8 (* pfRead8_A1) (void); + void (* pfReadM8_A0) (U8 * pData, int NumItems); + void (* pfReadM8_A1) (U8 * pData, int NumItems); + // + // 16 Bit access + // + void (* pfWrite16_A0) (U16 Data); + void (* pfWrite16_A1) (U16 Data); + void (* pfWriteM16_A0)(U16 * pData, int NumItems); + void (* pfWriteM16_A1)(U16 * pData, int NumItems); + U16 (* pfRead16_A0) (void); + U16 (* pfRead16_A1) (void); + void (* pfReadM16_A0) (U16 * pData, int NumItems); + void (* pfReadM16_A1) (U16 * pData, int NumItems); + // + // 32 Bit access + // + void (* pfWrite32_A0) (U32 Data); + void (* pfWrite32_A1) (U32 Data); + void (* pfWriteM32_A0)(U32 * pData, int NumItems); + void (* pfWriteM32_A1)(U32 * pData, int NumItems); + U32 (* pfRead32_A0) (void); + U32 (* pfRead32_A1) (void); + void (* pfReadM32_A0) (U32 * pData, int NumItems); + void (* pfReadM32_A1) (U32 * pData, int NumItems); + // + // SPI access + // + void (* pfSetCS) (U8 NotActive); + // + // Common routines + // + void (* pfFlushBuffer)(void); +} GUI_PORT_API; + +#endif /* GUITYPE_H_INCLUDED */ + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUI_VNC.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUI_VNC.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,137 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUI_VNC.h +Purpose : Publics for the VNC server +---------------------------END-OF-HEADER------------------------------ + +Attention : Do not modify this file ! If you do, you will not + be able do update to a later GUI version ! + +*/ + +#ifndef GUI_VNC_H +#define GUI_VNC_H + +#include "GUI_Private.h" + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + + +/********************************************************************* +* +* Defines +* +********************************************************************** +*/ +#define GUI_VNC_NO_ERROR 0 +#define GUI_VNC_ERROR_MISC 1 +#define GUI_VNC_ERROR_WRONGFORMAT 2 + +#define GUI_DES_ENCRYPT 0 +#define GUI_DES_DECRYPT 1 + +/********************************************************************* +* +* Types +* +********************************************************************** +*/ +typedef int (*GUI_tSend) (const U8 * pData, int len, void* pConnectInfo); +typedef int (*GUI_tReceive)( U8 * pData, int len, void* pConnectInfo); + +typedef struct GUI_VNC_CONTEXT { + GUI_DEVICE * pDevice; + struct GUI_VNC_CONTEXT * pNext; + int LayerIndex; + int BytesPerPixel; + int BitsPerPixel; // Note, that from within the VNC server the function LCD_GetBitsBerPixel() can not be used because the VNC server runs in a separate thread and the device chain can change during the function call + // + // Connection related data + // + GUI_tSend pfSend; + GUI_tReceive pfReceive; + void * pConnectInfo; + U16 ServerIndex; + // + // Display related info + // + int x0Dirty, y0Dirty, x1Dirty, y1Dirty; + int XSize, YSize; + int xOrg, yOrg, xOrgNew, yOrgNew; + int OrgLock; + // + // Status + // + char ClientSupportsHextile; + char IsBigEndian; +} GUI_VNC_CONTEXT; + +typedef struct { + void (* pfGetChallenge)(U8 * pChallenge); + void (* pfGetResponse )(U8 * pResponse ); +} GUI_VNC_AUTHENTICATION; + +/********************************************************************* +* +* Private Functions +* +********************************************************************** +*/ +void GUI_VNC_SetDESKey(U8 * pKey, int Mode); +void GUI_VNC_DoDES (U8 * pInblock, U8 * pOutblock); + +/********************************************************************* +* +* Public Functions +* +********************************************************************** +*/ +void GUI_VNC_AttachToLayer (GUI_VNC_CONTEXT * pContext, int LayerIndex); +void GUI_VNC_EnableKeyboardInput(int OnOff); +int GUI_VNC_GetNumConnections (void); +int GUI_VNC_Process (GUI_VNC_CONTEXT * pContext, GUI_tSend pfSend, GUI_tReceive pfReceive, void * pConnectInfo); +void GUI_VNC_RingBell (void); +void GUI_VNC_SetAuthentication (GUI_VNC_AUTHENTICATION * pAuthentication); +void GUI_VNC_SetPassword (U8 * sPassword); +void GUI_VNC_SetProgName (const char * sProgName); +void GUI_VNC_SetSize (unsigned xSize, unsigned ySize); +void GUI_VNC_SetLockFrame (unsigned OnOff); + +/**** External routine to link the server to the system ... USER defined ! ****/ +int GUI_VNC_X_StartServer(int LayerIndex, int ServerIndex); +void GUI_VNC_X_getpeername(U32 * Addr); + +#if defined(__cplusplus) + } +#endif + +#endif /* Avoid multiple inclusion */ + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/GUI_Version.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/GUI_Version.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,40 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GUI_Version.h +Purpose : Include file defining current GUI version +---------------------------END-OF-HEADER------------------------------ +*/ + +#ifndef GUI_VERSION_H +#define GUI_VERSION_H + +#define GUI_VERSION 52408 + +#endif /* Avoid multiple inclusion */ + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/Global.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/Global.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,63 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : GLOBAL.h +Purpose : Global types etc. +---------------------------END-OF-HEADER------------------------------ +*/ + +#ifndef GLOBAL_H // Guard against multiple inclusion +#define GLOBAL_H + +/********************************************************************* +* +* Macros +* +********************************************************************** +*/ +#ifndef U8 + #define U8 unsigned char +#endif +#ifndef U16 + #define U16 unsigned short +#endif +#ifndef U32 + #define U32 unsigned long +#endif +#ifndef I8 + #define I8 signed char +#endif +#ifndef I16 + #define I16 signed short +#endif +#ifndef I32 + #define I32 signed long +#endif + +#endif // Avoid multiple inclusion + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/HEADER.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/HEADER.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,199 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : HEADER.h +Purpose : HEADER include +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef HEADER_H +#define HEADER_H + +#include "WM.h" +#include "DIALOG_Intern.h" /* Req. for Create indirect data structure */ +#include "WIDGET.h" + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) + extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Public Types +* +********************************************************************** +*/ + +typedef WM_HMEM HEADER_Handle; + +typedef struct { + GUI_COLOR aColorFrame[2]; + GUI_COLOR aColorUpper[2]; + GUI_COLOR aColorLower[2]; + GUI_COLOR ColorArrow; +} HEADER_SKINFLEX_PROPS; + +/********************************************************************* +* +* Create functions +* +********************************************************************** +*/ + +HEADER_Handle HEADER_Create (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags, int SpecialFlags); +HEADER_Handle HEADER_CreateAttached(WM_HWIN hParent, int Id, int SpecialFlags); +HEADER_Handle HEADER_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id); +HEADER_Handle HEADER_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes); +HEADER_Handle HEADER_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); + +/********************************************************************* +* +* The callback ... +* +* Do not call it directly ! It is only to be used from within an +* overwritten callback. +*/ +void HEADER_Callback(WM_MESSAGE * pMsg); + +/********************************************************************* +* +* Standard member functions +* +********************************************************************** +*/ + +#define HEADER_EnableMemdev(hObj) WM_EnableMemdev (hObj) +#define HEADER_DisableMemdev(hObj) WM_DisableMemdev (hObj) +#define HEADER_Delete(hObj) WM_DeleteWindow (hObj) +#define HEADER_Paint(hObj) WM_Paint (hObj) +#define HEADER_Invalidate(hObj) WM_InvalidateWindow(hObj) + +/********************************************************************* +* +* Global functions +* +********************************************************************** +*/ + +/* Set defaults */ +GUI_COLOR HEADER_SetDefaultArrowColor(GUI_COLOR Color); +GUI_COLOR HEADER_SetDefaultBkColor (GUI_COLOR Color); +const GUI_CURSOR * HEADER_SetDefaultCursor (const GUI_CURSOR * pCursor); +const GUI_FONT * HEADER_SetDefaultFont (const GUI_FONT * pFont); +int HEADER_SetDefaultBorderH (int Spacing); +int HEADER_SetDefaultBorderV (int Spacing); +GUI_COLOR HEADER_SetDefaultTextColor (GUI_COLOR Color); + +/* Get defaults */ +GUI_COLOR HEADER_GetDefaultArrowColor(void); +GUI_COLOR HEADER_GetDefaultBkColor (void); +const GUI_CURSOR * HEADER_GetDefaultCursor (void); +const GUI_FONT * HEADER_GetDefaultFont (void); +int HEADER_GetDefaultBorderH (void); +int HEADER_GetDefaultBorderV (void); +GUI_COLOR HEADER_GetDefaultTextColor (void); + +/********************************************************************* +* +* Member functions +* +********************************************************************** +*/ +void HEADER_AddItem (HEADER_Handle hObj, int Width, const char * s, int Align); +void HEADER_DeleteItem (HEADER_Handle hObj, unsigned Index); +GUI_COLOR HEADER_GetArrowColor (HEADER_Handle hObj); +GUI_COLOR HEADER_GetBkColor (HEADER_Handle hObj); +int HEADER_GetHeight (HEADER_Handle hObj); +int HEADER_GetItemWidth (HEADER_Handle hObj, unsigned int Index); +int HEADER_GetNumItems (HEADER_Handle hObj); +int HEADER_GetSel (HEADER_Handle hObj); +GUI_COLOR HEADER_GetTextColor (HEADER_Handle hObj); +int HEADER_GetUserData (HEADER_Handle hObj, void * pDest, int NumBytes); +void HEADER_SetArrowColor (HEADER_Handle hObj, GUI_COLOR Color); +void HEADER_SetBitmap (HEADER_Handle hObj, unsigned int Index, const GUI_BITMAP * pBitmap); +void HEADER_SetBitmapEx (HEADER_Handle hObj, unsigned int Index, const GUI_BITMAP * pBitmap, int x, int y); +void HEADER_SetBkColor (HEADER_Handle hObj, GUI_COLOR Color); +void HEADER_SetBMP (HEADER_Handle hObj, unsigned int Index, const void * pBitmap); +void HEADER_SetBMPEx (HEADER_Handle hObj, unsigned int Index, const void * pBitmap, int x, int y); +void HEADER_SetDirIndicator (HEADER_Handle hObj, int Column, int Reverse); /* !!!Not to be documented!!! */ +void HEADER_SetDragLimit (HEADER_Handle hObj, unsigned DragLimit); +unsigned HEADER_SetFixed (HEADER_Handle hObj, unsigned Fixed); +void HEADER_SetFont (HEADER_Handle hObj, const GUI_FONT * pFont); +void HEADER_SetHeight (HEADER_Handle hObj, int Height); +void HEADER_SetTextAlign (HEADER_Handle hObj, unsigned int Index, int Align); +void HEADER_SetItemText (HEADER_Handle hObj, unsigned int Index, const char * s); +void HEADER_SetItemWidth (HEADER_Handle hObj, unsigned int Index, int Width); +void HEADER_SetScrollPos (HEADER_Handle hObj, int ScrollPos); +void HEADER_SetStreamedBitmap (HEADER_Handle hObj, unsigned int Index, const GUI_BITMAP_STREAM * pBitmap); +void HEADER_SetStreamedBitmapEx(HEADER_Handle hObj, unsigned int Index, const GUI_BITMAP_STREAM * pBitmap, int x, int y); +void HEADER_SetTextColor (HEADER_Handle hObj, GUI_COLOR Color); +int HEADER_SetUserData (HEADER_Handle hObj, const void * pSrc, int NumBytes); + +/********************************************************************* +* +* Member functions: Skinning +* +********************************************************************** +*/ +void HEADER_GetSkinFlexProps (HEADER_SKINFLEX_PROPS * pProps, int Index); +void HEADER_SetSkinClassic (HEADER_Handle hObj); +void HEADER_SetSkin (HEADER_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); +int HEADER_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); +void HEADER_SetSkinFlexProps (const HEADER_SKINFLEX_PROPS * pProps, int Index); +void HEADER_SetDefaultSkinClassic(void); +WIDGET_DRAW_ITEM_FUNC * HEADER_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); + +#define HEADER_SKIN_FLEX HEADER_DrawSkinFlex + +/********************************************************************* +* +* Macros for compatibility with older versions +* +********************************************************************** +*/ + +#ifdef HEADER_SPACING_H + #define HEADER_BORDER_H_DEFAULT HEADER_SPACING_H +#endif +#ifdef HEADER_SPACING_V + #define HEADER_BORDER_V_DEFAULT HEADER_SPACING_V +#endif +#define HEADER_SetDefaultSpacingH(Value) HEADER_SetDefaultBorderH(Value) +#define HEADER_SetDefaultSpacingV(Value) HEADER_SetDefaultBorderV(Value) +#define HEADER_GetDefaultSpacingH() HEADER_GetDefaultBorderH() +#define HEADER_GetDefaultSpacingV() HEADER_GetDefaultBorderV() + +#if defined(__cplusplus) + } +#endif + +#endif // GUI_WINSUPPORT +#endif // HEADER_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/ICONVIEW.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/ICONVIEW.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,133 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : ICONVIEW.h +Purpose : ICONVIEW include +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef ICONVIEW_H +#define ICONVIEW_H + +#include "WM.h" +#include "DIALOG_Intern.h" /* Req. for Create indirect data structure */ +#include "WIDGET.h" + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) + extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Defines +* +********************************************************************** +*/ +// +// Status- and create flags +// +#define ICONVIEW_CF_AUTOSCROLLBAR_V (1 << 1) +#define ICONVIEW_SF_AUTOSCROLLBAR_V ICONVIEW_CF_AUTOSCROLLBAR_V + +// +// Color indices +// +#define ICONVIEW_CI_BK 0 +#define ICONVIEW_CI_UNSEL 0 +#define ICONVIEW_CI_SEL 1 +#define ICONVIEW_CI_DISABLED 2 + +// +// Icon alignment flags, horizontal +// +#define ICONVIEW_IA_HCENTER (0 << 0) +#define ICONVIEW_IA_LEFT (1 << 0) +#define ICONVIEW_IA_RIGHT (2 << 0) + +// +// Icon alignment flags, vertical +// +#define ICONVIEW_IA_VCENTER (0 << 2) +#define ICONVIEW_IA_BOTTOM (1 << 2) +#define ICONVIEW_IA_TOP (2 << 2) + +/********************************************************************* +* +* Types +* +********************************************************************** +*/ +typedef WM_HMEM ICONVIEW_Handle; + +/********************************************************************* +* +* Public functions +* +********************************************************************** +*/ +ICONVIEW_Handle ICONVIEW_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int xSizeItems, int ySizeItems); +ICONVIEW_Handle ICONVIEW_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int xSizeItems, int ySizeItems, int NumExtraBytes); +ICONVIEW_Handle ICONVIEW_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); + +int ICONVIEW_AddBitmapItem (ICONVIEW_Handle hObj, const GUI_BITMAP * pBitmap, const char * pText); +int ICONVIEW_AddStreamedBitmapItem (ICONVIEW_Handle hObj, const void * pStreamedBitmap, const char * pText); +void ICONVIEW_DeleteItem (ICONVIEW_Handle hObj, unsigned Index); +void ICONVIEW_EnableStreamAuto (void); +U32 ICONVIEW_GetItemUserData (ICONVIEW_Handle hObj, int Index); +int ICONVIEW_GetNumItems (ICONVIEW_Handle hObj); +int ICONVIEW_GetItemText (ICONVIEW_Handle hObj, int Index, char * pBuffer, int MaxSize); +int ICONVIEW_GetSel (ICONVIEW_Handle hObj); +int ICONVIEW_GetUserData (ICONVIEW_Handle hObj, void * pDest, int NumBytes); +int ICONVIEW_InsertBitmapItem (ICONVIEW_Handle hObj, const GUI_BITMAP * pBitmap, const char * pText, int Index); +int ICONVIEW_InsertStreamedBitmapItem(ICONVIEW_Handle hObj, const void * pStreamedBitmap, const char * pText, int Index); +int ICONVIEW_SetBitmapItem (ICONVIEW_Handle hObj, int Index, const GUI_BITMAP * pBitmap); +void ICONVIEW_SetBkColor (ICONVIEW_Handle hObj, int Index, GUI_COLOR Color); +void ICONVIEW_SetFont (ICONVIEW_Handle hObj, const GUI_FONT * pFont); +void ICONVIEW_SetFrame (ICONVIEW_Handle hObj, int Coord, int Value); +void ICONVIEW_SetItemText (ICONVIEW_Handle hObj, int Index, const char * pText); +void ICONVIEW_SetItemUserData (ICONVIEW_Handle hObj, int Index, U32 UserData); +void ICONVIEW_SetSel (ICONVIEW_Handle hObj, int Sel); +void ICONVIEW_SetSpace (ICONVIEW_Handle hObj, int Coord, int Value); +int ICONVIEW_SetStreamedBitmapItem (ICONVIEW_Handle hObj, int Index, const void * pStreamedBitmap); +void ICONVIEW_SetIconAlign (ICONVIEW_Handle hObj, int IconAlign); +void ICONVIEW_SetTextAlign (ICONVIEW_Handle hObj, int TextAlign); +void ICONVIEW_SetTextColor (ICONVIEW_Handle hObj, int Index, GUI_COLOR Color); +int ICONVIEW_SetUserData (ICONVIEW_Handle hObj, const void * pSrc, int NumBytes); +void ICONVIEW_SetWrapMode (ICONVIEW_Handle hObj, GUI_WRAPMODE WrapMode); + +void ICONVIEW_Callback(WM_MESSAGE * pMsg); + +#if defined(__cplusplus) + } +#endif + +#endif // GUI_WINSUPPORT +#endif // ICONVIEW_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/IMAGE.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/IMAGE.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,103 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : IMAGE.h +Purpose : Image include +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef IMAGE_H +#define IMAGE_H + +#include "WM.h" +#include "DIALOG_Intern.h" +#include "WIDGET.h" + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) + extern "C" { // Make sure we have C-declarations in C++ programs +#endif + +/********************************************************************* +* +* Defines +* +********************************************************************** +*/ +#define IMAGE_CF_MEMDEV (1 << 0) // Widget uses an internally memory device which speeds up use of compressed images (GIF, JPEG, PNG) +#define IMAGE_CF_TILE (1 << 1) // Uses tiling to fill up the whole area of the widget +#define IMAGE_CF_ALPHA (1 << 2) // Needs to be set if alpha blending is required (PNG) +#define IMAGE_CF_ATTACHED (1 << 3) // Widget size is fixed to the parent border +#define IMAGE_CF_AUTOSIZE (1 << 4) // Widget size is taken from the attached image + +/********************************************************************* +* +* Types +* +********************************************************************** +*/ +typedef WM_HMEM IMAGE_Handle; + +/********************************************************************* +* +* Public functions +* +********************************************************************** +*/ +IMAGE_Handle IMAGE_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id); +IMAGE_Handle IMAGE_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes); +IMAGE_Handle IMAGE_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); + +void IMAGE_Callback(WM_MESSAGE * pMsg); + +/********************************************************************* +* +* Member functions +* +********************************************************************** +*/ +void IMAGE_SetBitmap(IMAGE_Handle hWin, const GUI_BITMAP * pBitmap); +void IMAGE_SetBMP (IMAGE_Handle hObj, const void * pData, U32 FileSize); +void IMAGE_SetBMPEx (IMAGE_Handle hObj, GUI_GET_DATA_FUNC * pfGetData, void * pVoid); +void IMAGE_SetDTA (IMAGE_Handle hObj, const void * pData, U32 FileSize); +void IMAGE_SetDTAEx (IMAGE_Handle hObj, GUI_GET_DATA_FUNC * pfGetData, void * pVoid); +void IMAGE_SetGIF (IMAGE_Handle hObj, const void * pData, U32 FileSize); +void IMAGE_SetGIFEx (IMAGE_Handle hObj, GUI_GET_DATA_FUNC * pfGetData, void * pVoid); +void IMAGE_SetJPEG (IMAGE_Handle hObj, const void * pData, U32 FileSize); +void IMAGE_SetJPEGEx(IMAGE_Handle hObj, GUI_GET_DATA_FUNC * pfGetData, void * pVoid); +void IMAGE_SetPNG (IMAGE_Handle hObj, const void * pData, U32 FileSize); +void IMAGE_SetPNGEx (IMAGE_Handle hObj, GUI_GET_DATA_FUNC * pfGetData, void * pVoid); + +#if defined(__cplusplus) + } +#endif + +#endif // GUI_WINSUPPORT +#endif // IMAGE_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/IMAGE_Private.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/IMAGE_Private.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,136 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : IMAGE_Private.h +Purpose : Private IMAGE include +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef IMAGE_PRIVATE_H +#define IMAGE_PRIVATE_H + +#include "IMAGE.h" +#include "GUI_Private.h" + +#if GUI_WINSUPPORT + +/********************************************************************* +* +* Private config defaults +* +********************************************************************** +*/ +#ifndef IMAGE_SUPPORT_TRANSPARENCY + #define IMAGE_SUPPORT_TRANSPARENCY WM_SUPPORT_TRANSPARENCY +#endif + +/********************************************************************* +* +* Object definition +* +********************************************************************** +*/ +typedef struct { + U32 Flags; +} IMAGE_PROPS; + +typedef struct { + WIDGET Widget; + IMAGE_PROPS Props; + const void * pData; // Data pointer of the object to be drawn (Bitmap, BMP, GIF, JPEG, PNG) + void (* pfDrawImageAt) (IMAGE_Handle hObj, int xPos, int yPos); // Object specific (Bitmap, BMP, GIF, JPEG, PNG) code + void (* pfPaint) (IMAGE_Handle hObj); // Drawing method specific (Default, Tiled, Magnified) code + void (* pfGetImageSize)(IMAGE_Handle hObj, int * pxSize, int * pySize); // Returns the image size of the attached item + void (* pfOnTimer) (IMAGE_Handle hObj); // Timer function for animated images (currently only animated GIFs are supported) + U32 FileSize; + // + // Data items used by IAMGE_GIF.c + // + int NumImages; // Number of (sub)images + int CurrentImage; // Image index used for animated images + GUI_TIMER_HANDLE hTimer; // Timer used for animated images + // + // Data items used by IAMGE_DTA.c + // + GUI_BITMAP Bitmap; // Bitmap structure + GUI_LOGPALETTE Palette; // Palette structure + // + // Data items used by Image_...Ex() - functions + // + void * pVoid; // Void pointer passed to GetData() function + GUI_GET_DATA_FUNC * pfGetData; // Pointer to GetData() function + // + // Data items used if memory devices are available and IMAGE_CF_MEMDEV has been set + // + #if GUI_SUPPORT_MEMDEV + GUI_MEMDEV_Handle hMem; + #endif + #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL + int DebugId; + #endif +} IMAGE_OBJ; + +/********************************************************************* +* +* Macros for internal use +* +********************************************************************** +*/ +#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL + #define IMAGE_INIT_ID(pObj) (pObj->DebugId = IMAGE_ID) +#else + #define IMAGE_INIT_ID(pObj) +#endif + +#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL + IMAGE_OBJ * IMAGE__LockH(IMAGE_Handle hObj); + #define IMAGE_LOCK_H(hObj) IMAGE__LockH(hObj) +#else + #define IMAGE_LOCK_H(hObj) (IMAGE_OBJ *)GUI_LOCK_H(hObj) +#endif + +/********************************************************************* +* +* Module internal data +* +********************************************************************** +*/ +extern IMAGE_PROPS IMAGE__DefaultProps; + +/********************************************************************* +* +* Private functions +* +********************************************************************** +*/ +void IMAGE__SetWindowSize(IMAGE_Handle hObj); +void IMAGE__FreeAttached (IMAGE_Handle hObj, int LeaveTimer); + +#endif // GUI_WINSUPPORT +#endif // IMAGE_PRIVATE_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/KNOB.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/KNOB.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,109 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : KNOB.h +Purpose : KNOB include +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef KNOB_H +#define KNOB_H + +#include "WM.h" +#include "DIALOG_Intern.h" // Req. for Create indirect data structure +#include "WIDGET.h" +#include "GUI_Debug.h" + +#if (GUI_SUPPORT_MEMDEV && GUI_WINSUPPORT) + +#if defined(__cplusplus) + extern "C" { // Make sure we have C-declarations in C++ programs +#endif + +/********************************************************************* +* +* Public Types +* +********************************************************************** +*/ +typedef WM_HMEM KNOB_Handle; + +/********************************************************************* +* +* Create functions +* +********************************************************************** +*/ +KNOB_Handle KNOB_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int Id); +KNOB_Handle KNOB_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int Id, int NumExtraBytes); +KNOB_Handle KNOB_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); + +/********************************************************************* +* +* The callback ... +* +* Do not call it directly ! It is only to be used from within an +* overwritten callback. +*/ +void KNOB_Callback(WM_MESSAGE * pMsg); + +/********************************************************************* +* +* Member functions +* +********************************************************************** +*/ +void KNOB_AddValue (KNOB_Handle hObj, I32 Value); +int KNOB_GetUserData(KNOB_Handle hObj, void * pDest, int NumBytes); // Gets user defined data +I32 KNOB_GetValue (KNOB_Handle hObj); // Returns the position of the knob in tenth of degree +void KNOB_SetBkColor (KNOB_Handle hObj, GUI_COLOR Color); // Sets the BK color of the widget +void KNOB_SetBkDevice(KNOB_Handle hObj, GUI_MEMDEV_Handle hMemBk); // Sets the background device +void KNOB_SetDevice (KNOB_Handle hObj, GUI_MEMDEV_Handle hMemSrc); // Sets the memory device with the drawn knob +void KNOB_SetKeyValue(KNOB_Handle hObj, I32 KeyValue); // Sets the value the knob will rotate on one key press +void KNOB_SetOffset (KNOB_Handle hObj, I32 Offset); // Sets the offset angle of the knob +void KNOB_SetPeriod (KNOB_Handle hObj, I32 Period); // Sets the period in which the knob stops +void KNOB_SetPos (KNOB_Handle hObj, I32 Pos); // Sets position of the knob in tenth of degree +void KNOB_SetRange (KNOB_Handle hObj, I32 MinRange, I32 MaxRange); // Sets the usable range of the knob widget +void KNOB_SetSnap (KNOB_Handle hObj, I32 Snap); // Sets Snap positions where the knob stops +void KNOB_SetTickSize(KNOB_Handle hObj, I32 TickSize); // Sets the ticksize, in 1/10 of degree +int KNOB_SetUserData(KNOB_Handle hObj, const void * pSrc, int NumBytes); // Sets user defined data + +/********************************************************************* +* +* Global functions +* +********************************************************************** +*/ + +#if defined(__cplusplus) + } +#endif + +#endif // (GUI_SUPPORT_MEMDEV && GUI_WINSUPPORT) +#endif // KNOB_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/LCD.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/LCD.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,731 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : LCD.h +Purpose : Declares LCD interface functions +---------------------------------------------------------------------- +*/ + +#ifndef LCD_H +#define LCD_H + +#include "GUI_ConfDefaults.h" /* Used for GUI_CONST_STORAGE */ +#include "Global.h" + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Basic type defines +* +* The follwing are defines for types used in the LCD-driver and the +* GUI layers on top of that. Since "C" does not provide data types of +* fixed length which are identical on all platforms, this is done here. +* For most 16/32 controllers, the settings will work fine. However, if +* you have similar defines in other sections of your program, you might +* want to change or relocate these defines, e.g. in a TYPE.h file. +*/ +#define I16P I16 /* signed 16 bits OR MORE ! */ +#define U16P U16 /* unsigned 16 bits OR MORE ! */ + +/********************************************************************* +* +* Settings for windows simulation +* +* Some settings in the configuration may conflict with the values required +* in the Simulation. This is why we ignore the target settings for data +* types and use the correct settings for the simulation. +* (U32 could be defined as long, which would yield a 64 bit type on +* the PC) +*/ +#ifdef WIN32 + #pragma warning( disable : 4244 ) // Disable warning messages in simulation + #pragma warning( disable : 4761 ) // Disable warning "integral size mismatch in argument; conversion supplied" +#endif + +/********************************************************************* +* +* Constants +*/ +#define LCD_ERR0 (0x10) +#define LCD_ERR_CONTROLLER_NOT_FOUND (LCD_ERR0+1) +#define LCD_ERR_MEMORY (LCD_ERR0+2) + +/********************************************************************* +* +* Drawing modes +*/ +#define LCD_DRAWMODE_NORMAL (0) +#define LCD_DRAWMODE_XOR (1<<0) +#define LCD_DRAWMODE_TRANS (1<<1) +#define LCD_DRAWMODE_REV (1<<2) + +/********************************************************************* +* +* Typedefs +*/ +typedef int LCD_DRAWMODE; +typedef U32 LCD_COLOR; + +/********************************************************************* +* +* Data structures +*/ +typedef struct { I16P x,y; } GUI_POINT; +typedef struct { I16 x0,y0,x1,y1; } LCD_RECT; + +typedef struct { + int NumEntries; + char HasTrans; + const LCD_COLOR * pPalEntries; +} LCD_LOGPALETTE; + +/* This is used for the simulation only ! */ +typedef struct { + int x,y; + unsigned char KeyStat; +} LCD_tMouseState; + +typedef struct { + int NumEntries; + const LCD_COLOR * pPalEntries; +} LCD_PHYSPALETTE; + +/********************************************************************* +* +* LCD_L0_... color conversion +*/ +typedef LCD_COLOR tLCDDEV_Index2Color (unsigned Index); +typedef unsigned int tLCDDEV_Color2Index (LCD_COLOR Color); +typedef unsigned int tLCDDEV_GetIndexMask (void); + +typedef void tLCDDEV_Index2ColorBulk(void * pIndex, LCD_COLOR * pColor, U32 NumItems, U8 SizeOfIndex); +typedef void tLCDDEV_Color2IndexBulk(LCD_COLOR * pColor, void * pIndex, U32 NumItems, U8 SizeOfIndex); + +/********************************************************************* +* +* Color conversion API tables +*/ +typedef struct { + tLCDDEV_Color2Index * pfColor2Index; + tLCDDEV_Index2Color * pfIndex2Color; + tLCDDEV_GetIndexMask * pfGetIndexMask; + int NoAlpha; + tLCDDEV_Color2IndexBulk * pfColor2IndexBulk; + tLCDDEV_Index2ColorBulk * pfIndex2ColorBulk; +} LCD_API_COLOR_CONV; + +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_0; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_1; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_1_2; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_1_4; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_1_5; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_1_8; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_1_16; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_1_24; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M1; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_2; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M2; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_4; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M4; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_5; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_6; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_8; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_16; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_1616I; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_111; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_222; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_233; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_323; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_332; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_444_12; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_444_12_1; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_444_16; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_555; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_565; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_556; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_655; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_666; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_666_9; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_822216; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_84444; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_8666; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_8666_1; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_88666I; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_888; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_8888; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M111; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M1555I; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M222; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M233; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M323; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M332; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M4444I; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M444_12; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M444_12_1; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M444_16; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M555; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M565; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M556; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M655; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M666; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M666_9; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M8565; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M888; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M8888; +extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M8888I; + +#define GUICC_0 &LCD_API_ColorConv_0 +#define GUICC_1 &LCD_API_ColorConv_1 +#define GUICC_1_2 &LCD_API_ColorConv_1_2 +#define GUICC_1_4 &LCD_API_ColorConv_1_4 +#define GUICC_1_5 &LCD_API_ColorConv_1_5 +#define GUICC_1_8 &LCD_API_ColorConv_1_8 +#define GUICC_1_16 &LCD_API_ColorConv_1_16 +#define GUICC_1_24 &LCD_API_ColorConv_1_24 +#define GUICC_M1 &LCD_API_ColorConv_M1 +#define GUICC_2 &LCD_API_ColorConv_2 +#define GUICC_M2 &LCD_API_ColorConv_M2 +#define GUICC_4 &LCD_API_ColorConv_4 +#define GUICC_M4 &LCD_API_ColorConv_M4 +#define GUICC_5 &LCD_API_ColorConv_5 +#define GUICC_6 &LCD_API_ColorConv_6 +#define GUICC_8 &LCD_API_ColorConv_8 +#define GUICC_16 &LCD_API_ColorConv_16 +#define GUICC_1616I &LCD_API_ColorConv_1616I +#define GUICC_111 &LCD_API_ColorConv_111 +#define GUICC_222 &LCD_API_ColorConv_222 +#define GUICC_233 &LCD_API_ColorConv_233 +#define GUICC_323 &LCD_API_ColorConv_323 +#define GUICC_332 &LCD_API_ColorConv_332 +#define GUICC_M4444I &LCD_API_ColorConv_M4444I +#define GUICC_444_12 &LCD_API_ColorConv_444_12 +#define GUICC_444_12_1 &LCD_API_ColorConv_444_12_1 +#define GUICC_444_16 &LCD_API_ColorConv_444_16 +#define GUICC_555 &LCD_API_ColorConv_555 +#define GUICC_565 &LCD_API_ColorConv_565 +#define GUICC_556 &LCD_API_ColorConv_556 +#define GUICC_655 &LCD_API_ColorConv_655 +#define GUICC_666 &LCD_API_ColorConv_666 +#define GUICC_666_9 &LCD_API_ColorConv_666_9 +#define GUICC_822216 &LCD_API_ColorConv_822216 +#define GUICC_84444 &LCD_API_ColorConv_84444 +#define GUICC_8666 &LCD_API_ColorConv_8666 +#define GUICC_8666_1 &LCD_API_ColorConv_8666_1 +#define GUICC_88666I &LCD_API_ColorConv_88666I +#define GUICC_888 &LCD_API_ColorConv_888 +#define GUICC_8888 &LCD_API_ColorConv_8888 +#define GUICC_M111 &LCD_API_ColorConv_M111 +#define GUICC_M1555I &LCD_API_ColorConv_M1555I +#define GUICC_M222 &LCD_API_ColorConv_M222 +#define GUICC_M233 &LCD_API_ColorConv_M233 +#define GUICC_M323 &LCD_API_ColorConv_M323 +#define GUICC_M332 &LCD_API_ColorConv_M332 +#define GUICC_M444_12 &LCD_API_ColorConv_M444_12 +#define GUICC_M444_12_1 &LCD_API_ColorConv_M444_12_1 +#define GUICC_M444_16 &LCD_API_ColorConv_M444_16 +#define GUICC_M555 &LCD_API_ColorConv_M555 +#define GUICC_M565 &LCD_API_ColorConv_M565 +#define GUICC_M556 &LCD_API_ColorConv_M556 +#define GUICC_M655 &LCD_API_ColorConv_M655 +#define GUICC_M666 &LCD_API_ColorConv_M666 +#define GUICC_M666_9 &LCD_API_ColorConv_M666_9 +#define GUICC_M8565 &LCD_API_ColorConv_M8565 +#define GUICC_M888 &LCD_API_ColorConv_M888 +#define GUICC_M8888 &LCD_API_ColorConv_M8888 +#define GUICC_M8888I &LCD_API_ColorConv_M8888I + +void GUICC_M1555I_SetCustColorConv(tLCDDEV_Color2IndexBulk * pfColor2IndexBulk, tLCDDEV_Index2ColorBulk * pfIndex2ColorBulk); +void GUICC_M565_SetCustColorConv (tLCDDEV_Color2IndexBulk * pfColor2IndexBulk, tLCDDEV_Index2ColorBulk * pfIndex2ColorBulk); +void GUICC_M4444I_SetCustColorConv(tLCDDEV_Color2IndexBulk * pfColor2IndexBulk, tLCDDEV_Index2ColorBulk * pfIndex2ColorBulk); +void GUICC_M888_SetCustColorConv (tLCDDEV_Color2IndexBulk * pfColor2IndexBulk, tLCDDEV_Index2ColorBulk * pfIndex2ColorBulk); +void GUICC_M8888I_SetCustColorConv(tLCDDEV_Color2IndexBulk * pfColor2IndexBulk, tLCDDEV_Index2ColorBulk * pfIndex2ColorBulk); + +/********************************************************************* +* +* Compatibility defines for older versions +*/ +#define GUI_COLOR_CONV_1 GUICC_1 +#define GUI_COLOR_CONV_2 GUICC_2 +#define GUI_COLOR_CONV_4 GUICC_4 +#define GUI_COLOR_CONV_8666 GUICC_8666 +#define GUI_COLOR_CONV_888 GUICC_888 +#define GUI_COLOR_CONV_8888 GUICC_8888 +#define GUI_COLOR_CONV_565 GUICC_565 +#define GUI_COLOR_CONV_M565 GUICC_M565 + +/********************************************************************* +* +* LCDDEV function table +* +* Below the routines which need to in an LCDDEV routine table are +* defined. All of these routines have to be in the low-level driver +* (LCD_L0) or in the memory device which can be used to replace the +* driver. +* The one exception to this is the SetClipRect routine, which would +* be identical for all drivers and is therefor contained in the +* level above (LCD). +*/ +typedef void tLCDDEV_DrawPixel (int x, int y); +typedef void tLCDDEV_DrawHLine (int x0, int y0, int x1); +typedef void tLCDDEV_DrawVLine (int x , int y0, int y1); +typedef void tLCDDEV_FillRect (int x0, int y0, int x1, int y1); +typedef unsigned int tLCDDEV_GetPixelIndex(int x, int y); +typedef void tLCDDEV_SetPixelIndex(int x, int y, int ColorIndex); +typedef void tLCDDEV_XorPixel (int x, int y); +typedef void tLCDDEV_FillPolygon (const GUI_POINT * pPoints, int NumPoints, int x0, int y0); +typedef void tLCDDEV_FillPolygonAA(const GUI_POINT * pPoints, int NumPoints, int x0, int y0); +typedef void tLCDDEV_GetRect (LCD_RECT * pRect); +typedef int tLCDDEV_Init (void); +typedef void tLCDDEV_On (void); +typedef void tLCDDEV_Off (void); +typedef void tLCDDEV_SetLUTEntry (U8 Pos, LCD_COLOR color); +typedef void * tLCDDEV_GetDevFunc (int Index); +typedef I32 tLCDDEV_GetDevProp (int Index); +typedef void tLCDDEV_SetOrg (int x, int y); + +/********************************************************************* +* +* Memory device API tables +*/ +typedef struct GUI_DEVICE GUI_DEVICE; +typedef struct GUI_DEVICE_API GUI_DEVICE_API; + +typedef void tLCDDEV_DrawBitmap (int x0, int y0, int xsize, int ysize, + int BitsPerPixel, int BytesPerLine, + const U8 * pData, int Diff, + const void * pTrans); /* Really LCD_PIXELINDEX, but is void to avoid compiler warnings */ +#define GUI_MEMDEV_APILIST_1 &GUI_MEMDEV_DEVICE_1 +#define GUI_MEMDEV_APILIST_8 &GUI_MEMDEV_DEVICE_8 +#define GUI_MEMDEV_APILIST_16 &GUI_MEMDEV_DEVICE_16 +#define GUI_MEMDEV_APILIST_32 &GUI_MEMDEV_DEVICE_32 + +/********************************************************************* +* +* Defines for device capabilities +* +* The following is the list of device capabilities which can, but do +* not have to be implemented in the driver. This way the driver can be +* enhanced in the future without affecting the driver interface, +* keeping older drivers compatible. +* More DevCaps can always be added in the future, as older drivers +* are guaranteed to return 0 for all unimplemented features or queries. +* +* The values below define the legal parameters to the LCD_GetDeviceCaps +* and the LCD_GetpCapFunc routines. +*/ + +#define LCD_DEVCAP_XSIZE 0x01 /* Quest horiz. res. of display */ +#define LCD_DEVCAP_YSIZE 0x02 /* Quest vert. res. of display */ +#define LCD_DEVCAP_VXSIZE 0x03 /* Quest vert. res. of virtual disp.*/ +#define LCD_DEVCAP_VYSIZE 0x04 /* Quest vert. res. of virtual disp.*/ +#define LCD_DEVCAP_XORG 0x05 /* X-origin ... usually 0 */ +#define LCD_DEVCAP_YORG 0x06 /* Y-origin ... usually 0 */ +#define LCD_DEVCAP_CONTROLLER 0x07 /* LCD Controller (Numerical) */ +#define LCD_DEVCAP_BITSPERPIXEL 0x08 /* Bits per pixel ... 1/2/4/8 */ +#define LCD_DEVCAP_NUMCOLORS 0x09 /* Quest number of colors */ +#define LCD_DEVCAP_XMAG 0x0A +#define LCD_DEVCAP_YMAG 0x0B +#define LCD_DEVCAP_MIRROR_X 0x0C +#define LCD_DEVCAP_MIRROR_Y 0x0D +#define LCD_DEVCAP_SWAP_XY 0x0E +#define LCD_DEVCAP_SWAP_RB 0x0F + +int LCD_GetXSizeMax(void); +int LCD_GetYSizeMax(void); +int LCD_GetVXSizeMax(void); +int LCD_GetVYSizeMax(void); +int LCD_GetBitsPerPixelMax(void); + +int LCD_GetXSizeEx (int LayerIndex); +int LCD_GetYSizeEx (int LayerIndex); +int LCD_GetVXSizeEx (int LayerIndex); +int LCD_GetVYSizeEx (int LayerIndex); +int LCD_GetBitsPerPixelEx (int LayerIndex); +U32 LCD_GetNumColorsEx (int LayerIndex); +int LCD_GetXMagEx (int LayerIndex); +int LCD_GetYMagEx (int LayerIndex); +int LCD_GetMirrorXEx (int LayerIndex); +int LCD_GetMirrorYEx (int LayerIndex); +int LCD_GetSwapXYEx (int LayerIndex); +int LCD_GetReversLUTEx (int LayerIndex); +int LCD_GetPhysColorsInRAMEx(int LayerIndex); + +int LCD_GetXSize (void); +int LCD_GetYSize (void); +int LCD_GetVXSize (void); +int LCD_GetVYSize (void); +int LCD_GetBitsPerPixel (void); +U32 LCD_GetNumColors (void); +int LCD_GetXMag (void); +int LCD_GetYMag (void); +int LCD_GetMirrorX (void); +int LCD_GetMirrorY (void); +int LCD_GetSwapXY (void); +int LCD_GetReversLUT (void); +int LCD_GetPhysColorsInRAM (void); + +I32 LCD__GetBPP (U32 IndexMask); +I32 LCD__GetBPPDevice(U32 IndexMask); + +tLCDDEV_Index2Color * LCD_GetpfIndex2ColorEx(int LayerIndex); +tLCDDEV_Color2Index * LCD_GetpfColor2IndexEx(int LayerIndex); + +tLCDDEV_Color2Index * LCD_GetpfColor2Index(void); + +int LCD_GetNumLayers(void); + +LCD_COLOR * LCD_GetPalette (void); +LCD_COLOR * LCD_GetPaletteEx(int LayerIndex); + +void (* LCD_GetDevFunc(int LayerIndex, int Item))(void); + +/********************************************************************* +* +* Values for requesting and setting function pointers (display driver) +*/ + /* Request of a function pointer for... */ +#define LCD_DEVFUNC_READRECT 0x01 /* ...reading a rectangular display area */ +#define LCD_DEVFUNC_SETALPHA 0x02 /* ...setting the alpha blending factor */ +#define LCD_DEVFUNC_SETPOS 0x03 /* ...setting the layer position */ +#define LCD_DEVFUNC_GETPOS 0x04 /* ...getting the layer position */ +#define LCD_DEVFUNC_SETSIZE 0x05 /* ...setting the layer size */ +#define LCD_DEVFUNC_SETVIS 0x06 /* ...setting the visibility of a layer */ +#define LCD_DEVFUNC_24BPP 0x07 /* ...drawing 24bpp bitmaps */ +#define LCD_DEVFUNC_NEXT_PIXEL 0x08 /* ...drawing a bitmap pixel by pixel */ +#define LCD_DEVFUNC_SET_VRAM_ADDR 0x09 /* ...setting the VRAM address */ +#define LCD_DEVFUNC_SET_VSIZE 0x0A /* ...setting the VRAM size */ +#define LCD_DEVFUNC_SET_SIZE 0x0B /* ...setting the display size */ +#define LCD_DEVFUNC_INIT 0x0C /* ...initializing the display controller */ +#define LCD_DEVFUNC_CONTROLCACHE 0x0D /* ...controlling the cache */ +#define LCD_DEVFUNC_ON 0x0E /* ...switching the display on */ +#define LCD_DEVFUNC_OFF 0x0F /* ...switching the display off */ +#define LCD_DEVFUNC_SETLUTENTRY 0x10 /* ...setting a LUT entry */ +#define LCD_DEVFUNC_FILLPOLY 0x11 /* ...filling a polygon */ +#define LCD_DEVFUNC_FILLPOLYAA 0x12 /* ...filling an antialiased polygon */ +#define LCD_DEVFUNC_ALPHAMODE 0x13 /* ...setting the alpha blending mode */ +#define LCD_DEVFUNC_CHROMAMODE 0x14 /* ...setting the chroma blending mode */ +#define LCD_DEVFUNC_CHROMA 0x15 /* ...setting the chroma values */ +#define LCD_DEVFUNC_SETFUNC 0x16 /* ...setting a function pointer */ +#define LCD_DEVFUNC_REFRESH 0x17 /* ...refreshing the display */ +#define LCD_DEVFUNC_SETRECT 0x18 /* ...setting the drawing rectangle */ + /* Setting a function pointer for... */ +#define LCD_DEVFUNC_FILLRECT 0x19 /* ...filling a rectangular area */ +#define LCD_DEVFUNC_DRAWBMP_1BPP 0x20 /* ...drawing a 1bpp bitmap */ +#define LCD_DEVFUNC_COPYBUFFER 0x21 /* ...copying complete frame buffers */ +#define LCD_DEVFUNC_SHOWBUFFER 0x22 /* ...shows the given buffer */ +#define LCD_DEVFUNC_COPYRECT 0x23 /* ...filling a rectangular area */ +#define LCD_DEVFUNC_DRAWBMP_16BPP 0x24 /* ...drawing a 16bpp bitmap */ +#define LCD_DEVFUNC_DRAWBMP_8BPP 0x25 /* ...drawing a 8bpp bitmap */ +#define LCD_DEVFUNC_READPIXEL 0x26 /* ...reading a pixel index */ +#define LCD_DEVFUNC_READMPIXELS 0x27 /* ...reading multiple pixel indices */ +#define LCD_DEVFUNC_DRAWBMP_32BPP 0x28 /* ...drawing a 32bpp bitmap */ + +/********************************************************************* +* +* Values for requesting function pointers (memory devices) +*/ + /* Request of a function pointer for... */ +#define MEMDEV_DEVFUNC_WRITETOACTIVE 0x16 /* ...writing the memory device */ + +/********************************************************************* +* +* Values for requesting data +*/ + /* Request pointer to... */ +#define LCD_DEVDATA_MEMDEV 0x01 /* ...default memory device API */ +#define LCD_DEVDATA_PHYSPAL 0x02 /* ...physical palette */ + +/********************************************************************* +* +* Structures for passing data to LCD_X_DisplayDriver() +*/ +typedef struct { + void * pVRAM; +} LCD_X_SETVRAMADDR_INFO; + +typedef struct { + int xPos, yPos; +} LCD_X_SETORG_INFO; + +typedef struct { + LCD_COLOR Color; + U8 Pos; +} LCD_X_SETLUTENTRY_INFO; + +typedef struct { + int xSize, ySize; +} LCD_X_SETSIZE_INFO; + +typedef struct { + int xPos, yPos; +} LCD_X_SETPOS_INFO; + +typedef struct { + int Alpha; +} LCD_X_SETALPHA_INFO; + +typedef struct { + int OnOff; +} LCD_X_SETVIS_INFO; + +typedef struct { + int AlphaMode; +} LCD_X_SETALPHAMODE_INFO; + +typedef struct { + int ChromaMode; +} LCD_X_SETCHROMAMODE_INFO; + +typedef struct { + LCD_COLOR ChromaMin; + LCD_COLOR ChromaMax; +} LCD_X_SETCHROMA_INFO; + +typedef struct { + int Index; +} LCD_X_SHOWBUFFER_INFO; + +/********************************************************************* +* +* Commands for LCD_X_DisplayDriver() +*/ +#define LCD_X_INITCONTROLLER 0x01 /* Initializing the display controller */ +#define LCD_X_SETVRAMADDR 0x02 /* Setting the video RAM address */ +#define LCD_X_SETORG 0x03 /* Setting the origin within a layer */ +#define LCD_X_SETLUTENTRY 0x04 /* Setting an entry of the LUT */ +#define LCD_X_ON 0x05 /* Switching the display on */ +#define LCD_X_OFF 0x06 /* Switching the display off */ +#define LCD_X_SETSIZE 0x07 /* Setting the layer size */ +#define LCD_X_SETPOS 0x08 /* Setting the layer position */ +#define LCD_X_SETVIS 0x09 /* Setting the visibility of a layer */ +#define LCD_X_SETALPHA 0x0A /* Setting the alpha value of the layer */ +#define LCD_X_SETALPHAMODE 0x0B /* Setting the alpha blending mode */ +#define LCD_X_SETCHROMAMODE 0x0C /* Setting the chroma blending mode */ +#define LCD_X_SETCHROMA 0x0D /* Setting the chroma values */ +#define LCD_X_SHOWBUFFER 0x0E /* Switching to the given buffer */ + +int LCD_X_DisplayDriver(unsigned LayerIndex, unsigned Cmd, void * pData); +void LCD_X_Config(void); + +/********************************************************************* +* +* Set layer properties +*/ +int LCD_SetAlphaEx (int LayerIndex, int Alpha); +int LCD_SetPosEx (int LayerIndex, int xPos, int yPos); +int LCD_SetSizeEx (int LayerIndex, int xSize, int ySize); +int LCD_SetVisEx (int LayerIndex, int OnOff); +int LCD_SetVRAMAddrEx (int LayerIndex, void * pVRAM); +int LCD_SetVSizeEx (int LayerIndex, int xSize, int ySize); +int LCD_SetAlphaModeEx (int LayerIndex, int AlphaMode); +int LCD_SetChromaModeEx(int LayerIndex, int ChromaMode); +int LCD_SetChromaEx (int LayerIndex, LCD_COLOR ChromaMin, LCD_COLOR ChromaMax); + +int LCD_SetAlpha (int Alpha); +int LCD_SetVRAMAddr (void * pVRAM); +int LCD_SetVSize (int xSize, int ySize); +int LCD_SetSize (int xSize, int ySize); +int LCD_SetVis (int OnOff); +int LCD_SetPos (int xPos, int yPos); +int LCD_SetAlphaMode (int AlphaMode); +int LCD_SetChromaMode(int ChromaMode); +int LCD_SetChroma (LCD_COLOR ChromaMin, LCD_COLOR ChromaMax); +int LCD_SetLUTEntry (U8 Pos, LCD_COLOR Color); +int LCD_SetDevFunc (int LayerIndex, int IdFunc, void (* pDriverFunc)(void)); + +/********************************************************************* +* +* Get layer properties +*/ +int LCD_GetPosEx(int LayerIndex, int * pxPos, int * pyPos); + +int LCD_GetPos (int * pxPos, int * pyPos); + +/********************************************************************* +* +* Display refresh (optional) +*/ +int LCD_Refresh (void); +int LCD_RefreshEx(int LayerIndex); + +/********************************************************************* +* +* NEXT_PIXEL API support +*/ +typedef struct { + int (* pfStart) (int x0, int y0, int x1, int y1); + void (* pfSetPixel)(int PixelIndex); + void (* pfNextLine)(void); + void (* pfEnd) (void); +} LCD_API_NEXT_PIXEL; + +LCD_API_NEXT_PIXEL * LCD_GetNextPixelAPI(void); + +/********************************************************************* +* +* LCD_CLIP function table +*/ +typedef void tLCD_HL_DrawHLine (int x0, int y0, int x1); +typedef void tLCD_HL_DrawPixel (int x0, int y0); + +typedef struct { + tLCD_HL_DrawHLine * pfDrawHLine; + tLCD_HL_DrawPixel * pfDrawPixel; +} tLCD_HL_APIList; + +void LCD_DrawHLine(int x0, int y0, int x1); +void LCD_DrawPixel(int x0, int y0); +void LCD_DrawVLine(int x, int y0, int y1); + + +/********************************************************************* +* +* Declarations for LCD_ +*/ +void LCD_SetClipRectEx(const LCD_RECT * pRect); +void LCD_SetClipRectMax(void); + +/* Get device capabilities (0 if not supported) */ +I32 LCD_GetDevCap (int Index); +I32 LCD_GetDevCapEx(int LayerIndex, int Index); + +/* Initialize LCD using config-parameters */ +int LCD_Init(void); +int LCD_InitColors(void); + +void LCD_SetBkColor (LCD_COLOR Color); /* Set background color */ +void LCD_SetColor (LCD_COLOR Color); /* Set foreground color */ +void LCD_SetPixelIndex(int x, int y, int ColorIndex); + +/* Palette routines (Not available on all drivers) */ +void LCD_InitLUT(void); +int LCD_SetLUTEntryEx(int LayerIndex, U8 Pos, LCD_COLOR Color); +void LCD_SetLUTEx(int LayerIndex, const LCD_PHYSPALETTE * pPalette); +void LCD_SetLUT (const LCD_PHYSPALETTE * pPalette); + +LCD_DRAWMODE LCD_SetDrawMode (LCD_DRAWMODE dm); +void LCD_SetColorIndex(unsigned PixelIndex); +void LCD_SetBkColorIndex(unsigned PixelIndex); +void LCD_FillRect(int x0, int y0, int x1, int y1); +typedef void tLCD_SetPixelAA(int x, int y, U8 Intens); + +void LCD_SetPixelAA4_Trans (int x, int y, U8 Intens); +void LCD_SetPixelAA4_NoTrans(int x, int y, U8 Intens); + +void LCD_SetPixelAA8_Trans (int x, int y, U8 Intens); +void LCD_SetPixelAA8_NoTrans(int x, int y, U8 Intens); + +LCD_COLOR LCD_AA_MixColors16 (LCD_COLOR Color, LCD_COLOR BkColor, U8 Intens); +LCD_COLOR LCD_AA_MixColors256(LCD_COLOR Color, LCD_COLOR BkColor, U8 Intens); +LCD_COLOR LCD_MixColors256 (LCD_COLOR Color, LCD_COLOR BkColor, unsigned Intens); +LCD_COLOR LCD_GetPixelColor(int x, int y); /* Get RGB color of pixel */ +unsigned int LCD_GetPixelIndex(int x, int y); +int LCD_GetBkColorIndex (void); +int LCD_GetColorIndex (void); +U32 LCD_AA_SetAndMask(U32 AndMask); + +/* Configuration */ +int LCD_SetMaxNumColors(unsigned MaxNumColors); + +/********************************************************************* +* +* Optional support for rotation +*/ +#if GUI_SUPPORT_ROTATION + +typedef void tLCD_DrawBitmap(int x0, int y0, int xsize, int ysize, + int xMul, int yMul, int BitsPerPixel, int BytesPerLine, + const U8 * pPixel, const void * pTrans); +typedef void tRect2TextRect (LCD_RECT * pRect); + +struct tLCD_APIList_struct { + tLCD_DrawBitmap * pfDrawBitmap; + tRect2TextRect * pfRect2TextRect; + tRect2TextRect * pfTransformRect; +}; + +typedef struct tLCD_APIList_struct tLCD_APIList; + +extern tLCD_APIList LCD_APIListCCW; +extern tLCD_APIList LCD_APIListCW; +extern tLCD_APIList LCD_APIList180; + +#define GUI_ROTATION tLCD_APIList +#define GUI_ROTATE_CCW &LCD_APIListCCW +#define GUI_ROTATE_CW &LCD_APIListCW +#define GUI_ROTATE_180 &LCD_APIList180 +#define GUI_ROTATE_0 0 + +tLCD_SetPixelAA * LCD__GetPfSetPixel(int BitsPerPixel); + +#endif + +/********************************************************************* +* +* Physical color access, internally used only +*/ +void LCD__SetPhysColor(U8 Pos, LCD_COLOR Color); + +/********************************************************************* +* +* Cache control +*/ +#define LCD_CC_UNLOCK (0) /* Default mode: Cache is transparent */ +#define LCD_CC_LOCK (1) /* Cache is locked, no write operations */ +#define LCD_CC_FLUSH (2) /* Flush cache, do not change mode */ + +int LCD_ControlCache (int Cmd); +int LCD_ControlCacheEx(int LayerIndex, int Cmd); + +/********************************************************************* +* +* Color conversion +*/ +unsigned LCD_Color2Index (LCD_COLOR Color); +LCD_COLOR LCD_Index2Color (int Index); +LCD_COLOR LCD_Index2ColorEx (int i, unsigned LayerIndex); + +/********************************************************************* +* +* LCD_X_... +*/ +unsigned char LCD_X_Read00(void); +unsigned char LCD_X_Read01(void); +void LCD_X_Write00 (unsigned char c); +void LCD_X_Write01 (unsigned char c); +void LCD_X_WriteM01(unsigned char * pData, int NumBytes); + +#if defined(__cplusplus) + } +#endif + +#endif /* LCD_H */ + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/LCD_ConfDefaults.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/LCD_ConfDefaults.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,69 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : LCD_ConfDefaults.h +Purpose : Valid LCD configuration and defaults +---------------------------------------------------------------------- +*/ + +#ifndef LCD_CONFIG_DEFAULTS_H +#define LCD_CONFIG_DEFAULTS_H + +#include "LCDConf.h" /* Configuration header file */ + +/********************************************************** +* +* Configuration defaults +*/ +#ifndef LCD_MIRROR_X + #define LCD_MIRROR_X 0 +#endif +#ifndef LCD_MIRROR_Y + #define LCD_MIRROR_Y 0 +#endif +#ifndef LCD_SWAP_XY + #define LCD_SWAP_XY 0 +#endif +#ifndef LCD_FIRSTCOM0 + #define LCD_FIRSTCOM0 0 +#endif +#ifndef LCD_FIRSTSEG0 + #define LCD_FIRSTSEG0 0 +#endif +#ifndef LCD_SWAP_RB + #define LCD_SWAP_RB 0 +#endif +#ifndef LCD_DISPLAY_INDEX + #define LCD_DISPLAY_INDEX 0 +#endif +#ifndef LCD_ENDIAN_BIG + #define LCD_ENDIAN_BIG 0 +#endif + +#endif /* LCD_CONFIG_DEFAULTS_H */ + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/LCD_Protected.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/LCD_Protected.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,120 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : LCD_Protected.h +Purpose : LCD level - To be used only internally by the GUI +---------------------------------------------------------------------- +*/ + +#ifndef LCD_PROTECTED_H +#define LCD_PROTECTED_H + +#include "LCD.h" + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Data types +*/ +typedef struct { + LCD_COLOR * paColor; + I16 NumEntries; +} LCD_LUT_INFO; + +typedef struct { + tLCDDEV_DrawPixel * pfDrawPixel; + tLCDDEV_DrawHLine * pfDrawHLine; + tLCDDEV_DrawVLine * pfDrawVLine; + tLCDDEV_FillRect * pfFillRect; + tLCDDEV_DrawBitmap * pfDrawBitmap; +} LCD_API_LIST; + +/********************************************************************* +* +* External data +*/ +extern GUI_CONST_STORAGE U8 LCD_aMirror[256]; +extern LCD_PIXELINDEX * LCD__aConvTable; + +/********************************************************************* +* +* Misc functions +*/ +void LCD_UpdateColorIndices (void); +int LCD_PassingBitmapsAllowed(void); +void LCD_EnableCursor (int OnOff); +void LCD_SelectLCD (void); + +void LCD_DrawBitmap(int x0, int y0, + int xsize, int ysize, + int xMul, int yMul, + int BitsPerPixel, + int BytesPerLine, + const U8 * pPixel, + const LCD_PIXELINDEX * pTrans); + +void LCD__DrawBitmap_1bpp(int x0, int y0, + int xsize, int ysize, + int xMul, int yMul, + int BitsPerPixel, + int BytesPerLine, + const U8 * pPixel, + const LCD_PIXELINDEX * pTrans, + int OffData); + +/********************************************************************* +* +* Internal used color conversion routines +*/ +tLCDDEV_Index2Color LCD_Index2Color_444_12; +tLCDDEV_Index2Color LCD_Index2Color_M444_12; +tLCDDEV_Index2Color LCD_Index2Color_444_12_1; +tLCDDEV_Index2Color LCD_Index2Color_M444_12_1; +tLCDDEV_Index2Color LCD_Index2Color_444_16; +tLCDDEV_Index2Color LCD_Index2Color_M444_16; +tLCDDEV_Index2Color LCD_Index2Color_555; +tLCDDEV_Index2Color LCD_Index2Color_565; +tLCDDEV_Index2Color LCD_Index2Color_8666; +tLCDDEV_Index2Color LCD_Index2Color_888; +tLCDDEV_Index2Color LCD_Index2Color_8888; +tLCDDEV_Index2Color LCD_Index2Color_M555; +tLCDDEV_Index2Color LCD_Index2Color_M565; +tLCDDEV_Index2Color LCD_Index2Color_M888; + +tLCDDEV_Color2Index LCD_Color2Index_8666; + +#if defined(__cplusplus) +} +#endif + +#endif /* LCD_PROTECTED_H */ + +/*************************** End of file ****************************/ +
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/LCD_SIM.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/LCD_SIM.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,205 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : LCD_SIM.h +Purpose : Declares LCD interface functions +---------------------------------------------------------------------- +*/ + +#ifndef LCDSIM_H +#define LCDSIM_H + +#include "LCD.h" + +/************************************************************ +* +* Defines +* +************************************************************* +*/ +#define LCDSIM_MAX_DISPLAYS GUI_NUM_LAYERS + +#define GUI_TRANSMODE_PIXELALPHA 0 +#define GUI_TRANSMODE_CHROMA 1 +#define GUI_TRANSMODE_ZERO 2 + +#ifdef __cplusplus +extern "C" { +#endif +/************************************************************ +* +* LCDSIM_ General declarations +* +************************************************************* +*/ + +void LCDSIM_PreInit(void); +char* LCDSIM_Init(void); +void LCDSIM_Exit(void); +int LCDSIM_GetMouseState(LCD_tMouseState *pState); +void LCDSIM_SetMouseState(int x, int y, int KeyStat, int LayerIndex); +void LCDSIM_CheckMouseState(int LayerIndex); +int LCDSIM_SaveBMP (const char * sFileName); +int LCDSIM_SaveBMPEx (const char * sFileName, int x0, int y0, int xSize, int ySize); +int LCDSIM_SaveSBMP (const char * sFileName); +int LCDSIM_SaveSBMPEx(const char * sFileName, int x0, int y0, int xSize, int ySize); +void LCDSIM_SetRGBOrder(unsigned RGBOrder); + +/************************************************************ +* +* LCDSIM_ Functions for each display +* +************************************************************* +*/ + +void LCDSIM_FillRect(int x0, int y0, int x1, int y1, int Index, int LayerIndex); +int LCDSIM_GetModifyCnt(int LayerIndex); +int LCDSIM_GetModifyCntInfo(int LayerIndex); +int LCDSIM_GetPixelColor(int x, int y, int LayerIndex); +int LCDSIM_GetPixelIndex(int x, int y, int LayerIndex); +int LCDSIM_Index2Color(int Index, int LayerIndex); +int LCDSIM_RLUT_GetPixelIndex(int x, int y, int LayerIndex); +void LCDSIM_RLUT_SetPixelIndex(int x, int y, int Index, int LayerIndex); +void LCDSIM_SetLUTEntry(U8 Pos, LCD_COLOR color, int LayerIndex); +void LCDSIM_SetPixelIndex(int x, int y, int Index, int LayerIndex); +void LCDSIM_SetPixelColor(int x, int y, LCD_COLOR PixelColor, int LayerIndex); +void LCDSIM_SetSubPixel(int x, int y, U8 Value, int LayerIndex); +void LCDSIM_SetPixelPhys(int x, int y, int Index, int LayerIndex); +int LCDSIM_GetPixelPhys(int xPhys, int yPhys, int LayerIndex); +void LCDSIM_FillRectPhys(int x0Phys, int y0Phys, int x1Phys, int y1Phys, int Index, int LayerIndex); +void LCDSIM_SetOrg(int x, int y, int LayerIndex); +void LCDSIM_SetAlpha(int Alpha, int LayerIndex); +int LCDSIM_GetAlpha(int LayerIndex); +void LCDSIM_SetLayerPos(int xPos, int yPos, int LayerIndex); +void LCDSIM_SetLayerVis(int OnOff, int LayerIndex); +void LCDSIM_SetSize(int LayerIndex, int xSize, int ySize); +void LCDSIM_SetTransMode(int LayerIndex, int TransMode); +void LCDSIM_SetChroma(int LayerIndex, LCD_COLOR ChromaMin, LCD_COLOR ChromaMax); +void LCDSIM_SetCompositeColor(U32 Color); +void LCDSIM_SetCompositeSize(int xSize, int ySize); +void LCDSIM_CopyBuffer(int LayerIndex, int IndexSrc, int IndexDst); + +/******************************************************************** +* +* Publics for LCD +* +********************************************************************* +*/ +void SIM_GUI_SetCompositeSize(int xSize, int ySize); +void SIM_GUI_SetCompositeColor(U32 Color); +U32 SIM_GUI_GetCompositeColor(void); +void SIM_GUI_SetLCDPos(int xPos, int yPos); +int SIM_GUI_SetTransColor(int Color); +int SIM_GUI_SetLCDColorBlack (unsigned int Index, int Color); +int SIM_GUI_SetLCDColorWhite (unsigned int Index, int Color); +void SIM_GUI_SetMag(int MagX, int MagY); +int SIM_GUI_GetMagX(void); +int SIM_GUI_GetMagY(void); +int SIM_GUI_GetForwardRButton(void); +void SIM_GUI_SetForwardRButton(int OnOff); +void SIM_GUI_SetTransMode(int LayerIndex, int TransMode); +void SIM_GUI_SetChroma(int LayerIndex, unsigned long ChromaMin, unsigned long ChromaMax); +void SIM_GUI_UseCustomBitmaps(void); +void SIM_GUI_SetAccellerator(int Accellerator); +void SIM_GUI_SetMainScreenOffset(int x, int y); + + +/******************************************************************** +* +* Routine(s) in user application +* +********************************************************************* +*/ +void SIM_X_Config(void); /* Allow init before application starts ... Use it to set LCD offset etc */ + +/******************************************************************** +* +* Publics used by GUI_X module +* +********************************************************************* +*/ +void SIM_GUI_Delay (int ms); +void SIM_GUI_ExecIdle(void); +int SIM_GUI_GetTime(void); +int SIM_GUI_GetKey(void); +int SIM_GUI_WaitKey(void); +void SIM_GUI_StoreKey(int); + + +/******************************************************************** +* +* Publics for logging, warning, errorout +* +********************************************************************* +*/ +void SIM_GUI_Log(const char *s); +void SIM_GUI_Log1(const char *s, int p0); +void SIM_GUI_Log2(const char *s, int p0, int p1); +void SIM_GUI_Log3(const char *s, int p0, int p1, int p2); +void SIM_GUI_Log4(const char *s, int p0, int p1, int p2,int p3); +void SIM_GUI_Warn(const char *s); +void SIM_GUI_Warn1(const char *s, int p0); +void SIM_GUI_Warn2(const char *s, int p0, int p1); +void SIM_GUI_Warn3(const char *s, int p0, int p1, int p2); +void SIM_GUI_Warn4(const char *s, int p0, int p1, int p2, int p3); +void SIM_GUI_ErrorOut(const char *s); +void SIM_GUI_ErrorOut1(const char *s, int p0); +void SIM_GUI_ErrorOut2(const char *s, int p0, int p1); +void SIM_GUI_ErrorOut3(const char *s, int p0, int p1, int p2); +void SIM_GUI_ErrorOut4(const char *s, int p0, int p1, int p2, int p3); +void SIM_GUI_EnableMessageBoxOnError(int Status); + +/******************************************************************** +* +* Commandline support +* +********************************************************************* +*/ +const char *SIM_GUI_GetCmdLine(void); + +/******************************************************************** +* +* Multitasking support +* +********************************************************************* +*/ +void SIM_GUI_CreateTask(char * pName, void * pFunc); +void SIM_GUI_Start(void); +unsigned long SIM_GUI_GetTaskID(void); +void SIM_GUI_Lock(void); +void SIM_GUI_Unlock(void); +void SIM_GUI_InitOS(void); + +#ifdef __cplusplus +} +#endif + +#endif /* LCD_H */ + + + +
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/LISTBOX.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/LISTBOX.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,208 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : LISTBOX.h +Purpose : LISTBOX widget include +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef LISTBOX_H +#define LISTBOX_H + +#include "WM.h" +#include "WIDGET.h" /* Req. for WIDGET_DRAW_ITEM_FUNC */ +#include "DIALOG_Intern.h" /* Req. for Create indirect data structure */ + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) + extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* defines +* +********************************************************************** +*/ + +#define LISTBOX_ALL_ITEMS -1 + +/********************************************************************* +* +* Color indices +*/ +#define LISTBOX_CI_UNSEL 0 +#define LISTBOX_CI_SEL 1 +#define LISTBOX_CI_SELFOCUS 2 +#define LISTBOX_CI_DISABLED 3 + +/************************************************************ +* +* States +*/ +typedef WM_HMEM LISTBOX_Handle; + +/********************************************************************* +* +* Notification codes +* +* The following is the list of notification codes specific to this widget, +* Send with the WM_NOTIFY_PARENT message +*/ +#define LISTBOX_NOTIFICATION_LOST_FOCUS (WM_NOTIFICATION_WIDGET + 0) + +/************************************************************ +* +* Create / Status flags +*/ +#define LISTBOX_CF_AUTOSCROLLBAR_H (1<<0) +#define LISTBOX_CF_AUTOSCROLLBAR_V (1<<1) +#define LISTBOX_CF_MULTISEL (1<<2) +#define LISTBOX_SF_AUTOSCROLLBAR_H LISTBOX_CF_AUTOSCROLLBAR_H +#define LISTBOX_SF_AUTOSCROLLBAR_V LISTBOX_CF_AUTOSCROLLBAR_V +#define LISTBOX_SF_MULTISEL LISTBOX_CF_MULTISEL + +/********************************************************************* +* +* Standard member functions +* +********************************************************************** +*/ + +#define LISTBOX_EnableMemdev(hObj) WM_EnableMemdev(hObj) +#define LISTBOX_DisableMemdev(hObj) WM_DisableMemdev(hObj) +#define LISTBOX_Delete(hObj) WM_DeleteWindow(hObj) +#define LISTBOX_Paint(hObj) WM_Paint(hObj) +#define LISTBOX_Invalidate(hObj) WM_InvalidateWindow(hObj) + +/********************************************************************* +* +* Create functions +* +********************************************************************** +*/ + +LISTBOX_Handle LISTBOX_Create (const GUI_ConstString * ppText, int x0, int y0, int xSize, int ySize, int Flags); +LISTBOX_Handle LISTBOX_CreateAsChild (const GUI_ConstString * ppText, WM_HWIN hWinParent, int x0, int y0, int xSize, int ySize, int Flags); +LISTBOX_Handle LISTBOX_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, const GUI_ConstString * ppText); +LISTBOX_Handle LISTBOX_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, const GUI_ConstString * ppText, int NumExtraBytes); +LISTBOX_Handle LISTBOX_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); + +/********************************************************************* +* +* The callback ... +* +* Do not call it directly ! It is only to be used from within an +* overwritten callback. +*/ +void LISTBOX_Callback(WM_MESSAGE * pMsg); + +/********************************************************************* +* +* Member functions +* +********************************************************************** +*/ + +int LISTBOX_AddKey (LISTBOX_Handle hObj, int Key); +void LISTBOX_AddString (LISTBOX_Handle hObj, const char * s); +void LISTBOX_AddStringH (LISTBOX_Handle hObj, WM_HMEM hString); /* Not to be documented!!! */ +void LISTBOX_DecSel (LISTBOX_Handle hObj); +void LISTBOX_DeleteItem (LISTBOX_Handle hObj, unsigned int Index); +unsigned LISTBOX_GetItemSpacing (LISTBOX_Handle hObj); +unsigned LISTBOX_GetNumItems (LISTBOX_Handle hObj); +int LISTBOX_GetSel (LISTBOX_Handle hObj); +const GUI_FONT * LISTBOX_GetFont (LISTBOX_Handle hObj); +int LISTBOX_GetItemDisabled (LISTBOX_Handle hObj, unsigned Index); +int LISTBOX_GetItemSel (LISTBOX_Handle hObj, unsigned Index); +void LISTBOX_GetItemText (LISTBOX_Handle hObj, unsigned Index, char * pBuffer, int MaxSize); +int LISTBOX_GetMulti (LISTBOX_Handle hObj); +int LISTBOX_GetScrollStepH (LISTBOX_Handle hObj); +int LISTBOX_GetTextAlign (LISTBOX_Handle hObj); +int LISTBOX_GetUserData (LISTBOX_Handle hObj, void * pDest, int NumBytes); +void LISTBOX_IncSel (LISTBOX_Handle hObj); +void LISTBOX_InsertString (LISTBOX_Handle hObj, const char * s, unsigned int Index); +void LISTBOX_InvalidateItem (LISTBOX_Handle hObj, int Index); +int LISTBOX_OwnerDraw (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); +void LISTBOX_SetAutoScrollH (LISTBOX_Handle hObj, int OnOff); +void LISTBOX_SetAutoScrollV (LISTBOX_Handle hObj, int OnOff); +void LISTBOX_SetBkColor (LISTBOX_Handle hObj, unsigned int Index, GUI_COLOR color); +void LISTBOX_SetFont (LISTBOX_Handle hObj, const GUI_FONT * pFont); +void LISTBOX_SetItemDisabled (LISTBOX_Handle hObj, unsigned Index, int OnOff); +void LISTBOX_SetItemSel (LISTBOX_Handle hObj, unsigned Index, int OnOff); +void LISTBOX_SetItemSpacing (LISTBOX_Handle hObj, unsigned Value); +void LISTBOX_SetMulti (LISTBOX_Handle hObj, int Mode); +void LISTBOX_SetOwner (LISTBOX_Handle hObj, WM_HWIN hOwner); +void LISTBOX_SetOwnerDraw (LISTBOX_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawItem); +void LISTBOX_SetScrollStepH (LISTBOX_Handle hObj, int Value); +void LISTBOX_SetSel (LISTBOX_Handle hObj, int Sel); +void LISTBOX_SetScrollbarColor(LISTBOX_Handle hObj, unsigned Index, GUI_COLOR Color); +void LISTBOX_SetScrollbarWidth(LISTBOX_Handle hObj, unsigned Width); +void LISTBOX_SetString (LISTBOX_Handle hObj, const char * s, unsigned int Index); +void LISTBOX_SetText (LISTBOX_Handle hObj, const GUI_ConstString * ppText); +void LISTBOX_SetTextAlign (LISTBOX_Handle hObj, int Align); +GUI_COLOR LISTBOX_SetTextColor (LISTBOX_Handle hObj, unsigned int Index, GUI_COLOR Color); +int LISTBOX_SetUserData (LISTBOX_Handle hObj, const void * pSrc, int NumBytes); +int LISTBOX_UpdateScrollers (LISTBOX_Handle hObj); + +/********************************************************************* +* +* Global functions +* +********************************************************************** +*/ + +const GUI_FONT * LISTBOX_GetDefaultFont(void); +int LISTBOX_GetDefaultScrollStepH (void); +GUI_COLOR LISTBOX_GetDefaultBkColor (unsigned Index); +int LISTBOX_GetDefaultTextAlign (void); +GUI_COLOR LISTBOX_GetDefaultTextColor (unsigned Index); +void LISTBOX_SetDefaultFont (const GUI_FONT * pFont); +void LISTBOX_SetDefaultScrollStepH (int Value); +void LISTBOX_SetDefaultBkColor (unsigned Index, GUI_COLOR Color); +void LISTBOX_SetDefaultTextAlign (int Align); +void LISTBOX_SetDefaultTextColor (unsigned Index, GUI_COLOR Color); + +/********************************************************************* +* +* Compatibility to older versions +* +********************************************************************** +*/ + +#define LISTBOX_SetBackColor(hObj, Index, Color) LISTBOX_SetBkColor(hObj, Index, Color) +#define LISTBOX_DeleteString LISTBOX_DeleteItem + +#if defined(__cplusplus) + } +#endif + +#endif // GUI_WINSUPPORT +#endif // LISTBOX_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/LISTVIEW.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/LISTVIEW.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,197 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : LISTVIEW.h +Purpose : LISTVIEW include +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef LISTVIEW_H +#define LISTVIEW_H + +#include "WM.h" +#include "DIALOG_Intern.h" // Req. for Create indirect data structure +#include "ICONVIEW.h" +#include "HEADER.h" + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) + extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Defines +*/ +#define LISTVIEW_ALL_ITEMS -1 + +/********************************************************************* +* +* Color indices +*/ +#define LISTVIEW_CI_UNSEL 0 +#define LISTVIEW_CI_SEL 1 +#define LISTVIEW_CI_SELFOCUS 2 +#define LISTVIEW_CI_DISABLED 3 + +/************************************************************ +* +* Create / Status flags +*/ +#define LISTVIEW_CF_AUTOSCROLLBAR_H (1 << 0) +#define LISTVIEW_CF_AUTOSCROLLBAR_V (1 << 1) +#define LISTVIEW_SF_AUTOSCROLLBAR_H LISTVIEW_CF_AUTOSCROLLBAR_H +#define LISTVIEW_SF_AUTOSCROLLBAR_V LISTVIEW_CF_AUTOSCROLLBAR_V + +/********************************************************************* +* +* Public Types +* +********************************************************************** +*/ +typedef WM_HMEM LISTVIEW_Handle; + +/********************************************************************* +* +* Create functions +* +********************************************************************** +*/ +LISTVIEW_Handle LISTVIEW_Create (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags, int SpecialFlags); +LISTVIEW_Handle LISTVIEW_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id); +LISTVIEW_Handle LISTVIEW_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes); +LISTVIEW_Handle LISTVIEW_CreateAttached(WM_HWIN hParent, int Id, int SpecialFlags); +LISTVIEW_Handle LISTVIEW_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); + +/********************************************************************* +* +* The callback ... +* +* Do not call it directly ! It is only to be used from within an +* overwritten callback. +*/ +void LISTVIEW_Callback(WM_MESSAGE * pMsg); + +/********************************************************************* +* +* Standard member functions +* +********************************************************************** +*/ +#define LISTVIEW_Delete(hObj) WM_DeleteWindow (hObj) +#define LISTVIEW_DisableMemdev(hObj) WM_DisableMemdev (hObj) +#define LISTVIEW_EnableMemdev(hObj) WM_EnableMemdev (hObj) +#define LISTVIEW_Invalidate(hObj) WM_InvalidateWindow(hObj) +#define LISTVIEW_Paint(hObj) WM_Paint (hObj) + +/********************************************************************* +* +* Member functions +* +********************************************************************** +*/ +int LISTVIEW_AddColumn (LISTVIEW_Handle hObj, int Width, const char * s, int Align); +int LISTVIEW_AddRow (LISTVIEW_Handle hObj, const GUI_ConstString * ppText); +int LISTVIEW_CompareText (const void * p0, const void * p1); +int LISTVIEW_CompareDec (const void * p0, const void * p1); +void LISTVIEW_DecSel (LISTVIEW_Handle hObj); +void LISTVIEW_DeleteAllRows (LISTVIEW_Handle hObj); +void LISTVIEW_DeleteColumn (LISTVIEW_Handle hObj, unsigned Index); +void LISTVIEW_DeleteRow (LISTVIEW_Handle hObj, unsigned Index); +void LISTVIEW_DeleteRowSorted (LISTVIEW_Handle hObj, int Row); +void LISTVIEW_DisableRow (LISTVIEW_Handle hObj, unsigned Row); +void LISTVIEW_DisableSort (LISTVIEW_Handle hObj); +void LISTVIEW_EnableRow (LISTVIEW_Handle hObj, unsigned Row); +void LISTVIEW_EnableSort (LISTVIEW_Handle hObj); +GUI_COLOR LISTVIEW_GetBkColor (LISTVIEW_Handle hObj, unsigned Index); +const GUI_FONT * LISTVIEW_GetFont(LISTVIEW_Handle hObj); +HEADER_Handle LISTVIEW_GetHeader (LISTVIEW_Handle hObj); +void LISTVIEW_GetItemText (LISTVIEW_Handle hObj, unsigned Column, unsigned Row, char * pBuffer, unsigned MaxSize); +unsigned LISTVIEW_GetItemTextLen (LISTVIEW_Handle hObj, unsigned Column, unsigned Row); +void LISTVIEW_GetItemTextSorted (LISTVIEW_Handle hObj, unsigned Column, unsigned Row, char * pBuffer, unsigned MaxSize); +unsigned LISTVIEW_GetLBorder (LISTVIEW_Handle hObj); +unsigned LISTVIEW_GetNumColumns (LISTVIEW_Handle hObj); +unsigned LISTVIEW_GetNumRows (LISTVIEW_Handle hObj); +unsigned LISTVIEW_GetRBorder (LISTVIEW_Handle hObj); +int LISTVIEW_GetSel (LISTVIEW_Handle hObj); +int LISTVIEW_GetSelUnsorted (LISTVIEW_Handle hObj); +int LISTVIEW_GetTextAlign (LISTVIEW_Handle hObj, unsigned ColIndex); +GUI_COLOR LISTVIEW_GetTextColor (LISTVIEW_Handle hObj, unsigned Index); +int LISTVIEW_GetUserData (LISTVIEW_Handle hObj, void * pDest, int NumBytes); +U32 LISTVIEW_GetUserDataRow (LISTVIEW_Handle hObj, unsigned Row); +GUI_WRAPMODE LISTVIEW_GetWrapMode (LISTVIEW_Handle hObj); +void LISTVIEW_IncSel (LISTVIEW_Handle hObj); +int LISTVIEW_InsertRow (LISTVIEW_Handle hObj, unsigned Index, const GUI_ConstString * ppText); +int LISTVIEW_OwnerDraw (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); +unsigned LISTVIEW_RowIsDisabled (LISTVIEW_Handle hObj, unsigned Row); +void LISTVIEW_SetAutoScrollH (LISTVIEW_Handle hObj, int OnOff); +void LISTVIEW_SetAutoScrollV (LISTVIEW_Handle hObj, int OnOff); +void LISTVIEW_SetItemBitmap (LISTVIEW_Handle hObj, unsigned Column, unsigned Row, int xOff, int yOff, const GUI_BITMAP * pBitmap); +void LISTVIEW_SetBkColor (LISTVIEW_Handle hObj, unsigned int Index, GUI_COLOR Color); +void LISTVIEW_SetColumnWidth (LISTVIEW_Handle hObj, unsigned int Index, int Width); +void LISTVIEW_SetCompareFunc (LISTVIEW_Handle hObj, unsigned Column, int (* fpCompare)(const void * p0, const void * p1)); +unsigned LISTVIEW_SetFixed (LISTVIEW_Handle hObj, unsigned Fixed); +void LISTVIEW_SetFont (LISTVIEW_Handle hObj, const GUI_FONT * pFont); +int LISTVIEW_SetGridVis (LISTVIEW_Handle hObj, int Show); +void LISTVIEW_SetHeaderHeight (LISTVIEW_Handle hObj, unsigned HeaderHeight); +void LISTVIEW_SetItemBkColor (LISTVIEW_Handle hObj, unsigned Column, unsigned Row, unsigned int Index, GUI_COLOR Color); +void LISTVIEW_SetItemText (LISTVIEW_Handle hObj, unsigned Column, unsigned Row, const char * s); +void LISTVIEW_SetItemTextColor (LISTVIEW_Handle hObj, unsigned Column, unsigned Row, unsigned int Index, GUI_COLOR Color); +void LISTVIEW_SetLBorder (LISTVIEW_Handle hObj, unsigned BorderSize); +void LISTVIEW_SetOwnerDraw (LISTVIEW_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawItem); +void LISTVIEW_SetRBorder (LISTVIEW_Handle hObj, unsigned BorderSize); +unsigned LISTVIEW_SetRowHeight (LISTVIEW_Handle hObj, unsigned RowHeight); +void LISTVIEW_SetSel (LISTVIEW_Handle hObj, int Sel); +void LISTVIEW_SetSelUnsorted (LISTVIEW_Handle hObj, int Sel); +unsigned LISTVIEW_SetSort (LISTVIEW_Handle hObj, unsigned Column, unsigned Reverse); +void LISTVIEW_SetTextAlign (LISTVIEW_Handle hObj, unsigned int Index, int Align); +void LISTVIEW_SetTextColor (LISTVIEW_Handle hObj, unsigned int Index, GUI_COLOR Color); +int LISTVIEW_SetUserData (LISTVIEW_Handle hObj, const void * pSrc, int NumBytes); +void LISTVIEW_SetUserDataRow (LISTVIEW_Handle hObj, unsigned Row, U32 UserData); +void LISTVIEW_SetWrapMode (LISTVIEW_Handle hObj, GUI_WRAPMODE WrapMode); + +/********************************************************************* +* +* Global functions +* +********************************************************************** +*/ + +GUI_COLOR LISTVIEW_SetDefaultBkColor (unsigned Index, GUI_COLOR Color); +const GUI_FONT * LISTVIEW_SetDefaultFont (const GUI_FONT * pFont); +GUI_COLOR LISTVIEW_SetDefaultGridColor(GUI_COLOR Color); +GUI_COLOR LISTVIEW_SetDefaultTextColor(unsigned Index, GUI_COLOR Color); + +#if defined(__cplusplus) + } +#endif + +#endif // GUI_WINSUPPORT +#endif // LISTVIEW_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/LISTWHEEL.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/LISTWHEEL.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,140 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : LISTWHEEL.h +Purpose : LISTWHEEL widget include +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef LISTWHEEL_H +#define LISTWHEEL_H + +#include "WM.h" +#include "DIALOG_Intern.h" +#include "WIDGET.h" + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) + extern "C" { // Make sure we have C-declarations in C++ programs +#endif + +/********************************************************************* +* +* Defines +* +********************************************************************** +*/ +#define LISTWHEEL_CI_UNSEL 0 +#define LISTWHEEL_CI_SEL 1 + +/********************************************************************* +* +* Types +* +********************************************************************** +*/ +typedef WM_HMEM LISTWHEEL_Handle; + +/********************************************************************* +* +* Standard member functions +* +********************************************************************** +*/ +/********************************************************************* +* +* Create functions +* +********************************************************************** +*/ +LISTWHEEL_Handle LISTWHEEL_Create (const GUI_ConstString * ppText, int x0, int y0, int xSize, int ySize, int Flags); +LISTWHEEL_Handle LISTWHEEL_CreateAsChild (const GUI_ConstString * ppText, WM_HWIN hWinParent, int x0, int y0, int xSize, int ySize, int Flags); +LISTWHEEL_Handle LISTWHEEL_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); +LISTWHEEL_Handle LISTWHEEL_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, + int WinFlags, int ExFlags, int Id, const GUI_ConstString * ppText); +LISTWHEEL_Handle LISTWHEEL_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, + int WinFlags, int ExFlags, int Id, const GUI_ConstString * ppText, int NumExtraBytes); + +/********************************************************************* +* +* The callback ... +* +* Do not call it directly ! It is only to be used from within an +* overwritten callback. +*/ +void LISTWHEEL_Callback(WM_MESSAGE * pMsg); + +/********************************************************************* +* +* Member functions +* +********************************************************************** +*/ +void LISTWHEEL_AddString (LISTWHEEL_Handle hObj, const char * s); +void * LISTWHEEL_GetItemData (LISTWHEEL_Handle hObj, unsigned Index); /* not to be documented */ +void LISTWHEEL_GetItemText (LISTWHEEL_Handle hObj, unsigned Index, char * pBuffer, int MaxSize); +int LISTWHEEL_GetItemFromPos (LISTWHEEL_Handle hObj, int yPos); +int LISTWHEEL_GetLBorder (LISTWHEEL_Handle hObj); +unsigned LISTWHEEL_GetLineHeight (LISTWHEEL_Handle hObj); +int LISTWHEEL_GetNumItems (LISTWHEEL_Handle hObj); +int LISTWHEEL_GetPos (LISTWHEEL_Handle hObj); +int LISTWHEEL_GetRBorder (LISTWHEEL_Handle hObj); +int LISTWHEEL_GetSel (LISTWHEEL_Handle hObj); +int LISTWHEEL_GetSnapPosition(LISTWHEEL_Handle hObj); +int LISTWHEEL_GetTextAlign (LISTWHEEL_Handle hObj); +int LISTWHEEL_GetUserData (LISTWHEEL_Handle hObj, void * pDest, int NumBytes); +void LISTWHEEL_MoveToPos (LISTWHEEL_Handle hObj, unsigned int Index); +int LISTWHEEL_OwnerDraw (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); +void LISTWHEEL_SetBkColor (LISTWHEEL_Handle hObj, unsigned int Index, GUI_COLOR Color); +void LISTWHEEL_SetDeceleration(LISTWHEEL_Handle hObj, unsigned Deceleration); +void LISTWHEEL_SetFont (LISTWHEEL_Handle hObj, const GUI_FONT * pFont); +void LISTWHEEL_SetItemData (LISTWHEEL_Handle hObj, unsigned Index, void * pData); /* not to be documented */ +void LISTWHEEL_SetLBorder (LISTWHEEL_Handle hObj, unsigned BorderSize); +void LISTWHEEL_SetLineHeight (LISTWHEEL_Handle hObj, unsigned LineHeight); +void LISTWHEEL_SetOwnerDraw (LISTWHEEL_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfOwnerDraw); +void LISTWHEEL_SetPos (LISTWHEEL_Handle hObj, unsigned int Index); +void LISTWHEEL_SetRBorder (LISTWHEEL_Handle hObj, unsigned BorderSize); +void LISTWHEEL_SetSel (LISTWHEEL_Handle hObj, int Sel); +void LISTWHEEL_SetSnapPosition(LISTWHEEL_Handle hObj, int SnapPosition); +void LISTWHEEL_SetText (LISTWHEEL_Handle hObj, const GUI_ConstString * ppText); +void LISTWHEEL_SetTextAlign (LISTWHEEL_Handle hObj, int Align); +void LISTWHEEL_SetTextColor (LISTWHEEL_Handle hObj, unsigned int Index, GUI_COLOR Color); +void LISTWHEEL_SetTimerPeriod (LISTWHEEL_Handle hObj, GUI_TIMER_TIME TimerPeriod); +int LISTWHEEL_SetUserData (LISTWHEEL_Handle hObj, const void * pSrc, int NumBytes); +void LISTWHEEL_SetVelocity (LISTWHEEL_Handle hObj, int Velocity); + +const GUI_FONT * LISTWHEEL_GetFont(LISTWHEEL_Handle hObj); + +#if defined(__cplusplus) + } +#endif + +#endif // GUI_WINSUPPORT +#endif // LISTWHEEL_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/MENU.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/MENU.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,270 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : MENU.h +Purpose : MENU include +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef MENU_H +#define MENU_H + +#include "WM.h" +#include "WIDGET.h" +#include "DIALOG_Intern.h" // Required for Create indirect data structure + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) + extern "C" { // Make sure we have C-declarations in C++ programs +#endif + +/********************************************************************* +* +* Defines +* +********************************************************************** +*/ +#define MENU_SKIN_FLEX MENU_DrawSkinFlex + +/********************************************************************* +* +* Create flags +*/ +#define MENU_CF_HORIZONTAL (0<<0) +#define MENU_CF_VERTICAL (1<<0) +#define MENU_CF_OPEN_ON_POINTEROVER (1<<1) // Normally a menu opens first when clicked on it +#define MENU_CF_CLOSE_ON_SECOND_CLICK (1<<2) // Normally a menu closes only when clicked outside it +#define MENU_CF_HIDE_DISABLED_SEL (1<<3) // Hides the selection when a disabled item is selected + +/********************************************************************* +* +* Menu item flags +*/ +#define MENU_IF_DISABLED (1<<0) // Indicates that item is disabled +#define MENU_IF_SEPARATOR (1<<1) // Indicates that item is a separator + +/********************************************************************* +* +* Color indices +*/ +#define MENU_CI_ENABLED 0 +#define MENU_CI_SELECTED 1 +#define MENU_CI_DISABLED 2 +#define MENU_CI_DISABLED_SEL 3 +#define MENU_CI_ACTIVE_SUBMENU 4 + +/********************************************************************* +* +* Border indices +*/ +#define MENU_BI_LEFT 0 +#define MENU_BI_RIGHT 1 +#define MENU_BI_TOP 2 +#define MENU_BI_BOTTOM 3 + +/********************************************************************* +* +* Message types +*/ +#define MENU_ON_ITEMSELECT 0 // Send to owner when selecting a menu item +#define MENU_ON_INITMENU 1 // Send to owner when for the first time selecting a submenu +#define MENU_ON_INITSUBMENU 2 // Send to owner when selecting a submenu +#define MENU_ON_OPEN 3 // Internal message of menu widget (only send to submenus) +#define MENU_ON_CLOSE 4 // Internal message of menu widget (only send to submenus) +#define MENU_IS_MENU 5 // Internal message of menu widget. Owner must call + // WM_DefaultProc() when not handle the message +#define MENU_ON_ITEMACTIVATE 6 // Send to owner when highlighting a menu item +#define MENU_ON_ITEMPRESSED 7 // Send to owner when a menu item has been pressed + +/********************************************************************* +* +* Skinning property indices +*/ +#define MENU_SKINFLEX_PI_ENABLED 0 +#define MENU_SKINFLEX_PI_SELECTED 1 +#define MENU_SKINFLEX_PI_DISABLED 2 +#define MENU_SKINFLEX_PI_DISABLED_SEL 3 +#define MENU_SKINFLEX_PI_ACTIVE_SUBMENU 4 + +/********************************************************************* +* +* Types +* +********************************************************************** +*/ + +typedef WM_HMEM MENU_Handle; + +typedef struct { + // + // Background + // + GUI_COLOR aBkColorH[2]; + GUI_COLOR BkColorV; + GUI_COLOR FrameColorH; + GUI_COLOR FrameColorV; + // + // Selection + // + GUI_COLOR aSelColorH[2]; + GUI_COLOR aSelColorV[2]; + GUI_COLOR FrameColorSelH; + GUI_COLOR FrameColorSelV; + // + // Separator + // + GUI_COLOR aSepColorH[2]; + GUI_COLOR aSepColorV[2]; + // + // Arrow + // + GUI_COLOR ArrowColor; + // + // Text + // + GUI_COLOR TextColor; +} MENU_SKINFLEX_PROPS; + +/********************************************************************* +* +* Menu message data +*/ +typedef struct { + U16 MsgType; + U16 ItemId; +} MENU_MSG_DATA; + +/********************************************************************* +* +* Menu item data +*/ +typedef struct { + const char * pText; + U16 Id; + U16 Flags; + MENU_Handle hSubmenu; +} MENU_ITEM_DATA; + +/********************************************************************* +* +* Create functions +* +********************************************************************** +*/ +MENU_Handle MENU_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); +MENU_Handle MENU_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id); +MENU_Handle MENU_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes); + +/********************************************************************* +* +* The callback ... +* +* Do not call it directly ! It is only to be used from within an +* overwritten callback. +*/ +void MENU_Callback(WM_MESSAGE * pMsg); + +/********************************************************************* +* +* Standard member functions +* +********************************************************************** +*/ +#define MENU_EnableMemdev(hObj) WM_EnableMemdev(hObj) +#define MENU_DisableMemdev(hObj) WM_DisableMemdev(hObj) +#define MENU_Delete(hObj) WM_DeleteWindow(hObj) +#define MENU_Paint(hObj) WM_Paint(hObj) +#define MENU_Invalidate(hObj) WM_InvalidateWindow(hObj) + +/********************************************************************* +* +* Individual member functions +* +********************************************************************** +*/ +void MENU_AddItem (MENU_Handle hObj, const MENU_ITEM_DATA * pItemData); +void MENU_Attach (MENU_Handle hObj, WM_HWIN hDestWin, int x, int y, int xSize, int ySize, int Flags); +void MENU_DeleteItem (MENU_Handle hObj, U16 ItemId); +void MENU_DisableItem (MENU_Handle hObj, U16 ItemId); +void MENU_EnableItem (MENU_Handle hObj, U16 ItemId); +void MENU_GetItem (MENU_Handle hObj, U16 ItemId, MENU_ITEM_DATA * pItemData); +void MENU_GetItemText (MENU_Handle hObj, U16 ItemId, char * pBuffer, unsigned BufferSize); +unsigned MENU_GetNumItems (MENU_Handle hObj); +WM_HWIN MENU_GetOwner (MENU_Handle hObj); +int MENU_GetUserData (MENU_Handle hObj, void * pDest, int NumBytes); +void MENU_InsertItem (MENU_Handle hObj, U16 ItemId, const MENU_ITEM_DATA * pItemData); +void MENU_Popup (MENU_Handle hObj, WM_HWIN hDestWin, int x, int y, int xSize, int ySize, int Flags); +void MENU_SetBkColor (MENU_Handle hObj, unsigned ColorIndex, GUI_COLOR Color); +void MENU_SetBorderSize(MENU_Handle hObj, unsigned BorderIndex, U8 BorderSize); +void MENU_SetFont (MENU_Handle hObj, const GUI_FONT * pFont); +void MENU_SetItem (MENU_Handle hObj, U16 ItemId, const MENU_ITEM_DATA * pItemData); +void MENU_SetOwner (MENU_Handle hObj, WM_HWIN hOwner); +int MENU_SetSel (MENU_Handle hObj, int Sel); +void MENU_SetTextColor (MENU_Handle hObj, unsigned ColorIndex, GUI_COLOR Color); +int MENU_SetUserData (MENU_Handle hObj, const void * pSrc, int NumBytes); + +/********************************************************************* +* +* Member functions, get / set defaults +* +********************************************************************** +*/ +GUI_COLOR MENU_GetDefaultTextColor (unsigned ColorIndex); +GUI_COLOR MENU_GetDefaultBkColor (unsigned ColorIndex); +U8 MENU_GetDefaultBorderSize (unsigned BorderIndex); +const WIDGET_EFFECT * MENU_GetDefaultEffect (void); +const GUI_FONT * MENU_GetDefaultFont (void); +void MENU_SetDefaultTextColor (unsigned ColorIndex, GUI_COLOR Color); +void MENU_SetDefaultBkColor (unsigned ColorIndex, GUI_COLOR Color); +void MENU_SetDefaultBorderSize (unsigned BorderIndex, U8 BorderSize); +void MENU_SetDefaultEffect (const WIDGET_EFFECT * pEffect); +void MENU_SetDefaultFont (const GUI_FONT * pFont); + +/********************************************************************* +* +* Member functions: Skinning +* +********************************************************************** +*/ +int MENU_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); +void MENU_GetSkinFlexProps (MENU_SKINFLEX_PROPS * pProps, int Index); +WIDGET_DRAW_ITEM_FUNC * MENU_SetDefaultSkin (WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); +void MENU_SetDefaultSkinClassic(void); +void MENU_SetSkinClassic (MENU_Handle hObj); +void MENU_SetSkin (MENU_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); +void MENU_SetSkinFlexProps (const MENU_SKINFLEX_PROPS * pProps, int Index); +void MENU_SkinEnableArrow (MENU_Handle hObj, int OnOff); + +#if defined(__cplusplus) + } +#endif + +#endif // GUI_WINSUPPORT +#endif // MENU_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/MESSAGEBOX.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/MESSAGEBOX.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,61 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : MESSAGEBOX.h +Purpose : Message box interface +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef MESSAGEBOX_H +#define MESSAGEBOX_H + +#include "WM.h" + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +WM_HWIN MESSAGEBOX_Create(const char * sMessage, const char * sCaption, int Flags); + +/********************************************************************* +* +* The callback ... +* +* Do not call it directly ! It is only to be used from within an +* overwritten callback. +*/ +void MESSAGEBOX_Callback(WM_MESSAGE * pMsg); + +#if defined(__cplusplus) + } +#endif + +#endif /* GUI_WINSUPPORT */ + +#endif /* MESSAGEBOX */
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/MULTIEDIT.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/MULTIEDIT.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,149 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : MULTIEDIT.h +Purpose : MULTIEDIT include +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef MULTIEDIT_H +#define MULTIEDIT_H + +#include "WM.h" +#include "DIALOG_Intern.h" /* Req. for Create indirect data structure */ + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) + extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +#define MULTIEDIT_CF_READONLY (1 << 0) +#define MULTIEDIT_CF_INSERT (1 << 2) +#define MULTIEDIT_CF_AUTOSCROLLBAR_V (1 << 3) +#define MULTIEDIT_CF_AUTOSCROLLBAR_H (1 << 4) +#define MULTIEDIT_CF_PASSWORD (1 << 5) + +#define MULTIEDIT_SF_READONLY MULTIEDIT_CF_READONLY +#define MULTIEDIT_SF_INSERT MULTIEDIT_CF_INSERT +#define MULTIEDIT_SF_AUTOSCROLLBAR_V MULTIEDIT_CF_AUTOSCROLLBAR_V +#define MULTIEDIT_SF_AUTOSCROLLBAR_H MULTIEDIT_CF_AUTOSCROLLBAR_H +#define MULTIEDIT_SF_PASSWORD MULTIEDIT_CF_PASSWORD + +/********************************************************************* +* +* Color indices +*/ +#define MULTIEDIT_CI_EDIT 0 +#define MULTIEDIT_CI_READONLY 1 + +/********************************************************************* +* +* Public Types +* +********************************************************************** +*/ + +typedef WM_HMEM MULTIEDIT_HANDLE; + +/********************************************************************* +* +* Create functions +* +********************************************************************** +*/ +MULTIEDIT_HANDLE MULTIEDIT_Create (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags, int ExFlags, const char * pText, int MaxLen); +MULTIEDIT_HANDLE MULTIEDIT_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int BufferSize, const char * pText); +MULTIEDIT_HANDLE MULTIEDIT_CreateIndirect(const GUI_WIDGET_CREATE_INFO* pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); +MULTIEDIT_HANDLE MULTIEDIT_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int BufferSize, const char * pText, int NumExtraBytes); + +/********************************************************************* +* +* The callback ... +* +* Do not call it directly ! It is only to be used from within an +* overwritten callback. +*/ +void MULTIEDIT_Callback(WM_MESSAGE * pMsg); + +/********************************************************************* +* +* Member functions +* +********************************************************************** +*/ + +int MULTIEDIT_AddKey (MULTIEDIT_HANDLE hObj, U16 Key); +int MULTIEDIT_AddText (MULTIEDIT_HANDLE hObj, const char * s); +void MULTIEDIT_EnableBlink (MULTIEDIT_HANDLE hObj, int Period, int OnOff); +int MULTIEDIT_GetCursorCharPos (MULTIEDIT_HANDLE hObj); +void MULTIEDIT_GetCursorPixelPos(MULTIEDIT_HANDLE hObj, int * pxPos, int * pyPos); +void MULTIEDIT_GetPrompt (MULTIEDIT_HANDLE hObj, char* sDest, int MaxNumChars); +int MULTIEDIT_GetTextSize (MULTIEDIT_HANDLE hObj); +void MULTIEDIT_GetText (MULTIEDIT_HANDLE hObj, char* sDest, int MaxNumChars); +int MULTIEDIT_GetUserData (MULTIEDIT_HANDLE hObj, void * pDest, int NumBytes); +void MULTIEDIT_SetTextAlign (MULTIEDIT_HANDLE hObj, int Align); +void MULTIEDIT_SetAutoScrollH (MULTIEDIT_HANDLE hObj, int OnOff); +void MULTIEDIT_SetAutoScrollV (MULTIEDIT_HANDLE hObj, int OnOff); +void MULTIEDIT_SetBkColor (MULTIEDIT_HANDLE hObj, unsigned Index, GUI_COLOR color); +void MULTIEDIT_SetCursorCharPos (MULTIEDIT_HANDLE hObj, int x, int y); /* Not yet implemented */ +void MULTIEDIT_SetCursorPixelPos(MULTIEDIT_HANDLE hObj, int x, int y); /* Not yet implemented */ +void MULTIEDIT_SetCursorOffset (MULTIEDIT_HANDLE hObj, int Offset); +void MULTIEDIT_SetHBorder (MULTIEDIT_HANDLE hObj, unsigned HBorder); +void MULTIEDIT_SetFocussable (MULTIEDIT_HANDLE hObj, int State); +void MULTIEDIT_SetFont (MULTIEDIT_HANDLE hObj, const GUI_FONT * pFont); +void MULTIEDIT_SetInsertMode (MULTIEDIT_HANDLE hObj, int OnOff); +void MULTIEDIT_SetBufferSize (MULTIEDIT_HANDLE hObj, int BufferSize); +void MULTIEDIT_SetMaxNumChars (MULTIEDIT_HANDLE hObj, unsigned MaxNumChars); +void MULTIEDIT_SetPrompt (MULTIEDIT_HANDLE hObj, const char* sPrompt); +void MULTIEDIT_SetReadOnly (MULTIEDIT_HANDLE hObj, int OnOff); +void MULTIEDIT_SetPasswordMode (MULTIEDIT_HANDLE hObj, int OnOff); +void MULTIEDIT_SetText (MULTIEDIT_HANDLE hObj, const char* s); +void MULTIEDIT_SetTextColor (MULTIEDIT_HANDLE hObj, unsigned Index, GUI_COLOR color); +int MULTIEDIT_SetUserData (MULTIEDIT_HANDLE hObj, const void * pSrc, int NumBytes); +void MULTIEDIT_SetWrapNone (MULTIEDIT_HANDLE hObj); +void MULTIEDIT_SetWrapChar (MULTIEDIT_HANDLE hObj); +void MULTIEDIT_SetWrapWord (MULTIEDIT_HANDLE hObj); + +/********************************************************************* +* +* Macros for compatibility with older versions +* +********************************************************************** +*/ + +#define MULTIEDIT_SetMaxLen(hObj, MaxLen) MULTIEDIT_SetBufferSize(hObj, MaxLen) +#define MULTIEDIT_GetStringSize MULTIEDIT_GetTextSize + +#if defined(__cplusplus) + } +#endif + +#endif // GUI_WINSUPPORT +#endif // MULTIEDIT_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/MULTIPAGE.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/MULTIPAGE.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,198 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : MULTIPAGE.h +Purpose : MULTIPAGE include +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef MULTIPAGE_H +#define MULTIPAGE_H + +#include "WM.h" +#include "DIALOG.h" // Required for Create indirect data structure + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) + extern "C" { // Make sure we have C-declarations in C++ programs +#endif + +/********************************************************************* +* +* Defines +* +********************************************************************** +*/ +/********************************************************************* +* +* Create / Status flags +*/ +#define MULTIPAGE_ALIGN_LEFT (0 << 0) +#define MULTIPAGE_ALIGN_RIGHT (1 << 0) +#define MULTIPAGE_ALIGN_TOP (0 << 2) +#define MULTIPAGE_ALIGN_BOTTOM (1 << 2) + +#define MULTIPAGE_CF_ROTATE_CW WIDGET_CF_VERTICAL + +#define MULTIPAGE_CI_DISABLED 0 +#define MULTIPAGE_CI_ENABLED 1 + +#define MULTIPAGE_SKIN_FRAME_LEFT (1 << 0) +#define MULTIPAGE_SKIN_FRAME_RIGHT (1 << 1) +#define MULTIPAGE_SKIN_FRAME_TOP (1 << 2) +#define MULTIPAGE_SKIN_FRAME_BOTTOM (1 << 3) +#define MULTIPAGE_SKIN_FRAME_ALL (MULTIPAGE_SKIN_FRAME_LEFT | MULTIPAGE_SKIN_FRAME_RIGHT | MULTIPAGE_SKIN_FRAME_TOP | MULTIPAGE_SKIN_FRAME_BOTTOM) + +#define MULTIPAGE_SKINFLEX_PI_ENABLED 0 +#define MULTIPAGE_SKINFLEX_PI_SELECTED 1 +#define MULTIPAGE_SKINFLEX_PI_DISABLED 2 + +/********************************************************************* +* +* Public Types +* +********************************************************************** +*/ +typedef WM_HMEM MULTIPAGE_Handle; + +typedef struct { + GUI_COLOR BkColor; + GUI_COLOR aBkUpper[2]; + GUI_COLOR aBkLower[2]; + GUI_COLOR FrameColor; + GUI_COLOR TextColor; +} MULTIPAGE_SKINFLEX_PROPS; + +typedef struct { + U16 StartOff; // Offset to use when drawing the unselected item 0. + U8 SelSideBorderInc; // Number of pixels to add on both sides when drawing the selected item. + U8 UnselTopBorderDec; // Number of pixels to decrease the height of unselected items. +} MULTIPAGE_SKIN_PROPS; + +typedef struct { + #if GUI_SUPPORT_ROTATION + GUI_ROTATION * pRotation; + #endif + unsigned Align; + int Sel; + U16 State; + U8 FrameFlags; // Flags to let the drawing function know which parts of the frame to display. + U8 PageStatus; +} MULTIPAGE_SKIN_INFO; + +/********************************************************************* +* +* Create functions +* +********************************************************************** +*/ +MULTIPAGE_Handle MULTIPAGE_Create (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags, int SpecialFlags); +MULTIPAGE_Handle MULTIPAGE_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id); +MULTIPAGE_Handle MULTIPAGE_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes); +MULTIPAGE_Handle MULTIPAGE_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); + +/********************************************************************* +* +* The callback ... +* +* Do not call it directly ! It is only to be used from within an +* overwritten callback. +*/ +void MULTIPAGE_Callback(WM_MESSAGE * pMsg); + +/********************************************************************* +* +* Member functions +* +********************************************************************** +*/ +void MULTIPAGE_AddPage (MULTIPAGE_Handle hObj, WM_HWIN hWin ,const char * pText); +void MULTIPAGE_AddEmptyPage (MULTIPAGE_Handle hObj, WM_HWIN hWin ,const char * pText); +WM_HWIN MULTIPAGE_AttachWindow (MULTIPAGE_Handle hObj, unsigned Index, WM_HWIN hWin); +void MULTIPAGE_DeletePage (MULTIPAGE_Handle hObj, unsigned Index, int Delete); +void MULTIPAGE_DisablePage (MULTIPAGE_Handle hObj, unsigned Index); +void MULTIPAGE_EnablePage (MULTIPAGE_Handle hObj, unsigned Index); +const GUI_FONT * MULTIPAGE_GetFont (MULTIPAGE_Handle hObj); +int MULTIPAGE_GetSelection (MULTIPAGE_Handle hObj); +int MULTIPAGE_GetPageText (MULTIPAGE_Handle hObj, unsigned Index, char * pBuffer, int MaxLen); +int MULTIPAGE_GetUserData (MULTIPAGE_Handle hObj, void * pDest, int NumBytes); +WM_HWIN MULTIPAGE_GetWindow (MULTIPAGE_Handle hObj, unsigned Index); +int MULTIPAGE_IsPageEnabled (MULTIPAGE_Handle hObj, unsigned Index); +void MULTIPAGE_SelectPage (MULTIPAGE_Handle hObj, unsigned Index); +void MULTIPAGE_SetAlign (MULTIPAGE_Handle hObj, unsigned Align); +void MULTIPAGE_SetBkColor (MULTIPAGE_Handle hObj, GUI_COLOR Color, unsigned Index); +void MULTIPAGE_SetFont (MULTIPAGE_Handle hObj, const GUI_FONT * pFont); +void MULTIPAGE_SetRotation (MULTIPAGE_Handle hObj, unsigned Rotation); +void MULTIPAGE_SetText (MULTIPAGE_Handle hObj, const char * pText, unsigned Index); +void MULTIPAGE_SetTextColor (MULTIPAGE_Handle hObj, GUI_COLOR Color, unsigned Index); +int MULTIPAGE_SetUserData (MULTIPAGE_Handle hObj, const void * pSrc, int NumBytes); + +/********************************************************************* +* +* Get/Set defaults +* +********************************************************************** +*/ +unsigned MULTIPAGE_GetDefaultAlign (void); +GUI_COLOR MULTIPAGE_GetDefaultBkColor (unsigned Index); +const GUI_FONT * MULTIPAGE_GetDefaultFont (void); +GUI_COLOR MULTIPAGE_GetDefaultTextColor(unsigned Index); + +void MULTIPAGE_SetDefaultAlign (unsigned Align); +void MULTIPAGE_SetDefaultBkColor (GUI_COLOR Color, unsigned Index); +void MULTIPAGE_SetDefaultFont (const GUI_FONT * pFont); +void MULTIPAGE_SetDefaultTextColor(GUI_COLOR Color, unsigned Index); + +void MULTIPAGE_SetEffectColor (unsigned Index, GUI_COLOR Color); +GUI_COLOR MULTIPAGE_GetEffectColor (unsigned Index); +int MULTIPAGE_GetNumEffectColors (void); + +/********************************************************************* +* +* Member functions: Skinning +* +********************************************************************** +*/ +int MULTIPAGE_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); +void MULTIPAGE_GetSkinFlexProps (MULTIPAGE_SKINFLEX_PROPS * pProps, int Index); +WIDGET_DRAW_ITEM_FUNC * MULTIPAGE_SetDefaultSkin (WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); +void MULTIPAGE_SetDefaultSkinClassic(void); +void MULTIPAGE_SetSkinClassic (MULTIPAGE_Handle hObj); +void MULTIPAGE_SetSkin (MULTIPAGE_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); +void MULTIPAGE_SetSkinFlexProps (const MULTIPAGE_SKINFLEX_PROPS * pProps, int Index); + +#define MULTIPAGE_SKIN_FLEX MULTIPAGE_DrawSkinFlex + +#if defined(__cplusplus) + } +#endif + +#endif // GUI_WINSUPPORT +#endif // MULTIPAGE_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/PROGBAR.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/PROGBAR.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,165 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : PROGBAR.h +Purpose : Progressbar include +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef PROGBAR_H /* Avoid multiple inclusion */ +#define PROGBAR_H + +#include "WM.h" +#include "DIALOG_Intern.h" /* Req. for Create indirect data structure */ +#include "WIDGET.h" + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) + extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Defines +* +********************************************************************** +*/ +/********************************************************************* +* +* Create flags +*/ +#define PROGBAR_CF_HORIZONTAL (0 << 0) +#define PROGBAR_CF_VERTICAL (1 << 0) +#define PROGBAR_CF_USER (1 << 1) + +/********************************************************************* +* +* Skinning constants +*/ +#define PROGBAR_SKINFLEX_L 0 +#define PROGBAR_SKINFLEX_R 1 + +/********************************************************************* +* +* Types +* +********************************************************************** +*/ +typedef WM_HMEM PROGBAR_Handle; + +typedef struct { + GUI_COLOR aColorUpperL[2]; + GUI_COLOR aColorLowerL[2]; + GUI_COLOR aColorUpperR[2]; + GUI_COLOR aColorLowerR[2]; + GUI_COLOR ColorFrame; + GUI_COLOR ColorText; +} PROGBAR_SKINFLEX_PROPS; + +typedef struct { + int IsVertical; + int Index; + const char * pText; +} PROGBAR_SKINFLEX_INFO; + +/********************************************************************* +* +* Create functions +* +********************************************************************** +*/ + +PROGBAR_Handle PROGBAR_Create (int x0, int y0, int xSize, int ySize, int Flags); +PROGBAR_Handle PROGBAR_CreateAsChild (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags); +PROGBAR_Handle PROGBAR_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id); +PROGBAR_Handle PROGBAR_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes); +PROGBAR_Handle PROGBAR_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); + +/********************************************************************* +* +* The callback ... +* +* Do not call it directly ! It is only to be used from within an +* overwritten callback. +*/ +void PROGBAR_Callback(WM_MESSAGE * pMsg); + +/********************************************************************* +* +* Standard member functions +* +********************************************************************** +*/ + +#define PROGBAR_EnableMemdev(hObj) WM_EnableMemdev(hObj) +#define PROGBAR_DisableMemdev(hObj) WM_DisableMemdev(hObj) +#define PROGBAR_Delete(hObj) WM_DeleteWindow(hObj) +#define PROGBAR_Paint(hObj) WM_Paint(hObj) + +/********************************************************************* +* +* Individual member functions +* +********************************************************************** +*/ + +int PROGBAR_GetUserData (PROGBAR_Handle hObj, void * pDest, int NumBytes); +void PROGBAR_SetBarColor (PROGBAR_Handle hObj, unsigned int index, GUI_COLOR color); +void PROGBAR_SetFont (PROGBAR_Handle hObj, const GUI_FONT * pfont); +void PROGBAR_SetMinMax (PROGBAR_Handle hObj, int Min, int Max); +void PROGBAR_SetText (PROGBAR_Handle hObj, const char* s); +void PROGBAR_SetTextAlign(PROGBAR_Handle hObj, int Align); +void PROGBAR_SetTextColor(PROGBAR_Handle hObj, unsigned int index, GUI_COLOR color); +void PROGBAR_SetTextPos (PROGBAR_Handle hObj, int XOff, int YOff); +void PROGBAR_SetValue (PROGBAR_Handle hObj, int v); +int PROGBAR_SetUserData (PROGBAR_Handle hObj, const void * pSrc, int NumBytes); + +/********************************************************************* +* +* Member functions: Skinning +* +********************************************************************** +*/ +void PROGBAR_GetSkinFlexProps (PROGBAR_SKINFLEX_PROPS * pProps, int Index); +void PROGBAR_SetSkinClassic (PROGBAR_Handle hObj); +void PROGBAR_SetSkin (PROGBAR_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); +int PROGBAR_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); +void PROGBAR_SetSkinFlexProps (const PROGBAR_SKINFLEX_PROPS * pProps, int Index); +void PROGBAR_SetDefaultSkinClassic(void); +WIDGET_DRAW_ITEM_FUNC * PROGBAR_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); + +#define PROGBAR_SKIN_FLEX PROGBAR_DrawSkinFlex + +#if defined(__cplusplus) + } +#endif + +#endif // GUI_WINSUPPORT +#endif // PROGBAR_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/RADIO.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/RADIO.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,184 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : RADIO.h +Purpose : RADIO include +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef RADIO_H +#define RADIO_H + +#include "WM.h" +#include "DIALOG_Intern.h" /* Req. for Create indirect data structure */ +#include "WIDGET.h" + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) + extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Bitmap indices +*/ +#define RADIO_BI_INACTIV 0 +#define RADIO_BI_ACTIV 1 +#define RADIO_BI_CHECK 2 + +/********************************************************************* +* +* Skinning property indices +*/ +#define RADIO_SKINFLEX_PI_PRESSED 0 +#define RADIO_SKINFLEX_PI_UNPRESSED 1 + +/********************************************************************* +* +* Defaults for public configuration switches +* +********************************************************************** + +The following are defaults for config switches which affect the +interface specified in this module +*/ + +/********************************************************************* +* +* Defines +* +********************************************************************** +*/ +#define RADIO_TEXTPOS_RIGHT 0 +#define RADIO_TEXTPOS_LEFT WIDGET_STATE_USER0 /* Not implemented, TBD */ + +/********************************************************************* +* +* Public Types +* +********************************************************************** +*/ +typedef WM_HMEM RADIO_Handle; + +typedef struct { + GUI_COLOR aColorButton[4]; + int ButtonSize; +} RADIO_SKINFLEX_PROPS; + +/********************************************************************* +* +* Create functions +* +********************************************************************** +*/ + +RADIO_Handle RADIO_Create (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags, unsigned Para); +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); +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); +RADIO_Handle RADIO_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); + +/********************************************************************* +* +* The callback ... +* +* Do not call it directly ! It is only to be used from within an +* overwritten callback. +*/ +void RADIO_Callback(WM_MESSAGE * pMsg); + +/********************************************************************* +* +* Standard member functions +* +********************************************************************** +*/ + +void RADIO_SetDefaultFont (const GUI_FONT * pFont); +GUI_COLOR RADIO_SetDefaultFocusColor(GUI_COLOR Color); +void RADIO_SetDefaultImage (const GUI_BITMAP * pBitmap, unsigned int Index); +void RADIO_SetDefaultTextColor (GUI_COLOR TextColor); + +const GUI_FONT * RADIO_GetDefaultFont (void); +GUI_COLOR RADIO_GetDefaultTextColor (void); + +/********************************************************************* +* +* Member functions +* +********************************************************************** +*/ + +void RADIO_AddValue (RADIO_Handle hObj, int Add); +void RADIO_Dec (RADIO_Handle hObj); +int RADIO_GetText (RADIO_Handle hObj, unsigned Index, char * pBuffer, int MaxLen); +int RADIO_GetUserData (RADIO_Handle hObj, void * pDest, int NumBytes); +void RADIO_Inc (RADIO_Handle hObj); +void RADIO_SetBkColor (RADIO_Handle hObj, GUI_COLOR Color); +GUI_COLOR RADIO_SetFocusColor(RADIO_Handle hObj, GUI_COLOR Color); +void RADIO_SetFont (RADIO_Handle hObj, const GUI_FONT * pFont); +void RADIO_SetGroupId (RADIO_Handle hObj, U8 GroupId); +void RADIO_SetImage (RADIO_Handle hObj, const GUI_BITMAP * pBitmap, unsigned int Index); +void RADIO_SetText (RADIO_Handle hObj, const char* pText, unsigned Index); +void RADIO_SetTextColor (RADIO_Handle hObj, GUI_COLOR Color); +void RADIO_SetValue (RADIO_Handle hObj, int v); +int RADIO_SetUserData (RADIO_Handle hObj, const void * pSrc, int NumBytes); + +const GUI_BITMAP * RADIO_GetImage(RADIO_Handle hObj, unsigned int Index); + +/********************************************************************* +* +* Member functions: Skinning +* +********************************************************************** +*/ +void RADIO_GetSkinFlexProps (RADIO_SKINFLEX_PROPS * pProps, int Index); +void RADIO_SetSkinClassic (RADIO_Handle hObj); +void RADIO_SetSkin (RADIO_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); +int RADIO_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); +void RADIO_SetSkinFlexProps (const RADIO_SKINFLEX_PROPS * pProps, int Index); +void RADIO_SetDefaultSkinClassic(void); +WIDGET_DRAW_ITEM_FUNC * RADIO_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); + +#define RADIO_SKIN_FLEX RADIO_DrawSkinFlex + +/********************************************************************* +* +* Query state +* +********************************************************************** +*/ +int RADIO_GetValue(RADIO_Handle hObj); + +#if defined(__cplusplus) + } +#endif + +#endif // GUI_WINSUPPORT +#endif // RADIO_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/SCROLLBAR.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/SCROLLBAR.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,195 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : SCROLLBAR.h +Purpose : SCROLLBAR include +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef SCROLLBAR_H +#define SCROLLBAR_H + +#include "WM.h" +#include "DIALOG_Intern.h" /* Req. for Create indirect data structure */ +#include "WIDGET.h" + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) + extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Defines +* +********************************************************************** +*/ +#define SCROLLBAR_CI_THUMB 0 +#define SCROLLBAR_CI_SHAFT 1 +#define SCROLLBAR_CI_ARROW 2 + +/********************************************************************* +* +* States +*/ +#define SCROLLBAR_STATE_PRESSED WIDGET_STATE_USER0 + +/********************************************************************* +* +* Create / Status flags +*/ +#define SCROLLBAR_CF_VERTICAL WIDGET_CF_VERTICAL +#define SCROLLBAR_CF_FOCUSSABLE WIDGET_STATE_FOCUSSABLE + +/************************************************************ +* +* Skinning property indices +*/ +#define SCROLLBAR_SKINFLEX_PI_PRESSED 0 +#define SCROLLBAR_SKINFLEX_PI_UNPRESSED 1 + +/********************************************************************* +* +* Public Types +* +********************************************************************** +*/ +typedef WM_HMEM SCROLLBAR_Handle; + +typedef struct { + GUI_COLOR aColorFrame[3]; + GUI_COLOR aColorUpper[2]; + GUI_COLOR aColorLower[2]; + GUI_COLOR aColorShaft[2]; + GUI_COLOR ColorArrow; + GUI_COLOR ColorGrasp; +} SCROLLBAR_SKINFLEX_PROPS; + +typedef struct { + int IsVertical; + int State; +} SCROLLBAR_SKINFLEX_INFO; + +/********************************************************************* +* +* Create functions +* +********************************************************************** +*/ +SCROLLBAR_Handle SCROLLBAR_Create (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int WinFlags, int SpecialFlags); +SCROLLBAR_Handle SCROLLBAR_CreateAttached(WM_HWIN hParent, int SpecialFlags); +SCROLLBAR_Handle SCROLLBAR_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id); +SCROLLBAR_Handle SCROLLBAR_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes); +SCROLLBAR_Handle SCROLLBAR_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); + +/********************************************************************* +* +* The callback ... +* +* Do not call it directly ! It is only to be used from within an +* overwritten callback. +*/ +void SCROLLBAR_Callback(WM_MESSAGE * pMsg); + +/********************************************************************* +* +* Member functions +* +********************************************************************** +*/ + +/* Methods changing properties */ + +void SCROLLBAR_AddValue (SCROLLBAR_Handle hObj, int Add); +void SCROLLBAR_Dec (SCROLLBAR_Handle hObj); +void SCROLLBAR_Inc (SCROLLBAR_Handle hObj); +int SCROLLBAR_GetUserData(SCROLLBAR_Handle hObj, void * pDest, int NumBytes); +GUI_COLOR SCROLLBAR_SetColor (SCROLLBAR_Handle hObj, int Index, GUI_COLOR Color); +void SCROLLBAR_SetNumItems(SCROLLBAR_Handle hObj, int NumItems); +void SCROLLBAR_SetPageSize(SCROLLBAR_Handle hObj, int PageSize); +void SCROLLBAR_SetValue (SCROLLBAR_Handle hObj, int v); +int SCROLLBAR_SetWidth (SCROLLBAR_Handle hObj, int Width); +void SCROLLBAR_SetState (SCROLLBAR_Handle hObj, const WM_SCROLL_STATE* pState); +int SCROLLBAR_SetUserData(SCROLLBAR_Handle hObj, const void * pSrc, int NumBytes); + +/********************************************************************* +* +* Member functions: Skinning +* +********************************************************************** +*/ +void SCROLLBAR_GetSkinFlexProps (SCROLLBAR_SKINFLEX_PROPS * pProps, int Index); +void SCROLLBAR_SetSkinClassic (SCROLLBAR_Handle hObj); +void SCROLLBAR_SetSkin (SCROLLBAR_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); +int SCROLLBAR_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); +void SCROLLBAR_SetSkinFlexProps (const SCROLLBAR_SKINFLEX_PROPS * pProps, int Index); +void SCROLLBAR_SetDefaultSkinClassic(void); +WIDGET_DRAW_ITEM_FUNC * SCROLLBAR_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); + +#define SCROLLBAR_SKIN_FLEX SCROLLBAR_DrawSkinFlex + +/********************************************************************* +* +* Global functions +* +********************************************************************** +*/ +int SCROLLBAR_GetDefaultWidth(void); +int SCROLLBAR_GetThumbSizeMin(void); +GUI_COLOR SCROLLBAR_SetDefaultColor(GUI_COLOR Color, unsigned int Index); /* Not yet documented */ +int SCROLLBAR_SetDefaultWidth(int DefaultWidth); +int SCROLLBAR_SetThumbSizeMin(int ThumbSizeMin); + +/********************************************************************* +* +* Query state +* +********************************************************************** +*/ +int SCROLLBAR_GetNumItems(SCROLLBAR_Handle hObj); +int SCROLLBAR_GetPageSize(SCROLLBAR_Handle hObj); +int SCROLLBAR_GetValue (SCROLLBAR_Handle hObj); + +/********************************************************************* +* +* Macros for compatibility +* +********************************************************************** +*/ +#define SCROLLBAR_BKCOLOR0_DEFAULT SCROLLBAR_COLOR_ARROW_DEFAULT +#define SCROLLBAR_BKCOLOR1_DEFAULT SCROLLBAR_COLOR_SHAFT_DEFAULT +#define SCROLLBAR_COLOR0_DEFAULT SCROLLBAR_COLOR_THUMB_DEFAULT + +#if defined(__cplusplus) + } +#endif + +#endif // GUI_WINSUPPORT +#endif // SCROLLBAR_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/SLIDER.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/SLIDER.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,182 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : SLIDER.h +Purpose : SLIDER include +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef SLIDER_H +#define SLIDER_H + +#include "WM.h" +#include "DIALOG_Intern.h" /* Req. for Create indirect data structure */ +#include "WIDGET.h" + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) + extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/************************************************************ +* +* Defines +* +************************************************************* +*/ +/************************************************************ +* +* States +*/ +#define SLIDER_STATE_PRESSED WIDGET_STATE_USER0 + +/************************************************************ +* +* Create / Status flags +*/ +#define SLIDER_CF_HORIZONTAL 0 +#define SLIDER_CF_VERTICAL WIDGET_CF_VERTICAL + +/************************************************************ +* +* Skinning property indices +*/ +#define SLIDER_SKINFLEX_PI_PRESSED 0 +#define SLIDER_SKINFLEX_PI_UNPRESSED 1 + +/********************************************************************* +* +* Public Types +* +********************************************************************** +*/ +typedef WM_HMEM SLIDER_Handle; + +typedef struct { + GUI_COLOR aColorFrame[2]; + GUI_COLOR aColorInner[2]; + GUI_COLOR aColorShaft[3]; + GUI_COLOR ColorTick; + GUI_COLOR ColorFocus; + int TickSize; + int ShaftSize; +} SLIDER_SKINFLEX_PROPS; + +typedef struct { + int Width; + int NumTicks; + int Size; + int IsPressed; + int IsVertical; +} SLIDER_SKINFLEX_INFO; + +/********************************************************************* +* +* Create functions +* +********************************************************************** +*/ +SLIDER_Handle SLIDER_Create (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int WinFlags, int SpecialFlags); +SLIDER_Handle SLIDER_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id); +SLIDER_Handle SLIDER_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes); +SLIDER_Handle SLIDER_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); + +/********************************************************************* +* +* The callback ... +* +* Do not call it directly ! It is only to be used from within an +* overwritten callback. +*/ +void SLIDER_Callback(WM_MESSAGE * pMsg); + +/********************************************************************* +* +* Member functions +* +********************************************************************** +*/ +void SLIDER_Dec (SLIDER_Handle hObj); +void SLIDER_EnableFocusRect(SLIDER_Handle hObj, int OnOff); +GUI_COLOR SLIDER_GetBarColor (SLIDER_Handle hObj); +GUI_COLOR SLIDER_GetBkColor (SLIDER_Handle hObj); +U8 SLIDER_GetFlag (SLIDER_Handle hObj, U8 Flag); +GUI_COLOR SLIDER_GetFocusColor (SLIDER_Handle hObj); +GUI_COLOR SLIDER_GetTickColor (SLIDER_Handle hObj); +int SLIDER_GetUserData (SLIDER_Handle hObj, void * pDest, int NumBytes); +int SLIDER_GetValue (SLIDER_Handle hObj); +void SLIDER_Inc (SLIDER_Handle hObj); +void SLIDER_SetBarColor (SLIDER_Handle hObj, GUI_COLOR Color); +void SLIDER_SetBkColor (SLIDER_Handle hObj, GUI_COLOR Color); +GUI_COLOR SLIDER_SetFocusColor (SLIDER_Handle hObj, GUI_COLOR Color); +void SLIDER_SetNumTicks (SLIDER_Handle hObj, int NumTicks); +void SLIDER_SetRange (SLIDER_Handle hObj, int Min, int Max); +void SLIDER_SetTickColor (SLIDER_Handle hObj, GUI_COLOR Color); +int SLIDER_SetUserData (SLIDER_Handle hObj, const void * pSrc, int NumBytes); +void SLIDER_SetValue (SLIDER_Handle hObj, int v); +void SLIDER_SetWidth (SLIDER_Handle hObj, int Width); + +/********************************************************************* +* +* Member functions: Skinning +* +********************************************************************** +*/ +void SLIDER_GetSkinFlexProps (SLIDER_SKINFLEX_PROPS * pProps, int Index); +void SLIDER_SetSkinClassic (SLIDER_Handle hObj); +void SLIDER_SetSkin (SLIDER_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); +int SLIDER_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); +void SLIDER_SetSkinFlexProps (const SLIDER_SKINFLEX_PROPS * pProps, int Index); +void SLIDER_SetDefaultSkinClassic(void); +WIDGET_DRAW_ITEM_FUNC * SLIDER_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); + +#define SLIDER_SKIN_FLEX SLIDER_DrawSkinFlex + +/********************************************************************* +* +* Global functions +* +********************************************************************** +*/ +GUI_COLOR SLIDER_GetDefaultBkColor (void); +GUI_COLOR SLIDER_GetDefaultBarColor (void); +GUI_COLOR SLIDER_GetDefaultFocusColor(void); +GUI_COLOR SLIDER_GetDefaultTickColor (void); +void SLIDER_SetDefaultBkColor (GUI_COLOR Color); +void SLIDER_SetDefaultBarColor (GUI_COLOR Color); +GUI_COLOR SLIDER_SetDefaultFocusColor(GUI_COLOR Color); +void SLIDER_SetDefaultTickColor (GUI_COLOR Color); + +#if defined(__cplusplus) + } +#endif + +#endif // GUI_WINSUPPORT +#endif // SLIDER_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/SPINBOX.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/SPINBOX.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,178 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : SPINBOX.h +Purpose : SPINBOX header file +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef SPINBOX_H +#define SPINBOX_H + +#include "WM.h" +#include "DIALOG_Intern.h" // Required for Create indirect data structure +#include "WIDGET.h" +#include "GUI_Debug.h" +#include "EDIT.h" + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) + extern "C" { // Make sure we have C-declarations in C++ programs +#endif + +/********************************************************************* +* +* Defines +* +********************************************************************** +*/ +/********************************************************************* +* +* States +*/ +#define SPINBOX_STATE_PRESSED(x) (U8)(1 << (U8)x) // These flags are stored in (SPINBOX_OBJ->State) | x must be 0 or 1 +#define SPINBOX_STATE_FOCUS WIDGET_STATE_FOCUS // This is read from (SPINBOX_OBJ->Widget.State) + +#define SPINBOX_EDGE_RIGHT 0 +#define SPINBOX_EDGE_LEFT 1 +#define SPINBOX_EDGE_CENTER 2 + +#define SPINBOX_EM_STEP 0 +#define SPINBOX_EM_EDIT 1 + +#ifndef SPINBOX_EM_DEFAULT + #define SPINBOX_EM_DEFAULT SPINBOX_EM_STEP +#endif + +/********************************************************************* +* +* Color indices +*/ +#define SPINBOX_CI_DISABLED EDIT_CI_DISABLED +#define SPINBOX_CI_ENABLED EDIT_CI_ENABLED +#define SPINBOX_CI_PRESSED 2 + +/********************************************************************* +* +* Skinning property indices +*/ +#define SPINBOX_SKIN_FLEX SPINBOX_DrawSkinFlex + +#define SPINBOX_SKINFLEX_PI_PRESSED 0 +#define SPINBOX_SKINFLEX_PI_FOCUSSED 1 +#define SPINBOX_SKINFLEX_PI_ENABLED 2 +#define SPINBOX_SKINFLEX_PI_DISABLED 3 +#define SPINBOX_SKIN_FLEX_RADIUS 2 + +/********************************************************************* +* +* Public Types +* +********************************************************************** +*/ +typedef WM_HMEM SPINBOX_Handle; + +typedef struct { + GUI_COLOR aColorFrame[2]; // [0] Outer color of surrounding frame. [1] Inner color of surrounding frame. + GUI_COLOR aColorUpper[2]; // [0] Upper color of gradient for upper button. [1] Lower color of gradient for upper button. + GUI_COLOR aColorLower[2]; // [0] Upper color of gradient for lower button. [1] Lower color of gradient for lower button. + GUI_COLOR ColorArrow; // Color of the button arrow. + GUI_COLOR ColorBk; // Color of the background. // See WIDGET_ITEM_CREATE in SPINBOX_DrawSkinFlex() + GUI_COLOR ColorText; // Color of the text. // See WIDGET_ITEM_CREATE in SPINBOX_DrawSkinFlex() + GUI_COLOR ColorButtonFrame; // Color of the button frame. +} SPINBOX_SKINFLEX_PROPS; + +/********************************************************************* +* +* Prototypes +* +********************************************************************** +*/ +/********************************************************************* +* +* Creation +*/ +SPINBOX_Handle SPINBOX_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int Id, int Min, int Max); +SPINBOX_Handle SPINBOX_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int Id, int Min, int Max, int NumExtraBytes); +SPINBOX_Handle SPINBOX_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); + +/********************************************************************* +* +* Callback, should be called only from within a custom callback. +*/ +void SPINBOX_Callback(WM_MESSAGE * pMsg); + +/********************************************************************* +* +* Get / Set properties +*/ +void SPINBOX_EnableBlink (SPINBOX_Handle hObj, int Period, int OnOff); +GUI_COLOR SPINBOX_GetBkColor (SPINBOX_Handle hObj, unsigned int Index); +GUI_COLOR SPINBOX_GetButtonBkColor(SPINBOX_Handle hObj, unsigned int Index); +EDIT_Handle SPINBOX_GetEditHandle (SPINBOX_Handle hObj); +int SPINBOX_GetUserData (SPINBOX_Handle hObj, void * pDest, int NumBytes); +I32 SPINBOX_GetValue (SPINBOX_Handle hObj); +void SPINBOX_SetBkColor (SPINBOX_Handle hObj, unsigned int Index, GUI_COLOR Color); +void SPINBOX_SetButtonBkColor(SPINBOX_Handle hObj, unsigned int Index, GUI_COLOR Color); +void SPINBOX_SetButtonSize (SPINBOX_Handle hObj, unsigned ButtonSize); +void SPINBOX_SetEdge (SPINBOX_Handle hObj, U8 Edge); +void SPINBOX_SetEditMode (SPINBOX_Handle hObj, U8 EditMode); +void SPINBOX_SetFont (SPINBOX_Handle hObj, const GUI_FONT * pFont); +void SPINBOX_SetRange (SPINBOX_Handle hObj, I32 Min, I32 Max); +U16 SPINBOX_SetStep (SPINBOX_Handle hObj, U16 Step); +void SPINBOX_SetTextColor (SPINBOX_Handle hObj, unsigned int Index, GUI_COLOR Color); +int SPINBOX_SetUserData (SPINBOX_Handle hObj, const void * pSrc, int NumBytes); +void SPINBOX_SetValue (SPINBOX_Handle hObj, I32 Value); + +/********************************************************************* +* +* Default value management +*/ +U16 SPINBOX_GetDefaultButtonSize(void); +void SPINBOX_SetDefaultButtonSize(U16 ButtonSize); + +/********************************************************************* +* +* Skinning +*/ +void SPINBOX_GetSkinFlexProps (SPINBOX_SKINFLEX_PROPS * pProps, int Index); +void SPINBOX_SetSkinClassic (SPINBOX_Handle hObj); +void SPINBOX_SetSkin (SPINBOX_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); +int SPINBOX_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); +void SPINBOX_SetSkinFlexProps (const SPINBOX_SKINFLEX_PROPS * pProps, int Index); +void SPINBOX_SetDefaultSkinClassic(void); +WIDGET_DRAW_ITEM_FUNC * SPINBOX_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); + +#if defined(__cplusplus) + } +#endif + +#endif // GUI_WINSUPPORT +#endif // SPINBOX_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/TEXT.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/TEXT.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,149 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : TEXT.h +Purpose : TEXT include +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef TEXT_H +#define TEXT_H + +#include "WM.h" +#include "DIALOG_Intern.h" /* Req. for Create indirect data structure */ +#include "WIDGET.h" +#include "GUI_Debug.h" + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) + extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/************************************************************ +* +* #defines +* +************************************************************* +*/ + +/************************************************************ +* +* Create / Status flags +*/ +#define TEXT_CF_LEFT GUI_TA_LEFT +#define TEXT_CF_RIGHT GUI_TA_RIGHT +#define TEXT_CF_HCENTER GUI_TA_HCENTER + +#define TEXT_CF_VCENTER GUI_TA_VCENTER +#define TEXT_CF_TOP GUI_TA_TOP +#define TEXT_CF_BOTTOM GUI_TA_BOTTOM + + +/********************************************************************* +* +* Public Types +* +********************************************************************** + +*/ +typedef WM_HMEM TEXT_Handle; + +/********************************************************************* +* +* Standard member functions +* +********************************************************************** +*/ + +#define TEXT_EnableMemdev(hObj) WM_EnableMemdev(hObj) +#define TEXT_DisableMemdev(hObj) WM_DisableMemdev(hObj) +#define TEXT_Delete(hObj) WM_DeleteWindow(hObj) +#define TEXT_Paint(hObj) WM_Paint(hObj) +#define TEXT_Invalidate(hObj) WM_InvalidateWindow(hObj) + +/********************************************************************* +* +* Create functions +* +********************************************************************** +*/ +TEXT_Handle TEXT_Create (int x0, int y0, int xSize, int ySize, int Id, int Flags, const char * s, int Align); +TEXT_Handle TEXT_CreateAsChild (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags, const char * s, int Align); +TEXT_Handle TEXT_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, const char * pText); +TEXT_Handle TEXT_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, const char * pText, int NumExtraBytes); +TEXT_Handle TEXT_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); + +/********************************************************************* +* +* The callback ... +* +* Do not call it directly ! It is only to be used from within an +* overwritten callback. +*/ +void TEXT_Callback(WM_MESSAGE * pMsg); + +/********************************************************************* +* +* Member functions +* +********************************************************************** +*/ + +/* Methods changing properties */ + +int TEXT_GetNumLines (TEXT_Handle hObj); +int TEXT_GetText (TEXT_Handle hObj, char * pDest, U32 BufferSize); +int TEXT_GetUserData (TEXT_Handle hObj, void * pDest, int NumBytes); +void TEXT_SetBkColor (TEXT_Handle hObj, GUI_COLOR Color); /* Obsolete. Left in GUI for compatibility to older versions */ +void TEXT_SetFont (TEXT_Handle hObj, const GUI_FONT * pFont); +int TEXT_SetText (TEXT_Handle hObj, const char * s); +void TEXT_SetTextAlign(TEXT_Handle hObj, int Align); +void TEXT_SetTextColor(TEXT_Handle hObj, GUI_COLOR Color); +int TEXT_SetUserData (TEXT_Handle hObj, const void * pSrc, int NumBytes); +void TEXT_SetWrapMode (TEXT_Handle hObj, GUI_WRAPMODE WrapMode); + +/********************************************************************* +* +* Global functions +* +********************************************************************** +*/ + +void TEXT_SetDefaultFont (const GUI_FONT * pFont); +const GUI_FONT * TEXT_GetDefaultFont (void); +void TEXT_SetDefaultTextColor(GUI_COLOR Color); +GUI_WRAPMODE TEXT_SetDefaultWrapMode (GUI_WRAPMODE WrapMode); + +#if defined(__cplusplus) + } +#endif + +#endif // GUI_WINSUPPORT +#endif // TEXT_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/TREEVIEW.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/TREEVIEW.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,229 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : TREEVIEW.h +Purpose : TREEVIEW include +--------------------END-OF-HEADER------------------------------------- +*/ + +#ifndef TREEVIEW_H +#define TREEVIEW_H + +#include "WM.h" +#include "DIALOG_Intern.h" /* Req. for Create indirect data structure */ +#include "WIDGET.h" + +#if GUI_WINSUPPORT + +#if defined(__cplusplus) + extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/********************************************************************* +* +* Defines +* +********************************************************************** +*/ +/* Status- and create flags */ +#define TREEVIEW_CF_HIDELINES (1 << 0) +#define TREEVIEW_CF_ROWSELECT (1 << 1) +#define TREEVIEW_CF_AUTOSCROLLBAR_H (1 << 2) +#define TREEVIEW_CF_AUTOSCROLLBAR_V (1 << 3) +#define TREEVIEW_SF_HIDELINES TREEVIEW_CF_HIDELINES +#define TREEVIEW_SF_ROWSELECT TREEVIEW_CF_ROWSELECT +#define TREEVIEW_SF_AUTOSCROLLBAR_H TREEVIEW_CF_AUTOSCROLLBAR_H +#define TREEVIEW_SF_AUTOSCROLLBAR_V TREEVIEW_CF_AUTOSCROLLBAR_V + +/* Bitmap indices */ +#define TREEVIEW_BI_CLOSED 0 +#define TREEVIEW_BI_OPEN 1 +#define TREEVIEW_BI_LEAF 2 +#define TREEVIEW_BI_PLUS 3 +#define TREEVIEW_BI_MINUS 4 +#define TREEVIEW_BI_PM 5 + +/* Color indices */ +#define TREEVIEW_CI_UNSEL 0 +#define TREEVIEW_CI_SEL 1 +#define TREEVIEW_CI_DISABLED 2 + +/* Relative positions (create) */ +#define TREEVIEW_INSERT_ABOVE 0 +#define TREEVIEW_INSERT_BELOW 1 +#define TREEVIEW_INSERT_FIRST_CHILD 2 + +/* Relative positions (retrieve) */ +#define TREEVIEW_GET_FIRST 0 +#define TREEVIEW_GET_LAST 1 +#define TREEVIEW_GET_NEXT_SIBLING 2 +#define TREEVIEW_GET_PREV_SIBLING 3 +#define TREEVIEW_GET_FIRST_CHILD 4 +#define TREEVIEW_GET_PARENT 5 + +/* Item flags */ +#define TREEVIEW_ITEM_TYPE_LEAF (0 << 0) +#define TREEVIEW_ITEM_TYPE_NODE (1 << 0) + +/* Selection mode */ +#define TREEVIEW_SELMODE_ROW 1 +#define TREEVIEW_SELMODE_TEXT 0 + +/************************************************************ +* +* Types +* +************************************************************* +*/ +typedef WM_HMEM TREEVIEW_Handle; +typedef WM_HMEM TREEVIEW_ITEM_Handle; + +typedef struct { + int IsNode; + int IsExpanded; + int HasLines; + int HasRowSelect; + int Level; +} TREEVIEW_ITEM_INFO; + +typedef struct { + GUI_COLOR ColorBk; + GUI_COLOR ColorText; + GUI_COLOR ColorTextBk; + GUI_COLOR ColorLines; + GUI_RECT rText; + TREEVIEW_ITEM_Handle hItem; + const GUI_FONT * pFont; + char * pText; + U8 NumLines; + I16 ax0[3]; + I16 ay0[3]; + I16 ax1[3]; + I16 ay1[3]; + U8 NumConnectors; + I16 axc[16]; + const GUI_BITMAP * pBmPM; + const GUI_BITMAP * pBmOCL; + I16 xPosPM, xPosOCL; + U8 IndexPM; + U8 IndexOCL; +} TREEVIEW_ITEM_DRAW_INFO; + +/********************************************************************* +* +* Create functions +* +********************************************************************** +*/ +TREEVIEW_Handle TREEVIEW_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id); +TREEVIEW_Handle TREEVIEW_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes); +TREEVIEW_Handle TREEVIEW_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); + +/********************************************************************* +* +* The callback ... +* +* Do not call it directly ! It is only to be used from within an +* overwritten callback. +*/ +void TREEVIEW_Callback(WM_MESSAGE * pMsg); + +/********************************************************************* +* +* Common functions +* +********************************************************************** +*/ +int TREEVIEW_AttachItem (TREEVIEW_Handle hObj, TREEVIEW_ITEM_Handle hItem, TREEVIEW_ITEM_Handle hItemAt, int Position); +void TREEVIEW_DecSel (TREEVIEW_Handle hObj); +TREEVIEW_ITEM_Handle TREEVIEW_GetItem (TREEVIEW_Handle hObj, TREEVIEW_ITEM_Handle hItem, int Flags); +TREEVIEW_ITEM_Handle TREEVIEW_GetSel (TREEVIEW_Handle hObj); +int TREEVIEW_GetUserData (TREEVIEW_Handle hObj, void * pDest, int NumBytes); +void TREEVIEW_IncSel (TREEVIEW_Handle hObj); +TREEVIEW_ITEM_Handle TREEVIEW_InsertItem (TREEVIEW_Handle hObj, int IsNode, TREEVIEW_ITEM_Handle hItemPrev, int Position, const char * s); +int TREEVIEW_OwnerDraw (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); +void TREEVIEW_ScrollToSel (TREEVIEW_Handle hObj); +void TREEVIEW_SetAutoScrollH (TREEVIEW_Handle hObj, int State); +void TREEVIEW_SetAutoScrollV (TREEVIEW_Handle hObj, int State); +void TREEVIEW_SetBitmapOffset(TREEVIEW_Handle hObj, int Index, int xOff, int yOff); +void TREEVIEW_SetBkColor (TREEVIEW_Handle hObj, int Index, GUI_COLOR Color); +void TREEVIEW_SetFont (TREEVIEW_Handle hObj, const GUI_FONT * pFont); +void TREEVIEW_SetHasLines (TREEVIEW_Handle hObj, int State); +void TREEVIEW_SetImage (TREEVIEW_Handle hObj, int Index, const GUI_BITMAP * pBitmap); +int TREEVIEW_SetIndent (TREEVIEW_Handle hObj, int Indent); +void TREEVIEW_SetLineColor (TREEVIEW_Handle hObj, int Index, GUI_COLOR Color); +void TREEVIEW_SetOwnerDraw (TREEVIEW_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawItem); +void TREEVIEW_SetSel (TREEVIEW_Handle hObj, TREEVIEW_ITEM_Handle hItem); +void TREEVIEW_SetSelMode (TREEVIEW_Handle hObj, int Mode); +void TREEVIEW_SetTextColor (TREEVIEW_Handle hObj, int Index, GUI_COLOR Color); +int TREEVIEW_SetTextIndent (TREEVIEW_Handle hObj, int TextIndent); +int TREEVIEW_SetUserData (TREEVIEW_Handle hObj, const void * pSrc, int NumBytes); + + +/********************************************************************* +* +* Treeview item related functions +* +********************************************************************** +*/ +void TREEVIEW_ITEM_Collapse (TREEVIEW_ITEM_Handle hItem); +void TREEVIEW_ITEM_CollapseAll(TREEVIEW_ITEM_Handle hItem); +TREEVIEW_ITEM_Handle TREEVIEW_ITEM_Create (int IsNode, const char * s, U32 UserData); +void TREEVIEW_ITEM_Delete (TREEVIEW_ITEM_Handle hItem); +void TREEVIEW_ITEM_Detach (TREEVIEW_ITEM_Handle hItem); +void TREEVIEW_ITEM_Expand (TREEVIEW_ITEM_Handle hItem); +void TREEVIEW_ITEM_ExpandAll (TREEVIEW_ITEM_Handle hItem); +void TREEVIEW_ITEM_GetInfo (TREEVIEW_ITEM_Handle hItem, TREEVIEW_ITEM_INFO * pInfo); +void TREEVIEW_ITEM_GetText (TREEVIEW_ITEM_Handle hItem, U8 * pBuffer, int MaxNumBytes); +U32 TREEVIEW_ITEM_GetUserData(TREEVIEW_ITEM_Handle hItem); +void TREEVIEW_ITEM_SetImage (TREEVIEW_ITEM_Handle hItem, int Index, const GUI_BITMAP * pBitmap); +TREEVIEW_ITEM_Handle TREEVIEW_ITEM_SetText (TREEVIEW_ITEM_Handle hItem, const char * s); +void TREEVIEW_ITEM_SetUserData(TREEVIEW_ITEM_Handle hItem, U32 UserData); + +/********************************************************************* +* +* Managing default values +* +********************************************************************** +*/ +GUI_COLOR TREEVIEW_GetDefaultBkColor (int Index); +const GUI_FONT * TREEVIEW_GetDefaultFont (void); +GUI_COLOR TREEVIEW_GetDefaultLineColor(int Index); +GUI_COLOR TREEVIEW_GetDefaultTextColor(int Index); +void TREEVIEW_SetDefaultBkColor (int Index, GUI_COLOR Color); +void TREEVIEW_SetDefaultFont (const GUI_FONT * pFont); +void TREEVIEW_SetDefaultLineColor(int Index, GUI_COLOR Color); +void TREEVIEW_SetDefaultTextColor(int Index, GUI_COLOR Color); + +#if defined(__cplusplus) + } +#endif + +#endif // GUI_WINSUPPORT +#endif // TREEVIEW_H + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/WIDGET.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/WIDGET.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,371 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : WIDGET.h +Purpose : Widget interface +---------------------------END-OF-HEADER------------------------------ +*/ + +#ifndef WIDGET_H /* Avoid multiple inclusion */ +#define WIDGET_H + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +#include "WM_Intern.h" /* Window manager, including some internals, which speed things up */ + +#if GUI_WINSUPPORT + +/********************************************************************* +* +* Typedefs +* +********************************************************************** +*/ +typedef struct { + WM_HWIN hWin; + int Cmd; /* WIDGET_ITEM_GET_XSIZE, WIDGET_ITEM_GET_YSIZE, WIDGET_ITEM_DRAW, */ + int ItemIndex; + int Col; + int x0, y0, x1, y1; + void * p; +} WIDGET_ITEM_DRAW_INFO; + +typedef int WIDGET_DRAW_ITEM_FUNC(const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); +typedef void WIDGET_PAINT (WM_HWIN hObj); +typedef void WIDGET_CREATE (WM_HWIN hObj); + +typedef struct { + WIDGET_PAINT * pfPaint; + WIDGET_CREATE * pfCreate; + void * pSkinPrivate; +} WIDGET_SKIN; + +/********************************************************************* +* +* Important: WIDGET_DRAW_ITEM_FUNC needs to be defined +* in SCROLLBAR.h! +* +********************************************************************** +*/ +#include "SCROLLBAR.h" + +/********************************************************************* +* +* Defines +* +********************************************************************** +*/ +/********************************************************************* +* +* Unique widget id's +*/ +#define BUTTON_ID 0x42555454UL /* BUTT */ +#define CHECKBOX_ID 0x43484543UL /* CHEC */ +#define DROPDOWN_ID 0x44524f50UL /* DROP */ +#define EDIT_ID 0x45444954UL /* EDIT */ +#define FRAMEWIN_ID 0x4652414dUL /* FRAM */ +#define GRAPH_ID 0x47524150UL /* GRAP */ +#define HEADER_ID 0x48454144UL /* HEAD */ +#define LISTBOX_ID 0x4C495342UL /* LISB */ +#define LISTVIEW_ID 0x4C495356UL /* LISV */ +#define LISTWHEEL_ID 0x4C495357UL /* LISW */ +#define MENU_ID 0x4d454e55UL /* MENU */ +#define MULTIEDIT_ID 0x4d554c45UL /* MULE */ +#define MULTIPAGE_ID 0x4d554c50UL /* MULP */ +#define PROGBAR_ID 0x50524f47UL /* PROG */ +#define RADIO_ID 0x52414449UL /* RADI */ +#define SCROLLBAR_ID 0x5343524fUL /* SCRO */ +#define SLIDER_ID 0x534c4944UL /* SLID */ +#define TEXT_ID 0x54455854UL /* TEXT */ +#define TREEVIEW_ID 0x54524545UL /* TREE */ +#define ICONVIEW_ID 0x49434f4eUL /* ICON */ +#define IMAGE_ID 0x494d4147UL /* IMAG */ +#define SPINBOX_ID 0x5350494eUL /* SPIN */ +#define KNOB_ID 0x4b4e4f42UL /* KNOB */ + +#define WIDGET_LOCK(hWin) ((WIDGET*)GUI_LOCK_H(hWin)) + +/********************************************************************* +* +* Config switches +*/ + +#ifndef WIDGET_USE_PARENT_EFFECT + #define WIDGET_USE_PARENT_EFFECT 0 +#endif +#ifndef WIDGET_USE_FLEX_SKIN + #define WIDGET_USE_FLEX_SKIN 0 +#endif +#if !defined(WIDGET_USE_SCHEME_SMALL) && !defined(WIDGET_USE_SCHEME_MEDIUM) && !defined(WIDGET_USE_SCHEME_LARGE) + #define WIDGET_USE_SCHEME_SMALL 1 + #define WIDGET_USE_SCHEME_MEDIUM 0 + #define WIDGET_USE_SCHEME_LARGE 0 +#endif +#ifndef WIDGET_USE_SCHEME_SMALL + #define WIDGET_USE_SCHEME_SMALL 0 +#endif +#ifndef WIDGET_USE_SCHEME_MEDIUM + #define WIDGET_USE_SCHEME_MEDIUM 0 +#endif +#ifndef WIDGET_USE_SCHEME_LARGE + #define WIDGET_USE_SCHEME_LARGE 0 +#endif +#if (WIDGET_USE_SCHEME_SMALL + WIDGET_USE_SCHEME_MEDIUM + WIDGET_USE_SCHEME_LARGE) > 1 + #error Only one scheme can be selected! +#endif + +/********************************************************************* +* +* States +*/ + +#define WIDGET_STATE_FOCUS (1 << 0) +#define WIDGET_STATE_VERTICAL (1 << 3) +#define WIDGET_STATE_FOCUSSABLE (1 << 4) + +#define WIDGET_STATE_USER0 (1 << 8) /* Freely available for derived widget */ +#define WIDGET_STATE_USER1 (1 << 9) /* Freely available for derived widget */ +#define WIDGET_STATE_USER2 (1 << 10) /* Freely available for derived widget */ + +/********************************************************************* +* +* Skinning message identifiers +*/ +#define WIDGET_ITEM_CREATE 0 +#define WIDGET_ITEM_DRAW 1 +#define WIDGET_ITEM_DRAW_ARROW 2 +#define WIDGET_ITEM_DRAW_ARROW_L 3 +#define WIDGET_ITEM_DRAW_ARROW_R 4 +#define WIDGET_ITEM_DRAW_BACKGROUND 5 +#define WIDGET_ITEM_DRAW_BITMAP 6 +#define WIDGET_ITEM_DRAW_BUTTON 7 +#define WIDGET_ITEM_DRAW_BUTTON_L 8 +#define WIDGET_ITEM_DRAW_BUTTON_R 9 +#define WIDGET_ITEM_DRAW_FOCUS 10 +#define WIDGET_ITEM_DRAW_FRAME 11 +#define WIDGET_ITEM_DRAW_OVERLAP 12 +#define WIDGET_ITEM_DRAW_OVERLAY 13 +#define WIDGET_ITEM_DRAW_SEP 14 +#define WIDGET_ITEM_DRAW_SHAFT 15 +#define WIDGET_ITEM_DRAW_SHAFT_L 16 +#define WIDGET_ITEM_DRAW_SHAFT_R 17 +#define WIDGET_ITEM_DRAW_TEXT 18 +#define WIDGET_ITEM_DRAW_THUMB 19 +#define WIDGET_ITEM_DRAW_TICKS 20 +#define WIDGET_ITEM_GET_BORDERSIZE_B 21 +#define WIDGET_ITEM_GET_BORDERSIZE_L 22 +#define WIDGET_ITEM_GET_BORDERSIZE_R 23 +#define WIDGET_ITEM_GET_BORDERSIZE_T 24 +#define WIDGET_ITEM_GET_BUTTONSIZE 25 +#define WIDGET_ITEM_GET_XSIZE 26 +#define WIDGET_ITEM_GET_YSIZE 27 +#define WIDGET_ITEM_GET_RADIUS 28 +#define WIDGET_ITEM_APPLY_PROPS 29 // Not to be documented. Use this message identifier to update the + // properties of attached widgets from <WIDGET>_DrawSkinFlex(). + +#define WIDGET_DRAW_OVERLAY WIDGET_ITEM_DRAW_OVERLAY +#define WIDGET_DRAW_BACKGROUND WIDGET_ITEM_DRAW_BACKGROUND + +/********************************************************************* +* +* Messages +*/ + +#define WM_WIDGET_SET_EFFECT (WM_WIDGET + 0) + +/********************************************************************* +* +* Create flags +*/ + +#define WIDGET_CF_VERTICAL WIDGET_STATE_VERTICAL + +/********************************************************************* +* +* Widget object +* +* The widget object is the base class for most widgets +*/ +typedef struct { + int EffectSize; + void (* pfDrawUp) (void); + void (* pfDrawUpRect) (const GUI_RECT * pRect); + void (* pfDrawDown) (void); + void (* pfDrawDownRect)(const GUI_RECT * pRect); + void (* pfDrawFlat) (void); + void (* pfDrawFlatRect)(const GUI_RECT * pRect); +} WIDGET_EFFECT; + +typedef struct { + WM_Obj Win; + const WIDGET_EFFECT* pEffect; + I16 Id; + U16 State; +} WIDGET; + + +/********************************************************************* +* +* GUI_DRAW +* +* The GUI_DRAW object is used as base class for selfdrawing, +* non-windows objects. They are used as content of different widgets, +* such as the bitmap or header widgets. +*/ +/* Declare Object struct */ +typedef struct GUI_DRAW GUI_DRAW; +typedef void GUI_DRAW_SELF_CB (WM_HWIN hWin); +typedef WM_HMEM GUI_DRAW_HANDLE; + +/* Declare Object constants (member functions etc) */ +typedef struct { + void (* pfDraw) (GUI_DRAW_HANDLE hDrawObj, WM_HWIN hObj, int x, int y); + int (* pfGetXSize)(GUI_DRAW_HANDLE hDrawObj); + int (* pfGetYSize)(GUI_DRAW_HANDLE hDrawObj); +} GUI_DRAW_CONSTS; + +/* Declare Object */ +struct GUI_DRAW { + const GUI_DRAW_CONSTS* pConsts; + union { + const void * pData; + GUI_DRAW_SELF_CB* pfDraw; + } Data; + I16 xOff, yOff; +}; + +/* GUI_DRAW_ API */ +void GUI_DRAW__Draw (GUI_DRAW_HANDLE hDrawObj, WM_HWIN hObj, int x, int y); +int GUI_DRAW__GetXSize(GUI_DRAW_HANDLE hDrawObj); +int GUI_DRAW__GetYSize(GUI_DRAW_HANDLE hDrawObj); + +/* GUI_DRAW_ Constructurs for different objects */ +WM_HMEM GUI_DRAW_BITMAP_Create (const GUI_BITMAP* pBitmap, int x, int y); +WM_HMEM GUI_DRAW_BMP_Create (const void* pBMP, int x, int y); +WM_HMEM GUI_DRAW_STREAMED_Create(const GUI_BITMAP_STREAM * pBitmap, int x, int y); +WM_HMEM GUI_DRAW_SELF_Create(GUI_DRAW_SELF_CB* pfDraw, int x, int y); + +/********************************************************************* +* +* Global data +* +********************************************************************** +*/ + +extern const WIDGET_EFFECT WIDGET_Effect_3D; +extern const WIDGET_EFFECT WIDGET_Effect_3D1L; +extern const WIDGET_EFFECT WIDGET_Effect_3D2L; +extern const WIDGET_EFFECT WIDGET_Effect_None; +extern const WIDGET_EFFECT WIDGET_Effect_Simple; + +/********************************************************************* +* +* Internal API routines +* +********************************************************************** +*/ + +void WIDGET__DrawFocusRect (WIDGET * pWidget, const GUI_RECT * pRect, int Dist); +void WIDGET__DrawHLine (WIDGET * pWidget, int y, int x0, int x1); +void WIDGET__DrawTriangle (WIDGET * pWidget, int x, int y, int Size, int Inc); +void WIDGET__DrawVLine (WIDGET * pWidget, int x, int y0, int y1); +void WIDGET__EFFECT_DrawDownRect(WIDGET * pWidget, GUI_RECT * pRect); +void WIDGET__EFFECT_DrawDown (WIDGET * pWidget); +void WIDGET__EFFECT_DrawUpRect (WIDGET * pWidget, GUI_RECT * pRect); +void WIDGET__FillRectEx (WIDGET * pWidget, const GUI_RECT * pRect); +int WIDGET__GetWindowSizeX (WM_HWIN hWin); +GUI_COLOR WIDGET__GetBkColor (WM_HWIN hObj); +int WIDGET__GetXSize (const WIDGET * pWidget); +int WIDGET__GetYSize (const WIDGET * pWidget); +void WIDGET__GetClientRect (WIDGET * pWidget, GUI_RECT * pRect); +void WIDGET__GetInsideRect (WIDGET * pWidget, GUI_RECT * pRect); +void WIDGET__Init (WIDGET * pWidget, int Id, U16 State); +void WIDGET__RotateRect90 (WIDGET * pWidget, GUI_RECT * pDest, const GUI_RECT * pRect); +void WIDGET__SetScrollState (WM_HWIN hWin, const WM_SCROLL_STATE * pVState, const WM_SCROLL_STATE * pState); +void WIDGET__FillStringInRect (const char * pText, const GUI_RECT * pFillRect, const GUI_RECT * pTextRectMax, const GUI_RECT * pTextRectAct); + +/********************************************************************* +* +* API routines +* +********************************************************************** +*/ +void WIDGET_SetState (WM_HWIN hObj, int State); +void WIDGET_AndState (WM_HWIN hObj, int State); +void WIDGET_OrState (WM_HWIN hObj, int State); +int WIDGET_HandleActive (WM_HWIN hObj, WM_MESSAGE* pMsg); +int WIDGET_GetState (WM_HWIN hObj); +int WIDGET_SetWidth (WM_HWIN hObj, int Width); + +void WIDGET_EFFECT_3D_DrawUp(void); + +const WIDGET_EFFECT* WIDGET_SetDefaultEffect(const WIDGET_EFFECT* pEffect); + +void WIDGET_SetEffect (WM_HWIN hObj, const WIDGET_EFFECT* pEffect); + +const WIDGET_EFFECT* WIDGET_GetDefaultEffect(void); + +void WIDGET_EFFECT_3D_SetColor (unsigned Index, GUI_COLOR Color); +void WIDGET_EFFECT_3D1L_SetColor (unsigned Index, GUI_COLOR Color); +void WIDGET_EFFECT_3D2L_SetColor (unsigned Index, GUI_COLOR Color); +void WIDGET_EFFECT_Simple_SetColor(unsigned Index, GUI_COLOR Color); + +GUI_COLOR WIDGET_EFFECT_3D_GetColor (unsigned Index); +GUI_COLOR WIDGET_EFFECT_3D1L_GetColor (unsigned Index); +GUI_COLOR WIDGET_EFFECT_3D2L_GetColor (unsigned Index); +GUI_COLOR WIDGET_EFFECT_Simple_GetColor(unsigned Index); + +int WIDGET_EFFECT_3D_GetNumColors(void); +int WIDGET_EFFECT_3D1L_GetNumColors(void); +int WIDGET_EFFECT_3D2L_GetNumColors(void); +int WIDGET_EFFECT_Simple_GetNumColors(void); + +/********************************************************************* +* +* Compatibility macros +* +********************************************************************** +*/ +#define WIDGET_SetDefaultEffect_3D() WIDGET_SetDefaultEffect(&WIDGET_Effect_3D) +#define WIDGET_SetDefaultEffect_3D1L() WIDGET_SetDefaultEffect(&WIDGET_Effect_3D1L) +#define WIDGET_SetDefaultEffect_3D2L() WIDGET_SetDefaultEffect(&WIDGET_Effect_3D2L) +#define WIDGET_SetDefaultEffect_None() WIDGET_SetDefaultEffect(&WIDGET_Effect_None) +#define WIDGET_SetDefaultEffect_Simple() WIDGET_SetDefaultEffect(&WIDGET_Effect_Simple) + +#endif /* GUI_WINSUPPORT */ + +#if defined(__cplusplus) + } +#endif + +#endif /* SLIDER_H */ + + + +
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/WM.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/WM.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,741 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : WM.h +Purpose : Windows manager include +---------------------------------------------------------------------- +*/ + +#ifndef WM_H /* Make sure we only include it once */ +#define WM_H + + +#include "GUI_ConfDefaults.h" +#include "GUI_Type.h" /* Needed because of typedefs only */ +#include "WM_GUI.h" /* Some functions needed by GUI routines */ +#include "GUI.h" + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +/* Static memory devices */ +#ifndef WM_SUPPORT_STATIC_MEMDEV + #define WM_SUPPORT_STATIC_MEMDEV GUI_SUPPORT_MEMDEV +#endif + +/* Support for transparency. Switching it off makes Wm smaller and faster */ +#ifndef WM_SUPPORT_TRANSPARENCY + #define WM_SUPPORT_TRANSPARENCY 1 /* Should be defined outside of GUI_WINSUPPORT because of '#if GUI_WINSUPPORT && WM_SUPPORT_TRANSPARENCY' in some files */ +#endif + +/* This is for tests only. It will fill the invalid area of a window. + Can be used for debugging. */ +#ifndef WM_SUPPORT_DIAG + #ifdef WIN32 /* In simulation */ + #define WM_SUPPORT_DIAG GUI_WINSUPPORT + #else + #define WM_SUPPORT_DIAG 0 + #endif +#endif + +/* Make sure we actually have configured windows. If we have not, + there is no point for a windows manager and it will therefor not + generate any code ! +*/ + +#if GUI_WINSUPPORT + +/********************************************************************* +* +* Config defaults +*/ +#ifndef WM_ASSERT + #define WM_ASSERT(expr) GUI_DEBUG_ASSERT(expr) +#endif + +#ifndef WM_SUPPORT_TOUCH + #define WM_SUPPORT_TOUCH GUI_SUPPORT_TOUCH +#endif + +/* Allow older API calls */ +#ifndef WM_COMPATIBLE_MODE + #define WM_COMPATIBLE_MODE 1 +#endif + +/* Send a message if visibility of a window has changed */ +#ifndef WM_SUPPORT_NOTIFY_VIS_CHANGED + #define WM_SUPPORT_NOTIFY_VIS_CHANGED 0 +#endif + +#ifndef WM_SUPPORT_CPP + #if defined (_MSC_VER) + #define WM_SUPPORT_CPP 1 + #else + #define WM_SUPPORT_CPP 0 + #endif +#endif + +/********************************************************************* +* +* Locking macros +*/ +#define WM_LOCK() GUI_LOCK() +#define WM_UNLOCK() GUI_UNLOCK() + +#define WM_LOCK_H(hWin) (WM_Obj *)GUI_LOCK_H(hWin) + +/********************************************************************* +* +* Data types +*/ +typedef struct { + int Key, PressedCnt; +} WM_KEY_INFO; + +typedef struct { + int NumItems, v, PageSize; +} WM_SCROLL_STATE; + +typedef struct { + int Done; + int ReturnValue; +} WM_DIALOG_STATUS; + +typedef struct { + int x,y; + U8 State; + U8 StatePrev; +} WM_PID_STATE_CHANGED_INFO; + +typedef struct { + void (* cbBegin)(void); + void (* cbEnd) (void); +} WM_MULTIBUF_API; + +typedef struct { + int Cmd; + int dx, dy, da; + int xPos, yPos; + int Period; + int SnapX; + int SnapY; + int FinalMove; + U32 Flags; + GUI_PID_STATE * pState; + GUI_HMEM hContext; +} WM_MOTION_INFO; + +typedef struct { + I32 FactorMin; // Minimum factor to be used (<< 16) + I32 FactorMax; // Maximum factor to be used (<< 16) + U32 xSize; // Native xSize of window to be zoomed in pixels + U32 ySize; // Native ySize of window to be zoomed in pixels + U32 xSizeParent; // xSize of parent window + U32 ySizeParent; // ySize of parent window + I32 Factor0; // Primary factor when starting zoom gesture (<< 16) + int xPos0; // Primary window position in x when starting the gesture + int yPos0; // Primary window position in y when starting the gesture + GUI_POINT Center0; // Primary center point when starting the gesture +} WM_ZOOM_INFO; + +typedef struct { + int Flags; // Information regarding gesture type + GUI_POINT Point; // Relative movement + GUI_POINT Center; // Center point for zooming + I32 Angle; // Angle between the touch points + I32 Factor; // Current zoom factor + WM_ZOOM_INFO * pZoomInfo; // Pointer to WM_ZOOM_INFO structure +} WM_GESTURE_INFO; + +typedef struct { + int dx, dy; +} WM_MOVE_INFO; + +/********************************************************************* +* +* Gesture flags for multi touch support +*/ +#define WM_GF_BEGIN (1 << 0) +#define WM_GF_END (1 << 1) +#define WM_GF_PAN (1 << 2) +#define WM_GF_ZOOM (1 << 3) +#define WM_GF_ROTATE (1 << 4) + +/********************************************************************* +* +* Messages Ids +* +* The following is the list of windows messages. +*/ +#define WM_CREATE 0x0001 /* The first message received, right after client has actually been created */ +#define WM_MOVE 0x0003 /* window has been moved (Same as WIN32) */ + +#define WM_SIZE 0x0005 /* Is sent to a window after its size has changed (Same as WIN32, do not change !) */ + +#define WM_DELETE 11 /* Delete (Destroy) command: This tells the client to free its data strutures since the window + it is associates with no longer exists.*/ +#define WM_TOUCH 0x0240 /* Touch screen message */ +#define WM_TOUCH_CHILD 13 /* Touch screen message to ancestors */ +#define WM_KEY 14 /* Key has been pressed */ + +#define WM_PAINT 0x000F /* Repaint window (because content is (partially) invalid */ + +#if GUI_SUPPORT_MOUSE +#define WM_MOUSEOVER 16 /* Mouse has moved, no key pressed */ +#define WM_MOUSEOVER_END 18 /* Mouse has moved, no key pressed */ +#endif + +#define WM_PID_STATE_CHANGED 17 /* Pointer input device state has changed */ + +#define WM_GET_INSIDE_RECT 20 /* get inside rectangle: client rectangle minus pixels lost to effect */ +#define WM_GET_ID 21 /* Get id of widget */ +#define WM_SET_ID 22 /* Set id of widget */ +#define WM_GET_CLIENT_WINDOW 23 /* Get window handle of client window. Default is the same as window */ +#define WM_CAPTURE_RELEASED 24 /* Let window know that mouse capture is over */ + +#define WM_INIT_DIALOG 29 /* Inform dialog that it is ready for init */ + +#define WM_SET_FOCUS 30 /* Inform window that it has gotten or lost the focus */ +#define WM_GET_ACCEPT_FOCUS 31 /* Find out if window can accept the focus */ +#define WM_NOTIFY_CHILD_HAS_FOCUS 32 /* Sent to parent when child receives / loses focus */ + +#define WM_NOTIFY_OWNER_KEY 33 /* Some widgets (e.g. listbox) notify owner when receiving key messages */ + +#define WM_GET_BKCOLOR 34 /* Return back ground color (only frame window and similar) */ +#define WM_GET_SCROLL_STATE 35 /* Query state of scroll bar */ + +#define WM_SET_SCROLL_STATE 36 /* Set scroll info ... only effective for scrollbars */ + +#define WM_NOTIFY_CLIENTCHANGE 37 /* Client area may have changed */ +#define WM_NOTIFY_PARENT 38 /* Notify parent. Information is detailed as notification code */ +#define WM_NOTIFY_PARENT_REFLECTION 39 /* Notify parent reflection. + Sometimes send back as a result of the WM_NOTIFY_PARENT message + to let child react on behalf of its parent. + Information is detailed as notification code */ +#define WM_NOTIFY_ENABLE 40 /* Enable or disable widget */ +#define WM_NOTIFY_VIS_CHANGED 41 /* Visibility of a window has or may have changed */ + +#define WM_HANDLE_DIALOG_STATUS 42 /* Set or get dialog status */ +#define WM_GET_RADIOGROUP 43 /* Send to all siblings and children of a radio control when + selection changed */ +#define WM_MENU 44 /* Send to owner window of menu widget */ +#define WM_SCREENSIZE_CHANGED 45 /* Send to all windows when size of screen has changed */ +#define WM_PRE_PAINT 46 /* Send to a window before it receives a WM_PAINT message */ +#define WM_POST_PAINT 47 /* Send to a window after (the last) WM_PAINT message */ + +#define WM_MOTION 48 /* Automatic motion messages */ + +#define WM_GESTURE 0x0119 /* Gesture message */ + +#define WM_TIMER 0x0113 /* Timer has expired (Keep the same as WIN32) */ +#define WM_WIDGET 0x0300 /* 256 messages reserved for Widget messages */ +#define WM_USER 0x0400 /* Reserved for user messages ... (Keep the same as WIN32) */ + +/********************************************************************* +* +* Motion messages +*/ +#define WM_MOTION_INIT 0 +#define WM_MOTION_MOVE 1 +#define WM_MOTION_GETPOS 2 +#define WM_MOTION_GETCONTEXT 3 + +/********************************************************************* +* +* Motion flags +*/ +#define WM_MOTION_MANAGE_BY_WINDOW (1 << 0) // Window movement is managed by window itself + +/********************************************************************* +* +* Notification codes +* +* The following is the list of notification codes send +* with the WM_NOTIFY_PARENT message +*/ +#define WM_NOTIFICATION_CLICKED 1 +#define WM_NOTIFICATION_RELEASED 2 +#define WM_NOTIFICATION_MOVED_OUT 3 +#define WM_NOTIFICATION_SEL_CHANGED 4 +#define WM_NOTIFICATION_VALUE_CHANGED 5 +#define WM_NOTIFICATION_SCROLLBAR_ADDED 6 /* Scroller added */ +#define WM_NOTIFICATION_CHILD_DELETED 7 /* Inform window that child is about to be deleted */ +#define WM_NOTIFICATION_GOT_FOCUS 8 +#define WM_NOTIFICATION_LOST_FOCUS 9 +#define WM_NOTIFICATION_SCROLL_CHANGED 10 + +#define WM_NOTIFICATION_WIDGET 11 /* Space for widget defined notifications */ +#define WM_NOTIFICATION_USER 16 /* Space for application (user) defined notifications */ + +/********************************************************************* +* +* Memory management +*/ +#define WM_HWIN GUI_HWIN +#define WM_HWIN_NULL GUI_HMEM_NULL +#define WM_HMEM GUI_HMEM +#define WM_HMEM_NULL GUI_HMEM_NULL +#define WM_HTIMER GUI_HMEM + +/********************************************************************* +* +* Window defines +*/ +#define WM_HBKWIN WM_GetDesktopWindow() /* Handle of background window */ +#define WM_UNATTACHED ((WM_HMEM) - 1) /* Do not attach to a window */ + +/********************************************************************* +* +* Window create flags. +* +* These flags can be passed to the create window +* function as flag-parameter. The flags are combinable using the +* binary or operator. +*/ +#define WM_CF_HASTRANS (1UL << 0) /* Has transparency. Needs to be defined for windows which do not fill the entire + section of their (client) rectangle. */ +#define WM_CF_HIDE (0UL << 1) /* Hide window after creation (default !) */ +#define WM_CF_SHOW (1UL << 1) /* Show window after creation */ +#define WM_CF_MEMDEV (1UL << 2) /* Use memory device for redraws */ +#define WM_CF_STAYONTOP (1UL << 3) /* Stay on top */ +#define WM_CF_DISABLED (1UL << 4) /* Disabled: Does not receive PID (mouse & touch) input */ + +/* Create only flags ... Not available as status flags */ +#define WM_CF_ACTIVATE (1UL << 5) /* If automatic activation upon creation of window is desired */ +#define WM_CF_FGND (0UL << 6) /* Put window in foreground after creation (default !) */ +#define WM_CF_BGND (1UL << 6) /* Put window in background after creation */ + +/* Anchor flags */ +#define WM_CF_ANCHOR_RIGHT (1UL << 7) /* Right anchor ... If parent is resized, distance to right will remain const (left is default) */ +#define WM_CF_ANCHOR_BOTTOM (1UL << 8) /* Bottom anchor ... If parent is resized, distance to bottom will remain const (top is default) */ +#define WM_CF_ANCHOR_LEFT (1UL << 9) /* Left anchor ... If parent is resized, distance to left will remain const (left is default) */ +#define WM_CF_ANCHOR_TOP (1UL << 10) /* Top anchor ... If parent is resized, distance to top will remain const (top is default) */ + +#define WM_CF_CONST_OUTLINE (1UL << 11) /* Constant outline. This is relevant for transparent windows only. If a window is transparent + and does not have a constant outline, its background is invalided instead of the window itself. + This causes add. computation time when redrawing. */ +#define WM_CF_LATE_CLIP (1UL << 12) +#define WM_CF_MEMDEV_ON_REDRAW (1UL << 13) + +#define WM_SF_INVALID_DRAW (1UL << 14) +#define WM_SF_DELETE (1UL << 15) /* Marks the window to be deleted within WM_Exec() when no callback routine is executed */ + +#define WM_CF_STATIC (1UL << 16) /* Use static memory device for redraws */ + +#define WM_CF_MOTION_X (1UL << 17) /* Window can be moved automatically in X axis */ +#define WM_CF_MOTION_Y (1UL << 18) /* Window can be moved automatically in Y axis */ + +#define WM_CF_GESTURE (1UL << 19) /* Marks the window to be a able to receive gesture messages */ + +#define WM_CF_ZOOM (1UL << 20) /* Window can be scaled automatically by multi touch gesture input */ + +#define WM_CF_MOTION_R (1UL << 21) // Window can be rotated + +/********************************************************************* +* +* Window manager types +*/ +typedef struct WM_Obj WM_Obj; +typedef struct WM_MESSAGE WM_MESSAGE; + +typedef void WM_CALLBACK( WM_MESSAGE * pMsg); + +struct WM_MESSAGE { + int MsgId; /* type of message */ + WM_HWIN hWin; /* Destination window */ + WM_HWIN hWinSrc; /* Source window */ + union { + const void * p; /* Some messages need more info ... Pointer is declared "const" because some systems (M16C) have 4 byte const, byte 2 byte default ptrs */ + int v; + GUI_COLOR Color; + } Data; +}; + +struct WM_Obj { + GUI_RECT Rect; /* Outer dimensions of window */ + GUI_RECT InvalidRect; /* Invalid rectangle */ + WM_CALLBACK* cb; /* Ptr to notification callback */ + WM_HWIN hNextLin; /* Next window in linear list */ + WM_HWIN hParent; + WM_HWIN hFirstChild; + WM_HWIN hNext; + #if WM_SUPPORT_STATIC_MEMDEV + GUI_MEMDEV_Handle hMem; /* Static memory device */ + #endif + U32 Status; /* Status flags */ + #if WM_SUPPORT_CPP + void * ObjPtr; + #endif +}; + +typedef void WM_tfPollPID(void); +typedef void WM_tfForEach(WM_HWIN hWin, void * pData); + +typedef void (* WM_tfInvalidateParent) (const GUI_RECT * pInvalidRect, WM_HWIN hParent, WM_HWIN hStop); +typedef void (* WM_tfInvalidateDrawFunc)(WM_HWIN hWin); +typedef void (* WM_tfPaint1Func) (WM_HWIN hWin); + +typedef struct { + WM_HMEM hTimer; + WM_HWIN hWin; + int UserId; +} WM_TIMER_OBJ; + +/********************************************************************* +* +* General control routines +*/ +void WM_Activate (void); +void WM_Deactivate(void); +void WM_Init (void); +int WM_Exec (void); /* Execute all jobs ... Return 0 if nothing was done. */ +U32 WM_SetCreateFlags(U32 Flags); +WM_tfPollPID * WM_SetpfPollPID(WM_tfPollPID * pf); + +/********************************************************************* +* +* Window manager interface +*/ +void WM_AttachWindow (WM_HWIN hWin, WM_HWIN hParent); +void WM_AttachWindowAt (WM_HWIN hWin, WM_HWIN hParent, int x, int y); +int WM_CheckScrollPos (WM_SCROLL_STATE * pScrollState, int Pos, int LowerDist, int UpperDist); /* not to be documented (may change in future version) */ +void WM_ClrHasTrans (WM_HWIN hWin); +WM_HWIN WM_CreateWindow (int x0, int y0, int xSize, int ySize, U32 Style, WM_CALLBACK * cb, int NumExtraBytes); +WM_HWIN WM_CreateWindowAsChild (int x0, int y0, int xSize, int ySize, WM_HWIN hWinParent, U32 Style, WM_CALLBACK* cb, int NumExtraBytes); +void WM_DeleteWindow (WM_HWIN hWin); +void WM_DetachWindow (WM_HWIN hWin); +void WM_EnableGestures (WM_HWIN hWin, int OnOff); +int WM_GetHasTrans (WM_HWIN hWin); +WM_HWIN WM_GetFocussedWindow (void); +int WM_GetInvalidRect (WM_HWIN hWin, GUI_RECT * pRect); +int WM_GetStayOnTop (WM_HWIN hWin); +void WM_HideWindow (WM_HWIN hWin); +void WM_InvalidateArea (const GUI_RECT * pRect); +void WM_InvalidateRect (WM_HWIN hWin, const GUI_RECT * pRect); +void WM_InvalidateWindow (WM_HWIN hWin); +void WM_InvalidateWindowAndDescsEx(WM_HWIN hWin, const GUI_RECT * pInvalidRect, U16 Flags); +void WM_InvalidateWindowAndDescs (WM_HWIN hWin); /* not to be documented (may change in future version) */ +int WM_IsEnabled (WM_HWIN hObj); +char WM_IsCompletelyCovered (WM_HWIN hWin); /* Checks if the window is completely covered by other windows */ +char WM_IsCompletelyVisible (WM_HWIN hWin); /* Is the window completely visible ? */ +int WM_IsFocussable (WM_HWIN hWin); +int WM_IsVisible (WM_HWIN hWin); +int WM_IsWindow (WM_HWIN hWin); /* Check validity */ +void WM_SetAnchor (WM_HWIN hWin, U16 AnchorFlags); +void WM_SetHasTrans (WM_HWIN hWin); +void WM_SetId (WM_HWIN hObj, int Id); +void WM_SetStayOnTop (WM_HWIN hWin, int OnOff); +void WM_SetTransState (WM_HWIN hWin, unsigned State); +void WM_ShowWindow (WM_HWIN hWin); +void WM_ValidateRect (WM_HWIN hWin, const GUI_RECT * pRect); +void WM_ValidateWindow (WM_HWIN hWin); + +/* Gesture support */ +void WM_GESTURE_Enable (int OnOff); +int WM_GESTURE_EnableEx(int OnOff, int MaxFactor); +void WM_GESTURE_Exec (void); + +/* Motion support */ +void WM_MOTION_Enable (int OnOff); +void WM_MOTION_SetMovement (WM_HWIN hWin, int Axis, I32 Velocity, I32 Dist); +void WM_MOTION_SetMotion (WM_HWIN hWin, int Axis, I32 Velocity, I32 Deceleration); +void WM_MOTION_SetMoveable (WM_HWIN hWin, U32 Flags, int OnOff); +void WM_MOTION_SetDeceleration (WM_HWIN hWin, int Axis, I32 Deceleration); +unsigned WM_MOTION_SetDefaultPeriod(unsigned Period); +void WM_MOTION_SetSpeed (WM_HWIN hWin, int Axis, I32 Velocity); + +/* Motion support, private interface */ +WM_HMEM WM_MOTION__CreateContext(void); +void WM_MOTION__DeleteContext(WM_HMEM hContext); + +/* Motion support, private function(s) */ +void WM__SetMotionCallback (void(* cbMotion) (GUI_PID_STATE * pState, void * p)); + +/* Static memory devices */ +#if (GUI_SUPPORT_MEMDEV) + #define GUI_MEMDEV_EDGE_LEFT 0 + #define GUI_MEMDEV_EDGE_RIGHT 1 + #define GUI_MEMDEV_EDGE_TOP 2 + #define GUI_MEMDEV_EDGE_BOTTOM 3 + + int GUI_MEMDEV_BlendWinBk (WM_HWIN hWin, int Period, U32 BlendColor, U8 BlendIntens); + int GUI_MEMDEV_BlurAndBlendWinBk(WM_HWIN hWin, int Period, U8 BlurDepth, U32 BlendColor, U8 BlendIntens); + int GUI_MEMDEV_BlurWinBk (WM_HWIN hWin, int Period, U8 BlurDepth); + void GUI_MEMDEV_CreateStatic (WM_HWIN hWin); + int GUI_MEMDEV_FadeInWindow (WM_HWIN hWin, int Period); + int GUI_MEMDEV_FadeOutWindow (WM_HWIN hWin, int Period); + GUI_MEMDEV_Handle GUI_MEMDEV_GetStaticDevice (WM_HWIN hWin); + GUI_MEMDEV_Handle GUI_MEMDEV_GetWindowDevice (WM_HWIN hWin); + int GUI_MEMDEV_MoveInWindow (WM_HWIN hWin, int x, int y, int a180, int Period); + int GUI_MEMDEV_MoveOutWindow (WM_HWIN hWin, int x, int y, int a180, int Period); + void GUI_MEMDEV_Paint1Static (WM_HWIN hWin); /* not to be documented */ + int GUI_MEMDEV_ShiftInWindow (WM_HWIN hWin, int Period, int Direction); + int GUI_MEMDEV_ShiftOutWindow (WM_HWIN hWin, int Period, int Direction); + int GUI_MEMDEV_SwapWindow (WM_HWIN hWin, int Period, int Edge); + +#endif + +/* Move/resize windows */ +void WM_MoveWindow (WM_HWIN hWin, int dx, int dy); +void WM_ResizeWindow (WM_HWIN hWin, int dx, int dy); +void WM_MoveTo (WM_HWIN hWin, int x, int y); +void WM_MoveChildTo (WM_HWIN hWin, int x, int y); +void WM_SetSize (WM_HWIN hWin, int XSize, int YSize); +void WM_SetWindowPos (WM_HWIN hWin, int xPos, int yPos, int xSize, int ySize); +int WM_SetXSize (WM_HWIN hWin, int xSize); +int WM_SetYSize (WM_HWIN hWin, int ySize); +int WM_SetScrollbarH (WM_HWIN hWin, int OnOff); /* not to be documented (may change in future version) */ +int WM_SetScrollbarV (WM_HWIN hWin, int OnOff); /* not to be documented (may change in future version) */ + +/* ToolTip support */ +#define WM_TOOLTIP_PI_FIRST 0 +#define WM_TOOLTIP_PI_SHOW 1 +#define WM_TOOLTIP_PI_NEXT 2 + +#define WM_TOOLTIP_CI_BK 0 +#define WM_TOOLTIP_CI_FRAME 1 +#define WM_TOOLTIP_CI_TEXT 2 + +typedef WM_HMEM WM_TOOLTIP_HANDLE; + +typedef struct { + int Id; + const char * pText; +} TOOLTIP_INFO; + +int WM_TOOLTIP_AddTool (WM_TOOLTIP_HANDLE hToolTip, WM_HWIN hTool, const char * pText); +WM_TOOLTIP_HANDLE WM_TOOLTIP_Create (WM_HWIN hDlg, const TOOLTIP_INFO * pInfo, unsigned NumItems); +void WM_TOOLTIP_Delete (WM_TOOLTIP_HANDLE hToolTip); +GUI_COLOR WM_TOOLTIP_SetDefaultColor (unsigned Index, GUI_COLOR Color); +const GUI_FONT * WM_TOOLTIP_SetDefaultFont (const GUI_FONT * pFont); +unsigned WM_TOOLTIP_SetDefaultPeriod(unsigned Index, unsigned Period); + +/* ToolTip support, private */ +void WM__SetToolTipCallback(void(* cbToolTip)(GUI_PID_STATE * pState, WM_HWIN)); + +/* Timer */ +#ifdef GUI_X_CREATE_TIMER + int WM_CreateTimer (WM_HWIN hWin, int UserID, int Period, int Mode); /* not to be documented (may change in future version) */ + void WM_DeleteTimer (WM_HWIN hWin, int UserId); /* not to be documented (may change in future version) */ +#else + WM_HMEM WM_CreateTimer (WM_HWIN hWin, int UserID, int Period, int Mode); /* not to be documented (may change in future version) */ + void WM_DeleteTimer (WM_HMEM hTimer); /* not to be documented (may change in future version) */ + void WM_RestartTimer(WM_HMEM hTimer, int Period); +#endif +int WM_GetTimerId(WM_HTIMER hTimer); + +/* Diagnostics */ +int WM_GetNumWindows(void); +int WM_GetNumInvalidWindows(void); + +/* Scroll state related functions */ +void WM_CheckScrollBounds(WM_SCROLL_STATE * pScrollState); /* not to be documented (may change in future version) */ +int WM_GetScrollPosH (WM_HWIN hWin); +int WM_GetScrollPosV (WM_HWIN hWin); +void WM_SetScrollPosH (WM_HWIN hWin, unsigned ScrollPos); +void WM_SetScrollPosV (WM_HWIN hWin, unsigned ScrollPos); +int WM_SetScrollValue (WM_SCROLL_STATE * pScrollState, int v); /* not to be documented (may change in future version) */ + +/* Get / Set (new) callback function */ +WM_CALLBACK * WM_SetCallback(WM_HWIN hWin, WM_CALLBACK * cb); +WM_CALLBACK * WM_GetCallback(WM_HWIN hWin); + +/* Get size/origin of a window */ +void WM_GetClientRect (GUI_RECT * pRect); +void WM_GetClientRectEx (WM_HWIN hWin, GUI_RECT * pRect); +void WM_GetInsideRect (GUI_RECT * pRect); +void WM_GetInsideRectEx (WM_HWIN hWin, GUI_RECT * pRect); +void WM_GetInsideRectExScrollbar(WM_HWIN hWin, GUI_RECT * pRect); /* not to be documented (may change in future version) */ +void WM_GetWindowRect (GUI_RECT * pRect); +void WM_GetWindowRectEx (WM_HWIN hWin, GUI_RECT * pRect); +int WM_GetOrgX (void); +int WM_GetOrgY (void); +int WM_GetWindowOrgX (WM_HWIN hWin); +int WM_GetWindowOrgY (WM_HWIN hWin); +int WM_GetWindowSizeX (WM_HWIN hWin); +int WM_GetWindowSizeY (WM_HWIN hWin); +WM_HWIN WM_GetFirstChild (WM_HWIN hWin); +WM_HWIN WM_GetNextSibling (WM_HWIN hWin); +WM_HWIN WM_GetParent (WM_HWIN hWin); +WM_HWIN WM_GetPrevSibling (WM_HWIN hWin); +int WM_GetId (WM_HWIN hWin); +WM_HWIN WM_GetScrollbarV (WM_HWIN hWin); +WM_HWIN WM_GetScrollbarH (WM_HWIN hWin); +WM_HWIN WM_GetScrollPartner (WM_HWIN hWin); +WM_HWIN WM_GetClientWindow (WM_HWIN hObj); +GUI_COLOR WM_GetBkColor (WM_HWIN hObj); + +/* Change Z-Order of windows */ +void WM_BringToBottom(WM_HWIN hWin); +void WM_BringToTop(WM_HWIN hWin); + +GUI_COLOR WM_SetDesktopColor (GUI_COLOR Color); +GUI_COLOR WM_SetDesktopColorEx(GUI_COLOR Color, unsigned int LayerIndex); +void WM_SetDesktopColors (GUI_COLOR Color); + +/* Select window used for drawing operations */ +WM_HWIN WM_SelectWindow (WM_HWIN hWin); +WM_HWIN WM_GetActiveWindow (void); +void WM_Paint (WM_HWIN hObj); +void WM_Update (WM_HWIN hWin); +void WM_PaintWindowAndDescs (WM_HWIN hWin); +void WM_UpdateWindowAndDescs (WM_HWIN hWin); + +/* Get foreground/background windows */ +WM_HWIN WM_GetDesktopWindow (void); +WM_HWIN WM_GetDesktopWindowEx(unsigned int LayerIndex); + +/* Reduce clipping area of a window */ +const GUI_RECT * WM_SetUserClipRect(const GUI_RECT * pRect); +void WM_SetDefault (void); + +/* Use of memory devices */ +void WM_EnableMemdev (WM_HWIN hWin); +void WM_DisableMemdev (WM_HWIN hWin); + +/* Automatic use of multiple buffers */ +int WM_MULTIBUF_Enable(int OnOff); + +extern const WM_MULTIBUF_API * WM_MULTIBUF__pAPI; + +typedef void (* T_WM_EXEC_GESTURE)(void); + +extern T_WM_EXEC_GESTURE WM__pExecGestures; + +/* ... */ +int WM_OnKey(int Key, int Pressed); +void WM_MakeModal(WM_HWIN hWin); + +/********************************************************************* +* +* Message related functions +* +* Please note that some of these functions do not yet show up in the +* documentation, as they should not be required by application program. +*/ +void WM_NotifyParent (WM_HWIN hWin, int Notification); +void WM_SendMessage (WM_HWIN hWin, WM_MESSAGE * p); +void WM_SendMessageNoPara (WM_HWIN hWin, int MsgId); /* not to be documented (may change in future */ +void WM_DefaultProc (WM_MESSAGE * pMsg); +int WM_BroadcastMessage (WM_MESSAGE * pMsg); +void WM_SetScrollState (WM_HWIN hWin, const WM_SCROLL_STATE * pState); +void WM_SetEnableState (WM_HWIN hItem, int State); +void WM_SendToParent (WM_HWIN hWin, WM_MESSAGE * pMsg); +int WM_HasFocus (WM_HWIN hWin); +int WM_SetFocus (WM_HWIN hWin); +WM_HWIN WM_SetFocusOnNextChild (WM_HWIN hParent); /* Set the focus to the next child */ +WM_HWIN WM_SetFocusOnPrevChild (WM_HWIN hParent); /* Set the focus to the previous child */ +WM_HWIN WM_GetDialogItem (WM_HWIN hWin, int Id); +void WM_EnableWindow (WM_HWIN hWin); +void WM_DisableWindow (WM_HWIN hWin); +void WM_GetScrollState (WM_HWIN hObj, WM_SCROLL_STATE * pScrollState); + +/********************************************************************* +* +* Managing user data +*/ +int WM_GetUserData (WM_HWIN hWin, void * pDest, int SizeOfBuffer); +int WM_SetUserData (WM_HWIN hWin, const void * pSrc, int SizeOfBuffer); +int WM__GetUserDataEx(WM_HWIN hWin, void * pDest, int NumBytes, int SizeOfObject); +int WM__SetUserDataEx(WM_HWIN hWin, const void * pSrc, int NumBytes, int SizeOfObject); + +/********************************************************************* +* +* Capturing input focus +*/ +int WM_HasCaptured (WM_HWIN hWin); +void WM_SetCapture (WM_HWIN hObj, int AutoRelease); +void WM_SetCaptureMove(WM_HWIN hWin, const GUI_PID_STATE * pState, int MinVisibility, int LimitTop); /* Not yet documented */ +void WM_ReleaseCapture(void); + +/********************************************************************* +* +* Misc routines +*/ +int WM_HandlePID (void); +WM_HWIN WM_Screen2hWin (int x, int y); +WM_HWIN WM_Screen2hWinEx (WM_HWIN hStop, int x, int y); +void WM_ForEachDesc (WM_HWIN hWin, WM_tfForEach * pcb, void * pData); +void WM_SetScreenSize (int xSize, int ySize); +int WM_PollSimMsg (void); + +/********************************************************************* +* +* Diagnostics routines +*/ +#if (WM_SUPPORT_DIAG) +void WM_DIAG_EnableInvalidationColoring(int OnOff); +#endif + +/********************************************************************* +* +* Macros for compatibility with older versions +*/ +#if WM_COMPATIBLE_MODE + #define HBWIN WM_HWIN + #define HBWIN_NULL WM_HWIN_NULL + + #define WM_HideWin WM_HideWindow + #define WM_ShowWin WM_ShowWindow + #define WM_GetKey GUI_GetKey + #define WM_WaitKey GUI_WaitKey + + #define WM_ExecIdle WM_Exec + #define WM_ExecIdle1 WM_Exec1 + + #define WM_Invalidate WM_InvalidateWindow + #define WM_GetWinRect WM_GetWindowRect + #define WM_GetWinOrgX WM_GetWindowOrgX + #define WM_GetWinOrgY WM_GetWindowOrgY + #define WM_GetWinSizeX WM_GetWindowSizeX + #define WM_GetWinSizeY WM_GetWindowSizeY + #define WM_GetXSize WM_GetWindowSizeX + #define WM_GetYSize WM_GetWindowSizeY + #define WM_SelWin WM_SelectWindow + #define WM_GetBackgroundWindow WM_GetDesktopWindow + #define WM_GetForegroundWindow 0 + #define WM_SetForegroundWindow WM_BringToTop + #define WM_SetUserClipArea WM_SetUserClipRect + + + #define WM_Start() + #define WM_Stop() + #define WM_SetBkWindowColor(Color) WM_SetDesktopColor(Color) + +#endif + + +#endif /* GUI_WINSUPPORT */ + +#if defined(__cplusplus) +} +#endif + +#endif /* WM_H */ + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/WM_GUI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/WM_GUI.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,71 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : WM_GUI.h +Purpose : Windows manager include for low level GUI routines +---------------------------------------------------------------------- +*/ + +#ifndef WM_GUI_H /* Make sure we only include it once */ +#define WM_GUI_H + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +int WM__InitIVRSearch(const GUI_RECT* pMaxRect); +int WM__GetNextIVR (void); +int WM__GetOrgX_AA(void); +int WM__GetOrgY_AA(void); + +#define WM_ITERATE_START(pRect) \ + { \ + if (WM__InitIVRSearch(pRect)) \ + do { + +#define WM_ITERATE_END() \ + } while (WM__GetNextIVR()); \ + } + +#define WM_ADDORGX(x) (x += GUI_pContext->xOff) +#define WM_ADDORGY(y) (y += GUI_pContext->yOff) +#define WM_ADDORG(x0,y0) WM_ADDORGX(x0); WM_ADDORGY(y0) +#define WM_ADDORGX_AA(x) (x += WM__GetOrgX_AA()) +#define WM_ADDORGY_AA(y) (y += WM__GetOrgY_AA()) +#define WM_ADDORG_AA(x0,y0) WM_ADDORGX_AA(x0); WM_ADDORGY_AA(y0) +#define WM_SUBORGX(x) (x -= GUI_pContext->xOff) +#define WM_SUBORGY(y) (y -= GUI_pContext->yOff) +#define WM_SUBORG(x0,y0) WM_SUBORGX(x0); WM_SUBORGY(y0) + +#if defined(__cplusplus) + } +#endif + + +#endif /* Avoid multiple inclusion */ + +/*************************** End of file ****************************/
diff -r 000000000000 -r 1bf8f02b0770 emWin_header/WM_Intern.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emWin_header/WM_Intern.h Sat Mar 26 22:49:50 2016 +0000 @@ -0,0 +1,253 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH & Co. KG * +* Solutions for real time microcontroller applications * +********************************************************************** +* * +* (c) 1996 - 2014 SEGGER Microcontroller GmbH & Co. KG * +* * +* Internet: www.segger.com Support: support@segger.com * +* * +********************************************************************** + +** emWin V5.24 - Graphical user interface for embedded applications ** +All Intellectual Property rights in the Software belongs to SEGGER. +emWin is protected by international copyright laws. Knowledge of the +source code may not be used to write a similar product. This file may +only be used in accordance with the following terms: + +The software has been licensed to NXP Semiconductors USA, Inc. whose +registered office is situated at 411 E. Plumeria Drive, San Jose, +CA 95134, USA solely for the purposes of creating libraries for +NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and +distributed under the terms and conditions of the NXP End User License +Agreement. +Full source code is available at: www.segger.com + +We appreciate your understanding and fairness. +---------------------------------------------------------------------- +File : WM_Intern.h +Purpose : Windows manager internal include +---------------------------------------------------------------------- +*/ + +#ifndef WM_INTERN_H /* Make sure we only include it once */ +#define WM_INTERN_H /* Make sure we only include it once */ + +#include "WM.h" +#include "GUI_Private.h" + + +#if defined(__cplusplus) +extern "C" { /* Make sure we have C-declarations in C++ programs */ +#endif + +#if GUI_WINSUPPORT + +/********************************************************************* +* +* defines +* +********************************************************************** + + The following could be placed in a file of its own as it is not + used outside of the window manager + +*/ +/* Basic Windows status flags. + For module-internally use only ! +*/ +#define WM_SF_HASTRANS WM_CF_HASTRANS +#define WM_SF_MEMDEV WM_CF_MEMDEV +#define WM_SF_MEMDEV_ON_REDRAW WM_CF_MEMDEV_ON_REDRAW +#define WM_SF_DISABLED WM_CF_DISABLED /* Disabled: Does not receive PID (mouse & touch) input */ +#define WM_SF_ISVIS WM_CF_SHOW /* Is visible flag */ + +#define WM_SF_STAYONTOP WM_CF_STAYONTOP +#define WM_SF_LATE_CLIP WM_CF_LATE_CLIP +#define WM_SF_ANCHOR_RIGHT WM_CF_ANCHOR_RIGHT +#define WM_SF_ANCHOR_BOTTOM WM_CF_ANCHOR_BOTTOM +#define WM_SF_ANCHOR_LEFT WM_CF_ANCHOR_LEFT +#define WM_SF_ANCHOR_TOP WM_CF_ANCHOR_TOP + +#define WM_SF_INVALID WM_CF_ACTIVATE /* We reuse this flag, as it is create only and Invalid is status only */ + +#define WM_SF_CONST_OUTLINE WM_CF_CONST_OUTLINE /* Constant outline.*/ + +#define WM_H2P(hWin) ((WM_Obj*)GUI_ALLOC_h2p(hWin)) + + +#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_LOG_WARNINGS + #define WM_ASSERT_NOT_IN_PAINT() { if (WM__PaintCallbackCnt) \ + GUI_DEBUG_ERROROUT("Function may not be called from within a paint event"); \ + } +#else + #define WM_ASSERT_NOT_IN_PAINT() +#endif + +/********************************************************************* +* +* Data types & structures +* +********************************************************************** +*/ +typedef struct { + WM_HWIN hOld; + WM_HWIN hNew; +} WM_NOTIFY_CHILD_HAS_FOCUS_INFO; + +typedef struct WM_CRITICAL_HANDLE { + struct WM_CRITICAL_HANDLE * pNext; + volatile WM_HWIN hWin; +} WM_CRITICAL_HANDLE; + +/********************************************************************* +* +* Data (extern) +* +********************************************************************** +*/ +extern U32 WM__CreateFlags; +extern WM_HWIN WM__ahCapture[GUI_NUM_LAYERS]; +extern WM_HWIN WM__ahWinFocus[GUI_NUM_LAYERS]; +extern char WM__CaptureReleaseAuto; +extern WM_tfPollPID * WM_pfPollPID; +extern U8 WM__PaintCallbackCnt; /* Public for assertions only */ +extern WM_HWIN WM__hCreateStatic; + +#if WM_SUPPORT_TRANSPARENCY + extern int WM__TransWindowCnt; + extern WM_HWIN WM__hATransWindow; +#endif + +#if WM_SUPPORT_DIAG + extern void (*WM__pfShowInvalid)(WM_HWIN hWin); +#endif + +extern WM_CRITICAL_HANDLE WM__aCHWinModal[GUI_NUM_LAYERS]; +extern WM_CRITICAL_HANDLE WM__aCHWinLast[GUI_NUM_LAYERS]; + +#if GUI_SUPPORT_MOUSE + extern WM_CRITICAL_HANDLE WM__aCHWinMouseOver[GUI_NUM_LAYERS]; +#endif + +#ifdef WM_C + #define GUI_EXTERN +#else + #define GUI_EXTERN extern +#endif + +#if (GUI_NUM_LAYERS > 1) + GUI_EXTERN unsigned WM__TouchedLayer; + #define WM__TOUCHED_LAYER WM__TouchedLayer +#else + #define WM__TOUCHED_LAYER GUI_CURSOR_LAYER +#endif + +GUI_EXTERN U16 WM__NumWindows; +GUI_EXTERN U16 WM__NumInvalidWindows; +GUI_EXTERN WM_HWIN WM__FirstWin; +GUI_EXTERN WM_CRITICAL_HANDLE * WM__pFirstCriticalHandle; + +GUI_EXTERN WM_HWIN WM__ahDesktopWin[GUI_NUM_LAYERS]; +GUI_EXTERN GUI_COLOR WM__aBkColor[GUI_NUM_LAYERS]; + +#undef GUI_EXTERN + +/********************************************************************* +* +* Prototypes +* +********************************************************************** +*/ +void WM__ActivateClipRect (void); +int WM__ClipAtParentBorders (GUI_RECT * pRect, WM_HWIN hWin); +void WM__Client2Screen (const WM_Obj * pWin, GUI_RECT * pRect); +void WM__DeleteAssocTimer (WM_HWIN hWin); +void WM__DeleteSecure (WM_HWIN hWin); +void WM__DetachWindow (WM_HWIN hChild); +void WM__ForEachDesc (WM_HWIN hWin, WM_tfForEach * pcb, void * pData); +void WM__GetClientRectWin (const WM_Obj * pWin, GUI_RECT * pRect); +void WM__GetClientRectEx (WM_HWIN hWin, GUI_RECT * pRect); +WM_HWIN WM__GetFirstSibling (WM_HWIN hWin); +WM_HWIN WM__GetFocussedChild (WM_HWIN hWin); +int WM__GetHasFocus (WM_HWIN hWin); +WM_HWIN WM__GetLastSibling (WM_HWIN hWin); +WM_HWIN WM__GetPrevSibling (WM_HWIN hWin); +int WM__GetTopLevelLayer (WM_HWIN hWin); +int WM__GetWindowSizeX (const WM_Obj * pWin); +int WM__GetWindowSizeY (const WM_Obj * pWin); +void WM__InsertWindowIntoList (WM_HWIN hWin, WM_HWIN hParent); +void WM__Invalidate1Abs (WM_HWIN hWin, const GUI_RECT * pRect); +void WM__InvalidateAreaBelow (const GUI_RECT * pRect, WM_HWIN StopWin); +void WM__InvalidateRectEx (const GUI_RECT * pInvalidRect, WM_HWIN hParent, WM_HWIN hStop); +void WM__InvalidateTransAreaAbove(const GUI_RECT * pRect, WM_HWIN StopWin); +int WM__IntersectRect (GUI_RECT * pDest, const GUI_RECT * pr0, const GUI_RECT * pr1); +int WM__IsAncestor (WM_HWIN hChild, WM_HWIN hParent); +int WM__IsAncestorOrSelf (WM_HWIN hChild, WM_HWIN hParent); +int WM__IsChild (WM_HWIN hWin, WM_HWIN hParent); +int WM__IsEnabled (WM_HWIN hWin); +int WM__IsInModalArea (WM_HWIN hWin); +int WM__IsInWindow (WM_Obj * pWin, int x, int y); +int WM__IsWindow (WM_HWIN hWin); +void WM__LeaveIVRSearch (void); +void WM__MoveTo (WM_HWIN hWin, int x, int y); +void WM__MoveWindow (WM_HWIN hWin, int dx, int dy); +void WM__NotifyVisChanged (WM_HWIN hWin, GUI_RECT * pRect); +int WM__RectIsNZ (const GUI_RECT * pr); +void WM__RemoveWindowFromList (WM_HWIN hWin); +void WM__RemoveFromLinList (WM_HWIN hWin); +void WM__Screen2Client (const WM_Obj * pWin, GUI_RECT * pRect); +void WM__SelectTopLevelLayer (WM_HWIN hWin); +void WM__SendMsgNoData (WM_HWIN hWin, U8 MsgId); +void WM__SendMessage (WM_HWIN hWin, WM_MESSAGE * pm); +void WM__SendMessageIfEnabled (WM_HWIN hWin, WM_MESSAGE * pm); +void WM__SendMessageNoPara (WM_HWIN hWin, int MsgId); +void WM__SendPIDMessage (WM_HWIN hWin, WM_MESSAGE * pMsg); +int WM__SetScrollbarH (WM_HWIN hWin, int OnOff); +int WM__SetScrollbarV (WM_HWIN hWin, int OnOff); +void WM__UpdateChildPositions (WM_Obj * pObj, int dx0, int dy0, int dx1, int dy1); +void WM_PID__GetPrevState (GUI_PID_STATE * pPrevState, int Layer); +void WM_PID__SetPrevState (GUI_PID_STATE * pPrevState, int Layer); +void WM__SendTouchMessage (WM_HWIN hWin, WM_MESSAGE * pMsg); + +U16 WM_GetFlags (WM_HWIN hWin); +int WM__Paint (WM_HWIN hWin); +void WM__Paint1 (WM_HWIN hWin); +void WM__AddCriticalHandle (WM_CRITICAL_HANDLE * pCH); +void WM__RemoveCriticalHandle (WM_CRITICAL_HANDLE * pCH); +void WM__SetLastTouched (WM_HWIN hWin); + +#if WM_SUPPORT_STATIC_MEMDEV + void WM__InvalidateDrawAndDescs(WM_HWIN hWin); +#else + #define WM__InvalidateDrawAndDescs(hWin) +#endif + +/* Static memory devices */ +#if (GUI_SUPPORT_MEMDEV) + typedef struct { + int xSize, ySize; // Size of bk window + } EFFECT_CONTEXT; + + int GUI_MEMDEV__CalcParaFadeIn (int Period, int TimeUsed); + void GUI_MEMDEV__ChangeBK (EFFECT_CONTEXT * pContext); + void GUI_MEMDEV__RemoveStaticDevice(WM_HWIN hWin); + void GUI_MEMDEV__UndoBK (EFFECT_CONTEXT * pContext); +#endif + +void WM__InvalidateParent(const GUI_RECT * pInvalidRect, WM_HWIN hParent, WM_HWIN hStop); +void WM__InvalidateRect (const GUI_RECT * pInvalidRect, WM_HWIN hParent, WM_HWIN hStop, U16 Flags); + +WM_tfInvalidateParent WM__SetInvalidateParentFunc(WM_tfInvalidateParent pfInvalidateParentFunc); +WM_tfInvalidateDrawFunc WM__SetInvalidateDrawFunc (WM_tfInvalidateDrawFunc pfInvalidateDrawFunc); +WM_tfPaint1Func WM__SetPaint1Func (WM_tfPaint1Func pfPaint1Func); + +#endif /* GUI_WINSUPPORT */ + +#if defined(__cplusplus) + } +#endif + +#endif /* WM_INTERN_H */ + +/*************************** End of file ****************************/