VBoxCocoaHelper.h revision e2de40b4b54a8ea51348be768ddcd3ecd753d7b6
/** @file
*
* VBox frontends: Qt GUI ("VirtualBox"):
* VBoxCocoa Helper
*/
/*
* Copyright (C) 2009 Sun Microsystems, Inc.
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
#ifndef ___darwin_VBoxCocoaHelper_h
#define ___darwin_VBoxCocoaHelper_h
/* Macro which add a typedef of the given Cocoa class in an appropriate form
* reference the Cocoa type somewhere. The use of this prevents extensive
* casting of void* to the right type in the Cocoa context. */
#ifdef __OBJC__
#define ADD_COCOA_NATIVE_REF(CocoaClass) \
@class CocoaClass; \
#else /* __OBJC__ */
#endif /* __OBJC__ */
#ifdef __OBJC__
/* System includes */
/* Qt includes */
#include <QString>
#include <QVarLengthArray>
{
return [reinterpret_cast<const NSString *>(CFStringCreateWithCharacters (0, reinterpret_cast<const UniChar *> (aString.unicode()),
}
{
if(!str)
return QString();
if (chars)
}
{
/* Create a bitmap rep from the image. */
/* Create an NSImage and add the bitmap rep to it */
return image;
}
/* Helper class for automatic creation & destroying of a cocoa auto release
pool. */
{
inline CocoaAutoreleasePool()
{
}
inline ~CocoaAutoreleasePool()
{
}
};
#endif /* __OBJC__ */
#endif /* ___darwin_VBoxCocoaHelper_h */