### Interface

# GcrUi Renderer

#### Description [src]

    interface GcrUi.Renderer : GObject.Object

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.

#### Prerequisite

In order to implement Renderer, your type must inherit from`GObject`.

#### Implementations

- GcrCertificateRenderer
- GcrFailureRenderer
- GcrKeyRenderer

#### Functions

###### gcr_renderer_create

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

###### gcr_renderer_register

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

###### gcr_renderer_register_well_known

Register all the well known renderers for certificates and keys known to the Gcr library.

#### Instance methods

###### gcr_renderer_emit_data_changed

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

###### gcr_renderer_get_attributes

Get the PKCS#11 attributes, if any, set for this renderer to display.

###### gcr_renderer_popuplate_popup

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.

###### gcr_renderer_render_view

Render the contents of the renderer to the given viewer.

###### gcr_renderer_set_attributes

Set the PKCS#11 attributes for this renderer to display.

#### Properties

###### GcrUi.Renderer:attributes

The attributes to display.

###### GcrUi.Renderer:label

The label to display.

#### Signals

###### GcrUi.Renderer::data-changed

A signal that is emitted by the renderer when it’s data changed and should be rerendered.

#### Interface structure

    struct GcrUiRendererIface {
      GTypeInterface parent;
      void (* data_changed) (
        GcrRenderer* self
      );
      void (* render_view) (
        GcrRenderer* self,
        GcrViewer* viewer
      );
      void (* populate_popup) (
        GcrRenderer* self,
        GcrViewer* viewer,
        GtkMenu* menu
      );

    }

The interface for `GcrRenderer`.

###### Interface members

`parent`

    GTypeInterface

| The parent interface type.

`data_changed`

    void (* data_changed) (
        GcrRenderer* self
      )

| Signal emitted when data being rendered changes.

`render_view`

    void (* render_view) (
        GcrRenderer* self,
        GcrViewer* viewer
      )

| Method invoked to render the data into a viewer.

`populate_popup`

    void (* populate_popup) (
        GcrRenderer* self,
        GcrViewer* viewer,
        GtkMenu* menu
      )

| Method invoked to populate a popup menu with additional renderer options.

#### Virtual methods

###### GcrUi.Renderer.data_changed

Signal emitted when data being rendered changes.

###### GcrUi.Renderer.populate_popup

Method invoked to populate a popup menu with additional renderer options.

###### GcrUi.Renderer.render_view

Render the contents of the renderer to the given viewer.