+
+void wxNonOwnedWindowCocoaImpl::WindowToScreen( int *x, int *y )
+{
+ wxPoint p((x ? *x : 0), (y ? *y : 0) );
+ NSPoint nspt = wxToNSPoint( [m_macWindow contentView], p );
+ nspt = [[m_macWindow contentView] convertPoint:nspt toView:nil];
+ nspt = [m_macWindow convertBaseToScreen:nspt];
+ p = wxFromNSPoint( NULL, nspt);
+ if ( x )
+ *x = p.x;
+ if ( y )
+ *y = p.y;
+}
+
+bool wxNonOwnedWindowCocoaImpl::IsActive()
+{
+ return [m_macWindow isKeyWindow];
+}
+
+void wxNonOwnedWindowCocoaImpl::SetModified(bool modified)
+{
+ [m_macWindow setDocumentEdited:modified];
+}
+
+bool wxNonOwnedWindowCocoaImpl::IsModified() const
+{
+ return [m_macWindow isDocumentEdited];
+}
+
+void wxNonOwnedWindowCocoaImpl::SetRepresentedFilename(const wxString& filename)
+{
+ [m_macWindow setRepresentedFilename:wxCFStringRef(filename).AsNSString()];
+}
+
+void wxNonOwnedWindowCocoaImpl::RestoreWindowLevel()
+{
+ if ( [m_macWindow level] != m_macWindowLevel )
+ [m_macWindow setLevel:m_macWindowLevel];
+}
+
+WX_NSResponder wxNonOwnedWindowCocoaImpl::GetNextFirstResponder()
+{
+ return s_nextFirstResponder;
+}
+
+
+//
+//
+//
+
+wxNonOwnedWindowImpl* wxNonOwnedWindowImpl::CreateNonOwnedWindow( wxNonOwnedWindow* wxpeer, wxWindow* parent, WXWindow nativeWindow)
+{
+ wxNonOwnedWindowCocoaImpl* now = new wxNonOwnedWindowCocoaImpl( wxpeer );
+ now->Create( parent, nativeWindow );
+ return now;
+}
+
+wxNonOwnedWindowImpl* wxNonOwnedWindowImpl::CreateNonOwnedWindow( wxNonOwnedWindow* wxpeer, wxWindow* parent, const wxPoint& pos, const wxSize& size,
+ long style, long extraStyle, const wxString& name )
+{
+ wxNonOwnedWindowImpl* now = new wxNonOwnedWindowCocoaImpl( wxpeer );
+ now->Create( parent, pos, size, style , extraStyle, name );
+ return now;
+}
+