📄 xos_typedef.h.svn-base
字号:
//**************************************************************
//Copyright (C), 2008-2008, AnyLook Co., Ltd.
//File name: xOS_Typedef.h
//Author: AnyLook
//Version: 1.0
//Date: 2008/07/31
//Description:
// xOS Include file
//Others:
//Function List:
//<Name> <desc>
//Simple
//History:
//<author> <time> <version > <desc>
// AnyLook 2008/07/31 1.0 build this moudle
//**************************************************************
#if !defined(xOSTYPEDEF_H)
#define xOSTYPEDEF_H
#include "xOS_Comdef.h"
#define MAX_FILE_NAME 260
#define DIRECTORY_CHAR '/'
#define DIRECTORY_STR "/"
#define xOS_SYS_DIR "xos"
#define xOS_SYS_XEF "xos.xdl"
#define xOS_SYS_XBIOS "xbios.xdl"
#define xOS_EXE_EXT ".xef"
#define xOS_LIB_EXT ".xdl"
typedef void* Handler;
typedef void (*PFNxNOTIFY) (void *);
typedef int (*PFNxEXEENTRY) (int, const char *);
typedef int (*PFNxQUIT) (void);
typedef int (*PFNxENTRY) (void *, void **, PFNxEXEENTRY *, PFNxQUIT *);
typedef struct _xOSCallback xOSCallback;
typedef void CancelCB(xOSCallback* pcb);
typedef void NotifyCB(void* pUser);
struct _xOSCallback
{
xOSCallback *pNext; // RESERVED
void *pmc; // RESERVED
CancelCB *pfnCancel; // Filled by callback handler
void *pCancelData; // Filled by callback handler
NotifyCB *pfnNotify; // Filled by caller
void *pNotifyData; // Filled by caller
void *pReserved; // RESERVED - Used by handler
};
#define CB_Init(pcb,pcf,pcx) \
do { \
(pcb)->pfnNotify = (NotifyCB*)(pcf); \
(pcb)->pNotifyData = (pcx); \
} while (0);
#define CB_Cancel(pcb) \
do { \
if (0 != (pcb)->pfnCancel) { \
(pcb)->pfnCancel(pcb); \
} \
} while (0)
#define CB_IsQueued(pcb) (0 != (pcb)->pfnCancel)
// the type of an interface's method vtable
#define VTBL(iname) iname##Vtbl
// shortcut for declaring an abstract interface
#define INTERFACE(iname) \
typedef struct VTBL(iname) VTBL(iname); \
struct VTBL(iname)
// macro for retrieving the vtable from an instance of an interface
#define GETSUBVTBL(p,iname) ((VTBL(iname)*)(p))
// macro for retrieving the vtable from an instance of an interface
#define GETPVTBL(p,iname) (*((VTBL(iname) **)((void *)p)))
// Define an interface vtable (Assumes INHERIT_iname exists for iname)
#define VTBL_DEFINE(iname)\
INTERFACE(iname) \
{\
INHERIT_##iname(iname);\
}
// Define an AEE interface (Assumes INHERIT_iname exists for iname) */
#define INTERFACE_DEFINE(iname)\
typedef struct iname iname;\
VTBL_DEFINE(iname)
#define INHERIT_IFBase(iname) \
uint32 (*AddRef)(iname*); \
uint32 (*Release)(iname*)
INTERFACE_DEFINE(IFBase);
static INLINE uint32 IFBASE_AddRef(IFBase *pMe)
{
return GETPVTBL(pMe,IFBase)->AddRef(pMe);
}
static INLINE uint32 IFBASE_Release(IFBase *pMe)
{
return GETPVTBL(pMe,IFBase)->Release(pMe);
}
// Encoding constants are returned in xOSDevInfo.wEncoding
#if !defined(xOS_ENC_UNICODE)
#define xOS_ENC_UNICODE 0xFF
#define xOS_ENC_UNICODE2 0xFE
#endif
#if !defined(xOS_ENC_KSC5601) || !defined(xOS_ENC_EUC_KR)
#define xOS_ENC_KSC5601 0xFE
#define xOS_ENC_EUC_KR xOS_ENC_KSC5601
#endif
#if !defined(xOS_ENC_S_JIS)
#define xOS_ENC_S_JIS 0xFD
#endif
#if !defined(xOS_ENC_EUC_CN) // Simplified Chinese
#define xOS_ENC_EUC_CN 0xFC
#endif
#if !defined(xOS_RAW_TEXT)
#define xOS_RAW_TEXT 0x0FA
#endif
#if !defined(xOS_ENC_UTF8)
#define xOS_ENC_UTF8 2
#endif
#if !defined(xOS_ENC_ISOLATIN1)
#define xOS_ENC_ISOLATIN1 3
#endif
#if !defined(xOS_ENC_LATIN_HEBREW)
#define xOS_ENC_LATIN_HEBREW 4
#endif
#if !defined(xOS_ENC_GSM_7_BIT_DEFAULT)
#define xOS_ENC_GSM_7_BIT_DEFAULT 5
#endif
#if !defined(xOS_ENC_OCTET)
#define xOS_ENC_OCTET 6
#endif
#define xOS_SIMID_LEN 20
// Device info
typedef struct _xOSDevInfo
{
uint32 m_dwLang; // Used by Resource Loader - See AEE_LNG_XXX below
uint32 m_dwPlatformID; // Platform ID
uint32 m_dwCarrierID; // Carrier ID
char m_pszSIMID[xOS_SIMID_LEN]; // SIM ID
uint16 m_wEncoding; // Character set encoding (xOS_ENC_UNICODE, ....)
flg m_bFlip:1; // Device sends the flip event (EVT_FLIP) when the clamshell is opened/closed
flg m_bVibrator:1; // Vibrator installed
flg m_bExtSpeaker:1; // External speaker installed
flg m_bVR:1; // Voice recognition supported
flg m_bPosLoc:1; // Position location supported
flg m_bMIDI:1; // MIDI file formats supported
flg m_bPen:1; // Pen device supported
} xOSDevInfo;
typedef struct _xOSDateTime
{
uint16 wYear;
uint16 wMonth;
uint16 wDay;
uint16 wHour;
uint16 wMinute;
uint16 wSecond;
uint16 wWeekDay;
} xOSDateTime;
typedef enum
{
_FA_NORMAL =0,
_FA_HIDDEN =0x0001,
_FA_DIR =0x0002,
_FA_READONLY=0x0004,
_FA_SYSTEM =0x0008
} FileAttrib;
typedef enum
{
_SEEK_SET,
_SEEK_CUR,
_SEEK_END
} FileSeekType;
typedef struct _FileInfo
{
FileAttrib attrib;
uint32 dwCreateTime;
uint32 dwAccessTime;
uint32 dwWriteTime;
uint32 dwSize;
char szName[MAX_FILE_NAME];
} FileInfo;
typedef struct _FSInfo
{
uint16 wMaxFiles;
uint16 wFilesUsed;
uint32 dwMaxSpace;
uint32 dwSpaceUsed;
} FSInfo;
//============================================================================
// DATA STRUCTURE DOCUMENTATION
//==============================================================================
//
//AEEDateTime
//
//Description:
//
// This structure contains date and time information.
//
//Definition:
//
//typedef struct AEEDateTime
//{
// uint16 wYear;
// uint16 wMonth;
// uint16 wDay;
// uint16 wHour;
// uint16 wMinute;
// uint16 wSecond;
// uint16 wWeekDay;
//} AEEDateTime;
//
//
//Members:
// wYear : 4-digit year
//
// wMonth : Month 1-12(January=1, December=12)
//
// wDay : Day 1-31
//
// wHour : Hour 0-23
//
// wMinute : Minute 0-59
//
// wSecond : Seconds 0-59
//
// wWeekDay : Day of the week 0-6 (0=Monday, 6=Sunday)
//
//Comments:
// None
//
//See Also:
// None
//==============================================================================
//==============================================================================
#endif // #if !defined(xOSTYPEDEF_H)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -