add BearPi STemWin test demo

This commit is contained in:
morixinguan
2021-01-30 11:26:41 +08:00
parent a01cf34ab8
commit 424b4f729c
190 changed files with 143893 additions and 0 deletions

View File

@@ -0,0 +1,224 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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);
/*********************************************************************
*
* Managing default values
*
**********************************************************************
*/
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);
/*********************************************************************
*
* 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 ****************************/

View File

@@ -0,0 +1,146 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : BUTTON_Private.h
Purpose : BUTTON private header file
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef BUTTON_PRIVATE_H
#define BUTTON_PRIVATE_H
#include "WM.h"
#include "BUTTON.h"
#if GUI_WINSUPPORT
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#ifndef BUTTON_3D_MOVE_X
#define BUTTON_3D_MOVE_X 1
#endif
#ifndef BUTTON_3D_MOVE_Y
#define BUTTON_3D_MOVE_Y 1
#endif
/*********************************************************************
*
* Object definition
*
**********************************************************************
*/
typedef struct {
WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
} BUTTON_SKIN_PRIVATE;
typedef struct {
GUI_COLOR aBkColor[3];
GUI_COLOR aTextColor[3];
GUI_COLOR FocusColor;
GUI_COLOR FrameColor;
const GUI_FONT * pFont;
BUTTON_SKIN_PRIVATE SkinPrivate;
I16 Align;
I16 xPosText, yPosText;
} BUTTON_PROPS;
typedef struct {
WIDGET Widget;
BUTTON_PROPS Props;
WIDGET_SKIN const * pWidgetSkin;
WM_HMEM hpText;
WM_HMEM ahDrawObj[3];
} BUTTON_Obj;
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define BUTTON_INIT_ID(p) (p->Widget.DebugId = BUTTON_ID)
#else
#define BUTTON_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
BUTTON_Obj * BUTTON_LockH(BUTTON_Handle h);
#define BUTTON_LOCK_H(h) BUTTON_LockH(h)
#else
#define BUTTON_LOCK_H(h) (BUTTON_Obj *)GUI_LOCK_H(h)
#endif
/*********************************************************************
*
* Public data (internal defaults)
*
**********************************************************************
*/
extern BUTTON_PROPS BUTTON__DefaultProps;
extern const WIDGET_SKIN BUTTON__SkinClassic;
extern WIDGET_SKIN BUTTON__Skin;
extern WIDGET_SKIN const * BUTTON__pSkinDefault;
/*********************************************************************
*
* Private functions
*
**********************************************************************
*/
void BUTTON__SetDrawObj(BUTTON_Handle hObj, int Index, GUI_DRAW_HANDLE hDrawObj);
#endif /* GUI_WINSUPPORT */
#endif /* BUTTON_H */

View File

@@ -0,0 +1,171 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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 ****************************/

View File

@@ -0,0 +1,218 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : CHECKBOX.h
Purpose : CHECKBOX include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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);
/*********************************************************************
*
* Managing default values
*
**********************************************************************
*/
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);
/*********************************************************************
*
* 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);
int CHECKBOX_SetUserData (CHECKBOX_Handle hObj, const void * pSrc, int NumBytes);
/*********************************************************************
*
* 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 ****************************/

View File

@@ -0,0 +1,173 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : CHECKBOX_Private.h
Purpose : CHECKBOX private header file
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef CHECKBOX_PRIVATE_H
#define CHECKBOX_PRIVATE_H
#include "WM.h"
#include "WIDGET.h"
#include "CHECKBOX.h"
#if GUI_WINSUPPORT
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#ifndef CHECKBOX_BKCOLOR0_DEFAULT
#define CHECKBOX_BKCOLOR0_DEFAULT 0x808080 /* Inactive color */
#endif
#ifndef CHECKBOX_BKCOLOR1_DEFAULT
#define CHECKBOX_BKCOLOR1_DEFAULT GUI_WHITE /* Active color */
#endif
#ifndef CHECKBOX_FGCOLOR0_DEFAULT
#define CHECKBOX_FGCOLOR0_DEFAULT 0x101010
#endif
#ifndef CHECKBOX_FGCOLOR1_DEFAULT
#define CHECKBOX_FGCOLOR1_DEFAULT GUI_BLACK
#endif
#ifndef CHECKBOX_DEFAULT_SIZE
#define CHECKBOX_DEFAULT_SIZE 15
#endif
/*********************************************************************
*
* Object definition
*
**********************************************************************
*/
typedef struct {
unsigned (* pfGetButtonSize)(void);
WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
} CHECKBOX_SKIN_PRIVATE;
typedef struct {
const GUI_FONT * pFont;
GUI_COLOR aBkColorBox[2]; /* Colors used to draw the box background */
GUI_COLOR BkColor; /* Widget background color */
GUI_COLOR TextColor;
GUI_COLOR FocusColor;
CHECKBOX_SKIN_PRIVATE SkinPrivate;
I16 Align;
U8 Spacing;
const GUI_BITMAP * apBm[6];
} CHECKBOX_PROPS;
typedef struct {
WIDGET Widget;
CHECKBOX_PROPS Props;
WIDGET_SKIN const * pWidgetSkin;
U8 NumStates;
U8 CurrentState;
WM_HMEM hpText;
U32 ButtonSize;
} CHECKBOX_Obj;
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define CHECKBOX_INIT_ID(p) (p->Widget.DebugId = CHECKBOX_ID)
#else
#define CHECKBOX_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
CHECKBOX_Obj * CHECKBOX_LockH(CHECKBOX_Handle h);
#define CHECKBOX_LOCK_H(h) CHECKBOX_LockH(h)
#else
#define CHECKBOX_LOCK_H(h) (CHECKBOX_Obj *)GUI_LOCK_H(h)
#endif
/*********************************************************************
*
* Private functions
*
**********************************************************************
*/
unsigned CHECKBOX__GetButtonSize(void);
/*********************************************************************
*
* Public data (internal defaults)
*
**********************************************************************
*/
extern CHECKBOX_PROPS CHECKBOX__DefaultProps;
extern const WIDGET_SKIN CHECKBOX__SkinClassic;
extern WIDGET_SKIN CHECKBOX__Skin;
extern WIDGET_SKIN const * CHECKBOX__pSkinDefault;
/*********************************************************************
*
* Extern data
*
**********************************************************************
*/
extern const GUI_BITMAP CHECKBOX__abmCheck[2];
#endif /* GUI_WINSUPPORT */
#endif /* CHECKBOX_PRIVATE_H */
/*************************** End of file ****************************/

View File

@@ -0,0 +1,149 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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 */

View File

@@ -0,0 +1,144 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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 */

View File

@@ -0,0 +1,113 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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 ****************************/

View File

@@ -0,0 +1,120 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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 ****************************/

View File

@@ -0,0 +1,211 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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;
/*********************************************************************
*
* 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
/*********************************************************************
*
* Managing default values
*
**********************************************************************
*/
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 ****************************/

View File

@@ -0,0 +1,154 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : DROPDOWN_Private.h
Purpose : DROPDOWN private header file
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef DROPDOWN_PRIVATE_H
#define DROPDOWN_PRIVATE_H
#include "DROPDOWN.h"
#include "WIDGET.h"
#include "GUI_ARRAY.h"
#if GUI_WINSUPPORT
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define DROPDOWN_SF_AUTOSCROLLBAR DROPDOWN_CF_AUTOSCROLLBAR
/*********************************************************************
*
* Object definition
*
**********************************************************************
*/
typedef struct {
WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
} DROPDOWN_SKIN_PRIVATE;
typedef struct {
const GUI_FONT * pFont;
GUI_COLOR aBackColor[3];
GUI_COLOR aTextColor[3];
GUI_COLOR aColor[2];
GUI_COLOR aScrollbarColor[3];
DROPDOWN_SKIN_PRIVATE SkinPrivate;
I16 TextBorderSize;
I16 Align;
} DROPDOWN_PROPS;
typedef struct {
WIDGET Widget;
I16 Sel; // Current selection
I16 ySizeLB; // ySize of assigned LISTBOX in expanded state
I16 TextHeight;
GUI_ARRAY Handles;
WM_SCROLL_STATE ScrollState;
DROPDOWN_PROPS Props;
WIDGET_SKIN const * pWidgetSkin;
WM_HWIN hListWin;
U8 Flags;
U16 ItemSpacing;
U8 ScrollbarWidth;
char IsPressed;
WM_HMEM hDisabled;
} DROPDOWN_Obj;
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define DROPDOWN_INIT_ID(p) (p->Widget.DebugId = DROPDOWN_ID)
#else
#define DROPDOWN_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
DROPDOWN_Obj * DROPDOWN_LockH(DROPDOWN_Handle h);
#define DROPDOWN_LOCK_H(h) DROPDOWN_LockH(h)
#else
#define DROPDOWN_LOCK_H(h) (DROPDOWN_Obj *)GUI_LOCK_H(h)
#endif
/*********************************************************************
*
* Private (module internal) data
*
**********************************************************************
*/
extern DROPDOWN_PROPS DROPDOWN__DefaultProps;
extern const WIDGET_SKIN DROPDOWN__SkinClassic;
extern WIDGET_SKIN DROPDOWN__Skin;
extern WIDGET_SKIN const * DROPDOWN__pSkinDefault;
/*********************************************************************
*
* Private functions
*
**********************************************************************
*/
void DROPDOWN__AdjustHeight(DROPDOWN_Handle hObj);
int DROPDOWN__GetNumItems (DROPDOWN_Obj * pObj);
const char * DROPDOWN__GetpItemLocked(DROPDOWN_Handle hObj, int Index);
#endif // GUI_WINSUPPORT
#endif // DROPDOWN_PRIVATE_H

View File

@@ -0,0 +1,236 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : EDIT.h
Purpose : EDIT include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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
#define EDIT_CI_CURSOR 2
//
// Signed or normal mode
//
#define GUI_EDIT_NORMAL (0 << 0)
#define GUI_EDIT_SIGNED (1 << 0)
#define GUI_EDIT_SUPPRESS_LEADING_ZEROES (1 << 1)
//
// Cursor coloring
//
#define GUI_EDIT_SHOWCURSOR (1 << 2)
#define GUI_EDIT_CUSTCOLORMODE (1 << 3)
//
// 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
/*********************************************************************
*
* 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);
/*********************************************************************
*
* Managing default values
*
**********************************************************************
*/
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);
/*********************************************************************
*
* Individual member functions
*/
//
// 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);
int EDIT_EnableInversion (EDIT_Handle hObj, int OnOff);
//
// 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);
#if defined(__cplusplus)
}
#endif
#endif // GUI_WINSUPPORT
#endif // EDIT_H
/*************************** End of file ****************************/

View File

@@ -0,0 +1,152 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : EDIT_Private.h
Purpose : Internal header file
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef EDIT_PRIVATE_H
#define EDIT_PRIVATE_H
#include "EDIT.h"
#if GUI_WINSUPPORT
#include "WIDGET.h"
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define EDIT_REALLOC_SIZE 16
#ifndef EDIT_XOFF
#define EDIT_XOFF 1
#endif
/*********************************************************************
*
* Types
*
**********************************************************************
*/
typedef struct EDIT_Obj_struct EDIT_Obj;
typedef struct {
int Align;
int Border;
const GUI_FONT * pFont;
GUI_COLOR aTextColor[3];
GUI_COLOR aBkColor[3];
} EDIT_PROPS;
struct EDIT_Obj_struct {
WIDGET Widget;
WM_HMEM hpText;
I16 MaxLen;
U16 BufferSize;
I32 Min, Max; // Min max values as normalized floats (integers)
U8 NumDecs; // Number of decimals
I32 CurrentValue; // Current value
int CursorPos; // Cursor position. 0 means left most
unsigned SelSize; // Number of selected characters
U8 EditMode; // Insert or overwrite mode
U8 XSizeCursor; // Size of cursor when working in insert mode
U8 Flags;
tEDIT_AddKeyEx * pfAddKeyEx; // Handle key input
tEDIT_UpdateBuffer * pfUpdateBuffer; // Update textbuffer
EDIT_PROPS Props;
WM_HTIMER hTimer;
U8 MinMaxMode;
};
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define EDIT_INIT_ID(p) (p->Widget.DebugId = EDIT_ID)
#else
#define EDIT_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
EDIT_Obj * EDIT_LockH(EDIT_Handle h);
#define EDIT_LOCK_H(h) EDIT_LockH(h)
#else
#define EDIT_LOCK_H(h) (EDIT_Obj *)GUI_LOCK_H(h)
#endif
/*********************************************************************
*
* Public data (internal defaults)
*
**********************************************************************
*/
extern EDIT_PROPS EDIT__DefaultProps;
/*********************************************************************
*
* Public functions (internal)
*
**********************************************************************
*/
U16 EDIT__GetCurrentChar (EDIT_Obj * pObj);
void EDIT__SetCursorPos (EDIT_Handle hObj, int CursorPos);
void EDIT__SetValueUnsigned(EDIT_Handle hObj, I32 Value);
#endif // GUI_WINSUPPORT
#endif // EDIT_PRIVATE_H
/*************************** End of file ****************************/

View File

@@ -0,0 +1,274 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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);
/*********************************************************************
*
* Member functions: Set Properties
*
**********************************************************************
*/
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);
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);
/*********************************************************************
*
* Managing default values
*
**********************************************************************
*/
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 ****************************/

View File

@@ -0,0 +1,267 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : FRAMEWIN_Private.h
Purpose : FRAMEWIN private header file
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef FRAMEWIN_PRIVATE_H
#define FRAMEWIN_PRIVATE_H
#include "WM.h"
#include "FRAMEWIN.h"
#include "WIDGET.h"
#include "GUI_HOOK.h"
#if GUI_WINSUPPORT
/******************************************************************
*
* Config defaults
*
*******************************************************************
*/
//
//Support for 3D effects
//
#ifndef FRAMEWIN_CLIENTCOLOR_DEFAULT
#if WIDGET_USE_FLEX_SKIN
#define FRAMEWIN_CLIENTCOLOR_DEFAULT GUI_WHITE
#else
#define FRAMEWIN_CLIENTCOLOR_DEFAULT GUI_GRAY_C0
#endif
#endif
//
// Default for top frame size
//
#ifndef FRAMEWIN_TITLEHEIGHT_DEFAULT
#define FRAMEWIN_TITLEHEIGHT_DEFAULT 0
#endif
//
// Default for left/right/top/bottom frame size
//
#ifndef FRAMEWIN_BORDER_DEFAULT
#define FRAMEWIN_BORDER_DEFAULT 3
#endif
//
// Default for inner frame size
//
#ifndef FRAMEWIN_IBORDER_DEFAULT
#define FRAMEWIN_IBORDER_DEFAULT 1
#endif
//
// Default font
//
#ifndef FRAMEWIN_DEFAULT_FONT
#if WIDGET_USE_FLEX_SKIN
#if WIDGET_USE_SCHEME_SMALL
#define FRAMEWIN_DEFAULT_FONT &GUI_Font13_1
#elif WIDGET_USE_SCHEME_MEDIUM
#define FRAMEWIN_DEFAULT_FONT &GUI_Font16_1
#elif WIDGET_USE_SCHEME_LARGE
#define FRAMEWIN_DEFAULT_FONT &GUI_Font24_1
#endif
#else
#if WIDGET_USE_SCHEME_SMALL
#define FRAMEWIN_DEFAULT_FONT &GUI_Font8_1
#elif WIDGET_USE_SCHEME_MEDIUM
#define FRAMEWIN_DEFAULT_FONT &GUI_Font13_1
#elif WIDGET_USE_SCHEME_LARGE
#define FRAMEWIN_DEFAULT_FONT &GUI_Font16_1
#endif
#endif
#endif
//
// Default bar color when framewin is active
//
#ifndef FRAMEWIN_BARCOLOR_ACTIVE_DEFAULT
#define FRAMEWIN_BARCOLOR_ACTIVE_DEFAULT GUI_BLUE
#endif
//
// Default bar color when framewin is inactive
//
#ifndef FRAMEWIN_BARCOLOR_INACTIVE_DEFAULT
#define FRAMEWIN_BARCOLOR_INACTIVE_DEFAULT GUI_DARKGRAY
#endif
//
// Default frame color
//
#ifndef FRAMEWIN_FRAMECOLOR_DEFAULT
#define FRAMEWIN_FRAMECOLOR_DEFAULT GUI_GRAY_AA
#endif
//
// Default text color when framewin is active
//
#ifndef FRAMEWIN_TEXTCOLOR_INACTIVE_DEFAULT
#if WIDGET_USE_FLEX_SKIN
#define FRAMEWIN_TEXTCOLOR_INACTIVE_DEFAULT GUI_BLACK
#else
#define FRAMEWIN_TEXTCOLOR_INACTIVE_DEFAULT GUI_WHITE
#endif
#endif
//
// Default text color when framewin is inactive
//
#ifndef FRAMEWIN_TEXTCOLOR_ACTIVE_DEFAULT
#if WIDGET_USE_FLEX_SKIN
#define FRAMEWIN_TEXTCOLOR_ACTIVE_DEFAULT GUI_BLACK
#else
#define FRAMEWIN_TEXTCOLOR_ACTIVE_DEFAULT GUI_WHITE
#endif
#endif
//
// Default text alignment
//
#ifndef FRAMEWIN_TEXTALIGN_DEFAULT
#define FRAMEWIN_TEXTALIGN_DEFAULT GUI_TA_LEFT
#endif
/*********************************************************************
*
* Object definition
*
**********************************************************************
*/
typedef struct {
unsigned (* pfGetBordersize)(FRAMEWIN_Handle hObj, unsigned Index);
WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
} FRAMEWIN_SKIN_PRIVATE;
typedef struct {
const GUI_FONT * pFont;
GUI_COLOR aBarColor[2];
GUI_COLOR aTextColor[2];
GUI_COLOR ClientColor;
FRAMEWIN_SKIN_PRIVATE SkinPrivate;
I16 TitleHeight;
I16 BorderSize;
I16 IBorderSize;
I16 TextAlign;
} FRAMEWIN_PROPS;
typedef struct {
WIDGET Widget;
FRAMEWIN_PROPS Props;
WIDGET_SKIN const * pWidgetSkin;
WIDGET_DRAW_ITEM_FUNC * pfDrawItem; // Only for drawing the title bar...
WM_CALLBACK * cb;
WM_HWIN hClient;
WM_HWIN hMenu;
WM_HWIN hText;
GUI_RECT rRestore;
U16 Flags;
WM_HWIN hFocussedChild; // Handle to focussed child .. default none (0)
WM_DIALOG_STATUS * pDialogStatus;
GUI_HOOK * pFirstHook;
} FRAMEWIN_Obj;
typedef struct {
I16 TitleHeight;
I16 MenuHeight;
GUI_RECT rClient;
GUI_RECT rTitleText;
} FRAMEWIN_POSITIONS;
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define FRAMEWIN_INIT_ID(p) (p->Widget.DebugId = FRAMEWIN_ID)
#else
#define FRAMEWIN_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
FRAMEWIN_Obj * FRAMEWIN_LockH(FRAMEWIN_Handle h);
#define FRAMEWIN_LOCK_H(h) FRAMEWIN_LockH(h)
#else
#define FRAMEWIN_LOCK_H(h) (FRAMEWIN_Obj *)GUI_LOCK_H(h)
#endif
/*********************************************************************
*
* Public data (internal defaults)
*
**********************************************************************
*/
extern FRAMEWIN_PROPS FRAMEWIN__DefaultProps;
extern const WIDGET_SKIN FRAMEWIN__SkinClassic;
extern WIDGET_SKIN FRAMEWIN__Skin;
extern const WIDGET_SKIN * FRAMEWIN__pSkinDefault;
/*********************************************************************
*
* Private functions
*
**********************************************************************
*/
void FRAMEWIN__CalcPositions (FRAMEWIN_Handle hObj, FRAMEWIN_POSITIONS * pPos);
int FRAMEWIN__CalcTitleHeight(FRAMEWIN_Obj * pObj);
void FRAMEWIN__UpdatePositions(FRAMEWIN_Handle hObj);
void FRAMEWIN__UpdateButtons (FRAMEWIN_Handle hObj, int OldHeight, int OldBorderSizeL, int OldBorderSizeR, int OldBorderSizeT);
void FRAMEWIN__GetTitleLimits (FRAMEWIN_Handle hObj, int * pxMin, int * pxMax);
unsigned FRAMEWIN__GetBorderSize (FRAMEWIN_Handle hObj, unsigned Index);
#endif // GUI_WINSUPPORT
#endif // FRAMEWIN_PRIVATE_H

View File

@@ -0,0 +1,204 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GRAPH.h
Purpose : GRAPH include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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);
/*********************************************************************
*
* 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 ****************************/

View File

@@ -0,0 +1,170 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GRAPH_Private.h
Purpose : GRAPH private header file
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef GRAPH_PRIVATE_H
#define GRAPH_PRIVATE_H
#include "GRAPH.h"
#include "GUI_ARRAY.h"
#include "WIDGET.h"
#if GUI_WINSUPPORT
/*********************************************************************
*
* Object definition
*
**********************************************************************
*/
typedef struct GRAPH_OBJ GRAPH_OBJ;
typedef struct GRAPH_DATA_OBJ GRAPH_DATA_OBJ;
typedef struct GRAPH_SCALE_OBJ GRAPH_SCALE_OBJ;
typedef struct GRAPH_PAINT_OBJ GRAPH_PAINT_OBJ;
struct GRAPH_PAINT_OBJ {
void (* pfOnPaint) (WM_HMEM hObj, GUI_RECT * pRectInvalid); /* Pointer to paint function */
void (* pfOnDelete) (WM_HMEM hObj); /* Pointer to delete function */
WM_HWIN hGraph; /* Handle of graph widget */
};
typedef struct {
GUI_COLOR TextColor;
const GUI_FONT * pFont;
} GRAPH_SCALE_PROPS;
struct GRAPH_SCALE_OBJ {
GRAPH_PAINT_OBJ PaintObj;
GRAPH_SCALE_PROPS Props;
int Pos;
int TextAlign;
unsigned TickDist;
int Off;
U16 Flags;
float Factor;
int NumDecs;
};
struct GRAPH_DATA_OBJ {
GRAPH_PAINT_OBJ PaintObj;
void (* pfInvalidateNewItem)(GRAPH_DATA_OBJ * pDataObj); /* Pointer to a function which can be used for invalidating the required area */
unsigned NumItems;
unsigned MaxNumItems;
GUI_COLOR Color;
int OffX, OffY;
};
typedef struct {
GUI_COLOR aColor[4];
unsigned GridSpacingX;
unsigned GridSpacingY;
unsigned GridOffX;
unsigned GridOffY;
unsigned BorderL;
unsigned BorderT;
unsigned BorderR;
unsigned BorderB;
} GRAPH_PROPS;
struct GRAPH_OBJ {
WIDGET Widget;
GRAPH_PROPS Props;
GUI_ARRAY GraphArray;
GUI_ARRAY ScaleArray;
U8 ShowGrid;
unsigned RangeX, RangeY;
U16 Flags;
U8 LineStyleV;
U8 LineStyleH;
WM_SCROLL_STATE ScrollStateV;
WM_SCROLL_STATE ScrollStateH;
void (* pUserDraw)(WM_HWIN hObj, int Stage);
};
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define GRAPH_INIT_ID(p) (p->Widget.DebugId = GRAPH_ID)
#else
#define GRAPH_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
GRAPH_OBJ * GRAPH_LockH(GRAPH_Handle h);
#define GRAPH_LOCK_H(h) GRAPH_LockH(h)
#else
#define GRAPH_LOCK_H(h) (GRAPH_OBJ *)GUI_LOCK_H(h)
#endif
/*********************************************************************
*
* Public data (internal defaults)
*
**********************************************************************
*/
extern GRAPH_PROPS GRAPH__DefaultProps;
/*********************************************************************
*
* Private functions
*
**********************************************************************
*/
void GRAPH__AddValue (GRAPH_DATA_OBJ * pDataObj, void * pData, void * pValue, int Size);
void GRAPH__InvalidateGraph(GRAPH_Handle hObj);
#endif /* GUI_WINSUPPORT */
#endif /* GRAPH_PRIVATE_H */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,105 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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 ****************************/

View File

@@ -0,0 +1,157 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GUIDRV_DCache_Private.h
Purpose : Private declarations for GUIDRV_DCache driver
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef GUIDRV_DCACHE_PRIVATE_H
#define GUIDRV_DCACHE_PRIVATE_H
#include "GUIDRV_DCache.h"
#if defined(__cplusplus)
extern "C" { /* Make sure we have C-declarations in C++ programs */
#endif
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
//
// Use unique context identified
//
#define DRIVER_CONTEXT DRIVER_CONTEXT_DCACHE
/*********************************************************************
*
* Types
*
**********************************************************************
*/
/*********************************************************************
*
* DRIVER_CONTEXT
*/
typedef struct {
//
// Data
//
int xSize, ySize; // Display size
int vxSize, vySize; // Virtual display size
int BitsPerPixelDriver;
int BitsPerPixel;
int NumColors;
LCD_PIXELINDEX IndexMask;
U32 MemSize;
GUI_RECT rDirty;
const GUI_DEVICE_API * pMemdev_API;
//
// Cache mamagement
//
void (* pfFlush )(GUI_DEVICE * pDevice);
void (* pfSendCacheRect)(GUI_DEVICE * pDevice, int x0, int y0, int x1, int y1);
//
// Setting the rectangle to be filled up within the real driver
//
void (* pfSetRect )(GUI_DEVICE * pDevice, int x0, int y0, int x1, int y1, int OnOff);
//
// Mode dependent 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 (* 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);
//
// Request information
//
I32 (* pfGetDevProp )(GUI_DEVICE * pDevice, int Index);
//
// Initialization
//
void (* pfInit) (GUI_DEVICE * pDevice);
//
// Conversion array from cache to real display driver
//
LCD_PIXELINDEX * pConvert;
LCD_PIXELINDEX * pIndex;
//
// Cache
//
U8 * pVRAM;
U8 * pVRAM_Lock;
int CacheLocked;
int CacheStat;
int CacheDirty;
//
// The driver which is used for the actual drawing operations
//
GUI_DEVICE * pDriver;
} DRIVER_CONTEXT;
/*********************************************************************
*
* Private interface
*
**********************************************************************
*/
void GUIDRV_DCache__AddDirtyRect (DRIVER_CONTEXT * pContext, int x0, int y0, int x1, int y1);
void GUIDRV_DCache__ClearDirtyRect(DRIVER_CONTEXT * pContext);
void GUIDRV_DCache__InitOnce (GUI_DEVICE * pDevice);
#if defined(__cplusplus)
}
#endif
#endif /* GUIDRV_DCACHE_PRIVATE_H */
/*************************** End of file ****************************/

View File

@@ -0,0 +1,103 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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 ****************************/

View File

@@ -0,0 +1,283 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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 ****************************/

View File

@@ -0,0 +1,260 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GUIDRV_FlexColor_Private.h
Purpose : Private declarations for GUIDRV_FlexColor driver
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#include "GUIDRV_FlexColor.h"
#ifndef GUIDRV_FLEXCOLOR_PRIVATE_H
#define GUIDRV_FLEXCOLOR_PRIVATE_H
#if defined(__cplusplus)
extern "C" { /* Make sure we have C-declarations in C++ programs */
#endif
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define LCD_WRITE_BUFFER_SIZE 500
#define FLEXCOLOR_CF_MANAGE_ORIENTATION (1 << 0)
#define FLEXCOLOR_CF_RAM_ADDR_SET (1 << 1)
#define FLEXCOLOR_CF_SET_CURSOR (1 << 2)
#define FLEXCOLOR_CF_DEFAULT FLEXCOLOR_CF_RAM_ADDR_SET
#define FLEXCOLOR_MAX_NUM_DUMMY_READS 5
#define FLEXCOLOR_NUM_DUMMY_READS 1
#define PUSH_RECT 0
#define POP_RECT 1
//
// Use unique context identified
//
#define DRIVER_CONTEXT DRIVER_CONTEXT_FLEXCOLOR
/*********************************************************************
*
* Types
*
**********************************************************************
*/
typedef struct DRIVER_CONTEXT DRIVER_CONTEXT;
/*********************************************************************
*
* DRIVER_CONTEXT
*/
struct DRIVER_CONTEXT {
//
// Data
//
int xSize, ySize; // Display size
int vxSize, vySize; // Virtual display size
int x0, y0, x1, y1; // Current rectangle
int NumDummyReads; // Number of required dummy reads
U16 RegEntryMode; // Can be used for storing additional configuration bits for 'EntryMode' register which is modified by the driver
U16 Flags;
LCD_PIXELINDEX IndexMask;
int FirstSEG, FirstCOM;
int Orientation;
int BitsPerPixel;
int Shift;
GUI_DEVICE * pDevice;
const GUI_DEVICE_API * pMemdev_API;
//
// Cache
//
void * pVRAM;
int CacheLocked;
int CacheStat;
int xPos, yPos;
U32 Addr;
GUI_RECT CacheRect;
//
// Buffers
//
void * pWriteBuffer;
void * pLineBuffer;
U8 aPair_8 [3 + FLEXCOLOR_MAX_NUM_DUMMY_READS];
U16 aPair_16[3 + FLEXCOLOR_MAX_NUM_DUMMY_READS];
//
// Functions for writing single items (data, cmd) regardless of the interface and getting the status
//
U16 (* pfReadReg) (DRIVER_CONTEXT * _pContext);
void (* pfSetReg) (DRIVER_CONTEXT * _pContext, U16 _Data);
void (* pfWritePara) (DRIVER_CONTEXT * _pContext, U16 _Data);
void (* pfSetInterface)(DRIVER_CONTEXT * _pContext, int _BusWidth);
//
// Setting read mode, required for RA8870
//
void (* pfSetReadMode)(DRIVER_CONTEXT * _pContext, int OnOff, int SetCursor);
//
// Cache related function pointers
//
void (* pfSendCacheRect)(DRIVER_CONTEXT * _pContext, int _x0, int _y0, int _x1, int _y1);
U32 (* pfReadData) (DRIVER_CONTEXT * _pContext);
void (* pfWriteData) (DRIVER_CONTEXT * _pContext, U32 _PixelIndex);
//
// Controller specific routines
//
void (* pfSetRect) (DRIVER_CONTEXT * _pContext, int _x0, int _y0, int _x1, int _y1);
void (* pfSetPhysRAMAddr) (DRIVER_CONTEXT * _pContext, int _x, int _y);
void (* pfSetOrientation) (DRIVER_CONTEXT * _pContext);
U16 (* pfReadPixel_16bpp_B16)(DRIVER_CONTEXT * _pContext);
U16 (* pfReadPixel_16bpp_B8) (DRIVER_CONTEXT * _pContext);
U32 (* pfReadPixel_18bpp_B9) (DRIVER_CONTEXT * _pContext);
U32 (* pfReadPixel_18bpp_B18)(DRIVER_CONTEXT * _pContext);
void (* pfReadRect_16bpp_B16) (GUI_DEVICE * _pDevice, int _x0, int _y0, int _x1, int _y1, U16 * _pBuffer);
void (* pfReadRect_16bpp_B8) (GUI_DEVICE * _pDevice, int _x0, int _y0, int _x1, int _y1, U16 * _pBuffer);
void (* pfReadRect_18bpp_B9) (GUI_DEVICE * _pDevice, int _x0, int _y0, int _x1, int _y1, U32 * _pBuffer);
void (* pfReadRect_18bpp_B18) (GUI_DEVICE * _pDevice, int _x0, int _y0, int _x1, int _y1, U32 * _pBuffer);
//
// Custom read functions
//
U16 (* pfReadPixelCust_16bpp) (int LayerIndex);
U32 (* pfReadPixelCust_18bpp) (int LayerIndex);
void(* pfReadMPixelCust_16bpp)(int LayerIndex, U16 * pBuffer, U32 NumPixels);
void(* pfReadMPixelCust_18bpp)(int LayerIndex, U32 * pBuffer, U32 NumPixels);
//
// Mode dependent 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 (* 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);
int (* pfControlCache )(GUI_DEVICE * _pDevice, int _Cmd);
void (* pfRefresh )(GUI_DEVICE * _pDevice);
//
// Controller dependent function pointers
//
void (* pfReadRect)(void);
//
// Orientation
//
int (* pfLog2PhysX)(DRIVER_CONTEXT * _pContext, int _x, int _y);
int (* pfLog2PhysY)(DRIVER_CONTEXT * _pContext, int _x, int _y);
//
// Function pointer for setting up pfLog2Phys<X,Y>
//
void (* pfSetLog2Phys)(DRIVER_CONTEXT * _pContext);
//
// Hardware routines
//
GUI_PORT_API HW_API;
};
/*********************************************************************
*
* Private functions
*
**********************************************************************
*/
void GUIDRV_FlexColor__InitOnce (GUI_DEVICE * pDevice);
int GUIDRV_FlexColor__ControlCache (GUI_DEVICE * pDevice, int Cmd);
void GUIDRV_FlexColor__Refresh (GUI_DEVICE * pDevice);
void GUIDRV_FlexColor__AddCacheRect (DRIVER_CONTEXT * pContext);
void GUIDRV_FlexColor__ManageRect (DRIVER_CONTEXT * pContext, int Cmd);
void GUIDRV_FlexColor__SetCacheAddr (DRIVER_CONTEXT * pContext, int x, int y);
void GUIDRV_FlexColor__SetCacheRect (DRIVER_CONTEXT * pContext, int x0, int y0, int x1, int y1);
void GUIDRV_FlexColor__SetLog2Phys (DRIVER_CONTEXT * pContext);
void GUIDRV_FlexColor__SetSubRect (DRIVER_CONTEXT * pContext, int x0, int y0, int x1, int y1);
unsigned int GUIDRV_FlexColor__GetPixelIndexCache (GUI_DEVICE * pDevice, int x, int y);
void GUIDRV_FlexColor__SetPixelIndexCache (GUI_DEVICE * pDevice, int x, int y, int PixelIndex);
unsigned int GUIDRV_FlexColor__GetPixelIndexNoCache(GUI_DEVICE * pDevice, int x, int y);
void GUIDRV_FlexColor__SetPixelIndexNoCache(GUI_DEVICE * pDevice, int x, int y, int PixelIndex);
void GUIDRV_FlexColor__SetFunc66712(GUI_DEVICE * pDevice, U16 AndMask_SetAddrRAM);
/*********************************************************************
*
* Simulation (Segger internal use only)
*
**********************************************************************
*/
#if defined(WIN32) && defined(LCD_SIMCONTROLLER)
extern GUI_PORT_API SIM_FlexColor_HW_API;
void SIM_FlexColor_Config (GUI_DEVICE * pDevice, int Orientation, int xSize, int ySize, int FirstSEG, int FirstCOM, int BitsPerPixel, int NumDummyReads);
void SIM_FlexColor_SetBus8 (GUI_DEVICE * pDevice);
void SIM_FlexColor_SetBus9 (GUI_DEVICE * pDevice);
void SIM_FlexColor_SetBus16 (GUI_DEVICE * pDevice);
void SIM_FlexColor_SetBus32 (GUI_DEVICE * pDevice, int Shift);
void SIM_FlexColor_SetFunc66702(GUI_DEVICE * pDevice);
void SIM_FlexColor_SetFunc66708(GUI_DEVICE * pDevice);
void SIM_FlexColor_SetFunc66709(GUI_DEVICE * pDevice);
void SIM_FlexColor_SetFunc66712(GUI_DEVICE * pDevice);
void SIM_FlexColor_SetFunc66714(GUI_DEVICE * pDevice);
void SIM_FlexColor_SetFunc66715(GUI_DEVICE * pDevice);
void SIM_FlexColor_SetFunc66718(GUI_DEVICE * pDevice);
void SIM_FlexColor_SetFunc66719(GUI_DEVICE * pDevice);
void SIM_FlexColor_SetFunc66720(GUI_DEVICE * pDevice);
void SIM_FlexColor_SetFunc66721(GUI_DEVICE * pDevice);
void SIM_FlexColor_SetFunc66722(GUI_DEVICE * pDevice);
void SIM_FlexColor_SetFunc66772(GUI_DEVICE * pDevice);
#endif
#if defined(__cplusplus)
}
#endif
#endif /* GUIDRV_FLEXCOLOR_PRIVATE_H */
/*************************** End of file ****************************/

View File

@@ -0,0 +1,274 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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 ****************************/

View File

@@ -0,0 +1,216 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/*********************************************************************
*
* 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;
}
}
}
}
/*************************** End of file ****************************/

View File

@@ -0,0 +1,299 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/*********************************************************************
*
* Static functions
*
**********************************************************************
*/
/*********************************************************************
*
* _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);
}
}
}
}
/*************************** End of file ****************************/

View File

@@ -0,0 +1,140 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/*********************************************************************
*
* Static functions
*
**********************************************************************
*/
/*********************************************************************
*
* _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);
}
}
}
}
/*************************** End of file ****************************/

View File

@@ -0,0 +1,210 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/*********************************************************************
*
* Static functions
*
**********************************************************************
*/
/*********************************************************************
*
* _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);
}
}
}
}
/*************************** End of file ****************************/

View File

@@ -0,0 +1,767 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GUIDRV_Lin_Private.h
Purpose : Common definitions and common code for all LIN-drivers
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef GUIDRV_LIN_PRIVATE_H
#define GUIDRV_LIN_PRIVATE_H
#include <string.h>
#if defined(__cplusplus)
extern "C" { /* Make sure we have C-declarations in C++ programs */
#endif
/*********************************************************************
*
* Common definitions for all variants of the LIN driver
*
**********************************************************************
*/
#if defined(WIN32)
//
// Simulation prototypes
//
U16 SIM_Lin_ReadMem16 (unsigned int Off);
U32 SIM_Lin_ReadMem32 (unsigned int Off);
U8 SIM_Lin_ReadMem08p (U8 * p);
U32 SIM_Lin_ReadMem32p (U32 * p);
void SIM_Lin_WriteMem16 (unsigned int Off, U16 Data);
void SIM_Lin_WriteMem32 (unsigned int Off, U32 Data);
void SIM_Lin_WriteMem08p(U8 * p, U8 Data);
void SIM_Lin_WriteMem16p(U16 * p, U16 Data);
void SIM_Lin_WriteMem32p(U32 * p, U32 Data);
void SIM_Lin_memcpy (void * pDst, const void * pSrc, int Len);
void SIM_Lin_memset (void * pDst, U8 Value, U32 Len);
void SIM_Lin_SetVRAMAddr(int LayerIndex, void * pVRAM);
void SIM_Lin_SetVRAMSize(int LayerIndex, int vxSize, int vySize, int xSize, int ySize);
void SIM_Lin_CopyBuffer (int IndexSrc, int IndexDst);
void SIM_Lin_ShowBuffer (int Index);
//
// Access macro definition for internal simulation
//
#define LCD_READ_MEM16(VRAMAddr, Off) SIM_Lin_ReadMem16(Off)
#define LCD_READ_MEM32(VRAMAddr, Off) SIM_Lin_ReadMem32(Off)
#define LCD_READ_MEM08P(p) SIM_Lin_ReadMem08p(p)
#define LCD_READ_MEM32P(p) SIM_Lin_ReadMem32p(p)
#define LCD_WRITE_MEM16(VRAMAddr, Off, Data) SIM_Lin_WriteMem16(Off, Data)
#define LCD_WRITE_MEM32(VRAMAddr, Off, Data) SIM_Lin_WriteMem32(Off, Data)
#define LCD_WRITE_MEM08P(p, Data) SIM_Lin_WriteMem08p(p, Data)
#define LCD_WRITE_MEM16P(p, Data) SIM_Lin_WriteMem16p(p, Data)
#define LCD_WRITE_MEM32P(p, Data) SIM_Lin_WriteMem32p(p, Data)
#undef GUI_MEMCPY
#define GUI_MEMCPY(pDst, pSrc, Len) SIM_Lin_memcpy(pDst, pSrc, Len)
#undef GUI_MEMSET
#define GUI_MEMSET(pDst, Value, Len) SIM_Lin_memset(pDst, Value, Len)
#else
//
// Access macro definition for hardware
//
#define LCD_READ_MEM16(VRAMAddr, Off) (*((U16 *)VRAMAddr + (U32)Off))
#define LCD_READ_MEM32(VRAMAddr, Off) (*((U32 *)VRAMAddr + (U32)Off))
#define LCD_READ_MEM08P(p) (*((U8 *)p))
#define LCD_READ_MEM32P(p) (*((U32 *)p))
#define LCD_WRITE_MEM16(VRAMAddr, Off, Data) *((U16 *)VRAMAddr + (U32)Off) = Data
#define LCD_WRITE_MEM32(VRAMAddr, Off, Data) *((U32 *)VRAMAddr + (U32)Off) = Data
#define LCD_WRITE_MEM08P(p, Data) *((U8 *)p) = Data
#define LCD_WRITE_MEM16P(p, Data) *((U16 *)p) = Data
#define LCD_WRITE_MEM32P(p, Data) *((U32 *)p) = Data
#endif
#define WRITE_MEM16(VRAMAddr, Off, Data) LCD_WRITE_MEM16(VRAMAddr, Off, Data)
#define WRITE_MEM32(VRAMAddr, Off, Data) LCD_WRITE_MEM32(VRAMAddr, Off, Data)
#define READ_MEM08P(p) LCD_READ_MEM08P(p)
#define READ_MEM16(VRAMAddr, Off) LCD_READ_MEM16(VRAMAddr, Off)
#define READ_MEM32(VRAMAddr, Off) LCD_READ_MEM32(VRAMAddr, Off)
#define READ_MEM32P(p) LCD_READ_MEM32P(p)
#define WRITE_MEM08P(p, Data) LCD_WRITE_MEM08P(p, Data)
#define WRITE_MEM16P(p, Data) LCD_WRITE_MEM16P(p, Data)
#define WRITE_MEM32P(p, Data) LCD_WRITE_MEM32P(p, Data)
#define OFF2PTR08(VRAMAddr, Off) (U8 *)((U8 *)VRAMAddr + (Off ))
#define OFF2PTR16(VRAMAddr, Off) (U16 *)((U8 *)VRAMAddr + (Off << 1))
#define OFF2PTR32(VRAMAddr, Off) (U32 *)((U8 *)VRAMAddr + (Off << 2))
//
// Use unique context identified
//
#define DRIVER_CONTEXT DRIVER_CONTEXT_LIN
//
// Definition of default members for DRIVER_CONTEXT structure
//
#define DEFAULT_CONTEXT_MEMBERS \
U32 VRAMAddr; \
U32 BaseAddr; \
int BufferIndex; \
int xSize, ySize; \
int vxSize, vySize; \
int vxSizePhys; \
int xPos, yPos; \
int Alpha; \
int IsVisible; \
void (* pfFillRect) (int /* LayerIndex */, \
int /* x0 */, \
int /* y0 */, \
int /* x1 */, \
int /* y1 */, \
U32 /* PixelIndex */); \
void (* pfCopyBuffer)(int /* LayerIndex */, \
int /* IndexSrc */, \
int /* IndexDst */); \
void (* pfDrawBMP1) (int /* LayerIndex */, \
int /* x */, \
int /* y */, \
U8 const * /* p */, \
int /* Diff */, \
int /* xSize */, \
int /* ySize */, \
int /* BytesPerLine */, \
const LCD_PIXELINDEX * /* pTrans */); \
void (* pfDrawBMP8) (int /* LayerIndex */, \
int /* x */, \
int /* y */, \
U8 const * /* p */, \
int /* xSize */, \
int /* ySize */, \
int /* BytesPerLine */, \
const LCD_PIXELINDEX * /* pTrans */); \
void (* pfCopyRect) (int /* LayerIndex */, \
int /* x0 */, \
int /* y0 */, \
int /* x1 */, \
int /* y1 */, \
int /* xSize */, \
int /* ySize */);
#ifndef PRIVATE_CONTEXT_MEMBERS
#define PRIVATE_CONTEXT_MEMBERS
#endif
//
// Definition of default function management for _GetDevFunc()
//
#define DEFAULT_MANAGEMENT_GETDEVFUNC() \
case LCD_DEVFUNC_SET_VRAM_ADDR: \
return (void (*)(void))_SetVRAMAddr; \
case LCD_DEVFUNC_SET_VSIZE: \
return (void (*)(void))_SetVSize; \
case LCD_DEVFUNC_SET_SIZE: \
return (void (*)(void))_SetSize; \
case LCD_DEVFUNC_SETPOS: \
return (void (*)(void))_SetPos; \
case LCD_DEVFUNC_GETPOS: \
return (void (*)(void))_GetPos; \
case LCD_DEVFUNC_SETALPHA: \
return (void (*)(void))_SetAlpha; \
case LCD_DEVFUNC_SETVIS: \
return (void (*)(void))_SetVis; \
case LCD_DEVFUNC_INIT: \
return (void (*)(void))_Init; \
case LCD_DEVFUNC_ON: \
return (void (*)(void))_On; \
case LCD_DEVFUNC_OFF: \
return (void (*)(void))_Off; \
case LCD_DEVFUNC_ALPHAMODE: \
return (void (*)(void))_SetAlphaMode; \
case LCD_DEVFUNC_CHROMAMODE: \
return (void (*)(void))_SetChromaMode; \
case LCD_DEVFUNC_CHROMA: \
return (void (*)(void))_SetChroma; \
case LCD_DEVFUNC_COPYBUFFER: \
return (void (*)(void))_CopyBuffer; \
case LCD_DEVFUNC_SHOWBUFFER: \
return (void (*)(void))_ShowBuffer; \
case LCD_DEVFUNC_SETFUNC: \
return (void (*)(void))_SetDevFunc; \
case LCD_DEVFUNC_FILLRECT: \
return (void (*)(void))((DRIVER_CONTEXT *)(*ppDevice)->u.pContext)->pfFillRect; \
case LCD_DEVFUNC_DRAWBMP_1BPP: \
return (void (*)(void))((DRIVER_CONTEXT *)(*ppDevice)->u.pContext)->pfDrawBMP1; \
case LCD_DEVFUNC_DRAWBMP_8BPP: \
return (void (*)(void))((DRIVER_CONTEXT *)(*ppDevice)->u.pContext)->pfDrawBMP8; \
case LCD_DEVFUNC_COPYRECT: \
return (void (*)(void))((DRIVER_CONTEXT *)(*ppDevice)->u.pContext)->pfCopyRect;
//
// Definition of private function management for _GetDevFunc()
//
#ifndef PRIVATE_MANAGEMENT_GETDEVFUNC
#define PRIVATE_MANAGEMENT_GETDEVFUNC()
#endif
//
// Definition of default function management for _SetDevFunc()
//
#define DEFAULT_MANAGEMENT_SETDEVFUNC() \
case LCD_DEVFUNC_FILLRECT: \
pContext->pfFillRect = (void (*)(int LayerIndex, int x0, int y0, int x1, int y1, U32 PixelIndex))pFunc; \
break; \
case LCD_DEVFUNC_COPYBUFFER: \
pContext->pfCopyBuffer = (void (*)(int LayerIndex, int IndexSrc, int IndexDst))pFunc; \
break; \
case LCD_DEVFUNC_DRAWBMP_1BPP: \
pContext->pfDrawBMP1 = (void (*)(int LayerIndex, int x, int y, U8 const * p, int Diff, int xSize, int ySize, int BytesPerLine, const LCD_PIXELINDEX * pTrans))pFunc; \
break; \
case LCD_DEVFUNC_DRAWBMP_8BPP: \
pContext->pfDrawBMP8 = (void (*)(int LayerIndex, int x, int y, U8 const * p, int xSize, int ySize, int BytesPerLine, const LCD_PIXELINDEX * pTrans))pFunc; \
break; \
case LCD_DEVFUNC_COPYRECT: \
pContext->pfCopyRect = (void (*)(int LayerIndex, int x0, int y0, int x1, int y1, int xSize, int ySize))pFunc; \
break;
//
// Definition of private function management for _GetDevFunc()
//
#ifndef PRIVATE_MANAGEMENT_SETDEVFUNC
#define PRIVATE_MANAGEMENT_SETDEVFUNC()
#endif
//
// Endian related definitions
//
#ifndef LCD_MIRROR
#define LCD_MIRROR 0
#endif
#if (LCD_MIRROR == 2)
#define MIRROR(x) x = ((x & 0x000000ffUL) << 8) \
| ((x & 0x0000ff00UL) >> 8) \
| ((x & 0x00ff0000UL) << 8) \
| ((x & 0xff000000UL) >> 8)
#else
#define MIRROR(x) x = ((x & 0x000000ffUL) << 24) \
| ((x & 0x0000ff00UL) << 8) \
| ((x & 0x00ff0000UL) >> 8) \
| ((x & 0xff000000UL) >> 24)
#endif
/*********************************************************************
*
* Types
*
**********************************************************************
*/
//
// DRIVER_CONTEXT structure consisting of default and private members
//
typedef struct {
DEFAULT_CONTEXT_MEMBERS
PRIVATE_CONTEXT_MEMBERS
} DRIVER_CONTEXT;
/*********************************************************************
*
* Static code (common for all)
*
**********************************************************************
*/
/*********************************************************************
*
* _InitOnce
*
* Purpose:
* Allocates a fixed block for the context of the driver
*
* Return value:
* 0 on success, 1 on error
*/
static int _InitOnce(GUI_DEVICE * pDevice) {
if (pDevice->u.pContext == NULL) {
pDevice->u.pContext = GUI_ALLOC_GetFixedBlock(sizeof(DRIVER_CONTEXT));
GUI__memset((U8 *)pDevice->u.pContext, 0, sizeof(DRIVER_CONTEXT));
}
return pDevice->u.pContext ? 0 : 1;
}
/*********************************************************************
*
* _GetRect
*
* Purpose:
* Returns the display size.
*/
static void _GetRect(GUI_DEVICE * pDevice, LCD_RECT * pRect) {
DRIVER_CONTEXT * pContext;
pContext = (DRIVER_CONTEXT *)pDevice->u.pContext;
pRect->x0 = 0;
pRect->y0 = 0;
pRect->x1 = pContext->vxSize - 1;
pRect->y1 = pContext->vySize - 1;
}
/*********************************************************************
*
* _SetVis
*
* Purpose:
* Sets the visibility of the given layer by sending a LCD_X_SETVIS command to LCD_X_DisplayDriver()
* (Requires special hardware support.)
*/
static void _SetVis(GUI_DEVICE * pDevice, int OnOff) {
DRIVER_CONTEXT * pContext;
LCD_X_SETVIS_INFO Data = {0};
_InitOnce(pDevice);
if (pDevice->u.pContext) {
pContext = (DRIVER_CONTEXT *)pDevice->u.pContext;
pContext->IsVisible = OnOff;
Data.OnOff = OnOff;
LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_SETVIS, (void *)&Data);
}
}
/*********************************************************************
*
* _SetPos
*
* Purpose:
* Sets the position of the given layer by sending a LCD_X_SETPOS command to LCD_X_DisplayDriver()
* (Requires special hardware support.)
*/
static void _SetPos(GUI_DEVICE * pDevice, int xPos, int yPos) {
DRIVER_CONTEXT * pContext;
int xSizeDisplay, ySizeDisplay, xSizeLayer, ySizeLayer, BitsPerPixel;
LCD_X_SETPOS_INFO PosInfo = {0};
_InitOnce(pDevice);
if (pDevice->u.pContext) {
pContext = (DRIVER_CONTEXT *)pDevice->u.pContext;
pContext->xPos = xPos;
pContext->yPos = yPos;
xSizeDisplay = LCD_GetXSizeDisplay();
ySizeDisplay = LCD_GetYSizeDisplay();
xSizeLayer = pContext->xSize;
ySizeLayer = pContext->ySize;
BitsPerPixel = pDevice->pDeviceAPI->pfGetDevProp(pDevice, LCD_DEVCAP_BITSPERPIXEL);
PosInfo.BytesPerPixel = (BitsPerPixel + 7) / 8;
if (xPos < 0) {
PosInfo.Off -= xPos * PosInfo.BytesPerPixel;
PosInfo.xPos = 0;
PosInfo.xLen = xSizeLayer + xPos;
} else {
PosInfo.xPos = xPos;
PosInfo.xLen = xSizeLayer;
if ((PosInfo.xPos + PosInfo.xLen) > xSizeDisplay) {
PosInfo.xLen = xSizeDisplay - xPos;
}
}
if (yPos < 0) {
PosInfo.Off -= yPos * PosInfo.BytesPerPixel * xSizeLayer;
PosInfo.yPos = 0;
PosInfo.yLen = ySizeLayer + yPos;
} else {
PosInfo.yPos = yPos;
PosInfo.yLen = ySizeLayer;
if ((PosInfo.yPos + PosInfo.yLen) > ySizeDisplay) {
PosInfo.yLen = ySizeDisplay - yPos;
}
}
if ((PosInfo.xLen <= 0) || (PosInfo.yLen <= 0) || (PosInfo.xPos >= xSizeDisplay) || (PosInfo.yPos >= ySizeDisplay)) {
if (pContext->IsVisible == 1) {
_SetVis(pDevice, 0);
}
return;
}
if (pContext->IsVisible == 0) {
_SetVis(pDevice, 1);
}
LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_SETPOS, (void *)&PosInfo);
}
}
/*********************************************************************
*
* _GetPos
*
* Purpose:
* Returns the position of the given layer.
*/
static void _GetPos(GUI_DEVICE * pDevice, int * pxPos, int * pyPos) {
DRIVER_CONTEXT * pContext;
_InitOnce(pDevice);
if (pDevice->u.pContext) {
pContext = (DRIVER_CONTEXT *)pDevice->u.pContext;
*pxPos = pContext->xPos;
*pyPos = pContext->yPos;
}
}
/*********************************************************************
*
* _SetAlpha
*
* Purpose:
* Sets the alpha value of the given layer by sending a LCD_X_SETALPHA command to LCD_X_DisplayDriver()
* (Requires special hardware support.)
*/
static void _SetAlpha(GUI_DEVICE * pDevice, int Alpha) {
DRIVER_CONTEXT * pContext;
LCD_X_SETALPHA_INFO Data = {0};
_InitOnce(pDevice);
if (pDevice->u.pContext) {
pContext = (DRIVER_CONTEXT *)pDevice->u.pContext;
pContext->Alpha = Alpha;
Data.Alpha = Alpha;
LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_SETALPHA, (void *)&Data);
}
}
/*********************************************************************
*
* _Init
*
* Purpose:
* Called during the initialization process of emWin.
*/
static int _Init(GUI_DEVICE * pDevice) {
int r;
r = _InitOnce(pDevice);
r |= LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_INITCONTROLLER, NULL);
return r;
}
/*********************************************************************
*
* _On
*
* Purpose:
* Sends a LCD_X_ON command to LCD_X_DisplayDriver().
*/
static void _On (GUI_DEVICE * pDevice) {
LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_ON, NULL);
}
/*********************************************************************
*
* _Off
*
* Purpose:
* Sends a LCD_X_OFF command to LCD_X_DisplayDriver().
*/
static void _Off (GUI_DEVICE * pDevice) {
LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_OFF, NULL);
}
/*********************************************************************
*
* _SetAlphaMode
*
* Purpose:
* Sets the alpha mode of the given layer by sending a LCD_X_SETALPHAMODE command to LCD_X_DisplayDriver()
* (Requires special hardware support.)
*/
static void _SetAlphaMode(GUI_DEVICE * pDevice, int AlphaMode) {
LCD_X_SETALPHAMODE_INFO Data = {0};
Data.AlphaMode = AlphaMode;
LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_SETALPHAMODE, (void *)&Data);
}
/*********************************************************************
*
* _SetChromaMode
*
* Purpose:
* Sets the chroma mode of the given layer by sending a LCD_X_SETCHROMAMODE command to LCD_X_DisplayDriver()
* (Requires special hardware support.)
*/
static void _SetChromaMode(GUI_DEVICE * pDevice, int ChromaMode) {
LCD_X_SETCHROMAMODE_INFO Data = {0};
Data.ChromaMode = ChromaMode;
LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_SETCHROMAMODE, (void *)&Data);
}
/*********************************************************************
*
* _SetChroma
*
* Purpose:
* Sets the chroma values of the given layer by sending a LCD_X_SETCHROMA command to LCD_X_DisplayDriver()
* (Requires special hardware support.)
*/
static void _SetChroma(GUI_DEVICE * pDevice, LCD_COLOR ChromaMin, LCD_COLOR ChromaMax) {
LCD_X_SETCHROMA_INFO Data = {0};
Data.ChromaMin = ChromaMin;
Data.ChromaMax = ChromaMax;
LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_SETCHROMA, (void *)&Data);
}
/*********************************************************************
*
* _CopyBuffer
*
* Purpose:
* Copies the source buffer to the destination buffer and routes
* further drawing operations to the destination buffer.
*
* (Required for using multiple buffers)
*/
static void _CopyBuffer(GUI_DEVICE * pDevice, int IndexSrc, int IndexDst) {
DRIVER_CONTEXT * pContext;
#if (!defined(WIN32))
U32 AddrSrc, AddrDst;
I32 BufferSize;
int BitsPerPixel;
#endif
_InitOnce(pDevice);
if (pDevice->u.pContext) {
pContext = (DRIVER_CONTEXT *)pDevice->u.pContext;
if (IndexSrc != IndexDst) {
#if defined(WIN32)
SIM_Lin_CopyBuffer(IndexSrc, IndexDst);
#else
BitsPerPixel = pDevice->pDeviceAPI->pfGetDevProp(pDevice, LCD_DEVCAP_BITSPERPIXEL);
BufferSize = (((U32)pContext->xSize * pContext->ySize * BitsPerPixel) >> 3);
AddrSrc = pContext->BaseAddr + BufferSize * IndexSrc;
AddrDst = pContext->BaseAddr + BufferSize * IndexDst;
if (pContext->pfCopyBuffer) {
//
// Use custom callback function for copy operation
//
pContext->pfCopyBuffer(pDevice->LayerIndex, IndexSrc, IndexDst);
} else {
//
// Calculate pointers for copy operation
//
GUI_MEMCPY((void *)AddrDst, (void *)AddrSrc, BufferSize);
}
//
// Set destination buffer as target for further drawing operations
//
pContext->VRAMAddr = AddrDst;
#endif
}
}
}
/*********************************************************************
*
* _ShowBuffer
*
* Purpose:
* Sends a LCD_X_SHOWBUFFER command to LCD_X_DisplayDriver() to make the given buffer visible.
*
* (Required for using multiple buffers)
*/
static void _ShowBuffer(GUI_DEVICE * pDevice, int Index) {
LCD_X_SHOWBUFFER_INFO Data = {0};
_InitOnce(pDevice);
if (pDevice->u.pContext) {
#if defined(WIN32)
SIM_Lin_ShowBuffer(Index);
#else
Data.Index = Index;
LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_SHOWBUFFER, (void *)&Data);
#endif
}
}
/*********************************************************************
*
* _SetOrg
*
* Purpose:
* Calls the driver callback function with the display origin to be set
*/
static void _SetOrg(GUI_DEVICE * pDevice, int x, int y) {
#if (!defined(WIN32))
DRIVER_CONTEXT * pContext;
int Orientation;
#endif
LCD_X_SETORG_INFO Data = {0};
#if defined(WIN32)
LCDSIM_SetOrg(x, y, pDevice->LayerIndex);
#else
pContext = (DRIVER_CONTEXT *)pDevice->u.pContext;
Orientation = LCD_GetMirrorXEx(pDevice->LayerIndex) * GUI_MIRROR_X;
Orientation |= LCD_GetMirrorYEx(pDevice->LayerIndex) * GUI_MIRROR_Y;
Orientation |= LCD_GetSwapXYEx (pDevice->LayerIndex) * GUI_SWAP_XY;
switch (Orientation) {
case 0:
Data.xPos = x;
Data.yPos = y;
break;
case GUI_MIRROR_X:
Data.xPos = pContext->vxSize - pContext->xSize - x;
Data.yPos = y;
break;
case GUI_MIRROR_Y:
Data.xPos = x;
Data.yPos = pContext->vySize - pContext->ySize - y;
break;
case GUI_MIRROR_X | GUI_MIRROR_Y:
Data.xPos = pContext->vxSize - pContext->xSize - x;
Data.yPos = pContext->vySize - pContext->ySize - y;
break;
case GUI_SWAP_XY:
Data.xPos = y;
Data.yPos = x;
break;
case GUI_SWAP_XY | GUI_MIRROR_X:
Data.xPos = pContext->vySize - pContext->ySize - y;
Data.yPos = x;
break;
case GUI_SWAP_XY | GUI_MIRROR_Y:
Data.xPos = y;
Data.yPos = pContext->vxSize - pContext->xSize - x;
break;
case GUI_SWAP_XY | GUI_MIRROR_X | GUI_MIRROR_Y:
Data.xPos = pContext->vySize - pContext->ySize - y;
Data.yPos = pContext->vxSize - pContext->xSize - x;
break;
}
LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_SETORG, (void *)&Data);
#endif
}
/*********************************************************************
*
* _SetVRAMAddr
*/
static void _SetVRAMAddr(GUI_DEVICE * pDevice, void * pVRAM) {
DRIVER_CONTEXT * pContext;
LCD_X_SETVRAMADDR_INFO Data = {0};
_InitOnce(pDevice);
if (pDevice->u.pContext) {
pContext = (DRIVER_CONTEXT *)pDevice->u.pContext;
pContext->VRAMAddr = pContext->BaseAddr = (U32)pVRAM;
Data.pVRAM = pVRAM;
LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_SETVRAMADDR, (void *)&Data);
}
#if defined(WIN32)
SIM_Lin_SetVRAMAddr(pDevice->LayerIndex, pVRAM);
#endif
}
/*********************************************************************
*
* _SetVSize
*/
static void _SetVSize(GUI_DEVICE * pDevice, int xSize, int ySize) {
DRIVER_CONTEXT * pContext;
#if defined(WIN32)
int NumBuffers;
#endif
_InitOnce(pDevice);
if (pDevice->u.pContext) {
#if defined(WIN32)
NumBuffers = GUI_MULTIBUF_GetNumBuffers();
#endif
pContext = (DRIVER_CONTEXT *)pDevice->u.pContext;
if (LCD_GetSwapXYEx(pDevice->LayerIndex)) {
#if defined(WIN32)
pContext->vxSize = xSize * NumBuffers;
#else
pContext->vxSize = xSize;
#endif
pContext->vySize = ySize;
pContext->vxSizePhys = ySize;
} else {
pContext->vxSize = xSize;
#if defined(WIN32)
pContext->vySize = ySize * NumBuffers;
#else
pContext->vySize = ySize;
#endif
pContext->vxSizePhys = xSize;
}
}
#if defined(WIN32)
SIM_Lin_SetVRAMSize(pDevice->LayerIndex, pContext->vxSize, pContext->vySize, pContext->xSize, pContext->ySize);
#endif
}
/*********************************************************************
*
* _SetSize
*/
static void _SetSize(GUI_DEVICE * pDevice, int xSize, int ySize) {
DRIVER_CONTEXT * pContext;
LCD_X_SETSIZE_INFO Data = {0};
_InitOnce(pDevice);
if (pDevice->u.pContext) {
pContext = (DRIVER_CONTEXT *)pDevice->u.pContext;
if (pContext->vxSizePhys == 0) {
if (LCD_GetSwapXYEx(pDevice->LayerIndex)) {
pContext->vxSizePhys = ySize;
} else {
pContext->vxSizePhys = xSize;
}
}
pContext->xSize = xSize;
pContext->ySize = ySize;
Data.xSize = xSize;
Data.ySize = ySize;
LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_SETSIZE, (void *)&Data);
}
}
#if defined(__cplusplus)
}
#endif
#endif /* GUIDRV_LIN_PRIVATE_H */
/*************************** End of file ****************************/

View File

@@ -0,0 +1,67 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#include "GUI_Private.h"
#ifndef GUIDRV_NOOPT_1_8_H
#define GUIDRV_NOOPT_1_8_H
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);
#endif
/*************************** End of file ****************************/

View File

@@ -0,0 +1,83 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef GUIDRV_TEMPLATE_H
#define GUIDRV_TEMPLATE_H
/*********************************************************************
*
* 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
#endif
/*************************** End of file ****************************/

View File

@@ -0,0 +1,129 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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 ****************************/

View File

@@ -0,0 +1,216 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GUIDRV_TemplateI_Private.h
Purpose : Interface definition for GUIDRV_TemplateI driver
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#include "GUIDRV_TemplateI.h"
#include "GUIDRV_NoOpt_1_8.h"
#ifndef GUIDRV_TEMPLATE_I_PRIVATE_H
#define GUIDRV_TEMPLATE_I_PRIVATE_H
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define PRIVATE_DEVFUNC_ONINITHOOK 0x1000
//
// Use unique context identified
//
#define DRIVER_CONTEXT DRIVER_CONTEXT_TEMPLATE_I
/*********************************************************************
*
* Types
*
**********************************************************************
*/
typedef struct DRIVER_CONTEXT DRIVER_CONTEXT;
typedef void (* T_ONINITHOOK)(DRIVER_CONTEXT * pContext);
/*********************************************************************
*
* MANAGE_VMEM_API
*/
typedef struct {
//
// TBD: Add private function pointers...
//
int Dummy;
} MANAGE_VMEM_API;
/*********************************************************************
*
* DRIVER_CONTEXT
*/
struct DRIVER_CONTEXT {
//
// Common data
//
int xSize, ySize;
int vxSize, vySize;
//
// Driver specific data
//
//
// Accelerators for calculation
//
int BytesPerLine;
int BitsPerPixel;
//
// VRAM
//
U8 * pVMEM;
//
// Pointer to driver internal initialization routine
//
void (* pfInit) (GUI_DEVICE * pDevice);
void (* pfCheck)(GUI_DEVICE * pDevice);
//
// API-Tables
//
MANAGE_VMEM_API ManageVMEM_API; // Memory management
GUI_PORT_API HW_API; // Hardware routines
};
/*********************************************************************
*
* LOG2PHYS_xxx
*/
#define LOG2PHYS_X ( x )
#define LOG2PHYS_X_OX (pContext->xSize - x - 1)
#define LOG2PHYS_X_OY ( x )
#define LOG2PHYS_X_OXY (pContext->xSize - x - 1)
#define LOG2PHYS_X_OS ( y )
#define LOG2PHYS_X_OSX (pContext->ySize - y - 1)
#define LOG2PHYS_X_OSY ( y )
#define LOG2PHYS_X_OSXY (pContext->ySize - y - 1)
#define LOG2PHYS_Y ( y )
#define LOG2PHYS_Y_OX ( y )
#define LOG2PHYS_Y_OY (pContext->ySize - y - 1)
#define LOG2PHYS_Y_OXY (pContext->ySize - y - 1)
#define LOG2PHYS_Y_OS ( x )
#define LOG2PHYS_Y_OSX ( x )
#define LOG2PHYS_Y_OSY (pContext->xSize - x - 1)
#define LOG2PHYS_Y_OSXY (pContext->xSize - x - 1)
/*********************************************************************
*
* _SetPixelIndex_##EXT
*/
#define DEFINE_SETPIXELINDEX(EXT, X_PHYS, Y_PHYS) \
static void _SetPixelIndex_##EXT(GUI_DEVICE * pDevice, int x, int y, int PixelIndex) { \
DRIVER_CONTEXT * pContext; \
\
pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; \
pContext->xSize = pContext->xSize; /* Keep compiler happy */ \
_SetPixelIndex(pDevice, X_PHYS, Y_PHYS, PixelIndex); \
}
/*********************************************************************
*
* _GetPixelIndex_##EXT
*/
#define DEFINE_GETPIXELINDEX(EXT, X_PHYS, Y_PHYS) \
static unsigned int _GetPixelIndex_##EXT(GUI_DEVICE * pDevice, int x, int y) { \
LCD_PIXELINDEX PixelIndex; \
DRIVER_CONTEXT * pContext; \
\
pContext = (DRIVER_CONTEXT *)pDevice->u.pContext; \
pContext->xSize = pContext->xSize; /* Keep compiler happy */ \
PixelIndex = _GetPixelIndex(pDevice, X_PHYS, Y_PHYS); \
return PixelIndex; \
}
/*********************************************************************
*
* _GetDevProp_##EXT
*/
#define DEFINE_GETDEVPROP(EXT, MX, MY, SWAP) \
static I32 _GetDevProp_##EXT(GUI_DEVICE * pDevice, int Index) { \
switch (Index) { \
case LCD_DEVCAP_MIRROR_X: return MX; \
case LCD_DEVCAP_MIRROR_Y: return MY; \
case LCD_DEVCAP_SWAP_XY: return SWAP; \
} \
return _GetDevProp(pDevice, Index); \
}
/*********************************************************************
*
* DEFINE_FUNCTIONS
*/
#define DEFINE_FUNCTIONS(EXT, X_PHYS, Y_PHYS, MX, MY, SWAP) \
DEFINE_SETPIXELINDEX(EXT, X_PHYS, Y_PHYS) \
DEFINE_GETPIXELINDEX(EXT, X_PHYS, Y_PHYS) \
DEFINE_GETDEVPROP(EXT, MX, MY, SWAP) \
DEFINE_GUI_DEVICE_API(EXT)
/*********************************************************************
*
* Private functions
*
**********************************************************************
*/
void (*GUIDRV__TemplateI_GetDevFunc(GUI_DEVICE ** ppDevice, int Index))(void);
void GUIDRV__TemplateI_SetOrg (GUI_DEVICE * pDevice, int x, int y);
I32 GUIDRV__TemplateI_GetDevProp(GUI_DEVICE * pDevice, int Index);
void GUIDRV__TemplateI_GetRect (GUI_DEVICE * pDevice, LCD_RECT * pRect);
#endif
/*************************** End of file ****************************/

View File

@@ -0,0 +1,80 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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 ****************************/

View File

@@ -0,0 +1,160 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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.
(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 ****************************/

View File

@@ -0,0 +1,90 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef GUI_ARRAY_H
#define GUI_ARRAY_H
#include "WM_Intern.h"
#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 */
#endif /* GUI_ARRAY_H */

View File

@@ -0,0 +1,87 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GUI_ARRAY_Private.h
Purpose : Private array handling routines, should be used only
from within GUI_ARRAY... routines!
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef GUI_ARRAY_PRIVATE_H
#define GUI_ARRAY_PRIVATE_H
#include "GUI_ARRAY.h"
#if GUI_WINSUPPORT
/*********************************************************************
*
* Private types
*
**********************************************************************
*/
typedef struct {
U16 NumItems;
WM_HMEM haHandle; /* Handle to buffer holding handles */
} GUI_ARRAY_OBJ;
/*********************************************************************
*
* Private functions
*
**********************************************************************
*/
WM_HMEM GUI_ARRAY__GethItem (const GUI_ARRAY_OBJ * pThis, unsigned int Index);
void * GUI_ARRAY__GetpItem (const GUI_ARRAY_OBJ * pThis, unsigned int Index);
void * GUI_ARRAY__GetpItemLocked(const GUI_ARRAY_OBJ * pThis, unsigned int Index);
int GUI_ARRAY__SethItem ( GUI_ARRAY_OBJ * pThis, unsigned int Index, WM_HMEM hItem);
#endif /* GUI_WINSUPPORT */
#endif /* GUI_ARRAY_PRIVATE_H */

View File

@@ -0,0 +1,124 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GUI_BMP_Private.h
Purpose : Private header file for GUI_BMP... functions
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef GUI_BMP_PRIVATE_H
#define GUI_BMP_PRIVATE_H
#include "GUI_Private.h"
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define BI_RGB 0
#define BI_RLE8 1
#define BI_RLE4 2
#define BI_BITFIELDS 3
/*********************************************************************
*
* Types
*
**********************************************************************
*/
//
// Default parameter structure for reading data from memory
//
typedef struct {
const U8 * pFileData;
} GUI_BMP_PARAM;
//
// Context structure for getting stdio input
//
typedef struct {
GUI_GET_DATA_FUNC * pfGetData; // Function pointer
U32 Off; // Data pointer
void * pParam; // Parameter pointer passed to function
} GUI_BMP_CONTEXT;
//
// Parameter structure for passing several required variables to the
// functions _DrawLine_RGB() and _DrawLine_ARGB() (in GUI_BMP_EnableAlpha.c).
//
typedef struct {
const U8 * pSrc; // Pointer to data
I32 xSrc; // Used to read data
int ySrc; // Used to read data
I32 xSize;
U32 BytesPerPixel;
tLCDDEV_Color2Index * pfColor2Index;
tLCDDEV_Index2Color * pfIndex2Color; // Used to manage bitfield conversion
LCD_API_NEXT_PIXEL * pNextPixel_API;
int x0; // Used to draw data
int y0; // Used to draw data
int x1; // Used to draw data
int y1; // Used to draw data
} GUI_DRAWLINE_INFO;
/*********************************************************************
*
* Interface
*
**********************************************************************
*/
int GUI_BMP__GetData (void * p, const U8 ** ppData, unsigned NumBytesReq, U32 Off);
int GUI_BMP__Init (GUI_BMP_CONTEXT * pContext, I32 * pWidth, I32 * pHeight, U16 * pBitCount, int * pNumColors, int * pCompression);
int GUI_BMP__ReadData (GUI_BMP_CONTEXT * pContext, int NumBytes, const U8 ** ppData, unsigned StartOfFile);
int GUI_BMP__ReadPalette(GUI_BMP_CONTEXT * pContext, int NumColors);
#endif /* GUI_BMP_PRIVATE_H */
/*************************** End of file ****************************/

View File

@@ -0,0 +1,197 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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 !
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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
*
***********************************************************************
*/
/* ATTENTION: This define swaps the meaning of a logical color from
ABGR to ARGB.
It further swaps the meaning of a transparent pixel:
ABGR: 0x00 means opaque, 0xFF means transparent (default)
ARGB: 0x00 means transparent, 0xFF means opaque
*/
//#ifndef GUI_USE_ARGB
// #define GUI_USE_ARGB 1
//#endif
/* 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
/* Optional custom drawing of memory devices */
#ifndef GUI_MEMDEV_SUPPORT_CUSTOMDRAW
#define GUI_MEMDEV_SUPPORT_CUSTOMDRAW 1
#endif
/* Clip static memory devices to parent borders */
#ifndef GUI_MEMDEV_CLIP_AT_PARENT
#define GUI_MEMDEV_CLIP_AT_PARENT 0
#endif
#endif /* ifdef GUI_CONFDEFAULTS_H */
/*************************** End of file ****************************/

View File

@@ -0,0 +1,210 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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.
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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 ****************************/

View File

@@ -0,0 +1,97 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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 !
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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_FontF8x13_ASCII_Prop1;
extern GUI_CONST_STORAGE GUI_FONT_PROP GUI_FontF8x15B_ASCII_Prop1;
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_Font13ASCII_Prop1;
extern GUI_CONST_STORAGE GUI_FONT_PROP GUI_Font13B_ASCII_Prop1;
extern GUI_CONST_STORAGE GUI_FONT_PROP GUI_Font13H_ASCII_Prop1;
extern GUI_CONST_STORAGE GUI_FONT_PROP GUI_Font13HB_ASCII_Prop1;
extern GUI_CONST_STORAGE GUI_FONT_PROP GUI_Font16_1_FontProp1;
extern GUI_CONST_STORAGE GUI_FONT_PROP GUI_Font16ASCIIProp1;
extern GUI_CONST_STORAGE GUI_FONT_PROP GUI_Font16B_ASCII_Prop1;
extern GUI_CONST_STORAGE GUI_FONT_PROP GUI_Font20_ASCII_Prop1;
extern GUI_CONST_STORAGE GUI_FONT_PROP GUI_Font20B_ASCII_Prop1;
extern GUI_CONST_STORAGE GUI_FONT_PROP GUI_Font24_ASCII_Prop1;
extern GUI_CONST_STORAGE GUI_FONT_PROP GUI_Font24B_ASCII_Prop1;
extern GUI_CONST_STORAGE GUI_FONT_PROP GUI_Font32_ASCII_Prop1;
extern GUI_CONST_STORAGE GUI_FONT_PROP GUI_Font32B_ASCII_Prop1;
extern GUI_CONST_STORAGE GUI_FONT_PROP GUI_FontComic18B_ASCII_Prop1;
extern GUI_CONST_STORAGE GUI_FONT_PROP GUI_FontComic24B_ASCII_Prop1;
extern GUI_CONST_STORAGE GUI_CHARINFO GUI_Font16_HK_CharInfo[169];
#if defined(__cplusplus)
}
#endif
#endif /* Guard against multiple inclusion */
/*************************** End of file ****************************/

View File

@@ -0,0 +1,143 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GUI_GIF_Private.h
Purpose : Private header file for GUI_GIF... functions
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef GUI_GIF_PRIVATE_H
#define GUI_GIF_PRIVATE_H
#include "GUI_Private.h"
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define MAX_NUM_LWZ_BITS 12
/*********************************************************************
*
* Types
*
**********************************************************************
*/
/* Context structure */
typedef struct {
/* Required for getting input */
unsigned NumBytesInBuffer; /* Remaining bytes in buffer */
const U8 * pBuffer; /* Pointer into buffer for reading data */
GUI_GET_DATA_FUNC * pfGetData; /* Function pointer */
void * pParam; /* Parameter pointer passed to function */
U32 Off; /* Data pointer */
/* Decompression data */
U8 aBuffer[258]; /* Input buffer for data block */
short aCode [(1 << MAX_NUM_LWZ_BITS)]; /* This array stores the LZW codes for the compressed strings */
U8 aPrefix[(1 << MAX_NUM_LWZ_BITS)]; /* Prefix character of the LZW code. */
U8 aDecompBuffer[3000]; /* Decompression buffer. The higher the compression, the more bytes are needed in the buffer. */
U8 * sp; /* Pointer into the decompression buffer */
int CurBit;
int LastBit;
int GetDone;
int LastByte;
int ReturnClear;
int CodeSize;
int SetCodeSize;
int MaxCode;
int MaxCodeSize;
int ClearCode;
int EndCode;
int FirstCode;
int OldCode;
/* Palette buffer */
GUI_COLOR aColorTable[256];
} GUI_GIF_CONTEXT;
typedef struct {
int XPos;
int YPos;
int XSize;
int YSize;
int Flags;
int NumColors;
} IMAGE_DESCRIPTOR;
/* Default parameter structure for reading data from memory */
typedef struct {
const U8 * pFileData;
U32 FileSize;
} GUI_GIF_PARAM;
typedef int DRAW_FROM_DATABLOCK(GUI_GIF_CONTEXT * pContext, IMAGE_DESCRIPTOR * pDescriptor, int x0, int y0, int Transparency, int Disposal, int Num, int Denom);
typedef void CLEAR_UNUSED_PIXELS(int x0, int y0, IMAGE_DESCRIPTOR * pDescriptor, GUI_GIF_IMAGE_INFO * pInfo, int Num, int Denom);
/*********************************************************************
*
* Private data
*
**********************************************************************
*/
extern const int GUI_GIF__aInterlaceOffset[4];
extern const int GUI_GIF__aInterlaceYPos[4];
/*********************************************************************
*
* Interface
*
**********************************************************************
*/
int GUI_GIF__ReadData(GUI_GIF_CONTEXT * pContext, unsigned NumBytes, const U8 ** ppData, unsigned StartOfFile);
int GUI_GIF__GetData(void * p, const U8 ** ppData, unsigned NumBytesReq, U32 Off);
int GUI_GIF__DrawFromFilePointer(GUI_GIF_CONTEXT * pContext, int x0, int y0, int Index, int Num, int Denom, DRAW_FROM_DATABLOCK pfDrawFromDataBlock, CLEAR_UNUSED_PIXELS pfClearUnusedPixels);
void GUI_GIF__InitLZW(GUI_GIF_CONTEXT * pContext, int InputCodeSize);
int GUI_GIF__GetNextByte(GUI_GIF_CONTEXT * pContext);
#endif /* GUI_GIF_PRIVATE_H */

View File

@@ -0,0 +1,96 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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 ****************************/

View File

@@ -0,0 +1,294 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GUI_JPEG_Private.h
Purpose : Private header
----------------------------------------------------------------------
Explanation of terms:
Component - Color channel, e.g., Red or Luminance.
Sample - Single component value (i.e., one number in the image data).
Coefficient - Frequency coefficient (a DCT transform output number).
Block - 8x8 group of samples or coefficients.
MCU - (Minimum Coded Unit) is an interleaved set of blocks of size
determined by the sampling factors, or a single block in a
noninterleaved scan.
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef GUI_JPEG_PRIVATE_H
#define GUI_JPEG_PRIVATE_H
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define JPEG_LOCK_H(h) (GUI_JPEG_DCONTEXT *)GUI_LOCK_H(h)
/*********************************************************************
*
* Scan types
*/
#define GRAYSCALE 0
#define YH1V1 1
#define YH2V1 2
#define YH1V2 3
#define YH2V2 4
/*********************************************************************
*
* Maximum number of...
*/
#define MAX_COMPONENTS 4
#define MAX_HUFFTABLES 8
#define MAX_QUANTTABLES 4
#define MAX_COMPSINSCAN 4
#define MAX_BLOCKSPERMCU 10
/*********************************************************************
*
* Marker definitions
*/
#define M_SOF0 0xc0 /* Start Of Frame */
#define M_SOF1 0xc1
#define M_SOF2 0xc2
#define M_SOF3 0xc3
#define M_SOF5 0xc5
#define M_SOF6 0xc6
#define M_SOF7 0xc7
#define M_JPG 0xc8
#define M_SOF9 0xc9
#define M_SOF10 0xca
#define M_SOF11 0xcb
#define M_SOF13 0xcd
#define M_SOF14 0xce
#define M_SOF15 0xcf
#define M_DHT 0xc4 /* Define Huffman Table */
#define M_DAC 0xcc /* Define Arithmetic Coding Table */
#define M_RST0 0xd0
#define M_RST1 0xd1
#define M_RST2 0xd2
#define M_RST3 0xd3
#define M_RST4 0xd4
#define M_RST5 0xd5
#define M_RST6 0xd6
#define M_RST7 0xd7
#define M_SOI 0xd8 /* Start Of Image */
#define M_EOI 0xd9
#define M_SOS 0xda /* Start Of Scan */
#define M_DQT 0xdb /* Define Quantisation Table */
#define M_DRI 0xdd /* Define Restart Interval */
#define M_APP0 0xe0 /* Application Usage */
#define M_APP14 0xee /* Adobe marker */
#define M_TEM 0x01
#define ADOBE_TRANSFORM_RGB 0
#define ADOBE_TRANSFORM_YCBCR 1
/*********************************************************************
*
* Types
*
**********************************************************************
*/
/* Default parameter structure for reading data from memory */
typedef struct {
const U8 * pFileData;
I32 FileSize;
} GUI_JPEG_PARAM;
/* Huffman table definition */
typedef struct {
unsigned aLookUp[256];
U8 aCodeSize[256];
unsigned aTree[512];
} HUFF_TABLE;
/* Coefficient buffer used for progressive JPEGs */
typedef struct {
int NumBlocksX;
int NumBlocksY;
unsigned BlockSize;
GUI_HMEM hData;
} COEFF_BUFFER;
typedef struct GUI_JPEG_DCONTEXT GUI_JPEG_DCONTEXT;
struct GUI_JPEG_DCONTEXT {
/* Function pointer for drawing one line of completely decoded pixels */
void (* pfWritePixels)(int x0, int y0, GUI_JPEG_DCONTEXT * pContext, GUI_COLOR (* pfGetColor)(const U8 ** ppData, unsigned SkipCnt), tLCDDEV_Color2Index * pfColor2Index);
/* Function pointer for reading one byte */
int (* pfGetU8)(GUI_JPEG_DCONTEXT * pContext, U8 * pByte);
GUI_GET_DATA_FUNC * pfGetData; /* 'GetData' Function pointer */
void * pParam; /* Pointer passed to 'GetData' function */
U32 Off; /* Data pointer */
/* Image size */
U16 xSize;
U16 ySize;
/* Input buffer */
const U8 * pBuffer;
unsigned NumBytesInBuffer;
U8 StartOfFile;
U8 aStuff[4]; /* Stuff back buffer */
U8 NumBytesStuffed; /* Number of stuffed bytes */
/* Bit buffer */
U32 BitBuffer;
int NumBitsLeft;
/* Huffman tables */
U8 aHuffNumTableAvail[MAX_HUFFTABLES];
U8 aaHuffNum[MAX_HUFFTABLES][17]; /* Pointer to number of Huffman codes per bit size */
U8 aaHuffVal[MAX_HUFFTABLES][256]; /* Pointer to Huffman codes */
HUFF_TABLE aHuffTable[MAX_HUFFTABLES];
HUFF_TABLE * apDC_Huff[MAX_BLOCKSPERMCU];
HUFF_TABLE * apAC_Huff[MAX_BLOCKSPERMCU];
/* Quantization tables */
U16 aaQuantTbl[MAX_QUANTTABLES][64];
U16 * apQuantTbl[MAX_QUANTTABLES];
/* Component information */
U8 NumCompsPerFrame; /* Number of components per frame */
U8 aCompHSamp[MAX_COMPONENTS]; /* Component's horizontal sampling factor */
U8 aCompVSamp[MAX_COMPONENTS]; /* Component's vertical sampling factor */
U8 aCompQuant[MAX_COMPONENTS]; /* Component's quantization table selector */
U8 aCompId [MAX_COMPONENTS]; /* Component's ID */
U8 NumCompsPerScan; /* Number of components per scan */
U8 aCompList[MAX_COMPSINSCAN]; /* Components in this scan */
U8 aCompDC_Tab[MAX_COMPONENTS]; /* Component's DC Huffman coding table selector */
U8 aCompAC_Tab[MAX_COMPONENTS]; /* Component's AC Huffman coding table selector */
unsigned * apComponent[MAX_BLOCKSPERMCU]; /* Points into the table aLastDC_Val[] */
unsigned aLastDC_Val[MAX_COMPONENTS]; /* Table of last DC values */
/* Data used for progressive scans */
U8 SpectralStart; /* Spectral selection start */
U8 SpectralEnd; /* Spectral selection end */
U8 SuccessiveLow; /* Successive approximation low */
U8 SuccessiveHigh; /* Successive approximation high */
COEFF_BUFFER aDC_Coeffs[MAX_COMPONENTS]; /* DC coefficient buffer for progressive scan */
COEFF_BUFFER aAC_Coeffs[MAX_COMPONENTS]; /* AC coefficient buffer for progressive scan */
int aBlockY_MCU[MAX_COMPONENTS]; /* */
GUI_HMEM hBmpLine;
/* Common */
U8 TransformationRequired;
U8 IsProgressive; /* Flag is set to 1 if JPEG is progressive */
U8 ScanType; /* Gray, Yh1v1, Yh1v2, Yh2v1, Yh2v2 */
int MaxMCUsPerRow; /* Maximum number of MCUs per row */
int MaxMCUsPerCol; /* Maximum number of MCUs per column */
int MaxBlocksPerMCU; /* Maximum number of blocks per MCU */
int MaxBlocksPerRow; /* Maximum number of blocks per row */
int MaxMCU_xSize; /* MCU's max. X size in pixels */
int MaxMCU_ySize; /* MCU's max. Y size in pixels */
int DestBytesPerPixel; /* 4 (RGB) or 1 (Y) */
int DestBytesPerScanline; /* Rounded up */
int RealDestBytesPerScanline; /* Actual bytes */
int EOB_Run; /* 'End Of Band' run */
int RestartInterval;
int RestartsLeft;
int NextRestartNum;
int MCUsPerRow;
int MCUsPerCol;
int NumBlocksPerMCU;
int aMCU_Org[MAX_BLOCKSPERMCU];
/* Block buffer */
GUI_HMEM hBlocks;
GUI_HMEM hBlockMaxZagSet;
/* Sample buffer */
GUI_HMEM hSampleBuf;
U8 * pSampleBuf;
/* Status */
int TotalLinesLeft; /* Total number of lines left in image */
int MCULinesLeft; /* Total number of lines left in current MCU */
/* Output buffer(s) */
GUI_HMEM hScanLine0; /* Buffer 0 */
GUI_HMEM hScanLine1; /* Buffer 1, only used for V2 sampling factors */
U8 BufferIndex;
/* Arrays used for converting YCbCr to RGB */
int aCRR[256];
int aCBB[256];
I32 aCRG[256];
I32 aCBG[256];
/* Banding */
U8 BandingRequired; /* Flag if banding is required */
unsigned NumBands; /* Number of required bands for drawing the complete frame */
int NumBlocksPerBand; /* Number of vertical blocks per band */
int FirstBlockOfBand;
int aFirstBlockOfBand[MAX_COMPONENTS];
int bpp;
};
/*********************************************************************
*
* Private interface
*
**********************************************************************
*/
int GUI_JPEG__AllocBandingCoeffBuffer (GUI_HMEM hContext);
int GUI_JPEG__DecodeLine (GUI_JPEG_DCONTEXT * pContext);
int GUI_JPEG__DecodeProgressiveBanding(GUI_JPEG_DCONTEXT * pContext);
void GUI_JPEG__Free (GUI_JPEG_DCONTEXT * pContext);
GUI_COLOR GUI_JPEG__GetColorGray (const U8 ** ppData, unsigned SkipCnt);
GUI_COLOR GUI_JPEG__GetColorRGB (const U8 ** ppData, unsigned SkipCnt);
int GUI_JPEG__GetData (void * p, const U8 ** ppData, unsigned NumBytesReq, U32 Off);
int GUI_JPEG__InitDraw (GUI_HMEM hContext);
int GUI_JPEG__ReadUntilSOF (GUI_HMEM hContext);
void GUI_JPEG__SetNextBand (GUI_JPEG_DCONTEXT * pContext);
int GUI_JPEG__SkipLine (GUI_JPEG_DCONTEXT * pContext);
int GUI_JPEG__GetInfoEx (GUI_HMEM hContext, GUI_JPEG_INFO * pInfo);
#endif

View File

@@ -0,0 +1,694 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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__AlphaPreserveTrans(int OnOff);
extern unsigned GUI_MEMDEV__TimePerFrame;
#define GUI_TIME_PER_FRAME (GUI_TIMER_TIME)GUI_MEMDEV__TimePerFrame
#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 GL_FillEllipseAA_HiRes(int x0, int y0, int rx, int ry);
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 */
#define GUI_ALPHABLENDING_DONE (1 << 0)
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 */
#define GUI_STREAM_FORMAT_A555 25 /* DO NOT CHANGE */
#define GUI_STREAM_FORMAT_AM555 26 /* DO NOT CHANGE */
#define GUI_STREAM_FORMAT_A565 27 /* DO NOT CHANGE */
#define GUI_STREAM_FORMAT_AM565 28 /* DO NOT CHANGE */
#define GUI_STREAM_FORMAT_M8888I 29 /* 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);
//
// API list to be used for MultiBuffering
//
extern const GUI_MULTIBUF_API GUI_MULTIBUF_APIList;
extern const GUI_MULTIBUF_API_EX GUI_MULTIBUF_APIListEx;
#ifdef GL_CORE_C
#define GUI_EXTERN
#else
#define GUI_EXTERN extern
#endif
GUI_EXTERN int (* GUI_pfUpdateSoftLayer)(void);
#ifdef WIN32
GUI_EXTERN void (* GUI_pfSoftlayerGetPixel)(int x, int y, void * p);
#endif
GUI_EXTERN void (* GUI_pfHookMTOUCH)(const GUI_MTOUCH_STATE * pState);
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
GUI_EXTERN U8 GUI__PreserveTrans;
GUI_EXTERN U8 GUI__IsInitialized;
#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 ****************************/

View File

@@ -0,0 +1,110 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GUI_SIM_Win32.h
Purpose : Declares public functions of Simulation
----------------------------------------------------------------------
*/
#ifndef SIM_GUI_H
#define SIM_GUI_H
#include <windows.h>
#if defined(__cplusplus)
extern "C" { /* Make sure we have C-declarations in C++ programs */
#endif
/********************************************************************
*
* Data
*
*********************************************************************
*/
extern HINSTANCE SIM_GUI_hInst;
extern HWND SIM_GUI_hWndMain;
/********************************************************************
*
* Types
*
*********************************************************************
*/
typedef struct {
HWND hWndMain;
HWND ahWndLCD[16];
HWND ahWndColor[16];
} SIM_GUI_INFO;
typedef int SIM_GUI_tfHook (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, int * pResult);
typedef void SIM_GUI_tfDelayHandler (int ms);
typedef void SIM_GUI_tfExecIdleHandler(void);
/********************************************************************
*
* Interface
*
*********************************************************************
*/
void SIM_GUI_ShowDevice (int OnOff);
void SIM_GUI_SetCallback (int (* pfCallback)(SIM_GUI_INFO * pInfo));
void SIM_GUI_HandleKeyEvents (unsigned Msg, WPARAM wParam);
HWND SIM_GUI_CreateCompositeWindow(HWND hParent, int x, int y, int xSize, int ySize, int DisplayIndex);
HWND SIM_GUI_CreateLCDWindow (HWND hParent, int x, int y, int xSize, int ySize, int LayerIndex);
HWND SIM_GUI_CreateLOGWindow (HWND hParent, int x, int y, int xSize, int ySize);
HWND SIM_GUI_CreateLCDInfoWindow (HWND hParent, int x, int y, int xSize, int ySize, int LayerIndex);
void SIM_GUI_Enable (void);
int SIM_GUI_Init (HINSTANCE hInst, HWND hWndMain, char * pCmdLine, const char * sAppName);
void SIM_GUI_CopyToClipboard (int LayerIndex);
void SIM_GUI_SetLCDWindowHook (SIM_GUI_tfHook * pfHook);
void SIM_GUI_SetDelayHandler (SIM_GUI_tfDelayHandler * pfHandler);
void SIM_GUI_SetExecIdleHandler (SIM_GUI_tfExecIdleHandler * pfHandler);
void SIM_GUI_GetCompositeSize (int * pxSize, int * pySize);
int SIM_GUI_GetTransColor (void);
void SIM_GUI_GetLCDPos (int * px, int * py);
void SIM_GUI_Exit (void);
void SIM_GUI_SetMessageBoxOnError (int OnOff);
int SIM_GUI_App (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow);
void SIM_GUI_SetPixel (int x, int y, unsigned Color);
void SIM_GUI_LOG_Time (void);
void __cdecl SIM_GUI_LOG_Add (const char *format ,... );
void SIM_GUI_LOG_AddRed(void);
void SIM_GUI_LOG_Clear (void);
void LCDSIM_Paint (HWND hWnd);
void LCDSIM_PaintComposite(HWND hWnd);
void LCDSIM_SetTransMode (int LayerIndex, int TransMode);
void LCDSIM_SetChroma (int LayerIndex, unsigned long ChromaMin, unsigned long ChromaMax);
#if defined(__cplusplus)
}
#endif
#endif /* SIM_GUI_H */

View File

@@ -0,0 +1,87 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GUI_SPRITE_Private.h
Purpose : Private header file for sprites
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef GUI_SPRITE_PRIVATE_H
#define GUI_SPRITE_PRIVATE_H
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define SPRITE_LOCK_H(h) (GUI_SPRITE_OBJ *)GUI_LOCK_H(h)
/*********************************************************************
*
* Types
*
**********************************************************************
*/
//
// The sprite object
//
typedef struct {
GUI_DEVICE * pDevice;
GUI_RECT Rect;
GUI_HMEM hColors;
U16 Flags;
const GUI_BITMAP * pBM;
void (* pCB)(GUI_HSPRITE hSprite, int Cmd); // Callback routine for animated sprites
GUI_HMEM hContext;
} GUI_SPRITE_OBJ;
#endif // GUI_SPRITE_PRIVATE_H
/*************************** End of file ****************************/

View File

@@ -0,0 +1,104 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef GUI_SETORIENTATION_H
#define GUI_SETORIENTATION_H
#include "GUI_Private.h"
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
//
// Use unique context identified
//
#define DRIVER_CONTEXT DRIVER_CONTEXT_ORIENTATION
/*********************************************************************
*
* 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);
#endif /* GUI_SETORIENTATION_H */
/*************************** End of file ****************************/

View File

@@ -0,0 +1,623 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#include "GUI_SetOrientation.h"
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define XY2PTR(x, y) (PIXEL *)(pContext->pData + y * pContext->BytesPerLine + x * pContext->pDrawingAPI->BytesPerPixel)
/*********************************************************************
*
* 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
};
/*************************** End of file ****************************/

View File

@@ -0,0 +1,691 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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 !
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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;
};
typedef struct {
void (* cbBegin)(void);
void (* cbEnd) (void);
} GUI_MULTIBUF_API;
typedef struct {
void (* cbBeginEx)(int LayerIndex);
void (* cbEndEx) (int LayerIndex);
} GUI_MULTIBUF_API_EX;
/*********************************************************************
*
* FONT structures
*/
/* Translation list. Translates a character code into up to 2
indices of images to display on top of each other;
'<27>' -> index('a'), index('<27>') */
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_ENC_APIList_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_ENC_APIList_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;
//
// Used for emWinSPY with reduced data types and array sizes
//
typedef struct {
U8 Layer;
U8 NumPoints;
I16 ax[5];
I16 ay[5];
U16 aId[5];
U8 aFlags[5];
} GUI_MTOUCH_STATE;
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;
/*********************************************************************
*
* Send/Receive function for VNC and/or emWinSPY
*/
typedef int (* GUI_tSend) (const U8 * pData, int len, void * p);
typedef int (* GUI_tRecv) ( U8 * pData, int len, void * p);
/*********************************************************************
*
* Memory allocation replacement for emWinSPY
*/
typedef void * (* GUI_tMalloc)(unsigned int);
typedef void (* GUI_tFree) (void *);
#endif /* GUITYPE_H_INCLUDED */
/*************************** End of file ****************************/

View File

@@ -0,0 +1,156 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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 !
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef GUI_VNC_H
#define GUI_VNC_H
#include "GUI_Private.h"
#include "GUI_Type.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 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_tRecv 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_tRecv 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 ****************************/

View File

@@ -0,0 +1,61 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef GUI_VERSION_H
#define GUI_VERSION_H
#define GUI_VERSION 53202
#endif /* Avoid multiple inclusion */
/*************************** End of file ****************************/

View File

@@ -0,0 +1,84 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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 ****************************/

View File

@@ -0,0 +1,206 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : HEADER.h
Purpose : HEADER include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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);
/*********************************************************************
*
* Managing default values
*
**********************************************************************
*/
/* 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 ****************************/

View File

@@ -0,0 +1,145 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : HEADER_Private.h
Purpose : Private HEADER include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef HEADER_PRIVATE_H
#define HEADER_PRIVATE_H
#include "HEADER.h"
#include "WIDGET.h"
#include "WM.h"
#include "GUI_ARRAY.h"
#if GUI_WINSUPPORT
/*********************************************************************
*
* Object definition
*
**********************************************************************
*/
typedef struct {
int Width;
I16 Align;
WM_HMEM hDrawObj;
char acText[1];
} HEADER_COLUMN;
typedef struct {
WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
} HEADER_SKIN_PRIVATE;
typedef struct {
const GUI_FONT * pFont;
GUI_COLOR BkColor;
GUI_COLOR TextColor;
GUI_COLOR ArrowColor;
HEADER_SKIN_PRIVATE SkinPrivate;
} HEADER_PROPS;
typedef struct {
WIDGET Widget;
HEADER_PROPS Props;
WIDGET_SKIN const * pWidgetSkin;
GUI_ARRAY Columns;
int CapturePosX;
int CaptureItem;
int ScrollPos;
int Sel;
int DirIndicatorColumn;
int DirIndicatorReverse;
unsigned Fixed;
U8 DragLimit;
} HEADER_Obj;
/*********************************************************************
*
* Private (module internal) data
*
**********************************************************************
*/
extern HEADER_PROPS HEADER__DefaultProps;
extern const GUI_CURSOR * HEADER__pDefaultCursor;
extern int HEADER__DefaultBorderH;
extern int HEADER__DefaultBorderV;
extern const WIDGET_SKIN HEADER__SkinClassic;
extern WIDGET_SKIN HEADER__Skin;
extern WIDGET_SKIN const * HEADER__pSkinDefault;
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define HEADER_INIT_ID(p) (p->Widget.DebugId = HEADER_ID)
#else
#define HEADER_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
HEADER_Obj * HEADER_LockH(HEADER_Handle h);
#define HEADER_LOCK_H(h) HEADER_LockH(h)
#else
#define HEADER_LOCK_H(h) (HEADER_Obj *)GUI_LOCK_H(h)
#endif
void HEADER__SetDrawObj(HEADER_Handle hObj, unsigned Index, GUI_DRAW_HANDLE hDrawObj);
#endif // GUI_WINSUPPORT
#endif // Avoid multiple inclusion

View File

@@ -0,0 +1,160 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : ICONVIEW.h
Purpose : ICONVIEW include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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_AddBMPItem (ICONVIEW_Handle hObj, const U8 * pBMP, const char * pText);
int ICONVIEW_AddBMPItemEx (ICONVIEW_Handle hObj, const void * pBMP, GUI_GET_DATA_FUNC * pfGetData, 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_InsertBMPItem (ICONVIEW_Handle hObj, const U8 * pBMP, const char * pText, int Index);
int ICONVIEW_InsertBMPItemEx (ICONVIEW_Handle hObj, const void * pBMP, GUI_GET_DATA_FUNC * pfGetData, 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);
int ICONVIEW_SetBMPItem (ICONVIEW_Handle hObj, const U8 * pBMP, int Index);
int ICONVIEW_SetBMPItemEx (ICONVIEW_Handle hObj, const void * pBMP, GUI_GET_DATA_FUNC * pfGetData, int Index);
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 ****************************/

View File

@@ -0,0 +1,154 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : ICONVIEW_Private.h
Purpose : ICONVIEW private header file
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef ICONVIEW_PRIVATE_H
#define ICONVIEW_PRIVATE_H
#include "WM.h"
#include "GUI_ARRAY.h"
#include "ICONVIEW.h"
#if GUI_WINSUPPORT
#if defined(__cplusplus)
extern "C" { // Make sure we have C-declarations in C++ programs
#endif
/*********************************************************************
*
* Types
*
**********************************************************************
*/
typedef struct {
const GUI_FONT * pFont;
GUI_COLOR aBkColor[3];
GUI_COLOR aTextColor[3];
int FrameX, FrameY;
int SpaceX, SpaceY;
int TextAlign;
int IconAlign;
GUI_WRAPMODE WrapMode;
} ICONVIEW_PROPS;
typedef struct {
WIDGET Widget;
WM_SCROLL_STATE ScrollStateV;
WM_SCROLL_STATE ScrollStateH;
ICONVIEW_PROPS Props;
GUI_ARRAY ItemArray;
int xSizeItems;
int ySizeItems;
int Sel;
U16 Flags;
} ICONVIEW_OBJ;
typedef void tDrawImage (const void * pData, GUI_GET_DATA_FUNC * pfGetData, int xPos, int yPos);
typedef void tDrawText (ICONVIEW_OBJ * pObj, GUI_RECT * pRect, const char * s);
typedef void tGetImageSizes(const void * pData, GUI_GET_DATA_FUNC * pfGetData, int * xSize, int * ySize);
typedef struct {
tDrawImage * pfDrawImage;
tDrawText * pfDrawText;
tGetImageSizes * pfGetImageSizes;
GUI_GET_DATA_FUNC * pfGetData;
const void * pData;
U32 UserData;
int SizeOfData;
char acText[1];
} ICONVIEW_ITEM;
/*********************************************************************
*
* Function pointer(s)
*
**********************************************************************
*/
extern void (* ICONVIEW__pfDrawStreamedBitmap)(const void * p, int x, int y);
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define ICONVIEW_INIT_ID(p) (p->Widget.DebugId = ICONVIEW_ID)
#else
#define ICONVIEW_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
ICONVIEW_OBJ * ICONVIEW_LockH(ICONVIEW_Handle h);
#define ICONVIEW_LOCK_H(h) ICONVIEW_LockH(h)
#else
#define ICONVIEW_LOCK_H(h) (ICONVIEW_OBJ *)GUI_LOCK_H(h)
#endif
/*********************************************************************
*
* Private functions
*
**********************************************************************
*/
void ICONVIEW__DrawText (ICONVIEW_OBJ * pObj, GUI_RECT * pRect, const char * pText);
void ICONVIEW__ManageAutoScroll(ICONVIEW_Handle hObj);
#if defined(__cplusplus)
}
#endif
#endif // GUI_WINSUPPORT
#endif // ICONVIEW_H
/*************************** End of file ****************************/

View File

@@ -0,0 +1,127 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : IMAGE.h
Purpose : Image include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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 internal 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
*
**********************************************************************
*/
int IMAGE_GetUserData(IMAGE_Handle hObj, void * pDest, int NumBytes);
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);
int IMAGE_SetUserData(IMAGE_Handle hObj, const void * pSrc, int NumBytes);
#if defined(__cplusplus)
}
#endif
#endif // GUI_WINSUPPORT
#endif // IMAGE_H
/*************************** End of file ****************************/

View File

@@ -0,0 +1,154 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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
} IMAGE_OBJ;
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define IMAGE_INIT_ID(p) (p->Widget.DebugId = IMAGE_ID)
#else
#define IMAGE_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
IMAGE_OBJ * IMAGE__LockH(IMAGE_Handle h);
#define IMAGE_LOCK_H(h) IMAGE__LockH(h)
#else
#define IMAGE_LOCK_H(h) (IMAGE_OBJ *)GUI_LOCK_H(h)
#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 ****************************/

View File

@@ -0,0 +1,130 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : KNOB.h
Purpose : KNOB include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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 ****************************/

View File

@@ -0,0 +1,120 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : KNOB.h
Purpose : KNOB include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef KNOB_PRIVATE_H
#define KNOB_PRIVATE_H
#include "KNOB.h"
#include "GUI_Private.h"
#if (GUI_SUPPORT_MEMDEV && GUI_WINSUPPORT)
/*********************************************************************
*
* Object definition
*
**********************************************************************
*/
typedef struct {
I32 Snap; // Position where the knob snaps
I32 Period; // Time it takes to stop the knob in ms
GUI_COLOR BkColor; // The Bk color
I32 Offset; // the offset
I32 MinRange;
I32 MaxRange;
I32 TickSize; // Minimum movement range in 1/10 of degree
I32 KeyValue; // Range of movement for one key push
} KNOB_PROPS;
typedef struct {
WIDGET Widget;
KNOB_PROPS Props;
WM_HMEM hContext;
I32 Angle;
I32 Value;
int xSize;
int ySize;
GUI_MEMDEV_Handle hMemSrc;
GUI_MEMDEV_Handle hMemDst;
GUI_MEMDEV_Handle hMemBk;
} KNOB_OBJ;
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define KNOB_INIT_ID(p) p->Widget.DebugId = KNOB_ID
#else
#define KNOB_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
KNOB_OBJ * KNOB_LockH(KNOB_Handle h);
#define KNOB_LOCK_H(h) KNOB_LockH(h)
#else
#define KNOB_LOCK_H(h) (KNOB_OBJ *)GUI_LOCK_H(h)
#endif
/*********************************************************************
*
* Module internal data
*
**********************************************************************
*/
extern KNOB_PROPS KNOB__DefaultProps;
#endif // (GUI_SUPPORT_MEMDEV && GUI_WINSUPPORT)
#endif // KNOB_PRIVATE_H

View File

@@ -0,0 +1,756 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : LCD.h
Purpose : Declares LCD interface functions
----------------------------------------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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_2;
extern const LCD_API_COLOR_CONV LCD_API_ColorConv_4;
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_2 &LCD_API_ColorConv_2
#define GUICC_4 &LCD_API_ColorConv_4
#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);
void LCD_SetDisplaySize(int xSizeDisplay, int ySizeDisplay);
int LCD_GetXSizeDisplay(void);
int LCD_GetYSizeDisplay(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;
int xLen, yLen;
int BytesPerPixel;
U32 Off;
} 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 emWin_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);
#if (GUI_USE_ARGB)
U32 LCD_AA_SetOrMask(U32 OrMask);
#else
U32 LCD_AA_SetAndMask(U32 AndMask);
#endif
/* 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 ****************************/

View File

@@ -0,0 +1,93 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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
----------------------------------------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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
#ifndef LCD_ALLOW_NON_OPTIMIZED_MODE
#define LCD_ALLOW_NON_OPTIMIZED_MODE 1
#endif
#endif /* LCD_CONFIG_DEFAULTS_H */
/*************************** End of file ****************************/

View File

@@ -0,0 +1,109 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : LCD_Private.h
Purpose : To be used only by the display drivers
----------------------------------------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef LCD_Private_H
#define LCD_Private_H
#include "LCDConf.h"
#include "LCD_Protected.h"
#include "GUI.h"
/*********************************************************************
*
* API functions
*/
extern const struct tLCDDEV_APIList_struct * /* const */ LCD_aAPI[GUI_NUM_LAYERS];
/*********************************************************************
*
* Support for Segment/COMLUTs
*/
#define LCD_TYPE_SEGTRANS U16
#define LCD_TYPE_COMTRANS U16
#ifdef LCD_LUT_COM
extern LCD_TYPE_COMTRANS LCD__aLine2Com0[LCD_YSIZE];
#endif
#ifdef LCD_LUT_SEG
extern LCD_TYPE_COMTRANS LCD__aCol2Seg0[LCD_XSIZE];
#endif
/*********************************************************************
*
* Support for multiple display controllers
*/
#define DECLARE_PROTOTYPES(DISTX) \
void LCD_##DISTX##_SetPixelIndex(int x, int y, int PixelIndex); \
unsigned LCD_##DISTX##_GetPixelIndex(int x, int y); \
void LCD_##DISTX##_XorPixel (int x, int y); \
void LCD_##DISTX##_DrawHLine (int x0, int y, int x1); \
void LCD_##DISTX##_DrawVLine (int x, int y0, int y1); \
void LCD_##DISTX##_FillRect (int x0, int y0, int x1, int y1); \
void LCD_##DISTX##_DrawBitmap (int x0, int y0, int xsize, int ysize, int BitsPerPixel, int BytesPerLine, const U8 * pData, int Diff, const LCD_PIXELINDEX * pTrans); \
void LCD_##DISTX##_SetOrg (int x, int y); \
void LCD_##DISTX##_On (void); \
void LCD_##DISTX##_Off (void); \
int LCD_##DISTX##_Init (void); \
void LCD_##DISTX##_SetLUTEntry (U8 Pos, LCD_COLOR Color); \
void * LCD_##DISTX##_GetDevFunc (int Index); \
void LCD_##DISTX##_ReInit (void)
DECLARE_PROTOTYPES(DIST0);
DECLARE_PROTOTYPES(DIST1);
DECLARE_PROTOTYPES(DIST2);
DECLARE_PROTOTYPES(DIST3);
#endif /* Avoid multiple inclusion */
/*************************** End of file ****************************/

View File

@@ -0,0 +1,142 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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
----------------------------------------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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_M8888I;
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 ****************************/

View File

@@ -0,0 +1,218 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : LCD_SIM.h
Purpose : Declares LCD interface functions
----------------------------------------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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
/************************************************************
*
* 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);
void LCDSIM_Invalidate(int LayerIndex);
/********************************************************************
*
* 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);
void SIM_GUI_SetCompositeTouch(int LayerIndex);
int SIM_GUI_GetCompositeTouch(void);
/********************************************************************
*
* 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);
#endif /* LCD_H */

View File

@@ -0,0 +1,219 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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_CF_WRAP (1<<3)
#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
#define LISTBOX_SF_WRAP LISTBOX_CF_WRAP
/*********************************************************************
*
* 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);
void LISTBOX_EnableWrapMode (LISTBOX_Handle hObj, int OnOff);
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);
/*********************************************************************
*
* Managing default values
*
**********************************************************************
*/
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 ****************************/

View File

@@ -0,0 +1,161 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : LISTBOX_Private.h
Purpose : Private LISTBOX include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef LISTBOX_PRIVATE_H
#define LISTBOX_PRIVATE_H
#include "LISTBOX.h"
#include "WM.h"
#include "GUI_ARRAY.h"
#include "WIDGET.h"
#if GUI_WINSUPPORT
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define LISTBOX_ITEM_SELECTED (1 << 0)
#define LISTBOX_ITEM_DISABLED (1 << 1)
/*********************************************************************
*
* Object definition
*
**********************************************************************
*/
typedef struct {
U16 xSize, ySize;
I32 ItemPosY;
U8 Status;
char acText[1];
} LISTBOX_ITEM;
typedef struct {
const GUI_FONT * pFont;
U16 ScrollStepH;
GUI_COLOR aBackColor[4];
GUI_COLOR aTextColor[4];
GUI_COLOR aScrollbarColor[3];
I16 Align;
} LISTBOX_PROPS;
typedef struct {
WIDGET Widget;
GUI_ARRAY ItemArray;
WIDGET_DRAW_ITEM_FUNC* pfDrawItem;
WM_SCROLL_STATE ScrollStateV;
WM_SCROLL_STATE ScrollStateH;
LISTBOX_PROPS Props;
WM_HWIN hOwner;
I16 Sel; /* current selection */
U8 Flags;
U8 ScrollbarWidth;
U16 ItemSpacing;
U16 ContentSizeX;
} LISTBOX_Obj;
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define LISTBOX_INIT_ID(p) p->Widget.DebugId = LISTBOX_ID
#else
#define LISTBOX_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
LISTBOX_Obj * LISTBOX_LockH(LISTBOX_Handle h);
#define LISTBOX_LOCK_H(h) LISTBOX_LockH(h)
#else
#define LISTBOX_LOCK_H(h) (LISTBOX_Obj *)GUI_LOCK_H(h)
#endif
/*********************************************************************
*
* Private (module internal) data
*
**********************************************************************
*/
extern LISTBOX_PROPS LISTBOX_DefaultProps;
/*********************************************************************
*
* Private (module internal) functions
*
**********************************************************************
*/
unsigned LISTBOX__GetNumItems (const LISTBOX_Obj * pObj);
const char * LISTBOX__GetpStringLocked (LISTBOX_Handle hObj, int Index, LISTBOX_ITEM ** ppItem);
void LISTBOX__InvalidateInsideArea (LISTBOX_Handle hObj);
void LISTBOX__InvalidateItem (LISTBOX_Handle hObj, int Sel);
void LISTBOX__InvalidateItemAndBelow(LISTBOX_Handle hObj, int Sel);
void LISTBOX__InvalidateItemSize (const LISTBOX_Obj * pObj, unsigned Index);
void LISTBOX__SetScrollbarColor (LISTBOX_Handle hObj, const LISTBOX_Obj * pObj);
void LISTBOX__SetScrollbarWidth (LISTBOX_Handle hObj, const LISTBOX_Obj * pObj);
void LISTBOX__AddSize (LISTBOX_Obj * pObj, int Index);
#endif /* GUI_WINSUPPORT */
#else /* Avoid problems with empty object modules */
void LISTBOX_C(void) {}
#endif
/*************************** End of file ****************************/

View File

@@ -0,0 +1,212 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : LISTVIEW.h
Purpose : LISTVIEW include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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_CF_CELL_SELECT (1 << 2) // Create Flag used to enable cell selection
#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);
/*********************************************************************
*
* 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_EnableCellSelect (LISTVIEW_Handle hObj, unsigned OnOff); // Enables/disables cell selection
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_GetItemRect (LISTVIEW_Handle hObj, U32 Col, U32 Row, GUI_RECT * pRect);
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_GetSelCol (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_SetItemTextSorted (LISTVIEW_Handle hObj, unsigned Column, unsigned Row, const char * pText);
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_SetSelCol (LISTVIEW_Handle hObj, int NewCol);
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);
/*********************************************************************
*
* Managing default values
*
**********************************************************************
*/
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 ****************************/

View File

@@ -0,0 +1,203 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : LISTVIEW_Private.h
Purpose : Private LISTVIEW include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef LISTVIEW_PRIVATE_H
#define LISTVIEW_PRIVATE_H
#include "WM.h"
#if GUI_WINSUPPORT
#include <stddef.h>
#include "LISTVIEW.h"
#include "GUI_ARRAY.h"
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define SORT_TYPE U16
#define LISTVIEW_CELL_INFO_COLORS (1 << 0)
#define LISTVIEW_CELL_INFO_BITMAP (1 << 1)
/*********************************************************************
*
* Object definition
*
**********************************************************************
*/
typedef struct {
GUI_COLOR aBkColor[4];
GUI_COLOR aTextColor[4];
GUI_COLOR GridColor;
const GUI_FONT * pFont;
U16 ScrollStepH;
GUI_WRAPMODE WrapMode;
int DefaultAlign;
} LISTVIEW_PROPS;
typedef struct {
void (* pfDraw)(LISTVIEW_Handle hObj, unsigned Column, unsigned Row, GUI_RECT * pRect);
void * pData;
GUI_COLOR aBkColor[4];
GUI_COLOR aTextColor[4];
I16 xOff, yOff;
U8 Flags;
} LISTVIEW_CELL_INFO;
typedef struct {
WM_HMEM hCellInfo; // Optional cell info. If 0, there is no cell info. (Defaults used)
char acText[1];
} LISTVIEW_CELL;
typedef struct {
GUI_ARRAY hCellArray;
char Disabled;
U32 UserData;
} LISTVIEW_ROW;
typedef struct {
U8 Align;
int (* fpCompare) (const void * p0, const void * p1); // User function to be called to compare the contents of 2 cells
} LISTVIEW_COLUMN;
typedef struct LISTVIEW_Obj LISTVIEW_Obj;
typedef struct {
WM_HMEM hSortArray;
SORT_TYPE SortArrayNumItems;
int (* fpSort)(LISTVIEW_Handle hObj); // Function to be called to get a sorted array
void (* fpFree)(WM_HMEM hObj); // Function to be called to free the sort object
U8 Reverse;
} LISTVIEW_SORT;
struct LISTVIEW_Obj {
WIDGET Widget;
HEADER_Handle hHeader;
WIDGET_DRAW_ITEM_FUNC * pfDrawItem;
GUI_ARRAY hRowArray; // Each entry is a handle of LISTVIEW_ROW structure.
GUI_ARRAY hColumnArray; // Each entry is a handle of LISTVIEW_COLUMN structure.
LISTVIEW_PROPS Props;
int Sel;
int SelCol;
int ShowGrid;
int SortIndex; // Column for sorting
unsigned RowDistY;
unsigned LBorder;
unsigned RBorder;
unsigned Fixed;
WM_SCROLL_STATE ScrollStateV;
WM_SCROLL_STATE ScrollStateH;
WM_HMEM hSort;
U8 IsSorted;
U8 IsPresorted;
U8 ReverseSort; // Set to 1 if reverse sorting is required
U8 Flags;
};
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define LISTVIEW_INIT_ID(p) (p->Widget.DebugId = LISTVIEW_ID)
#else
#define LISTVIEW_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
LISTVIEW_Obj * LISTVIEW_LockH(LISTVIEW_Handle h);
#define LISTVIEW_LOCK_H(h) LISTVIEW_LockH(h)
#else
#define LISTVIEW_LOCK_H(h) (LISTVIEW_Obj *)GUI_LOCK_H(h)
#endif
/*********************************************************************
*
* Private (module internal) data
*
**********************************************************************
*/
extern LISTVIEW_PROPS LISTVIEW_DefaultProps;
/*********************************************************************
*
* Private (module internal) functions
*
**********************************************************************
*/
LISTVIEW_CELL_INFO * LISTVIEW__CreateCellInfoLocked (LISTVIEW_Handle hObj, unsigned Column, unsigned Row);
unsigned LISTVIEW__GetNumColumns (LISTVIEW_Obj * pObj);
unsigned LISTVIEW__GetNumRows (LISTVIEW_Obj * pObj);
LISTVIEW_CELL_INFO * LISTVIEW__GetpCellInfo (LISTVIEW_Handle hObj, unsigned Column, unsigned Row);
LISTVIEW_ROW * LISTVIEW__GetpRow (LISTVIEW_Handle hObj, int Row);
unsigned LISTVIEW__GetRowDistY (LISTVIEW_Obj * pObj);
unsigned LISTVIEW__GetRowSorted (LISTVIEW_Handle hObj, int Row);
void LISTVIEW__InvalidateInsideArea (LISTVIEW_Handle hObj);
void LISTVIEW__InvalidateRow (LISTVIEW_Handle hObj, int Sel);
void LISTVIEW__InvalidateRowAndBelow(LISTVIEW_Handle hObj, int Sel);
void LISTVIEW__SetSel (LISTVIEW_Handle hObj, int NewSel);
void LISTVIEW__SetSelCol (LISTVIEW_Handle hObj, int NewSelCol);
int LISTVIEW__UpdateScrollParas (LISTVIEW_Handle hObj);
#endif // GUI_WINSUPPORT
#endif // LISTVIEW_PRIVATE_H
/*************************** End of file ****************************/

View File

@@ -0,0 +1,162 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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);
int LISTWHEEL_IsMoving (LISTWHEEL_Handle hObj);
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 ****************************/

View File

@@ -0,0 +1,152 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : LISTWHEEL_Private.h
Purpose : Private LISTWHEEL include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef LISTWHEEL_PRIVATE_H
#define LISTWHEEL_PRIVATE_H
#include "LISTWHEEL.h"
#include "WM.h"
#include "GUI_ARRAY.h"
#include "WIDGET.h"
#if GUI_WINSUPPORT
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define LISTWHEEL_STATE_PRESSED WIDGET_STATE_USER0
/*********************************************************************
*
* Object definition
*
**********************************************************************
*/
typedef struct {
void * pData;
char acText[1];
} LISTWHEEL_ITEM;
typedef struct {
const GUI_FONT * pFont;
GUI_COLOR aBackColor[2];
GUI_COLOR aTextColor[2];
I16 Align;
unsigned Deceleration;
} LISTWHEEL_PROPS;
typedef struct {
WIDGET Widget;
GUI_ARRAY ItemArray;
WIDGET_DRAW_ITEM_FUNC * pfOwnerDraw;
LISTWHEEL_PROPS Props;
WM_HMEM hTimer;
unsigned LBorder;
unsigned RBorder;
unsigned LineHeight;
int Sel;
GUI_TIMER_TIME TimeTouched; // Time stamp of last touch event
GUI_TIMER_TIME TimeTouchedLast; // Time of the last touch
int PosTouchedLast; // Last touched position in pixels
int Pos; // Current position in pixels
int Velocity; // Motion in pixels
int SnapPosition; // Snap position in pixels
int TouchPos; // Y-position of last touch event
int ySizeData; // Data size in pixels
int Destination; // Destination position in pixels
GUI_TIMER_TIME TimerPeriod; // Period of timer events
} LISTWHEEL_OBJ;
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define LISTWHEEL_INIT_ID(p) (p->Widget.DebugId = LISTWHEEL_ID)
#else
#define LISTWHEEL_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
LISTWHEEL_OBJ * LISTWHEEL_LockH(LISTWHEEL_Handle h);
#define LISTWHEEL_LOCK_H(h) LISTWHEEL_LockH(h)
#else
#define LISTWHEEL_LOCK_H(h) (LISTWHEEL_OBJ *)GUI_LOCK_H(h)
#endif
/*********************************************************************
*
* Private (module internal) data
*
**********************************************************************
*/
extern LISTWHEEL_PROPS LISTWHEEL_DefaultProps;
/*********************************************************************
*
* Private (module internal) functions
*
**********************************************************************
*/
const char * LISTWHEEL__GetpStringLocked(LISTWHEEL_Handle hObj, int Index, LISTWHEEL_ITEM ** ppItem);
#endif // GUI_WINSUPPORT
#endif // LISTWHEEL_PRIVATE_H
/*************************** End of file ****************************/

View File

@@ -0,0 +1,279 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : MENU.h
Purpose : MENU include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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);
/*********************************************************************
*
* 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);
/*********************************************************************
*
* Managing default values
*
**********************************************************************
*/
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 ****************************/

View File

@@ -0,0 +1,193 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : MENU_Private.h
Purpose : Internal header file
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef MENU_PRIVATE_H
#define MENU_PRIVATE_H
#include "WIDGET.h"
#include "MENU.h"
#include "GUI_ARRAY.h"
#if GUI_WINSUPPORT
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
/*********************************************************************
*
* Status flags
*/
#define MENU_SF_HORIZONTAL MENU_CF_HORIZONTAL
#define MENU_SF_VERTICAL MENU_CF_VERTICAL
#define MENU_SF_OPEN_ON_POINTEROVER MENU_CF_OPEN_ON_POINTEROVER
#define MENU_SF_CLOSE_ON_SECOND_CLICK MENU_CF_CLOSE_ON_SECOND_CLICK
#define MENU_SF_HIDE_DISABLED_SEL MENU_CF_HIDE_DISABLED_SEL
#define MENU_SF_ACTIVE (1 << 6) // Internal flag only
#define MENU_SF_POPUP (1 << 7) // Internal flag only
#define MENU_SF_ARROW (1 << 8) // Internal flag only
/*********************************************************************
*
* Types
*
**********************************************************************
*/
//
// MENU_SKIN_PRIVATE
//
typedef struct {
WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
} MENU_SKIN_PRIVATE;
//
// MENU_ITEM
//
typedef struct {
MENU_Handle hSubmenu;
U16 Id;
U16 Flags;
int TextWidth;
char acText[1];
} MENU_ITEM;
//
// MENU_PROPS
//
typedef struct {
GUI_COLOR aTextColor[5];
GUI_COLOR aBkColor[5];
U8 aBorder[4];
const GUI_FONT * pFont;
MENU_SKIN_PRIVATE SkinPrivate;
} MENU_PROPS;
//
// MENU_Obj
//
typedef struct {
WIDGET Widget;
MENU_PROPS Props;
GUI_ARRAY ItemArray;
WM_HWIN hOwner;
U16 Flags;
char IsSubmenuActive;
int Width;
int Height;
int Sel;
unsigned ArrowAreaWidth;
WIDGET_SKIN const * pWidgetSkin;
} MENU_Obj;
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define MENU_INIT_ID(pObj) (pObj->Widget.DebugId = MENU_ID)
#else
#define MENU_INIT_ID(pObj)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
MENU_Obj * MENU_LockH(MENU_Handle hObj);
#define MENU_LOCK_H(hObj) MENU_LockH(hObj)
#else
#define MENU_LOCK_H(hObj) (MENU_Obj *)GUI_LOCK_H(hObj)
#endif
/*********************************************************************
*
* Public data (internal defaults)
*
**********************************************************************
*/
extern MENU_PROPS MENU__DefaultProps;
extern const WIDGET_EFFECT * MENU__pDefaultEffect;
extern const WIDGET_SKIN MENU__SkinClassic;
extern WIDGET_SKIN MENU__Skin;
extern WIDGET_SKIN const * MENU__pSkinDefault;
/*********************************************************************
*
* Private functions
*
**********************************************************************
*/
int MENU__CalcMenuSizeX (MENU_Handle hObj);
int MENU__CalcMenuSizeY (MENU_Handle hObj);
int MENU__FindItem (MENU_Handle hObj, U16 ItemId, MENU_Handle* phMenu);
int MENU__GetEffectSize (MENU_Handle hObj);
int MENU__GetItemHeight (MENU_Handle hObj, unsigned Index);
int MENU__GetItemWidth (MENU_Handle hObj, unsigned Index);
unsigned MENU__GetNumItems (MENU_Obj * pObj);
int MENU__HasEffect (MENU_Handle hObj, MENU_Obj * pObj);
void MENU__InvalidateItem (MENU_Handle hObj, unsigned Index);
void MENU__RecalcTextWidthOfItems(MENU_Obj * pObj);
void MENU__ResizeMenu (MENU_Handle hObj);
int MENU__SendMenuMessage (MENU_Handle hObj, WM_HWIN hDestWin, U16 MsgType, U16 ItemId);
char MENU__SetItem (MENU_Handle hObj, unsigned Index, const MENU_ITEM_DATA* pItemData);
void MENU__SetItemFlags (MENU_Obj * pObj, unsigned Index, U16 Mask, U16 Flags);
#endif // GUI_WINSUPPORT
#endif // MENU_PRIVATE_H
/*************************** End of file ****************************/

View File

@@ -0,0 +1,82 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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 */

View File

@@ -0,0 +1,170 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : MULTIEDIT.h
Purpose : MULTIEDIT include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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 ****************************/

View File

@@ -0,0 +1,234 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : MULTIPAGE.h
Purpose : MULTIPAGE include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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
#define SCROLLBAR_SIZE 32 // Defines the space for the scrollbar arrows
#define MULTIPAGE_BI_SELECTED 0
#define MULTIPAGE_BI_UNSELECTED 1
#define MULTIPAGE_BI_DISABLED 2
#define MULTIPAGE_BI_MAX 3 // The defines above are used as array indices.
/*********************************************************************
*
* 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 {
U8 SelSideBorderInc; // Number of pixels to add on both sides when drawing the selected item.
U8 SelTopBorderInc; // Number of pixels to add on top of selected 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;
GUI_DRAW_HANDLE * pDrawObj;
} 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_AddEmptyPage (MULTIPAGE_Handle hObj, WM_HWIN hWin ,const char * pText);
void MULTIPAGE_AddPage (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);
void MULTIPAGE_EnableScrollbar(MULTIPAGE_Handle hObj, unsigned OnOff);
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);
int MULTIPAGE_SetBitmapEx (MULTIPAGE_Handle hObj, const GUI_BITMAP * pBitmap, int x, int y, int Index, int State);
int MULTIPAGE_SetBitmap (MULTIPAGE_Handle hObj, const GUI_BITMAP * pBitmap, int Index, int State);
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_SetTabWidth (MULTIPAGE_Handle hObj, int Width, int Index);
void MULTIPAGE_SetTabHeight (MULTIPAGE_Handle hObj, int Height);
void MULTIPAGE_SetTextAlign (MULTIPAGE_Handle hObj, unsigned Align);
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);
/*********************************************************************
*
* Managing default values
*
**********************************************************************
*/
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_SetDefaultBorderSizeX(unsigned Size);
void MULTIPAGE_SetDefaultBorderSizeY(unsigned Size);
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 ****************************/

View File

@@ -0,0 +1,196 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : MULTIPAGE_Private.h
Purpose : Private MULTIPAGE include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef MULTIPAGE_PRIVATE_H
#define MULTIPAGE_PRIVATE_H
#include "GUI_Debug.h"
#include "GUI_ARRAY.h"
#include "MULTIPAGE.h"
#if GUI_WINSUPPORT
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define MULTIPAGE_STATE_ENABLED (1 << 0)
#define MULTIPAGE_STATE_SCROLLMODE WIDGET_STATE_USER0
#define MULTIPAGE_NUMCOLORS 2
/*********************************************************************
*
* Object definition
*
**********************************************************************
*/
//
// MULTIPAGE_PAGE
//
typedef struct {
WM_HWIN hWin;
U8 Status;
int ItemWidth;
WM_HMEM hDrawObj[3];
char acText;
} MULTIPAGE_PAGE;
//
// MULTIPAGE_SKIN_PRIVATE
//
typedef struct {
WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
} MULTIPAGE_SKIN_PRIVATE;
//
// MULTIPAGE_PROPS
//
typedef struct {
const GUI_FONT * pFont;
unsigned Align;
GUI_COLOR aBkColor[MULTIPAGE_NUMCOLORS];
GUI_COLOR aTextColor[MULTIPAGE_NUMCOLORS];
MULTIPAGE_SKIN_PRIVATE SkinPrivate;
int BorderSize0;
int BorderSize1;
unsigned TextAlign;
unsigned Scrollbar;
int (* pfGetTouchedPage)(MULTIPAGE_Handle hObj, int x, int y);
int (* pfGetTabBarWidth)(MULTIPAGE_Handle hObj);
} MULTIPAGE_PROPS;
//
// MULTIPAGE_Obj
//
typedef struct MULTIPAGE_Obj MULTIPAGE_Obj;
struct MULTIPAGE_Obj {
WIDGET Widget;
void (* pfDrawTextItem)(MULTIPAGE_Obj * pObj, const char * pText, unsigned Index, const GUI_RECT * pRect, int x0, int xSize, int ColorIndex);
WM_HWIN hClient;
GUI_ARRAY hPageArray;
unsigned Selection;
int ScrollState;
MULTIPAGE_PROPS Props;
WIDGET_SKIN const * pWidgetSkin;
MULTIPAGE_SKIN_PROPS SkinProps;
int ItemHeight;
int MaxHeight;
};
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define MULTIPAGE_INIT_ID(p) (p->Widget.DebugId = MULTIPAGE_ID)
#else
#define MULTIPAGE_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
MULTIPAGE_Obj * MULTIPAGE_LockH(MULTIPAGE_Handle h);
#define MULTIPAGE_LOCK_H(h) MULTIPAGE_LockH(h)
#else
#define MULTIPAGE_LOCK_H(h) (MULTIPAGE_Obj *)GUI_LOCK_H(h)
#endif
/*********************************************************************
*
* Externals
*
**********************************************************************
*/
extern GUI_COLOR MULTIPAGE__aEffectColor[2];
extern MULTIPAGE_PROPS MULTIPAGE__DefaultProps;
extern const WIDGET_SKIN MULTIPAGE__SkinClassic;
extern WIDGET_SKIN MULTIPAGE__Skin;
extern WIDGET_SKIN const * MULTIPAGE__pSkinDefault;
/*********************************************************************
*
* Private functions
*
**********************************************************************
*/
void MULTIPAGE__CalcBorderRect (MULTIPAGE_Obj * pObj, GUI_RECT * pRect);
void MULTIPAGE__CalcClientRect (MULTIPAGE_Handle hObj, GUI_RECT * pRect);
void MULTIPAGE__DeleteScrollbar(MULTIPAGE_Handle hObj);
void MULTIPAGE__DrawTextItemH (MULTIPAGE_Obj * pObj, const char * pText, unsigned Index, const GUI_RECT * pRect, int x0, int w, int ColorIndex);
int MULTIPAGE__GetPagePos (MULTIPAGE_Handle hObj, unsigned Index);
int MULTIPAGE__GetPageWidth (MULTIPAGE_Handle hObj, unsigned Index);
void MULTIPAGE__GetTabBarRect (MULTIPAGE_Handle hObj, GUI_RECT * pRect);
int MULTIPAGE__SetDrawObj (MULTIPAGE_Handle hObj, GUI_DRAW_HANDLE hDrawObj, int Index, int State);
void MULTIPAGE__UpdatePositions(MULTIPAGE_Handle hObj);
/*********************************************************************
*
* Private Skinning functions
*
**********************************************************************
*/
int MULTIPAGE_SKIN__GetPagePos (MULTIPAGE_Handle hObj, unsigned Index);
int MULTIPAGE_SKIN__GetTabBarWidth(MULTIPAGE_Handle hObj);
int MULTIPAGE_SKIN__GetTouchedPage(MULTIPAGE_Handle hObj, int TouchX, int TouchY);
#endif // GUI_WINSUPPORT
#endif // MULTIPAGE_PRIVATE_H
/*************************** End of file ****************************/

View File

@@ -0,0 +1,176 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : PROGBAR.h
Purpose : Progressbar include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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);
/*********************************************************************
*
* Individual member functions
*
**********************************************************************
*/
void PROGBAR_GetMinMax (PROGBAR_Handle hObj, int * pMin, int * pMax);
int PROGBAR_GetUserData (PROGBAR_Handle hObj, void * pDest, int NumBytes);
int PROGBAR_GetValue (PROGBAR_Handle hObj);
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 ****************************/

View File

@@ -0,0 +1,146 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : PROGBAR_Private.h
Purpose : Internal header file
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef PROGBAR_PRIVATE_H
#define PROGBAR_PRIVATE_H
#include "PROGBAR.h"
#include "WIDGET.h"
#if GUI_WINSUPPORT
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define PROGBAR_SF_HORIZONTAL PROGBAR_CF_HORIZONTAL
#define PROGBAR_SF_VERTICAL PROGBAR_CF_VERTICAL
#define PROGBAR_SF_USER PROGBAR_CF_USER
/*********************************************************************
*
* Types
*
**********************************************************************
*/
typedef struct {
WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
} PROGBAR_SKIN_PRIVATE;
typedef struct {
const GUI_FONT * pFont;
GUI_COLOR aBarColor[2];
GUI_COLOR aTextColor[2];
PROGBAR_SKIN_PRIVATE SkinPrivate;
} PROGBAR_PROPS;
typedef struct {
WIDGET Widget;
int v;
WM_HMEM hpText;
I16 XOff, YOff;
I16 TextAlign;
int Min, Max;
PROGBAR_PROPS Props;
WIDGET_SKIN const * pWidgetSkin;
U8 Flags;
} PROGBAR_Obj;
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define PROGBAR_INIT_ID(p) p->Widget.DebugId = PROGBAR_ID
#else
#define PROGBAR_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
PROGBAR_Obj * PROGBAR_LockH(PROGBAR_Handle h);
#define PROGBAR_LOCK_H(h) PROGBAR_LockH(h)
#else
#define PROGBAR_LOCK_H(h) (PROGBAR_Obj *)GUI_LOCK_H(h)
#endif
/*********************************************************************
*
* Public data (internal defaults)
*
**********************************************************************
*/
extern PROGBAR_PROPS PROGBAR__DefaultProps;
extern const WIDGET_SKIN PROGBAR__SkinClassic;
extern WIDGET_SKIN PROGBAR__Skin;
extern WIDGET_SKIN const * PROGBAR__pSkinDefault;
/*********************************************************************
*
* Public functions (internal)
*
**********************************************************************
*/
char * PROGBAR__GetTextLocked(const PROGBAR_Obj * pObj);
void PROGBAR__GetTextRect (const PROGBAR_Obj * pObj, GUI_RECT * pRect, const char * pText);
int PROGBAR__Value2Pos (const PROGBAR_Obj * pObj, int v);
#endif /* GUI_WINSUPPORT */
#endif /* PROGBAR_PRIVATE_H */
/*************************** End of file ****************************/

View File

@@ -0,0 +1,204 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : RADIO.h
Purpose : RADIO include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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);
/*********************************************************************
*
* Managing default values
*
**********************************************************************
*/
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 ****************************/

View File

@@ -0,0 +1,211 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : RADIO_Private.h
Purpose : RADIO private header file
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef RADIO_PRIVATE_H
#define RADIO_PRIVATE_H
#include "WM.h"
#if GUI_WINSUPPORT
#include "RADIO.h"
#include "WIDGET.h"
#include "GUI_ARRAY.h"
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
/* Define default image inactiv */
#ifndef RADIO_IMAGE0_DEFAULT
#define RADIO_IMAGE0_DEFAULT &RADIO__abmRadio[0]
#endif
/* Define default image activ */
#ifndef RADIO_IMAGE1_DEFAULT
#define RADIO_IMAGE1_DEFAULT &RADIO__abmRadio[1]
#endif
/* Define default image check */
#ifndef RADIO_IMAGE_CHECK_DEFAULT
#define RADIO_IMAGE_CHECK_DEFAULT &RADIO__bmCheck
#endif
/* Define default font */
#ifndef RADIO_FONT_DEFAULT
#if WIDGET_USE_SCHEME_SMALL
#define RADIO_SPACING_DEFAULT 20
#define RADIO_FONT_DEFAULT &GUI_Font13_1
#elif WIDGET_USE_SCHEME_MEDIUM
#define RADIO_SPACING_DEFAULT 24
#define RADIO_FONT_DEFAULT &GUI_Font16_1
#elif WIDGET_USE_SCHEME_LARGE
#define RADIO_SPACING_DEFAULT 30
#define RADIO_FONT_DEFAULT &GUI_Font24_1
#endif
#endif
/* Define vertical default spacing */
#ifndef RADIO_SPACING_DEFAULT
#define RADIO_SPACING_DEFAULT 20
#endif
/* Define default text color */
#ifndef RADIO_DEFAULT_TEXT_COLOR
#define RADIO_DEFAULT_TEXT_COLOR GUI_BLACK
#endif
/* Define default background color */
#ifndef RADIO_DEFAULT_BKCOLOR
#define RADIO_DEFAULT_BKCOLOR GUI_GRAY_C0
#endif
#ifndef RADIO_FOCUSCOLOR_DEFAULT
#define RADIO_FOCUSCOLOR_DEFAULT GUI_BLACK
#endif
#define RADIO_BORDER 2
/*********************************************************************
*
* Object definition
*
**********************************************************************
*/
typedef struct {
unsigned (* pfGetButtonSize)(RADIO_Handle hObj);
WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
} RADIO_SKIN_PRIVATE;
typedef struct {
GUI_COLOR BkColor;
GUI_COLOR TextColor;
GUI_COLOR FocusColor;
const GUI_FONT * pFont;
const GUI_BITMAP * apBmRadio[2];
const GUI_BITMAP * pBmCheck;
RADIO_SKIN_PRIVATE SkinPrivate;
} RADIO_PROPS;
typedef struct {
WIDGET Widget;
RADIO_PROPS Props;
WIDGET_SKIN const * pWidgetSkin;
GUI_ARRAY TextArray;
I16 Sel; /* current selection */
U16 Spacing;
U16 NumItems;
U8 GroupId;
} RADIO_Obj;
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define RADIO_INIT_ID(p) p->Widget.DebugId = RADIO_ID
#else
#define RADIO_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
RADIO_Obj * RADIO_LockH(RADIO_Handle h);
#define RADIO_LOCK_H(h) RADIO_LockH(h)
#else
#define RADIO_LOCK_H(h) (RADIO_Obj *)GUI_LOCK_H(h)
#endif
/*********************************************************************
*
* Types
*
**********************************************************************
*/
typedef void tRADIO_SetValue(RADIO_Handle hObj, int v);
/*********************************************************************
*
* Extern data
*
**********************************************************************
*/
extern RADIO_PROPS RADIO__DefaultProps;
extern const WIDGET_SKIN RADIO__SkinClassic;
extern WIDGET_SKIN RADIO__Skin;
extern WIDGET_SKIN const * RADIO__pSkinDefault;
extern const GUI_BITMAP RADIO__abmRadio[2];
extern const GUI_BITMAP RADIO__bmCheck;
extern tRADIO_SetValue* RADIO__pfHandleSetValue;
/*********************************************************************
*
* public functions (internal)
*
**********************************************************************
*/
void RADIO__SetValue (RADIO_Handle hObj, int v);
unsigned RADIO__GetButtonSize(RADIO_Handle hObj);
#endif /* GUI_WINSUPPORT */
#endif /* RADIO_PRIVATE_H */
/************************* end of file ******************************/

View File

@@ -0,0 +1,223 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : SCROLLBAR.h
Purpose : SCROLLBAR include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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
/*********************************************************************
*
* Managing default values
*
**********************************************************************
*/
int SCROLLBAR_GetDefaultWidth(void);
GUI_COLOR SCROLLBAR_SetDefaultColor(GUI_COLOR Color, unsigned int Index); /* Not yet documented */
int SCROLLBAR_SetDefaultWidth(int DefaultWidth);
/*********************************************************************
*
* Global functions
*
**********************************************************************
*/
int SCROLLBAR_GetThumbSizeMin(void);
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 ****************************/

View File

@@ -0,0 +1,204 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : SCROLLBAR_Private.h
Purpose : SCROLLBAR internal header file
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef SCROLLBAR_PRIVATE_H
#define SCROLLBAR_PRIVATE_H
#include "SCROLLBAR.h"
#include "WIDGET.h"
#include "GUI_Debug.h"
#if GUI_WINSUPPORT
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define PRESSED_STATE_NONE 0
#define PRESSED_STATE_RIGHT 1
#define PRESSED_STATE_LEFT 2
#define PRESSED_STATE_THUMB 3
/*********************************************************************
*
* Private config defaults
*
**********************************************************************
*/
/* Define colors */
#ifndef SCROLLBAR_COLOR_SHAFT_DEFAULT
#define SCROLLBAR_COLOR_SHAFT_DEFAULT GUI_GRAY
#endif
#ifndef SCROLLBAR_COLOR_ARROW_DEFAULT
#define SCROLLBAR_COLOR_ARROW_DEFAULT GUI_BLACK
#endif
#ifndef SCROLLBAR_COLOR_THUMB_DEFAULT
#define SCROLLBAR_COLOR_THUMB_DEFAULT GUI_GRAY_C0
#endif
#ifndef SCROLLBAR_THUMB_SIZE_MIN_DEFAULT
#define SCROLLBAR_THUMB_SIZE_MIN_DEFAULT 4
#endif
#ifndef SCROLLBAR_DEFAULT_WIDTH
#if WIDGET_USE_SCHEME_SMALL
#define SCROLLBAR_DEFAULT_WIDTH 11
#elif WIDGET_USE_SCHEME_MEDIUM
#define SCROLLBAR_DEFAULT_WIDTH 16
#elif WIDGET_USE_SCHEME_LARGE
#define SCROLLBAR_DEFAULT_WIDTH 22
#endif
#endif
#define SCROLLBAR_TIMER_ID 1234
/*********************************************************************
*
* Module internal data
*
**********************************************************************
*/
extern GUI_COLOR SCROLLBAR__aDefaultBkColor[2];
extern GUI_COLOR SCROLLBAR__aDefaultColor[2];
extern I16 SCROLLBAR__DefaultWidth;
extern I16 SCROLLBAR__ThumbSizeMin;
/*********************************************************************
*
* Object definition
*
**********************************************************************
*/
typedef struct {
WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
} SCROLLBAR_SKIN_PRIVATE;
typedef struct {
GUI_COLOR aColor[3];
SCROLLBAR_SKIN_PRIVATE SkinPrivate;
} SCROLLBAR_PROPS;
typedef struct {
int x0_LeftArrow;
int x1_LeftArrow;
int x0_Thumb;
int x1_Thumb;
int x0_RightArrow;
int x1_RightArrow;
int x1;
int xSizeMoveable;
int ThumbSize;
} SCROLLBAR_POSITIONS;
typedef struct SCROLLBAR_OBJ SCROLLBAR_OBJ;
struct SCROLLBAR_OBJ {
WIDGET Widget;
SCROLLBAR_PROPS Props;
WIDGET_SKIN const * pWidgetSkin;
void (* pfCalcPositions)(SCROLLBAR_Handle hObj, SCROLLBAR_POSITIONS * pPos);
int NumItems, v, PageSize;
int State;
int TimerStep;
int TouchPos;
WM_HMEM hTimer;
};
/*********************************************************************
*
* Private macros
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define SCROLLBAR_INIT_ID(p) (p->Widget.DebugId = SCROLLBAR_ID)
#else
#define SCROLLBAR_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
SCROLLBAR_OBJ * SCROLLBAR_LockH(SCROLLBAR_Handle h);
#define SCROLLBAR_LOCK_H(h) SCROLLBAR_LockH(h)
#else
#define SCROLLBAR_LOCK_H(h) (SCROLLBAR_OBJ *)GUI_LOCK_H(h)
#endif
/*********************************************************************
*
* Private functions
*
**********************************************************************
*/
void SCROLLBAR__InvalidatePartner(SCROLLBAR_Handle hObj);
void SCROLLBAR__Rect2VRect (const WIDGET * pWidget, GUI_RECT * pRect);
/*********************************************************************
*
* Private data
*
**********************************************************************
*/
extern SCROLLBAR_PROPS SCROLLBAR__DefaultProps;
extern const WIDGET_SKIN SCROLLBAR__SkinClassic;
extern WIDGET_SKIN SCROLLBAR__Skin;
extern WIDGET_SKIN const * SCROLLBAR__pSkinDefault;
#endif /* GUI_WINSUPPORT */
#endif /* Avoid multiple inclusion */

View File

@@ -0,0 +1,204 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : SLIDER.h
Purpose : SLIDER include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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);
void SLIDER_GetRange (SLIDER_Handle hObj, int * pMin, int * pMax);
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
/*********************************************************************
*
* Managing default values
*
**********************************************************************
*/
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 ****************************/

View File

@@ -0,0 +1,141 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : SLIDER_Private.h
Purpose : SLIDER private header file
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef SLIDER_PRIVATE_H
#define SLIDER_PRIVATE_H
#include "WM.h"
#include "WIDGET.h"
#include "SLIDER.h"
#if GUI_WINSUPPORT
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
//
// Flags
//
#define SLIDER_FLAG_DRAW_FOCUS_RECT (1 << 0)
/*********************************************************************
*
* Object definition
*
**********************************************************************
*/
typedef struct {
WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
} SLIDER_SKIN_PRIVATE;
typedef struct {
U8 Flags;
GUI_COLOR BkColor;
GUI_COLOR BarColor;
GUI_COLOR FocusColor;
GUI_COLOR TickColor;
SLIDER_SKIN_PRIVATE SkinPrivate;
} SLIDER_PROPS;
typedef struct {
WIDGET Widget;
SLIDER_PROPS Props;
WIDGET_SKIN const * pWidgetSkin;
int NumTicks;
int Max;
int Min;
int v;
I16 Width;
} SLIDER_Obj;
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define SLIDER_INIT_ID(p) (p->Widget.DebugId = SLIDER_ID)
#else
#define SLIDER_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
SLIDER_Obj * SLIDER_LockH(SLIDER_Handle h);
#define SLIDER_LOCK_H(h) SLIDER_LockH(h)
#else
#define SLIDER_LOCK_H(h) (SLIDER_Obj *)GUI_LOCK_H(h)
#endif
#ifndef SLIDER_SUPPORT_TRANSPARENCY
#define SLIDER_SUPPORT_TRANSPARENCY WM_SUPPORT_TRANSPARENCY
#endif
/*********************************************************************
*
* Public data (internal defaults)
*
**********************************************************************
*/
extern SLIDER_PROPS SLIDER__DefaultProps;
extern const WIDGET_SKIN SLIDER__SkinClassic;
extern WIDGET_SKIN SLIDER__Skin;
extern const WIDGET_SKIN * SLIDER__pSkinDefault;
#endif // GUI_WINSUPPORT
#endif // SLIDER_PRIVATE_H
/*************************** End of file ****************************/

View File

@@ -0,0 +1,199 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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);
/*********************************************************************
*
* Managing default values
*/
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 ****************************/

View File

@@ -0,0 +1,166 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : SPINBOX_Private.h
Purpose : Private SPINBOX include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef SPINBOX_PRIVATE_H
#define SPINBOX_PRIVATE_H
#include "SPINBOX.h"
#include "EDIT.h"
#include "GUI_Private.h"
#if GUI_WINSUPPORT
/*********************************************************************
*
* Private config defaults
*
**********************************************************************
*/
/*********************************************************************
*
* Object definition
*
**********************************************************************
*/
typedef struct {
WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
} SPINBOX_SKIN_PRIVATE;
typedef struct {
GUI_COLOR aButtonBkColor[3]; // Button background color for the states (disabled, pressed, unpressed).
GUI_COLOR aButtonUpperColor[3]; // Upper color for the button states (disabled, pressed, unpressed).
GUI_COLOR aButtonLowerColor[3]; // Lower color for the button states (disabled, pressed, unpressed).
GUI_COLOR aButtonOuterColor[3]; // Outer color for the button states (disabled, pressed, unpressed).
GUI_COLOR aTriangleColor[3]; // Color of the triangle for the button states (disabled, pressed, unpressed).
GUI_COLOR aBkColor[2]; // Background color for the states (enabled, disabled).
GUI_COLOR aTextColor[2]; // Text color for the states (enabled, disabled).
I32 Min; // Minimum allowed value.
I32 Max; // Maximum allowed value.
U16 Step; // Value will be increased/decreased by this amount when a button is clicked.
U16 ButtonSize; // Size of the button depending on the orientation.
U8 Edge; // Buttons reside on the left or right edge of the widget.
SPINBOX_SKIN_PRIVATE SkinPrivate; // Structure containing a pointer to the used DrawSkin-function.
} SPINBOX_PROPS;
typedef struct {
WIDGET Widget;
SPINBOX_PROPS Props;
const WIDGET_SKIN * pWidgetSkin;
EDIT_Handle hEdit;
GUI_TIMER_HANDLE hTimer;
I8 TimerButton;
I8 LastButton;
I8 NoAction;
U8 State; // Pressed state
} SPINBOX_OBJ;
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define SPINBOX_INIT_ID(p) (p->Widget.DebugId = SPINBOX_ID)
#else
#define SPINBOX_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
SPINBOX_OBJ * SPINBOX_LockH(SPINBOX_Handle h);
#define SPINBOX_LOCK_H(h) SPINBOX_LockH(h)
#else
#define SPINBOX_LOCK_H(h) (SPINBOX_OBJ *)GUI_LOCK_H(h)
#endif
#define SPINBOX_BUTTON_NONE -1
#define SPINBOX_BUTTON_0 0
#define SPINBOX_BUTTON_1 1
#define SPINBOX_TIMER_ID 1234
/*********************************************************************
*
* Private function prototypes
*
**********************************************************************
*/
void SPINBOX__ApplyProps (SPINBOX_Handle hObj, SPINBOX_SKINFLEX_PROPS * const * ppProps);
void SPINBOX__DrawBk (SPINBOX_Handle hObj, GUI_COLOR Color);
void SPINBOX__GetButtonRect (SPINBOX_Handle hObj, GUI_RECT * pButtonRect, U8 ButtonIndex);
void SPINBOX__GetButtonRectEx(SPINBOX_Handle hObj, WIDGET_ITEM_DRAW_INFO * ItemInfo);
int SPINBOX__GetDefaultMax (void);
int SPINBOX__GetDefaultMin (void);
/*********************************************************************
*
* Module internal data
*
**********************************************************************
*/
/*********************************************************************
*
* Public data (internal defaults)
*
**********************************************************************
*/
extern SPINBOX_PROPS SPINBOX__DefaultProps;
extern const WIDGET_SKIN SPINBOX__SkinClassic;
extern WIDGET_SKIN SPINBOX__Skin;
extern const WIDGET_SKIN * SPINBOX__pSkinDefault;
#endif // GUI_WINSUPPORT
#endif // SPINBOX_PRIVATE_H
/*************************** End of file ****************************/

View File

@@ -0,0 +1,216 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : SWIPELIST.h
Purpose : SWIPELIST include
--------------------END-OF-HEADER-------------------------------------
*/
#ifndef SWIPELIST_H
#define SWIPELIST_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
/*********************************************************************
*
* Create flags
*
**********************************************************************
*/
#define SWIPELIST_CF_HORIZONTAL (0 << 0)
#define SWIPELIST_CF_VERTICAL (1 << 0)
/*********************************************************************
*
* Getting border size
*/
#define SWIPELIST_BI_LEFT 0
#define SWIPELIST_BI_RIGHT 1
#define SWIPELIST_BI_TOP 2
#define SWIPELIST_BI_BOTTOM 3
/*********************************************************************
*
* Getting font
*/
#define SWIPELIST_FI_SEP_ITEM 0
#define SWIPELIST_FI_ITEM_HEADER 1
#define SWIPELIST_FI_ITEM_TEXT 2
/*********************************************************************
*
* Getting color
*/
#define SWIPELIST_CI_ITEM_HEADER_UNSEL 0
#define SWIPELIST_CI_ITEM_HEADER_SEL 1
#define SWIPELIST_CI_ITEM_TEXT_UNSEL 2
#define SWIPELIST_CI_ITEM_TEXT_SEL 3
#define SWIPELIST_CI_SEP_ITEM_TEXT 4
#define SWIPELIST_CI_BK_ITEM_UNSEL 0
#define SWIPELIST_CI_BK_ITEM_SEL 1
#define SWIPELIST_CI_BK_SEP_ITEM 2
/*********************************************************************
*
* Bitmap align
*/
#define SWIPELIST_BA_LEFT (0<<0)
#define SWIPELIST_BA_RIGHT (1<<0)
#define SWIPELIST_BA_HCENTER (2<<0)
#define SWIPELIST_BA_VCENTER (3<<2)
#define SWIPELIST_BA_TOP (0<<2)
#define SWIPELIST_BA_BOTTOM (1<<2)
/*********************************************************************
*
* Public Types
*
**********************************************************************
*/
typedef WM_HMEM SWIPELIST_Handle;
/*********************************************************************
*
* Create functions
*
**********************************************************************
*/
SWIPELIST_Handle SWIPELIST_CreateAsChild (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags);
SWIPELIST_Handle SWIPELIST_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id);
SWIPELIST_Handle SWIPELIST_CreateIndirect (const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
SWIPELIST_Handle SWIPELIST_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 SWIPELIST_Callback(WM_MESSAGE * pMsg);
/*********************************************************************
*
* Member functions
*
**********************************************************************
*/
int SWIPELIST_AddItem (SWIPELIST_Handle hObj, const char * sText, int ItemSize);
int SWIPELIST_AddItemText (SWIPELIST_Handle hObj, unsigned ItemIndex, const char * sText);
int SWIPELIST_AddSepItem (SWIPELIST_Handle hObj, const char * sText, int ItemSize);
void SWIPELIST_DeleteItem (SWIPELIST_Handle hObj, unsigned ItemIndex);
const GUI_BITMAP * SWIPELIST_GetBitmap (SWIPELIST_Handle hObj, unsigned ItemIndex);
int SWIPELIST_GetBitmapSpace (SWIPELIST_Handle hObj);
GUI_COLOR SWIPELIST_GetBkColor (SWIPELIST_Handle hObj, unsigned Index);
int SWIPELIST_GetBorderSize (SWIPELIST_Handle hObj, unsigned Index);
const GUI_FONT * SWIPELIST_GetFont (SWIPELIST_Handle hObj, unsigned Index);
int SWIPELIST_GetItemSize (SWIPELIST_Handle hObj, unsigned ItemIndex);
U32 SWIPELIST_GetItemUserData (SWIPELIST_Handle hObj, unsigned ItemIndex);
int SWIPELIST_GetNumItems (SWIPELIST_Handle hObj);
int SWIPELIST_GetNumText (SWIPELIST_Handle hObj, unsigned ItemIndex);
int SWIPELIST_GetReleasedItem (SWIPELIST_Handle hObj);
int SWIPELIST_GetScrollPos (SWIPELIST_Handle hObj);
int SWIPELIST_GetSelItem (SWIPELIST_Handle hObj);
GUI_COLOR SWIPELIST_GetSepColor (SWIPELIST_Handle hObj, unsigned ItemIndex);
int SWIPELIST_GetSepSize (SWIPELIST_Handle hObj, unsigned ItemIndex);
void SWIPELIST_GetText (SWIPELIST_Handle hObj, unsigned ItemIndex, unsigned TextIndex, char * pBuffer, int MaxSize);
int SWIPELIST_GetTextAlign (SWIPELIST_Handle hObj, unsigned ItemIndex);
GUI_COLOR SWIPELIST_GetTextColor (SWIPELIST_Handle hObj, unsigned Index);
int SWIPELIST_GetUserData (SWIPELIST_Handle hObj, void * pDest, int NumBytes);
int SWIPELIST_ItemAttachWindow (SWIPELIST_Handle hObj, unsigned ItemIndex, WM_HWIN hWin, int x0, int y0);
void SWIPELIST_ItemDetachWindow (SWIPELIST_Handle hObj, WM_HWIN hWin);
int SWIPELIST_OwnerDraw (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
void SWIPELIST_SetAttachedWindowPos (SWIPELIST_Handle hObj, WM_HWIN hWin, int x0, int y0);
void SWIPELIST_SetBitmap (SWIPELIST_Handle hObj, unsigned ItemIndex, int Align, const GUI_BITMAP * pBitmap);
void SWIPELIST_SetBitmapEx (SWIPELIST_Handle hObj, unsigned ItemIndex, int Align, const GUI_BITMAP * pBitmap, int x, int y);
void SWIPELIST_SetBitmapSpace (SWIPELIST_Handle hObj, unsigned Size);
void SWIPELIST_SetBkColor (SWIPELIST_Handle hObj, unsigned Index, GUI_COLOR Color);
void SWIPELIST_SetBorderSize (SWIPELIST_Handle hObj, unsigned Index, unsigned Size);
void SWIPELIST_SetFont (SWIPELIST_Handle hObj, unsigned Index, const GUI_FONT * pFont);
void SWIPELIST_SetItemSize (SWIPELIST_Handle hObj, unsigned ItemIndex, unsigned Size);
void SWIPELIST_SetItemUserData (SWIPELIST_Handle hObj, unsigned ItemIndex, U32 UserData);
void SWIPELIST_SetOwnerDraw (SWIPELIST_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawItem);
void SWIPELIST_SetScrollPos (SWIPELIST_Handle hObj, int Pos);
void SWIPELIST_SetScrollPosItem (SWIPELIST_Handle hObj, unsigned ItemIndex);
void SWIPELIST_SetSepColor (SWIPELIST_Handle hObj, unsigned ItemIndex, GUI_COLOR Color);
void SWIPELIST_SetSepSize (SWIPELIST_Handle hObj, unsigned ItemIndex, int Size);
void SWIPELIST_SetText (SWIPELIST_Handle hObj, unsigned ItemIndex, unsigned TextIndex, char * sText);
void SWIPELIST_SetTextAlign (SWIPELIST_Handle hObj, unsigned ItemIndex, int Align);
void SWIPELIST_SetTextColor (SWIPELIST_Handle hObj, unsigned Index, GUI_COLOR Color);
int SWIPELIST_SetUserData (SWIPELIST_Handle hObj, const void * pSrc, int NumBytes);
/*********************************************************************
*
* Global functions
*
**********************************************************************
*/
int SWIPELIST_GetDefaultBitmapSpace (void);
GUI_COLOR SWIPELIST_GetDefaultBkColor (unsigned Index);
int SWIPELIST_GetDefaultBorderSize (unsigned Index);
const GUI_FONT * SWIPELIST_GetDefaultFont (unsigned Index);
GUI_COLOR SWIPELIST_GetDefaultSepColor (void);
unsigned SWIPELIST_GetDefaultSepSize (void);
GUI_COLOR SWIPELIST_GetDefaultTextColor (unsigned Index);
int SWIPELIST_GetDefaultTextAlign (void);
void SWIPELIST_SetDefaultBitmapSpace (unsigned Size);
void SWIPELIST_SetDefaultBkColor (unsigned Index, GUI_COLOR Color);
void SWIPELIST_SetDefaultBorderSize (unsigned Index, unsigned Size);
void SWIPELIST_SetDefaultFont (unsigned Index, const GUI_FONT * pFont);
void SWIPELIST_SetDefaultSepColor (GUI_COLOR Color);
void SWIPELIST_SetDefaultSepSize (unsigned Size);
void SWIPELIST_SetDefaultTextColor (unsigned Index, GUI_COLOR Color);
void SWIPELIST_SetDefaultTextAlign (int Align);
#if defined(__cplusplus)
}
#endif
#endif // GUI_WINSUPPORT
#endif // SWIPELIST_H
/*************************** End of file ****************************/

View File

@@ -0,0 +1,136 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : SWIPELIST.h
Purpose : SWIPELIST include
--------------------END-OF-HEADER-------------------------------------
*/
#ifndef SWIPELIST_PRIVATE_H
#define SWIPELIST_PRIVATE_H
#include "SWIPELIST.h"
#include "GUI_Private.h"
#include "GUI_ARRAY.h"
#if GUI_WINSUPPORT
/*********************************************************************
*
* Object definition
*
**********************************************************************
*/
typedef struct {
WM_HWIN hWin;
int xPos;
int yPos;
} SWIPELIST_WIN;
typedef struct {
GUI_ARRAY WinArray;
GUI_ARRAY TextArray;
int TextSize;
WM_HMEM hDrawObj;
GUI_COLOR SepColor;
int SepSize;
int Pos;
int Size;
int BitmapAlign;
int TextAlign;
U8 Flags;
U32 UserData;
} SWIPELIST_ITEM;
typedef struct {
const GUI_FONT * pSepFont;
const GUI_FONT * pHeaderFont;
const GUI_FONT * pTextFont;
GUI_COLOR aTextColor[5];
GUI_COLOR aBkColor[3];
int BitmapSpace;
int aBorderSize[4];
U8 Flags;
} SWIPELIST_PROPS;
typedef struct {
WIDGET Widget;
SWIPELIST_PROPS Props;
WIDGET_DRAW_ITEM_FUNC * pfDrawItem;
GUI_ARRAY ItemArray;
int Pos;
int Size;
int FirstVisible;
int LastVisible;
int Sel;
int ReleasedItem;
} SWIPELIST_OBJ;
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define SWIPELIST_INIT_ID(p) p->Widget.DebugId = SWIPELIST_ID
#else
#define SWIPELIST_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
SWIPELIST_OBJ * SWIPELIST_LockH(SWIPELIST_Handle h);
#define SWIPELIST_LOCK_H(h) SWIPELIST_LockH(h)
#else
#define SWIPELIST_LOCK_H(h) (SWIPELIST_OBJ *)GUI_LOCK_H(h)
#endif
/*********************************************************************
*
* Module internal data
*
**********************************************************************
*/
extern SWIPELIST_PROPS SWIPELIST__DefaultProps;
extern GUI_COLOR SWIPELIST__DefaultSepColor;
extern int SWIPELIST__DefaultSepSize;
extern int SWIPELIST__DefaultTextAlign;
/*********************************************************************
*
* Private functions
*
**********************************************************************
*/
void SWIPELIST__SetDrawObj (SWIPELIST_Handle hObj, int Index, int Align, GUI_DRAW_HANDLE hDrawObj);
void SWIPELIST__CalcItemPos (GUI_ARRAY ItemArray, int StartIndex, int EndIndex, int AddSize);
int SWIPELIST__CalcItemSize (SWIPELIST_Handle hObj, int ItemIndex);
#endif /* if GUI_WINSUPPORT */
#endif /* SWIPELIST_PRIVATE_H */

View File

@@ -0,0 +1,164 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : TEXT.h
Purpose : TEXT include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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;
/*********************************************************************
*
* 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 */
GUI_COLOR TEXT_GetBkColor (TEXT_Handle hObj);
const GUI_FONT * TEXT_GetFont (TEXT_Handle hObj);
int TEXT_GetNumLines (TEXT_Handle hObj);
int TEXT_GetText (TEXT_Handle hObj, char * pDest, U32 BufferSize);
int TEXT_GetTextAlign(TEXT_Handle hObj);
GUI_COLOR TEXT_GetTextColor(TEXT_Handle hObj);
int TEXT_GetUserData (TEXT_Handle hObj, void * pDest, int NumBytes);
GUI_WRAPMODE TEXT_GetWrapMode (TEXT_Handle hObj);
void TEXT_SetBkColor (TEXT_Handle hObj, GUI_COLOR Color);
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);
/*********************************************************************
*
* Managing default values
*
**********************************************************************
*/
const GUI_FONT * TEXT_GetDefaultFont (void);
GUI_COLOR TEXT_GetDefaultTextColor(void);
GUI_WRAPMODE TEXT_GetDefaultWrapMode (void);
void TEXT_SetDefaultFont (const GUI_FONT * pFont);
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 ****************************/

View File

@@ -0,0 +1,110 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : TEXT.h
Purpose : TEXT include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef TEXT_PRIVATE_H
#define TEXT_PRIVATE_H
#include "TEXT.h"
#include "GUI_Private.h"
#if GUI_WINSUPPORT
/*********************************************************************
*
* Object definition
*
**********************************************************************
*/
typedef struct {
const GUI_FONT * pFont;
GUI_COLOR TextColor;
GUI_COLOR BkColor;
GUI_WRAPMODE WrapMode;
} TEXT_PROPS;
typedef struct {
WIDGET Widget;
TEXT_PROPS Props;
WM_HMEM hpText;
I16 Align;
} TEXT_OBJ;
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define TEXT_INIT_ID(p) p->Widget.DebugId = TEXT_ID
#else
#define TEXT_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
TEXT_OBJ * TEXT_LockH(TEXT_Handle h);
#define TEXT_LOCK_H(h) TEXT_LockH(h)
#else
#define TEXT_LOCK_H(h) (TEXT_OBJ *)GUI_LOCK_H(h)
#endif
/*********************************************************************
*
* Module internal data
*
**********************************************************************
*/
extern TEXT_PROPS TEXT__DefaultProps;
#endif /* if GUI_WINSUPPORT */
#endif /* TEXT_PRIVATE_H */

View File

@@ -0,0 +1,250 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : TREEVIEW.h
Purpose : TREEVIEW include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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 ****************************/

View File

@@ -0,0 +1,168 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : TREEVIEW_Private.h
Purpose : TREEVIEW private header file
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef TREEVIEW_PRIVATE_H
#define TREEVIEW_PRIVATE_H
#include "WM.h"
#include "TREEVIEW.h"
#if GUI_WINSUPPORT
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define TREEVIEW_ITEM_STATE_EXPANDED (1 << 1)
#define TREEVIEW_ITEM_STATE_ISLAST (1 << 2)
#define TREEVIEW_STATE_HASLINES (1 << 0)
#define TREEVIEW_COLORS_BK 0
#define TREEVIEW_COLORS_TEXT 1
#define TREEVIEW_COLORS_LINE 2
/*********************************************************************
*
* Types
*
**********************************************************************
*/
typedef struct {
const GUI_BITMAP * apBm[3]; /* Closed, Open, Leaf */
} TREEVIEW_ITEM_DATA;
typedef struct {
WM_HMEM hParent; /* Handle to treeview object */
TREEVIEW_ITEM_Handle hNext;
TREEVIEW_ITEM_Handle hPrev;
U32 UserData;
WM_HMEM hData; /* Handle of TREEVIEW_ITEM_DATA structure */
U16 xSize;
U16 ySize;
U16 Flags;
U16 Connectors;
U8 Level; /* 0...15 */
char acText[1];
} TREEVIEW_ITEM_OBJ;
typedef struct {
const GUI_FONT * pFont;
GUI_COLOR aBkColor[3];
GUI_COLOR aTextColor[3];
GUI_COLOR aLineColor[3];
GUI_COLOR FocusColor;
const GUI_BITMAP * apBm[5]; /* Closed, Open, Leaf, Plus, Minus */
int Indent;
int TextIndent;
int MinItemHeight;
} TREEVIEW_PROPS;
typedef struct {
WIDGET Widget;
WIDGET_DRAW_ITEM_FUNC * pfDrawItem;
WM_SCROLL_STATE ScrollStateV;
WM_SCROLL_STATE ScrollStateH;
TREEVIEW_PROPS Props;
U16 Flags;
TREEVIEW_ITEM_Handle hFirst;
TREEVIEW_ITEM_Handle hLast;
TREEVIEW_ITEM_Handle hSel;
GUI_TIMER_HANDLE hTimer;
/* Cache variables */
int NumItems;
int NumVisItems;
int xSizeItems; /* xSize in pixel used for all visible items */
int ySizeItems; /* ySize in pixel used for all visible items */
I16 xOffPM, yOffPM; /* x/y offset of PM bitmap */
U16 xOverlapHLine;
} TREEVIEW_OBJ;
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define TREEVIEW_INIT_ID(p) p->Widget.DebugId = TREEVIEW_ID
#else
#define TREEVIEW_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
TREEVIEW_OBJ * TREEVIEW_LockH(TREEVIEW_Handle h);
#define TREEVIEW_LOCK_H(h) TREEVIEW_LockH(h)
#else
#define TREEVIEW_LOCK_H(h) (TREEVIEW_OBJ *)GUI_LOCK_H(h)
#endif
/*********************************************************************
*
* Module internal data
*
**********************************************************************
*/
extern TREEVIEW_PROPS TREEVIEW__DefaultProps;
extern GUI_CONST_STORAGE GUI_BITMAP TREEVIEW__bmOpen;
extern GUI_CONST_STORAGE GUI_BITMAP TREEVIEW__bmClosed;
extern GUI_CONST_STORAGE GUI_BITMAP TREEVIEW__bmLeaf;
extern GUI_CONST_STORAGE GUI_BITMAP TREEVIEW__bmPlus;
extern GUI_CONST_STORAGE GUI_BITMAP TREEVIEW__bmMinus;
#endif /* GUI_WINSUPPORT */
#endif /* TREEVIEW_H */
/*************************** End of file ****************************/

View File

@@ -0,0 +1,399 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : WIDGET.h
Purpose : Widget interface
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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 FRAMECLNT_ID 0x46524143UL /* FRAC */
#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 MPAGECLNT_ID 0x4d50434CUL /* MPCL */
#define PROGBAR_ID 0x50524f47UL /* PROG */
#define RADIO_ID 0x52414449UL /* RADI */
#define SCROLLBAR_ID 0x5343524fUL /* SCRO */
#define SLIDER_ID 0x534c4944UL /* SLID */
#define SWIPELIST_ID 0x53574950UL /* SWIP */
#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 WINDOW_ID 0x57494e44UL /* WIND */
#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 1
#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;
#if GUI_DEBUG_LEVEL > 1
U32 DebugId;
#endif
} 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 */

View File

@@ -0,0 +1,71 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : WINDOW_Private.h
Purpose : WINDOW private header file
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef WINDOW_PRIVATE_H
#define WINDOW_PRIVATE_H
#include "WM.h"
#if GUI_WINSUPPORT
/*********************************************************************
*
* Externals
*
**********************************************************************
*/
extern GUI_COLOR WINDOW__DefaultBkColor;
#endif /* GUI_WINSUPPORT */
#endif /* WINDOW_PRIVATE_H */

View File

@@ -0,0 +1,782 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : WM.h
Purpose : Windows manager include
----------------------------------------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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 WM_WINDOW_INFO WM_WINDOW_INFO;
struct WM_WINDOW_INFO {
GUI_HMEM hWin;
GUI_HMEM hParent;
GUI_HMEM hFirstChild;
GUI_HMEM hNext;
GUI_RECT Rect;
U32 Status;
U32 DebugId;
WM_WINDOW_INFO * pNext;
};
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 {
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_GET_WINDOW_ID 49 /* Return widget type specific Id (DebugId) */
#define WM_PRE_BANDING 50
#define WM_POST_BANDING 51
#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);
I32 WM_GESTURE_SetThresholdAngle(I32 ThresholdAngle);
I32 WM_GESTURE_SetThresholdDist (I32 ThresholdDist);
/* 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);
GUI_MEMDEV_Handle GUI_MEMDEV_CreateWindowDevice(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);
void GUI_MEMDEV__CreateStatic (WM_HWIN hWin);
#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 GUI_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);
int WM_SetModalLayer(int LayerIndex);
int WM_GetModalLayer(void);
/*********************************************************************
*
* 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);
int WM_GetWindowInfo (WM_WINDOW_INFO * pInfo, int FirstWindow);
/*********************************************************************
*
* 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 ****************************/

View File

@@ -0,0 +1,92 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
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
----------------------------------------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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 ****************************/

View File

@@ -0,0 +1,274 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - 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 STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : WM_Intern.h
Purpose : Windows manager internal include
----------------------------------------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#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];
extern int WM__ModalLayer;
#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__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__ClipBK (EFFECT_CONTEXT * pContext);
void GUI_MEMDEV__RemoveStaticDevice(WM_HWIN hWin);
void GUI_MEMDEV__UndoClipBK (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 ****************************/