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.

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