Classes | Public Types | Public Member Functions

gfxGdkNativeRenderer Class Reference

This class lets us take code that draws into an GDK drawable and lets us use it to draw into any Thebes context. More...

#include <gfxGdkNativeRenderer.h>

List of all members.

Classes

struct  DrawOutput

Public Types

enum  {
  DRAW_IS_OPAQUE = 0x01, DRAW_SUPPORTS_OFFSET = 0x02, DRAW_SUPPORTS_CLIP_RECT = 0x04, DRAW_SUPPORTS_CLIP_LIST = 0x08,
  DRAW_SUPPORTS_NONDEFAULT_VISUAL = 0x10, DRAW_SUPPORTS_ALTERNATE_SCREEN = 0x20
}

Public Member Functions

virtual nsresult NativeDraw (GdkDrawable *drawable, short offsetX, short offsetY, GdkRectangle *clipRects, PRUint32 numClipRects)=0
 Perform the native drawing.
nsresult Draw (gfxContext *ctx, int width, int height, PRUint32 flags, DrawOutput *output)

Detailed Description

This class lets us take code that draws into an GDK drawable and lets us use it to draw into any Thebes context.

The user should subclass this class, override NativeDraw, and then call Draw(). The drawing will be subjected to all Thebes transformations, clipping etc.


Member Enumeration Documentation

anonymous enum
Enumerator:
DRAW_IS_OPAQUE 
DRAW_SUPPORTS_OFFSET 
DRAW_SUPPORTS_CLIP_RECT 
DRAW_SUPPORTS_CLIP_LIST 
DRAW_SUPPORTS_NONDEFAULT_VISUAL 
DRAW_SUPPORTS_ALTERNATE_SCREEN 

Member Function Documentation

nsresult gfxGdkNativeRenderer::Draw ( gfxContext ctx,
int  width,
int  height,
PRUint32  flags,
DrawOutput output 
)
Parameters:
flags see above
bounds Draw()'s drawing is guaranteed to be restricted to the rectangle (offset.x,offset.y,bounds.width,bounds.height)
dpy a display to use for the drawing if ctx doesn't have one
resultSurface if non-null, we will try to capture a copy of the rendered image into a surface similar to the surface of ctx; if successful, a pointer to the new gfxASurface is stored in *resultSurface, otherwise *resultSurface is set to nsnull.
virtual nsresult gfxGdkNativeRenderer::NativeDraw ( GdkDrawable drawable,
short  offsetX,
short  offsetY,
GdkRectangle *  clipRects,
PRUint32  numClipRects 
) [pure virtual]

Perform the native drawing.

Parameters:
offsetX draw at this offset into the given drawable
offsetY draw at this offset into the given drawable
clipRects an array of rects; clip to the union
numClipRects the number of rects in the array, or zero if no clipping is required

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