QTfrontend/CocoaInitializer.mm
author nemo
Thu, 10 Sep 2009 15:30:11 +0000
changeset 2377 f3fab2b09e0c
parent 2261 57e99c908e7c
child 2400 2422ea85d100
permissions -rw-r--r--
And in frontend
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2261
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     1
/*
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     2
 * Copyright (C) 2008 Remko Troncon
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     3
 */
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     4
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     5
#include "CocoaInitializer.h"
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     6
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     7
#include <AppKit/AppKit.h>
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     8
#include <Cocoa/Cocoa.h>
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     9
#include <QtDebug>
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    10
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    11
class CocoaInitializer::Private 
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    12
{
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    13
	public:
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    14
		NSAutoreleasePool* autoReleasePool_;
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    15
};
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    16
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    17
CocoaInitializer::CocoaInitializer()
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    18
{
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    19
	d = new CocoaInitializer::Private();
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    20
	NSApplicationLoad();
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    21
	d->autoReleasePool_ = [[NSAutoreleasePool alloc] init];
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    22
}
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    23
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    24
CocoaInitializer::~CocoaInitializer()
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    25
{
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    26
	[d->autoReleasePool_ release];
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    27
	delete d;
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    28
}