summaryrefslogtreecommitdiff
path: root/src/page.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/page.c
parent438230655b539ad6aa15b017a792cab8ca7f6d89 (diff)
parent2d71d20a62ca8f6989d86db58ce64c7a862675dd (diff)
Merge tag 'upstream/3.10.0'
Upstream version 3.10.0
Diffstat (limited to 'src/page.c')
-rw-r--r--src/page.c2043
1 files changed, 1900 insertions, 143 deletions
diff --git a/src/page.c b/src/page.c
index a3c28d5..eee78d1 100644
--- a/src/page.c
+++ b/src/page.c
@@ -1,4 +1,4 @@
-/* page.c generated by valac 0.18.1, the Vala compiler
+/* page.c generated by valac 0.20.1, the Vala compiler
* generated from page.vala, do not modify */
/*
@@ -20,6 +20,8 @@
#include <math.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <glib/gstdio.h>
+#include <gtk/gtk.h>
+#include <gdk/gdk.h>
#include <gio/gio.h>
#include <gobject/gvaluecollector.h>
@@ -239,11 +241,14 @@ gboolean page_has_crop (Page* self);
void page_get_crop (Page* self, gint* x, gint* y, gint* width, gint* height);
gchar* page_get_named_crop (Page* self);
guchar* page_get_pixels (Page* self, int* result_length1);
+void page_set_pixels (Page* self, guchar* new_pixels, int new_pixels_length1);
+static guchar* _vala_array_dup3 (guchar* self, int length);
static guchar page_get_sample (Page* self, guchar* pixels, int pixels_length1, gint offset, gint x, gint depth, gint n_channels, gint channel);
static void page_get_pixel (Page* self, gint x, gint y, guchar* pixel, int pixel_length1, gint offset);
GdkPixbuf* page_get_image (Page* self, gboolean apply_crop);
static gchar* page_get_icc_data_encoded (Page* self, const gchar* icc_profile_filename);
-void page_save (Page* self, const gchar* type, GFile* file, GError** error);
+void page_copy_to_clipboard (Page* self, GtkWindow* window);
+void page_save (Page* self, const gchar* type, gint quality, GFile* file, GError** error);
PixbufWriter* pixbuf_writer_new (GFileOutputStream* stream);
PixbufWriter* pixbuf_writer_construct (GType object_type, GFileOutputStream* stream);
gpointer pixbuf_writer_ref (gpointer instance);
@@ -284,41 +289,70 @@ Page* page_construct (GType object_type, gint width, gint height, gint dpi, Scan
gboolean _tmp3_;
gint _tmp8_;
ScanDirection _tmp9_;
+#line 68 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self = (Page*) g_type_create_instance (object_type);
+#line 70 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1_ = scan_direction;
+#line 70 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp1_ == SCAN_DIRECTION_TOP_TO_BOTTOM) {
+#line 70 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = TRUE;
+#line 301 "page.c"
} else {
ScanDirection _tmp2_;
+#line 70 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp2_ = scan_direction;
+#line 70 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = _tmp2_ == SCAN_DIRECTION_BOTTOM_TO_TOP;
+#line 308 "page.c"
}
+#line 70 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp3_ = _tmp0_;
+#line 70 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp3_) {
+#line 314 "page.c"
gint _tmp4_;
gint _tmp5_;
+#line 72 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp4_ = width;
+#line 72 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->width = _tmp4_;
+#line 73 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp5_ = height;
+#line 73 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->n_rows = _tmp5_;
+#line 325 "page.c"
} else {
gint _tmp6_;
gint _tmp7_;
+#line 77 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp6_ = height;
+#line 77 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->width = _tmp6_;
+#line 78 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp7_ = width;
+#line 78 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->n_rows = _tmp7_;
+#line 337 "page.c"
}
+#line 80 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp8_ = dpi;
+#line 80 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->dpi = _tmp8_;
+#line 81 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp9_ = scan_direction;
+#line 81 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->scan_direction = _tmp9_;
+#line 68 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return self;
+#line 349 "page.c"
}
Page* page_new (gint width, gint height, gint dpi, ScanDirection scan_direction) {
+#line 68 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return page_construct (TYPE_PAGE, width, height, dpi, scan_direction);
+#line 356 "page.c"
}
@@ -345,117 +379,199 @@ void page_set_page_info (Page* self, ScanPageInfo* info) {
guchar* _tmp20_;
gint _tmp20__length1;
gint _tmp21_;
+#line 84 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (self != NULL);
+#line 84 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (info != NULL);
+#line 86 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = info;
+#line 86 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1_ = _tmp0_->height;
+#line 86 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->expected_rows = _tmp1_;
+#line 87 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp2_ = info;
+#line 87 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp3_ = _tmp2_->dpi;
+#line 87 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->dpi = (gint) _tmp3_;
+#line 90 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp4_ = info;
+#line 90 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp5_ = _tmp4_->width;
+#line 90 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->width = _tmp5_;
+#line 91 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp6_ = info;
+#line 91 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp7_ = _tmp6_->height;
+#line 91 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->n_rows = _tmp7_;
+#line 93 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp8_ = self->priv->n_rows;
+#line 93 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp8_ < 0) {
+#line 415 "page.c"
gint _tmp9_;
+#line 94 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp9_ = self->priv->width;
+#line 94 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->n_rows = _tmp9_ / 2;
+#line 421 "page.c"
}
+#line 95 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp10_ = info;
+#line 95 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp11_ = _tmp10_->depth;
+#line 95 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->depth = _tmp11_;
+#line 96 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp12_ = info;
+#line 96 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp13_ = _tmp12_->n_channels;
+#line 96 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->n_channels = _tmp13_;
+#line 97 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp14_ = self->priv->width;
+#line 97 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp15_ = self->priv->depth;
+#line 97 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp16_ = self->priv->n_channels;
+#line 97 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->rowstride = (((_tmp14_ * _tmp15_) * _tmp16_) + 7) / 8;
+#line 98 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp17_ = self->priv->n_rows;
+#line 98 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp18_ = self->priv->rowstride;
+#line 98 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp19_ = _tmp17_ * _tmp18_;
+#line 98 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->pixels = g_renew (guchar, self->priv->pixels, _tmp17_ * _tmp18_);
+#line 98 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
(_tmp19_ > self->priv->pixels_length1) ? memset (self->priv->pixels + self->priv->pixels_length1, 0, sizeof (guchar) * (_tmp19_ - self->priv->pixels_length1)) : NULL;
+#line 98 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->pixels_length1 = _tmp19_;
+#line 98 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->_pixels_size_ = _tmp19_;
+#line 99 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp20_ = self->priv->pixels;
+#line 99 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp20__length1 = self->priv->pixels_length1;
+#line 99 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (_tmp20_ != NULL);
+#line 102 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp21_ = self->priv->depth;
+#line 102 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp21_ == 1) {
+#line 467 "page.c"
guchar* _tmp22_;
gint _tmp22__length1;
gint _tmp23_;
gint _tmp24_;
+#line 103 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp22_ = self->priv->pixels;
+#line 103 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp22__length1 = self->priv->pixels_length1;
+#line 103 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp23_ = self->priv->n_rows;
+#line 103 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp24_ = self->priv->rowstride;
+#line 103 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
memset (_tmp22_, 0x00, (gsize) (_tmp23_ * _tmp24_));
+#line 482 "page.c"
} else {
guchar* _tmp25_;
gint _tmp25__length1;
gint _tmp26_;
gint _tmp27_;
+#line 105 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp25_ = self->priv->pixels;
+#line 105 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp25__length1 = self->priv->pixels_length1;
+#line 105 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp26_ = self->priv->n_rows;
+#line 105 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp27_ = self->priv->rowstride;
+#line 105 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
memset (_tmp25_, 0xFF, (gsize) (_tmp26_ * _tmp27_));
+#line 498 "page.c"
}
+#line 107 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_signal_emit_by_name (self, "size-changed");
+#line 108 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_signal_emit_by_name (self, "pixels-changed");
+#line 504 "page.c"
}
void page_start (Page* self) {
+#line 111 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (self != NULL);
+#line 113 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->scanning = TRUE;
+#line 114 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_signal_emit_by_name (self, "scan-line-changed");
+#line 515 "page.c"
}
gboolean page_is_scanning (Page* self) {
gboolean result = FALSE;
gboolean _tmp0_;
+#line 117 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (self != NULL, FALSE);
+#line 119 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = self->priv->scanning;
+#line 119 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
result = _tmp0_;
+#line 119 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return result;
+#line 530 "page.c"
}
gboolean page_has_data (Page* self) {
gboolean result = FALSE;
gboolean _tmp0_;
+#line 122 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (self != NULL, FALSE);
+#line 124 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = self->priv->has_data_;
+#line 124 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
result = _tmp0_;
+#line 124 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return result;
+#line 545 "page.c"
}
gboolean page_is_color (Page* self) {
gboolean result = FALSE;
gint _tmp0_;
+#line 127 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (self != NULL, FALSE);
+#line 129 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = self->priv->n_channels;
+#line 129 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
result = _tmp0_ > 1;
+#line 129 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return result;
+#line 560 "page.c"
}
gint page_get_scan_line (Page* self) {
gint result = 0;
gint _tmp0_;
+#line 132 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (self != NULL, 0);
+#line 134 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = self->priv->scan_line;
+#line 134 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
result = _tmp0_;
+#line 134 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return result;
+#line 575 "page.c"
}
@@ -473,14 +589,23 @@ static void page_parse_line (Page* self, ScanLine* line, gint n, gboolean* size_
gint _tmp17_;
gint line_offset;
gint _tmp33_;
+#line 137 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (self != NULL);
+#line 137 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (line != NULL);
+#line 141 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = line;
+#line 141 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1_ = _tmp0_->number;
+#line 141 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp2_ = n;
+#line 141 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
line_number = _tmp1_ + _tmp2_;
+#line 144 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_vala_size_changed = FALSE;
+#line 145 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
while (TRUE) {
+#line 609 "page.c"
gint _tmp3_;
gint _tmp4_ = 0;
gint rows = 0;
@@ -492,42 +617,77 @@ static void page_parse_line (Page* self, ScanLine* line, gint n, gboolean* size_
gint _tmp10_;
gint _tmp11_;
gint _tmp12_ = 0;
+#line 145 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp3_ = line_number;
+#line 145 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp4_ = page_get_scan_height (self);
+#line 145 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (!(_tmp3_ >= _tmp4_)) {
+#line 145 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 629 "page.c"
}
+#line 150 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp5_ = self->priv->n_rows;
+#line 150 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
rows = _tmp5_;
+#line 151 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp6_ = rows;
+#line 151 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp7_ = self->priv->width;
+#line 151 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->n_rows = _tmp6_ + (_tmp7_ / 2);
+#line 152 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp8_ = rows;
+#line 152 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp9_ = self->priv->n_rows;
- g_debug ("page.vala:151: Extending image from %d lines to %d lines", _tmp8_, _tmp9_);
+#line 152 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ g_debug ("page.vala:152: Extending image from %d lines to %d lines", _tmp8_, _tmp9_);
+#line 153 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp10_ = self->priv->n_rows;
+#line 153 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp11_ = self->priv->rowstride;
+#line 153 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp12_ = _tmp10_ * _tmp11_;
+#line 153 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->pixels = g_renew (guchar, self->priv->pixels, _tmp10_ * _tmp11_);
+#line 153 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
(_tmp12_ > self->priv->pixels_length1) ? memset (self->priv->pixels + self->priv->pixels_length1, 0, sizeof (guchar) * (_tmp12_ - self->priv->pixels_length1)) : NULL;
+#line 153 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->pixels_length1 = _tmp12_;
+#line 153 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->_pixels_size_ = _tmp12_;
+#line 155 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_vala_size_changed = TRUE;
+#line 663 "page.c"
}
+#line 159 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp13_ = line_number;
+#line 159 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp14_ = self->priv->rowstride;
+#line 159 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
offset = _tmp13_ * _tmp14_;
+#line 160 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp15_ = n;
+#line 160 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp16_ = line;
+#line 160 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp17_ = _tmp16_->data_length;
+#line 160 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
line_offset = _tmp15_ * _tmp17_;
+#line 679 "page.c"
{
gint i;
+#line 161 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
i = 0;
+#line 684 "page.c"
{
gboolean _tmp18_;
+#line 161 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp18_ = TRUE;
+#line 161 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
while (TRUE) {
+#line 691 "page.c"
gboolean _tmp19_;
gint _tmp21_;
ScanLine* _tmp22_;
@@ -543,38 +703,69 @@ static void page_parse_line (Page* self, ScanLine* line, gint n, gboolean* size_
gint _tmp30_;
guchar _tmp31_;
guchar _tmp32_;
+#line 161 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp19_ = _tmp18_;
+#line 161 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (!_tmp19_) {
+#line 711 "page.c"
gint _tmp20_;
+#line 161 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp20_ = i;
+#line 161 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
i = _tmp20_ + 1;
+#line 717 "page.c"
}
+#line 161 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp18_ = FALSE;
+#line 161 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp21_ = i;
+#line 161 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp22_ = line;
+#line 161 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp23_ = _tmp22_->data_length;
+#line 161 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (!(_tmp21_ < _tmp23_)) {
+#line 161 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 731 "page.c"
}
+#line 162 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp24_ = self->priv->pixels;
+#line 162 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp24__length1 = self->priv->pixels_length1;
+#line 162 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp25_ = offset;
+#line 162 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp26_ = i;
+#line 162 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp27_ = line;
+#line 162 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp28_ = _tmp27_->data;
+#line 162 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp28__length1 = _tmp27_->data_length1;
+#line 162 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp29_ = line_offset;
+#line 162 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp30_ = i;
+#line 162 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp31_ = _tmp28_[_tmp29_ + _tmp30_];
+#line 162 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp24_[_tmp25_ + _tmp26_] = _tmp31_;
+#line 162 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp32_ = _tmp24_[_tmp25_ + _tmp26_];
+#line 757 "page.c"
}
}
}
+#line 164 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp33_ = line_number;
+#line 164 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->scan_line = _tmp33_;
+#line 137 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (size_changed) {
+#line 137 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
*size_changed = _vala_size_changed;
+#line 769 "page.c"
}
}
@@ -582,16 +773,25 @@ static void page_parse_line (Page* self, ScanLine* line, gint n, gboolean* size_
void page_parse_scan_line (Page* self, ScanLine* line) {
gboolean size_has_changed;
gboolean _tmp9_;
+#line 167 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (self != NULL);
+#line 167 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (line != NULL);
+#line 169 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
size_has_changed = FALSE;
+#line 783 "page.c"
{
gint i;
+#line 170 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
i = 0;
+#line 788 "page.c"
{
gboolean _tmp0_;
+#line 170 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = TRUE;
+#line 170 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
while (TRUE) {
+#line 795 "page.c"
gboolean _tmp1_;
gint _tmp3_;
ScanLine* _tmp4_;
@@ -599,33 +799,59 @@ void page_parse_scan_line (Page* self, ScanLine* line) {
ScanLine* _tmp6_;
gint _tmp7_;
gboolean _tmp8_ = FALSE;
+#line 170 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1_ = _tmp0_;
+#line 170 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (!_tmp1_) {
+#line 807 "page.c"
gint _tmp2_;
+#line 170 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp2_ = i;
+#line 170 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
i = _tmp2_ + 1;
+#line 813 "page.c"
}
+#line 170 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = FALSE;
+#line 170 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp3_ = i;
+#line 170 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp4_ = line;
+#line 170 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp5_ = _tmp4_->n_lines;
+#line 170 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (!(_tmp3_ < _tmp5_)) {
+#line 170 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 827 "page.c"
}
+#line 171 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp6_ = line;
+#line 171 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp7_ = i;
+#line 171 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
page_parse_line (self, _tmp6_, _tmp7_, &_tmp8_);
+#line 171 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
size_has_changed = _tmp8_;
+#line 837 "page.c"
}
}
}
+#line 173 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->has_data_ = TRUE;
+#line 175 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp9_ = size_has_changed;
+#line 175 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp9_) {
+#line 176 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_signal_emit_by_name (self, "size-changed");
+#line 849 "page.c"
}
+#line 177 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_signal_emit_by_name (self, "scan-line-changed");
+#line 178 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_signal_emit_by_name (self, "pixels-changed");
+#line 855 "page.c"
}
@@ -635,20 +861,34 @@ void page_finish (Page* self) {
gint _tmp1_;
gboolean _tmp4_;
gboolean _tmp12_;
+#line 181 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (self != NULL);
+#line 183 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
size_has_changed = FALSE;
+#line 186 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1_ = self->priv->expected_rows;
+#line 186 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp1_ < 0) {
+#line 873 "page.c"
gint _tmp2_;
gint _tmp3_ = 0;
+#line 187 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp2_ = self->priv->scan_line;
+#line 187 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp3_ = page_get_scan_height (self);
+#line 187 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = _tmp2_ != _tmp3_;
+#line 882 "page.c"
} else {
+#line 186 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = FALSE;
+#line 886 "page.c"
}
+#line 186 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp4_ = _tmp0_;
+#line 186 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp4_) {
+#line 892 "page.c"
gint rows = 0;
gint _tmp5_;
gint _tmp6_;
@@ -657,38 +897,68 @@ void page_finish (Page* self) {
gint _tmp9_ = 0;
gint _tmp10_;
gint _tmp11_;
+#line 191 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp5_ = self->priv->n_rows;
+#line 191 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
rows = _tmp5_;
+#line 192 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp6_ = self->priv->scan_line;
+#line 192 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->n_rows = _tmp6_;
+#line 193 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp7_ = self->priv->n_rows;
+#line 193 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp8_ = self->priv->rowstride;
+#line 193 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp9_ = _tmp7_ * _tmp8_;
+#line 193 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->pixels = g_renew (guchar, self->priv->pixels, _tmp7_ * _tmp8_);
+#line 193 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
(_tmp9_ > self->priv->pixels_length1) ? memset (self->priv->pixels + self->priv->pixels_length1, 0, sizeof (guchar) * (_tmp9_ - self->priv->pixels_length1)) : NULL;
+#line 193 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->pixels_length1 = _tmp9_;
+#line 193 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->_pixels_size_ = _tmp9_;
+#line 194 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp10_ = rows;
+#line 194 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp11_ = self->priv->n_rows;
- g_debug ("page.vala:193: Trimming page from %d lines to %d lines", _tmp10_, _tmp11_);
+#line 194 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ g_debug ("page.vala:194: Trimming page from %d lines to %d lines", _tmp10_, _tmp11_);
+#line 196 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
size_has_changed = TRUE;
+#line 931 "page.c"
}
+#line 198 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->scanning = FALSE;
+#line 200 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp12_ = size_has_changed;
+#line 200 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp12_) {
+#line 201 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_signal_emit_by_name (self, "size-changed");
+#line 941 "page.c"
}
+#line 202 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_signal_emit_by_name (self, "scan-line-changed");
+#line 203 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ g_signal_emit_by_name (self, "scan-finished");
+#line 947 "page.c"
}
ScanDirection page_get_scan_direction (Page* self) {
ScanDirection result = 0;
ScanDirection _tmp0_;
+#line 206 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (self != NULL, 0);
+#line 208 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = self->priv->scan_direction;
+#line 208 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
result = _tmp0_;
+#line 208 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return result;
+#line 962 "page.c"
}
@@ -710,36 +980,67 @@ static void page_set_scan_direction (Page* self, ScanDirection direction) {
ScanDirection _tmp33_;
gboolean _tmp34_;
gboolean _tmp35_;
+#line 211 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (self != NULL);
+#line 214 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
size_has_changed = FALSE;
+#line 217 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = self->priv->scan_direction;
+#line 217 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1_ = direction;
+#line 217 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp0_ == _tmp1_) {
+#line 218 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return;
+#line 996 "page.c"
}
+#line 221 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp2_ = direction;
+#line 221 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp3_ = self->priv->scan_direction;
+#line 221 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
left_steps = (gint) (_tmp2_ - _tmp3_);
+#line 222 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp4_ = left_steps;
+#line 222 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp4_ < 0) {
+#line 1008 "page.c"
gint _tmp5_;
+#line 223 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp5_ = left_steps;
+#line 223 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
left_steps = _tmp5_ + 4;
+#line 1014 "page.c"
}
+#line 224 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp6_ = left_steps;
+#line 224 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp6_ != 2) {
+#line 225 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
size_has_changed = TRUE;
+#line 1022 "page.c"
}
+#line 227 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp7_ = page_get_width (self);
+#line 227 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
width = _tmp7_;
+#line 228 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp8_ = page_get_height (self);
+#line 228 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
height = _tmp8_;
+#line 231 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp9_ = self->priv->has_crop_;
+#line 231 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp9_) {
+#line 1036 "page.c"
gint _tmp10_;
+#line 233 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp10_ = left_steps;
+#line 233 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
switch (_tmp10_) {
+#line 233 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
case 1:
+#line 1044 "page.c"
{
gint _tmp11_;
gint _tmp12_;
@@ -749,23 +1050,41 @@ static void page_set_scan_direction (Page* self, ScanDirection direction) {
gint _tmp16_;
gint _tmp17_;
gint _tmp18_;
+#line 237 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp11_ = self->priv->crop_x;
+#line 237 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
t = _tmp11_;
+#line 238 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp12_ = self->priv->crop_y;
+#line 238 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_x = _tmp12_;
+#line 239 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp13_ = width;
+#line 239 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp14_ = t;
+#line 239 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp15_ = self->priv->crop_width;
+#line 239 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_y = _tmp13_ - (_tmp14_ + _tmp15_);
+#line 240 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp16_ = self->priv->crop_width;
+#line 240 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
t = _tmp16_;
+#line 241 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp17_ = self->priv->crop_height;
+#line 241 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_width = _tmp17_;
+#line 242 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp18_ = t;
+#line 242 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_height = _tmp18_;
+#line 243 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 1084 "page.c"
}
+#line 233 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
case 2:
+#line 1088 "page.c"
{
gint _tmp19_;
gint _tmp20_;
@@ -773,17 +1092,29 @@ static void page_set_scan_direction (Page* self, ScanDirection direction) {
gint _tmp22_;
gint _tmp23_;
gint _tmp24_;
+#line 246 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp19_ = width;
+#line 246 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp20_ = self->priv->crop_x;
+#line 246 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp21_ = self->priv->crop_width;
+#line 246 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_x = _tmp19_ - (_tmp20_ + _tmp21_);
+#line 247 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp22_ = width;
+#line 247 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp23_ = self->priv->crop_y;
+#line 247 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp24_ = self->priv->crop_height;
+#line 247 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_y = _tmp22_ - (_tmp23_ + _tmp24_);
+#line 248 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 1114 "page.c"
}
+#line 233 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
case 3:
+#line 1118 "page.c"
{
gint _tmp25_;
gint _tmp26_;
@@ -793,36 +1124,65 @@ static void page_set_scan_direction (Page* self, ScanDirection direction) {
gint _tmp30_;
gint _tmp31_;
gint _tmp32_;
+#line 251 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp25_ = self->priv->crop_y;
+#line 251 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
t = _tmp25_;
+#line 252 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp26_ = self->priv->crop_x;
+#line 252 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_y = _tmp26_;
+#line 253 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp27_ = height;
+#line 253 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp28_ = t;
+#line 253 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp29_ = self->priv->crop_height;
+#line 253 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_x = _tmp27_ - (_tmp28_ + _tmp29_);
+#line 254 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp30_ = self->priv->crop_width;
+#line 254 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
t = _tmp30_;
+#line 255 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp31_ = self->priv->crop_height;
+#line 255 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_width = _tmp31_;
+#line 256 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp32_ = t;
+#line 256 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_height = _tmp32_;
+#line 257 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 1158 "page.c"
}
default:
+#line 233 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 1163 "page.c"
}
}
+#line 261 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp33_ = direction;
+#line 261 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->scan_direction = _tmp33_;
+#line 262 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp34_ = size_has_changed;
+#line 262 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp34_) {
+#line 263 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_signal_emit_by_name (self, "size-changed");
+#line 1176 "page.c"
}
+#line 264 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_signal_emit_by_name (self, "scan-direction-changed");
+#line 265 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp35_ = self->priv->has_crop_;
+#line 265 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp35_) {
+#line 266 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_signal_emit_by_name (self, "crop-changed");
+#line 1186 "page.c"
}
}
@@ -832,36 +1192,66 @@ void page_rotate_left (Page* self) {
ScanDirection direction;
ScanDirection _tmp1_;
ScanDirection _tmp2_;
+#line 269 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (self != NULL);
+#line 271 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = self->priv->scan_direction;
+#line 271 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
direction = _tmp0_;
+#line 272 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1_ = direction;
+#line 272 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
switch (_tmp1_) {
+#line 272 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
case SCAN_DIRECTION_TOP_TO_BOTTOM:
+#line 1208 "page.c"
{
+#line 275 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
direction = SCAN_DIRECTION_LEFT_TO_RIGHT;
+#line 276 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 1214 "page.c"
}
+#line 272 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
case SCAN_DIRECTION_LEFT_TO_RIGHT:
+#line 1218 "page.c"
{
+#line 278 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
direction = SCAN_DIRECTION_BOTTOM_TO_TOP;
+#line 279 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 1224 "page.c"
}
+#line 272 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
case SCAN_DIRECTION_BOTTOM_TO_TOP:
+#line 1228 "page.c"
{
+#line 281 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
direction = SCAN_DIRECTION_RIGHT_TO_LEFT;
+#line 282 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 1234 "page.c"
}
+#line 272 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
case SCAN_DIRECTION_RIGHT_TO_LEFT:
+#line 1238 "page.c"
{
+#line 284 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
direction = SCAN_DIRECTION_TOP_TO_BOTTOM;
+#line 285 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 1244 "page.c"
}
default:
+#line 272 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 1249 "page.c"
}
+#line 287 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp2_ = direction;
+#line 287 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
page_set_scan_direction (self, _tmp2_);
+#line 1255 "page.c"
}
@@ -870,46 +1260,81 @@ void page_rotate_right (Page* self) {
ScanDirection direction;
ScanDirection _tmp1_;
ScanDirection _tmp2_;
+#line 290 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (self != NULL);
+#line 292 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = self->priv->scan_direction;
+#line 292 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
direction = _tmp0_;
+#line 293 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1_ = direction;
+#line 293 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
switch (_tmp1_) {
+#line 293 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
case SCAN_DIRECTION_TOP_TO_BOTTOM:
+#line 1276 "page.c"
{
+#line 296 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
direction = SCAN_DIRECTION_RIGHT_TO_LEFT;
+#line 297 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 1282 "page.c"
}
+#line 293 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
case SCAN_DIRECTION_LEFT_TO_RIGHT:
+#line 1286 "page.c"
{
+#line 299 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
direction = SCAN_DIRECTION_TOP_TO_BOTTOM;
+#line 300 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 1292 "page.c"
}
+#line 293 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
case SCAN_DIRECTION_BOTTOM_TO_TOP:
+#line 1296 "page.c"
{
+#line 302 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
direction = SCAN_DIRECTION_LEFT_TO_RIGHT;
+#line 303 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 1302 "page.c"
}
+#line 293 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
case SCAN_DIRECTION_RIGHT_TO_LEFT:
+#line 1306 "page.c"
{
+#line 305 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
direction = SCAN_DIRECTION_BOTTOM_TO_TOP;
+#line 306 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 1312 "page.c"
}
default:
+#line 293 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 1317 "page.c"
}
+#line 308 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp2_ = direction;
+#line 308 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
page_set_scan_direction (self, _tmp2_);
+#line 1323 "page.c"
}
gint page_get_dpi (Page* self) {
gint result = 0;
gint _tmp0_;
+#line 311 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (self != NULL, 0);
+#line 313 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = self->priv->dpi;
+#line 313 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
result = _tmp0_;
+#line 313 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return result;
+#line 1338 "page.c"
}
@@ -917,11 +1342,17 @@ gboolean page_is_landscape (Page* self) {
gboolean result = FALSE;
gint _tmp0_ = 0;
gint _tmp1_ = 0;
+#line 316 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (self != NULL, FALSE);
+#line 318 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = page_get_width (self);
+#line 318 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1_ = page_get_height (self);
+#line 318 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
result = _tmp0_ > _tmp1_;
+#line 318 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return result;
+#line 1356 "page.c"
}
@@ -930,26 +1361,45 @@ gint page_get_width (Page* self) {
gboolean _tmp0_ = FALSE;
ScanDirection _tmp1_;
gboolean _tmp3_;
+#line 321 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (self != NULL, 0);
+#line 323 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1_ = self->priv->scan_direction;
+#line 323 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp1_ == SCAN_DIRECTION_TOP_TO_BOTTOM) {
+#line 323 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = TRUE;
+#line 1373 "page.c"
} else {
ScanDirection _tmp2_;
+#line 323 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp2_ = self->priv->scan_direction;
+#line 323 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = _tmp2_ == SCAN_DIRECTION_BOTTOM_TO_TOP;
+#line 1380 "page.c"
}
+#line 323 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp3_ = _tmp0_;
+#line 323 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp3_) {
+#line 1386 "page.c"
gint _tmp4_;
+#line 324 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp4_ = self->priv->width;
+#line 324 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
result = _tmp4_;
+#line 324 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return result;
+#line 1394 "page.c"
} else {
gint _tmp5_;
+#line 326 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp5_ = self->priv->n_rows;
+#line 326 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
result = _tmp5_;
+#line 326 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return result;
+#line 1403 "page.c"
}
}
@@ -959,26 +1409,45 @@ gint page_get_height (Page* self) {
gboolean _tmp0_ = FALSE;
ScanDirection _tmp1_;
gboolean _tmp3_;
+#line 329 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (self != NULL, 0);
+#line 331 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1_ = self->priv->scan_direction;
+#line 331 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp1_ == SCAN_DIRECTION_TOP_TO_BOTTOM) {
+#line 331 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = TRUE;
+#line 1421 "page.c"
} else {
ScanDirection _tmp2_;
+#line 331 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp2_ = self->priv->scan_direction;
+#line 331 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = _tmp2_ == SCAN_DIRECTION_BOTTOM_TO_TOP;
+#line 1428 "page.c"
}
+#line 331 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp3_ = _tmp0_;
+#line 331 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp3_) {
+#line 1434 "page.c"
gint _tmp4_;
+#line 332 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp4_ = self->priv->n_rows;
+#line 332 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
result = _tmp4_;
+#line 332 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return result;
+#line 1442 "page.c"
} else {
gint _tmp5_;
+#line 334 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp5_ = self->priv->width;
+#line 334 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
result = _tmp5_;
+#line 334 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return result;
+#line 1451 "page.c"
}
}
@@ -986,61 +1455,92 @@ gint page_get_height (Page* self) {
gint page_get_depth (Page* self) {
gint result = 0;
gint _tmp0_;
+#line 337 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (self != NULL, 0);
+#line 339 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = self->priv->depth;
+#line 339 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
result = _tmp0_;
+#line 339 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return result;
+#line 1467 "page.c"
}
gint page_get_n_channels (Page* self) {
gint result = 0;
gint _tmp0_;
+#line 342 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (self != NULL, 0);
+#line 344 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = self->priv->n_channels;
+#line 344 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
result = _tmp0_;
+#line 344 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return result;
+#line 1482 "page.c"
}
gint page_get_rowstride (Page* self) {
gint result = 0;
gint _tmp0_;
+#line 347 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (self != NULL, 0);
+#line 349 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = self->priv->rowstride;
+#line 349 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
result = _tmp0_;
+#line 349 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return result;
+#line 1497 "page.c"
}
gint page_get_scan_width (Page* self) {
gint result = 0;
gint _tmp0_;
+#line 352 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (self != NULL, 0);
+#line 354 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = self->priv->width;
+#line 354 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
result = _tmp0_;
+#line 354 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return result;
+#line 1512 "page.c"
}
gint page_get_scan_height (Page* self) {
gint result = 0;
gint _tmp0_;
+#line 357 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (self != NULL, 0);
+#line 359 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = self->priv->n_rows;
+#line 359 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
result = _tmp0_;
+#line 359 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return result;
+#line 1527 "page.c"
}
void page_set_color_profile (Page* self, const gchar* color_profile) {
const gchar* _tmp0_;
gchar* _tmp1_;
+#line 362 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (self != NULL);
+#line 364 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = color_profile;
+#line 364 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1_ = g_strdup (_tmp0_);
+#line 364 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_g_free0 (self->priv->color_profile);
+#line 364 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->color_profile = _tmp1_;
+#line 1544 "page.c"
}
@@ -1048,23 +1548,37 @@ gchar* page_get_color_profile (Page* self) {
gchar* result = NULL;
const gchar* _tmp0_;
gchar* _tmp1_;
+#line 367 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (self != NULL, NULL);
+#line 369 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = self->priv->color_profile;
+#line 369 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1_ = g_strdup (_tmp0_);
+#line 369 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
result = _tmp1_;
+#line 369 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return result;
+#line 1562 "page.c"
}
void page_set_no_crop (Page* self) {
gboolean _tmp0_;
+#line 372 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (self != NULL);
+#line 374 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = self->priv->has_crop_;
+#line 374 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (!_tmp0_) {
+#line 375 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return;
+#line 1576 "page.c"
}
+#line 376 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->has_crop_ = FALSE;
+#line 377 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_signal_emit_by_name (self, "crop-changed");
+#line 1582 "page.c"
}
@@ -1080,51 +1594,95 @@ void page_set_custom_crop (Page* self, gint width, gint height) {
gboolean _tmp13_;
gint _tmp14_;
gint _tmp15_;
+#line 380 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (self != NULL);
+#line 384 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = width;
+#line 384 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (_tmp0_ >= 1);
+#line 385 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1_ = height;
+#line 385 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (_tmp1_ >= 1);
+#line 387 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp5_ = self->priv->crop_name;
+#line 387 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp5_ == NULL) {
+#line 1612 "page.c"
gboolean _tmp6_;
+#line 387 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp6_ = self->priv->has_crop_;
+#line 387 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp4_ = _tmp6_;
+#line 1618 "page.c"
} else {
+#line 387 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp4_ = FALSE;
+#line 1622 "page.c"
}
+#line 387 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp7_ = _tmp4_;
+#line 387 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp7_) {
+#line 1628 "page.c"
gint _tmp8_;
gint _tmp9_;
+#line 387 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp8_ = self->priv->crop_width;
+#line 387 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp9_ = width;
+#line 387 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp3_ = _tmp8_ == _tmp9_;
+#line 1637 "page.c"
} else {
+#line 387 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp3_ = FALSE;
+#line 1641 "page.c"
}
+#line 387 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp10_ = _tmp3_;
+#line 387 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp10_) {
+#line 1647 "page.c"
gint _tmp11_;
gint _tmp12_;
+#line 387 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp11_ = self->priv->crop_height;
+#line 387 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp12_ = height;
+#line 387 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp2_ = _tmp11_ == _tmp12_;
+#line 1656 "page.c"
} else {
+#line 387 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp2_ = FALSE;
+#line 1660 "page.c"
}
+#line 387 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp13_ = _tmp2_;
+#line 387 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp13_) {
+#line 388 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return;
+#line 1668 "page.c"
}
+#line 389 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_g_free0 (self->priv->crop_name);
+#line 389 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_name = NULL;
+#line 390 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->has_crop_ = TRUE;
+#line 392 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp14_ = width;
+#line 392 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_width = _tmp14_;
+#line 393 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp15_ = height;
+#line 393 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_height = _tmp15_;
+#line 406 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_signal_emit_by_name (self, "crop-changed");
+#line 1686 "page.c"
}
@@ -1134,12 +1692,19 @@ void page_set_named_crop (Page* self, const gchar* name) {
const gchar* _tmp0_;
const gchar* _tmp1_;
GQuark _tmp3_ = 0U;
+#line 412 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
static GQuark _tmp2_label0 = 0;
+#line 412 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
static GQuark _tmp2_label1 = 0;
+#line 412 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
static GQuark _tmp2_label2 = 0;
+#line 412 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
static GQuark _tmp2_label3 = 0;
+#line 412 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
static GQuark _tmp2_label4 = 0;
+#line 412 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
static GQuark _tmp2_label5 = 0;
+#line 1708 "page.c"
const gchar* _tmp5_;
gchar* _tmp6_;
gint _tmp7_ = 0;
@@ -1156,128 +1721,224 @@ void page_set_named_crop (Page* self, const gchar* name) {
gint _tmp19_;
gint _tmp22_;
gint _tmp23_;
+#line 409 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (self != NULL);
+#line 409 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (name != NULL);
+#line 412 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = name;
+#line 412 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1_ = _tmp0_;
+#line 412 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
+#line 412 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp3_ == ((0 != _tmp2_label0) ? _tmp2_label0 : (_tmp2_label0 = g_quark_from_static_string ("A4")))) {
+#line 412 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
switch (0) {
+#line 1739 "page.c"
default:
{
+#line 415 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
width = 8.3;
+#line 416 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
height = 11.7;
+#line 417 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 1748 "page.c"
}
}
} else if (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("A5")))) {
+#line 412 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
switch (0) {
+#line 1754 "page.c"
default:
{
+#line 419 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
width = 5.8;
+#line 420 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
height = 8.3;
+#line 421 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 1763 "page.c"
}
}
} else if (_tmp3_ == ((0 != _tmp2_label2) ? _tmp2_label2 : (_tmp2_label2 = g_quark_from_static_string ("A6")))) {
+#line 412 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
switch (0) {
+#line 1769 "page.c"
default:
{
+#line 423 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
width = 4.1;
+#line 424 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
height = 5.8;
+#line 425 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 1778 "page.c"
}
}
} else if (_tmp3_ == ((0 != _tmp2_label3) ? _tmp2_label3 : (_tmp2_label3 = g_quark_from_static_string ("letter")))) {
+#line 412 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
switch (0) {
+#line 1784 "page.c"
default:
{
+#line 427 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
width = 8.5;
+#line 428 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
height = (gdouble) 11;
+#line 429 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 1793 "page.c"
}
}
} else if (_tmp3_ == ((0 != _tmp2_label4) ? _tmp2_label4 : (_tmp2_label4 = g_quark_from_static_string ("legal")))) {
+#line 412 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
switch (0) {
+#line 1799 "page.c"
default:
{
+#line 431 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
width = 8.5;
+#line 432 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
height = (gdouble) 14;
+#line 433 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 1808 "page.c"
}
}
} else if (_tmp3_ == ((0 != _tmp2_label5) ? _tmp2_label5 : (_tmp2_label5 = g_quark_from_static_string ("4x6")))) {
+#line 412 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
switch (0) {
+#line 1814 "page.c"
default:
{
+#line 435 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
width = (gdouble) 4;
+#line 436 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
height = (gdouble) 6;
+#line 437 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 1823 "page.c"
}
}
} else {
+#line 412 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
switch (0) {
+#line 1829 "page.c"
default:
{
const gchar* _tmp4_;
+#line 439 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp4_ = name;
- g_warning ("page.vala:437: Unknown paper size '%s'", _tmp4_);
+#line 439 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ g_warning ("page.vala:439: Unknown paper size '%s'", _tmp4_);
+#line 440 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return;
+#line 1839 "page.c"
}
}
}
+#line 443 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp5_ = name;
+#line 443 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp6_ = g_strdup (_tmp5_);
+#line 443 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_g_free0 (self->priv->crop_name);
+#line 443 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_name = _tmp6_;
+#line 444 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->has_crop_ = TRUE;
+#line 446 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp7_ = page_get_width (self);
+#line 446 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
pw = _tmp7_;
+#line 447 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp8_ = page_get_height (self);
+#line 447 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
ph = _tmp8_;
+#line 450 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp9_ = pw;
+#line 450 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp10_ = ph;
+#line 450 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp9_ > _tmp10_) {
+#line 1867 "page.c"
gdouble t = 0.0;
gdouble _tmp11_;
gdouble _tmp12_;
gdouble _tmp13_;
+#line 453 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp11_ = width;
+#line 453 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
t = _tmp11_;
+#line 454 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp12_ = height;
+#line 454 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
width = _tmp12_;
+#line 455 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp13_ = t;
+#line 455 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
height = _tmp13_;
+#line 1884 "page.c"
}
+#line 459 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp14_ = width;
+#line 459 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp15_ = self->priv->dpi;
+#line 459 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_width = (gint) ((_tmp14_ * _tmp15_) + 0.5);
+#line 460 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp16_ = height;
+#line 460 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp17_ = self->priv->dpi;
+#line 460 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_height = (gint) ((_tmp16_ * _tmp17_) + 0.5);
+#line 462 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp18_ = self->priv->crop_width;
+#line 462 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp19_ = pw;
+#line 462 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp18_ < _tmp19_) {
+#line 1904 "page.c"
gint _tmp20_;
gint _tmp21_;
+#line 463 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp20_ = pw;
+#line 463 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp21_ = self->priv->crop_width;
+#line 463 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_x = (_tmp20_ - _tmp21_) / 2;
+#line 1913 "page.c"
} else {
+#line 465 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_x = 0;
+#line 1917 "page.c"
}
+#line 466 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp22_ = self->priv->crop_height;
+#line 466 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp23_ = ph;
+#line 466 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp22_ < _tmp23_) {
+#line 1925 "page.c"
gint _tmp24_;
gint _tmp25_;
+#line 467 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp24_ = ph;
+#line 467 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp25_ = self->priv->crop_height;
+#line 467 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_y = (_tmp24_ - _tmp25_) / 2;
+#line 1934 "page.c"
} else {
+#line 469 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_y = 0;
+#line 1938 "page.c"
}
+#line 470 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_signal_emit_by_name (self, "crop-changed");
+#line 1942 "page.c"
}
@@ -1290,22 +1951,39 @@ void page_move_crop (Page* self, gint x, gint y) {
gint _tmp5_ = 0;
gint _tmp6_;
gint _tmp7_;
+#line 473 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (self != NULL);
+#line 475 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = x;
+#line 475 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (_tmp0_ >= 0);
+#line 476 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1_ = y;
+#line 476 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (_tmp1_ >= 0);
+#line 477 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp2_ = x;
+#line 477 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp3_ = page_get_width (self);
+#line 477 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (_tmp2_ < _tmp3_);
+#line 478 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp4_ = y;
+#line 478 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp5_ = page_get_height (self);
+#line 478 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (_tmp4_ < _tmp5_);
+#line 480 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp6_ = x;
+#line 480 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_x = _tmp6_;
+#line 481 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp7_ = y;
+#line 481 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_y = _tmp7_;
+#line 482 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_signal_emit_by_name (self, "crop-changed");
+#line 1987 "page.c"
}
@@ -1316,19 +1994,33 @@ void page_rotate_crop (Page* self) {
gint _tmp2_;
gint _tmp3_;
const gchar* _tmp4_;
+#line 485 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (self != NULL);
+#line 489 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = self->priv->has_crop_;
+#line 489 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (!_tmp0_) {
+#line 490 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return;
+#line 2006 "page.c"
}
+#line 492 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1_ = self->priv->crop_width;
+#line 492 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
t = _tmp1_;
+#line 493 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp2_ = self->priv->crop_height;
+#line 493 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_width = _tmp2_;
+#line 494 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp3_ = t;
+#line 494 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_height = _tmp3_;
+#line 497 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp4_ = self->priv->crop_name;
+#line 497 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp4_ == NULL) {
+#line 2024 "page.c"
gint w = 0;
gint h = 0;
gint _tmp5_ = 0;
@@ -1341,56 +2033,99 @@ void page_rotate_crop (Page* self) {
gint _tmp15_;
gint _tmp16_;
gint _tmp19_;
+#line 501 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp5_ = page_get_width (self);
+#line 501 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
w = _tmp5_;
+#line 502 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp6_ = page_get_height (self);
+#line 502 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
h = _tmp6_;
+#line 504 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp7_ = self->priv->crop_x;
+#line 504 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp8_ = self->priv->crop_width;
+#line 504 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp9_ = w;
+#line 504 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if ((_tmp7_ + _tmp8_) > _tmp9_) {
+#line 2053 "page.c"
gint _tmp10_;
gint _tmp11_;
+#line 505 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp10_ = w;
+#line 505 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp11_ = self->priv->crop_width;
+#line 505 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_x = _tmp10_ - _tmp11_;
+#line 2062 "page.c"
}
+#line 506 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp12_ = self->priv->crop_x;
+#line 506 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp12_ < 0) {
+#line 2068 "page.c"
gint _tmp13_;
+#line 508 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_x = 0;
+#line 509 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp13_ = w;
+#line 509 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_width = _tmp13_;
+#line 2076 "page.c"
}
+#line 511 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp14_ = self->priv->crop_y;
+#line 511 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp15_ = self->priv->crop_height;
+#line 511 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp16_ = h;
+#line 511 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if ((_tmp14_ + _tmp15_) > _tmp16_) {
+#line 2086 "page.c"
gint _tmp17_;
gint _tmp18_;
+#line 512 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp17_ = h;
+#line 512 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp18_ = self->priv->crop_height;
+#line 512 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_y = _tmp17_ - _tmp18_;
+#line 2095 "page.c"
}
+#line 513 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp19_ = self->priv->crop_y;
+#line 513 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp19_ < 0) {
+#line 2101 "page.c"
gint _tmp20_;
+#line 515 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_y = 0;
+#line 516 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp20_ = h;
+#line 516 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->crop_height = _tmp20_;
+#line 2109 "page.c"
}
}
+#line 520 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_signal_emit_by_name (self, "crop-changed");
+#line 2114 "page.c"
}
gboolean page_has_crop (Page* self) {
gboolean result = FALSE;
gboolean _tmp0_;
+#line 523 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (self != NULL, FALSE);
+#line 525 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = self->priv->has_crop_;
+#line 525 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
result = _tmp0_;
+#line 525 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return result;
+#line 2129 "page.c"
}
@@ -1403,26 +2138,47 @@ void page_get_crop (Page* self, gint* x, gint* y, gint* width, gint* height) {
gint _tmp1_;
gint _tmp2_;
gint _tmp3_;
+#line 528 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (self != NULL);
+#line 530 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = self->priv->crop_x;
+#line 530 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_vala_x = _tmp0_;
+#line 531 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1_ = self->priv->crop_y;
+#line 531 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_vala_y = _tmp1_;
+#line 532 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp2_ = self->priv->crop_width;
+#line 532 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_vala_width = _tmp2_;
+#line 533 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp3_ = self->priv->crop_height;
+#line 533 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_vala_height = _tmp3_;
+#line 528 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (x) {
+#line 528 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
*x = _vala_x;
+#line 2164 "page.c"
}
+#line 528 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (y) {
+#line 528 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
*y = _vala_y;
+#line 2170 "page.c"
}
+#line 528 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (width) {
+#line 528 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
*width = _vala_width;
+#line 2176 "page.c"
}
+#line 528 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (height) {
+#line 528 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
*height = _vala_height;
+#line 2182 "page.c"
}
}
@@ -1431,11 +2187,17 @@ gchar* page_get_named_crop (Page* self) {
gchar* result = NULL;
const gchar* _tmp0_;
gchar* _tmp1_;
+#line 536 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (self != NULL, NULL);
+#line 538 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = self->priv->crop_name;
+#line 538 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1_ = g_strdup (_tmp0_);
+#line 538 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
result = _tmp1_;
+#line 538 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return result;
+#line 2201 "page.c"
}
@@ -1445,24 +2207,83 @@ guchar* page_get_pixels (Page* self, int* result_length1) {
gint _tmp0__length1;
guchar* _tmp1_;
gint _tmp1__length1;
+#line 541 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (self != NULL, NULL);
+#line 543 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = self->priv->pixels;
+#line 543 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0__length1 = self->priv->pixels_length1;
+#line 543 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1_ = _tmp0_;
+#line 543 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1__length1 = _tmp0__length1;
+#line 543 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (result_length1) {
+#line 543 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
*result_length1 = _tmp1__length1;
+#line 2225 "page.c"
}
+#line 543 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
result = _tmp1_;
+#line 543 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return result;
+#line 2231 "page.c"
+}
+
+
+static guchar* _vala_array_dup3 (guchar* self, int length) {
+#line 548 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ return g_memdup (self, length * sizeof (guchar));
+#line 2238 "page.c"
+}
+
+
+void page_set_pixels (Page* self, guchar* new_pixels, int new_pixels_length1) {
+ guchar* _tmp0_;
+ gint _tmp0__length1;
+ guchar* _tmp1_;
+ gint _tmp1__length1;
+ guchar* _tmp2_;
+ gint _tmp2__length1;
+#line 546 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ g_return_if_fail (self != NULL);
+#line 548 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp0_ = new_pixels;
+#line 548 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp0__length1 = new_pixels_length1;
+#line 548 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup3 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
+#line 548 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp1__length1 = _tmp0__length1;
+#line 548 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ self->priv->pixels = (g_free (self->priv->pixels), NULL);
+#line 548 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ self->priv->pixels = _tmp1_;
+#line 548 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ self->priv->pixels_length1 = _tmp1__length1;
+#line 548 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ self->priv->_pixels_size_ = self->priv->pixels_length1;
+#line 549 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp2_ = new_pixels;
+#line 549 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp2__length1 = new_pixels_length1;
+#line 549 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ self->priv->has_data_ = _tmp2_ != NULL;
+#line 550 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ g_signal_emit_by_name (self, "pixels-changed");
+#line 2275 "page.c"
}
static guchar page_get_sample (Page* self, guchar* pixels, int pixels_length1, gint offset, gint x, gint depth, gint n_channels, gint channel) {
guchar result = '\0';
+#line 554 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (self != NULL, '\0');
+#line 557 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
result = (guchar) 0xFF;
+#line 557 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return result;
+#line 2287 "page.c"
}
@@ -1511,79 +2332,138 @@ static void page_get_pixel (Page* self, gint x, gint y, guchar* pixel, int pixel
gint _tmp128_;
guchar _tmp129_ = '\0';
guchar _tmp130_;
+#line 561 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (self != NULL);
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = page_get_scan_direction (self);
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
switch (_tmp0_) {
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
case SCAN_DIRECTION_TOP_TO_BOTTOM:
+#line 2344 "page.c"
{
+#line 566 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 2348 "page.c"
}
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
case SCAN_DIRECTION_BOTTOM_TO_TOP:
+#line 2352 "page.c"
{
gint _tmp1_ = 0;
gint _tmp2_;
gint _tmp3_ = 0;
gint _tmp4_;
+#line 568 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1_ = page_get_scan_width (self);
+#line 568 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp2_ = x;
+#line 568 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
x = (_tmp1_ - _tmp2_) - 1;
+#line 569 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp3_ = page_get_scan_height (self);
+#line 569 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp4_ = y;
+#line 569 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
y = (_tmp3_ - _tmp4_) - 1;
+#line 570 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 2372 "page.c"
}
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
case SCAN_DIRECTION_LEFT_TO_RIGHT:
+#line 2376 "page.c"
{
gint _tmp5_;
gint t;
gint _tmp6_ = 0;
gint _tmp7_;
gint _tmp8_;
+#line 572 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp5_ = x;
+#line 572 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
t = _tmp5_;
+#line 573 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp6_ = page_get_scan_width (self);
+#line 573 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp7_ = y;
+#line 573 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
x = (_tmp6_ - _tmp7_) - 1;
+#line 574 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp8_ = t;
+#line 574 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
y = _tmp8_;
+#line 575 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 2399 "page.c"
}
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
case SCAN_DIRECTION_RIGHT_TO_LEFT:
+#line 2403 "page.c"
{
gint _tmp9_;
gint t;
gint _tmp10_;
gint _tmp11_ = 0;
gint _tmp12_;
+#line 577 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp9_ = x;
+#line 577 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
t = _tmp9_;
+#line 578 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp10_ = y;
+#line 578 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
x = _tmp10_;
+#line 579 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp11_ = page_get_scan_height (self);
+#line 579 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp12_ = t;
+#line 579 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
y = (_tmp11_ - _tmp12_) - 1;
+#line 580 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 2426 "page.c"
}
default:
+#line 563 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 2431 "page.c"
}
+#line 583 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp13_ = page_get_depth (self);
+#line 583 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
depth = _tmp13_;
+#line 584 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp14_ = page_get_n_channels (self);
+#line 584 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
n_channels = _tmp14_;
+#line 585 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp15_ = page_get_rowstride (self);
+#line 585 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp16_ = y;
+#line 585 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
line_offset = _tmp15_ * _tmp16_;
+#line 588 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp18_ = depth;
+#line 588 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp18_ == 8) {
+#line 2451 "page.c"
gint _tmp19_;
+#line 588 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp19_ = n_channels;
+#line 588 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp17_ = _tmp19_ == 3;
+#line 2457 "page.c"
} else {
+#line 588 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp17_ = FALSE;
+#line 2461 "page.c"
}
+#line 588 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp20_ = _tmp17_;
+#line 588 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp20_) {
+#line 2467 "page.c"
gint _tmp21_;
gint _tmp22_;
gint _tmp23_;
@@ -1612,52 +2492,96 @@ static void page_get_pixel (Page* self, gint x, gint y, guchar* pixel, int pixel
gint _tmp39_;
guchar _tmp40_;
guchar _tmp41_;
+#line 590 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp21_ = line_offset;
+#line 590 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp22_ = x;
+#line 590 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp23_ = n_channels;
+#line 590 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
o = _tmp21_ + (_tmp22_ * _tmp23_);
+#line 591 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp24_ = pixel;
+#line 591 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp24__length1 = pixel_length1;
+#line 591 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp25_ = offset;
+#line 591 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp26_ = self->priv->pixels;
+#line 591 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp26__length1 = self->priv->pixels_length1;
+#line 591 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp27_ = o;
+#line 591 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp28_ = _tmp26_[_tmp27_];
+#line 591 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp24_[_tmp25_ + 0] = _tmp28_;
+#line 591 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp29_ = _tmp24_[_tmp25_ + 0];
+#line 592 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp30_ = pixel;
+#line 592 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp30__length1 = pixel_length1;
+#line 592 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp31_ = offset;
+#line 592 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp32_ = self->priv->pixels;
+#line 592 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp32__length1 = self->priv->pixels_length1;
+#line 592 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp33_ = o;
+#line 592 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp34_ = _tmp32_[_tmp33_ + 1];
+#line 592 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp30_[_tmp31_ + 1] = _tmp34_;
+#line 592 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp35_ = _tmp30_[_tmp31_ + 1];
+#line 593 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp36_ = pixel;
+#line 593 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp36__length1 = pixel_length1;
+#line 593 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp37_ = offset;
+#line 593 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp38_ = self->priv->pixels;
+#line 593 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp38__length1 = self->priv->pixels_length1;
+#line 593 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp39_ = o;
+#line 593 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp40_ = _tmp38_[_tmp39_ + 2];
+#line 593 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp36_[_tmp37_ + 2] = _tmp40_;
+#line 593 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp41_ = _tmp36_[_tmp37_ + 2];
+#line 594 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return;
+#line 2560 "page.c"
} else {
gboolean _tmp42_ = FALSE;
gint _tmp43_;
gboolean _tmp45_;
+#line 596 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp43_ = depth;
+#line 596 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp43_ == 8) {
+#line 2569 "page.c"
gint _tmp44_;
+#line 596 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp44_ = n_channels;
+#line 596 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp42_ = _tmp44_ == 1;
+#line 2575 "page.c"
} else {
+#line 596 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp42_ = FALSE;
+#line 2579 "page.c"
}
+#line 596 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp45_ = _tmp42_;
+#line 596 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp45_) {
+#line 2585 "page.c"
guchar* _tmp46_;
gint _tmp46__length1;
gint _tmp47_;
@@ -1677,43 +2601,78 @@ static void page_get_pixel (Page* self, gint x, gint y, guchar* pixel, int pixel
guchar _tmp57_;
guchar _tmp58_;
guchar _tmp59_;
+#line 598 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp46_ = self->priv->pixels;
+#line 598 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp46__length1 = self->priv->pixels_length1;
+#line 598 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp47_ = line_offset;
+#line 598 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp48_ = x;
+#line 598 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp49_ = _tmp46_[_tmp47_ + _tmp48_];
+#line 598 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
p = _tmp49_;
+#line 599 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp50_ = pixel;
+#line 599 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp50__length1 = pixel_length1;
+#line 599 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp51_ = offset;
+#line 599 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp52_ = pixel;
+#line 599 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp52__length1 = pixel_length1;
+#line 599 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp53_ = offset;
+#line 599 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp54_ = pixel;
+#line 599 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp54__length1 = pixel_length1;
+#line 599 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp55_ = offset;
+#line 599 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp56_ = p;
+#line 599 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp54_[_tmp55_ + 2] = _tmp56_;
+#line 599 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp57_ = _tmp54_[_tmp55_ + 2];
+#line 599 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp52_[_tmp53_ + 1] = _tmp57_;
+#line 599 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp58_ = _tmp52_[_tmp53_ + 1];
+#line 599 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp50_[_tmp51_ + 0] = _tmp58_;
+#line 599 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp59_ = _tmp50_[_tmp51_ + 0];
+#line 600 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return;
+#line 2651 "page.c"
} else {
gboolean _tmp60_ = FALSE;
gint _tmp61_;
gboolean _tmp63_;
+#line 604 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp61_ = depth;
+#line 604 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp61_ == 1) {
+#line 2660 "page.c"
gint _tmp62_;
+#line 604 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp62_ = n_channels;
+#line 604 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp60_ = _tmp62_ == 1;
+#line 2666 "page.c"
} else {
+#line 604 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp60_ = FALSE;
+#line 2670 "page.c"
}
+#line 604 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp63_ = _tmp60_;
+#line 604 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp63_) {
+#line 2676 "page.c"
guchar* _tmp64_;
gint _tmp64__length1;
gint _tmp65_;
@@ -1736,50 +2695,92 @@ static void page_get_pixel (Page* self, gint x, gint y, guchar* pixel, int pixel
guchar _tmp78_;
guchar _tmp79_;
guchar _tmp80_;
+#line 606 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp64_ = self->priv->pixels;
+#line 606 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp64__length1 = self->priv->pixels_length1;
+#line 606 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp65_ = line_offset;
+#line 606 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp66_ = x;
+#line 606 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp67_ = _tmp64_[_tmp65_ + (_tmp66_ / 8)];
+#line 606 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
p = _tmp67_;
+#line 607 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp69_ = p;
+#line 607 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp70_ = x;
+#line 607 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (((gint) (_tmp69_ & (0x80 >> (_tmp70_ % 8)))) != 0) {
+#line 607 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp68_ = 0x00;
+#line 2719 "page.c"
} else {
+#line 607 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp68_ = 0xFF;
+#line 2723 "page.c"
}
+#line 607 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp71_ = pixel;
+#line 607 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp71__length1 = pixel_length1;
+#line 607 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp72_ = offset;
+#line 607 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp73_ = pixel;
+#line 607 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp73__length1 = pixel_length1;
+#line 607 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp74_ = offset;
+#line 607 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp75_ = pixel;
+#line 607 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp75__length1 = pixel_length1;
+#line 607 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp76_ = offset;
+#line 607 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp77_ = _tmp68_;
+#line 607 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp75_[_tmp76_ + 2] = (guchar) _tmp77_;
+#line 607 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp78_ = _tmp75_[_tmp76_ + 2];
+#line 607 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp73_[_tmp74_ + 1] = _tmp78_;
+#line 607 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp79_ = _tmp73_[_tmp74_ + 1];
+#line 607 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp71_[_tmp72_ + 0] = _tmp79_;
+#line 607 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp80_ = _tmp71_[_tmp72_ + 0];
+#line 608 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return;
+#line 2759 "page.c"
} else {
gboolean _tmp81_ = FALSE;
gint _tmp82_;
gboolean _tmp84_;
+#line 612 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp82_ = depth;
+#line 612 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp82_ == 2) {
+#line 2768 "page.c"
gint _tmp83_;
+#line 612 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp83_ = n_channels;
+#line 612 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp81_ = _tmp83_ == 1;
+#line 2774 "page.c"
} else {
+#line 612 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp81_ = FALSE;
+#line 2778 "page.c"
}
+#line 612 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp84_ = _tmp81_;
+#line 612 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp84_) {
+#line 2784 "page.c"
gint _tmp85_[4] = {0};
gint block_shift[4];
guchar* _tmp86_;
@@ -1806,80 +2807,152 @@ static void page_get_pixel (Page* self, gint x, gint y, guchar* pixel, int pixel
guchar _tmp101_;
guchar _tmp102_;
guchar _tmp103_;
+#line 614 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp85_[0] = 6;
+#line 614 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp85_[1] = 4;
+#line 614 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp85_[2] = 2;
+#line 614 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp85_[3] = 0;
+#line 614 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
memcpy (block_shift, _tmp85_, 4 * sizeof (gint));
+#line 616 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp86_ = self->priv->pixels;
+#line 616 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp86__length1 = self->priv->pixels_length1;
+#line 616 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp87_ = line_offset;
+#line 616 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp88_ = x;
+#line 616 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp89_ = _tmp86_[_tmp87_ + (_tmp88_ / 4)];
+#line 616 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
p = _tmp89_;
+#line 617 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp90_ = p;
+#line 617 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp91_ = x;
+#line 617 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp92_ = block_shift[_tmp91_ % 4];
+#line 617 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
sample = (_tmp90_ >> _tmp92_) & 0x3;
+#line 618 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp93_ = sample;
+#line 618 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
sample = (_tmp93_ * 255) / 3;
+#line 620 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp94_ = pixel;
+#line 620 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp94__length1 = pixel_length1;
+#line 620 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp95_ = offset;
+#line 620 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp96_ = pixel;
+#line 620 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp96__length1 = pixel_length1;
+#line 620 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp97_ = offset;
+#line 620 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp98_ = pixel;
+#line 620 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp98__length1 = pixel_length1;
+#line 620 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp99_ = offset;
+#line 620 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp100_ = sample;
+#line 620 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp98_[_tmp99_ + 2] = (guchar) _tmp100_;
+#line 620 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp101_ = _tmp98_[_tmp99_ + 2];
+#line 620 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp96_[_tmp97_ + 1] = _tmp101_;
+#line 620 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp102_ = _tmp96_[_tmp97_ + 1];
+#line 620 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp94_[_tmp95_ + 0] = _tmp102_;
+#line 620 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp103_ = _tmp94_[_tmp95_ + 0];
+#line 621 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return;
+#line 2879 "page.c"
}
}
}
}
+#line 625 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp104_ = pixel;
+#line 625 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp104__length1 = pixel_length1;
+#line 625 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp105_ = offset;
+#line 625 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp106_ = self->priv->pixels;
+#line 625 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp106__length1 = self->priv->pixels_length1;
+#line 625 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp107_ = line_offset;
+#line 625 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp108_ = x;
+#line 625 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp109_ = depth;
+#line 625 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp110_ = n_channels;
+#line 625 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp111_ = page_get_sample (self, _tmp106_, _tmp106__length1, _tmp107_, _tmp108_, _tmp109_, _tmp110_, 0);
+#line 625 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp104_[_tmp105_ + 0] = _tmp111_;
+#line 625 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp112_ = _tmp104_[_tmp105_ + 0];
+#line 626 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp113_ = pixel;
+#line 626 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp113__length1 = pixel_length1;
+#line 626 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp114_ = offset;
+#line 626 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp115_ = self->priv->pixels;
+#line 626 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp115__length1 = self->priv->pixels_length1;
+#line 626 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp116_ = line_offset;
+#line 626 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp117_ = x;
+#line 626 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp118_ = depth;
+#line 626 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp119_ = n_channels;
+#line 626 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp120_ = page_get_sample (self, _tmp115_, _tmp115__length1, _tmp116_, _tmp117_, _tmp118_, _tmp119_, 1);
+#line 626 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp113_[_tmp114_ + 1] = _tmp120_;
+#line 626 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp121_ = _tmp113_[_tmp114_ + 1];
+#line 627 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp122_ = pixel;
+#line 627 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp122__length1 = pixel_length1;
+#line 627 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp123_ = offset;
+#line 627 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp124_ = self->priv->pixels;
+#line 627 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp124__length1 = self->priv->pixels_length1;
+#line 627 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp125_ = line_offset;
+#line 627 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp126_ = x;
+#line 627 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp127_ = depth;
+#line 627 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp128_ = n_channels;
+#line 627 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp129_ = page_get_sample (self, _tmp124_, _tmp124__length1, _tmp125_, _tmp126_, _tmp127_, _tmp128_, 2);
+#line 627 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp122_[_tmp123_ + 2] = _tmp129_;
+#line 627 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp130_ = _tmp122_[_tmp123_ + 2];
+#line 2956 "page.c"
}
@@ -1903,17 +2976,29 @@ GdkPixbuf* page_get_image (Page* self, gboolean apply_crop) {
guint8* image_pixels;
gint image_pixels_length1;
gint _image_pixels_size_;
+#line 630 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (self != NULL, NULL);
+#line 633 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1_ = apply_crop;
+#line 633 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp1_) {
+#line 2986 "page.c"
gboolean _tmp2_;
+#line 633 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp2_ = self->priv->has_crop_;
+#line 633 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = _tmp2_;
+#line 2992 "page.c"
} else {
+#line 633 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = FALSE;
+#line 2996 "page.c"
}
+#line 633 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp3_ = _tmp0_;
+#line 633 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp3_) {
+#line 3002 "page.c"
gint _tmp4_;
gint _tmp5_;
gint _tmp6_;
@@ -1926,68 +3011,125 @@ GdkPixbuf* page_get_image (Page* self, gboolean apply_crop) {
gint _tmp14_;
gint _tmp15_;
gint _tmp16_ = 0;
+#line 635 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp4_ = self->priv->crop_x;
+#line 635 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
l = _tmp4_;
+#line 636 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp5_ = l;
+#line 636 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp6_ = self->priv->crop_width;
+#line 636 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
r = _tmp5_ + _tmp6_;
+#line 637 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp7_ = self->priv->crop_y;
+#line 637 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
t = _tmp7_;
+#line 638 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp8_ = t;
+#line 638 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp9_ = self->priv->crop_height;
+#line 638 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
b = _tmp8_ + _tmp9_;
+#line 640 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp10_ = l;
+#line 640 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp10_ < 0) {
+#line 641 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
l = 0;
+#line 3041 "page.c"
}
+#line 642 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp11_ = r;
+#line 642 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp12_ = page_get_width (self);
+#line 642 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp11_ > _tmp12_) {
+#line 3049 "page.c"
gint _tmp13_ = 0;
+#line 643 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp13_ = page_get_width (self);
+#line 643 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
r = _tmp13_;
+#line 3055 "page.c"
}
+#line 644 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp14_ = t;
+#line 644 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp14_ < 0) {
+#line 645 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
t = 0;
+#line 3063 "page.c"
}
+#line 646 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp15_ = b;
+#line 646 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp16_ = page_get_height (self);
+#line 646 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp15_ > _tmp16_) {
+#line 3071 "page.c"
gint _tmp17_ = 0;
+#line 647 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp17_ = page_get_height (self);
+#line 647 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
b = _tmp17_;
+#line 3077 "page.c"
}
} else {
gint _tmp18_ = 0;
gint _tmp19_ = 0;
+#line 651 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
l = 0;
+#line 652 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp18_ = page_get_width (self);
+#line 652 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
r = _tmp18_;
+#line 653 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
t = 0;
+#line 654 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp19_ = page_get_height (self);
+#line 654 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
b = _tmp19_;
+#line 3094 "page.c"
}
+#line 657 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp20_ = r;
+#line 657 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp21_ = l;
+#line 657 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp22_ = b;
+#line 657 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp23_ = t;
+#line 657 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp24_ = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, _tmp20_ - _tmp21_, _tmp22_ - _tmp23_);
+#line 657 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
image = _tmp24_;
+#line 658 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp25_ = image;
+#line 658 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp26_ = gdk_pixbuf_get_pixels (_tmp25_);
+#line 658 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
image_pixels = _tmp26_;
+#line 658 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
image_pixels_length1 = -1;
+#line 658 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_image_pixels_size_ = image_pixels_length1;
+#line 3118 "page.c"
{
gint _tmp27_;
gint y;
+#line 659 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp27_ = t;
+#line 659 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
y = _tmp27_;
+#line 3126 "page.c"
{
gboolean _tmp28_;
+#line 659 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp28_ = TRUE;
+#line 659 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
while (TRUE) {
+#line 3133 "page.c"
gboolean _tmp29_;
gint _tmp31_;
gint _tmp32_;
@@ -1996,32 +3138,56 @@ GdkPixbuf* page_get_image (Page* self, gboolean apply_crop) {
gint _tmp35_;
gint _tmp36_;
gint offset;
+#line 659 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp29_ = _tmp28_;
+#line 659 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (!_tmp29_) {
+#line 3146 "page.c"
gint _tmp30_;
+#line 659 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp30_ = y;
+#line 659 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
y = _tmp30_ + 1;
+#line 3152 "page.c"
}
+#line 659 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp28_ = FALSE;
+#line 659 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp31_ = y;
+#line 659 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp32_ = b;
+#line 659 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (!(_tmp31_ < _tmp32_)) {
+#line 659 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 3164 "page.c"
}
+#line 661 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp33_ = image;
+#line 661 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp34_ = gdk_pixbuf_get_rowstride (_tmp33_);
+#line 661 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp35_ = y;
+#line 661 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp36_ = t;
+#line 661 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
offset = _tmp34_ * (_tmp35_ - _tmp36_);
+#line 3176 "page.c"
{
gint _tmp37_;
gint x;
+#line 662 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp37_ = l;
+#line 662 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
x = _tmp37_;
+#line 3184 "page.c"
{
gboolean _tmp38_;
+#line 662 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp38_ = TRUE;
+#line 662 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
while (TRUE) {
+#line 3191 "page.c"
gboolean _tmp39_;
gint _tmp41_;
gint _tmp42_;
@@ -2032,34 +3198,58 @@ GdkPixbuf* page_get_image (Page* self, gboolean apply_crop) {
gint _tmp46_;
gint _tmp47_;
gint _tmp48_;
+#line 662 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp39_ = _tmp38_;
+#line 662 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (!_tmp39_) {
+#line 3206 "page.c"
gint _tmp40_;
+#line 662 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp40_ = x;
+#line 662 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
x = _tmp40_ + 1;
+#line 3212 "page.c"
}
+#line 662 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp38_ = FALSE;
+#line 662 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp41_ = x;
+#line 662 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp42_ = r;
+#line 662 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (!(_tmp41_ < _tmp42_)) {
+#line 662 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
break;
+#line 3224 "page.c"
}
+#line 663 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp43_ = x;
+#line 663 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp44_ = y;
+#line 663 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp45_ = image_pixels;
+#line 663 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp45__length1 = image_pixels_length1;
+#line 663 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp46_ = offset;
+#line 663 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp47_ = x;
+#line 663 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp48_ = l;
+#line 663 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
page_get_pixel (self, _tmp43_, _tmp44_, _tmp45_, _tmp45__length1, _tmp46_ + ((_tmp47_ - _tmp48_) * 3));
+#line 3242 "page.c"
}
}
}
}
}
}
+#line 666 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
result = image;
+#line 666 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return result;
+#line 3253 "page.c"
}
@@ -2078,27 +3268,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 3308 "page.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 3314 "page.c"
}
@@ -2113,56 +3325,143 @@ static gchar* page_get_icc_data_encoded (Page* self, const gchar* icc_profile_fi
gchar* _tmp8_ = NULL;
gchar* _tmp9_;
GError * _inner_error_ = NULL;
+#line 669 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (self != NULL, NULL);
+#line 669 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (icc_profile_filename != NULL, NULL);
+#line 3333 "page.c"
{
const gchar* _tmp0_;
gchar* _tmp1_ = NULL;
+#line 675 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = icc_profile_filename;
+#line 675 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_file_get_contents (_tmp0_, &_tmp1_, NULL, &_inner_error_);
+#line 675 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_g_free0 (contents);
+#line 675 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
contents = _tmp1_;
+#line 675 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_inner_error_ != NULL) {
- goto __catch2_g_error;
+#line 3347 "page.c"
+ goto __catch3_g_error;
}
}
- goto __finally2;
- __catch2_g_error:
+ goto __finally3;
+ __catch3_g_error:
{
GError* e = NULL;
GError* _tmp2_;
const gchar* _tmp3_;
+#line 673 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
e = _inner_error_;
+#line 673 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_inner_error_ = NULL;
+#line 679 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp2_ = e;
+#line 679 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp3_ = _tmp2_->message;
- g_warning ("page.vala:670: failed to get icc profile data: %s", _tmp3_);
+#line 679 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ g_warning ("page.vala:679: failed to get icc profile data: %s", _tmp3_);
+#line 680 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
result = NULL;
+#line 680 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_g_error_free0 (e);
+#line 680 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_g_free0 (contents);
+#line 680 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return result;
+#line 3375 "page.c"
}
- __finally2:
+ __finally3:
+#line 673 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_inner_error_ != NULL) {
+#line 673 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_g_free0 (contents);
+#line 673 "/home/bob/bzr/simple-scan/trunk/src/page.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 673 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_clear_error (&_inner_error_);
+#line 673 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return NULL;
+#line 3388 "page.c"
}
+#line 684 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp4_ = contents;
+#line 684 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp6_ = string_to_utf8 (_tmp4_, &_tmp5_);
+#line 684 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp7_ = (guchar*) _tmp6_;
+#line 684 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp7__length1 = (_tmp5_ * sizeof (gchar)) / sizeof (guchar);
+#line 684 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp8_ = g_base64_encode (_tmp7_, (_tmp5_ * sizeof (gchar)) / sizeof (guchar));
+#line 684 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp9_ = _tmp8_;
+#line 684 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp7_ = (g_free (_tmp7_), NULL);
+#line 684 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
result = _tmp9_;
+#line 684 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_g_free0 (contents);
+#line 684 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return result;
+#line 3410 "page.c"
+}
+
+
+static gpointer _g_object_ref0 (gpointer self) {
+#line 689 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ return self ? g_object_ref (self) : NULL;
+#line 3417 "page.c"
}
-void page_save (Page* self, const gchar* type, GFile* file, GError** error) {
+void page_copy_to_clipboard (Page* self, GtkWindow* window) {
+ GtkWindow* _tmp0_;
+ GdkDisplay* _tmp1_ = NULL;
+ GdkDisplay* _tmp2_;
+ GdkDisplay* display;
+ GtkClipboard* _tmp3_ = NULL;
+ GtkClipboard* _tmp4_;
+ GtkClipboard* clipboard;
+ GdkPixbuf* _tmp5_ = NULL;
+ GdkPixbuf* image;
+#line 687 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ g_return_if_fail (self != NULL);
+#line 687 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ g_return_if_fail (window != NULL);
+#line 689 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp0_ = window;
+#line 689 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp1_ = gtk_widget_get_display ((GtkWidget*) _tmp0_);
+#line 689 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp2_ = _g_object_ref0 (_tmp1_);
+#line 689 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ display = _tmp2_;
+#line 690 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp3_ = gtk_clipboard_get_for_display (display, GDK_SELECTION_CLIPBOARD);
+#line 690 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp4_ = _g_object_ref0 (_tmp3_);
+#line 690 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ clipboard = _tmp4_;
+#line 691 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp5_ = page_get_image (self, TRUE);
+#line 691 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ image = _tmp5_;
+#line 692 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ gtk_clipboard_set_image (clipboard, image);
+#line 687 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _g_object_unref0 (image);
+#line 687 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _g_object_unref0 (clipboard);
+#line 687 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _g_object_unref0 (display);
+#line 3461 "page.c"
+}
+
+
+void page_save (Page* self, const gchar* type, gint quality, GFile* file, GError** error) {
GFile* _tmp0_;
GFileOutputStream* _tmp1_ = NULL;
GFileOutputStream* stream;
@@ -2177,378 +3476,711 @@ void page_save (Page* self, const gchar* type, GFile* file, GError** error) {
const gchar* _tmp9_;
gint _tmp10_ = 0;
GError * _inner_error_ = NULL;
+#line 695 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (self != NULL);
+#line 695 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (type != NULL);
+#line 695 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (file != NULL);
+#line 697 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = file;
+#line 697 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1_ = g_file_replace (_tmp0_, NULL, FALSE, G_FILE_CREATE_NONE, NULL, &_inner_error_);
+#line 697 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
stream = _tmp1_;
+#line 697 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_inner_error_ != NULL) {
+#line 697 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_propagate_error (error, _inner_error_);
+#line 697 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return;
+#line 3498 "page.c"
}
+#line 698 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp2_ = stream;
+#line 698 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp3_ = pixbuf_writer_new (_tmp2_);
+#line 698 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
writer = _tmp3_;
+#line 699 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp4_ = page_get_image (self, TRUE);
+#line 699 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
image = _tmp4_;
+#line 701 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
icc_profile_data = NULL;
+#line 702 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp5_ = self->priv->color_profile;
+#line 702 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp5_ != NULL) {
+#line 3516 "page.c"
const gchar* _tmp6_;
gchar* _tmp7_ = NULL;
+#line 703 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp6_ = self->priv->color_profile;
+#line 703 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp7_ = page_get_icc_data_encoded (self, _tmp6_);
+#line 703 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_g_free0 (icc_profile_data);
+#line 703 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
icc_profile_data = _tmp7_;
+#line 3527 "page.c"
}
+#line 705 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp8_ = g_strcmp0;
+#line 705 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp9_ = type;
+#line 705 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp10_ = _tmp8_ (_tmp9_, "jpeg");
+#line 705 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_tmp10_ == 0) {
+#line 3537 "page.c"
gchar* _tmp11_;
- gchar** _tmp12_ = NULL;
+ gchar* _tmp12_;
+ gchar* _tmp13_;
+ gchar* _tmp14_;
+ gchar* _tmp15_;
+ gchar** _tmp16_ = NULL;
gchar** keys;
gint keys_length1;
gint _keys_size_;
- gchar* _tmp13_;
- gchar** _tmp14_ = NULL;
+ gint _tmp17_;
+ gchar* _tmp18_ = NULL;
+ gchar* _tmp19_;
+ gint _tmp20_;
+ gchar* _tmp21_ = NULL;
+ gint _tmp22_;
+ gchar* _tmp23_ = NULL;
+ const gchar* _tmp24_;
+ gchar* _tmp25_;
+ gchar** _tmp26_ = NULL;
gchar** values;
gint values_length1;
gint _values_size_;
- PixbufWriter* _tmp15_;
- GdkPixbuf* _tmp16_;
- gchar** _tmp17_;
- gint _tmp17__length1;
- gchar** _tmp18_;
- gint _tmp18__length1;
+ const gchar* _tmp27_;
+ PixbufWriter* _tmp30_;
+ GdkPixbuf* _tmp31_;
+ gchar** _tmp32_;
+ gint _tmp32__length1;
+ gchar** _tmp33_;
+ gint _tmp33__length1;
+#line 707 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp11_ = g_strdup ("quality");
- _tmp12_ = g_new0 (gchar*, 2 + 1);
- _tmp12_[0] = _tmp11_;
- _tmp12_[1] = NULL;
- keys = _tmp12_;
- keys_length1 = 2;
+#line 707 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp12_ = g_strdup ("density-unit");
+#line 707 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp13_ = g_strdup ("x-density");
+#line 707 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp14_ = g_strdup ("y-density");
+#line 707 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp15_ = g_strdup ("icc-profile");
+#line 707 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp16_ = g_new0 (gchar*, 6 + 1);
+#line 707 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp16_[0] = _tmp11_;
+#line 707 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp16_[1] = _tmp12_;
+#line 707 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp16_[2] = _tmp13_;
+#line 707 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp16_[3] = _tmp14_;
+#line 707 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp16_[4] = _tmp15_;
+#line 707 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp16_[5] = NULL;
+#line 707 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ keys = _tmp16_;
+#line 707 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ keys_length1 = 6;
+#line 707 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_keys_size_ = keys_length1;
- _tmp13_ = g_strdup ("90");
- _tmp14_ = g_new0 (gchar*, 2 + 1);
- _tmp14_[0] = _tmp13_;
- _tmp14_[1] = NULL;
- values = _tmp14_;
- values_length1 = 2;
+#line 708 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp17_ = quality;
+#line 708 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp18_ = g_strdup_printf ("%d", _tmp17_);
+#line 708 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp19_ = g_strdup ("dots-per-inch");
+#line 708 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp20_ = self->priv->dpi;
+#line 708 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp21_ = g_strdup_printf ("%d", _tmp20_);
+#line 708 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp22_ = self->priv->dpi;
+#line 708 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp23_ = g_strdup_printf ("%d", _tmp22_);
+#line 708 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp24_ = icc_profile_data;
+#line 708 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp25_ = g_strdup (_tmp24_);
+#line 708 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp26_ = g_new0 (gchar*, 6 + 1);
+#line 708 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp26_[0] = _tmp18_;
+#line 708 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp26_[1] = _tmp19_;
+#line 708 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp26_[2] = _tmp21_;
+#line 708 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp26_[3] = _tmp23_;
+#line 708 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp26_[4] = _tmp25_;
+#line 708 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp26_[5] = NULL;
+#line 708 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ values = _tmp26_;
+#line 708 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ values_length1 = 6;
+#line 708 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_values_size_ = values_length1;
- _tmp15_ = writer;
- _tmp16_ = image;
- _tmp17_ = keys;
- _tmp17__length1 = keys_length1;
- _tmp18_ = values;
- _tmp18__length1 = values_length1;
- pixbuf_writer_save (_tmp15_, _tmp16_, "jpeg", _tmp17_, _tmp17__length1, _tmp18_, _tmp18__length1, &_inner_error_);
+#line 709 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp27_ = icc_profile_data;
+#line 709 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ if (_tmp27_ == NULL) {
+#line 3639 "page.c"
+ gchar** _tmp28_;
+ gint _tmp28__length1;
+ gchar* _tmp29_;
+#line 710 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp28_ = keys;
+#line 710 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp28__length1 = keys_length1;
+#line 710 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _g_free0 (_tmp28_[4]);
+#line 710 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp28_[4] = NULL;
+#line 710 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp29_ = _tmp28_[4];
+#line 3653 "page.c"
+ }
+#line 711 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp30_ = writer;
+#line 711 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp31_ = image;
+#line 711 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp32_ = keys;
+#line 711 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp32__length1 = keys_length1;
+#line 711 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp33_ = values;
+#line 711 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp33__length1 = values_length1;
+#line 711 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ pixbuf_writer_save (_tmp30_, _tmp31_, "jpeg", _tmp32_, _tmp32__length1, _tmp33_, _tmp33__length1, &_inner_error_);
+#line 711 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_inner_error_ != NULL) {
+#line 711 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_propagate_error (error, _inner_error_);
+#line 711 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
values = (_vala_array_free (values, values_length1, (GDestroyNotify) g_free), NULL);
+#line 711 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
+#line 711 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_g_free0 (icc_profile_data);
+#line 711 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_g_object_unref0 (image);
+#line 711 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_pixbuf_writer_unref0 (writer);
+#line 711 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_g_object_unref0 (stream);
+#line 711 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return;
+#line 3687 "page.c"
}
+#line 705 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
values = (_vala_array_free (values, values_length1, (GDestroyNotify) g_free), NULL);
+#line 705 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
+#line 3693 "page.c"
} else {
- GCompareFunc _tmp19_;
- const gchar* _tmp20_;
- gint _tmp21_ = 0;
- _tmp19_ = g_strcmp0;
- _tmp20_ = type;
- _tmp21_ = _tmp19_ (_tmp20_, "png");
- if (_tmp21_ == 0) {
- gchar* _tmp22_;
- gchar** _tmp23_ = NULL;
+ GCompareFunc _tmp34_;
+ const gchar* _tmp35_;
+ gint _tmp36_ = 0;
+#line 713 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp34_ = g_strcmp0;
+#line 713 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp35_ = type;
+#line 713 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp36_ = _tmp34_ (_tmp35_, "png");
+#line 713 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ if (_tmp36_ == 0) {
+#line 3706 "page.c"
+ gchar* _tmp37_;
+ gchar** _tmp38_ = NULL;
gchar** keys;
gint keys_length1;
gint _keys_size_;
- const gchar* _tmp24_;
- gchar* _tmp25_;
- gchar** _tmp26_ = NULL;
+ const gchar* _tmp39_;
+ gchar* _tmp40_;
+ gchar** _tmp41_ = NULL;
gchar** values;
gint values_length1;
gint _values_size_;
- const gchar* _tmp27_;
- PixbufWriter* _tmp30_;
- GdkPixbuf* _tmp31_;
- gchar** _tmp32_;
- gint _tmp32__length1;
- gchar** _tmp33_;
- gint _tmp33__length1;
- _tmp22_ = g_strdup ("icc-profile");
- _tmp23_ = g_new0 (gchar*, 2 + 1);
- _tmp23_[0] = _tmp22_;
- _tmp23_[1] = NULL;
- keys = _tmp23_;
+ const gchar* _tmp42_;
+ PixbufWriter* _tmp45_;
+ GdkPixbuf* _tmp46_;
+ gchar** _tmp47_;
+ gint _tmp47__length1;
+ gchar** _tmp48_;
+ gint _tmp48__length1;
+#line 715 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp37_ = g_strdup ("icc-profile");
+#line 715 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp38_ = g_new0 (gchar*, 2 + 1);
+#line 715 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp38_[0] = _tmp37_;
+#line 715 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp38_[1] = NULL;
+#line 715 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ keys = _tmp38_;
+#line 715 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
keys_length1 = 2;
+#line 715 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_keys_size_ = keys_length1;
- _tmp24_ = icc_profile_data;
- _tmp25_ = g_strdup (_tmp24_);
- _tmp26_ = g_new0 (gchar*, 2 + 1);
- _tmp26_[0] = _tmp25_;
- _tmp26_[1] = NULL;
- values = _tmp26_;
+#line 716 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp39_ = icc_profile_data;
+#line 716 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp40_ = g_strdup (_tmp39_);
+#line 716 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp41_ = g_new0 (gchar*, 2 + 1);
+#line 716 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp41_[0] = _tmp40_;
+#line 716 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp41_[1] = NULL;
+#line 716 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ values = _tmp41_;
+#line 716 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
values_length1 = 2;
+#line 716 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_values_size_ = values_length1;
- _tmp27_ = icc_profile_data;
- if (_tmp27_ == NULL) {
- gchar** _tmp28_;
- gint _tmp28__length1;
- gchar* _tmp29_;
- _tmp28_ = keys;
- _tmp28__length1 = keys_length1;
- _g_free0 (_tmp28_[0]);
- _tmp28_[0] = NULL;
- _tmp29_ = _tmp28_[0];
+#line 717 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp42_ = icc_profile_data;
+#line 717 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ if (_tmp42_ == NULL) {
+#line 3759 "page.c"
+ gchar** _tmp43_;
+ gint _tmp43__length1;
+ gchar* _tmp44_;
+#line 718 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp43_ = keys;
+#line 718 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp43__length1 = keys_length1;
+#line 718 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _g_free0 (_tmp43_[0]);
+#line 718 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp43_[0] = NULL;
+#line 718 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp44_ = _tmp43_[0];
+#line 3773 "page.c"
}
- _tmp30_ = writer;
- _tmp31_ = image;
- _tmp32_ = keys;
- _tmp32__length1 = keys_length1;
- _tmp33_ = values;
- _tmp33__length1 = values_length1;
- pixbuf_writer_save (_tmp30_, _tmp31_, "png", _tmp32_, _tmp32__length1, _tmp33_, _tmp33__length1, &_inner_error_);
+#line 719 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp45_ = writer;
+#line 719 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp46_ = image;
+#line 719 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp47_ = keys;
+#line 719 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp47__length1 = keys_length1;
+#line 719 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp48_ = values;
+#line 719 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp48__length1 = values_length1;
+#line 719 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ pixbuf_writer_save (_tmp45_, _tmp46_, "png", _tmp47_, _tmp47__length1, _tmp48_, _tmp48__length1, &_inner_error_);
+#line 719 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_inner_error_ != NULL) {
+#line 719 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_propagate_error (error, _inner_error_);
+#line 719 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
values = (_vala_array_free (values, values_length1, (GDestroyNotify) g_free), NULL);
+#line 719 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
+#line 719 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_g_free0 (icc_profile_data);
+#line 719 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_g_object_unref0 (image);
+#line 719 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_pixbuf_writer_unref0 (writer);
+#line 719 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_g_object_unref0 (stream);
+#line 719 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return;
+#line 3807 "page.c"
}
+#line 713 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
values = (_vala_array_free (values, values_length1, (GDestroyNotify) g_free), NULL);
+#line 713 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
+#line 3813 "page.c"
} else {
- GCompareFunc _tmp34_;
- const gchar* _tmp35_;
- gint _tmp36_ = 0;
- _tmp34_ = g_strcmp0;
- _tmp35_ = type;
- _tmp36_ = _tmp34_ (_tmp35_, "tiff");
- if (_tmp36_ == 0) {
- gchar* _tmp37_;
- gchar* _tmp38_;
- gchar** _tmp39_ = NULL;
+ GCompareFunc _tmp49_;
+ const gchar* _tmp50_;
+ gint _tmp51_ = 0;
+#line 721 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp49_ = g_strcmp0;
+#line 721 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp50_ = type;
+#line 721 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp51_ = _tmp49_ (_tmp50_, "tiff");
+#line 721 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ if (_tmp51_ == 0) {
+#line 3826 "page.c"
+ gchar* _tmp52_;
+ gchar* _tmp53_;
+ gchar** _tmp54_ = NULL;
gchar** keys;
gint keys_length1;
gint _keys_size_;
- gchar* _tmp40_;
- const gchar* _tmp41_;
- gchar* _tmp42_;
- gchar** _tmp43_ = NULL;
+ gchar* _tmp55_;
+ const gchar* _tmp56_;
+ gchar* _tmp57_;
+ gchar** _tmp58_ = NULL;
gchar** values;
gint values_length1;
gint _values_size_;
- const gchar* _tmp44_;
- PixbufWriter* _tmp47_;
- GdkPixbuf* _tmp48_;
- gchar** _tmp49_;
- gint _tmp49__length1;
- gchar** _tmp50_;
- gint _tmp50__length1;
- _tmp37_ = g_strdup ("compression");
- _tmp38_ = g_strdup ("icc-profile");
- _tmp39_ = g_new0 (gchar*, 3 + 1);
- _tmp39_[0] = _tmp37_;
- _tmp39_[1] = _tmp38_;
- _tmp39_[2] = NULL;
- keys = _tmp39_;
+ const gchar* _tmp59_;
+ PixbufWriter* _tmp62_;
+ GdkPixbuf* _tmp63_;
+ gchar** _tmp64_;
+ gint _tmp64__length1;
+ gchar** _tmp65_;
+ gint _tmp65__length1;
+#line 723 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp52_ = g_strdup ("compression");
+#line 723 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp53_ = g_strdup ("icc-profile");
+#line 723 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp54_ = g_new0 (gchar*, 3 + 1);
+#line 723 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp54_[0] = _tmp52_;
+#line 723 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp54_[1] = _tmp53_;
+#line 723 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp54_[2] = NULL;
+#line 723 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ keys = _tmp54_;
+#line 723 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
keys_length1 = 3;
+#line 723 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_keys_size_ = keys_length1;
- _tmp40_ = g_strdup ("8");
- _tmp41_ = icc_profile_data;
- _tmp42_ = g_strdup (_tmp41_);
- _tmp43_ = g_new0 (gchar*, 3 + 1);
- _tmp43_[0] = _tmp40_;
- _tmp43_[1] = _tmp42_;
- _tmp43_[2] = NULL;
- values = _tmp43_;
+#line 724 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp55_ = g_strdup ("8");
+#line 724 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp56_ = icc_profile_data;
+#line 724 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp57_ = g_strdup (_tmp56_);
+#line 724 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp58_ = g_new0 (gchar*, 3 + 1);
+#line 724 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp58_[0] = _tmp55_;
+#line 724 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp58_[1] = _tmp57_;
+#line 724 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp58_[2] = NULL;
+#line 724 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ values = _tmp58_;
+#line 724 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
values_length1 = 3;
+#line 724 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_values_size_ = values_length1;
- _tmp44_ = icc_profile_data;
- if (_tmp44_ == NULL) {
- gchar** _tmp45_;
- gint _tmp45__length1;
- gchar* _tmp46_;
- _tmp45_ = keys;
- _tmp45__length1 = keys_length1;
- _g_free0 (_tmp45_[1]);
- _tmp45_[1] = NULL;
- _tmp46_ = _tmp45_[1];
+#line 725 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp59_ = icc_profile_data;
+#line 725 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ if (_tmp59_ == NULL) {
+#line 3889 "page.c"
+ gchar** _tmp60_;
+ gint _tmp60__length1;
+ gchar* _tmp61_;
+#line 726 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp60_ = keys;
+#line 726 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp60__length1 = keys_length1;
+#line 726 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _g_free0 (_tmp60_[1]);
+#line 726 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp60_[1] = NULL;
+#line 726 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp61_ = _tmp60_[1];
+#line 3903 "page.c"
}
- _tmp47_ = writer;
- _tmp48_ = image;
- _tmp49_ = keys;
- _tmp49__length1 = keys_length1;
- _tmp50_ = values;
- _tmp50__length1 = values_length1;
- pixbuf_writer_save (_tmp47_, _tmp48_, "tiff", _tmp49_, _tmp49__length1, _tmp50_, _tmp50__length1, &_inner_error_);
+#line 727 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp62_ = writer;
+#line 727 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp63_ = image;
+#line 727 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp64_ = keys;
+#line 727 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp64__length1 = keys_length1;
+#line 727 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp65_ = values;
+#line 727 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ _tmp65__length1 = values_length1;
+#line 727 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ pixbuf_writer_save (_tmp62_, _tmp63_, "tiff", _tmp64_, _tmp64__length1, _tmp65_, _tmp65__length1, &_inner_error_);
+#line 727 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_inner_error_ != NULL) {
+#line 727 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_propagate_error (error, _inner_error_);
+#line 727 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
values = (_vala_array_free (values, values_length1, (GDestroyNotify) g_free), NULL);
+#line 727 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
+#line 727 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_g_free0 (icc_profile_data);
+#line 727 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_g_object_unref0 (image);
+#line 727 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_pixbuf_writer_unref0 (writer);
+#line 727 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_g_object_unref0 (stream);
+#line 727 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return;
+#line 3937 "page.c"
}
+#line 721 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
values = (_vala_array_free (values, values_length1, (GDestroyNotify) g_free), NULL);
+#line 721 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
+#line 3943 "page.c"
} else {
}
}
}
+#line 695 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_g_free0 (icc_profile_data);
+#line 695 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_g_object_unref0 (image);
+#line 695 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_pixbuf_writer_unref0 (writer);
+#line 695 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_g_object_unref0 (stream);
+#line 3956 "page.c"
}
static void value_page_init (GValue* value) {
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
value->data[0].v_pointer = NULL;
+#line 3963 "page.c"
}
static void value_page_free_value (GValue* value) {
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (value->data[0].v_pointer) {
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
page_unref (value->data[0].v_pointer);
+#line 3972 "page.c"
}
}
static void value_page_copy_value (const GValue* src_value, GValue* dest_value) {
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (src_value->data[0].v_pointer) {
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
dest_value->data[0].v_pointer = page_ref (src_value->data[0].v_pointer);
+#line 3982 "page.c"
} else {
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
dest_value->data[0].v_pointer = NULL;
+#line 3986 "page.c"
}
}
static gpointer value_page_peek_pointer (const GValue* value) {
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return value->data[0].v_pointer;
+#line 3994 "page.c"
}
static gchar* value_page_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (collect_values[0].v_pointer) {
+#line 4001 "page.c"
Page* object;
object = collect_values[0].v_pointer;
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (object->parent_instance.g_class == NULL) {
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
+#line 4008 "page.c"
} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.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 4012 "page.c"
}
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
value->data[0].v_pointer = page_ref (object);
+#line 4016 "page.c"
} else {
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
value->data[0].v_pointer = NULL;
+#line 4020 "page.c"
}
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return NULL;
+#line 4024 "page.c"
}
static gchar* value_page_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
Page** object_p;
object_p = collect_values[0].v_pointer;
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (!object_p) {
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
+#line 4035 "page.c"
}
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (!value->data[0].v_pointer) {
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
*object_p = NULL;
+#line 4041 "page.c"
} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
*object_p = value->data[0].v_pointer;
+#line 4045 "page.c"
} else {
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
*object_p = page_ref (value->data[0].v_pointer);
+#line 4049 "page.c"
}
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return NULL;
+#line 4053 "page.c"
}
GParamSpec* param_spec_page (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
ParamSpecPage* spec;
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (g_type_is_a (object_type, TYPE_PAGE), NULL);
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
G_PARAM_SPEC (spec)->value_type = object_type;
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return G_PARAM_SPEC (spec);
+#line 4067 "page.c"
}
gpointer value_get_page (const GValue* value) {
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_PAGE), NULL);
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return value->data[0].v_pointer;
+#line 4076 "page.c"
}
void value_set_page (GValue* value, gpointer v_object) {
Page* old;
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_PAGE));
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
old = value->data[0].v_pointer;
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (v_object) {
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_PAGE));
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
value->data[0].v_pointer = v_object;
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
page_ref (value->data[0].v_pointer);
+#line 4096 "page.c"
} else {
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
value->data[0].v_pointer = NULL;
+#line 4100 "page.c"
}
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (old) {
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
page_unref (old);
+#line 4106 "page.c"
}
}
void value_take_page (GValue* value, gpointer v_object) {
Page* old;
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_PAGE));
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
old = value->data[0].v_pointer;
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (v_object) {
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_PAGE));
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
value->data[0].v_pointer = v_object;
+#line 4125 "page.c"
} else {
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
value->data[0].v_pointer = NULL;
+#line 4129 "page.c"
}
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (old) {
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
page_unref (old);
+#line 4135 "page.c"
}
}
static void page_class_init (PageClass * klass) {
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
page_parent_class = g_type_class_peek_parent (klass);
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
PAGE_CLASS (klass)->finalize = page_finalize;
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_type_class_add_private (klass, sizeof (PagePrivate));
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_signal_new ("pixels_changed", TYPE_PAGE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_signal_new ("size_changed", TYPE_PAGE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_signal_new ("scan_line_changed", TYPE_PAGE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_signal_new ("scan_direction_changed", TYPE_PAGE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_signal_new ("crop_changed", TYPE_PAGE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
+ g_signal_new ("scan_finished", TYPE_PAGE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+#line 4159 "page.c"
}
static void page_instance_init (Page * self) {
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv = PAGE_GET_PRIVATE (self);
+#line 51 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->scan_direction = SCAN_DIRECTION_TOP_TO_BOTTOM;
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->ref_count = 1;
+#line 4170 "page.c"
}
static void page_finalize (Page* obj) {
Page * self;
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PAGE, Page);
+#line 32 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_g_free0 (self->priv->color_profile);
+#line 39 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->priv->pixels = (g_free (self->priv->pixels), NULL);
+#line 55 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_g_free0 (self->priv->crop_name);
+#line 4184 "page.c"
}
@@ -2569,49 +4201,63 @@ GType page_get_type (void) {
gpointer page_ref (gpointer instance) {
Page* self;
self = instance;
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_atomic_int_inc (&self->ref_count);
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return instance;
+#line 4209 "page.c"
}
void page_unref (gpointer instance) {
Page* self;
self = instance;
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (g_atomic_int_dec_and_test (&self->ref_count)) {
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
PAGE_GET_CLASS (self)->finalize (self);
+#line 20 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_type_free_instance ((GTypeInstance *) self);
+#line 4222 "page.c"
}
}
-static gpointer _g_object_ref0 (gpointer self) {
- return self ? g_object_ref (self) : NULL;
-}
-
-
PixbufWriter* pixbuf_writer_construct (GType object_type, GFileOutputStream* stream) {
PixbufWriter* self = NULL;
GFileOutputStream* _tmp0_;
GFileOutputStream* _tmp1_;
+#line 738 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (stream != NULL, NULL);
+#line 738 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self = (PixbufWriter*) g_type_create_instance (object_type);
+#line 740 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = stream;
+#line 740 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1_ = _g_object_ref0 (_tmp0_);
+#line 740 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_g_object_unref0 (self->stream);
+#line 740 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->stream = _tmp1_;
+#line 738 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return self;
+#line 4245 "page.c"
}
PixbufWriter* pixbuf_writer_new (GFileOutputStream* stream) {
+#line 738 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return pixbuf_writer_construct (TYPE_PIXBUF_WRITER, stream);
+#line 4252 "page.c"
}
static gboolean _pixbuf_writer_write_pixbuf_data_gdk_pixbuf_save_func (guint8* buf, gsize buf_length1, GError** error, gpointer self) {
gboolean result;
result = pixbuf_writer_write_pixbuf_data (self, buf, buf_length1, error);
+#line 745 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return result;
+#line 4261 "page.c"
}
@@ -2623,19 +4269,33 @@ void pixbuf_writer_save (PixbufWriter* self, GdkPixbuf* image, const gchar* type
gchar** _tmp3_;
gint _tmp3__length1;
GError * _inner_error_ = NULL;
+#line 743 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (self != NULL);
+#line 743 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (image != NULL);
+#line 743 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (type != NULL);
+#line 745 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = image;
+#line 745 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1_ = type;
+#line 745 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp2_ = option_keys;
+#line 745 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp2__length1 = option_keys_length1;
+#line 745 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp3_ = option_values;
+#line 745 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp3__length1 = option_values_length1;
+#line 745 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
gdk_pixbuf_save_to_callbackv (_tmp0_, _pixbuf_writer_write_pixbuf_data_gdk_pixbuf_save_func, self, _tmp1_, _tmp2_, _tmp3_, &_inner_error_);
+#line 745 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_inner_error_ != NULL) {
+#line 745 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_propagate_error (error, _inner_error_);
+#line 745 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return;
+#line 4299 "page.c"
}
}
@@ -2646,145 +4306,235 @@ static gboolean pixbuf_writer_write_pixbuf_data (PixbufWriter* self, guint8* buf
guint8* _tmp1_;
gint _tmp1__length1;
GError * _inner_error_ = NULL;
+#line 748 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (self != NULL, FALSE);
+#line 750 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp0_ = self->stream;
+#line 750 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1_ = buf;
+#line 750 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_tmp1__length1 = buf_length1;
+#line 750 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_output_stream_write_all ((GOutputStream*) _tmp0_, _tmp1_, (gsize) _tmp1__length1, NULL, NULL, &_inner_error_);
+#line 750 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (_inner_error_ != NULL) {
+#line 750 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_propagate_error (error, _inner_error_);
+#line 750 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return FALSE;
+#line 4326 "page.c"
}
+#line 751 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
result = TRUE;
+#line 751 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return result;
+#line 4332 "page.c"
}
static void value_pixbuf_writer_init (GValue* value) {
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
value->data[0].v_pointer = NULL;
+#line 4339 "page.c"
}
static void value_pixbuf_writer_free_value (GValue* value) {
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (value->data[0].v_pointer) {
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
pixbuf_writer_unref (value->data[0].v_pointer);
+#line 4348 "page.c"
}
}
static void value_pixbuf_writer_copy_value (const GValue* src_value, GValue* dest_value) {
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (src_value->data[0].v_pointer) {
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
dest_value->data[0].v_pointer = pixbuf_writer_ref (src_value->data[0].v_pointer);
+#line 4358 "page.c"
} else {
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
dest_value->data[0].v_pointer = NULL;
+#line 4362 "page.c"
}
}
static gpointer value_pixbuf_writer_peek_pointer (const GValue* value) {
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return value->data[0].v_pointer;
+#line 4370 "page.c"
}
static gchar* value_pixbuf_writer_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (collect_values[0].v_pointer) {
+#line 4377 "page.c"
PixbufWriter* object;
object = collect_values[0].v_pointer;
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (object->parent_instance.g_class == NULL) {
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
+#line 4384 "page.c"
} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.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 4388 "page.c"
}
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
value->data[0].v_pointer = pixbuf_writer_ref (object);
+#line 4392 "page.c"
} else {
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
value->data[0].v_pointer = NULL;
+#line 4396 "page.c"
}
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return NULL;
+#line 4400 "page.c"
}
static gchar* value_pixbuf_writer_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
PixbufWriter** object_p;
object_p = collect_values[0].v_pointer;
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (!object_p) {
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
+#line 4411 "page.c"
}
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (!value->data[0].v_pointer) {
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
*object_p = NULL;
+#line 4417 "page.c"
} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
*object_p = value->data[0].v_pointer;
+#line 4421 "page.c"
} else {
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
*object_p = pixbuf_writer_ref (value->data[0].v_pointer);
+#line 4425 "page.c"
}
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return NULL;
+#line 4429 "page.c"
}
GParamSpec* param_spec_pixbuf_writer (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
ParamSpecPixbufWriter* spec;
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (g_type_is_a (object_type, TYPE_PIXBUF_WRITER), NULL);
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
G_PARAM_SPEC (spec)->value_type = object_type;
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return G_PARAM_SPEC (spec);
+#line 4443 "page.c"
}
gpointer value_get_pixbuf_writer (const GValue* value) {
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_PIXBUF_WRITER), NULL);
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return value->data[0].v_pointer;
+#line 4452 "page.c"
}
void value_set_pixbuf_writer (GValue* value, gpointer v_object) {
PixbufWriter* old;
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_PIXBUF_WRITER));
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
old = value->data[0].v_pointer;
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (v_object) {
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_PIXBUF_WRITER));
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
value->data[0].v_pointer = v_object;
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
pixbuf_writer_ref (value->data[0].v_pointer);
+#line 4472 "page.c"
} else {
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
value->data[0].v_pointer = NULL;
+#line 4476 "page.c"
}
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (old) {
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
pixbuf_writer_unref (old);
+#line 4482 "page.c"
}
}
void value_take_pixbuf_writer (GValue* value, gpointer v_object) {
PixbufWriter* old;
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_PIXBUF_WRITER));
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
old = value->data[0].v_pointer;
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (v_object) {
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_PIXBUF_WRITER));
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
value->data[0].v_pointer = v_object;
+#line 4501 "page.c"
} else {
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
value->data[0].v_pointer = NULL;
+#line 4505 "page.c"
}
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (old) {
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
pixbuf_writer_unref (old);
+#line 4511 "page.c"
}
}
static void pixbuf_writer_class_init (PixbufWriterClass * klass) {
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
pixbuf_writer_parent_class = g_type_class_peek_parent (klass);
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
PIXBUF_WRITER_CLASS (klass)->finalize = pixbuf_writer_finalize;
+#line 4521 "page.c"
}
static void pixbuf_writer_instance_init (PixbufWriter * self) {
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self->ref_count = 1;
+#line 4528 "page.c"
}
static void pixbuf_writer_finalize (PixbufWriter* obj) {
PixbufWriter * self;
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PIXBUF_WRITER, PixbufWriter);
+#line 736 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
_g_object_unref0 (self->stream);
+#line 4538 "page.c"
}
@@ -2805,17 +4555,24 @@ GType pixbuf_writer_get_type (void) {
gpointer pixbuf_writer_ref (gpointer instance) {
PixbufWriter* self;
self = instance;
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_atomic_int_inc (&self->ref_count);
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
return instance;
+#line 4563 "page.c"
}
void pixbuf_writer_unref (gpointer instance) {
PixbufWriter* self;
self = instance;
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
if (g_atomic_int_dec_and_test (&self->ref_count)) {
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
PIXBUF_WRITER_GET_CLASS (self)->finalize (self);
+#line 734 "/home/bob/bzr/simple-scan/trunk/src/page.vala"
g_type_free_instance ((GTypeInstance *) self);
+#line 4576 "page.c"
}
}