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.

135 lines
3.8 KiB

  1. #if !defined(CTRL__Flow_inl__INCLUDED)
  2. #define CTRL__Flow_inl__INCLUDED
  3. #pragma once
  4. #if ENABLE_MSGTABLE_API
  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(Interpolation * pipol, float flProgress, int nStart, int nEnd)
  21. {
  22. float flResult = 0.0f;
  23. VerifyHR(pipol->Compute(flProgress, (float) nStart, (float) nEnd, &flResult));
  24. return Round(flResult);
  25. }
  26. //------------------------------------------------------------------------------
  27. inline float
  28. Compute(Interpolation * pipol, float flProgress, float flStart, float flEnd)
  29. {
  30. float flResult = 0.0f;
  31. VerifyHR(pipol->Compute(flProgress, flStart, flEnd, &flResult));
  32. return flResult;
  33. }
  34. /***************************************************************************\
  35. *****************************************************************************
  36. *
  37. * class DuFlow
  38. *
  39. *****************************************************************************
  40. \***************************************************************************/
  41. //------------------------------------------------------------------------------
  42. inline
  43. DuFlow::DuFlow()
  44. {
  45. m_cRef = 1;
  46. }
  47. //------------------------------------------------------------------------------
  48. inline void
  49. DuFlow::AddRef()
  50. {
  51. ++m_cRef;
  52. }
  53. //------------------------------------------------------------------------------
  54. inline void
  55. DuFlow::Release()
  56. {
  57. if (--m_cRef == 0)
  58. Delete();
  59. }
  60. /***************************************************************************\
  61. *****************************************************************************
  62. *
  63. * class DuAlphaFlow
  64. *
  65. *****************************************************************************
  66. \***************************************************************************/
  67. //------------------------------------------------------------------------------
  68. inline float
  69. DuAlphaFlow::BoxAlpha(float flAlpha) const
  70. {
  71. if (flAlpha < 0.0f) {
  72. return 0.0f;
  73. } else if (flAlpha > 1.0f) {
  74. return 1.0f;
  75. } else {
  76. return flAlpha;
  77. }
  78. }
  79. /***************************************************************************\
  80. *****************************************************************************
  81. *
  82. * class DuScaleFlow
  83. *
  84. *****************************************************************************
  85. \***************************************************************************/
  86. /***************************************************************************\
  87. *****************************************************************************
  88. *
  89. * class DuRectFlow
  90. *
  91. *****************************************************************************
  92. \***************************************************************************/
  93. /***************************************************************************\
  94. *****************************************************************************
  95. *
  96. * class DuRotateFlow
  97. *
  98. *****************************************************************************
  99. \***************************************************************************/
  100. //------------------------------------------------------------------------------
  101. inline void
  102. DuRotateFlow::MarkDirty()
  103. {
  104. m_fDirty = TRUE;
  105. }
  106. #endif // ENABLE_MSGTABLE_API
  107. #endif // CTRL__Flow_inl__INCLUDED