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.

186 lines
5.2 KiB

  1. #if !defined(CTRL__Flow_h__INCLUDED)
  2. #define CTRL__Flow_h__INCLUDED
  3. #pragma once
  4. #if ENABLE_MSGTABLE_API
  5. //------------------------------------------------------------------------------
  6. class DuFlow :
  7. public FlowImpl<DuFlow, DUser::SGadget>
  8. {
  9. // Construction
  10. public:
  11. inline DuFlow();
  12. // Public API
  13. public:
  14. dapi HRESULT ApiAddRef(Flow::AddRefMsg *) { AddRef(); return S_OK; }
  15. dapi HRESULT ApiRelease(Flow::ReleaseMsg *) { Release(); return S_OK; }
  16. dapi HRESULT ApiGetPRID(Flow::GetPRIDMsg * pmsg) { pmsg->prid = 0; return S_OK; }
  17. dapi HRESULT ApiGetKeyFrame(Flow::GetKeyFrameMsg * pmsg);
  18. dapi HRESULT ApiSetKeyFrame(Flow::SetKeyFrameMsg * pmsg);
  19. dapi HRESULT ApiOnReset(Flow::OnResetMsg * pmsg);
  20. dapi HRESULT ApiOnAction(Flow::OnActionMsg * pmsg);
  21. // Implementation
  22. protected:
  23. inline void AddRef();
  24. inline void Release();
  25. // Data
  26. protected:
  27. UINT m_cRef;
  28. };
  29. //------------------------------------------------------------------------------
  30. class DuAlphaFlow :
  31. public AlphaFlowImpl<DuAlphaFlow, DuFlow>
  32. {
  33. // Construction
  34. public:
  35. static HRESULT InitClass();
  36. HRESULT PostBuild(DUser::Gadget::ConstructInfo * pci);
  37. // Operations
  38. public:
  39. // Public API:
  40. public:
  41. dapi HRESULT ApiGetPRID(Flow::GetPRIDMsg * pmsg) { pmsg->prid = s_pridAlpha; return S_OK; }
  42. dapi HRESULT ApiGetKeyFrame(Flow::GetKeyFrameMsg * pmsg);
  43. dapi HRESULT ApiSetKeyFrame(Flow::SetKeyFrameMsg * pmsg);
  44. dapi HRESULT ApiOnReset(Flow::OnResetMsg * pmsg);
  45. dapi HRESULT ApiOnAction(Flow::OnActionMsg * pmsg);
  46. // Implementaton
  47. protected:
  48. void SetVisualAlpha(Visual * pgvSubject, float flAlpha);
  49. inline float BoxAlpha(float flAlpha) const;
  50. // Data
  51. public:
  52. static PRID s_pridAlpha;
  53. protected:
  54. float m_flStart;
  55. float m_flEnd;
  56. };
  57. //------------------------------------------------------------------------------
  58. class DuRectFlow :
  59. public RectFlowImpl<DuRectFlow, DuFlow>
  60. {
  61. // Construction
  62. public:
  63. static HRESULT InitClass();
  64. HRESULT PostBuild(DUser::Gadget::ConstructInfo * pci);
  65. // Operations
  66. public:
  67. // Public API:
  68. public:
  69. dapi HRESULT ApiGetPRID(Flow::GetPRIDMsg * pmsg) { pmsg->prid = s_pridRect; return S_OK; }
  70. dapi HRESULT ApiGetKeyFrame(Flow::GetKeyFrameMsg * pmsg);
  71. dapi HRESULT ApiSetKeyFrame(Flow::SetKeyFrameMsg * pmsg);
  72. dapi HRESULT ApiOnReset(Flow::OnResetMsg * pmsg);
  73. dapi HRESULT ApiOnAction(Flow::OnActionMsg * pmsg);
  74. // Implementaton
  75. protected:
  76. // Data
  77. public:
  78. static PRID s_pridRect;
  79. protected:
  80. POINT m_ptStart;
  81. POINT m_ptEnd;
  82. SIZE m_sizeStart;
  83. SIZE m_sizeEnd;
  84. UINT m_nChangeFlags;
  85. };
  86. //------------------------------------------------------------------------------
  87. class DuRotateFlow :
  88. public RotateFlowImpl<DuRotateFlow, DuFlow>
  89. {
  90. // Construction
  91. public:
  92. static HRESULT InitClass();
  93. HRESULT PostBuild(DUser::Gadget::ConstructInfo * pci);
  94. // Operations
  95. public:
  96. // Public API:
  97. public:
  98. dapi HRESULT ApiGetPRID(Flow::GetPRIDMsg * pmsg) { pmsg->prid = s_pridRotate; return S_OK; }
  99. dapi HRESULT ApiGetKeyFrame(Flow::GetKeyFrameMsg * pmsg);
  100. dapi HRESULT ApiSetKeyFrame(Flow::SetKeyFrameMsg * pmsg);
  101. dapi HRESULT ApiOnReset(Flow::OnResetMsg * pmsg);
  102. dapi HRESULT ApiOnAction(Flow::OnActionMsg * pmsg);
  103. // Implementaton
  104. protected:
  105. void ComputeAngles();
  106. inline void MarkDirty();
  107. // Data
  108. public:
  109. static PRID s_pridRotate;
  110. protected:
  111. float m_flRawStart; // User specified starting angle
  112. float m_flRawEnd;
  113. float m_flActualStart;// Actually computed starting angle
  114. float m_flActualEnd;
  115. RotateFlow::EDirection
  116. m_nDir;
  117. BOOL m_fDirty; // State has changed since last updated
  118. };
  119. //------------------------------------------------------------------------------
  120. class DuScaleFlow :
  121. public ScaleFlowImpl<DuScaleFlow, DuFlow>
  122. {
  123. // Construction
  124. public:
  125. static HRESULT InitClass();
  126. HRESULT PostBuild(DUser::Gadget::ConstructInfo * pci);
  127. // Operations
  128. public:
  129. // Public API:
  130. public:
  131. dapi HRESULT ApiGetPRID(Flow::GetPRIDMsg * pmsg) { pmsg->prid = s_pridScale; return S_OK; }
  132. dapi HRESULT ApiGetKeyFrame(Flow::GetKeyFrameMsg * pmsg);
  133. dapi HRESULT ApiSetKeyFrame(Flow::SetKeyFrameMsg * pmsg);
  134. dapi HRESULT ApiOnReset(Flow::OnResetMsg * pmsg);
  135. dapi HRESULT ApiOnAction(Flow::OnActionMsg * pmsg);
  136. // Implementaton
  137. protected:
  138. // Data
  139. public:
  140. static PRID s_pridScale;
  141. protected:
  142. float m_flStart;
  143. float m_flEnd;
  144. };
  145. #endif // ENABLE_MSGTABLE_API
  146. #include "Flow.inl"
  147. #endif // CTRL__Flow_h__INCLUDED