#ifndef __WX_COCOA_NSTABLEDATASOURCE_H__
#define __WX_COCOA_NSTABLEDATASOURCE_H__
+#include "wx/cocoa/objc/objc_uniquifying.h"
+
#import <Foundation/NSObject.h>
// ============================================================================
objectValueForTableColumn: (NSTableColumn *)tableColumn
row: (int)rowIndex;
@end // wxCocoaNSTableDataSource
+WX_DECLARE_GET_OBJC_CLASS(wxCocoaNSTableDataSource,NSObject)
#endif // _WX_COCOA_NSTABLEDATASOURCE_H_
#ifndef __WX_COCOA_OBJC_NSMENU_H__
#define __WX_COCOA_OBJC_NSMENU_H__
+#include "wx/cocoa/objc/objc_uniquifying.h"
+
#import <AppKit/NSMenu.h>
// ============================================================================
- (void)dealloc;
@end // WXNSMenu
+WX_DECLARE_GET_OBJC_CLASS(WXNSMenu,NSMenu)
#endif //ndef __WX_COCOA_OBJC_NSMENU_H__
}
@end // WXNSMenu
+WX_IMPLEMENT_GET_OBJC_CLASS(WXNSMenu,NSMenu)
// ============================================================================
// @class wxNSMenuNotificationObserver
{
}
-struct objc_object *wxCocoaNSMenu::sm_cocoaObserver = [[wxNSMenuNotificationObserver alloc] init];
-
- (void)menuDidAddItem: (NSNotification *)notification;
- (void)menuDidChangeItem: (NSNotification *)notification;
- (void)menuDidRemoveItem: (NSNotification *)notification;
- (void)menuDidSendAction: (NSNotification *)notification;
- (void)menuWillSendAction: (NSNotification *)notification;
@end // interface wxNSMenuNotificationObserver
+WX_DECLARE_GET_OBJC_CLASS(wxNSMenuNotificationObserver,NSObject)
@implementation wxNSMenuNotificationObserver : NSObject
}
@end // implementation wxNSMenuNotificationObserver
+WX_IMPLEMENT_GET_OBJC_CLASS(wxNSMenuNotificationObserver,NSObject)
// ========================================================================
// wxCocoaNSMenu
// ========================================================================
WX_IMPLEMENT_OBJC_INTERFACE_HASHMAP(NSMenu)
+struct objc_object *wxCocoaNSMenu::sm_cocoaObserver = [[WX_GET_OBJC_CLASS(wxNSMenuNotificationObserver) alloc] init];
+
void wxCocoaNSMenu::AssociateNSMenu(WX_NSMenu cocoaNSMenu, unsigned int flags)
{
if(cocoaNSMenu)
#include "wx/log.h"
#endif // WX_PRECOMP
+#include "wx/cocoa/objc/objc_uniquifying.h"
+
#include "wx/cocoa/NSScroller.h"
#import <AppKit/NSScroller.h>
- (void)wxNSScrollerAction: (id)sender;
@end // wxNSScrollerTarget
+WX_DECLARE_GET_OBJC_CLASS(wxNSScrollerTarget,NSObject)
@implementation wxNSScrollerTarget : NSObject
- (void)wxNSScrollerAction: (id)sender
}
@end // implementation wxNSScrollerTarget
+WX_IMPLEMENT_GET_OBJC_CLASS(wxNSScrollerTarget,NSObject)
// ============================================================================
// class wxCocoaNSScroller
// ============================================================================
-const wxObjcAutoRefFromAlloc<struct objc_object*> wxCocoaNSScroller::sm_cocoaTarget = [[wxNSScrollerTarget alloc] init];
+const wxObjcAutoRefFromAlloc<struct objc_object*> wxCocoaNSScroller::sm_cocoaTarget = [[WX_GET_OBJC_CLASS(wxNSScrollerTarget) alloc] init];
void wxCocoaNSScroller::AssociateNSScroller(WX_NSScroller cocoaNSScroller)
{
#include "wx/cocoa/NSTabView.h"
+#include "wx/cocoa/objc/objc_uniquifying.h"
+
#include <AppKit/NSTabView.h>
// ============================================================================
- (void)tabView:(NSTabView*)tabView didSelectTabViewItem:(NSTabViewItem*)tabViewItem;
- (BOOL)tabView:(NSTabView*)tabView shouldSelectTabViewItem:(NSTabViewItem*)tabViewItem;
@end // interface wxNSTabViewDelegate : NSObject
+WX_DECLARE_GET_OBJC_CLASS(wxNSTabViewDelegate,NSObject)
@implementation wxNSTabViewDelegate : NSObject
- (void)tabView:(NSTabView*)tabView didSelectTabViewItem:(NSTabViewItem*)tabViewItem
}
@end // implementation wxNSTabViewDelegate : NSObject
+WX_IMPLEMENT_GET_OBJC_CLASS(wxNSTabViewDelegate,NSObject)
// ============================================================================
// class wxCocoaNSTabView
// ============================================================================
WX_IMPLEMENT_OBJC_INTERFACE_HASHMAP(NSTabView)
-wxObjcAutoRefFromAlloc<struct objc_object*> wxCocoaNSTabView::sm_cocoaDelegate = [[wxNSTabViewDelegate alloc] init];
+wxObjcAutoRefFromAlloc<struct objc_object*> wxCocoaNSTabView::sm_cocoaDelegate = [[WX_GET_OBJC_CLASS(wxNSTabViewDelegate) alloc] init];
void wxCocoaNSTabView::AssociateNSTabView(WX_NSTabView cocoaNSTabView)
{
}
@end // implementation wxCocoaNSTableDataSource
+WX_IMPLEMENT_GET_OBJC_CLASS(wxCocoaNSTableDataSource,NSObject)
#include "wx/cocoa/NSWindow.h"
+#include "wx/cocoa/objc/objc_uniquifying.h"
+
#import <Foundation/NSNotification.h>
#import <Foundation/NSString.h>
#include "wx/cocoa/objc/NSWindow.h"
- (void)wxMenuItemAction: (NSMenuItem *)menuItem;
- (BOOL)validateMenuItem: (NSMenuItem *)menuItem;
@end //interface wxNSWindowDelegate
+WX_DECLARE_GET_OBJC_CLASS(wxNSWindowDelegate,NSObject)
@implementation wxNSWindowDelegate : NSObject
}
@end //implementation wxNSWindowDelegate
+WX_IMPLEMENT_GET_OBJC_CLASS(wxNSWindowDelegate,NSObject)
// ============================================================================
// class wxCocoaNSWindow
wxCocoaNSWindow::wxCocoaNSWindow(wxTopLevelWindowCocoa *tlw)
: m_wxTopLevelWindowCocoa(tlw)
{
- m_cocoaDelegate = [[wxNSWindowDelegate alloc] init];
+ m_cocoaDelegate = [[WX_GET_OBJC_CLASS(wxNSWindowDelegate) alloc] init];
[m_cocoaDelegate setWxCocoaInterface: this];
}
#include "wx/combobox.h"
+#include "wx/cocoa/objc/objc_uniquifying.h"
+
#ifndef WX_PRECOMP
#include "wx/window.h"
#include "wx/log.h"
- (void)comboBoxWillDismiss:(NSNotification *)notification;
- (void)comboBoxWillPopUp:(NSNotification *)notification;
@end // wxPoserNSComboBox
+WX_DECLARE_GET_OBJC_CLASS(wxPoserNSComboBox,NSComboBox)
//WX_IMPLEMENT_POSER(wxPoserNSComboBox);
@implementation wxPoserNSComboBox : NSComboBox
}
@end // implementation wxPoserNSComboBox
+WX_IMPLEMENT_GET_OBJC_CLASS(wxPoserNSComboBox,NSComboBox)
#include "wx/cocoa/autorelease.h"
#include "wx/cocoa/string.h"
return false;
m_cocoaNSView = NULL;
- SetNSComboBox([[wxPoserNSComboBox alloc] initWithFrame:MakeDefaultNSRect(size)]);
+ SetNSComboBox([[WX_GET_OBJC_CLASS(wxPoserNSComboBox) alloc] initWithFrame:MakeDefaultNSRect(size)]);
[m_cocoaNSView release];
[GetNSTextField() setStringValue:wxNSStringWithWxString(value.c_str())];
[GetNSControl() sizeToFit];
[GetNSTableView() setHeaderView: nil];
// Set up the data source
- m_cocoaDataSource = [[wxCocoaNSTableDataSource alloc] init];
+ m_cocoaDataSource = [[WX_GET_OBJC_CLASS(wxCocoaNSTableDataSource) alloc] init];
[GetNSTableView() setDataSource:m_cocoaDataSource];
// Add the single column
#include "wx/cocoa/mbarman.h"
#include "wx/cocoa/autorelease.h"
+#include "wx/cocoa/objc/objc_uniquifying.h"
#import <Foundation/NSString.h>
#import <Foundation/NSNotification.h>
- (void)windowWillClose: (NSNotification *)notification;
#endif // 0
@end // interface wxMenuBarManagerObserver : NSObject
+WX_DECLARE_GET_OBJC_CLASS(wxMenuBarManagerObserver,NSObject)
@implementation wxMenuBarManagerObserver : NSObject
- (id)init
#endif // 0
@end // implementation wxMenuBarManagerObserver : NSObject
+WX_IMPLEMENT_GET_OBJC_CLASS(wxMenuBarManagerObserver,NSObject)
// ============================================================================
// wxMenuBarManager
wxMenuBarManager::wxMenuBarManager()
{
- m_observer = [[wxMenuBarManagerObserver alloc]
+ m_observer = [[WX_GET_OBJC_CLASS(wxMenuBarManagerObserver) alloc]
initWithWxMenuBarManager:this];
[[NSNotificationCenter defaultCenter] addObserver:m_observer
selector:@selector(windowDidBecomeKey:)
#include "wx/mdi.h"
+#include "wx/cocoa/objc/objc_uniquifying.h"
+
#ifndef WX_PRECOMP
#include "wx/log.h"
#endif // WX_PRECOMP
- (id)initWithWxMDIParentFrame: (wxMDIParentFrame *)mdiParent;
- (void)windowDidBecomeMain: (NSNotification *)notification;
@end // interface wxMDIParentFrameObserver : NSObject
+WX_DECLARE_GET_OBJC_CLASS(wxMDIParentFrameObserver,NSObject)
@implementation wxMDIParentFrameObserver : NSObject
- (id)init
}
@end // implementation wxMDIParentFrameObserver : NSObject
+WX_IMPLEMENT_GET_OBJC_CLASS(wxMDIParentFrameObserver,NSObject)
// ========================================================================
// wxMDIParentFrame
{
m_clientWindow = NULL;
m_currentChild = NULL;
- m_observer = [[wxMDIParentFrameObserver alloc]
+ m_observer = [[WX_GET_OBJC_CLASS(wxMDIParentFrameObserver) alloc]
initWithWxMDIParentFrame:this];
[[NSNotificationCenter defaultCenter] addObserver:m_observer
selector:@selector(windowDidBecomeMain:)
bool wxMenu::Create(const wxString& title, long style)
{
wxAutoNSAutoreleasePool pool;
- m_cocoaNSMenu = [[WXNSMenu alloc] initWithTitle: wxNSStringWithWxString(title)];
+ m_cocoaNSMenu = [[WX_GET_OBJC_CLASS(WXNSMenu) alloc] initWithTitle: wxNSStringWithWxString(title)];
AssociateNSMenu(m_cocoaNSMenu);
return true;
}
#include "wx/menuitem.h"
+#include "wx/cocoa/objc/objc_uniquifying.h"
+
#ifndef WX_PRECOMP
#include "wx/menu.h"
#include "wx/utils.h"
- (void)wxMenuItemAction: (id)sender;
- (BOOL)validateMenuItem: (id)menuItem;
@end //interface wxNSMenuItemTarget
+WX_DECLARE_GET_OBJC_CLASS(wxNSMenuItemTarget,NSObject)
@implementation wxNSMenuItemTarget : NSObject
}
@end //implementation wxNSMenuItemTarget
+WX_IMPLEMENT_GET_OBJC_CLASS(wxNSMenuItemTarget,NSObject)
// ============================================================================
// wxMenuItemCocoa implementation
IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject)
wxMenuItemCocoaHash wxMenuItemCocoa::sm_cocoaHash;
-wxObjcAutoRefFromAlloc<struct objc_object *> wxMenuItemCocoa::sm_cocoaTarget = [[wxNSMenuItemTarget alloc] init];
+wxObjcAutoRefFromAlloc<struct objc_object *> wxMenuItemCocoa::sm_cocoaTarget = [[WX_GET_OBJC_CLASS(wxNSMenuItemTarget) alloc] init];
// ----------------------------------------------------------------------------
// wxMenuItemBase
#include "wx/cocoa/autorelease.h"
#include "wx/cocoa/string.h"
+#include "wx/cocoa/objc/objc_uniquifying.h"
#import <AppKit/NSTabView.h>
#import <AppKit/NSTabViewItem.h>
- (NSImage*)image;
- (void)setImage:(NSImage*)image;
@end // interface WXCTabViewImageItem : NSTabViewItem
+WX_DECLARE_GET_OBJC_CLASS(WXCTabViewImageItem,NSTabViewItem)
@implementation WXCTabViewImageItem : NSTabViewItem
- (id)init
}
@end // implementation WXCTabViewImageItem : NSTabViewItem
+WX_IMPLEMENT_GET_OBJC_CLASS(WXCTabViewImageItem,NSTabViewItem)
// ========================================================================
// wxNotebookEvent
{
wxAutoNSAutoreleasePool pool;
m_pages.Insert(page,pos);
- NSTabViewItem *tvitem = [[WXCTabViewImageItem alloc] initWithIdentifier:nil];
+ NSTabViewItem *tvitem = [[WX_GET_OBJC_CLASS(WXCTabViewImageItem) alloc] initWithIdentifier:nil];
[tvitem setLabel: wxNSStringWithWxString(title)];
const wxBitmap *bmp = (imageId!=-1)?m_imageList->GetBitmapPtr(imageId):NULL;
if(bmp)
#include "wx/cocoa/string.h"
#include "wx/cocoa/log.h"
+#include "wx/cocoa/objc/objc_uniquifying.h"
+
#import <AppKit/NSSound.h>
#import <Foundation/NSData.h>
// Delegate methods
- (void)sound:(NSSound *)theSound didFinishPlaying:(BOOL)finishedPlaying;
@end // interface wxNSSoundDelegate : NSObject
+WX_DECLARE_GET_OBJC_CLASS(wxNSSoundDelegate,NSObject)
@implementation wxNSSoundDelegate : NSObject
}
@end // wxNSSoundDelegate
+WX_IMPLEMENT_GET_OBJC_CLASS(wxNSSoundDelegate,NSObject)
-const wxObjcAutoRefFromAlloc<struct objc_object*> wxSound::sm_cocoaDelegate = [[wxNSSoundDelegate alloc] init];
+const wxObjcAutoRefFromAlloc<struct objc_object*> wxSound::sm_cocoaDelegate = [[WX_GET_OBJC_CLASS(wxNSSoundDelegate) alloc] init];
// ------------------------------------------------------------------
// wxSound
#include "wx/cocoa/private/timer.h"
#include "wx/cocoa/autorelease.h"
+#include "wx/cocoa/objc/objc_uniquifying.h"
+
#import <Foundation/NSTimer.h>
// ========================================================================
- (wxCocoaTimerImpl*)timer;
- (void)onNotify:(NSTimer *)theTimer;
@end // interface wxNSTimerData : NSObject
+WX_DECLARE_GET_OBJC_CLASS(wxNSTimerData,NSObject)
@implementation wxNSTimerData : NSObject
- (id)init
m_timer->Notify();
}
@end
+WX_IMPLEMENT_GET_OBJC_CLASS(wxNSTimerData,NSObject)
// ----------------------------------------------------------------------------
// wxCocoaTimerImpl
wxAutoNSAutoreleasePool thePool;
- wxNSTimerData *timerData = [[wxNSTimerData alloc] initWithWxTimer:this];
+ wxNSTimerData *timerData = [[WX_GET_OBJC_CLASS(wxNSTimerData) alloc] initWithWxTimer:this];
m_cocoaNSTimer = [[NSTimer
scheduledTimerWithTimeInterval: millisecs / 1000.0 //seconds
target: timerData
#include "wx/cocoa/string.h"
+#include "wx/cocoa/objc/objc_uniquifying.h"
+
#import <Foundation/Foundation.h>
#import <AppKit/NSWorkspace.h>
-(id)init:(void*)handle processIdentifier:(long)pid;
- (void)termHandler:(NSNotification *)aNotification;
@end
+WX_DECLARE_GET_OBJC_CLASS(wxTaskHandler,NSObject)
@implementation wxTaskHandler : NSObject
}
@end
+WX_IMPLEMENT_GET_OBJC_CLASS(wxTaskHandler,NSObject)
long wxExecute(const wxString& command,
int sync,
if(sync & wxEXEC_ASYNC)
{
- [[wxTaskHandler alloc]init:handle
+ [[WX_GET_OBJC_CLASS(wxTaskHandler) alloc]init:handle
processIdentifier:[theTask processIdentifier]];
return 0;