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.

84 lines
1.6 KiB

  1. #ifndef _GDIPPEN_HPP
  2. #define _GDIPPEN_HPP
  3. class TestPenInterface : public TestConfigureInterface,
  4. public TestDialogInterface
  5. {
  6. public:
  7. // acquire brush object
  8. virtual Pen* GetPen() { return pen; };
  9. // output pen setup to File
  10. virtual VOID AddToFile(OutputFile* outfile, INT id = 0) = 0;
  11. ~TestPenInterface()
  12. {
  13. delete pen;
  14. }
  15. protected:
  16. // pointer to underlying GDI+ brush object
  17. Pen *pen;
  18. };
  19. class TestPen : public TestPenInterface
  20. {
  21. public:
  22. TestPen()
  23. {
  24. pen = NULL;
  25. brush = NULL;
  26. tempBrush = NULL;
  27. }
  28. // Configuration Interface
  29. virtual BOOL ChangeSettings(HWND hwnd);
  30. virtual VOID Initialize();
  31. // Dialog Management Interface
  32. virtual VOID InitDialog(HWND hwnd);
  33. virtual BOOL SaveValues(HWND hwnd);
  34. virtual BOOL ProcessDialog(HWND hwnd,
  35. UINT msg,
  36. WPARAM wParam,
  37. LPARAM lParam);
  38. // output pen setup to File
  39. virtual VOID AddToFile(OutputFile* outfile, INT id = 0);
  40. virtual TestPen* Clone()
  41. {
  42. TestPen *newPen = new TestPen();
  43. *newPen = *this; // bitwise copy
  44. if (pen)
  45. newPen->pen = pen->Clone();
  46. if (brush)
  47. newPen->brush = brush->Clone();
  48. if (tempBrush)
  49. newPen->tempBrush = tempBrush->Clone();
  50. return newPen;
  51. };
  52. protected:
  53. // helper routine to toggle enable/disable of brush
  54. VOID EnableBrushFields(HWND hwnd, BOOL enable = TRUE);
  55. private:
  56. // tempBrush should be NULL unless we are changing settings
  57. TestBrush *brush, *tempBrush;
  58. INT brushSelect, tempBrushSelect;
  59. BOOL useBrush;
  60. ARGB argb;
  61. REAL width;
  62. INT startCap, endCap, dashCap;
  63. INT lineJoin;
  64. REAL miterLimit;
  65. INT dashStyle;
  66. };
  67. #endif