File: note.c

package info (click to toggle)
vala 0.56.18-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 57,520 kB
  • sloc: ansic: 581,293; sh: 5,357; makefile: 3,980; xml: 3,161; yacc: 1,219; lex: 374; javascript: 23
file content (233 lines) | stat: -rw-r--r-- 9,671 bytes parent folder | download | duplicates (2)
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
/* note.c generated by valac, the Vala compiler
 * generated from note.vala, do not modify */

/* note.vala
 *
 * Copyright (C) 2008-2009 Didier Villevalois
 * Copyright (C) 2008-2012 Florian Brosch
 *
 * This library 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 library 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 library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	Didier 'Ptitjes Villevalois <ptitjes@free.fr>
 */

#include "valadoc.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.h>
#include <valagee.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	VALADOC_CONTENT_NOTE_0_PROPERTY,
	VALADOC_CONTENT_NOTE_NUM_PROPERTIES
};
static GParamSpec* valadoc_content_note_properties[VALADOC_CONTENT_NOTE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

static gpointer valadoc_content_note_parent_class = NULL;
static ValadocContentBlockIface * valadoc_content_note_valadoc_content_block_parent_iface = NULL;

 G_GNUC_INTERNAL ValadocContentNote* valadoc_content_note_new (void);
 G_GNUC_INTERNAL ValadocContentNote* valadoc_content_note_construct (GType object_type);
 G_GNUC_INTERNAL ValadocContentBlockContent* valadoc_content_block_content_construct (GType object_type);
static void valadoc_content_note_real_check (ValadocContentContentElement* base,
                                      ValadocApiTree* api_root,
                                      ValadocApiNode* container,
                                      const gchar* file_path,
                                      ValadocErrorReporter* reporter,
                                      ValadocSettings* settings);
static void valadoc_content_note_real_accept (ValadocContentContentElement* base,
                                       ValadocContentContentVisitor* visitor);
static ValadocContentContentElement* valadoc_content_note_real_copy (ValadocContentContentElement* base,
                                                              ValadocContentContentElement* new_parent);
 G_GNUC_INTERNAL void valadoc_content_content_element_set_parent (ValadocContentContentElement* self,
                                                 ValadocContentContentElement* value);
static GType valadoc_content_note_get_type_once (void);

 G_GNUC_INTERNAL ValadocContentNote*
valadoc_content_note_construct (GType object_type)
{
	ValadocContentNote * self = NULL;
	self = (ValadocContentNote*) valadoc_content_block_content_construct (object_type);
	return self;
}

 G_GNUC_INTERNAL ValadocContentNote*
valadoc_content_note_new (void)
{
	return valadoc_content_note_construct (VALADOC_CONTENT_TYPE_NOTE);
}

static void
valadoc_content_note_real_check (ValadocContentContentElement* base,
                                 ValadocApiTree* api_root,
                                 ValadocApiNode* container,
                                 const gchar* file_path,
                                 ValadocErrorReporter* reporter,
                                 ValadocSettings* settings)
{
	ValadocContentNote * self;
	self = (ValadocContentNote*) base;
	g_return_if_fail (api_root != NULL);
	g_return_if_fail (container != NULL);
	g_return_if_fail (file_path != NULL);
	g_return_if_fail (reporter != NULL);
	g_return_if_fail (settings != NULL);
	VALADOC_CONTENT_CONTENT_ELEMENT_CLASS (valadoc_content_note_parent_class)->check ((ValadocContentContentElement*) G_TYPE_CHECK_INSTANCE_CAST (self, VALADOC_CONTENT_TYPE_BLOCK_CONTENT, ValadocContentBlockContent), api_root, container, file_path, reporter, settings);
}

static void
valadoc_content_note_real_accept (ValadocContentContentElement* base,
                                  ValadocContentContentVisitor* visitor)
{
	ValadocContentNote * self;
	self = (ValadocContentNote*) base;
	g_return_if_fail (visitor != NULL);
	valadoc_content_content_visitor_visit_note (visitor, self);
}

static ValadocContentContentElement*
valadoc_content_note_real_copy (ValadocContentContentElement* base,
                                ValadocContentContentElement* new_parent)
{
	ValadocContentNote * self;
	ValadocContentNote* note = NULL;
	ValadocContentNote* _tmp0_;
	ValadocContentNote* _tmp1_;
	ValadocContentContentElement* result;
	self = (ValadocContentNote*) base;
	_tmp0_ = valadoc_content_note_new ();
	note = _tmp0_;
	_tmp1_ = note;
	valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp1_, new_parent);
	{
		ValaList* _block_list = NULL;
		ValaList* _tmp2_;
		ValaList* _tmp3_;
		gint _block_size = 0;
		ValaList* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		gint _block_index = 0;
		_tmp2_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) self);
		_tmp3_ = _tmp2_;
		_block_list = _tmp3_;
		_tmp4_ = _block_list;
		_tmp5_ = vala_collection_get_size ((ValaCollection*) _tmp4_);
		_tmp6_ = _tmp5_;
		_block_size = _tmp6_;
		_block_index = -1;
		while (TRUE) {
			gint _tmp7_;
			gint _tmp8_;
			ValadocContentBlock* block = NULL;
			ValaList* _tmp9_;
			gpointer _tmp10_;
			ValadocContentBlock* copy = NULL;
			ValadocContentBlock* _tmp11_;
			ValadocContentNote* _tmp12_;
			ValadocContentContentElement* _tmp13_;
			ValadocContentBlock* _tmp14_;
			ValadocContentNote* _tmp15_;
			ValaList* _tmp16_;
			ValaList* _tmp17_;
			ValadocContentBlock* _tmp18_;
			_block_index = _block_index + 1;
			_tmp7_ = _block_index;
			_tmp8_ = _block_size;
			if (!(_tmp7_ < _tmp8_)) {
				break;
			}
			_tmp9_ = _block_list;
			_tmp10_ = vala_list_get (_tmp9_, _block_index);
			block = (ValadocContentBlock*) _tmp10_;
			_tmp11_ = block;
			_tmp12_ = note;
			_tmp13_ = valadoc_content_content_element_copy ((ValadocContentContentElement*) _tmp11_, (ValadocContentContentElement*) _tmp12_);
			_tmp14_ = VALADOC_CONTENT_IS_BLOCK (_tmp13_) ? ((ValadocContentBlock*) _tmp13_) : NULL;
			if (_tmp14_ == NULL) {
				_g_object_unref0 (_tmp13_);
			}
			copy = _tmp14_;
			_tmp15_ = note;
			_tmp16_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp15_);
			_tmp17_ = _tmp16_;
			_tmp18_ = copy;
			vala_collection_add ((ValaCollection*) _tmp17_, _tmp18_);
			_g_object_unref0 (copy);
			_g_object_unref0 (block);
		}
	}
	result = (ValadocContentContentElement*) note;
	return result;
}

static void
valadoc_content_note_class_init (ValadocContentNoteClass * klass,
                                 gpointer klass_data)
{
	valadoc_content_note_parent_class = g_type_class_peek_parent (klass);
	((ValadocContentContentElementClass *) klass)->check = (void (*) (ValadocContentContentElement*, ValadocApiTree*, ValadocApiNode*, const gchar*, ValadocErrorReporter*, ValadocSettings*)) valadoc_content_note_real_check;
	((ValadocContentContentElementClass *) klass)->accept = (void (*) (ValadocContentContentElement*, ValadocContentContentVisitor*)) valadoc_content_note_real_accept;
	((ValadocContentContentElementClass *) klass)->copy = (ValadocContentContentElement* (*) (ValadocContentContentElement*, ValadocContentContentElement*)) valadoc_content_note_real_copy;
}

static void
valadoc_content_note_valadoc_content_block_interface_init (ValadocContentBlockIface * iface,
                                                           gpointer iface_data)
{
	valadoc_content_note_valadoc_content_block_parent_iface = g_type_interface_peek_parent (iface);
}

static void
valadoc_content_note_instance_init (ValadocContentNote * self,
                                    gpointer klass)
{
}

static GType
valadoc_content_note_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ValadocContentNoteClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_content_note_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocContentNote), 0, (GInstanceInitFunc) valadoc_content_note_instance_init, NULL };
	static const GInterfaceInfo valadoc_content_block_info = { (GInterfaceInitFunc) valadoc_content_note_valadoc_content_block_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType valadoc_content_note_type_id;
	valadoc_content_note_type_id = g_type_register_static (VALADOC_CONTENT_TYPE_BLOCK_CONTENT, "ValadocContentNote", &g_define_type_info, 0);
	g_type_add_interface_static (valadoc_content_note_type_id, VALADOC_CONTENT_TYPE_BLOCK, &valadoc_content_block_info);
	return valadoc_content_note_type_id;
}

GType
valadoc_content_note_get_type (void)
{
	static volatile gsize valadoc_content_note_type_id__once = 0;
	if (g_once_init_enter (&valadoc_content_note_type_id__once)) {
		GType valadoc_content_note_type_id;
		valadoc_content_note_type_id = valadoc_content_note_get_type_once ();
		g_once_init_leave (&valadoc_content_note_type_id__once, valadoc_content_note_type_id);
	}
	return valadoc_content_note_type_id__once;
}