Leaked source code of windows server 2003
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.

155 lines
4.8 KiB

  1. #if !defined(CTRL__OldAnimation_inl__INCLUDED)
  2. #define CTRL__OldAnimation_inl__INCLUDED
  3. #pragma once
  4. #define DEBUG_TRACECREATION 0 // Trace Creation and destruction of animations
  5. /***************************************************************************\
  6. *****************************************************************************
  7. *
  8. * Global Functions
  9. *
  10. *****************************************************************************
  11. \***************************************************************************/
  12. //------------------------------------------------------------------------------
  13. inline int
  14. Round(float f)
  15. {
  16. return (int) (f + 0.5);
  17. }
  18. //------------------------------------------------------------------------------
  19. inline int
  20. Compute(IInterpolation * pipol, float flProgress, int nStart, int nEnd)
  21. {
  22. return Round(pipol->Compute(flProgress, (float) nStart, (float) nEnd));
  23. }
  24. //------------------------------------------------------------------------------
  25. inline float
  26. Compute(IInterpolation * pipol, float flProgress, float flStart, float flEnd)
  27. {
  28. return pipol->Compute(flProgress, flStart, flEnd);
  29. }
  30. /***************************************************************************\
  31. *****************************************************************************
  32. *
  33. * class OldAnimation
  34. *
  35. *****************************************************************************
  36. \***************************************************************************/
  37. //------------------------------------------------------------------------------
  38. inline
  39. OldAnimation::OldAnimation()
  40. {
  41. m_time = IAnimation::tComplete; // By default, completes normally
  42. #if DEBUG_TRACECREATION
  43. Trace("START Animation 0x%p @ %d\n", this, GetTickCount());
  44. #endif // DEBUG_TRACECREATION
  45. }
  46. /***************************************************************************\
  47. *****************************************************************************
  48. *
  49. * class OldAlphaAnimation
  50. *
  51. *****************************************************************************
  52. \***************************************************************************/
  53. //------------------------------------------------------------------------------
  54. inline
  55. OldAlphaAnimation::OldAlphaAnimation()
  56. {
  57. }
  58. //------------------------------------------------------------------------------
  59. inline HRESULT
  60. OldAlphaAnimation::GetInterface(HGADGET hgad, REFIID riid, void ** ppvUnk)
  61. {
  62. return OldAnimation::GetInterface(hgad, s_pridAlpha, riid, ppvUnk);
  63. }
  64. /***************************************************************************\
  65. *****************************************************************************
  66. *
  67. * class OldScaleAnimation
  68. *
  69. *****************************************************************************
  70. \***************************************************************************/
  71. //------------------------------------------------------------------------------
  72. inline
  73. OldScaleAnimation::OldScaleAnimation()
  74. {
  75. }
  76. //------------------------------------------------------------------------------
  77. inline HRESULT
  78. OldScaleAnimation::GetInterface(HGADGET hgad, REFIID riid, void ** ppvUnk)
  79. {
  80. return OldAnimation::GetInterface(hgad, s_pridScale, riid, ppvUnk);
  81. }
  82. /***************************************************************************\
  83. *****************************************************************************
  84. *
  85. * class OldRectAnimation
  86. *
  87. *****************************************************************************
  88. \***************************************************************************/
  89. //------------------------------------------------------------------------------
  90. inline
  91. OldRectAnimation::OldRectAnimation()
  92. {
  93. }
  94. //------------------------------------------------------------------------------
  95. inline HRESULT
  96. OldRectAnimation::GetInterface(HGADGET hgad, REFIID riid, void ** ppvUnk)
  97. {
  98. return OldAnimation::GetInterface(hgad, s_pridRect, riid, ppvUnk);
  99. }
  100. /***************************************************************************\
  101. *****************************************************************************
  102. *
  103. * class OldRotateAnimation
  104. *
  105. *****************************************************************************
  106. \***************************************************************************/
  107. //------------------------------------------------------------------------------
  108. inline
  109. OldRotateAnimation::OldRotateAnimation()
  110. {
  111. }
  112. //------------------------------------------------------------------------------
  113. inline HRESULT
  114. OldRotateAnimation::GetInterface(HGADGET hgad, REFIID riid, void ** ppvUnk)
  115. {
  116. return OldAnimation::GetInterface(hgad, s_pridRotate, riid, ppvUnk);
  117. }
  118. #endif // CTRL__OldAnimation_inl__INCLUDED