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.

139 lines
4.6 KiB

  1. // SimpView.h : interface of the CSimpsonsView class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_SIMPVIEW_H__7CA4916E_71B3_11D1_AA67_00600814AAE9__INCLUDED_)
  5. #define AFX_SIMPVIEW_H__7CA4916E_71B3_11D1_AA67_00600814AAE9__INCLUDED_
  6. #if _MSC_VER >= 1000
  7. #pragma once
  8. #endif // _MSC_VER >= 1000
  9. // GDI+ includes
  10. #include <math.h>
  11. #include <gdiplus.h>
  12. using namespace Gdiplus;
  13. //#include "DXTrans.h"
  14. #include "DXHelper.h"
  15. #include "dxtpriv.h"
  16. #include "Parse.h"
  17. class CSimpsonsView : public CView
  18. {
  19. protected: // create from serialization only
  20. CSimpsonsView();
  21. DECLARE_DYNCREATE(CSimpsonsView)
  22. // Attributes
  23. public:
  24. CSimpsonsDoc* GetDocument();
  25. // Operations
  26. public:
  27. // Overrides
  28. // ClassWizard generated virtual function overrides
  29. //{{AFX_VIRTUAL(CSimpsonsView)
  30. protected:
  31. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  32. virtual void OnDraw(CDC* pDC);
  33. //}}AFX_VIRTUAL
  34. // Implementation
  35. public:
  36. virtual ~CSimpsonsView();
  37. #ifdef _DEBUG
  38. virtual void AssertValid() const;
  39. virtual void Dump(CDumpContext& dc) const;
  40. #endif
  41. protected:
  42. // Generated message map functions
  43. protected:
  44. //{{AFX_MSG(CSimpsonsView)
  45. afx_msg void OnSize(UINT nType, int cx, int cy);
  46. afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  47. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  48. afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  49. afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
  50. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  51. afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
  52. //}}AFX_MSG
  53. DECLARE_MESSAGE_MAP()
  54. private:
  55. HRESULT Render(bool invalidate);
  56. void DrawAll(IDX2D *pDX2D);
  57. void DrawAllGDI(HDC hDC);
  58. void DrawGDIPoly(HDC hDC, PolyInfo *pPoly);
  59. void DrawGDIPolyPathAPI(HDC hDC, PolyInfo *pPoly);
  60. void DrawAllGDIP(HDC hDC);
  61. void BuildGDIPList();
  62. void DrawGDIPPoly(Graphics *g, PolyInfo *pPoly, Pen *pen, Brush *brush);
  63. void DrawGDIPPolyFromList(Graphics *g, int stroke, GraphicsPath *pPath, Pen *pen, Brush *brush);
  64. void UpdateStatusMessage();
  65. void ForceUpdate();
  66. private:
  67. void ToggleGDI();
  68. void ToggleDelegateToGDI();
  69. void ToggleStroke();
  70. void ToggleFill();
  71. void AddRotation(float fTheta);
  72. void ResetTransform();
  73. bool IncrementAttribute(int attribute);
  74. bool IncrementTest();
  75. void PrintTestResults();
  76. HRESULT Resize(DWORD nX, DWORD nY);
  77. void DoMove(POINT &pt);
  78. private:
  79. IDirectDraw3 * m_pDD;
  80. IDirectDrawSurface * m_pddsScreen;
  81. IDXSurfaceFactory * m_pSurfFactory;
  82. IDX2D * m_pDX2D;
  83. IDX2D * m_pDX2DScreen;
  84. IDX2DDebug * m_pDX2DDebug;
  85. CSize m_sizWin;
  86. RECT m_clientRectHack; // client rect in screen coords
  87. GraphicsPath * m_gpPathArray;
  88. DWORD m_dwRenderTime;
  89. bool m_CycleTests; // If true, cycle through all tests
  90. int m_testCaseNumber; // Which test case to render
  91. bool m_bIgnoreStroke;
  92. bool m_bIgnoreFill;
  93. bool m_bNullPenSelected;
  94. HPEN m_hNullPen;
  95. HPEN m_hStrokePen;
  96. //view/tracking parameters
  97. CDX2DXForm m_XForm;
  98. CPoint m_centerPoint;
  99. CPoint m_lastPoint;
  100. bool m_tracking;
  101. bool m_scaling;
  102. bool m_bLButton;
  103. };
  104. #ifndef _DEBUG // debug version in SimpView.cpp
  105. inline CSimpsonsDoc* CSimpsonsView::GetDocument()
  106. { return (CSimpsonsDoc*)m_pDocument; }
  107. #endif
  108. /////////////////////////////////////////////////////////////////////////////
  109. //{{AFX_INSERT_LOCATION}}
  110. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  111. #endif // !defined(AFX_SIMPVIEW_H__7CA4916E_71B3_11D1_AA67_00600814AAE9__INCLUDED_)