Cinder  0.8.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Namespaces | Typedefs | Functions
CinderCocoa.h File Reference
#include "cinder/Cinder.h"
#include "cinder/Surface.h"
#include "cinder/Shape2d.h"
#include "cinder/Color.h"
#include "cinder/Buffer.h"
#include "cinder/ImageIo.h"
#include <ApplicationServices/ApplicationServices.h>
#include <CoreFoundation/CoreFoundation.h>
Include dependency graph for CinderCocoa.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  cinder::cocoa::SafeNsString
 Represents an exception-safe Cocoa NSString which behaves like a shared_ptr but can implicitly cast itself to NSString*. More...
 
class  cinder::cocoa::SafeNsData
 Represents an exception-safe Cocoa NSData which behaves like a shared_ptr but can implicitly cast itself to NSData*. More...
 
class  cinder::cocoa::SafeNsAutoreleasePool
 Represents an exception-safe NSAutoreleasePool. Replaces the global NSAutoreleasePool for its lifetime. More...
 
class  cinder::cocoa::ImageSourceCgImage
 
class  cinder::cocoa::ImageTargetCgImage
 

Namespaces

 cinder
 
 cinder::cocoa
 

Typedefs

typedef std::shared_ptr
< struct __CFString > 
cinder::cocoa::SafeCfString
 
typedef std::shared_ptr< class
ImageSourceCgImage > 
cinder::cocoa::ImageSourceCgImageRef
 
typedef std::shared_ptr< class
ImageTargetCgImage > 
cinder::cocoa::ImageTargetCgImageRef
 

Functions

void cinder::cocoa::safeCfRelease (const CFTypeRef cfRef)
 Safely release a CoreFoundation object, testing for null before calling CFRelease. Designed to be used as the deleter of a shared_ptr. More...
 
void cinder::cocoa::safeCocoaRelease (void *nsObject)
 Safely release a Cocoa object, testing for null before calling [nsObject release]. Designed to be used as the deleter of a shared_ptr. More...
 
CGContextRef cinder::cocoa::createCgBitmapContext (const Surface8u &surface)
 Creates a CGBitmapContext that represents a cinder::Surface8u. Users must call CGContextRelease() to free the result. More...
 
CGContextRef cinder::cocoa::getWindowContext ()
 Returns the current CoreGraphics context for the active window. Requires the current Renderer to be a Renderer2d. Does not need to be released. More...
 
std::string cinder::cocoa::convertCfString (CFStringRef str)
 Converts a CFStringRef into std::string with UTF8 encoding. More...
 
CFStringRef cinder::cocoa::createCfString (const std::string &str)
 Converts a std::string into a CFStringRef. Assumes UTF8 encoding. User must call CFRelease() to free the result. More...
 
SafeCfString cinder::cocoa::createSafeCfString (const std::string &str)
 Converts a std::string into an exception-safe CFString pointer. Assumes UTF8 encoding. The deleter is set to free the string when appropriate. More...
 
std::string cinder::cocoa::convertNsString (NSString *str)
 Converts a NSString into a std::string with UTF8 encoding. More...
 
CFURLRef cinder::cocoa::createCfUrl (const cinder::Url &url)
 Converts a cinder::URL into a CFURLRef. User must call CFRelease() to free the result. More...
 
CFAttributedStringRef cinder::cocoa::createCfAttributedString (const std::string &str, const cinder::Font &font, const ColorA &color)
 Converts a std::string to a CFAttributedStringRef with attributes set for font and color. Assumes UTF8 encoding. User must call CFRelease() to free the result. Returns NULL on failure. More...
 
CFAttributedStringRef cinder::cocoa::createCfAttributedString (const std::string &str, const cinder::Font &font, const ColorA &color, bool ligate)
 Converts a std::string to a CFAttributedStringRef with attributes set for font and color. If ligate then ligatures will be used. Assumes UTF8 encoding. User must call CFRelease() to free the result. Returns NULL on failure. More...
 
CGColorRef cinder::cocoa::createCgColor (const Color &color)
 Converts a cinder::Color to CGColor. User must call CGColorRelease() to free the result. More...
 
CGColorRef cinder::cocoa::createCgColor (const ColorA &color)
 Converts a cinder::ColorA to CGColor. User must call CGColorRelease() to free the result. More...
 
CGRect cinder::cocoa::createCgRect (const Area &area)
 Converts a cinder::Area to a CGRect. More...
 
Area cinder::cocoa::CgRectToArea (const CGRect &rect)
 Converts a CGRect to a cinder::Area. More...
 
CGSize cinder::cocoa::createCgSize (const Vec2i &s)
 Creates a Cocoa CGSize from a cinder::Vec2i. More...
 
CGSize cinder::cocoa::createCgSize (const Vec2f &s)
 Creates a Cocoa CGSize from a cinder::Vec2f. More...
 
void cinder::cocoa::convertCgPath (CGPathRef cgPath, Shape2d *resultShape, bool flipVertical=true)
 Converts a CGPathRef to a cinder::Shape2d. If flipVertical then the path will be flipped vertically. More...
 
CFDataRef cinder::cocoa::createCfDataRef (const cinder::Buffer &buffer)
 Creates a CFDataRef from a cinder::Buffer buffer. The result does not assume ownership of the data and should be freed using CFRelease(). More...
 
ImageSourceCgImageRef cinder::cocoa::createImageSource (::CGImageRef imageRef, ImageSource::Options=ImageSource::Options())
 
::CGImageRef cinder::cocoa::createCgImage (ImageSourceRef imageSource, ImageTarget::Options=ImageTarget::Options())
 Loads an ImageSource into a new CGImageRef. Release the result with ::CGImageRelease. More...