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.

61 lines
863 B

  1. INLINE CDevDesc::CDevDesc(CTxtEdit * ped) : _ped(ped), _pdd(NULL)
  2. {
  3. // Header does the work
  4. }
  5. INLINE BOOL CDevDesc::IsValid() const
  6. {
  7. return _pdd != NULL;
  8. }
  9. INLINE HDC CDevDesc::GetRenderDC()
  10. {
  11. HDC hdc = NULL;
  12. if (NULL == _pdd)
  13. {
  14. // We don't already have on so try to get one. This is only valid when
  15. // we are inplace active.
  16. SetDrawInfo(
  17. DVA_ASPECT
  18. -1,
  19. NULL,
  20. NULL,
  21. hicTarget);
  22. }
  23. if (_pdd != NULL)
  24. {
  25. hdc = _pdd->GetDC();
  26. }
  27. return hdc;
  28. }
  29. INLINE HDC CDevDesc::GetTargetDC()
  30. {
  31. if (_pdd != NULL)
  32. {
  33. return _pdd->GetTargetDC();
  34. }
  35. if (NULL != _hicMainTarget)
  36. {
  37. return _hicMainTarget;
  38. }
  39. return GetRenderDC();
  40. }
  41. INLINE void CDevDesc::ResetDrawInfo()
  42. {
  43. // We shouldn't reset
  44. Assert
  45. CDrawInfo *pdd = _pdd;
  46. _pdd = _pdd->Pop();
  47. delete pdd;
  48. }