]> www.fi.muni.cz Git - evince.git/blobdiff - pixbuf/pixbuf-document.c
Added missing files.
[evince.git] / pixbuf / pixbuf-document.c
index 5147293a29945d934bdc3ad50f5ee3ece9dca6ee..e3d064da4f95cbc2e9dfdcdcc5e43bb20a5547ef 100644 (file)
@@ -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;