cairoLib.Pattern.Pattern Class Reference

List of all members.

Detailed Description

Description.


Public Member Functions

cairo_pattern_tgetPatternStruct ()
 this (cairo_pattern_t *cairo_pattern)
 Sets our main struct and passes it to the parent class.
void addColorStopRgb (double offset, double red, double green, double blue)
 Adds an opaque color stop to a gradient pattern.
void addColorStopRgba (double offset, double red, double green, double blue, double alpha)
 Adds a translucent color stop to a gradient pattern.
void destroy ()
 Decreases the reference count on pattern by one.
cairo_pattern_treference ()
 Increases the reference count on pattern by one.
cairo_status_t status ()
 Checks whether an error has previously occurred for this pattern.
void setExtend (cairo_extend_t extend)
 Sets the mode to be used for drawing outside the area of a pattern.
cairo_extend_t getExtend ()
 Gets the current extend mode for a pattern.
void setFilter (cairo_filter_t filter)
 pattern: filter:
cairo_filter_t getFilter ()
 pattern: Returns:
void setMatrix (cairo_matrix_t *matrix)
 Sets the pattern's transformation matrix to matrix.
void getMatrix (cairo_matrix_t *matrix)
 Stores the pattern's transformation matrix into matrix.
cairo_pattern_type_t getType ()
 This function returns the type a pattern.

Static Public Member Functions

static cairo_pattern_tcreateRgb (double red, double green, double blue)
 Creates a new cairo_pattern_t corresponding to an opaque color.
static cairo_pattern_tcreateRgba (double red, double green, double blue, double alpha)
 Creates a new cairo_pattern_t corresponding to a translucent color.
static cairo_pattern_tcreateForSurface (cairo_surface_t *surface)
 Create a new cairo_pattern_t for the given surface.
static cairo_pattern_tcreateLinear (double x0, double y0, double x1, double y1)
 Create a new linear gradient cairo_pattern_t along the line defined by (x0, y0) and (x1, y1).
static cairo_pattern_tcreateRadial (double cx0, double cy0, double radius0, double cx1, double cy1, double radius1)
 Creates a new radial gradient cairo_pattern_t between the two circles defined by (x0, y0, c0) and (x1, y1, c0).

Protected Member Functions

void * getStruct ()
 the main Gtk struct as a void*

Protected Attributes

cairo_pattern_tcairo_pattern
 the main Gtk struct


Constructor & Destructor Documentation

cairoLib.Pattern.Pattern.this ( cairo_pattern_t cairo_pattern  ) 

Sets our main struct and passes it to the parent class.


Member Function Documentation

void cairoLib.Pattern.Pattern.addColorStopRgb ( double  offset,
double  red,
double  green,
double  blue 
)

Adds an opaque color stop to a gradient pattern.

The offset specifies the location along the gradient's control vector. For example, a linear gradient's control vector is from (x0,y0) to (x1,y1) while a radial gradient's control vector is from any point on the start circle to the corresponding point on the end circle. The color is specified in the same way as in cairo_set_source_rgb(). Note: If the pattern is not a gradient pattern, (eg. a linear or radial pattern), then the pattern will be put into an error status with a status of CAIRO_STATUS_PATTERN_TYPE_MISMATCH. pattern: a cairo_pattern_t offset: an offset in the range [0.0 .. 1.0] red: red component of color green: green component of color blue: blue component of color

void cairoLib.Pattern.Pattern.addColorStopRgba ( double  offset,
double  red,
double  green,
double  blue,
double  alpha 
)

Adds a translucent color stop to a gradient pattern.

The offset specifies the location along the gradient's control vector. For example, a linear gradient's control vector is from (x0,y0) to (x1,y1) while a radial gradient's control vector is from any point on the start circle to the corresponding point on the end circle. The color is specified in the same way as in cairo_set_source_rgba(). Note: If the pattern is not a gradient pattern, (eg. a linear or radial pattern), then the pattern will be put into an error status with a status of CAIRO_STATUS_PATTERN_TYPE_MISMATCH. pattern: a cairo_pattern_t offset: an offset in the range [0.0 .. 1.0] red: red component of color green: green component of color blue: blue component of color alpha: alpha component of color

static cairo_pattern_t* cairoLib.Pattern.Pattern.createForSurface ( cairo_surface_t surface  )  [static]

Create a new cairo_pattern_t for the given surface.

surface: the surface Returns: the newly created cairo_pattern_t if succesful, or an error pattern in case of no memory. The caller owns the returned object and should call cairo_pattern_destroy() when finished with it. This function will always return a valid pointer, but if an error occurred the pattern status will be set to an error. To inspect the status of a pattern use cairo_pattern_status().

static cairo_pattern_t* cairoLib.Pattern.Pattern.createLinear ( double  x0,
double  y0,
double  x1,
double  y1 
) [static]

Create a new linear gradient cairo_pattern_t along the line defined by (x0, y0) and (x1, y1).

Before using the gradient pattern, a number of color stops should be defined using cairo_pattern_add_color_stop_rgb() or cairo_pattern_add_color_stop_rgba(). Note: The coordinates here are in pattern space. For a new pattern, pattern space is identical to user space, but the relationship between the spaces can be changed with cairo_pattern_set_matrix(). x0: x coordinate of the start point y0: y coordinate of the start point x1: x coordinate of the end point y1: y coordinate of the end point Returns: the newly created cairo_pattern_t if succesful, or an error pattern in case of no memory. The caller owns the returned object and should call cairo_pattern_destroy() when finished with it. This function will always return a valid pointer, but if an error occurred the pattern status will be set to an error. To inspect the status of a pattern use cairo_pattern_status().

static cairo_pattern_t* cairoLib.Pattern.Pattern.createRadial ( double  cx0,
double  cy0,
double  radius0,
double  cx1,
double  cy1,
double  radius1 
) [static]

Creates a new radial gradient cairo_pattern_t between the two circles defined by (x0, y0, c0) and (x1, y1, c0).

Before using the gradient pattern, a number of color stops should be defined using cairo_pattern_add_color_stop_rgb() or cairo_pattern_add_color_stop_rgba(). Note: The coordinates here are in pattern space. For a new pattern, pattern space is identical to user space, but the relationship between the spaces can be changed with cairo_pattern_set_matrix(). cx0: x coordinate for the center of the start circle cy0: y coordinate for the center of the start circle radius0: radius of the start cirle cx1: x coordinate for the center of the end circle cy1: y coordinate for the center of the end circle radius1: radius of the end cirle Returns: the newly created cairo_pattern_t if succesful, or an error pattern in case of no memory. The caller owns the returned object and should call cairo_pattern_destroy() when finished with it. This function will always return a valid pointer, but if an error occurred the pattern status will be set to an error. To inspect the status of a pattern use cairo_pattern_status().

static cairo_pattern_t* cairoLib.Pattern.Pattern.createRgb ( double  red,
double  green,
double  blue 
) [static]

Creates a new cairo_pattern_t corresponding to an opaque color.

The color components are floating point numbers in the range 0 to 1. If the values passed in are outside that range, they will be clamped. red: red component of the color green: green component of the color blue: blue component of the color Returns: the newly created cairo_pattern_t if succesful, or an error pattern in case of no memory. The caller owns the returned object and should call cairo_pattern_destroy() when finished with it. This function will always return a valid pointer, but if an error occurred the pattern status will be set to an error. To inspect the status of a pattern use cairo_pattern_status().

static cairo_pattern_t* cairoLib.Pattern.Pattern.createRgba ( double  red,
double  green,
double  blue,
double  alpha 
) [static]

Creates a new cairo_pattern_t corresponding to a translucent color.

The color components are floating point numbers in the range 0 to 1. If the values passed in are outside that range, they will be clamped. red: red component of the color green: green component of the color blue: blue component of the color alpha: alpha component of the color Returns: the newly created cairo_pattern_t if succesful, or an error pattern in case of no memory. The caller owns the returned object and should call cairo_pattern_destroy() when finished with it. This function will always return a valid pointer, but if an error occurred the pattern status will be set to an error. To inspect the status of a pattern use cairo_pattern_status().

void cairoLib.Pattern.Pattern.destroy (  ) 

Decreases the reference count on pattern by one.

If the result is zero, then pattern and all associated resources are freed. See cairo_pattern_reference(). pattern: a cairo_pattern_t

cairo_extend_t cairoLib.Pattern.Pattern.getExtend (  ) 

Gets the current extend mode for a pattern.

See cairo_extend_t for details on the semantics of each extend strategy. pattern: a cairo_pattern_t Returns: the current extend strategy used for drawing the pattern.

cairo_filter_t cairoLib.Pattern.Pattern.getFilter (  ) 

pattern: Returns:

void cairoLib.Pattern.Pattern.getMatrix ( cairo_matrix_t matrix  ) 

Stores the pattern's transformation matrix into matrix.

pattern: a cairo_pattern_t matrix: return value for the matrix

cairo_pattern_t* cairoLib.Pattern.Pattern.getPatternStruct (  ) 

void* cairoLib.Pattern.Pattern.getStruct (  )  [protected]

the main Gtk struct as a void*

cairo_pattern_type_t cairoLib.Pattern.Pattern.getType (  ) 

This function returns the type a pattern.

See cairo_pattern_type_t for available types. pattern: a cairo_pattern_t Returns: The type of pattern. Since 1.2

cairo_pattern_t* cairoLib.Pattern.Pattern.reference (  ) 

Increases the reference count on pattern by one.

This prevents pattern from being destroyed until a matching call to cairo_pattern_destroy() is made. pattern: a cairo_pattern_t Returns: the referenced cairo_pattern_t.

void cairoLib.Pattern.Pattern.setExtend ( cairo_extend_t  extend  ) 

Sets the mode to be used for drawing outside the area of a pattern.

See cairo_extend_t for details on the semantics of each extend strategy. pattern: a cairo_pattern_t extend: a cairo_extend_t describing how the area outside of the pattern will be drawn

void cairoLib.Pattern.Pattern.setFilter ( cairo_filter_t  filter  ) 

pattern: filter:

void cairoLib.Pattern.Pattern.setMatrix ( cairo_matrix_t matrix  ) 

Sets the pattern's transformation matrix to matrix.

This matrix is a transformation from user space to pattern space. When a pattern is first created it always has the identity matrix for its transformation matrix, which means that pattern space is initially identical to user space. Important: Please note that the direction of this transformation matrix is from user space to pattern space. This means that if you imagine the flow from a pattern to user space (and on to device space), then coordinates in that flow will be transformed by the inverse of the pattern matrix. For example, if you want to make a pattern appear twice as large as it does by default the correct code to use is: cairo_matrix_init_scale (matrix, 0.5, 0.5); cairo_pattern_set_matrix (pattern, matrix); Meanwhile, using values of 2.0 rather than 0.5 in the code above would cause the pattern to appear at half of its default size. Also, please note the discussion of the user-space locking semantics of cairo_set_source(). pattern: a cairo_pattern_t matrix: a cairo_matrix_t

cairo_status_t cairoLib.Pattern.Pattern.status (  ) 

Checks whether an error has previously occurred for this pattern.

pattern: a cairo_pattern_t Returns: CAIRO_STATUS_SUCCESS, CAIRO_STATUS_NO_MEMORY, or CAIRO_STATUS_PATTERN_TYPE_MISMATCH.


Member Data Documentation

cairo_pattern_t* cairoLib.Pattern.Pattern.cairo_pattern [protected]

the main Gtk struct


SourceForge.net Logo DSource.org Logo digitalmars.com Logo