# Cairo::QuartzSurface Class Reference

A QuartzSurface provides a way to render within Apple Mac OS X. More...

Inherits Cairo::Surface.

List of all members.

## Public Member Functions

| QuartzSurface (cairo_surface_t*cobject, bool has_reference=false)
| Create a C++ wrapper for the C instance.
virtual | ~QuartzSurface ()
CGContextRef | get_cg_context () const
| Returns the CGContextRef associated with this surface, or NULL if none.

## Static Public Member Functions

static RefPtr< QuartzSurface > | create (CGContextRef cg_context, int width, int height)
| Creates a cairo surface that targets the given CGContext.
static RefPtr< QuartzSurface > | create (Format format, int width, int height)
| Creates a device-independent-bitmap surface not associated with any particular existing surface or device context.

## Detailed Description

A QuartzSurface provides a way to render within Apple Mac OS X.

If you want to draw to the screen within a Mac OS X application, you should use this Surface type.

Note:
  For this Surface to be available, cairo must have been compiled with (native) Quartz support (requires Cairo > 1.4.0)

## Constructor & Destructor Documentation

Cairo::QuartzSurface::QuartzSurface | ( | cairo_surface_t * | cobject,
|  | bool | has_reference = `false` |
| ) |  |  | `[explicit]`

Create a C++ wrapper for the C instance.

This C++ instance should then be given to a RefPtr.

Parameters:

  | cobject | The C instance.
  | has_reference | whether we already have a reference. Otherwise, the constructor will take an extra reference.

virtual Cairo::QuartzSurface::~QuartzSurface | ( |  | ) | `[virtual]`

## Member Function Documentation

static RefPtr<QuartzSurface> Cairo::QuartzSurface::create | ( | Format | format,
|  | int | width,
|  | int | height |
| ) |  |  | `[static]`

Creates a device-independent-bitmap surface not associated with any particular existing surface or device context.

The created bitmap will be unititialized.

Parameters:

  | format | format of pixels in the surface to create
  | width | width of the surface, in pixels
  | height | height of the surface, in pixels

Returns:
  the newly created surface

static RefPtr<QuartzSurface> Cairo::QuartzSurface::create | ( | CGContextRef | cg_context,
|  | int | width,
|  | int | height |
| ) |  |  | `[static]`

Creates a cairo surface that targets the given CGContext.

Parameters:

  | cg_context | the CGContext to create a surface for

Returns:
  the newly created surface

CGContextRef Cairo::QuartzSurface::get_cg_context | ( |  | ) | const

Returns the CGContextRef associated with this surface, or NULL if none.

Also returns NULL if the surface is not a Quartz surface.

Returns:
  CGContextRef or NULL if no CGContextRef available.

The documentation for this class was generated from the following file:

- cairomm/quartz_surface.h