⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 i_pwin.h

📁 Very very small GUI. Usefull for small system, without OS or small OS. Event driven, support user m
💻 H
📖 第 1 页 / 共 3 页
字号:
#ifndef I_PWIN_H#define I_PWIN_H/* -------------------------------------------------------------------------- */#include <pwin.h>/* -------------------------------------------------------------------------- *//*#define IPW_USE_TRACE   1 #define IPW_USE_CHECKS  1 					 #define IPW_USE_ASSERTS 1 #define IPW_USE_ERRFN   1  *//* -------------------------------------------------------------------------- */
/* Initialization code tracing */#define IPW_TRC_IN1(_code_) _code_/* Region allocation code tracing */#define IPW_TRC_RA1(_code_) _code_#define IPW_TRC_RA2(_code_) _code_/* Rectangle geometry and manipulation code tracing */#define IPW_TRC_RE1(_code_) _code_#define IPW_TRC_RE2(_code_) _code_#define IPW_TRC_RE3(_code_) _code_/* Drawing code tracing */#define IPW_TRC_DR1(_code_) _code_#define IPW_TRC_DR2(_code_) _code_#define IPW_TRC_DR3(_code_) _code_/* Bitmap code tracing */#define IPW_TRC_BM1(_code_) _code_#define IPW_TRC_BM2(_code_) _code_#define IPW_TRC_BM3(_code_) _code_/* Event code tracing */#define IPW_TRC_EV1(_code_) _code_#define IPW_TRC_EV2(_code_) _code_/* Window code tracing */#define IPW_TRC_WN1(_code_) _code_#define IPW_TRC_WN2(_code_) _code_#define IPW_TRC_WN3(_code_) _code_/* Display code tracing */#define IPW_TRC_DP1(_code_) _code_#define IPW_TRC_DP2(_code_) _code_/* Timeout code tracing */#define IPW_TRC_TM1(_code_) _code_#define IPW_TRC_TM2(_code_) _code_/* Mat 3d code tracing */#define IPW_TRC_MA1(_code_) _code_/* -------------------------------------------------------------------------- */#define IPW_CHK_REGION_ALLOC(_code_)     _code_#define IPW_CHK_REGION_FREE_LIST(_code_) _code_#define IPW_CHK_BITMAP_STRUCT(_code_)    _code_#define IPW_CHK_GC_STRUCT(_code_)        _code_#define IPW_CHK_WINDOW_STRUCT(_code_)    _code_#define IPW_CHK_REGION_LIST(_code_)      _code_#define IPW_CHK_REGION_MAX_USAGE(_code_) _code_/* -------------------------------------------------------------------------- */#define IPW_MACRO_START     do {#define IPW_MACRO_END       } while (0)//#define IPW_EMPTY_STATEMENT IPW_MACRO_START IPW_MACRO_END
#define IPW_EMPTY_STATEMENT /* -------------------------------------------------------------------------- */#ifdef IPW_USE_ERRFN#define IPW_NOTE(_args_)                                  \    IPW_MACRO_START                                       \        IPw_Note( __FILE__, __LINE__);  \        IPw_Printf _args_;                                \    IPW_MACRO_END#define IPW_WARN(_cond_, _args_)                              \    IPW_MACRO_START                                           \        if (!(_cond_))                                        \        {                                                     \            IPw_Warn( __FILE__, __LINE__);  \            IPw_Printf _args_;                                \        }                                                     \    IPW_MACRO_END#define IPW_FAIL(_cond_, _args_)                             \    IPW_MACRO_START                                          \        if (!(_cond_))                                       \        {                                                    \            IPw_Fail(__FILE__, __LINE__); \            IPw_Printf _args_;                               \        }                                                    \    IPW_MACRO_END#else#define IPW_NOTE(_args_)         IPW_EMPTY_STATEMENT#define IPW_WARN(_cond_, _args_) IPW_EMPTY_STATEMENT  #define IPW_FAIL(_cond_, _args_) IPW_EMPTY_STATEMENT    #endif/* -------------------------------------------------------------------------- */#ifdef IPW_USE_ASSERTS
#define IPW_ASSERT(_cond_, _args_)                            \    IPW_MACRO_START                                           \        if (!(_cond_))                                        \        {                                                     \            IPw_Assert( __FILE__, __LINE__);\            IPw_Printf _args_;  								\
        }                                                     \    IPW_MACRO_END#else /* IPW_USE_ASSERTS */#define IPW_ASSERT(_cond_, _args_) IPW_EMPTY_STATEMENT#endif /* not IPW_USE_ASSERTS */
#define IPW_CHECK_PTR(_ptr_) /*#define IPW_CHECK_PTR(_ptr_) \    IPW_ASSERT(PW_NULL != (_ptr_), (# _ptr_ " == NULL"))  */
#define IPW_CHECK_PTR2(_ptr1_, _ptr2_)                         /*#define IPW_CHECK_PTR2(_ptr1_, _ptr2_)                          \    IPW_MACRO_START                                             \        IPW_ASSERT(PW_NULL != (_ptr1_), (# _ptr1_ " == NULL")); \        IPW_ASSERT(PW_NULL != (_ptr2_), (# _ptr2_ " == NULL")); \    IPW_MACRO_END   */        /*#define IPW_CHECK_PTR3(_ptr1_, _ptr2_, _ptr3_)                  \    IPW_MACRO_START                                             \        IPW_ASSERT(PW_NULL != (_ptr1_), (# _ptr1_ " == NULL")); \        IPW_ASSERT(PW_NULL != (_ptr2_), (# _ptr2_ " == NULL")); \        IPW_ASSERT(PW_NULL != (_ptr3_), (# _ptr3_ " == NULL")); \    IPW_MACRO_END           									 */#define IPW_CHECK_PTR4(_ptr1_, _ptr2_, _ptr3_, _ptr4_)          \    IPW_MACRO_START                                             \        IPW_ASSERT(PW_NULL != (_ptr1_), (# _ptr1_ " == NULL")); \        IPW_ASSERT(PW_NULL != (_ptr2_), (# _ptr2_ " == NULL")); \        IPW_ASSERT(PW_NULL != (_ptr3_), (# _ptr3_ " == NULL")); \        IPW_ASSERT(PW_NULL != (_ptr4_), (# _ptr4_ " == NULL")); \    IPW_MACRO_END           #define IPW_CHECK_PTR5(_ptr1_, _ptr2_, _ptr3_, _ptr4_, _ptr5_)  \    IPW_MACRO_START                                             \        IPW_ASSERT(PW_NULL != (_ptr1_), (# _ptr1_ " == NULL")); \        IPW_ASSERT(PW_NULL != (_ptr2_), (# _ptr2_ " == NULL")); \        IPW_ASSERT(PW_NULL != (_ptr3_), (# _ptr3_ " == NULL")); \        IPW_ASSERT(PW_NULL != (_ptr4_), (# _ptr4_ " == NULL")); \        IPW_ASSERT(PW_NULL != (_ptr5_), (# _ptr5_ " == NULL")); \    IPW_MACRO_END           #define IPW_CHECK_PTR6(_ptr1_, _ptr2_, _ptr3_,                  \                       _ptr4_, _ptr5_, _ptr6_)                  \    IPW_MACRO_START                                             \        IPW_ASSERT(PW_NULL != (_ptr1_), (# _ptr1_ " == NULL")); \        IPW_ASSERT(PW_NULL != (_ptr2_), (# _ptr2_ " == NULL")); \        IPW_ASSERT(PW_NULL != (_ptr3_), (# _ptr3_ " == NULL")); \        IPW_ASSERT(PW_NULL != (_ptr4_), (# _ptr4_ " == NULL")); \        IPW_ASSERT(PW_NULL != (_ptr5_), (# _ptr5_ " == NULL")); \        IPW_ASSERT(PW_NULL != (_ptr6_), (# _ptr6_ " == NULL")); \    IPW_MACRO_END           #define IPW_CHECK_COND(_cond_) 
/*#define IPW_CHECK_COND(_cond_) \    IPW_ASSERT(_cond_, (# _cond_ " is FALSE!"))*//* -------------------------------------------------------------------------- */#ifdef IPW_USE_TRACE#define IPW_TRACE_F(_args_)                               \    IPW_MACRO_START                                       \        IPw_Trace( __FILE__, __LINE__); \        IPw_Printf _args_;                                \    IPW_MACRO_END#define IPW_TRACE1_F(_t_, _a_)                            \    IPW_MACRO_START                                       \        IPw_Trace( __FILE__, __LINE__); \        IPw_Printf(# _a_ "=%" # _t_ " ", _a_);            \    IPW_MACRO_END#define IPW_TRACE2_F(_t_, _a_, _b_)                       \    IPW_MACRO_START                                       \        IPw_Trace( __FILE__, __LINE__); \        IPw_Printf(# _a_ "=%" # _t_ "\t"                   \                   # _b_ "=%" # _t_ "\t",                  \                   _a_, _b_);                             \    IPW_MACRO_END#define IPW_TRACE3_F(_t_, _a_, _b_, _c_)                  \    IPW_MACRO_START                                       \        IPw_Trace( __FILE__, __LINE__); \        IPw_Printf(# _a_ "=%" # _t_ "\t"                   \                   # _b_ "=%" # _t_ "\t"                   \                   # _c_ "=%" # _t_ "\t",                  \                    _a_, _b_, _c_);                       \    IPW_MACRO_END#define IPW_TRACE4_F(_t_, _a_, _b_, _c_, _d_)             \    IPW_MACRO_START                                       \        IPw_Trace( __FILE__, __LINE__); \        IPw_Printf(# _a_ "=%" # _t_ "\t"                   \                   # _b_ "=%" # _t_ "\t"                   \                   # _c_ "=%" # _t_ "\t"                   \                   # _d_ "=%" # _t_ "\t",                  \                   _a_, _b_, _c_, _d_);                   \    IPW_MACRO_END#define IPW_TRACE5_F(_t_, _a_, _b_, _c_, _d_, _e_)        \    IPW_MACRO_START                                       \        IPw_Trace( __FILE__, __LINE__); \        IPw_Printf(# _a_ "=%" # _t_ "\t"                   \                   # _b_ "=%" # _t_ "\t"                   \                   # _c_ "=%" # _t_ "\t"                   \                   # _d_ "=%" # _t_ "\t"                   \                   # _e_ "=%" # _t_ "\t",                  \                   _a_, _b_, _c_, _d_, _e_);              \    IPW_MACRO_END#define IPW_TRACE6_F(_t_, _a_, _b_, _c_, _d_, _e_, _f_)   \    IPW_MACRO_START                                       \        IPw_Trace( __FILE__, __LINE__); \        IPw_Printf(# _a_ "=%" # _t_ "\t"                   \                   # _b_ "=%" # _t_ "\t"                   \                   # _c_ "=%" # _t_ "\t"                   \                   # _d_ "=%" # _t_ "\t"                   \                   # _e_ "=%" # _t_ "\t"                   \                   # _f_ "=%" # _t_ "\t",                  \                   _a_, _b_, _c_, _d_, _e_, _f_);         \    IPW_MACRO_END#define IPW_TRACE1M_F(_ta_, _a_)                          \    IPW_MACRO_START                                       \        IPw_Trace( __FILE__, __LINE__); \        IPw_Printf(# _a_ "=%" # _ta_ " ", _a_);           \    IPW_MACRO_END#define IPW_TRACE2M_F(_ta_, _a_, _tb_, _b_)               \    IPW_MACRO_START                                       \        IPw_Trace( __FILE__, __LINE__); \        IPw_Printf(# _a_ "=%" # _ta_ " "                  \                   # _b_ "=%" # _tb_ " ",                 \                   _a_, _b_);                             \    IPW_MACRO_END#define IPW_TRACE3M_F(_ta_, _a_, _tb_, _b_, _tc_, _c_)    \    IPW_MACRO_START                                       \        IPw_Trace( __FILE__, __LINE__); \        IPw_Printf(# _a_ "=%" # _ta_ " "                  \                   # _b_ "=%" # _tb_ " "                  \                   # _c_ "=%" # _tc_ " ",                 \                    _a_, _b_, _c_);                       \    IPW_MACRO_END#define IPW_TRACE4M_F(_ta_, _a_, _tb_, _b_,               \                      _tc_, _c_, _td_, _d_)               \    IPW_MACRO_START                                       \        IPw_Trace( __FILE__, __LINE__); \        IPw_Printf(# _a_ "=%" # _ta_ " "                  \                   # _b_ "=%" # _tb_ " "                  \                   # _c_ "=%" # _tc_ " "                  \                   # _d_ "=%" # _td_ " ",                 \                   _a_, _b_, _c_, _d_);                   \    IPW_MACRO_END#define IPW_TRACE5M_F(_ta_, _a_, _tb_, _b_,               \                      _tc_, _c_, _td_, _d_, _te_, _e_)    \    IPW_MACRO_START                                       \        IPw_Trace( __FILE__, __LINE__); \        IPw_Printf(# _a_ "=%" # _ta_ " "                  \                   # _b_ "=%" # _tb_ " "                  \                   # _c_ "=%" # _tc_ " "                  \                   # _d_ "=%" # _td_ " "                  \                   # _e_ "=%" # _te_ " ",                 \                   _a_, _b_, _c_, _d_, _e_);              \    IPW_MACRO_END#define IPW_TRACE6M_F(_ta_, _a_, _tb_, _b_, _tc_, _c_,    \                      _td_, _d_, _te_, _e_, _tf_, _f_)    \    IPW_MACRO_START                                       \        IPw_Trace( __FILE__, __LINE__); \        IPw_Printf(# _a_ "=%" # _ta_ " "                  \                   # _b_ "=%" # _tb_ " "                  \                   # _c_ "=%" # _tc_ " "                  \                   # _d_ "=%" # _td_ " "                  \                   # _e_ "=%" # _te_ " "                  \                   # _f_ "=%" # _tf_ " ",                 \

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -