[gnome-keyring: 5/5] Merge branch 'gnome-3-0'
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-keyring: 5/5] Merge branch 'gnome-3-0'
- Date: Fri, 8 Apr 2011 16:22:34 +0000 (UTC)
commit 4557d759ccf929ad80d2244bc14fe10ac2f06560
Merge: 843fdea 122c6a6
Author: Stef Walter <stefw collabora co uk>
Date: Fri Apr 8 18:21:53 2011 +0200
Merge branch 'gnome-3-0'
Conflicts:
.gitignore
gcr/gcr-certificate-renderer.c
gcr/gcr-parser.c
gcr/tests/Makefile.am
gcr/tests/frob-key.c
gcr/tests/frob-selector.c
gcr/tests/test-certificate-chain.c
gcr/tests/ui-test-key.c
configure.in | 42 +++--
docs/reference/gcr/Makefile.am | 15 ++-
docs/reference/gcr/gcr-docs.sgml | 10 +-
docs/reference/gcr/gcr-sections.txt | 214 ++++++++++++++++++------
gcr/gcr-certificate-chain.c | 32 ++++
gcr/gcr-certificate-chain.h | 2 +
gcr/gcr-certificate-renderer.c | 65 +++++++-
gcr/gcr-certificate-renderer.h | 6 +-
gcr/gcr-certificate-widget.c | 74 ++++++++-
gcr/gcr-certificate-widget.h | 7 +-
gcr/gcr-certificate.c | 12 ++
gcr/gcr-certificate.h | 1 +
gcr/gcr-importer.c | 170 ++++++++++++++++++-
gcr/gcr-importer.h | 6 +-
gcr/gcr-initializer.h | 85 ----------
gcr/gcr-key-renderer.c | 40 +++++
gcr/gcr-key-renderer.h | 2 +
gcr/gcr-key-widget.c | 53 ++++++
gcr/gcr-key-widget.h | 3 +
gcr/gcr-library.c | 16 +-
gcr/gcr-parser.c | 312 ++++++++++++++++++++++++++++++-----
gcr/gcr-parser.h | 25 ++--
gcr/gcr-pkcs11-certificate.c | 12 ++
gcr/gcr-pkcs11-certificate.h | 3 +
gcr/gcr-renderer.c | 80 +++++++++
gcr/gcr-renderer.h | 1 +
gcr/gcr-simple-certificate.c | 13 ++
gcr/gcr-simple-certificate.h | 2 +
gcr/gcr-trust.c | 2 +-
gcr/gcr-types.h | 22 +--
gcr/gcr-unlock-options-widget.c | 132 +++++++++++++++
gcr/gcr-unlock-options-widget.h | 2 +
gcr/gcr-viewer.c | 81 +++++++++-
gcr/gcr-viewer.h | 3 +-
gcr/tests/Makefile.am | 2 +-
35 files changed, 1292 insertions(+), 255 deletions(-)
---
diff --cc gcr/gcr-certificate-renderer.c
index 6029e58,83685fe..77c5599
--- a/gcr/gcr-certificate-renderer.c
+++ b/gcr/gcr-certificate-renderer.c
@@@ -333,20 -288,19 +347,25 @@@ gcr_certificate_renderer_class_init (Gc
gobject_class->set_property = gcr_certificate_renderer_set_property;
gobject_class->get_property = gcr_certificate_renderer_get_property;
+ /**
+ * GcrCertificateRenderer:certificate:
+ *
+ * The certificate to display. May be %NULL.
+ */
g_object_class_install_property (gobject_class, PROP_CERTIFICATE,
- g_param_spec_object("certificate", "Certificate", "Certificate to display.",
- GCR_TYPE_CERTIFICATE, G_PARAM_READWRITE));
+ g_param_spec_object ("certificate", "Certificate", "Certificate to display.",
+ GCR_TYPE_CERTIFICATE, G_PARAM_READWRITE));
+
+ g_object_class_install_property (gobject_class, PROP_ATTRIBUTES,
+ g_param_spec_boxed ("attributes", "Attributes", "Certificate pkcs11 attributes",
+ GCK_TYPE_ATTRIBUTES, G_PARAM_READWRITE));
- g_object_class_override_property (gobject_class, PROP_LABEL, "label");
- g_object_class_override_property (gobject_class, PROP_ATTRIBUTES, "attributes");
+ g_object_class_install_property (gobject_class, PROP_LABEL,
+ g_param_spec_string ("label", "Label", "Certificate Label",
+ "", G_PARAM_READWRITE));
_gcr_icons_register ();
+ gcr_certificate_mixin_class_init (gobject_class);
/* Register this as a renderer which can be loaded */
registered = gck_attributes_new ();
@@@ -589,36 -504,40 +617,53 @@@ gcr_certificate_renderer_new (GcrCertif
return g_object_new (GCR_TYPE_CERTIFICATE_RENDERER, "certificate", certificate, NULL);
}
+GcrCertificateRenderer*
+gcr_certificate_renderer_new_for_attributes (const gchar *label, struct _GckAttributes *attrs)
+{
+ return g_object_new (GCR_TYPE_CERTIFICATE_RENDERER, "label", label, "attributes", attrs, NULL);
+}
+
+ /**
+ * gcr_certificate_renderer_get_certificate:
+ * @self: The renderer
+ *
+ * Get the certificate displayed in the renderer. If no certificate was
+ * explicitly set, then the renderer will return itself since it acts as
+ * a valid certificate.
+ *
+ * Returns: The certificate, owned by the renderer.
+ */
GcrCertificate*
gcr_certificate_renderer_get_certificate (GcrCertificateRenderer *self)
{
g_return_val_if_fail (GCR_IS_CERTIFICATE_RENDERER (self), NULL);
- return self->pv->certificate;
+ if (self->pv->opt_cert)
+ return self->pv->opt_cert;
+ return GCR_CERTIFICATE (self);
}
+ /**
+ * gcr_certificate_renderer_set_certificate:
+ * @self: The renderer
+ * @certificate: The certificate to display
+ *
+ * Set a certificate to display in the renderer.
+ */
void
- gcr_certificate_renderer_set_certificate (GcrCertificateRenderer *self, GcrCertificate *cert)
+ gcr_certificate_renderer_set_certificate (GcrCertificateRenderer *self, GcrCertificate *certificate)
{
g_return_if_fail (GCR_IS_CERTIFICATE_RENDERER (self));
- if (self->pv->certificate)
- g_object_unref (self->pv->certificate);
- self->pv->certificate = certificate;
- if (self->pv->certificate)
- g_object_ref (self->pv->certificate);
+ if (self->pv->opt_cert)
+ g_object_unref (self->pv->opt_cert);
- self->pv->opt_cert = cert;
++ self->pv->opt_cert = certificate;
+ if (self->pv->opt_cert)
+ g_object_ref (self->pv->opt_cert);
+
+ if (self->pv->opt_attrs) {
+ gck_attributes_unref (self->pv->opt_attrs);
+ self->pv->opt_attrs = NULL;
+ }
gcr_renderer_emit_data_changed (GCR_RENDERER (self));
g_object_notify (G_OBJECT (self), "certificate");
@@@ -628,9 -555,17 +681,17 @@@ GckAttributes
gcr_certificate_renderer_get_attributes (GcrCertificateRenderer *self)
{
g_return_val_if_fail (GCR_IS_CERTIFICATE_RENDERER (self), NULL);
- return self->pv->attributes;
+ return self->pv->opt_attrs;
}
+ /**
+ * gcr_certificate_renderer_set_attributes:
+ * @self: The renderer
+ * @attrs: Attributes to set
+ *
+ * Set the PKCS\#11 attributes for this renderer to display. One of the attributes
+ * should be a CKA_VALUE type attribute containing a DER encoded certificate.
+ */
void
gcr_certificate_renderer_set_attributes (GcrCertificateRenderer *self, GckAttributes *attrs)
{
diff --cc gcr/gcr-certificate-renderer.h
index 2cc225b,079402a..d93093d
--- a/gcr/gcr-certificate-renderer.h
+++ b/gcr/gcr-certificate-renderer.h
@@@ -57,11 -56,8 +59,11 @@@ struct _GcrCertificateRendererClass
GType gcr_certificate_renderer_get_type (void);
- GcrCertificateRenderer* gcr_certificate_renderer_new (GcrCertificate *cert);
+ GcrCertificateRenderer* gcr_certificate_renderer_new (GcrCertificate *certificate);
+GcrCertificateRenderer* gcr_certificate_renderer_new_for_attributes (const gchar *label,
+ struct _GckAttributes *attrs);
+
GcrCertificate* gcr_certificate_renderer_get_certificate (GcrCertificateRenderer *self);
void gcr_certificate_renderer_set_certificate (GcrCertificateRenderer *self,
diff --cc gcr/gcr-certificate.c
index 9a3ebb9,4f6e7fa..ab2f59a
--- a/gcr/gcr-certificate.c
+++ b/gcr/gcr-certificate.c
@@@ -49,17 -46,20 +49,29 @@@
*
* You can use #GcrSimpleCertificate to simply load a certificate for which
* you already have the raw certificate data.
+ *
+ * The #GcrCertificate interface has several properties that must be implemented.
+ * You can use a mixin to implement these properties if desired. See the
+ * gcr_certificate_mixin_class_init() and gcr_certificate_mixin_get_property()
+ * functions.
+ *
+ * All certificates are comparable. If implementing a #GcrCertificate, you can
+ * use GCR_CERTIFICATE_MIXIN_IMPLEMENT_COMPARABLE() to implement the #GcrComparable
+ * interface.
*/
+ /**
+ * GcrCertificate:
+ *
+ * An object which holds a certificate.
+ */
+
+ /**
+ * GcrCertificateIface:
+ *
+ * The interface that implementors of #GcrCertificate must implement.
+ */
+
/*
* The DER data in this structure is owned by the derived class.
* It is only valid for the duration of the current call stack
diff --cc gcr/gcr-certificate.h
index 32b37b6,57ab9e1..f180cf8
--- a/gcr/gcr-certificate.h
+++ b/gcr/gcr-certificate.h
@@@ -47,8 -43,9 +47,9 @@@ typedef struct _GcrCertificateIfac
struct _GcrCertificateIface {
GTypeInterface parent;
- gconstpointer (*get_der_data) (GcrCertificate *self, gsize *n_data);
+ gconstpointer (*get_der_data) (GcrCertificate *self, gsize *n_data);
+ /*< private >*/
gpointer dummy1;
gpointer dummy2;
gpointer dummy3;
diff --cc gcr/gcr-renderer.c
index 8d96dd9,6524b63..f60f782
--- a/gcr/gcr-renderer.c
+++ b/gcr/gcr-renderer.c
@@@ -80,23 -127,28 +127,37 @@@ gcr_renderer_get_type (void
return type;
}
+ /**
+ * gcr_renderer_render:
+ * @self: The renderer
+ * @viewer: The viewer to render to.
+ *
+ * Render the contents of the renderer to the given viewer.
+ */
void
-gcr_renderer_render (GcrRenderer *self, GcrViewer *viewer)
+gcr_renderer_render_view (GcrRenderer *self, GcrViewer *viewer)
{
g_return_if_fail (GCR_IS_RENDERER (self));
- g_return_if_fail (GCR_RENDERER_GET_INTERFACE (self)->render);
- GCR_RENDERER_GET_INTERFACE (self)->render (self, viewer);
+ g_return_if_fail (GCR_RENDERER_GET_INTERFACE (self)->render_view);
+ GCR_RENDERER_GET_INTERFACE (self)->render_view (self, viewer);
+}
+
+void
+gcr_renderer_popuplate_popup (GcrRenderer *self, GcrViewer *viewer,
+ GtkMenu *menu)
+{
+ g_return_if_fail (GCR_IS_RENDERER (self));
+ if (GCR_RENDERER_GET_INTERFACE (self)->populate_popup)
+ GCR_RENDERER_GET_INTERFACE (self)->populate_popup (self, viewer, menu);
}
+ /**
+ * gcr_renderer_emit_data_changed:
+ * @self: The renderer
+ *
+ * Emit the GcrRenderer::data-changed signal on the renderer. This is used by
+ * renderer implementations.
+ */
void
gcr_renderer_emit_data_changed (GcrRenderer *self)
{
diff --cc gcr/gcr-renderer.h
index e262508,b18bbe3..816c8f1
--- a/gcr/gcr-renderer.h
+++ b/gcr/gcr-renderer.h
@@@ -44,14 -43,10 +44,15 @@@ struct _GcrRendererIface
void (*data_changed) (GcrRenderer *self);
/* virtual */
- void (*render) (GcrRenderer *self, GcrViewer *viewer);
+ void (*render_view) (GcrRenderer *self, GcrViewer *viewer);
+
+ const void (*get_column_value) (GcrRenderer *self, GQuark column, GValue *value);
+
+ void (*populate_popup) (GcrRenderer *self, GcrViewer *viewer, GtkMenu *menu);
+ /*< private >*/
gpointer dummy1;
+
gpointer dummy2;
gpointer dummy3;
gpointer dummy4;
diff --cc gcr/tests/Makefile.am
index c8b4cd7,1e57e92..59bad0b
--- a/gcr/tests/Makefile.am
+++ b/gcr/tests/Makefile.am
@@@ -43,7 -43,6 +43,7 @@@ EXTRA_DIST =
# ------------------------------------------------------------------
noinst_PROGRAMS = \
- frob-selector \
frob-certificate \
frob-key \
++ frob-selector \
frob-unlock-options
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]