File: notifying-string.c

package info (click to toggle)
pioneers 15.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,584 kB
  • sloc: ansic: 43,583; sh: 4,353; makefile: 874; xml: 24
file content (236 lines) | stat: -rw-r--r-- 6,737 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
/* Generated by GOB (v2.0.20)   (do not edit directly) */

/* End world hunger, donate to the World Food Programme, http://www.wfp.org */

#define GOB_VERSION_MAJOR 2
#define GOB_VERSION_MINOR 0
#define GOB_VERSION_PATCHLEVEL 20

#define selfp (self->_priv)

#include <string.h> /* memset() */

#include "notifying-string.h"

#include "notifying-string-private.h"

#ifdef G_LIKELY
#define ___GOB_LIKELY(expr) G_LIKELY(expr)
#define ___GOB_UNLIKELY(expr) G_UNLIKELY(expr)
#else /* ! G_LIKELY */
#define ___GOB_LIKELY(expr) (expr)
#define ___GOB_UNLIKELY(expr) (expr)
#endif /* G_LIKELY */
/* self casting macros */
#define SELF(x) NOTIFYING_STRING(x)
#define SELF_CONST(x) NOTIFYING_STRING_CONST(x)
#define IS_SELF(x) NOTIFYING_IS_STRING(x)
#define TYPE_SELF NOTIFYING_TYPE_STRING
#define SELF_CLASS(x) NOTIFYING_STRING_CLASS(x)

#define SELF_GET_CLASS(x) NOTIFYING_STRING_GET_CLASS(x)

/* self typedefs */
typedef NotifyingString Self;
typedef NotifyingStringClass SelfClass;

/* here are local prototypes */
static void notifying_string_init (NotifyingString * o) G_GNUC_UNUSED;
static void notifying_string_class_init (NotifyingStringClass * c) G_GNUC_UNUSED;

/*
 * Signal connection wrapper macro shortcuts
 */
#define self_connect__changed(object,func,data)	notifying_string_connect__changed((object),(func),(data))
#define self_connect_after__changed(object,func,data)	notifying_string_connect_after__changed((object),(func),(data))
#define self_connect_data__changed(object,func,data,destroy_data,flags)	notifying_string_connect_data__changed((object),(func),(data),(destroy_data),(flags))

enum {
	CHANGED_SIGNAL,
	LAST_SIGNAL
};

static guint object_signals[LAST_SIGNAL] = {0};

/* pointer to the class of our parent */
static GObjectClass *parent_class = NULL;

/* Short form macros */
#define self_changed notifying_string_changed
#define self_new notifying_string_new
#define self_set notifying_string_set
#define self_get notifying_string_get
GType
notifying_string_get_type (void)
{
	static GType type = 0;

	if ___GOB_UNLIKELY(type == 0) {
		static const GTypeInfo info = {
			sizeof (NotifyingStringClass),
			(GBaseInitFunc) NULL,
			(GBaseFinalizeFunc) NULL,
			(GClassInitFunc) notifying_string_class_init,
			(GClassFinalizeFunc) NULL,
			NULL /* class_data */,
			sizeof (NotifyingString),
			0 /* n_preallocs */,
			(GInstanceInitFunc) notifying_string_init,
			NULL
		};

		type = g_type_register_static (G_TYPE_OBJECT, "NotifyingString", &info, (GTypeFlags)0);
	}

	return type;
}

/* a macro for creating a new object of our type */
#define GET_NEW ((NotifyingString *)g_object_new(notifying_string_get_type(), NULL))

/* a function for creating a new object of our type */
#include <stdarg.h>
static NotifyingString * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
static NotifyingString *
GET_NEW_VARG (const char *first, ...)
{
	NotifyingString *ret;
	va_list ap;
	va_start (ap, first);
	ret = (NotifyingString *)g_object_new_valist (notifying_string_get_type (), first, ap);
	va_end (ap);
	return ret;
}


static void
___finalize(GObject *obj_self)
{
#define __GOB_FUNCTION__ "Notifying:String::finalize"
	NotifyingString *self G_GNUC_UNUSED = NOTIFYING_STRING (obj_self);
	gpointer priv G_GNUC_UNUSED = self->_priv;
#line 5 "common/notifying-string.gob"
	if(self->_priv->value) { g_free ((gpointer) self->_priv->value); self->_priv->value = NULL; }
#line 115 "notifying-string.c"
	if(G_OBJECT_CLASS(parent_class)->finalize) \
		(* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
}
#undef __GOB_FUNCTION__

static void 
notifying_string_init (NotifyingString * o G_GNUC_UNUSED)
{
#define __GOB_FUNCTION__ "Notifying:String::init"
	o->_priv = G_TYPE_INSTANCE_GET_PRIVATE(o,NOTIFYING_TYPE_STRING,NotifyingStringPrivate);
#line 4 "common/notifying-string.gob"
	o->_priv->value =  NULL ;
#line 128 "notifying-string.c"
}
#undef __GOB_FUNCTION__
static void 
notifying_string_class_init (NotifyingStringClass * c G_GNUC_UNUSED)
{
#define __GOB_FUNCTION__ "Notifying:String::class_init"
	GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) c;

	g_type_class_add_private(c,sizeof(NotifyingStringPrivate));

	parent_class = g_type_class_ref (G_TYPE_OBJECT);

	object_signals[CHANGED_SIGNAL] =
		g_signal_new ("changed",
			G_TYPE_FROM_CLASS (g_object_class),
			(GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
			G_STRUCT_OFFSET (NotifyingStringClass, changed),
			NULL, NULL,
			g_cclosure_marshal_VOID__VOID,
			G_TYPE_NONE, 0);

	c->changed = NULL;
	g_object_class->finalize = ___finalize;
}
#undef __GOB_FUNCTION__



#line 7 "common/notifying-string.gob"
void 
notifying_string_changed (NotifyingString * self)
{
#line 161 "notifying-string.c"
	GValue ___param_values[1];
	GValue ___return_val;

memset (&___return_val, 0, sizeof (___return_val));
memset (&___param_values, 0, sizeof (___param_values));

#line 7 "common/notifying-string.gob"
	g_return_if_fail (self != NULL);
#line 7 "common/notifying-string.gob"
	g_return_if_fail (NOTIFYING_IS_STRING (self));
#line 172 "notifying-string.c"

	___param_values[0].g_type = 0;
	g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
	g_value_set_instance (&___param_values[0], (gpointer) self);

	g_signal_emitv (___param_values,
		object_signals[CHANGED_SIGNAL],
		0 /* detail */,
		&___return_val);

	g_value_unset (&___param_values[0]);
}

#line 12 "common/notifying-string.gob"
GObject * 
notifying_string_new (void)
{
#line 190 "notifying-string.c"
#define __GOB_FUNCTION__ "Notifying:String::new"
{
#line 12 "common/notifying-string.gob"
	
		return (GObject *) GET_NEW;
	}}
#line 197 "notifying-string.c"
#undef __GOB_FUNCTION__

#line 16 "common/notifying-string.gob"
void 
notifying_string_set (NotifyingString * self, const gchar * value)
{
#line 204 "notifying-string.c"
#define __GOB_FUNCTION__ "Notifying:String::set"
#line 16 "common/notifying-string.gob"
	g_return_if_fail (self != NULL);
#line 16 "common/notifying-string.gob"
	g_return_if_fail (NOTIFYING_IS_STRING (self));
#line 210 "notifying-string.c"
{
#line 16 "common/notifying-string.gob"
	
		self->_priv->value = g_strdup(value);
		self_changed(self);
	}}
#line 217 "notifying-string.c"
#undef __GOB_FUNCTION__

#line 21 "common/notifying-string.gob"
gchar * 
notifying_string_get (NotifyingString * self)
{
#line 224 "notifying-string.c"
#define __GOB_FUNCTION__ "Notifying:String::get"
#line 21 "common/notifying-string.gob"
	g_return_val_if_fail (self != NULL, (gchar * )0);
#line 21 "common/notifying-string.gob"
	g_return_val_if_fail (NOTIFYING_IS_STRING (self), (gchar * )0);
#line 230 "notifying-string.c"
{
#line 21 "common/notifying-string.gob"
	
		return g_strdup(self->_priv->value);
	}}
#line 236 "notifying-string.c"
#undef __GOB_FUNCTION__