Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Header:
- #import <Cocoa/Cocoa.h>
- @class NativeInterfaceExtensions_;
- namespace nim {
- namespace interface {
- struct NativeInterfaceExtensions
- {
- NativeInterfaceExtensions(id window);
- ~NativeInterfaceExtensions();
- private:
- NativeInterfaceExtensions_* nativeWindow;
- };
- }
- }
- // Source:
- #import "NativeMainWindow.h"
- @interface NativeInterfaceExtensions_ : NSObject
- @property(copy) NSWindow* WindowHandler;
- - (id) initWithWindowHandler:(id)window;
- @end
- @implementation NativeInterfaceExtensions_
- @synthesize WindowHandler;
- - (id) initWithWindowHandler:(id)window {
- self = [super self];
- if (self) {
- NSLog(@"%d", (int)[window isKindOfClass:[NSWindow class]]);
- WindowHandler = (NSWindow*)window;
- return self;
- }
- return nil;
- }
- @end
- using namespace nim::interface;
- NativeInterfaceExtensions::NativeInterfaceExtensions(id window) {
- nativeWindow = [[NativeInterfaceExtensions_ alloc] initWithWindowHandler:window];
- }
- NativeInterfaceExtensions::~NativeInterfaceExtensions() {
- [nativeWindow release];
- }
Advertisement
Add Comment
Please, Sign In to add comment