mlabelpiece.h
00001 #ifndef _MGNCS_LABELPIECE_H
00002 #define _MGNCS_LABELPIECE_H
00003
00004 #ifdef __cplusplus
00005 extern "C" {
00006 #endif
00007
00008 typedef struct _mLabelPieceClass mLabelPieceClass;
00009 typedef struct _mLabelPiece mLabelPiece;
00010
00011 #define mLabelPieceClassHeader(clss, superCls) \
00012 mStaticPieceClassHeader(clss, superCls)
00013
00014 struct _mLabelPieceClass
00015 {
00016 mLabelPieceClassHeader(mLabelPiece, mStaticPiece)
00017 };
00018
00019 MGNCS_EXPORT extern mLabelPieceClass g_stmLabelPieceCls;
00020
00021 #define mLabelPieceHeader(clss) \
00022 mStaticPieceHeader(clss) \
00023 const char* str; \
00024 char align; \
00025 char valign; \
00026 unsigned char flag;
00027
00028 struct _mLabelPiece
00029 {
00030 mLabelPieceHeader(mLabelPiece)
00031 };
00032
00033 #define mLabelPiece_setFlag(self, bitmask) (((self)->flag)|=(bitmask))
00034 #define mLabelPiece_clearFlag(self, bitmask) (((self)->flag)&=(~(bitmask)))
00035 #define mLabelPiece_isFlag(self, bitmask) (((self->flag)&(bitmask)) == (bitmask))
00036
00037 #define mLabelPiece_setAutoWrap(self, autoWrap) ((autoWrap)?mLabelPiece_setFlag(self, 0x1):mLabelPiece_clearFlag(self, 0x1))
00038 #define mLabelPiece_isAutoWrap(self) mLabelPiece_isFlag(self, 0x1)
00039
00040 #define mLabelPiece_setPrefix(self, prefix) ((prefix)?mLabelPiece_setFlag(self, 0x2):mLabelPiece_clearFlag(self, 0x2))
00041 #define mLabelPiece_isPrefix(self) mLabelPiece_isFlag(self, 0x2)
00042
00043 #define mLabelPiece_setWordBreak(self, wordbreak) ((wordbreak)?mLabelPiece_setFlag(self, 0x4):mLabelPiece_clearFlag(self, 0x4))
00044 #define mLabelPiece_isWordBreak(self) mLabelPiece_isFlag(self, 0x4)
00045
00046 #define mLabelPiece_setSelected(self, selected) ((selected)?mLabelPiece_setFlag(self, 0x8):mLabelPiece_clearFlag(self, 0x8))
00047 #define mLabelPiece_isSelected(self) mLabelPiece_isFlag(self, 0x8)
00048
00049 enum mLabelPieceProps {
00050 NCSP_LABELPIECE_LABEL = LABELPIECE_PROP_BEGIN,
00051 NCSP_LABELPIECE_PREFIX,
00052 NCSP_LABELPIECE_SELECT = PIECECOMM_PROP_SELECT,
00053 NCSP_LABELPIECE_ALIGN = PIECECOMM_PROP_ALIGN,
00054 NCSP_LABELPIECE_VALIGN = PIECECOMM_PROP_VALIGN,
00055 NCSP_LABELPIECE_AUTOWRAP = PIECECOMM_PROP_AUTOWRAP,
00056 NCSP_LABELPIECE_WORDBREAK = PIECECOMM_PROP_WORDBREAK
00057 };
00058
00059
00060 #ifdef __cplusplus
00061 }
00062 #endif
00063
00064 #endif
00065