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.

140 lines
3.3 KiB

  1. #include "Gdiplus.h"
  2. class MYPATTERNBRUSH
  3. {
  4. public:
  5. UINT bitsOffset;
  6. BITMAPINFO * bmi;
  7. MYPATTERNBRUSH()
  8. {
  9. bitsOffset = 0;
  10. bmi = NULL;
  11. }
  12. ~MYPATTERNBRUSH()
  13. {
  14. if (bmi != NULL)
  15. delete [] bmi;
  16. }
  17. };
  18. class MYOBJECTS
  19. {
  20. public:
  21. enum MYOBJECTTYPE
  22. {
  23. UnknownObjectType,
  24. PenObjectType,
  25. BrushObjectType,
  26. };
  27. MYOBJECTTYPE type;
  28. UINT color;
  29. int penWidth;
  30. int patIndex;
  31. MYPATTERNBRUSH * brushPattern;
  32. MYOBJECTS()
  33. {
  34. type = UnknownObjectType;
  35. color = 0;
  36. penWidth = 1;
  37. patIndex = -1;
  38. brushPattern = NULL;
  39. }
  40. ~MYOBJECTS()
  41. {
  42. if (brushPattern != NULL)
  43. delete brushPattern;
  44. }
  45. };
  46. class MYDATA
  47. {
  48. public:
  49. int recordNum;
  50. int numObjects;
  51. int containerId;
  52. HWND hwnd;
  53. Gdiplus::Graphics * g;
  54. Gdiplus::Metafile * metafile;
  55. SIZEL windowExtent;
  56. SIZEL viewportExtent;
  57. UINT mapMode;
  58. POINTL viewportOrg;
  59. POINTL windowOrg;
  60. float dx;
  61. float dy;
  62. float scaleX;
  63. float scaleY;
  64. MYOBJECTS * pObjects;
  65. MYPATTERNBRUSH * curBrushPattern;
  66. int curPatIndex;
  67. int curBrush;
  68. int curPen;
  69. int curPenWidth;
  70. Gdiplus::FillMode fillMode;
  71. Gdiplus::PointF curPos;
  72. DWORD arcDirection;
  73. Gdiplus::GraphicsPath * path;
  74. BOOL pathOpen;
  75. float miterLimit;
  76. Gdiplus::Matrix matrix;
  77. MYDATA(HWND inHwnd)
  78. {
  79. g = NULL;
  80. hwnd = inHwnd;
  81. recordNum = 0;
  82. numObjects = 0;
  83. containerId = 0;
  84. mapMode = MM_TEXT;
  85. count = 0;
  86. windowExtent.cx = 100;
  87. windowExtent.cy = 100;
  88. viewportExtent.cx = 100;
  89. viewportExtent.cy = 100;
  90. viewportOrg.x = 0;
  91. viewportOrg.y = 0;
  92. windowOrg.x = 0;
  93. windowOrg.y = 0;
  94. dx = 0;
  95. dy = 0;
  96. scaleX = 1;
  97. scaleY = 1;
  98. pObjects = NULL;
  99. curBrushPattern = NULL;
  100. curPatIndex = -1;
  101. curBrush = 0;
  102. curPen = 0;
  103. curPenWidth = 1;
  104. fillMode = Gdiplus::FillModeAlternate;
  105. curPos.X = 0;
  106. curPos.Y = 0;
  107. arcDirection = AD_COUNTERCLOCKWISE;
  108. path = NULL;
  109. pathOpen = FALSE;
  110. miterLimit = 10;
  111. }
  112. ~MYDATA()
  113. {
  114. delete [] pObjects;
  115. delete path;
  116. }
  117. void PushId(int id)
  118. {
  119. if (count >= 10) count--;
  120. ids[count++] = id;
  121. }
  122. int PopId()
  123. {
  124. if (count <= 0) return 0;
  125. return ids[--count];
  126. }
  127. protected:
  128. int ids[10];
  129. int count;
  130. };