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.

70 lines
1016 B

  1. /*
  2. * _DEVSTK.H
  3. *
  4. * Purpose:
  5. * CDevState - handle access to device descriptor
  6. *
  7. * Authors:
  8. * Rick Sailor
  9. */
  10. #ifndef _DEVSTK_H_
  11. #define _DEVSTK_H_
  12. class CTxtEdit;
  13. class CDrawInfo;
  14. // device descriptor
  15. class CDevState
  16. {
  17. public:
  18. CDevState(CTxtEdit * ped);
  19. ~CDevState();
  20. BOOL IsValid() const;
  21. BOOL IsMetafile() const;
  22. BOOL SetDrawInfo(
  23. DWORD dwDrawAspect,
  24. LONG lindex,
  25. const DVTARGETDEVICE *_ptd,
  26. HDC hdcDraw,
  27. HDC hicTargetDev);
  28. BOOL SetDC(HDC hdc);
  29. void ResetDrawInfo();
  30. HDC GetTargetDD();
  31. HDC GetRenderDD();
  32. void ReleaseDC();
  33. BOOL SameDrawAndTargetDevice();
  34. LONG ConvertXToTarget(LONG xPixels);
  35. LONG ConvertXToDraw(LONG xPixels);
  36. LONG ConvertYToDraw(LONG yPixels);
  37. protected:
  38. CTxtEdit * _ped; // used to GetDC and ReleaseDC
  39. CDrawInfo * _pdd;
  40. HDC _hicMainTarget;
  41. };
  42. #ifndef DEBUG
  43. #include <_devstki.h>
  44. #endif // DEBUG
  45. #endif // _DEVSTK_H_