X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=pixbuf%2Fpixbuf-document.c;h=e3d064da4f95cbc2e9dfdcdcc5e43bb20a5547ef;hb=d89b1cb89ef2d589befbe7a7f0c9732ff72ecc7b;hp=5147293a29945d934bdc3ad50f5ee3ece9dca6ee;hpb=2a08b88d7fc1397335cc85812b8f2bd4d53125d9;p=evince.git diff --git a/pixbuf/pixbuf-document.c b/pixbuf/pixbuf-document.c index 5147293a..e3d064da 100644 --- a/pixbuf/pixbuf-document.c +++ b/pixbuf/pixbuf-document.c @@ -30,6 +30,8 @@ struct _PixbufDocument GObject parent_instance; GdkPixbuf *pixbuf; + + gchar *uri; }; typedef struct _PixbufDocumentClass PixbufDocumentClass; @@ -65,6 +67,8 @@ pixbuf_document_load (EvDocument *document, return FALSE; pixbuf_document->pixbuf = pixbuf; + g_free (pixbuf_document->uri); + pixbuf_document->uri = g_strdup (uri); return TRUE; } @@ -74,8 +78,9 @@ pixbuf_document_save (EvDocument *document, const char *uri, GError **error) { - g_warning ("pixbuf_document_save not implemented"); /* FIXME */ - return TRUE; + PixbufDocument *pixbuf_document = PIXBUF_DOCUMENT (document); + + return ev_xfer_uri_simple (pixbuf_document->uri, uri, error); } static int @@ -108,7 +113,7 @@ pixbuf_document_render_pixbuf (EvDocument *document, gdk_pixbuf_get_height (pixbuf_document->pixbuf) * rc->scale, GDK_INTERP_BILINEAR); - rotated_pixbuf = gdk_pixbuf_rotate_simple (scaled_pixbuf, rc->rotation); + rotated_pixbuf = gdk_pixbuf_rotate_simple (scaled_pixbuf, 360 - rc->rotation); g_object_unref (scaled_pixbuf); return rotated_pixbuf; @@ -120,6 +125,7 @@ pixbuf_document_finalize (GObject *object) PixbufDocument *pixbuf_document = PIXBUF_DOCUMENT (object); g_object_unref (pixbuf_document->pixbuf); + g_free (pixbuf_document->uri); G_OBJECT_CLASS (pixbuf_document_parent_class)->finalize (object); } @@ -180,7 +186,7 @@ pixbuf_document_thumbnails_get_thumbnail (EvDocumentThumbnails *document, pixbuf = gdk_pixbuf_scale_simple (pixbuf_document->pixbuf, size, height, GDK_INTERP_BILINEAR); - rotated_pixbuf = gdk_pixbuf_rotate_simple (pixbuf, rotation); + rotated_pixbuf = gdk_pixbuf_rotate_simple (pixbuf, 360 - rotation); g_object_unref (pixbuf); return rotated_pixbuf;