summaryrefslogtreecommitdiff
path: root/plugins/common/Resources.c
blob: fa8165744e63c81d7da1e5ef5d9a6d4cef90f454 (plain)
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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
/* Resources.c generated by valac 0.36.6, the Vala compiler
 * generated from Resources.vala, do not modify */

/* Copyright 2016 Software Freedom Conservancy Inc.
 *
 * This software is licensed under the GNU Lesser General Public License
 * (version 2.1 or later).  See the COPYING file in this distribution.
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <gio/gio.h>
#include <gdk-pixbuf/gdk-pixbuf.h>

#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))



#define RESOURCES_WEBSITE_NAME _ ("Visit the Shotwell home page")
#define RESOURCES_WEBSITE_URL "https://wiki.gnome.org/Apps/Shotwell"
#define RESOURCES_LICENSE "\n" \
"Shotwell is free software; you can redistribute it and/or modify it un" \
"der the \n" \
"terms of the GNU Lesser General Public License as published by the Fre" \
"e \n" \
"Software Foundation; either version 2.1 of the License, or (at your op" \
"tion) \n" \
"any later version.\n" \
"\n" \
"Shotwell is distributed in the hope that it will be useful, but WITHOU" \
"T \n" \
"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or " \
"FITNESS\n" \
"FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License f" \
"or \n" \
"more details.\n" \
"\n" \
"You should have received a copy of the GNU Lesser General Public Licen" \
"se \n" \
"along with Shotwell; if not, write to the Free Software Foundation, In" \
"c., \n" \
"51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA\n"
#define RESOURCES_TRANSLATORS _ ("translator-credits")
GdkPixbuf** resources_load_icon_set (GFile* icon_file, int* result_length1);
static void _vala_array_add2 (GdkPixbuf** * array, int* length, int* size, GdkPixbuf* value);
GdkPixbuf** resources_load_from_resource (const gchar* resource_path, int* result_length1);
static void _vala_array_add3 (GdkPixbuf** * array, int* length, int* size, GdkPixbuf* value);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


static gpointer _g_object_ref0 (gpointer self) {
#line 50 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	return self ? g_object_ref (self) : NULL;
#line 40 "Resources.c"
}


static void _vala_array_add2 (GdkPixbuf** * array, int* length, int* size, GdkPixbuf* value) {
#line 50 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	if ((*length) == (*size)) {
#line 50 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 50 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		*array = g_renew (GdkPixbuf*, *array, (*size) + 1);
#line 51 "Resources.c"
	}
#line 50 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	(*array)[(*length)++] = value;
#line 50 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	(*array)[*length] = NULL;
#line 57 "Resources.c"
}


GdkPixbuf** resources_load_icon_set (GFile* icon_file, int* result_length1) {
	GdkPixbuf** result = NULL;
	GdkPixbuf* icon = NULL;
	GdkPixbuf* _tmp10_;
	GdkPixbuf** _tmp16_;
	gint _tmp16__length1;
	GError * _inner_error_ = NULL;
#line 40 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	g_return_val_if_fail ((icon_file == NULL) || G_IS_FILE (icon_file), NULL);
#line 41 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	icon = NULL;
#line 72 "Resources.c"
	{
		GdkPixbuf* _tmp0_ = NULL;
		GFile* _tmp1_;
		gchar* _tmp2_;
		gchar* _tmp3_;
		GdkPixbuf* _tmp4_;
		GdkPixbuf* _tmp5_;
		GdkPixbuf* _tmp6_;
#line 43 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp1_ = icon_file;
#line 43 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp2_ = g_file_get_path (_tmp1_);
#line 43 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp3_ = _tmp2_;
#line 43 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp4_ = gdk_pixbuf_new_from_file (_tmp3_, &_inner_error_);
#line 43 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp5_ = _tmp4_;
#line 43 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_g_free0 (_tmp3_);
#line 43 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp0_ = _tmp5_;
#line 43 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 97 "Resources.c"
			goto __catch4_g_error;
		}
#line 43 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp6_ = _tmp0_;
#line 43 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp0_ = NULL;
#line 43 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_g_object_unref0 (icon);
#line 43 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		icon = _tmp6_;
#line 42 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_g_object_unref0 (_tmp0_);
#line 110 "Resources.c"
	}
	goto __finally4;
	__catch4_g_error:
	{
		GError* err = NULL;
		GFile* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
#line 42 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		err = _inner_error_;
#line 42 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_inner_error_ = NULL;
#line 45 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp7_ = icon_file;
#line 45 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp8_ = g_file_get_path (_tmp7_);
#line 45 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp9_ = _tmp8_;
#line 45 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		g_warning ("Resources.vala:45: couldn't load icon set from %s.", _tmp9_);
#line 45 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_g_free0 (_tmp9_);
#line 42 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_g_error_free0 (err);
#line 135 "Resources.c"
	}
	__finally4:
#line 42 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 42 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_g_object_unref0 (icon);
#line 42 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 42 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		g_clear_error (&_inner_error_);
#line 42 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		return NULL;
#line 148 "Resources.c"
	}
#line 48 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	_tmp10_ = icon;
#line 48 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	if (_tmp10_ != NULL) {
#line 154 "Resources.c"
		GdkPixbuf** icon_pixbuf_set = NULL;
		GdkPixbuf** _tmp11_;
		gint icon_pixbuf_set_length1;
		gint _icon_pixbuf_set_size_;
		GdkPixbuf** _tmp12_;
		gint _tmp12__length1;
		GdkPixbuf* _tmp13_;
		GdkPixbuf* _tmp14_;
		GdkPixbuf** _tmp15_;
		gint _tmp15__length1;
#line 49 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp11_ = g_new0 (GdkPixbuf*, 0 + 1);
#line 49 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		icon_pixbuf_set = _tmp11_;
#line 49 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		icon_pixbuf_set_length1 = 0;
#line 49 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_icon_pixbuf_set_size_ = icon_pixbuf_set_length1;
#line 50 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp12_ = icon_pixbuf_set;
#line 50 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp12__length1 = icon_pixbuf_set_length1;
#line 50 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp13_ = icon;
#line 50 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp14_ = _g_object_ref0 (_tmp13_);
#line 50 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_vala_array_add2 (&icon_pixbuf_set, &icon_pixbuf_set_length1, &_icon_pixbuf_set_size_, _tmp14_);
#line 51 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp15_ = icon_pixbuf_set;
#line 51 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp15__length1 = icon_pixbuf_set_length1;
#line 51 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		if (result_length1) {
#line 51 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
			*result_length1 = _tmp15__length1;
#line 191 "Resources.c"
		}
#line 51 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		result = _tmp15_;
#line 51 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_g_object_unref0 (icon);
#line 51 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		return result;
#line 199 "Resources.c"
	}
#line 54 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	_tmp16_ = NULL;
#line 54 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	_tmp16__length1 = 0;
#line 54 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	if (result_length1) {
#line 54 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		*result_length1 = _tmp16__length1;
#line 209 "Resources.c"
	}
#line 54 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	result = _tmp16_;
#line 54 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	_g_object_unref0 (icon);
#line 54 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	return result;
#line 217 "Resources.c"
}


static void _vala_array_add3 (GdkPixbuf** * array, int* length, int* size, GdkPixbuf* value) {
#line 67 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	if ((*length) == (*size)) {
#line 67 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 67 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		*array = g_renew (GdkPixbuf*, *array, (*size) + 1);
#line 228 "Resources.c"
	}
#line 67 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	(*array)[(*length)++] = value;
#line 67 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	(*array)[*length] = NULL;
#line 234 "Resources.c"
}


GdkPixbuf** resources_load_from_resource (const gchar* resource_path, int* result_length1) {
	GdkPixbuf** result = NULL;
	GdkPixbuf* icon = NULL;
	GdkPixbuf* _tmp5_;
	GdkPixbuf** _tmp11_;
	gint _tmp11__length1;
	GError * _inner_error_ = NULL;
#line 57 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	g_return_val_if_fail (resource_path != NULL, NULL);
#line 58 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	icon = NULL;
#line 249 "Resources.c"
	{
		GdkPixbuf* _tmp0_ = NULL;
		const gchar* _tmp1_;
		GdkPixbuf* _tmp2_;
		GdkPixbuf* _tmp3_;
#line 60 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp1_ = resource_path;
#line 60 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp2_ = gdk_pixbuf_new_from_resource (_tmp1_, &_inner_error_);
#line 60 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp0_ = _tmp2_;
#line 60 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 263 "Resources.c"
			goto __catch5_g_error;
		}
#line 60 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp3_ = _tmp0_;
#line 60 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp0_ = NULL;
#line 60 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_g_object_unref0 (icon);
#line 60 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		icon = _tmp3_;
#line 59 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_g_object_unref0 (_tmp0_);
#line 276 "Resources.c"
	}
	goto __finally5;
	__catch5_g_error:
	{
		GError* _error_ = NULL;
		const gchar* _tmp4_;
#line 59 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_error_ = _inner_error_;
#line 59 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_inner_error_ = NULL;
#line 62 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp4_ = resource_path;
#line 62 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		g_warning ("Resources.vala:62: Couldn't load icon set from %s", _tmp4_);
#line 59 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_g_error_free0 (_error_);
#line 293 "Resources.c"
	}
	__finally5:
#line 59 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 59 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_g_object_unref0 (icon);
#line 59 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 59 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		g_clear_error (&_inner_error_);
#line 59 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		return NULL;
#line 306 "Resources.c"
	}
#line 65 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	_tmp5_ = icon;
#line 65 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	if (_tmp5_ != NULL) {
#line 312 "Resources.c"
		GdkPixbuf** icon_pixbuf_set = NULL;
		GdkPixbuf** _tmp6_;
		gint icon_pixbuf_set_length1;
		gint _icon_pixbuf_set_size_;
		GdkPixbuf** _tmp7_;
		gint _tmp7__length1;
		GdkPixbuf* _tmp8_;
		GdkPixbuf* _tmp9_;
		GdkPixbuf** _tmp10_;
		gint _tmp10__length1;
#line 66 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp6_ = g_new0 (GdkPixbuf*, 0 + 1);
#line 66 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		icon_pixbuf_set = _tmp6_;
#line 66 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		icon_pixbuf_set_length1 = 0;
#line 66 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_icon_pixbuf_set_size_ = icon_pixbuf_set_length1;
#line 67 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp7_ = icon_pixbuf_set;
#line 67 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp7__length1 = icon_pixbuf_set_length1;
#line 67 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp8_ = icon;
#line 67 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp9_ = _g_object_ref0 (_tmp8_);
#line 67 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_vala_array_add3 (&icon_pixbuf_set, &icon_pixbuf_set_length1, &_icon_pixbuf_set_size_, _tmp9_);
#line 68 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp10_ = icon_pixbuf_set;
#line 68 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp10__length1 = icon_pixbuf_set_length1;
#line 68 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		if (result_length1) {
#line 68 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
			*result_length1 = _tmp10__length1;
#line 349 "Resources.c"
		}
#line 68 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		result = _tmp10_;
#line 68 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_g_object_unref0 (icon);
#line 68 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		return result;
#line 357 "Resources.c"
	}
#line 71 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	_tmp11_ = NULL;
#line 71 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	_tmp11__length1 = 0;
#line 71 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	if (result_length1) {
#line 71 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		*result_length1 = _tmp11__length1;
#line 367 "Resources.c"
	}
#line 71 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	result = _tmp11_;
#line 71 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	_g_object_unref0 (icon);
#line 71 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	return result;
#line 375 "Resources.c"
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}