// Created: 2003/04/01
// RCS-ID: $Id$
// Copyright: (c) 2003 David Elliott
-// Licence: wxWindows license
+// Licence: wxWidgets licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/wxprec.h"
#import <AppKit/NSTypesetter.h>
#import <AppKit/NSImage.h>
-#include <wx/listimpl.cpp>
+#include "wx/listimpl.cpp"
WX_DEFINE_LIST(wxCocoaDCStack);
IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{
+ wxAutoNSAutoreleasePool pool;
if(!CocoaTakeFocus()) return;
NSBezierPath *bezpath = [NSBezierPath bezierPathWithRect:NSMakeRect(x,y,width,height)];
CocoaSetPenForNSBezierPath(m_pen,bezpath);
void wxDC::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
{
+ wxAutoNSAutoreleasePool pool;
if(!CocoaTakeFocus()) return;
NSBezierPath *bezpath = [NSBezierPath bezierPath];
[bezpath moveToPoint:NSMakePoint(x1,y1)];
void wxDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
{
+ wxAutoNSAutoreleasePool pool;
if(!CocoaTakeFocus()) return;
wxASSERT_MSG(sm_cocoaNSTextStorage && sm_cocoaNSLayoutManager && sm_cocoaNSTextContainer, wxT("Text system has not been initialized. BAD PROGRAMMER!"));
NSAttributedString *attributedString = [[NSAttributedString alloc]
void wxDC::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask)
{
+ wxAutoNSAutoreleasePool pool;
if(!CocoaTakeFocus()) return;
if(!bmp.Ok())
return;
{
// this is a bit artificial, but we need to force wxDC to think
// the pen has changed
- wxPen* pen = & GetPen();
+ const wxPen* pen = & GetPen();
wxPen tempPen;
m_pen = tempPen;
SetPen(* pen);