32 #ifndef _MGUI_NCSCTRL_PAIRPIECE_H 33 #define _MGUI_NCSCTRL_PAIRPIECE_H 39 typedef struct _mPairPieceClass mPairPieceClass;
40 typedef struct _mPairPiece mPairPiece;
42 #define mPairPieceClassHeader(clss, superCls) \ 43 mLayoutPieceClassHeader(clss, superCls) 45 struct _mPairPieceClass
47 mPairPieceClassHeader(mPairPiece, mLayoutPiece)
50 MGNCS_EXPORT
extern mPairPieceClass g_stmPairPieceCls;
52 #define mPairPieceHeader(clss) \ 53 mLayoutPieceHeader(clss) \ 60 mPairPieceHeader(mPairPiece)
63 #define NCS_PAIRPIECE_DIRECTION_MASK 0x80000000 64 #define NCS_PAIRPIECE_FIRST_MASK 0x40000000 65 #define NCS_PAIRPIECE_SIZE_TYPE_MASK 0x30000000 66 #define NCS_PAIRPIECE_SIZE_MASK 0x00000FFF 67 #define NCS_PAIRPIECE_SPACE_MASK 0x0FF00000 68 #define NCS_PAIRPIECE_MARGIN_MASK 0x000FF000 70 #define mPairPiece_setVert(self) ((self)->flags |= NCS_PAIRPIECE_DIRECTION_MASK) 71 #define mPairPiece_setHorz(self) ((self)->flags &= ~NCS_PAIRPIECE_DIRECTION_MASK) 72 #define mPairPiece_isVert(self) ((self)->flags & NCS_PAIRPIECE_DIRECTION_MASK) 74 #define mPairPiece_setReverse(self) ((self)->flags |= NCS_PAIRPIECE_FIRST_MASK) 75 #define mPairPiece_cancelReverse(self) ((self)->flags &= ~NCS_PAIRPIECE_FIRST_MASK) 76 #define mPairPiece_reversed(self) ((self)->flags & NCS_PAIRPIECE_FIRST_MASK) 78 #define mPairPiece_getFirst(self) ((self)->first) 80 #define mPairPiece_getSecond(self) ((self)->second) 81 #define mPairPiece_setFirst(self, piece) do{ \ 82 if(((self)->flags&NCS_PAIRPIECE_FIRST_MASK)) \ 83 (self)->second=(piece); \ 85 (self)->first=(piece); \ 88 #define mPairPiece_setSecond(self, piece) do{ \ 89 if(((self)->flags&NCS_PAIRPIECE_FIRST_MASK)) \ 90 (self)->first=(piece); \ 92 (self)->second=(piece); \ 97 enum mPairPieceSizeType{
98 NCS_PAIRPIECE_ST_FIXED = NCS_LAYOUTPIECE_ST_FIXED,
99 NCS_PAIRPIECE_ST_PERCENT = NCS_LAYOUTPIECE_ST_PERCENT,
100 NCS_PAIRPIECE_ST_AUTO = NCS_LAYOUTPIECE_ST_AUTO
103 #define SET_BIT_VALUE(dword, value, mask,offset) ((dword) = ((dword)& (~(mask))) | (((value)<<(offset))&mask)) 104 #define GET_BIT_VALUE(dword, mask, offset) (((dword)&(mask))>>(offset)) 106 #define mPairPiece_setFirstSizeType(self, type) SET_BIT_VALUE(self->flags, type, NCS_PAIRPIECE_SIZE_TYPE_MASK,28) 107 #define mPairPiece_getFirstSizeType(self) GET_BIT_VALUE(self->flags, NCS_PAIRPIECE_SIZE_TYPE_MASK, 28) 108 #define mPairPiece_setFirstSize(self, size) (self->flags = (self->flags&(~NCS_PAIRPIECE_SIZE_MASK))|((size)&NCS_PAIRPIECE_SIZE_MASK)) 109 #define mPairPiece_getFirstSize(self) (int)(self->flags&NCS_PAIRPIECE_SIZE_MASK) 111 #define mPairPiece_setSpace(self, space) SET_BIT_VALUE(self->flags, space, NCS_PAIRPIECE_SPACE_MASK, 20) 112 #define mPairPiece_getSpace(self) (int)GET_BIT_VALUE(self->flags, NCS_PAIRPIECE_SPACE_MASK, 20) 114 #define mPairPiece_setMargin(self, margin) SET_BIT_VALUE(self->flags, margin, NCS_PAIRPIECE_MARGIN_MASK, 12) 115 #define mPairPiece_getMargin(self) (int)GET_BIT_VALUE(self->flags, NCS_PAIRPIECE_MARGIN_MASK, 12) 117 enum mPairPieceProps{
118 NCSP_PAIRPIECE_SECOND_AS_FIRST = PAIRPIECE_PROP_BEGIN,
119 NCSP_PAIRPIECE_FIRST_SIZE_TYPE,
120 NCSP_PAIRPIECE_FIRST_SIZE,
121 NCSP_PAIRPIECE_FIRST,
122 NCSP_PAIRPIECE_SECOND,
123 NCSP_PAIRPIECE_DIRECTION = PIECECOMM_PROP_DIRECTION,
124 NCSP_PAIRPIECE_SPACE = PIECECOMM_PROP_SPACE,
125 NCSP_PAIRPIECE_MARGIN = PIECECOMM_PROP_MARGIN