| Gcr Library Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
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);
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.
struct GcrRendererIface {
GTypeInterface parent;
/* signals */
void (*data_changed) (GcrRenderer *self);
/* virtual */
void (*render) (GcrRenderer *self, GcrViewer *viewer);
};
The interface for GcrRenderer
GTypeInterface |
The parent interface |
| The GcrRenderer::data-changed signal | |
| A virtual method to render the contents. |
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().
|
The label for the renderer |
|
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(). |
void gcr_renderer_register (GType renderer_type,GckAttributes *attrs);
Register a renderer to be created when matching attributes are passed to
gcr_renderer_create().
|
The renderer class type |
|
The attributes to match |
void gcr_renderer_render (GcrRenderer *self,GcrViewer *viewer);
Render the contents of the renderer to the given viewer.
|
The renderer |
|
The viewer to render to. |
void gcr_renderer_emit_data_changed (GcrRenderer *self);
Emit the GcrRenderer::data-changed signal on the renderer. This is used by renderer implementations.
|
The renderer |