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.

212 lines
5.5 KiB

  1. #if !defined(INC__DUserCtrl_h__INCLUDED)
  2. #define INC__DUserCtrl_h__INCLUDED
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #ifdef __cplusplus
  7. #define BEGIN_INTERPOLATION_INTERFACE(i, guid) \
  8. struct __declspec(uuid(guid)) i; \
  9. struct i : public IInterpolation \
  10. {
  11. #define END_INTERPOLATION_INTERFACE() \
  12. };
  13. #define BEGIN_ANIMATION_INTERFACE(i, guid) \
  14. struct __declspec(uuid(guid)) i; \
  15. struct i : public IAnimation \
  16. {
  17. #define END_ANIMATION_INTERFACE() \
  18. };
  19. #else
  20. // TODO: Create C definition
  21. #endif
  22. /***************************************************************************\
  23. *
  24. * ButtonGadget
  25. *
  26. \***************************************************************************/
  27. DEFINE_EVENT(evButtonClicked, "DCADCE53-062B-4d1f-B36F-3F2EB27B88CF");
  28. #ifdef GADGET_ENABLE_COM
  29. /***************************************************************************\
  30. *
  31. * Interpolation
  32. *
  33. \***************************************************************************/
  34. struct __declspec(uuid("E188CC9E-4805-487d-9313-3B22AC8FE336")) IInterpolation;
  35. interface IInterpolation : public IUnknown
  36. {
  37. public:
  38. STDMETHOD_(float, Compute)(float flProgress, float flStart, float flEnd) PURE;
  39. };
  40. BEGIN_INTERPOLATION_INTERFACE(ILinearInterpolation, "3FD65045-7BF5-4a65-B137-F441529BD8F4")
  41. END_INTERPOLATION_INTERFACE()
  42. BEGIN_INTERPOLATION_INTERFACE(ILogInterpolation, "98C0FB9A-534D-4b9f-A439-A8E13F0C2D9E")
  43. STDMETHOD_(void, SetScale)(float flScale) PURE;
  44. END_INTERPOLATION_INTERFACE()
  45. BEGIN_INTERPOLATION_INTERFACE(IExpInterpolation, "280DC2CC-7703-4147-8356-3FAACE662CD1")
  46. STDMETHOD_(void, SetScale)(float flScale) PURE;
  47. END_INTERPOLATION_INTERFACE()
  48. BEGIN_INTERPOLATION_INTERFACE(ISInterpolation, "D07C8B2F-1896-438f-9EC2-6938ABD0D20C")
  49. STDMETHOD_(void, SetScale)(float flScale) PURE;
  50. END_INTERPOLATION_INTERFACE()
  51. #define INTERPOLATION_LINEAR (1)
  52. #define INTERPOLATION_LOG (2)
  53. #define INTERPOLATION_EXP (3)
  54. #define INTERPOLATION_S (4)
  55. DUSER_API BOOL WINAPI BuildInterpolation(UINT nIPolID, int nVersion, REFIID riid, void ** ppvUnk);
  56. /***************************************************************************\
  57. *
  58. * Animations
  59. *
  60. \***************************************************************************/
  61. #ifdef GADGET_ENABLE_TRANSITIONS
  62. interface IAnimationCallback;
  63. struct __declspec(uuid("7AACE668-81EB-48d7-8734-267C83FF6DFF")) IAnimation;
  64. interface IAnimation : public IUnknown
  65. {
  66. public:
  67. STDMETHOD_(void, SetFunction)(IInterpolation * pipol) PURE;
  68. enum ETime {
  69. tComplete, // Completed normally
  70. tEnd, // Jumped to end
  71. tAbort, // Aborted in place
  72. tReset, // Reset to beginning
  73. tDestroy // The Gadget being animationed has been destroyed
  74. };
  75. STDMETHOD_(void, SetTime)(ETime time) PURE;
  76. STDMETHOD_(UINT, GetID)() const PURE;
  77. STDMETHOD_(void, SetCallback)(IAnimationCallback * pcb) PURE;
  78. };
  79. interface IAnimationCallback : public IUnknown
  80. {
  81. public:
  82. STDMETHOD_(void, OnComplete)(IAnimation * pAni, IAnimation::ETime time) PURE;
  83. STDMETHOD_(void, OnSetTime)(IAnimation * pAni, IAnimation::ETime time) PURE;
  84. };
  85. #define ANIF_USESTART 0x00000001 // Use the specified start values
  86. // instead of querying the current
  87. struct GANI_DESC
  88. {
  89. DWORD cbSize;
  90. HGADGET hgadChange;
  91. GMA_ACTION act;
  92. UINT nAniFlags;
  93. IInterpolation *
  94. pipol;
  95. IAnimationCallback *
  96. pcb;
  97. };
  98. #define GANI_ALPHACOMPLETE_OPTIMIZE 0x00000001 // Turn off alpha-blending if not needed
  99. struct GANI_ALPHADESC : public GANI_DESC
  100. {
  101. float flStart;
  102. float flEnd;
  103. BOOL fPushToChildren;
  104. UINT nOnComplete;
  105. };
  106. struct GANI_SCALEDESC : public GANI_DESC
  107. {
  108. enum EAlignment {
  109. aTopLeft,
  110. aTopCenter,
  111. aTopRight,
  112. aMiddleLeft,
  113. aMiddleCenter,
  114. aMiddleRight,
  115. aBottomLeft,
  116. aBottomCenter,
  117. aBottomRight
  118. };
  119. EAlignment al;
  120. float flStart;
  121. float flEnd;
  122. };
  123. struct GANI_RECTDESC : public GANI_DESC
  124. {
  125. POINT ptStart;
  126. POINT ptEnd;
  127. SIZE sizeStart;
  128. SIZE sizeEnd;
  129. UINT nChangeFlags;
  130. };
  131. #define GANI_ROTATEDIRECTION_SHORT 0 // Shortest arc
  132. #define GANI_ROTATEDIRECTION_LONG 1 // Longer arc
  133. #define GANI_ROTATEDIRECTION_CW 2 // Clock-wise
  134. #define GANI_ROTATEDIRECTION_CCW 3 // Counter clock-wise
  135. struct GANI_ROTATEDESC : public GANI_DESC
  136. {
  137. float flStart;
  138. float flEnd;
  139. UINT nDir;
  140. };
  141. #define ANIMATION_ALPHA (1)
  142. #define ANIMATION_SCALE (2)
  143. #define ANIMATION_RECT (3)
  144. #define ANIMATION_ROTATE (4)
  145. DUSER_API BOOL WINAPI BuildAnimation(UINT nAniID, int nVersion, GANI_DESC * pDesc, REFIID riid, void ** ppvUnk);
  146. DUSER_API BOOL WINAPI GetGadgetAnimation(HGADGET hgad, UINT nAniID, REFIID riid, void ** ppvUnk);
  147. #endif // GADGET_ENABLE_TRANSITIONS
  148. #endif // GADGET_ENABLE_COM
  149. DUSER_API BOOL WINAPI BuildDropTarget(HGADGET hgadRoot, HWND hwnd);
  150. #ifdef __cplusplus
  151. };
  152. #endif
  153. #endif // INC__DUserCtrl_h__INCLUDED