Ai
227 Star 1.1K Fork 391

Polarix/SimpleGUI

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
SGUI_Interface.h 3.52 KB
一键复制 编辑 原始数据 按行查看 历史
Polarix 提交于 2022-05-31 18:59 +08:00 . 2022-06-01:
#ifndef __INCLUDED_SGUI_INTERFACE_H__
#define __INCLUDED_SGUI_INTERFACE_H__
//=======================================================================//
//= Include files. =//
//=======================================================================//
#include "SGUI_Typedef.h"
#include "SGUI_Common.h"
#include <string.h>
//=======================================================================//
//= Macro definition. =//
//=======================================================================//
#if defined ( __CC_ARM )
#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.
#elif defined ( __ICCARM__ )
#define SGUI_ASM __asm // < asm keyword for IAR Compiler.
#define SGUI_INLINE inline // inline keyword for IAR Compiler. Only available in High optimization mode!
#elif defined ( __GNUC__ )
#define SGUI_ASM __asm // asm keyword for GNU Compiler.
#define SGUI_INLINE inline // inline keyword for GNU Compiler.
#elif defined ( __TASKING__ )
#define SGUI_ASM __asm // asm keyword for TASKING Compiler.
#define SGUI_INLINE inline // inline keyword for TASKING Compiler.
#endif
//=======================================================================//
//= Public function declaration. =//
//=======================================================================//
#ifdef _SIMPLE_GUI_ENCODE_TEXT_
// Only used when running in simulated environment and text encode need convert to GB2312.
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)))
#else
#define ENCODE(S) (S)
#endif
#ifdef _SIMPLE_GUI_ENABLE_DYNAMIC_MEMORY_
SGUI_PTR SGUI_SystemIF_Allocate(SGUI_SIZE sSize);
void SGUI_SystemIF_Free(SGUI_PTR pFreePointer);
#endif
//=======================================================================//
//= Macro function. =//
//=======================================================================//
#define SGUI_SystemIF_MemoryCopy(DEST, SOURCE, SIZE) \
(memcpy(DEST, SOURCE, SIZE))
#define SGUI_SystemIF_MemorySet(PTR, VAL, SIZE) \
(memset(PTR, VAL, SIZE))
#define SGUI_SystemIF_StringLength(/* SGUI_CSZSTR */STR) \
((NULL == (STR))?0:(strlen((STR))))
#define SGUI_SystemIF_StringCopy(/* SGUI_SZSTR */DEST, /* SGUI_CSZSTR */SRC) \
(strcpy((DEST), (SRC)))
#define SGUI_SystemIF_StringLengthCopy(/* SGUI_SZSTR */DEST, /* SGUI_CSZSTR */SRC, /* SGUI_SIZE */SIZE) \
(strncpy((DEST), (SRC), (SIZE)))
#define SGUI_SystemIF_StringCompare(/* SGUI_SZSTR */LEFT, /* SGUI_CSZSTR */RIGHT) \
(strcmp((LEFT), (RIGHT)))
#endif // __INCLUDED_SGUI_INTERFACE_H__
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/Polarix/simplegui.git
git@gitee.com:Polarix/simplegui.git
Polarix
simplegui
SimpleGUI
Stable

搜索帮助