aboutsummaryrefslogtreecommitdiff
path: root/Src/tataki/canvas/mac/PaintCanvas.cpp
blob: 6cfeb1268cd0e7e6868c5be31f1ff356f865e896 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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()
{
}