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 GdkPixbuf* find_icon_sized (const char* name, GtkIconSize icon_size) {
24 GdkPixbuf* result = NULL;
27 g_return_val_if_fail (name != NULL, NULL);
28 gtk_icon_size_lookup (icon_size, &width, &height);
29 result = find_icon (name, width);
34 static gpointer _g_object_ref0 (gpointer self) {
35 return self ? g_object_ref (self) : NULL;
39 GdkPixbuf* find_icon (const char* name, gint size) {
40 GdkPixbuf* result = NULL;
41 GError * _inner_error_ = NULL;
42 g_return_val_if_fail (name != NULL, NULL);
44 GtkIconTheme* icon_theme;
47 icon_theme = _g_object_ref0 (gtk_icon_theme_get_default ());
48 _tmp0_ = gtk_icon_theme_load_icon (icon_theme, name, size, GTK_ICON_LOOKUP_FORCE_SIZE, &_inner_error_);
49 if (_inner_error_ != NULL) {
50 _g_object_unref0 (icon_theme);
51 goto __catch5_g_error;
54 _g_object_unref0 (icon_theme);
64 fprintf (stdout, "Error loading icon '%s': %s\n", name, e->message);
72 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);
73 g_clear_error (&_inner_error_);