[gcr] gcr: Rename GcrCertificateReqRenderer to GcrCertificateRequestRenderer



commit afab17dbf9607620995f4a10304f66315469f597
Author: Stef Walter <stefw collabora co uk>
Date:   Mon Nov 21 13:00:42 2011 +0100

    gcr: Rename GcrCertificateReqRenderer to GcrCertificateRequestRenderer
    
     * Longer name is more in line with our other names

 gcr/Makefile.am                                    |    2 +-
 gcr/gcr-certificate-req-renderer.h                 |   70 -------------
 ...nderer.c => gcr-certificate-request-renderer.c} |  102 ++++++++++----------
 gcr/gcr-certificate-request-renderer.h             |   70 +++++++++++++
 gcr/gcr-renderer.c                                 |    4 +-
 gcr/tests/frob-request.c                           |    4 +-
 6 files changed, 126 insertions(+), 126 deletions(-)
---
diff --git a/gcr/Makefile.am b/gcr/Makefile.am
index f8ea461..b6d991c 100644
--- a/gcr/Makefile.am
+++ b/gcr/Makefile.am
@@ -141,7 +141,7 @@ libgcr_ GCR_MAJOR@_la_SOURCES = \
 	gcr-certificate-exporter.c gcr-certificate-exporter.h \
 	gcr-certificate-extensions.c gcr-certificate-extensions.h \
 	gcr-certificate-renderer.c gcr-certificate-renderer.h \
-	gcr-certificate-req-renderer.c gcr-certificate-req-renderer.h \
+	gcr-certificate-request-renderer.c gcr-certificate-request-renderer.h \
 	gcr-certificate-widget.c gcr-certificate-widget.h \
 	gcr-collection-model.c gcr-collection-model.h \
 	gcr-combo-selector.c gcr-combo-selector.h \
diff --git a/gcr/gcr-certificate-req-renderer.c b/gcr/gcr-certificate-request-renderer.c
similarity index 80%
rename from gcr/gcr-certificate-req-renderer.c
rename to gcr/gcr-certificate-request-renderer.c
index a6b4f01..c5b7b02 100644
--- a/gcr/gcr-certificate-req-renderer.c
+++ b/gcr/gcr-certificate-request-renderer.c
@@ -20,7 +20,7 @@
 #include "config.h"
 
 #include "gcr-certificate-renderer-private.h"
-#include "gcr-certificate-req-renderer.h"
+#include "gcr-certificate-request-renderer.h"
 #include "gcr-display-view.h"
 #include "gcr-oids.h"
 #include "gcr-subject-public-key.h"
@@ -35,16 +35,16 @@
 #include <glib/gi18n-lib.h>
 
 /**
- * GcrCertificateReqRenderer:
+ * GcrCertificateRequestRenderer:
  *
  * An implementation of #GcrRenderer which renders certificate requests
  */
 
 /**
- * GcrCertificateReqRendererClass:
+ * GcrCertificateRequestRendererClass:
  * @parent_class: The parent class
  *
- * The class for #GcrCertificateReqRenderer
+ * The class for #GcrCertificateRequestRenderer
  */
 
 enum {
@@ -53,7 +53,7 @@ enum {
 	PROP_ATTRIBUTES
 };
 
-struct _GcrCertificateReqRendererPrivate {
+struct _GcrCertificateRequestRendererPrivate {
 	GckAttributes *attrs;
 	gchar *label;
 
@@ -62,14 +62,14 @@ struct _GcrCertificateReqRendererPrivate {
 	GNode *asn;
 };
 
-static void     _gcr_certificate_req_renderer_iface    (GcrRendererIface *iface);
+static void     _gcr_certificate_request_renderer_iface    (GcrRendererIface *iface);
 
-G_DEFINE_TYPE_WITH_CODE (GcrCertificateReqRenderer, _gcr_certificate_req_renderer, G_TYPE_OBJECT,
-	G_IMPLEMENT_INTERFACE (GCR_TYPE_RENDERER, _gcr_certificate_req_renderer_iface);
+G_DEFINE_TYPE_WITH_CODE (GcrCertificateRequestRenderer, _gcr_certificate_request_renderer, G_TYPE_OBJECT,
+	G_IMPLEMENT_INTERFACE (GCR_TYPE_RENDERER, _gcr_certificate_request_renderer_iface);
 );
 
 static gchar*
-calculate_label (GcrCertificateReqRenderer *self)
+calculate_label (GcrCertificateRequestRenderer *self)
 {
 	gchar *label = NULL;
 
@@ -96,16 +96,16 @@ calculate_label (GcrCertificateReqRenderer *self)
 }
 
 static void
-_gcr_certificate_req_renderer_init (GcrCertificateReqRenderer *self)
+_gcr_certificate_request_renderer_init (GcrCertificateRequestRenderer *self)
 {
-	self->pv = (G_TYPE_INSTANCE_GET_PRIVATE (self, GCR_TYPE_CERTIFICATE_REQ_RENDERER,
-	                                         GcrCertificateReqRendererPrivate));
+	self->pv = (G_TYPE_INSTANCE_GET_PRIVATE (self, GCR_TYPE_CERTIFICATE_REQUEST_RENDERER,
+	                                         GcrCertificateRequestRendererPrivate));
 }
 
 static void
-_gcr_certificate_req_renderer_finalize (GObject *obj)
+_gcr_certificate_request_renderer_finalize (GObject *obj)
 {
-	GcrCertificateReqRenderer *self = GCR_CERTIFICATE_REQ_RENDERER (obj);
+	GcrCertificateRequestRenderer *self = GCR_CERTIFICATE_REQUEST_RENDERER (obj);
 
 	if (self->pv->attrs)
 		gck_attributes_unref (self->pv->attrs);
@@ -116,16 +116,16 @@ _gcr_certificate_req_renderer_finalize (GObject *obj)
 
 	egg_asn1x_destroy (self->pv->asn);
 
-	G_OBJECT_CLASS (_gcr_certificate_req_renderer_parent_class)->finalize (obj);
+	G_OBJECT_CLASS (_gcr_certificate_request_renderer_parent_class)->finalize (obj);
 }
 
 static void
-_gcr_certificate_req_renderer_set_property (GObject *obj,
+_gcr_certificate_request_renderer_set_property (GObject *obj,
                                             guint prop_id,
                                             const GValue *value,
                                             GParamSpec *pspec)
 {
-	GcrCertificateReqRenderer *self = GCR_CERTIFICATE_REQ_RENDERER (obj);
+	GcrCertificateRequestRenderer *self = GCR_CERTIFICATE_REQUEST_RENDERER (obj);
 
 	switch (prop_id) {
 	case PROP_LABEL:
@@ -135,7 +135,7 @@ _gcr_certificate_req_renderer_set_property (GObject *obj,
 		gcr_renderer_emit_data_changed (GCR_RENDERER (self));
 		break;
 	case PROP_ATTRIBUTES:
-		_gcr_certificate_req_renderer_set_attributes (self, g_value_get_boxed (value));
+		_gcr_certificate_request_renderer_set_attributes (self, g_value_get_boxed (value));
 		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
@@ -144,12 +144,12 @@ _gcr_certificate_req_renderer_set_property (GObject *obj,
 }
 
 static void
-_gcr_certificate_req_renderer_get_property (GObject *obj,
+_gcr_certificate_request_renderer_get_property (GObject *obj,
                                             guint prop_id,
                                             GValue *value,
                                             GParamSpec *pspec)
 {
-	GcrCertificateReqRenderer *self = GCR_CERTIFICATE_REQ_RENDERER (obj);
+	GcrCertificateRequestRenderer *self = GCR_CERTIFICATE_REQUEST_RENDERER (obj);
 
 	switch (prop_id) {
 	case PROP_LABEL:
@@ -165,21 +165,21 @@ _gcr_certificate_req_renderer_get_property (GObject *obj,
 }
 
 static void
-_gcr_certificate_req_renderer_class_init (GcrCertificateReqRendererClass *klass)
+_gcr_certificate_request_renderer_class_init (GcrCertificateRequestRendererClass *klass)
 {
 	GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 	GckAttributes *registered;
 
 	_gcr_oids_init ();
 
-	g_type_class_add_private (klass, sizeof (GcrCertificateReqRendererPrivate));
+	g_type_class_add_private (klass, sizeof (GcrCertificateRequestRendererPrivate));
 
-	gobject_class->finalize = _gcr_certificate_req_renderer_finalize;
-	gobject_class->set_property = _gcr_certificate_req_renderer_set_property;
-	gobject_class->get_property = _gcr_certificate_req_renderer_get_property;
+	gobject_class->finalize = _gcr_certificate_request_renderer_finalize;
+	gobject_class->set_property = _gcr_certificate_request_renderer_set_property;
+	gobject_class->get_property = _gcr_certificate_request_renderer_get_property;
 
 	/**
-	 * GcrCertificateReqRenderer:attributes:
+	 * GcrCertificateRequestRenderer:attributes:
 	 *
 	 * The certificate attributes to display. One of the attributes must be
 	 * a CKA_VALUE type attribute which contains a DER encoded certificate.
@@ -189,7 +189,7 @@ _gcr_certificate_req_renderer_class_init (GcrCertificateReqRendererClass *klass)
 	                               GCK_TYPE_ATTRIBUTES, G_PARAM_READWRITE));
 
 	/**
-	 * GcrCertificateReqRenderer:label:
+	 * GcrCertificateRequestRenderer:label:
 	 *
 	 * The label to display.
 	 */
@@ -201,13 +201,13 @@ _gcr_certificate_req_renderer_class_init (GcrCertificateReqRendererClass *klass)
 	registered = gck_attributes_new ();
 	gck_attributes_add_ulong (registered, CKA_CLASS, CKO_GCR_CERTIFICATE_REQUEST);
 	gck_attributes_add_ulong (registered, CKA_GCR_CERTIFICATE_REQUEST_TYPE, CKQ_GCR_PKCS10);
-	gcr_renderer_register (GCR_TYPE_CERTIFICATE_REQ_RENDERER, registered);
+	gcr_renderer_register (GCR_TYPE_CERTIFICATE_REQUEST_RENDERER, registered);
 	gck_attributes_unref (registered);
 
 	registered = gck_attributes_new ();
 	gck_attributes_add_ulong (registered, CKA_CLASS, CKO_GCR_CERTIFICATE_REQUEST);
 	gck_attributes_add_ulong (registered, CKA_GCR_CERTIFICATE_REQUEST_TYPE, CKQ_GCR_SPKAC);
-	gcr_renderer_register (GCR_TYPE_CERTIFICATE_REQ_RENDERER, registered);
+	gcr_renderer_register (GCR_TYPE_CERTIFICATE_REQUEST_RENDERER, registered);
 	gck_attributes_unref (registered);
 }
 
@@ -281,7 +281,7 @@ append_attribute (GcrRenderer *renderer,
 }
 
 static guint
-ensure_key_size (GcrCertificateReqRenderer *self,
+ensure_key_size (GcrCertificateRequestRenderer *self,
                  GNode *public_key)
 {
 	if (self->pv->key_size)
@@ -292,7 +292,7 @@ ensure_key_size (GcrCertificateReqRenderer *self,
 }
 
 static void
-render_pkcs10_certificate_req (GcrCertificateReqRenderer *self,
+render_pkcs10_certificate_req (GcrCertificateRequestRenderer *self,
                                GcrDisplayView *view)
 {
 	GcrRenderer *renderer = GCR_RENDERER (self);
@@ -354,7 +354,7 @@ render_pkcs10_certificate_req (GcrCertificateReqRenderer *self,
 }
 
 static void
-render_spkac_certificate_req (GcrCertificateReqRenderer *self,
+render_spkac_certificate_req (GcrCertificateRequestRenderer *self,
                               GcrDisplayView *view)
 {
 	GcrRenderer *renderer = GCR_RENDERER (self);
@@ -391,20 +391,20 @@ render_spkac_certificate_req (GcrCertificateReqRenderer *self,
 }
 
 static void
-gcr_certificate_req_renderer_render (GcrRenderer *renderer,
+gcr_certificate_request_renderer_render (GcrRenderer *renderer,
                                      GcrViewer *viewer)
 {
-	GcrCertificateReqRenderer *self;
+	GcrCertificateRequestRenderer *self;
 	GcrDisplayView *view;
 	GIcon *icon;
 
-	self = GCR_CERTIFICATE_REQ_RENDERER (renderer);
+	self = GCR_CERTIFICATE_REQUEST_RENDERER (renderer);
 
 	if (GCR_IS_DISPLAY_VIEW (viewer)) {
 		view = GCR_DISPLAY_VIEW (viewer);
 
 	} else {
-		g_warning ("GcrCertificateReqRenderer only works with internal specific "
+		g_warning ("GcrCertificateRequestRenderer only works with internal specific "
 		           "GcrViewer returned by gcr_viewer_new().");
 		return;
 	}
@@ -423,7 +423,7 @@ gcr_certificate_req_renderer_render (GcrRenderer *renderer,
 		render_spkac_certificate_req (self, view);
 		break;
 	default:
-		g_warning ("unknown request type in GcrCertificateReqRenderer");
+		g_warning ("unknown request type in GcrCertificateRequestRenderer");
 		break;
 	}
 
@@ -431,13 +431,13 @@ gcr_certificate_req_renderer_render (GcrRenderer *renderer,
 }
 
 static void
-_gcr_certificate_req_renderer_iface (GcrRendererIface *iface)
+_gcr_certificate_request_renderer_iface (GcrRendererIface *iface)
 {
-	iface->render_view = gcr_certificate_req_renderer_render;
+	iface->render_view = gcr_certificate_request_renderer_render;
 }
 
 /**
- * gcr_certificate_req_renderer_new_for_attributes:
+ * gcr_certificate_request_renderer_new_for_attributes:
  * @label: (allow-none): the label to display
  * @attrs: the attributes to display
  *
@@ -445,21 +445,21 @@ _gcr_certificate_req_renderer_iface (GcrRendererIface *iface)
  * One of the attributes should be a CKA_VALUE type attribute containing a DER
  * encoded PKCS\#10 certificate request or an SPKAC request.
  *
- * Returns: (transfer full): a newly allocated #GcrCertificateReqRenderer, which
+ * Returns: (transfer full): a newly allocated #GcrCertificateRequestRenderer, which
  *          should be released with g_object_unref()
  */
 GcrRenderer *
-_gcr_certificate_req_renderer_new_for_attributes (const gchar *label,
+_gcr_certificate_request_renderer_new_for_attributes (const gchar *label,
                                                   GckAttributes *attrs)
 {
-	return g_object_new (GCR_TYPE_CERTIFICATE_REQ_RENDERER,
+	return g_object_new (GCR_TYPE_CERTIFICATE_REQUEST_RENDERER,
 	                     "label", label,
 	                     "attributes", attrs,
 	                     NULL);
 }
 
 /**
- * gcr_certificate_req_renderer_get_attributes:
+ * gcr_certificate_request_renderer_get_attributes:
  * @self: the renderer
  *
  * Get the PKCS\#11 attributes, if any, set for this renderer to display.
@@ -467,14 +467,14 @@ _gcr_certificate_req_renderer_new_for_attributes (const gchar *label,
  * Returns: (allow-none) (transfer none): the attributes, owned by the renderer
  */
 GckAttributes *
-_gcr_certificate_req_renderer_get_attributes (GcrCertificateReqRenderer *self)
+_gcr_certificate_request_renderer_get_attributes (GcrCertificateRequestRenderer *self)
 {
-	g_return_val_if_fail (GCR_IS_CERTIFICATE_REQ_RENDERER (self), NULL);
+	g_return_val_if_fail (GCR_IS_CERTIFICATE_REQUEST_RENDERER (self), NULL);
 	return self->pv->attrs;
 }
 
 /**
- * gcr_certificate_req_renderer_set_attributes:
+ * gcr_certificate_request_renderer_set_attributes:
  * @self: the renderer
  * @attrs: (allow-none): attributes to set
  *
@@ -483,7 +483,7 @@ _gcr_certificate_req_renderer_get_attributes (GcrCertificateReqRenderer *self)
  * certificate request or an SPKAC request.
  */
 void
-_gcr_certificate_req_renderer_set_attributes (GcrCertificateReqRenderer *self,
+_gcr_certificate_request_renderer_set_attributes (GcrCertificateRequestRenderer *self,
                                               GckAttributes *attrs)
 {
 	GckAttribute *value;
@@ -491,13 +491,13 @@ _gcr_certificate_req_renderer_set_attributes (GcrCertificateReqRenderer *self,
 	gulong type = 0;
 	EggBytes *bytes;
 
-	g_return_if_fail (GCR_IS_CERTIFICATE_REQ_RENDERER (self));
+	g_return_if_fail (GCR_IS_CERTIFICATE_REQUEST_RENDERER (self));
 
 	if (attrs) {
 		value = gck_attributes_find (attrs, CKA_VALUE);
 		if (value == NULL) {
 			g_warning ("no CKA_VALUE found in attributes passed to "
-				   "GcrCertificateReqRenderer attributes property");
+				   "GcrCertificateRequestRenderer attributes property");
 			return;
 		}
 
@@ -513,7 +513,7 @@ _gcr_certificate_req_renderer_set_attributes (GcrCertificateReqRenderer *self,
 				type = CKQ_GCR_SPKAC;
 			} else {
 				g_warning ("the data contained in the CKA_VALUE attribute passed to "
-				           "GcrCertificateReqRenderer was not valid DER encoded PKCS#10 "
+				           "GcrCertificateRequestRenderer was not valid DER encoded PKCS#10 "
 				           "or SPKAC");
 			}
 		}
diff --git a/gcr/gcr-certificate-request-renderer.h b/gcr/gcr-certificate-request-renderer.h
new file mode 100644
index 0000000..5e35057
--- /dev/null
+++ b/gcr/gcr-certificate-request-renderer.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2010 Stefan Walter
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#if !defined (__GCR_INSIDE_HEADER__) && !defined (GCR_COMPILATION)
+#error "Only <gcr/gcr.h> or <gcr/gcr-base.h> can be included directly."
+#endif
+
+#ifndef __GCR_CERTIFICATE_REQUEST_RENDERER_H__
+#define __GCR_CERTIFICATE_REQUEST_RENDERER_H__
+
+#include <glib-object.h>
+#include <gtk/gtk.h>
+
+#include "gcr-certificate.h"
+#include "gcr-renderer.h"
+#include "gcr-types.h"
+
+G_BEGIN_DECLS
+
+#define GCR_TYPE_CERTIFICATE_REQUEST_RENDERER               (_gcr_certificate_request_renderer_get_type ())
+#define GCR_CERTIFICATE_REQUEST_RENDERER(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCR_TYPE_CERTIFICATE_REQUEST_RENDERER, GcrCertificateRequestRenderer))
+#define GCR_CERTIFICATE_REQUEST_RENDERER_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GCR_TYPE_CERTIFICATE_REQUEST_RENDERER, GcrCertificateRequestRendererClass))
+#define GCR_IS_CERTIFICATE_REQUEST_RENDERER(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCR_TYPE_CERTIFICATE_REQUEST_RENDERER))
+#define GCR_IS_CERTIFICATE_REQUEST_RENDERER_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), GCR_TYPE_CERTIFICATE_REQUEST_RENDERER))
+#define GCR_CERTIFICATE_REQUEST_RENDERER_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GCR_TYPE_CERTIFICATE_REQUEST_RENDERER, GcrCertificateRequestRendererClass))
+
+typedef struct _GcrCertificateRequestRenderer GcrCertificateRequestRenderer;
+typedef struct _GcrCertificateRequestRendererClass GcrCertificateRequestRendererClass;
+typedef struct _GcrCertificateRequestRendererPrivate GcrCertificateRequestRendererPrivate;
+
+struct _GcrCertificateRequestRenderer {
+	GObject parent;
+
+	/*< private >*/
+	GcrCertificateRequestRendererPrivate *pv;
+};
+
+struct _GcrCertificateRequestRendererClass {
+	GObjectClass parent_class;
+};
+
+GType             _gcr_certificate_request_renderer_get_type              (void);
+
+GcrRenderer *     _gcr_certificate_request_renderer_new_for_attributes    (const gchar *label,
+                                                                       struct _GckAttributes *attrs);
+
+GckAttributes *   _gcr_certificate_request_renderer_get_attributes        (GcrCertificateRequestRenderer *self);
+
+void              _gcr_certificate_request_renderer_set_attributes        (GcrCertificateRequestRenderer *self,
+                                                                       GckAttributes *attrs);
+
+G_END_DECLS
+
+#endif /* __GCR_CERTIFICATE_REQUEST_RENDERER_H__ */
diff --git a/gcr/gcr-renderer.c b/gcr/gcr-renderer.c
index 296bcf0..3ef5c1a 100644
--- a/gcr/gcr-renderer.c
+++ b/gcr/gcr-renderer.c
@@ -25,7 +25,7 @@
 #include "gcr-renderer.h"
 
 #include "gcr-certificate-renderer.h"
-#include "gcr-certificate-req-renderer.h"
+#include "gcr-certificate-request-renderer.h"
 #include "gcr-gnupg-renderer.h"
 #include "gcr-key-renderer.h"
 
@@ -290,7 +290,7 @@ void
 gcr_renderer_register_well_known (void)
 {
 	g_type_class_unref (g_type_class_ref (GCR_TYPE_CERTIFICATE_RENDERER));
-	g_type_class_unref (g_type_class_ref (GCR_TYPE_CERTIFICATE_REQ_RENDERER));
+	g_type_class_unref (g_type_class_ref (GCR_TYPE_CERTIFICATE_REQUEST_RENDERER));
 	g_type_class_unref (g_type_class_ref (GCR_TYPE_KEY_RENDERER));
 	g_type_class_unref (g_type_class_ref (GCR_TYPE_GNUPG_RENDERER));
 }
diff --git a/gcr/tests/frob-request.c b/gcr/tests/frob-request.c
index 68b5d0e..6447837 100644
--- a/gcr/tests/frob-request.c
+++ b/gcr/tests/frob-request.c
@@ -24,7 +24,7 @@
 #include "config.h"
 
 #include "gcr/gcr.h"
-#include "gcr/gcr-certificate-req-renderer.h"
+#include "gcr/gcr-certificate-request-renderer.h"
 
 #include <gtk/gtk.h>
 
@@ -41,7 +41,7 @@ on_parser_parsed (GcrParser *parser,
 	GtkDialog *dialog = GTK_DIALOG (user_data);
 
 	viewer = gcr_viewer_new_scrolled ();
-	renderer = _gcr_certificate_req_renderer_new_for_attributes (gcr_parser_get_parsed_label (parser),
+	renderer = _gcr_certificate_request_renderer_new_for_attributes (gcr_parser_get_parsed_label (parser),
 	                                                             gcr_parser_get_parsed_attributes (parser));
 	gcr_viewer_add_renderer (viewer, renderer);
 	g_object_unref (renderer);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]