Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes

gfxASurface Class Reference

A surface is something you can draw on. More...

#include <gfxASurface.h>

Inheritance diagram for gfxASurface:

List of all members.

Public Types

enum  gfxImageFormat {
  ImageFormatARGB32, ImageFormatRGB24, ImageFormatA8, ImageFormatA1,
  ImageFormatUnknown
}
 

The format for an image surface.

More...
enum  gfxSurfaceType {
  SurfaceTypeImage, SurfaceTypePDF, SurfaceTypePS, SurfaceTypeXlib,
  SurfaceTypeXcb, SurfaceTypeGlitz, SurfaceTypeQuartz, SurfaceTypeWin32,
  SurfaceTypeBeOS, SurfaceTypeDirectFB, SurfaceTypeSVG, SurfaceTypeOS2,
  SurfaceTypeWin32Printing, SurfaceTypeQuartzImage, SurfaceTypeScript, SurfaceTypeQPainter,
  SurfaceTypeDDraw
}
enum  gfxContentType { CONTENT_COLOR = 0x1000, CONTENT_ALPHA = 0x2000, CONTENT_COLOR_ALPHA = 0x3000 }

Public Member Functions

nsrefcnt AddRef (void)
nsrefcnt Release (void)
cairo_surface_tCairoSurface ()
gfxSurfaceType GetType () const
gfxContentType GetContentType () const
void SetDeviceOffset (const gfxPoint &offset)
gfxPoint GetDeviceOffset () const
void Flush ()
void MarkDirty ()
void MarkDirty (const gfxRect &r)
virtual nsresult BeginPrinting (const nsAString &aTitle, const nsAString &aPrintToFileName)
virtual nsresult EndPrinting ()
virtual nsresult AbortPrinting ()
virtual nsresult BeginPage ()
virtual nsresult EndPage ()
void SetData (const cairo_user_data_key_t *key, void *user_data, thebes_destroy_func_t destroy)
void * GetData (const cairo_user_data_key_t *key)
virtual void Finish ()
int CairoStatus ()
virtual PRInt32 GetDefaultContextFlags () const

Static Public Member Functions

static already_AddRefed
< gfxASurface
Wrap (cairo_surface_t *csurf)
static PRBool CheckSurfaceSize (const gfxIntSize &sz, PRInt32 limit=0)
static gfxContentType ContentFromFormat (gfxImageFormat format)

Protected Member Functions

 gfxASurface ()
void Init (cairo_surface_t *surface, PRBool existingSurface=0)
virtual ~gfxASurface ()

Static Protected Member Functions

static gfxASurfaceGetSurfaceWrapper (cairo_surface_t *csurf)
static void SetSurfaceWrapper (cairo_surface_t *csurf, gfxASurface *asurf)

Protected Attributes

PRPackedBool mSurfaceValid

Detailed Description

A surface is something you can draw on.

Instantiate a subclass of this abstract class, and use gfxContext to draw on this surface.


Member Enumeration Documentation

Enumerator:
CONTENT_COLOR 
CONTENT_ALPHA 
CONTENT_COLOR_ALPHA 

The format for an image surface.

For all formats with alpha data, 0 means transparent, 1 or 255 means fully opaque.

Enumerator:
ImageFormatARGB32 

ARGB data in native endianness, using premultiplied alpha.

ImageFormatRGB24 

xRGB data in native endianness

ImageFormatA8 

Only an alpha channel.

ImageFormatA1 

Packed transparency information (one byte refers to 8 pixels).

ImageFormatUnknown 
Enumerator:
SurfaceTypeImage 
SurfaceTypePDF 
SurfaceTypePS 
SurfaceTypeXlib 
SurfaceTypeXcb 
SurfaceTypeGlitz 
SurfaceTypeQuartz 
SurfaceTypeWin32 
SurfaceTypeBeOS 
SurfaceTypeDirectFB 
SurfaceTypeSVG 
SurfaceTypeOS2 
SurfaceTypeWin32Printing 
SurfaceTypeQuartzImage 
SurfaceTypeScript 
SurfaceTypeQPainter 
SurfaceTypeDDraw 

Constructor & Destructor Documentation

gfxASurface::gfxASurface (  )  [inline, protected]
virtual gfxASurface::~gfxASurface (  )  [inline, protected, virtual]

Member Function Documentation

virtual nsresult gfxASurface::AbortPrinting (  )  [virtual]

Reimplemented in gfxPDFSurface, and gfxPSSurface.

nsrefcnt gfxASurface::AddRef ( void   ) 
virtual nsresult gfxASurface::BeginPage (  )  [virtual]

Reimplemented in gfxPDFSurface, and gfxPSSurface.

virtual nsresult gfxASurface::BeginPrinting ( const nsAString aTitle,
const nsAString aPrintToFileName 
) [virtual]

Reimplemented in gfxPDFSurface, and gfxPSSurface.

int gfxASurface::CairoStatus (  ) 
cairo_surface_t* gfxASurface::CairoSurface (  )  [inline]
static PRBool gfxASurface::CheckSurfaceSize ( const gfxIntSize sz,
PRInt32  limit = 0 
) [static]
static gfxContentType gfxASurface::ContentFromFormat ( gfxImageFormat  format  )  [static]
virtual nsresult gfxASurface::EndPage (  )  [virtual]

Reimplemented in gfxPDFSurface, and gfxPSSurface.

virtual nsresult gfxASurface::EndPrinting (  )  [virtual]

Reimplemented in gfxPDFSurface, and gfxPSSurface.

virtual void gfxASurface::Finish (  )  [virtual]

Reimplemented in gfxPDFSurface, and gfxPSSurface.

void gfxASurface::Flush (  ) 
gfxContentType gfxASurface::GetContentType (  )  const
void* gfxASurface::GetData ( const cairo_user_data_key_t key  ) 
virtual PRInt32 gfxASurface::GetDefaultContextFlags (  )  const [inline, virtual]

Reimplemented in gfxPDFSurface, and gfxPSSurface.

gfxPoint gfxASurface::GetDeviceOffset (  )  const
static gfxASurface* gfxASurface::GetSurfaceWrapper ( cairo_surface_t csurf  )  [static, protected]
gfxSurfaceType gfxASurface::GetType (  )  const
void gfxASurface::Init ( cairo_surface_t surface,
PRBool  existingSurface = 0 
) [protected]
void gfxASurface::MarkDirty (  ) 
void gfxASurface::MarkDirty ( const gfxRect r  ) 
nsrefcnt gfxASurface::Release ( void   ) 
void gfxASurface::SetData ( const cairo_user_data_key_t key,
void *  user_data,
thebes_destroy_func_t  destroy 
)
void gfxASurface::SetDeviceOffset ( const gfxPoint offset  ) 
static void gfxASurface::SetSurfaceWrapper ( cairo_surface_t csurf,
gfxASurface asurf 
) [static, protected]
static already_AddRefed<gfxASurface> gfxASurface::Wrap ( cairo_surface_t csurf  )  [static]

Member Data Documentation


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