Synopsis

#include <adg-1/adg.h>

struct              AdgFillStyle;
struct              AdgFillStyleClass;
void                adg_fill_style_set_pattern          (AdgFillStyle *fill_style,
                                                         cairo_pattern_t *pattern);
cairo_pattern_t *   adg_fill_style_get_pattern          (AdgFillStyle *fill_style);
void                adg_fill_style_set_extents          (AdgFillStyle *fill_style,
                                                         const CpmlExtents *extents);
const CpmlExtents * adg_fill_style_get_extents          (AdgFillStyle *fill_style);

Object Hierarchy

  GObject
   +----AdgStyle
         +----AdgFillStyle
               +----AdgRuledFill

Properties

  "pattern"                  CairoPattern*         : Read / Write

Description

A style defining a generic fill based on cairo_pattern_t.

Details

struct AdgFillStyle

struct AdgFillStyle;

All fields are private and should not be used directly. Use its public methods instead.

Since 1.0


struct AdgFillStyleClass

struct AdgFillStyleClass {
    /* Virtual table */
    void                (*set_extents)          (AdgFillStyle   *fill_style,
                                                 const CpmlExtents *extents);
};

The default set_extents@ implementation simply sets the extents owned by the fill style instance to the one provided, so the last call has precedence. Any derived class can override it to customize this behavior, for example to keep the greatest boundary box instead of the last one.

set_extents ()

virtual method that specifies where a specific fill style must be applied. It is called by AdgHatch in the rendering phase passing with its boundary box as argument.

Since 1.0


adg_fill_style_set_pattern ()

void                adg_fill_style_set_pattern          (AdgFillStyle *fill_style,
                                                         cairo_pattern_t *pattern);

Note

This function is only useful in new fill implementations.

Sets a new pattern on fill_style. A new reference is added to pattern with cairo_pattern_reference() and the old pattern (if any) is unreferenced with cairo_pattern_destroy().

fill_style :

an AdgFillStyle

pattern :

the new pattern

Since 1.0


adg_fill_style_get_pattern ()

cairo_pattern_t *   adg_fill_style_get_pattern          (AdgFillStyle *fill_style);

Gets the current pattern binded to fill_style.

fill_style :

an AdgFillStyle

Returns :

the current pattern. [transfer none]

Since 1.0


adg_fill_style_set_extents ()

void                adg_fill_style_set_extents          (AdgFillStyle *fill_style,
                                                         const CpmlExtents *extents);

Note

This function is only useful in new fill style implementations.

Forcibly sets new extents on fill_style. Any fill style class that want to make some kind of customization can override the set_extents() virtual method to intercept any extents change.

Sets new extents on fill_style. These extents are usually set by the arrange() method of the entity using this filling style.

fill_style :

an AdgFillStyle

extents :

the new extents

Since 1.0


adg_fill_style_get_extents ()

const CpmlExtents * adg_fill_style_get_extents          (AdgFillStyle *fill_style);

Stores a copy of the extents of fill_style in extents. This struct specifies the maximum portion (in global space) this fill style should be applied: it will clamped by the entities as needed.

fill_style :

an AdgFillStyle

Returns :

the extents of fill_style or NULL on errors. [transfer none]

Since 1.0

Property Details

The "pattern" property

  "pattern"                  CairoPattern*         : Read / Write

The cairo pattern set for this entity.