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