1 /* moonshot-utils.c generated by valac 0.10.4, the Vala compiler
2 * generated from moonshot-utils.vala, do not modify */
6 #include <glib-object.h>
10 #include <gdk-pixbuf/gdk-pixdata.h>
13 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
14 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
18 GdkPixbuf* find_icon_sized (const char* name, GtkIconSize icon_size);
19 GdkPixbuf* find_icon (const char* name, gint size);
23 #line 5 "moonshot-utils.vala"
24 GdkPixbuf* find_icon_sized (const char* name, GtkIconSize icon_size) {
25 #line 26 "moonshot-utils.c"
26 GdkPixbuf* result = NULL;
29 #line 5 "moonshot-utils.vala"
30 g_return_val_if_fail (name != NULL, NULL);
31 #line 8 "moonshot-utils.vala"
32 gtk_icon_size_lookup (icon_size, &width, &height);
33 #line 34 "moonshot-utils.c"
34 result = find_icon (name, width);
35 #line 9 "moonshot-utils.vala"
37 #line 38 "moonshot-utils.c"
41 static gpointer _g_object_ref0 (gpointer self) {
42 return self ? g_object_ref (self) : NULL;
46 #line 17 "moonshot-utils.vala"
47 GdkPixbuf* find_icon (const char* name, gint size) {
48 #line 49 "moonshot-utils.c"
49 GdkPixbuf* result = NULL;
50 GError * _inner_error_ = NULL;
51 #line 17 "moonshot-utils.vala"
52 g_return_val_if_fail (name != NULL, NULL);
53 #line 54 "moonshot-utils.c"
55 GtkIconTheme* icon_theme;
57 #line 33 "moonshot-utils.vala"
58 icon_theme = _g_object_ref0 (gtk_icon_theme_get_default ());
59 #line 34 "moonshot-utils.vala"
60 _tmp0_ = gtk_icon_theme_load_icon (icon_theme, name, size, GTK_ICON_LOOKUP_FORCE_SIZE, &_inner_error_);
61 #line 62 "moonshot-utils.c"
62 if (_inner_error_ != NULL) {
63 _g_object_unref0 (icon_theme);
64 goto __catch7_g_error;
67 _g_object_unref0 (icon_theme);
68 #line 34 "moonshot-utils.vala"
70 #line 71 "moonshot-utils.c"
79 #line 39 "moonshot-utils.vala"
80 fprintf (stdout, "Error loading icon '%s': %s\n", name, e->message);
81 #line 82 "moonshot-utils.c"
84 #line 40 "moonshot-utils.vala"
86 #line 87 "moonshot-utils.c"
91 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);
92 g_clear_error (&_inner_error_);