## GcrRenderer GcrRenderer — An interface implemented by renderers. |

## Synopsis

                        GcrRenderer;
    struct              GcrRendererIface;
    GcrRenderer *            gcr_renderer_create            (const gchar *label,
                                                             GckAttributes *attrs);
    void                gcr_renderer_register               (GType renderer_type,
                                                             GckAttributes *attrs);
    void                gcr_renderer_render                 (GcrRenderer *self,
                                                             GcrViewer *viewer);
    void                gcr_renderer_emit_data_changed      (GcrRenderer *self);

## Description

A GcrRenderer is an interface that's implemented by renderers which wish to render data to a GcrViewer.

The interaction between GcrRenderer and GcrViewer is not stable yet, and so new renderers cannot be implemented outside the Gcr library at this time.

To lookup a renderer for a given set of attributes, use the `gcr_renderer_create()` function. This will create and initialize a renderer that's capable of viewing the data in those attributes.

## Details

### GcrRenderer

    typedef struct _GcrRenderer GcrRenderer;

A renderer.

### struct GcrRendererIface

    struct GcrRendererIface {
    	GTypeInterface parent;

    	/* signals */
    	void (*data_changed) (GcrRenderer *self);

    	/* virtual */
    	void (*render) (GcrRenderer *self, GcrViewer *viewer);
    };

The interface for GcrRenderer

GTypeInterface `parent`; | The parent interface
`data_changed` () | The GcrRenderer::data-changed signal
`render` () | A virtual method to render the contents.

### gcr_renderer_create ()

    GcrRenderer *            gcr_renderer_create            (const gchar *label,
                                                             GckAttributes *attrs);

Create and initialize a renderer for the given attributes and label. These renderers should have been preregistered via `gcr_renderer_register()`.

`label` : | The label for the renderer
`attrs` : | The attributes to render
Returns : | A new renderer, or `NULL` if no renderer matched the attributes. The render should be released with g_object-`unref()`.

### gcr_renderer_register ()

    void                gcr_renderer_register               (GType renderer_type,
                                                             GckAttributes *attrs);

Register a renderer to be created when matching attributes are passed to `gcr_renderer_create()`.

`renderer_type` : | The renderer class type
`attrs` : | The attributes to match

### gcr_renderer_render ()

    void                gcr_renderer_render                 (GcrRenderer *self,
                                                             GcrViewer *viewer);

Render the contents of the renderer to the given viewer.

`self` : | The renderer
`viewer` : | The viewer to render to.

### gcr_renderer_emit_data_changed ()

    void                gcr_renderer_emit_data_changed      (GcrRenderer *self);

Emit the GcrRenderer::data-changed signal on the renderer. This is used by renderer implementations.

`self` : | The renderer