Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Malcolm <dave_malcolm@src.gnome.org>2005-04-01 20:04:26 (GMT)
committer David Malcolm <dave_malcolm@src.gnome.org>2005-04-01 20:04:26 (GMT)
commitbf999dd5cf322d288a136a627bcb821cd2175eef (patch)
treeda4148c39ff4601b056d84febdbf3f6752cfbaa9
parent51bd7fd8e4e9c5654c38fb1933fe304c24cf34d8 (diff)
Got pixbuf backend working again
-rw-r--r--ChangeLog7
-rw-r--r--Makefile.am2
-rw-r--r--pixbuf/pixbuf-document.c58
3 files changed, 15 insertions, 52 deletions
diff --git a/ChangeLog b/ChangeLog
index 3682209..0227b57 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-04-01 David Malcolm <dmalcolm@redhat.com>
+
+ * Makefile.am:
+ * pixbuf/pixbuf-document.c:
+
+ Got pixbuf backend working again
+
2005-04-01 Steve Murphy <murf@e-tools.com>
* configure.in: Added "rw" to ALL_LINGUAS.
diff --git a/Makefile.am b/Makefile.am
index 155dac8..41d8abd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = lib cut-n-paste data backend po pdf ps shell thumbnailer
+SUBDIRS = lib cut-n-paste data backend po pdf ps pixbuf shell thumbnailer
intltool_extra = intltool-extract.in intltool-merge.in intltool-update.in
diff --git a/pixbuf/pixbuf-document.c b/pixbuf/pixbuf-document.c
index 4195675..c728ed0 100644
--- a/pixbuf/pixbuf-document.c
+++ b/pixbuf/pixbuf-document.c
@@ -107,15 +107,6 @@ pixbuf_document_get_page (EvDocument *document)
}
static void
-pixbuf_document_set_target (EvDocument *document,
- GdkDrawable *target)
-{
- PixbufDocument *pixbuf_document = PIXBUF_DOCUMENT (document);
-
- pixbuf_document->target = target;
-}
-
-static void
pixbuf_document_set_scale (EvDocument *document,
double scale)
{
@@ -125,17 +116,6 @@ pixbuf_document_set_scale (EvDocument *document,
}
static void
-pixbuf_document_set_page_offset (EvDocument *document,
- int x,
- int y)
-{
- PixbufDocument *pixbuf_document = PIXBUF_DOCUMENT (document);
-
- pixbuf_document->x_offset = x;
- pixbuf_document->y_offset = y;
-}
-
-static void
pixbuf_document_get_page_size (EvDocument *document,
int page,
int *width,
@@ -149,36 +129,14 @@ pixbuf_document_get_page_size (EvDocument *document,
*height = gdk_pixbuf_get_height (pixbuf_document->pixbuf) * pixbuf_document->scale;
}
-static void
-pixbuf_document_render (EvDocument *document,
- int clip_x,
- int clip_y,
- int clip_width,
- int clip_height)
+static GdkPixbuf*
+pixbuf_document_render_pixbuf (EvDocument *document)
{
PixbufDocument *pixbuf_document = PIXBUF_DOCUMENT (document);
- GdkPixbuf *tmp_pixbuf;
-
- tmp_pixbuf = gdk_pixbuf_new (gdk_pixbuf_get_colorspace (pixbuf_document->pixbuf),
- gdk_pixbuf_get_has_alpha (pixbuf_document->pixbuf),
- gdk_pixbuf_get_bits_per_sample (pixbuf_document->pixbuf),
- clip_width, clip_height);
-
- gdk_pixbuf_fill (tmp_pixbuf, 0xffffffff);
- gdk_pixbuf_scale (pixbuf_document->pixbuf, tmp_pixbuf, 0, 0,
- MIN(gdk_pixbuf_get_width(pixbuf_document->pixbuf)* pixbuf_document->scale-clip_x, clip_width),
- MIN(gdk_pixbuf_get_height(pixbuf_document->pixbuf)* pixbuf_document->scale-clip_y, clip_height),
- -clip_x, -clip_y,
- pixbuf_document->scale, pixbuf_document->scale,
- GDK_INTERP_BILINEAR);
-
- gdk_draw_pixbuf (pixbuf_document->target, NULL, tmp_pixbuf,
- 0, 0,
- clip_x, clip_y,
- clip_width, clip_height, GDK_RGB_DITHER_NORMAL,
- 0, 0);
-
- g_object_unref (tmp_pixbuf);
+ return gdk_pixbuf_scale_simple (pixbuf_document->pixbuf,
+ gdk_pixbuf_get_width (pixbuf_document->pixbuf) * pixbuf_document->scale,
+ gdk_pixbuf_get_height (pixbuf_document->pixbuf) * pixbuf_document->scale,
+ GDK_INTERP_BILINEAR);
}
static void
@@ -259,10 +217,8 @@ pixbuf_document_document_iface_init (EvDocumentIface *iface)
iface->set_page = pixbuf_document_set_page;
iface->get_page = pixbuf_document_get_page;
iface->set_scale = pixbuf_document_set_scale;
- iface->set_target = pixbuf_document_set_target;
- iface->set_page_offset = pixbuf_document_set_page_offset;
iface->get_page_size = pixbuf_document_get_page_size;
- iface->render = pixbuf_document_render;
+ iface->render_pixbuf = pixbuf_document_render_pixbuf;
}
static GdkPixbuf *