#include "wx/log.h"
#include "wx/window.h"
#include "wx/dc.h"
+ #include "wx/dcclient.h"
#include "wx/utils.h"
#endif //WX_PRECOMP
#include "wx/tooltip.h"
+#include "wx/cocoa/dc.h"
#include "wx/cocoa/autorelease.h"
#include "wx/cocoa/string.h"
#include "wx/cocoa/trackingrectmanager.h"
#include "wx/mac/corefoundation/cfref.h"
+#include "wx/cocoa/ObjcRef.h"
#import <Foundation/NSArray.h>
#import <Foundation/NSRunLoop.h>
bool need_debug = cocoaNSView || m_cocoaNSView;
if(need_debug) wxLogTrace(wxTRACE_COCOA_RetainRelease,wxT("wxWindowCocoa=%p::SetNSView [m_cocoaNSView=%p retainCount]=%d"),this,m_cocoaNSView,[m_cocoaNSView retainCount]);
DisassociateNSView(m_cocoaNSView);
- [cocoaNSView retain];
- [m_cocoaNSView release];
+ wxGCSafeRetain(cocoaNSView);
+ wxGCSafeRelease(m_cocoaNSView);
m_cocoaNSView = cocoaNSView;
AssociateNSView(m_cocoaNSView);
if(need_debug) wxLogTrace(wxTRACE_COCOA_RetainRelease,wxT("wxWindowCocoa=%p::SetNSView [cocoaNSView=%p retainCount]=%d"),this,cocoaNSView,[cocoaNSView retainCount]);
WX_NSAffineTransform wxWindowCocoa::CocoaGetWxToBoundsTransform()
{
// TODO: Handle scrolling offset
- NSAffineTransform *transform = wxDC::CocoaGetWxToBoundsTransform([GetNSView() isFlipped], [GetNSView() bounds].size.height);
+ NSAffineTransform *transform = wxCocoaDCImpl::CocoaGetWxToBoundsTransform([GetNSView() isFlipped], [GetNSView() bounds].size.height);
return transform;
}
// transformations. However, it's better than nothing.
// We don't create a wxClientDC because we don't want to accidently be able to use
// it for drawing.
- wxDC tmpdc;
+ wxClientDC tmpdc(const_cast<wxWindow*>(this));
return tmpdc.GetTextExtent(string, outX, outY, outDescent, outExternalLeading, inFont);
}