GcrRenderer

## 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_popuplate_popup        (GcrRenderer *self,
                                                             GcrViewer *viewer,
                                                             GtkMenu *menu);
    void                gcr_renderer_render                 (GcrRenderer *self,
                                                             GcrViewer *viewer);
    void                gcr_renderer_render_view            (GcrRenderer *self,
                                                             GcrViewer *viewer);
    void                gcr_renderer_emit_data_changed      (GcrRenderer *self);
    void                gcr_renderer_register_well_known    (void);

## Object Hierarchy

      GInterface
       +----GcrRendererIface

## Known Implementations

GcrRendererIface is implemented by GcrCertificateRenderer and GcrKeyRenderer.

## 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;

The interface for GcrRenderer

### 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_popuplate_popup ()

    void                gcr_renderer_popuplate_popup        (GcrRenderer *self,
                                                             GcrViewer *viewer,
                                                             GtkMenu *menu);

Called by GcrViewer when about to display a popup menu for the content displayed by the renderer. The renderer can add a menu item if desired.

`self` : | The renderer
`viewer` : | The viewer that is displaying a popup
`menu` : | The popup menu being displayed

### gcr_renderer_render ()

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

### Warning

`gcr_renderer_render` has been deprecated since version 3.2 and should not be used in newly-written code. Use `gcr_renderer_render_view()` instead

Render a renderer to the viewer.

`self` : | the renderer
`viewer` : | the viewer to render to

### gcr_renderer_render_view ()

    void                gcr_renderer_render_view            (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

### gcr_renderer_register_well_known ()

    void                gcr_renderer_register_well_known    (void);