From 2437d854718de954dcd51f00e6ffbe0bb80adbf3 Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Fri, 27 May 2011 12:57:57 +0200 Subject: [PATCH] Remove obsolete page_blank function --- utils.c | 42 ------------------------------------------ utils.h | 9 --------- 2 files changed, 51 deletions(-) diff --git a/utils.c b/utils.c index 43511a8..40e5412 100644 --- a/utils.c +++ b/utils.c @@ -153,48 +153,6 @@ execute_command(char* const argv[], char** output) return true; } -GtkWidget* -page_blank(unsigned int width, unsigned int height) -{ - if ((width == 0) || (height == 0)) { - return NULL; - } - - guchar* buffer = malloc(sizeof(guchar) * (width * height * 1)); - if (!buffer) { - return NULL; - } - - /* draw white */ - for (unsigned int i = 0; i < width * height; i++) { - buffer[i] = 255; - } - - GdkPixbuf* pixbuf = gdk_pixbuf_new_from_data(buffer, GDK_COLORSPACE_RGB, FALSE, 8, - width, height, 1, NULL, NULL); - - if (!pixbuf) { - free(buffer); - return NULL; - } - - /* convert to image */ - GtkWidget* image = gtk_image_new(); - if (!image) { - free(buffer); - g_object_unref(pixbuf); - return false; - } - - gtk_image_set_from_pixbuf(GTK_IMAGE(image), pixbuf); - gtk_widget_show(image); - - /*free(buffer);*/ // XXX: Read documentation - g_object_unref(pixbuf); - - return image; -} - void document_index_build(GtkTreeModel* model, GtkTreeIter* parent, girara_tree_node_t* tree) { diff --git a/utils.h b/utils.h index 62db090..3637b58 100644 --- a/utils.h +++ b/utils.h @@ -50,15 +50,6 @@ bool file_valid_extension(zathura_t* zathura, const char* path); */ bool execute_command(char* const argv[], char** output); -/** - * Creates a blank page - * - * @param width The width of the page - * @param height The height of the page - * @return The widget of the page or NULL if an error occured - */ -GtkWidget* page_blank(unsigned int width, unsigned int height); - /** * Generates the document index based upon the list retreived from the document * object.