| Gcr Library Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Prerequisites | Known Implementations | Properties | Signals | ||||
GcrRenderer; struct GcrRendererIface; GcrRenderer * gcr_renderer_create (const gchar *label,GckAttributes *attrs); void gcr_renderer_register (GType renderer_type,GckAttributes *attrs); GckAttributes * gcr_renderer_get_attributes (GcrRenderer *self); void gcr_renderer_set_attributes (GcrRenderer *self,GckAttributes *attrs); void gcr_renderer_popuplate_popup (GcrRenderer *self,GcrViewer *viewer,GtkMenu *menu); void gcr_renderer_render_view (GcrRenderer *self,GcrViewer *viewer); void gcr_renderer_emit_data_changed (GcrRenderer *self); void gcr_renderer_register_well_known (void);
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_view) (GcrRenderer *self, GcrViewer *viewer);
void (*populate_popup) (GcrRenderer *self, GcrViewer *viewer, GtkMenu *menu);
};
The interface for GcrRenderer
GTypeInterface |
the parent interface type |
| signal emitted when data being rendered changes | |
| method invoked to render the data into a viewer | |
| method invoked to populate a popup menu with additional renderer options |
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. [allow-none] |
|
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(). [transfer full][allow-none]
|
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 |
GckAttributes * gcr_renderer_get_attributes (GcrRenderer *self);
Get the PKCS#11 attributes, if any, set for this renderer to display.
|
The renderer |
Returns : |
the attributes, owned by the renderer. [allow-none][transfer none] |
void gcr_renderer_set_attributes (GcrRenderer *self,GckAttributes *attrs);
Set the PKCS#11 attributes for this renderer to display.
|
The renderer |
|
attributes to set. [allow-none] |
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.
|
The renderer |
|
The viewer that is displaying a popup |
|
The popup menu being displayed |
void gcr_renderer_render_view (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 "data-changed" signal on the renderer. This is used by renderer implementations.
|
The renderer |
"data-changed" signalvoid user_function (GcrRenderer *arg0,
gpointer user_data) : Run Last
A signal that is emitted by the renderer when it's data changed and should be rerendered.
|
user data set when the signal handler was connected. |