// Created: 2003/04/01
// RCS-ID: $Id$
// Copyright: (c) 2003 David Elliott
-// Licence: wxWidgets licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/wxprec.h"
#include "wx/cocoa/autorelease.h"
#include "wx/cocoa/string.h"
+#include "wx/cocoa/ObjcRef.h"
#import <AppKit/NSBezierPath.h>
#import <AppKit/NSTextStorage.h>
void wxCocoaDCImpl::CocoaInitializeTextSystem()
{
+ wxAutoNSAutoreleasePool pool;
+
wxASSERT_MSG(!sm_cocoaNSTextStorage && !sm_cocoaNSLayoutManager && !sm_cocoaNSTextContainer,wxT("Text system already initalized! BAD PROGRAMMER!"));
- sm_cocoaNSTextStorage = [[NSTextStorage alloc] init];
+ // FIXME: Never released
+ sm_cocoaNSTextStorage = wxGCSafeRetain([[[NSTextStorage alloc] init] autorelease]);
+
+ // FIXME: Never released
+ sm_cocoaNSLayoutManager = wxGCSafeRetain([[[NSLayoutManager alloc] init] autorelease]);
- sm_cocoaNSLayoutManager = [[NSLayoutManager alloc] init];
[sm_cocoaNSTextStorage addLayoutManager:sm_cocoaNSLayoutManager];
// NSTextStorage retains NSLayoutManager, but so do we
// [sm_cocoaNSLayoutManager release]; [sm_cocoaNSLayoutManager retain];
// NOTE: initWithContainerSize is the designated initializer, but the
// Apple CircleView sample gets away with just calling init, which
// is all we really need for our purposes.
- sm_cocoaNSTextContainer = [[NSTextContainer alloc] init];
+ // FIXME: Never released
+ sm_cocoaNSTextContainer = wxGCSafeRetain([[[NSTextContainer alloc] init] autorelease]);
[sm_cocoaNSLayoutManager addTextContainer:sm_cocoaNSTextContainer];
// NSLayoutManager retains NSTextContainer, but so do we
// [sm_cocoaNSTextContainer release]; [sm_cocoaNSTextContainer retain];
{
};
-void wxCocoaDCImpl::DoDrawPolygon( int, wxPoint *, int, int, int)
+void wxCocoaDCImpl::DoDrawPolygon( int, wxPoint *, int, int, wxPolygonFillMode)
{
};
{
wxAutoNSAutoreleasePool pool;
if(!CocoaTakeFocus()) return;
- if(!bmp.Ok())
+ if(!bmp.IsOk())
return;
#if 0
[context restoreGraphicsState];
}
-bool wxCocoaDCImpl::DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, int style)
+bool wxCocoaDCImpl::DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, wxFloodFillStyle style)
{
return false;
}
}
-bool wxCocoaDCImpl::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop, bool useMask , wxCoord xsrcMask, wxCoord ysrcMask)
+bool wxCocoaDCImpl::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, wxRasterOperationMode rop, bool useMask , wxCoord xsrcMask, wxCoord ysrcMask)
{
if(!CocoaTakeFocus()) return false;
if(!source) return false;
void wxCocoaDCImpl::SetTextForeground( const wxColour &col )
{
-// if (!Ok()) return;
+// if (!IsOk()) return;
m_textForegroundColour = col;
};
void wxCocoaDCImpl::SetTextBackground( const wxColour &col )
{
-// if (!Ok()) return;
+// if (!IsOk()) return;
m_textBackgroundColour = col;
};
{
}
-void wxCocoaDCImpl::SetLogicalFunction(int)
+void wxCocoaDCImpl::SetLogicalFunction(wxRasterOperationMode)
{
}
-void wxCocoaDCImpl::SetMapMode( int mode )
+void wxCocoaDCImpl::SetMapMode( wxMappingMode mode )
{
switch (mode)
{