2019-01-11 14:03:38 +00:00
|
|
|
#ifndef __INCLUDED_SGUI_INTERFACE_H__
|
|
|
|
#define __INCLUDED_SGUI_INTERFACE_H__
|
|
|
|
//=======================================================================//
|
2021-04-13 15:09:25 +00:00
|
|
|
//= Include files. =//
|
2019-01-11 14:03:38 +00:00
|
|
|
//=======================================================================//
|
|
|
|
#include "SGUI_Typedef.h"
|
2019-04-30 14:13:12 +00:00
|
|
|
#include "SGUI_Common.h"
|
2020-12-24 14:36:52 +00:00
|
|
|
#include <string.h>
|
2019-01-11 14:03:38 +00:00
|
|
|
|
|
|
|
//=======================================================================//
|
2021-10-08 16:31:30 +00:00
|
|
|
//= Macro definition. =//
|
2019-01-11 14:03:38 +00:00
|
|
|
//=======================================================================//
|
|
|
|
#if defined ( __CC_ARM )
|
2021-10-08 16:31:30 +00:00
|
|
|
#define SGUI_ASM __asm // asm keyword for ARM Compiler(Keil MDK).
|
|
|
|
#define SGUI_INLINE __inline // inline keyword for ARM Compiler.
|
|
|
|
#pragma diag_suppress 870 // Disabled "multibyte character sequence" warning.
|
2019-01-11 14:03:38 +00:00
|
|
|
|
|
|
|
#elif defined ( __ICCARM__ )
|
2021-10-08 16:31:30 +00:00
|
|
|
#define SGUI_ASM __asm // < asm keyword for IAR Compiler.
|
|
|
|
#define SGUI_INLINE inline // inline keyword for IAR Compiler. Only available in High optimization mode!
|
2019-01-11 14:03:38 +00:00
|
|
|
|
|
|
|
#elif defined ( __GNUC__ )
|
2021-10-08 16:31:30 +00:00
|
|
|
#define SGUI_ASM __asm // asm keyword for GNU Compiler.
|
|
|
|
#define SGUI_INLINE inline // inline keyword for GNU Compiler.
|
2019-01-11 14:03:38 +00:00
|
|
|
|
|
|
|
#elif defined ( __TASKING__ )
|
2021-10-08 16:31:30 +00:00
|
|
|
#define SGUI_ASM __asm // asm keyword for TASKING Compiler.
|
|
|
|
#define SGUI_INLINE inline // inline keyword for TASKING Compiler.
|
2019-01-11 14:03:38 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
//=======================================================================//
|
2021-04-13 15:09:25 +00:00
|
|
|
//= Public function declaration. =//
|
2019-01-11 14:03:38 +00:00
|
|
|
//=======================================================================//
|
2020-12-24 14:36:52 +00:00
|
|
|
|
2019-05-01 13:01:45 +00:00
|
|
|
#ifdef _SIMPLE_GUI_ENCODE_TEXT_
|
2019-01-11 14:03:38 +00:00
|
|
|
// Only used when running in simulated environment and text encode need convert to GB2312.
|
2021-04-13 15:09:25 +00:00
|
|
|
SGUI_SZSTR SGUI_SystemIF_EncodeConvert(SGUI_CSZSTR szSourceEncode, SGUI_SZSTR szDestinationEncode, SGUI_SZSTR szSource);
|
|
|
|
#define SGUI_ENCODE_BUFFER_SIZE (512)
|
|
|
|
#define ENCODE(S) (SGUI_SystemIF_EncodeConvert(_SIMPLE_GUI_ENCODE_TEXT_SRC_, _SIMPLE_GUI_ENCODE_TEXT_DEST_, (char *)(S)))
|
2019-01-11 14:03:38 +00:00
|
|
|
#else
|
2021-04-13 15:09:25 +00:00
|
|
|
#define ENCODE(S) (S)
|
2019-01-11 14:03:38 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _SIMPLE_GUI_ENABLE_DYNAMIC_MEMORY_
|
2021-04-13 15:09:25 +00:00
|
|
|
SGUI_PTR SGUI_SystemIF_Allocate(SGUI_SIZE sSize);
|
|
|
|
void SGUI_SystemIF_Free(SGUI_PTR pFreePointer);
|
2019-01-11 14:03:38 +00:00
|
|
|
#endif
|
2021-10-08 16:31:30 +00:00
|
|
|
//=======================================================================//
|
|
|
|
//= Macro function. =//
|
|
|
|
//=======================================================================//
|
2021-04-13 15:09:25 +00:00
|
|
|
#define SGUI_SystemIF_MemoryCopy(DEST, SOURCE, SIZE) \
|
2020-12-24 14:36:52 +00:00
|
|
|
(memcpy(DEST, SOURCE, SIZE))
|
2021-04-13 15:09:25 +00:00
|
|
|
#define SGUI_SystemIF_MemorySet(PTR, VAL, SIZE) \
|
2020-12-24 14:36:52 +00:00
|
|
|
(memset(PTR, VAL, SIZE))
|
|
|
|
#define SGUI_SystemIF_StringLength(/* SGUI_CSZSTR */STR) \
|
|
|
|
((NULL == (STR))?0:(strlen((STR))))
|
2021-04-13 15:09:25 +00:00
|
|
|
#define SGUI_SystemIF_StringCopy(/* SGUI_SZSTR */DEST, /* SGUI_CSZSTR */SRC) \
|
2020-12-24 14:36:52 +00:00
|
|
|
(strcpy((DEST), (SRC)))
|
|
|
|
#define SGUI_SystemIF_StringLengthCopy(/* SGUI_SZSTR */DEST, /* SGUI_CSZSTR */SRC, /* SGUI_SIZE */SIZE) \
|
|
|
|
(strncpy((DEST), (SRC), (SIZE)))
|
2022-05-31 10:59:24 +00:00
|
|
|
#define SGUI_SystemIF_StringCompare(/* SGUI_SZSTR */LEFT, /* SGUI_CSZSTR */RIGHT) \
|
|
|
|
(strcmp((LEFT), (RIGHT)))
|
2020-12-24 14:36:52 +00:00
|
|
|
|
2019-01-11 14:03:38 +00:00
|
|
|
#endif // __INCLUDED_SGUI_INTERFACE_H__
|