diff options
Diffstat (limited to 'Src/tataki/canvas/mac/PaintCanvas.cpp')
-rw-r--r-- | Src/tataki/canvas/mac/PaintCanvas.cpp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Src/tataki/canvas/mac/PaintCanvas.cpp b/Src/tataki/canvas/mac/PaintCanvas.cpp new file mode 100644 index 00000000..6cfeb126 --- /dev/null +++ b/Src/tataki/canvas/mac/PaintCanvas.cpp @@ -0,0 +1,51 @@ +#include "PaintCanvas.h" + +PaintCanvas::PaintCanvas() +{ + qdcontext=0; +} + +bool PaintCanvas::beginPaint(BaseWnd *wnd) +{ + HIWindowRef macWnd = wnd->getOsWindowHandle(); + + qdcontext = GetWindowPort(macWnd); + QDBeginCGContext(qdcontext, &context); + + return true; +} + +PaintCanvas::~PaintCanvas() +{ + if (qdcontext) + QDEndCGContext(qdcontext, &context); +} + +WndCanvas::WndCanvas() +{ + qdcontext=0; +} + +WndCanvas::~WndCanvas() +{ + if (qdcontext) + QDEndCGContext(qdcontext, &context); +} + +int WndCanvas::attachToClient(BaseWnd *basewnd) +{ + HIWindowRef macWnd = basewnd->getOsWindowHandle(); + + qdcontext = GetWindowPort(macWnd); + QDBeginCGContext(qdcontext, &context); + return 1; +} + + +TextInfoCanvas::TextInfoCanvas(BaseWnd */*unused*/) +{ +} + +TextInfoCanvas::~TextInfoCanvas() +{ +} |