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.

127 lines
3.6 KiB

  1. /*******************************************************************************
  2. *
  3. * (C) COPYRIGHT MICROSOFT CORPORATION, 1998, 1999, 2000
  4. *
  5. * TITLE: PAINTERS.H
  6. *
  7. * VERSION: 1.0
  8. *
  9. * AUTHOR: ShaunIv
  10. *
  11. * DATE: 1/13/1999
  12. *
  13. * DESCRIPTION: Image transition base class and derived classes
  14. *
  15. *******************************************************************************/
  16. #ifndef __PAINTERS_H_INCLUDED
  17. #define __PAINTERS_H_INCLUDED
  18. #include <windows.h>
  19. #include "imgs.h"
  20. #include "randgen.h"
  21. #include "simdc.h"
  22. class CImagePainter
  23. {
  24. private:
  25. CBitmapImage *m_pBitmapImage;
  26. DWORD m_dwInitialTickCount;
  27. bool m_bFirstFrame;
  28. bool m_bAlreadyPaintedLastFrame;
  29. protected:
  30. CRandomNumberGen m_RandomNumberGen;
  31. RECT m_rcScreen;
  32. RECT m_rcImageArea;
  33. RECT m_rcFinal;
  34. DWORD m_dwDuration;
  35. private:
  36. CImagePainter(void);
  37. CImagePainter( const CImagePainter & );
  38. operator=( const CImagePainter & );
  39. public:
  40. CImagePainter( CBitmapImage *pBitmapImage, CSimpleDC &ClientDC, const RECT &rcImageArea, const RECT &rcScreen );
  41. virtual ~CImagePainter(void);
  42. DWORD ElapsedTime(void) const;
  43. CBitmapImage *BitmapImage(void);
  44. void Paint( CSimpleDC &PaintDC );
  45. bool TimerTick( CSimpleDC &ClientDC );
  46. void Erase( CSimpleDC &ClientDC, RECT &rc );
  47. virtual void Paint( CSimpleDC &PaintDC, CSimpleDC &MemoryDC );
  48. virtual bool NeedPainting(void);
  49. virtual bool IsValid(void);
  50. virtual void PaintFrame( CSimpleDC &ClientDC, CSimpleDC &MemoryDC ) = 0;
  51. };
  52. class CSimpleTransitionPainter : public CImagePainter
  53. {
  54. public:
  55. CSimpleTransitionPainter( CBitmapImage *pBitmapImage, CSimpleDC &ClientDC, const RECT &rcImageArea, const RECT &rcScreen );
  56. virtual ~CSimpleTransitionPainter(void);
  57. virtual void PaintFrame( CSimpleDC &ClientDC, CSimpleDC &MemoryDC );
  58. };
  59. class CSlidingTransitionPainter : public CImagePainter
  60. {
  61. private:
  62. RECT m_rcOriginal;
  63. RECT m_rcPrevious;
  64. public:
  65. CSlidingTransitionPainter( CBitmapImage *pBitmapImage, CSimpleDC &ClientDC, const RECT &rcImageArea, const RECT &rcScreen );
  66. virtual ~CSlidingTransitionPainter(void);
  67. virtual bool NeedPainting(void);
  68. virtual void PaintFrame( CSimpleDC &ClientDC, CSimpleDC &MemoryDC );
  69. };
  70. class CRandomBlockPainter : public CImagePainter
  71. {
  72. private:
  73. int *m_pBlockAddresses;
  74. int m_nBlockSize;
  75. int m_nStartIndex;
  76. SIZE m_sizeBlockCount;
  77. public:
  78. CRandomBlockPainter( CBitmapImage *pBitmapImage, CSimpleDC &ClientDC, const RECT &rcImageArea, const RECT &rcScreen );
  79. virtual ~CRandomBlockPainter(void);
  80. virtual bool NeedPainting(void);
  81. virtual bool IsValid(void);
  82. virtual void PaintFrame( CSimpleDC &ClientDC, CSimpleDC &MemoryDC );
  83. };
  84. class CAlphaFadePainter : public CImagePainter
  85. {
  86. private:
  87. BLENDFUNCTION m_bfBlendFunction;
  88. HBITMAP m_hbmpBuffer;
  89. CSimpleDC CompatDC;
  90. public:
  91. CAlphaFadePainter( CBitmapImage *pBitmapImage, CSimpleDC &ClientDC, const RECT &rcImageArea, const RECT &rcScreen );
  92. virtual bool IsValid(void);
  93. virtual ~CAlphaFadePainter(void);
  94. virtual bool NeedPainting(void);
  95. virtual void PaintFrame( CSimpleDC &ClientDC, CSimpleDC &MemoryDC );
  96. };
  97. class COpenCurtainPainter : public CImagePainter
  98. {
  99. private:
  100. int m_nCurrentWidth;
  101. int m_nFinalWidth;
  102. public:
  103. COpenCurtainPainter( CBitmapImage *pBitmapImage, CSimpleDC &ClientDC, const RECT &rcImageArea, const RECT &rcScreen );
  104. virtual ~COpenCurtainPainter(void);
  105. virtual bool NeedPainting(void);
  106. virtual void PaintFrame( CSimpleDC &ClientDC, CSimpleDC &MemoryDC );
  107. };
  108. #endif // __PAINTERS_H_INCLUDED