summaryrefslogtreecommitdiff
path: root/plugins/common/Resources.c
blob: 828d6dff26e6f99000134ece0aa7c6b0b5793def (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
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
/* Resources.c generated by valac 0.40.4, 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_add4 (GdkPixbuf** * array,
                       int* length,
                       int* size,
                       GdkPixbuf* value);
GdkPixbuf** resources_load_from_resource (const gchar* resource_path,
                                          int* result_length1);
static void _vala_array_add5 (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 55 "Resources.c"
}


static void
_vala_array_add4 (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 71 "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 77 "Resources.c"
}


GdkPixbuf**
resources_load_icon_set (GFile* icon_file,
                         int* result_length1)
{
	GdkPixbuf** result = NULL;
	GdkPixbuf* icon = NULL;
	GdkPixbuf* _tmp8_;
	GdkPixbuf** _tmp14_;
	gint _tmp14__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 95 "Resources.c"
	{
		GdkPixbuf* _tmp0_ = NULL;
		gchar* _tmp1_;
		gchar* _tmp2_;
		GdkPixbuf* _tmp3_;
		GdkPixbuf* _tmp4_;
		GdkPixbuf* _tmp5_;
#line 43 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp1_ = g_file_get_path (icon_file);
#line 43 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp2_ = _tmp1_;
#line 43 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp3_ = gdk_pixbuf_new_from_file (_tmp2_, &_inner_error_);
#line 43 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp4_ = _tmp3_;
#line 43 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_g_free0 (_tmp2_);
#line 43 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp0_ = _tmp4_;
#line 43 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 117 "Resources.c"
			goto __catch4_g_error;
		}
#line 43 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp5_ = _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 = _tmp5_;
#line 42 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_g_object_unref0 (_tmp0_);
#line 130 "Resources.c"
	}
	goto __finally4;
	__catch4_g_error:
	{
		GError* err = NULL;
		gchar* _tmp6_;
		gchar* _tmp7_;
#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"
		_tmp6_ = g_file_get_path (icon_file);
#line 45 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp7_ = _tmp6_;
#line 45 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		g_warning ("Resources.vala:45: couldn't load icon set from %s.", _tmp7_);
#line 45 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_g_free0 (_tmp7_);
#line 42 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_g_error_free0 (err);
#line 152 "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 165 "Resources.c"
	}
#line 48 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	_tmp8_ = icon;
#line 48 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	if (_tmp8_ != NULL) {
#line 171 "Resources.c"
		GdkPixbuf** icon_pixbuf_set = NULL;
		GdkPixbuf** _tmp9_;
		gint icon_pixbuf_set_length1;
		gint _icon_pixbuf_set_size_;
		GdkPixbuf** _tmp10_;
		gint _tmp10__length1;
		GdkPixbuf* _tmp11_;
		GdkPixbuf* _tmp12_;
		GdkPixbuf** _tmp13_;
		gint _tmp13__length1;
#line 49 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp9_ = g_new0 (GdkPixbuf*, 0 + 1);
#line 49 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		icon_pixbuf_set = _tmp9_;
#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"
		_tmp10_ = icon_pixbuf_set;
#line 50 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp10__length1 = icon_pixbuf_set_length1;
#line 50 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp11_ = icon;
#line 50 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp12_ = _g_object_ref0 (_tmp11_);
#line 50 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_vala_array_add4 (&icon_pixbuf_set, &icon_pixbuf_set_length1, &_icon_pixbuf_set_size_, _tmp12_);
#line 51 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp13_ = icon_pixbuf_set;
#line 51 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp13__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 = _tmp13__length1;
#line 208 "Resources.c"
		}
#line 51 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		result = _tmp13_;
#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 216 "Resources.c"
	}
#line 54 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	_tmp14_ = NULL;
#line 54 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	_tmp14__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 = _tmp14__length1;
#line 226 "Resources.c"
	}
#line 54 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	result = _tmp14_;
#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 234 "Resources.c"
}


static void
_vala_array_add5 (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 250 "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 256 "Resources.c"
}


GdkPixbuf**
resources_load_from_resource (const gchar* resource_path,
                              int* result_length1)
{
	GdkPixbuf** result = NULL;
	GdkPixbuf* icon = NULL;
	GdkPixbuf* _tmp3_;
	GdkPixbuf** _tmp9_;
	gint _tmp9__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 274 "Resources.c"
	{
		GdkPixbuf* _tmp0_ = NULL;
		GdkPixbuf* _tmp1_;
		GdkPixbuf* _tmp2_;
#line 60 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp1_ = gdk_pixbuf_new_from_resource (resource_path, &_inner_error_);
#line 60 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp0_ = _tmp1_;
#line 60 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 285 "Resources.c"
			goto __catch5_g_error;
		}
#line 60 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp2_ = _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 = _tmp2_;
#line 59 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_g_object_unref0 (_tmp0_);
#line 298 "Resources.c"
	}
	goto __finally5;
	__catch5_g_error:
	{
		GError* _error_ = NULL;
#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"
		g_warning ("Resources.vala:62: Couldn't load icon set from %s", resource_path);
#line 59 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_g_error_free0 (_error_);
#line 312 "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 325 "Resources.c"
	}
#line 65 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	_tmp3_ = icon;
#line 65 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	if (_tmp3_ != NULL) {
#line 331 "Resources.c"
		GdkPixbuf** icon_pixbuf_set = NULL;
		GdkPixbuf** _tmp4_;
		gint icon_pixbuf_set_length1;
		gint _icon_pixbuf_set_size_;
		GdkPixbuf** _tmp5_;
		gint _tmp5__length1;
		GdkPixbuf* _tmp6_;
		GdkPixbuf* _tmp7_;
		GdkPixbuf** _tmp8_;
		gint _tmp8__length1;
#line 66 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp4_ = g_new0 (GdkPixbuf*, 0 + 1);
#line 66 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		icon_pixbuf_set = _tmp4_;
#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"
		_tmp5_ = icon_pixbuf_set;
#line 67 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp5__length1 = icon_pixbuf_set_length1;
#line 67 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp6_ = icon;
#line 67 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp7_ = _g_object_ref0 (_tmp6_);
#line 67 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_vala_array_add5 (&icon_pixbuf_set, &icon_pixbuf_set_length1, &_icon_pixbuf_set_size_, _tmp7_);
#line 68 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp8_ = icon_pixbuf_set;
#line 68 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		_tmp8__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 = _tmp8__length1;
#line 368 "Resources.c"
		}
#line 68 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
		result = _tmp8_;
#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 376 "Resources.c"
	}
#line 71 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	_tmp9_ = NULL;
#line 71 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	_tmp9__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 = _tmp9__length1;
#line 386 "Resources.c"
	}
#line 71 "/home/jens/Source/shotwell/plugins/common/Resources.vala"
	result = _tmp9_;
#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 394 "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);
}