123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- #ifndef _ANIMLAYER_H
- #define _ANIMLAYER_H
- #include "layer.h"
- // {6B64CD27-5A26-4c4b-8C59-E6A70CF6493A}
- static const GUID animLayerGuid =
- { 0x6b64cd27, 0x5a26, 0x4c4b, { 0x8c, 0x59, 0xe6, 0xa7, 0xc, 0xf6, 0x49, 0x3a } };
- #define ANIMLAYER_SCRIPTPARENT Layer
- class AnimLayerScriptController : public LayerScriptController {
- public:
- virtual const wchar_t *getClassName();
- virtual const wchar_t *getAncestorClassName();
- virtual ScriptObjectController *getAncestorController() { return layerController; }
- virtual int getNumFunctions();
- virtual const function_descriptor_struct *getExportedFunctions();
- virtual GUID getClassGuid();
- virtual ScriptObject *instantiate();
- virtual void destroy(ScriptObject *o);
- virtual void *encapsulate(ScriptObject *o);
- virtual void deencapsulate(void *o);
- private:
- static function_descriptor_struct exportedFunction[];
-
- };
- extern AnimLayerScriptController *animlayerController;
- #ifndef _NOSTUDIO
- #define TIMER_ANIM 872
- #define ANIM_STOPPED 0
- #define ANIM_PLAYING 1
- #define ANIM_PAUSED 2
- #define ANIMLAYER_PARENT Layer
- #define ANIM_UNKNOWN 0
- #define ANIM_VERT 1
- #define ANIM_HORZ 2
- #define ANIM_MULTI 3
- class AnimatedLayer : public ANIMLAYER_SCRIPTPARENT {
- public:
- AnimatedLayer();
- virtual ~AnimatedLayer();
- virtual int onInit();
- virtual int getHeight();
- virtual int getWidth();
- virtual void timerCallback(int id);
- virtual int getSourceOffsetY();
- virtual int getSourceOffsetX();
- virtual void setAutoPlay(int p);
- virtual int setXuiParam(int _xuihandle, int xmlattributeid, const wchar_t *xmlattributename, const wchar_t *value);
-
- virtual void setHeight(int h, int selfset=0);
- virtual void setWidth(int w, int selfset=0);
- virtual SkinBitmap *getBitmap();
- void play();
- void pause();
- void stop();
- int getLength();
- void setStartFrame(int s);
- void setEndFrame(int e);
- void setAutoReplay(int r);
- int getStartFrame();
- int getEndFrame();
- int isPlaying();
- int isPaused();
- int isStopped();
- int getSpeed();
- int getDirection();
- void gotoFrame(int n);
- void setSpeed(int s);
- int getAutoReplay();
- int getCurFrame();
- void setRealtime(int r);
- virtual api_region *getBitmapRegion();
- SkinBitmap *getElementBitmap(int n);
- virtual void makeRegion();
- virtual void deleteRegion();
- void reloadMultipleElements();
- virtual void setElementFrames(int n);
- virtual void setBitmap(const wchar_t *name);
- virtual int onPaint(Canvas *canvas);
- protected:
- /*static */void CreateXMLParameters(int master_handle);
- enum {
- ANIMLAYER_AUTOREPLAY=0,
- ANIMLAYER_AUTOPLAY,
- ANIMLAYER_SPEED,
- ANIMLAYER_FRAMEHEIGHT,
- ANIMLAYER_FRAMEWIDTH,
- ANIMLAYER_REALTIME,
- ANIMLAYER_ELEMENTFRAMES,
- ANIMLAYER_START,
- ANIMLAYER_END,
- ANIMLAYER_DEBUG,
- };
- private:
- int frameHeight, frameWidth;
- int startframe;
- int endframe;
- int status;
- int curframe;
- int autoreplay;
- int speed;
- int timerset;
- int realtime;
- int style;
- int autoplay;
- PtrList<SkinBitmap> bitmap_elements;
- int multiple_elements_frames;
- int debug;
- int xuihandle;
- void _invalidate();
- void stopTimer();
- void startTimer();
- PtrList<RegionI> regionlist;
- int oldstyle;
- static XMLParamPair params[];
- // FG>
- // -- SCRIPT -----------------------------------------------------
- public:
- // virtuals
- virtual void script_play();
- virtual void script_pause();
- virtual void script_stop();
- virtual int script_getLength();
- virtual void script_setStartFrame(int s);
- virtual void script_setEndFrame(int e);
- virtual void script_setAutoReplay(int r);
- virtual void script_setSpeed(int a);
- virtual int script_getStartFrame();
- virtual int script_getEndFrame();
- virtual int script_getSpeed();
- virtual int script_getDirection();
- virtual int script_getAutoReplay();
- virtual int script_isPlaying();
- virtual int script_isStopped();
- virtual int script_isPaused();
- //virtual void script_gotoFrame(int f);
- virtual void script_onFrame(int n);
- virtual void script_onStop();
- virtual void script_onPlay();
- virtual void script_onPause();
- virtual void script_onResume();
- virtual int script_getCurFrame();
- virtual void script_setRealtime(int r);
- static scriptVar script_vcpu_setSpeed(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar s);
- static scriptVar script_vcpu_gotoFrame(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar f);
- static scriptVar script_vcpu_setStartFrame(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar s);
- static scriptVar script_vcpu_setEndFrame(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar e);
- static scriptVar script_vcpu_setAutoReplay(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar ar);
- static scriptVar script_vcpu_play(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
- static scriptVar script_vcpu_pause(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
- static scriptVar script_vcpu_stop(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
- static scriptVar script_vcpu_isPlaying(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
- static scriptVar script_vcpu_isPaused(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
- static scriptVar script_vcpu_isStopped(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
- static scriptVar script_vcpu_getStartFrame(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
- static scriptVar script_vcpu_getEndFrame(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
- static scriptVar script_vcpu_getLength(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
- static scriptVar script_vcpu_getDirection(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
- static scriptVar script_vcpu_getAutoReplay(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
- static scriptVar script_vcpu_getSpeed(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
- static scriptVar script_vcpu_getCurFrame(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
- static scriptVar script_vcpu_setRealtime(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar r);
- static scriptVar script_vcpu_onPlay(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
- static scriptVar script_vcpu_onStop(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
- static scriptVar script_vcpu_onPause(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
- static scriptVar script_vcpu_onResume(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
- static scriptVar script_vcpu_onFrame(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar f);
- #else
- class AnimatedLayer : public ANIMLAYER_SCRIPTPARENT {
- public:
- #endif
- // INSERT_SCRIPT_OBJECT_CONTROL
- };
- extern const wchar_t animLayerXuiObjectStr[];
- extern char animLayerXuiSvcName[];
- class AnimLayerXuiSvc : public XuiObjectSvc<AnimatedLayer, animLayerXuiObjectStr, animLayerXuiSvcName> {};
- #endif
|