43 #ifdef _MGNCSCTRL_ANIMATE
44 #ifndef _MGNCS_ANIMATEPIECE_H
45 #define _MGNCS_ANIMATEPIECE_H
51 typedef struct _mAnimatePiece mAnimatePiece;
52 typedef struct _mAnimatePieceClass mAnimatePieceClass;
54 #define mAnimatePieceHeader(clss) \
55 mStaticPieceHeader(clss) \
56 unsigned char flags; \
57 unsigned char align:4; \
58 unsigned char valign:4; \
59 mAnimateFrames *frame;
63 mAnimatePieceHeader(mAnimatePiece)
66 #define mAnimatePieceClassHeader(clss, superCls) \
67 mStaticPieceClassHeader(clss, superCls) \
68 void (*reset)(mAnimatePiece *self); \
69 void (*autofit)(mAnimatePiece *self, int *width, int *height); \
71 struct _mAnimatePieceClass
73 mAnimatePieceClassHeader(mAnimatePiece, mStaticPiece)
76 MGNCS_EXPORT
extern mAnimatePieceClass g_stmAnimatePieceCls;
78 enum mAnimatePieceProps {
79 NCSP_ANIMATEPIECE_GIFFILE = ANIMATEPIECE_PROP_BEGIN,
80 NCSP_ANIMATEPIECE_DIR,
81 NCSP_ANIMATEPIECE_MEM,
82 NCSP_ANIMATEPIECE_AUTOLOOP,
83 NCSP_ANIMATEPIECE_SCALE,
84 NCSP_ANIMATEPIECE_AUTOFIT,
85 NCSP_ANIMATEPIECE_AUTOPLAY,
86 NCSP_ANIMATEPIECE_BMPARRAY,
87 NCSP_ANIMATEPIECE_AFRAME,
88 NCSP_ANIMATEPIECE_ALIGN = PIECECOMM_PROP_ALIGN,
89 NCSP_ANIMATEPIECE_VALIGN = PIECECOMM_PROP_VALIGN
92 #define NCSS_AF_AUTOLOOP 0x01
93 #define NCSS_AF_PLAY 0x02
94 #define NCSS_AF_SCALE 0x04
95 #define NCSS_AF_AUTOFIT 0x08
96 #define NCSS_AF_AUTOPLAY 0x10
98 #define mAnimatePiece_setAutoloop(self, bautoloop) \
99 ((bautoloop)?SET_BIT((self)->flags, NCSS_AF_AUTOLOOP):CLEAR_BIT((self)->flags, NCSS_AF_AUTOLOOP))
101 #define mAnimatePiece_isAutoloop(self) \
102 IS_BIT_SET((self)->flags, NCSS_AF_AUTOLOOP)
104 #define mAnimatePiece_setScale(self, bscale) \
105 ((bscale)?SET_BIT((self)->flags, NCSS_AF_SCALE):CLEAR_BIT((self)->flags, NCSS_AF_SCALE))
107 #define mAnimatePiece_isScale(self) \
108 IS_BIT_SET((self)->flags, NCSS_AF_SCALE)
110 #define mAnimatePiece_setAutofit(self, bautofit) \
111 ((bautofit)?SET_BIT((self)->flags, NCSS_AF_AUTOFIT):CLEAR_BIT((self)->flags, NCSS_AF_AUTOFIT))
113 #define mAnimatePiece_isAutofit(self) \
114 IS_BIT_SET((self)->flags, NCSS_AF_AUTOFIT)
116 #define mAnimatePiece_setPlay(self, bplay) \
117 ((bplay)?SET_BIT((self)->flags, NCSS_AF_PLAY):CLEAR_BIT((self)->flags, NCSS_AF_PLAY))
119 #define mAnimatePiece_isPlay(self) \
120 IS_BIT_SET((self)->flags, NCSS_AF_PLAY)
122 #define mAnimatePiece_setAutoplay(self, bautoplay) \
123 ((bautoplay)?SET_BIT((self)->flags, NCSS_AF_AUTOPLAY):CLEAR_BIT((self)->flags, NCSS_AF_AUTOPLAY))
125 #define mAnimatePiece_isAutoplay(self) \
126 IS_BIT_SET((self)->flags, NCSS_AF_AUTOPLAY)
133 #endif //_MGNCSCTRL_ANIMATE