mlinelayoutpiece.h
00001 #if defined (_MGNCSCTRL_TOOLBAR) || defined (_MGNCSCTRL_IMWORDSEL)
00002
00003 #ifndef _MGUI_NCSCTRL_LINELAYOUTPIECE_H
00004 #define _MGUI_NCSCTRL_LINELAYOUTPIECE_H
00005
00006 #ifdef __cplusplus
00007 extern "C" {
00008 #endif
00009
00010 typedef struct _mLineLayoutPieceClass mLineLayoutPieceClass;
00011 typedef struct _mLineLayoutPiece mLineLayoutPiece;
00012
00013 #define NCS_LINELAYOUTPIECENODE_FLAG_FIXED 0x00 //the size of piece is fixed
00014 #define NCS_LINELAYOUTPIECENODE_FLAG_AUTO 0x01 //the size of piece must bigger than def_size
00015 typedef struct _mLineLayoutPieceNode {
00016 mHotPiece * piece;
00017 struct _mLineLayoutPieceNode * next, *prev;
00018 unsigned int flags:8;
00019 unsigned int def_min_size:12;
00020 unsigned int def_max_size:12;
00021 }mLineLayoutPieceNode;
00022
00023 #define mLineLayoutPieceClassHeader(clss, superCls) \
00024 mLayoutPieceClassHeader(clss, superCls) \
00025 BOOL (*addPiece)(clss*, mHotPiece *piece, int type, int min_size, int max_size); \
00026 BOOL (*appendPiece)(clss*, mHotPiece *piece, int type, int min_size, int max_size); \
00027 void (*recalc)(clss*); \
00028 mLineLayoutPieceNode * (*find)(clss *,mHotPiece *piece); \
00029 void (*reset)(clss*, void (*free_piece)(mHotPiece*));
00030
00031 struct _mLineLayoutPieceClass
00032 {
00033 mLineLayoutPieceClassHeader(mLineLayoutPiece, mLayoutPiece)
00034 };
00035
00036 extern mLineLayoutPieceClass g_stmLineLayoutPieceCls;
00037
00038 #define mLineLayoutPieceHeader(clss) \
00039 mLayoutPieceHeader(clss) \
00040 int left:16; \
00041 int top:16; \
00042 int right:16; \
00043 int bottom:16; \
00044 unsigned short direction:1; \
00045 unsigned short autoWrap:1; \
00046 unsigned short line_height:14; \
00047 unsigned char margin; \
00048 unsigned char space; \
00049 mLineLayoutPieceNode *node; \
00050 mLineLayoutPieceNode *tail_node;
00051
00052
00053 struct _mLineLayoutPiece
00054 {
00055 mLineLayoutPieceHeader(mLineLayoutPiece)
00056 };
00057
00058 enum mLineLayoutPieceProps{
00059 NCSP_LINELAYOUTPIECE_COUNT = LINELAYOUTPIECE_PROP_BEGIN,
00060 NCSP_LINELAYOUTPIECE_LINE_HEIGHT,
00061 NCSP_LINELAYOUTPiECE_AUTOWRAP = PIECECOMM_PROP_AUTOWRAP,
00062 NCSP_LINELAYOUTPIECE_DIRECTION = PIECECOMM_PROP_DIRECTION,
00063 NCSP_LINELAYOUTPIECE_SPACE = PIECECOMM_PROP_SPACE,
00064 NCSP_LINELAYOUTPIECE_MARGIN = PIECECOMM_PROP_MARGIN
00065 };
00066
00067 #ifdef __cplusplus
00068 }
00069 #endif
00070
00071 #endif
00072 #endif //_MGNCSCTRL_TOOLBAR