1
0

PaintCanvas.cpp 789 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #include "PaintCanvas.h"
  2. PaintCanvas::PaintCanvas()
  3. {
  4. qdcontext=0;
  5. }
  6. bool PaintCanvas::beginPaint(BaseWnd *wnd)
  7. {
  8. HIWindowRef macWnd = wnd->getOsWindowHandle();
  9. qdcontext = GetWindowPort(macWnd);
  10. QDBeginCGContext(qdcontext, &context);
  11. return true;
  12. }
  13. PaintCanvas::~PaintCanvas()
  14. {
  15. if (qdcontext)
  16. QDEndCGContext(qdcontext, &context);
  17. }
  18. WndCanvas::WndCanvas()
  19. {
  20. qdcontext=0;
  21. }
  22. WndCanvas::~WndCanvas()
  23. {
  24. if (qdcontext)
  25. QDEndCGContext(qdcontext, &context);
  26. }
  27. int WndCanvas::attachToClient(BaseWnd *basewnd)
  28. {
  29. HIWindowRef macWnd = basewnd->getOsWindowHandle();
  30. qdcontext = GetWindowPort(macWnd);
  31. QDBeginCGContext(qdcontext, &context);
  32. return 1;
  33. }
  34. TextInfoCanvas::TextInfoCanvas(BaseWnd */*unused*/)
  35. {
  36. }
  37. TextInfoCanvas::~TextInfoCanvas()
  38. {
  39. }