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.

575 lines
11 KiB

  1. #include "windowspch.h"
  2. #pragma hdrstop
  3. #include <ddraw.h>
  4. #include <GdiplusMem.h>
  5. #include <GdiplusEnums.h>
  6. #include <GdiplusTypes.h>
  7. #include <GdiplusInit.h>
  8. #include <GdiplusPixelFormats.h>
  9. #include <GdiplusColor.h>
  10. #include <GdiplusMetaHeader.h>
  11. #include <GdiplusImaging.h>
  12. #include <GdiplusColorMatrix.h>
  13. #include <GdiplusGpStubs.h>
  14. #include <GdiplusFlat.h>
  15. extern "C"
  16. {
  17. static void* WINGDIPAPI GdipAlloc(IN size_t size)
  18. {
  19. return NULL;
  20. }
  21. static GpStatus WINGDIPAPI GdipCloneBrush(
  22. GpBrush *brush,
  23. GpBrush **cloneBrush)
  24. {
  25. if (cloneBrush != NULL) {
  26. *cloneBrush = NULL;
  27. }
  28. return NotImplemented;
  29. }
  30. static GpStatus WINGDIPAPI GdipCreateFont(
  31. GDIPCONST GpFontFamily *fontFamily,
  32. REAL emSize,
  33. INT style,
  34. Unit unit,
  35. GpFont **font)
  36. {
  37. if (font != NULL) {
  38. *font = NULL;
  39. }
  40. return NotImplemented;
  41. }
  42. static GpStatus WINGDIPAPI GdipCreateFontFamilyFromName(
  43. GDIPCONST WCHAR *name,
  44. GpFontCollection *fontCollection,
  45. GpFontFamily **FontFamily)
  46. {
  47. if (FontFamily != NULL) {
  48. *FontFamily = NULL;
  49. }
  50. return NotImplemented;
  51. }
  52. static GpStatus WINGDIPAPI GdipCreateFromHDC(
  53. HDC hdc,
  54. GpGraphics **graphics)
  55. {
  56. if (graphics != NULL) {
  57. *graphics = NULL;
  58. }
  59. return NotImplemented;
  60. }
  61. static GpStatus WINGDIPAPI GdipCreateFromHWND(
  62. HWND hwnd,
  63. GpGraphics **graphics)
  64. {
  65. if (graphics != NULL) {
  66. *graphics = NULL;
  67. }
  68. return NotImplemented;
  69. }
  70. static GpStatus WINGDIPAPI GdipCreateFromHWNDICM(
  71. HWND hwnd,
  72. GpGraphics **graphics)
  73. {
  74. if (graphics != NULL) {
  75. *graphics = NULL;
  76. }
  77. return NotImplemented;
  78. }
  79. static GpStatus WINGDIPAPI GdipCreateMatrix(GpMatrix **matrix)
  80. {
  81. if (matrix != NULL) {
  82. *matrix = NULL;
  83. }
  84. return NotImplemented;
  85. }
  86. static GpStatus WINGDIPAPI GdipCreateMatrix2(
  87. REAL m11,
  88. REAL m12,
  89. REAL m21,
  90. REAL m22,
  91. REAL dx,
  92. REAL dy,
  93. GpMatrix **matrix)
  94. {
  95. if (matrix != NULL) {
  96. *matrix = NULL;
  97. }
  98. return NotImplemented;
  99. }
  100. static GpStatus WINGDIPAPI GdipCreatePen1(
  101. ARGB color,
  102. REAL width,
  103. GpUnit unit,
  104. GpPen **pen)
  105. {
  106. if (pen != NULL) {
  107. *pen = NULL;
  108. }
  109. return NotImplemented;
  110. }
  111. static GpStatus WINGDIPAPI GdipCreateRegion(GpRegion **region)
  112. {
  113. if (region != NULL) {
  114. *region = NULL;
  115. }
  116. return NotImplemented;
  117. }
  118. static GpStatus WINGDIPAPI GdipCreateSolidFill(
  119. ARGB color,
  120. GpSolidFill **brush)
  121. {
  122. if (brush != NULL) {
  123. *brush = NULL;
  124. }
  125. return NotImplemented;
  126. }
  127. static GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush *brush)
  128. {
  129. return NotImplemented;
  130. }
  131. static GpStatus WINGDIPAPI GdipDeleteFont(GpFont* font)
  132. {
  133. return NotImplemented;
  134. }
  135. static GpStatus WINGDIPAPI GdipDeleteFontFamily(GpFontFamily *FontFamily)
  136. {
  137. return NotImplemented;
  138. }
  139. static GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics)
  140. {
  141. return NotImplemented;
  142. }
  143. static GpStatus WINGDIPAPI GdipDeleteMatrix(GpMatrix *matrix)
  144. {
  145. return NotImplemented;
  146. }
  147. static GpStatus WINGDIPAPI GdipDeletePen(GpPen *pen)
  148. {
  149. return NotImplemented;
  150. }
  151. static GpStatus WINGDIPAPI GdipDeleteRegion(GpRegion *region)
  152. {
  153. return NotImplemented;
  154. }
  155. static GpStatus WINGDIPAPI GdipDrawLine(
  156. GpGraphics *graphics,
  157. GpPen *pen,
  158. REAL x1,
  159. REAL y1,
  160. REAL x2,
  161. REAL y2)
  162. {
  163. return NotImplemented;
  164. }
  165. static GpStatus WINGDIPAPI GdipDrawRectangle(
  166. GpGraphics *graphics,
  167. GpPen *pen,
  168. REAL x,
  169. REAL y,
  170. REAL width,
  171. REAL height)
  172. {
  173. return NotImplemented;
  174. }
  175. static GpStatus WINGDIPAPI GdipDrawString(
  176. GpGraphics *graphics,
  177. GDIPCONST WCHAR *string,
  178. INT length,
  179. GDIPCONST GpFont *font,
  180. GDIPCONST RectF *layoutRect,
  181. GDIPCONST GpStringFormat *stringFormat,
  182. GDIPCONST GpBrush *brush)
  183. {
  184. return NotImplemented;
  185. }
  186. static GpStatus WINGDIPAPI GdipFillRectangle(
  187. GpGraphics *graphics,
  188. GpBrush *brush,
  189. REAL x,
  190. REAL y,
  191. REAL width,
  192. REAL height)
  193. {
  194. return NotImplemented;
  195. }
  196. static void WINGDIPAPI GdipFree(IN void* ptr)
  197. {
  198. }
  199. static GpStatus WINGDIPAPI GdipGetClip(
  200. GpGraphics *graphics,
  201. GpRegion *region)
  202. {
  203. return NotImplemented;
  204. }
  205. static GpStatus WINGDIPAPI GdipGetCompositingMode(
  206. GpGraphics *graphics,
  207. CompositingMode *compositingMode)
  208. {
  209. if (compositingMode != NULL) {
  210. *compositingMode = CompositingModeSourceOver;
  211. }
  212. return NotImplemented;
  213. }
  214. static GpStatus WINGDIPAPI GdipGetCompositingQuality(
  215. GpGraphics *graphics,
  216. CompositingQuality *compositingQuality)
  217. {
  218. if (compositingQuality != NULL) {
  219. *compositingQuality = CompositingQualityInvalid;
  220. }
  221. return NotImplemented;
  222. }
  223. static GpStatus WINGDIPAPI GdipGetDC(GpGraphics* graphics, HDC * hdc)
  224. {
  225. if (hdc != NULL) {
  226. *hdc = NULL;
  227. }
  228. return NotImplemented;
  229. }
  230. static GpStatus WINGDIPAPI GdipGetFontSize(GpFont *font, REAL *size)
  231. {
  232. if (size != NULL) {
  233. *size = 0.0;
  234. }
  235. return NotImplemented;
  236. }
  237. static GpStatus WINGDIPAPI GdipGetGenericFontFamilySansSerif(
  238. GpFontFamily **nativeFamily)
  239. {
  240. if (nativeFamily != NULL) {
  241. *nativeFamily = NULL;
  242. }
  243. return NotImplemented;
  244. }
  245. static GpStatus WINGDIPAPI GdipGetInterpolationMode(
  246. GpGraphics *graphics,
  247. InterpolationMode *interpolationMode)
  248. {
  249. if (interpolationMode != NULL) {
  250. *interpolationMode = InterpolationModeInvalid;
  251. }
  252. return NotImplemented;
  253. }
  254. static GpStatus WINGDIPAPI GdipGetPixelOffsetMode(
  255. GpGraphics *graphics,
  256. PixelOffsetMode *pixelOffsetMode)
  257. {
  258. if (pixelOffsetMode != NULL) {
  259. *pixelOffsetMode = PixelOffsetModeInvalid;
  260. }
  261. return NotImplemented;
  262. }
  263. static GpStatus WINGDIPAPI GdipGetSmoothingMode(
  264. GpGraphics *graphics,
  265. SmoothingMode *smoothingMode)
  266. {
  267. if (smoothingMode != NULL) {
  268. *smoothingMode = SmoothingModeInvalid;
  269. }
  270. return NotImplemented;
  271. }
  272. static GpStatus WINGDIPAPI GdipGetTextContrast(
  273. GpGraphics *graphics,
  274. UINT * contrast)
  275. {
  276. if (contrast != NULL) {
  277. *contrast = 0;
  278. }
  279. return NotImplemented;
  280. }
  281. static GpStatus WINGDIPAPI GdipGetTextRenderingHint(
  282. GpGraphics *graphics,
  283. TextRenderingHint *mode)
  284. {
  285. if (mode != NULL) {
  286. *mode = TextRenderingHintSystemDefault;
  287. }
  288. return NotImplemented;
  289. }
  290. static GpStatus WINGDIPAPI GdipGetWorldTransform(
  291. GpGraphics *graphics,
  292. GpMatrix *matrix)
  293. {
  294. return NotImplemented;
  295. }
  296. static GpStatus WINGDIPAPI GdipIsClipEmpty(
  297. GpGraphics *graphics,
  298. BOOL *result)
  299. {
  300. if (result != NULL) {
  301. *result = FALSE;
  302. }
  303. return NotImplemented;
  304. }
  305. static GpStatus WINGDIPAPI GdipMeasureString(
  306. GpGraphics *graphics,
  307. GDIPCONST WCHAR *string,
  308. INT length,
  309. GDIPCONST GpFont *font,
  310. GDIPCONST RectF *layoutRect,
  311. GDIPCONST GpStringFormat *stringFormat,
  312. RectF *boundingBox,
  313. INT *codepointsFitted,
  314. INT *linesFilled)
  315. {
  316. return NotImplemented;
  317. }
  318. static GpStatus WINGDIPAPI GdipReleaseDC(GpGraphics* graphics, HDC hdc)
  319. {
  320. return NotImplemented;
  321. }
  322. static GpStatus WINGDIPAPI GdipResetWorldTransform(GpGraphics *graphics)
  323. {
  324. return NotImplemented;
  325. }
  326. static GpStatus WINGDIPAPI GdipRestoreGraphics(
  327. GpGraphics *graphics,
  328. GraphicsState state)
  329. {
  330. return NotImplemented;
  331. }
  332. static GpStatus WINGDIPAPI GdipSaveGraphics(
  333. GpGraphics *graphics,
  334. GraphicsState *state)
  335. {
  336. return NotImplemented;
  337. }
  338. static GpStatus WINGDIPAPI GdipSetClipRect(
  339. GpGraphics *graphics,
  340. REAL x,
  341. REAL y,
  342. REAL width,
  343. REAL height,
  344. CombineMode combineMode)
  345. {
  346. return NotImplemented;
  347. }
  348. static GpStatus WINGDIPAPI GdipSetClipRegion(
  349. GpGraphics *graphics,
  350. GpRegion *region,
  351. CombineMode combineMode)
  352. {
  353. return NotImplemented;
  354. }
  355. static GpStatus WINGDIPAPI GdipSetCompositingMode(
  356. GpGraphics *graphics,
  357. CompositingMode compositingMode)
  358. {
  359. return NotImplemented;
  360. }
  361. static GpStatus WINGDIPAPI GdipSetCompositingQuality(
  362. GpGraphics *graphics,
  363. CompositingQuality compositingQuality)
  364. {
  365. return NotImplemented;
  366. }
  367. static GpStatus WINGDIPAPI GdipSetInterpolationMode(
  368. GpGraphics *graphics,
  369. InterpolationMode interpolationMode)
  370. {
  371. return NotImplemented;
  372. }
  373. static GpStatus WINGDIPAPI GdipSetPixelOffsetMode(
  374. GpGraphics* graphics,
  375. PixelOffsetMode pixelOffsetMode)
  376. {
  377. return NotImplemented;
  378. }
  379. static GpStatus WINGDIPAPI GdipSetSmoothingMode(
  380. GpGraphics *graphics,
  381. SmoothingMode smoothingMode)
  382. {
  383. return NotImplemented;
  384. }
  385. static GpStatus WINGDIPAPI GdipSetTextContrast(
  386. GpGraphics *graphics,
  387. UINT contrast)
  388. {
  389. return NotImplemented;
  390. }
  391. static GpStatus WINGDIPAPI GdipSetTextRenderingHint(
  392. GpGraphics *graphics,
  393. TextRenderingHint mode)
  394. {
  395. return NotImplemented;
  396. }
  397. static GpStatus WINGDIPAPI GdipSetWorldTransform(
  398. GpGraphics *graphics,
  399. GpMatrix *matrix)
  400. {
  401. return NotImplemented;
  402. }
  403. static GpStatus WINGDIPAPI GdipTranslateRegionI(
  404. GpRegion *region,
  405. INT dx,
  406. INT dy)
  407. {
  408. return NotImplemented;
  409. }
  410. static
  411. VOID WINAPI GdiplusShutdown(ULONG_PTR token)
  412. {
  413. }
  414. static
  415. Status WINAPI GdiplusStartup(
  416. OUT ULONG_PTR *token,
  417. const GdiplusStartupInput *input,
  418. OUT GdiplusStartupOutput *output)
  419. {
  420. if (output != NULL) {
  421. ZeroMemory(output, sizeof(GdiplusStartupOutput));
  422. }
  423. return NotImplemented;
  424. }
  425. //
  426. // !! WARNING !! The entries below must be in alphabetical order,
  427. // and are CASE SENSITIVE (eg lower case comes last!)
  428. //
  429. DEFINE_PROCNAME_ENTRIES(gdiplus)
  430. {
  431. DLPENTRY(GdipAlloc)
  432. DLPENTRY(GdipCloneBrush)
  433. DLPENTRY(GdipCreateFont)
  434. DLPENTRY(GdipCreateFontFamilyFromName)
  435. DLPENTRY(GdipCreateFromHDC)
  436. DLPENTRY(GdipCreateFromHWND)
  437. DLPENTRY(GdipCreateFromHWNDICM)
  438. DLPENTRY(GdipCreateMatrix)
  439. DLPENTRY(GdipCreateMatrix2)
  440. DLPENTRY(GdipCreatePen1)
  441. DLPENTRY(GdipCreateRegion)
  442. DLPENTRY(GdipCreateSolidFill)
  443. DLPENTRY(GdipDeleteBrush)
  444. DLPENTRY(GdipDeleteFont)
  445. DLPENTRY(GdipDeleteFontFamily)
  446. DLPENTRY(GdipDeleteGraphics)
  447. DLPENTRY(GdipDeleteMatrix)
  448. DLPENTRY(GdipDeletePen)
  449. DLPENTRY(GdipDeleteRegion)
  450. DLPENTRY(GdipDrawLine)
  451. DLPENTRY(GdipDrawRectangle)
  452. DLPENTRY(GdipDrawString)
  453. DLPENTRY(GdipFillRectangle)
  454. DLPENTRY(GdipFree)
  455. DLPENTRY(GdipGetClip)
  456. DLPENTRY(GdipGetCompositingMode)
  457. DLPENTRY(GdipGetCompositingQuality)
  458. DLPENTRY(GdipGetDC)
  459. DLPENTRY(GdipGetFontSize)
  460. DLPENTRY(GdipGetGenericFontFamilySansSerif)
  461. DLPENTRY(GdipGetInterpolationMode)
  462. DLPENTRY(GdipGetPixelOffsetMode)
  463. DLPENTRY(GdipGetSmoothingMode)
  464. DLPENTRY(GdipGetTextContrast)
  465. DLPENTRY(GdipGetTextRenderingHint)
  466. DLPENTRY(GdipGetWorldTransform)
  467. DLPENTRY(GdipIsClipEmpty)
  468. DLPENTRY(GdipMeasureString)
  469. DLPENTRY(GdipReleaseDC)
  470. DLPENTRY(GdipResetWorldTransform)
  471. DLPENTRY(GdipRestoreGraphics)
  472. DLPENTRY(GdipSaveGraphics)
  473. DLPENTRY(GdipSetClipRect)
  474. DLPENTRY(GdipSetClipRegion)
  475. DLPENTRY(GdipSetCompositingMode)
  476. DLPENTRY(GdipSetCompositingQuality)
  477. DLPENTRY(GdipSetInterpolationMode)
  478. DLPENTRY(GdipSetPixelOffsetMode)
  479. DLPENTRY(GdipSetSmoothingMode)
  480. DLPENTRY(GdipSetTextContrast)
  481. DLPENTRY(GdipSetTextRenderingHint)
  482. DLPENTRY(GdipSetWorldTransform)
  483. DLPENTRY(GdipTranslateRegionI)
  484. DLPENTRY(GdiplusShutdown)
  485. DLPENTRY(GdiplusStartup)};
  486. // BUGBUG (reinerf) - we shouldn't need the EXTERN_C below since we are already in
  487. // an extern "C" {} block, but the compiler seems to get my goat,
  488. // so I murdered his goat in a bloody melee.
  489. EXTERN_C DEFINE_PROCNAME_MAP(gdiplus)
  490. }; // extern "C"