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.

59 lines
1.5 KiB

  1. #if !defined(SERVICES__Surface_inl__INCLUDED)
  2. #define SERVICES__Surface_inl__INCLUDED
  3. #pragma once
  4. //------------------------------------------------------------------------------
  5. inline DuSurface::EType
  6. DuSurface::GetSurfaceType(UINT nSurfaceType)
  7. {
  8. AssertMsg(stDC == GSURFACE_HDC, "ID's must match");
  9. return (EType) nSurfaceType;
  10. }
  11. //------------------------------------------------------------------------------
  12. inline UINT
  13. DuSurface::GetSurfaceType(DuSurface::EType type)
  14. {
  15. AssertMsg(stDC == GSURFACE_HDC, "ID's must match");
  16. return (UINT) type;
  17. }
  18. //------------------------------------------------------------------------------
  19. inline HDC
  20. DuDCSurface::GetHDC()
  21. {
  22. return m_hdc;
  23. }
  24. //------------------------------------------------------------------------------
  25. inline Gdiplus::Graphics *
  26. DuGpSurface::GetGraphics()
  27. {
  28. return m_pgpgr;
  29. }
  30. //------------------------------------------------------------------------------
  31. inline
  32. HDC
  33. CastHDC(DuSurface * psrf)
  34. {
  35. AssertMsg(psrf->GetType() == DuSurface::stDC, "Must be an HDC surface");
  36. return ((DuDCSurface *) psrf)->GetHDC();
  37. }
  38. //------------------------------------------------------------------------------
  39. inline
  40. Gdiplus::Graphics *
  41. CastGraphics(DuSurface * psrf)
  42. {
  43. AssertMsg(psrf->GetType() == DuSurface::stGdiPlus, "Must be a GDI+ surface");
  44. return ((DuGpSurface *) psrf)->GetGraphics();
  45. }
  46. #endif // SERVICES__Surface_inl__INCLUDED