summaryrefslogtreecommitdiff
path: root/src/book.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/book.c')
-rw-r--r--src/book.c1488
1 files changed, 730 insertions, 758 deletions
diff --git a/src/book.c b/src/book.c
index 32f35e2..1ec2970 100644
--- a/src/book.c
+++ b/src/book.c
@@ -1,4 +1,4 @@
-/* book.c generated by valac 0.14.0, the Vala compiler
+/* book.c generated by valac 0.15.2, the Vala compiler
* generated from book.vala, do not modify */
/*
@@ -18,14 +18,14 @@
#include <string.h>
#include <gio/gio.h>
#include <cairo.h>
-#include <gdk-pixbuf/gdk-pixdata.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
#include <float.h>
#include <math.h>
#include <gdk/gdk.h>
#include <cairo-ps.h>
#include <zlib.h>
-#include <jpeglib.h>
-#include <config.h>
+#include "jpeglib.h"
+#include "config.h"
#include <gobject/gvaluecollector.h>
@@ -1123,55 +1123,55 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
gchar* _tmp43_;
PDFWriter* _tmp44_;
PDFWriter* _tmp45_;
- PDFWriter* _tmp359_;
- PDFWriter* _tmp360_;
- guint _tmp361_ = 0U;
+ PDFWriter* _tmp349_;
+ PDFWriter* _tmp350_;
+ guint _tmp351_ = 0U;
guint info_number;
+ PDFWriter* _tmp352_;
+ guint _tmp353_;
+ gchar* _tmp354_ = NULL;
+ gchar* _tmp355_;
+ PDFWriter* _tmp356_;
+ PDFWriter* _tmp357_;
+ gchar* _tmp358_ = NULL;
+ gchar* _tmp359_;
+ PDFWriter* _tmp360_;
+ PDFWriter* _tmp361_;
PDFWriter* _tmp362_;
- guint _tmp363_;
- gchar* _tmp364_ = NULL;
- gchar* _tmp365_;
+ gsize _tmp363_;
+ gsize xref_offset;
+ PDFWriter* _tmp364_;
+ PDFWriter* _tmp365_;
PDFWriter* _tmp366_;
- PDFWriter* _tmp367_;
- gchar* _tmp368_ = NULL;
- gchar* _tmp369_;
- PDFWriter* _tmp370_;
+ GList* _tmp367_;
+ guint _tmp368_ = 0U;
+ gchar* _tmp369_ = NULL;
+ gchar* _tmp370_;
PDFWriter* _tmp371_;
- PDFWriter* _tmp372_;
- gsize _tmp373_;
- gsize xref_offset;
- PDFWriter* _tmp374_;
- PDFWriter* _tmp375_;
- PDFWriter* _tmp376_;
- GList* _tmp377_;
- guint _tmp378_ = 0U;
- gchar* _tmp379_ = NULL;
- gchar* _tmp380_;
- PDFWriter* _tmp381_;
- GList* _tmp382_;
- PDFWriter* _tmp387_;
- PDFWriter* _tmp388_;
+ GList* _tmp372_;
+ PDFWriter* _tmp377_;
+ PDFWriter* _tmp378_;
+ PDFWriter* _tmp379_;
+ PDFWriter* _tmp380_;
+ GList* _tmp381_;
+ guint _tmp382_ = 0U;
+ gchar* _tmp383_ = NULL;
+ gchar* _tmp384_;
+ PDFWriter* _tmp385_;
+ guint _tmp386_;
+ gchar* _tmp387_ = NULL;
+ gchar* _tmp388_;
PDFWriter* _tmp389_;
- PDFWriter* _tmp390_;
- GList* _tmp391_;
- guint _tmp392_ = 0U;
- gchar* _tmp393_ = NULL;
- gchar* _tmp394_;
+ guint _tmp390_;
+ gchar* _tmp391_ = NULL;
+ gchar* _tmp392_;
+ PDFWriter* _tmp393_;
+ PDFWriter* _tmp394_;
PDFWriter* _tmp395_;
- guint _tmp396_;
+ gsize _tmp396_;
gchar* _tmp397_ = NULL;
gchar* _tmp398_;
PDFWriter* _tmp399_;
- guint _tmp400_;
- gchar* _tmp401_ = NULL;
- gchar* _tmp402_;
- PDFWriter* _tmp403_;
- PDFWriter* _tmp404_;
- PDFWriter* _tmp405_;
- gsize _tmp406_;
- gchar* _tmp407_ = NULL;
- gchar* _tmp408_;
- PDFWriter* _tmp409_;
GError * _inner_error_ = NULL;
g_return_if_fail (self != NULL);
g_return_if_fail (file != NULL);
@@ -1329,123 +1329,123 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
gint _data_size_ = 0;
Page* _tmp70_;
gboolean _tmp71_ = FALSE;
- guint8* _tmp237_;
- gint _tmp237__length1;
- gint _tmp238_ = 0;
- guint8* _tmp239_ = NULL;
+ guint8* _tmp227_;
+ gint _tmp227__length1;
+ gint _tmp228_ = 0;
+ guint8* _tmp229_ = NULL;
guint8* compressed_data;
gint compressed_data_length1;
gint _compressed_data_size_;
- guint8* _tmp240_;
- gint _tmp240__length1;
- PDFWriter* _tmp255_;
- PDFWriter* _tmp256_;
- guint _tmp257_ = 0U;
+ guint8* _tmp230_;
+ gint _tmp230__length1;
+ PDFWriter* _tmp245_;
+ PDFWriter* _tmp246_;
+ guint _tmp247_ = 0U;
guint number;
+ PDFWriter* _tmp248_;
+ guint _tmp249_;
+ gchar* _tmp250_ = NULL;
+ gchar* _tmp251_;
+ PDFWriter* _tmp252_;
+ PDFWriter* _tmp253_;
+ PDFWriter* _tmp254_;
+ guint _tmp255_;
+ gchar* _tmp256_ = NULL;
+ gchar* _tmp257_;
PDFWriter* _tmp258_;
- guint _tmp259_;
- gchar* _tmp260_ = NULL;
- gchar* _tmp261_;
- PDFWriter* _tmp262_;
+ gint _tmp259_;
+ guint _tmp260_;
+ gchar* _tmp261_ = NULL;
+ gchar* _tmp262_;
PDFWriter* _tmp263_;
- PDFWriter* _tmp264_;
- guint _tmp265_;
- gchar* _tmp266_ = NULL;
- gchar* _tmp267_;
- PDFWriter* _tmp268_;
- gint _tmp269_;
- guint _tmp270_;
- gchar* _tmp271_ = NULL;
- gchar* _tmp272_;
- PDFWriter* _tmp273_;
- gdouble _tmp274_;
+ gdouble _tmp264_;
+ gchar* _tmp265_;
+ gint _tmp265__length1;
+ const gchar* _tmp266_ = NULL;
+ gdouble _tmp267_;
+ gchar* _tmp268_;
+ gint _tmp268__length1;
+ const gchar* _tmp269_ = NULL;
+ gchar* _tmp270_ = NULL;
+ gchar* _tmp271_;
+ PDFWriter* _tmp272_;
+ guint _tmp273_;
+ gchar* _tmp274_ = NULL;
gchar* _tmp275_;
- gint _tmp275__length1;
- const gchar* _tmp276_ = NULL;
- gdouble _tmp277_;
- gchar* _tmp278_;
- gint _tmp278__length1;
- const gchar* _tmp279_ = NULL;
- gchar* _tmp280_ = NULL;
- gchar* _tmp281_;
- PDFWriter* _tmp282_;
- guint _tmp283_;
- gchar* _tmp284_ = NULL;
- gchar* _tmp285_;
+ PDFWriter* _tmp276_;
+ PDFWriter* _tmp277_;
+ PDFWriter* _tmp278_;
+ PDFWriter* _tmp279_;
+ guint _tmp280_ = 0U;
+ PDFWriter* _tmp281_;
+ guint _tmp282_;
+ gchar* _tmp283_ = NULL;
+ gchar* _tmp284_;
+ PDFWriter* _tmp285_;
PDFWriter* _tmp286_;
PDFWriter* _tmp287_;
PDFWriter* _tmp288_;
- PDFWriter* _tmp289_;
- guint _tmp290_ = 0U;
- PDFWriter* _tmp291_;
- guint _tmp292_;
- gchar* _tmp293_ = NULL;
- gchar* _tmp294_;
- PDFWriter* _tmp295_;
+ gint _tmp289_;
+ gchar* _tmp290_ = NULL;
+ gchar* _tmp291_;
+ PDFWriter* _tmp292_;
+ gint _tmp293_;
+ gchar* _tmp294_ = NULL;
+ gchar* _tmp295_;
PDFWriter* _tmp296_;
- PDFWriter* _tmp297_;
- PDFWriter* _tmp298_;
- gint _tmp299_;
- gchar* _tmp300_ = NULL;
- gchar* _tmp301_;
- PDFWriter* _tmp302_;
- gint _tmp303_;
- gchar* _tmp304_ = NULL;
- gchar* _tmp305_;
- PDFWriter* _tmp306_;
- const gchar* _tmp307_;
- gchar* _tmp308_ = NULL;
- gchar* _tmp309_;
- PDFWriter* _tmp310_;
- gint _tmp311_;
- gchar* _tmp312_ = NULL;
- gchar* _tmp313_;
+ const gchar* _tmp297_;
+ gchar* _tmp298_ = NULL;
+ gchar* _tmp299_;
+ PDFWriter* _tmp300_;
+ gint _tmp301_;
+ gchar* _tmp302_ = NULL;
+ gchar* _tmp303_;
+ PDFWriter* _tmp304_;
+ guint8* _tmp305_;
+ gint _tmp305__length1;
+ gchar* _tmp306_ = NULL;
+ gchar* _tmp307_;
+ const gchar* _tmp308_;
+ PDFWriter* _tmp313_;
PDFWriter* _tmp314_;
- guint8* _tmp315_;
- gint _tmp315__length1;
- gchar* _tmp316_ = NULL;
- gchar* _tmp317_;
- const gchar* _tmp318_;
- PDFWriter* _tmp323_;
- PDFWriter* _tmp324_;
- PDFWriter* _tmp325_;
- guint8* _tmp326_;
- gint _tmp326__length1;
- PDFWriter* _tmp327_;
+ PDFWriter* _tmp315_;
+ guint8* _tmp316_;
+ gint _tmp316__length1;
+ PDFWriter* _tmp317_;
+ PDFWriter* _tmp318_;
+ PDFWriter* _tmp319_;
+ gdouble _tmp320_;
+ gchar* _tmp321_;
+ gint _tmp321__length1;
+ const gchar* _tmp322_ = NULL;
+ gdouble _tmp323_;
+ gchar* _tmp324_;
+ gint _tmp324__length1;
+ const gchar* _tmp325_ = NULL;
+ gint _tmp326_;
+ gchar* _tmp327_ = NULL;
+ gchar* command;
PDFWriter* _tmp328_;
PDFWriter* _tmp329_;
- gdouble _tmp330_;
- gchar* _tmp331_;
- gint _tmp331__length1;
- const gchar* _tmp332_ = NULL;
- gdouble _tmp333_;
+ guint _tmp330_ = 0U;
+ PDFWriter* _tmp331_;
+ guint _tmp332_;
+ gchar* _tmp333_ = NULL;
gchar* _tmp334_;
- gint _tmp334__length1;
- const gchar* _tmp335_ = NULL;
- gint _tmp336_;
- gchar* _tmp337_ = NULL;
- gchar* command;
- PDFWriter* _tmp338_;
- PDFWriter* _tmp339_;
- guint _tmp340_ = 0U;
- PDFWriter* _tmp341_;
- guint _tmp342_;
- gchar* _tmp343_ = NULL;
- gchar* _tmp344_;
- PDFWriter* _tmp345_;
+ PDFWriter* _tmp335_;
+ PDFWriter* _tmp336_;
+ const gchar* _tmp337_;
+ gint _tmp338_;
+ gint _tmp339_;
+ gchar* _tmp340_ = NULL;
+ gchar* _tmp341_;
+ PDFWriter* _tmp342_;
+ PDFWriter* _tmp343_;
+ PDFWriter* _tmp344_;
+ const gchar* _tmp345_;
PDFWriter* _tmp346_;
- const gchar* _tmp347_;
- gint _tmp348_;
- gint _tmp349_;
- gchar* _tmp350_ = NULL;
- gchar* _tmp351_;
- PDFWriter* _tmp352_;
- PDFWriter* _tmp353_;
- PDFWriter* _tmp354_;
- const gchar* _tmp355_;
- PDFWriter* _tmp356_;
- PDFWriter* _tmp357_;
- PDFWriter* _tmp358_;
+ PDFWriter* _tmp347_;
+ PDFWriter* _tmp348_;
_tmp47_ = _tmp46_;
if (!_tmp47_) {
gint _tmp48_;
@@ -1510,7 +1510,7 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
color_space = _tmp72_;
_tmp73_ = height;
_tmp74_ = width;
- data_length = ((_tmp73_ * _tmp74_) * 3) + 1;
+ data_length = (_tmp73_ * _tmp74_) * 3;
_tmp75_ = data_length;
_tmp76_ = g_new0 (guint8, _tmp75_);
data = (g_free (data), NULL);
@@ -1658,10 +1658,6 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
gint _tmp119_;
guint8* _tmp120_ = NULL;
gint offset;
- guint8* _tmp121_;
- gint _tmp121__length1;
- gint _tmp122_;
- guint8 _tmp123_;
shift_count = 6;
depth = 2;
_tmp116_ = g_strdup ("DeviceGray");
@@ -1677,159 +1673,149 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
data_length1 = _tmp119_;
_data_size_ = data_length1;
offset = 0;
- _tmp121_ = data;
- _tmp121__length1 = data_length1;
- _tmp122_ = offset;
- _tmp121_[_tmp122_] = (guint8) 0;
- _tmp123_ = _tmp121_[_tmp122_];
{
gint row;
row = 0;
{
- gboolean _tmp124_;
- _tmp124_ = TRUE;
+ gboolean _tmp121_;
+ _tmp121_ = TRUE;
while (TRUE) {
- gboolean _tmp125_;
- gint _tmp127_;
+ gboolean _tmp122_;
+ gint _tmp124_;
+ gint _tmp125_;
+ gint _tmp126_;
gint _tmp128_;
- gint _tmp129_;
- gint _tmp134_;
- GdkPixbuf* _tmp135_;
- gint _tmp136_ = 0;
+ GdkPixbuf* _tmp129_;
+ gint _tmp130_ = 0;
gint in_offset;
- _tmp125_ = _tmp124_;
- if (!_tmp125_) {
- gint _tmp126_;
- _tmp126_ = row;
- row = _tmp126_ + 1;
+ _tmp122_ = _tmp121_;
+ if (!_tmp122_) {
+ gint _tmp123_;
+ _tmp123_ = row;
+ row = _tmp123_ + 1;
}
- _tmp124_ = FALSE;
- _tmp127_ = row;
- _tmp128_ = height;
- if (!(_tmp127_ < _tmp128_)) {
+ _tmp121_ = FALSE;
+ _tmp124_ = row;
+ _tmp125_ = height;
+ if (!(_tmp124_ < _tmp125_)) {
break;
}
- _tmp129_ = shift_count;
- if (_tmp129_ != 6) {
- gint _tmp130_;
- guint8* _tmp131_;
- gint _tmp131__length1;
- gint _tmp132_;
- guint8 _tmp133_;
- _tmp130_ = offset;
- offset = _tmp130_ + 1;
- _tmp131_ = data;
- _tmp131__length1 = data_length1;
- _tmp132_ = offset;
- _tmp131_[_tmp132_] = (guint8) 0;
- _tmp133_ = _tmp131_[_tmp132_];
+ _tmp126_ = shift_count;
+ if (_tmp126_ != 6) {
+ gint _tmp127_;
+ _tmp127_ = offset;
+ offset = _tmp127_ + 1;
shift_count = 6;
}
- _tmp134_ = row;
- _tmp135_ = image;
- _tmp136_ = gdk_pixbuf_get_rowstride (_tmp135_);
- in_offset = _tmp134_ * _tmp136_;
+ _tmp128_ = row;
+ _tmp129_ = image;
+ _tmp130_ = gdk_pixbuf_get_rowstride (_tmp129_);
+ in_offset = _tmp128_ * _tmp130_;
{
gint x;
x = 0;
{
- gboolean _tmp137_;
- _tmp137_ = TRUE;
+ gboolean _tmp131_;
+ _tmp131_ = TRUE;
while (TRUE) {
- gboolean _tmp138_;
- gint _tmp140_;
+ gboolean _tmp132_;
+ gint _tmp134_;
+ gint _tmp135_;
+ gint _tmp136_;
+ guint8* _tmp140_;
+ gint _tmp140__length1;
gint _tmp141_;
- guint8* _tmp142_;
- gint _tmp142__length1;
- gint _tmp143_;
- gint _tmp144_;
- guint8 _tmp145_;
+ gint _tmp142_;
+ guint8 _tmp143_;
guint8 p;
- guint8 _tmp146_;
- gint _tmp161_;
- _tmp138_ = _tmp137_;
- if (!_tmp138_) {
- gint _tmp139_;
- _tmp139_ = x;
- x = _tmp139_ + 1;
+ guint8 _tmp144_;
+ gint _tmp159_;
+ _tmp132_ = _tmp131_;
+ if (!_tmp132_) {
+ gint _tmp133_;
+ _tmp133_ = x;
+ x = _tmp133_ + 1;
}
- _tmp137_ = FALSE;
- _tmp140_ = x;
- _tmp141_ = width;
- if (!(_tmp140_ < _tmp141_)) {
+ _tmp131_ = FALSE;
+ _tmp134_ = x;
+ _tmp135_ = width;
+ if (!(_tmp134_ < _tmp135_)) {
break;
}
- _tmp142_ = pixels;
- _tmp142__length1 = pixels_length1;
- _tmp143_ = in_offset;
- _tmp144_ = x;
- _tmp145_ = _tmp142_[_tmp143_ + (_tmp144_ * 3)];
- p = _tmp145_;
- _tmp146_ = p;
- if (((gint) _tmp146_) >= 192) {
- guint8* _tmp147_;
- gint _tmp147__length1;
- gint _tmp148_;
- gint _tmp149_;
- guint8 _tmp150_;
- _tmp147_ = data;
- _tmp147__length1 = data_length1;
- _tmp148_ = offset;
- _tmp149_ = shift_count;
- _tmp147_[_tmp148_] |= (guint8) (3 << _tmp149_);
- _tmp150_ = _tmp147_[_tmp148_];
+ _tmp136_ = shift_count;
+ if (_tmp136_ == 6) {
+ guint8* _tmp137_;
+ gint _tmp137__length1;
+ gint _tmp138_;
+ guint8 _tmp139_;
+ _tmp137_ = data;
+ _tmp137__length1 = data_length1;
+ _tmp138_ = offset;
+ _tmp137_[_tmp138_] = (guint8) 0;
+ _tmp139_ = _tmp137_[_tmp138_];
+ }
+ _tmp140_ = pixels;
+ _tmp140__length1 = pixels_length1;
+ _tmp141_ = in_offset;
+ _tmp142_ = x;
+ _tmp143_ = _tmp140_[_tmp141_ + (_tmp142_ * 3)];
+ p = _tmp143_;
+ _tmp144_ = p;
+ if (((gint) _tmp144_) >= 192) {
+ guint8* _tmp145_;
+ gint _tmp145__length1;
+ gint _tmp146_;
+ gint _tmp147_;
+ guint8 _tmp148_;
+ _tmp145_ = data;
+ _tmp145__length1 = data_length1;
+ _tmp146_ = offset;
+ _tmp147_ = shift_count;
+ _tmp145_[_tmp146_] |= (guint8) (3 << _tmp147_);
+ _tmp148_ = _tmp145_[_tmp146_];
} else {
- guint8 _tmp151_;
- _tmp151_ = p;
- if (((gint) _tmp151_) >= 128) {
- guint8* _tmp152_;
- gint _tmp152__length1;
- gint _tmp153_;
- gint _tmp154_;
- guint8 _tmp155_;
- _tmp152_ = data;
- _tmp152__length1 = data_length1;
- _tmp153_ = offset;
- _tmp154_ = shift_count;
- _tmp152_[_tmp153_] |= (guint8) (2 << _tmp154_);
- _tmp155_ = _tmp152_[_tmp153_];
+ guint8 _tmp149_;
+ _tmp149_ = p;
+ if (((gint) _tmp149_) >= 128) {
+ guint8* _tmp150_;
+ gint _tmp150__length1;
+ gint _tmp151_;
+ gint _tmp152_;
+ guint8 _tmp153_;
+ _tmp150_ = data;
+ _tmp150__length1 = data_length1;
+ _tmp151_ = offset;
+ _tmp152_ = shift_count;
+ _tmp150_[_tmp151_] |= (guint8) (2 << _tmp152_);
+ _tmp153_ = _tmp150_[_tmp151_];
} else {
- guint8 _tmp156_;
- _tmp156_ = p;
- if (((gint) _tmp156_) >= 64) {
- guint8* _tmp157_;
- gint _tmp157__length1;
- gint _tmp158_;
- gint _tmp159_;
- guint8 _tmp160_;
- _tmp157_ = data;
- _tmp157__length1 = data_length1;
- _tmp158_ = offset;
- _tmp159_ = shift_count;
- _tmp157_[_tmp158_] |= (guint8) (1 << _tmp159_);
- _tmp160_ = _tmp157_[_tmp158_];
+ guint8 _tmp154_;
+ _tmp154_ = p;
+ if (((gint) _tmp154_) >= 64) {
+ guint8* _tmp155_;
+ gint _tmp155__length1;
+ gint _tmp156_;
+ gint _tmp157_;
+ guint8 _tmp158_;
+ _tmp155_ = data;
+ _tmp155__length1 = data_length1;
+ _tmp156_ = offset;
+ _tmp157_ = shift_count;
+ _tmp155_[_tmp156_] |= (guint8) (1 << _tmp157_);
+ _tmp158_ = _tmp155_[_tmp156_];
}
}
}
- _tmp161_ = shift_count;
- if (_tmp161_ == 0) {
- gint _tmp162_;
- guint8* _tmp163_;
- gint _tmp163__length1;
- gint _tmp164_;
- guint8 _tmp165_;
- _tmp162_ = offset;
- offset = _tmp162_ + 1;
- _tmp163_ = data;
- _tmp163__length1 = data_length1;
- _tmp164_ = offset;
- _tmp163_[_tmp164_] = (guint8) 0;
- _tmp165_ = _tmp163_[_tmp164_];
+ _tmp159_ = shift_count;
+ if (_tmp159_ == 0) {
+ gint _tmp160_;
+ _tmp160_ = offset;
+ offset = _tmp160_ + 1;
shift_count = 6;
} else {
- gint _tmp166_;
- _tmp166_ = shift_count;
- shift_count = _tmp166_ - 2;
+ gint _tmp161_;
+ _tmp161_ = shift_count;
+ shift_count = _tmp161_ - 2;
}
}
}
@@ -1838,153 +1824,139 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
}
}
} else {
- Page* _tmp167_;
- gint _tmp168_ = 0;
- _tmp167_ = page;
- _tmp168_ = page_get_depth (_tmp167_);
- if (_tmp168_ == 1) {
+ Page* _tmp162_;
+ gint _tmp163_ = 0;
+ _tmp162_ = page;
+ _tmp163_ = page_get_depth (_tmp162_);
+ if (_tmp163_ == 1) {
gint mask;
- gchar* _tmp169_;
- gint _tmp170_;
- gint _tmp171_;
+ gchar* _tmp164_;
+ gint _tmp165_;
+ gint _tmp166_;
gint data_length;
- gint _tmp172_;
- guint8* _tmp173_ = NULL;
+ gint _tmp167_;
+ guint8* _tmp168_ = NULL;
gint offset;
- guint8* _tmp174_;
- gint _tmp174__length1;
- gint _tmp175_;
- guint8 _tmp176_;
mask = 0x80;
depth = 1;
- _tmp169_ = g_strdup ("DeviceGray");
+ _tmp164_ = g_strdup ("DeviceGray");
_g_free0 (color_space);
- color_space = _tmp169_;
- _tmp170_ = height;
- _tmp171_ = width;
- data_length = _tmp170_ * ((_tmp171_ + 7) / 8);
- _tmp172_ = data_length;
- _tmp173_ = g_new0 (guint8, _tmp172_);
+ color_space = _tmp164_;
+ _tmp165_ = height;
+ _tmp166_ = width;
+ data_length = _tmp165_ * ((_tmp166_ + 7) / 8);
+ _tmp167_ = data_length;
+ _tmp168_ = g_new0 (guint8, _tmp167_);
data = (g_free (data), NULL);
- data = _tmp173_;
- data_length1 = _tmp172_;
+ data = _tmp168_;
+ data_length1 = _tmp167_;
_data_size_ = data_length1;
offset = 0;
- _tmp174_ = data;
- _tmp174__length1 = data_length1;
- _tmp175_ = offset;
- _tmp174_[_tmp175_] = (guint8) 0;
- _tmp176_ = _tmp174_[_tmp175_];
{
gint row;
row = 0;
{
- gboolean _tmp177_;
- _tmp177_ = TRUE;
+ gboolean _tmp169_;
+ _tmp169_ = TRUE;
while (TRUE) {
- gboolean _tmp178_;
- gint _tmp180_;
- gint _tmp181_;
- gint _tmp182_;
- gint _tmp187_;
- GdkPixbuf* _tmp188_;
- gint _tmp189_ = 0;
+ gboolean _tmp170_;
+ gint _tmp172_;
+ gint _tmp173_;
+ gint _tmp174_;
+ gint _tmp176_;
+ GdkPixbuf* _tmp177_;
+ gint _tmp178_ = 0;
gint in_offset;
- _tmp178_ = _tmp177_;
- if (!_tmp178_) {
- gint _tmp179_;
- _tmp179_ = row;
- row = _tmp179_ + 1;
+ _tmp170_ = _tmp169_;
+ if (!_tmp170_) {
+ gint _tmp171_;
+ _tmp171_ = row;
+ row = _tmp171_ + 1;
}
- _tmp177_ = FALSE;
- _tmp180_ = row;
- _tmp181_ = height;
- if (!(_tmp180_ < _tmp181_)) {
+ _tmp169_ = FALSE;
+ _tmp172_ = row;
+ _tmp173_ = height;
+ if (!(_tmp172_ < _tmp173_)) {
break;
}
- _tmp182_ = mask;
- if (_tmp182_ != 0x80) {
- gint _tmp183_;
- guint8* _tmp184_;
- gint _tmp184__length1;
- gint _tmp185_;
- guint8 _tmp186_;
- _tmp183_ = offset;
- offset = _tmp183_ + 1;
- _tmp184_ = data;
- _tmp184__length1 = data_length1;
- _tmp185_ = offset;
- _tmp184_[_tmp185_] = (guint8) 0;
- _tmp186_ = _tmp184_[_tmp185_];
+ _tmp174_ = mask;
+ if (_tmp174_ != 0x80) {
+ gint _tmp175_;
+ _tmp175_ = offset;
+ offset = _tmp175_ + 1;
mask = 0x80;
}
- _tmp187_ = row;
- _tmp188_ = image;
- _tmp189_ = gdk_pixbuf_get_rowstride (_tmp188_);
- in_offset = _tmp187_ * _tmp189_;
+ _tmp176_ = row;
+ _tmp177_ = image;
+ _tmp178_ = gdk_pixbuf_get_rowstride (_tmp177_);
+ in_offset = _tmp176_ * _tmp178_;
{
gint x;
x = 0;
{
- gboolean _tmp190_;
- _tmp190_ = TRUE;
+ gboolean _tmp179_;
+ _tmp179_ = TRUE;
while (TRUE) {
- gboolean _tmp191_;
- gint _tmp193_;
- gint _tmp194_;
- guint8* _tmp195_;
- gint _tmp195__length1;
+ gboolean _tmp180_;
+ gint _tmp182_;
+ gint _tmp183_;
+ gint _tmp184_;
+ guint8* _tmp188_;
+ gint _tmp188__length1;
+ gint _tmp189_;
+ gint _tmp190_;
+ guint8 _tmp191_;
gint _tmp196_;
gint _tmp197_;
- guint8 _tmp198_;
- gint _tmp203_;
- gint _tmp204_;
- _tmp191_ = _tmp190_;
- if (!_tmp191_) {
- gint _tmp192_;
- _tmp192_ = x;
- x = _tmp192_ + 1;
+ _tmp180_ = _tmp179_;
+ if (!_tmp180_) {
+ gint _tmp181_;
+ _tmp181_ = x;
+ x = _tmp181_ + 1;
}
- _tmp190_ = FALSE;
- _tmp193_ = x;
- _tmp194_ = width;
- if (!(_tmp193_ < _tmp194_)) {
+ _tmp179_ = FALSE;
+ _tmp182_ = x;
+ _tmp183_ = width;
+ if (!(_tmp182_ < _tmp183_)) {
break;
}
- _tmp195_ = pixels;
- _tmp195__length1 = pixels_length1;
- _tmp196_ = in_offset;
- _tmp197_ = x;
- _tmp198_ = _tmp195_[_tmp196_ + (_tmp197_ * 3)];
- if (((gint) _tmp198_) != 0) {
- guint8* _tmp199_;
- gint _tmp199__length1;
- gint _tmp200_;
- gint _tmp201_;
- guint8 _tmp202_;
- _tmp199_ = data;
- _tmp199__length1 = data_length1;
- _tmp200_ = offset;
- _tmp201_ = mask;
- _tmp199_[_tmp200_] |= (guint8) _tmp201_;
- _tmp202_ = _tmp199_[_tmp200_];
+ _tmp184_ = mask;
+ if (_tmp184_ == 0x80) {
+ guint8* _tmp185_;
+ gint _tmp185__length1;
+ gint _tmp186_;
+ guint8 _tmp187_;
+ _tmp185_ = data;
+ _tmp185__length1 = data_length1;
+ _tmp186_ = offset;
+ _tmp185_[_tmp186_] = (guint8) 0;
+ _tmp187_ = _tmp185_[_tmp186_];
+ }
+ _tmp188_ = pixels;
+ _tmp188__length1 = pixels_length1;
+ _tmp189_ = in_offset;
+ _tmp190_ = x;
+ _tmp191_ = _tmp188_[_tmp189_ + (_tmp190_ * 3)];
+ if (((gint) _tmp191_) != 0) {
+ guint8* _tmp192_;
+ gint _tmp192__length1;
+ gint _tmp193_;
+ gint _tmp194_;
+ guint8 _tmp195_;
+ _tmp192_ = data;
+ _tmp192__length1 = data_length1;
+ _tmp193_ = offset;
+ _tmp194_ = mask;
+ _tmp192_[_tmp193_] |= (guint8) _tmp194_;
+ _tmp195_ = _tmp192_[_tmp193_];
}
- _tmp203_ = mask;
- mask = _tmp203_ >> 1;
- _tmp204_ = mask;
- if (_tmp204_ == 0) {
- gint _tmp205_;
- guint8* _tmp206_;
- gint _tmp206__length1;
- gint _tmp207_;
- guint8 _tmp208_;
- _tmp205_ = offset;
- offset = _tmp205_ + 1;
- _tmp206_ = data;
- _tmp206__length1 = data_length1;
- _tmp207_ = offset;
- _tmp206_[_tmp207_] = (guint8) 0;
- _tmp208_ = _tmp206_[_tmp207_];
+ _tmp196_ = mask;
+ mask = _tmp196_ >> 1;
+ _tmp197_ = mask;
+ if (_tmp197_ == 0) {
+ gint _tmp198_;
+ _tmp198_ = offset;
+ offset = _tmp198_ + 1;
mask = 0x80;
}
}
@@ -1994,104 +1966,104 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
}
}
} else {
- gchar* _tmp209_;
- gint _tmp210_;
- gint _tmp211_;
+ gchar* _tmp199_;
+ gint _tmp200_;
+ gint _tmp201_;
gint data_length;
- gint _tmp212_;
- guint8* _tmp213_ = NULL;
+ gint _tmp202_;
+ guint8* _tmp203_ = NULL;
depth = 8;
- _tmp209_ = g_strdup ("DeviceGray");
+ _tmp199_ = g_strdup ("DeviceGray");
_g_free0 (color_space);
- color_space = _tmp209_;
- _tmp210_ = height;
- _tmp211_ = width;
- data_length = (_tmp210_ * _tmp211_) + 1;
- _tmp212_ = data_length;
- _tmp213_ = g_new0 (guint8, _tmp212_);
+ color_space = _tmp199_;
+ _tmp200_ = height;
+ _tmp201_ = width;
+ data_length = _tmp200_ * _tmp201_;
+ _tmp202_ = data_length;
+ _tmp203_ = g_new0 (guint8, _tmp202_);
data = (g_free (data), NULL);
- data = _tmp213_;
- data_length1 = _tmp212_;
+ data = _tmp203_;
+ data_length1 = _tmp202_;
_data_size_ = data_length1;
{
gint row;
row = 0;
{
- gboolean _tmp214_;
- _tmp214_ = TRUE;
+ gboolean _tmp204_;
+ _tmp204_ = TRUE;
while (TRUE) {
- gboolean _tmp215_;
- gint _tmp217_;
- gint _tmp218_;
- gint _tmp219_;
- GdkPixbuf* _tmp220_;
- gint _tmp221_ = 0;
+ gboolean _tmp205_;
+ gint _tmp207_;
+ gint _tmp208_;
+ gint _tmp209_;
+ GdkPixbuf* _tmp210_;
+ gint _tmp211_ = 0;
gint in_offset;
- gint _tmp222_;
- gint _tmp223_;
+ gint _tmp212_;
+ gint _tmp213_;
gint out_offset;
- _tmp215_ = _tmp214_;
- if (!_tmp215_) {
- gint _tmp216_;
- _tmp216_ = row;
- row = _tmp216_ + 1;
+ _tmp205_ = _tmp204_;
+ if (!_tmp205_) {
+ gint _tmp206_;
+ _tmp206_ = row;
+ row = _tmp206_ + 1;
}
- _tmp214_ = FALSE;
- _tmp217_ = row;
- _tmp218_ = height;
- if (!(_tmp217_ < _tmp218_)) {
+ _tmp204_ = FALSE;
+ _tmp207_ = row;
+ _tmp208_ = height;
+ if (!(_tmp207_ < _tmp208_)) {
break;
}
- _tmp219_ = row;
- _tmp220_ = image;
- _tmp221_ = gdk_pixbuf_get_rowstride (_tmp220_);
- in_offset = _tmp219_ * _tmp221_;
- _tmp222_ = row;
- _tmp223_ = width;
- out_offset = _tmp222_ * _tmp223_;
+ _tmp209_ = row;
+ _tmp210_ = image;
+ _tmp211_ = gdk_pixbuf_get_rowstride (_tmp210_);
+ in_offset = _tmp209_ * _tmp211_;
+ _tmp212_ = row;
+ _tmp213_ = width;
+ out_offset = _tmp212_ * _tmp213_;
{
gint x;
x = 0;
{
- gboolean _tmp224_;
- _tmp224_ = TRUE;
+ gboolean _tmp214_;
+ _tmp214_ = TRUE;
while (TRUE) {
- gboolean _tmp225_;
- gint _tmp227_;
- gint _tmp228_;
- guint8* _tmp229_;
- gint _tmp229__length1;
- gint _tmp230_;
- gint _tmp231_;
- guint8* _tmp232_;
- gint _tmp232__length1;
- gint _tmp233_;
- gint _tmp234_;
- guint8 _tmp235_;
- guint8 _tmp236_;
- _tmp225_ = _tmp224_;
- if (!_tmp225_) {
- gint _tmp226_;
- _tmp226_ = x;
- x = _tmp226_ + 1;
+ gboolean _tmp215_;
+ gint _tmp217_;
+ gint _tmp218_;
+ guint8* _tmp219_;
+ gint _tmp219__length1;
+ gint _tmp220_;
+ gint _tmp221_;
+ guint8* _tmp222_;
+ gint _tmp222__length1;
+ gint _tmp223_;
+ gint _tmp224_;
+ guint8 _tmp225_;
+ guint8 _tmp226_;
+ _tmp215_ = _tmp214_;
+ if (!_tmp215_) {
+ gint _tmp216_;
+ _tmp216_ = x;
+ x = _tmp216_ + 1;
}
- _tmp224_ = FALSE;
- _tmp227_ = x;
- _tmp228_ = width;
- if (!(_tmp227_ < _tmp228_)) {
+ _tmp214_ = FALSE;
+ _tmp217_ = x;
+ _tmp218_ = width;
+ if (!(_tmp217_ < _tmp218_)) {
break;
}
- _tmp229_ = data;
- _tmp229__length1 = data_length1;
- _tmp230_ = out_offset;
- _tmp231_ = x;
- _tmp232_ = pixels;
- _tmp232__length1 = pixels_length1;
- _tmp233_ = in_offset;
- _tmp234_ = x;
- _tmp235_ = _tmp232_[_tmp233_ + (_tmp234_ * 3)];
- _tmp229_[_tmp230_ + _tmp231_] = _tmp235_;
- _tmp236_ = _tmp229_[_tmp230_ + _tmp231_];
+ _tmp219_ = data;
+ _tmp219__length1 = data_length1;
+ _tmp220_ = out_offset;
+ _tmp221_ = x;
+ _tmp222_ = pixels;
+ _tmp222__length1 = pixels_length1;
+ _tmp223_ = in_offset;
+ _tmp224_ = x;
+ _tmp225_ = _tmp222_[_tmp223_ + (_tmp224_ * 3)];
+ _tmp219_[_tmp220_ + _tmp221_] = _tmp225_;
+ _tmp226_ = _tmp219_[_tmp220_ + _tmp221_];
}
}
}
@@ -2101,250 +2073,250 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
}
}
}
- _tmp237_ = data;
- _tmp237__length1 = data_length1;
- _tmp239_ = book_compress_zlib (self, _tmp237_, _tmp237__length1, &_tmp238_);
- compressed_data = _tmp239_;
- compressed_data_length1 = _tmp238_;
+ _tmp227_ = data;
+ _tmp227__length1 = data_length1;
+ _tmp229_ = book_compress_zlib (self, _tmp227_, _tmp227__length1, &_tmp228_);
+ compressed_data = _tmp229_;
+ compressed_data_length1 = _tmp228_;
_compressed_data_size_ = compressed_data_length1;
- _tmp240_ = compressed_data;
- _tmp240__length1 = compressed_data_length1;
- if (_tmp240_ != NULL) {
- gint _tmp241_;
- const gchar* _tmp251_;
- _tmp241_ = depth;
- if (_tmp241_ > 1) {
+ _tmp230_ = compressed_data;
+ _tmp230__length1 = compressed_data_length1;
+ if (_tmp230_ != NULL) {
+ gint _tmp231_;
+ const gchar* _tmp241_;
+ _tmp231_ = depth;
+ if (_tmp231_ > 1) {
gsize jpeg_length = 0UL;
- GdkPixbuf* _tmp242_;
- gsize _tmp243_ = 0UL;
- gint _tmp244_ = 0;
- guint8* _tmp245_ = NULL;
+ GdkPixbuf* _tmp232_;
+ gsize _tmp233_ = 0UL;
+ gint _tmp234_ = 0;
+ guint8* _tmp235_ = NULL;
guint8* jpeg_data;
gint jpeg_data_length1;
gint _jpeg_data_size_;
- gsize _tmp246_;
- guint8* _tmp247_;
- gint _tmp247__length1;
- _tmp242_ = image;
- _tmp245_ = book_compress_jpeg (self, _tmp242_, &_tmp243_, &_tmp244_);
- jpeg_length = _tmp243_;
- jpeg_data = _tmp245_;
- jpeg_data_length1 = _tmp244_;
+ gsize _tmp236_;
+ guint8* _tmp237_;
+ gint _tmp237__length1;
+ _tmp232_ = image;
+ _tmp235_ = book_compress_jpeg (self, _tmp232_, &_tmp233_, &_tmp234_);
+ jpeg_length = _tmp233_;
+ jpeg_data = _tmp235_;
+ jpeg_data_length1 = _tmp234_;
_jpeg_data_size_ = jpeg_data_length1;
- _tmp246_ = jpeg_length;
- _tmp247_ = compressed_data;
- _tmp247__length1 = compressed_data_length1;
- if (_tmp246_ < ((gsize) _tmp247__length1)) {
- gchar* _tmp248_;
- guint8* _tmp249_;
- gint _tmp249__length1;
- guint8* _tmp250_;
- gint _tmp250__length1;
- _tmp248_ = g_strdup ("DCTDecode");
+ _tmp236_ = jpeg_length;
+ _tmp237_ = compressed_data;
+ _tmp237__length1 = compressed_data_length1;
+ if (_tmp236_ < ((gsize) _tmp237__length1)) {
+ gchar* _tmp238_;
+ guint8* _tmp239_;
+ gint _tmp239__length1;
+ guint8* _tmp240_;
+ gint _tmp240__length1;
+ _tmp238_ = g_strdup ("DCTDecode");
_g_free0 (filter);
- filter = _tmp248_;
- _tmp249_ = jpeg_data;
- _tmp249__length1 = jpeg_data_length1;
- _tmp250_ = (_tmp249_ != NULL) ? _vala_array_dup1 (_tmp249_, _tmp249__length1) : ((gpointer) _tmp249_);
- _tmp250__length1 = _tmp249__length1;
+ filter = _tmp238_;
+ _tmp239_ = jpeg_data;
+ _tmp239__length1 = jpeg_data_length1;
+ _tmp240_ = (_tmp239_ != NULL) ? _vala_array_dup1 (_tmp239_, _tmp239__length1) : ((gpointer) _tmp239_);
+ _tmp240__length1 = _tmp239__length1;
data = (g_free (data), NULL);
- data = _tmp250_;
- data_length1 = _tmp250__length1;
+ data = _tmp240_;
+ data_length1 = _tmp240__length1;
_data_size_ = data_length1;
}
jpeg_data = (g_free (jpeg_data), NULL);
}
- _tmp251_ = filter;
- if (_tmp251_ == NULL) {
- gchar* _tmp252_;
- guint8* _tmp253_;
- gint _tmp253__length1;
- guint8* _tmp254_;
- gint _tmp254__length1;
- _tmp252_ = g_strdup ("FlateDecode");
+ _tmp241_ = filter;
+ if (_tmp241_ == NULL) {
+ gchar* _tmp242_;
+ guint8* _tmp243_;
+ gint _tmp243__length1;
+ guint8* _tmp244_;
+ gint _tmp244__length1;
+ _tmp242_ = g_strdup ("FlateDecode");
_g_free0 (filter);
- filter = _tmp252_;
- _tmp253_ = compressed_data;
- _tmp253__length1 = compressed_data_length1;
- _tmp254_ = (_tmp253_ != NULL) ? _vala_array_dup2 (_tmp253_, _tmp253__length1) : ((gpointer) _tmp253_);
- _tmp254__length1 = _tmp253__length1;
+ filter = _tmp242_;
+ _tmp243_ = compressed_data;
+ _tmp243__length1 = compressed_data_length1;
+ _tmp244_ = (_tmp243_ != NULL) ? _vala_array_dup2 (_tmp243_, _tmp243__length1) : ((gpointer) _tmp243_);
+ _tmp244__length1 = _tmp243__length1;
data = (g_free (data), NULL);
- data = _tmp254_;
- data_length1 = _tmp254__length1;
+ data = _tmp244_;
+ data_length1 = _tmp244__length1;
_data_size_ = data_length1;
}
}
- _tmp255_ = writer;
- pdf_writer_write_string (_tmp255_, "\n");
- _tmp256_ = writer;
- _tmp257_ = pdf_writer_start_object (_tmp256_);
- number = _tmp257_;
+ _tmp245_ = writer;
+ pdf_writer_write_string (_tmp245_, "\n");
+ _tmp246_ = writer;
+ _tmp247_ = pdf_writer_start_object (_tmp246_);
+ number = _tmp247_;
+ _tmp248_ = writer;
+ _tmp249_ = number;
+ _tmp250_ = g_strdup_printf ("%u 0 obj\n", _tmp249_);
+ _tmp251_ = _tmp250_;
+ pdf_writer_write_string (_tmp248_, _tmp251_);
+ _g_free0 (_tmp251_);
+ _tmp252_ = writer;
+ pdf_writer_write_string (_tmp252_, "<<\n");
+ _tmp253_ = writer;
+ pdf_writer_write_string (_tmp253_, "/Type /Page\n");
+ _tmp254_ = writer;
+ _tmp255_ = pages_number;
+ _tmp256_ = g_strdup_printf ("/Parent %u 0 R\n", _tmp255_);
+ _tmp257_ = _tmp256_;
+ pdf_writer_write_string (_tmp254_, _tmp257_);
+ _g_free0 (_tmp257_);
_tmp258_ = writer;
- _tmp259_ = number;
- _tmp260_ = g_strdup_printf ("%u 0 obj\n", _tmp259_);
- _tmp261_ = _tmp260_;
- pdf_writer_write_string (_tmp258_, _tmp261_);
- _g_free0 (_tmp261_);
- _tmp262_ = writer;
- pdf_writer_write_string (_tmp262_, "<<\n");
+ _tmp259_ = i;
+ _tmp260_ = number;
+ _tmp261_ = g_strdup_printf ("/Resources << /XObject << /Im%d %u 0 R >> >>\n", _tmp259_, _tmp260_ + 1);
+ _tmp262_ = _tmp261_;
+ pdf_writer_write_string (_tmp258_, _tmp262_);
+ _g_free0 (_tmp262_);
_tmp263_ = writer;
- pdf_writer_write_string (_tmp263_, "/Type /Page\n");
- _tmp264_ = writer;
- _tmp265_ = pages_number;
- _tmp266_ = g_strdup_printf ("/Parent %u 0 R\n", _tmp265_);
- _tmp267_ = _tmp266_;
- pdf_writer_write_string (_tmp264_, _tmp267_);
- _g_free0 (_tmp267_);
- _tmp268_ = writer;
- _tmp269_ = i;
- _tmp270_ = number;
- _tmp271_ = g_strdup_printf ("/Resources << /XObject << /Im%d %u 0 R >> >>\n", _tmp269_, _tmp270_ + 1);
- _tmp272_ = _tmp271_;
- pdf_writer_write_string (_tmp268_, _tmp272_);
- _g_free0 (_tmp272_);
- _tmp273_ = writer;
- _tmp274_ = page_width;
- _tmp275_ = width_buffer;
- _tmp275__length1 = width_buffer_length1;
- _tmp276_ = g_ascii_formatd (_tmp275_, _tmp275__length1, "%.2f", _tmp274_);
- _tmp277_ = page_height;
- _tmp278_ = height_buffer;
- _tmp278__length1 = height_buffer_length1;
- _tmp279_ = g_ascii_formatd (_tmp278_, _tmp278__length1, "%.2f", _tmp277_);
- _tmp280_ = g_strdup_printf ("/MediaBox [ 0 0 %s %s ]\n", _tmp276_, _tmp279_);
- _tmp281_ = _tmp280_;
- pdf_writer_write_string (_tmp273_, _tmp281_);
- _g_free0 (_tmp281_);
- _tmp282_ = writer;
- _tmp283_ = number;
- _tmp284_ = g_strdup_printf ("/Contents %u 0 R\n", _tmp283_ + 2);
- _tmp285_ = _tmp284_;
- pdf_writer_write_string (_tmp282_, _tmp285_);
- _g_free0 (_tmp285_);
+ _tmp264_ = page_width;
+ _tmp265_ = width_buffer;
+ _tmp265__length1 = width_buffer_length1;
+ _tmp266_ = g_ascii_formatd (_tmp265_, _tmp265__length1, "%.2f", _tmp264_);
+ _tmp267_ = page_height;
+ _tmp268_ = height_buffer;
+ _tmp268__length1 = height_buffer_length1;
+ _tmp269_ = g_ascii_formatd (_tmp268_, _tmp268__length1, "%.2f", _tmp267_);
+ _tmp270_ = g_strdup_printf ("/MediaBox [ 0 0 %s %s ]\n", _tmp266_, _tmp269_);
+ _tmp271_ = _tmp270_;
+ pdf_writer_write_string (_tmp263_, _tmp271_);
+ _g_free0 (_tmp271_);
+ _tmp272_ = writer;
+ _tmp273_ = number;
+ _tmp274_ = g_strdup_printf ("/Contents %u 0 R\n", _tmp273_ + 2);
+ _tmp275_ = _tmp274_;
+ pdf_writer_write_string (_tmp272_, _tmp275_);
+ _g_free0 (_tmp275_);
+ _tmp276_ = writer;
+ pdf_writer_write_string (_tmp276_, ">>\n");
+ _tmp277_ = writer;
+ pdf_writer_write_string (_tmp277_, "endobj\n");
+ _tmp278_ = writer;
+ pdf_writer_write_string (_tmp278_, "\n");
+ _tmp279_ = writer;
+ _tmp280_ = pdf_writer_start_object (_tmp279_);
+ number = _tmp280_;
+ _tmp281_ = writer;
+ _tmp282_ = number;
+ _tmp283_ = g_strdup_printf ("%u 0 obj\n", _tmp282_);
+ _tmp284_ = _tmp283_;
+ pdf_writer_write_string (_tmp281_, _tmp284_);
+ _g_free0 (_tmp284_);
+ _tmp285_ = writer;
+ pdf_writer_write_string (_tmp285_, "<<\n");
_tmp286_ = writer;
- pdf_writer_write_string (_tmp286_, ">>\n");
+ pdf_writer_write_string (_tmp286_, "/Type /XObject\n");
_tmp287_ = writer;
- pdf_writer_write_string (_tmp287_, "endobj\n");
+ pdf_writer_write_string (_tmp287_, "/Subtype /Image\n");
_tmp288_ = writer;
- pdf_writer_write_string (_tmp288_, "\n");
- _tmp289_ = writer;
- _tmp290_ = pdf_writer_start_object (_tmp289_);
- number = _tmp290_;
- _tmp291_ = writer;
- _tmp292_ = number;
- _tmp293_ = g_strdup_printf ("%u 0 obj\n", _tmp292_);
- _tmp294_ = _tmp293_;
- pdf_writer_write_string (_tmp291_, _tmp294_);
- _g_free0 (_tmp294_);
- _tmp295_ = writer;
- pdf_writer_write_string (_tmp295_, "<<\n");
+ _tmp289_ = width;
+ _tmp290_ = g_strdup_printf ("/Width %d\n", _tmp289_);
+ _tmp291_ = _tmp290_;
+ pdf_writer_write_string (_tmp288_, _tmp291_);
+ _g_free0 (_tmp291_);
+ _tmp292_ = writer;
+ _tmp293_ = height;
+ _tmp294_ = g_strdup_printf ("/Height %d\n", _tmp293_);
+ _tmp295_ = _tmp294_;
+ pdf_writer_write_string (_tmp292_, _tmp295_);
+ _g_free0 (_tmp295_);
_tmp296_ = writer;
- pdf_writer_write_string (_tmp296_, "/Type /XObject\n");
- _tmp297_ = writer;
- pdf_writer_write_string (_tmp297_, "/Subtype /Image\n");
- _tmp298_ = writer;
- _tmp299_ = width;
- _tmp300_ = g_strdup_printf ("/Width %d\n", _tmp299_);
- _tmp301_ = _tmp300_;
- pdf_writer_write_string (_tmp298_, _tmp301_);
- _g_free0 (_tmp301_);
- _tmp302_ = writer;
- _tmp303_ = height;
- _tmp304_ = g_strdup_printf ("/Height %d\n", _tmp303_);
- _tmp305_ = _tmp304_;
- pdf_writer_write_string (_tmp302_, _tmp305_);
- _g_free0 (_tmp305_);
- _tmp306_ = writer;
- _tmp307_ = color_space;
- _tmp308_ = g_strdup_printf ("/ColorSpace /%s\n", _tmp307_);
- _tmp309_ = _tmp308_;
- pdf_writer_write_string (_tmp306_, _tmp309_);
- _g_free0 (_tmp309_);
- _tmp310_ = writer;
- _tmp311_ = depth;
- _tmp312_ = g_strdup_printf ("/BitsPerComponent %d\n", _tmp311_);
- _tmp313_ = _tmp312_;
- pdf_writer_write_string (_tmp310_, _tmp313_);
- _g_free0 (_tmp313_);
- _tmp314_ = writer;
- _tmp315_ = data;
- _tmp315__length1 = data_length1;
- _tmp316_ = g_strdup_printf ("/Length %d\n", _tmp315__length1);
- _tmp317_ = _tmp316_;
- pdf_writer_write_string (_tmp314_, _tmp317_);
- _g_free0 (_tmp317_);
- _tmp318_ = filter;
- if (_tmp318_ != NULL) {
- PDFWriter* _tmp319_;
- const gchar* _tmp320_;
- gchar* _tmp321_ = NULL;
- gchar* _tmp322_;
- _tmp319_ = writer;
- _tmp320_ = filter;
- _tmp321_ = g_strdup_printf ("/Filter /%s\n", _tmp320_);
- _tmp322_ = _tmp321_;
- pdf_writer_write_string (_tmp319_, _tmp322_);
- _g_free0 (_tmp322_);
+ _tmp297_ = color_space;
+ _tmp298_ = g_strdup_printf ("/ColorSpace /%s\n", _tmp297_);
+ _tmp299_ = _tmp298_;
+ pdf_writer_write_string (_tmp296_, _tmp299_);
+ _g_free0 (_tmp299_);
+ _tmp300_ = writer;
+ _tmp301_ = depth;
+ _tmp302_ = g_strdup_printf ("/BitsPerComponent %d\n", _tmp301_);
+ _tmp303_ = _tmp302_;
+ pdf_writer_write_string (_tmp300_, _tmp303_);
+ _g_free0 (_tmp303_);
+ _tmp304_ = writer;
+ _tmp305_ = data;
+ _tmp305__length1 = data_length1;
+ _tmp306_ = g_strdup_printf ("/Length %d\n", _tmp305__length1);
+ _tmp307_ = _tmp306_;
+ pdf_writer_write_string (_tmp304_, _tmp307_);
+ _g_free0 (_tmp307_);
+ _tmp308_ = filter;
+ if (_tmp308_ != NULL) {
+ PDFWriter* _tmp309_;
+ const gchar* _tmp310_;
+ gchar* _tmp311_ = NULL;
+ gchar* _tmp312_;
+ _tmp309_ = writer;
+ _tmp310_ = filter;
+ _tmp311_ = g_strdup_printf ("/Filter /%s\n", _tmp310_);
+ _tmp312_ = _tmp311_;
+ pdf_writer_write_string (_tmp309_, _tmp312_);
+ _g_free0 (_tmp312_);
}
- _tmp323_ = writer;
- pdf_writer_write_string (_tmp323_, ">>\n");
- _tmp324_ = writer;
- pdf_writer_write_string (_tmp324_, "stream\n");
- _tmp325_ = writer;
- _tmp326_ = data;
- _tmp326__length1 = data_length1;
- pdf_writer_write (_tmp325_, _tmp326_, _tmp326__length1);
- _tmp327_ = writer;
- pdf_writer_write_string (_tmp327_, "\n");
+ _tmp313_ = writer;
+ pdf_writer_write_string (_tmp313_, ">>\n");
+ _tmp314_ = writer;
+ pdf_writer_write_string (_tmp314_, "stream\n");
+ _tmp315_ = writer;
+ _tmp316_ = data;
+ _tmp316__length1 = data_length1;
+ pdf_writer_write (_tmp315_, _tmp316_, _tmp316__length1);
+ _tmp317_ = writer;
+ pdf_writer_write_string (_tmp317_, "\n");
+ _tmp318_ = writer;
+ pdf_writer_write_string (_tmp318_, "endstream\n");
+ _tmp319_ = writer;
+ pdf_writer_write_string (_tmp319_, "endobj\n");
+ _tmp320_ = page_width;
+ _tmp321_ = width_buffer;
+ _tmp321__length1 = width_buffer_length1;
+ _tmp322_ = g_ascii_formatd (_tmp321_, _tmp321__length1, "%f", _tmp320_);
+ _tmp323_ = page_height;
+ _tmp324_ = height_buffer;
+ _tmp324__length1 = height_buffer_length1;
+ _tmp325_ = g_ascii_formatd (_tmp324_, _tmp324__length1, "%f", _tmp323_);
+ _tmp326_ = i;
+ _tmp327_ = g_strdup_printf ("q\n%s 0 0 %s 0 0 cm\n/Im%d Do\nQ", _tmp322_, _tmp325_, _tmp326_);
+ command = _tmp327_;
_tmp328_ = writer;
- pdf_writer_write_string (_tmp328_, "endstream\n");
+ pdf_writer_write_string (_tmp328_, "\n");
_tmp329_ = writer;
- pdf_writer_write_string (_tmp329_, "endobj\n");
- _tmp330_ = page_width;
- _tmp331_ = width_buffer;
- _tmp331__length1 = width_buffer_length1;
- _tmp332_ = g_ascii_formatd (_tmp331_, _tmp331__length1, "%f", _tmp330_);
- _tmp333_ = page_height;
- _tmp334_ = height_buffer;
- _tmp334__length1 = height_buffer_length1;
- _tmp335_ = g_ascii_formatd (_tmp334_, _tmp334__length1, "%f", _tmp333_);
- _tmp336_ = i;
- _tmp337_ = g_strdup_printf ("q\n%s 0 0 %s 0 0 cm\n/Im%d Do\nQ", _tmp332_, _tmp335_, _tmp336_);
- command = _tmp337_;
- _tmp338_ = writer;
- pdf_writer_write_string (_tmp338_, "\n");
- _tmp339_ = writer;
- _tmp340_ = pdf_writer_start_object (_tmp339_);
- number = _tmp340_;
- _tmp341_ = writer;
- _tmp342_ = number;
- _tmp343_ = g_strdup_printf ("%u 0 obj\n", _tmp342_);
- _tmp344_ = _tmp343_;
- pdf_writer_write_string (_tmp341_, _tmp344_);
- _g_free0 (_tmp344_);
- _tmp345_ = writer;
- pdf_writer_write_string (_tmp345_, "<<\n");
+ _tmp330_ = pdf_writer_start_object (_tmp329_);
+ number = _tmp330_;
+ _tmp331_ = writer;
+ _tmp332_ = number;
+ _tmp333_ = g_strdup_printf ("%u 0 obj\n", _tmp332_);
+ _tmp334_ = _tmp333_;
+ pdf_writer_write_string (_tmp331_, _tmp334_);
+ _g_free0 (_tmp334_);
+ _tmp335_ = writer;
+ pdf_writer_write_string (_tmp335_, "<<\n");
+ _tmp336_ = writer;
+ _tmp337_ = command;
+ _tmp338_ = strlen (_tmp337_);
+ _tmp339_ = _tmp338_;
+ _tmp340_ = g_strdup_printf ("/Length %d\n", _tmp339_ + 1);
+ _tmp341_ = _tmp340_;
+ pdf_writer_write_string (_tmp336_, _tmp341_);
+ _g_free0 (_tmp341_);
+ _tmp342_ = writer;
+ pdf_writer_write_string (_tmp342_, ">>\n");
+ _tmp343_ = writer;
+ pdf_writer_write_string (_tmp343_, "stream\n");
+ _tmp344_ = writer;
+ _tmp345_ = command;
+ pdf_writer_write_string (_tmp344_, _tmp345_);
_tmp346_ = writer;
- _tmp347_ = command;
- _tmp348_ = strlen (_tmp347_);
- _tmp349_ = _tmp348_;
- _tmp350_ = g_strdup_printf ("/Length %d\n", _tmp349_ + 1);
- _tmp351_ = _tmp350_;
- pdf_writer_write_string (_tmp346_, _tmp351_);
- _g_free0 (_tmp351_);
- _tmp352_ = writer;
- pdf_writer_write_string (_tmp352_, ">>\n");
- _tmp353_ = writer;
- pdf_writer_write_string (_tmp353_, "stream\n");
- _tmp354_ = writer;
- _tmp355_ = command;
- pdf_writer_write_string (_tmp354_, _tmp355_);
- _tmp356_ = writer;
- pdf_writer_write_string (_tmp356_, "\n");
- _tmp357_ = writer;
- pdf_writer_write_string (_tmp357_, "endstream\n");
- _tmp358_ = writer;
- pdf_writer_write_string (_tmp358_, "endobj\n");
+ pdf_writer_write_string (_tmp346_, "\n");
+ _tmp347_ = writer;
+ pdf_writer_write_string (_tmp347_, "endstream\n");
+ _tmp348_ = writer;
+ pdf_writer_write_string (_tmp348_, "endobj\n");
_g_free0 (command);
compressed_data = (g_free (compressed_data), NULL);
data = (g_free (data), NULL);
@@ -2357,100 +2329,100 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
}
}
}
- _tmp359_ = writer;
- pdf_writer_write_string (_tmp359_, "\n");
+ _tmp349_ = writer;
+ pdf_writer_write_string (_tmp349_, "\n");
+ _tmp350_ = writer;
+ _tmp351_ = pdf_writer_start_object (_tmp350_);
+ info_number = _tmp351_;
+ _tmp352_ = writer;
+ _tmp353_ = info_number;
+ _tmp354_ = g_strdup_printf ("%u 0 obj\n", _tmp353_);
+ _tmp355_ = _tmp354_;
+ pdf_writer_write_string (_tmp352_, _tmp355_);
+ _g_free0 (_tmp355_);
+ _tmp356_ = writer;
+ pdf_writer_write_string (_tmp356_, "<<\n");
+ _tmp357_ = writer;
+ _tmp358_ = g_strdup_printf ("/Creator (Simple Scan %s)\n", VERSION);
+ _tmp359_ = _tmp358_;
+ pdf_writer_write_string (_tmp357_, _tmp359_);
+ _g_free0 (_tmp359_);
_tmp360_ = writer;
- _tmp361_ = pdf_writer_start_object (_tmp360_);
- info_number = _tmp361_;
+ pdf_writer_write_string (_tmp360_, ">>\n");
+ _tmp361_ = writer;
+ pdf_writer_write_string (_tmp361_, "endobj\n");
_tmp362_ = writer;
- _tmp363_ = info_number;
- _tmp364_ = g_strdup_printf ("%u 0 obj\n", _tmp363_);
- _tmp365_ = _tmp364_;
- pdf_writer_write_string (_tmp362_, _tmp365_);
- _g_free0 (_tmp365_);
+ _tmp363_ = _tmp362_->offset;
+ xref_offset = _tmp363_;
+ _tmp364_ = writer;
+ pdf_writer_write_string (_tmp364_, "xref\n");
+ _tmp365_ = writer;
_tmp366_ = writer;
- pdf_writer_write_string (_tmp366_, "<<\n");
- _tmp367_ = writer;
- _tmp368_ = g_strdup_printf ("/Creator (Simple Scan %s)\n", VERSION);
- _tmp369_ = _tmp368_;
- pdf_writer_write_string (_tmp367_, _tmp369_);
- _g_free0 (_tmp369_);
- _tmp370_ = writer;
- pdf_writer_write_string (_tmp370_, ">>\n");
+ _tmp367_ = _tmp366_->object_offsets;
+ _tmp368_ = g_list_length (_tmp367_);
+ _tmp369_ = g_strdup_printf ("1 %zu\n", (gsize) _tmp368_);
+ _tmp370_ = _tmp369_;
+ pdf_writer_write_string (_tmp365_, _tmp370_);
+ _g_free0 (_tmp370_);
_tmp371_ = writer;
- pdf_writer_write_string (_tmp371_, "endobj\n");
- _tmp372_ = writer;
- _tmp373_ = _tmp372_->offset;
- xref_offset = _tmp373_;
- _tmp374_ = writer;
- pdf_writer_write_string (_tmp374_, "xref\n");
- _tmp375_ = writer;
- _tmp376_ = writer;
- _tmp377_ = _tmp376_->object_offsets;
- _tmp378_ = g_list_length (_tmp377_);
- _tmp379_ = g_strdup_printf ("1 %zu\n", (gsize) _tmp378_);
- _tmp380_ = _tmp379_;
- pdf_writer_write_string (_tmp375_, _tmp380_);
- _g_free0 (_tmp380_);
- _tmp381_ = writer;
- _tmp382_ = _tmp381_->object_offsets;
+ _tmp372_ = _tmp371_->object_offsets;
{
GList* offset_collection = NULL;
GList* offset_it = NULL;
- offset_collection = _tmp382_;
+ offset_collection = _tmp372_;
for (offset_it = offset_collection; offset_it != NULL; offset_it = offset_it->next) {
guint offset = 0U;
offset = GPOINTER_TO_UINT (offset_it->data);
{
- PDFWriter* _tmp383_;
- guint _tmp384_;
- gchar* _tmp385_ = NULL;
- gchar* _tmp386_;
- _tmp383_ = writer;
- _tmp384_ = offset;
- _tmp385_ = g_strdup_printf ("%010zu 00000 n \n", (gsize) _tmp384_);
- _tmp386_ = _tmp385_;
- pdf_writer_write_string (_tmp383_, _tmp386_);
- _g_free0 (_tmp386_);
+ PDFWriter* _tmp373_;
+ guint _tmp374_;
+ gchar* _tmp375_ = NULL;
+ gchar* _tmp376_;
+ _tmp373_ = writer;
+ _tmp374_ = offset;
+ _tmp375_ = g_strdup_printf ("%010zu 00000 n \n", (gsize) _tmp374_);
+ _tmp376_ = _tmp375_;
+ pdf_writer_write_string (_tmp373_, _tmp376_);
+ _g_free0 (_tmp376_);
}
}
}
- _tmp387_ = writer;
- pdf_writer_write_string (_tmp387_, "trailer\n");
- _tmp388_ = writer;
- pdf_writer_write_string (_tmp388_, "<<\n");
+ _tmp377_ = writer;
+ pdf_writer_write_string (_tmp377_, "trailer\n");
+ _tmp378_ = writer;
+ pdf_writer_write_string (_tmp378_, "<<\n");
+ _tmp379_ = writer;
+ _tmp380_ = writer;
+ _tmp381_ = _tmp380_->object_offsets;
+ _tmp382_ = g_list_length (_tmp381_);
+ _tmp383_ = g_strdup_printf ("/Size %zu\n", (gsize) _tmp382_);
+ _tmp384_ = _tmp383_;
+ pdf_writer_write_string (_tmp379_, _tmp384_);
+ _g_free0 (_tmp384_);
+ _tmp385_ = writer;
+ _tmp386_ = info_number;
+ _tmp387_ = g_strdup_printf ("/Info %u 0 R\n", _tmp386_);
+ _tmp388_ = _tmp387_;
+ pdf_writer_write_string (_tmp385_, _tmp388_);
+ _g_free0 (_tmp388_);
_tmp389_ = writer;
- _tmp390_ = writer;
- _tmp391_ = _tmp390_->object_offsets;
- _tmp392_ = g_list_length (_tmp391_);
- _tmp393_ = g_strdup_printf ("/Size %zu\n", (gsize) _tmp392_);
- _tmp394_ = _tmp393_;
- pdf_writer_write_string (_tmp389_, _tmp394_);
- _g_free0 (_tmp394_);
+ _tmp390_ = catalog_number;
+ _tmp391_ = g_strdup_printf ("/Root %u 0 R\n", _tmp390_);
+ _tmp392_ = _tmp391_;
+ pdf_writer_write_string (_tmp389_, _tmp392_);
+ _g_free0 (_tmp392_);
+ _tmp393_ = writer;
+ pdf_writer_write_string (_tmp393_, ">>\n");
+ _tmp394_ = writer;
+ pdf_writer_write_string (_tmp394_, "startxref\n");
_tmp395_ = writer;
- _tmp396_ = info_number;
- _tmp397_ = g_strdup_printf ("/Info %u 0 R\n", _tmp396_);
+ _tmp396_ = xref_offset;
+ _tmp397_ = g_strdup_printf ("%zu\n", _tmp396_);
_tmp398_ = _tmp397_;
pdf_writer_write_string (_tmp395_, _tmp398_);
_g_free0 (_tmp398_);
_tmp399_ = writer;
- _tmp400_ = catalog_number;
- _tmp401_ = g_strdup_printf ("/Root %u 0 R\n", _tmp400_);
- _tmp402_ = _tmp401_;
- pdf_writer_write_string (_tmp399_, _tmp402_);
- _g_free0 (_tmp402_);
- _tmp403_ = writer;
- pdf_writer_write_string (_tmp403_, ">>\n");
- _tmp404_ = writer;
- pdf_writer_write_string (_tmp404_, "startxref\n");
- _tmp405_ = writer;
- _tmp406_ = xref_offset;
- _tmp407_ = g_strdup_printf ("%zu\n", _tmp406_);
- _tmp408_ = _tmp407_;
- pdf_writer_write_string (_tmp405_, _tmp408_);
- _g_free0 (_tmp408_);
- _tmp409_ = writer;
- pdf_writer_write_string (_tmp409_, "%%EOF\n");
+ pdf_writer_write_string (_tmp399_, "%%EOF\n");
_pdf_writer_unref0 (writer);
_g_object_unref0 (stream);
}
@@ -2811,7 +2783,7 @@ void pdf_writer_write (PDFWriter* self, guint8* data, int data_length1) {
_inner_error_ = NULL;
_tmp2_ = e;
_tmp3_ = _tmp2_->message;
- g_warning ("book.vala:530: Error writing PDF: %s", _tmp3_);
+ g_warning ("book.vala:538: Error writing PDF: %s", _tmp3_);
_g_error_free0 (e);
}
__finally0:
@@ -3118,7 +3090,7 @@ static cairo_status_t ps_writer_write_cairo_data (PsWriter* self, guint8* data,
_inner_error_ = NULL;
_tmp2_ = e;
_tmp3_ = _tmp2_->message;
- g_warning ("book.vala:566: Error writing data: %s", _tmp3_);
+ g_warning ("book.vala:574: Error writing data: %s", _tmp3_);
result = CAIRO_STATUS_WRITE_ERROR;
_g_error_free0 (e);
return result;