X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=sidebyside;f=libdocument%2Fev-document-misc.c;h=605cbb0a87c0074a67a7c03762db37af0ddd0e41;hb=2297bff1e7d745f0f837d44feeda03244368d7f1;hp=6a98a8cd2bc6b3708205eeb07d37a56b6fceadf3;hpb=7e11393f41b7c3df86e1562bcc08a42b05c19a6f;p=evince.git diff --git a/libdocument/ev-document-misc.c b/libdocument/ev-document-misc.c index 6a98a8cd..605cbb0a 100644 --- a/libdocument/ev-document-misc.c +++ b/libdocument/ev-document-misc.c @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include @@ -32,10 +32,11 @@ * NULL, then it will fill the return pixbuf with the contents of * source_pixbuf. */ -GdkPixbuf * -ev_document_misc_get_thumbnail_frame (int width, - int height, - GdkPixbuf *source_pixbuf) +static GdkPixbuf * +create_thumbnail_frame (int width, + int height, + GdkPixbuf *source_pixbuf, + gboolean fill_bg) { GdkPixbuf *retval; guchar *data; @@ -67,8 +68,10 @@ ev_document_misc_get_thumbnail_frame (int width, rowstride = gdk_pixbuf_get_rowstride (retval); gdk_pixbuf_fill (retval, 0x000000ff); - for (i = 1; i < height_r + 1; i++) - memset (data + (rowstride * i) + 4, 0xffffffff, width_r * 4); + if (fill_bg) { + for (i = 1; i < height_r + 1; i++) + memset (data + (rowstride * i) + 4, 0xffffffff, width_r * 4); + } /* copy the source pixbuf */ if (source_pixbuf) @@ -91,6 +94,22 @@ ev_document_misc_get_thumbnail_frame (int width, return retval; } +GdkPixbuf * +ev_document_misc_get_thumbnail_frame (int width, + int height, + GdkPixbuf *source_pixbuf) +{ + return create_thumbnail_frame (width, height, source_pixbuf, TRUE); +} + +GdkPixbuf * +ev_document_misc_get_loading_thumbnail (int width, + int height, + gboolean inverted_colors) +{ + return create_thumbnail_frame (width, height, NULL, !inverted_colors); +} + void ev_document_misc_get_page_border_size (gint page_width, gint page_height, @@ -118,7 +137,8 @@ ev_document_misc_paint_one_page (GdkDrawable *drawable, GtkWidget *widget, GdkRectangle *area, GtkBorder *border, - gboolean highlight) + gboolean highlight, + gboolean inverted_colors) { GtkStyle *style = gtk_widget_get_style (widget); GtkStateType state = gtk_widget_get_state (widget); @@ -131,7 +151,7 @@ ev_document_misc_paint_one_page (GdkDrawable *drawable, area->width, area->height); gdk_draw_rectangle (drawable, - style->white_gc, + inverted_colors ? style->black_gc : style->white_gc, TRUE, area->x + border->left, area->y + border->top,