Debian Codegraph @

pkcs11/template/gkm-xxx.c

raw
1 /*
2 * gnome-keyring
3 *
4 * Copyright (C) 2008 Stefan Walter
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 2.1 of
9 * the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, see
18 * <http://www.gnu.org/licenses/>.
19 */
20
21 #include "config.h"
22
23 #include "gkm-xxx.h"
24
25 enum {
26 PROP_0,
27 PROP_XXX
28 };
29
30 enum {
31 SIGNAL,
32 LAST_SIGNAL
33 };
34
35 static guint signals[LAST_SIGNAL] = { 0 };
36
37 struct _GkmXxx {
38 GObject parent;
39 };
40
41 G_DEFINE_TYPE (GkmXxx, gkm_xxx, G_TYPE_OBJECT);
42
43 /* -----------------------------------------------------------------------------
44 * INTERNAL
45 */
46
47 /* -----------------------------------------------------------------------------
48 * OBJECT
49 */
50
51
52 static GObject*
53 gkm_xxx_constructor (GType type, guint n_props, GObjectConstructParam *props)
54 {
55 GkmXxx *self = GKM_XXX (G_OBJECT_CLASS (gkm_xxx_parent_class)->constructor(type, n_props, props));
56 g_return_val_if_fail (self, NULL);
57
58
59
60 return G_OBJECT (self);
61 }
62
63 static void
64 gkm_xxx_init (GkmXxx *self)
65 {
66
67 }
68
69 static void
70 gkm_xxx_dispose (GObject *obj)
71 {
72 GkmXxx *self = GKM_XXX (obj);
73
74 G_OBJECT_CLASS (gkm_xxx_parent_class)->dispose (obj);
75 }
76
77 static void
78 gkm_xxx_finalize (GObject *obj)
79 {
80 GkmXxx *self = GKM_XXX (obj);
81
82 G_OBJECT_CLASS (gkm_xxx_parent_class)->finalize (obj);
83 }
84
85 static void
86 gkm_xxx_set_property (GObject *obj, guint prop_id, const GValue *value,
87 GParamSpec *pspec)
88 {
89 GkmXxx *self = GKM_XXX (obj);
90
91 switch (prop_id) {
92 case PROP_XXX:
93 break;
94 default:
95 G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
96 break;
97 }
98 }
99
100 static void
101 gkm_xxx_get_property (GObject *obj, guint prop_id, GValue *value,
102 GParamSpec *pspec)
103 {
104 GkmXxx *self = GKM_XXX (obj);
105
106 switch (prop_id) {
107 case PROP_XXX:
108 break;
109 default:
110 G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
111 break;
112 }
113 }
114
115 static void
116 gkm_xxx_class_init (GkmXxxClass *klass)
117 {
118 GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
119
120 gobject_class->constructor = gkm_xxx_constructor;
121 gobject_class->dispose = gkm_xxx_dispose;
122 gobject_class->finalize = gkm_xxx_finalize;
123 gobject_class->set_property = gkm_xxx_set_property;
124 gobject_class->get_property = gkm_xxx_get_property;
125
126 g_object_class_install_property (gobject_class, PROP_XXX,
127 g_param_spec_pointer ("xxx", "Xxx", "Xxx.", G_PARAM_READWRITE));
128
129 signals[SIGNAL] = g_signal_new ("signal", GKM_TYPE_XXX,
130 G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GkmXxxClass, signal),
131 NULL, NULL, g_cclosure_marshal_VOID__OBJECT,
132 G_TYPE_NONE, 0);
133 }
134
135 /* -----------------------------------------------------------------------------
136 * PUBLIC
137 */
138
139 GkmXxx*
140 gkm_xxx_new (void)
141 {
142 return g_object_new (GKM_TYPE_XXX, NULL);
143 }