summaryrefslogtreecommitdiff
path: root/src/book.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/book.c')
-rw-r--r--src/book.c550
1 files changed, 282 insertions, 268 deletions
diff --git a/src/book.c b/src/book.c
index 711aa1c..c59870c 100644
--- a/src/book.c
+++ b/src/book.c
@@ -1,4 +1,4 @@
-/* book.c generated by valac 0.16.0, the Vala compiler
+/* book.c generated by valac 0.16.1, the Vala compiler
* generated from book.vala, do not modify */
/*
@@ -622,51 +622,65 @@ static GFile* book_make_indexed_file (Book* self, const gchar* uri, gint i) {
static void book_save_multi_file (Book* self, const gchar* type, GFile* file, GError** error) {
- gint i;
- GList* _tmp0_;
GError * _inner_error_ = NULL;
g_return_if_fail (self != NULL);
g_return_if_fail (type != NULL);
g_return_if_fail (file != NULL);
- i = 0;
- _tmp0_ = self->priv->pages;
{
- GList* page_collection = NULL;
- GList* page_it = NULL;
- page_collection = _tmp0_;
- for (page_it = page_collection; page_it != NULL; page_it = page_it->next) {
- Page* _tmp1_;
- Page* page = NULL;
- _tmp1_ = _page_ref0 ((Page*) page_it->data);
- page = _tmp1_;
- {
- Page* _tmp2_;
- const gchar* _tmp3_;
- GFile* _tmp4_;
- gchar* _tmp5_ = NULL;
- gchar* _tmp6_;
- gint _tmp7_;
- GFile* _tmp8_ = NULL;
+ gint i;
+ i = 0;
+ {
+ gboolean _tmp0_;
+ _tmp0_ = TRUE;
+ while (TRUE) {
+ gboolean _tmp1_;
+ gint _tmp3_;
+ guint _tmp4_ = 0U;
+ gint _tmp5_;
+ Page* _tmp6_ = NULL;
+ Page* page;
+ Page* _tmp7_;
+ const gchar* _tmp8_;
GFile* _tmp9_;
- gint _tmp10_;
- _tmp2_ = page;
- _tmp3_ = type;
- _tmp4_ = file;
- _tmp5_ = g_file_get_uri (_tmp4_);
- _tmp6_ = _tmp5_;
- _tmp7_ = i;
- _tmp8_ = book_make_indexed_file (self, _tmp6_, _tmp7_);
- _tmp9_ = _tmp8_;
- page_save (_tmp2_, _tmp3_, _tmp9_, &_inner_error_);
- _g_object_unref0 (_tmp9_);
- _g_free0 (_tmp6_);
+ gchar* _tmp10_ = NULL;
+ gchar* _tmp11_;
+ gint _tmp12_;
+ GFile* _tmp13_ = NULL;
+ GFile* _tmp14_;
+ gint _tmp15_;
+ _tmp1_ = _tmp0_;
+ if (!_tmp1_) {
+ gint _tmp2_;
+ _tmp2_ = i;
+ i = _tmp2_ + 1;
+ }
+ _tmp0_ = FALSE;
+ _tmp3_ = i;
+ _tmp4_ = book_get_n_pages (self);
+ if (!(((guint) _tmp3_) < _tmp4_)) {
+ break;
+ }
+ _tmp5_ = i;
+ _tmp6_ = book_get_page (self, _tmp5_);
+ page = _tmp6_;
+ _tmp7_ = page;
+ _tmp8_ = type;
+ _tmp9_ = file;
+ _tmp10_ = g_file_get_uri (_tmp9_);
+ _tmp11_ = _tmp10_;
+ _tmp12_ = i;
+ _tmp13_ = book_make_indexed_file (self, _tmp11_, _tmp12_);
+ _tmp14_ = _tmp13_;
+ page_save (_tmp7_, _tmp8_, _tmp14_, &_inner_error_);
+ _g_object_unref0 (_tmp14_);
+ _g_free0 (_tmp11_);
if (_inner_error_ != NULL) {
g_propagate_error (error, _inner_error_);
_page_unref0 (page);
return;
}
- _tmp10_ = i;
- i = _tmp10_ + 1;
+ _tmp15_ = i;
+ g_signal_emit_by_name (self, "saving", _tmp15_);
_page_unref0 (page);
}
}
@@ -715,7 +729,6 @@ static void book_save_ps (Book* self, GFile* file, GError** error) {
cairo_surface_t* _tmp4_;
cairo_surface_t* _tmp5_;
cairo_surface_t* surface;
- GList* _tmp6_;
GError * _inner_error_ = NULL;
g_return_if_fail (self != NULL);
g_return_if_fail (file != NULL);
@@ -732,62 +745,82 @@ static void book_save_ps (Book* self, GFile* file, GError** error) {
_tmp4_ = _tmp3_->surface;
_tmp5_ = _cairo_surface_reference0 (_tmp4_);
surface = _tmp5_;
- _tmp6_ = self->priv->pages;
{
- GList* page_collection = NULL;
- GList* page_it = NULL;
- page_collection = _tmp6_;
- for (page_it = page_collection; page_it != NULL; page_it = page_it->next) {
- Page* _tmp7_;
- Page* page = NULL;
- _tmp7_ = _page_ref0 ((Page*) page_it->data);
- page = _tmp7_;
- {
- Page* _tmp8_;
- GdkPixbuf* _tmp9_ = NULL;
+ gint i;
+ i = 0;
+ {
+ gboolean _tmp6_;
+ _tmp6_ = TRUE;
+ while (TRUE) {
+ gboolean _tmp7_;
+ gint _tmp9_;
+ guint _tmp10_ = 0U;
+ gint _tmp11_;
+ Page* _tmp12_ = NULL;
+ Page* page;
+ Page* _tmp13_;
+ GdkPixbuf* _tmp14_ = NULL;
GdkPixbuf* image;
- GdkPixbuf* _tmp10_;
- gint _tmp11_ = 0;
- Page* _tmp12_;
- gint _tmp13_ = 0;
+ GdkPixbuf* _tmp15_;
+ gint _tmp16_ = 0;
+ Page* _tmp17_;
+ gint _tmp18_ = 0;
gdouble width;
- GdkPixbuf* _tmp14_;
- gint _tmp15_ = 0;
- Page* _tmp16_;
- gint _tmp17_ = 0;
+ GdkPixbuf* _tmp19_;
+ gint _tmp20_ = 0;
+ Page* _tmp21_;
+ gint _tmp22_ = 0;
gdouble height;
- cairo_surface_t* _tmp18_;
- gdouble _tmp19_;
- gdouble _tmp20_;
- cairo_surface_t* _tmp21_;
- GdkPixbuf* _tmp22_;
- Page* _tmp23_;
- gint _tmp24_ = 0;
- cairo_surface_t* _tmp25_;
- _tmp8_ = page;
- _tmp9_ = page_get_image (_tmp8_, TRUE);
- image = _tmp9_;
- _tmp10_ = image;
- _tmp11_ = gdk_pixbuf_get_width (_tmp10_);
- _tmp12_ = page;
- _tmp13_ = page_get_dpi (_tmp12_);
- width = (_tmp11_ * 72.0) / _tmp13_;
- _tmp14_ = image;
- _tmp15_ = gdk_pixbuf_get_height (_tmp14_);
- _tmp16_ = page;
- _tmp17_ = page_get_dpi (_tmp16_);
- height = (_tmp15_ * 72.0) / _tmp17_;
- _tmp18_ = surface;
- _tmp19_ = width;
- _tmp20_ = height;
- cairo_ps_surface_set_size (_tmp18_, _tmp19_, _tmp20_);
- _tmp21_ = surface;
- _tmp22_ = image;
- _tmp23_ = page;
- _tmp24_ = page_get_dpi (_tmp23_);
- book_save_ps_pdf_surface (self, _tmp21_, _tmp22_, (gdouble) _tmp24_);
- _tmp25_ = surface;
- cairo_surface_show_page (_tmp25_);
+ cairo_surface_t* _tmp23_;
+ gdouble _tmp24_;
+ gdouble _tmp25_;
+ cairo_surface_t* _tmp26_;
+ GdkPixbuf* _tmp27_;
+ Page* _tmp28_;
+ gint _tmp29_ = 0;
+ cairo_surface_t* _tmp30_;
+ gint _tmp31_;
+ _tmp7_ = _tmp6_;
+ if (!_tmp7_) {
+ gint _tmp8_;
+ _tmp8_ = i;
+ i = _tmp8_ + 1;
+ }
+ _tmp6_ = FALSE;
+ _tmp9_ = i;
+ _tmp10_ = book_get_n_pages (self);
+ if (!(((guint) _tmp9_) < _tmp10_)) {
+ break;
+ }
+ _tmp11_ = i;
+ _tmp12_ = book_get_page (self, _tmp11_);
+ page = _tmp12_;
+ _tmp13_ = page;
+ _tmp14_ = page_get_image (_tmp13_, TRUE);
+ image = _tmp14_;
+ _tmp15_ = image;
+ _tmp16_ = gdk_pixbuf_get_width (_tmp15_);
+ _tmp17_ = page;
+ _tmp18_ = page_get_dpi (_tmp17_);
+ width = (_tmp16_ * 72.0) / _tmp18_;
+ _tmp19_ = image;
+ _tmp20_ = gdk_pixbuf_get_height (_tmp19_);
+ _tmp21_ = page;
+ _tmp22_ = page_get_dpi (_tmp21_);
+ height = (_tmp20_ * 72.0) / _tmp22_;
+ _tmp23_ = surface;
+ _tmp24_ = width;
+ _tmp25_ = height;
+ cairo_ps_surface_set_size (_tmp23_, _tmp24_, _tmp25_);
+ _tmp26_ = surface;
+ _tmp27_ = image;
+ _tmp28_ = page;
+ _tmp29_ = page_get_dpi (_tmp28_);
+ book_save_ps_pdf_surface (self, _tmp26_, _tmp27_, (gdouble) _tmp29_);
+ _tmp30_ = surface;
+ cairo_surface_show_page (_tmp30_);
+ _tmp31_ = i;
+ g_signal_emit_by_name (self, "saving", _tmp31_);
_g_object_unref0 (image);
_page_unref0 (page);
}
@@ -1123,55 +1156,55 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
gchar* _tmp43_;
PDFWriter* _tmp44_;
PDFWriter* _tmp45_;
- PDFWriter* _tmp349_;
PDFWriter* _tmp350_;
- guint _tmp351_ = 0U;
+ PDFWriter* _tmp351_;
+ guint _tmp352_ = 0U;
guint info_number;
- PDFWriter* _tmp352_;
- guint _tmp353_;
- gchar* _tmp354_ = NULL;
- gchar* _tmp355_;
- PDFWriter* _tmp356_;
+ PDFWriter* _tmp353_;
+ guint _tmp354_;
+ gchar* _tmp355_ = NULL;
+ gchar* _tmp356_;
PDFWriter* _tmp357_;
- gchar* _tmp358_ = NULL;
- gchar* _tmp359_;
- PDFWriter* _tmp360_;
+ PDFWriter* _tmp358_;
+ gchar* _tmp359_ = NULL;
+ gchar* _tmp360_;
PDFWriter* _tmp361_;
PDFWriter* _tmp362_;
- gsize _tmp363_;
+ PDFWriter* _tmp363_;
+ gsize _tmp364_;
gsize xref_offset;
- PDFWriter* _tmp364_;
PDFWriter* _tmp365_;
PDFWriter* _tmp366_;
- GList* _tmp367_;
- guint _tmp368_ = 0U;
- gchar* _tmp369_ = NULL;
- gchar* _tmp370_;
- PDFWriter* _tmp371_;
- GList* _tmp372_;
- PDFWriter* _tmp377_;
+ PDFWriter* _tmp367_;
+ GList* _tmp368_;
+ guint _tmp369_ = 0U;
+ gchar* _tmp370_ = NULL;
+ gchar* _tmp371_;
+ PDFWriter* _tmp372_;
+ GList* _tmp373_;
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_;
- guint _tmp390_;
- gchar* _tmp391_ = NULL;
- gchar* _tmp392_;
- PDFWriter* _tmp393_;
+ PDFWriter* _tmp381_;
+ GList* _tmp382_;
+ guint _tmp383_ = 0U;
+ gchar* _tmp384_ = NULL;
+ gchar* _tmp385_;
+ PDFWriter* _tmp386_;
+ guint _tmp387_;
+ gchar* _tmp388_ = NULL;
+ gchar* _tmp389_;
+ PDFWriter* _tmp390_;
+ guint _tmp391_;
+ gchar* _tmp392_ = NULL;
+ gchar* _tmp393_;
PDFWriter* _tmp394_;
PDFWriter* _tmp395_;
- gsize _tmp396_;
- gchar* _tmp397_ = NULL;
- gchar* _tmp398_;
- PDFWriter* _tmp399_;
+ PDFWriter* _tmp396_;
+ gsize _tmp397_;
+ gchar* _tmp398_ = NULL;
+ gchar* _tmp399_;
+ PDFWriter* _tmp400_;
GError * _inner_error_ = NULL;
g_return_if_fail (self != NULL);
g_return_if_fail (file != NULL);
@@ -1446,6 +1479,7 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
PDFWriter* _tmp346_;
PDFWriter* _tmp347_;
PDFWriter* _tmp348_;
+ gint _tmp349_;
_tmp47_ = _tmp46_;
if (!_tmp47_) {
gint _tmp48_;
@@ -2317,6 +2351,8 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
pdf_writer_write_string (_tmp347_, "endstream\n");
_tmp348_ = writer;
pdf_writer_write_string (_tmp348_, "endobj\n");
+ _tmp349_ = i;
+ g_signal_emit_by_name (self, "saving", _tmp349_);
_g_free0 (command);
compressed_data = (g_free (compressed_data), NULL);
data = (g_free (data), NULL);
@@ -2329,186 +2365,163 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
}
}
}
- _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");
+ pdf_writer_write_string (_tmp350_, "\n");
+ _tmp351_ = writer;
+ _tmp352_ = pdf_writer_start_object (_tmp351_);
+ info_number = _tmp352_;
+ _tmp353_ = writer;
+ _tmp354_ = info_number;
+ _tmp355_ = g_strdup_printf ("%u 0 obj\n", _tmp354_);
+ _tmp356_ = _tmp355_;
+ pdf_writer_write_string (_tmp353_, _tmp356_);
+ _g_free0 (_tmp356_);
_tmp357_ = writer;
- _tmp358_ = g_strdup_printf ("/Creator (Simple Scan %s)\n", VERSION);
- _tmp359_ = _tmp358_;
- pdf_writer_write_string (_tmp357_, _tmp359_);
- _g_free0 (_tmp359_);
- _tmp360_ = writer;
- pdf_writer_write_string (_tmp360_, ">>\n");
+ pdf_writer_write_string (_tmp357_, "<<\n");
+ _tmp358_ = writer;
+ _tmp359_ = g_strdup_printf ("/Creator (Simple Scan %s)\n", VERSION);
+ _tmp360_ = _tmp359_;
+ pdf_writer_write_string (_tmp358_, _tmp360_);
+ _g_free0 (_tmp360_);
_tmp361_ = writer;
- pdf_writer_write_string (_tmp361_, "endobj\n");
+ pdf_writer_write_string (_tmp361_, ">>\n");
_tmp362_ = writer;
- _tmp363_ = _tmp362_->offset;
- xref_offset = _tmp363_;
- _tmp364_ = writer;
- pdf_writer_write_string (_tmp364_, "xref\n");
+ pdf_writer_write_string (_tmp362_, "endobj\n");
+ _tmp363_ = writer;
+ _tmp364_ = _tmp363_->offset;
+ xref_offset = _tmp364_;
_tmp365_ = writer;
+ pdf_writer_write_string (_tmp365_, "xref\n");
_tmp366_ = writer;
- _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;
- _tmp372_ = _tmp371_->object_offsets;
+ _tmp367_ = writer;
+ _tmp368_ = _tmp367_->object_offsets;
+ _tmp369_ = g_list_length (_tmp368_);
+ _tmp370_ = g_strdup_printf ("1 %zu\n", (gsize) _tmp369_);
+ _tmp371_ = _tmp370_;
+ pdf_writer_write_string (_tmp366_, _tmp371_);
+ _g_free0 (_tmp371_);
+ _tmp372_ = writer;
+ _tmp373_ = _tmp372_->object_offsets;
{
GList* offset_collection = NULL;
GList* offset_it = NULL;
- offset_collection = _tmp372_;
+ offset_collection = _tmp373_;
for (offset_it = offset_collection; offset_it != NULL; offset_it = offset_it->next) {
guint offset = 0U;
offset = GPOINTER_TO_UINT (offset_it->data);
{
- 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_);
+ PDFWriter* _tmp374_;
+ guint _tmp375_;
+ gchar* _tmp376_ = NULL;
+ gchar* _tmp377_;
+ _tmp374_ = writer;
+ _tmp375_ = offset;
+ _tmp376_ = g_strdup_printf ("%010zu 00000 n \n", (gsize) _tmp375_);
+ _tmp377_ = _tmp376_;
+ pdf_writer_write_string (_tmp374_, _tmp377_);
+ _g_free0 (_tmp377_);
}
}
}
- _tmp377_ = writer;
- pdf_writer_write_string (_tmp377_, "trailer\n");
_tmp378_ = writer;
- pdf_writer_write_string (_tmp378_, "<<\n");
+ pdf_writer_write_string (_tmp378_, "trailer\n");
_tmp379_ = writer;
+ pdf_writer_write_string (_tmp379_, "<<\n");
_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_ = 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");
+ _tmp381_ = writer;
+ _tmp382_ = _tmp381_->object_offsets;
+ _tmp383_ = g_list_length (_tmp382_);
+ _tmp384_ = g_strdup_printf ("/Size %zu\n", (gsize) _tmp383_);
+ _tmp385_ = _tmp384_;
+ pdf_writer_write_string (_tmp380_, _tmp385_);
+ _g_free0 (_tmp385_);
+ _tmp386_ = writer;
+ _tmp387_ = info_number;
+ _tmp388_ = g_strdup_printf ("/Info %u 0 R\n", _tmp387_);
+ _tmp389_ = _tmp388_;
+ pdf_writer_write_string (_tmp386_, _tmp389_);
+ _g_free0 (_tmp389_);
+ _tmp390_ = writer;
+ _tmp391_ = catalog_number;
+ _tmp392_ = g_strdup_printf ("/Root %u 0 R\n", _tmp391_);
+ _tmp393_ = _tmp392_;
+ pdf_writer_write_string (_tmp390_, _tmp393_);
+ _g_free0 (_tmp393_);
_tmp394_ = writer;
- pdf_writer_write_string (_tmp394_, "startxref\n");
+ pdf_writer_write_string (_tmp394_, ">>\n");
_tmp395_ = writer;
- _tmp396_ = xref_offset;
- _tmp397_ = g_strdup_printf ("%zu\n", _tmp396_);
- _tmp398_ = _tmp397_;
- pdf_writer_write_string (_tmp395_, _tmp398_);
- _g_free0 (_tmp398_);
- _tmp399_ = writer;
- pdf_writer_write_string (_tmp399_, "%%EOF\n");
+ pdf_writer_write_string (_tmp395_, "startxref\n");
+ _tmp396_ = writer;
+ _tmp397_ = xref_offset;
+ _tmp398_ = g_strdup_printf ("%zu\n", _tmp397_);
+ _tmp399_ = _tmp398_;
+ pdf_writer_write_string (_tmp396_, _tmp399_);
+ _g_free0 (_tmp399_);
+ _tmp400_ = writer;
+ pdf_writer_write_string (_tmp400_, "%%EOF\n");
_pdf_writer_unref0 (writer);
_g_object_unref0 (stream);
}
void book_save (Book* self, const gchar* type, GFile* file, GError** error) {
- GCompareFunc _tmp0_;
+ const gchar* _tmp0_;
const gchar* _tmp1_;
- gint _tmp2_ = 0;
+ GQuark _tmp3_ = 0U;
+ static GQuark _tmp2_label0 = 0;
+ static GQuark _tmp2_label1 = 0;
+ static GQuark _tmp2_label2 = 0;
+ static GQuark _tmp2_label3 = 0;
+ static GQuark _tmp2_label4 = 0;
GError * _inner_error_ = NULL;
g_return_if_fail (self != NULL);
g_return_if_fail (type != NULL);
g_return_if_fail (file != NULL);
- _tmp0_ = g_strcmp0;
- _tmp1_ = type;
- _tmp2_ = _tmp0_ (_tmp1_, "jpeg");
- if (_tmp2_ == 0) {
- GFile* _tmp3_;
- _tmp3_ = file;
- book_save_multi_file (self, "jpeg", _tmp3_, &_inner_error_);
- if (_inner_error_ != NULL) {
- g_propagate_error (error, _inner_error_);
- return;
- }
- } else {
- GCompareFunc _tmp4_;
- const gchar* _tmp5_;
- gint _tmp6_ = 0;
- _tmp4_ = g_strcmp0;
- _tmp5_ = type;
- _tmp6_ = _tmp4_ (_tmp5_, "png");
- if (_tmp6_ == 0) {
- GFile* _tmp7_;
- _tmp7_ = file;
- book_save_multi_file (self, "png", _tmp7_, &_inner_error_);
- if (_inner_error_ != NULL) {
- g_propagate_error (error, _inner_error_);
- return;
+ _tmp0_ = type;
+ _tmp1_ = _tmp0_;
+ _tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
+ if (((_tmp3_ == ((0 != _tmp2_label0) ? _tmp2_label0 : (_tmp2_label0 = g_quark_from_static_string ("jpeg")))) || (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("png"))))) || (_tmp3_ == ((0 != _tmp2_label2) ? _tmp2_label2 : (_tmp2_label2 = g_quark_from_static_string ("tiff"))))) {
+ switch (0) {
+ default:
+ {
+ const gchar* _tmp4_;
+ GFile* _tmp5_;
+ _tmp4_ = type;
+ _tmp5_ = file;
+ book_save_multi_file (self, _tmp4_, _tmp5_, &_inner_error_);
+ if (_inner_error_ != NULL) {
+ g_propagate_error (error, _inner_error_);
+ return;
+ }
+ break;
}
- } else {
- GCompareFunc _tmp8_;
- const gchar* _tmp9_;
- gint _tmp10_ = 0;
- _tmp8_ = g_strcmp0;
- _tmp9_ = type;
- _tmp10_ = _tmp8_ (_tmp9_, "tiff");
- if (_tmp10_ == 0) {
- GFile* _tmp11_;
- _tmp11_ = file;
- book_save_multi_file (self, "tiff", _tmp11_, &_inner_error_);
+ }
+ } else if (_tmp3_ == ((0 != _tmp2_label3) ? _tmp2_label3 : (_tmp2_label3 = g_quark_from_static_string ("ps")))) {
+ switch (0) {
+ default:
+ {
+ GFile* _tmp6_;
+ _tmp6_ = file;
+ book_save_ps (self, _tmp6_, &_inner_error_);
if (_inner_error_ != NULL) {
g_propagate_error (error, _inner_error_);
return;
}
- } else {
- GCompareFunc _tmp12_;
- const gchar* _tmp13_;
- gint _tmp14_ = 0;
- _tmp12_ = g_strcmp0;
- _tmp13_ = type;
- _tmp14_ = _tmp12_ (_tmp13_, "ps");
- if (_tmp14_ == 0) {
- GFile* _tmp15_;
- _tmp15_ = file;
- book_save_ps (self, _tmp15_, &_inner_error_);
- if (_inner_error_ != NULL) {
- g_propagate_error (error, _inner_error_);
- return;
- }
- } else {
- GCompareFunc _tmp16_;
- const gchar* _tmp17_;
- gint _tmp18_ = 0;
- _tmp16_ = g_strcmp0;
- _tmp17_ = type;
- _tmp18_ = _tmp16_ (_tmp17_, "pdf");
- if (_tmp18_ == 0) {
- GFile* _tmp19_;
- _tmp19_ = file;
- book_save_pdf (self, _tmp19_, &_inner_error_);
- if (_inner_error_ != NULL) {
- g_propagate_error (error, _inner_error_);
- return;
- }
- }
+ break;
+ }
+ }
+ } else if (_tmp3_ == ((0 != _tmp2_label4) ? _tmp2_label4 : (_tmp2_label4 = g_quark_from_static_string ("pdf")))) {
+ switch (0) {
+ default:
+ {
+ GFile* _tmp7_;
+ _tmp7_ = file;
+ book_save_pdf (self, _tmp7_, &_inner_error_);
+ if (_inner_error_ != NULL) {
+ g_propagate_error (error, _inner_error_);
+ return;
}
+ break;
}
}
}
@@ -2683,6 +2696,7 @@ static void book_class_init (BookClass * klass) {
g_signal_new ("reordered", TYPE_BOOK, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
g_signal_new ("cleared", TYPE_BOOK, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
g_signal_new ("needs_saving_changed", TYPE_BOOK, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+ g_signal_new ("saving", TYPE_BOOK, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
}
@@ -2783,7 +2797,7 @@ void pdf_writer_write (PDFWriter* self, guint8* data, int data_length1) {
_inner_error_ = NULL;
_tmp2_ = e;
_tmp3_ = _tmp2_->message;
- g_warning ("book.vala:538: Error writing PDF: %s", _tmp3_);
+ g_warning ("book.vala:547: Error writing PDF: %s", _tmp3_);
_g_error_free0 (e);
}
__finally0:
@@ -3090,7 +3104,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:574: Error writing data: %s", _tmp3_);
+ g_warning ("book.vala:583: Error writing data: %s", _tmp3_);
result = CAIRO_STATUS_WRITE_ERROR;
_g_error_free0 (e);
return result;