mboxlayoutpiece.h
00001
00002 #ifndef _MGUI_NCSCTRL_BOXLAYOUTPIECE_H
00003 #define _MGUI_NCSCTRL_BOXLAYOUTPIECE_H
00004
00005 #ifdef __cplusplus
00006 extern "C" {
00007 #endif
00008
00009 typedef struct _mBoxLayoutPieceClass mBoxLayoutPieceClass;
00010 typedef struct _mBoxLayoutPiece mBoxLayoutPiece;
00011
00012 #define mBoxLayoutPieceClassHeader(clss, superCls) \
00013 mLayoutPieceClassHeader(clss, superCls) \
00014 \
00015 void (*recalcBox)(clss *); \
00016 int (*getCellAutoSize)(clss *, int i); \
00017 \
00018 int (*setCellInfo)(clss *, int idx, int size, int type, BOOL bupdate); \
00019 mHotPiece* (*setCell)(clss *, int idx, mHotPiece *cell); \
00020 mHotPiece* (*getCell)(clss *, int idx);
00021
00022 struct _mBoxLayoutPieceClass
00023 {
00024 mBoxLayoutPieceClassHeader(mBoxLayoutPiece, mLayoutPiece)
00025 };
00026
00027 MGNCS_EXPORT extern mBoxLayoutPieceClass g_stmBoxLayoutPieceCls;
00028
00029 #define mBoxLayoutPieceHeader(clss) \
00030 mLayoutPieceHeader(clss) \
00031 int left:16; \
00032 int top:16; \
00033 int right:16; \
00034 int bottom:16; \
00035 unsigned short count; \
00036 unsigned char margin; \
00037 unsigned char space; \
00038 unsigned short * cell_info; \
00039 mHotPiece ** cells;
00040
00041
00042 struct _mBoxLayoutPiece
00043 {
00044 mBoxLayoutPieceHeader(mBoxLayoutPiece)
00045 };
00046
00047 #define mBoxLayoutPiece_getSizeType(size) mLayoutPiece_getSizeType(size)
00048 #define mBoxLayoutPiece_setSizeType(size, type) mLayoutPiece_setSizeType(size, type)
00049 #define mBoxLayoutPiece_setSize(size, value) mLayoutPiece_setSize(size, value)
00050 #define mBoxLayoutPiece_getSize(size) mLayoutPiece_getSize(size)
00051
00052
00053 enum mBoxLayoutPieceProps{
00054 NCSP_BOXLAYOUTPIECE_COUNT = BOXLAYOUTPIECE_PROP_BEGIN,
00055 NCSP_BOXLAYOUTPIECE_SPACE = PIECECOMM_PROP_SPACE,
00056 NCSP_BOXLAYOUTPIECE_MARGIN = PIECECOMM_PROP_MARGIN
00057 };
00058
00061 BOOL mBoxLayoutPiece_calcSize(mBoxLayoutPiece *self, int total_size, int *sizes);
00062
00063 #ifdef __cplusplus
00064 }
00065 #endif
00066
00067 #endif
00068