Synopsis

#include <adg-1/adg.h>

struct              AdgStyle;
struct              AdgStyleClass;
void                adg_style_invalidate                (AdgStyle *style);
void                adg_style_apply                     (AdgStyle *style,
                                                         AdgEntity *entity,
                                                         cairo_t *cr);

Object Hierarchy

  GObject
   +----AdgStyle
         +----AdgColorStyle
         +----AdgDimStyle
         +----AdgFillStyle
         +----AdgFontStyle
         +----AdgLineStyle
         +----AdgTableStyle

Signals

  "apply"                                          : Run Last
  "invalidate"                                     : Run Last

Description

This is the fundamental abstract class for styles.

Details

struct AdgStyle

struct AdgStyle;

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

Since 1.0


struct AdgStyleClass

struct AdgStyleClass {
    /* Signals */
    void                (*invalidate)           (AdgStyle       *style);
    void                (*apply)                (AdgStyle       *style,
                                                 AdgEntity      *entity,
                                                 cairo_t        *cr);
};

The default invalidate handler does not do anything.

The virtual method apply *must* be implemented by any derived class. The default implementation will trigger an error if called.

invalidate ()

virtual method to reset the style.

apply ()

abstract virtual to apply a style to a cairo context.

Since 1.0


adg_style_invalidate ()

void                adg_style_invalidate                (AdgStyle *style);

Emits the "invalidate" signal on style. This signal is always emitted while disposing style, so be sure it can be called more than once without harms.

Note

This function is only useful in new style implementations.

style :

an AdgStyle derived style

Since 1.0


adg_style_apply ()

void                adg_style_apply                     (AdgStyle *style,
                                                         AdgEntity *entity,
                                                         cairo_t *cr);

Emits the "apply" signal on style, passing entity and cr as parameters to the signal.

style :

an AdgStyle derived style

entity :

the caller AdgEntity

cr :

the subject cairo context

Since 1.0

Signal Details

The "apply" signal

void                user_function                      (AdgStyle  *style,
                                                        AdgEntity *entity,
                                                        gpointer   cr,
                                                        gpointer   user_data)      : Run Last

Applies style to cr so the next rendering operations will be done accordling to this style directives. The entity parameter is used to resolve the internal dresses of style, if any.

style :

an AdgStyle

entity :

the caller AdgEntity

cr :

the cairo_t context

user_data :

user data set when the signal handler was connected.

Since 1.0


The "invalidate" signal

void                user_function                      (AdgStyle *style,
                                                        gpointer  user_data)      : Run Last

Invalidates the style, that is resets all the cache, if any, retained by the internal implementation.

This signal is emitted while disposing style, so be sure it can be called more than once without harms. Furthermore it will be emitted from property setter code of new implementations to force the recomputation of the cache.

style :

an AdgStyle

user_data :

user data set when the signal handler was connected.

Since 1.0