From ad3628fa86caa8eb9ded43eacb115f44558eb1ee Mon Sep 17 00:00:00 2001 From: David Elliott Date: Fri, 20 Apr 2007 20:21:52 +0000 Subject: [PATCH] Move Objective-C interfaces into separate header files in preparation for being able to use them from other source files. No new or changed code. Work on behalf of Software 2000 Ltd. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45553 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/cocoa/objc/NSMenu.h | 28 ++++++++++++++++++++++ include/wx/cocoa/objc/NSView.h | 40 ++++++++++++++++++++++++++++++++ include/wx/cocoa/objc/NSWindow.h | 24 +++++++++++++++++++ src/cocoa/NSMenu.mm | 9 +------ src/cocoa/NSView.mm | 24 ++----------------- src/cocoa/NSWindow.mm | 10 +------- 6 files changed, 96 insertions(+), 39 deletions(-) create mode 100644 include/wx/cocoa/objc/NSMenu.h create mode 100644 include/wx/cocoa/objc/NSView.h create mode 100644 include/wx/cocoa/objc/NSWindow.h diff --git a/include/wx/cocoa/objc/NSMenu.h b/include/wx/cocoa/objc/NSMenu.h new file mode 100644 index 0000000000..88df42043f --- /dev/null +++ b/include/wx/cocoa/objc/NSMenu.h @@ -0,0 +1,28 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/cocoa/objc/NSMenu.h +// Purpose: wxPoserNSMenu class +// Author: David Elliott +// Modified by: +// Created: 2007/04/20 (move from NSMenu.mm) +// RCS-ID: $Id$ +// Copyright: (c) 2002 David Elliott +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef __WX_COCOA_OBJC_NSMENU_H__ +#define __WX_COCOA_OBJC_NSMENU_H__ + +#import + +// ============================================================================ +// @class wxPoserNSMenu +// ============================================================================ +@interface wxPoserNSMenu : NSMenu +{ +} + +- (void)dealloc; + +@end // wxPoserNSMenu + +#endif //ndef __WX_COCOA_OBJC_NSMENU_H__ diff --git a/include/wx/cocoa/objc/NSView.h b/include/wx/cocoa/objc/NSView.h new file mode 100644 index 0000000000..58c4f5101d --- /dev/null +++ b/include/wx/cocoa/objc/NSView.h @@ -0,0 +1,40 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/cocoa/objc/NSView.h +// Purpose: wxPoserNSView class +// Author: David Elliott +// Modified by: +// Created: 2007/04/20 (move from NSView.mm) +// RCS-ID: $Id$ +// Copyright: (c) 2003 David Elliott +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef __WX_COCOA_OBJC_NSVIEW_H__ +#define __WX_COCOA_OBJC_NSVIEW_H__ + +#import + +// ============================================================================ +// @class wxPoserNSView +// ============================================================================ +@interface wxPoserNSView : NSView +{ +} + +- (void)drawRect: (NSRect)rect; +- (void)mouseDown:(NSEvent *)theEvent; +- (void)mouseDragged:(NSEvent *)theEvent; +- (void)mouseUp:(NSEvent *)theEvent; +- (void)mouseMoved:(NSEvent *)theEvent; +- (void)mouseEntered:(NSEvent *)theEvent; +- (void)mouseExited:(NSEvent *)theEvent; +- (void)rightMouseDown:(NSEvent *)theEvent; +- (void)rightMouseDragged:(NSEvent *)theEvent; +- (void)rightMouseUp:(NSEvent *)theEvent; +- (void)otherMouseDown:(NSEvent *)theEvent; +- (void)otherMouseDragged:(NSEvent *)theEvent; +- (void)otherMouseUp:(NSEvent *)theEvent; +- (void)resetCursorRects; +@end // wxPoserNSView + +#endif //ndef __WX_COCOA_OBJC_NSVIEW_H__ diff --git a/include/wx/cocoa/objc/NSWindow.h b/include/wx/cocoa/objc/NSWindow.h new file mode 100644 index 0000000000..91109254d2 --- /dev/null +++ b/include/wx/cocoa/objc/NSWindow.h @@ -0,0 +1,24 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/cocoa/objc/NSWindow.h +// Purpose: wxPoserNSWindow class +// Author: David Elliott +// Modified by: +// Created: 2007/04/20 (move from NSWindow.mm) +// RCS-ID: $Id$ +// Copyright: (c) 2003 David Elliott +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#import + +// ============================================================================ +// @class wxPoserNSWindow +// ============================================================================ +@interface wxPoserNSWindow : NSWindow +{ +} + +- (BOOL)canBecomeKeyWindow; +- (BOOL)canBecomeMainWindow; +@end // wxPoserNSwindow + diff --git a/src/cocoa/NSMenu.mm b/src/cocoa/NSMenu.mm index ef19045c45..40226cd5a2 100644 --- a/src/cocoa/NSMenu.mm +++ b/src/cocoa/NSMenu.mm @@ -19,18 +19,11 @@ #include "wx/cocoa/ObjcPose.h" #import -#import +#include "wx/cocoa/objc/NSMenu.h" // ============================================================================ // @class wxPoserNSMenu // ============================================================================ -@interface wxPoserNSMenu : NSMenu -{ -} - -- (void)dealloc; - -@end // wxPoserNSMenu WX_IMPLEMENT_POSER(wxPoserNSMenu); @implementation wxPoserNSMenu : NSMenu diff --git a/src/cocoa/NSView.mm b/src/cocoa/NSView.mm index 72c6899868..db8d47e618 100644 --- a/src/cocoa/NSView.mm +++ b/src/cocoa/NSView.mm @@ -4,7 +4,7 @@ // Author: David Elliott // Modified by: // Created: 2003/02/15 -// RCS-ID: $Id: +// RCS-ID: $Id$ // Copyright: (c) 2003 David Elliott // Licence: wxWidgets licence ///////////////////////////////////////////////////////////////////////////// @@ -25,9 +25,9 @@ #include "wx/cocoa/ObjcPose.h" #include "wx/cocoa/NSView.h" -#import #import #import +#include "wx/cocoa/objc/NSView.h" // ---------------------------------------------------------------------------- // globals @@ -56,26 +56,6 @@ void wxCocoaNSView::DisassociateNSView(WX_NSView cocoaNSView) // ============================================================================ // @class wxPoserNSView // ============================================================================ -@interface wxPoserNSView : NSView -{ -} - -- (void)drawRect: (NSRect)rect; -- (void)mouseDown:(NSEvent *)theEvent; -- (void)mouseDragged:(NSEvent *)theEvent; -- (void)mouseUp:(NSEvent *)theEvent; -- (void)mouseMoved:(NSEvent *)theEvent; -- (void)mouseEntered:(NSEvent *)theEvent; -- (void)mouseExited:(NSEvent *)theEvent; -- (void)rightMouseDown:(NSEvent *)theEvent; -- (void)rightMouseDragged:(NSEvent *)theEvent; -- (void)rightMouseUp:(NSEvent *)theEvent; -- (void)otherMouseDown:(NSEvent *)theEvent; -- (void)otherMouseDragged:(NSEvent *)theEvent; -- (void)otherMouseUp:(NSEvent *)theEvent; -- (void)resetCursorRects; -@end // wxPoserNSView - WX_IMPLEMENT_POSER(wxPoserNSView); @implementation wxPoserNSView : NSView diff --git a/src/cocoa/NSWindow.mm b/src/cocoa/NSWindow.mm index 792f701b19..2a75aac9c0 100644 --- a/src/cocoa/NSWindow.mm +++ b/src/cocoa/NSWindow.mm @@ -26,9 +26,9 @@ #include "wx/cocoa/ObjcPose.h" #include "wx/cocoa/NSWindow.h" -#import #import #import +#include "wx/cocoa/objc/NSWindow.h" // ============================================================================ // @class wxNSWindowDelegate @@ -189,14 +189,6 @@ wxMenuBar* wxCocoaNSWindow::GetAppMenuBar(wxCocoaNSWindow *win) // ============================================================================ // @class wxPoserNSWindow // ============================================================================ -@interface wxPoserNSWindow : NSWindow -{ -} - -- (BOOL)canBecomeKeyWindow; -- (BOOL)canBecomeMainWindow; -@end // wxPoserNSwindow - WX_IMPLEMENT_POSER(wxPoserNSWindow); @implementation wxPoserNSWindow : NSWindow -- 2.47.2