Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.4 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: mtkanim.hxx
  3. *
  4. * Copyright (c) 1997 Microsoft Corporation
  5. *
  6. \**************************************************************************/
  7. #ifndef __mtkanim_hxx__
  8. #define __mtkanim_hxx__
  9. #include "mtk.hxx"
  10. // Animation modes
  11. enum {
  12. MTK_ANIMATE_NONE = 0, // ? is this useful ?
  13. MTK_ANIMATE_CONTINUOUS,
  14. MTK_ANIMATE_INTERVAL
  15. };
  16. enum {
  17. MTK_ANIMATE_TIMER_ID = 1
  18. };
  19. typedef void (CALLBACK* MTK_ANIMATEPROC)();
  20. /**************************************************************************\
  21. * MTKANIMATOR
  22. *
  23. \**************************************************************************/
  24. class MTKANIMATOR {
  25. public:
  26. MTKANIMATOR();
  27. MTKANIMATOR( HWND hwndAttach );
  28. ~MTKANIMATOR();
  29. void SetHwnd( HWND hwndAttach ) { hwnd = hwndAttach; };
  30. void SetFunc(MTK_ANIMATEPROC Func);
  31. void SetMode( UINT mode, float *fParam );
  32. BOOL Draw(); // Call animation function
  33. void Start();
  34. void Stop();
  35. //mf: ? need Suspend, Resume ?
  36. private:
  37. void Init();
  38. HWND hwnd; // window the animator is attached to
  39. MTK_ANIMATEPROC AnimateFunc;
  40. UINT msUpdateInterval; // update interval, in milliseconds
  41. int nFrames;
  42. UINT mode;
  43. UINT idTimer; // animate timer
  44. };
  45. typedef MTKANIMATOR* PMTKANIMATOR;
  46. #endif // __mtkanim_hxx__