gnome-keyring r1493 - trunk/pkcs11/template
- From: nnielsen svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-keyring r1493 - trunk/pkcs11/template
- Date: Mon, 2 Feb 2009 20:30:06 +0000 (UTC)
Author: nnielsen
Date: Mon Feb 2 20:30:06 2009
New Revision: 1493
URL: http://svn.gnome.org/viewvc/gnome-keyring?rev=1493&view=rev
Log:
Add templates
Added:
trunk/pkcs11/template/ (props changed)
trunk/pkcs11/template/gck-xxx.c
trunk/pkcs11/template/gck-xxx.h
trunk/pkcs11/template/gck-zzz.c (contents, props changed)
trunk/pkcs11/template/gck-zzz.h (contents, props changed)
Added: trunk/pkcs11/template/gck-xxx.c
==============================================================================
--- (empty file)
+++ trunk/pkcs11/template/gck-xxx.c Mon Feb 2 20:30:06 2009
@@ -0,0 +1,144 @@
+/*
+ * gnome-keyring
+ *
+ * Copyright (C) 2008 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.
+ */
+
+#include "config.h"
+
+#include "gck-xxx.h"
+
+enum {
+ PROP_0,
+ PROP_XXX
+};
+
+enum {
+ SIGNAL,
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
+struct _GckXxx {
+ GObject parent;
+};
+
+G_DEFINE_TYPE (GckXxx, gck_xxx, G_TYPE_OBJECT);
+
+/* -----------------------------------------------------------------------------
+ * INTERNAL
+ */
+
+/* -----------------------------------------------------------------------------
+ * OBJECT
+ */
+
+
+static GObject*
+gck_xxx_constructor (GType type, guint n_props, GObjectConstructParam *props)
+{
+ GckXxx *self = GCK_XXX (G_OBJECT_CLASS (gck_xxx_parent_class)->constructor(type, n_props, props));
+ g_return_val_if_fail (self, NULL);
+
+
+
+ return G_OBJECT (self);
+}
+
+static void
+gck_xxx_init (GckXxx *self)
+{
+
+}
+
+static void
+gck_xxx_dispose (GObject *obj)
+{
+ GckXxx *self = GCK_XXX (obj);
+
+ G_OBJECT_CLASS (gck_xxx_parent_class)->dispose (obj);
+}
+
+static void
+gck_xxx_finalize (GObject *obj)
+{
+ GckXxx *self = GCK_XXX (obj);
+
+ G_OBJECT_CLASS (gck_xxx_parent_class)->finalize (obj);
+}
+
+static void
+gck_xxx_set_property (GObject *obj, guint prop_id, const GValue *value,
+ GParamSpec *pspec)
+{
+ GckXxx *self = GCK_XXX (obj);
+
+ switch (prop_id) {
+ case PROP_XXX:
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+gck_xxx_get_property (GObject *obj, guint prop_id, GValue *value,
+ GParamSpec *pspec)
+{
+ GckXxx *self = GCK_XXX (obj);
+
+ switch (prop_id) {
+ case PROP_XXX:
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+gck_xxx_class_init (GckXxxClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+ gobject_class->constructor = gck_xxx_constructor;
+ gobject_class->dispose = gck_xxx_dispose;
+ gobject_class->finalize = gck_xxx_finalize;
+ gobject_class->set_property = gck_xxx_set_property;
+ gobject_class->get_property = gck_xxx_get_property;
+
+ g_object_class_install_property (gobject_class, PROP_XXX,
+ g_param_spec_pointer ("xxx", "Xxx", "Xxx.", G_PARAM_READWRITE));
+
+ signals[SIGNAL] = g_signal_new ("signal", GCK_TYPE_XXX,
+ G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GckXxxClass, signal),
+ NULL, NULL, g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 0);
+}
+
+/* -----------------------------------------------------------------------------
+ * PUBLIC
+ */
+
+GckXxx*
+gck_xxx_new (void)
+{
+ return g_object_new (GCK_TYPE_XXX, NULL);
+}
Added: trunk/pkcs11/template/gck-xxx.h
==============================================================================
--- (empty file)
+++ trunk/pkcs11/template/gck-xxx.h Mon Feb 2 20:30:06 2009
@@ -0,0 +1,49 @@
+/*
+ * gnome-keyring
+ *
+ * Copyright (C) 2008 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.
+ */
+
+#ifndef __GCK_XXX_H__
+#define __GCK_XXX_H__
+
+#include <glib-object.h>
+
+#define GCK_TYPE_XXX (gck_xxx_get_type ())
+#define GCK_XXX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCK_TYPE_XXX, GckXxx))
+#define GCK_XXX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GCK_TYPE_XXX, GckXxxClass))
+#define GCK_IS_XXX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCK_TYPE_XXX))
+#define GCK_IS_XXX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GCK_TYPE_XXX))
+#define GCK_XXX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GCK_TYPE_XXX, GckXxxClass))
+
+typedef struct _GckXxx GckXxx;
+typedef struct _GckXxxClass GckXxxClass;
+
+struct _GckXxxClass {
+ GObjectClass parent_class;
+
+ /* signals --------------------------------------------------------- */
+
+ void (*signal) (GckXxx *xxx);
+};
+
+GType gck_xxx_get_type (void);
+
+GckXxx* gck_xxx_new (void);
+
+#endif /* __GCK_XXX_H__ */
Added: trunk/pkcs11/template/gck-zzz.c
==============================================================================
--- (empty file)
+++ trunk/pkcs11/template/gck-zzz.c Mon Feb 2 20:30:06 2009
@@ -0,0 +1,60 @@
+/*
+ * gnome-keyring
+ *
+ * Copyright (C) 2008 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.
+ */
+
+#include "config.h"
+
+#include "gkr-zzz.h"
+
+static void
+gkr_zzz_base_init (gpointer gobject_class)
+{
+ static gboolean initialized = FALSE;
+ if (!initialized) {
+ /* Add properties and signals to the interface */
+
+
+ initialized = TRUE;
+ }
+}
+
+GType
+gkr_zzz_get_type (void)
+{
+ static GType type = 0;
+ if (!type) {
+ static const GTypeInfo info = {
+ sizeof (GkrZzzIFace),
+ gkr_zzz_base_init, /* base init */
+ NULL, /* base finalize */
+ NULL, /* class_init */
+ NULL, /* class finalize */
+ NULL, /* class data */
+ 0,
+ 0, /* n_preallocs */
+ NULL, /* instance init */
+ };
+ type = g_type_register_static (G_TYPE_INTERFACE, "GkrZzzIFace", &info, 0);
+ g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
+ }
+
+ return type;
+}
+
Added: trunk/pkcs11/template/gck-zzz.h
==============================================================================
--- (empty file)
+++ trunk/pkcs11/template/gck-zzz.h Mon Feb 2 20:30:06 2009
@@ -0,0 +1,46 @@
+/*
+ * gnome-keyring
+ *
+ * Copyright (C) 2008 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.
+ */
+
+#ifndef __GKR_ZZZ_H__
+#define __GKR_ZZZ_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define GKR_TYPE_ZZZ (gkr_zzz_get_type())
+#define GKR_ZZZ(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GKR_TYPE_ZZZ, GkrZzz))
+#define GKR_IS_ZZZ(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GKR_TYPE_ZZZ))
+#define GKR_ZZZ_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GKR_TYPE_ZZZ, GkrZzzIface))
+
+typedef struct _GkrZzz GkrZzz;
+typedef struct _GkrZzzIface GkrZzzIface;
+
+struct _GkrZzzIface {
+ GTypeInterface parent;
+};
+
+GType gkr_zzz_get_type (void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* __GKR_ZZZ_H__ */
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]