summaryrefslogtreecommitdiff
path: root/src/book.c
diff options
context:
space:
mode:
authorAlessio Treglia <alessio@debian.org>2013-10-05 15:29:30 +0100
committerAlessio Treglia <alessio@debian.org>2013-10-05 15:29:30 +0100
commite51f2bbb5a0f25b37330891d769b996a2c13d277 (patch)
tree25d429c588012a476c15b6ca5b4bf393613beca3 /src/book.c
parent438230655b539ad6aa15b017a792cab8ca7f6d89 (diff)
parent2d71d20a62ca8f6989d86db58ce64c7a862675dd (diff)
Merge tag 'upstream/3.10.0'
Upstream version 3.10.0
Diffstat (limited to 'src/book.c')
-rw-r--r--src/book.c3169
1 files changed, 2525 insertions, 644 deletions
diff --git a/src/book.c b/src/book.c
index 9d868ef..b9e4dbb 100644
--- a/src/book.c
+++ b/src/book.c
@@ -1,4 +1,4 @@
-/* book.c generated by valac 0.18.1, the Vala compiler
+/* book.c generated by valac 0.20.1, the Vala compiler
* generated from book.vala, do not modify */
/*
@@ -24,8 +24,6 @@
#include <gdk/gdk.h>
#include <cairo-ps.h>
#include <zlib.h>
-#include "jpeglib.h"
-#include "config.h"
#include <gobject/gvaluecollector.h>
@@ -51,6 +49,7 @@ typedef struct _Page Page;
typedef struct _PageClass PageClass;
#define _page_unref0(var) ((var == NULL) ? NULL : (var = (page_unref (var), NULL)))
#define __g_list_free__page_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__page_unref0_ (var), NULL)))
+#define _g_byte_array_unref0(var) ((var == NULL) ? NULL : (var = (g_byte_array_unref (var), NULL)))
#define TYPE_SCAN_DIRECTION (scan_direction_get_type ())
#define _g_free0(var) (var = (g_free (var), NULL))
@@ -69,6 +68,7 @@ typedef struct _PsWriterClass PsWriterClass;
typedef struct _PsWriterPrivate PsWriterPrivate;
#define _cairo_surface_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_surface_destroy (var), NULL)))
#define _ps_writer_unref0(var) ((var == NULL) ? NULL : (var = (ps_writer_unref (var), NULL)))
+#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define TYPE_PDF_WRITER (pdf_writer_get_type ())
#define PDF_WRITER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PDF_WRITER, PDFWriter))
@@ -83,7 +83,6 @@ typedef struct _PDFWriterPrivate PDFWriterPrivate;
#define _pdf_writer_unref0(var) ((var == NULL) ? NULL : (var = (pdf_writer_unref (var), NULL)))
typedef struct _ParamSpecBook ParamSpecBook;
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
-#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _ParamSpecPDFWriter ParamSpecPDFWriter;
typedef struct _ParamSpecPsWriter ParamSpecPsWriter;
@@ -101,6 +100,7 @@ struct _BookClass {
struct _BookPrivate {
GList* pages;
gboolean needs_saving;
+ GByteArray* jpeg_data;
};
typedef enum {
@@ -194,8 +194,8 @@ guint book_get_n_pages (Book* self);
Page* book_get_page (Book* self, gint page_number);
guint book_get_page_index (Book* self, Page* page);
static GFile* book_make_indexed_file (Book* self, const gchar* uri, gint i);
-static void book_save_multi_file (Book* self, const gchar* type, GFile* file, GError** error);
-void page_save (Page* self, const gchar* type, GFile* file, GError** error);
+static void book_save_multi_file (Book* self, const gchar* type, gint quality, GFile* file, GError** error);
+void page_save (Page* self, const gchar* type, gint quality, GFile* file, GError** error);
static void book_save_ps_pdf_surface (Book* self, cairo_surface_t* surface, GdkPixbuf* image, gdouble dpi);
static void book_save_ps (Book* self, GFile* file, GError** error);
PsWriter* ps_writer_new (GFileOutputStream* stream);
@@ -210,14 +210,10 @@ GType ps_writer_get_type (void) G_GNUC_CONST;
GdkPixbuf* page_get_image (Page* self, gboolean apply_crop);
gint page_get_dpi (Page* self);
static guint8* book_compress_zlib (Book* self, guint8* data, int data_length1, int* result_length1);
-static void book_jpeg_init_cb (struct jpeg_compress_struct* info);
-static gboolean book_jpeg_empty_cb (struct jpeg_compress_struct* info);
-static void book_jpeg_term_cb (struct jpeg_compress_struct* info);
-static guint8* book_compress_jpeg (Book* self, GdkPixbuf* image, gsize* n_written, int* result_length1);
-static void _book_jpeg_init_cb_jpeg_initdestinationfunc (struct jpeg_compress_struct* cinfo);
-static gboolean _book_jpeg_empty_cb_jpeg_emptyoutputbufferfunc (struct jpeg_compress_struct* cinfo);
-static void _book_jpeg_term_cb_jpeg_termdestinationfunc (struct jpeg_compress_struct* cinfo);
-static void book_save_pdf (Book* self, GFile* file, GError** error);
+static guint8* book_compress_jpeg (Book* self, GdkPixbuf* image, gint quality, gint dpi, int* result_length1);
+static gboolean book_write_pixbuf_data (Book* self, guint8* buf, int buf_length1, GError** error);
+static gboolean _book_write_pixbuf_data_gdk_pixbuf_save_func (guint8* buf, gsize buf_length1, GError** error, gpointer self);
+static void book_save_pdf (Book* self, GFile* file, gint quality, GError** error);
PDFWriter* pdf_writer_new (GFileOutputStream* stream);
PDFWriter* pdf_writer_construct (GType object_type, GFileOutputStream* stream);
gpointer pdf_writer_ref (gpointer instance);
@@ -234,7 +230,7 @@ gint page_get_depth (Page* self);
static guint8* _vala_array_dup1 (guint8* self, int length);
static guint8* _vala_array_dup2 (guint8* self, int length);
void pdf_writer_write (PDFWriter* self, guint8* data, int data_length1);
-void book_save (Book* self, const gchar* type, GFile* file, GError** error);
+void book_save (Book* self, const gchar* type, gint quality, GFile* file, GError** error);
gboolean book_get_needs_saving (Book* self);
static void g_cclosure_user_marshal_VOID__PAGE (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
static void book_finalize (Book* obj);
@@ -249,86 +245,131 @@ enum {
static cairo_status_t ps_writer_write_cairo_data (PsWriter* self, guint8* data, int data_length1);
static cairo_status_t _ps_writer_write_cairo_data_cairo_write_func_t (gpointer self, guchar* data, int data_length1);
static void ps_writer_finalize (PsWriter* obj);
+static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
+static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gpointer _page_ref0 (gpointer self) {
+#line 32 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return self ? page_ref (self) : NULL;
+#line 256 "book.c"
}
static void _book_page_changed_cb_page_pixels_changed (Page* _sender, gpointer self) {
+#line 34 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_page_changed_cb (self, _sender);
+#line 263 "book.c"
}
static void _book_page_changed_cb_page_crop_changed (Page* _sender, gpointer self) {
+#line 35 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_page_changed_cb (self, _sender);
+#line 270 "book.c"
}
static void _page_unref0_ (gpointer var) {
+#line 14 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
(var == NULL) ? NULL : (var = (page_unref (var), NULL));
+#line 277 "book.c"
}
static void _g_list_free__page_unref0_ (GList* self) {
+#line 14 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_list_foreach (self, (GFunc) _page_unref0_, NULL);
+#line 14 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_list_free (self);
+#line 286 "book.c"
}
Book* book_construct (GType object_type) {
Book* self = NULL;
+#line 25 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self = (Book*) g_type_create_instance (object_type);
+#line 27 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
__g_list_free__page_unref0_0 (self->priv->pages);
+#line 27 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->priv->pages = NULL;
+#line 25 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return self;
+#line 300 "book.c"
}
Book* book_new (void) {
+#line 25 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return book_construct (TYPE_BOOK);
+#line 307 "book.c"
}
void book_clear (Book* self) {
GList* _tmp0_;
+#line 39 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (self != NULL);
+#line 41 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = self->priv->pages;
+#line 317 "book.c"
{
GList* page_collection = NULL;
GList* page_it = NULL;
+#line 41 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
page_collection = _tmp0_;
+#line 41 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
for (page_it = page_collection; page_it != NULL; page_it = page_it->next) {
+#line 325 "book.c"
Page* _tmp1_;
Page* page = NULL;
+#line 41 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = _page_ref0 ((Page*) page_it->data);
+#line 41 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
page = _tmp1_;
+#line 332 "book.c"
{
Page* _tmp2_;
guint _tmp3_ = 0U;
Page* _tmp4_;
guint _tmp5_ = 0U;
+#line 43 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = page;
+#line 43 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_parse_name ("pixels-changed", TYPE_PAGE, &_tmp3_, NULL, FALSE);
+#line 43 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _book_page_changed_cb_page_pixels_changed, self);
+#line 44 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = page;
+#line 44 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_parse_name ("crop-changed", TYPE_PAGE, &_tmp5_, NULL, FALSE);
+#line 44 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_handlers_disconnect_matched (_tmp4_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp5_, 0, NULL, (GCallback) _book_page_changed_cb_page_crop_changed, self);
+#line 41 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_page_unref0 (page);
+#line 352 "book.c"
}
}
}
+#line 46 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
__g_list_free__page_unref0_0 (self->priv->pages);
+#line 46 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->priv->pages = NULL;
+#line 47 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_emit_by_name (self, "cleared");
+#line 362 "book.c"
}
static void book_page_changed_cb (Book* self, Page* page) {
+#line 50 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (self != NULL);
+#line 50 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (page != NULL);
+#line 52 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_set_needs_saving (self, TRUE);
+#line 373 "book.c"
}
@@ -341,21 +382,37 @@ Page* book_append_page (Book* self, gint width, gint height, gint dpi, ScanDirec
Page* _tmp4_;
Page* page;
Page* _tmp5_;
+#line 55 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (self != NULL, NULL);
+#line 57 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = width;
+#line 57 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = height;
+#line 57 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = dpi;
+#line 57 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = scan_direction;
+#line 57 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = page_new (_tmp0_, _tmp1_, _tmp2_, _tmp3_);
+#line 57 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
page = _tmp4_;
+#line 58 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_connect (page, "pixels-changed", (GCallback) _book_page_changed_cb_page_pixels_changed, self);
+#line 59 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_connect (page, "crop-changed", (GCallback) _book_page_changed_cb_page_crop_changed, self);
+#line 61 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5_ = _page_ref0 (page);
+#line 61 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->priv->pages = g_list_append (self->priv->pages, _tmp5_);
+#line 62 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_emit_by_name (self, "page-added", page);
+#line 63 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_set_needs_saving (self, TRUE);
+#line 65 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
result = page;
+#line 65 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
+#line 416 "book.c"
}
@@ -364,16 +421,27 @@ void book_move_page (Book* self, Page* page, guint location) {
Page* _tmp1_;
Page* _tmp2_;
guint _tmp3_;
+#line 68 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (self != NULL);
+#line 68 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (page != NULL);
+#line 70 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = page;
+#line 70 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->priv->pages = g_list_remove (self->priv->pages, _tmp0_);
+#line 71 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = page;
+#line 71 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = _page_ref0 (_tmp1_);
+#line 71 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = location;
+#line 71 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->priv->pages = g_list_insert (self->priv->pages, _tmp2_, (gint) _tmp3_);
+#line 72 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_emit_by_name (self, "reordered");
+#line 73 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_set_needs_saving (self, TRUE);
+#line 445 "book.c"
}
@@ -384,19 +452,33 @@ void book_delete_page (Book* self, Page* page) {
guint _tmp3_ = 0U;
Page* _tmp4_;
Page* _tmp5_;
+#line 76 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (self != NULL);
+#line 76 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (page != NULL);
+#line 78 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = page;
+#line 78 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_parse_name ("pixels-changed", TYPE_PAGE, &_tmp1_, NULL, FALSE);
+#line 78 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _book_page_changed_cb_page_pixels_changed, self);
+#line 79 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = page;
+#line 79 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_parse_name ("crop-changed", TYPE_PAGE, &_tmp3_, NULL, FALSE);
+#line 79 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _book_page_changed_cb_page_crop_changed, self);
+#line 80 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = page;
+#line 80 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_emit_by_name (self, "page-removed", _tmp4_);
+#line 81 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5_ = page;
+#line 81 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->priv->pages = g_list_remove (self->priv->pages, _tmp5_);
+#line 82 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_set_needs_saving (self, TRUE);
+#line 482 "book.c"
}
@@ -404,11 +486,17 @@ guint book_get_n_pages (Book* self) {
guint result = 0U;
GList* _tmp0_;
guint _tmp1_ = 0U;
+#line 85 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (self != NULL, 0U);
+#line 87 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = self->priv->pages;
+#line 87 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = g_list_length (_tmp0_);
+#line 87 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
result = _tmp1_;
+#line 87 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
+#line 500 "book.c"
}
@@ -419,23 +507,39 @@ Page* book_get_page (Book* self, gint page_number) {
gint _tmp5_;
gconstpointer _tmp6_ = NULL;
Page* _tmp7_;
+#line 90 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (self != NULL, NULL);
+#line 92 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = page_number;
+#line 92 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp0_ < 0) {
+#line 517 "book.c"
GList* _tmp1_;
guint _tmp2_ = 0U;
gint _tmp3_;
+#line 93 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = self->priv->pages;
+#line 93 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = g_list_length (_tmp1_);
+#line 93 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = page_number;
+#line 93 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
page_number = ((gint) _tmp2_) + _tmp3_;
+#line 529 "book.c"
}
+#line 94 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = self->priv->pages;
+#line 94 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5_ = page_number;
+#line 94 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp6_ = g_list_nth_data (_tmp4_, (guint) _tmp5_);
+#line 94 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp7_ = _page_ref0 ((Page*) _tmp6_);
+#line 94 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
result = _tmp7_;
+#line 94 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
+#line 543 "book.c"
}
@@ -444,13 +548,21 @@ guint book_get_page_index (Book* self, Page* page) {
GList* _tmp0_;
Page* _tmp1_;
gint _tmp2_ = 0;
+#line 97 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (self != NULL, 0U);
+#line 97 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (page != NULL, 0U);
+#line 99 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = self->priv->pages;
+#line 99 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = page;
+#line 99 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = g_list_index (_tmp0_, _tmp1_);
+#line 99 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
result = (guint) _tmp2_;
+#line 99 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
+#line 566 "book.c"
}
@@ -461,20 +573,35 @@ static gint string_last_index_of_char (const gchar* self, gunichar c, gint start
gchar* _tmp2_ = NULL;
gchar* _result_;
gchar* _tmp3_;
+#line 928 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
g_return_val_if_fail (self != NULL, 0);
+#line 929 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp0_ = start_index;
+#line 929 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp1_ = c;
+#line 929 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp2_ = g_utf8_strrchr (((gchar*) self) + _tmp0_, (gssize) (-1), _tmp1_);
+#line 929 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_result_ = _tmp2_;
+#line 931 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp3_ = _result_;
+#line 931 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
if (_tmp3_ != NULL) {
+#line 591 "book.c"
gchar* _tmp4_;
+#line 932 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp4_ = _result_;
+#line 932 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
result = (gint) (_tmp4_ - ((gchar*) self));
+#line 932 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
return result;
+#line 599 "book.c"
} else {
+#line 934 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
result = -1;
+#line 934 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
return result;
+#line 605 "book.c"
}
}
@@ -498,59 +625,109 @@ static gchar* string_slice (const gchar* self, glong start, glong end) {
glong _tmp21_;
glong _tmp22_;
gchar* _tmp23_ = NULL;
+#line 1190 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
g_return_val_if_fail (self != NULL, NULL);
+#line 1191 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp0_ = strlen (self);
+#line 1191 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp1_ = _tmp0_;
+#line 1191 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
string_length = (glong) _tmp1_;
+#line 1192 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp2_ = start;
+#line 1192 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
if (_tmp2_ < ((glong) 0)) {
+#line 641 "book.c"
glong _tmp3_;
glong _tmp4_;
+#line 1193 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp3_ = string_length;
+#line 1193 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp4_ = start;
+#line 1193 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
start = _tmp3_ + _tmp4_;
+#line 650 "book.c"
}
+#line 1195 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp5_ = end;
+#line 1195 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
if (_tmp5_ < ((glong) 0)) {
+#line 656 "book.c"
glong _tmp6_;
glong _tmp7_;
+#line 1196 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp6_ = string_length;
+#line 1196 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp7_ = end;
+#line 1196 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
end = _tmp6_ + _tmp7_;
+#line 665 "book.c"
}
+#line 1198 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp9_ = start;
+#line 1198 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
if (_tmp9_ >= ((glong) 0)) {
+#line 671 "book.c"
glong _tmp10_;
glong _tmp11_;
+#line 1198 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp10_ = start;
+#line 1198 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp11_ = string_length;
+#line 1198 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp8_ = _tmp10_ <= _tmp11_;
+#line 680 "book.c"
} else {
+#line 1198 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp8_ = FALSE;
+#line 684 "book.c"
}
+#line 1198 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp12_ = _tmp8_;
+#line 1198 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
g_return_val_if_fail (_tmp12_, NULL);
+#line 1199 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp14_ = end;
+#line 1199 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
if (_tmp14_ >= ((glong) 0)) {
+#line 694 "book.c"
glong _tmp15_;
glong _tmp16_;
+#line 1199 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp15_ = end;
+#line 1199 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp16_ = string_length;
+#line 1199 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp13_ = _tmp15_ <= _tmp16_;
+#line 703 "book.c"
} else {
+#line 1199 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp13_ = FALSE;
+#line 707 "book.c"
}
+#line 1199 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp17_ = _tmp13_;
+#line 1199 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
g_return_val_if_fail (_tmp17_, NULL);
+#line 1200 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp18_ = start;
+#line 1200 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp19_ = end;
+#line 1200 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
g_return_val_if_fail (_tmp18_ <= _tmp19_, NULL);
+#line 1201 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp20_ = start;
+#line 1201 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp21_ = end;
+#line 1201 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp22_ = start;
+#line 1201 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp23_ = g_strndup (((gchar*) self) + _tmp20_, (gsize) (_tmp21_ - _tmp22_));
+#line 1201 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
result = _tmp23_;
+#line 1201 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
return result;
+#line 731 "book.c"
}
@@ -569,37 +746,79 @@ static GFile* book_make_indexed_file (Book* self, const gchar* uri, gint i) {
gint _tmp9_ = 0;
gint extension_index;
gint _tmp10_;
- const gchar* _tmp25_;
- gint _tmp26_;
- const gchar* _tmp27_;
- gchar* _tmp28_ = NULL;
- gchar* _tmp29_;
- GFile* _tmp30_ = NULL;
- GFile* _tmp31_;
+ guint _tmp25_ = 0U;
+ gchar* _tmp26_ = NULL;
+ gchar* _tmp27_;
+ gint _tmp28_;
+ gint _tmp29_;
+ gint _tmp30_;
+ gint width;
+ gint _tmp31_;
+ gchar* _tmp32_ = NULL;
+ gchar* number_format;
+ const gchar* _tmp33_;
+ gchar* _tmp34_;
+ gchar* _tmp35_;
+ const gchar* _tmp36_;
+ gint _tmp37_;
+ gchar* _tmp38_ = NULL;
+ gchar* _tmp39_;
+ gchar* _tmp40_;
+ gchar* _tmp41_;
+ const gchar* _tmp42_;
+ gchar* _tmp43_;
+ gchar* _tmp44_;
+ gchar* filename;
+ const gchar* _tmp45_;
+ GFile* _tmp46_ = NULL;
+#line 102 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (self != NULL, NULL);
+#line 102 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (uri != NULL, NULL);
+#line 104 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = book_get_n_pages (self);
+#line 104 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp0_ == ((guint) 1)) {
+#line 783 "book.c"
const gchar* _tmp1_;
GFile* _tmp2_ = NULL;
+#line 105 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = uri;
+#line 105 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = g_file_new_for_uri (_tmp1_);
+#line 105 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
result = _tmp2_;
+#line 105 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
+#line 794 "book.c"
}
+#line 108 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = uri;
+#line 108 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = g_path_get_basename (_tmp3_);
+#line 108 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
basename = _tmp4_;
+#line 109 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5_ = uri;
+#line 109 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp6_ = g_strdup (_tmp5_);
+#line 109 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
prefix = _tmp6_;
+#line 109 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp7_ = g_strdup ("");
+#line 109 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
suffix = _tmp7_;
+#line 110 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp8_ = basename;
+#line 110 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp9_ = string_last_index_of_char (_tmp8_, (gunichar) '.', 0);
+#line 110 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
extension_index = _tmp9_;
+#line 111 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp10_ = extension_index;
+#line 111 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp10_ >= 0) {
+#line 822 "book.c"
const gchar* _tmp11_;
gint _tmp12_;
const gchar* _tmp13_;
@@ -614,53 +833,141 @@ static GFile* book_make_indexed_file (Book* self, const gchar* uri, gint i) {
gint _tmp22_;
gint _tmp23_;
gchar* _tmp24_ = NULL;
+#line 113 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp11_ = basename;
+#line 113 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp12_ = extension_index;
+#line 113 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp13_ = basename;
+#line 113 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp14_ = strlen (_tmp13_);
+#line 113 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp15_ = _tmp14_;
+#line 113 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp16_ = string_slice (_tmp11_, (glong) _tmp12_, (glong) _tmp15_);
+#line 113 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (suffix);
+#line 113 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
suffix = _tmp16_;
+#line 114 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp17_ = uri;
+#line 114 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp18_ = uri;
+#line 114 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp19_ = strlen (_tmp18_);
+#line 114 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp20_ = _tmp19_;
+#line 114 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp21_ = suffix;
+#line 114 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp22_ = strlen (_tmp21_);
+#line 114 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp23_ = _tmp22_;
+#line 114 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp24_ = string_slice (_tmp17_, (glong) 0, (glong) (_tmp20_ - _tmp23_));
+#line 114 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (prefix);
+#line 114 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
prefix = _tmp24_;
+#line 873 "book.c"
}
- _tmp25_ = prefix;
- _tmp26_ = i;
- _tmp27_ = suffix;
- _tmp28_ = g_strdup_printf ("%s-%d%s", _tmp25_, _tmp26_ + 1, _tmp27_);
+#line 116 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp25_ = book_get_n_pages (self);
+#line 116 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp26_ = g_strdup_printf ("%u", _tmp25_);
+#line 116 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp27_ = _tmp26_;
+#line 116 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp28_ = strlen (_tmp27_);
+#line 116 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp29_ = _tmp28_;
- _tmp30_ = g_file_new_for_uri (_tmp29_);
- _tmp31_ = _tmp30_;
- _g_free0 (_tmp29_);
- result = _tmp31_;
+#line 116 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp30_ = _tmp29_;
+#line 116 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp27_);
+#line 116 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ width = _tmp30_;
+#line 117 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp31_ = width;
+#line 117 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp32_ = g_strdup_printf ("%%0%dd", _tmp31_);
+#line 117 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ number_format = _tmp32_;
+#line 118 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp33_ = prefix;
+#line 118 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp34_ = g_strconcat (_tmp33_, "-", NULL);
+#line 118 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp35_ = _tmp34_;
+#line 118 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp36_ = number_format;
+#line 118 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp37_ = i;
+#line 118 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp38_ = g_strdup_printf (_tmp36_, _tmp37_ + 1);
+#line 118 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp39_ = _tmp38_;
+#line 118 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp40_ = g_strconcat (_tmp35_, _tmp39_, NULL);
+#line 118 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp41_ = _tmp40_;
+#line 118 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp42_ = suffix;
+#line 118 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp43_ = g_strconcat (_tmp41_, _tmp42_, NULL);
+#line 118 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp44_ = _tmp43_;
+#line 118 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp41_);
+#line 118 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp39_);
+#line 118 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp35_);
+#line 118 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ filename = _tmp44_;
+#line 119 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp45_ = filename;
+#line 119 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp46_ = g_file_new_for_uri (_tmp45_);
+#line 119 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ result = _tmp46_;
+#line 119 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (filename);
+#line 119 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (number_format);
+#line 119 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (suffix);
+#line 119 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (prefix);
+#line 119 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (basename);
+#line 119 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
+#line 947 "book.c"
}
-static void book_save_multi_file (Book* self, const gchar* type, GFile* file, GError** error) {
+static void book_save_multi_file (Book* self, const gchar* type, gint quality, GFile* file, GError** error) {
GError * _inner_error_ = NULL;
+#line 122 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (self != NULL);
+#line 122 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (type != NULL);
+#line 122 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (file != NULL);
+#line 959 "book.c"
{
gint i;
+#line 124 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
i = 0;
+#line 964 "book.c"
{
gboolean _tmp0_;
+#line 124 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = TRUE;
+#line 124 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
while (TRUE) {
+#line 971 "book.c"
gboolean _tmp1_;
gint _tmp3_;
guint _tmp4_ = 0U;
@@ -669,47 +976,85 @@ static void book_save_multi_file (Book* self, const gchar* type, GFile* file, GE
Page* page;
Page* _tmp7_;
const gchar* _tmp8_;
- GFile* _tmp9_;
- gchar* _tmp10_ = NULL;
- gchar* _tmp11_;
- gint _tmp12_;
- GFile* _tmp13_ = NULL;
- GFile* _tmp14_;
- gint _tmp15_;
+ gint _tmp9_;
+ GFile* _tmp10_;
+ gchar* _tmp11_ = NULL;
+ gchar* _tmp12_;
+ gint _tmp13_;
+ GFile* _tmp14_ = NULL;
+ GFile* _tmp15_;
+ gint _tmp16_;
+#line 124 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = _tmp0_;
+#line 124 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!_tmp1_) {
+#line 992 "book.c"
gint _tmp2_;
+#line 124 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = i;
+#line 124 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
i = _tmp2_ + 1;
+#line 998 "book.c"
}
+#line 124 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = FALSE;
+#line 124 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = i;
+#line 124 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = book_get_n_pages (self);
+#line 124 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!(((guint) _tmp3_) < _tmp4_)) {
+#line 124 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
+#line 1010 "book.c"
}
+#line 126 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5_ = i;
+#line 126 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp6_ = book_get_page (self, _tmp5_);
+#line 126 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
page = _tmp6_;
+#line 127 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp7_ = page;
+#line 127 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp8_ = type;
- _tmp9_ = file;
- _tmp10_ = g_file_get_uri (_tmp9_);
- _tmp11_ = _tmp10_;
- _tmp12_ = i;
- _tmp13_ = book_make_indexed_file (self, _tmp11_, _tmp12_);
- _tmp14_ = _tmp13_;
- page_save (_tmp7_, _tmp8_, _tmp14_, &_inner_error_);
- _g_object_unref0 (_tmp14_);
- _g_free0 (_tmp11_);
+#line 127 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp9_ = quality;
+#line 127 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp10_ = file;
+#line 127 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp11_ = g_file_get_uri (_tmp10_);
+#line 127 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp12_ = _tmp11_;
+#line 127 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp13_ = i;
+#line 127 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp14_ = book_make_indexed_file (self, _tmp12_, _tmp13_);
+#line 127 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp15_ = _tmp14_;
+#line 127 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ page_save (_tmp7_, _tmp8_, _tmp9_, _tmp15_, &_inner_error_);
+#line 127 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_object_unref0 (_tmp15_);
+#line 127 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp12_);
+#line 127 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_inner_error_ != NULL) {
+#line 127 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_propagate_error (error, _inner_error_);
+#line 127 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_page_unref0 (page);
+#line 127 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return;
+#line 1050 "book.c"
}
- _tmp15_ = i;
- g_signal_emit_by_name (self, "saving", _tmp15_);
+#line 128 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp16_ = i;
+#line 128 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ g_signal_emit_by_name (self, "saving", _tmp16_);
+#line 124 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_page_unref0 (page);
+#line 1058 "book.c"
}
}
}
@@ -724,26 +1069,44 @@ static void book_save_ps_pdf_surface (Book* self, cairo_surface_t* surface, GdkP
gdouble _tmp3_;
GdkPixbuf* _tmp4_;
cairo_pattern_t* _tmp5_ = NULL;
+#line 132 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (self != NULL);
+#line 132 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (surface != NULL);
+#line 132 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (image != NULL);
+#line 134 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = surface;
+#line 134 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = cairo_create (_tmp0_);
+#line 134 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
context = _tmp1_;
+#line 135 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = dpi;
+#line 135 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = dpi;
+#line 135 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
cairo_scale (context, 72.0 / _tmp2_, 72.0 / _tmp3_);
+#line 136 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = image;
+#line 136 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
gdk_cairo_set_source_pixbuf (context, _tmp4_, (gdouble) 0, (gdouble) 0);
+#line 137 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5_ = cairo_get_source (context);
+#line 137 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
cairo_pattern_set_filter (_tmp5_, CAIRO_FILTER_BEST);
+#line 138 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
cairo_paint (context);
+#line 132 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_cairo_destroy0 (context);
+#line 1103 "book.c"
}
static gpointer _cairo_surface_reference0 (gpointer self) {
+#line 145 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return self ? cairo_surface_reference (self) : NULL;
+#line 1110 "book.c"
}
@@ -758,28 +1121,49 @@ static void book_save_ps (Book* self, GFile* file, GError** error) {
cairo_surface_t* _tmp5_;
cairo_surface_t* surface;
GError * _inner_error_ = NULL;
+#line 141 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (self != NULL);
+#line 141 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (file != NULL);
+#line 143 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = file;
+#line 143 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = g_file_replace (_tmp0_, NULL, FALSE, G_FILE_CREATE_NONE, NULL, &_inner_error_);
+#line 143 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
stream = _tmp1_;
+#line 143 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_inner_error_ != NULL) {
+#line 143 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_propagate_error (error, _inner_error_);
+#line 143 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return;
+#line 1141 "book.c"
}
+#line 144 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = ps_writer_new (stream);
+#line 144 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
writer = _tmp2_;
+#line 145 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = writer;
+#line 145 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = _tmp3_->surface;
+#line 145 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5_ = _cairo_surface_reference0 (_tmp4_);
+#line 145 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
surface = _tmp5_;
+#line 1155 "book.c"
{
gint i;
+#line 147 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
i = 0;
+#line 1160 "book.c"
{
gboolean _tmp6_;
+#line 147 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp6_ = TRUE;
+#line 147 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
while (TRUE) {
+#line 1167 "book.c"
gboolean _tmp7_;
gint _tmp9_;
guint _tmp10_ = 0U;
@@ -808,55 +1192,103 @@ static void book_save_ps (Book* self, GFile* file, GError** error) {
gint _tmp29_ = 0;
cairo_surface_t* _tmp30_;
gint _tmp31_;
+#line 147 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp7_ = _tmp6_;
+#line 147 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!_tmp7_) {
+#line 1200 "book.c"
gint _tmp8_;
+#line 147 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp8_ = i;
+#line 147 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
i = _tmp8_ + 1;
+#line 1206 "book.c"
}
+#line 147 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp6_ = FALSE;
+#line 147 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp9_ = i;
+#line 147 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp10_ = book_get_n_pages (self);
+#line 147 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!(((guint) _tmp9_) < _tmp10_)) {
+#line 147 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
+#line 1218 "book.c"
}
+#line 149 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp11_ = i;
+#line 149 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp12_ = book_get_page (self, _tmp11_);
+#line 149 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
page = _tmp12_;
+#line 150 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp13_ = page;
+#line 150 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp14_ = page_get_image (_tmp13_, TRUE);
+#line 150 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
image = _tmp14_;
+#line 151 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp15_ = image;
+#line 151 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp16_ = gdk_pixbuf_get_width (_tmp15_);
+#line 151 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp17_ = page;
+#line 151 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp18_ = page_get_dpi (_tmp17_);
+#line 151 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
width = (_tmp16_ * 72.0) / _tmp18_;
+#line 152 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp19_ = image;
+#line 152 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp20_ = gdk_pixbuf_get_height (_tmp19_);
+#line 152 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp21_ = page;
+#line 152 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp22_ = page_get_dpi (_tmp21_);
+#line 152 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
height = (_tmp20_ * 72.0) / _tmp22_;
+#line 153 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp23_ = surface;
+#line 153 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp24_ = width;
+#line 153 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp25_ = height;
+#line 153 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
cairo_ps_surface_set_size (_tmp23_, _tmp24_, _tmp25_);
+#line 154 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp26_ = surface;
+#line 154 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp27_ = image;
+#line 154 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp28_ = page;
+#line 154 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp29_ = page_get_dpi (_tmp28_);
+#line 154 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_save_ps_pdf_surface (self, _tmp26_, _tmp27_, (gdouble) _tmp29_);
+#line 155 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp30_ = surface;
+#line 155 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
cairo_surface_show_page (_tmp30_);
+#line 156 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp31_ = i;
+#line 156 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_emit_by_name (self, "saving", _tmp31_);
+#line 147 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_object_unref0 (image);
+#line 147 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_page_unref0 (page);
+#line 1282 "book.c"
}
}
}
+#line 141 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_cairo_surface_destroy0 (surface);
+#line 141 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_ps_writer_unref0 (writer);
+#line 141 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_object_unref0 (stream);
+#line 1292 "book.c"
}
@@ -884,266 +1316,360 @@ static guint8* book_compress_zlib (Book* self, guint8* data, int data_length1, i
gint _tmp14_ = 0;
guint8* _tmp15_;
gint _tmp15__length1;
+#line 160 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (self != NULL, NULL);
+#line 162 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
deflateInit (&stream, (gint) Z_BEST_COMPRESSION);
+#line 163 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = data;
+#line 163 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0__length1 = data_length1;
+#line 163 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = g_new0 (guint8, _tmp0__length1);
+#line 163 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
out_data = _tmp1_;
+#line 163 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
out_data_length1 = _tmp0__length1;
+#line 163 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_out_data_size_ = out_data_length1;
+#line 165 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = data;
+#line 165 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2__length1 = data_length1;
+#line 165 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
stream.next_in = _tmp2_;
+#line 165 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
stream.avail_in = _tmp2__length1;
+#line 166 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = out_data;
+#line 166 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3__length1 = out_data_length1;
+#line 166 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
stream.next_out = _tmp3_;
+#line 166 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
stream.avail_out = _tmp3__length1;
+#line 167 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
while (TRUE) {
+#line 1354 "book.c"
z_stream _tmp4_;
guint _tmp5_;
gint _tmp6_ = 0;
+#line 167 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = stream;
+#line 167 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5_ = _tmp4_.avail_in;
+#line 167 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!(_tmp5_ > ((guint) 0))) {
+#line 167 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
+#line 1366 "book.c"
}
+#line 169 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp6_ = deflate (&stream, (gint) Z_FINISH);
+#line 169 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp6_ == ((gint) Z_STREAM_ERROR)) {
+#line 170 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
+#line 1374 "book.c"
}
}
+#line 173 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp7_ = stream;
+#line 173 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp8_ = _tmp7_.avail_in;
+#line 173 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp8_ > ((guint) 0)) {
+#line 1383 "book.c"
guint8* _tmp9_;
gint _tmp9__length1;
+#line 174 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp9_ = NULL;
+#line 174 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp9__length1 = 0;
+#line 174 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (result_length1) {
+#line 174 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
*result_length1 = _tmp9__length1;
+#line 1394 "book.c"
}
+#line 174 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
result = _tmp9_;
+#line 174 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
out_data = (g_free (out_data), NULL);
+#line 174 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
deflateEnd (&stream);
+#line 174 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
+#line 1404 "book.c"
}
+#line 176 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp10_ = data;
+#line 176 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp10__length1 = data_length1;
+#line 176 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp11_ = stream;
+#line 176 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp12_ = _tmp11_.avail_out;
+#line 176 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
n_written = _tmp10__length1 - _tmp12_;
+#line 177 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp13_ = n_written;
+#line 177 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp14_ = (gint) _tmp13_;
+#line 177 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
out_data = g_renew (guint8, out_data, (gint) _tmp13_);
+#line 177 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
(_tmp14_ > out_data_length1) ? memset (out_data + out_data_length1, 0, sizeof (guint8) * (_tmp14_ - out_data_length1)) : NULL;
+#line 177 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
out_data_length1 = _tmp14_;
+#line 177 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_out_data_size_ = _tmp14_;
+#line 179 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp15_ = out_data;
+#line 179 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp15__length1 = out_data_length1;
+#line 179 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (result_length1) {
+#line 179 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
*result_length1 = _tmp15__length1;
+#line 1436 "book.c"
}
+#line 179 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
result = _tmp15_;
+#line 179 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
deflateEnd (&stream);
+#line 179 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
+#line 1444 "book.c"
}
-static void book_jpeg_init_cb (struct jpeg_compress_struct* info) {
- g_return_if_fail (info != NULL);
-}
-
-
-static gboolean book_jpeg_empty_cb (struct jpeg_compress_struct* info) {
- gboolean result = FALSE;
- g_return_val_if_fail (info != NULL, FALSE);
- result = TRUE;
- return result;
-}
-
-
-static void book_jpeg_term_cb (struct jpeg_compress_struct* info) {
- g_return_if_fail (info != NULL);
-}
-
-
-static void _book_jpeg_init_cb_jpeg_initdestinationfunc (struct jpeg_compress_struct* cinfo) {
- book_jpeg_init_cb (cinfo);
-}
-
-
-static gboolean _book_jpeg_empty_cb_jpeg_emptyoutputbufferfunc (struct jpeg_compress_struct* cinfo) {
+static gboolean _book_write_pixbuf_data_gdk_pixbuf_save_func (guint8* buf, gsize buf_length1, GError** error, gpointer self) {
gboolean result;
- result = book_jpeg_empty_cb (cinfo);
+ result = book_write_pixbuf_data (self, buf, buf_length1, error);
+#line 191 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
+#line 1453 "book.c"
}
-static void _book_jpeg_term_cb_jpeg_termdestinationfunc (struct jpeg_compress_struct* cinfo) {
- book_jpeg_term_cb (cinfo);
-}
-
-
-static guint8* book_compress_jpeg (Book* self, GdkPixbuf* image, gsize* n_written, int* result_length1) {
- gsize _vala_n_written = 0UL;
+static guint8* book_compress_jpeg (Book* self, GdkPixbuf* image, gint quality, gint dpi, int* result_length1) {
guint8* result = NULL;
- struct jpeg_compress_struct info = {0};
- struct jpeg_error_mgr jerr = {0};
- struct jpeg_destination_mgr dest_mgr = {0};
- struct jpeg_error_mgr* _tmp0_ = NULL;
- GdkPixbuf* _tmp1_;
- gint _tmp2_ = 0;
- GdkPixbuf* _tmp3_;
- gint _tmp4_ = 0;
- struct jpeg_compress_struct _tmp5_;
+ GByteArray* _tmp0_;
+ gchar* _tmp1_;
+ gchar* _tmp2_;
+ gchar* _tmp3_;
+ gchar* _tmp4_;
+ gchar** _tmp5_ = NULL;
+ gchar** keys;
+ gint keys_length1;
+ gint _keys_size_;
gint _tmp6_;
- struct jpeg_compress_struct _tmp7_;
- gint _tmp8_;
- struct jpeg_compress_struct _tmp9_;
- gint _tmp10_;
- gint max_length;
+ gchar* _tmp7_ = NULL;
+ gchar* _tmp8_;
+ gint _tmp9_;
+ gchar* _tmp10_ = NULL;
gint _tmp11_;
- guint8* _tmp12_ = NULL;
+ gchar* _tmp12_ = NULL;
+ gchar** _tmp13_ = NULL;
+ gchar** values;
+ gint values_length1;
+ gint _values_size_;
+ GByteArray* _tmp15_;
+ guint8* _tmp16_;
+ gint _tmp16__length1;
guint8* data;
gint data_length1;
gint _data_size_;
- guint8* _tmp13_;
- gint _tmp13__length1;
- gint _tmp14_;
- GdkPixbuf* _tmp15_;
- guint8* _tmp16_ = NULL;
- guint8* pixels;
- gint pixels_length1;
- gint _pixels_size_;
- gint _tmp28_;
- struct jpeg_destination_mgr _tmp29_;
- gint _tmp30_;
- gint _tmp31_ = 0;
- guint8* _tmp32_;
- gint _tmp32__length1;
+ guint8* _tmp17_;
+ gint _tmp17__length1;
+ GError * _inner_error_ = NULL;
+#line 184 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (self != NULL, NULL);
+#line 184 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (image != NULL, NULL);
- memset (&info, 0, sizeof (struct jpeg_compress_struct));
- memset (&jerr, 0, sizeof (struct jpeg_error_mgr));
- memset (&dest_mgr, 0, sizeof (struct jpeg_destination_mgr));
- _tmp0_ = jpeg_std_error (&jerr);
- info.err = _tmp0_;
- jpeg_create_compress (&info);
- _tmp1_ = image;
- _tmp2_ = gdk_pixbuf_get_width (_tmp1_);
- info.image_width = _tmp2_;
- _tmp3_ = image;
- _tmp4_ = gdk_pixbuf_get_height (_tmp3_);
- info.image_height = _tmp4_;
- info.input_components = 3;
- info.in_color_space = JCS_RGB;
- jpeg_set_defaults (&info);
- _tmp5_ = info;
- _tmp6_ = _tmp5_.image_width;
- _tmp7_ = info;
- _tmp8_ = _tmp7_.image_height;
- _tmp9_ = info;
- _tmp10_ = _tmp9_.input_components;
- max_length = (_tmp6_ * _tmp8_) * _tmp10_;
- _tmp11_ = max_length;
- _tmp12_ = g_new0 (guint8, _tmp11_);
- data = _tmp12_;
- data_length1 = _tmp11_;
- _data_size_ = data_length1;
- _tmp13_ = data;
- _tmp13__length1 = data_length1;
- dest_mgr.next_output_byte = _tmp13_;
- _tmp14_ = max_length;
- dest_mgr.free_in_buffer = _tmp14_;
- dest_mgr.init_destination = _book_jpeg_init_cb_jpeg_initdestinationfunc;
- dest_mgr.empty_output_buffer = _book_jpeg_empty_cb_jpeg_emptyoutputbufferfunc;
- dest_mgr.term_destination = _book_jpeg_term_cb_jpeg_termdestinationfunc;
- info.dest = &dest_mgr;
- jpeg_start_compress (&info, TRUE);
- _tmp15_ = image;
- _tmp16_ = gdk_pixbuf_get_pixels (_tmp15_);
- pixels = _tmp16_;
- pixels_length1 = -1;
- _pixels_size_ = pixels_length1;
+#line 186 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp0_ = g_byte_array_new ();
+#line 186 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_byte_array_unref0 (self->priv->jpeg_data);
+#line 186 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ self->priv->jpeg_data = _tmp0_;
+#line 187 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp1_ = g_strdup ("quality");
+#line 187 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp2_ = g_strdup ("density-unit");
+#line 187 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp3_ = g_strdup ("x-density");
+#line 187 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp4_ = g_strdup ("y-density");
+#line 187 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp5_ = g_new0 (gchar*, 5 + 1);
+#line 187 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp5_[0] = _tmp1_;
+#line 187 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp5_[1] = _tmp2_;
+#line 187 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp5_[2] = _tmp3_;
+#line 187 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp5_[3] = _tmp4_;
+#line 187 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp5_[4] = NULL;
+#line 187 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ keys = _tmp5_;
+#line 187 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ keys_length1 = 5;
+#line 187 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _keys_size_ = keys_length1;
+#line 188 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp6_ = quality;
+#line 188 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp7_ = g_strdup_printf ("%d", _tmp6_);
+#line 188 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp8_ = g_strdup ("dots-per-inch");
+#line 188 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp9_ = dpi;
+#line 188 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp10_ = g_strdup_printf ("%d", _tmp9_);
+#line 188 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp11_ = dpi;
+#line 188 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp12_ = g_strdup_printf ("%d", _tmp11_);
+#line 188 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp13_ = g_new0 (gchar*, 5 + 1);
+#line 188 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp13_[0] = _tmp7_;
+#line 188 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp13_[1] = _tmp8_;
+#line 188 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp13_[2] = _tmp10_;
+#line 188 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp13_[3] = _tmp12_;
+#line 188 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp13_[4] = NULL;
+#line 188 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ values = _tmp13_;
+#line 188 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ values_length1 = 5;
+#line 188 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _values_size_ = values_length1;
+#line 1556 "book.c"
{
- gint r;
- r = 0;
- {
- gboolean _tmp17_;
- _tmp17_ = TRUE;
- while (TRUE) {
- gboolean _tmp18_;
- gint _tmp20_;
- struct jpeg_compress_struct _tmp21_;
- gint _tmp22_;
- guint8* row[1] = {0};
- guint8* _tmp23_;
- gint _tmp23__length1;
- gint _tmp24_;
- GdkPixbuf* _tmp25_;
- gint _tmp26_ = 0;
- guint8* _tmp27_;
- _tmp18_ = _tmp17_;
- if (!_tmp18_) {
- gint _tmp19_;
- _tmp19_ = r;
- r = _tmp19_ + 1;
- }
- _tmp17_ = FALSE;
- _tmp20_ = r;
- _tmp21_ = info;
- _tmp22_ = _tmp21_.image_height;
- if (!(_tmp20_ < _tmp22_)) {
- break;
- }
- _tmp23_ = pixels;
- _tmp23__length1 = pixels_length1;
- _tmp24_ = r;
- _tmp25_ = image;
- _tmp26_ = gdk_pixbuf_get_rowstride (_tmp25_);
- row[0] = ((guint8*) _tmp23_) + (_tmp24_ * _tmp26_);
- _tmp27_ = row[0];
- jpeg_write_scanlines (&info, row, 1);
- }
+ GdkPixbuf* _tmp14_;
+#line 191 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp14_ = image;
+#line 191 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ gdk_pixbuf_save_to_callbackv (_tmp14_, _book_write_pixbuf_data_gdk_pixbuf_save_func, self, "jpeg", keys, values, &_inner_error_);
+#line 191 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ if (_inner_error_ != NULL) {
+#line 1565 "book.c"
+ goto __catch0_g_error;
}
}
- jpeg_finish_compress (&info);
- _tmp28_ = max_length;
- _tmp29_ = dest_mgr;
- _tmp30_ = _tmp29_.free_in_buffer;
- _vala_n_written = (gsize) (_tmp28_ - _tmp30_);
- _tmp31_ = (gint) _vala_n_written;
- data = g_renew (guint8, data, (gint) _vala_n_written);
- (_tmp31_ > data_length1) ? memset (data + data_length1, 0, sizeof (guint8) * (_tmp31_ - data_length1)) : NULL;
- data_length1 = _tmp31_;
- _data_size_ = _tmp31_;
- _tmp32_ = data;
- _tmp32__length1 = data_length1;
- if (result_length1) {
- *result_length1 = _tmp32__length1;
+ goto __finally0;
+ __catch0_g_error:
+ {
+ GError* e = NULL;
+#line 189 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ e = _inner_error_;
+#line 189 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _inner_error_ = NULL;
+#line 189 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_error_free0 (e);
+#line 1579 "book.c"
}
- result = _tmp32_;
- jpeg_destroy_compress (&info);
- if (n_written) {
- *n_written = _vala_n_written;
+ __finally0:
+#line 189 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ if (_inner_error_ != NULL) {
+#line 189 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ values = (_vala_array_free (values, values_length1, (GDestroyNotify) g_free), NULL);
+#line 189 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
+#line 189 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+#line 189 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ g_clear_error (&_inner_error_);
+#line 189 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ return NULL;
+#line 1594 "book.c"
}
+#line 196 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp15_ = self->priv->jpeg_data;
+#line 196 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp16_ = _tmp15_->data;
+#line 196 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp16__length1 = _tmp15_->len;
+#line 196 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp15_->data = NULL;
+#line 196 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ data = _tmp16_;
+#line 196 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ data_length1 = _tmp16__length1;
+#line 196 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _data_size_ = data_length1;
+#line 197 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_byte_array_unref0 (self->priv->jpeg_data);
+#line 197 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ self->priv->jpeg_data = NULL;
+#line 199 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp17_ = data;
+#line 199 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp17__length1 = data_length1;
+#line 199 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ if (result_length1) {
+#line 199 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ *result_length1 = _tmp17__length1;
+#line 1622 "book.c"
+ }
+#line 199 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ result = _tmp17_;
+#line 199 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ values = (_vala_array_free (values, values_length1, (GDestroyNotify) g_free), NULL);
+#line 199 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
+#line 199 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
+#line 1632 "book.c"
+}
+
+
+static gboolean book_write_pixbuf_data (Book* self, guint8* buf, int buf_length1, GError** error) {
+ gboolean result = FALSE;
+ GByteArray* _tmp0_;
+ guint8* _tmp1_;
+ gint _tmp1__length1;
+#line 202 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ g_return_val_if_fail (self != NULL, FALSE);
+#line 204 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp0_ = self->priv->jpeg_data;
+#line 204 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp1_ = buf;
+#line 204 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp1__length1 = buf_length1;
+#line 204 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ g_byte_array_append (_tmp0_, _tmp1_, _tmp1__length1);
+#line 205 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ result = TRUE;
+#line 205 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ return result;
+#line 1655 "book.c"
}
static guint8* _vala_array_dup1 (guint8* self, int length) {
+#line 404 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return g_memdup (self, length * sizeof (guint8));
+#line 1662 "book.c"
}
static guint8* _vala_array_dup2 (guint8* self, int length) {
+#line 411 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return g_memdup (self, length * sizeof (guint8));
+#line 1669 "book.c"
}
-static void book_save_pdf (Book* self, GFile* file, GError** error) {
+static void book_save_pdf (Book* self, GFile* file, gint quality, GError** error) {
GFile* _tmp0_;
GFileOutputStream* _tmp1_ = NULL;
GFileOutputStream* stream;
@@ -1184,118 +1710,179 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
gchar* _tmp43_;
PDFWriter* _tmp44_;
PDFWriter* _tmp45_;
- PDFWriter* _tmp350_;
- PDFWriter* _tmp351_;
- guint _tmp352_ = 0U;
- guint info_number;
+ PDFWriter* _tmp352_;
PDFWriter* _tmp353_;
- guint _tmp354_;
- gchar* _tmp355_ = NULL;
- gchar* _tmp356_;
- PDFWriter* _tmp357_;
- PDFWriter* _tmp358_;
- gchar* _tmp359_ = NULL;
- gchar* _tmp360_;
- PDFWriter* _tmp361_;
- PDFWriter* _tmp362_;
+ guint _tmp354_ = 0U;
+ guint info_number;
+ PDFWriter* _tmp355_;
+ guint _tmp356_;
+ gchar* _tmp357_ = NULL;
+ gchar* _tmp358_;
+ PDFWriter* _tmp359_;
+ PDFWriter* _tmp360_;
+ gchar* _tmp361_ = NULL;
+ gchar* _tmp362_;
PDFWriter* _tmp363_;
- gsize _tmp364_;
- gsize xref_offset;
+ PDFWriter* _tmp364_;
PDFWriter* _tmp365_;
- PDFWriter* _tmp366_;
+ gsize _tmp366_;
+ gsize xref_offset;
PDFWriter* _tmp367_;
- GList* _tmp368_;
- guint _tmp369_ = 0U;
- gchar* _tmp370_ = NULL;
- gchar* _tmp371_;
- PDFWriter* _tmp372_;
- GList* _tmp373_;
- PDFWriter* _tmp378_;
- PDFWriter* _tmp379_;
+ PDFWriter* _tmp368_;
+ PDFWriter* _tmp369_;
+ GList* _tmp370_;
+ guint _tmp371_ = 0U;
+ gchar* _tmp372_ = NULL;
+ gchar* _tmp373_;
+ PDFWriter* _tmp374_;
+ GList* _tmp375_;
PDFWriter* _tmp380_;
PDFWriter* _tmp381_;
- GList* _tmp382_;
- guint _tmp383_ = 0U;
- gchar* _tmp384_ = NULL;
- gchar* _tmp385_;
- PDFWriter* _tmp386_;
- guint _tmp387_;
- gchar* _tmp388_ = NULL;
- gchar* _tmp389_;
- PDFWriter* _tmp390_;
- guint _tmp391_;
- gchar* _tmp392_ = NULL;
- gchar* _tmp393_;
- PDFWriter* _tmp394_;
- PDFWriter* _tmp395_;
+ PDFWriter* _tmp382_;
+ PDFWriter* _tmp383_;
+ GList* _tmp384_;
+ guint _tmp385_ = 0U;
+ gchar* _tmp386_ = NULL;
+ gchar* _tmp387_;
+ PDFWriter* _tmp388_;
+ guint _tmp389_;
+ gchar* _tmp390_ = NULL;
+ gchar* _tmp391_;
+ PDFWriter* _tmp392_;
+ guint _tmp393_;
+ gchar* _tmp394_ = NULL;
+ gchar* _tmp395_;
PDFWriter* _tmp396_;
- gsize _tmp397_;
- gchar* _tmp398_ = NULL;
- gchar* _tmp399_;
- PDFWriter* _tmp400_;
+ PDFWriter* _tmp397_;
+ PDFWriter* _tmp398_;
+ gsize _tmp399_;
+ gchar* _tmp400_ = NULL;
+ gchar* _tmp401_;
+ PDFWriter* _tmp402_;
GError * _inner_error_ = NULL;
+#line 208 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (self != NULL);
+#line 208 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (file != NULL);
+#line 210 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = file;
+#line 210 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = g_file_replace (_tmp0_, NULL, FALSE, G_FILE_CREATE_NONE, NULL, &_inner_error_);
+#line 210 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
stream = _tmp1_;
+#line 210 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_inner_error_ != NULL) {
+#line 210 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_propagate_error (error, _inner_error_);
+#line 210 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return;
+#line 1780 "book.c"
}
+#line 211 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = pdf_writer_new (stream);
+#line 211 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
writer = _tmp2_;
+#line 214 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = writer;
+#line 214 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp3_, "%PDF-1.3\n");
+#line 217 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = writer;
+#line 217 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp4_, "%\xe2\xe3\xcf\xd3\n");
+#line 220 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5_ = writer;
+#line 220 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp6_ = pdf_writer_start_object (_tmp5_);
+#line 220 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
catalog_number = _tmp6_;
+#line 221 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp7_ = writer;
+#line 221 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp8_ = catalog_number;
+#line 221 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp9_ = g_strdup_printf ("%u 0 obj\n", _tmp8_);
+#line 221 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp10_ = _tmp9_;
+#line 221 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp7_, _tmp10_);
+#line 221 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp10_);
+#line 222 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp11_ = writer;
+#line 222 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp11_, "<<\n");
+#line 223 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp12_ = writer;
+#line 223 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp12_, "/Type /Catalog\n");
+#line 225 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp13_ = writer;
+#line 225 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp14_ = catalog_number;
+#line 225 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp15_ = g_strdup_printf ("/Pages %u 0 R\n", _tmp14_ + 1);
+#line 225 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp16_ = _tmp15_;
+#line 225 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp13_, _tmp16_);
+#line 225 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp16_);
+#line 226 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp17_ = writer;
+#line 226 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp17_, ">>\n");
+#line 227 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp18_ = writer;
+#line 227 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp18_, "endobj\n");
+#line 245 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp19_ = writer;
+#line 245 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp19_, "\n");
+#line 246 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp20_ = writer;
+#line 246 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp21_ = pdf_writer_start_object (_tmp20_);
+#line 246 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pages_number = _tmp21_;
+#line 247 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp22_ = writer;
+#line 247 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp23_ = pages_number;
+#line 247 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp24_ = g_strdup_printf ("%u 0 obj\n", _tmp23_);
+#line 247 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp25_ = _tmp24_;
+#line 247 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp22_, _tmp25_);
+#line 247 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp25_);
+#line 248 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp26_ = writer;
+#line 248 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp26_, "<<\n");
+#line 249 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp27_ = writer;
+#line 249 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp27_, "/Type /Pages\n");
+#line 250 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp28_ = writer;
+#line 250 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp28_, "/Kids [");
+#line 1874 "book.c"
{
gint i;
+#line 251 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
i = 0;
+#line 1879 "book.c"
{
gboolean _tmp29_;
+#line 251 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp29_ = TRUE;
+#line 251 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
while (TRUE) {
+#line 1886 "book.c"
gboolean _tmp30_;
gint _tmp32_;
guint _tmp33_ = 0U;
@@ -1304,47 +1891,85 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
gint _tmp36_;
gchar* _tmp37_ = NULL;
gchar* _tmp38_;
+#line 251 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp30_ = _tmp29_;
+#line 251 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!_tmp30_) {
+#line 1899 "book.c"
gint _tmp31_;
+#line 251 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp31_ = i;
+#line 251 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
i = _tmp31_ + 1;
+#line 1905 "book.c"
}
+#line 251 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp29_ = FALSE;
+#line 251 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp32_ = i;
+#line 251 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp33_ = book_get_n_pages (self);
+#line 251 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!(((guint) _tmp32_) < _tmp33_)) {
+#line 251 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
+#line 1917 "book.c"
}
+#line 252 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp34_ = writer;
+#line 252 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp35_ = pages_number;
+#line 252 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp36_ = i;
+#line 252 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp37_ = g_strdup_printf (" %u 0 R", (_tmp35_ + 1) + (_tmp36_ * 3));
+#line 252 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp38_ = _tmp37_;
+#line 252 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp34_, _tmp38_);
+#line 252 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp38_);
+#line 1933 "book.c"
}
}
}
+#line 253 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp39_ = writer;
+#line 253 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp39_, " ]\n");
+#line 254 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp40_ = writer;
+#line 254 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp41_ = book_get_n_pages (self);
+#line 254 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp42_ = g_strdup_printf ("/Count %u\n", _tmp41_);
+#line 254 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp43_ = _tmp42_;
+#line 254 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp40_, _tmp43_);
+#line 254 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (_tmp43_);
+#line 255 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp44_ = writer;
+#line 255 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp44_, ">>\n");
+#line 256 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp45_ = writer;
+#line 256 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write_string (_tmp45_, "endobj\n");
+#line 1961 "book.c"
{
gint i;
+#line 258 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
i = 0;
+#line 1966 "book.c"
{
gboolean _tmp46_;
+#line 258 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp46_ = TRUE;
+#line 258 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
while (TRUE) {
+#line 1973 "book.c"
gboolean _tmp47_;
gint _tmp49_;
guint _tmp50_ = 0U;
@@ -1399,193 +2024,265 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
gint _compressed_data_size_;
guint8* _tmp230_;
gint _tmp230__length1;
- PDFWriter* _tmp245_;
- PDFWriter* _tmp246_;
- guint _tmp247_ = 0U;
- guint number;
+ PDFWriter* _tmp247_;
PDFWriter* _tmp248_;
- guint _tmp249_;
- gchar* _tmp250_ = NULL;
- gchar* _tmp251_;
- PDFWriter* _tmp252_;
- PDFWriter* _tmp253_;
+ guint _tmp249_ = 0U;
+ guint number;
+ PDFWriter* _tmp250_;
+ guint _tmp251_;
+ gchar* _tmp252_ = NULL;
+ gchar* _tmp253_;
PDFWriter* _tmp254_;
- guint _tmp255_;
- gchar* _tmp256_ = NULL;
- gchar* _tmp257_;
- PDFWriter* _tmp258_;
- gint _tmp259_;
- guint _tmp260_;
- gchar* _tmp261_ = NULL;
- gchar* _tmp262_;
- PDFWriter* _tmp263_;
- gdouble _tmp264_;
- gchar* _tmp265_;
- gint _tmp265__length1;
- const gchar* _tmp266_ = NULL;
- gdouble _tmp267_;
- gchar* _tmp268_;
- gint _tmp268__length1;
- const gchar* _tmp269_ = NULL;
- gchar* _tmp270_ = NULL;
- gchar* _tmp271_;
- PDFWriter* _tmp272_;
- guint _tmp273_;
- gchar* _tmp274_ = NULL;
- gchar* _tmp275_;
- PDFWriter* _tmp276_;
- PDFWriter* _tmp277_;
+ PDFWriter* _tmp255_;
+ PDFWriter* _tmp256_;
+ guint _tmp257_;
+ gchar* _tmp258_ = NULL;
+ gchar* _tmp259_;
+ PDFWriter* _tmp260_;
+ gint _tmp261_;
+ guint _tmp262_;
+ gchar* _tmp263_ = NULL;
+ gchar* _tmp264_;
+ PDFWriter* _tmp265_;
+ gdouble _tmp266_;
+ gchar* _tmp267_;
+ gint _tmp267__length1;
+ const gchar* _tmp268_ = NULL;
+ gdouble _tmp269_;
+ gchar* _tmp270_;
+ gint _tmp270__length1;
+ const gchar* _tmp271_ = NULL;
+ gchar* _tmp272_ = NULL;
+ gchar* _tmp273_;
+ PDFWriter* _tmp274_;
+ guint _tmp275_;
+ gchar* _tmp276_ = NULL;
+ gchar* _tmp277_;
PDFWriter* _tmp278_;
PDFWriter* _tmp279_;
- guint _tmp280_ = 0U;
+ PDFWriter* _tmp280_;
PDFWriter* _tmp281_;
- guint _tmp282_;
- gchar* _tmp283_ = NULL;
- gchar* _tmp284_;
- PDFWriter* _tmp285_;
- PDFWriter* _tmp286_;
+ guint _tmp282_ = 0U;
+ PDFWriter* _tmp283_;
+ guint _tmp284_;
+ gchar* _tmp285_ = NULL;
+ gchar* _tmp286_;
PDFWriter* _tmp287_;
PDFWriter* _tmp288_;
- gint _tmp289_;
- gchar* _tmp290_ = NULL;
- gchar* _tmp291_;
- PDFWriter* _tmp292_;
- gint _tmp293_;
- gchar* _tmp294_ = NULL;
- gchar* _tmp295_;
- PDFWriter* _tmp296_;
- const gchar* _tmp297_;
- gchar* _tmp298_ = NULL;
- gchar* _tmp299_;
- PDFWriter* _tmp300_;
- gint _tmp301_;
- gchar* _tmp302_ = NULL;
- gchar* _tmp303_;
- PDFWriter* _tmp304_;
- guint8* _tmp305_;
- gint _tmp305__length1;
- gchar* _tmp306_ = NULL;
- gchar* _tmp307_;
- const gchar* _tmp308_;
- PDFWriter* _tmp313_;
- PDFWriter* _tmp314_;
+ PDFWriter* _tmp289_;
+ PDFWriter* _tmp290_;
+ gint _tmp291_;
+ gchar* _tmp292_ = NULL;
+ gchar* _tmp293_;
+ PDFWriter* _tmp294_;
+ gint _tmp295_;
+ gchar* _tmp296_ = NULL;
+ gchar* _tmp297_;
+ PDFWriter* _tmp298_;
+ const gchar* _tmp299_;
+ gchar* _tmp300_ = NULL;
+ gchar* _tmp301_;
+ PDFWriter* _tmp302_;
+ gint _tmp303_;
+ gchar* _tmp304_ = NULL;
+ gchar* _tmp305_;
+ PDFWriter* _tmp306_;
+ guint8* _tmp307_;
+ gint _tmp307__length1;
+ gchar* _tmp308_ = NULL;
+ gchar* _tmp309_;
+ const gchar* _tmp310_;
PDFWriter* _tmp315_;
- guint8* _tmp316_;
- gint _tmp316__length1;
+ PDFWriter* _tmp316_;
PDFWriter* _tmp317_;
- PDFWriter* _tmp318_;
+ guint8* _tmp318_;
+ gint _tmp318__length1;
PDFWriter* _tmp319_;
- gdouble _tmp320_;
- gchar* _tmp321_;
- gint _tmp321__length1;
- const gchar* _tmp322_ = NULL;
- gdouble _tmp323_;
- gchar* _tmp324_;
- gint _tmp324__length1;
- const gchar* _tmp325_ = NULL;
- gint _tmp326_;
- gchar* _tmp327_ = NULL;
+ PDFWriter* _tmp320_;
+ PDFWriter* _tmp321_;
+ gdouble _tmp322_;
+ gchar* _tmp323_;
+ gint _tmp323__length1;
+ const gchar* _tmp324_ = NULL;
+ gdouble _tmp325_;
+ gchar* _tmp326_;
+ gint _tmp326__length1;
+ const gchar* _tmp327_ = NULL;
+ gint _tmp328_;
+ gchar* _tmp329_ = NULL;
gchar* command;
- PDFWriter* _tmp328_;
- PDFWriter* _tmp329_;
- guint _tmp330_ = 0U;
+ PDFWriter* _tmp330_;
PDFWriter* _tmp331_;
- guint _tmp332_;
- gchar* _tmp333_ = NULL;
- gchar* _tmp334_;
- PDFWriter* _tmp335_;
- PDFWriter* _tmp336_;
- const gchar* _tmp337_;
- gint _tmp338_;
- gint _tmp339_;
- gchar* _tmp340_ = NULL;
- gchar* _tmp341_;
- PDFWriter* _tmp342_;
- PDFWriter* _tmp343_;
+ guint _tmp332_ = 0U;
+ PDFWriter* _tmp333_;
+ guint _tmp334_;
+ gchar* _tmp335_ = NULL;
+ gchar* _tmp336_;
+ PDFWriter* _tmp337_;
+ PDFWriter* _tmp338_;
+ const gchar* _tmp339_;
+ gint _tmp340_;
+ gint _tmp341_;
+ gchar* _tmp342_ = NULL;
+ gchar* _tmp343_;
PDFWriter* _tmp344_;
- const gchar* _tmp345_;
+ PDFWriter* _tmp345_;
PDFWriter* _tmp346_;
- PDFWriter* _tmp347_;
+ const gchar* _tmp347_;
PDFWriter* _tmp348_;
- gint _tmp349_;
+ PDFWriter* _tmp349_;
+ PDFWriter* _tmp350_;
+ gint _tmp351_;
+#line 258 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp47_ = _tmp46_;
+#line 258 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!_tmp47_) {
+#line 2141 "book.c"
gint _tmp48_;
+#line 258 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp48_ = i;
+#line 258 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
i = _tmp48_ + 1;
+#line 2147 "book.c"
}
+#line 258 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp46_ = FALSE;
+#line 258 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp49_ = i;
+#line 258 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp50_ = book_get_n_pages (self);
+#line 258 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!(((guint) _tmp49_) < _tmp50_)) {
+#line 258 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
+#line 2159 "book.c"
}
+#line 260 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp51_ = i;
+#line 260 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp52_ = book_get_page (self, _tmp51_);
+#line 260 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
page = _tmp52_;
+#line 261 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp53_ = page;
+#line 261 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp54_ = page_get_image (_tmp53_, TRUE);
+#line 261 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
image = _tmp54_;
+#line 262 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp55_ = image;
+#line 262 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp56_ = gdk_pixbuf_get_width (_tmp55_);
+#line 262 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
width = _tmp56_;
+#line 263 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp57_ = image;
+#line 263 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp58_ = gdk_pixbuf_get_height (_tmp57_);
+#line 263 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
height = _tmp58_;
+#line 264 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp59_ = image;
+#line 264 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp60_ = gdk_pixbuf_get_pixels (_tmp59_);
+#line 264 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pixels = _tmp60_;
+#line 264 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pixels_length1 = -1;
+#line 264 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_pixels_size_ = pixels_length1;
+#line 265 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp61_ = width;
+#line 265 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp62_ = page;
+#line 265 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp63_ = page_get_dpi (_tmp62_);
+#line 265 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
page_width = (_tmp61_ * 72.0) / _tmp63_;
+#line 266 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp64_ = height;
+#line 266 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp65_ = page;
+#line 266 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp66_ = page_get_dpi (_tmp65_);
+#line 266 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
page_height = (_tmp64_ * 72.0) / _tmp66_;
+#line 268 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
depth = 8;
+#line 269 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp67_ = g_strdup ("DeviceRGB");
+#line 269 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
color_space = _tmp67_;
+#line 270 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
filter = NULL;
+#line 271 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp68_ = g_new0 (gchar, G_ASCII_DTOSTR_BUF_SIZE);
+#line 271 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
width_buffer = _tmp68_;
+#line 271 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
width_buffer_length1 = G_ASCII_DTOSTR_BUF_SIZE;
+#line 271 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_width_buffer_size_ = width_buffer_length1;
+#line 272 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp69_ = g_new0 (gchar, G_ASCII_DTOSTR_BUF_SIZE);
+#line 272 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
height_buffer = _tmp69_;
+#line 272 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
height_buffer_length1 = G_ASCII_DTOSTR_BUF_SIZE;
+#line 272 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_height_buffer_size_ = height_buffer_length1;
+#line 274 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp70_ = page;
+#line 274 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp71_ = page_is_color (_tmp70_);
+#line 274 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp71_) {
+#line 2241 "book.c"
gchar* _tmp72_;
gint _tmp73_;
gint _tmp74_;
gint data_length;
gint _tmp75_;
guint8* _tmp76_ = NULL;
+#line 276 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
depth = 8;
+#line 277 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp72_ = g_strdup ("DeviceRGB");
+#line 277 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (color_space);
+#line 277 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
color_space = _tmp72_;
+#line 278 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp73_ = height;
+#line 278 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp74_ = width;
+#line 278 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data_length = (_tmp73_ * _tmp74_) * 3;
+#line 279 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp75_ = data_length;
+#line 279 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp76_ = g_new0 (guint8, _tmp75_);
+#line 279 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data = (g_free (data), NULL);
+#line 279 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data = _tmp76_;
+#line 279 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data_length1 = _tmp75_;
+#line 279 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_data_size_ = data_length1;
+#line 2274 "book.c"
{
gint row;
+#line 280 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
row = 0;
+#line 2279 "book.c"
{
gboolean _tmp77_;
+#line 280 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp77_ = TRUE;
+#line 280 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
while (TRUE) {
+#line 2286 "book.c"
gboolean _tmp78_;
gint _tmp80_;
gint _tmp81_;
@@ -1596,32 +2293,57 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
gint _tmp85_;
gint _tmp86_;
gint out_offset;
+#line 280 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp78_ = _tmp77_;
+#line 280 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!_tmp78_) {
+#line 2301 "book.c"
gint _tmp79_;
+#line 280 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp79_ = row;
+#line 280 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
row = _tmp79_ + 1;
+#line 2307 "book.c"
}
+#line 280 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp77_ = FALSE;
+#line 280 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp80_ = row;
+#line 280 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp81_ = height;
+#line 280 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!(_tmp80_ < _tmp81_)) {
+#line 280 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
+#line 2319 "book.c"
}
+#line 282 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp82_ = row;
+#line 282 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp83_ = image;
+#line 282 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp84_ = gdk_pixbuf_get_rowstride (_tmp83_);
+#line 282 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
in_offset = _tmp82_ * _tmp84_;
+#line 283 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp85_ = row;
+#line 283 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp86_ = width;
+#line 283 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
out_offset = (_tmp85_ * _tmp86_) * 3;
+#line 2335 "book.c"
{
gint x;
+#line 284 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
x = 0;
+#line 2340 "book.c"
{
gboolean _tmp87_;
+#line 284 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp87_ = TRUE;
+#line 284 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
while (TRUE) {
+#line 2347 "book.c"
gboolean _tmp88_;
gint _tmp90_;
gint _tmp91_;
@@ -1655,51 +2377,97 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
gint _tmp111_;
guint8 _tmp112_;
guint8 _tmp113_;
+#line 284 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp88_ = _tmp87_;
+#line 284 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!_tmp88_) {
+#line 2385 "book.c"
gint _tmp89_;
+#line 284 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp89_ = x;
+#line 284 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
x = _tmp89_ + 1;
+#line 2391 "book.c"
}
+#line 284 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp87_ = FALSE;
+#line 284 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp90_ = x;
+#line 284 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp91_ = width;
+#line 284 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!(_tmp90_ < _tmp91_)) {
+#line 284 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
+#line 2403 "book.c"
}
+#line 286 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp92_ = in_offset;
+#line 286 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp93_ = x;
+#line 286 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
in_o = _tmp92_ + (_tmp93_ * 3);
+#line 287 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp94_ = out_offset;
+#line 287 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp95_ = x;
+#line 287 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
out_o = _tmp94_ + (_tmp95_ * 3);
+#line 289 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp96_ = data;
+#line 289 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp96__length1 = data_length1;
+#line 289 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp97_ = out_o;
+#line 289 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp98_ = pixels;
+#line 289 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp98__length1 = pixels_length1;
+#line 289 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp99_ = in_o;
+#line 289 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp100_ = _tmp98_[_tmp99_];
+#line 289 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp96_[_tmp97_] = _tmp100_;
+#line 289 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp101_ = _tmp96_[_tmp97_];
+#line 290 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp102_ = data;
+#line 290 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp102__length1 = data_length1;
+#line 290 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp103_ = out_o;
+#line 290 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp104_ = pixels;
+#line 290 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp104__length1 = pixels_length1;
+#line 290 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp105_ = in_o;
+#line 290 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp106_ = _tmp104_[_tmp105_ + 1];
+#line 290 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp102_[_tmp103_ + 1] = _tmp106_;
+#line 290 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp107_ = _tmp102_[_tmp103_ + 1];
+#line 291 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp108_ = data;
+#line 291 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp108__length1 = data_length1;
+#line 291 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp109_ = out_o;
+#line 291 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp110_ = pixels;
+#line 291 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp110__length1 = pixels_length1;
+#line 291 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp111_ = in_o;
+#line 291 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp112_ = _tmp110_[_tmp111_ + 2];
+#line 291 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp108_[_tmp109_ + 2] = _tmp112_;
+#line 291 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp113_ = _tmp108_[_tmp109_ + 2];
+#line 2471 "book.c"
}
}
}
@@ -1709,9 +2477,13 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
} else {
Page* _tmp114_;
gint _tmp115_ = 0;
+#line 295 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp114_ = page;
+#line 295 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp115_ = page_get_depth (_tmp114_);
+#line 295 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp115_ == 2) {
+#line 2487 "book.c"
gint shift_count;
gchar* _tmp116_;
gint _tmp117_;
@@ -1720,28 +2492,49 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
gint _tmp119_;
guint8* _tmp120_ = NULL;
gint offset;
+#line 297 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
shift_count = 6;
+#line 298 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
depth = 2;
+#line 299 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp116_ = g_strdup ("DeviceGray");
+#line 299 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (color_space);
+#line 299 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
color_space = _tmp116_;
+#line 300 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp117_ = height;
+#line 300 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp118_ = width;
+#line 300 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data_length = _tmp117_ * (((_tmp118_ * 2) + 7) / 8);
+#line 301 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp119_ = data_length;
+#line 301 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp120_ = g_new0 (guint8, _tmp119_);
+#line 301 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data = (g_free (data), NULL);
+#line 301 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data = _tmp120_;
+#line 301 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data_length1 = _tmp119_;
+#line 301 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_data_size_ = data_length1;
+#line 302 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
offset = 0;
+#line 2526 "book.c"
{
gint row;
+#line 303 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
row = 0;
+#line 2531 "book.c"
{
gboolean _tmp121_;
+#line 303 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp121_ = TRUE;
+#line 303 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
while (TRUE) {
+#line 2538 "book.c"
gboolean _tmp122_;
gint _tmp124_;
gint _tmp125_;
@@ -1750,36 +2543,65 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
GdkPixbuf* _tmp129_;
gint _tmp130_ = 0;
gint in_offset;
+#line 303 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp122_ = _tmp121_;
+#line 303 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!_tmp122_) {
+#line 2551 "book.c"
gint _tmp123_;
+#line 303 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp123_ = row;
+#line 303 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
row = _tmp123_ + 1;
+#line 2557 "book.c"
}
+#line 303 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp121_ = FALSE;
+#line 303 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp124_ = row;
+#line 303 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp125_ = height;
+#line 303 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!(_tmp124_ < _tmp125_)) {
+#line 303 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
+#line 2569 "book.c"
}
+#line 306 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp126_ = shift_count;
+#line 306 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp126_ != 6) {
+#line 2575 "book.c"
gint _tmp127_;
+#line 308 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp127_ = offset;
+#line 308 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
offset = _tmp127_ + 1;
+#line 309 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
shift_count = 6;
+#line 2583 "book.c"
}
+#line 312 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp128_ = row;
+#line 312 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp129_ = image;
+#line 312 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp130_ = gdk_pixbuf_get_rowstride (_tmp129_);
+#line 312 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
in_offset = _tmp128_ * _tmp130_;
+#line 2593 "book.c"
{
gint x;
+#line 313 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
x = 0;
+#line 2598 "book.c"
{
gboolean _tmp131_;
+#line 313 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp131_ = TRUE;
+#line 313 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
while (TRUE) {
+#line 2605 "book.c"
gboolean _tmp132_;
gint _tmp134_;
gint _tmp135_;
@@ -1792,92 +2614,159 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
guint8 p;
guint8 _tmp144_;
gint _tmp159_;
+#line 313 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp132_ = _tmp131_;
+#line 313 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!_tmp132_) {
+#line 2622 "book.c"
gint _tmp133_;
+#line 313 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp133_ = x;
+#line 313 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
x = _tmp133_ + 1;
+#line 2628 "book.c"
}
+#line 313 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp131_ = FALSE;
+#line 313 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp134_ = x;
+#line 313 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp135_ = width;
+#line 313 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!(_tmp134_ < _tmp135_)) {
+#line 313 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
+#line 2640 "book.c"
}
+#line 316 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp136_ = shift_count;
+#line 316 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp136_ == 6) {
+#line 2646 "book.c"
guint8* _tmp137_;
gint _tmp137__length1;
gint _tmp138_;
guint8 _tmp139_;
+#line 317 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp137_ = data;
+#line 317 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp137__length1 = data_length1;
+#line 317 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp138_ = offset;
+#line 317 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp137_[_tmp138_] = (guint8) 0;
+#line 317 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp139_ = _tmp137_[_tmp138_];
+#line 2661 "book.c"
}
+#line 320 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp140_ = pixels;
+#line 320 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp140__length1 = pixels_length1;
+#line 320 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp141_ = in_offset;
+#line 320 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp142_ = x;
+#line 320 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp143_ = _tmp140_[_tmp141_ + (_tmp142_ * 3)];
+#line 320 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
p = _tmp143_;
+#line 321 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp144_ = p;
+#line 321 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (((gint) _tmp144_) >= 192) {
+#line 2679 "book.c"
guint8* _tmp145_;
gint _tmp145__length1;
gint _tmp146_;
gint _tmp147_;
guint8 _tmp148_;
+#line 322 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp145_ = data;
+#line 322 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp145__length1 = data_length1;
+#line 322 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp146_ = offset;
+#line 322 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp147_ = shift_count;
+#line 322 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp145_[_tmp146_] |= (guint8) (3 << _tmp147_);
+#line 322 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp148_ = _tmp145_[_tmp146_];
+#line 2697 "book.c"
} else {
guint8 _tmp149_;
+#line 323 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp149_ = p;
+#line 323 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (((gint) _tmp149_) >= 128) {
+#line 2704 "book.c"
guint8* _tmp150_;
gint _tmp150__length1;
gint _tmp151_;
gint _tmp152_;
guint8 _tmp153_;
+#line 324 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp150_ = data;
+#line 324 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp150__length1 = data_length1;
+#line 324 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp151_ = offset;
+#line 324 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp152_ = shift_count;
+#line 324 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp150_[_tmp151_] |= (guint8) (2 << _tmp152_);
+#line 324 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp153_ = _tmp150_[_tmp151_];
+#line 2722 "book.c"
} else {
guint8 _tmp154_;
+#line 325 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp154_ = p;
+#line 325 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (((gint) _tmp154_) >= 64) {
+#line 2729 "book.c"
guint8* _tmp155_;
gint _tmp155__length1;
gint _tmp156_;
gint _tmp157_;
guint8 _tmp158_;
+#line 326 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp155_ = data;
+#line 326 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp155__length1 = data_length1;
+#line 326 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp156_ = offset;
+#line 326 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp157_ = shift_count;
+#line 326 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp155_[_tmp156_] |= (guint8) (1 << _tmp157_);
+#line 326 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp158_ = _tmp155_[_tmp156_];
+#line 2747 "book.c"
}
}
}
+#line 329 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp159_ = shift_count;
+#line 329 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp159_ == 0) {
+#line 2755 "book.c"
gint _tmp160_;
+#line 331 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp160_ = offset;
+#line 331 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
offset = _tmp160_ + 1;
+#line 332 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
shift_count = 6;
+#line 2763 "book.c"
} else {
gint _tmp161_;
+#line 335 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp161_ = shift_count;
+#line 335 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
shift_count = _tmp161_ - 2;
+#line 2770 "book.c"
}
}
}
@@ -1888,9 +2777,13 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
} else {
Page* _tmp162_;
gint _tmp163_ = 0;
+#line 339 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp162_ = page;
+#line 339 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp163_ = page_get_depth (_tmp162_);
+#line 339 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp163_ == 1) {
+#line 2787 "book.c"
gint mask;
gchar* _tmp164_;
gint _tmp165_;
@@ -1899,28 +2792,49 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
gint _tmp167_;
guint8* _tmp168_ = NULL;
gint offset;
+#line 341 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
mask = 0x80;
+#line 343 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
depth = 1;
+#line 344 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp164_ = g_strdup ("DeviceGray");
+#line 344 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (color_space);
+#line 344 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
color_space = _tmp164_;
+#line 345 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp165_ = height;
+#line 345 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp166_ = width;
+#line 345 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data_length = _tmp165_ * ((_tmp166_ + 7) / 8);
+#line 346 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp167_ = data_length;
+#line 346 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp168_ = g_new0 (guint8, _tmp167_);
+#line 346 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data = (g_free (data), NULL);
+#line 346 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data = _tmp168_;
+#line 346 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data_length1 = _tmp167_;
+#line 346 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_data_size_ = data_length1;
+#line 347 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
offset = 0;
+#line 2826 "book.c"
{
gint row;
+#line 348 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
row = 0;
+#line 2831 "book.c"
{
gboolean _tmp169_;
+#line 348 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp169_ = TRUE;
+#line 348 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
while (TRUE) {
+#line 2838 "book.c"
gboolean _tmp170_;
gint _tmp172_;
gint _tmp173_;
@@ -1929,36 +2843,65 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
GdkPixbuf* _tmp177_;
gint _tmp178_ = 0;
gint in_offset;
+#line 348 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp170_ = _tmp169_;
+#line 348 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!_tmp170_) {
+#line 2851 "book.c"
gint _tmp171_;
+#line 348 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp171_ = row;
+#line 348 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
row = _tmp171_ + 1;
+#line 2857 "book.c"
}
+#line 348 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp169_ = FALSE;
+#line 348 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp172_ = row;
+#line 348 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp173_ = height;
+#line 348 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!(_tmp172_ < _tmp173_)) {
+#line 348 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
+#line 2869 "book.c"
}
+#line 351 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp174_ = mask;
+#line 351 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp174_ != 0x80) {
+#line 2875 "book.c"
gint _tmp175_;
+#line 353 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp175_ = offset;
+#line 353 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
offset = _tmp175_ + 1;
+#line 354 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
mask = 0x80;
+#line 2883 "book.c"
}
+#line 357 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp176_ = row;
+#line 357 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp177_ = image;
+#line 357 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp178_ = gdk_pixbuf_get_rowstride (_tmp177_);
+#line 357 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
in_offset = _tmp176_ * _tmp178_;
+#line 2893 "book.c"
{
gint x;
+#line 358 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
x = 0;
+#line 2898 "book.c"
{
gboolean _tmp179_;
+#line 358 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp179_ = TRUE;
+#line 358 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
while (TRUE) {
+#line 2905 "book.c"
gboolean _tmp180_;
gint _tmp182_;
gint _tmp183_;
@@ -1970,56 +2913,100 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
guint8 _tmp191_;
gint _tmp196_;
gint _tmp197_;
+#line 358 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp180_ = _tmp179_;
+#line 358 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!_tmp180_) {
+#line 2921 "book.c"
gint _tmp181_;
+#line 358 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp181_ = x;
+#line 358 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
x = _tmp181_ + 1;
+#line 2927 "book.c"
}
+#line 358 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp179_ = FALSE;
+#line 358 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp182_ = x;
+#line 358 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp183_ = width;
+#line 358 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!(_tmp182_ < _tmp183_)) {
+#line 358 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
+#line 2939 "book.c"
}
+#line 361 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp184_ = mask;
+#line 361 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp184_ == 0x80) {
+#line 2945 "book.c"
guint8* _tmp185_;
gint _tmp185__length1;
gint _tmp186_;
guint8 _tmp187_;
+#line 362 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp185_ = data;
+#line 362 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp185__length1 = data_length1;
+#line 362 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp186_ = offset;
+#line 362 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp185_[_tmp186_] = (guint8) 0;
+#line 362 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp187_ = _tmp185_[_tmp186_];
+#line 2960 "book.c"
}
+#line 365 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp188_ = pixels;
+#line 365 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp188__length1 = pixels_length1;
+#line 365 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp189_ = in_offset;
+#line 365 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp190_ = x;
+#line 365 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp191_ = _tmp188_[_tmp189_ + (_tmp190_ * 3)];
+#line 365 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (((gint) _tmp191_) != 0) {
+#line 2974 "book.c"
guint8* _tmp192_;
gint _tmp192__length1;
gint _tmp193_;
gint _tmp194_;
guint8 _tmp195_;
+#line 366 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp192_ = data;
+#line 366 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp192__length1 = data_length1;
+#line 366 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp193_ = offset;
+#line 366 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp194_ = mask;
+#line 366 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp192_[_tmp193_] |= (guint8) _tmp194_;
+#line 366 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp195_ = _tmp192_[_tmp193_];
+#line 2992 "book.c"
}
+#line 369 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp196_ = mask;
+#line 369 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
mask = _tmp196_ >> 1;
+#line 370 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp197_ = mask;
+#line 370 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp197_ == 0) {
+#line 3002 "book.c"
gint _tmp198_;
+#line 372 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp198_ = offset;
+#line 372 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
offset = _tmp198_ + 1;
+#line 373 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
mask = 0x80;
+#line 3010 "book.c"
}
}
}
@@ -2034,26 +3021,45 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
gint data_length;
gint _tmp202_;
guint8* _tmp203_ = NULL;
+#line 380 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
depth = 8;
+#line 381 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp199_ = g_strdup ("DeviceGray");
+#line 381 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (color_space);
+#line 381 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
color_space = _tmp199_;
+#line 382 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp200_ = height;
+#line 382 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp201_ = width;
+#line 382 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data_length = _tmp200_ * _tmp201_;
+#line 383 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp202_ = data_length;
+#line 383 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp203_ = g_new0 (guint8, _tmp202_);
+#line 383 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data = (g_free (data), NULL);
+#line 383 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data = _tmp203_;
+#line 383 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data_length1 = _tmp202_;
+#line 383 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_data_size_ = data_length1;
+#line 3051 "book.c"
{
gint row;
+#line 384 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
row = 0;
+#line 3056 "book.c"
{
gboolean _tmp204_;
+#line 384 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp204_ = TRUE;
+#line 384 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
while (TRUE) {
+#line 3063 "book.c"
gboolean _tmp205_;
gint _tmp207_;
gint _tmp208_;
@@ -2064,32 +3070,57 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
gint _tmp212_;
gint _tmp213_;
gint out_offset;
+#line 384 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp205_ = _tmp204_;
+#line 384 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!_tmp205_) {
+#line 3078 "book.c"
gint _tmp206_;
+#line 384 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp206_ = row;
+#line 384 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
row = _tmp206_ + 1;
+#line 3084 "book.c"
}
+#line 384 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp204_ = FALSE;
+#line 384 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp207_ = row;
+#line 384 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp208_ = height;
+#line 384 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!(_tmp207_ < _tmp208_)) {
+#line 384 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
+#line 3096 "book.c"
}
+#line 386 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp209_ = row;
+#line 386 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp210_ = image;
+#line 386 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp211_ = gdk_pixbuf_get_rowstride (_tmp210_);
+#line 386 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
in_offset = _tmp209_ * _tmp211_;
+#line 387 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp212_ = row;
+#line 387 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp213_ = width;
+#line 387 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
out_offset = _tmp212_ * _tmp213_;
+#line 3112 "book.c"
{
gint x;
+#line 388 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
x = 0;
+#line 3117 "book.c"
{
gboolean _tmp214_;
+#line 388 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp214_ = TRUE;
+#line 388 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
while (TRUE) {
+#line 3124 "book.c"
gboolean _tmp215_;
gint _tmp217_;
gint _tmp218_;
@@ -2103,29 +3134,53 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
gint _tmp224_;
guint8 _tmp225_;
guint8 _tmp226_;
+#line 388 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp215_ = _tmp214_;
+#line 388 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!_tmp215_) {
+#line 3142 "book.c"
gint _tmp216_;
+#line 388 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp216_ = x;
+#line 388 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
x = _tmp216_ + 1;
+#line 3148 "book.c"
}
+#line 388 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp214_ = FALSE;
+#line 388 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp217_ = x;
+#line 388 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp218_ = width;
+#line 388 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!(_tmp217_ < _tmp218_)) {
+#line 388 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
+#line 3160 "book.c"
}
+#line 389 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp219_ = data;
+#line 389 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp219__length1 = data_length1;
+#line 389 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp220_ = out_offset;
+#line 389 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp221_ = x;
+#line 389 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp222_ = pixels;
+#line 389 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp222__length1 = pixels_length1;
+#line 389 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp223_ = in_offset;
+#line 389 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp224_ = x;
+#line 389 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp225_ = _tmp222_[_tmp223_ + (_tmp224_ * 3)];
+#line 389 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp219_[_tmp220_ + _tmp221_] = _tmp225_;
+#line 389 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp226_ = _tmp219_[_tmp220_ + _tmp221_];
+#line 3184 "book.c"
}
}
}
@@ -2135,421 +3190,801 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
}
}
}
+#line 394 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp227_ = data;
+#line 394 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp227__length1 = data_length1;
+#line 394 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp229_ = book_compress_zlib (self, _tmp227_, _tmp227__length1, &_tmp228_);
+#line 394 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
compressed_data = _tmp229_;
+#line 394 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
compressed_data_length1 = _tmp228_;
+#line 394 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_compressed_data_size_ = compressed_data_length1;
+#line 395 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp230_ = compressed_data;
+#line 395 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp230__length1 = compressed_data_length1;
+#line 395 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp230_ != NULL) {
+#line 3212 "book.c"
gint _tmp231_;
- const gchar* _tmp241_;
+ const gchar* _tmp243_;
+#line 398 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp231_ = depth;
+#line 398 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp231_ > 1) {
- gsize jpeg_length = 0UL;
+#line 3219 "book.c"
GdkPixbuf* _tmp232_;
- gsize _tmp233_ = 0UL;
- gint _tmp234_ = 0;
- guint8* _tmp235_ = NULL;
+ gint _tmp233_;
+ Page* _tmp234_;
+ gint _tmp235_ = 0;
+ gint _tmp236_ = 0;
+ guint8* _tmp237_ = NULL;
guint8* jpeg_data;
gint jpeg_data_length1;
gint _jpeg_data_size_;
- gsize _tmp236_;
- guint8* _tmp237_;
- gint _tmp237__length1;
+ guint8* _tmp238_;
+ gint _tmp238__length1;
+ guint8* _tmp239_;
+ gint _tmp239__length1;
+#line 400 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp232_ = image;
- _tmp235_ = book_compress_jpeg (self, _tmp232_, &_tmp233_, &_tmp234_);
- jpeg_length = _tmp233_;
- jpeg_data = _tmp235_;
- jpeg_data_length1 = _tmp234_;
+#line 400 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp233_ = quality;
+#line 400 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp234_ = page;
+#line 400 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp235_ = page_get_dpi (_tmp234_);
+#line 400 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp237_ = book_compress_jpeg (self, _tmp232_, _tmp233_, _tmp235_, &_tmp236_);
+#line 400 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ jpeg_data = _tmp237_;
+#line 400 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ jpeg_data_length1 = _tmp236_;
+#line 400 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_jpeg_data_size_ = jpeg_data_length1;
- _tmp236_ = jpeg_length;
- _tmp237_ = compressed_data;
- _tmp237__length1 = compressed_data_length1;
- if (_tmp236_ < ((gsize) _tmp237__length1)) {
- gchar* _tmp238_;
- guint8* _tmp239_;
- gint _tmp239__length1;
- guint8* _tmp240_;
- gint _tmp240__length1;
- _tmp238_ = g_strdup ("DCTDecode");
+#line 401 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp238_ = jpeg_data;
+#line 401 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp238__length1 = jpeg_data_length1;
+#line 401 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp239_ = compressed_data;
+#line 401 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp239__length1 = compressed_data_length1;
+#line 401 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ if (_tmp238__length1 < _tmp239__length1) {
+#line 3259 "book.c"
+ gchar* _tmp240_;
+ guint8* _tmp241_;
+ gint _tmp241__length1;
+ guint8* _tmp242_;
+ gint _tmp242__length1;
+#line 403 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp240_ = g_strdup ("DCTDecode");
+#line 403 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (filter);
- filter = _tmp238_;
- _tmp239_ = jpeg_data;
- _tmp239__length1 = jpeg_data_length1;
- _tmp240_ = (_tmp239_ != NULL) ? _vala_array_dup1 (_tmp239_, _tmp239__length1) : ((gpointer) _tmp239_);
- _tmp240__length1 = _tmp239__length1;
+#line 403 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ filter = _tmp240_;
+#line 404 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp241_ = jpeg_data;
+#line 404 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp241__length1 = jpeg_data_length1;
+#line 404 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp242_ = (_tmp241_ != NULL) ? _vala_array_dup1 (_tmp241_, _tmp241__length1) : ((gpointer) _tmp241_);
+#line 404 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp242__length1 = _tmp241__length1;
+#line 404 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data = (g_free (data), NULL);
- data = _tmp240_;
- data_length1 = _tmp240__length1;
+#line 404 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ data = _tmp242_;
+#line 404 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ data_length1 = _tmp242__length1;
+#line 404 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_data_size_ = data_length1;
+#line 3287 "book.c"
}
+#line 398 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
jpeg_data = (g_free (jpeg_data), NULL);
+#line 3291 "book.c"
}
- _tmp241_ = filter;
- if (_tmp241_ == NULL) {
- gchar* _tmp242_;
- guint8* _tmp243_;
- gint _tmp243__length1;
- guint8* _tmp244_;
- gint _tmp244__length1;
- _tmp242_ = g_strdup ("FlateDecode");
+#line 408 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp243_ = filter;
+#line 408 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ if (_tmp243_ == NULL) {
+#line 3297 "book.c"
+ gchar* _tmp244_;
+ guint8* _tmp245_;
+ gint _tmp245__length1;
+ guint8* _tmp246_;
+ gint _tmp246__length1;
+#line 410 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp244_ = g_strdup ("FlateDecode");
+#line 410 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (filter);
- filter = _tmp242_;
- _tmp243_ = compressed_data;
- _tmp243__length1 = compressed_data_length1;
- _tmp244_ = (_tmp243_ != NULL) ? _vala_array_dup2 (_tmp243_, _tmp243__length1) : ((gpointer) _tmp243_);
- _tmp244__length1 = _tmp243__length1;
+#line 410 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ filter = _tmp244_;
+#line 411 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp245_ = compressed_data;
+#line 411 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp245__length1 = compressed_data_length1;
+#line 411 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp246_ = (_tmp245_ != NULL) ? _vala_array_dup2 (_tmp245_, _tmp245__length1) : ((gpointer) _tmp245_);
+#line 411 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp246__length1 = _tmp245__length1;
+#line 411 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data = (g_free (data), NULL);
- data = _tmp244_;
- data_length1 = _tmp244__length1;
+#line 411 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ data = _tmp246_;
+#line 411 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ data_length1 = _tmp246__length1;
+#line 411 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_data_size_ = data_length1;
+#line 3325 "book.c"
}
}
- _tmp245_ = writer;
- pdf_writer_write_string (_tmp245_, "\n");
- _tmp246_ = writer;
- _tmp247_ = pdf_writer_start_object (_tmp246_);
- number = _tmp247_;
+#line 416 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp247_ = writer;
+#line 416 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp247_, "\n");
+#line 417 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp248_ = writer;
- _tmp249_ = number;
- _tmp250_ = g_strdup_printf ("%u 0 obj\n", _tmp249_);
- _tmp251_ = _tmp250_;
- pdf_writer_write_string (_tmp248_, _tmp251_);
- _g_free0 (_tmp251_);
- _tmp252_ = writer;
- pdf_writer_write_string (_tmp252_, "<<\n");
- _tmp253_ = writer;
- pdf_writer_write_string (_tmp253_, "/Type /Page\n");
+#line 417 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp249_ = pdf_writer_start_object (_tmp248_);
+#line 417 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ number = _tmp249_;
+#line 418 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp250_ = writer;
+#line 418 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp251_ = number;
+#line 418 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp252_ = g_strdup_printf ("%u 0 obj\n", _tmp251_);
+#line 418 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp253_ = _tmp252_;
+#line 418 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp250_, _tmp253_);
+#line 418 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp253_);
+#line 419 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp254_ = writer;
- _tmp255_ = pages_number;
- _tmp256_ = g_strdup_printf ("/Parent %u 0 R\n", _tmp255_);
- _tmp257_ = _tmp256_;
- pdf_writer_write_string (_tmp254_, _tmp257_);
- _g_free0 (_tmp257_);
- _tmp258_ = writer;
- _tmp259_ = i;
- _tmp260_ = number;
- _tmp261_ = g_strdup_printf ("/Resources << /XObject << /Im%d %u 0 R >> >>\n", _tmp259_, _tmp260_ + 1);
- _tmp262_ = _tmp261_;
- pdf_writer_write_string (_tmp258_, _tmp262_);
- _g_free0 (_tmp262_);
- _tmp263_ = writer;
- _tmp264_ = page_width;
- _tmp265_ = width_buffer;
- _tmp265__length1 = width_buffer_length1;
- _tmp266_ = g_ascii_formatd (_tmp265_, _tmp265__length1, "%.2f", _tmp264_);
- _tmp267_ = page_height;
- _tmp268_ = height_buffer;
- _tmp268__length1 = height_buffer_length1;
- _tmp269_ = g_ascii_formatd (_tmp268_, _tmp268__length1, "%.2f", _tmp267_);
- _tmp270_ = g_strdup_printf ("/MediaBox [ 0 0 %s %s ]\n", _tmp266_, _tmp269_);
- _tmp271_ = _tmp270_;
- pdf_writer_write_string (_tmp263_, _tmp271_);
- _g_free0 (_tmp271_);
- _tmp272_ = writer;
- _tmp273_ = number;
- _tmp274_ = g_strdup_printf ("/Contents %u 0 R\n", _tmp273_ + 2);
- _tmp275_ = _tmp274_;
- pdf_writer_write_string (_tmp272_, _tmp275_);
- _g_free0 (_tmp275_);
- _tmp276_ = writer;
- pdf_writer_write_string (_tmp276_, ">>\n");
- _tmp277_ = writer;
- pdf_writer_write_string (_tmp277_, "endobj\n");
+#line 419 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp254_, "<<\n");
+#line 420 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp255_ = writer;
+#line 420 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp255_, "/Type /Page\n");
+#line 421 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp256_ = writer;
+#line 421 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp257_ = pages_number;
+#line 421 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp258_ = g_strdup_printf ("/Parent %u 0 R\n", _tmp257_);
+#line 421 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp259_ = _tmp258_;
+#line 421 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp256_, _tmp259_);
+#line 421 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp259_);
+#line 422 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp260_ = writer;
+#line 422 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp261_ = i;
+#line 422 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp262_ = number;
+#line 422 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp263_ = g_strdup_printf ("/Resources << /XObject << /Im%d %u 0 R >> >>\n", _tmp261_, _tmp262_ + 1);
+#line 422 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp264_ = _tmp263_;
+#line 422 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp260_, _tmp264_);
+#line 422 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp264_);
+#line 423 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp265_ = writer;
+#line 423 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp266_ = page_width;
+#line 423 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp267_ = width_buffer;
+#line 423 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp267__length1 = width_buffer_length1;
+#line 423 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp268_ = g_ascii_formatd (_tmp267_, _tmp267__length1, "%.2f", _tmp266_);
+#line 423 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp269_ = page_height;
+#line 423 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp270_ = height_buffer;
+#line 423 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp270__length1 = height_buffer_length1;
+#line 423 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp271_ = g_ascii_formatd (_tmp270_, _tmp270__length1, "%.2f", _tmp269_);
+#line 423 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp272_ = g_strdup_printf ("/MediaBox [ 0 0 %s %s ]\n", _tmp268_, _tmp271_);
+#line 423 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp273_ = _tmp272_;
+#line 423 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp265_, _tmp273_);
+#line 423 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp273_);
+#line 424 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp274_ = writer;
+#line 424 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp275_ = number;
+#line 424 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp276_ = g_strdup_printf ("/Contents %u 0 R\n", _tmp275_ + 2);
+#line 424 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp277_ = _tmp276_;
+#line 424 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp274_, _tmp277_);
+#line 424 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp277_);
+#line 425 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp278_ = writer;
- pdf_writer_write_string (_tmp278_, "\n");
+#line 425 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp278_, ">>\n");
+#line 426 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp279_ = writer;
- _tmp280_ = pdf_writer_start_object (_tmp279_);
- number = _tmp280_;
+#line 426 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp279_, "endobj\n");
+#line 429 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp280_ = writer;
+#line 429 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp280_, "\n");
+#line 430 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp281_ = writer;
- _tmp282_ = number;
- _tmp283_ = g_strdup_printf ("%u 0 obj\n", _tmp282_);
- _tmp284_ = _tmp283_;
- pdf_writer_write_string (_tmp281_, _tmp284_);
- _g_free0 (_tmp284_);
- _tmp285_ = writer;
- pdf_writer_write_string (_tmp285_, "<<\n");
- _tmp286_ = writer;
- pdf_writer_write_string (_tmp286_, "/Type /XObject\n");
+#line 430 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp282_ = pdf_writer_start_object (_tmp281_);
+#line 430 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ number = _tmp282_;
+#line 431 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp283_ = writer;
+#line 431 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp284_ = number;
+#line 431 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp285_ = g_strdup_printf ("%u 0 obj\n", _tmp284_);
+#line 431 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp286_ = _tmp285_;
+#line 431 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp283_, _tmp286_);
+#line 431 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp286_);
+#line 432 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp287_ = writer;
- pdf_writer_write_string (_tmp287_, "/Subtype /Image\n");
+#line 432 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp287_, "<<\n");
+#line 433 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp288_ = writer;
- _tmp289_ = width;
- _tmp290_ = g_strdup_printf ("/Width %d\n", _tmp289_);
- _tmp291_ = _tmp290_;
- pdf_writer_write_string (_tmp288_, _tmp291_);
- _g_free0 (_tmp291_);
- _tmp292_ = writer;
- _tmp293_ = height;
- _tmp294_ = g_strdup_printf ("/Height %d\n", _tmp293_);
- _tmp295_ = _tmp294_;
- pdf_writer_write_string (_tmp292_, _tmp295_);
- _g_free0 (_tmp295_);
- _tmp296_ = writer;
- _tmp297_ = color_space;
- _tmp298_ = g_strdup_printf ("/ColorSpace /%s\n", _tmp297_);
- _tmp299_ = _tmp298_;
- pdf_writer_write_string (_tmp296_, _tmp299_);
- _g_free0 (_tmp299_);
- _tmp300_ = writer;
- _tmp301_ = depth;
- _tmp302_ = g_strdup_printf ("/BitsPerComponent %d\n", _tmp301_);
- _tmp303_ = _tmp302_;
- pdf_writer_write_string (_tmp300_, _tmp303_);
- _g_free0 (_tmp303_);
- _tmp304_ = writer;
- _tmp305_ = data;
- _tmp305__length1 = data_length1;
- _tmp306_ = g_strdup_printf ("/Length %d\n", _tmp305__length1);
- _tmp307_ = _tmp306_;
- pdf_writer_write_string (_tmp304_, _tmp307_);
- _g_free0 (_tmp307_);
- _tmp308_ = filter;
- if (_tmp308_ != NULL) {
- PDFWriter* _tmp309_;
- const gchar* _tmp310_;
- gchar* _tmp311_ = NULL;
- gchar* _tmp312_;
- _tmp309_ = writer;
- _tmp310_ = filter;
- _tmp311_ = g_strdup_printf ("/Filter /%s\n", _tmp310_);
- _tmp312_ = _tmp311_;
- pdf_writer_write_string (_tmp309_, _tmp312_);
- _g_free0 (_tmp312_);
+#line 433 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp288_, "/Type /XObject\n");
+#line 434 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp289_ = writer;
+#line 434 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp289_, "/Subtype /Image\n");
+#line 435 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp290_ = writer;
+#line 435 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp291_ = width;
+#line 435 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp292_ = g_strdup_printf ("/Width %d\n", _tmp291_);
+#line 435 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp293_ = _tmp292_;
+#line 435 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp290_, _tmp293_);
+#line 435 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp293_);
+#line 436 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp294_ = writer;
+#line 436 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp295_ = height;
+#line 436 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp296_ = g_strdup_printf ("/Height %d\n", _tmp295_);
+#line 436 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp297_ = _tmp296_;
+#line 436 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp294_, _tmp297_);
+#line 436 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp297_);
+#line 437 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp298_ = writer;
+#line 437 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp299_ = color_space;
+#line 437 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp300_ = g_strdup_printf ("/ColorSpace /%s\n", _tmp299_);
+#line 437 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp301_ = _tmp300_;
+#line 437 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp298_, _tmp301_);
+#line 437 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp301_);
+#line 438 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp302_ = writer;
+#line 438 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp303_ = depth;
+#line 438 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp304_ = g_strdup_printf ("/BitsPerComponent %d\n", _tmp303_);
+#line 438 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp305_ = _tmp304_;
+#line 438 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp302_, _tmp305_);
+#line 438 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp305_);
+#line 439 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp306_ = writer;
+#line 439 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp307_ = data;
+#line 439 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp307__length1 = data_length1;
+#line 439 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp308_ = g_strdup_printf ("/Length %d\n", _tmp307__length1);
+#line 439 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp309_ = _tmp308_;
+#line 439 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp306_, _tmp309_);
+#line 439 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp309_);
+#line 440 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp310_ = filter;
+#line 440 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ if (_tmp310_ != NULL) {
+#line 3530 "book.c"
+ PDFWriter* _tmp311_;
+ const gchar* _tmp312_;
+ gchar* _tmp313_ = NULL;
+ gchar* _tmp314_;
+#line 441 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp311_ = writer;
+#line 441 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp312_ = filter;
+#line 441 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp313_ = g_strdup_printf ("/Filter /%s\n", _tmp312_);
+#line 441 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp314_ = _tmp313_;
+#line 441 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp311_, _tmp314_);
+#line 441 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp314_);
+#line 3547 "book.c"
}
- _tmp313_ = writer;
- pdf_writer_write_string (_tmp313_, ">>\n");
- _tmp314_ = writer;
- pdf_writer_write_string (_tmp314_, "stream\n");
+#line 442 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp315_ = writer;
- _tmp316_ = data;
- _tmp316__length1 = data_length1;
- pdf_writer_write (_tmp315_, _tmp316_, _tmp316__length1);
+#line 442 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp315_, ">>\n");
+#line 443 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp316_ = writer;
+#line 443 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp316_, "stream\n");
+#line 444 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp317_ = writer;
- pdf_writer_write_string (_tmp317_, "\n");
- _tmp318_ = writer;
- pdf_writer_write_string (_tmp318_, "endstream\n");
+#line 444 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp318_ = data;
+#line 444 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp318__length1 = data_length1;
+#line 444 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write (_tmp317_, _tmp318_, _tmp318__length1);
+#line 445 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp319_ = writer;
- pdf_writer_write_string (_tmp319_, "endobj\n");
- _tmp320_ = page_width;
- _tmp321_ = width_buffer;
- _tmp321__length1 = width_buffer_length1;
- _tmp322_ = g_ascii_formatd (_tmp321_, _tmp321__length1, "%f", _tmp320_);
- _tmp323_ = page_height;
- _tmp324_ = height_buffer;
- _tmp324__length1 = height_buffer_length1;
- _tmp325_ = g_ascii_formatd (_tmp324_, _tmp324__length1, "%f", _tmp323_);
- _tmp326_ = i;
- _tmp327_ = g_strdup_printf ("q\n%s 0 0 %s 0 0 cm\n/Im%d Do\nQ", _tmp322_, _tmp325_, _tmp326_);
- command = _tmp327_;
- _tmp328_ = writer;
- pdf_writer_write_string (_tmp328_, "\n");
- _tmp329_ = writer;
- _tmp330_ = pdf_writer_start_object (_tmp329_);
- number = _tmp330_;
+#line 445 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp319_, "\n");
+#line 446 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp320_ = writer;
+#line 446 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp320_, "endstream\n");
+#line 447 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp321_ = writer;
+#line 447 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp321_, "endobj\n");
+#line 450 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp322_ = page_width;
+#line 450 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp323_ = width_buffer;
+#line 450 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp323__length1 = width_buffer_length1;
+#line 450 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp324_ = g_ascii_formatd (_tmp323_, _tmp323__length1, "%f", _tmp322_);
+#line 450 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp325_ = page_height;
+#line 450 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp326_ = height_buffer;
+#line 450 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp326__length1 = height_buffer_length1;
+#line 450 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp327_ = g_ascii_formatd (_tmp326_, _tmp326__length1, "%f", _tmp325_);
+#line 450 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp328_ = i;
+#line 450 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp329_ = g_strdup_printf ("q\n%s 0 0 %s 0 0 cm\n/Im%d Do\nQ", _tmp324_, _tmp327_, _tmp328_);
+#line 450 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ command = _tmp329_;
+#line 451 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp330_ = writer;
+#line 451 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp330_, "\n");
+#line 452 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp331_ = writer;
- _tmp332_ = number;
- _tmp333_ = g_strdup_printf ("%u 0 obj\n", _tmp332_);
- _tmp334_ = _tmp333_;
- pdf_writer_write_string (_tmp331_, _tmp334_);
- _g_free0 (_tmp334_);
- _tmp335_ = writer;
- pdf_writer_write_string (_tmp335_, "<<\n");
- _tmp336_ = writer;
- _tmp337_ = command;
- _tmp338_ = strlen (_tmp337_);
- _tmp339_ = _tmp338_;
- _tmp340_ = g_strdup_printf ("/Length %d\n", _tmp339_ + 1);
+#line 452 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp332_ = pdf_writer_start_object (_tmp331_);
+#line 452 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ number = _tmp332_;
+#line 453 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp333_ = writer;
+#line 453 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp334_ = number;
+#line 453 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp335_ = g_strdup_printf ("%u 0 obj\n", _tmp334_);
+#line 453 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp336_ = _tmp335_;
+#line 453 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp333_, _tmp336_);
+#line 453 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp336_);
+#line 454 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp337_ = writer;
+#line 454 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp337_, "<<\n");
+#line 455 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp338_ = writer;
+#line 455 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp339_ = command;
+#line 455 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp340_ = strlen (_tmp339_);
+#line 455 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp341_ = _tmp340_;
- pdf_writer_write_string (_tmp336_, _tmp341_);
- _g_free0 (_tmp341_);
- _tmp342_ = writer;
- pdf_writer_write_string (_tmp342_, ">>\n");
- _tmp343_ = writer;
- pdf_writer_write_string (_tmp343_, "stream\n");
+#line 455 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp342_ = g_strdup_printf ("/Length %d\n", _tmp341_ + 1);
+#line 455 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp343_ = _tmp342_;
+#line 455 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp338_, _tmp343_);
+#line 455 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp343_);
+#line 456 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp344_ = writer;
- _tmp345_ = command;
- pdf_writer_write_string (_tmp344_, _tmp345_);
+#line 456 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp344_, ">>\n");
+#line 457 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp345_ = writer;
+#line 457 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp345_, "stream\n");
+#line 458 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp346_ = writer;
- pdf_writer_write_string (_tmp346_, "\n");
- _tmp347_ = writer;
- pdf_writer_write_string (_tmp347_, "endstream\n");
+#line 458 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp347_ = command;
+#line 458 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp346_, _tmp347_);
+#line 459 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp348_ = writer;
- pdf_writer_write_string (_tmp348_, "endobj\n");
- _tmp349_ = i;
- g_signal_emit_by_name (self, "saving", _tmp349_);
+#line 459 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp348_, "\n");
+#line 460 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp349_ = writer;
+#line 460 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp349_, "endstream\n");
+#line 461 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp350_ = writer;
+#line 461 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp350_, "endobj\n");
+#line 463 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp351_ = i;
+#line 463 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ g_signal_emit_by_name (self, "saving", _tmp351_);
+#line 258 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (command);
+#line 258 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
compressed_data = (g_free (compressed_data), NULL);
+#line 258 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data = (g_free (data), NULL);
+#line 258 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
height_buffer = (g_free (height_buffer), NULL);
+#line 258 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
width_buffer = (g_free (width_buffer), NULL);
+#line 258 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (filter);
+#line 258 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_free0 (color_space);
+#line 258 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_object_unref0 (image);
+#line 258 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_page_unref0 (page);
+#line 3689 "book.c"
}
}
}
- _tmp350_ = writer;
- pdf_writer_write_string (_tmp350_, "\n");
- _tmp351_ = writer;
- _tmp352_ = pdf_writer_start_object (_tmp351_);
- info_number = _tmp352_;
+#line 467 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp352_ = writer;
+#line 467 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp352_, "\n");
+#line 468 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp353_ = writer;
- _tmp354_ = info_number;
- _tmp355_ = g_strdup_printf ("%u 0 obj\n", _tmp354_);
- _tmp356_ = _tmp355_;
- pdf_writer_write_string (_tmp353_, _tmp356_);
- _g_free0 (_tmp356_);
- _tmp357_ = writer;
- pdf_writer_write_string (_tmp357_, "<<\n");
- _tmp358_ = writer;
- _tmp359_ = g_strdup_printf ("/Creator (Simple Scan %s)\n", VERSION);
- _tmp360_ = _tmp359_;
- pdf_writer_write_string (_tmp358_, _tmp360_);
- _g_free0 (_tmp360_);
- _tmp361_ = writer;
- pdf_writer_write_string (_tmp361_, ">>\n");
- _tmp362_ = writer;
- pdf_writer_write_string (_tmp362_, "endobj\n");
+#line 468 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp354_ = pdf_writer_start_object (_tmp353_);
+#line 468 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ info_number = _tmp354_;
+#line 469 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp355_ = writer;
+#line 469 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp356_ = info_number;
+#line 469 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp357_ = g_strdup_printf ("%u 0 obj\n", _tmp356_);
+#line 469 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp358_ = _tmp357_;
+#line 469 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp355_, _tmp358_);
+#line 469 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp358_);
+#line 470 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp359_ = writer;
+#line 470 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp359_, "<<\n");
+#line 471 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp360_ = writer;
+#line 471 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp361_ = g_strdup_printf ("/Creator (Simple Scan %s)\n", VERSION);
+#line 471 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp362_ = _tmp361_;
+#line 471 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp360_, _tmp362_);
+#line 471 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp362_);
+#line 472 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp363_ = writer;
- _tmp364_ = _tmp363_->offset;
- xref_offset = _tmp364_;
+#line 472 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp363_, ">>\n");
+#line 473 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp364_ = writer;
+#line 473 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp364_, "endobj\n");
+#line 476 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp365_ = writer;
- pdf_writer_write_string (_tmp365_, "xref\n");
- _tmp366_ = writer;
+#line 476 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp366_ = _tmp365_->offset;
+#line 476 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ xref_offset = _tmp366_;
+#line 477 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp367_ = writer;
- _tmp368_ = _tmp367_->object_offsets;
- _tmp369_ = g_list_length (_tmp368_);
- _tmp370_ = g_strdup_printf ("1 %zu\n", (gsize) _tmp369_);
- _tmp371_ = _tmp370_;
- pdf_writer_write_string (_tmp366_, _tmp371_);
- _g_free0 (_tmp371_);
- _tmp372_ = writer;
- _tmp373_ = _tmp372_->object_offsets;
+#line 477 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp367_, "xref\n");
+#line 478 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp368_ = writer;
+#line 478 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp369_ = writer;
+#line 478 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp370_ = _tmp369_->object_offsets;
+#line 478 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp371_ = g_list_length (_tmp370_);
+#line 478 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp372_ = g_strdup_printf ("1 %zu\n", (gsize) _tmp371_);
+#line 478 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp373_ = _tmp372_;
+#line 478 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp368_, _tmp373_);
+#line 478 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp373_);
+#line 479 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp374_ = writer;
+#line 479 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp375_ = _tmp374_->object_offsets;
+#line 3767 "book.c"
{
GList* offset_collection = NULL;
GList* offset_it = NULL;
- offset_collection = _tmp373_;
+#line 479 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ offset_collection = _tmp375_;
+#line 479 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
for (offset_it = offset_collection; offset_it != NULL; offset_it = offset_it->next) {
+#line 3775 "book.c"
guint offset = 0U;
+#line 479 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
offset = (guint) ((guintptr) offset_it->data);
+#line 3779 "book.c"
{
- PDFWriter* _tmp374_;
- guint _tmp375_;
- gchar* _tmp376_ = NULL;
- gchar* _tmp377_;
- _tmp374_ = writer;
- _tmp375_ = offset;
- _tmp376_ = g_strdup_printf ("%010zu 00000 n \n", (gsize) _tmp375_);
- _tmp377_ = _tmp376_;
- pdf_writer_write_string (_tmp374_, _tmp377_);
- _g_free0 (_tmp377_);
+ PDFWriter* _tmp376_;
+ guint _tmp377_;
+ gchar* _tmp378_ = NULL;
+ gchar* _tmp379_;
+#line 480 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp376_ = writer;
+#line 480 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp377_ = offset;
+#line 480 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp378_ = g_strdup_printf ("%010zu 00000 n \n", (gsize) _tmp377_);
+#line 480 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp379_ = _tmp378_;
+#line 480 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp376_, _tmp379_);
+#line 480 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp379_);
+#line 3797 "book.c"
}
}
}
- _tmp378_ = writer;
- pdf_writer_write_string (_tmp378_, "trailer\n");
- _tmp379_ = writer;
- pdf_writer_write_string (_tmp379_, "<<\n");
+#line 483 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp380_ = writer;
+#line 483 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp380_, "trailer\n");
+#line 484 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp381_ = writer;
- _tmp382_ = _tmp381_->object_offsets;
- _tmp383_ = g_list_length (_tmp382_);
- _tmp384_ = g_strdup_printf ("/Size %zu\n", (gsize) _tmp383_);
- _tmp385_ = _tmp384_;
- pdf_writer_write_string (_tmp380_, _tmp385_);
- _g_free0 (_tmp385_);
- _tmp386_ = writer;
- _tmp387_ = info_number;
- _tmp388_ = g_strdup_printf ("/Info %u 0 R\n", _tmp387_);
- _tmp389_ = _tmp388_;
- pdf_writer_write_string (_tmp386_, _tmp389_);
- _g_free0 (_tmp389_);
- _tmp390_ = writer;
- _tmp391_ = catalog_number;
- _tmp392_ = g_strdup_printf ("/Root %u 0 R\n", _tmp391_);
- _tmp393_ = _tmp392_;
- pdf_writer_write_string (_tmp390_, _tmp393_);
- _g_free0 (_tmp393_);
- _tmp394_ = writer;
- pdf_writer_write_string (_tmp394_, ">>\n");
- _tmp395_ = writer;
- pdf_writer_write_string (_tmp395_, "startxref\n");
+#line 484 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp381_, "<<\n");
+#line 485 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp382_ = writer;
+#line 485 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp383_ = writer;
+#line 485 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp384_ = _tmp383_->object_offsets;
+#line 485 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp385_ = g_list_length (_tmp384_);
+#line 485 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp386_ = g_strdup_printf ("/Size %zu\n", (gsize) _tmp385_);
+#line 485 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp387_ = _tmp386_;
+#line 485 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp382_, _tmp387_);
+#line 485 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp387_);
+#line 486 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp388_ = writer;
+#line 486 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp389_ = info_number;
+#line 486 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp390_ = g_strdup_printf ("/Info %u 0 R\n", _tmp389_);
+#line 486 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp391_ = _tmp390_;
+#line 486 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp388_, _tmp391_);
+#line 486 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp391_);
+#line 487 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp392_ = writer;
+#line 487 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp393_ = catalog_number;
+#line 487 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp394_ = g_strdup_printf ("/Root %u 0 R\n", _tmp393_);
+#line 487 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp395_ = _tmp394_;
+#line 487 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp392_, _tmp395_);
+#line 487 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp395_);
+#line 489 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp396_ = writer;
- _tmp397_ = xref_offset;
- _tmp398_ = g_strdup_printf ("%zu\n", _tmp397_);
- _tmp399_ = _tmp398_;
- pdf_writer_write_string (_tmp396_, _tmp399_);
- _g_free0 (_tmp399_);
- _tmp400_ = writer;
- pdf_writer_write_string (_tmp400_, "%%EOF\n");
+#line 489 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp396_, ">>\n");
+#line 490 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp397_ = writer;
+#line 490 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp397_, "startxref\n");
+#line 491 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp398_ = writer;
+#line 491 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp399_ = xref_offset;
+#line 491 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp400_ = g_strdup_printf ("%zu\n", _tmp399_);
+#line 491 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp401_ = _tmp400_;
+#line 491 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp398_, _tmp401_);
+#line 491 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_free0 (_tmp401_);
+#line 492 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp402_ = writer;
+#line 492 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ pdf_writer_write_string (_tmp402_, "%%EOF\n");
+#line 208 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_pdf_writer_unref0 (writer);
+#line 208 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_object_unref0 (stream);
+#line 3877 "book.c"
}
-void book_save (Book* self, const gchar* type, GFile* file, GError** error) {
+void book_save (Book* self, const gchar* type, gint quality, GFile* file, GError** error) {
const gchar* _tmp0_;
const gchar* _tmp1_;
GQuark _tmp3_ = 0U;
+#line 497 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
static GQuark _tmp2_label0 = 0;
+#line 497 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
static GQuark _tmp2_label1 = 0;
+#line 497 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
static GQuark _tmp2_label2 = 0;
+#line 497 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
static GQuark _tmp2_label3 = 0;
+#line 497 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
static GQuark _tmp2_label4 = 0;
+#line 3895 "book.c"
GError * _inner_error_ = NULL;
+#line 495 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (self != NULL);
+#line 495 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (type != NULL);
+#line 495 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (file != NULL);
+#line 497 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = type;
+#line 497 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = _tmp0_;
+#line 497 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
+#line 497 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (((_tmp3_ == ((0 != _tmp2_label0) ? _tmp2_label0 : (_tmp2_label0 = g_quark_from_static_string ("jpeg")))) || (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("png"))))) || (_tmp3_ == ((0 != _tmp2_label2) ? _tmp2_label2 : (_tmp2_label2 = g_quark_from_static_string ("tiff"))))) {
+#line 497 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
switch (0) {
+#line 3913 "book.c"
default:
{
const gchar* _tmp4_;
- GFile* _tmp5_;
+ gint _tmp5_;
+ GFile* _tmp6_;
+#line 502 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = type;
- _tmp5_ = file;
- book_save_multi_file (self, _tmp4_, _tmp5_, &_inner_error_);
+#line 502 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp5_ = quality;
+#line 502 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp6_ = file;
+#line 502 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ book_save_multi_file (self, _tmp4_, _tmp5_, _tmp6_, &_inner_error_);
+#line 502 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_inner_error_ != NULL) {
+#line 502 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_propagate_error (error, _inner_error_);
+#line 502 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return;
+#line 3933 "book.c"
}
+#line 503 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
+#line 3937 "book.c"
}
}
} else if (_tmp3_ == ((0 != _tmp2_label3) ? _tmp2_label3 : (_tmp2_label3 = g_quark_from_static_string ("ps")))) {
+#line 497 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
switch (0) {
+#line 3943 "book.c"
default:
{
- GFile* _tmp6_;
- _tmp6_ = file;
- book_save_ps (self, _tmp6_, &_inner_error_);
+ GFile* _tmp7_;
+#line 505 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp7_ = file;
+#line 505 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ book_save_ps (self, _tmp7_, &_inner_error_);
+#line 505 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_inner_error_ != NULL) {
+#line 505 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_propagate_error (error, _inner_error_);
+#line 505 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return;
+#line 3957 "book.c"
}
+#line 506 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
+#line 3961 "book.c"
}
}
} else if (_tmp3_ == ((0 != _tmp2_label4) ? _tmp2_label4 : (_tmp2_label4 = g_quark_from_static_string ("pdf")))) {
+#line 497 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
switch (0) {
+#line 3967 "book.c"
default:
{
- GFile* _tmp7_;
- _tmp7_ = file;
- book_save_pdf (self, _tmp7_, &_inner_error_);
+ GFile* _tmp8_;
+ gint _tmp9_;
+#line 508 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp8_ = file;
+#line 508 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _tmp9_ = quality;
+#line 508 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ book_save_pdf (self, _tmp8_, _tmp9_, &_inner_error_);
+#line 508 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_inner_error_ != NULL) {
+#line 508 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_propagate_error (error, _inner_error_);
+#line 508 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return;
+#line 3984 "book.c"
}
+#line 509 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
break;
+#line 3988 "book.c"
}
}
}
@@ -2562,15 +3997,25 @@ void book_set_needs_saving (Book* self, gboolean needs_saving) {
gboolean _tmp1_;
gboolean _tmp2_;
gboolean _tmp3_;
+#line 513 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (self != NULL);
+#line 515 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = self->priv->needs_saving;
+#line 515 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
needed_saving = _tmp0_;
+#line 516 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = needs_saving;
+#line 516 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->priv->needs_saving = _tmp1_;
+#line 517 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = needed_saving;
+#line 517 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = needs_saving;
+#line 517 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_tmp2_ != _tmp3_) {
+#line 518 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_emit_by_name (self, "needs-saving-changed");
+#line 4019 "book.c"
}
}
@@ -2578,10 +4023,15 @@ void book_set_needs_saving (Book* self, gboolean needs_saving) {
gboolean book_get_needs_saving (Book* self) {
gboolean result = FALSE;
gboolean _tmp0_;
+#line 521 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (self != NULL, FALSE);
+#line 523 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = self->priv->needs_saving;
+#line 523 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
result = _tmp0_;
+#line 523 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
+#line 4035 "book.c"
}
@@ -2592,178 +4042,293 @@ static void g_cclosure_user_marshal_VOID__PAGE (GClosure * closure, GValue * ret
register gpointer data1;
register gpointer data2;
cc = (GCClosure *) closure;
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (n_param_values == 2);
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (G_CCLOSURE_SWAP_DATA (closure)) {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data1 = closure->data;
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data2 = param_values->data[0].v_pointer;
+#line 4054 "book.c"
} else {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data1 = param_values->data[0].v_pointer;
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
data2 = closure->data;
+#line 4060 "book.c"
}
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
callback = (GMarshalFunc_VOID__PAGE) (marshal_data ? marshal_data : cc->callback);
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
callback (data1, value_get_page (param_values + 1), data2);
+#line 4066 "book.c"
}
static void value_book_init (GValue* value) {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = NULL;
+#line 4073 "book.c"
}
static void value_book_free_value (GValue* value) {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (value->data[0].v_pointer) {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_unref (value->data[0].v_pointer);
+#line 4082 "book.c"
}
}
static void value_book_copy_value (const GValue* src_value, GValue* dest_value) {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (src_value->data[0].v_pointer) {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
dest_value->data[0].v_pointer = book_ref (src_value->data[0].v_pointer);
+#line 4092 "book.c"
} else {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
dest_value->data[0].v_pointer = NULL;
+#line 4096 "book.c"
}
}
static gpointer value_book_peek_pointer (const GValue* value) {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return value->data[0].v_pointer;
+#line 4104 "book.c"
}
static gchar* value_book_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (collect_values[0].v_pointer) {
+#line 4111 "book.c"
Book* object;
object = collect_values[0].v_pointer;
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (object->parent_instance.g_class == NULL) {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
+#line 4118 "book.c"
} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
+#line 4122 "book.c"
}
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = book_ref (object);
+#line 4126 "book.c"
} else {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = NULL;
+#line 4130 "book.c"
}
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return NULL;
+#line 4134 "book.c"
}
static gchar* value_book_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
Book** object_p;
object_p = collect_values[0].v_pointer;
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!object_p) {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
+#line 4145 "book.c"
}
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!value->data[0].v_pointer) {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
*object_p = NULL;
+#line 4151 "book.c"
} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
*object_p = value->data[0].v_pointer;
+#line 4155 "book.c"
} else {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
*object_p = book_ref (value->data[0].v_pointer);
+#line 4159 "book.c"
}
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return NULL;
+#line 4163 "book.c"
}
GParamSpec* param_spec_book (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
ParamSpecBook* spec;
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (g_type_is_a (object_type, TYPE_BOOK), NULL);
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
G_PARAM_SPEC (spec)->value_type = object_type;
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return G_PARAM_SPEC (spec);
+#line 4177 "book.c"
}
gpointer value_get_book (const GValue* value) {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_BOOK), NULL);
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return value->data[0].v_pointer;
+#line 4186 "book.c"
}
void value_set_book (GValue* value, gpointer v_object) {
Book* old;
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_BOOK));
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
old = value->data[0].v_pointer;
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (v_object) {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_BOOK));
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = v_object;
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_ref (value->data[0].v_pointer);
+#line 4206 "book.c"
} else {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = NULL;
+#line 4210 "book.c"
}
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (old) {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_unref (old);
+#line 4216 "book.c"
}
}
void value_take_book (GValue* value, gpointer v_object) {
Book* old;
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_BOOK));
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
old = value->data[0].v_pointer;
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (v_object) {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_BOOK));
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = v_object;
+#line 4235 "book.c"
} else {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = NULL;
+#line 4239 "book.c"
}
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (old) {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_unref (old);
+#line 4245 "book.c"
}
}
static void book_class_init (BookClass * klass) {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
book_parent_class = g_type_class_peek_parent (klass);
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
BOOK_CLASS (klass)->finalize = book_finalize;
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_type_class_add_private (klass, sizeof (BookPrivate));
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_new ("page_added", TYPE_BOOK, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__PAGE, G_TYPE_NONE, 1, TYPE_PAGE);
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_new ("page_removed", TYPE_BOOK, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__PAGE, G_TYPE_NONE, 1, TYPE_PAGE);
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_new ("reordered", TYPE_BOOK, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_new ("cleared", TYPE_BOOK, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_new ("needs_saving_changed", TYPE_BOOK, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_new ("saving", TYPE_BOOK, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
+#line 4269 "book.c"
}
static void book_instance_init (Book * self) {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->priv = BOOK_GET_PRIVATE (self);
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->ref_count = 1;
+#line 4278 "book.c"
}
static void book_finalize (Book* obj) {
Book * self;
GList* _tmp0_;
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_BOOK, Book);
+#line 32 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = self->priv->pages;
+#line 4289 "book.c"
{
GList* page_collection = NULL;
GList* page_it = NULL;
+#line 32 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
page_collection = _tmp0_;
+#line 32 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
for (page_it = page_collection; page_it != NULL; page_it = page_it->next) {
+#line 4297 "book.c"
Page* _tmp1_;
Page* page = NULL;
+#line 32 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = _page_ref0 ((Page*) page_it->data);
+#line 32 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
page = _tmp1_;
+#line 4304 "book.c"
{
Page* _tmp2_;
guint _tmp3_ = 0U;
Page* _tmp4_;
guint _tmp5_ = 0U;
+#line 34 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = page;
+#line 34 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_parse_name ("pixels-changed", TYPE_PAGE, &_tmp3_, NULL, FALSE);
+#line 34 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _book_page_changed_cb_page_pixels_changed, self);
+#line 35 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = page;
+#line 35 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_parse_name ("crop-changed", TYPE_PAGE, &_tmp5_, NULL, FALSE);
+#line 35 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_signal_handlers_disconnect_matched (_tmp4_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp5_, 0, NULL, (GCallback) _book_page_changed_cb_page_crop_changed, self);
+#line 32 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_page_unref0 (page);
+#line 4324 "book.c"
}
}
}
+#line 14 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
__g_list_free__page_unref0_0 (self->priv->pages);
+#line 182 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ _g_byte_array_unref0 (self->priv->jpeg_data);
+#line 4332 "book.c"
}
@@ -2784,23 +4349,32 @@ GType book_get_type (void) {
gpointer book_ref (gpointer instance) {
Book* self;
self = instance;
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_atomic_int_inc (&self->ref_count);
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return instance;
+#line 4357 "book.c"
}
void book_unref (gpointer instance) {
Book* self;
self = instance;
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (g_atomic_int_dec_and_test (&self->ref_count)) {
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
BOOK_GET_CLASS (self)->finalize (self);
+#line 12 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_type_free_instance ((GTypeInstance *) self);
+#line 4370 "book.c"
}
}
static gpointer _g_object_ref0 (gpointer self) {
+#line 535 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return self ? g_object_ref (self) : NULL;
+#line 4378 "book.c"
}
@@ -2808,18 +4382,28 @@ PDFWriter* pdf_writer_construct (GType object_type, GFileOutputStream* stream) {
PDFWriter* self = NULL;
GFileOutputStream* _tmp0_;
GFileOutputStream* _tmp1_;
+#line 533 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (stream != NULL, NULL);
+#line 533 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self = (PDFWriter*) g_type_create_instance (object_type);
+#line 535 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = stream;
+#line 535 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = _g_object_ref0 (_tmp0_);
+#line 535 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_object_unref0 (self->priv->stream);
+#line 535 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->priv->stream = _tmp1_;
+#line 533 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return self;
+#line 4400 "book.c"
}
PDFWriter* pdf_writer_new (GFileOutputStream* stream) {
+#line 533 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return pdf_writer_construct (TYPE_PDF_WRITER, stream);
+#line 4407 "book.c"
}
@@ -2828,42 +4412,67 @@ void pdf_writer_write (PDFWriter* self, guint8* data, int data_length1) {
guint8* _tmp5_;
gint _tmp5__length1;
GError * _inner_error_ = NULL;
+#line 538 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (self != NULL);
+#line 4418 "book.c"
{
GFileOutputStream* _tmp0_;
guint8* _tmp1_;
gint _tmp1__length1;
+#line 542 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = self->priv->stream;
+#line 542 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = data;
+#line 542 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1__length1 = data_length1;
+#line 542 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_output_stream_write_all ((GOutputStream*) _tmp0_, _tmp1_, (gsize) _tmp1__length1, NULL, NULL, &_inner_error_);
+#line 542 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_inner_error_ != NULL) {
- goto __catch0_g_error;
+#line 4433 "book.c"
+ goto __catch1_g_error;
}
}
- goto __finally0;
- __catch0_g_error:
+ goto __finally1;
+ __catch1_g_error:
{
GError* e = NULL;
GError* _tmp2_;
const gchar* _tmp3_;
+#line 540 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
e = _inner_error_;
+#line 540 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_inner_error_ = NULL;
+#line 546 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = e;
+#line 546 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = _tmp2_->message;
- g_warning ("book.vala:562: Error writing PDF: %s", _tmp3_);
+#line 546 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ g_warning ("book.vala:546: Error writing PDF: %s", _tmp3_);
+#line 540 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_error_free0 (e);
+#line 4455 "book.c"
}
- __finally0:
+ __finally1:
+#line 540 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_inner_error_ != NULL) {
+#line 540 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+#line 540 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_clear_error (&_inner_error_);
+#line 540 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return;
+#line 4466 "book.c"
}
+#line 548 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp4_ = self->offset;
+#line 548 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5_ = data;
+#line 548 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp5__length1 = data_length1;
+#line 548 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->offset = _tmp4_ + _tmp5__length1;
+#line 4476 "book.c"
}
@@ -2882,27 +4491,49 @@ static gchar* string_to_utf8 (const gchar* self, int* result_length1) {
gint _tmp6_;
gchar* _tmp7_;
gint _tmp7__length1;
+#line 1267 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
g_return_val_if_fail (self != NULL, NULL);
+#line 1268 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp0_ = strlen (self);
+#line 1268 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp1_ = _tmp0_;
+#line 1268 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp2_ = g_new0 (gchar, _tmp1_ + 1);
+#line 1268 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_result_ = _tmp2_;
+#line 1268 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_result__length1 = _tmp1_ + 1;
+#line 1268 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
__result__size_ = _result__length1;
+#line 1269 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp3_ = _result__length1;
+#line 1269 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_result__length1 = _tmp3_ - 1;
+#line 1270 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp4_ = _result_;
+#line 1270 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp4__length1 = _result__length1;
+#line 1270 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp5_ = strlen (self);
+#line 1270 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp6_ = _tmp5_;
+#line 1270 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
memcpy (_tmp4_, self, (gsize) _tmp6_);
+#line 1271 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp7_ = _result_;
+#line 1271 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
_tmp7__length1 = _result__length1;
+#line 1271 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
if (result_length1) {
+#line 1271 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
*result_length1 = _tmp7__length1;
+#line 4531 "book.c"
}
+#line 1271 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
result = _tmp7_;
+#line 1271 "/usr/share/vala-0.20/vapi/glib-2.0.vapi"
return result;
+#line 4537 "book.c"
}
@@ -2912,14 +4543,23 @@ void pdf_writer_write_string (PDFWriter* self, const gchar* text) {
gchar* _tmp2_ = NULL;
guint8* _tmp3_;
gint _tmp3__length1;
+#line 551 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (self != NULL);
+#line 551 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (text != NULL);
+#line 553 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = text;
+#line 553 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = string_to_utf8 (_tmp0_, &_tmp1_);
+#line 553 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = (guint8*) _tmp2_;
+#line 553 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3__length1 = (_tmp1_ * sizeof (gchar)) / sizeof (guint8);
+#line 553 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_write (self, _tmp3_, (_tmp1_ * sizeof (gchar)) / sizeof (guint8));
+#line 553 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = (g_free (_tmp3_), NULL);
+#line 4563 "book.c"
}
@@ -2928,145 +4568,235 @@ guint pdf_writer_start_object (PDFWriter* self) {
gsize _tmp0_;
GList* _tmp1_;
guint _tmp2_ = 0U;
+#line 556 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (self != NULL, 0U);
+#line 558 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = self->offset;
+#line 558 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->object_offsets = g_list_append (self->object_offsets, (gpointer) ((guintptr) ((guint) _tmp0_)));
+#line 559 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = self->object_offsets;
+#line 559 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = g_list_length (_tmp1_);
+#line 559 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
result = _tmp2_;
+#line 559 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
+#line 4586 "book.c"
}
static void value_pdf_writer_init (GValue* value) {
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = NULL;
+#line 4593 "book.c"
}
static void value_pdf_writer_free_value (GValue* value) {
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (value->data[0].v_pointer) {
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_unref (value->data[0].v_pointer);
+#line 4602 "book.c"
}
}
static void value_pdf_writer_copy_value (const GValue* src_value, GValue* dest_value) {
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (src_value->data[0].v_pointer) {
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
dest_value->data[0].v_pointer = pdf_writer_ref (src_value->data[0].v_pointer);
+#line 4612 "book.c"
} else {
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
dest_value->data[0].v_pointer = NULL;
+#line 4616 "book.c"
}
}
static gpointer value_pdf_writer_peek_pointer (const GValue* value) {
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return value->data[0].v_pointer;
+#line 4624 "book.c"
}
static gchar* value_pdf_writer_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (collect_values[0].v_pointer) {
+#line 4631 "book.c"
PDFWriter* object;
object = collect_values[0].v_pointer;
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (object->parent_instance.g_class == NULL) {
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
+#line 4638 "book.c"
} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
+#line 4642 "book.c"
}
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = pdf_writer_ref (object);
+#line 4646 "book.c"
} else {
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = NULL;
+#line 4650 "book.c"
}
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return NULL;
+#line 4654 "book.c"
}
static gchar* value_pdf_writer_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
PDFWriter** object_p;
object_p = collect_values[0].v_pointer;
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!object_p) {
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
+#line 4665 "book.c"
}
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!value->data[0].v_pointer) {
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
*object_p = NULL;
+#line 4671 "book.c"
} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
*object_p = value->data[0].v_pointer;
+#line 4675 "book.c"
} else {
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
*object_p = pdf_writer_ref (value->data[0].v_pointer);
+#line 4679 "book.c"
}
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return NULL;
+#line 4683 "book.c"
}
GParamSpec* param_spec_pdf_writer (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
ParamSpecPDFWriter* spec;
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (g_type_is_a (object_type, TYPE_PDF_WRITER), NULL);
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
G_PARAM_SPEC (spec)->value_type = object_type;
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return G_PARAM_SPEC (spec);
+#line 4697 "book.c"
}
gpointer value_get_pdf_writer (const GValue* value) {
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_PDF_WRITER), NULL);
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return value->data[0].v_pointer;
+#line 4706 "book.c"
}
void value_set_pdf_writer (GValue* value, gpointer v_object) {
PDFWriter* old;
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_PDF_WRITER));
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
old = value->data[0].v_pointer;
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (v_object) {
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_PDF_WRITER));
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = v_object;
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_ref (value->data[0].v_pointer);
+#line 4726 "book.c"
} else {
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = NULL;
+#line 4730 "book.c"
}
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (old) {
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_unref (old);
+#line 4736 "book.c"
}
}
void value_take_pdf_writer (GValue* value, gpointer v_object) {
PDFWriter* old;
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_PDF_WRITER));
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
old = value->data[0].v_pointer;
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (v_object) {
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_PDF_WRITER));
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = v_object;
+#line 4755 "book.c"
} else {
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = NULL;
+#line 4759 "book.c"
}
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (old) {
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_unref (old);
+#line 4765 "book.c"
}
}
static void pdf_writer_class_init (PDFWriterClass * klass) {
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
pdf_writer_parent_class = g_type_class_peek_parent (klass);
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
PDF_WRITER_CLASS (klass)->finalize = pdf_writer_finalize;
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_type_class_add_private (klass, sizeof (PDFWriterPrivate));
+#line 4777 "book.c"
}
static void pdf_writer_instance_init (PDFWriter * self) {
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->priv = PDF_WRITER_GET_PRIVATE (self);
+#line 529 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->offset = (gsize) 0;
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->ref_count = 1;
+#line 4788 "book.c"
}
static void pdf_writer_finalize (PDFWriter* obj) {
PDFWriter * self;
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PDF_WRITER, PDFWriter);
+#line 530 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_list_free0 (self->object_offsets);
+#line 531 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_object_unref0 (self->priv->stream);
+#line 4800 "book.c"
}
@@ -3087,17 +4817,24 @@ GType pdf_writer_get_type (void) {
gpointer pdf_writer_ref (gpointer instance) {
PDFWriter* self;
self = instance;
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_atomic_int_inc (&self->ref_count);
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return instance;
+#line 4825 "book.c"
}
void pdf_writer_unref (gpointer instance) {
PDFWriter* self;
self = instance;
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (g_atomic_int_dec_and_test (&self->ref_count)) {
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
PDF_WRITER_GET_CLASS (self)->finalize (self);
+#line 527 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_type_free_instance ((GTypeInstance *) self);
+#line 4838 "book.c"
}
}
@@ -3105,7 +4842,9 @@ void pdf_writer_unref (gpointer instance) {
static cairo_status_t _ps_writer_write_cairo_data_cairo_write_func_t (gpointer self, guchar* data, int data_length1) {
cairo_status_t result;
result = ps_writer_write_cairo_data (self, data, data_length1);
+#line 571 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
+#line 4848 "book.c"
}
@@ -3114,192 +4853,309 @@ PsWriter* ps_writer_construct (GType object_type, GFileOutputStream* stream) {
GFileOutputStream* _tmp0_;
GFileOutputStream* _tmp1_;
cairo_surface_t* _tmp2_;
+#line 568 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (stream != NULL, NULL);
+#line 568 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self = (PsWriter*) g_type_create_instance (object_type);
+#line 570 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = stream;
+#line 570 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = _g_object_ref0 (_tmp0_);
+#line 570 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_object_unref0 (self->stream);
+#line 570 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->stream = _tmp1_;
+#line 571 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = cairo_ps_surface_create_for_stream (_ps_writer_write_cairo_data_cairo_write_func_t, self, (gdouble) 0, (gdouble) 0);
+#line 571 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_cairo_surface_destroy0 (self->surface);
+#line 571 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->surface = _tmp2_;
+#line 568 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return self;
+#line 4877 "book.c"
}
PsWriter* ps_writer_new (GFileOutputStream* stream) {
+#line 568 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return ps_writer_construct (TYPE_PS_WRITER, stream);
+#line 4884 "book.c"
}
static cairo_status_t ps_writer_write_cairo_data (PsWriter* self, guint8* data, int data_length1) {
cairo_status_t result = 0;
GError * _inner_error_ = NULL;
+#line 574 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (self != NULL, 0);
+#line 4893 "book.c"
{
GFileOutputStream* _tmp0_;
guint8* _tmp1_;
gint _tmp1__length1;
+#line 578 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp0_ = self->stream;
+#line 578 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1_ = data;
+#line 578 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp1__length1 = data_length1;
+#line 578 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_output_stream_write_all ((GOutputStream*) _tmp0_, _tmp1_, (gsize) _tmp1__length1, NULL, NULL, &_inner_error_);
+#line 578 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_inner_error_ != NULL) {
- goto __catch1_g_error;
+#line 4908 "book.c"
+ goto __catch2_g_error;
}
}
- goto __finally1;
- __catch1_g_error:
+ goto __finally2;
+ __catch2_g_error:
{
GError* e = NULL;
GError* _tmp2_;
const gchar* _tmp3_;
+#line 576 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
e = _inner_error_;
+#line 576 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_inner_error_ = NULL;
+#line 582 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp2_ = e;
+#line 582 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_tmp3_ = _tmp2_->message;
- g_warning ("book.vala:598: Error writing data: %s", _tmp3_);
+#line 582 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
+ g_warning ("book.vala:582: Error writing data: %s", _tmp3_);
+#line 583 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
result = CAIRO_STATUS_WRITE_ERROR;
+#line 583 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_error_free0 (e);
+#line 583 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
+#line 4934 "book.c"
}
- __finally1:
+ __finally2:
+#line 576 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (_inner_error_ != NULL) {
+#line 576 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+#line 576 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_clear_error (&_inner_error_);
+#line 576 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return 0;
+#line 4945 "book.c"
}
+#line 586 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
result = CAIRO_STATUS_SUCCESS;
+#line 586 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return result;
+#line 4951 "book.c"
}
static void value_ps_writer_init (GValue* value) {
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = NULL;
+#line 4958 "book.c"
}
static void value_ps_writer_free_value (GValue* value) {
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (value->data[0].v_pointer) {
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
ps_writer_unref (value->data[0].v_pointer);
+#line 4967 "book.c"
}
}
static void value_ps_writer_copy_value (const GValue* src_value, GValue* dest_value) {
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (src_value->data[0].v_pointer) {
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
dest_value->data[0].v_pointer = ps_writer_ref (src_value->data[0].v_pointer);
+#line 4977 "book.c"
} else {
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
dest_value->data[0].v_pointer = NULL;
+#line 4981 "book.c"
}
}
static gpointer value_ps_writer_peek_pointer (const GValue* value) {
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return value->data[0].v_pointer;
+#line 4989 "book.c"
}
static gchar* value_ps_writer_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (collect_values[0].v_pointer) {
+#line 4996 "book.c"
PsWriter* object;
object = collect_values[0].v_pointer;
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (object->parent_instance.g_class == NULL) {
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
+#line 5003 "book.c"
} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
+#line 5007 "book.c"
}
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = ps_writer_ref (object);
+#line 5011 "book.c"
} else {
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = NULL;
+#line 5015 "book.c"
}
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return NULL;
+#line 5019 "book.c"
}
static gchar* value_ps_writer_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
PsWriter** object_p;
object_p = collect_values[0].v_pointer;
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!object_p) {
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
+#line 5030 "book.c"
}
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (!value->data[0].v_pointer) {
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
*object_p = NULL;
+#line 5036 "book.c"
} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
*object_p = value->data[0].v_pointer;
+#line 5040 "book.c"
} else {
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
*object_p = ps_writer_ref (value->data[0].v_pointer);
+#line 5044 "book.c"
}
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return NULL;
+#line 5048 "book.c"
}
GParamSpec* param_spec_ps_writer (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
ParamSpecPsWriter* spec;
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (g_type_is_a (object_type, TYPE_PS_WRITER), NULL);
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
G_PARAM_SPEC (spec)->value_type = object_type;
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return G_PARAM_SPEC (spec);
+#line 5062 "book.c"
}
gpointer value_get_ps_writer (const GValue* value) {
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_PS_WRITER), NULL);
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return value->data[0].v_pointer;
+#line 5071 "book.c"
}
void value_set_ps_writer (GValue* value, gpointer v_object) {
PsWriter* old;
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_PS_WRITER));
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
old = value->data[0].v_pointer;
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (v_object) {
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_PS_WRITER));
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = v_object;
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
ps_writer_ref (value->data[0].v_pointer);
+#line 5091 "book.c"
} else {
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = NULL;
+#line 5095 "book.c"
}
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (old) {
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
ps_writer_unref (old);
+#line 5101 "book.c"
}
}
void value_take_ps_writer (GValue* value, gpointer v_object) {
PsWriter* old;
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_PS_WRITER));
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
old = value->data[0].v_pointer;
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (v_object) {
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_PS_WRITER));
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = v_object;
+#line 5120 "book.c"
} else {
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
value->data[0].v_pointer = NULL;
+#line 5124 "book.c"
}
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (old) {
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
ps_writer_unref (old);
+#line 5130 "book.c"
}
}
static void ps_writer_class_init (PsWriterClass * klass) {
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
ps_writer_parent_class = g_type_class_peek_parent (klass);
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
PS_WRITER_CLASS (klass)->finalize = ps_writer_finalize;
+#line 5140 "book.c"
}
static void ps_writer_instance_init (PsWriter * self) {
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self->ref_count = 1;
+#line 5147 "book.c"
}
static void ps_writer_finalize (PsWriter* obj) {
PsWriter * self;
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PS_WRITER, PsWriter);
+#line 565 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_cairo_surface_destroy0 (self->surface);
+#line 566 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
_g_object_unref0 (self->stream);
+#line 5159 "book.c"
}
@@ -3320,19 +5176,44 @@ GType ps_writer_get_type (void) {
gpointer ps_writer_ref (gpointer instance) {
PsWriter* self;
self = instance;
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_atomic_int_inc (&self->ref_count);
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
return instance;
+#line 5184 "book.c"
}
void ps_writer_unref (gpointer instance) {
PsWriter* self;
self = instance;
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
if (g_atomic_int_dec_and_test (&self->ref_count)) {
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
PS_WRITER_GET_CLASS (self)->finalize (self);
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/book.vala"
g_type_free_instance ((GTypeInstance *) self);
+#line 5197 "book.c"
+ }
+}
+
+
+static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
+ if ((array != NULL) && (destroy_func != NULL)) {
+ int i;
+ for (i = 0; i < array_length; i = i + 1) {
+ if (((gpointer*) array)[i] != NULL) {
+ destroy_func (((gpointer*) array)[i]);
+ }
+ }
}
}
+static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
+ _vala_array_destroy (array, array_length, destroy_func);
+ g_free (array);
+}
+
+