X-Git-Url: http://git.maemo.org/git/?p=jamendo;a=blobdiff_plain;f=src%2Fresource_utils.c;fp=src%2Fresource_utils.c;h=010dcdcb05fc9147d530970d55973fd0cfc31e62;hp=0000000000000000000000000000000000000000;hb=71eece00473c745dbe74c7dd9abd6a5fa52ea3ab;hpb=496d310181c50d216bf2f44e9a970a791aa2aba0;ds=sidebyside diff --git a/src/resource_utils.c b/src/resource_utils.c new file mode 100644 index 0000000..010dcdc --- /dev/null +++ b/src/resource_utils.c @@ -0,0 +1,22 @@ +/* + * resource_utils.c + * + * Created on: 2009-12-18 + * Author: marcin + */ + +#include "resource_utils.h" + +GtkWidget* resource_get_image(const gchar* name) { + gchar* filepath = g_strdup_printf("%s/%s", RESPREFIX, name); + GtkWidget* image = gtk_image_new_from_file(filepath); + g_free(filepath); + return image; +} + +GdkPixbuf* resource_get_pixbuf_at_scale(const gchar* name, int width, int height) { + gchar* filepath = g_strdup_printf("%s/%s", RESPREFIX, name); + GdkPixbuf* pixbuf = gdk_pixbuf_new_from_file_at_scale(filepath, width, height, TRUE, NULL); + g_free(filepath); + return pixbuf; +}