From 23a3dc6838d8b60b0b4b0c3c33e7ba489d3906ff Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Thu, 15 Sep 2011 09:50:31 +0200 Subject: Imported Upstream version 3.1.91 --- src/book-view.c | 1861 ++++++++++++++------ src/book.c | 2485 ++++++++++++++++++-------- src/page-view.c | 3844 +++++++++++++++++++++++++++++++--------- src/page.c | 1896 ++++++++++++++------ src/sane.vapi | 31 +- src/scanner.c | 5059 +++++++++++++++++++++++++++++++++++++---------------- src/scanner.vala | 83 +- src/simple-scan.c | 1530 +++++++++++----- src/ui.c | 3896 +++++++++++++++++++++++++++-------------- 9 files changed, 14800 insertions(+), 5885 deletions(-) (limited to 'src') diff --git a/src/book-view.c b/src/book-view.c index 5d2e84d..f989d83 100644 --- a/src/book-view.c +++ b/src/book-view.c @@ -1,4 +1,4 @@ -/* book-view.c generated by valac 0.13.1, the Vala compiler +/* book-view.c generated by valac 0.13.4, the Vala compiler * generated from book-view.vala, do not modify */ /* @@ -301,81 +301,149 @@ static void _book_view_scroll_cb_gtk_adjustment_value_changed (GtkAdjustment* _s BookView* book_view_construct (GType object_type, Book* book) { BookView * self = NULL; Book* _tmp0_; - Page* _tmp4_ = NULL; - Page* _tmp5_; - GHashTable* _tmp6_ = NULL; - GtkDrawingArea* _tmp7_ = NULL; - GtkHScrollbar* _tmp8_ = NULL; - GtkAdjustment* _tmp9_ = NULL; - GtkAdjustment* _tmp10_; + Book* _tmp1_; + Book* _tmp13_; + Page* _tmp14_ = NULL; + Page* _tmp15_; + Book* _tmp16_; + Book* _tmp17_; + Book* _tmp18_; + Book* _tmp19_; + GHashFunc _tmp20_; + GEqualFunc _tmp21_; + GHashTable* _tmp22_; + GtkDrawingArea* _tmp23_; + GtkWidget* _tmp24_; + GtkWidget* _tmp25_; + GtkWidget* _tmp26_; + GtkWidget* _tmp27_; + GtkWidget* _tmp28_; + GtkHScrollbar* _tmp29_; + GtkHScrollbar* _tmp30_; + GtkHScrollbar* _tmp31_; + GtkAdjustment* _tmp32_ = NULL; + GtkAdjustment* _tmp33_; + GtkHScrollbar* _tmp34_; + GtkWidget* _tmp35_; + GtkWidget* _tmp36_; + GtkWidget* _tmp37_; + GtkWidget* _tmp38_; + GtkWidget* _tmp39_; + GtkWidget* _tmp40_; + GtkWidget* _tmp41_; + GtkWidget* _tmp42_; + GtkAdjustment* _tmp43_; + GtkWidget* _tmp44_; g_return_val_if_fail (book != NULL, NULL); self = (BookView*) g_object_new (object_type, NULL); - _tmp0_ = _book_ref0 (book); + _tmp0_ = book; + _tmp1_ = _book_ref0 (_tmp0_); _book_unref0 (self->priv->book); - self->priv->book = _tmp0_; + self->priv->book = _tmp1_; { gint i; i = 0; { - gboolean _tmp1_; - _tmp1_ = TRUE; + gboolean _tmp2_; + _tmp2_ = TRUE; while (TRUE) { - guint _tmp2_; - Page* _tmp3_ = NULL; + gboolean _tmp3_; + gint _tmp5_; + Book* _tmp6_; + guint _tmp7_ = 0U; + Book* _tmp8_; + gint _tmp9_; + Page* _tmp10_ = NULL; Page* page; - if (!_tmp1_) { - i++; + Book* _tmp11_; + Page* _tmp12_; + _tmp3_ = _tmp2_; + if (!_tmp3_) { + gint _tmp4_; + _tmp4_ = i; + i = _tmp4_ + 1; } - _tmp1_ = FALSE; - _tmp2_ = book_get_n_pages (book); - if (!(((guint) i) < _tmp2_)) { + _tmp2_ = FALSE; + _tmp5_ = i; + _tmp6_ = book; + _tmp7_ = book_get_n_pages (_tmp6_); + if (!(((guint) _tmp5_) < _tmp7_)) { break; } - _tmp3_ = book_get_page (book, i); - page = _tmp3_; - book_view_add_cb (self, book, page); + _tmp8_ = book; + _tmp9_ = i; + _tmp10_ = book_get_page (_tmp8_, _tmp9_); + page = _tmp10_; + _tmp11_ = book; + _tmp12_ = page; + book_view_add_cb (self, _tmp11_, _tmp12_); _page_unref0 (page); } } } - _tmp4_ = book_get_page (book, 0); - _tmp5_ = _tmp4_; - book_view_select_page (self, _tmp5_); - _page_unref0 (_tmp5_); - g_signal_connect_object (book, "page-added", (GCallback) _book_view_add_cb_book_page_added, self, 0); - g_signal_connect_object (book, "page-removed", (GCallback) _book_view_remove_cb_book_page_removed, self, 0); - g_signal_connect_object (book, "reordered", (GCallback) _book_view_reorder_cb_book_reordered, self, 0); - g_signal_connect_object (book, "cleared", (GCallback) _book_view_clear_cb_book_cleared, self, 0); + _tmp13_ = book; + _tmp14_ = book_get_page (_tmp13_, 0); + _tmp15_ = _tmp14_; + book_view_select_page (self, _tmp15_); + _page_unref0 (_tmp15_); + _tmp16_ = book; + g_signal_connect_object (_tmp16_, "page-added", (GCallback) _book_view_add_cb_book_page_added, self, 0); + _tmp17_ = book; + g_signal_connect_object (_tmp17_, "page-removed", (GCallback) _book_view_remove_cb_book_page_removed, self, 0); + _tmp18_ = book; + g_signal_connect_object (_tmp18_, "reordered", (GCallback) _book_view_reorder_cb_book_reordered, self, 0); + _tmp19_ = book; + g_signal_connect_object (_tmp19_, "cleared", (GCallback) _book_view_clear_cb_book_cleared, self, 0); self->priv->need_layout = TRUE; - _tmp6_ = g_hash_table_new_full (g_direct_hash, g_direct_equal, _page_unref0_, _page_view_unref0_); + _tmp20_ = g_direct_hash; + _tmp21_ = g_direct_equal; + _tmp22_ = g_hash_table_new_full (_tmp20_, _tmp21_, _page_unref0_, _page_view_unref0_); _g_hash_table_unref0 (self->priv->page_data); - self->priv->page_data = _tmp6_; + self->priv->page_data = _tmp22_; self->priv->cursor = GDK_ARROW; - _tmp7_ = (GtkDrawingArea*) gtk_drawing_area_new (); + _tmp23_ = (GtkDrawingArea*) gtk_drawing_area_new (); + _tmp24_ = (GtkWidget*) g_object_ref_sink (_tmp23_); _g_object_unref0 (self->priv->drawing_area); - self->priv->drawing_area = (GtkWidget*) g_object_ref_sink (_tmp7_); - gtk_widget_set_size_request (self->priv->drawing_area, 200, 100); - gtk_widget_set_can_focus (self->priv->drawing_area, TRUE); - gtk_widget_set_events (self->priv->drawing_area, (gint) (((((GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK) | GDK_BUTTON_RELEASE_MASK) | GDK_FOCUS_CHANGE_MASK) | GDK_STRUCTURE_MASK) | GDK_SCROLL_MASK)); - gtk_box_pack_start ((GtkBox*) self, self->priv->drawing_area, TRUE, TRUE, (guint) 0); - _tmp8_ = (GtkHScrollbar*) gtk_hscrollbar_new (NULL); + self->priv->drawing_area = _tmp24_; + _tmp25_ = self->priv->drawing_area; + gtk_widget_set_size_request (_tmp25_, 200, 100); + _tmp26_ = self->priv->drawing_area; + gtk_widget_set_can_focus (_tmp26_, TRUE); + _tmp27_ = self->priv->drawing_area; + gtk_widget_set_events (_tmp27_, (gint) (((((GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK) | GDK_BUTTON_RELEASE_MASK) | GDK_FOCUS_CHANGE_MASK) | GDK_STRUCTURE_MASK) | GDK_SCROLL_MASK)); + _tmp28_ = self->priv->drawing_area; + gtk_box_pack_start ((GtkBox*) self, _tmp28_, TRUE, TRUE, (guint) 0); + _tmp29_ = (GtkHScrollbar*) gtk_hscrollbar_new (NULL); + _tmp30_ = g_object_ref_sink (_tmp29_); _g_object_unref0 (self->priv->scroll); - self->priv->scroll = g_object_ref_sink (_tmp8_); - _tmp9_ = gtk_range_get_adjustment ((GtkRange*) self->priv->scroll); - _tmp10_ = _g_object_ref0 (_tmp9_); + self->priv->scroll = _tmp30_; + _tmp31_ = self->priv->scroll; + _tmp32_ = gtk_range_get_adjustment ((GtkRange*) _tmp31_); + _tmp33_ = _g_object_ref0 (_tmp32_); _g_object_unref0 (self->priv->adjustment); - self->priv->adjustment = _tmp10_; - gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) self->priv->scroll, FALSE, TRUE, (guint) 0); - g_signal_connect_object (self->priv->drawing_area, "configure-event", (GCallback) _book_view_configure_cb_gtk_widget_configure_event, self, 0); - g_signal_connect_object (self->priv->drawing_area, "draw", (GCallback) _book_view_draw_cb_gtk_widget_draw, self, 0); - g_signal_connect_object (self->priv->drawing_area, "motion-notify-event", (GCallback) _book_view_motion_cb_gtk_widget_motion_notify_event, self, 0); - g_signal_connect_object (self->priv->drawing_area, "key-press-event", (GCallback) _book_view_key_cb_gtk_widget_key_press_event, self, 0); - g_signal_connect_object (self->priv->drawing_area, "button-press-event", (GCallback) _book_view_button_cb_gtk_widget_button_press_event, self, 0); - g_signal_connect_object (self->priv->drawing_area, "button-release-event", (GCallback) _book_view_button_cb_gtk_widget_button_release_event, self, 0); - g_signal_connect_object (self->priv->drawing_area, "focus-in-event", (GCallback) _book_view_focus_cb_gtk_widget_focus_in_event, self, G_CONNECT_AFTER); - g_signal_connect_object (self->priv->drawing_area, "focus-out-event", (GCallback) _book_view_focus_cb_gtk_widget_focus_out_event, self, G_CONNECT_AFTER); - g_signal_connect_object (self->priv->adjustment, "value-changed", (GCallback) _book_view_scroll_cb_gtk_adjustment_value_changed, self, 0); - gtk_widget_show (self->priv->drawing_area); + self->priv->adjustment = _tmp33_; + _tmp34_ = self->priv->scroll; + gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) _tmp34_, FALSE, TRUE, (guint) 0); + _tmp35_ = self->priv->drawing_area; + g_signal_connect_object (_tmp35_, "configure-event", (GCallback) _book_view_configure_cb_gtk_widget_configure_event, self, 0); + _tmp36_ = self->priv->drawing_area; + g_signal_connect_object (_tmp36_, "draw", (GCallback) _book_view_draw_cb_gtk_widget_draw, self, 0); + _tmp37_ = self->priv->drawing_area; + g_signal_connect_object (_tmp37_, "motion-notify-event", (GCallback) _book_view_motion_cb_gtk_widget_motion_notify_event, self, 0); + _tmp38_ = self->priv->drawing_area; + g_signal_connect_object (_tmp38_, "key-press-event", (GCallback) _book_view_key_cb_gtk_widget_key_press_event, self, 0); + _tmp39_ = self->priv->drawing_area; + g_signal_connect_object (_tmp39_, "button-press-event", (GCallback) _book_view_button_cb_gtk_widget_button_press_event, self, 0); + _tmp40_ = self->priv->drawing_area; + g_signal_connect_object (_tmp40_, "button-release-event", (GCallback) _book_view_button_cb_gtk_widget_button_release_event, self, 0); + _tmp41_ = self->priv->drawing_area; + g_signal_connect_object (_tmp41_, "focus-in-event", (GCallback) _book_view_focus_cb_gtk_widget_focus_in_event, self, G_CONNECT_AFTER); + _tmp42_ = self->priv->drawing_area; + g_signal_connect_object (_tmp42_, "focus-out-event", (GCallback) _book_view_focus_cb_gtk_widget_focus_out_event, self, G_CONNECT_AFTER); + _tmp43_ = self->priv->adjustment; + g_signal_connect_object (_tmp43_, "value-changed", (GCallback) _book_view_scroll_cb_gtk_adjustment_value_changed, self, 0); + _tmp44_ = self->priv->drawing_area; + gtk_widget_show (_tmp44_); return self; } @@ -392,16 +460,22 @@ static gpointer _page_view_ref0 (gpointer self) { static PageView* book_view_get_nth_page (BookView* self, gint n) { PageView* result = NULL; - Page* _tmp0_ = NULL; + Book* _tmp0_; + gint _tmp1_; + Page* _tmp2_ = NULL; Page* page; - gconstpointer _tmp1_ = NULL; - PageView* _tmp2_; + GHashTable* _tmp3_; + gconstpointer _tmp4_ = NULL; + PageView* _tmp5_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = book_get_page (self->priv->book, n); - page = _tmp0_; - _tmp1_ = g_hash_table_lookup (self->priv->page_data, page); - _tmp2_ = _page_view_ref0 ((PageView*) _tmp1_); - result = _tmp2_; + _tmp0_ = self->priv->book; + _tmp1_ = n; + _tmp2_ = book_get_page (_tmp0_, _tmp1_); + page = _tmp2_; + _tmp3_ = self->priv->page_data; + _tmp4_ = g_hash_table_lookup (_tmp3_, page); + _tmp5_ = _page_view_ref0 ((PageView*) _tmp4_); + result = _tmp5_; _page_unref0 (page); return result; } @@ -409,7 +483,8 @@ static PageView* book_view_get_nth_page (BookView* self, gint n) { static PageView* book_view_get_next_page (BookView* self, PageView* page) { PageView* result = NULL; - PageView* _tmp8_; + PageView* _tmp20_; + PageView* _tmp21_; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (page != NULL, NULL); { @@ -419,36 +494,60 @@ static PageView* book_view_get_next_page (BookView* self, PageView* page) { gboolean _tmp0_; _tmp0_ = TRUE; while (TRUE) { - Page* _tmp1_ = NULL; + gboolean _tmp1_; + Book* _tmp3_; + gint _tmp4_; + Page* _tmp5_ = NULL; Page* p; - Page* _tmp2_ = NULL; - Page* _tmp3_; - gboolean _tmp4_; - if (!_tmp0_) { - i++; + Page* _tmp6_; + Page* _tmp7_; + PageView* _tmp8_; + Page* _tmp9_ = NULL; + Page* _tmp10_; + gboolean _tmp11_; + _tmp1_ = _tmp0_; + if (!_tmp1_) { + gint _tmp2_; + _tmp2_ = i; + i = _tmp2_ + 1; } _tmp0_ = FALSE; - _tmp1_ = book_get_page (self->priv->book, i); - p = _tmp1_; - if (p == NULL) { + _tmp3_ = self->priv->book; + _tmp4_ = i; + _tmp5_ = book_get_page (_tmp3_, _tmp4_); + p = _tmp5_; + _tmp6_ = p; + if (_tmp6_ == NULL) { _page_unref0 (p); break; } - _tmp2_ = page_view_get_page (page); - _tmp3_ = _tmp2_; - _tmp4_ = p == _tmp3_; - _page_unref0 (_tmp3_); - if (_tmp4_) { - Page* _tmp5_ = NULL; - _tmp5_ = book_get_page (self->priv->book, i + 1); + _tmp7_ = p; + _tmp8_ = page; + _tmp9_ = page_view_get_page (_tmp8_); + _tmp10_ = _tmp9_; + _tmp11_ = _tmp7_ == _tmp10_; + _page_unref0 (_tmp10_); + if (_tmp11_) { + Book* _tmp12_; + gint _tmp13_; + Page* _tmp14_ = NULL; + Page* _tmp15_; + _tmp12_ = self->priv->book; + _tmp13_ = i; + _tmp14_ = book_get_page (_tmp12_, _tmp13_ + 1); _page_unref0 (p); - p = _tmp5_; - if (p != NULL) { - gconstpointer _tmp6_ = NULL; - PageView* _tmp7_; - _tmp6_ = g_hash_table_lookup (self->priv->page_data, p); - _tmp7_ = _page_view_ref0 ((PageView*) _tmp6_); - result = _tmp7_; + p = _tmp14_; + _tmp15_ = p; + if (_tmp15_ != NULL) { + GHashTable* _tmp16_; + Page* _tmp17_; + gconstpointer _tmp18_ = NULL; + PageView* _tmp19_; + _tmp16_ = self->priv->page_data; + _tmp17_ = p; + _tmp18_ = g_hash_table_lookup (_tmp16_, _tmp17_); + _tmp19_ = _page_view_ref0 ((PageView*) _tmp18_); + result = _tmp19_; _page_unref0 (p); return result; } @@ -457,8 +556,9 @@ static PageView* book_view_get_next_page (BookView* self, PageView* page) { } } } - _tmp8_ = _page_view_ref0 (page); - result = _tmp8_; + _tmp20_ = page; + _tmp21_ = _page_view_ref0 (_tmp20_); + result = _tmp21_; return result; } @@ -466,55 +566,77 @@ static PageView* book_view_get_next_page (BookView* self, PageView* page) { static PageView* book_view_get_prev_page (BookView* self, PageView* page) { PageView* result = NULL; PageView* _tmp0_; + PageView* _tmp1_; PageView* prev_page; - PageView* _tmp8_; + PageView* _tmp18_; + PageView* _tmp19_; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (page != NULL, NULL); - _tmp0_ = _page_view_ref0 (page); - prev_page = _tmp0_; + _tmp0_ = page; + _tmp1_ = _page_view_ref0 (_tmp0_); + prev_page = _tmp1_; { gint i; i = 0; { - gboolean _tmp1_; - _tmp1_ = TRUE; + gboolean _tmp2_; + _tmp2_ = TRUE; while (TRUE) { - Page* _tmp2_ = NULL; + gboolean _tmp3_; + Book* _tmp5_; + gint _tmp6_; + Page* _tmp7_ = NULL; Page* p; - Page* _tmp3_ = NULL; - Page* _tmp4_; - gboolean _tmp5_; - gconstpointer _tmp6_ = NULL; - PageView* _tmp7_; - if (!_tmp1_) { - i++; + Page* _tmp8_; + Page* _tmp9_; + PageView* _tmp10_; + Page* _tmp11_ = NULL; + Page* _tmp12_; + gboolean _tmp13_; + GHashTable* _tmp14_; + Page* _tmp15_; + gconstpointer _tmp16_ = NULL; + PageView* _tmp17_; + _tmp3_ = _tmp2_; + if (!_tmp3_) { + gint _tmp4_; + _tmp4_ = i; + i = _tmp4_ + 1; } - _tmp1_ = FALSE; - _tmp2_ = book_get_page (self->priv->book, i); - p = _tmp2_; - if (p == NULL) { + _tmp2_ = FALSE; + _tmp5_ = self->priv->book; + _tmp6_ = i; + _tmp7_ = book_get_page (_tmp5_, _tmp6_); + p = _tmp7_; + _tmp8_ = p; + if (_tmp8_ == NULL) { _page_unref0 (p); break; } - _tmp3_ = page_view_get_page (page); - _tmp4_ = _tmp3_; - _tmp5_ = p == _tmp4_; - _page_unref0 (_tmp4_); - if (_tmp5_) { + _tmp9_ = p; + _tmp10_ = page; + _tmp11_ = page_view_get_page (_tmp10_); + _tmp12_ = _tmp11_; + _tmp13_ = _tmp9_ == _tmp12_; + _page_unref0 (_tmp12_); + if (_tmp13_) { result = prev_page; _page_unref0 (p); return result; } - _tmp6_ = g_hash_table_lookup (self->priv->page_data, p); - _tmp7_ = _page_view_ref0 ((PageView*) _tmp6_); + _tmp14_ = self->priv->page_data; + _tmp15_ = p; + _tmp16_ = g_hash_table_lookup (_tmp14_, _tmp15_); + _tmp17_ = _page_view_ref0 ((PageView*) _tmp16_); _page_view_unref0 (prev_page); - prev_page = _tmp7_; + prev_page = _tmp17_; _page_unref0 (p); } } } - _tmp8_ = _page_view_ref0 (page); - result = _tmp8_; + _tmp18_ = page; + _tmp19_ = _page_view_ref0 (_tmp18_); + result = _tmp19_; _page_view_unref0 (prev_page); return result; } @@ -551,20 +673,26 @@ static gpointer _page_ref0 (gpointer self) { static void book_view_add_cb (BookView* self, Book* book, Page* page) { - PageView* _tmp0_ = NULL; + Page* _tmp0_; + PageView* _tmp1_; PageView* page_view; - Page* _tmp1_; - PageView* _tmp2_; + GHashTable* _tmp2_; + Page* _tmp3_; + Page* _tmp4_; + PageView* _tmp5_; g_return_if_fail (self != NULL); g_return_if_fail (book != NULL); g_return_if_fail (page != NULL); - _tmp0_ = page_view_new (page); - page_view = _tmp0_; + _tmp0_ = page; + _tmp1_ = page_view_new (_tmp0_); + page_view = _tmp1_; g_signal_connect_object (page_view, "changed", (GCallback) _book_view_page_view_changed_cb_page_view_changed, self, 0); g_signal_connect_object (page_view, "size-changed", (GCallback) _book_view_page_view_size_changed_cb_page_view_size_changed, self, 0); - _tmp1_ = _page_ref0 (page); - _tmp2_ = _page_view_ref0 (page_view); - g_hash_table_insert (self->priv->page_data, _tmp1_, _tmp2_); + _tmp2_ = self->priv->page_data; + _tmp3_ = page; + _tmp4_ = _page_ref0 (_tmp3_); + _tmp5_ = _page_view_ref0 (page_view); + g_hash_table_insert (_tmp2_, _tmp4_, _tmp5_); self->priv->need_layout = TRUE; book_view_redraw (self); _page_view_unref0 (page_view); @@ -574,83 +702,141 @@ static void book_view_add_cb (BookView* self, Book* book, Page* page) { static void book_view_set_selected_page (BookView* self, PageView* page) { gboolean _tmp0_ = FALSE; PageView* _tmp1_; - gboolean _tmp2_; + gboolean _tmp4_; + PageView* _tmp6_; + PageView* _tmp7_; + PageView* _tmp8_; + GtkWidget* _tmp9_; + gboolean _tmp10_ = FALSE; + gboolean _tmp11_; g_return_if_fail (self != NULL); - if (self->priv->selected_page != NULL) { - _tmp0_ = page != self->priv->selected_page; + _tmp1_ = self->priv->selected_page; + if (_tmp1_ != NULL) { + PageView* _tmp2_; + PageView* _tmp3_; + _tmp2_ = page; + _tmp3_ = self->priv->selected_page; + _tmp0_ = _tmp2_ != _tmp3_; } else { _tmp0_ = FALSE; } - if (_tmp0_) { - page_view_set_selected (self->priv->selected_page, FALSE); + _tmp4_ = _tmp0_; + if (_tmp4_) { + PageView* _tmp5_; + _tmp5_ = self->priv->selected_page; + page_view_set_selected (_tmp5_, FALSE); } - _tmp1_ = _page_view_ref0 (page); + _tmp6_ = page; + _tmp7_ = _page_view_ref0 (_tmp6_); _page_view_unref0 (self->priv->selected_page); - self->priv->selected_page = _tmp1_; - if (self->priv->selected_page == NULL) { + self->priv->selected_page = _tmp7_; + _tmp8_ = self->priv->selected_page; + if (_tmp8_ == NULL) { return; } - g_object_get (self->priv->drawing_area, "has-focus", &_tmp2_, NULL); - if (!_tmp2_) { - page_view_set_selected (self->priv->selected_page, FALSE); + _tmp9_ = self->priv->drawing_area; + g_object_get (_tmp9_, "has-focus", &_tmp10_, NULL); + _tmp11_ = _tmp10_; + if (!_tmp11_) { + PageView* _tmp12_; + _tmp12_ = self->priv->selected_page; + page_view_set_selected (_tmp12_, FALSE); } else { - page_view_set_selected (self->priv->selected_page, TRUE); + PageView* _tmp13_; + _tmp13_ = self->priv->selected_page; + page_view_set_selected (_tmp13_, TRUE); } } static void book_view_set_x_offset (BookView* self, gint offset) { + GtkAdjustment* _tmp0_; + gint _tmp1_; g_return_if_fail (self != NULL); - gtk_adjustment_set_value (self->priv->adjustment, (gdouble) offset); + _tmp0_ = self->priv->adjustment; + _tmp1_ = offset; + gtk_adjustment_set_value (_tmp0_, (gdouble) _tmp1_); } static gint book_view_get_x_offset (BookView* self) { gint result = 0; - gdouble _tmp0_; + GtkAdjustment* _tmp0_; + gdouble _tmp1_ = 0.0; g_return_val_if_fail (self != NULL, 0); - _tmp0_ = gtk_adjustment_get_value (self->priv->adjustment); - result = (gint) _tmp0_; + _tmp0_ = self->priv->adjustment; + _tmp1_ = gtk_adjustment_get_value (_tmp0_); + result = (gint) _tmp1_; return result; } static void book_view_show_page_view (BookView* self, PageView* page) { gboolean _tmp0_ = FALSE; + PageView* _tmp1_; + gboolean _tmp4_; GtkAllocation allocation = {0}; - GtkAllocation _tmp2_ = {0}; - gint _tmp3_; + GtkWidget* _tmp5_; + GtkAllocation _tmp6_ = {0}; + PageView* _tmp7_; + gint _tmp8_ = 0; gint left_edge; - gint _tmp4_; - gint _tmp5_; + PageView* _tmp9_; + gint _tmp10_ = 0; + PageView* _tmp11_; + gint _tmp12_ = 0; gint right_edge; - gint _tmp6_; + gint _tmp13_; + gint _tmp14_ = 0; g_return_if_fail (self != NULL); - if (page == NULL) { + _tmp1_ = page; + if (_tmp1_ == NULL) { _tmp0_ = TRUE; } else { - gboolean _tmp1_; - _tmp1_ = gtk_widget_get_visible ((GtkWidget*) self->priv->scroll); - _tmp0_ = !_tmp1_; + GtkHScrollbar* _tmp2_; + gboolean _tmp3_ = FALSE; + _tmp2_ = self->priv->scroll; + _tmp3_ = gtk_widget_get_visible ((GtkWidget*) _tmp2_); + _tmp0_ = !_tmp3_; } - if (_tmp0_) { + _tmp4_ = _tmp0_; + if (_tmp4_) { return; } - gtk_widget_get_allocation (self->priv->drawing_area, &_tmp2_); - allocation = _tmp2_; - _tmp3_ = page_view_get_x_offset (page); - left_edge = _tmp3_; - _tmp4_ = page_view_get_x_offset (page); - _tmp5_ = page_view_get_width (page); - right_edge = _tmp4_ + _tmp5_; - _tmp6_ = book_view_get_x_offset (self); - if ((left_edge - _tmp6_) < 0) { - book_view_set_x_offset (self, left_edge); + _tmp5_ = self->priv->drawing_area; + gtk_widget_get_allocation (_tmp5_, &_tmp6_); + allocation = _tmp6_; + _tmp7_ = page; + _tmp8_ = page_view_get_x_offset (_tmp7_); + left_edge = _tmp8_; + _tmp9_ = page; + _tmp10_ = page_view_get_x_offset (_tmp9_); + _tmp11_ = page; + _tmp12_ = page_view_get_width (_tmp11_); + right_edge = _tmp10_ + _tmp12_; + _tmp13_ = left_edge; + _tmp14_ = book_view_get_x_offset (self); + if ((_tmp13_ - _tmp14_) < 0) { + gint _tmp15_; + _tmp15_ = left_edge; + book_view_set_x_offset (self, _tmp15_); } else { - gint _tmp7_; - _tmp7_ = book_view_get_x_offset (self); - if ((right_edge - _tmp7_) > allocation.width) { - book_view_set_x_offset (self, right_edge - allocation.width); + gint _tmp16_; + gint _tmp17_ = 0; + GtkAllocation _tmp18_; + gint _tmp19_; + _tmp16_ = right_edge; + _tmp17_ = book_view_get_x_offset (self); + _tmp18_ = allocation; + _tmp19_ = _tmp18_.width; + if ((_tmp16_ - _tmp17_) > _tmp19_) { + gint _tmp20_; + GtkAllocation _tmp21_; + gint _tmp22_; + _tmp20_ = right_edge; + _tmp21_ = allocation; + _tmp22_ = _tmp21_.width; + book_view_set_x_offset (self, _tmp20_ - _tmp22_); } } } @@ -658,60 +844,94 @@ static void book_view_show_page_view (BookView* self, PageView* page) { static void book_view_select_page_view (BookView* self, PageView* page) { Page* p; + PageView* _tmp0_; + PageView* _tmp1_; + PageView* _tmp2_; + gboolean _tmp3_; + PageView* _tmp5_; + Page* _tmp8_; g_return_if_fail (self != NULL); p = NULL; - if (self->priv->selected_page == page) { + _tmp0_ = self->priv->selected_page; + _tmp1_ = page; + if (_tmp0_ == _tmp1_) { _page_unref0 (p); return; } - book_view_set_selected_page (self, page); - if (self->priv->need_layout) { + _tmp2_ = page; + book_view_set_selected_page (self, _tmp2_); + _tmp3_ = self->priv->need_layout; + if (_tmp3_) { self->priv->show_selected_page = TRUE; } else { - book_view_show_page_view (self, page); + PageView* _tmp4_; + _tmp4_ = page; + book_view_show_page_view (self, _tmp4_); } - if (page != NULL) { - Page* _tmp0_ = NULL; - _tmp0_ = page_view_get_page (page); + _tmp5_ = page; + if (_tmp5_ != NULL) { + PageView* _tmp6_; + Page* _tmp7_ = NULL; + _tmp6_ = page; + _tmp7_ = page_view_get_page (_tmp6_); _page_unref0 (p); - p = _tmp0_; + p = _tmp7_; } - g_signal_emit_by_name (self, "page-selected", p); + _tmp8_ = p; + g_signal_emit_by_name (self, "page-selected", _tmp8_); _page_unref0 (p); } static void book_view_remove_cb (BookView* self, Book* book, Page* page) { PageView* _tmp0_; + PageView* _tmp1_; PageView* new_selection; - Page* _tmp1_ = NULL; Page* _tmp2_; - gboolean _tmp3_; + Page* _tmp3_ = NULL; + Page* _tmp4_; + gboolean _tmp5_; + GHashTable* _tmp12_; + Page* _tmp13_; + PageView* _tmp14_; g_return_if_fail (self != NULL); g_return_if_fail (book != NULL); g_return_if_fail (page != NULL); - _tmp0_ = _page_view_ref0 (self->priv->selected_page); - new_selection = _tmp0_; - _tmp1_ = book_view_get_selected (self); - _tmp2_ = _tmp1_; - _tmp3_ = page == _tmp2_; - _page_unref0 (_tmp2_); - if (_tmp3_) { - PageView* _tmp4_ = NULL; - _tmp4_ = book_view_get_prev_page (self, self->priv->selected_page); + _tmp0_ = self->priv->selected_page; + _tmp1_ = _page_view_ref0 (_tmp0_); + new_selection = _tmp1_; + _tmp2_ = page; + _tmp3_ = book_view_get_selected (self); + _tmp4_ = _tmp3_; + _tmp5_ = _tmp2_ == _tmp4_; + _page_unref0 (_tmp4_); + if (_tmp5_) { + PageView* _tmp6_; + PageView* _tmp7_ = NULL; + PageView* _tmp8_; + PageView* _tmp9_; + _tmp6_ = self->priv->selected_page; + _tmp7_ = book_view_get_prev_page (self, _tmp6_); _page_view_unref0 (new_selection); - new_selection = _tmp4_; - if (new_selection == self->priv->selected_page) { - PageView* _tmp5_ = NULL; - _tmp5_ = book_view_get_next_page (self, self->priv->selected_page); + new_selection = _tmp7_; + _tmp8_ = new_selection; + _tmp9_ = self->priv->selected_page; + if (_tmp8_ == _tmp9_) { + PageView* _tmp10_; + PageView* _tmp11_ = NULL; + _tmp10_ = self->priv->selected_page; + _tmp11_ = book_view_get_next_page (self, _tmp10_); _page_view_unref0 (new_selection); - new_selection = _tmp5_; + new_selection = _tmp11_; } _page_view_unref0 (self->priv->selected_page); self->priv->selected_page = NULL; } - g_hash_table_remove (self->priv->page_data, page); - book_view_select_page_view (self, new_selection); + _tmp12_ = self->priv->page_data; + _tmp13_ = page; + g_hash_table_remove (_tmp12_, _tmp13_); + _tmp14_ = new_selection; + book_view_select_page_view (self, _tmp14_); self->priv->need_layout = TRUE; book_view_redraw (self); _page_view_unref0 (new_selection); @@ -727,9 +947,11 @@ static void book_view_reorder_cb (BookView* self, Book* book) { static void book_view_clear_cb (BookView* self, Book* book) { + GHashTable* _tmp0_; g_return_if_fail (self != NULL); g_return_if_fail (book != NULL); - g_hash_table_remove_all (self->priv->page_data); + _tmp0_ = self->priv->page_data; + g_hash_table_remove_all (_tmp0_); _page_view_unref0 (self->priv->selected_page); self->priv->selected_page = NULL; g_signal_emit_by_name (self, "page-selected", NULL); @@ -741,9 +963,11 @@ static void book_view_clear_cb (BookView* self, Book* book) { Book* book_view_get_book (BookView* self) { Book* result = NULL; Book* _tmp0_; + Book* _tmp1_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = _book_ref0 (self->priv->book); - result = _tmp0_; + _tmp0_ = self->priv->book; + _tmp1_ = _book_ref0 (_tmp0_); + result = _tmp1_; return result; } @@ -752,6 +976,7 @@ static gboolean book_view_configure_cb (BookView* self, GtkWidget* widget, GdkEv gboolean result = FALSE; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (widget != NULL, FALSE); + g_return_val_if_fail (event != NULL, FALSE); self->priv->need_layout = TRUE; result = FALSE; return result; @@ -759,12 +984,16 @@ static gboolean book_view_configure_cb (BookView* self, GtkWidget* widget, GdkEv static void book_view_layout_into (BookView* self, gint width, gint height, gint* book_width, gint* book_height) { - gint _book_width = 0; - gint _book_height = 0; + gint _vala_book_width = 0; + gint _vala_book_height = 0; gint max_dpi; gint max_width; gint max_height; + gint _tmp41_; + gint _tmp42_; gdouble aspect; + gint _tmp43_; + gint _tmp44_; gdouble max_aspect; gint spacing; gint x_offset; @@ -777,25 +1006,43 @@ static void book_view_layout_into (BookView* self, gint width, gint height, gint gboolean _tmp0_; _tmp0_ = TRUE; while (TRUE) { - guint _tmp1_; - Page* _tmp2_ = NULL; - Page* page; + gboolean _tmp1_; gint _tmp3_; - if (!_tmp0_) { - i++; + Book* _tmp4_; + guint _tmp5_ = 0U; + Book* _tmp6_; + gint _tmp7_; + Page* _tmp8_ = NULL; + Page* page; + Page* _tmp9_; + gint _tmp10_ = 0; + gint _tmp11_; + _tmp1_ = _tmp0_; + if (!_tmp1_) { + gint _tmp2_; + _tmp2_ = i; + i = _tmp2_ + 1; } _tmp0_ = FALSE; - _tmp1_ = book_get_n_pages (self->priv->book); - if (!(((guint) i) < _tmp1_)) { + _tmp3_ = i; + _tmp4_ = self->priv->book; + _tmp5_ = book_get_n_pages (_tmp4_); + if (!(((guint) _tmp3_) < _tmp5_)) { break; } - _tmp2_ = book_get_page (self->priv->book, i); - page = _tmp2_; - _tmp3_ = page_get_dpi (page); - if (_tmp3_ > max_dpi) { - gint _tmp4_; - _tmp4_ = page_get_dpi (page); - max_dpi = _tmp4_; + _tmp6_ = self->priv->book; + _tmp7_ = i; + _tmp8_ = book_get_page (_tmp6_, _tmp7_); + page = _tmp8_; + _tmp9_ = page; + _tmp10_ = page_get_dpi (_tmp9_); + _tmp11_ = max_dpi; + if (_tmp10_ > _tmp11_) { + Page* _tmp12_; + gint _tmp13_ = 0; + _tmp12_ = page; + _tmp13_ = page_get_dpi (_tmp12_); + max_dpi = _tmp13_; } _page_unref0 (page); } @@ -807,104 +1054,210 @@ static void book_view_layout_into (BookView* self, gint width, gint height, gint gint i; i = 0; { - gboolean _tmp5_; - _tmp5_ = TRUE; + gboolean _tmp14_; + _tmp14_ = TRUE; while (TRUE) { - guint _tmp6_; - Page* _tmp7_ = NULL; + gboolean _tmp15_; + gint _tmp17_; + Book* _tmp18_; + guint _tmp19_ = 0U; + Book* _tmp20_; + gint _tmp21_; + Page* _tmp22_ = NULL; Page* page; - gint _tmp8_; + Page* _tmp23_; + gint _tmp24_ = 0; gint w; - gint _tmp9_; + Page* _tmp25_; + gint _tmp26_ = 0; gint h; - gint _tmp10_; - gint _tmp11_; - if (!_tmp5_) { - i++; + gint _tmp27_; + gint _tmp28_; + Page* _tmp29_; + gint _tmp30_ = 0; + gint _tmp31_; + gint _tmp32_; + Page* _tmp33_; + gint _tmp34_ = 0; + gint _tmp35_; + gint _tmp36_; + gint _tmp38_; + gint _tmp39_; + _tmp15_ = _tmp14_; + if (!_tmp15_) { + gint _tmp16_; + _tmp16_ = i; + i = _tmp16_ + 1; } - _tmp5_ = FALSE; - _tmp6_ = book_get_n_pages (self->priv->book); - if (!(((guint) i) < _tmp6_)) { + _tmp14_ = FALSE; + _tmp17_ = i; + _tmp18_ = self->priv->book; + _tmp19_ = book_get_n_pages (_tmp18_); + if (!(((guint) _tmp17_) < _tmp19_)) { break; } - _tmp7_ = book_get_page (self->priv->book, i); - page = _tmp7_; - _tmp8_ = page_get_width (page); - w = _tmp8_; - _tmp9_ = page_get_height (page); - h = _tmp9_; - _tmp10_ = page_get_dpi (page); - w = (gint) (((((gdouble) w) * max_dpi) / _tmp10_) + 0.5); - _tmp11_ = page_get_dpi (page); - h = (gint) (((((gdouble) h) * max_dpi) / _tmp11_) + 0.5); - if (w > max_width) { - max_width = w; + _tmp20_ = self->priv->book; + _tmp21_ = i; + _tmp22_ = book_get_page (_tmp20_, _tmp21_); + page = _tmp22_; + _tmp23_ = page; + _tmp24_ = page_get_width (_tmp23_); + w = _tmp24_; + _tmp25_ = page; + _tmp26_ = page_get_height (_tmp25_); + h = _tmp26_; + _tmp27_ = w; + _tmp28_ = max_dpi; + _tmp29_ = page; + _tmp30_ = page_get_dpi (_tmp29_); + w = (gint) (((((gdouble) _tmp27_) * _tmp28_) / _tmp30_) + 0.5); + _tmp31_ = h; + _tmp32_ = max_dpi; + _tmp33_ = page; + _tmp34_ = page_get_dpi (_tmp33_); + h = (gint) (((((gdouble) _tmp31_) * _tmp32_) / _tmp34_) + 0.5); + _tmp35_ = w; + _tmp36_ = max_width; + if (_tmp35_ > _tmp36_) { + gint _tmp37_; + _tmp37_ = w; + max_width = _tmp37_; } - if (h > max_height) { - max_height = h; + _tmp38_ = h; + _tmp39_ = max_height; + if (_tmp38_ > _tmp39_) { + gint _tmp40_; + _tmp40_ = h; + max_height = _tmp40_; } _page_unref0 (page); } } } - aspect = ((gdouble) width) / height; - max_aspect = ((gdouble) max_width) / max_height; + _tmp41_ = width; + _tmp42_ = height; + aspect = ((gdouble) _tmp41_) / _tmp42_; + _tmp43_ = max_width; + _tmp44_ = max_height; + max_aspect = ((gdouble) _tmp43_) / _tmp44_; spacing = 12; - _book_width = 0; - _book_height = 0; + _vala_book_width = 0; + _vala_book_height = 0; { gint i; i = 0; { - gboolean _tmp12_; - _tmp12_ = TRUE; + gboolean _tmp45_; + _tmp45_ = TRUE; while (TRUE) { - guint _tmp13_; - PageView* _tmp14_ = NULL; + gboolean _tmp46_; + gint _tmp48_; + Book* _tmp49_; + guint _tmp50_ = 0U; + gint _tmp51_; + PageView* _tmp52_ = NULL; PageView* page; - Page* _tmp15_ = NULL; + PageView* _tmp53_; + Page* _tmp54_ = NULL; Page* p; - gint _tmp20_; + gdouble _tmp55_; + gdouble _tmp56_; + PageView* _tmp75_; + gint _tmp76_ = 0; gint h; - gint _tmp21_; - if (!_tmp12_) { - i++; + gint _tmp77_; + gint _tmp78_; + gint _tmp80_; + PageView* _tmp81_; + gint _tmp82_ = 0; + gint _tmp83_; + _tmp46_ = _tmp45_; + if (!_tmp46_) { + gint _tmp47_; + _tmp47_ = i; + i = _tmp47_ + 1; } - _tmp12_ = FALSE; - _tmp13_ = book_get_n_pages (self->priv->book); - if (!(((guint) i) < _tmp13_)) { + _tmp45_ = FALSE; + _tmp48_ = i; + _tmp49_ = self->priv->book; + _tmp50_ = book_get_n_pages (_tmp49_); + if (!(((guint) _tmp48_) < _tmp50_)) { break; } - _tmp14_ = book_view_get_nth_page (self, i); - page = _tmp14_; - _tmp15_ = page_view_get_page (page); - p = _tmp15_; - if (max_aspect > aspect) { - gint _tmp16_; - gint _tmp17_; + _tmp51_ = i; + _tmp52_ = book_view_get_nth_page (self, _tmp51_); + page = _tmp52_; + _tmp53_ = page; + _tmp54_ = page_view_get_page (_tmp53_); + p = _tmp54_; + _tmp55_ = max_aspect; + _tmp56_ = aspect; + if (_tmp55_ > _tmp56_) { + Page* _tmp57_; + gint _tmp58_ = 0; + gint _tmp59_; + gint _tmp60_; + Page* _tmp61_; + gint _tmp62_ = 0; + gint _tmp63_; gint w; - _tmp16_ = page_get_width (p); - _tmp17_ = page_get_dpi (p); - w = (gint) (((((gdouble) _tmp16_) * max_dpi) * width) / (_tmp17_ * max_width)); - page_view_set_width (page, w); + PageView* _tmp64_; + gint _tmp65_; + _tmp57_ = p; + _tmp58_ = page_get_width (_tmp57_); + _tmp59_ = max_dpi; + _tmp60_ = width; + _tmp61_ = p; + _tmp62_ = page_get_dpi (_tmp61_); + _tmp63_ = max_width; + w = (gint) (((((gdouble) _tmp58_) * _tmp59_) * _tmp60_) / (_tmp62_ * _tmp63_)); + _tmp64_ = page; + _tmp65_ = w; + page_view_set_width (_tmp64_, _tmp65_); } else { - gint _tmp18_; - gint _tmp19_; + Page* _tmp66_; + gint _tmp67_ = 0; + gint _tmp68_; + gint _tmp69_; + Page* _tmp70_; + gint _tmp71_ = 0; + gint _tmp72_; gint h; - _tmp18_ = page_get_height (p); - _tmp19_ = page_get_dpi (p); - h = (gint) (((((gdouble) _tmp18_) * max_dpi) * height) / (_tmp19_ * max_height)); - page_view_set_height (page, h); + PageView* _tmp73_; + gint _tmp74_; + _tmp66_ = p; + _tmp67_ = page_get_height (_tmp66_); + _tmp68_ = max_dpi; + _tmp69_ = height; + _tmp70_ = p; + _tmp71_ = page_get_dpi (_tmp70_); + _tmp72_ = max_height; + h = (gint) (((((gdouble) _tmp67_) * _tmp68_) * _tmp69_) / (_tmp71_ * _tmp72_)); + _tmp73_ = page; + _tmp74_ = h; + page_view_set_height (_tmp73_, _tmp74_); } - _tmp20_ = page_view_get_height (page); - h = _tmp20_; - if (h > _book_height) { - _book_height = h; + _tmp75_ = page; + _tmp76_ = page_view_get_height (_tmp75_); + h = _tmp76_; + _tmp77_ = h; + _tmp78_ = _vala_book_height; + if (_tmp77_ > _tmp78_) { + gint _tmp79_; + _tmp79_ = h; + _vala_book_height = _tmp79_; } - _tmp21_ = page_view_get_width (page); - _book_width = _book_width + _tmp21_; - if (i != 0) { - _book_width = _book_width + spacing; + _tmp80_ = _vala_book_width; + _tmp81_ = page; + _tmp82_ = page_view_get_width (_tmp81_); + _vala_book_width = _tmp80_ + _tmp82_; + _tmp83_ = i; + if (_tmp83_ != 0) { + gint _tmp84_; + gint _tmp85_; + _tmp84_ = _vala_book_width; + _tmp85_ = spacing; + _vala_book_width = _tmp84_ + _tmp85_; } _page_unref0 (p); _page_view_unref0 (page); @@ -916,115 +1269,229 @@ static void book_view_layout_into (BookView* self, gint width, gint height, gint gint i; i = 0; { - gboolean _tmp22_; - _tmp22_ = TRUE; + gboolean _tmp86_; + _tmp86_ = TRUE; while (TRUE) { - guint _tmp23_; - PageView* _tmp24_ = NULL; + gboolean _tmp87_; + gint _tmp89_; + Book* _tmp90_; + guint _tmp91_ = 0U; + gint _tmp92_; + PageView* _tmp93_ = NULL; PageView* page; - gint _tmp25_; - gint _tmp26_; - if (!_tmp22_) { - i++; + PageView* _tmp94_; + gint _tmp95_; + gint _tmp96_; + PageView* _tmp97_; + gint _tmp98_ = 0; + gint _tmp99_; + PageView* _tmp100_; + gint _tmp101_; + PageView* _tmp102_; + gint _tmp103_ = 0; + _tmp87_ = _tmp86_; + if (!_tmp87_) { + gint _tmp88_; + _tmp88_ = i; + i = _tmp88_ + 1; } - _tmp22_ = FALSE; - _tmp23_ = book_get_n_pages (self->priv->book); - if (!(((guint) i) < _tmp23_)) { + _tmp86_ = FALSE; + _tmp89_ = i; + _tmp90_ = self->priv->book; + _tmp91_ = book_get_n_pages (_tmp90_); + if (!(((guint) _tmp89_) < _tmp91_)) { break; } - _tmp24_ = book_view_get_nth_page (self, i); - page = _tmp24_; - page_view_set_x_offset (page, x_offset); - _tmp25_ = page_view_get_width (page); - x_offset = x_offset + (_tmp25_ + spacing); - _tmp26_ = page_view_get_height (page); - page_view_set_y_offset (page, (height - _tmp26_) / 2); + _tmp92_ = i; + _tmp93_ = book_view_get_nth_page (self, _tmp92_); + page = _tmp93_; + _tmp94_ = page; + _tmp95_ = x_offset; + page_view_set_x_offset (_tmp94_, _tmp95_); + _tmp96_ = x_offset; + _tmp97_ = page; + _tmp98_ = page_view_get_width (_tmp97_); + _tmp99_ = spacing; + x_offset = _tmp96_ + (_tmp98_ + _tmp99_); + _tmp100_ = page; + _tmp101_ = height; + _tmp102_ = page; + _tmp103_ = page_view_get_height (_tmp102_); + page_view_set_y_offset (_tmp100_, (_tmp101_ - _tmp103_) / 2); _page_view_unref0 (page); } } } if (book_width) { - *book_width = _book_width; + *book_width = _vala_book_width; } if (book_height) { - *book_height = _book_height; + *book_height = _vala_book_height; } } static void book_view_layout (BookView* self) { + gboolean _tmp0_; GtkAllocation allocation = {0}; - GtkAllocation _tmp0_ = {0}; + GtkWidget* _tmp1_; + GtkAllocation _tmp2_ = {0}; GtkAllocation box_allocation = {0}; - GtkAllocation _tmp1_ = {0}; + GtkAllocation _tmp3_ = {0}; gboolean right_aligned; - gdouble _tmp2_; - gdouble _tmp3_; - gdouble _tmp4_; + GtkAdjustment* _tmp4_; + gdouble _tmp5_ = 0.0; + GtkAdjustment* _tmp6_; + gdouble _tmp7_ = 0.0; + GtkAdjustment* _tmp8_; + gdouble _tmp9_ = 0.0; + GtkAllocation _tmp10_; + gint _tmp11_; gint width; - guint _tmp5_; + GtkAllocation _tmp12_; + gint _tmp13_; + guint _tmp14_ = 0U; gint height; gint book_width = 0; gint book_height = 0; - gint _tmp6_; - gint _tmp7_; + gint _tmp15_; + gint _tmp16_; + gint _tmp17_ = 0; + gint _tmp18_ = 0; + gint _tmp19_; + GtkAllocation _tmp20_; + gint _tmp21_; + gboolean _tmp54_; g_return_if_fail (self != NULL); - if (!self->priv->need_layout) { + _tmp0_ = self->priv->need_layout; + if (!_tmp0_) { return; } self->priv->laying_out = TRUE; - gtk_widget_get_allocation (self->priv->drawing_area, &_tmp0_); - allocation = _tmp0_; - gtk_widget_get_allocation ((GtkWidget*) self, &_tmp1_); - box_allocation = _tmp1_; + _tmp1_ = self->priv->drawing_area; + gtk_widget_get_allocation (_tmp1_, &_tmp2_); + allocation = _tmp2_; + gtk_widget_get_allocation ((GtkWidget*) self, &_tmp3_); + box_allocation = _tmp3_; right_aligned = TRUE; - _tmp2_ = gtk_adjustment_get_value (self->priv->adjustment); - _tmp3_ = gtk_adjustment_get_upper (self->priv->adjustment); - _tmp4_ = gtk_adjustment_get_page_size (self->priv->adjustment); - if (_tmp2_ < (_tmp3_ - _tmp4_)) { + _tmp4_ = self->priv->adjustment; + _tmp5_ = gtk_adjustment_get_value (_tmp4_); + _tmp6_ = self->priv->adjustment; + _tmp7_ = gtk_adjustment_get_upper (_tmp6_); + _tmp8_ = self->priv->adjustment; + _tmp9_ = gtk_adjustment_get_page_size (_tmp8_); + if (_tmp5_ < (_tmp7_ - _tmp9_)) { right_aligned = FALSE; } - width = (gint) allocation.width; - _tmp5_ = gtk_container_get_border_width ((GtkContainer*) self); - height = (gint) (box_allocation.height - (_tmp5_ * 2)); - book_view_layout_into (self, width, height, &_tmp6_, &_tmp7_); - book_width = _tmp6_; - book_height = _tmp7_; - if (book_width > allocation.width) { - gint _tmp8_; - gint _tmp9_; + _tmp10_ = allocation; + _tmp11_ = _tmp10_.width; + width = (gint) _tmp11_; + _tmp12_ = box_allocation; + _tmp13_ = _tmp12_.height; + _tmp14_ = gtk_container_get_border_width ((GtkContainer*) self); + height = (gint) (_tmp13_ - (_tmp14_ * 2)); + _tmp15_ = width; + _tmp16_ = height; + book_view_layout_into (self, _tmp15_, _tmp16_, &_tmp17_, &_tmp18_); + book_width = _tmp17_; + book_height = _tmp18_; + _tmp19_ = book_width; + _tmp20_ = allocation; + _tmp21_ = _tmp20_.width; + if (_tmp19_ > _tmp21_) { + GtkAllocation _tmp22_; + gint _tmp23_; + gint _tmp24_; + gint _tmp25_; + gint _tmp26_ = 0; + gint _tmp27_ = 0; + GtkAdjustment* _tmp28_; + GtkAdjustment* _tmp29_; + gint _tmp30_; + GtkAdjustment* _tmp31_; + GtkAllocation _tmp32_; + gint _tmp33_; + gint _tmp34_; + GtkAllocation _tmp35_; + gint _tmp36_; gint max_offset; - gboolean _tmp10_ = FALSE; - height = allocation.height; - book_view_layout_into (self, width, height, &_tmp8_, &_tmp9_); - book_width = _tmp8_; - book_height = _tmp9_; - gtk_adjustment_set_lower (self->priv->adjustment, (gdouble) 0); - gtk_adjustment_set_upper (self->priv->adjustment, (gdouble) book_width); - gtk_adjustment_set_page_size (self->priv->adjustment, (gdouble) allocation.width); - max_offset = book_width - allocation.width; - if (right_aligned) { - _tmp10_ = TRUE; + gboolean _tmp37_ = FALSE; + gboolean _tmp38_; + gboolean _tmp41_; + GtkHScrollbar* _tmp43_; + _tmp22_ = allocation; + _tmp23_ = _tmp22_.height; + height = _tmp23_; + _tmp24_ = width; + _tmp25_ = height; + book_view_layout_into (self, _tmp24_, _tmp25_, &_tmp26_, &_tmp27_); + book_width = _tmp26_; + book_height = _tmp27_; + _tmp28_ = self->priv->adjustment; + gtk_adjustment_set_lower (_tmp28_, (gdouble) 0); + _tmp29_ = self->priv->adjustment; + _tmp30_ = book_width; + gtk_adjustment_set_upper (_tmp29_, (gdouble) _tmp30_); + _tmp31_ = self->priv->adjustment; + _tmp32_ = allocation; + _tmp33_ = _tmp32_.width; + gtk_adjustment_set_page_size (_tmp31_, (gdouble) _tmp33_); + _tmp34_ = book_width; + _tmp35_ = allocation; + _tmp36_ = _tmp35_.width; + max_offset = _tmp34_ - _tmp36_; + _tmp38_ = right_aligned; + if (_tmp38_) { + _tmp37_ = TRUE; } else { - gint _tmp11_; - _tmp11_ = book_view_get_x_offset (self); - _tmp10_ = _tmp11_ > max_offset; + gint _tmp39_ = 0; + gint _tmp40_; + _tmp39_ = book_view_get_x_offset (self); + _tmp40_ = max_offset; + _tmp37_ = _tmp39_ > _tmp40_; } - if (_tmp10_) { - book_view_set_x_offset (self, max_offset); + _tmp41_ = _tmp37_; + if (_tmp41_) { + gint _tmp42_; + _tmp42_ = max_offset; + book_view_set_x_offset (self, _tmp42_); } - gtk_widget_show ((GtkWidget*) self->priv->scroll); + _tmp43_ = self->priv->scroll; + gtk_widget_show ((GtkWidget*) _tmp43_); } else { + GtkHScrollbar* _tmp44_; + gint _tmp45_; + GtkAllocation _tmp46_; + gint _tmp47_; gint offset; - gtk_widget_hide ((GtkWidget*) self->priv->scroll); - offset = (book_width - allocation.width) / 2; - gtk_adjustment_set_lower (self->priv->adjustment, (gdouble) offset); - gtk_adjustment_set_upper (self->priv->adjustment, (gdouble) offset); - gtk_adjustment_set_page_size (self->priv->adjustment, (gdouble) 0); - book_view_set_x_offset (self, offset); + GtkAdjustment* _tmp48_; + gint _tmp49_; + GtkAdjustment* _tmp50_; + gint _tmp51_; + GtkAdjustment* _tmp52_; + gint _tmp53_; + _tmp44_ = self->priv->scroll; + gtk_widget_hide ((GtkWidget*) _tmp44_); + _tmp45_ = book_width; + _tmp46_ = allocation; + _tmp47_ = _tmp46_.width; + offset = (_tmp45_ - _tmp47_) / 2; + _tmp48_ = self->priv->adjustment; + _tmp49_ = offset; + gtk_adjustment_set_lower (_tmp48_, (gdouble) _tmp49_); + _tmp50_ = self->priv->adjustment; + _tmp51_ = offset; + gtk_adjustment_set_upper (_tmp50_, (gdouble) _tmp51_); + _tmp52_ = self->priv->adjustment; + gtk_adjustment_set_page_size (_tmp52_, (gdouble) 0); + _tmp53_ = offset; + book_view_set_x_offset (self, _tmp53_); } - if (self->priv->show_selected_page) { - book_view_show_page_view (self, self->priv->selected_page); + _tmp54_ = self->priv->show_selected_page; + if (_tmp54_) { + PageView* _tmp55_; + _tmp55_ = self->priv->selected_page; + book_view_show_page_view (self, _tmp55_); } self->priv->need_layout = FALSE; self->priv->show_selected_page = FALSE; @@ -1034,95 +1501,149 @@ static void book_view_layout (BookView* self) { static gboolean book_view_draw_cb (BookView* self, GtkWidget* widget, cairo_t* context) { gboolean result = FALSE; - guint _tmp0_; + Book* _tmp0_; + guint _tmp1_ = 0U; gdouble left = 0.0; gdouble top = 0.0; gdouble right = 0.0; gdouble bottom = 0.0; - gdouble _tmp1_; - gdouble _tmp2_; - gdouble _tmp3_; - gdouble _tmp4_; + cairo_t* _tmp2_; + gdouble _tmp3_ = 0.0; + gdouble _tmp4_ = 0.0; + gdouble _tmp5_ = 0.0; + gdouble _tmp6_ = 0.0; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (context != NULL, FALSE); - _tmp0_ = book_get_n_pages (self->priv->book); - if (_tmp0_ == ((guint) 0)) { + _tmp0_ = self->priv->book; + _tmp1_ = book_get_n_pages (_tmp0_); + if (_tmp1_ == ((guint) 0)) { result = FALSE; return result; } book_view_layout (self); - cairo_clip_extents (context, &_tmp1_, &_tmp2_, &_tmp3_, &_tmp4_); - left = _tmp1_; - top = _tmp2_; - right = _tmp3_; - bottom = _tmp4_; + _tmp2_ = context; + cairo_clip_extents (_tmp2_, &_tmp3_, &_tmp4_, &_tmp5_, &_tmp6_); + left = _tmp3_; + top = _tmp4_; + right = _tmp5_; + bottom = _tmp6_; { gint i; i = 0; { - gboolean _tmp5_; - _tmp5_ = TRUE; + gboolean _tmp7_; + _tmp7_ = TRUE; while (TRUE) { - guint _tmp6_; - PageView* _tmp7_ = NULL; + gboolean _tmp8_; + gint _tmp10_; + Book* _tmp11_; + guint _tmp12_ = 0U; + gint _tmp13_; + PageView* _tmp14_ = NULL; PageView* page; - gint _tmp8_; - gint _tmp9_; + PageView* _tmp15_; + gint _tmp16_ = 0; + gint _tmp17_ = 0; gint left_edge; - gint _tmp10_; - gint _tmp11_; - gint _tmp12_; + PageView* _tmp18_; + gint _tmp19_ = 0; + PageView* _tmp20_; + gint _tmp21_ = 0; + gint _tmp22_ = 0; gint right_edge; - gboolean _tmp13_ = FALSE; - gint _tmp14_; - gboolean _tmp15_; - if (!_tmp5_) { - i++; + gboolean _tmp23_ = FALSE; + gint _tmp24_; + gdouble _tmp25_; + gboolean _tmp28_; + cairo_t* _tmp29_; + cairo_t* _tmp30_; + gint _tmp31_ = 0; + PageView* _tmp32_; + cairo_t* _tmp33_; + cairo_t* _tmp34_; + PageView* _tmp35_; + gboolean _tmp36_ = FALSE; + _tmp8_ = _tmp7_; + if (!_tmp8_) { + gint _tmp9_; + _tmp9_ = i; + i = _tmp9_ + 1; } - _tmp5_ = FALSE; - _tmp6_ = book_get_n_pages (self->priv->book); - if (!(((guint) i) < _tmp6_)) { + _tmp7_ = FALSE; + _tmp10_ = i; + _tmp11_ = self->priv->book; + _tmp12_ = book_get_n_pages (_tmp11_); + if (!(((guint) _tmp10_) < _tmp12_)) { break; } - _tmp7_ = book_view_get_nth_page (self, i); - page = _tmp7_; - _tmp8_ = page_view_get_x_offset (page); - _tmp9_ = book_view_get_x_offset (self); - left_edge = _tmp8_ - _tmp9_; - _tmp10_ = page_view_get_x_offset (page); - _tmp11_ = page_view_get_width (page); - _tmp12_ = book_view_get_x_offset (self); - right_edge = (_tmp10_ + _tmp11_) - _tmp12_; - if (((gdouble) right_edge) < left) { - _tmp13_ = TRUE; + _tmp13_ = i; + _tmp14_ = book_view_get_nth_page (self, _tmp13_); + page = _tmp14_; + _tmp15_ = page; + _tmp16_ = page_view_get_x_offset (_tmp15_); + _tmp17_ = book_view_get_x_offset (self); + left_edge = _tmp16_ - _tmp17_; + _tmp18_ = page; + _tmp19_ = page_view_get_x_offset (_tmp18_); + _tmp20_ = page; + _tmp21_ = page_view_get_width (_tmp20_); + _tmp22_ = book_view_get_x_offset (self); + right_edge = (_tmp19_ + _tmp21_) - _tmp22_; + _tmp24_ = right_edge; + _tmp25_ = left; + if (((gdouble) _tmp24_) < _tmp25_) { + _tmp23_ = TRUE; } else { - _tmp13_ = ((gdouble) left_edge) > right; + gint _tmp26_; + gdouble _tmp27_; + _tmp26_ = left_edge; + _tmp27_ = right; + _tmp23_ = ((gdouble) _tmp26_) > _tmp27_; } - if (_tmp13_) { + _tmp28_ = _tmp23_; + if (_tmp28_) { _page_view_unref0 (page); continue; } - cairo_save (context); - _tmp14_ = book_view_get_x_offset (self); - cairo_translate (context, (gdouble) (-_tmp14_), (gdouble) 0); - page_view_render (page, context); - cairo_restore (context); - _tmp15_ = page_view_get_selected (page); - if (_tmp15_) { - GtkStyle* _tmp16_ = NULL; - gint _tmp17_; - gint _tmp18_; - gint _tmp19_; - gint _tmp20_; - gint _tmp21_; - _tmp16_ = gtk_widget_get_style (self->priv->drawing_area); - _tmp17_ = page_view_get_x_offset (page); - _tmp18_ = book_view_get_x_offset (self); - _tmp19_ = page_view_get_y_offset (page); - _tmp20_ = page_view_get_width (page); - _tmp21_ = page_view_get_height (page); - gtk_paint_focus (_tmp16_, context, GTK_STATE_SELECTED, NULL, NULL, _tmp17_ - _tmp18_, _tmp19_, _tmp20_, _tmp21_); + _tmp29_ = context; + cairo_save (_tmp29_); + _tmp30_ = context; + _tmp31_ = book_view_get_x_offset (self); + cairo_translate (_tmp30_, (gdouble) (-_tmp31_), (gdouble) 0); + _tmp32_ = page; + _tmp33_ = context; + page_view_render (_tmp32_, _tmp33_); + _tmp34_ = context; + cairo_restore (_tmp34_); + _tmp35_ = page; + _tmp36_ = page_view_get_selected (_tmp35_); + if (_tmp36_) { + GtkWidget* _tmp37_; + GtkStyle* _tmp38_ = NULL; + cairo_t* _tmp39_; + PageView* _tmp40_; + gint _tmp41_ = 0; + gint _tmp42_ = 0; + PageView* _tmp43_; + gint _tmp44_ = 0; + PageView* _tmp45_; + gint _tmp46_ = 0; + PageView* _tmp47_; + gint _tmp48_ = 0; + _tmp37_ = self->priv->drawing_area; + _tmp38_ = gtk_widget_get_style (_tmp37_); + _tmp39_ = context; + _tmp40_ = page; + _tmp41_ = page_view_get_x_offset (_tmp40_); + _tmp42_ = book_view_get_x_offset (self); + _tmp43_ = page; + _tmp44_ = page_view_get_y_offset (_tmp43_); + _tmp45_ = page; + _tmp46_ = page_view_get_width (_tmp45_); + _tmp47_ = page; + _tmp48_ = page_view_get_height (_tmp47_); + gtk_paint_focus (_tmp38_, _tmp39_, GTK_STATE_SELECTED, NULL, NULL, _tmp41_ - _tmp42_, _tmp44_, _tmp46_, _tmp48_); } _page_view_unref0 (page); } @@ -1134,8 +1655,8 @@ static gboolean book_view_draw_cb (BookView* self, GtkWidget* widget, cairo_t* c static PageView* book_view_get_page_at (BookView* self, gint x, gint y, gint* x_, gint* y_) { - gint _x_ = 0; - gint _y_ = 0; + gint _vala_x_ = 0; + gint _vala_y_ = 0; PageView* result = NULL; g_return_val_if_fail (self != NULL, NULL); { @@ -1145,62 +1666,114 @@ static PageView* book_view_get_page_at (BookView* self, gint x, gint y, gint* x_ gboolean _tmp0_; _tmp0_ = TRUE; while (TRUE) { - guint _tmp1_; - PageView* _tmp2_ = NULL; - PageView* page; + gboolean _tmp1_; gint _tmp3_; + Book* _tmp4_; + guint _tmp5_ = 0U; + gint _tmp6_; + PageView* _tmp7_ = NULL; + PageView* page; + PageView* _tmp8_; + gint _tmp9_ = 0; gint left; - gint _tmp4_; + gint _tmp10_; + PageView* _tmp11_; + gint _tmp12_ = 0; gint right; - gint _tmp5_; + PageView* _tmp13_; + gint _tmp14_ = 0; gint top; - gint _tmp6_; + gint _tmp15_; + PageView* _tmp16_; + gint _tmp17_ = 0; gint bottom; - gboolean _tmp7_ = FALSE; - gboolean _tmp8_ = FALSE; - gboolean _tmp9_ = FALSE; - if (!_tmp0_) { - i++; + gboolean _tmp18_ = FALSE; + gboolean _tmp19_ = FALSE; + gboolean _tmp20_ = FALSE; + gint _tmp21_; + gint _tmp22_; + gboolean _tmp25_; + gboolean _tmp28_; + gboolean _tmp31_; + _tmp1_ = _tmp0_; + if (!_tmp1_) { + gint _tmp2_; + _tmp2_ = i; + i = _tmp2_ + 1; } _tmp0_ = FALSE; - _tmp1_ = book_get_n_pages (self->priv->book); - if (!(((guint) i) < _tmp1_)) { + _tmp3_ = i; + _tmp4_ = self->priv->book; + _tmp5_ = book_get_n_pages (_tmp4_); + if (!(((guint) _tmp3_) < _tmp5_)) { break; } - _tmp2_ = book_view_get_nth_page (self, i); - page = _tmp2_; - _tmp3_ = page_view_get_x_offset (page); - left = _tmp3_; - _tmp4_ = page_view_get_width (page); - right = left + _tmp4_; - _tmp5_ = page_view_get_y_offset (page); - top = _tmp5_; - _tmp6_ = page_view_get_height (page); - bottom = top + _tmp6_; - if (x >= left) { - _tmp9_ = x <= right; + _tmp6_ = i; + _tmp7_ = book_view_get_nth_page (self, _tmp6_); + page = _tmp7_; + _tmp8_ = page; + _tmp9_ = page_view_get_x_offset (_tmp8_); + left = _tmp9_; + _tmp10_ = left; + _tmp11_ = page; + _tmp12_ = page_view_get_width (_tmp11_); + right = _tmp10_ + _tmp12_; + _tmp13_ = page; + _tmp14_ = page_view_get_y_offset (_tmp13_); + top = _tmp14_; + _tmp15_ = top; + _tmp16_ = page; + _tmp17_ = page_view_get_height (_tmp16_); + bottom = _tmp15_ + _tmp17_; + _tmp21_ = x; + _tmp22_ = left; + if (_tmp21_ >= _tmp22_) { + gint _tmp23_; + gint _tmp24_; + _tmp23_ = x; + _tmp24_ = right; + _tmp20_ = _tmp23_ <= _tmp24_; } else { - _tmp9_ = FALSE; + _tmp20_ = FALSE; } - if (_tmp9_) { - _tmp8_ = y >= top; + _tmp25_ = _tmp20_; + if (_tmp25_) { + gint _tmp26_; + gint _tmp27_; + _tmp26_ = y; + _tmp27_ = top; + _tmp19_ = _tmp26_ >= _tmp27_; } else { - _tmp8_ = FALSE; + _tmp19_ = FALSE; } - if (_tmp8_) { - _tmp7_ = y <= bottom; + _tmp28_ = _tmp19_; + if (_tmp28_) { + gint _tmp29_; + gint _tmp30_; + _tmp29_ = y; + _tmp30_ = bottom; + _tmp18_ = _tmp29_ <= _tmp30_; } else { - _tmp7_ = FALSE; + _tmp18_ = FALSE; } - if (_tmp7_) { - _x_ = x - left; - _y_ = y - top; + _tmp31_ = _tmp18_; + if (_tmp31_) { + gint _tmp32_; + gint _tmp33_; + gint _tmp34_; + gint _tmp35_; + _tmp32_ = x; + _tmp33_ = left; + _vala_x_ = _tmp32_ - _tmp33_; + _tmp34_ = y; + _tmp35_ = top; + _vala_y_ = _tmp34_ - _tmp35_; result = page; if (x_) { - *x_ = _x_; + *x_ = _vala_x_; } if (y_) { - *y_ = _y_; + *y_ = _vala_y_; } return result; } @@ -1210,10 +1783,10 @@ static PageView* book_view_get_page_at (BookView* self, gint x, gint y, gint* x_ } result = NULL; if (x_) { - *x_ = _x_; + *x_ = _vala_x_; } if (y_) { - *y_ = _y_; + *y_ = _vala_y_; } return result; } @@ -1221,51 +1794,100 @@ static PageView* book_view_get_page_at (BookView* self, gint x, gint y, gint* x_ static gboolean book_view_button_cb (BookView* self, GtkWidget* widget, GdkEventButton* event) { gboolean result = FALSE; + GtkWidget* _tmp0_; gint x; gint y; + GdkEventButton _tmp1_; + GdkEventType _tmp2_; + PageView* _tmp12_; + GdkEventButton _tmp13_; + guint _tmp14_; + GdkEventButton _tmp29_; + guint _tmp30_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (widget != NULL, FALSE); + g_return_val_if_fail (event != NULL, FALSE); book_view_layout (self); - gtk_widget_grab_focus (self->priv->drawing_area); + _tmp0_ = self->priv->drawing_area; + gtk_widget_grab_focus (_tmp0_); x = 0; y = 0; - if ((*event).type == GDK_BUTTON_PRESS) { - gint _tmp0_; - gint _tmp1_; - gint _tmp2_; - PageView* _tmp3_ = NULL; - PageView* _tmp4_; - _tmp0_ = book_view_get_x_offset (self); - _tmp3_ = book_view_get_page_at (self, (gint) ((*event).x + _tmp0_), (gint) (*event).y, &_tmp1_, &_tmp2_); - x = _tmp1_; - y = _tmp2_; - _tmp4_ = _tmp3_; - book_view_select_page_view (self, _tmp4_); - _page_view_unref0 (_tmp4_); + _tmp1_ = *event; + _tmp2_ = _tmp1_.type; + if (_tmp2_ == GDK_BUTTON_PRESS) { + GdkEventButton _tmp3_; + gdouble _tmp4_; + gint _tmp5_ = 0; + GdkEventButton _tmp6_; + gdouble _tmp7_; + gint _tmp8_ = 0; + gint _tmp9_ = 0; + PageView* _tmp10_ = NULL; + PageView* _tmp11_; + _tmp3_ = *event; + _tmp4_ = _tmp3_.x; + _tmp5_ = book_view_get_x_offset (self); + _tmp6_ = *event; + _tmp7_ = _tmp6_.y; + _tmp10_ = book_view_get_page_at (self, (gint) (_tmp4_ + _tmp5_), (gint) _tmp7_, &_tmp8_, &_tmp9_); + x = _tmp8_; + y = _tmp9_; + _tmp11_ = _tmp10_; + book_view_select_page_view (self, _tmp11_); + _page_view_unref0 (_tmp11_); } - if (self->priv->selected_page == NULL) { + _tmp12_ = self->priv->selected_page; + if (_tmp12_ == NULL) { result = FALSE; return result; } - if ((*event).button == ((guint) 1)) { - if ((*event).type == GDK_BUTTON_PRESS) { - page_view_button_press (self->priv->selected_page, x, y); + _tmp13_ = *event; + _tmp14_ = _tmp13_.button; + if (_tmp14_ == ((guint) 1)) { + GdkEventButton _tmp15_; + GdkEventType _tmp16_; + _tmp15_ = *event; + _tmp16_ = _tmp15_.type; + if (_tmp16_ == GDK_BUTTON_PRESS) { + PageView* _tmp17_; + gint _tmp18_; + gint _tmp19_; + _tmp17_ = self->priv->selected_page; + _tmp18_ = x; + _tmp19_ = y; + page_view_button_press (_tmp17_, _tmp18_, _tmp19_); } else { - if ((*event).type == GDK_BUTTON_RELEASE) { - page_view_button_release (self->priv->selected_page, x, y); + GdkEventButton _tmp20_; + GdkEventType _tmp21_; + _tmp20_ = *event; + _tmp21_ = _tmp20_.type; + if (_tmp21_ == GDK_BUTTON_RELEASE) { + PageView* _tmp22_; + gint _tmp23_; + gint _tmp24_; + _tmp22_ = self->priv->selected_page; + _tmp23_ = x; + _tmp24_ = y; + page_view_button_release (_tmp22_, _tmp23_, _tmp24_); } else { - if ((*event).type == GDK_2BUTTON_PRESS) { - Page* _tmp5_ = NULL; - Page* _tmp6_; - _tmp5_ = book_view_get_selected (self); - _tmp6_ = _tmp5_; - g_signal_emit_by_name (self, "show-page", _tmp6_); - _page_unref0 (_tmp6_); + GdkEventButton _tmp25_; + GdkEventType _tmp26_; + _tmp25_ = *event; + _tmp26_ = _tmp25_.type; + if (_tmp26_ == GDK_2BUTTON_PRESS) { + Page* _tmp27_ = NULL; + Page* _tmp28_; + _tmp27_ = book_view_get_selected (self); + _tmp28_ = _tmp27_; + g_signal_emit_by_name (self, "show-page", _tmp28_); + _page_unref0 (_tmp28_); } } } } - if ((*event).button == ((guint) 3)) { + _tmp29_ = *event; + _tmp30_ = _tmp29_.button; + if (_tmp30_ == ((guint) 3)) { g_signal_emit_by_name (self, "show-menu"); } result = FALSE; @@ -1275,19 +1897,31 @@ static gboolean book_view_button_cb (BookView* self, GtkWidget* widget, GdkEvent static void book_view_set_cursor (BookView* self, GdkCursorType cursor) { GdkCursor* c = NULL; - GdkCursor* _tmp0_ = NULL; - GdkWindow* _tmp1_ = NULL; + GdkCursorType _tmp0_; + GdkCursorType _tmp1_; + GdkCursorType _tmp2_; + GdkCursorType _tmp3_; + GdkCursor* _tmp4_; + GtkWidget* _tmp5_; + GdkWindow* _tmp6_ = NULL; + GdkCursor* _tmp7_; g_return_if_fail (self != NULL); - if (self->priv->cursor == cursor) { + _tmp0_ = self->priv->cursor; + _tmp1_ = cursor; + if (_tmp0_ == _tmp1_) { _g_object_unref0 (c); return; } - self->priv->cursor = cursor; - _tmp0_ = gdk_cursor_new (cursor); + _tmp2_ = cursor; + self->priv->cursor = _tmp2_; + _tmp3_ = cursor; + _tmp4_ = gdk_cursor_new (_tmp3_); _g_object_unref0 (c); - c = _tmp0_; - _tmp1_ = gtk_widget_get_window (self->priv->drawing_area); - gdk_window_set_cursor (_tmp1_, c); + c = _tmp4_; + _tmp5_ = self->priv->drawing_area; + _tmp6_ = gtk_widget_get_window (_tmp5_); + _tmp7_ = c; + gdk_window_set_cursor (_tmp6_, _tmp7_); _g_object_unref0 (c); } @@ -1296,51 +1930,100 @@ static gboolean book_view_motion_cb (BookView* self, GtkWidget* widget, GdkEvent gboolean result = FALSE; GdkCursorType cursor; gboolean _tmp0_ = FALSE; + PageView* _tmp1_; + gboolean _tmp4_; + GdkCursorType _tmp33_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (widget != NULL, FALSE); + g_return_val_if_fail (event != NULL, FALSE); cursor = GDK_ARROW; - if (self->priv->selected_page != NULL) { - _tmp0_ = ((*event).state & GDK_BUTTON1_MASK) != 0; + _tmp1_ = self->priv->selected_page; + if (_tmp1_ != NULL) { + GdkEventMotion _tmp2_; + GdkModifierType _tmp3_; + _tmp2_ = *event; + _tmp3_ = _tmp2_.state; + _tmp0_ = (_tmp3_ & GDK_BUTTON1_MASK) != 0; } else { _tmp0_ = FALSE; } - if (_tmp0_) { - gint _tmp1_; - gint _tmp2_; + _tmp4_ = _tmp0_; + if (_tmp4_) { + GdkEventMotion _tmp5_; + gdouble _tmp6_; + gint _tmp7_ = 0; + PageView* _tmp8_; + gint _tmp9_ = 0; gint x; - gint _tmp3_; + GdkEventMotion _tmp10_; + gdouble _tmp11_; + PageView* _tmp12_; + gint _tmp13_ = 0; gint y; - GdkCursorType _tmp4_; - _tmp1_ = book_view_get_x_offset (self); - _tmp2_ = page_view_get_x_offset (self->priv->selected_page); - x = (gint) (((*event).x + _tmp1_) - _tmp2_); - _tmp3_ = page_view_get_y_offset (self->priv->selected_page); - y = (gint) ((*event).y - _tmp3_); - page_view_motion (self->priv->selected_page, x, y); - _tmp4_ = page_view_get_cursor (self->priv->selected_page); - cursor = _tmp4_; + PageView* _tmp14_; + gint _tmp15_; + gint _tmp16_; + PageView* _tmp17_; + GdkCursorType _tmp18_ = 0; + _tmp5_ = *event; + _tmp6_ = _tmp5_.x; + _tmp7_ = book_view_get_x_offset (self); + _tmp8_ = self->priv->selected_page; + _tmp9_ = page_view_get_x_offset (_tmp8_); + x = (gint) ((_tmp6_ + _tmp7_) - _tmp9_); + _tmp10_ = *event; + _tmp11_ = _tmp10_.y; + _tmp12_ = self->priv->selected_page; + _tmp13_ = page_view_get_y_offset (_tmp12_); + y = (gint) (_tmp11_ - _tmp13_); + _tmp14_ = self->priv->selected_page; + _tmp15_ = x; + _tmp16_ = y; + page_view_motion (_tmp14_, _tmp15_, _tmp16_); + _tmp17_ = self->priv->selected_page; + _tmp18_ = page_view_get_cursor (_tmp17_); + cursor = _tmp18_; } else { gint x = 0; gint y = 0; - gint _tmp5_; - gint _tmp6_; - gint _tmp7_; - PageView* _tmp8_ = NULL; + GdkEventMotion _tmp19_; + gdouble _tmp20_; + gint _tmp21_ = 0; + GdkEventMotion _tmp22_; + gdouble _tmp23_; + gint _tmp24_ = 0; + gint _tmp25_ = 0; + PageView* _tmp26_ = NULL; PageView* over_page; - _tmp5_ = book_view_get_x_offset (self); - _tmp8_ = book_view_get_page_at (self, (gint) ((*event).x + _tmp5_), (gint) (*event).y, &_tmp6_, &_tmp7_); - x = _tmp6_; - y = _tmp7_; - over_page = _tmp8_; - if (over_page != NULL) { - GdkCursorType _tmp9_; - page_view_motion (over_page, x, y); - _tmp9_ = page_view_get_cursor (over_page); - cursor = _tmp9_; + PageView* _tmp27_; + _tmp19_ = *event; + _tmp20_ = _tmp19_.x; + _tmp21_ = book_view_get_x_offset (self); + _tmp22_ = *event; + _tmp23_ = _tmp22_.y; + _tmp26_ = book_view_get_page_at (self, (gint) (_tmp20_ + _tmp21_), (gint) _tmp23_, &_tmp24_, &_tmp25_); + x = _tmp24_; + y = _tmp25_; + over_page = _tmp26_; + _tmp27_ = over_page; + if (_tmp27_ != NULL) { + PageView* _tmp28_; + gint _tmp29_; + gint _tmp30_; + PageView* _tmp31_; + GdkCursorType _tmp32_ = 0; + _tmp28_ = over_page; + _tmp29_ = x; + _tmp30_ = y; + page_view_motion (_tmp28_, _tmp29_, _tmp30_); + _tmp31_ = over_page; + _tmp32_ = page_view_get_cursor (_tmp31_); + cursor = _tmp32_; } _page_view_unref0 (over_page); } - book_view_set_cursor (self, cursor); + _tmp33_ = cursor; + book_view_set_cursor (self, _tmp33_); result = FALSE; return result; } @@ -1348,52 +2031,67 @@ static gboolean book_view_motion_cb (BookView* self, GtkWidget* widget, GdkEvent static gboolean book_view_key_cb (BookView* self, GtkWidget* widget, GdkEventKey* event) { gboolean result = FALSE; + GdkEventKey _tmp0_; + guint _tmp1_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (widget != NULL, FALSE); - switch ((*event).keyval) { + g_return_val_if_fail (event != NULL, FALSE); + _tmp0_ = *event; + _tmp1_ = _tmp0_.keyval; + switch (_tmp1_) { case 0xff50: { - Page* _tmp0_ = NULL; - Page* _tmp1_; - _tmp0_ = book_get_page (self->priv->book, 0); - _tmp1_ = _tmp0_; - book_view_select_page (self, _tmp1_); - _page_unref0 (_tmp1_); + Book* _tmp2_; + Page* _tmp3_ = NULL; + Page* _tmp4_; + _tmp2_ = self->priv->book; + _tmp3_ = book_get_page (_tmp2_, 0); + _tmp4_ = _tmp3_; + book_view_select_page (self, _tmp4_); + _page_unref0 (_tmp4_); result = TRUE; return result; } case 0xff51: { - PageView* _tmp2_ = NULL; - PageView* _tmp3_; - _tmp2_ = book_view_get_prev_page (self, self->priv->selected_page); - _tmp3_ = _tmp2_; - book_view_select_page_view (self, _tmp3_); - _page_view_unref0 (_tmp3_); + PageView* _tmp5_; + PageView* _tmp6_ = NULL; + PageView* _tmp7_; + _tmp5_ = self->priv->selected_page; + _tmp6_ = book_view_get_prev_page (self, _tmp5_); + _tmp7_ = _tmp6_; + book_view_select_page_view (self, _tmp7_); + _page_view_unref0 (_tmp7_); result = TRUE; return result; } case 0xff53: { - PageView* _tmp4_ = NULL; - PageView* _tmp5_; - _tmp4_ = book_view_get_next_page (self, self->priv->selected_page); - _tmp5_ = _tmp4_; - book_view_select_page_view (self, _tmp5_); - _page_view_unref0 (_tmp5_); + PageView* _tmp8_; + PageView* _tmp9_ = NULL; + PageView* _tmp10_; + _tmp8_ = self->priv->selected_page; + _tmp9_ = book_view_get_next_page (self, _tmp8_); + _tmp10_ = _tmp9_; + book_view_select_page_view (self, _tmp10_); + _page_view_unref0 (_tmp10_); result = TRUE; return result; } case 0xFF57: { - guint _tmp6_; - Page* _tmp7_ = NULL; - Page* _tmp8_; - _tmp6_ = book_get_n_pages (self->priv->book); - _tmp7_ = book_get_page (self->priv->book, ((gint) _tmp6_) - 1); - _tmp8_ = _tmp7_; - book_view_select_page (self, _tmp8_); - _page_unref0 (_tmp8_); + Book* _tmp11_; + Book* _tmp12_; + guint _tmp13_ = 0U; + Page* _tmp14_ = NULL; + Page* _tmp15_; + _tmp11_ = self->priv->book; + _tmp12_ = self->priv->book; + _tmp13_ = book_get_n_pages (_tmp12_); + _tmp14_ = book_get_page (_tmp11_, ((gint) _tmp13_) - 1); + _tmp15_ = _tmp14_; + book_view_select_page (self, _tmp15_); + _page_unref0 (_tmp15_); result = TRUE; return result; } @@ -1408,45 +2106,60 @@ static gboolean book_view_key_cb (BookView* self, GtkWidget* widget, GdkEventKey static gboolean book_view_focus_cb (BookView* self, GtkWidget* widget, GdkEventFocus* event) { gboolean result = FALSE; + PageView* _tmp0_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (widget != NULL, FALSE); - book_view_set_selected_page (self, self->priv->selected_page); + g_return_val_if_fail (event != NULL, FALSE); + _tmp0_ = self->priv->selected_page; + book_view_set_selected_page (self, _tmp0_); result = FALSE; return result; } static void book_view_scroll_cb (BookView* self, GtkAdjustment* adjustment) { + gboolean _tmp0_; g_return_if_fail (self != NULL); g_return_if_fail (adjustment != NULL); - if (!self->priv->laying_out) { + _tmp0_ = self->priv->laying_out; + if (!_tmp0_) { book_view_redraw (self); } } void book_view_redraw (BookView* self) { + GtkWidget* _tmp0_; g_return_if_fail (self != NULL); - gtk_widget_queue_draw (self->priv->drawing_area); + _tmp0_ = self->priv->drawing_area; + gtk_widget_queue_draw (_tmp0_); } void book_view_select_page (BookView* self, Page* page) { Page* _tmp0_ = NULL; Page* _tmp1_; - gboolean _tmp2_; + Page* _tmp2_; + gboolean _tmp3_; + Page* _tmp4_; g_return_if_fail (self != NULL); _tmp0_ = book_view_get_selected (self); _tmp1_ = _tmp0_; - _tmp2_ = _tmp1_ == page; + _tmp2_ = page; + _tmp3_ = _tmp1_ == _tmp2_; _page_unref0 (_tmp1_); - if (_tmp2_) { + if (_tmp3_) { return; } - if (page != NULL) { - gconstpointer _tmp3_ = NULL; - _tmp3_ = g_hash_table_lookup (self->priv->page_data, page); - book_view_select_page_view (self, (PageView*) _tmp3_); + _tmp4_ = page; + if (_tmp4_ != NULL) { + GHashTable* _tmp5_; + Page* _tmp6_; + gconstpointer _tmp7_ = NULL; + _tmp5_ = self->priv->page_data; + _tmp6_ = page; + _tmp7_ = g_hash_table_lookup (_tmp5_, _tmp6_); + book_view_select_page_view (self, (PageView*) _tmp7_); } else { book_view_select_page_view (self, NULL); } @@ -1454,34 +2167,42 @@ void book_view_select_page (BookView* self, Page* page) { void book_view_select_next_page (BookView* self) { - PageView* _tmp0_ = NULL; - PageView* _tmp1_; + PageView* _tmp0_; + PageView* _tmp1_ = NULL; + PageView* _tmp2_; g_return_if_fail (self != NULL); - _tmp0_ = book_view_get_next_page (self, self->priv->selected_page); - _tmp1_ = _tmp0_; - book_view_select_page_view (self, _tmp1_); - _page_view_unref0 (_tmp1_); + _tmp0_ = self->priv->selected_page; + _tmp1_ = book_view_get_next_page (self, _tmp0_); + _tmp2_ = _tmp1_; + book_view_select_page_view (self, _tmp2_); + _page_view_unref0 (_tmp2_); } void book_view_select_prev_page (BookView* self) { - PageView* _tmp0_ = NULL; - PageView* _tmp1_; + PageView* _tmp0_; + PageView* _tmp1_ = NULL; + PageView* _tmp2_; g_return_if_fail (self != NULL); - _tmp0_ = book_view_get_prev_page (self, self->priv->selected_page); - _tmp1_ = _tmp0_; - book_view_select_page_view (self, _tmp1_); - _page_view_unref0 (_tmp1_); + _tmp0_ = self->priv->selected_page; + _tmp1_ = book_view_get_prev_page (self, _tmp0_); + _tmp2_ = _tmp1_; + book_view_select_page_view (self, _tmp2_); + _page_view_unref0 (_tmp2_); } Page* book_view_get_selected (BookView* self) { Page* result = NULL; + PageView* _tmp0_; g_return_val_if_fail (self != NULL, NULL); - if (self->priv->selected_page != NULL) { - Page* _tmp0_ = NULL; - _tmp0_ = page_view_get_page (self->priv->selected_page); - result = _tmp0_; + _tmp0_ = self->priv->selected_page; + if (_tmp0_ != NULL) { + PageView* _tmp1_; + Page* _tmp2_ = NULL; + _tmp1_ = self->priv->selected_page; + _tmp2_ = page_view_get_page (_tmp1_); + result = _tmp2_; return result; } else { result = NULL; diff --git a/src/book.c b/src/book.c index 6b1b7b3..e7b4b52 100644 --- a/src/book.c +++ b/src/book.c @@ -1,4 +1,4 @@ -/* book.c generated by valac 0.13.1, the Vala compiler +/* book.c generated by valac 0.13.4, the Vala compiler * generated from book.vala, do not modify */ /* @@ -306,16 +306,24 @@ static gpointer _page_ref0 (gpointer self) { Page* book_append_page (Book* self, gint width, gint height, gint dpi, ScanDirection scan_direction) { Page* result = NULL; - Page* _tmp0_ = NULL; + gint _tmp0_; + gint _tmp1_; + gint _tmp2_; + ScanDirection _tmp3_; + Page* _tmp4_; Page* page; - Page* _tmp1_; + Page* _tmp5_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = page_new (width, height, dpi, scan_direction); - page = _tmp0_; + _tmp0_ = width; + _tmp1_ = height; + _tmp2_ = dpi; + _tmp3_ = scan_direction; + _tmp4_ = page_new (_tmp0_, _tmp1_, _tmp2_, _tmp3_); + page = _tmp4_; g_signal_connect (page, "pixels-changed", (GCallback) _book_page_changed_cb_page_pixels_changed, self); g_signal_connect (page, "crop-changed", (GCallback) _book_page_changed_cb_page_crop_changed, self); - _tmp1_ = _page_ref0 (page); - self->priv->pages = g_list_append (self->priv->pages, _tmp1_); + _tmp5_ = _page_ref0 (page); + self->priv->pages = g_list_append (self->priv->pages, _tmp5_); g_signal_emit_by_name (self, "page-added", page); book_set_needs_saving (self, TRUE); result = page; @@ -325,78 +333,116 @@ Page* book_append_page (Book* self, gint width, gint height, gint dpi, ScanDirec void book_move_page (Book* self, Page* page, guint location) { Page* _tmp0_; + Page* _tmp1_; + Page* _tmp2_; + guint _tmp3_; g_return_if_fail (self != NULL); g_return_if_fail (page != NULL); - self->priv->pages = g_list_remove (self->priv->pages, page); - _tmp0_ = _page_ref0 (page); - self->priv->pages = g_list_insert (self->priv->pages, _tmp0_, (gint) location); + _tmp0_ = page; + self->priv->pages = g_list_remove (self->priv->pages, _tmp0_); + _tmp1_ = page; + _tmp2_ = _page_ref0 (_tmp1_); + _tmp3_ = location; + self->priv->pages = g_list_insert (self->priv->pages, _tmp2_, (gint) _tmp3_); g_signal_emit_by_name (self, "reordered"); book_set_needs_saving (self, TRUE); } void book_delete_page (Book* self, Page* page) { - guint _tmp0_; - guint _tmp1_; + Page* _tmp0_; + guint _tmp1_ = 0U; + Page* _tmp2_; + guint _tmp3_ = 0U; + Page* _tmp4_; + Page* _tmp5_; g_return_if_fail (self != NULL); g_return_if_fail (page != NULL); - g_signal_parse_name ("pixels-changed", TYPE_PAGE, &_tmp0_, NULL, FALSE); - g_signal_handlers_disconnect_matched (page, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp0_, 0, NULL, (GCallback) _book_page_changed_cb_page_pixels_changed, self); - g_signal_parse_name ("crop-changed", TYPE_PAGE, &_tmp1_, NULL, FALSE); - g_signal_handlers_disconnect_matched (page, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _book_page_changed_cb_page_crop_changed, self); - g_signal_emit_by_name (self, "page-removed", page); - self->priv->pages = g_list_remove (self->priv->pages, page); + _tmp0_ = page; + g_signal_parse_name ("pixels-changed", TYPE_PAGE, &_tmp1_, NULL, FALSE); + g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _book_page_changed_cb_page_pixels_changed, self); + _tmp2_ = page; + g_signal_parse_name ("crop-changed", TYPE_PAGE, &_tmp3_, NULL, FALSE); + g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _book_page_changed_cb_page_crop_changed, self); + _tmp4_ = page; + g_signal_emit_by_name (self, "page-removed", _tmp4_); + _tmp5_ = page; + self->priv->pages = g_list_remove (self->priv->pages, _tmp5_); book_set_needs_saving (self, TRUE); } guint book_get_n_pages (Book* self) { guint result = 0U; - guint _tmp0_; + GList* _tmp0_; + guint _tmp1_ = 0U; g_return_val_if_fail (self != NULL, 0U); - _tmp0_ = g_list_length (self->priv->pages); - result = _tmp0_; + _tmp0_ = self->priv->pages; + _tmp1_ = g_list_length (_tmp0_); + result = _tmp1_; return result; } Page* book_get_page (Book* self, gint page_number) { Page* result = NULL; - gconstpointer _tmp1_ = NULL; - Page* _tmp2_; + gint _tmp0_; + GList* _tmp4_; + gint _tmp5_; + gconstpointer _tmp6_ = NULL; + Page* _tmp7_; g_return_val_if_fail (self != NULL, NULL); - if (page_number < 0) { - guint _tmp0_; - _tmp0_ = g_list_length (self->priv->pages); - page_number = ((gint) _tmp0_) + page_number; - } - _tmp1_ = g_list_nth_data (self->priv->pages, (guint) page_number); - _tmp2_ = _page_ref0 ((Page*) _tmp1_); - result = _tmp2_; + _tmp0_ = page_number; + if (_tmp0_ < 0) { + GList* _tmp1_; + guint _tmp2_ = 0U; + gint _tmp3_; + _tmp1_ = self->priv->pages; + _tmp2_ = g_list_length (_tmp1_); + _tmp3_ = page_number; + page_number = ((gint) _tmp2_) + _tmp3_; + } + _tmp4_ = self->priv->pages; + _tmp5_ = page_number; + _tmp6_ = g_list_nth_data (_tmp4_, (guint) _tmp5_); + _tmp7_ = _page_ref0 ((Page*) _tmp6_); + result = _tmp7_; return result; } guint book_get_page_index (Book* self, Page* page) { guint result = 0U; - gint _tmp0_; + GList* _tmp0_; + Page* _tmp1_; + gint _tmp2_ = 0; g_return_val_if_fail (self != NULL, 0U); g_return_val_if_fail (page != NULL, 0U); - _tmp0_ = g_list_index (self->priv->pages, page); - result = (guint) _tmp0_; + _tmp0_ = self->priv->pages; + _tmp1_ = page; + _tmp2_ = g_list_index (_tmp0_, _tmp1_); + result = (guint) _tmp2_; return result; } static gint string_last_index_of_char (const gchar* self, gunichar c, gint start_index) { gint result = 0; - gchar* _tmp0_ = NULL; + gint _tmp0_; + gunichar _tmp1_; + gchar* _tmp2_ = NULL; gchar* _result_; + gchar* _tmp3_; g_return_val_if_fail (self != NULL, 0); - _tmp0_ = g_utf8_strrchr (((gchar*) self) + start_index, (gssize) (-1), c); - _result_ = _tmp0_; - if (_result_ != NULL) { - result = (gint) (_result_ - ((gchar*) self)); + _tmp0_ = start_index; + _tmp1_ = c; + _tmp2_ = g_utf8_strrchr (((gchar*) self) + _tmp0_, (gssize) (-1), _tmp1_); + _result_ = _tmp2_; + _tmp3_ = _result_; + if (_tmp3_ != NULL) { + gchar* _tmp4_; + _tmp4_ = _result_; + result = (gint) (_tmp4_ - ((gchar*) self)); return result; } else { result = -1; @@ -408,90 +454,166 @@ static gint string_last_index_of_char (const gchar* self, gunichar c, gint start static gchar* string_slice (const gchar* self, glong start, glong end) { gchar* result = NULL; gint _tmp0_; + gint _tmp1_; glong string_length; - gboolean _tmp1_ = FALSE; - gboolean _tmp2_ = FALSE; - gchar* _tmp3_ = NULL; + glong _tmp2_; + glong _tmp5_; + gboolean _tmp8_ = FALSE; + glong _tmp9_; + gboolean _tmp12_; + gboolean _tmp13_ = FALSE; + glong _tmp14_; + gboolean _tmp17_; + glong _tmp18_; + glong _tmp19_; + glong _tmp20_; + glong _tmp21_; + glong _tmp22_; + gchar* _tmp23_ = NULL; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = strlen (self); - string_length = (glong) _tmp0_; - if (start < ((glong) 0)) { - start = string_length + start; - } - if (end < ((glong) 0)) { - end = string_length + end; - } - if (start >= ((glong) 0)) { - _tmp1_ = start <= string_length; + _tmp1_ = _tmp0_; + string_length = (glong) _tmp1_; + _tmp2_ = start; + if (_tmp2_ < ((glong) 0)) { + glong _tmp3_; + glong _tmp4_; + _tmp3_ = string_length; + _tmp4_ = start; + start = _tmp3_ + _tmp4_; + } + _tmp5_ = end; + if (_tmp5_ < ((glong) 0)) { + glong _tmp6_; + glong _tmp7_; + _tmp6_ = string_length; + _tmp7_ = end; + end = _tmp6_ + _tmp7_; + } + _tmp9_ = start; + if (_tmp9_ >= ((glong) 0)) { + glong _tmp10_; + glong _tmp11_; + _tmp10_ = start; + _tmp11_ = string_length; + _tmp8_ = _tmp10_ <= _tmp11_; } else { - _tmp1_ = FALSE; - } - g_return_val_if_fail (_tmp1_, NULL); - if (end >= ((glong) 0)) { - _tmp2_ = end <= string_length; + _tmp8_ = FALSE; + } + _tmp12_ = _tmp8_; + g_return_val_if_fail (_tmp12_, NULL); + _tmp14_ = end; + if (_tmp14_ >= ((glong) 0)) { + glong _tmp15_; + glong _tmp16_; + _tmp15_ = end; + _tmp16_ = string_length; + _tmp13_ = _tmp15_ <= _tmp16_; } else { - _tmp2_ = FALSE; - } - g_return_val_if_fail (_tmp2_, NULL); - g_return_val_if_fail (start <= end, NULL); - _tmp3_ = g_strndup (((gchar*) self) + start, (gsize) (end - start)); - result = _tmp3_; + _tmp13_ = FALSE; + } + _tmp17_ = _tmp13_; + g_return_val_if_fail (_tmp17_, NULL); + _tmp18_ = start; + _tmp19_ = end; + g_return_val_if_fail (_tmp18_ <= _tmp19_, NULL); + _tmp20_ = start; + _tmp21_ = end; + _tmp22_ = start; + _tmp23_ = g_strndup (((gchar*) self) + _tmp20_, (gsize) (_tmp21_ - _tmp22_)); + result = _tmp23_; return result; } static GFile* book_make_indexed_file (Book* self, const gchar* uri, gint i) { GFile* result = NULL; - gchar* _tmp1_ = NULL; + gint _tmp0_; + const gchar* _tmp3_; + gchar* _tmp4_ = NULL; gchar* basename; - gchar* _tmp2_; + const gchar* _tmp5_; + gchar* _tmp6_; gchar* prefix; - gchar* _tmp3_; + gchar* _tmp7_; gchar* suffix; - gint _tmp4_; + const gchar* _tmp8_; + gint _tmp9_ = 0; gint extension_index; - gchar* _tmp10_ = NULL; - gchar* _tmp11_; - GFile* _tmp12_ = NULL; - GFile* _tmp13_; + gint _tmp10_; + const gchar* _tmp25_; + gint _tmp26_; + const gchar* _tmp27_; + gchar* _tmp28_ = NULL; + gchar* _tmp29_; + GFile* _tmp30_ = NULL; + GFile* _tmp31_; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (uri != NULL, NULL); - if (i == 0) { - GFile* _tmp0_ = NULL; - _tmp0_ = g_file_new_for_uri (uri); - result = _tmp0_; + _tmp0_ = i; + if (_tmp0_ == 0) { + const gchar* _tmp1_; + GFile* _tmp2_ = NULL; + _tmp1_ = uri; + _tmp2_ = g_file_new_for_uri (_tmp1_); + result = _tmp2_; return result; } - _tmp1_ = g_path_get_basename (uri); - basename = _tmp1_; - _tmp2_ = g_strdup (uri); - prefix = _tmp2_; - _tmp3_ = g_strdup (""); - suffix = _tmp3_; - _tmp4_ = string_last_index_of_char (basename, (gunichar) '.', 0); - extension_index = _tmp4_; - if (extension_index >= 0) { - gint _tmp5_; - gchar* _tmp6_ = NULL; - gint _tmp7_; - gint _tmp8_; - gchar* _tmp9_ = NULL; - _tmp5_ = strlen (basename); - _tmp6_ = string_slice (basename, (glong) extension_index, (glong) _tmp5_); + _tmp3_ = uri; + _tmp4_ = g_path_get_basename (_tmp3_); + basename = _tmp4_; + _tmp5_ = uri; + _tmp6_ = g_strdup (_tmp5_); + prefix = _tmp6_; + _tmp7_ = g_strdup (""); + suffix = _tmp7_; + _tmp8_ = basename; + _tmp9_ = string_last_index_of_char (_tmp8_, (gunichar) '.', 0); + extension_index = _tmp9_; + _tmp10_ = extension_index; + if (_tmp10_ >= 0) { + const gchar* _tmp11_; + gint _tmp12_; + const gchar* _tmp13_; + gint _tmp14_; + gint _tmp15_; + gchar* _tmp16_ = NULL; + const gchar* _tmp17_; + const gchar* _tmp18_; + gint _tmp19_; + gint _tmp20_; + const gchar* _tmp21_; + gint _tmp22_; + gint _tmp23_; + gchar* _tmp24_ = NULL; + _tmp11_ = basename; + _tmp12_ = extension_index; + _tmp13_ = basename; + _tmp14_ = strlen (_tmp13_); + _tmp15_ = _tmp14_; + _tmp16_ = string_slice (_tmp11_, (glong) _tmp12_, (glong) _tmp15_); _g_free0 (suffix); - suffix = _tmp6_; - _tmp7_ = strlen (uri); - _tmp8_ = strlen (suffix); - _tmp9_ = string_slice (uri, (glong) 0, (glong) (_tmp7_ - _tmp8_)); + suffix = _tmp16_; + _tmp17_ = uri; + _tmp18_ = uri; + _tmp19_ = strlen (_tmp18_); + _tmp20_ = _tmp19_; + _tmp21_ = suffix; + _tmp22_ = strlen (_tmp21_); + _tmp23_ = _tmp22_; + _tmp24_ = string_slice (_tmp17_, (glong) 0, (glong) (_tmp20_ - _tmp23_)); _g_free0 (prefix); - prefix = _tmp9_; - } - _tmp10_ = g_strdup_printf ("%s-%d%s", prefix, i, suffix); - _tmp11_ = _tmp10_; - _tmp12_ = g_file_new_for_uri (_tmp11_); - _tmp13_ = _tmp12_; - _g_free0 (_tmp11_); - result = _tmp13_; + prefix = _tmp24_; + } + _tmp25_ = prefix; + _tmp26_ = i; + _tmp27_ = suffix; + _tmp28_ = g_strdup_printf ("%s-%d%s", _tmp25_, _tmp26_, _tmp27_); + _tmp29_ = _tmp28_; + _tmp30_ = g_file_new_for_uri (_tmp29_); + _tmp31_ = _tmp30_; + _g_free0 (_tmp29_); + result = _tmp31_; _g_free0 (suffix); _g_free0 (prefix); _g_free0 (basename); @@ -501,38 +623,50 @@ 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 = self->priv->pages; + page_collection = _tmp0_; for (page_it = page_collection; page_it != NULL; page_it = page_it->next) { - Page* _tmp0_; + Page* _tmp1_; Page* page = NULL; - _tmp0_ = _page_ref0 ((Page*) page_it->data); - page = _tmp0_; + _tmp1_ = _page_ref0 ((Page*) page_it->data); + page = _tmp1_; { - gchar* _tmp1_ = NULL; - gchar* _tmp2_; - GFile* _tmp3_ = NULL; + Page* _tmp2_; + const gchar* _tmp3_; GFile* _tmp4_; - _tmp1_ = g_file_get_uri (file); - _tmp2_ = _tmp1_; - _tmp3_ = book_make_indexed_file (self, _tmp2_, i); - _tmp4_ = _tmp3_; - page_save (page, type, _tmp4_, &_inner_error_); - _g_object_unref0 (_tmp4_); - _g_free0 (_tmp2_); + gchar* _tmp5_ = NULL; + gchar* _tmp6_; + gint _tmp7_; + GFile* _tmp8_ = NULL; + 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_); if (_inner_error_ != NULL) { g_propagate_error (error, _inner_error_); _page_unref0 (page); return; } - i++; + _tmp10_ = i; + i = _tmp10_ + 1; _page_unref0 (page); } } @@ -541,18 +675,26 @@ static void book_save_multi_file (Book* self, const gchar* type, GFile* file, GE static void book_save_ps_pdf_surface (Book* self, cairo_surface_t* surface, GdkPixbuf* image, gdouble dpi) { - cairo_t* _tmp0_ = NULL; + cairo_surface_t* _tmp0_; + cairo_t* _tmp1_; cairo_t* context; - cairo_pattern_t* _tmp1_ = NULL; + gdouble _tmp2_; + gdouble _tmp3_; + GdkPixbuf* _tmp4_; + cairo_pattern_t* _tmp5_ = NULL; g_return_if_fail (self != NULL); g_return_if_fail (surface != NULL); g_return_if_fail (image != NULL); - _tmp0_ = cairo_create (surface); - context = _tmp0_; - cairo_scale (context, 72.0 / dpi, 72.0 / dpi); - gdk_cairo_set_source_pixbuf (context, image, (gdouble) 0, (gdouble) 0); - _tmp1_ = cairo_get_source (context); - cairo_pattern_set_filter (_tmp1_, CAIRO_FILTER_BEST); + _tmp0_ = surface; + _tmp1_ = cairo_create (_tmp0_); + context = _tmp1_; + _tmp2_ = dpi; + _tmp3_ = dpi; + cairo_scale (context, 72.0 / _tmp2_, 72.0 / _tmp3_); + _tmp4_ = image; + gdk_cairo_set_source_pixbuf (context, _tmp4_, (gdouble) 0, (gdouble) 0); + _tmp5_ = cairo_get_source (context); + cairo_pattern_set_filter (_tmp5_, CAIRO_FILTER_BEST); cairo_paint (context); _cairo_destroy0 (context); } @@ -564,56 +706,88 @@ static gpointer _cairo_surface_reference0 (gpointer self) { static void book_save_ps (Book* self, GFile* file, GError** error) { - GFileOutputStream* _tmp0_ = NULL; + GFile* _tmp0_; + GFileOutputStream* _tmp1_ = NULL; GFileOutputStream* stream; - PsWriter* _tmp1_ = NULL; + PsWriter* _tmp2_; PsWriter* writer; - cairo_surface_t* _tmp2_; + PsWriter* _tmp3_; + 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); - _tmp0_ = g_file_replace (file, NULL, FALSE, G_FILE_CREATE_NONE, NULL, &_inner_error_); - stream = _tmp0_; + _tmp0_ = file; + _tmp1_ = g_file_replace (_tmp0_, NULL, FALSE, G_FILE_CREATE_NONE, NULL, &_inner_error_); + stream = _tmp1_; if (_inner_error_ != NULL) { g_propagate_error (error, _inner_error_); return; } - _tmp1_ = ps_writer_new (stream); - writer = _tmp1_; - _tmp2_ = _cairo_surface_reference0 (writer->surface); - surface = _tmp2_; + _tmp2_ = ps_writer_new (stream); + writer = _tmp2_; + _tmp3_ = writer; + _tmp4_ = _tmp3_->surface; + _tmp5_ = _cairo_surface_reference0 (_tmp4_); + surface = _tmp5_; + _tmp6_ = self->priv->pages; { GList* page_collection = NULL; GList* page_it = NULL; - page_collection = self->priv->pages; + page_collection = _tmp6_; for (page_it = page_collection; page_it != NULL; page_it = page_it->next) { - Page* _tmp3_; + Page* _tmp7_; Page* page = NULL; - _tmp3_ = _page_ref0 ((Page*) page_it->data); - page = _tmp3_; + _tmp7_ = _page_ref0 ((Page*) page_it->data); + page = _tmp7_; { - GdkPixbuf* _tmp4_ = NULL; + Page* _tmp8_; + GdkPixbuf* _tmp9_ = NULL; GdkPixbuf* image; - gint _tmp5_; - gint _tmp6_; + GdkPixbuf* _tmp10_; + gint _tmp11_ = 0; + Page* _tmp12_; + gint _tmp13_ = 0; gdouble width; - gint _tmp7_; - gint _tmp8_; + GdkPixbuf* _tmp14_; + gint _tmp15_ = 0; + Page* _tmp16_; + gint _tmp17_ = 0; gdouble height; - gint _tmp9_; - _tmp4_ = page_get_image (page, TRUE); - image = _tmp4_; - _tmp5_ = gdk_pixbuf_get_width (image); - _tmp6_ = page_get_dpi (page); - width = (_tmp5_ * 72.0) / _tmp6_; - _tmp7_ = gdk_pixbuf_get_height (image); - _tmp8_ = page_get_dpi (page); - height = (_tmp7_ * 72.0) / _tmp8_; - cairo_ps_surface_set_size (surface, width, height); - _tmp9_ = page_get_dpi (page); - book_save_ps_pdf_surface (self, surface, image, (gdouble) _tmp9_); - cairo_surface_show_page (surface); + 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_); _g_object_unref0 (image); _page_unref0 (page); } @@ -628,72 +802,109 @@ static void book_save_ps (Book* self, GFile* file, GError** error) { static guint8* book_compress_zlib (Book* self, guint8* data, int data_length1, int* result_length1) { guint8* result = NULL; z_stream stream = {0}; - guint8* _tmp0_ = NULL; + guint8* _tmp0_; + gint _tmp0__length1; + guint8* _tmp1_ = NULL; guint8* out_data; gint out_data_length1; gint _out_data_size_; + guint8* _tmp2_; + gint _tmp2__length1; + guint8* _tmp3_; + gint _tmp3__length1; + z_stream _tmp7_; + guint _tmp8_; + guint8* _tmp10_; + gint _tmp10__length1; + z_stream _tmp11_; + guint _tmp12_; guint n_written; - gint _tmp3_; - guint8* _tmp4_; + guint _tmp13_; + gint _tmp14_ = 0; + guint8* _tmp15_; + gint _tmp15__length1; g_return_val_if_fail (self != NULL, NULL); deflateInit (&stream, (gint) Z_BEST_COMPRESSION); - _tmp0_ = g_new0 (guint8, data_length1); - out_data = _tmp0_; - out_data_length1 = data_length1; + _tmp0_ = data; + _tmp0__length1 = data_length1; + _tmp1_ = g_new0 (guint8, _tmp0__length1); + out_data = _tmp1_; + out_data_length1 = _tmp0__length1; _out_data_size_ = out_data_length1; - stream.next_in = data; - stream.avail_in = data_length1; - stream.next_out = out_data; - stream.avail_out = out_data_length1; + _tmp2_ = data; + _tmp2__length1 = data_length1; + stream.next_in = _tmp2_; + stream.avail_in = _tmp2__length1; + _tmp3_ = out_data; + _tmp3__length1 = out_data_length1; + stream.next_out = _tmp3_; + stream.avail_out = _tmp3__length1; while (TRUE) { - gint _tmp1_; - if (!(stream.avail_in > ((guint) 0))) { + z_stream _tmp4_; + guint _tmp5_; + gint _tmp6_ = 0; + _tmp4_ = stream; + _tmp5_ = _tmp4_.avail_in; + if (!(_tmp5_ > ((guint) 0))) { break; } - _tmp1_ = deflate (&stream, (gint) Z_FINISH); - if (_tmp1_ == ((gint) Z_STREAM_ERROR)) { + _tmp6_ = deflate (&stream, (gint) Z_FINISH); + if (_tmp6_ == ((gint) Z_STREAM_ERROR)) { break; } } - if (stream.avail_in > ((guint) 0)) { - guint8* _tmp2_; - _tmp2_ = NULL; + _tmp7_ = stream; + _tmp8_ = _tmp7_.avail_in; + if (_tmp8_ > ((guint) 0)) { + guint8* _tmp9_; + gint _tmp9__length1; + _tmp9_ = NULL; + _tmp9__length1 = 0; if (result_length1) { - *result_length1 = 0; + *result_length1 = _tmp9__length1; } - result = _tmp2_; + result = _tmp9_; out_data = (g_free (out_data), NULL); deflateEnd (&stream); return result; } - n_written = data_length1 - stream.avail_out; - _tmp3_ = (gint) n_written; - out_data = g_renew (guint8, out_data, (gint) n_written); - (_tmp3_ > out_data_length1) ? memset (out_data + out_data_length1, 0, sizeof (guint8) * (_tmp3_ - out_data_length1)) : NULL; - out_data_length1 = _tmp3_; - _out_data_size_ = _tmp3_; - _tmp4_ = out_data; + _tmp10_ = data; + _tmp10__length1 = data_length1; + _tmp11_ = stream; + _tmp12_ = _tmp11_.avail_out; + n_written = _tmp10__length1 - _tmp12_; + _tmp13_ = n_written; + _tmp14_ = (gint) _tmp13_; + out_data = g_renew (guint8, out_data, (gint) _tmp13_); + (_tmp14_ > out_data_length1) ? memset (out_data + out_data_length1, 0, sizeof (guint8) * (_tmp14_ - out_data_length1)) : NULL; + out_data_length1 = _tmp14_; + _out_data_size_ = _tmp14_; + _tmp15_ = out_data; + _tmp15__length1 = out_data_length1; if (result_length1) { - *result_length1 = out_data_length1; + *result_length1 = _tmp15__length1; } - result = _tmp4_; + result = _tmp15_; deflateEnd (&stream); return result; } static void book_jpeg_init_cb (struct jpeg_compress_struct* info) { + g_return_if_fail (info != NULL); } static gboolean book_jpeg_empty_cb (struct jpeg_compress_struct* info) { gboolean result = FALSE; + g_return_val_if_fail (info != NULL, FALSE); result = TRUE; return result; } static void book_jpeg_term_cb (struct jpeg_compress_struct* info) { + g_return_if_fail (info != NULL); } @@ -715,24 +926,41 @@ static void _book_jpeg_term_cb_jpeg_termdestinationfunc (struct jpeg_compress_st static guint8* book_compress_jpeg (Book* self, GdkPixbuf* image, gsize* n_written, int* result_length1) { - gsize _n_written = 0UL; + gsize _vala_n_written = 0UL; guint8* result = NULL; struct jpeg_compress_struct info = {0}; struct jpeg_error_mgr jerr = {0}; struct jpeg_destination_mgr dest_mgr = {0}; struct jpeg_error_mgr* _tmp0_ = NULL; - gint _tmp1_; - gint _tmp2_; + GdkPixbuf* _tmp1_; + gint _tmp2_ = 0; + GdkPixbuf* _tmp3_; + gint _tmp4_ = 0; + struct jpeg_compress_struct _tmp5_; + gint _tmp6_; + struct jpeg_compress_struct _tmp7_; + gint _tmp8_; + struct jpeg_compress_struct _tmp9_; + gint _tmp10_; gint max_length; - guint8* _tmp3_ = NULL; + gint _tmp11_; + guint8* _tmp12_ = NULL; guint8* data; gint data_length1; gint _data_size_; - guint8* _tmp4_ = NULL; + guint8* _tmp13_; + gint _tmp13__length1; + gint _tmp14_; + GdkPixbuf* _tmp15_; + guint8* _tmp16_ = NULL; guint8* pixels; gint pixels_length1; gint _pixels_size_; - guint8* _tmp7_; + gint _tmp28_; + struct jpeg_destination_mgr _tmp29_; + gint _tmp30_; + guint8* _tmp31_; + gint _tmp31__length1; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (image != NULL, NULL); memset (&info, 0, sizeof (struct jpeg_compress_struct)); @@ -741,61 +969,98 @@ static guint8* book_compress_jpeg (Book* self, GdkPixbuf* image, gsize* n_writte _tmp0_ = jpeg_std_error (&jerr); info.err = _tmp0_; jpeg_create_compress (&info); - _tmp1_ = gdk_pixbuf_get_width (image); - info.image_width = _tmp1_; - _tmp2_ = gdk_pixbuf_get_height (image); - info.image_height = _tmp2_; + _tmp1_ = image; + _tmp2_ = gdk_pixbuf_get_width (_tmp1_); + info.image_width = _tmp2_; + _tmp3_ = image; + _tmp4_ = gdk_pixbuf_get_height (_tmp3_); + info.image_height = _tmp4_; info.input_components = 3; info.in_color_space = JCS_RGB; jpeg_set_defaults (&info); - max_length = (info.image_width * info.image_height) * info.input_components; - _tmp3_ = g_new0 (guint8, max_length); - data = _tmp3_; - data_length1 = max_length; + _tmp5_ = info; + _tmp6_ = _tmp5_.image_width; + _tmp7_ = info; + _tmp8_ = _tmp7_.image_height; + _tmp9_ = info; + _tmp10_ = _tmp9_.input_components; + max_length = (_tmp6_ * _tmp8_) * _tmp10_; + _tmp11_ = max_length; + _tmp12_ = g_new0 (guint8, _tmp11_); + data = _tmp12_; + data_length1 = _tmp11_; _data_size_ = data_length1; - dest_mgr.next_output_byte = data; - dest_mgr.free_in_buffer = max_length; + _tmp13_ = data; + _tmp13__length1 = data_length1; + dest_mgr.next_output_byte = _tmp13_; + _tmp14_ = max_length; + dest_mgr.free_in_buffer = _tmp14_; dest_mgr.init_destination = _book_jpeg_init_cb_jpeg_initdestinationfunc; dest_mgr.empty_output_buffer = _book_jpeg_empty_cb_jpeg_emptyoutputbufferfunc; dest_mgr.term_destination = _book_jpeg_term_cb_jpeg_termdestinationfunc; info.dest = &dest_mgr; jpeg_start_compress (&info, TRUE); - _tmp4_ = gdk_pixbuf_get_pixels (image); - pixels = _tmp4_; + _tmp15_ = image; + _tmp16_ = gdk_pixbuf_get_pixels (_tmp15_); + pixels = _tmp16_; pixels_length1 = -1; _pixels_size_ = pixels_length1; { gint r; r = 0; { - gboolean _tmp5_; - _tmp5_ = TRUE; + gboolean _tmp17_; + _tmp17_ = TRUE; while (TRUE) { + gboolean _tmp18_; + gint _tmp20_; + struct jpeg_compress_struct _tmp21_; + gint _tmp22_; guint8* row[1] = {0}; - gint _tmp6_; - if (!_tmp5_) { - r++; + guint8* _tmp23_; + gint _tmp23__length1; + gint _tmp24_; + GdkPixbuf* _tmp25_; + gint _tmp26_ = 0; + guint8* _tmp27_; + _tmp18_ = _tmp17_; + if (!_tmp18_) { + gint _tmp19_; + _tmp19_ = r; + r = _tmp19_ + 1; } - _tmp5_ = FALSE; - if (!(r < info.image_height)) { + _tmp17_ = FALSE; + _tmp20_ = r; + _tmp21_ = info; + _tmp22_ = _tmp21_.image_height; + if (!(_tmp20_ < _tmp22_)) { break; } - _tmp6_ = gdk_pixbuf_get_rowstride (image); - row[0] = ((guint8*) pixels) + (r * _tmp6_); + _tmp23_ = pixels; + _tmp23__length1 = pixels_length1; + _tmp24_ = r; + _tmp25_ = image; + _tmp26_ = gdk_pixbuf_get_rowstride (_tmp25_); + row[0] = ((guint8*) _tmp23_) + (_tmp24_ * _tmp26_); + _tmp27_ = row[0]; jpeg_write_scanlines (&info, row, 1); } } } jpeg_finish_compress (&info); - _n_written = (gsize) (max_length - dest_mgr.free_in_buffer); - _tmp7_ = data; + _tmp28_ = max_length; + _tmp29_ = dest_mgr; + _tmp30_ = _tmp29_.free_in_buffer; + _vala_n_written = (gsize) (_tmp28_ - _tmp30_); + _tmp31_ = data; + _tmp31__length1 = data_length1; if (result_length1) { - *result_length1 = data_length1; + *result_length1 = _tmp31__length1; } - result = _tmp7_; + result = _tmp31_; jpeg_destroy_compress (&info); if (n_written) { - *n_written = _n_written; + *n_written = _vala_n_written; } return result; } @@ -812,286 +1077,561 @@ static guint8* _vala_array_dup2 (guint8* self, int length) { static void book_save_pdf (Book* self, GFile* file, GError** error) { - GFileOutputStream* _tmp0_ = NULL; + GFile* _tmp0_; + GFileOutputStream* _tmp1_ = NULL; GFileOutputStream* stream; - PDFWriter* _tmp1_ = NULL; + PDFWriter* _tmp2_; PDFWriter* writer; - guint _tmp2_; + PDFWriter* _tmp3_; + PDFWriter* _tmp4_; + PDFWriter* _tmp5_; + guint _tmp6_ = 0U; guint catalog_number; - gchar* _tmp3_ = NULL; - gchar* _tmp4_; - gchar* _tmp5_ = NULL; - gchar* _tmp6_; - guint _tmp7_; - guint pages_number; - gchar* _tmp8_ = NULL; - gchar* _tmp9_; + PDFWriter* _tmp7_; + guint _tmp8_; + gchar* _tmp9_ = NULL; + gchar* _tmp10_; + PDFWriter* _tmp11_; + PDFWriter* _tmp12_; + PDFWriter* _tmp13_; guint _tmp14_; gchar* _tmp15_ = NULL; gchar* _tmp16_; - guint _tmp100_; + PDFWriter* _tmp17_; + PDFWriter* _tmp18_; + PDFWriter* _tmp19_; + PDFWriter* _tmp20_; + guint _tmp21_ = 0U; + guint pages_number; + PDFWriter* _tmp22_; + guint _tmp23_; + gchar* _tmp24_ = NULL; + gchar* _tmp25_; + PDFWriter* _tmp26_; + PDFWriter* _tmp27_; + PDFWriter* _tmp28_; + PDFWriter* _tmp39_; + PDFWriter* _tmp40_; + guint _tmp41_ = 0U; + gchar* _tmp42_ = NULL; + gchar* _tmp43_; + PDFWriter* _tmp44_; + PDFWriter* _tmp45_; + PDFWriter* _tmp359_; + PDFWriter* _tmp360_; + guint _tmp361_ = 0U; guint info_number; - gchar* _tmp101_ = NULL; - gchar* _tmp102_; - gchar* _tmp103_ = NULL; - gchar* _tmp104_; + PDFWriter* _tmp362_; + guint _tmp363_; + gchar* _tmp364_ = NULL; + gchar* _tmp365_; + PDFWriter* _tmp366_; + PDFWriter* _tmp367_; + gchar* _tmp368_ = NULL; + gchar* _tmp369_; + PDFWriter* _tmp370_; + PDFWriter* _tmp371_; + PDFWriter* _tmp372_; + gsize _tmp373_; gsize xref_offset; - guint _tmp105_; - gchar* _tmp106_ = NULL; - gchar* _tmp107_; - guint _tmp110_; - gchar* _tmp111_ = NULL; - gchar* _tmp112_; - gchar* _tmp113_ = NULL; - gchar* _tmp114_; - gchar* _tmp115_ = NULL; - gchar* _tmp116_; - gchar* _tmp117_ = NULL; - gchar* _tmp118_; + PDFWriter* _tmp374_; + PDFWriter* _tmp375_; + PDFWriter* _tmp376_; + GList* _tmp377_; + guint _tmp378_ = 0U; + gchar* _tmp379_ = NULL; + gchar* _tmp380_; + PDFWriter* _tmp381_; + GList* _tmp382_; + PDFWriter* _tmp387_; + PDFWriter* _tmp388_; + PDFWriter* _tmp389_; + PDFWriter* _tmp390_; + GList* _tmp391_; + guint _tmp392_ = 0U; + gchar* _tmp393_ = NULL; + gchar* _tmp394_; + PDFWriter* _tmp395_; + guint _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); - _tmp0_ = g_file_replace (file, NULL, FALSE, G_FILE_CREATE_NONE, NULL, &_inner_error_); - stream = _tmp0_; + _tmp0_ = file; + _tmp1_ = g_file_replace (_tmp0_, NULL, FALSE, G_FILE_CREATE_NONE, NULL, &_inner_error_); + stream = _tmp1_; if (_inner_error_ != NULL) { g_propagate_error (error, _inner_error_); return; } - _tmp1_ = pdf_writer_new (stream); - writer = _tmp1_; - pdf_writer_write_string (writer, "%PDF-1.3\n"); - pdf_writer_write_string (writer, "%\xe2\xe3\xcf\xd3\n"); - _tmp2_ = pdf_writer_start_object (writer); - catalog_number = _tmp2_; - _tmp3_ = g_strdup_printf ("%u 0 obj\n", catalog_number); - _tmp4_ = _tmp3_; - pdf_writer_write_string (writer, _tmp4_); - _g_free0 (_tmp4_); - pdf_writer_write_string (writer, "<<\n"); - pdf_writer_write_string (writer, "/Type /Catalog\n"); - _tmp5_ = g_strdup_printf ("/Pages %u 0 R\n", catalog_number + 1); - _tmp6_ = _tmp5_; - pdf_writer_write_string (writer, _tmp6_); - _g_free0 (_tmp6_); - pdf_writer_write_string (writer, ">>\n"); - pdf_writer_write_string (writer, "endobj\n"); - pdf_writer_write_string (writer, "\n"); - _tmp7_ = pdf_writer_start_object (writer); - pages_number = _tmp7_; - _tmp8_ = g_strdup_printf ("%u 0 obj\n", pages_number); - _tmp9_ = _tmp8_; - pdf_writer_write_string (writer, _tmp9_); - _g_free0 (_tmp9_); - pdf_writer_write_string (writer, "<<\n"); - pdf_writer_write_string (writer, "/Type /Pages\n"); - pdf_writer_write_string (writer, "/Kids ["); + _tmp2_ = pdf_writer_new (stream); + writer = _tmp2_; + _tmp3_ = writer; + pdf_writer_write_string (_tmp3_, "%PDF-1.3\n"); + _tmp4_ = writer; + pdf_writer_write_string (_tmp4_, "%\xe2\xe3\xcf\xd3\n"); + _tmp5_ = writer; + _tmp6_ = pdf_writer_start_object (_tmp5_); + catalog_number = _tmp6_; + _tmp7_ = writer; + _tmp8_ = catalog_number; + _tmp9_ = g_strdup_printf ("%u 0 obj\n", _tmp8_); + _tmp10_ = _tmp9_; + pdf_writer_write_string (_tmp7_, _tmp10_); + _g_free0 (_tmp10_); + _tmp11_ = writer; + pdf_writer_write_string (_tmp11_, "<<\n"); + _tmp12_ = writer; + pdf_writer_write_string (_tmp12_, "/Type /Catalog\n"); + _tmp13_ = writer; + _tmp14_ = catalog_number; + _tmp15_ = g_strdup_printf ("/Pages %u 0 R\n", _tmp14_ + 1); + _tmp16_ = _tmp15_; + pdf_writer_write_string (_tmp13_, _tmp16_); + _g_free0 (_tmp16_); + _tmp17_ = writer; + pdf_writer_write_string (_tmp17_, ">>\n"); + _tmp18_ = writer; + pdf_writer_write_string (_tmp18_, "endobj\n"); + _tmp19_ = writer; + pdf_writer_write_string (_tmp19_, "\n"); + _tmp20_ = writer; + _tmp21_ = pdf_writer_start_object (_tmp20_); + pages_number = _tmp21_; + _tmp22_ = writer; + _tmp23_ = pages_number; + _tmp24_ = g_strdup_printf ("%u 0 obj\n", _tmp23_); + _tmp25_ = _tmp24_; + pdf_writer_write_string (_tmp22_, _tmp25_); + _g_free0 (_tmp25_); + _tmp26_ = writer; + pdf_writer_write_string (_tmp26_, "<<\n"); + _tmp27_ = writer; + pdf_writer_write_string (_tmp27_, "/Type /Pages\n"); + _tmp28_ = writer; + pdf_writer_write_string (_tmp28_, "/Kids ["); { gint i; i = 0; { - gboolean _tmp10_; - _tmp10_ = TRUE; + gboolean _tmp29_; + _tmp29_ = TRUE; while (TRUE) { - guint _tmp11_; - gchar* _tmp12_ = NULL; - gchar* _tmp13_; - if (!_tmp10_) { - i++; + gboolean _tmp30_; + gint _tmp32_; + guint _tmp33_ = 0U; + PDFWriter* _tmp34_; + guint _tmp35_; + gint _tmp36_; + gchar* _tmp37_ = NULL; + gchar* _tmp38_; + _tmp30_ = _tmp29_; + if (!_tmp30_) { + gint _tmp31_; + _tmp31_ = i; + i = _tmp31_ + 1; } - _tmp10_ = FALSE; - _tmp11_ = book_get_n_pages (self); - if (!(((guint) i) < _tmp11_)) { + _tmp29_ = FALSE; + _tmp32_ = i; + _tmp33_ = book_get_n_pages (self); + if (!(((guint) _tmp32_) < _tmp33_)) { break; } - _tmp12_ = g_strdup_printf (" %u 0 R", (pages_number + 1) + (i * 3)); - _tmp13_ = _tmp12_; - pdf_writer_write_string (writer, _tmp13_); - _g_free0 (_tmp13_); + _tmp34_ = writer; + _tmp35_ = pages_number; + _tmp36_ = i; + _tmp37_ = g_strdup_printf (" %u 0 R", (_tmp35_ + 1) + (_tmp36_ * 3)); + _tmp38_ = _tmp37_; + pdf_writer_write_string (_tmp34_, _tmp38_); + _g_free0 (_tmp38_); } } } - pdf_writer_write_string (writer, " ]\n"); - _tmp14_ = book_get_n_pages (self); - _tmp15_ = g_strdup_printf ("/Count %u\n", _tmp14_); - _tmp16_ = _tmp15_; - pdf_writer_write_string (writer, _tmp16_); - _g_free0 (_tmp16_); - pdf_writer_write_string (writer, ">>\n"); - pdf_writer_write_string (writer, "endobj\n"); + _tmp39_ = writer; + pdf_writer_write_string (_tmp39_, " ]\n"); + _tmp40_ = writer; + _tmp41_ = book_get_n_pages (self); + _tmp42_ = g_strdup_printf ("/Count %u\n", _tmp41_); + _tmp43_ = _tmp42_; + pdf_writer_write_string (_tmp40_, _tmp43_); + _g_free0 (_tmp43_); + _tmp44_ = writer; + pdf_writer_write_string (_tmp44_, ">>\n"); + _tmp45_ = writer; + pdf_writer_write_string (_tmp45_, "endobj\n"); { gint i; i = 0; { - gboolean _tmp17_; - _tmp17_ = TRUE; + gboolean _tmp46_; + _tmp46_ = TRUE; while (TRUE) { - guint _tmp18_; - Page* _tmp19_ = NULL; + gboolean _tmp47_; + gint _tmp49_; + guint _tmp50_ = 0U; + gint _tmp51_; + Page* _tmp52_ = NULL; Page* page; - GdkPixbuf* _tmp20_ = NULL; + Page* _tmp53_; + GdkPixbuf* _tmp54_ = NULL; GdkPixbuf* image; - gint _tmp21_; + GdkPixbuf* _tmp55_; + gint _tmp56_ = 0; gint width; - gint _tmp22_; + GdkPixbuf* _tmp57_; + gint _tmp58_ = 0; gint height; - guint8* _tmp23_ = NULL; + GdkPixbuf* _tmp59_; + guint8* _tmp60_ = NULL; guint8* pixels; gint pixels_length1; gint _pixels_size_; - gint _tmp24_; + gint _tmp61_; + Page* _tmp62_; + gint _tmp63_ = 0; gdouble page_width; - gint _tmp25_; + gint _tmp64_; + Page* _tmp65_; + gint _tmp66_ = 0; gdouble page_height; gint depth; - gchar* _tmp26_; + gchar* _tmp67_; gchar* color_space; gchar* filter; - gchar* _tmp27_ = NULL; + gchar* _tmp68_ = NULL; gchar* width_buffer; gint width_buffer_length1; gint _width_buffer_size_; - gchar* _tmp28_ = NULL; + gchar* _tmp69_ = NULL; gchar* height_buffer; gint height_buffer_length1; gint _height_buffer_size_; guint8* data = NULL; gint data_length1 = 0; gint _data_size_ = 0; - gboolean _tmp29_; - gint _tmp52_; - guint8* _tmp53_ = NULL; + Page* _tmp70_; + gboolean _tmp71_ = FALSE; + guint8* _tmp237_; + gint _tmp237__length1; + gint _tmp238_ = 0; + guint8* _tmp239_ = NULL; guint8* compressed_data; gint compressed_data_length1; gint _compressed_data_size_; - guint _tmp63_; + guint8* _tmp240_; + gint _tmp240__length1; + PDFWriter* _tmp255_; + PDFWriter* _tmp256_; + guint _tmp257_ = 0U; guint number; - gchar* _tmp64_ = NULL; - gchar* _tmp65_; - gchar* _tmp66_ = NULL; - gchar* _tmp67_; - gchar* _tmp68_ = NULL; - gchar* _tmp69_; - const gchar* _tmp70_ = NULL; - const gchar* _tmp71_ = NULL; - gchar* _tmp72_ = NULL; - gchar* _tmp73_; - gchar* _tmp74_ = NULL; - gchar* _tmp75_; - guint _tmp76_; - gchar* _tmp77_ = NULL; - gchar* _tmp78_; - gchar* _tmp79_ = NULL; - gchar* _tmp80_; - gchar* _tmp81_ = NULL; - gchar* _tmp82_; - gchar* _tmp83_ = NULL; - gchar* _tmp84_; - gchar* _tmp85_ = NULL; - gchar* _tmp86_; - gchar* _tmp87_ = NULL; - gchar* _tmp88_; - const gchar* _tmp91_ = NULL; - const gchar* _tmp92_ = NULL; - gchar* _tmp93_ = NULL; + PDFWriter* _tmp258_; + guint _tmp259_; + gchar* _tmp260_ = NULL; + gchar* _tmp261_; + PDFWriter* _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_; + 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* _tmp286_; + PDFWriter* _tmp287_; + PDFWriter* _tmp288_; + PDFWriter* _tmp289_; + guint _tmp290_ = 0U; + PDFWriter* _tmp291_; + guint _tmp292_; + gchar* _tmp293_ = NULL; + gchar* _tmp294_; + PDFWriter* _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_; + 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* _tmp328_; + PDFWriter* _tmp329_; + gdouble _tmp330_; + gchar* _tmp331_; + gint _tmp331__length1; + const gchar* _tmp332_ = NULL; + gdouble _tmp333_; + gchar* _tmp334_; + gint _tmp334__length1; + const gchar* _tmp335_ = NULL; + gint _tmp336_; + gchar* _tmp337_ = NULL; gchar* command; - guint _tmp94_; - gchar* _tmp95_ = NULL; - gchar* _tmp96_; - gint _tmp97_; - gchar* _tmp98_ = NULL; - gchar* _tmp99_; - if (!_tmp17_) { - i++; + PDFWriter* _tmp338_; + PDFWriter* _tmp339_; + guint _tmp340_ = 0U; + PDFWriter* _tmp341_; + guint _tmp342_; + gchar* _tmp343_ = NULL; + gchar* _tmp344_; + PDFWriter* _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_; + _tmp47_ = _tmp46_; + if (!_tmp47_) { + gint _tmp48_; + _tmp48_ = i; + i = _tmp48_ + 1; } - _tmp17_ = FALSE; - _tmp18_ = book_get_n_pages (self); - if (!(((guint) i) < _tmp18_)) { + _tmp46_ = FALSE; + _tmp49_ = i; + _tmp50_ = book_get_n_pages (self); + if (!(((guint) _tmp49_) < _tmp50_)) { break; } - _tmp19_ = book_get_page (self, i); - page = _tmp19_; - _tmp20_ = page_get_image (page, TRUE); - image = _tmp20_; - _tmp21_ = gdk_pixbuf_get_width (image); - width = _tmp21_; - _tmp22_ = gdk_pixbuf_get_height (image); - height = _tmp22_; - _tmp23_ = gdk_pixbuf_get_pixels (image); - pixels = _tmp23_; + _tmp51_ = i; + _tmp52_ = book_get_page (self, _tmp51_); + page = _tmp52_; + _tmp53_ = page; + _tmp54_ = page_get_image (_tmp53_, TRUE); + image = _tmp54_; + _tmp55_ = image; + _tmp56_ = gdk_pixbuf_get_width (_tmp55_); + width = _tmp56_; + _tmp57_ = image; + _tmp58_ = gdk_pixbuf_get_height (_tmp57_); + height = _tmp58_; + _tmp59_ = image; + _tmp60_ = gdk_pixbuf_get_pixels (_tmp59_); + pixels = _tmp60_; pixels_length1 = -1; _pixels_size_ = pixels_length1; - _tmp24_ = page_get_dpi (page); - page_width = (width * 72.0) / _tmp24_; - _tmp25_ = page_get_dpi (page); - page_height = (height * 72.0) / _tmp25_; + _tmp61_ = width; + _tmp62_ = page; + _tmp63_ = page_get_dpi (_tmp62_); + page_width = (_tmp61_ * 72.0) / _tmp63_; + _tmp64_ = height; + _tmp65_ = page; + _tmp66_ = page_get_dpi (_tmp65_); + page_height = (_tmp64_ * 72.0) / _tmp66_; depth = 8; - _tmp26_ = g_strdup ("DeviceRGB"); - color_space = _tmp26_; + _tmp67_ = g_strdup ("DeviceRGB"); + color_space = _tmp67_; filter = NULL; - _tmp27_ = g_new0 (gchar, G_ASCII_DTOSTR_BUF_SIZE); - width_buffer = _tmp27_; + _tmp68_ = g_new0 (gchar, G_ASCII_DTOSTR_BUF_SIZE); + width_buffer = _tmp68_; width_buffer_length1 = G_ASCII_DTOSTR_BUF_SIZE; _width_buffer_size_ = width_buffer_length1; - _tmp28_ = g_new0 (gchar, G_ASCII_DTOSTR_BUF_SIZE); - height_buffer = _tmp28_; + _tmp69_ = g_new0 (gchar, G_ASCII_DTOSTR_BUF_SIZE); + height_buffer = _tmp69_; height_buffer_length1 = G_ASCII_DTOSTR_BUF_SIZE; _height_buffer_size_ = height_buffer_length1; - _tmp29_ = page_is_color (page); - if (_tmp29_) { - gchar* _tmp30_; + _tmp70_ = page; + _tmp71_ = page_is_color (_tmp70_); + if (_tmp71_) { + gchar* _tmp72_; + gint _tmp73_; + gint _tmp74_; gint data_length; - guint8* _tmp31_ = NULL; + gint _tmp75_; + guint8* _tmp76_ = NULL; depth = 8; - _tmp30_ = g_strdup ("DeviceRGB"); + _tmp72_ = g_strdup ("DeviceRGB"); _g_free0 (color_space); - color_space = _tmp30_; - data_length = ((height * width) * 3) + 1; - _tmp31_ = g_new0 (guint8, data_length); + color_space = _tmp72_; + _tmp73_ = height; + _tmp74_ = width; + data_length = ((_tmp73_ * _tmp74_) * 3) + 1; + _tmp75_ = data_length; + _tmp76_ = g_new0 (guint8, _tmp75_); data = (g_free (data), NULL); - data = _tmp31_; - data_length1 = data_length; + data = _tmp76_; + data_length1 = _tmp75_; _data_size_ = data_length1; { gint row; row = 0; { - gboolean _tmp32_; - _tmp32_ = TRUE; + gboolean _tmp77_; + _tmp77_ = TRUE; while (TRUE) { - gint _tmp33_; + gboolean _tmp78_; + gint _tmp80_; + gint _tmp81_; + gint _tmp82_; + GdkPixbuf* _tmp83_; + gint _tmp84_ = 0; gint in_offset; + gint _tmp85_; + gint _tmp86_; gint out_offset; - if (!_tmp32_) { - row++; + _tmp78_ = _tmp77_; + if (!_tmp78_) { + gint _tmp79_; + _tmp79_ = row; + row = _tmp79_ + 1; } - _tmp32_ = FALSE; - if (!(row < height)) { + _tmp77_ = FALSE; + _tmp80_ = row; + _tmp81_ = height; + if (!(_tmp80_ < _tmp81_)) { break; } - _tmp33_ = gdk_pixbuf_get_rowstride (image); - in_offset = row * _tmp33_; - out_offset = (row * width) * 3; + _tmp82_ = row; + _tmp83_ = image; + _tmp84_ = gdk_pixbuf_get_rowstride (_tmp83_); + in_offset = _tmp82_ * _tmp84_; + _tmp85_ = row; + _tmp86_ = width; + out_offset = (_tmp85_ * _tmp86_) * 3; { gint x; x = 0; { - gboolean _tmp34_; - _tmp34_ = TRUE; + gboolean _tmp87_; + _tmp87_ = TRUE; while (TRUE) { + gboolean _tmp88_; + gint _tmp90_; + gint _tmp91_; + gint _tmp92_; + gint _tmp93_; gint in_o; + gint _tmp94_; + gint _tmp95_; gint out_o; - if (!_tmp34_) { - x++; + guint8* _tmp96_; + gint _tmp96__length1; + gint _tmp97_; + guint8* _tmp98_; + gint _tmp98__length1; + gint _tmp99_; + guint8 _tmp100_; + guint8 _tmp101_; + guint8* _tmp102_; + gint _tmp102__length1; + gint _tmp103_; + guint8* _tmp104_; + gint _tmp104__length1; + gint _tmp105_; + guint8 _tmp106_; + guint8 _tmp107_; + guint8* _tmp108_; + gint _tmp108__length1; + gint _tmp109_; + guint8* _tmp110_; + gint _tmp110__length1; + gint _tmp111_; + guint8 _tmp112_; + guint8 _tmp113_; + _tmp88_ = _tmp87_; + if (!_tmp88_) { + gint _tmp89_; + _tmp89_ = x; + x = _tmp89_ + 1; } - _tmp34_ = FALSE; - if (!(x < width)) { + _tmp87_ = FALSE; + _tmp90_ = x; + _tmp91_ = width; + if (!(_tmp90_ < _tmp91_)) { break; } - in_o = in_offset + (x * 3); - out_o = out_offset + (x * 3); - data[out_o] = pixels[in_o]; - data[out_o + 1] = pixels[in_o + 1]; - data[out_o + 2] = pixels[in_o + 2]; + _tmp92_ = in_offset; + _tmp93_ = x; + in_o = _tmp92_ + (_tmp93_ * 3); + _tmp94_ = out_offset; + _tmp95_ = x; + out_o = _tmp94_ + (_tmp95_ * 3); + _tmp96_ = data; + _tmp96__length1 = data_length1; + _tmp97_ = out_o; + _tmp98_ = pixels; + _tmp98__length1 = pixels_length1; + _tmp99_ = in_o; + _tmp100_ = _tmp98_[_tmp99_]; + _tmp96_[_tmp97_] = _tmp100_; + _tmp101_ = _tmp96_[_tmp97_]; + _tmp102_ = data; + _tmp102__length1 = data_length1; + _tmp103_ = out_o; + _tmp104_ = pixels; + _tmp104__length1 = pixels_length1; + _tmp105_ = in_o; + _tmp106_ = _tmp104_[_tmp105_ + 1]; + _tmp102_[_tmp103_ + 1] = _tmp106_; + _tmp107_ = _tmp102_[_tmp103_ + 1]; + _tmp108_ = data; + _tmp108__length1 = data_length1; + _tmp109_ = out_o; + _tmp110_ = pixels; + _tmp110__length1 = pixels_length1; + _tmp111_ = in_o; + _tmp112_ = _tmp110_[_tmp111_ + 2]; + _tmp108_[_tmp109_ + 2] = _tmp112_; + _tmp113_ = _tmp108_[_tmp109_ + 2]; } } } @@ -1099,83 +1639,191 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) { } } } else { - gint _tmp35_; - _tmp35_ = page_get_depth (page); - if (_tmp35_ == 2) { + Page* _tmp114_; + gint _tmp115_ = 0; + _tmp114_ = page; + _tmp115_ = page_get_depth (_tmp114_); + if (_tmp115_ == 2) { gint shift_count; - gchar* _tmp36_; + gchar* _tmp116_; + gint _tmp117_; + gint _tmp118_; gint data_length; - guint8* _tmp37_ = NULL; + gint _tmp119_; + guint8* _tmp120_ = NULL; gint offset; + guint8* _tmp121_; + gint _tmp121__length1; + gint _tmp122_; + guint8 _tmp123_; shift_count = 6; depth = 2; - _tmp36_ = g_strdup ("DeviceGray"); + _tmp116_ = g_strdup ("DeviceGray"); _g_free0 (color_space); - color_space = _tmp36_; - data_length = height * (((width * 2) + 7) / 8); - _tmp37_ = g_new0 (guint8, data_length); + color_space = _tmp116_; + _tmp117_ = height; + _tmp118_ = width; + data_length = _tmp117_ * (((_tmp118_ * 2) + 7) / 8); + _tmp119_ = data_length; + _tmp120_ = g_new0 (guint8, _tmp119_); data = (g_free (data), NULL); - data = _tmp37_; - data_length1 = data_length; + data = _tmp120_; + data_length1 = _tmp119_; _data_size_ = data_length1; offset = 0; - data[offset] = (guint8) 0; + _tmp121_ = data; + _tmp121__length1 = data_length1; + _tmp122_ = offset; + _tmp121_[_tmp122_] = (guint8) 0; + _tmp123_ = _tmp121_[_tmp122_]; { gint row; row = 0; { - gboolean _tmp38_; - _tmp38_ = TRUE; + gboolean _tmp124_; + _tmp124_ = TRUE; while (TRUE) { - gint _tmp39_; + gboolean _tmp125_; + gint _tmp127_; + gint _tmp128_; + gint _tmp129_; + gint _tmp134_; + GdkPixbuf* _tmp135_; + gint _tmp136_ = 0; gint in_offset; - if (!_tmp38_) { - row++; + _tmp125_ = _tmp124_; + if (!_tmp125_) { + gint _tmp126_; + _tmp126_ = row; + row = _tmp126_ + 1; } - _tmp38_ = FALSE; - if (!(row < height)) { + _tmp124_ = FALSE; + _tmp127_ = row; + _tmp128_ = height; + if (!(_tmp127_ < _tmp128_)) { break; } - if (shift_count != 6) { - offset++; - data[offset] = (guint8) 0; + _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_]; shift_count = 6; } - _tmp39_ = gdk_pixbuf_get_rowstride (image); - in_offset = row * _tmp39_; + _tmp134_ = row; + _tmp135_ = image; + _tmp136_ = gdk_pixbuf_get_rowstride (_tmp135_); + in_offset = _tmp134_ * _tmp136_; { gint x; x = 0; { - gboolean _tmp40_; - _tmp40_ = TRUE; + gboolean _tmp137_; + _tmp137_ = TRUE; while (TRUE) { + gboolean _tmp138_; + gint _tmp140_; + gint _tmp141_; + guint8* _tmp142_; + gint _tmp142__length1; + gint _tmp143_; + gint _tmp144_; + guint8 _tmp145_; guint8 p; - if (!_tmp40_) { - x++; + guint8 _tmp146_; + gint _tmp161_; + _tmp138_ = _tmp137_; + if (!_tmp138_) { + gint _tmp139_; + _tmp139_ = x; + x = _tmp139_ + 1; } - _tmp40_ = FALSE; - if (!(x < width)) { + _tmp137_ = FALSE; + _tmp140_ = x; + _tmp141_ = width; + if (!(_tmp140_ < _tmp141_)) { break; } - p = pixels[in_offset + (x * 3)]; - if (((gint) p) >= 192) { - data[offset] |= (guint8) (3 << shift_count); + _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_]; } else { - if (((gint) p) >= 128) { - data[offset] |= (guint8) (2 << shift_count); + 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_]; } else { - if (((gint) p) >= 64) { - data[offset] |= (guint8) (1 << shift_count); + 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_]; } } } - if (shift_count == 0) { - offset++; - data[offset] = (guint8) 0; + _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_]; shift_count = 6; } else { - shift_count = shift_count - 2; + gint _tmp166_; + _tmp166_ = shift_count; + shift_count = _tmp166_ - 2; } } } @@ -1184,71 +1832,153 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) { } } } else { - gint _tmp41_; - _tmp41_ = page_get_depth (page); - if (_tmp41_ == 1) { + Page* _tmp167_; + gint _tmp168_ = 0; + _tmp167_ = page; + _tmp168_ = page_get_depth (_tmp167_); + if (_tmp168_ == 1) { gint mask; - gchar* _tmp42_; + gchar* _tmp169_; + gint _tmp170_; + gint _tmp171_; gint data_length; - guint8* _tmp43_ = NULL; + gint _tmp172_; + guint8* _tmp173_ = NULL; gint offset; + guint8* _tmp174_; + gint _tmp174__length1; + gint _tmp175_; + guint8 _tmp176_; mask = 0x80; depth = 1; - _tmp42_ = g_strdup ("DeviceGray"); + _tmp169_ = g_strdup ("DeviceGray"); _g_free0 (color_space); - color_space = _tmp42_; - data_length = height * ((width + 7) / 8); - _tmp43_ = g_new0 (guint8, data_length); + color_space = _tmp169_; + _tmp170_ = height; + _tmp171_ = width; + data_length = _tmp170_ * ((_tmp171_ + 7) / 8); + _tmp172_ = data_length; + _tmp173_ = g_new0 (guint8, _tmp172_); data = (g_free (data), NULL); - data = _tmp43_; - data_length1 = data_length; + data = _tmp173_; + data_length1 = _tmp172_; _data_size_ = data_length1; offset = 0; - data[offset] = (guint8) 0; + _tmp174_ = data; + _tmp174__length1 = data_length1; + _tmp175_ = offset; + _tmp174_[_tmp175_] = (guint8) 0; + _tmp176_ = _tmp174_[_tmp175_]; { gint row; row = 0; { - gboolean _tmp44_; - _tmp44_ = TRUE; + gboolean _tmp177_; + _tmp177_ = TRUE; while (TRUE) { - gint _tmp45_; + gboolean _tmp178_; + gint _tmp180_; + gint _tmp181_; + gint _tmp182_; + gint _tmp187_; + GdkPixbuf* _tmp188_; + gint _tmp189_ = 0; gint in_offset; - if (!_tmp44_) { - row++; + _tmp178_ = _tmp177_; + if (!_tmp178_) { + gint _tmp179_; + _tmp179_ = row; + row = _tmp179_ + 1; } - _tmp44_ = FALSE; - if (!(row < height)) { + _tmp177_ = FALSE; + _tmp180_ = row; + _tmp181_ = height; + if (!(_tmp180_ < _tmp181_)) { break; } - if (mask != 0x80) { - offset++; - data[offset] = (guint8) 0; + _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_]; mask = 0x80; } - _tmp45_ = gdk_pixbuf_get_rowstride (image); - in_offset = row * _tmp45_; + _tmp187_ = row; + _tmp188_ = image; + _tmp189_ = gdk_pixbuf_get_rowstride (_tmp188_); + in_offset = _tmp187_ * _tmp189_; { gint x; x = 0; { - gboolean _tmp46_; - _tmp46_ = TRUE; + gboolean _tmp190_; + _tmp190_ = TRUE; while (TRUE) { - if (!_tmp46_) { - x++; + gboolean _tmp191_; + gint _tmp193_; + gint _tmp194_; + guint8* _tmp195_; + gint _tmp195__length1; + gint _tmp196_; + gint _tmp197_; + guint8 _tmp198_; + gint _tmp203_; + gint _tmp204_; + _tmp191_ = _tmp190_; + if (!_tmp191_) { + gint _tmp192_; + _tmp192_ = x; + x = _tmp192_ + 1; } - _tmp46_ = FALSE; - if (!(x < width)) { + _tmp190_ = FALSE; + _tmp193_ = x; + _tmp194_ = width; + if (!(_tmp193_ < _tmp194_)) { break; } - if (((gint) pixels[in_offset + (x * 3)]) != 0) { - data[offset] |= (guint8) mask; + _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_]; } - mask = mask >> 1; - if (mask == 0) { - offset++; - data[offset] = (guint8) 0; + _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_]; mask = 0x80; } } @@ -1258,54 +1988,104 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) { } } } else { - gchar* _tmp47_; + gchar* _tmp209_; + gint _tmp210_; + gint _tmp211_; gint data_length; - guint8* _tmp48_ = NULL; + gint _tmp212_; + guint8* _tmp213_ = NULL; depth = 8; - _tmp47_ = g_strdup ("DeviceGray"); + _tmp209_ = g_strdup ("DeviceGray"); _g_free0 (color_space); - color_space = _tmp47_; - data_length = (height * width) + 1; - _tmp48_ = g_new0 (guint8, data_length); + color_space = _tmp209_; + _tmp210_ = height; + _tmp211_ = width; + data_length = (_tmp210_ * _tmp211_) + 1; + _tmp212_ = data_length; + _tmp213_ = g_new0 (guint8, _tmp212_); data = (g_free (data), NULL); - data = _tmp48_; - data_length1 = data_length; + data = _tmp213_; + data_length1 = _tmp212_; _data_size_ = data_length1; { gint row; row = 0; { - gboolean _tmp49_; - _tmp49_ = TRUE; + gboolean _tmp214_; + _tmp214_ = TRUE; while (TRUE) { - gint _tmp50_; + gboolean _tmp215_; + gint _tmp217_; + gint _tmp218_; + gint _tmp219_; + GdkPixbuf* _tmp220_; + gint _tmp221_ = 0; gint in_offset; + gint _tmp222_; + gint _tmp223_; gint out_offset; - if (!_tmp49_) { - row++; + _tmp215_ = _tmp214_; + if (!_tmp215_) { + gint _tmp216_; + _tmp216_ = row; + row = _tmp216_ + 1; } - _tmp49_ = FALSE; - if (!(row < height)) { + _tmp214_ = FALSE; + _tmp217_ = row; + _tmp218_ = height; + if (!(_tmp217_ < _tmp218_)) { break; } - _tmp50_ = gdk_pixbuf_get_rowstride (image); - in_offset = row * _tmp50_; - out_offset = row * width; + _tmp219_ = row; + _tmp220_ = image; + _tmp221_ = gdk_pixbuf_get_rowstride (_tmp220_); + in_offset = _tmp219_ * _tmp221_; + _tmp222_ = row; + _tmp223_ = width; + out_offset = _tmp222_ * _tmp223_; { gint x; x = 0; { - gboolean _tmp51_; - _tmp51_ = TRUE; + gboolean _tmp224_; + _tmp224_ = TRUE; while (TRUE) { - if (!_tmp51_) { - x++; + 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; } - _tmp51_ = FALSE; - if (!(x < width)) { + _tmp224_ = FALSE; + _tmp227_ = x; + _tmp228_ = width; + if (!(_tmp227_ < _tmp228_)) { break; } - data[out_offset + x] = pixels[in_offset + (x * 3)]; + _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_]; } } } @@ -1315,149 +2095,250 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) { } } } - _tmp53_ = book_compress_zlib (self, data, data_length1, &_tmp52_); - compressed_data = _tmp53_; - compressed_data_length1 = _tmp52_; + _tmp237_ = data; + _tmp237__length1 = data_length1; + _tmp239_ = book_compress_zlib (self, _tmp237_, _tmp237__length1, &_tmp238_); + compressed_data = _tmp239_; + compressed_data_length1 = _tmp238_; _compressed_data_size_ = compressed_data_length1; - if (compressed_data != NULL) { - if (depth > 1) { + _tmp240_ = compressed_data; + _tmp240__length1 = compressed_data_length1; + if (_tmp240_ != NULL) { + gint _tmp241_; + const gchar* _tmp251_; + _tmp241_ = depth; + if (_tmp241_ > 1) { gsize jpeg_length = 0UL; - gsize _tmp54_; - gint _tmp55_; - guint8* _tmp56_ = NULL; + GdkPixbuf* _tmp242_; + gsize _tmp243_ = 0UL; + gint _tmp244_ = 0; + guint8* _tmp245_ = NULL; guint8* jpeg_data; gint jpeg_data_length1; gint _jpeg_data_size_; - _tmp56_ = book_compress_jpeg (self, image, &_tmp54_, &_tmp55_); - jpeg_length = _tmp54_; - jpeg_data = _tmp56_; - jpeg_data_length1 = _tmp55_; + 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_; _jpeg_data_size_ = jpeg_data_length1; - if (jpeg_length < ((gsize) compressed_data_length1)) { - gchar* _tmp57_; - guint8* _tmp58_; - guint8* _tmp59_; - _tmp57_ = g_strdup ("DCTDecode"); + _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"); _g_free0 (filter); - filter = _tmp57_; - _tmp59_ = (_tmp58_ = jpeg_data, (_tmp58_ == NULL) ? ((gpointer) _tmp58_) : _vala_array_dup1 (_tmp58_, jpeg_data_length1)); + 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; data = (g_free (data), NULL); - data = _tmp59_; - data_length1 = jpeg_data_length1; + data = _tmp250_; + data_length1 = _tmp250__length1; _data_size_ = data_length1; } jpeg_data = (g_free (jpeg_data), NULL); } - if (filter == NULL) { - gchar* _tmp60_; - guint8* _tmp61_; - guint8* _tmp62_; - _tmp60_ = g_strdup ("FlateDecode"); + _tmp251_ = filter; + if (_tmp251_ == NULL) { + gchar* _tmp252_; + guint8* _tmp253_; + gint _tmp253__length1; + guint8* _tmp254_; + gint _tmp254__length1; + _tmp252_ = g_strdup ("FlateDecode"); _g_free0 (filter); - filter = _tmp60_; - _tmp62_ = (_tmp61_ = compressed_data, (_tmp61_ == NULL) ? ((gpointer) _tmp61_) : _vala_array_dup2 (_tmp61_, compressed_data_length1)); + 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; data = (g_free (data), NULL); - data = _tmp62_; - data_length1 = compressed_data_length1; + data = _tmp254_; + data_length1 = _tmp254__length1; _data_size_ = data_length1; } } - pdf_writer_write_string (writer, "\n"); - _tmp63_ = pdf_writer_start_object (writer); - number = _tmp63_; - _tmp64_ = g_strdup_printf ("%u 0 obj\n", number); - _tmp65_ = _tmp64_; - pdf_writer_write_string (writer, _tmp65_); - _g_free0 (_tmp65_); - pdf_writer_write_string (writer, "<<\n"); - pdf_writer_write_string (writer, "/Type /Page\n"); - _tmp66_ = g_strdup_printf ("/Parent %u 0 R\n", pages_number); - _tmp67_ = _tmp66_; - pdf_writer_write_string (writer, _tmp67_); - _g_free0 (_tmp67_); - _tmp68_ = g_strdup_printf ("/Resources << /XObject << /Im%d %u 0 R >> >>\n", i, number + 1); - _tmp69_ = _tmp68_; - pdf_writer_write_string (writer, _tmp69_); - _g_free0 (_tmp69_); - _tmp70_ = g_ascii_formatd (width_buffer, width_buffer_length1, "%.2f", page_width); - _tmp71_ = g_ascii_formatd (height_buffer, height_buffer_length1, "%.2f", page_height); - _tmp72_ = g_strdup_printf ("/MediaBox [ 0 0 %s %s ]\n", _tmp70_, _tmp71_); - _tmp73_ = _tmp72_; - pdf_writer_write_string (writer, _tmp73_); - _g_free0 (_tmp73_); - _tmp74_ = g_strdup_printf ("/Contents %u 0 R\n", number + 2); - _tmp75_ = _tmp74_; - pdf_writer_write_string (writer, _tmp75_); - _g_free0 (_tmp75_); - pdf_writer_write_string (writer, ">>\n"); - pdf_writer_write_string (writer, "endobj\n"); - pdf_writer_write_string (writer, "\n"); - _tmp76_ = pdf_writer_start_object (writer); - number = _tmp76_; - _tmp77_ = g_strdup_printf ("%u 0 obj\n", number); - _tmp78_ = _tmp77_; - pdf_writer_write_string (writer, _tmp78_); - _g_free0 (_tmp78_); - pdf_writer_write_string (writer, "<<\n"); - pdf_writer_write_string (writer, "/Type /XObject\n"); - pdf_writer_write_string (writer, "/Subtype /Image\n"); - _tmp79_ = g_strdup_printf ("/Width %d\n", width); - _tmp80_ = _tmp79_; - pdf_writer_write_string (writer, _tmp80_); - _g_free0 (_tmp80_); - _tmp81_ = g_strdup_printf ("/Height %d\n", height); - _tmp82_ = _tmp81_; - pdf_writer_write_string (writer, _tmp82_); - _g_free0 (_tmp82_); - _tmp83_ = g_strdup_printf ("/ColorSpace /%s\n", color_space); - _tmp84_ = _tmp83_; - pdf_writer_write_string (writer, _tmp84_); - _g_free0 (_tmp84_); - _tmp85_ = g_strdup_printf ("/BitsPerComponent %d\n", depth); - _tmp86_ = _tmp85_; - pdf_writer_write_string (writer, _tmp86_); - _g_free0 (_tmp86_); - _tmp87_ = g_strdup_printf ("/Length %d\n", data_length1); - _tmp88_ = _tmp87_; - pdf_writer_write_string (writer, _tmp88_); - _g_free0 (_tmp88_); - if (filter != NULL) { - gchar* _tmp89_ = NULL; - gchar* _tmp90_; - _tmp89_ = g_strdup_printf ("/Filter /%s\n", filter); - _tmp90_ = _tmp89_; - pdf_writer_write_string (writer, _tmp90_); - _g_free0 (_tmp90_); + _tmp255_ = writer; + pdf_writer_write_string (_tmp255_, "\n"); + _tmp256_ = writer; + _tmp257_ = pdf_writer_start_object (_tmp256_); + number = _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"); + _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_); + _tmp286_ = writer; + pdf_writer_write_string (_tmp286_, ">>\n"); + _tmp287_ = writer; + pdf_writer_write_string (_tmp287_, "endobj\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"); + _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_); } - pdf_writer_write_string (writer, ">>\n"); - pdf_writer_write_string (writer, "stream\n"); - pdf_writer_write (writer, data, data_length1); - pdf_writer_write_string (writer, "\n"); - pdf_writer_write_string (writer, "endstream\n"); - pdf_writer_write_string (writer, "endobj\n"); - _tmp91_ = g_ascii_formatd (width_buffer, width_buffer_length1, "%f", page_width); - _tmp92_ = g_ascii_formatd (height_buffer, height_buffer_length1, "%f", page_height); - _tmp93_ = g_strdup_printf ("q\n%s 0 0 %s 0 0 cm\n/Im%d Do\nQ", _tmp91_, _tmp92_, i); - command = _tmp93_; - pdf_writer_write_string (writer, "\n"); - _tmp94_ = pdf_writer_start_object (writer); - number = _tmp94_; - _tmp95_ = g_strdup_printf ("%u 0 obj\n", number); - _tmp96_ = _tmp95_; - pdf_writer_write_string (writer, _tmp96_); - _g_free0 (_tmp96_); - pdf_writer_write_string (writer, "<<\n"); - _tmp97_ = strlen (command); - _tmp98_ = g_strdup_printf ("/Length %d\n", _tmp97_ + 1); - _tmp99_ = _tmp98_; - pdf_writer_write_string (writer, _tmp99_); - _g_free0 (_tmp99_); - pdf_writer_write_string (writer, ">>\n"); - pdf_writer_write_string (writer, "stream\n"); - pdf_writer_write_string (writer, command); - pdf_writer_write_string (writer, "\n"); - pdf_writer_write_string (writer, "endstream\n"); - pdf_writer_write_string (writer, "endobj\n"); + _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"); + _tmp328_ = writer; + pdf_writer_write_string (_tmp328_, "endstream\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"); + _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"); _g_free0 (command); compressed_data = (g_free (compressed_data), NULL); data = (g_free (data), NULL); @@ -1470,116 +2351,180 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) { } } } - pdf_writer_write_string (writer, "\n"); - _tmp100_ = pdf_writer_start_object (writer); - info_number = _tmp100_; - _tmp101_ = g_strdup_printf ("%u 0 obj\n", info_number); - _tmp102_ = _tmp101_; - pdf_writer_write_string (writer, _tmp102_); - _g_free0 (_tmp102_); - pdf_writer_write_string (writer, "<<\n"); - _tmp103_ = g_strdup_printf ("/Creator (Simple Scan %s)\n", VERSION); - _tmp104_ = _tmp103_; - pdf_writer_write_string (writer, _tmp104_); - _g_free0 (_tmp104_); - pdf_writer_write_string (writer, ">>\n"); - pdf_writer_write_string (writer, "endobj\n"); - xref_offset = writer->offset; - pdf_writer_write_string (writer, "xref\n"); - _tmp105_ = g_list_length (writer->object_offsets); - _tmp106_ = g_strdup_printf ("1 %zu\n", (gsize) _tmp105_); - _tmp107_ = _tmp106_; - pdf_writer_write_string (writer, _tmp107_); - _g_free0 (_tmp107_); + _tmp359_ = writer; + pdf_writer_write_string (_tmp359_, "\n"); + _tmp360_ = writer; + _tmp361_ = pdf_writer_start_object (_tmp360_); + info_number = _tmp361_; + _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_); + _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"); + _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; { GList* offset_collection = NULL; GList* offset_it = NULL; - offset_collection = writer->object_offsets; + offset_collection = _tmp382_; for (offset_it = offset_collection; offset_it != NULL; offset_it = offset_it->next) { guint offset = 0U; offset = GPOINTER_TO_UINT (offset_it->data); { - gchar* _tmp108_ = NULL; - gchar* _tmp109_; - _tmp108_ = g_strdup_printf ("%010zu 00000 n \n", (gsize) offset); - _tmp109_ = _tmp108_; - pdf_writer_write_string (writer, _tmp109_); - _g_free0 (_tmp109_); + 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_); } } } - pdf_writer_write_string (writer, "trailer\n"); - pdf_writer_write_string (writer, "<<\n"); - _tmp110_ = g_list_length (writer->object_offsets); - _tmp111_ = g_strdup_printf ("/Size %zu\n", (gsize) _tmp110_); - _tmp112_ = _tmp111_; - pdf_writer_write_string (writer, _tmp112_); - _g_free0 (_tmp112_); - _tmp113_ = g_strdup_printf ("/Info %u 0 R\n", info_number); - _tmp114_ = _tmp113_; - pdf_writer_write_string (writer, _tmp114_); - _g_free0 (_tmp114_); - _tmp115_ = g_strdup_printf ("/Root %u 0 R\n", catalog_number); - _tmp116_ = _tmp115_; - pdf_writer_write_string (writer, _tmp116_); - _g_free0 (_tmp116_); - pdf_writer_write_string (writer, ">>\n"); - pdf_writer_write_string (writer, "startxref\n"); - _tmp117_ = g_strdup_printf ("%zu\n", xref_offset); - _tmp118_ = _tmp117_; - pdf_writer_write_string (writer, _tmp118_); - _g_free0 (_tmp118_); - pdf_writer_write_string (writer, "%%EOF\n"); + _tmp387_ = writer; + pdf_writer_write_string (_tmp387_, "trailer\n"); + _tmp388_ = writer; + pdf_writer_write_string (_tmp388_, "<<\n"); + _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_); + _tmp395_ = writer; + _tmp396_ = info_number; + _tmp397_ = g_strdup_printf ("/Info %u 0 R\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_unref0 (writer); _g_object_unref0 (stream); } void book_save (Book* self, const gchar* type, GFile* file, GError** error) { - gint _tmp0_; + GCompareFunc _tmp0_; + const gchar* _tmp1_; + gint _tmp2_ = 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 (type, "jpeg"); - if (_tmp0_ == 0) { - book_save_multi_file (self, "jpeg", file, &_inner_error_); + _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 { - gint _tmp1_; - _tmp1_ = g_strcmp0 (type, "png"); - if (_tmp1_ == 0) { - book_save_multi_file (self, "png", file, &_inner_error_); + 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; } } else { - gint _tmp2_; - _tmp2_ = g_strcmp0 (type, "tiff"); - if (_tmp2_ == 0) { - book_save_multi_file (self, "tiff", file, &_inner_error_); + 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_); if (_inner_error_ != NULL) { g_propagate_error (error, _inner_error_); return; } } else { - gint _tmp3_; - _tmp3_ = g_strcmp0 (type, "ps"); - if (_tmp3_ == 0) { - book_save_ps (self, file, &_inner_error_); + 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 { - gint _tmp4_; - _tmp4_ = g_strcmp0 (type, "pdf"); - if (_tmp4_ == 0) { - book_save_pdf (self, file, &_inner_error_); + 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; @@ -1593,11 +2538,19 @@ void book_save (Book* self, const gchar* type, GFile* file, GError** error) { void book_set_needs_saving (Book* self, gboolean needs_saving) { + gboolean _tmp0_; gboolean needed_saving; + gboolean _tmp1_; + gboolean _tmp2_; + gboolean _tmp3_; g_return_if_fail (self != NULL); - needed_saving = self->priv->needs_saving; - self->priv->needs_saving = needs_saving; - if (needed_saving != needs_saving) { + _tmp0_ = self->priv->needs_saving; + needed_saving = _tmp0_; + _tmp1_ = needs_saving; + self->priv->needs_saving = _tmp1_; + _tmp2_ = needed_saving; + _tmp3_ = needs_saving; + if (_tmp2_ != _tmp3_) { g_signal_emit_by_name (self, "needs-saving-changed"); } } @@ -1605,8 +2558,10 @@ void book_set_needs_saving (Book* self, gboolean needs_saving) { gboolean book_get_needs_saving (Book* self) { gboolean result = FALSE; + gboolean _tmp0_; g_return_val_if_fail (self != NULL, FALSE); - result = self->priv->needs_saving; + _tmp0_ = self->priv->needs_saving; + result = _tmp0_; return result; } @@ -1806,11 +2761,13 @@ static gpointer _g_object_ref0 (gpointer self) { PDFWriter* pdf_writer_construct (GType object_type, GFileOutputStream* stream) { PDFWriter* self = NULL; GFileOutputStream* _tmp0_; + GFileOutputStream* _tmp1_; g_return_val_if_fail (stream != NULL, NULL); self = (PDFWriter*) g_type_create_instance (object_type); - _tmp0_ = _g_object_ref0 (stream); + _tmp0_ = stream; + _tmp1_ = _g_object_ref0 (_tmp0_); _g_object_unref0 (self->priv->stream); - self->priv->stream = _tmp0_; + self->priv->stream = _tmp1_; return self; } @@ -1821,10 +2778,19 @@ PDFWriter* pdf_writer_new (GFileOutputStream* stream) { void pdf_writer_write (PDFWriter* self, guint8* data, int data_length1) { + gsize _tmp4_; + guint8* _tmp5_; + gint _tmp5__length1; GError * _inner_error_ = NULL; g_return_if_fail (self != NULL); { - g_output_stream_write_all ((GOutputStream*) self->priv->stream, data, (gsize) data_length1, NULL, NULL, &_inner_error_); + GFileOutputStream* _tmp0_; + guint8* _tmp1_; + gint _tmp1__length1; + _tmp0_ = self->priv->stream; + _tmp1_ = data; + _tmp1__length1 = data_length1; + g_output_stream_write_all ((GOutputStream*) _tmp0_, _tmp1_, (gsize) _tmp1__length1, NULL, NULL, &_inner_error_); if (_inner_error_ != NULL) { goto __catch0_g_error; } @@ -1833,9 +2799,13 @@ void pdf_writer_write (PDFWriter* self, guint8* data, int data_length1) { __catch0_g_error: { GError* e = NULL; + GError* _tmp2_; + const gchar* _tmp3_; e = _inner_error_; _inner_error_ = NULL; - g_warning ("book.vala:529: Error writing PDF: %s", e->message); + _tmp2_ = e; + _tmp3_ = _tmp2_->message; + g_warning ("book.vala:529: Error writing PDF: %s", _tmp3_); _g_error_free0 (e); } __finally0: @@ -1844,59 +2814,80 @@ void pdf_writer_write (PDFWriter* self, guint8* data, int data_length1) { g_clear_error (&_inner_error_); return; } - self->offset = self->offset + data_length1; + _tmp4_ = self->offset; + _tmp5_ = data; + _tmp5__length1 = data_length1; + self->offset = _tmp4_ + _tmp5__length1; } static gchar* string_to_utf8 (const gchar* self, int* result_length1) { gchar* result = NULL; gint _tmp0_; - gchar* _tmp1_ = NULL; + gint _tmp1_; + gchar* _tmp2_ = NULL; gchar* _result_; gint _result__length1; gint __result__size_; - gint _tmp2_; - gchar* _tmp3_; + gint _tmp3_; + gchar* _tmp4_; + gint _tmp4__length1; + gint _tmp5_; + gint _tmp6_; + gchar* _tmp7_; + gint _tmp7__length1; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = strlen (self); - _tmp1_ = g_new0 (gchar, _tmp0_ + 1); - _result_ = _tmp1_; - _result__length1 = _tmp0_ + 1; + _tmp1_ = _tmp0_; + _tmp2_ = g_new0 (gchar, _tmp1_ + 1); + _result_ = _tmp2_; + _result__length1 = _tmp1_ + 1; __result__size_ = _result__length1; - _result__length1--; - _tmp2_ = strlen (self); - memcpy (_result_, self, (gsize) _tmp2_); - _tmp3_ = _result_; + _tmp3_ = _result__length1; + _result__length1 = _tmp3_ - 1; + _tmp4_ = _result_; + _tmp4__length1 = _result__length1; + _tmp5_ = strlen (self); + _tmp6_ = _tmp5_; + memcpy (_tmp4_, self, (gsize) _tmp6_); + _tmp7_ = _result_; + _tmp7__length1 = _result__length1; if (result_length1) { - *result_length1 = _result__length1; + *result_length1 = _tmp7__length1; } - result = _tmp3_; + result = _tmp7_; return result; } void pdf_writer_write_string (PDFWriter* self, const gchar* text) { - gint _tmp0_; - gchar* _tmp1_ = NULL; - guint8* _tmp2_; - gint _tmp2__length1; + const gchar* _tmp0_; + gint _tmp1_ = 0; + gchar* _tmp2_ = NULL; + guint8* _tmp3_; + gint _tmp3__length1; g_return_if_fail (self != NULL); g_return_if_fail (text != NULL); - _tmp1_ = string_to_utf8 (text, &_tmp0_); - _tmp2_ = (guint8*) _tmp1_; - _tmp2__length1 = _tmp0_; - pdf_writer_write (self, _tmp2_, _tmp0_); - _tmp2_ = (g_free (_tmp2_), NULL); + _tmp0_ = text; + _tmp2_ = string_to_utf8 (_tmp0_, &_tmp1_); + _tmp3_ = (guint8*) _tmp2_; + _tmp3__length1 = _tmp1_; + pdf_writer_write (self, _tmp3_, _tmp1_); + _tmp3_ = (g_free (_tmp3_), NULL); } guint pdf_writer_start_object (PDFWriter* self) { guint result = 0U; - guint _tmp0_; + gsize _tmp0_; + GList* _tmp1_; + guint _tmp2_ = 0U; g_return_val_if_fail (self != NULL, 0U); - self->object_offsets = g_list_append (self->object_offsets, GUINT_TO_POINTER ((guint) self->offset)); - _tmp0_ = g_list_length (self->object_offsets); - result = _tmp0_; + _tmp0_ = self->offset; + self->object_offsets = g_list_append (self->object_offsets, GUINT_TO_POINTER ((guint) _tmp0_)); + _tmp1_ = self->object_offsets; + _tmp2_ = g_list_length (_tmp1_); + result = _tmp2_; return result; } @@ -2075,15 +3066,17 @@ static cairo_status_t _ps_writer_write_cairo_data_cairo_write_func_t (gpointer s PsWriter* ps_writer_construct (GType object_type, GFileOutputStream* stream) { PsWriter* self = NULL; GFileOutputStream* _tmp0_; - cairo_surface_t* _tmp1_ = NULL; + GFileOutputStream* _tmp1_; + cairo_surface_t* _tmp2_; g_return_val_if_fail (stream != NULL, NULL); self = (PsWriter*) g_type_create_instance (object_type); - _tmp0_ = _g_object_ref0 (stream); + _tmp0_ = stream; + _tmp1_ = _g_object_ref0 (_tmp0_); _g_object_unref0 (self->stream); - self->stream = _tmp0_; - _tmp1_ = cairo_ps_surface_create_for_stream (_ps_writer_write_cairo_data_cairo_write_func_t, self, (gdouble) 0, (gdouble) 0); + self->stream = _tmp1_; + _tmp2_ = cairo_ps_surface_create_for_stream (_ps_writer_write_cairo_data_cairo_write_func_t, self, (gdouble) 0, (gdouble) 0); _cairo_surface_destroy0 (self->surface); - self->surface = _tmp1_; + self->surface = _tmp2_; return self; } @@ -2098,7 +3091,13 @@ static cairo_status_t ps_writer_write_cairo_data (PsWriter* self, guint8* data, GError * _inner_error_ = NULL; g_return_val_if_fail (self != NULL, 0); { - g_output_stream_write_all ((GOutputStream*) self->stream, data, (gsize) data_length1, NULL, NULL, &_inner_error_); + GFileOutputStream* _tmp0_; + guint8* _tmp1_; + gint _tmp1__length1; + _tmp0_ = self->stream; + _tmp1_ = data; + _tmp1__length1 = data_length1; + g_output_stream_write_all ((GOutputStream*) _tmp0_, _tmp1_, (gsize) _tmp1__length1, NULL, NULL, &_inner_error_); if (_inner_error_ != NULL) { goto __catch1_g_error; } @@ -2107,9 +3106,13 @@ static cairo_status_t ps_writer_write_cairo_data (PsWriter* self, guint8* data, __catch1_g_error: { GError* e = NULL; + GError* _tmp2_; + const gchar* _tmp3_; e = _inner_error_; _inner_error_ = NULL; - g_warning ("book.vala:565: Error writing data: %s", e->message); + _tmp2_ = e; + _tmp3_ = _tmp2_->message; + g_warning ("book.vala:565: Error writing data: %s", _tmp3_); result = CAIRO_STATUS_WRITE_ERROR; _g_error_free0 (e); return result; diff --git a/src/page-view.c b/src/page-view.c index 5f916e7..24bc20d 100644 --- a/src/page-view.c +++ b/src/page-view.c @@ -1,4 +1,4 @@ -/* page-view.c generated by valac 0.13.1, the Vala compiler +/* page-view.c generated by valac 0.13.4, the Vala compiler * generated from page-view.vala, do not modify */ /* @@ -243,16 +243,28 @@ static void _page_view_scan_direction_changed_cb_page_scan_direction_changed (Pa PageView* page_view_construct (GType object_type, Page* page) { PageView* self = NULL; Page* _tmp0_; + Page* _tmp1_; + Page* _tmp2_; + Page* _tmp3_; + Page* _tmp4_; + Page* _tmp5_; + Page* _tmp6_; g_return_val_if_fail (page != NULL, NULL); self = (PageView*) g_type_create_instance (object_type); - _tmp0_ = _page_ref0 (page); + _tmp0_ = page; + _tmp1_ = _page_ref0 (_tmp0_); _page_unref0 (self->priv->page); - self->priv->page = _tmp0_; - g_signal_connect (page, "pixels-changed", (GCallback) _page_view_page_pixels_changed_cb_page_pixels_changed, self); - g_signal_connect (page, "size-changed", (GCallback) _page_view_page_size_changed_cb_page_size_changed, self); - g_signal_connect (page, "crop-changed", (GCallback) _page_view_page_overlay_changed_cb_page_crop_changed, self); - g_signal_connect (page, "scan-line-changed", (GCallback) _page_view_page_overlay_changed_cb_page_scan_line_changed, self); - g_signal_connect (page, "scan-direction-changed", (GCallback) _page_view_scan_direction_changed_cb_page_scan_direction_changed, self); + self->priv->page = _tmp1_; + _tmp2_ = page; + g_signal_connect (_tmp2_, "pixels-changed", (GCallback) _page_view_page_pixels_changed_cb_page_pixels_changed, self); + _tmp3_ = page; + g_signal_connect (_tmp3_, "size-changed", (GCallback) _page_view_page_size_changed_cb_page_size_changed, self); + _tmp4_ = page; + g_signal_connect (_tmp4_, "crop-changed", (GCallback) _page_view_page_overlay_changed_cb_page_crop_changed, self); + _tmp5_ = page; + g_signal_connect (_tmp5_, "scan-line-changed", (GCallback) _page_view_page_overlay_changed_cb_page_scan_line_changed, self); + _tmp6_ = page; + g_signal_connect (_tmp6_, "scan-direction-changed", (GCallback) _page_view_scan_direction_changed_cb_page_scan_direction_changed, self); return self; } @@ -265,9 +277,11 @@ PageView* page_view_new (Page* page) { Page* page_view_get_page (PageView* self) { Page* result = NULL; Page* _tmp0_; + Page* _tmp1_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = _page_ref0 (self->priv->page); - result = _tmp0_; + _tmp0_ = self->priv->page; + _tmp1_ = _page_ref0 (_tmp0_); + result = _tmp1_; return result; } @@ -275,63 +289,89 @@ Page* page_view_get_page (PageView* self) { void page_view_set_selected (PageView* self, gboolean selected) { gboolean _tmp0_ = FALSE; gboolean _tmp1_ = FALSE; + gboolean _tmp2_; + gboolean _tmp4_; + gboolean _tmp9_; + gboolean _tmp10_; g_return_if_fail (self != NULL); - if (self->priv->selected) { - _tmp1_ = selected; + _tmp2_ = self->priv->selected; + if (_tmp2_) { + gboolean _tmp3_; + _tmp3_ = selected; + _tmp1_ = _tmp3_; } else { _tmp1_ = FALSE; } - if (_tmp1_) { + _tmp4_ = _tmp1_; + if (_tmp4_) { _tmp0_ = TRUE; } else { - gboolean _tmp2_ = FALSE; - if (!self->priv->selected) { - _tmp2_ = !selected; + gboolean _tmp5_ = FALSE; + gboolean _tmp6_; + gboolean _tmp8_; + _tmp6_ = self->priv->selected; + if (!_tmp6_) { + gboolean _tmp7_; + _tmp7_ = selected; + _tmp5_ = !_tmp7_; } else { - _tmp2_ = FALSE; + _tmp5_ = FALSE; } - _tmp0_ = _tmp2_; + _tmp8_ = _tmp5_; + _tmp0_ = _tmp8_; } - if (_tmp0_) { + _tmp9_ = _tmp0_; + if (_tmp9_) { return; } - self->priv->selected = selected; + _tmp10_ = selected; + self->priv->selected = _tmp10_; g_signal_emit_by_name (self, "changed"); } gboolean page_view_get_selected (PageView* self) { gboolean result = FALSE; + gboolean _tmp0_; g_return_val_if_fail (self != NULL, FALSE); - result = self->priv->selected; + _tmp0_ = self->priv->selected; + result = _tmp0_; return result; } void page_view_set_x_offset (PageView* self, gint offset) { + gint _tmp0_; g_return_if_fail (self != NULL); - self->priv->x_offset = offset; + _tmp0_ = offset; + self->priv->x_offset = _tmp0_; } void page_view_set_y_offset (PageView* self, gint offset) { + gint _tmp0_; g_return_if_fail (self != NULL); - self->priv->y_offset = offset; + _tmp0_ = offset; + self->priv->y_offset = _tmp0_; } gint page_view_get_x_offset (PageView* self) { gint result = 0; + gint _tmp0_; g_return_val_if_fail (self != NULL, 0); - result = self->priv->x_offset; + _tmp0_ = self->priv->x_offset; + result = _tmp0_; return result; } gint page_view_get_y_offset (PageView* self) { gint result = 0; + gint _tmp0_; g_return_val_if_fail (self != NULL, 0); - result = self->priv->y_offset; + _tmp0_ = self->priv->y_offset; + result = _tmp0_; return result; } @@ -345,318 +385,1042 @@ static guchar page_view_get_sample (PageView* self, guchar* pixels, int pixels_l static void page_view_get_pixel (PageView* self, Page* page, gint x, gint y, guchar* pixel, int pixel_length1) { - ScanDirection _tmp0_; - gint _tmp5_; + Page* _tmp0_; + ScanDirection _tmp1_ = 0; + Page* _tmp18_; + gint _tmp19_ = 0; gint depth; - gint _tmp6_; + Page* _tmp20_; + gint _tmp21_ = 0; gint n_channels; - gint _tmp7_; - guchar* _tmp8_ = NULL; + Page* _tmp22_; + gint _tmp23_ = 0; + guchar* _tmp24_ = NULL; guchar* pixels; gint pixels_length1; gint _pixels_size_; - gint _tmp9_; + Page* _tmp25_; + gint _tmp26_ = 0; + gint _tmp27_; gint offset; - gboolean _tmp10_ = FALSE; - guchar _tmp16_; - guchar _tmp17_; - guchar _tmp18_; + gboolean _tmp28_ = FALSE; + gint _tmp29_; + gboolean _tmp31_; + guchar* _tmp102_; + gint _tmp102__length1; + guchar* _tmp103_; + gint _tmp103__length1; + gint _tmp104_; + gint _tmp105_; + gint _tmp106_; + gint _tmp107_; + gint _tmp108_; + guchar _tmp109_ = '\0'; + guchar _tmp110_; + guchar* _tmp111_; + gint _tmp111__length1; + guchar* _tmp112_; + gint _tmp112__length1; + gint _tmp113_; + gint _tmp114_; + gint _tmp115_; + gint _tmp116_; + gint _tmp117_; + guchar _tmp118_ = '\0'; + guchar _tmp119_; + guchar* _tmp120_; + gint _tmp120__length1; + guchar* _tmp121_; + gint _tmp121__length1; + gint _tmp122_; + gint _tmp123_; + gint _tmp124_; + gint _tmp125_; + gint _tmp126_; + guchar _tmp127_ = '\0'; + guchar _tmp128_; g_return_if_fail (self != NULL); g_return_if_fail (page != NULL); - _tmp0_ = page_get_scan_direction (page); - switch (_tmp0_) { + _tmp0_ = page; + _tmp1_ = page_get_scan_direction (_tmp0_); + switch (_tmp1_) { case SCAN_DIRECTION_TOP_TO_BOTTOM: { break; } case SCAN_DIRECTION_BOTTOM_TO_TOP: { - gint _tmp1_; - gint _tmp2_; - _tmp1_ = page_get_scan_width (page); - x = (_tmp1_ - x) - 1; - _tmp2_ = page_get_scan_height (page); - y = (_tmp2_ - y) - 1; + Page* _tmp2_; + gint _tmp3_ = 0; + gint _tmp4_; + Page* _tmp5_; + gint _tmp6_ = 0; + gint _tmp7_; + _tmp2_ = page; + _tmp3_ = page_get_scan_width (_tmp2_); + _tmp4_ = x; + x = (_tmp3_ - _tmp4_) - 1; + _tmp5_ = page; + _tmp6_ = page_get_scan_height (_tmp5_); + _tmp7_ = y; + y = (_tmp6_ - _tmp7_) - 1; break; } case SCAN_DIRECTION_LEFT_TO_RIGHT: { + gint _tmp8_; gint t; - gint _tmp3_; - t = x; - _tmp3_ = page_get_scan_width (page); - x = (_tmp3_ - y) - 1; - y = t; + Page* _tmp9_; + gint _tmp10_ = 0; + gint _tmp11_; + gint _tmp12_; + _tmp8_ = x; + t = _tmp8_; + _tmp9_ = page; + _tmp10_ = page_get_scan_width (_tmp9_); + _tmp11_ = y; + x = (_tmp10_ - _tmp11_) - 1; + _tmp12_ = t; + y = _tmp12_; break; } case SCAN_DIRECTION_RIGHT_TO_LEFT: { + gint _tmp13_; gint t; - gint _tmp4_; - t = x; - x = y; - _tmp4_ = page_get_scan_height (page); - y = (_tmp4_ - t) - 1; + gint _tmp14_; + Page* _tmp15_; + gint _tmp16_ = 0; + gint _tmp17_; + _tmp13_ = x; + t = _tmp13_; + _tmp14_ = y; + x = _tmp14_; + _tmp15_ = page; + _tmp16_ = page_get_scan_height (_tmp15_); + _tmp17_ = t; + y = (_tmp16_ - _tmp17_) - 1; break; } default: break; } - _tmp5_ = page_get_depth (page); - depth = _tmp5_; - _tmp6_ = page_get_n_channels (page); - n_channels = _tmp6_; - _tmp8_ = page_get_pixels (page, &_tmp7_); - pixels = _tmp8_; - pixels_length1 = _tmp7_; + _tmp18_ = page; + _tmp19_ = page_get_depth (_tmp18_); + depth = _tmp19_; + _tmp20_ = page; + _tmp21_ = page_get_n_channels (_tmp20_); + n_channels = _tmp21_; + _tmp22_ = page; + _tmp24_ = page_get_pixels (_tmp22_, &_tmp23_); + pixels = _tmp24_; + pixels_length1 = _tmp23_; _pixels_size_ = pixels_length1; - _tmp9_ = page_get_rowstride (page); - offset = _tmp9_ * y; - if (depth == 8) { - _tmp10_ = n_channels == 3; + _tmp25_ = page; + _tmp26_ = page_get_rowstride (_tmp25_); + _tmp27_ = y; + offset = _tmp26_ * _tmp27_; + _tmp29_ = depth; + if (_tmp29_ == 8) { + gint _tmp30_; + _tmp30_ = n_channels; + _tmp28_ = _tmp30_ == 3; } else { - _tmp10_ = FALSE; + _tmp28_ = FALSE; } - if (_tmp10_) { + _tmp31_ = _tmp28_; + if (_tmp31_) { + gint _tmp32_; + gint _tmp33_; + gint _tmp34_; gint o; - o = offset + (x * n_channels); - pixel[0] = pixels[o]; - pixel[1] = pixels[o + 1]; - pixel[2] = pixels[o + 2]; + guchar* _tmp35_; + gint _tmp35__length1; + guchar* _tmp36_; + gint _tmp36__length1; + gint _tmp37_; + guchar _tmp38_; + guchar _tmp39_; + guchar* _tmp40_; + gint _tmp40__length1; + guchar* _tmp41_; + gint _tmp41__length1; + gint _tmp42_; + guchar _tmp43_; + guchar _tmp44_; + guchar* _tmp45_; + gint _tmp45__length1; + guchar* _tmp46_; + gint _tmp46__length1; + gint _tmp47_; + guchar _tmp48_; + guchar _tmp49_; + _tmp32_ = offset; + _tmp33_ = x; + _tmp34_ = n_channels; + o = _tmp32_ + (_tmp33_ * _tmp34_); + _tmp35_ = pixel; + _tmp35__length1 = pixel_length1; + _tmp36_ = pixels; + _tmp36__length1 = pixels_length1; + _tmp37_ = o; + _tmp38_ = _tmp36_[_tmp37_]; + _tmp35_[0] = _tmp38_; + _tmp39_ = _tmp35_[0]; + _tmp40_ = pixel; + _tmp40__length1 = pixel_length1; + _tmp41_ = pixels; + _tmp41__length1 = pixels_length1; + _tmp42_ = o; + _tmp43_ = _tmp41_[_tmp42_ + 1]; + _tmp40_[1] = _tmp43_; + _tmp44_ = _tmp40_[1]; + _tmp45_ = pixel; + _tmp45__length1 = pixel_length1; + _tmp46_ = pixels; + _tmp46__length1 = pixels_length1; + _tmp47_ = o; + _tmp48_ = _tmp46_[_tmp47_ + 2]; + _tmp45_[2] = _tmp48_; + _tmp49_ = _tmp45_[2]; return; } else { - gboolean _tmp11_ = FALSE; - if (depth == 8) { - _tmp11_ = n_channels == 1; + gboolean _tmp50_ = FALSE; + gint _tmp51_; + gboolean _tmp53_; + _tmp51_ = depth; + if (_tmp51_ == 8) { + gint _tmp52_; + _tmp52_ = n_channels; + _tmp50_ = _tmp52_ == 1; } else { - _tmp11_ = FALSE; + _tmp50_ = FALSE; } - if (_tmp11_) { - pixel[2] = pixels[offset + x]; - pixel[1] = pixel[2]; - pixel[0] = pixel[1]; + _tmp53_ = _tmp50_; + if (_tmp53_) { + guchar* _tmp54_; + gint _tmp54__length1; + guchar* _tmp55_; + gint _tmp55__length1; + guchar* _tmp56_; + gint _tmp56__length1; + guchar* _tmp57_; + gint _tmp57__length1; + gint _tmp58_; + gint _tmp59_; + guchar _tmp60_; + guchar _tmp61_; + guchar _tmp62_; + guchar _tmp63_; + _tmp54_ = pixel; + _tmp54__length1 = pixel_length1; + _tmp55_ = pixel; + _tmp55__length1 = pixel_length1; + _tmp56_ = pixel; + _tmp56__length1 = pixel_length1; + _tmp57_ = pixels; + _tmp57__length1 = pixels_length1; + _tmp58_ = offset; + _tmp59_ = x; + _tmp60_ = _tmp57_[_tmp58_ + _tmp59_]; + _tmp56_[2] = _tmp60_; + _tmp61_ = _tmp56_[2]; + _tmp55_[1] = _tmp61_; + _tmp62_ = _tmp55_[1]; + _tmp54_[0] = _tmp62_; + _tmp63_ = _tmp54_[0]; return; } else { - gboolean _tmp12_ = FALSE; - if (depth == 1) { - _tmp12_ = n_channels == 1; + gboolean _tmp64_ = FALSE; + gint _tmp65_; + gboolean _tmp67_; + _tmp65_ = depth; + if (_tmp65_ == 1) { + gint _tmp66_; + _tmp66_ = n_channels; + _tmp64_ = _tmp66_ == 1; } else { - _tmp12_ = FALSE; + _tmp64_ = FALSE; } - if (_tmp12_) { + _tmp67_ = _tmp64_; + if (_tmp67_) { + gint _tmp68_; + gint _tmp69_; gint o; - gint _tmp13_ = 0; - o = offset + (x / 8); - if (((gint) (pixels[o] & (0x80 >> (x % 8)))) != 0) { - _tmp13_ = 0x00; + gint _tmp70_ = 0; + guchar* _tmp71_; + gint _tmp71__length1; + gint _tmp72_; + guchar _tmp73_; + gint _tmp74_; + guchar* _tmp75_; + gint _tmp75__length1; + guchar* _tmp76_; + gint _tmp76__length1; + guchar* _tmp77_; + gint _tmp77__length1; + gint _tmp78_; + guchar _tmp79_; + guchar _tmp80_; + guchar _tmp81_; + _tmp68_ = offset; + _tmp69_ = x; + o = _tmp68_ + (_tmp69_ / 8); + _tmp71_ = pixels; + _tmp71__length1 = pixels_length1; + _tmp72_ = o; + _tmp73_ = _tmp71_[_tmp72_]; + _tmp74_ = x; + if (((gint) (_tmp73_ & (0x80 >> (_tmp74_ % 8)))) != 0) { + _tmp70_ = 0x00; } else { - _tmp13_ = 0xFF; + _tmp70_ = 0xFF; } - pixel[2] = (guchar) _tmp13_; - pixel[1] = pixel[2]; - pixel[0] = pixel[1]; + _tmp75_ = pixel; + _tmp75__length1 = pixel_length1; + _tmp76_ = pixel; + _tmp76__length1 = pixel_length1; + _tmp77_ = pixel; + _tmp77__length1 = pixel_length1; + _tmp78_ = _tmp70_; + _tmp77_[2] = (guchar) _tmp78_; + _tmp79_ = _tmp77_[2]; + _tmp76_[1] = _tmp79_; + _tmp80_ = _tmp76_[1]; + _tmp75_[0] = _tmp80_; + _tmp81_ = _tmp75_[0]; return; } else { - gboolean _tmp14_ = FALSE; - if (depth == 2) { - _tmp14_ = n_channels == 1; + gboolean _tmp82_ = FALSE; + gint _tmp83_; + gboolean _tmp85_; + _tmp83_ = depth; + if (_tmp83_ == 2) { + gint _tmp84_; + _tmp84_ = n_channels; + _tmp82_ = _tmp84_ == 1; } else { - _tmp14_ = FALSE; + _tmp82_ = FALSE; } - if (_tmp14_) { - gint _tmp15_[4] = {0}; + _tmp85_ = _tmp82_; + if (_tmp85_) { + gint _tmp86_[4] = {0}; gint block_shift[4]; + gint _tmp87_; + gint _tmp88_; gint o; + guchar* _tmp89_; + gint _tmp89__length1; + gint _tmp90_; + guchar _tmp91_; + gint _tmp92_; + gint _tmp93_; gint sample; - _tmp15_[0] = 6; - _tmp15_[1] = 4; - _tmp15_[2] = 2; - _tmp15_[3] = 0; - memcpy (block_shift, _tmp15_, 4 * sizeof (gint)); - o = offset + (x / 4); - sample = (pixels[o] >> block_shift[x % 4]) & 0x3; - sample = (sample * 255) / 3; - pixel[2] = (guchar) sample; - pixel[1] = pixel[2]; - pixel[0] = pixel[1]; + gint _tmp94_; + guchar* _tmp95_; + gint _tmp95__length1; + guchar* _tmp96_; + gint _tmp96__length1; + guchar* _tmp97_; + gint _tmp97__length1; + gint _tmp98_; + guchar _tmp99_; + guchar _tmp100_; + guchar _tmp101_; + _tmp86_[0] = 6; + _tmp86_[1] = 4; + _tmp86_[2] = 2; + _tmp86_[3] = 0; + memcpy (block_shift, _tmp86_, 4 * sizeof (gint)); + _tmp87_ = offset; + _tmp88_ = x; + o = _tmp87_ + (_tmp88_ / 4); + _tmp89_ = pixels; + _tmp89__length1 = pixels_length1; + _tmp90_ = o; + _tmp91_ = _tmp89_[_tmp90_]; + _tmp92_ = x; + _tmp93_ = block_shift[_tmp92_ % 4]; + sample = (_tmp91_ >> _tmp93_) & 0x3; + _tmp94_ = sample; + sample = (_tmp94_ * 255) / 3; + _tmp95_ = pixel; + _tmp95__length1 = pixel_length1; + _tmp96_ = pixel; + _tmp96__length1 = pixel_length1; + _tmp97_ = pixel; + _tmp97__length1 = pixel_length1; + _tmp98_ = sample; + _tmp97_[2] = (guchar) _tmp98_; + _tmp99_ = _tmp97_[2]; + _tmp96_[1] = _tmp99_; + _tmp100_ = _tmp96_[1]; + _tmp95_[0] = _tmp100_; + _tmp101_ = _tmp95_[0]; return; } } } } - _tmp16_ = page_view_get_sample (self, pixels, pixels_length1, offset, x, depth, x * n_channels); - pixel[0] = _tmp16_; - _tmp17_ = page_view_get_sample (self, pixels, pixels_length1, offset, x, depth, (x * n_channels) + 1); - pixel[1] = _tmp17_; - _tmp18_ = page_view_get_sample (self, pixels, pixels_length1, offset, x, depth, (x * n_channels) + 2); - pixel[2] = _tmp18_; + _tmp102_ = pixel; + _tmp102__length1 = pixel_length1; + _tmp103_ = pixels; + _tmp103__length1 = pixels_length1; + _tmp104_ = offset; + _tmp105_ = x; + _tmp106_ = depth; + _tmp107_ = x; + _tmp108_ = n_channels; + _tmp109_ = page_view_get_sample (self, _tmp103_, _tmp103__length1, _tmp104_, _tmp105_, _tmp106_, _tmp107_ * _tmp108_); + _tmp102_[0] = _tmp109_; + _tmp110_ = _tmp102_[0]; + _tmp111_ = pixel; + _tmp111__length1 = pixel_length1; + _tmp112_ = pixels; + _tmp112__length1 = pixels_length1; + _tmp113_ = offset; + _tmp114_ = x; + _tmp115_ = depth; + _tmp116_ = x; + _tmp117_ = n_channels; + _tmp118_ = page_view_get_sample (self, _tmp112_, _tmp112__length1, _tmp113_, _tmp114_, _tmp115_, (_tmp116_ * _tmp117_) + 1); + _tmp111_[1] = _tmp118_; + _tmp119_ = _tmp111_[1]; + _tmp120_ = pixel; + _tmp120__length1 = pixel_length1; + _tmp121_ = pixels; + _tmp121__length1 = pixels_length1; + _tmp122_ = offset; + _tmp123_ = x; + _tmp124_ = depth; + _tmp125_ = x; + _tmp126_ = n_channels; + _tmp127_ = page_view_get_sample (self, _tmp121_, _tmp121__length1, _tmp122_, _tmp123_, _tmp124_, (_tmp125_ * _tmp126_) + 2); + _tmp120_[2] = _tmp127_; + _tmp128_ = _tmp120_[2]; } static void page_view_set_pixel (PageView* self, Page* page, gdouble l, gdouble r, gdouble t, gdouble b, guchar* output, int output_length1, gint offset) { + gdouble _tmp0_; gint L; + gint _tmp1_; + gdouble _tmp2_; + gdouble _tmp4_; gint R; + gdouble _tmp5_; gint T; + gint _tmp6_; + gdouble _tmp7_; + gdouble _tmp9_; gint B; gdouble red; gdouble green; gdouble blue; - gboolean _tmp0_ = FALSE; - gboolean _tmp1_ = FALSE; gboolean _tmp10_ = FALSE; gboolean _tmp11_ = FALSE; - gboolean _tmp12_ = FALSE; - gboolean _tmp13_ = FALSE; + gdouble _tmp12_; + gdouble _tmp13_; + gboolean _tmp16_; + gboolean _tmp23_; + gboolean _tmp293_ = FALSE; + gdouble _tmp294_; + gint _tmp295_; + gboolean _tmp298_; + gboolean _tmp320_ = FALSE; + gdouble _tmp321_; + gint _tmp322_; + gboolean _tmp325_; + gboolean _tmp347_ = FALSE; + gdouble _tmp348_; + gint _tmp349_; + gboolean _tmp352_; + gboolean _tmp374_ = FALSE; + gdouble _tmp375_; + gint _tmp376_; + gboolean _tmp379_; + gdouble _tmp401_; + gdouble _tmp402_; + gdouble _tmp403_; + gdouble _tmp404_; gdouble scale; + guchar* _tmp405_; + gint _tmp405__length1; + gint _tmp406_; + gdouble _tmp407_; + gdouble _tmp408_; + guchar _tmp409_; + guchar* _tmp410_; + gint _tmp410__length1; + gint _tmp411_; + gdouble _tmp412_; + gdouble _tmp413_; + guchar _tmp414_; + guchar* _tmp415_; + gint _tmp415__length1; + gint _tmp416_; + gdouble _tmp417_; + gdouble _tmp418_; + guchar _tmp419_; g_return_if_fail (self != NULL); g_return_if_fail (page != NULL); - L = (gint) l; - if (((gdouble) L) != l) { - L++; + _tmp0_ = l; + L = (gint) _tmp0_; + _tmp1_ = L; + _tmp2_ = l; + if (((gdouble) _tmp1_) != _tmp2_) { + gint _tmp3_; + _tmp3_ = L; + L = _tmp3_ + 1; } - R = (gint) r; - T = (gint) t; - if (((gdouble) T) != t) { - T++; + _tmp4_ = r; + R = (gint) _tmp4_; + _tmp5_ = t; + T = (gint) _tmp5_; + _tmp6_ = T; + _tmp7_ = t; + if (((gdouble) _tmp6_) != _tmp7_) { + gint _tmp8_; + _tmp8_ = T; + T = _tmp8_ + 1; } - B = (gint) b; + _tmp9_ = b; + B = (gint) _tmp9_; red = 0.0; green = 0.0; blue = 0.0; - if ((r - l) <= 1.0) { - _tmp1_ = ((gint) r) == ((gint) l); + _tmp12_ = r; + _tmp13_ = l; + if ((_tmp12_ - _tmp13_) <= 1.0) { + gdouble _tmp14_; + gdouble _tmp15_; + _tmp14_ = r; + _tmp15_ = l; + _tmp11_ = ((gint) _tmp14_) == ((gint) _tmp15_); } else { - _tmp1_ = FALSE; + _tmp11_ = FALSE; } - if (_tmp1_) { - _tmp0_ = TRUE; + _tmp16_ = _tmp11_; + if (_tmp16_) { + _tmp10_ = TRUE; } else { - gboolean _tmp2_ = FALSE; - if ((b - t) <= 1.0) { - _tmp2_ = ((gint) b) == ((gint) t); + gboolean _tmp17_ = FALSE; + gdouble _tmp18_; + gdouble _tmp19_; + gboolean _tmp22_; + _tmp18_ = b; + _tmp19_ = t; + if ((_tmp18_ - _tmp19_) <= 1.0) { + gdouble _tmp20_; + gdouble _tmp21_; + _tmp20_ = b; + _tmp21_ = t; + _tmp17_ = ((gint) _tmp20_) == ((gint) _tmp21_); } else { - _tmp2_ = FALSE; + _tmp17_ = FALSE; } - _tmp0_ = _tmp2_; + _tmp22_ = _tmp17_; + _tmp10_ = _tmp22_; } - if (_tmp0_) { - gboolean _tmp3_ = FALSE; + _tmp23_ = _tmp10_; + if (_tmp23_) { + gboolean _tmp24_ = FALSE; + gdouble _tmp25_; + gdouble _tmp26_; + gboolean _tmp29_; + gint _tmp45_; + gint _tmp46_; + gdouble _tmp173_; + gdouble _tmp174_; + gdouble _tmp175_; + gdouble _tmp176_; gdouble scale; - if (((gint) l) == ((gint) r)) { - _tmp3_ = TRUE; + guchar* _tmp177_; + gint _tmp177__length1; + gint _tmp178_; + gdouble _tmp179_; + gdouble _tmp180_; + guchar _tmp181_; + guchar* _tmp182_; + gint _tmp182__length1; + gint _tmp183_; + gdouble _tmp184_; + gdouble _tmp185_; + guchar _tmp186_; + guchar* _tmp187_; + gint _tmp187__length1; + gint _tmp188_; + gdouble _tmp189_; + gdouble _tmp190_; + guchar _tmp191_; + _tmp25_ = l; + _tmp26_ = r; + if (((gint) _tmp25_) == ((gint) _tmp26_)) { + _tmp24_ = TRUE; } else { - _tmp3_ = ((gint) t) == ((gint) b); + gdouble _tmp27_; + gdouble _tmp28_; + _tmp27_ = t; + _tmp28_ = b; + _tmp24_ = ((gint) _tmp27_) == ((gint) _tmp28_); } - if (_tmp3_) { + _tmp29_ = _tmp24_; + if (_tmp29_) { guchar p[3] = {0}; - page_view_get_pixel (self, page, (gint) l, (gint) t, p, 3); - output[offset] = p[0]; - output[offset + 1] = p[1]; - output[offset + 2] = p[2]; + Page* _tmp30_; + gdouble _tmp31_; + gdouble _tmp32_; + guchar* _tmp33_; + gint _tmp33__length1; + gint _tmp34_; + guchar _tmp35_; + guchar _tmp36_; + guchar* _tmp37_; + gint _tmp37__length1; + gint _tmp38_; + guchar _tmp39_; + guchar _tmp40_; + guchar* _tmp41_; + gint _tmp41__length1; + gint _tmp42_; + guchar _tmp43_; + guchar _tmp44_; + _tmp30_ = page; + _tmp31_ = l; + _tmp32_ = t; + page_view_get_pixel (self, _tmp30_, (gint) _tmp31_, (gint) _tmp32_, p, 3); + _tmp33_ = output; + _tmp33__length1 = output_length1; + _tmp34_ = offset; + _tmp35_ = p[0]; + _tmp33_[_tmp34_] = _tmp35_; + _tmp36_ = _tmp33_[_tmp34_]; + _tmp37_ = output; + _tmp37__length1 = output_length1; + _tmp38_ = offset; + _tmp39_ = p[1]; + _tmp37_[_tmp38_ + 1] = _tmp39_; + _tmp40_ = _tmp37_[_tmp38_ + 1]; + _tmp41_ = output; + _tmp41__length1 = output_length1; + _tmp42_ = offset; + _tmp43_ = p[2]; + _tmp41_[_tmp42_ + 2] = _tmp43_; + _tmp44_ = _tmp41_[_tmp42_ + 2]; return; } - if (L > R) { + _tmp45_ = L; + _tmp46_ = R; + if (_tmp45_ > _tmp46_) { guchar p[3] = {0}; - page_view_get_pixel (self, page, R, T - 1, p, 3); - red = red + ((p[0] * (r - l)) * (T - t)); - green = green + ((p[1] * (r - l)) * (T - t)); - blue = blue + ((p[2] * (r - l)) * (T - t)); + Page* _tmp47_; + gint _tmp48_; + gint _tmp49_; + gdouble _tmp50_; + guchar _tmp51_; + gdouble _tmp52_; + gdouble _tmp53_; + gint _tmp54_; + gdouble _tmp55_; + gdouble _tmp56_; + guchar _tmp57_; + gdouble _tmp58_; + gdouble _tmp59_; + gint _tmp60_; + gdouble _tmp61_; + gdouble _tmp62_; + guchar _tmp63_; + gdouble _tmp64_; + gdouble _tmp65_; + gint _tmp66_; + gdouble _tmp67_; + Page* _tmp89_; + gint _tmp90_; + gint _tmp91_; + gdouble _tmp92_; + guchar _tmp93_; + gdouble _tmp94_; + gdouble _tmp95_; + gdouble _tmp96_; + gint _tmp97_; + gdouble _tmp98_; + guchar _tmp99_; + gdouble _tmp100_; + gdouble _tmp101_; + gdouble _tmp102_; + gint _tmp103_; + gdouble _tmp104_; + guchar _tmp105_; + gdouble _tmp106_; + gdouble _tmp107_; + gdouble _tmp108_; + gint _tmp109_; + _tmp47_ = page; + _tmp48_ = R; + _tmp49_ = T; + page_view_get_pixel (self, _tmp47_, _tmp48_, _tmp49_ - 1, p, 3); + _tmp50_ = red; + _tmp51_ = p[0]; + _tmp52_ = r; + _tmp53_ = l; + _tmp54_ = T; + _tmp55_ = t; + red = _tmp50_ + ((_tmp51_ * (_tmp52_ - _tmp53_)) * (_tmp54_ - _tmp55_)); + _tmp56_ = green; + _tmp57_ = p[1]; + _tmp58_ = r; + _tmp59_ = l; + _tmp60_ = T; + _tmp61_ = t; + green = _tmp56_ + ((_tmp57_ * (_tmp58_ - _tmp59_)) * (_tmp60_ - _tmp61_)); + _tmp62_ = blue; + _tmp63_ = p[2]; + _tmp64_ = r; + _tmp65_ = l; + _tmp66_ = T; + _tmp67_ = t; + blue = _tmp62_ + ((_tmp63_ * (_tmp64_ - _tmp65_)) * (_tmp66_ - _tmp67_)); { + gint _tmp68_; gint y; - y = T; + _tmp68_ = T; + y = _tmp68_; { - gboolean _tmp4_; - _tmp4_ = TRUE; + gboolean _tmp69_; + _tmp69_ = TRUE; while (TRUE) { - if (!_tmp4_) { - y++; + gboolean _tmp70_; + gint _tmp72_; + gint _tmp73_; + Page* _tmp74_; + gint _tmp75_; + gint _tmp76_; + gdouble _tmp77_; + guchar _tmp78_; + gdouble _tmp79_; + gdouble _tmp80_; + gdouble _tmp81_; + guchar _tmp82_; + gdouble _tmp83_; + gdouble _tmp84_; + gdouble _tmp85_; + guchar _tmp86_; + gdouble _tmp87_; + gdouble _tmp88_; + _tmp70_ = _tmp69_; + if (!_tmp70_) { + gint _tmp71_; + _tmp71_ = y; + y = _tmp71_ + 1; } - _tmp4_ = FALSE; - if (!(y < B)) { + _tmp69_ = FALSE; + _tmp72_ = y; + _tmp73_ = B; + if (!(_tmp72_ < _tmp73_)) { break; } - page_view_get_pixel (self, page, R, y, p, 3); - red = red + (p[0] * (r - l)); - green = green + (p[1] * (r - l)); - blue = blue + (p[2] * (r - l)); + _tmp74_ = page; + _tmp75_ = R; + _tmp76_ = y; + page_view_get_pixel (self, _tmp74_, _tmp75_, _tmp76_, p, 3); + _tmp77_ = red; + _tmp78_ = p[0]; + _tmp79_ = r; + _tmp80_ = l; + red = _tmp77_ + (_tmp78_ * (_tmp79_ - _tmp80_)); + _tmp81_ = green; + _tmp82_ = p[1]; + _tmp83_ = r; + _tmp84_ = l; + green = _tmp81_ + (_tmp82_ * (_tmp83_ - _tmp84_)); + _tmp85_ = blue; + _tmp86_ = p[2]; + _tmp87_ = r; + _tmp88_ = l; + blue = _tmp85_ + (_tmp86_ * (_tmp87_ - _tmp88_)); } } } - page_view_get_pixel (self, page, R, B, p, 3); - red = red + ((p[0] * (r - l)) * (b - B)); - green = green + ((p[1] * (r - l)) * (b - B)); - blue = blue + ((p[2] * (r - l)) * (b - B)); + _tmp89_ = page; + _tmp90_ = R; + _tmp91_ = B; + page_view_get_pixel (self, _tmp89_, _tmp90_, _tmp91_, p, 3); + _tmp92_ = red; + _tmp93_ = p[0]; + _tmp94_ = r; + _tmp95_ = l; + _tmp96_ = b; + _tmp97_ = B; + red = _tmp92_ + ((_tmp93_ * (_tmp94_ - _tmp95_)) * (_tmp96_ - _tmp97_)); + _tmp98_ = green; + _tmp99_ = p[1]; + _tmp100_ = r; + _tmp101_ = l; + _tmp102_ = b; + _tmp103_ = B; + green = _tmp98_ + ((_tmp99_ * (_tmp100_ - _tmp101_)) * (_tmp102_ - _tmp103_)); + _tmp104_ = blue; + _tmp105_ = p[2]; + _tmp106_ = r; + _tmp107_ = l; + _tmp108_ = b; + _tmp109_ = B; + blue = _tmp104_ + ((_tmp105_ * (_tmp106_ - _tmp107_)) * (_tmp108_ - _tmp109_)); } else { guchar p[3] = {0}; - page_view_get_pixel (self, page, L - 1, B, p, 3); - red = red + ((p[0] * (b - t)) * (L - l)); - green = green + ((p[1] * (b - t)) * (L - l)); - blue = blue + ((p[2] * (b - t)) * (L - l)); + Page* _tmp110_; + gint _tmp111_; + gint _tmp112_; + gdouble _tmp113_; + guchar _tmp114_; + gdouble _tmp115_; + gdouble _tmp116_; + gint _tmp117_; + gdouble _tmp118_; + gdouble _tmp119_; + guchar _tmp120_; + gdouble _tmp121_; + gdouble _tmp122_; + gint _tmp123_; + gdouble _tmp124_; + gdouble _tmp125_; + guchar _tmp126_; + gdouble _tmp127_; + gdouble _tmp128_; + gint _tmp129_; + gdouble _tmp130_; + Page* _tmp152_; + gint _tmp153_; + gint _tmp154_; + gdouble _tmp155_; + guchar _tmp156_; + gdouble _tmp157_; + gdouble _tmp158_; + gdouble _tmp159_; + gint _tmp160_; + gdouble _tmp161_; + guchar _tmp162_; + gdouble _tmp163_; + gdouble _tmp164_; + gdouble _tmp165_; + gint _tmp166_; + gdouble _tmp167_; + guchar _tmp168_; + gdouble _tmp169_; + gdouble _tmp170_; + gdouble _tmp171_; + gint _tmp172_; + _tmp110_ = page; + _tmp111_ = L; + _tmp112_ = B; + page_view_get_pixel (self, _tmp110_, _tmp111_ - 1, _tmp112_, p, 3); + _tmp113_ = red; + _tmp114_ = p[0]; + _tmp115_ = b; + _tmp116_ = t; + _tmp117_ = L; + _tmp118_ = l; + red = _tmp113_ + ((_tmp114_ * (_tmp115_ - _tmp116_)) * (_tmp117_ - _tmp118_)); + _tmp119_ = green; + _tmp120_ = p[1]; + _tmp121_ = b; + _tmp122_ = t; + _tmp123_ = L; + _tmp124_ = l; + green = _tmp119_ + ((_tmp120_ * (_tmp121_ - _tmp122_)) * (_tmp123_ - _tmp124_)); + _tmp125_ = blue; + _tmp126_ = p[2]; + _tmp127_ = b; + _tmp128_ = t; + _tmp129_ = L; + _tmp130_ = l; + blue = _tmp125_ + ((_tmp126_ * (_tmp127_ - _tmp128_)) * (_tmp129_ - _tmp130_)); { + gint _tmp131_; gint x; - x = L; + _tmp131_ = L; + x = _tmp131_; { - gboolean _tmp5_; - _tmp5_ = TRUE; + gboolean _tmp132_; + _tmp132_ = TRUE; while (TRUE) { - if (!_tmp5_) { - x++; + gboolean _tmp133_; + gint _tmp135_; + gint _tmp136_; + Page* _tmp137_; + gint _tmp138_; + gint _tmp139_; + gdouble _tmp140_; + guchar _tmp141_; + gdouble _tmp142_; + gdouble _tmp143_; + gdouble _tmp144_; + guchar _tmp145_; + gdouble _tmp146_; + gdouble _tmp147_; + gdouble _tmp148_; + guchar _tmp149_; + gdouble _tmp150_; + gdouble _tmp151_; + _tmp133_ = _tmp132_; + if (!_tmp133_) { + gint _tmp134_; + _tmp134_ = x; + x = _tmp134_ + 1; } - _tmp5_ = FALSE; - if (!(x < R)) { + _tmp132_ = FALSE; + _tmp135_ = x; + _tmp136_ = R; + if (!(_tmp135_ < _tmp136_)) { break; } - page_view_get_pixel (self, page, x, B, p, 3); - red = red + (p[0] * (b - t)); - green = green + (p[1] * (b - t)); - blue = blue + (p[2] * (b - t)); + _tmp137_ = page; + _tmp138_ = x; + _tmp139_ = B; + page_view_get_pixel (self, _tmp137_, _tmp138_, _tmp139_, p, 3); + _tmp140_ = red; + _tmp141_ = p[0]; + _tmp142_ = b; + _tmp143_ = t; + red = _tmp140_ + (_tmp141_ * (_tmp142_ - _tmp143_)); + _tmp144_ = green; + _tmp145_ = p[1]; + _tmp146_ = b; + _tmp147_ = t; + green = _tmp144_ + (_tmp145_ * (_tmp146_ - _tmp147_)); + _tmp148_ = blue; + _tmp149_ = p[2]; + _tmp150_ = b; + _tmp151_ = t; + blue = _tmp148_ + (_tmp149_ * (_tmp150_ - _tmp151_)); } } } - page_view_get_pixel (self, page, R, B, p, 3); - red = red + ((p[0] * (b - t)) * (r - R)); - green = green + ((p[1] * (b - t)) * (r - R)); - blue = blue + ((p[2] * (b - t)) * (r - R)); + _tmp152_ = page; + _tmp153_ = R; + _tmp154_ = B; + page_view_get_pixel (self, _tmp152_, _tmp153_, _tmp154_, p, 3); + _tmp155_ = red; + _tmp156_ = p[0]; + _tmp157_ = b; + _tmp158_ = t; + _tmp159_ = r; + _tmp160_ = R; + red = _tmp155_ + ((_tmp156_ * (_tmp157_ - _tmp158_)) * (_tmp159_ - _tmp160_)); + _tmp161_ = green; + _tmp162_ = p[1]; + _tmp163_ = b; + _tmp164_ = t; + _tmp165_ = r; + _tmp166_ = R; + green = _tmp161_ + ((_tmp162_ * (_tmp163_ - _tmp164_)) * (_tmp165_ - _tmp166_)); + _tmp167_ = blue; + _tmp168_ = p[2]; + _tmp169_ = b; + _tmp170_ = t; + _tmp171_ = r; + _tmp172_ = R; + blue = _tmp167_ + ((_tmp168_ * (_tmp169_ - _tmp170_)) * (_tmp171_ - _tmp172_)); } - scale = 1.0 / ((r - l) * (b - t)); - output[offset] = (guchar) ((red * scale) + 0.5); - output[offset + 1] = (guchar) ((green * scale) + 0.5); - output[offset + 2] = (guchar) ((blue * scale) + 0.5); + _tmp173_ = r; + _tmp174_ = l; + _tmp175_ = b; + _tmp176_ = t; + scale = 1.0 / ((_tmp173_ - _tmp174_) * (_tmp175_ - _tmp176_)); + _tmp177_ = output; + _tmp177__length1 = output_length1; + _tmp178_ = offset; + _tmp179_ = red; + _tmp180_ = scale; + _tmp177_[_tmp178_] = (guchar) ((_tmp179_ * _tmp180_) + 0.5); + _tmp181_ = _tmp177_[_tmp178_]; + _tmp182_ = output; + _tmp182__length1 = output_length1; + _tmp183_ = offset; + _tmp184_ = green; + _tmp185_ = scale; + _tmp182_[_tmp183_ + 1] = (guchar) ((_tmp184_ * _tmp185_) + 0.5); + _tmp186_ = _tmp182_[_tmp183_ + 1]; + _tmp187_ = output; + _tmp187__length1 = output_length1; + _tmp188_ = offset; + _tmp189_ = blue; + _tmp190_ = scale; + _tmp187_[_tmp188_ + 2] = (guchar) ((_tmp189_ * _tmp190_) + 0.5); + _tmp191_ = _tmp187_[_tmp188_ + 2]; return; } { + gint _tmp192_; gint x; - x = L; + _tmp192_ = L; + x = _tmp192_; { - gboolean _tmp6_; - _tmp6_ = TRUE; + gboolean _tmp193_; + _tmp193_ = TRUE; while (TRUE) { - if (!_tmp6_) { - x++; + gboolean _tmp194_; + gint _tmp196_; + gint _tmp197_; + _tmp194_ = _tmp193_; + if (!_tmp194_) { + gint _tmp195_; + _tmp195_ = x; + x = _tmp195_ + 1; } - _tmp6_ = FALSE; - if (!(x < R)) { + _tmp193_ = FALSE; + _tmp196_ = x; + _tmp197_ = R; + if (!(_tmp196_ < _tmp197_)) { break; } { + gint _tmp198_; gint y; - y = T; + _tmp198_ = T; + y = _tmp198_; { - gboolean _tmp7_; - _tmp7_ = TRUE; + gboolean _tmp199_; + _tmp199_ = TRUE; while (TRUE) { + gboolean _tmp200_; + gint _tmp202_; + gint _tmp203_; guchar p[3] = {0}; - if (!_tmp7_) { - y++; + Page* _tmp204_; + gint _tmp205_; + gint _tmp206_; + gdouble _tmp207_; + guchar _tmp208_; + gdouble _tmp209_; + guchar _tmp210_; + gdouble _tmp211_; + guchar _tmp212_; + _tmp200_ = _tmp199_; + if (!_tmp200_) { + gint _tmp201_; + _tmp201_ = y; + y = _tmp201_ + 1; } - _tmp7_ = FALSE; - if (!(y < B)) { + _tmp199_ = FALSE; + _tmp202_ = y; + _tmp203_ = B; + if (!(_tmp202_ < _tmp203_)) { break; } - page_view_get_pixel (self, page, x, y, p, 3); - red = red + p[0]; - green = green + p[1]; - blue = blue + p[2]; + _tmp204_ = page; + _tmp205_ = x; + _tmp206_ = y; + page_view_get_pixel (self, _tmp204_, _tmp205_, _tmp206_, p, 3); + _tmp207_ = red; + _tmp208_ = p[0]; + red = _tmp207_ + _tmp208_; + _tmp209_ = green; + _tmp210_ = p[1]; + green = _tmp209_ + _tmp210_; + _tmp211_ = blue; + _tmp212_ = p[2]; + blue = _tmp211_ + _tmp212_; } } } @@ -664,269 +1428,827 @@ static void page_view_set_pixel (PageView* self, Page* page, gdouble l, gdouble } } { + gint _tmp213_; gint x; - x = L; + _tmp213_ = L; + x = _tmp213_; { - gboolean _tmp8_; - _tmp8_ = TRUE; + gboolean _tmp214_; + _tmp214_ = TRUE; while (TRUE) { - if (!_tmp8_) { - x++; + gboolean _tmp215_; + gint _tmp217_; + gint _tmp218_; + gdouble _tmp219_; + gint _tmp220_; + gdouble _tmp236_; + gint _tmp237_; + _tmp215_ = _tmp214_; + if (!_tmp215_) { + gint _tmp216_; + _tmp216_ = x; + x = _tmp216_ + 1; } - _tmp8_ = FALSE; - if (!(x < R)) { + _tmp214_ = FALSE; + _tmp217_ = x; + _tmp218_ = R; + if (!(_tmp217_ < _tmp218_)) { break; } - if (t != ((gdouble) T)) { + _tmp219_ = t; + _tmp220_ = T; + if (_tmp219_ != ((gdouble) _tmp220_)) { guchar p[3] = {0}; - page_view_get_pixel (self, page, x, T - 1, p, 3); - red = red + (p[0] * (T - t)); - green = green + (p[1] * (T - t)); - blue = blue + (p[2] * (T - t)); + Page* _tmp221_; + gint _tmp222_; + gint _tmp223_; + gdouble _tmp224_; + guchar _tmp225_; + gint _tmp226_; + gdouble _tmp227_; + gdouble _tmp228_; + guchar _tmp229_; + gint _tmp230_; + gdouble _tmp231_; + gdouble _tmp232_; + guchar _tmp233_; + gint _tmp234_; + gdouble _tmp235_; + _tmp221_ = page; + _tmp222_ = x; + _tmp223_ = T; + page_view_get_pixel (self, _tmp221_, _tmp222_, _tmp223_ - 1, p, 3); + _tmp224_ = red; + _tmp225_ = p[0]; + _tmp226_ = T; + _tmp227_ = t; + red = _tmp224_ + (_tmp225_ * (_tmp226_ - _tmp227_)); + _tmp228_ = green; + _tmp229_ = p[1]; + _tmp230_ = T; + _tmp231_ = t; + green = _tmp228_ + (_tmp229_ * (_tmp230_ - _tmp231_)); + _tmp232_ = blue; + _tmp233_ = p[2]; + _tmp234_ = T; + _tmp235_ = t; + blue = _tmp232_ + (_tmp233_ * (_tmp234_ - _tmp235_)); } - if (b != ((gdouble) B)) { + _tmp236_ = b; + _tmp237_ = B; + if (_tmp236_ != ((gdouble) _tmp237_)) { guchar p[3] = {0}; - page_view_get_pixel (self, page, x, B, p, 3); - red = red + (p[0] * (b - B)); - green = green + (p[1] * (b - B)); - blue = blue + (p[2] * (b - B)); + Page* _tmp238_; + gint _tmp239_; + gint _tmp240_; + gdouble _tmp241_; + guchar _tmp242_; + gdouble _tmp243_; + gint _tmp244_; + gdouble _tmp245_; + guchar _tmp246_; + gdouble _tmp247_; + gint _tmp248_; + gdouble _tmp249_; + guchar _tmp250_; + gdouble _tmp251_; + gint _tmp252_; + _tmp238_ = page; + _tmp239_ = x; + _tmp240_ = B; + page_view_get_pixel (self, _tmp238_, _tmp239_, _tmp240_, p, 3); + _tmp241_ = red; + _tmp242_ = p[0]; + _tmp243_ = b; + _tmp244_ = B; + red = _tmp241_ + (_tmp242_ * (_tmp243_ - _tmp244_)); + _tmp245_ = green; + _tmp246_ = p[1]; + _tmp247_ = b; + _tmp248_ = B; + green = _tmp245_ + (_tmp246_ * (_tmp247_ - _tmp248_)); + _tmp249_ = blue; + _tmp250_ = p[2]; + _tmp251_ = b; + _tmp252_ = B; + blue = _tmp249_ + (_tmp250_ * (_tmp251_ - _tmp252_)); } } } } { + gint _tmp253_; gint y; - y = T; + _tmp253_ = T; + y = _tmp253_; { - gboolean _tmp9_; - _tmp9_ = TRUE; + gboolean _tmp254_; + _tmp254_ = TRUE; while (TRUE) { - if (!_tmp9_) { - y++; + gboolean _tmp255_; + gint _tmp257_; + gint _tmp258_; + gdouble _tmp259_; + gint _tmp260_; + gdouble _tmp276_; + gint _tmp277_; + _tmp255_ = _tmp254_; + if (!_tmp255_) { + gint _tmp256_; + _tmp256_ = y; + y = _tmp256_ + 1; } - _tmp9_ = FALSE; - if (!(y < B)) { + _tmp254_ = FALSE; + _tmp257_ = y; + _tmp258_ = B; + if (!(_tmp257_ < _tmp258_)) { break; } - if (l != ((gdouble) L)) { + _tmp259_ = l; + _tmp260_ = L; + if (_tmp259_ != ((gdouble) _tmp260_)) { guchar p[3] = {0}; - page_view_get_pixel (self, page, L - 1, y, p, 3); - red = red + (p[0] * (L - l)); - green = green + (p[1] * (L - l)); - blue = blue + (p[2] * (L - l)); + Page* _tmp261_; + gint _tmp262_; + gint _tmp263_; + gdouble _tmp264_; + guchar _tmp265_; + gint _tmp266_; + gdouble _tmp267_; + gdouble _tmp268_; + guchar _tmp269_; + gint _tmp270_; + gdouble _tmp271_; + gdouble _tmp272_; + guchar _tmp273_; + gint _tmp274_; + gdouble _tmp275_; + _tmp261_ = page; + _tmp262_ = L; + _tmp263_ = y; + page_view_get_pixel (self, _tmp261_, _tmp262_ - 1, _tmp263_, p, 3); + _tmp264_ = red; + _tmp265_ = p[0]; + _tmp266_ = L; + _tmp267_ = l; + red = _tmp264_ + (_tmp265_ * (_tmp266_ - _tmp267_)); + _tmp268_ = green; + _tmp269_ = p[1]; + _tmp270_ = L; + _tmp271_ = l; + green = _tmp268_ + (_tmp269_ * (_tmp270_ - _tmp271_)); + _tmp272_ = blue; + _tmp273_ = p[2]; + _tmp274_ = L; + _tmp275_ = l; + blue = _tmp272_ + (_tmp273_ * (_tmp274_ - _tmp275_)); } - if (r != ((gdouble) R)) { + _tmp276_ = r; + _tmp277_ = R; + if (_tmp276_ != ((gdouble) _tmp277_)) { guchar p[3] = {0}; - page_view_get_pixel (self, page, R, y, p, 3); - red = red + (p[0] * (r - R)); - green = green + (p[1] * (r - R)); - blue = blue + (p[2] * (r - R)); + Page* _tmp278_; + gint _tmp279_; + gint _tmp280_; + gdouble _tmp281_; + guchar _tmp282_; + gdouble _tmp283_; + gint _tmp284_; + gdouble _tmp285_; + guchar _tmp286_; + gdouble _tmp287_; + gint _tmp288_; + gdouble _tmp289_; + guchar _tmp290_; + gdouble _tmp291_; + gint _tmp292_; + _tmp278_ = page; + _tmp279_ = R; + _tmp280_ = y; + page_view_get_pixel (self, _tmp278_, _tmp279_, _tmp280_, p, 3); + _tmp281_ = red; + _tmp282_ = p[0]; + _tmp283_ = r; + _tmp284_ = R; + red = _tmp281_ + (_tmp282_ * (_tmp283_ - _tmp284_)); + _tmp285_ = green; + _tmp286_ = p[1]; + _tmp287_ = r; + _tmp288_ = R; + green = _tmp285_ + (_tmp286_ * (_tmp287_ - _tmp288_)); + _tmp289_ = blue; + _tmp290_ = p[2]; + _tmp291_ = r; + _tmp292_ = R; + blue = _tmp289_ + (_tmp290_ * (_tmp291_ - _tmp292_)); } } } } - if (l != ((gdouble) L)) { - _tmp10_ = t != ((gdouble) T); + _tmp294_ = l; + _tmp295_ = L; + if (_tmp294_ != ((gdouble) _tmp295_)) { + gdouble _tmp296_; + gint _tmp297_; + _tmp296_ = t; + _tmp297_ = T; + _tmp293_ = _tmp296_ != ((gdouble) _tmp297_); } else { - _tmp10_ = FALSE; + _tmp293_ = FALSE; } - if (_tmp10_) { + _tmp298_ = _tmp293_; + if (_tmp298_) { guchar p[3] = {0}; - page_view_get_pixel (self, page, L - 1, T - 1, p, 3); - red = red + ((p[0] * (L - l)) * (T - t)); - green = green + ((p[1] * (L - l)) * (T - t)); - blue = blue + ((p[2] * (L - l)) * (T - t)); + Page* _tmp299_; + gint _tmp300_; + gint _tmp301_; + gdouble _tmp302_; + guchar _tmp303_; + gint _tmp304_; + gdouble _tmp305_; + gint _tmp306_; + gdouble _tmp307_; + gdouble _tmp308_; + guchar _tmp309_; + gint _tmp310_; + gdouble _tmp311_; + gint _tmp312_; + gdouble _tmp313_; + gdouble _tmp314_; + guchar _tmp315_; + gint _tmp316_; + gdouble _tmp317_; + gint _tmp318_; + gdouble _tmp319_; + _tmp299_ = page; + _tmp300_ = L; + _tmp301_ = T; + page_view_get_pixel (self, _tmp299_, _tmp300_ - 1, _tmp301_ - 1, p, 3); + _tmp302_ = red; + _tmp303_ = p[0]; + _tmp304_ = L; + _tmp305_ = l; + _tmp306_ = T; + _tmp307_ = t; + red = _tmp302_ + ((_tmp303_ * (_tmp304_ - _tmp305_)) * (_tmp306_ - _tmp307_)); + _tmp308_ = green; + _tmp309_ = p[1]; + _tmp310_ = L; + _tmp311_ = l; + _tmp312_ = T; + _tmp313_ = t; + green = _tmp308_ + ((_tmp309_ * (_tmp310_ - _tmp311_)) * (_tmp312_ - _tmp313_)); + _tmp314_ = blue; + _tmp315_ = p[2]; + _tmp316_ = L; + _tmp317_ = l; + _tmp318_ = T; + _tmp319_ = t; + blue = _tmp314_ + ((_tmp315_ * (_tmp316_ - _tmp317_)) * (_tmp318_ - _tmp319_)); } - if (r != ((gdouble) R)) { - _tmp11_ = t != ((gdouble) T); + _tmp321_ = r; + _tmp322_ = R; + if (_tmp321_ != ((gdouble) _tmp322_)) { + gdouble _tmp323_; + gint _tmp324_; + _tmp323_ = t; + _tmp324_ = T; + _tmp320_ = _tmp323_ != ((gdouble) _tmp324_); } else { - _tmp11_ = FALSE; + _tmp320_ = FALSE; } - if (_tmp11_) { + _tmp325_ = _tmp320_; + if (_tmp325_) { guchar p[3] = {0}; - page_view_get_pixel (self, page, R, T - 1, p, 3); - red = red + ((p[0] * (r - R)) * (T - t)); - green = green + ((p[1] * (r - R)) * (T - t)); - blue = blue + ((p[2] * (r - R)) * (T - t)); + Page* _tmp326_; + gint _tmp327_; + gint _tmp328_; + gdouble _tmp329_; + guchar _tmp330_; + gdouble _tmp331_; + gint _tmp332_; + gint _tmp333_; + gdouble _tmp334_; + gdouble _tmp335_; + guchar _tmp336_; + gdouble _tmp337_; + gint _tmp338_; + gint _tmp339_; + gdouble _tmp340_; + gdouble _tmp341_; + guchar _tmp342_; + gdouble _tmp343_; + gint _tmp344_; + gint _tmp345_; + gdouble _tmp346_; + _tmp326_ = page; + _tmp327_ = R; + _tmp328_ = T; + page_view_get_pixel (self, _tmp326_, _tmp327_, _tmp328_ - 1, p, 3); + _tmp329_ = red; + _tmp330_ = p[0]; + _tmp331_ = r; + _tmp332_ = R; + _tmp333_ = T; + _tmp334_ = t; + red = _tmp329_ + ((_tmp330_ * (_tmp331_ - _tmp332_)) * (_tmp333_ - _tmp334_)); + _tmp335_ = green; + _tmp336_ = p[1]; + _tmp337_ = r; + _tmp338_ = R; + _tmp339_ = T; + _tmp340_ = t; + green = _tmp335_ + ((_tmp336_ * (_tmp337_ - _tmp338_)) * (_tmp339_ - _tmp340_)); + _tmp341_ = blue; + _tmp342_ = p[2]; + _tmp343_ = r; + _tmp344_ = R; + _tmp345_ = T; + _tmp346_ = t; + blue = _tmp341_ + ((_tmp342_ * (_tmp343_ - _tmp344_)) * (_tmp345_ - _tmp346_)); } - if (r != ((gdouble) R)) { - _tmp12_ = b != ((gdouble) B); + _tmp348_ = r; + _tmp349_ = R; + if (_tmp348_ != ((gdouble) _tmp349_)) { + gdouble _tmp350_; + gint _tmp351_; + _tmp350_ = b; + _tmp351_ = B; + _tmp347_ = _tmp350_ != ((gdouble) _tmp351_); } else { - _tmp12_ = FALSE; + _tmp347_ = FALSE; } - if (_tmp12_) { + _tmp352_ = _tmp347_; + if (_tmp352_) { guchar p[3] = {0}; - page_view_get_pixel (self, page, R, B, p, 3); - red = red + ((p[0] * (r - R)) * (b - B)); - green = green + ((p[1] * (r - R)) * (b - B)); - blue = blue + ((p[2] * (r - R)) * (b - B)); + Page* _tmp353_; + gint _tmp354_; + gint _tmp355_; + gdouble _tmp356_; + guchar _tmp357_; + gdouble _tmp358_; + gint _tmp359_; + gdouble _tmp360_; + gint _tmp361_; + gdouble _tmp362_; + guchar _tmp363_; + gdouble _tmp364_; + gint _tmp365_; + gdouble _tmp366_; + gint _tmp367_; + gdouble _tmp368_; + guchar _tmp369_; + gdouble _tmp370_; + gint _tmp371_; + gdouble _tmp372_; + gint _tmp373_; + _tmp353_ = page; + _tmp354_ = R; + _tmp355_ = B; + page_view_get_pixel (self, _tmp353_, _tmp354_, _tmp355_, p, 3); + _tmp356_ = red; + _tmp357_ = p[0]; + _tmp358_ = r; + _tmp359_ = R; + _tmp360_ = b; + _tmp361_ = B; + red = _tmp356_ + ((_tmp357_ * (_tmp358_ - _tmp359_)) * (_tmp360_ - _tmp361_)); + _tmp362_ = green; + _tmp363_ = p[1]; + _tmp364_ = r; + _tmp365_ = R; + _tmp366_ = b; + _tmp367_ = B; + green = _tmp362_ + ((_tmp363_ * (_tmp364_ - _tmp365_)) * (_tmp366_ - _tmp367_)); + _tmp368_ = blue; + _tmp369_ = p[2]; + _tmp370_ = r; + _tmp371_ = R; + _tmp372_ = b; + _tmp373_ = B; + blue = _tmp368_ + ((_tmp369_ * (_tmp370_ - _tmp371_)) * (_tmp372_ - _tmp373_)); } - if (l != ((gdouble) L)) { - _tmp13_ = b != ((gdouble) B); + _tmp375_ = l; + _tmp376_ = L; + if (_tmp375_ != ((gdouble) _tmp376_)) { + gdouble _tmp377_; + gint _tmp378_; + _tmp377_ = b; + _tmp378_ = B; + _tmp374_ = _tmp377_ != ((gdouble) _tmp378_); } else { - _tmp13_ = FALSE; + _tmp374_ = FALSE; } - if (_tmp13_) { + _tmp379_ = _tmp374_; + if (_tmp379_) { guchar p[3] = {0}; - page_view_get_pixel (self, page, L - 1, B, p, 3); - red = red + ((p[0] * (L - l)) * (b - B)); - green = green + ((p[1] * (L - l)) * (b - B)); - blue = blue + ((p[2] * (L - l)) * (b - B)); - } - scale = 1.0 / ((r - l) * (b - t)); - output[offset] = (guchar) ((red * scale) + 0.5); - output[offset + 1] = (guchar) ((green * scale) + 0.5); - output[offset + 2] = (guchar) ((blue * scale) + 0.5); + Page* _tmp380_; + gint _tmp381_; + gint _tmp382_; + gdouble _tmp383_; + guchar _tmp384_; + gint _tmp385_; + gdouble _tmp386_; + gdouble _tmp387_; + gint _tmp388_; + gdouble _tmp389_; + guchar _tmp390_; + gint _tmp391_; + gdouble _tmp392_; + gdouble _tmp393_; + gint _tmp394_; + gdouble _tmp395_; + guchar _tmp396_; + gint _tmp397_; + gdouble _tmp398_; + gdouble _tmp399_; + gint _tmp400_; + _tmp380_ = page; + _tmp381_ = L; + _tmp382_ = B; + page_view_get_pixel (self, _tmp380_, _tmp381_ - 1, _tmp382_, p, 3); + _tmp383_ = red; + _tmp384_ = p[0]; + _tmp385_ = L; + _tmp386_ = l; + _tmp387_ = b; + _tmp388_ = B; + red = _tmp383_ + ((_tmp384_ * (_tmp385_ - _tmp386_)) * (_tmp387_ - _tmp388_)); + _tmp389_ = green; + _tmp390_ = p[1]; + _tmp391_ = L; + _tmp392_ = l; + _tmp393_ = b; + _tmp394_ = B; + green = _tmp389_ + ((_tmp390_ * (_tmp391_ - _tmp392_)) * (_tmp393_ - _tmp394_)); + _tmp395_ = blue; + _tmp396_ = p[2]; + _tmp397_ = L; + _tmp398_ = l; + _tmp399_ = b; + _tmp400_ = B; + blue = _tmp395_ + ((_tmp396_ * (_tmp397_ - _tmp398_)) * (_tmp399_ - _tmp400_)); + } + _tmp401_ = r; + _tmp402_ = l; + _tmp403_ = b; + _tmp404_ = t; + scale = 1.0 / ((_tmp401_ - _tmp402_) * (_tmp403_ - _tmp404_)); + _tmp405_ = output; + _tmp405__length1 = output_length1; + _tmp406_ = offset; + _tmp407_ = red; + _tmp408_ = scale; + _tmp405_[_tmp406_] = (guchar) ((_tmp407_ * _tmp408_) + 0.5); + _tmp409_ = _tmp405_[_tmp406_]; + _tmp410_ = output; + _tmp410__length1 = output_length1; + _tmp411_ = offset; + _tmp412_ = green; + _tmp413_ = scale; + _tmp410_[_tmp411_ + 1] = (guchar) ((_tmp412_ * _tmp413_) + 0.5); + _tmp414_ = _tmp410_[_tmp411_ + 1]; + _tmp415_ = output; + _tmp415__length1 = output_length1; + _tmp416_ = offset; + _tmp417_ = blue; + _tmp418_ = scale; + _tmp415_[_tmp416_ + 2] = (guchar) ((_tmp417_ * _tmp418_) + 0.5); + _tmp419_ = _tmp415_[_tmp416_ + 2]; } static void page_view_update_preview (PageView* self, Page* page, GdkPixbuf** output_image, gint output_width, gint output_height, ScanDirection scan_direction, gint old_scan_line, gint scan_line) { - gint _tmp0_; + Page* _tmp0_; + gint _tmp1_ = 0; gint input_width; - gint _tmp1_; + Page* _tmp2_; + gint _tmp3_ = 0; gint input_height; gint L = 0; gint R = 0; gint T = 0; gint B = 0; - gboolean _tmp2_ = FALSE; - gboolean _tmp3_ = FALSE; - guint8* _tmp7_ = NULL; + gboolean _tmp4_ = FALSE; + gboolean _tmp5_ = FALSE; + GdkPixbuf* _tmp6_; + gboolean _tmp10_; + gboolean _tmp14_; + gint _tmp56_; + gint _tmp57_; + gint _tmp59_; + gint _tmp60_; + gint _tmp62_; + gint _tmp63_; + gint _tmp64_; + gint _tmp65_; + gint _tmp66_; + gint _tmp67_; + GdkPixbuf* _tmp68_; + GdkPixbuf* _tmp69_; + guint8* _tmp70_ = NULL; guchar* output; gint output_length1; gint _output_size_; - gint _tmp8_; + GdkPixbuf* _tmp71_; + gint _tmp72_ = 0; gint output_rowstride; - gint _tmp9_; + GdkPixbuf* _tmp73_; + gint _tmp74_ = 0; gint output_n_channels; - gboolean _tmp10_; + Page* _tmp75_; + gboolean _tmp76_ = FALSE; g_return_if_fail (self != NULL); g_return_if_fail (page != NULL); - _tmp0_ = page_get_width (page); - input_width = _tmp0_; - _tmp1_ = page_get_height (page); - input_height = _tmp1_; - if ((*output_image) == NULL) { - _tmp3_ = TRUE; + _tmp0_ = page; + _tmp1_ = page_get_width (_tmp0_); + input_width = _tmp1_; + _tmp2_ = page; + _tmp3_ = page_get_height (_tmp2_); + input_height = _tmp3_; + _tmp6_ = *output_image; + if (_tmp6_ == NULL) { + _tmp5_ = TRUE; } else { - gint _tmp4_; - _tmp4_ = gdk_pixbuf_get_width (*output_image); - _tmp3_ = _tmp4_ != output_width; + GdkPixbuf* _tmp7_; + gint _tmp8_ = 0; + gint _tmp9_; + _tmp7_ = *output_image; + _tmp8_ = gdk_pixbuf_get_width (_tmp7_); + _tmp9_ = output_width; + _tmp5_ = _tmp8_ != _tmp9_; } - if (_tmp3_) { - _tmp2_ = TRUE; + _tmp10_ = _tmp5_; + if (_tmp10_) { + _tmp4_ = TRUE; } else { - gint _tmp5_; - _tmp5_ = gdk_pixbuf_get_height (*output_image); - _tmp2_ = _tmp5_ != output_height; + GdkPixbuf* _tmp11_; + gint _tmp12_ = 0; + gint _tmp13_; + _tmp11_ = *output_image; + _tmp12_ = gdk_pixbuf_get_height (_tmp11_); + _tmp13_ = output_height; + _tmp4_ = _tmp12_ != _tmp13_; } - if (_tmp2_) { - GdkPixbuf* _tmp6_ = NULL; - _tmp6_ = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, output_width, output_height); + _tmp14_ = _tmp4_; + if (_tmp14_) { + gint _tmp15_; + gint _tmp16_; + GdkPixbuf* _tmp17_; + gint _tmp18_; + gint _tmp19_; + _tmp15_ = output_width; + _tmp16_ = output_height; + _tmp17_ = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, _tmp15_, _tmp16_); _g_object_unref0 (*output_image); - *output_image = _tmp6_; + *output_image = _tmp17_; L = 0; - R = output_width - 1; + _tmp18_ = output_width; + R = _tmp18_ - 1; T = 0; - B = output_height - 1; + _tmp19_ = output_height; + B = _tmp19_ - 1; } else { - switch (scan_direction) { + ScanDirection _tmp20_; + _tmp20_ = scan_direction; + switch (_tmp20_) { case SCAN_DIRECTION_TOP_TO_BOTTOM: { + gint _tmp21_; + gint _tmp22_; + gint _tmp23_; + gint _tmp24_; + gint _tmp25_; + gint _tmp26_; + gint _tmp27_; L = 0; - R = output_width - 1; - T = (gint) ((((gdouble) old_scan_line) * output_height) / input_height); - B = (gint) (((((gdouble) scan_line) * output_height) / input_height) + 0.5); + _tmp21_ = output_width; + R = _tmp21_ - 1; + _tmp22_ = old_scan_line; + _tmp23_ = output_height; + _tmp24_ = input_height; + T = (gint) ((((gdouble) _tmp22_) * _tmp23_) / _tmp24_); + _tmp25_ = scan_line; + _tmp26_ = output_height; + _tmp27_ = input_height; + B = (gint) (((((gdouble) _tmp25_) * _tmp26_) / _tmp27_) + 0.5); break; } case SCAN_DIRECTION_LEFT_TO_RIGHT: { - L = (gint) ((((gdouble) old_scan_line) * output_width) / input_width); - R = (gint) (((((gdouble) scan_line) * output_width) / input_width) + 0.5); + gint _tmp28_; + gint _tmp29_; + gint _tmp30_; + gint _tmp31_; + gint _tmp32_; + gint _tmp33_; + gint _tmp34_; + _tmp28_ = old_scan_line; + _tmp29_ = output_width; + _tmp30_ = input_width; + L = (gint) ((((gdouble) _tmp28_) * _tmp29_) / _tmp30_); + _tmp31_ = scan_line; + _tmp32_ = output_width; + _tmp33_ = input_width; + R = (gint) (((((gdouble) _tmp31_) * _tmp32_) / _tmp33_) + 0.5); T = 0; - B = output_height - 1; + _tmp34_ = output_height; + B = _tmp34_ - 1; break; } case SCAN_DIRECTION_BOTTOM_TO_TOP: { + gint _tmp35_; + gint _tmp36_; + gint _tmp37_; + gint _tmp38_; + gint _tmp39_; + gint _tmp40_; + gint _tmp41_; + gint _tmp42_; + gint _tmp43_; L = 0; - R = output_width - 1; - T = (gint) ((((gdouble) (input_height - scan_line)) * output_height) / input_height); - B = (gint) (((((gdouble) (input_height - old_scan_line)) * output_height) / input_height) + 0.5); + _tmp35_ = output_width; + R = _tmp35_ - 1; + _tmp36_ = input_height; + _tmp37_ = scan_line; + _tmp38_ = output_height; + _tmp39_ = input_height; + T = (gint) ((((gdouble) (_tmp36_ - _tmp37_)) * _tmp38_) / _tmp39_); + _tmp40_ = input_height; + _tmp41_ = old_scan_line; + _tmp42_ = output_height; + _tmp43_ = input_height; + B = (gint) (((((gdouble) (_tmp40_ - _tmp41_)) * _tmp42_) / _tmp43_) + 0.5); break; } case SCAN_DIRECTION_RIGHT_TO_LEFT: { - L = (gint) ((((gdouble) (input_width - scan_line)) * output_width) / input_width); - R = (gint) (((((gdouble) (input_width - old_scan_line)) * output_width) / input_width) + 0.5); + gint _tmp44_; + gint _tmp45_; + gint _tmp46_; + gint _tmp47_; + gint _tmp48_; + gint _tmp49_; + gint _tmp50_; + gint _tmp51_; + gint _tmp52_; + _tmp44_ = input_width; + _tmp45_ = scan_line; + _tmp46_ = output_width; + _tmp47_ = input_width; + L = (gint) ((((gdouble) (_tmp44_ - _tmp45_)) * _tmp46_) / _tmp47_); + _tmp48_ = input_width; + _tmp49_ = old_scan_line; + _tmp50_ = output_width; + _tmp51_ = input_width; + R = (gint) (((((gdouble) (_tmp48_ - _tmp49_)) * _tmp50_) / _tmp51_) + 0.5); T = 0; - B = output_height - 1; + _tmp52_ = output_height; + B = _tmp52_ - 1; break; } default: { + gint _tmp53_; + gint _tmp54_; + gint _tmp55_; T = 0; - B = T; - R = B; - L = R; + _tmp53_ = T; + B = _tmp53_; + _tmp54_ = B; + R = _tmp54_; + _tmp55_ = R; + L = _tmp55_; break; } } } - if (R >= output_width) { - R = output_width - 1; + _tmp56_ = R; + _tmp57_ = output_width; + if (_tmp56_ >= _tmp57_) { + gint _tmp58_; + _tmp58_ = output_width; + R = _tmp58_ - 1; } - if (B >= output_height) { - B = output_height - 1; + _tmp59_ = B; + _tmp60_ = output_height; + if (_tmp59_ >= _tmp60_) { + gint _tmp61_; + _tmp61_ = output_height; + B = _tmp61_ - 1; } - g_return_if_fail (L >= 0); - g_return_if_fail (R < output_width); - g_return_if_fail (T >= 0); - g_return_if_fail (B < output_height); - g_return_if_fail ((*output_image) != NULL); - _tmp7_ = gdk_pixbuf_get_pixels (*output_image); - output = _tmp7_; + _tmp62_ = L; + g_return_if_fail (_tmp62_ >= 0); + _tmp63_ = R; + _tmp64_ = output_width; + g_return_if_fail (_tmp63_ < _tmp64_); + _tmp65_ = T; + g_return_if_fail (_tmp65_ >= 0); + _tmp66_ = B; + _tmp67_ = output_height; + g_return_if_fail (_tmp66_ < _tmp67_); + _tmp68_ = *output_image; + g_return_if_fail (_tmp68_ != NULL); + _tmp69_ = *output_image; + _tmp70_ = gdk_pixbuf_get_pixels (_tmp69_); + output = _tmp70_; output_length1 = -1; _output_size_ = output_length1; - _tmp8_ = gdk_pixbuf_get_rowstride (*output_image); - output_rowstride = _tmp8_; - _tmp9_ = gdk_pixbuf_get_n_channels (*output_image); - output_n_channels = _tmp9_; - _tmp10_ = page_has_data (page); - if (!_tmp10_) { + _tmp71_ = *output_image; + _tmp72_ = gdk_pixbuf_get_rowstride (_tmp71_); + output_rowstride = _tmp72_; + _tmp73_ = *output_image; + _tmp74_ = gdk_pixbuf_get_n_channels (_tmp73_); + output_n_channels = _tmp74_; + _tmp75_ = page; + _tmp76_ = page_has_data (_tmp75_); + if (!_tmp76_) { { + gint _tmp77_; gint x; - x = L; + _tmp77_ = L; + x = _tmp77_; { - gboolean _tmp11_; - _tmp11_ = TRUE; + gboolean _tmp78_; + _tmp78_ = TRUE; while (TRUE) { - if (!_tmp11_) { - x++; + gboolean _tmp79_; + gint _tmp81_; + gint _tmp82_; + _tmp79_ = _tmp78_; + if (!_tmp79_) { + gint _tmp80_; + _tmp80_ = x; + x = _tmp80_ + 1; } - _tmp11_ = FALSE; - if (!(x <= R)) { + _tmp78_ = FALSE; + _tmp81_ = x; + _tmp82_ = R; + if (!(_tmp81_ <= _tmp82_)) { break; } { + gint _tmp83_; gint y; - y = T; + _tmp83_ = T; + y = _tmp83_; { - gboolean _tmp12_; - _tmp12_ = TRUE; + gboolean _tmp84_; + _tmp84_ = TRUE; while (TRUE) { + gboolean _tmp85_; + gint _tmp87_; + gint _tmp88_; + gint _tmp89_; + gint _tmp90_; + gint _tmp91_; + gint _tmp92_; gint o; - if (!_tmp12_) { - y++; + guchar* _tmp93_; + gint _tmp93__length1; + gint _tmp94_; + guchar* _tmp95_; + gint _tmp95__length1; + gint _tmp96_; + guchar* _tmp97_; + gint _tmp97__length1; + gint _tmp98_; + guchar _tmp99_; + guchar _tmp100_; + guchar _tmp101_; + _tmp85_ = _tmp84_; + if (!_tmp85_) { + gint _tmp86_; + _tmp86_ = y; + y = _tmp86_ + 1; } - _tmp12_ = FALSE; - if (!(y <= B)) { + _tmp84_ = FALSE; + _tmp87_ = y; + _tmp88_ = B; + if (!(_tmp87_ <= _tmp88_)) { break; } - o = (output_rowstride * y) + (x * output_n_channels); - output[o + 2] = (guchar) 0xFF; - output[o + 1] = output[o + 2]; - output[o] = output[o + 1]; + _tmp89_ = output_rowstride; + _tmp90_ = y; + _tmp91_ = x; + _tmp92_ = output_n_channels; + o = (_tmp89_ * _tmp90_) + (_tmp91_ * _tmp92_); + _tmp93_ = output; + _tmp93__length1 = output_length1; + _tmp94_ = o; + _tmp95_ = output; + _tmp95__length1 = output_length1; + _tmp96_ = o; + _tmp97_ = output; + _tmp97__length1 = output_length1; + _tmp98_ = o; + _tmp97_[_tmp98_ + 2] = (guchar) 0xFF; + _tmp99_ = _tmp97_[_tmp98_ + 2]; + _tmp95_[_tmp96_ + 1] = _tmp99_; + _tmp100_ = _tmp95_[_tmp96_ + 1]; + _tmp93_[_tmp94_] = _tmp100_; + _tmp101_ = _tmp93_[_tmp94_]; } } } @@ -936,42 +2258,108 @@ static void page_view_update_preview (PageView* self, Page* page, GdkPixbuf** ou return; } { + gint _tmp102_; gint x; - x = L; + _tmp102_ = L; + x = _tmp102_; { - gboolean _tmp13_; - _tmp13_ = TRUE; + gboolean _tmp103_; + _tmp103_ = TRUE; while (TRUE) { + gboolean _tmp104_; + gint _tmp106_; + gint _tmp107_; + gint _tmp108_; + gint _tmp109_; + gint _tmp110_; gdouble l; + gint _tmp111_; + gint _tmp112_; + gint _tmp113_; gdouble r; - if (!_tmp13_) { - x++; + _tmp104_ = _tmp103_; + if (!_tmp104_) { + gint _tmp105_; + _tmp105_ = x; + x = _tmp105_ + 1; } - _tmp13_ = FALSE; - if (!(x <= R)) { + _tmp103_ = FALSE; + _tmp106_ = x; + _tmp107_ = R; + if (!(_tmp106_ <= _tmp107_)) { break; } - l = (((gdouble) x) * input_width) / output_width; - r = (((gdouble) (x + 1)) * input_width) / output_width; + _tmp108_ = x; + _tmp109_ = input_width; + _tmp110_ = output_width; + l = (((gdouble) _tmp108_) * _tmp109_) / _tmp110_; + _tmp111_ = x; + _tmp112_ = input_width; + _tmp113_ = output_width; + r = (((gdouble) (_tmp111_ + 1)) * _tmp112_) / _tmp113_; { + gint _tmp114_; gint y; - y = T; + _tmp114_ = T; + y = _tmp114_; { - gboolean _tmp14_; - _tmp14_ = TRUE; + gboolean _tmp115_; + _tmp115_ = TRUE; while (TRUE) { + gboolean _tmp116_; + gint _tmp118_; + gint _tmp119_; + gint _tmp120_; + gint _tmp121_; + gint _tmp122_; gdouble t; + gint _tmp123_; + gint _tmp124_; + gint _tmp125_; gdouble b; - if (!_tmp14_) { - y++; + Page* _tmp126_; + gdouble _tmp127_; + gdouble _tmp128_; + gdouble _tmp129_; + gdouble _tmp130_; + guchar* _tmp131_; + gint _tmp131__length1; + gint _tmp132_; + gint _tmp133_; + gint _tmp134_; + gint _tmp135_; + _tmp116_ = _tmp115_; + if (!_tmp116_) { + gint _tmp117_; + _tmp117_ = y; + y = _tmp117_ + 1; } - _tmp14_ = FALSE; - if (!(y <= B)) { + _tmp115_ = FALSE; + _tmp118_ = y; + _tmp119_ = B; + if (!(_tmp118_ <= _tmp119_)) { break; } - t = (((gdouble) y) * input_height) / output_height; - b = (((gdouble) (y + 1)) * input_height) / output_height; - page_view_set_pixel (self, page, l, r, t, b, output, output_length1, (output_rowstride * y) + (x * output_n_channels)); + _tmp120_ = y; + _tmp121_ = input_height; + _tmp122_ = output_height; + t = (((gdouble) _tmp120_) * _tmp121_) / _tmp122_; + _tmp123_ = y; + _tmp124_ = input_height; + _tmp125_ = output_height; + b = (((gdouble) (_tmp123_ + 1)) * _tmp124_) / _tmp125_; + _tmp126_ = page; + _tmp127_ = l; + _tmp128_ = r; + _tmp129_ = t; + _tmp130_ = b; + _tmp131_ = output; + _tmp131__length1 = output_length1; + _tmp132_ = output_rowstride; + _tmp133_ = y; + _tmp134_ = x; + _tmp135_ = output_n_channels; + page_view_set_pixel (self, _tmp126_, _tmp127_, _tmp128_, _tmp129_, _tmp130_, _tmp131_, _tmp131__length1, (_tmp132_ * _tmp133_) + (_tmp134_ * _tmp135_)); } } } @@ -983,68 +2371,108 @@ static void page_view_update_preview (PageView* self, Page* page, GdkPixbuf** ou static gint page_view_get_preview_width (PageView* self) { gint result = 0; + gint _tmp0_; + gint _tmp1_; g_return_val_if_fail (self != NULL, 0); - result = self->priv->width - (self->priv->border_width * 2); + _tmp0_ = self->priv->width; + _tmp1_ = self->priv->border_width; + result = _tmp0_ - (_tmp1_ * 2); return result; } static gint page_view_get_preview_height (PageView* self) { gint result = 0; + gint _tmp0_; + gint _tmp1_; g_return_val_if_fail (self != NULL, 0); - result = self->priv->height - (self->priv->border_width * 2); + _tmp0_ = self->priv->height; + _tmp1_ = self->priv->border_width; + result = _tmp0_ - (_tmp1_ * 2); return result; } static void page_view_update_page_view (PageView* self) { + gboolean _tmp0_; + gint _tmp1_; gint old_scan_line; - gint _tmp0_; + Page* _tmp2_; + gint _tmp3_ = 0; gint scan_line; - ScanDirection _tmp1_; + ScanDirection _tmp4_; + Page* _tmp5_; + ScanDirection _tmp6_ = 0; ScanDirection left_steps; - gboolean _tmp2_ = FALSE; - ScanDirection _tmp3_; - gint _tmp4_; - gint _tmp5_; - ScanDirection _tmp6_; + gboolean _tmp7_ = FALSE; + ScanDirection _tmp8_; + gboolean _tmp10_; + Page* _tmp11_; + ScanDirection _tmp12_ = 0; + Page* _tmp13_; + gint _tmp14_ = 0; + gint _tmp15_ = 0; + Page* _tmp16_; + ScanDirection _tmp17_ = 0; + gint _tmp18_; + gint _tmp19_; + gint _tmp20_; g_return_if_fail (self != NULL); - if (!self->priv->update_image) { + _tmp0_ = self->priv->update_image; + if (!_tmp0_) { return; } - old_scan_line = self->priv->scan_line; - _tmp0_ = page_get_scan_line (self->priv->page); - scan_line = _tmp0_; - _tmp1_ = page_get_scan_direction (self->priv->page); - left_steps = self->priv->scan_direction - _tmp1_; - if (left_steps != 0) { - _tmp2_ = self->priv->image != NULL; + _tmp1_ = self->priv->scan_line; + old_scan_line = _tmp1_; + _tmp2_ = self->priv->page; + _tmp3_ = page_get_scan_line (_tmp2_); + scan_line = _tmp3_; + _tmp4_ = self->priv->scan_direction; + _tmp5_ = self->priv->page; + _tmp6_ = page_get_scan_direction (_tmp5_); + left_steps = _tmp4_ - _tmp6_; + _tmp8_ = left_steps; + if (_tmp8_ != 0) { + GdkPixbuf* _tmp9_; + _tmp9_ = self->priv->image; + _tmp7_ = _tmp9_ != NULL; } else { - _tmp2_ = FALSE; + _tmp7_ = FALSE; } - if (_tmp2_) { + _tmp10_ = _tmp7_; + if (_tmp10_) { _g_object_unref0 (self->priv->image); self->priv->image = NULL; } - _tmp3_ = page_get_scan_direction (self->priv->page); - self->priv->scan_direction = _tmp3_; - _tmp4_ = page_view_get_preview_width (self); - _tmp5_ = page_view_get_preview_height (self); - _tmp6_ = page_get_scan_direction (self->priv->page); - page_view_update_preview (self, self->priv->page, &self->priv->image, _tmp4_, _tmp5_, _tmp6_, old_scan_line, scan_line); + _tmp11_ = self->priv->page; + _tmp12_ = page_get_scan_direction (_tmp11_); + self->priv->scan_direction = _tmp12_; + _tmp13_ = self->priv->page; + _tmp14_ = page_view_get_preview_width (self); + _tmp15_ = page_view_get_preview_height (self); + _tmp16_ = self->priv->page; + _tmp17_ = page_get_scan_direction (_tmp16_); + _tmp18_ = old_scan_line; + _tmp19_ = scan_line; + page_view_update_preview (self, _tmp13_, &self->priv->image, _tmp14_, _tmp15_, _tmp17_, _tmp18_, _tmp19_); self->priv->update_image = FALSE; - self->priv->scan_line = scan_line; + _tmp20_ = scan_line; + self->priv->scan_line = _tmp20_; } static gint page_view_page_to_screen_x (PageView* self, gint x) { gint result = 0; gint _tmp0_; - gint _tmp1_; + gint _tmp1_ = 0; + Page* _tmp2_; + gint _tmp3_ = 0; g_return_val_if_fail (self != NULL, 0); - _tmp0_ = page_view_get_preview_width (self); - _tmp1_ = page_get_width (self->priv->page); - result = (gint) (((((gdouble) x) * _tmp0_) / _tmp1_) + 0.5); + _tmp0_ = x; + _tmp1_ = page_view_get_preview_width (self); + _tmp2_ = self->priv->page; + _tmp3_ = page_get_width (_tmp2_); + result = (gint) (((((gdouble) _tmp0_) * _tmp1_) / _tmp3_) + 0.5); return result; } @@ -1052,11 +2480,15 @@ static gint page_view_page_to_screen_x (PageView* self, gint x) { static gint page_view_page_to_screen_y (PageView* self, gint y) { gint result = 0; gint _tmp0_; - gint _tmp1_; + gint _tmp1_ = 0; + Page* _tmp2_; + gint _tmp3_ = 0; g_return_val_if_fail (self != NULL, 0); - _tmp0_ = page_view_get_preview_height (self); - _tmp1_ = page_get_height (self->priv->page); - result = (gint) (((((gdouble) y) * _tmp0_) / _tmp1_) + 0.5); + _tmp0_ = y; + _tmp1_ = page_view_get_preview_height (self); + _tmp2_ = self->priv->page; + _tmp3_ = page_get_height (_tmp2_); + result = (gint) (((((gdouble) _tmp0_) * _tmp1_) / _tmp3_) + 0.5); return result; } @@ -1064,11 +2496,15 @@ static gint page_view_page_to_screen_y (PageView* self, gint y) { static gint page_view_screen_to_page_x (PageView* self, gint x) { gint result = 0; gint _tmp0_; - gint _tmp1_; + Page* _tmp1_; + gint _tmp2_ = 0; + gint _tmp3_ = 0; g_return_val_if_fail (self != NULL, 0); - _tmp0_ = page_get_width (self->priv->page); - _tmp1_ = page_view_get_preview_width (self); - result = (gint) (((((gdouble) x) * _tmp0_) / _tmp1_) + 0.5); + _tmp0_ = x; + _tmp1_ = self->priv->page; + _tmp2_ = page_get_width (_tmp1_); + _tmp3_ = page_view_get_preview_width (self); + result = (gint) (((((gdouble) _tmp0_) * _tmp2_) / _tmp3_) + 0.5); return result; } @@ -1076,156 +2512,282 @@ static gint page_view_screen_to_page_x (PageView* self, gint x) { static gint page_view_screen_to_page_y (PageView* self, gint y) { gint result = 0; gint _tmp0_; - gint _tmp1_; + Page* _tmp1_; + gint _tmp2_ = 0; + gint _tmp3_ = 0; g_return_val_if_fail (self != NULL, 0); - _tmp0_ = page_get_height (self->priv->page); - _tmp1_ = page_view_get_preview_height (self); - result = (gint) (((((gdouble) y) * _tmp0_) / _tmp1_) + 0.5); + _tmp0_ = y; + _tmp1_ = self->priv->page; + _tmp2_ = page_get_height (_tmp1_); + _tmp3_ = page_view_get_preview_height (self); + result = (gint) (((((gdouble) _tmp0_) * _tmp2_) / _tmp3_) + 0.5); return result; } static CropLocation page_view_get_crop_location (PageView* self, gint x, gint y) { CropLocation result = 0; - gboolean _tmp0_; + Page* _tmp0_; + gboolean _tmp1_ = FALSE; gint cx = 0; gint cy = 0; gint cw = 0; gint ch = 0; - gint _tmp1_; - gint _tmp2_; - gint _tmp3_; - gint _tmp4_; - gint _tmp5_; + Page* _tmp2_; + gint _tmp3_ = 0; + gint _tmp4_ = 0; + gint _tmp5_ = 0; + gint _tmp6_ = 0; + gint _tmp7_; + gint _tmp8_ = 0; gint dx; - gint _tmp6_; + gint _tmp9_; + gint _tmp10_ = 0; gint dy; - gint _tmp7_; + gint _tmp11_; + gint _tmp12_ = 0; gint dw; - gint _tmp8_; + gint _tmp13_; + gint _tmp14_ = 0; gint dh; + gint _tmp15_; + gint _tmp16_; gint ix; + gint _tmp17_; + gint _tmp18_; gint iy; - gboolean _tmp9_ = FALSE; - gboolean _tmp10_ = FALSE; - gboolean _tmp11_ = FALSE; - gchar* _tmp12_ = NULL; + gboolean _tmp19_ = FALSE; + gboolean _tmp20_ = FALSE; + gboolean _tmp21_ = FALSE; + gint _tmp22_; + gboolean _tmp25_; + gboolean _tmp27_; + gboolean _tmp30_; + Page* _tmp31_; + gchar* _tmp32_ = NULL; gchar* name; + const gchar* _tmp33_; gint crop_border; - gboolean _tmp13_ = FALSE; - gboolean _tmp14_ = FALSE; - gboolean _tmp15_ = FALSE; - gboolean _tmp16_ = FALSE; + gint _tmp34_; + gint _tmp35_; + gint _tmp37_; + gint _tmp38_; + gboolean _tmp40_ = FALSE; + gint _tmp41_; + gint _tmp42_; + gboolean _tmp45_; + gboolean _tmp46_ = FALSE; + gint _tmp47_; + gint _tmp48_; + gint _tmp49_; + gboolean _tmp52_; + gboolean _tmp53_ = FALSE; + gint _tmp54_; + gint _tmp55_; + gboolean _tmp59_; + gboolean _tmp60_ = FALSE; + gint _tmp61_; + gint _tmp62_; + gint _tmp63_; + gboolean _tmp67_; + gint _tmp68_; + gint _tmp69_; + gint _tmp70_; + gint _tmp71_; + gint _tmp72_; + gint _tmp73_; + gint _tmp74_; + gint _tmp75_; + gint _tmp76_; + gint _tmp77_; g_return_val_if_fail (self != NULL, 0); - _tmp0_ = page_has_crop (self->priv->page); - if (!_tmp0_) { + _tmp0_ = self->priv->page; + _tmp1_ = page_has_crop (_tmp0_); + if (!_tmp1_) { result = 0; return result; } - page_get_crop (self->priv->page, &_tmp1_, &_tmp2_, &_tmp3_, &_tmp4_); - cx = _tmp1_; - cy = _tmp2_; - cw = _tmp3_; - ch = _tmp4_; - _tmp5_ = page_view_page_to_screen_x (self, cx); - dx = _tmp5_; - _tmp6_ = page_view_page_to_screen_y (self, cy); - dy = _tmp6_; - _tmp7_ = page_view_page_to_screen_x (self, cw); - dw = _tmp7_; - _tmp8_ = page_view_page_to_screen_y (self, ch); - dh = _tmp8_; - ix = x - dx; - iy = y - dy; - if (ix < 0) { - _tmp11_ = TRUE; + _tmp2_ = self->priv->page; + page_get_crop (_tmp2_, &_tmp3_, &_tmp4_, &_tmp5_, &_tmp6_); + cx = _tmp3_; + cy = _tmp4_; + cw = _tmp5_; + ch = _tmp6_; + _tmp7_ = cx; + _tmp8_ = page_view_page_to_screen_x (self, _tmp7_); + dx = _tmp8_; + _tmp9_ = cy; + _tmp10_ = page_view_page_to_screen_y (self, _tmp9_); + dy = _tmp10_; + _tmp11_ = cw; + _tmp12_ = page_view_page_to_screen_x (self, _tmp11_); + dw = _tmp12_; + _tmp13_ = ch; + _tmp14_ = page_view_page_to_screen_y (self, _tmp13_); + dh = _tmp14_; + _tmp15_ = x; + _tmp16_ = dx; + ix = _tmp15_ - _tmp16_; + _tmp17_ = y; + _tmp18_ = dy; + iy = _tmp17_ - _tmp18_; + _tmp22_ = ix; + if (_tmp22_ < 0) { + _tmp21_ = TRUE; } else { - _tmp11_ = ix > dw; + gint _tmp23_; + gint _tmp24_; + _tmp23_ = ix; + _tmp24_ = dw; + _tmp21_ = _tmp23_ > _tmp24_; } - if (_tmp11_) { - _tmp10_ = TRUE; + _tmp25_ = _tmp21_; + if (_tmp25_) { + _tmp20_ = TRUE; } else { - _tmp10_ = iy < 0; + gint _tmp26_; + _tmp26_ = iy; + _tmp20_ = _tmp26_ < 0; } - if (_tmp10_) { - _tmp9_ = TRUE; + _tmp27_ = _tmp20_; + if (_tmp27_) { + _tmp19_ = TRUE; } else { - _tmp9_ = iy > dh; + gint _tmp28_; + gint _tmp29_; + _tmp28_ = iy; + _tmp29_ = dh; + _tmp19_ = _tmp28_ > _tmp29_; } - if (_tmp9_) { + _tmp30_ = _tmp19_; + if (_tmp30_) { result = CROP_LOCATION_NONE; return result; } - _tmp12_ = page_get_named_crop (self->priv->page); - name = _tmp12_; - if (name != NULL) { + _tmp31_ = self->priv->page; + _tmp32_ = page_get_named_crop (_tmp31_); + name = _tmp32_; + _tmp33_ = name; + if (_tmp33_ != NULL) { result = CROP_LOCATION_MIDDLE; _g_free0 (name); return result; } crop_border = 20; - if (dw < (crop_border * 3)) { - crop_border = dw / 3; + _tmp34_ = dw; + _tmp35_ = crop_border; + if (_tmp34_ < (_tmp35_ * 3)) { + gint _tmp36_; + _tmp36_ = dw; + crop_border = _tmp36_ / 3; } - if (dh < (crop_border * 3)) { - crop_border = dh / 3; + _tmp37_ = dh; + _tmp38_ = crop_border; + if (_tmp37_ < (_tmp38_ * 3)) { + gint _tmp39_; + _tmp39_ = dh; + crop_border = _tmp39_ / 3; } - if (ix < crop_border) { - _tmp13_ = iy < crop_border; + _tmp41_ = ix; + _tmp42_ = crop_border; + if (_tmp41_ < _tmp42_) { + gint _tmp43_; + gint _tmp44_; + _tmp43_ = iy; + _tmp44_ = crop_border; + _tmp40_ = _tmp43_ < _tmp44_; } else { - _tmp13_ = FALSE; + _tmp40_ = FALSE; } - if (_tmp13_) { + _tmp45_ = _tmp40_; + if (_tmp45_) { result = CROP_LOCATION_TOP_LEFT; _g_free0 (name); return result; } - if (ix > (dw - crop_border)) { - _tmp14_ = iy < crop_border; + _tmp47_ = ix; + _tmp48_ = dw; + _tmp49_ = crop_border; + if (_tmp47_ > (_tmp48_ - _tmp49_)) { + gint _tmp50_; + gint _tmp51_; + _tmp50_ = iy; + _tmp51_ = crop_border; + _tmp46_ = _tmp50_ < _tmp51_; } else { - _tmp14_ = FALSE; + _tmp46_ = FALSE; } - if (_tmp14_) { + _tmp52_ = _tmp46_; + if (_tmp52_) { result = CROP_LOCATION_TOP_RIGHT; _g_free0 (name); return result; } - if (ix < crop_border) { - _tmp15_ = iy > (dh - crop_border); + _tmp54_ = ix; + _tmp55_ = crop_border; + if (_tmp54_ < _tmp55_) { + gint _tmp56_; + gint _tmp57_; + gint _tmp58_; + _tmp56_ = iy; + _tmp57_ = dh; + _tmp58_ = crop_border; + _tmp53_ = _tmp56_ > (_tmp57_ - _tmp58_); } else { - _tmp15_ = FALSE; + _tmp53_ = FALSE; } - if (_tmp15_) { + _tmp59_ = _tmp53_; + if (_tmp59_) { result = CROP_LOCATION_BOTTOM_LEFT; _g_free0 (name); return result; } - if (ix > (dw - crop_border)) { - _tmp16_ = iy > (dh - crop_border); + _tmp61_ = ix; + _tmp62_ = dw; + _tmp63_ = crop_border; + if (_tmp61_ > (_tmp62_ - _tmp63_)) { + gint _tmp64_; + gint _tmp65_; + gint _tmp66_; + _tmp64_ = iy; + _tmp65_ = dh; + _tmp66_ = crop_border; + _tmp60_ = _tmp64_ > (_tmp65_ - _tmp66_); } else { - _tmp16_ = FALSE; + _tmp60_ = FALSE; } - if (_tmp16_) { + _tmp67_ = _tmp60_; + if (_tmp67_) { result = CROP_LOCATION_BOTTOM_RIGHT; _g_free0 (name); return result; } - if (ix < crop_border) { + _tmp68_ = ix; + _tmp69_ = crop_border; + if (_tmp68_ < _tmp69_) { result = CROP_LOCATION_LEFT; _g_free0 (name); return result; } - if (ix > (dw - crop_border)) { + _tmp70_ = ix; + _tmp71_ = dw; + _tmp72_ = crop_border; + if (_tmp70_ > (_tmp71_ - _tmp72_)) { result = CROP_LOCATION_RIGHT; _g_free0 (name); return result; } - if (iy < crop_border) { + _tmp73_ = iy; + _tmp74_ = crop_border; + if (_tmp73_ < _tmp74_) { result = CROP_LOCATION_TOP; _g_free0 (name); return result; } - if (iy > (dh - crop_border)) { + _tmp75_ = iy; + _tmp76_ = dh; + _tmp77_ = crop_border; + if (_tmp75_ > (_tmp76_ - _tmp77_)) { result = CROP_LOCATION_BOTTOM; _g_free0 (name); return result; @@ -1238,74 +2800,138 @@ static CropLocation page_view_get_crop_location (PageView* self, gint x, gint y) void page_view_button_press (PageView* self, gint x, gint y) { CropLocation location = 0; - CropLocation _tmp0_; + gint _tmp0_; + gint _tmp1_; + CropLocation _tmp2_ = 0; + CropLocation _tmp3_; g_return_if_fail (self != NULL); - _tmp0_ = page_view_get_crop_location (self, x, y); - location = _tmp0_; - if (location != CROP_LOCATION_NONE) { - gint _tmp1_; - gint _tmp2_; - gint _tmp3_; - gint _tmp4_; - self->priv->crop_location = location; - self->priv->selected_crop_px = (gdouble) x; - self->priv->selected_crop_py = (gdouble) y; - page_get_crop (self->priv->page, &_tmp1_, &_tmp2_, &_tmp3_, &_tmp4_); - self->priv->selected_crop_x = _tmp1_; - self->priv->selected_crop_y = _tmp2_; - self->priv->selected_crop_w = _tmp3_; - self->priv->selected_crop_h = _tmp4_; + _tmp0_ = x; + _tmp1_ = y; + _tmp2_ = page_view_get_crop_location (self, _tmp0_, _tmp1_); + location = _tmp2_; + _tmp3_ = location; + if (_tmp3_ != CROP_LOCATION_NONE) { + CropLocation _tmp4_; + gint _tmp5_; + gint _tmp6_; + Page* _tmp7_; + gint _tmp8_ = 0; + gint _tmp9_ = 0; + gint _tmp10_ = 0; + gint _tmp11_ = 0; + _tmp4_ = location; + self->priv->crop_location = _tmp4_; + _tmp5_ = x; + self->priv->selected_crop_px = (gdouble) _tmp5_; + _tmp6_ = y; + self->priv->selected_crop_py = (gdouble) _tmp6_; + _tmp7_ = self->priv->page; + page_get_crop (_tmp7_, &_tmp8_, &_tmp9_, &_tmp10_, &_tmp11_); + self->priv->selected_crop_x = _tmp8_; + self->priv->selected_crop_y = _tmp9_; + self->priv->selected_crop_w = _tmp10_; + self->priv->selected_crop_h = _tmp11_; } } void page_view_motion (PageView* self, gint x, gint y) { - CropLocation _tmp0_; + gint _tmp0_; + gint _tmp1_; + CropLocation _tmp2_ = 0; CropLocation location; GdkCursorType cursor = 0; - gint _tmp1_; + CropLocation _tmp3_; + CropLocation _tmp4_; + Page* _tmp6_; + gint _tmp7_ = 0; gint pw; - gint _tmp2_; + Page* _tmp8_; + gint _tmp9_ = 0; gint ph; gint cx = 0; gint cy = 0; gint cw = 0; gint ch = 0; - gint _tmp3_; - gint _tmp4_; - gint _tmp5_; - gint _tmp6_; - gint _tmp7_; + Page* _tmp10_; + gint _tmp11_ = 0; + gint _tmp12_ = 0; + gint _tmp13_ = 0; + gint _tmp14_ = 0; + gint _tmp15_; + gdouble _tmp16_; + gint _tmp17_ = 0; gint dx; - gint _tmp8_; + gint _tmp18_; + gdouble _tmp19_; + gint _tmp20_ = 0; gint dy; + gint _tmp21_; gint new_x; + gint _tmp22_; gint new_y; + gint _tmp23_; gint new_w; + gint _tmp24_; gint new_h; - gint _tmp9_; + gint _tmp25_ = 0; gint min_size; - gboolean _tmp10_ = FALSE; - gboolean _tmp11_ = FALSE; - gboolean _tmp12_ = FALSE; - gboolean _tmp13_ = FALSE; - gboolean _tmp14_ = FALSE; - gboolean _tmp15_ = FALSE; - gboolean _tmp16_ = FALSE; - gboolean _tmp17_ = FALSE; - gboolean _tmp18_ = FALSE; - gboolean _tmp19_ = FALSE; - gboolean _tmp20_ = FALSE; - gboolean _tmp21_ = FALSE; - gboolean _tmp22_ = FALSE; - gboolean _tmp23_ = FALSE; - gboolean _tmp24_ = FALSE; - gboolean _tmp25_ = FALSE; gboolean _tmp26_ = FALSE; + gboolean _tmp27_ = FALSE; + CropLocation _tmp28_; + gboolean _tmp30_; + gboolean _tmp32_; + gboolean _tmp41_ = FALSE; + gboolean _tmp42_ = FALSE; + CropLocation _tmp43_; + gboolean _tmp45_; + gboolean _tmp47_; + gboolean _tmp56_ = FALSE; + gboolean _tmp57_ = FALSE; + CropLocation _tmp58_; + gboolean _tmp60_; + gboolean _tmp62_; + gboolean _tmp75_ = FALSE; + gboolean _tmp76_ = FALSE; + CropLocation _tmp77_; + gboolean _tmp79_; + gboolean _tmp81_; + CropLocation _tmp94_; + CropLocation _tmp115_; + gboolean _tmp120_ = FALSE; + gboolean _tmp121_ = FALSE; + CropLocation _tmp122_; + gboolean _tmp124_; + gboolean _tmp126_; + gboolean _tmp131_ = FALSE; + gboolean _tmp132_ = FALSE; + CropLocation _tmp133_; + gboolean _tmp135_; + gboolean _tmp137_; + gboolean _tmp142_ = FALSE; + gboolean _tmp143_ = FALSE; + CropLocation _tmp144_; + gboolean _tmp146_; + gboolean _tmp148_; + gboolean _tmp151_ = FALSE; + gboolean _tmp152_ = FALSE; + CropLocation _tmp153_; + gboolean _tmp155_; + gboolean _tmp157_; + Page* _tmp160_; + gint _tmp161_; + gint _tmp162_; + gboolean _tmp163_ = FALSE; + gint _tmp164_; + gint _tmp165_; + gboolean _tmp168_; g_return_if_fail (self != NULL); - _tmp0_ = page_view_get_crop_location (self, x, y); - location = _tmp0_; - switch (location) { + _tmp0_ = x; + _tmp1_ = y; + _tmp2_ = page_view_get_crop_location (self, _tmp0_, _tmp1_); + location = _tmp2_; + _tmp3_ = location; + switch (_tmp3_) { case CROP_LOCATION_MIDDLE: { cursor = GDK_HAND1; @@ -1357,181 +2983,421 @@ void page_view_motion (PageView* self, gint x, gint y) { break; } } - if (self->priv->crop_location == CROP_LOCATION_NONE) { - self->priv->cursor = cursor; + _tmp4_ = self->priv->crop_location; + if (_tmp4_ == CROP_LOCATION_NONE) { + GdkCursorType _tmp5_; + _tmp5_ = cursor; + self->priv->cursor = _tmp5_; return; } - _tmp1_ = page_get_width (self->priv->page); - pw = _tmp1_; - _tmp2_ = page_get_height (self->priv->page); - ph = _tmp2_; - page_get_crop (self->priv->page, &_tmp3_, &_tmp4_, &_tmp5_, &_tmp6_); - cx = _tmp3_; - cy = _tmp4_; - cw = _tmp5_; - ch = _tmp6_; - _tmp7_ = page_view_screen_to_page_x (self, x - ((gint) self->priv->selected_crop_px)); - dx = _tmp7_; - _tmp8_ = page_view_screen_to_page_y (self, y - ((gint) self->priv->selected_crop_py)); - dy = _tmp8_; - new_x = self->priv->selected_crop_x; - new_y = self->priv->selected_crop_y; - new_w = self->priv->selected_crop_w; - new_h = self->priv->selected_crop_h; - _tmp9_ = page_view_screen_to_page_x (self, 15); - min_size = _tmp9_; - if (self->priv->crop_location == CROP_LOCATION_TOP_LEFT) { - _tmp11_ = TRUE; + _tmp6_ = self->priv->page; + _tmp7_ = page_get_width (_tmp6_); + pw = _tmp7_; + _tmp8_ = self->priv->page; + _tmp9_ = page_get_height (_tmp8_); + ph = _tmp9_; + _tmp10_ = self->priv->page; + page_get_crop (_tmp10_, &_tmp11_, &_tmp12_, &_tmp13_, &_tmp14_); + cx = _tmp11_; + cy = _tmp12_; + cw = _tmp13_; + ch = _tmp14_; + _tmp15_ = x; + _tmp16_ = self->priv->selected_crop_px; + _tmp17_ = page_view_screen_to_page_x (self, _tmp15_ - ((gint) _tmp16_)); + dx = _tmp17_; + _tmp18_ = y; + _tmp19_ = self->priv->selected_crop_py; + _tmp20_ = page_view_screen_to_page_y (self, _tmp18_ - ((gint) _tmp19_)); + dy = _tmp20_; + _tmp21_ = self->priv->selected_crop_x; + new_x = _tmp21_; + _tmp22_ = self->priv->selected_crop_y; + new_y = _tmp22_; + _tmp23_ = self->priv->selected_crop_w; + new_w = _tmp23_; + _tmp24_ = self->priv->selected_crop_h; + new_h = _tmp24_; + _tmp25_ = page_view_screen_to_page_x (self, 15); + min_size = _tmp25_; + _tmp28_ = self->priv->crop_location; + if (_tmp28_ == CROP_LOCATION_TOP_LEFT) { + _tmp27_ = TRUE; } else { - _tmp11_ = self->priv->crop_location == CROP_LOCATION_LEFT; + CropLocation _tmp29_; + _tmp29_ = self->priv->crop_location; + _tmp27_ = _tmp29_ == CROP_LOCATION_LEFT; } - if (_tmp11_) { - _tmp10_ = TRUE; + _tmp30_ = _tmp27_; + if (_tmp30_) { + _tmp26_ = TRUE; } else { - _tmp10_ = self->priv->crop_location == CROP_LOCATION_BOTTOM_LEFT; + CropLocation _tmp31_; + _tmp31_ = self->priv->crop_location; + _tmp26_ = _tmp31_ == CROP_LOCATION_BOTTOM_LEFT; } - if (_tmp10_) { - if (dx > (new_w - min_size)) { - dx = new_w - min_size; + _tmp32_ = _tmp26_; + if (_tmp32_) { + gint _tmp33_; + gint _tmp34_; + gint _tmp35_; + gint _tmp38_; + gint _tmp39_; + _tmp33_ = dx; + _tmp34_ = new_w; + _tmp35_ = min_size; + if (_tmp33_ > (_tmp34_ - _tmp35_)) { + gint _tmp36_; + gint _tmp37_; + _tmp36_ = new_w; + _tmp37_ = min_size; + dx = _tmp36_ - _tmp37_; } - if ((new_x + dx) < 0) { - dx = -new_x; + _tmp38_ = new_x; + _tmp39_ = dx; + if ((_tmp38_ + _tmp39_) < 0) { + gint _tmp40_; + _tmp40_ = new_x; + dx = -_tmp40_; } } - if (self->priv->crop_location == CROP_LOCATION_TOP_LEFT) { - _tmp13_ = TRUE; + _tmp43_ = self->priv->crop_location; + if (_tmp43_ == CROP_LOCATION_TOP_LEFT) { + _tmp42_ = TRUE; } else { - _tmp13_ = self->priv->crop_location == CROP_LOCATION_TOP; + CropLocation _tmp44_; + _tmp44_ = self->priv->crop_location; + _tmp42_ = _tmp44_ == CROP_LOCATION_TOP; } - if (_tmp13_) { - _tmp12_ = TRUE; + _tmp45_ = _tmp42_; + if (_tmp45_) { + _tmp41_ = TRUE; } else { - _tmp12_ = self->priv->crop_location == CROP_LOCATION_TOP_RIGHT; + CropLocation _tmp46_; + _tmp46_ = self->priv->crop_location; + _tmp41_ = _tmp46_ == CROP_LOCATION_TOP_RIGHT; } - if (_tmp12_) { - if (dy > (new_h - min_size)) { - dy = new_h - min_size; + _tmp47_ = _tmp41_; + if (_tmp47_) { + gint _tmp48_; + gint _tmp49_; + gint _tmp50_; + gint _tmp53_; + gint _tmp54_; + _tmp48_ = dy; + _tmp49_ = new_h; + _tmp50_ = min_size; + if (_tmp48_ > (_tmp49_ - _tmp50_)) { + gint _tmp51_; + gint _tmp52_; + _tmp51_ = new_h; + _tmp52_ = min_size; + dy = _tmp51_ - _tmp52_; } - if ((new_y + dy) < 0) { - dy = -new_y; + _tmp53_ = new_y; + _tmp54_ = dy; + if ((_tmp53_ + _tmp54_) < 0) { + gint _tmp55_; + _tmp55_ = new_y; + dy = -_tmp55_; } } - if (self->priv->crop_location == CROP_LOCATION_TOP_RIGHT) { - _tmp15_ = TRUE; + _tmp58_ = self->priv->crop_location; + if (_tmp58_ == CROP_LOCATION_TOP_RIGHT) { + _tmp57_ = TRUE; } else { - _tmp15_ = self->priv->crop_location == CROP_LOCATION_RIGHT; + CropLocation _tmp59_; + _tmp59_ = self->priv->crop_location; + _tmp57_ = _tmp59_ == CROP_LOCATION_RIGHT; } - if (_tmp15_) { - _tmp14_ = TRUE; + _tmp60_ = _tmp57_; + if (_tmp60_) { + _tmp56_ = TRUE; } else { - _tmp14_ = self->priv->crop_location == CROP_LOCATION_BOTTOM_RIGHT; + CropLocation _tmp61_; + _tmp61_ = self->priv->crop_location; + _tmp56_ = _tmp61_ == CROP_LOCATION_BOTTOM_RIGHT; } - if (_tmp14_) { - if (dx < (min_size - new_w)) { - dx = min_size - new_w; + _tmp62_ = _tmp56_; + if (_tmp62_) { + gint _tmp63_; + gint _tmp64_; + gint _tmp65_; + gint _tmp68_; + gint _tmp69_; + gint _tmp70_; + gint _tmp71_; + _tmp63_ = dx; + _tmp64_ = min_size; + _tmp65_ = new_w; + if (_tmp63_ < (_tmp64_ - _tmp65_)) { + gint _tmp66_; + gint _tmp67_; + _tmp66_ = min_size; + _tmp67_ = new_w; + dx = _tmp66_ - _tmp67_; } - if (((new_x + new_w) + dx) > pw) { - dx = (pw - new_x) - new_w; + _tmp68_ = new_x; + _tmp69_ = new_w; + _tmp70_ = dx; + _tmp71_ = pw; + if (((_tmp68_ + _tmp69_) + _tmp70_) > _tmp71_) { + gint _tmp72_; + gint _tmp73_; + gint _tmp74_; + _tmp72_ = pw; + _tmp73_ = new_x; + _tmp74_ = new_w; + dx = (_tmp72_ - _tmp73_) - _tmp74_; } } - if (self->priv->crop_location == CROP_LOCATION_BOTTOM_LEFT) { - _tmp17_ = TRUE; + _tmp77_ = self->priv->crop_location; + if (_tmp77_ == CROP_LOCATION_BOTTOM_LEFT) { + _tmp76_ = TRUE; } else { - _tmp17_ = self->priv->crop_location == CROP_LOCATION_BOTTOM; + CropLocation _tmp78_; + _tmp78_ = self->priv->crop_location; + _tmp76_ = _tmp78_ == CROP_LOCATION_BOTTOM; } - if (_tmp17_) { - _tmp16_ = TRUE; + _tmp79_ = _tmp76_; + if (_tmp79_) { + _tmp75_ = TRUE; } else { - _tmp16_ = self->priv->crop_location == CROP_LOCATION_BOTTOM_RIGHT; + CropLocation _tmp80_; + _tmp80_ = self->priv->crop_location; + _tmp75_ = _tmp80_ == CROP_LOCATION_BOTTOM_RIGHT; } - if (_tmp16_) { - if (dy < (min_size - new_h)) { - dy = min_size - new_h; + _tmp81_ = _tmp75_; + if (_tmp81_) { + gint _tmp82_; + gint _tmp83_; + gint _tmp84_; + gint _tmp87_; + gint _tmp88_; + gint _tmp89_; + gint _tmp90_; + _tmp82_ = dy; + _tmp83_ = min_size; + _tmp84_ = new_h; + if (_tmp82_ < (_tmp83_ - _tmp84_)) { + gint _tmp85_; + gint _tmp86_; + _tmp85_ = min_size; + _tmp86_ = new_h; + dy = _tmp85_ - _tmp86_; } - if (((new_y + new_h) + dy) > ph) { - dy = (ph - new_y) - new_h; + _tmp87_ = new_y; + _tmp88_ = new_h; + _tmp89_ = dy; + _tmp90_ = ph; + if (((_tmp87_ + _tmp88_) + _tmp89_) > _tmp90_) { + gint _tmp91_; + gint _tmp92_; + gint _tmp93_; + _tmp91_ = ph; + _tmp92_ = new_y; + _tmp93_ = new_h; + dy = (_tmp91_ - _tmp92_) - _tmp93_; } } - if (self->priv->crop_location == CROP_LOCATION_MIDDLE) { - if (((new_x + dx) + new_w) > pw) { - dx = (pw - new_x) - new_w; + _tmp94_ = self->priv->crop_location; + if (_tmp94_ == CROP_LOCATION_MIDDLE) { + gint _tmp95_; + gint _tmp96_; + gint _tmp97_; + gint _tmp98_; + gint _tmp102_; + gint _tmp103_; + gint _tmp105_; + gint _tmp106_; + gint _tmp107_; + gint _tmp108_; + gint _tmp112_; + gint _tmp113_; + _tmp95_ = new_x; + _tmp96_ = dx; + _tmp97_ = new_w; + _tmp98_ = pw; + if (((_tmp95_ + _tmp96_) + _tmp97_) > _tmp98_) { + gint _tmp99_; + gint _tmp100_; + gint _tmp101_; + _tmp99_ = pw; + _tmp100_ = new_x; + _tmp101_ = new_w; + dx = (_tmp99_ - _tmp100_) - _tmp101_; } - if ((new_x + dx) < 0) { - dx = -new_x; + _tmp102_ = new_x; + _tmp103_ = dx; + if ((_tmp102_ + _tmp103_) < 0) { + gint _tmp104_; + _tmp104_ = new_x; + dx = -_tmp104_; } - if (((new_y + dy) + new_h) > ph) { - dy = (ph - new_y) - new_h; + _tmp105_ = new_y; + _tmp106_ = dy; + _tmp107_ = new_h; + _tmp108_ = ph; + if (((_tmp105_ + _tmp106_) + _tmp107_) > _tmp108_) { + gint _tmp109_; + gint _tmp110_; + gint _tmp111_; + _tmp109_ = ph; + _tmp110_ = new_y; + _tmp111_ = new_h; + dy = (_tmp109_ - _tmp110_) - _tmp111_; } - if ((new_y + dy) < 0) { - dy = -new_y; + _tmp112_ = new_y; + _tmp113_ = dy; + if ((_tmp112_ + _tmp113_) < 0) { + gint _tmp114_; + _tmp114_ = new_y; + dy = -_tmp114_; } } - if (self->priv->crop_location == CROP_LOCATION_MIDDLE) { - new_x = new_x + dx; - new_y = new_y + dy; + _tmp115_ = self->priv->crop_location; + if (_tmp115_ == CROP_LOCATION_MIDDLE) { + gint _tmp116_; + gint _tmp117_; + gint _tmp118_; + gint _tmp119_; + _tmp116_ = new_x; + _tmp117_ = dx; + new_x = _tmp116_ + _tmp117_; + _tmp118_ = new_y; + _tmp119_ = dy; + new_y = _tmp118_ + _tmp119_; } - if (self->priv->crop_location == CROP_LOCATION_TOP_LEFT) { - _tmp19_ = TRUE; + _tmp122_ = self->priv->crop_location; + if (_tmp122_ == CROP_LOCATION_TOP_LEFT) { + _tmp121_ = TRUE; } else { - _tmp19_ = self->priv->crop_location == CROP_LOCATION_LEFT; + CropLocation _tmp123_; + _tmp123_ = self->priv->crop_location; + _tmp121_ = _tmp123_ == CROP_LOCATION_LEFT; } - if (_tmp19_) { - _tmp18_ = TRUE; + _tmp124_ = _tmp121_; + if (_tmp124_) { + _tmp120_ = TRUE; } else { - _tmp18_ = self->priv->crop_location == CROP_LOCATION_BOTTOM_LEFT; + CropLocation _tmp125_; + _tmp125_ = self->priv->crop_location; + _tmp120_ = _tmp125_ == CROP_LOCATION_BOTTOM_LEFT; } - if (_tmp18_) { - new_x = new_x + dx; - new_w = new_w - dx; + _tmp126_ = _tmp120_; + if (_tmp126_) { + gint _tmp127_; + gint _tmp128_; + gint _tmp129_; + gint _tmp130_; + _tmp127_ = new_x; + _tmp128_ = dx; + new_x = _tmp127_ + _tmp128_; + _tmp129_ = new_w; + _tmp130_ = dx; + new_w = _tmp129_ - _tmp130_; } - if (self->priv->crop_location == CROP_LOCATION_TOP_LEFT) { - _tmp21_ = TRUE; + _tmp133_ = self->priv->crop_location; + if (_tmp133_ == CROP_LOCATION_TOP_LEFT) { + _tmp132_ = TRUE; } else { - _tmp21_ = self->priv->crop_location == CROP_LOCATION_TOP; + CropLocation _tmp134_; + _tmp134_ = self->priv->crop_location; + _tmp132_ = _tmp134_ == CROP_LOCATION_TOP; } - if (_tmp21_) { - _tmp20_ = TRUE; + _tmp135_ = _tmp132_; + if (_tmp135_) { + _tmp131_ = TRUE; } else { - _tmp20_ = self->priv->crop_location == CROP_LOCATION_TOP_RIGHT; + CropLocation _tmp136_; + _tmp136_ = self->priv->crop_location; + _tmp131_ = _tmp136_ == CROP_LOCATION_TOP_RIGHT; } - if (_tmp20_) { - new_y = new_y + dy; - new_h = new_h - dy; + _tmp137_ = _tmp131_; + if (_tmp137_) { + gint _tmp138_; + gint _tmp139_; + gint _tmp140_; + gint _tmp141_; + _tmp138_ = new_y; + _tmp139_ = dy; + new_y = _tmp138_ + _tmp139_; + _tmp140_ = new_h; + _tmp141_ = dy; + new_h = _tmp140_ - _tmp141_; } - if (self->priv->crop_location == CROP_LOCATION_TOP_RIGHT) { - _tmp23_ = TRUE; + _tmp144_ = self->priv->crop_location; + if (_tmp144_ == CROP_LOCATION_TOP_RIGHT) { + _tmp143_ = TRUE; } else { - _tmp23_ = self->priv->crop_location == CROP_LOCATION_RIGHT; + CropLocation _tmp145_; + _tmp145_ = self->priv->crop_location; + _tmp143_ = _tmp145_ == CROP_LOCATION_RIGHT; } - if (_tmp23_) { - _tmp22_ = TRUE; + _tmp146_ = _tmp143_; + if (_tmp146_) { + _tmp142_ = TRUE; } else { - _tmp22_ = self->priv->crop_location == CROP_LOCATION_BOTTOM_RIGHT; + CropLocation _tmp147_; + _tmp147_ = self->priv->crop_location; + _tmp142_ = _tmp147_ == CROP_LOCATION_BOTTOM_RIGHT; } - if (_tmp22_) { - new_w = new_w + dx; + _tmp148_ = _tmp142_; + if (_tmp148_) { + gint _tmp149_; + gint _tmp150_; + _tmp149_ = new_w; + _tmp150_ = dx; + new_w = _tmp149_ + _tmp150_; } - if (self->priv->crop_location == CROP_LOCATION_BOTTOM_LEFT) { - _tmp25_ = TRUE; + _tmp153_ = self->priv->crop_location; + if (_tmp153_ == CROP_LOCATION_BOTTOM_LEFT) { + _tmp152_ = TRUE; } else { - _tmp25_ = self->priv->crop_location == CROP_LOCATION_BOTTOM; + CropLocation _tmp154_; + _tmp154_ = self->priv->crop_location; + _tmp152_ = _tmp154_ == CROP_LOCATION_BOTTOM; } - if (_tmp25_) { - _tmp24_ = TRUE; + _tmp155_ = _tmp152_; + if (_tmp155_) { + _tmp151_ = TRUE; } else { - _tmp24_ = self->priv->crop_location == CROP_LOCATION_BOTTOM_RIGHT; + CropLocation _tmp156_; + _tmp156_ = self->priv->crop_location; + _tmp151_ = _tmp156_ == CROP_LOCATION_BOTTOM_RIGHT; } - if (_tmp24_) { - new_h = new_h + dy; + _tmp157_ = _tmp151_; + if (_tmp157_) { + gint _tmp158_; + gint _tmp159_; + _tmp158_ = new_h; + _tmp159_ = dy; + new_h = _tmp158_ + _tmp159_; } - page_move_crop (self->priv->page, new_x, new_y); - if (new_w != cw) { - _tmp26_ = TRUE; + _tmp160_ = self->priv->page; + _tmp161_ = new_x; + _tmp162_ = new_y; + page_move_crop (_tmp160_, _tmp161_, _tmp162_); + _tmp164_ = new_w; + _tmp165_ = cw; + if (_tmp164_ != _tmp165_) { + _tmp163_ = TRUE; } else { - _tmp26_ = new_h != ch; + gint _tmp166_; + gint _tmp167_; + _tmp166_ = new_h; + _tmp167_ = ch; + _tmp163_ = _tmp166_ != _tmp167_; } - if (_tmp26_) { - page_set_custom_crop (self->priv->page, new_w, new_h); + _tmp168_ = _tmp163_; + if (_tmp168_) { + Page* _tmp169_; + gint _tmp170_; + gint _tmp171_; + _tmp169_ = self->priv->page; + _tmp170_ = new_w; + _tmp171_ = new_h; + page_set_custom_crop (_tmp169_, _tmp170_, _tmp171_); } } @@ -1545,16 +3411,22 @@ void page_view_button_release (PageView* self, gint x, gint y) { GdkCursorType page_view_get_cursor (PageView* self) { GdkCursorType result = 0; + GdkCursorType _tmp0_; g_return_val_if_fail (self != NULL, 0); - result = self->priv->cursor; + _tmp0_ = self->priv->cursor; + result = _tmp0_; return result; } static gboolean page_view_animation_cb (PageView* self) { gboolean result = FALSE; + gint _tmp0_; + gint _tmp1_; g_return_val_if_fail (self != NULL, FALSE); - self->priv->animate_segment = (self->priv->animate_segment + 1) % self->priv->animate_n_segments; + _tmp0_ = self->priv->animate_segment; + _tmp1_ = self->priv->animate_n_segments; + self->priv->animate_segment = (_tmp0_ + 1) % _tmp1_; g_signal_emit_by_name (self, "changed"); result = TRUE; return result; @@ -1572,31 +3444,51 @@ static void page_view_update_animation (PageView* self) { gboolean animate = FALSE; gboolean is_animating = FALSE; gboolean _tmp0_ = FALSE; - gboolean _tmp1_; + Page* _tmp1_; + gboolean _tmp2_ = FALSE; + gboolean _tmp5_; + guint _tmp6_; + gboolean _tmp7_; + gboolean _tmp8_; + gboolean _tmp9_; g_return_if_fail (self != NULL); - _tmp1_ = page_is_scanning (self->priv->page); - if (_tmp1_) { - gboolean _tmp2_; - _tmp2_ = page_has_data (self->priv->page); - _tmp0_ = !_tmp2_; + _tmp1_ = self->priv->page; + _tmp2_ = page_is_scanning (_tmp1_); + if (_tmp2_) { + Page* _tmp3_; + gboolean _tmp4_ = FALSE; + _tmp3_ = self->priv->page; + _tmp4_ = page_has_data (_tmp3_); + _tmp0_ = !_tmp4_; } else { _tmp0_ = FALSE; } - animate = _tmp0_; - is_animating = self->priv->animate_timeout != ((guint) 0); - if (animate == is_animating) { + _tmp5_ = _tmp0_; + animate = _tmp5_; + _tmp6_ = self->priv->animate_timeout; + is_animating = _tmp6_ != ((guint) 0); + _tmp7_ = animate; + _tmp8_ = is_animating; + if (_tmp7_ == _tmp8_) { return; } - if (animate) { + _tmp9_ = animate; + if (_tmp9_) { + guint _tmp10_; self->priv->animate_segment = 0; - if (self->priv->animate_timeout == ((guint) 0)) { - guint _tmp3_; - _tmp3_ = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 150, _page_view_animation_cb_gsource_func, page_view_ref (self), page_view_unref); - self->priv->animate_timeout = _tmp3_; + _tmp10_ = self->priv->animate_timeout; + if (_tmp10_ == ((guint) 0)) { + guint _tmp11_ = 0U; + _tmp11_ = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 150, _page_view_animation_cb_gsource_func, page_view_ref (self), page_view_unref); + self->priv->animate_timeout = _tmp11_; } } else { - if (self->priv->animate_timeout != ((guint) 0)) { - g_source_remove (self->priv->animate_timeout); + guint _tmp12_; + _tmp12_ = self->priv->animate_timeout; + if (_tmp12_ != ((guint) 0)) { + guint _tmp13_; + _tmp13_ = self->priv->animate_timeout; + g_source_remove (_tmp13_); } self->priv->animate_timeout = (guint) 0; } @@ -1604,15 +3496,41 @@ static void page_view_update_animation (PageView* self) { void page_view_render (PageView* self, cairo_t* context) { - gint _tmp0_; + gint _tmp0_ = 0; gint w; - gint _tmp1_; + gint _tmp1_ = 0; gint h; - gboolean _tmp2_ = FALSE; - gboolean _tmp3_; - gboolean _tmp11_ = FALSE; - gboolean _tmp12_; - gboolean _tmp20_; + cairo_t* _tmp2_; + cairo_t* _tmp3_; + gint _tmp4_; + gint _tmp5_; + cairo_t* _tmp6_; + cairo_t* _tmp7_; + gint _tmp8_; + cairo_t* _tmp9_; + gint _tmp10_; + gint _tmp11_; + gint _tmp12_; + gint _tmp13_; + gint _tmp14_; + gint _tmp15_; + cairo_t* _tmp16_; + cairo_t* _tmp17_; + gint _tmp18_; + gint _tmp19_; + cairo_t* _tmp20_; + GdkPixbuf* _tmp21_; + cairo_t* _tmp22_; + gboolean _tmp23_ = FALSE; + Page* _tmp24_; + gboolean _tmp25_ = FALSE; + gboolean _tmp28_; + gboolean _tmp70_ = FALSE; + Page* _tmp71_; + gboolean _tmp72_ = FALSE; + gboolean _tmp75_; + Page* _tmp115_; + gboolean _tmp116_ = FALSE; g_return_if_fail (self != NULL); g_return_if_fail (context != NULL); page_view_update_animation (self); @@ -1621,223 +3539,471 @@ void page_view_render (PageView* self, cairo_t* context) { w = _tmp0_; _tmp1_ = page_view_get_preview_height (self); h = _tmp1_; - cairo_set_line_width (context, (gdouble) 1); - cairo_translate (context, (gdouble) self->priv->x_offset, (gdouble) self->priv->y_offset); - cairo_set_source_rgb (context, (gdouble) 0, (gdouble) 0, (gdouble) 0); - cairo_set_line_width (context, (gdouble) self->priv->border_width); - cairo_rectangle (context, ((gdouble) self->priv->border_width) / 2, ((gdouble) self->priv->border_width) / 2, (gdouble) (self->priv->width - self->priv->border_width), (gdouble) (self->priv->height - self->priv->border_width)); - cairo_stroke (context); - cairo_translate (context, (gdouble) self->priv->border_width, (gdouble) self->priv->border_width); - gdk_cairo_set_source_pixbuf (context, self->priv->image, (gdouble) 0, (gdouble) 0); - cairo_paint (context); - _tmp3_ = page_is_scanning (self->priv->page); - if (_tmp3_) { - gboolean _tmp4_; - _tmp4_ = page_has_data (self->priv->page); - _tmp2_ = !_tmp4_; + _tmp2_ = context; + cairo_set_line_width (_tmp2_, (gdouble) 1); + _tmp3_ = context; + _tmp4_ = self->priv->x_offset; + _tmp5_ = self->priv->y_offset; + cairo_translate (_tmp3_, (gdouble) _tmp4_, (gdouble) _tmp5_); + _tmp6_ = context; + cairo_set_source_rgb (_tmp6_, (gdouble) 0, (gdouble) 0, (gdouble) 0); + _tmp7_ = context; + _tmp8_ = self->priv->border_width; + cairo_set_line_width (_tmp7_, (gdouble) _tmp8_); + _tmp9_ = context; + _tmp10_ = self->priv->border_width; + _tmp11_ = self->priv->border_width; + _tmp12_ = self->priv->width; + _tmp13_ = self->priv->border_width; + _tmp14_ = self->priv->height; + _tmp15_ = self->priv->border_width; + cairo_rectangle (_tmp9_, ((gdouble) _tmp10_) / 2, ((gdouble) _tmp11_) / 2, (gdouble) (_tmp12_ - _tmp13_), (gdouble) (_tmp14_ - _tmp15_)); + _tmp16_ = context; + cairo_stroke (_tmp16_); + _tmp17_ = context; + _tmp18_ = self->priv->border_width; + _tmp19_ = self->priv->border_width; + cairo_translate (_tmp17_, (gdouble) _tmp18_, (gdouble) _tmp19_); + _tmp20_ = context; + _tmp21_ = self->priv->image; + gdk_cairo_set_source_pixbuf (_tmp20_, _tmp21_, (gdouble) 0, (gdouble) 0); + _tmp22_ = context; + cairo_paint (_tmp22_); + _tmp24_ = self->priv->page; + _tmp25_ = page_is_scanning (_tmp24_); + if (_tmp25_) { + Page* _tmp26_; + gboolean _tmp27_ = FALSE; + _tmp26_ = self->priv->page; + _tmp27_ = page_has_data (_tmp26_); + _tmp23_ = !_tmp27_; } else { - _tmp2_ = FALSE; + _tmp23_ = FALSE; } - if (_tmp2_) { + _tmp28_ = _tmp23_; + if (_tmp28_) { gdouble outer_radius = 0.0; + gint _tmp29_; + gint _tmp30_; + gint _tmp33_; gdouble arc; - gdouble _tmp5_; + gdouble _tmp34_; + gdouble _tmp35_; + gdouble _tmp36_ = 0.0; gdouble x; - gdouble _tmp6_; + gdouble _tmp37_; + gdouble _tmp38_; + gdouble _tmp39_ = 0.0; gdouble y; - gdouble _tmp7_; + gdouble _tmp40_; + gdouble _tmp41_; + gdouble _tmp42_; + gdouble _tmp43_; + gdouble _tmp44_ = 0.0; gdouble inner_radius; gdouble offset; - if (w > h) { - outer_radius = 0.15 * w; + _tmp29_ = w; + _tmp30_ = h; + if (_tmp29_ > _tmp30_) { + gint _tmp31_; + _tmp31_ = w; + outer_radius = 0.15 * _tmp31_; } else { - outer_radius = 0.15 * h; + gint _tmp32_; + _tmp32_ = h; + outer_radius = 0.15 * _tmp32_; } - arc = G_PI / self->priv->animate_n_segments; - _tmp5_ = sin (arc); - x = outer_radius * _tmp5_; - _tmp6_ = cos (arc); - y = outer_radius * (_tmp6_ - 1.0); - _tmp7_ = sqrt ((x * x) + (y * y)); - inner_radius = 0.6 * _tmp7_; + _tmp33_ = self->priv->animate_n_segments; + arc = G_PI / _tmp33_; + _tmp34_ = outer_radius; + _tmp35_ = arc; + _tmp36_ = sin (_tmp35_); + x = _tmp34_ * _tmp36_; + _tmp37_ = outer_radius; + _tmp38_ = arc; + _tmp39_ = cos (_tmp38_); + y = _tmp37_ * (_tmp39_ - 1.0); + _tmp40_ = x; + _tmp41_ = x; + _tmp42_ = y; + _tmp43_ = y; + _tmp44_ = sqrt ((_tmp40_ * _tmp41_) + (_tmp42_ * _tmp43_)); + inner_radius = 0.6 * _tmp44_; offset = 0.0; { gint i; i = 0; { - gboolean _tmp8_; - _tmp8_ = TRUE; + gboolean _tmp45_; + _tmp45_ = TRUE; while (TRUE) { - gdouble _tmp9_; - gdouble _tmp10_; - if (!_tmp8_) { - i++; - offset = offset + (arc * 2); + gboolean _tmp46_; + gint _tmp50_; + gint _tmp51_; + gint _tmp52_; + gdouble _tmp53_; + gdouble _tmp54_; + gdouble _tmp55_ = 0.0; + gint _tmp56_; + gdouble _tmp57_; + gdouble _tmp58_; + gdouble _tmp59_ = 0.0; + cairo_t* _tmp60_; + gdouble _tmp61_; + gdouble _tmp62_; + gdouble _tmp63_; + gint _tmp64_; + gint _tmp65_; + cairo_t* _tmp68_; + cairo_t* _tmp69_; + _tmp46_ = _tmp45_; + if (!_tmp46_) { + gint _tmp47_; + gdouble _tmp48_; + gdouble _tmp49_; + _tmp47_ = i; + i = _tmp47_ + 1; + _tmp48_ = offset; + _tmp49_ = arc; + offset = _tmp48_ + (_tmp49_ * 2); } - _tmp8_ = FALSE; - if (!(i < self->priv->animate_n_segments)) { + _tmp45_ = FALSE; + _tmp50_ = i; + _tmp51_ = self->priv->animate_n_segments; + if (!(_tmp50_ < _tmp51_)) { break; } - _tmp9_ = sin (offset); - x = (w / 2) + (outer_radius * _tmp9_); - _tmp10_ = cos (offset); - y = (h / 2) - (outer_radius * _tmp10_); - cairo_arc (context, x, y, inner_radius, (gdouble) 0, 2 * G_PI); - if (i == self->priv->animate_segment) { - cairo_set_source_rgb (context, 0.75, 0.75, 0.75); - cairo_fill_preserve (context); + _tmp52_ = w; + _tmp53_ = outer_radius; + _tmp54_ = offset; + _tmp55_ = sin (_tmp54_); + x = (_tmp52_ / 2) + (_tmp53_ * _tmp55_); + _tmp56_ = h; + _tmp57_ = outer_radius; + _tmp58_ = offset; + _tmp59_ = cos (_tmp58_); + y = (_tmp56_ / 2) - (_tmp57_ * _tmp59_); + _tmp60_ = context; + _tmp61_ = x; + _tmp62_ = y; + _tmp63_ = inner_radius; + cairo_arc (_tmp60_, _tmp61_, _tmp62_, _tmp63_, (gdouble) 0, 2 * G_PI); + _tmp64_ = i; + _tmp65_ = self->priv->animate_segment; + if (_tmp64_ == _tmp65_) { + cairo_t* _tmp66_; + cairo_t* _tmp67_; + _tmp66_ = context; + cairo_set_source_rgb (_tmp66_, 0.75, 0.75, 0.75); + _tmp67_ = context; + cairo_fill_preserve (_tmp67_); } - cairo_set_source_rgb (context, 0.5, 0.5, 0.5); - cairo_stroke (context); + _tmp68_ = context; + cairo_set_source_rgb (_tmp68_, 0.5, 0.5, 0.5); + _tmp69_ = context; + cairo_stroke (_tmp69_); } } } } - _tmp12_ = page_is_scanning (self->priv->page); - if (_tmp12_) { - gint _tmp13_; - _tmp13_ = page_get_scan_line (self->priv->page); - _tmp11_ = _tmp13_ > 0; + _tmp71_ = self->priv->page; + _tmp72_ = page_is_scanning (_tmp71_); + if (_tmp72_) { + Page* _tmp73_; + gint _tmp74_ = 0; + _tmp73_ = self->priv->page; + _tmp74_ = page_get_scan_line (_tmp73_); + _tmp70_ = _tmp74_ > 0; } else { - _tmp11_ = FALSE; + _tmp70_ = FALSE; } - if (_tmp11_) { - gint _tmp14_; + _tmp75_ = _tmp70_; + if (_tmp75_) { + Page* _tmp76_; + gint _tmp77_ = 0; gint scan_line; gdouble s = 0.0; gdouble x1 = 0.0; gdouble y1 = 0.0; gdouble x2 = 0.0; gdouble y2 = 0.0; - ScanDirection _tmp15_; - _tmp14_ = page_get_scan_line (self->priv->page); - scan_line = _tmp14_; - _tmp15_ = page_get_scan_direction (self->priv->page); - switch (_tmp15_) { + Page* _tmp78_; + ScanDirection _tmp79_ = 0; + cairo_t* _tmp107_; + gdouble _tmp108_; + gdouble _tmp109_; + cairo_t* _tmp110_; + gdouble _tmp111_; + gdouble _tmp112_; + cairo_t* _tmp113_; + cairo_t* _tmp114_; + _tmp76_ = self->priv->page; + _tmp77_ = page_get_scan_line (_tmp76_); + scan_line = _tmp77_; + _tmp78_ = self->priv->page; + _tmp79_ = page_get_scan_direction (_tmp78_); + switch (_tmp79_) { case SCAN_DIRECTION_TOP_TO_BOTTOM: { - gint _tmp16_; - _tmp16_ = page_view_page_to_screen_y (self, scan_line); - s = (gdouble) _tmp16_; + gint _tmp80_; + gint _tmp81_ = 0; + gdouble _tmp82_; + gint _tmp83_; + gdouble _tmp84_; + _tmp80_ = scan_line; + _tmp81_ = page_view_page_to_screen_y (self, _tmp80_); + s = (gdouble) _tmp81_; x1 = (gdouble) 0; - y1 = s + 0.5; - x2 = (gdouble) w; - y2 = s + 0.5; + _tmp82_ = s; + y1 = _tmp82_ + 0.5; + _tmp83_ = w; + x2 = (gdouble) _tmp83_; + _tmp84_ = s; + y2 = _tmp84_ + 0.5; break; } case SCAN_DIRECTION_BOTTOM_TO_TOP: { - gint _tmp17_; - _tmp17_ = page_view_page_to_screen_y (self, scan_line); - s = (gdouble) _tmp17_; + gint _tmp85_; + gint _tmp86_ = 0; + gint _tmp87_; + gdouble _tmp88_; + gint _tmp89_; + gint _tmp90_; + gdouble _tmp91_; + _tmp85_ = scan_line; + _tmp86_ = page_view_page_to_screen_y (self, _tmp85_); + s = (gdouble) _tmp86_; x1 = (gdouble) 0; - y1 = (h - s) + 0.5; - x2 = (gdouble) w; - y2 = (h - s) + 0.5; + _tmp87_ = h; + _tmp88_ = s; + y1 = (_tmp87_ - _tmp88_) + 0.5; + _tmp89_ = w; + x2 = (gdouble) _tmp89_; + _tmp90_ = h; + _tmp91_ = s; + y2 = (_tmp90_ - _tmp91_) + 0.5; break; } case SCAN_DIRECTION_LEFT_TO_RIGHT: { - gint _tmp18_; - _tmp18_ = page_view_page_to_screen_x (self, scan_line); - s = (gdouble) _tmp18_; - x1 = s + 0.5; + gint _tmp92_; + gint _tmp93_ = 0; + gdouble _tmp94_; + gdouble _tmp95_; + gint _tmp96_; + _tmp92_ = scan_line; + _tmp93_ = page_view_page_to_screen_x (self, _tmp92_); + s = (gdouble) _tmp93_; + _tmp94_ = s; + x1 = _tmp94_ + 0.5; y1 = (gdouble) 0; - x2 = s + 0.5; - y2 = (gdouble) h; + _tmp95_ = s; + x2 = _tmp95_ + 0.5; + _tmp96_ = h; + y2 = (gdouble) _tmp96_; break; } case SCAN_DIRECTION_RIGHT_TO_LEFT: { - gint _tmp19_; - _tmp19_ = page_view_page_to_screen_x (self, scan_line); - s = (gdouble) _tmp19_; - x1 = (w - s) + 0.5; + gint _tmp97_; + gint _tmp98_ = 0; + gint _tmp99_; + gdouble _tmp100_; + gint _tmp101_; + gdouble _tmp102_; + gint _tmp103_; + _tmp97_ = scan_line; + _tmp98_ = page_view_page_to_screen_x (self, _tmp97_); + s = (gdouble) _tmp98_; + _tmp99_ = w; + _tmp100_ = s; + x1 = (_tmp99_ - _tmp100_) + 0.5; y1 = (gdouble) 0; - x2 = (w - s) + 0.5; - y2 = (gdouble) h; + _tmp101_ = w; + _tmp102_ = s; + x2 = (_tmp101_ - _tmp102_) + 0.5; + _tmp103_ = h; + y2 = (gdouble) _tmp103_; break; } default: { + gdouble _tmp104_; + gdouble _tmp105_; + gdouble _tmp106_; y2 = (gdouble) 0; - x2 = y2; - y1 = x2; - x1 = y1; + _tmp104_ = y2; + x2 = _tmp104_; + _tmp105_ = x2; + y1 = _tmp105_; + _tmp106_ = y1; + x1 = _tmp106_; break; } } - cairo_move_to (context, x1, y1); - cairo_line_to (context, x2, y2); - cairo_set_source_rgb (context, 1.0, 0.0, 0.0); - cairo_stroke (context); + _tmp107_ = context; + _tmp108_ = x1; + _tmp109_ = y1; + cairo_move_to (_tmp107_, _tmp108_, _tmp109_); + _tmp110_ = context; + _tmp111_ = x2; + _tmp112_ = y2; + cairo_line_to (_tmp110_, _tmp111_, _tmp112_); + _tmp113_ = context; + cairo_set_source_rgb (_tmp113_, 1.0, 0.0, 0.0); + _tmp114_ = context; + cairo_stroke (_tmp114_); } - _tmp20_ = page_has_crop (self->priv->page); - if (_tmp20_) { + _tmp115_ = self->priv->page; + _tmp116_ = page_has_crop (_tmp115_); + if (_tmp116_) { gint x = 0; gint y = 0; gint crop_width = 0; gint crop_height = 0; - gint _tmp21_; - gint _tmp22_; - gint _tmp23_; - gint _tmp24_; - gint _tmp25_; + Page* _tmp117_; + gint _tmp118_ = 0; + gint _tmp119_ = 0; + gint _tmp120_ = 0; + gint _tmp121_ = 0; + gint _tmp122_; + gint _tmp123_ = 0; gint dx; - gint _tmp26_; + gint _tmp124_; + gint _tmp125_ = 0; gint dy; - gint _tmp27_; + gint _tmp126_; + gint _tmp127_ = 0; gint dw; - gint _tmp28_; + gint _tmp128_; + gint _tmp129_ = 0; gint dh; - page_get_crop (self->priv->page, &_tmp21_, &_tmp22_, &_tmp23_, &_tmp24_); - x = _tmp21_; - y = _tmp22_; - crop_width = _tmp23_; - crop_height = _tmp24_; - _tmp25_ = page_view_page_to_screen_x (self, x); - dx = _tmp25_; - _tmp26_ = page_view_page_to_screen_y (self, y); - dy = _tmp26_; - _tmp27_ = page_view_page_to_screen_x (self, crop_width); - dw = _tmp27_; - _tmp28_ = page_view_page_to_screen_y (self, crop_height); - dh = _tmp28_; - cairo_rectangle (context, (gdouble) 0, (gdouble) 0, (gdouble) w, (gdouble) h); - cairo_new_sub_path (context); - cairo_rectangle (context, (gdouble) dx, (gdouble) dy, (gdouble) dw, (gdouble) dh); - cairo_set_fill_rule (context, CAIRO_FILL_RULE_EVEN_ODD); - cairo_set_source_rgba (context, 0.25, 0.25, 0.25, 0.2); - cairo_fill (context); - cairo_rectangle (context, dx - 1.5, dy - 1.5, (gdouble) (dw + 3), (gdouble) (dh + 3)); - cairo_set_source_rgb (context, 1.0, 1.0, 1.0); - cairo_stroke (context); - cairo_rectangle (context, dx - 0.5, dy - 0.5, (gdouble) (dw + 1), (gdouble) (dh + 1)); - cairo_set_source_rgb (context, 0.0, 0.0, 0.0); - cairo_stroke (context); + cairo_t* _tmp130_; + gint _tmp131_; + gint _tmp132_; + cairo_t* _tmp133_; + cairo_t* _tmp134_; + gint _tmp135_; + gint _tmp136_; + gint _tmp137_; + gint _tmp138_; + cairo_t* _tmp139_; + cairo_t* _tmp140_; + cairo_t* _tmp141_; + cairo_t* _tmp142_; + gint _tmp143_; + gint _tmp144_; + gint _tmp145_; + gint _tmp146_; + cairo_t* _tmp147_; + cairo_t* _tmp148_; + cairo_t* _tmp149_; + gint _tmp150_; + gint _tmp151_; + gint _tmp152_; + gint _tmp153_; + cairo_t* _tmp154_; + cairo_t* _tmp155_; + _tmp117_ = self->priv->page; + page_get_crop (_tmp117_, &_tmp118_, &_tmp119_, &_tmp120_, &_tmp121_); + x = _tmp118_; + y = _tmp119_; + crop_width = _tmp120_; + crop_height = _tmp121_; + _tmp122_ = x; + _tmp123_ = page_view_page_to_screen_x (self, _tmp122_); + dx = _tmp123_; + _tmp124_ = y; + _tmp125_ = page_view_page_to_screen_y (self, _tmp124_); + dy = _tmp125_; + _tmp126_ = crop_width; + _tmp127_ = page_view_page_to_screen_x (self, _tmp126_); + dw = _tmp127_; + _tmp128_ = crop_height; + _tmp129_ = page_view_page_to_screen_y (self, _tmp128_); + dh = _tmp129_; + _tmp130_ = context; + _tmp131_ = w; + _tmp132_ = h; + cairo_rectangle (_tmp130_, (gdouble) 0, (gdouble) 0, (gdouble) _tmp131_, (gdouble) _tmp132_); + _tmp133_ = context; + cairo_new_sub_path (_tmp133_); + _tmp134_ = context; + _tmp135_ = dx; + _tmp136_ = dy; + _tmp137_ = dw; + _tmp138_ = dh; + cairo_rectangle (_tmp134_, (gdouble) _tmp135_, (gdouble) _tmp136_, (gdouble) _tmp137_, (gdouble) _tmp138_); + _tmp139_ = context; + cairo_set_fill_rule (_tmp139_, CAIRO_FILL_RULE_EVEN_ODD); + _tmp140_ = context; + cairo_set_source_rgba (_tmp140_, 0.25, 0.25, 0.25, 0.2); + _tmp141_ = context; + cairo_fill (_tmp141_); + _tmp142_ = context; + _tmp143_ = dx; + _tmp144_ = dy; + _tmp145_ = dw; + _tmp146_ = dh; + cairo_rectangle (_tmp142_, _tmp143_ - 1.5, _tmp144_ - 1.5, (gdouble) (_tmp145_ + 3), (gdouble) (_tmp146_ + 3)); + _tmp147_ = context; + cairo_set_source_rgb (_tmp147_, 1.0, 1.0, 1.0); + _tmp148_ = context; + cairo_stroke (_tmp148_); + _tmp149_ = context; + _tmp150_ = dx; + _tmp151_ = dy; + _tmp152_ = dw; + _tmp153_ = dh; + cairo_rectangle (_tmp149_, _tmp150_ - 0.5, _tmp151_ - 0.5, (gdouble) (_tmp152_ + 1), (gdouble) (_tmp153_ + 1)); + _tmp154_ = context; + cairo_set_source_rgb (_tmp154_, 0.0, 0.0, 0.0); + _tmp155_ = context; + cairo_stroke (_tmp155_); } } void page_view_set_width (PageView* self, gint width) { gint _tmp0_; - gint _tmp1_; + Page* _tmp1_; + gint _tmp2_ = 0; + Page* _tmp3_; + gint _tmp4_ = 0; gint height; - gboolean _tmp2_ = FALSE; + gboolean _tmp5_ = FALSE; + gint _tmp6_; + gint _tmp7_; + gboolean _tmp10_; + gint _tmp11_; + gint _tmp12_; g_return_if_fail (self != NULL); - _tmp0_ = page_get_height (self->priv->page); - _tmp1_ = page_get_width (self->priv->page); - height = (gint) ((((gdouble) width) * _tmp0_) / _tmp1_); - if (self->priv->width == width) { - _tmp2_ = self->priv->height == height; + _tmp0_ = width; + _tmp1_ = self->priv->page; + _tmp2_ = page_get_height (_tmp1_); + _tmp3_ = self->priv->page; + _tmp4_ = page_get_width (_tmp3_); + height = (gint) ((((gdouble) _tmp0_) * _tmp2_) / _tmp4_); + _tmp6_ = self->priv->width; + _tmp7_ = width; + if (_tmp6_ == _tmp7_) { + gint _tmp8_; + gint _tmp9_; + _tmp8_ = self->priv->height; + _tmp9_ = height; + _tmp5_ = _tmp8_ == _tmp9_; } else { - _tmp2_ = FALSE; + _tmp5_ = FALSE; } - if (_tmp2_) { + _tmp10_ = _tmp5_; + if (_tmp10_) { return; } - self->priv->width = width; - self->priv->height = height; + _tmp11_ = width; + self->priv->width = _tmp11_; + _tmp12_ = height; + self->priv->height = _tmp12_; self->priv->update_image = TRUE; g_signal_emit_by_name (self, "size-changed"); g_signal_emit_by_name (self, "changed"); @@ -1846,23 +4012,43 @@ void page_view_set_width (PageView* self, gint width) { void page_view_set_height (PageView* self, gint height) { gint _tmp0_; - gint _tmp1_; + Page* _tmp1_; + gint _tmp2_ = 0; + Page* _tmp3_; + gint _tmp4_ = 0; gint width; - gboolean _tmp2_ = FALSE; + gboolean _tmp5_ = FALSE; + gint _tmp6_; + gint _tmp7_; + gboolean _tmp10_; + gint _tmp11_; + gint _tmp12_; g_return_if_fail (self != NULL); - _tmp0_ = page_get_width (self->priv->page); - _tmp1_ = page_get_height (self->priv->page); - width = (gint) ((((gdouble) height) * _tmp0_) / _tmp1_); - if (self->priv->width == width) { - _tmp2_ = self->priv->height == height; + _tmp0_ = height; + _tmp1_ = self->priv->page; + _tmp2_ = page_get_width (_tmp1_); + _tmp3_ = self->priv->page; + _tmp4_ = page_get_height (_tmp3_); + width = (gint) ((((gdouble) _tmp0_) * _tmp2_) / _tmp4_); + _tmp6_ = self->priv->width; + _tmp7_ = width; + if (_tmp6_ == _tmp7_) { + gint _tmp8_; + gint _tmp9_; + _tmp8_ = self->priv->height; + _tmp9_ = height; + _tmp5_ = _tmp8_ == _tmp9_; } else { - _tmp2_ = FALSE; + _tmp5_ = FALSE; } - if (_tmp2_) { + _tmp10_ = _tmp5_; + if (_tmp10_) { return; } - self->priv->width = width; - self->priv->height = height; + _tmp11_ = width; + self->priv->width = _tmp11_; + _tmp12_ = height; + self->priv->height = _tmp12_; self->priv->update_image = TRUE; g_signal_emit_by_name (self, "size-changed"); g_signal_emit_by_name (self, "changed"); @@ -1871,16 +4057,20 @@ void page_view_set_height (PageView* self, gint height) { gint page_view_get_width (PageView* self) { gint result = 0; + gint _tmp0_; g_return_val_if_fail (self != NULL, 0); - result = self->priv->width; + _tmp0_ = self->priv->width; + result = _tmp0_; return result; } gint page_view_get_height (PageView* self) { gint result = 0; + gint _tmp0_; g_return_val_if_fail (self != NULL, 0); - result = self->priv->height; + _tmp0_ = self->priv->height; + result = _tmp0_; return result; } diff --git a/src/page.c b/src/page.c index 581c577..eec34df 100644 --- a/src/page.c +++ b/src/page.c @@ -1,4 +1,4 @@ -/* page.c generated by valac 0.13.1, the Vala compiler +/* page.c generated by valac 0.13.4, the Vala compiler * generated from page.vala, do not modify */ /* @@ -280,21 +280,39 @@ GType scan_direction_get_type (void) { Page* page_construct (GType object_type, gint width, gint height, gint dpi, ScanDirection scan_direction) { Page* self = NULL; gboolean _tmp0_ = FALSE; + ScanDirection _tmp1_; + gboolean _tmp3_; + gint _tmp8_; + ScanDirection _tmp9_; self = (Page*) g_type_create_instance (object_type); - if (scan_direction == SCAN_DIRECTION_TOP_TO_BOTTOM) { + _tmp1_ = scan_direction; + if (_tmp1_ == SCAN_DIRECTION_TOP_TO_BOTTOM) { _tmp0_ = TRUE; } else { - _tmp0_ = scan_direction == SCAN_DIRECTION_BOTTOM_TO_TOP; + ScanDirection _tmp2_; + _tmp2_ = scan_direction; + _tmp0_ = _tmp2_ == SCAN_DIRECTION_BOTTOM_TO_TOP; } - if (_tmp0_) { - self->priv->width = width; - self->priv->n_rows = height; + _tmp3_ = _tmp0_; + if (_tmp3_) { + gint _tmp4_; + gint _tmp5_; + _tmp4_ = width; + self->priv->width = _tmp4_; + _tmp5_ = height; + self->priv->n_rows = _tmp5_; } else { - self->priv->width = height; - self->priv->n_rows = width; - } - self->priv->dpi = dpi; - self->priv->scan_direction = scan_direction; + gint _tmp6_; + gint _tmp7_; + _tmp6_ = height; + self->priv->width = _tmp6_; + _tmp7_ = width; + self->priv->n_rows = _tmp7_; + } + _tmp8_ = dpi; + self->priv->dpi = _tmp8_; + _tmp9_ = scan_direction; + self->priv->scan_direction = _tmp9_; return self; } @@ -305,29 +323,89 @@ Page* page_new (gint width, gint height, gint dpi, ScanDirection scan_direction) void page_set_page_info (Page* self, ScanPageInfo* info) { - gint _tmp0_; + ScanPageInfo* _tmp0_; + gint _tmp1_; + ScanPageInfo* _tmp2_; + gdouble _tmp3_; + ScanPageInfo* _tmp4_; + gint _tmp5_; + ScanPageInfo* _tmp6_; + gint _tmp7_; + gint _tmp8_; + ScanPageInfo* _tmp10_; + gint _tmp11_; + ScanPageInfo* _tmp12_; + gint _tmp13_; + gint _tmp14_; + gint _tmp15_; + gint _tmp16_; + gint _tmp17_; + gint _tmp18_; + gint _tmp19_ = 0; + guchar* _tmp20_; + gint _tmp20__length1; + gint _tmp21_; g_return_if_fail (self != NULL); g_return_if_fail (info != NULL); - self->priv->expected_rows = info->height; - self->priv->dpi = (gint) info->dpi; - self->priv->width = info->width; - self->priv->n_rows = info->height; - if (self->priv->n_rows < 0) { - self->priv->n_rows = self->priv->width / 2; - } - self->priv->depth = info->depth; - self->priv->n_channels = info->n_channels; - self->priv->rowstride = (((self->priv->width * self->priv->depth) * self->priv->n_channels) + 7) / 8; - _tmp0_ = self->priv->n_rows * self->priv->rowstride; - self->priv->pixels = g_renew (guchar, self->priv->pixels, self->priv->n_rows * self->priv->rowstride); - (_tmp0_ > self->priv->pixels_length1) ? memset (self->priv->pixels + self->priv->pixels_length1, 0, sizeof (guchar) * (_tmp0_ - self->priv->pixels_length1)) : NULL; - self->priv->pixels_length1 = _tmp0_; - self->priv->_pixels_size_ = _tmp0_; - g_return_if_fail (self->priv->pixels != NULL); - if (self->priv->depth == 1) { - memset (self->priv->pixels, 0x00, (gsize) (self->priv->n_rows * self->priv->rowstride)); + _tmp0_ = info; + _tmp1_ = _tmp0_->height; + self->priv->expected_rows = _tmp1_; + _tmp2_ = info; + _tmp3_ = _tmp2_->dpi; + self->priv->dpi = (gint) _tmp3_; + _tmp4_ = info; + _tmp5_ = _tmp4_->width; + self->priv->width = _tmp5_; + _tmp6_ = info; + _tmp7_ = _tmp6_->height; + self->priv->n_rows = _tmp7_; + _tmp8_ = self->priv->n_rows; + if (_tmp8_ < 0) { + gint _tmp9_; + _tmp9_ = self->priv->width; + self->priv->n_rows = _tmp9_ / 2; + } + _tmp10_ = info; + _tmp11_ = _tmp10_->depth; + self->priv->depth = _tmp11_; + _tmp12_ = info; + _tmp13_ = _tmp12_->n_channels; + self->priv->n_channels = _tmp13_; + _tmp14_ = self->priv->width; + _tmp15_ = self->priv->depth; + _tmp16_ = self->priv->n_channels; + self->priv->rowstride = (((_tmp14_ * _tmp15_) * _tmp16_) + 7) / 8; + _tmp17_ = self->priv->n_rows; + _tmp18_ = self->priv->rowstride; + _tmp19_ = _tmp17_ * _tmp18_; + self->priv->pixels = g_renew (guchar, self->priv->pixels, _tmp17_ * _tmp18_); + (_tmp19_ > self->priv->pixels_length1) ? memset (self->priv->pixels + self->priv->pixels_length1, 0, sizeof (guchar) * (_tmp19_ - self->priv->pixels_length1)) : NULL; + self->priv->pixels_length1 = _tmp19_; + self->priv->_pixels_size_ = _tmp19_; + _tmp20_ = self->priv->pixels; + _tmp20__length1 = self->priv->pixels_length1; + g_return_if_fail (_tmp20_ != NULL); + _tmp21_ = self->priv->depth; + if (_tmp21_ == 1) { + guchar* _tmp22_; + gint _tmp22__length1; + gint _tmp23_; + gint _tmp24_; + _tmp22_ = self->priv->pixels; + _tmp22__length1 = self->priv->pixels_length1; + _tmp23_ = self->priv->n_rows; + _tmp24_ = self->priv->rowstride; + memset (_tmp22_, 0x00, (gsize) (_tmp23_ * _tmp24_)); } else { - memset (self->priv->pixels, 0xFF, (gsize) (self->priv->n_rows * self->priv->rowstride)); + guchar* _tmp25_; + gint _tmp25__length1; + gint _tmp26_; + gint _tmp27_; + _tmp25_ = self->priv->pixels; + _tmp25__length1 = self->priv->pixels_length1; + _tmp26_ = self->priv->n_rows; + _tmp27_ = self->priv->rowstride; + memset (_tmp25_, 0xFF, (gsize) (_tmp26_ * _tmp27_)); } g_signal_emit_by_name (self, "size-changed"); g_signal_emit_by_name (self, "pixels-changed"); @@ -343,92 +421,167 @@ void page_start (Page* self) { gboolean page_is_scanning (Page* self) { gboolean result = FALSE; + gboolean _tmp0_; g_return_val_if_fail (self != NULL, FALSE); - result = self->priv->scanning; + _tmp0_ = self->priv->scanning; + result = _tmp0_; return result; } gboolean page_has_data (Page* self) { gboolean result = FALSE; + gboolean _tmp0_; g_return_val_if_fail (self != NULL, FALSE); - result = self->priv->has_data_; + _tmp0_ = self->priv->has_data_; + result = _tmp0_; return result; } gboolean page_is_color (Page* self) { gboolean result = FALSE; + gint _tmp0_; g_return_val_if_fail (self != NULL, FALSE); - result = self->priv->n_channels > 1; + _tmp0_ = self->priv->n_channels; + result = _tmp0_ > 1; return result; } gint page_get_scan_line (Page* self) { gint result = 0; + gint _tmp0_; g_return_val_if_fail (self != NULL, 0); - result = self->priv->scan_line; + _tmp0_ = self->priv->scan_line; + result = _tmp0_; return result; } static void page_parse_line (Page* self, ScanLine* line, gint n, gboolean* size_changed) { - gboolean _size_changed = FALSE; + gboolean _vala_size_changed = FALSE; gint line_number = 0; + ScanLine* _tmp0_; + gint _tmp1_; + gint _tmp2_; + gint _tmp13_; + gint _tmp14_; gint offset; + gint _tmp15_; + ScanLine* _tmp16_; + gint _tmp17_; gint line_offset; + gint _tmp33_; g_return_if_fail (self != NULL); g_return_if_fail (line != NULL); - line_number = line->number + n; - _size_changed = FALSE; + _tmp0_ = line; + _tmp1_ = _tmp0_->number; + _tmp2_ = n; + line_number = _tmp1_ + _tmp2_; + _vala_size_changed = FALSE; while (TRUE) { - gint _tmp0_; + gint _tmp3_; + gint _tmp4_ = 0; gint rows = 0; - gint _tmp1_; - _tmp0_ = page_get_scan_height (self); - if (!(line_number >= _tmp0_)) { + gint _tmp5_; + gint _tmp6_; + gint _tmp7_; + gint _tmp8_; + gint _tmp9_; + gint _tmp10_; + gint _tmp11_; + gint _tmp12_ = 0; + _tmp3_ = line_number; + _tmp4_ = page_get_scan_height (self); + if (!(_tmp3_ >= _tmp4_)) { break; } - rows = self->priv->n_rows; - self->priv->n_rows = rows + (self->priv->width / 2); - g_debug ("page.vala:151: Extending image from %d lines to %d lines", rows, self->priv->n_rows); - _tmp1_ = self->priv->n_rows * self->priv->rowstride; - self->priv->pixels = g_renew (guchar, self->priv->pixels, self->priv->n_rows * self->priv->rowstride); - (_tmp1_ > self->priv->pixels_length1) ? memset (self->priv->pixels + self->priv->pixels_length1, 0, sizeof (guchar) * (_tmp1_ - self->priv->pixels_length1)) : NULL; - self->priv->pixels_length1 = _tmp1_; - self->priv->_pixels_size_ = _tmp1_; - _size_changed = TRUE; - } - offset = line_number * self->priv->rowstride; - line_offset = n * line->data_length; + _tmp5_ = self->priv->n_rows; + rows = _tmp5_; + _tmp6_ = rows; + _tmp7_ = self->priv->width; + self->priv->n_rows = _tmp6_ + (_tmp7_ / 2); + _tmp8_ = rows; + _tmp9_ = self->priv->n_rows; + g_debug ("page.vala:151: Extending image from %d lines to %d lines", _tmp8_, _tmp9_); + _tmp10_ = self->priv->n_rows; + _tmp11_ = self->priv->rowstride; + _tmp12_ = _tmp10_ * _tmp11_; + self->priv->pixels = g_renew (guchar, self->priv->pixels, _tmp10_ * _tmp11_); + (_tmp12_ > self->priv->pixels_length1) ? memset (self->priv->pixels + self->priv->pixels_length1, 0, sizeof (guchar) * (_tmp12_ - self->priv->pixels_length1)) : NULL; + self->priv->pixels_length1 = _tmp12_; + self->priv->_pixels_size_ = _tmp12_; + _vala_size_changed = TRUE; + } + _tmp13_ = line_number; + _tmp14_ = self->priv->rowstride; + offset = _tmp13_ * _tmp14_; + _tmp15_ = n; + _tmp16_ = line; + _tmp17_ = _tmp16_->data_length; + line_offset = _tmp15_ * _tmp17_; { gint i; i = 0; { - gboolean _tmp2_; - _tmp2_ = TRUE; + gboolean _tmp18_; + _tmp18_ = TRUE; while (TRUE) { - if (!_tmp2_) { - i++; + gboolean _tmp19_; + gint _tmp21_; + ScanLine* _tmp22_; + gint _tmp23_; + guchar* _tmp24_; + gint _tmp24__length1; + gint _tmp25_; + gint _tmp26_; + ScanLine* _tmp27_; + guchar* _tmp28_; + gint _tmp28__length1; + gint _tmp29_; + gint _tmp30_; + guchar _tmp31_; + guchar _tmp32_; + _tmp19_ = _tmp18_; + if (!_tmp19_) { + gint _tmp20_; + _tmp20_ = i; + i = _tmp20_ + 1; } - _tmp2_ = FALSE; - if (!(i < line->data_length)) { + _tmp18_ = FALSE; + _tmp21_ = i; + _tmp22_ = line; + _tmp23_ = _tmp22_->data_length; + if (!(_tmp21_ < _tmp23_)) { break; } - self->priv->pixels[offset + i] = line->data[line_offset + i]; + _tmp24_ = self->priv->pixels; + _tmp24__length1 = self->priv->pixels_length1; + _tmp25_ = offset; + _tmp26_ = i; + _tmp27_ = line; + _tmp28_ = _tmp27_->data; + _tmp28__length1 = _tmp27_->data_length1; + _tmp29_ = line_offset; + _tmp30_ = i; + _tmp31_ = _tmp28_[_tmp29_ + _tmp30_]; + _tmp24_[_tmp25_ + _tmp26_] = _tmp31_; + _tmp32_ = _tmp24_[_tmp25_ + _tmp26_]; } } } - self->priv->scan_line = line_number; + _tmp33_ = line_number; + self->priv->scan_line = _tmp33_; if (size_changed) { - *size_changed = _size_changed; + *size_changed = _vala_size_changed; } } void page_parse_scan_line (Page* self, ScanLine* line) { gboolean size_has_changed; + gboolean _tmp9_; g_return_if_fail (self != NULL); g_return_if_fail (line != NULL); size_has_changed = FALSE; @@ -440,20 +593,35 @@ void page_parse_scan_line (Page* self, ScanLine* line) { _tmp0_ = TRUE; while (TRUE) { gboolean _tmp1_; - if (!_tmp0_) { - i++; + gint _tmp3_; + ScanLine* _tmp4_; + gint _tmp5_; + ScanLine* _tmp6_; + gint _tmp7_; + gboolean _tmp8_ = FALSE; + _tmp1_ = _tmp0_; + if (!_tmp1_) { + gint _tmp2_; + _tmp2_ = i; + i = _tmp2_ + 1; } _tmp0_ = FALSE; - if (!(i < line->n_lines)) { + _tmp3_ = i; + _tmp4_ = line; + _tmp5_ = _tmp4_->n_lines; + if (!(_tmp3_ < _tmp5_)) { break; } - page_parse_line (self, line, i, &_tmp1_); - size_has_changed = _tmp1_; + _tmp6_ = line; + _tmp7_ = i; + page_parse_line (self, _tmp6_, _tmp7_, &_tmp8_); + size_has_changed = _tmp8_; } } } self->priv->has_data_ = TRUE; - if (size_has_changed) { + _tmp9_ = size_has_changed; + if (_tmp9_) { g_signal_emit_by_name (self, "size-changed"); } g_signal_emit_by_name (self, "scan-line-changed"); @@ -464,30 +632,50 @@ void page_parse_scan_line (Page* self, ScanLine* line) { void page_finish (Page* self) { gboolean size_has_changed; gboolean _tmp0_ = FALSE; + gint _tmp1_; + gboolean _tmp4_; + gboolean _tmp12_; g_return_if_fail (self != NULL); size_has_changed = FALSE; - if (self->priv->expected_rows < 0) { - gint _tmp1_; - _tmp1_ = page_get_scan_height (self); - _tmp0_ = self->priv->scan_line != _tmp1_; + _tmp1_ = self->priv->expected_rows; + if (_tmp1_ < 0) { + gint _tmp2_; + gint _tmp3_ = 0; + _tmp2_ = self->priv->scan_line; + _tmp3_ = page_get_scan_height (self); + _tmp0_ = _tmp2_ != _tmp3_; } else { _tmp0_ = FALSE; } - if (_tmp0_) { + _tmp4_ = _tmp0_; + if (_tmp4_) { gint rows = 0; - gint _tmp2_; - rows = self->priv->n_rows; - self->priv->n_rows = self->priv->scan_line; - _tmp2_ = self->priv->n_rows * self->priv->rowstride; - self->priv->pixels = g_renew (guchar, self->priv->pixels, self->priv->n_rows * self->priv->rowstride); - (_tmp2_ > self->priv->pixels_length1) ? memset (self->priv->pixels + self->priv->pixels_length1, 0, sizeof (guchar) * (_tmp2_ - self->priv->pixels_length1)) : NULL; - self->priv->pixels_length1 = _tmp2_; - self->priv->_pixels_size_ = _tmp2_; - g_debug ("page.vala:193: Trimming page from %d lines to %d lines", rows, self->priv->n_rows); + gint _tmp5_; + gint _tmp6_; + gint _tmp7_; + gint _tmp8_; + gint _tmp9_ = 0; + gint _tmp10_; + gint _tmp11_; + _tmp5_ = self->priv->n_rows; + rows = _tmp5_; + _tmp6_ = self->priv->scan_line; + self->priv->n_rows = _tmp6_; + _tmp7_ = self->priv->n_rows; + _tmp8_ = self->priv->rowstride; + _tmp9_ = _tmp7_ * _tmp8_; + self->priv->pixels = g_renew (guchar, self->priv->pixels, _tmp7_ * _tmp8_); + (_tmp9_ > self->priv->pixels_length1) ? memset (self->priv->pixels + self->priv->pixels_length1, 0, sizeof (guchar) * (_tmp9_ - self->priv->pixels_length1)) : NULL; + self->priv->pixels_length1 = _tmp9_; + self->priv->_pixels_size_ = _tmp9_; + _tmp10_ = rows; + _tmp11_ = self->priv->n_rows; + g_debug ("page.vala:193: Trimming page from %d lines to %d lines", _tmp10_, _tmp11_); size_has_changed = TRUE; } self->priv->scanning = FALSE; - if (size_has_changed) { + _tmp12_ = size_has_changed; + if (_tmp12_) { g_signal_emit_by_name (self, "size-changed"); } g_signal_emit_by_name (self, "scan-line-changed"); @@ -496,8 +684,10 @@ void page_finish (Page* self) { ScanDirection page_get_scan_direction (Page* self) { ScanDirection result = 0; + ScanDirection _tmp0_; g_return_val_if_fail (self != NULL, 0); - result = self->priv->scan_direction; + _tmp0_ = self->priv->scan_direction; + result = _tmp0_; return result; } @@ -508,72 +698,145 @@ static void page_set_scan_direction (Page* self, ScanDirection direction) { gboolean size_has_changed; gint width = 0; gint height = 0; - gint _tmp0_; - gint _tmp1_; + ScanDirection _tmp0_; + ScanDirection _tmp1_; + ScanDirection _tmp2_; + ScanDirection _tmp3_; + gint _tmp4_; + gint _tmp6_; + gint _tmp7_ = 0; + gint _tmp8_ = 0; + gboolean _tmp9_; + ScanDirection _tmp33_; + gboolean _tmp34_; + gboolean _tmp35_; g_return_if_fail (self != NULL); size_has_changed = FALSE; - if (self->priv->scan_direction == direction) { + _tmp0_ = self->priv->scan_direction; + _tmp1_ = direction; + if (_tmp0_ == _tmp1_) { return; } - left_steps = (gint) (direction - self->priv->scan_direction); - if (left_steps < 0) { - left_steps = left_steps + 4; + _tmp2_ = direction; + _tmp3_ = self->priv->scan_direction; + left_steps = (gint) (_tmp2_ - _tmp3_); + _tmp4_ = left_steps; + if (_tmp4_ < 0) { + gint _tmp5_; + _tmp5_ = left_steps; + left_steps = _tmp5_ + 4; } - if (left_steps != 2) { + _tmp6_ = left_steps; + if (_tmp6_ != 2) { size_has_changed = TRUE; } - _tmp0_ = page_get_width (self); - width = _tmp0_; - _tmp1_ = page_get_height (self); - height = _tmp1_; - if (self->priv->has_crop_) { - switch (left_steps) { + _tmp7_ = page_get_width (self); + width = _tmp7_; + _tmp8_ = page_get_height (self); + height = _tmp8_; + _tmp9_ = self->priv->has_crop_; + if (_tmp9_) { + gint _tmp10_; + _tmp10_ = left_steps; + switch (_tmp10_) { case 1: { - t = self->priv->crop_x; - self->priv->crop_x = self->priv->crop_y; - self->priv->crop_y = width - (t + self->priv->crop_width); - t = self->priv->crop_width; - self->priv->crop_width = self->priv->crop_height; - self->priv->crop_height = t; + gint _tmp11_; + gint _tmp12_; + gint _tmp13_; + gint _tmp14_; + gint _tmp15_; + gint _tmp16_; + gint _tmp17_; + gint _tmp18_; + _tmp11_ = self->priv->crop_x; + t = _tmp11_; + _tmp12_ = self->priv->crop_y; + self->priv->crop_x = _tmp12_; + _tmp13_ = width; + _tmp14_ = t; + _tmp15_ = self->priv->crop_width; + self->priv->crop_y = _tmp13_ - (_tmp14_ + _tmp15_); + _tmp16_ = self->priv->crop_width; + t = _tmp16_; + _tmp17_ = self->priv->crop_height; + self->priv->crop_width = _tmp17_; + _tmp18_ = t; + self->priv->crop_height = _tmp18_; break; } case 2: { - self->priv->crop_x = width - (self->priv->crop_x + self->priv->crop_width); - self->priv->crop_y = width - (self->priv->crop_y + self->priv->crop_height); + gint _tmp19_; + gint _tmp20_; + gint _tmp21_; + gint _tmp22_; + gint _tmp23_; + gint _tmp24_; + _tmp19_ = width; + _tmp20_ = self->priv->crop_x; + _tmp21_ = self->priv->crop_width; + self->priv->crop_x = _tmp19_ - (_tmp20_ + _tmp21_); + _tmp22_ = width; + _tmp23_ = self->priv->crop_y; + _tmp24_ = self->priv->crop_height; + self->priv->crop_y = _tmp22_ - (_tmp23_ + _tmp24_); break; } case 3: { - t = self->priv->crop_y; - self->priv->crop_y = self->priv->crop_x; - self->priv->crop_x = height - (t + self->priv->crop_height); - t = self->priv->crop_width; - self->priv->crop_width = self->priv->crop_height; - self->priv->crop_height = t; + gint _tmp25_; + gint _tmp26_; + gint _tmp27_; + gint _tmp28_; + gint _tmp29_; + gint _tmp30_; + gint _tmp31_; + gint _tmp32_; + _tmp25_ = self->priv->crop_y; + t = _tmp25_; + _tmp26_ = self->priv->crop_x; + self->priv->crop_y = _tmp26_; + _tmp27_ = height; + _tmp28_ = t; + _tmp29_ = self->priv->crop_height; + self->priv->crop_x = _tmp27_ - (_tmp28_ + _tmp29_); + _tmp30_ = self->priv->crop_width; + t = _tmp30_; + _tmp31_ = self->priv->crop_height; + self->priv->crop_width = _tmp31_; + _tmp32_ = t; + self->priv->crop_height = _tmp32_; break; } default: break; } } - self->priv->scan_direction = direction; - if (size_has_changed) { + _tmp33_ = direction; + self->priv->scan_direction = _tmp33_; + _tmp34_ = size_has_changed; + if (_tmp34_) { g_signal_emit_by_name (self, "size-changed"); } g_signal_emit_by_name (self, "scan-direction-changed"); - if (self->priv->has_crop_) { + _tmp35_ = self->priv->has_crop_; + if (_tmp35_) { g_signal_emit_by_name (self, "crop-changed"); } } void page_rotate_left (Page* self) { + ScanDirection _tmp0_; ScanDirection direction; + ScanDirection _tmp1_; + ScanDirection _tmp2_; g_return_if_fail (self != NULL); - direction = self->priv->scan_direction; - switch (direction) { + _tmp0_ = self->priv->scan_direction; + direction = _tmp0_; + _tmp1_ = direction; + switch (_tmp1_) { case SCAN_DIRECTION_TOP_TO_BOTTOM: { direction = SCAN_DIRECTION_LEFT_TO_RIGHT; @@ -597,15 +860,21 @@ void page_rotate_left (Page* self) { default: break; } - page_set_scan_direction (self, direction); + _tmp2_ = direction; + page_set_scan_direction (self, _tmp2_); } void page_rotate_right (Page* self) { + ScanDirection _tmp0_; ScanDirection direction; + ScanDirection _tmp1_; + ScanDirection _tmp2_; g_return_if_fail (self != NULL); - direction = self->priv->scan_direction; - switch (direction) { + _tmp0_ = self->priv->scan_direction; + direction = _tmp0_; + _tmp1_ = direction; + switch (_tmp1_) { case SCAN_DIRECTION_TOP_TO_BOTTOM: { direction = SCAN_DIRECTION_RIGHT_TO_LEFT; @@ -629,22 +898,25 @@ void page_rotate_right (Page* self) { default: break; } - page_set_scan_direction (self, direction); + _tmp2_ = direction; + page_set_scan_direction (self, _tmp2_); } gint page_get_dpi (Page* self) { gint result = 0; + gint _tmp0_; g_return_val_if_fail (self != NULL, 0); - result = self->priv->dpi; + _tmp0_ = self->priv->dpi; + result = _tmp0_; return result; } gboolean page_is_landscape (Page* self) { gboolean result = FALSE; - gint _tmp0_; - gint _tmp1_; + gint _tmp0_ = 0; + gint _tmp1_ = 0; g_return_val_if_fail (self != NULL, FALSE); _tmp0_ = page_get_width (self); _tmp1_ = page_get_height (self); @@ -656,17 +928,27 @@ gboolean page_is_landscape (Page* self) { gint page_get_width (Page* self) { gint result = 0; gboolean _tmp0_ = FALSE; + ScanDirection _tmp1_; + gboolean _tmp3_; g_return_val_if_fail (self != NULL, 0); - if (self->priv->scan_direction == SCAN_DIRECTION_TOP_TO_BOTTOM) { + _tmp1_ = self->priv->scan_direction; + if (_tmp1_ == SCAN_DIRECTION_TOP_TO_BOTTOM) { _tmp0_ = TRUE; } else { - _tmp0_ = self->priv->scan_direction == SCAN_DIRECTION_BOTTOM_TO_TOP; - } - if (_tmp0_) { - result = self->priv->width; + ScanDirection _tmp2_; + _tmp2_ = self->priv->scan_direction; + _tmp0_ = _tmp2_ == SCAN_DIRECTION_BOTTOM_TO_TOP; + } + _tmp3_ = _tmp0_; + if (_tmp3_) { + gint _tmp4_; + _tmp4_ = self->priv->width; + result = _tmp4_; return result; } else { - result = self->priv->n_rows; + gint _tmp5_; + _tmp5_ = self->priv->n_rows; + result = _tmp5_; return result; } } @@ -675,17 +957,27 @@ gint page_get_width (Page* self) { gint page_get_height (Page* self) { gint result = 0; gboolean _tmp0_ = FALSE; + ScanDirection _tmp1_; + gboolean _tmp3_; g_return_val_if_fail (self != NULL, 0); - if (self->priv->scan_direction == SCAN_DIRECTION_TOP_TO_BOTTOM) { + _tmp1_ = self->priv->scan_direction; + if (_tmp1_ == SCAN_DIRECTION_TOP_TO_BOTTOM) { _tmp0_ = TRUE; } else { - _tmp0_ = self->priv->scan_direction == SCAN_DIRECTION_BOTTOM_TO_TOP; - } - if (_tmp0_) { - result = self->priv->n_rows; + ScanDirection _tmp2_; + _tmp2_ = self->priv->scan_direction; + _tmp0_ = _tmp2_ == SCAN_DIRECTION_BOTTOM_TO_TOP; + } + _tmp3_ = _tmp0_; + if (_tmp3_) { + gint _tmp4_; + _tmp4_ = self->priv->n_rows; + result = _tmp4_; return result; } else { - result = self->priv->width; + gint _tmp5_; + _tmp5_ = self->priv->width; + result = _tmp5_; return result; } } @@ -693,66 +985,82 @@ gint page_get_height (Page* self) { gint page_get_depth (Page* self) { gint result = 0; + gint _tmp0_; g_return_val_if_fail (self != NULL, 0); - result = self->priv->depth; + _tmp0_ = self->priv->depth; + result = _tmp0_; return result; } gint page_get_n_channels (Page* self) { gint result = 0; + gint _tmp0_; g_return_val_if_fail (self != NULL, 0); - result = self->priv->n_channels; + _tmp0_ = self->priv->n_channels; + result = _tmp0_; return result; } gint page_get_rowstride (Page* self) { gint result = 0; + gint _tmp0_; g_return_val_if_fail (self != NULL, 0); - result = self->priv->rowstride; + _tmp0_ = self->priv->rowstride; + result = _tmp0_; return result; } gint page_get_scan_width (Page* self) { gint result = 0; + gint _tmp0_; g_return_val_if_fail (self != NULL, 0); - result = self->priv->width; + _tmp0_ = self->priv->width; + result = _tmp0_; return result; } gint page_get_scan_height (Page* self) { gint result = 0; + gint _tmp0_; g_return_val_if_fail (self != NULL, 0); - result = self->priv->n_rows; + _tmp0_ = self->priv->n_rows; + result = _tmp0_; return result; } void page_set_color_profile (Page* self, const gchar* color_profile) { - gchar* _tmp0_; + const gchar* _tmp0_; + gchar* _tmp1_; g_return_if_fail (self != NULL); - _tmp0_ = g_strdup (color_profile); + _tmp0_ = color_profile; + _tmp1_ = g_strdup (_tmp0_); _g_free0 (self->priv->color_profile); - self->priv->color_profile = _tmp0_; + self->priv->color_profile = _tmp1_; } gchar* page_get_color_profile (Page* self) { gchar* result = NULL; - gchar* _tmp0_; + const gchar* _tmp0_; + gchar* _tmp1_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = g_strdup (self->priv->color_profile); - result = _tmp0_; + _tmp0_ = self->priv->color_profile; + _tmp1_ = g_strdup (_tmp0_); + result = _tmp1_; return result; } void page_set_no_crop (Page* self) { + gboolean _tmp0_; g_return_if_fail (self != NULL); - if (!self->priv->has_crop_) { + _tmp0_ = self->priv->has_crop_; + if (!_tmp0_) { return; } self->priv->has_crop_ = FALSE; @@ -761,35 +1069,61 @@ void page_set_no_crop (Page* self) { void page_set_custom_crop (Page* self, gint width, gint height) { - gboolean _tmp0_ = FALSE; - gboolean _tmp1_ = FALSE; + gint _tmp0_; + gint _tmp1_; gboolean _tmp2_ = FALSE; + gboolean _tmp3_ = FALSE; + gboolean _tmp4_ = FALSE; + const gchar* _tmp5_; + gboolean _tmp7_; + gboolean _tmp10_; + gboolean _tmp13_; + gint _tmp14_; + gint _tmp15_; g_return_if_fail (self != NULL); - g_return_if_fail (width >= 1); - g_return_if_fail (height >= 1); - if (self->priv->crop_name == NULL) { - _tmp2_ = self->priv->has_crop_; + _tmp0_ = width; + g_return_if_fail (_tmp0_ >= 1); + _tmp1_ = height; + g_return_if_fail (_tmp1_ >= 1); + _tmp5_ = self->priv->crop_name; + if (_tmp5_ == NULL) { + gboolean _tmp6_; + _tmp6_ = self->priv->has_crop_; + _tmp4_ = _tmp6_; } else { - _tmp2_ = FALSE; + _tmp4_ = FALSE; } - if (_tmp2_) { - _tmp1_ = self->priv->crop_width == width; + _tmp7_ = _tmp4_; + if (_tmp7_) { + gint _tmp8_; + gint _tmp9_; + _tmp8_ = self->priv->crop_width; + _tmp9_ = width; + _tmp3_ = _tmp8_ == _tmp9_; } else { - _tmp1_ = FALSE; - } - if (_tmp1_) { - _tmp0_ = self->priv->crop_height == height; + _tmp3_ = FALSE; + } + _tmp10_ = _tmp3_; + if (_tmp10_) { + gint _tmp11_; + gint _tmp12_; + _tmp11_ = self->priv->crop_height; + _tmp12_ = height; + _tmp2_ = _tmp11_ == _tmp12_; } else { - _tmp0_ = FALSE; + _tmp2_ = FALSE; } - if (_tmp0_) { + _tmp13_ = _tmp2_; + if (_tmp13_) { return; } _g_free0 (self->priv->crop_name); self->priv->crop_name = NULL; self->priv->has_crop_ = TRUE; - self->priv->crop_width = width; - self->priv->crop_height = height; + _tmp14_ = width; + self->priv->crop_width = _tmp14_; + _tmp15_ = height; + self->priv->crop_height = _tmp15_; g_signal_emit_by_name (self, "crop-changed"); } @@ -798,23 +1132,36 @@ void page_set_named_crop (Page* self, const gchar* name) { gdouble width = 0.0; gdouble height = 0.0; const gchar* _tmp0_; - GQuark _tmp1_; - static GQuark _tmp1__label0 = 0; - static GQuark _tmp1__label1 = 0; - static GQuark _tmp1__label2 = 0; - static GQuark _tmp1__label3 = 0; - static GQuark _tmp1__label4 = 0; - static GQuark _tmp1__label5 = 0; - gchar* _tmp2_; - gint _tmp3_; + const gchar* _tmp1_; + 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; + static GQuark _tmp2_label5 = 0; + const gchar* _tmp5_; + gchar* _tmp6_; + gint _tmp7_ = 0; gint pw; - gint _tmp4_; + gint _tmp8_ = 0; gint ph; + gint _tmp9_; + gint _tmp10_; + gdouble _tmp14_; + gint _tmp15_; + gdouble _tmp16_; + gint _tmp17_; + gint _tmp18_; + gint _tmp19_; + gint _tmp22_; + gint _tmp23_; g_return_if_fail (self != NULL); g_return_if_fail (name != NULL); _tmp0_ = name; - _tmp1_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_); - if (_tmp1_ == ((0 != _tmp1__label0) ? _tmp1__label0 : (_tmp1__label0 = g_quark_from_static_string ("A4")))) { + _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 ("A4")))) { switch (0) { default: { @@ -823,7 +1170,7 @@ void page_set_named_crop (Page* self, const gchar* name) { break; } } - } else if (_tmp1_ == ((0 != _tmp1__label1) ? _tmp1__label1 : (_tmp1__label1 = g_quark_from_static_string ("A5")))) { + } else if (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("A5")))) { switch (0) { default: { @@ -832,7 +1179,7 @@ void page_set_named_crop (Page* self, const gchar* name) { break; } } - } else if (_tmp1_ == ((0 != _tmp1__label2) ? _tmp1__label2 : (_tmp1__label2 = g_quark_from_static_string ("A6")))) { + } else if (_tmp3_ == ((0 != _tmp2_label2) ? _tmp2_label2 : (_tmp2_label2 = g_quark_from_static_string ("A6")))) { switch (0) { default: { @@ -841,7 +1188,7 @@ void page_set_named_crop (Page* self, const gchar* name) { break; } } - } else if (_tmp1_ == ((0 != _tmp1__label3) ? _tmp1__label3 : (_tmp1__label3 = g_quark_from_static_string ("letter")))) { + } else if (_tmp3_ == ((0 != _tmp2_label3) ? _tmp2_label3 : (_tmp2_label3 = g_quark_from_static_string ("letter")))) { switch (0) { default: { @@ -850,7 +1197,7 @@ void page_set_named_crop (Page* self, const gchar* name) { break; } } - } else if (_tmp1_ == ((0 != _tmp1__label4) ? _tmp1__label4 : (_tmp1__label4 = g_quark_from_static_string ("legal")))) { + } else if (_tmp3_ == ((0 != _tmp2_label4) ? _tmp2_label4 : (_tmp2_label4 = g_quark_from_static_string ("legal")))) { switch (0) { default: { @@ -859,7 +1206,7 @@ void page_set_named_crop (Page* self, const gchar* name) { break; } } - } else if (_tmp1_ == ((0 != _tmp1__label5) ? _tmp1__label5 : (_tmp1__label5 = g_quark_from_static_string ("4x6")))) { + } else if (_tmp3_ == ((0 != _tmp2_label5) ? _tmp2_label5 : (_tmp2_label5 = g_quark_from_static_string ("4x6")))) { switch (0) { default: { @@ -872,34 +1219,61 @@ void page_set_named_crop (Page* self, const gchar* name) { switch (0) { default: { - g_warning ("page.vala:437: Unknown paper size '%s'", name); + const gchar* _tmp4_; + _tmp4_ = name; + g_warning ("page.vala:437: Unknown paper size '%s'", _tmp4_); return; } } } - _tmp2_ = g_strdup (name); + _tmp5_ = name; + _tmp6_ = g_strdup (_tmp5_); _g_free0 (self->priv->crop_name); - self->priv->crop_name = _tmp2_; + self->priv->crop_name = _tmp6_; self->priv->has_crop_ = TRUE; - _tmp3_ = page_get_width (self); - pw = _tmp3_; - _tmp4_ = page_get_height (self); - ph = _tmp4_; - if (pw > ph) { + _tmp7_ = page_get_width (self); + pw = _tmp7_; + _tmp8_ = page_get_height (self); + ph = _tmp8_; + _tmp9_ = pw; + _tmp10_ = ph; + if (_tmp9_ > _tmp10_) { gdouble t = 0.0; - t = width; - width = height; - height = t; - } - self->priv->crop_width = (gint) ((width * self->priv->dpi) + 0.5); - self->priv->crop_height = (gint) ((height * self->priv->dpi) + 0.5); - if (self->priv->crop_width < pw) { - self->priv->crop_x = (pw - self->priv->crop_width) / 2; + gdouble _tmp11_; + gdouble _tmp12_; + gdouble _tmp13_; + _tmp11_ = width; + t = _tmp11_; + _tmp12_ = height; + width = _tmp12_; + _tmp13_ = t; + height = _tmp13_; + } + _tmp14_ = width; + _tmp15_ = self->priv->dpi; + self->priv->crop_width = (gint) ((_tmp14_ * _tmp15_) + 0.5); + _tmp16_ = height; + _tmp17_ = self->priv->dpi; + self->priv->crop_height = (gint) ((_tmp16_ * _tmp17_) + 0.5); + _tmp18_ = self->priv->crop_width; + _tmp19_ = pw; + if (_tmp18_ < _tmp19_) { + gint _tmp20_; + gint _tmp21_; + _tmp20_ = pw; + _tmp21_ = self->priv->crop_width; + self->priv->crop_x = (_tmp20_ - _tmp21_) / 2; } else { self->priv->crop_x = 0; } - if (self->priv->crop_height < ph) { - self->priv->crop_y = (ph - self->priv->crop_height) / 2; + _tmp22_ = self->priv->crop_height; + _tmp23_ = ph; + if (_tmp22_ < _tmp23_) { + gint _tmp24_; + gint _tmp25_; + _tmp24_ = ph; + _tmp25_ = self->priv->crop_height; + self->priv->crop_y = (_tmp24_ - _tmp25_) / 2; } else { self->priv->crop_y = 0; } @@ -910,50 +1284,100 @@ void page_set_named_crop (Page* self, const gchar* name) { void page_move_crop (Page* self, gint x, gint y) { gint _tmp0_; gint _tmp1_; + gint _tmp2_; + gint _tmp3_ = 0; + gint _tmp4_; + gint _tmp5_ = 0; + gint _tmp6_; + gint _tmp7_; g_return_if_fail (self != NULL); - g_return_if_fail (x >= 0); - g_return_if_fail (y >= 0); - _tmp0_ = page_get_width (self); - g_return_if_fail (x < _tmp0_); - _tmp1_ = page_get_height (self); - g_return_if_fail (y < _tmp1_); - self->priv->crop_x = x; - self->priv->crop_y = y; + _tmp0_ = x; + g_return_if_fail (_tmp0_ >= 0); + _tmp1_ = y; + g_return_if_fail (_tmp1_ >= 0); + _tmp2_ = x; + _tmp3_ = page_get_width (self); + g_return_if_fail (_tmp2_ < _tmp3_); + _tmp4_ = y; + _tmp5_ = page_get_height (self); + g_return_if_fail (_tmp4_ < _tmp5_); + _tmp6_ = x; + self->priv->crop_x = _tmp6_; + _tmp7_ = y; + self->priv->crop_y = _tmp7_; g_signal_emit_by_name (self, "crop-changed"); } void page_rotate_crop (Page* self) { gint t = 0; + gboolean _tmp0_; + gint _tmp1_; + gint _tmp2_; + gint _tmp3_; + const gchar* _tmp4_; g_return_if_fail (self != NULL); - if (!self->priv->has_crop_) { + _tmp0_ = self->priv->has_crop_; + if (!_tmp0_) { return; } - t = self->priv->crop_width; - self->priv->crop_width = self->priv->crop_height; - self->priv->crop_height = t; - if (self->priv->crop_name == NULL) { + _tmp1_ = self->priv->crop_width; + t = _tmp1_; + _tmp2_ = self->priv->crop_height; + self->priv->crop_width = _tmp2_; + _tmp3_ = t; + self->priv->crop_height = _tmp3_; + _tmp4_ = self->priv->crop_name; + if (_tmp4_ == NULL) { gint w = 0; gint h = 0; - gint _tmp0_; - gint _tmp1_; - _tmp0_ = page_get_width (self); - w = _tmp0_; - _tmp1_ = page_get_height (self); - h = _tmp1_; - if ((self->priv->crop_x + self->priv->crop_width) > w) { - self->priv->crop_x = w - self->priv->crop_width; + gint _tmp5_ = 0; + gint _tmp6_ = 0; + gint _tmp7_; + gint _tmp8_; + gint _tmp9_; + gint _tmp12_; + gint _tmp14_; + gint _tmp15_; + gint _tmp16_; + gint _tmp19_; + _tmp5_ = page_get_width (self); + w = _tmp5_; + _tmp6_ = page_get_height (self); + h = _tmp6_; + _tmp7_ = self->priv->crop_x; + _tmp8_ = self->priv->crop_width; + _tmp9_ = w; + if ((_tmp7_ + _tmp8_) > _tmp9_) { + gint _tmp10_; + gint _tmp11_; + _tmp10_ = w; + _tmp11_ = self->priv->crop_width; + self->priv->crop_x = _tmp10_ - _tmp11_; } - if (self->priv->crop_x < 0) { + _tmp12_ = self->priv->crop_x; + if (_tmp12_ < 0) { + gint _tmp13_; self->priv->crop_x = 0; - self->priv->crop_width = w; + _tmp13_ = w; + self->priv->crop_width = _tmp13_; } - if ((self->priv->crop_y + self->priv->crop_height) > h) { - self->priv->crop_y = h - self->priv->crop_height; + _tmp14_ = self->priv->crop_y; + _tmp15_ = self->priv->crop_height; + _tmp16_ = h; + if ((_tmp14_ + _tmp15_) > _tmp16_) { + gint _tmp17_; + gint _tmp18_; + _tmp17_ = h; + _tmp18_ = self->priv->crop_height; + self->priv->crop_y = _tmp17_ - _tmp18_; } - if (self->priv->crop_y < 0) { + _tmp19_ = self->priv->crop_y; + if (_tmp19_ < 0) { + gint _tmp20_; self->priv->crop_y = 0; - self->priv->crop_height = h; + _tmp20_ = h; + self->priv->crop_height = _tmp20_; } } g_signal_emit_by_name (self, "crop-changed"); @@ -962,43 +1386,55 @@ void page_rotate_crop (Page* self) { gboolean page_has_crop (Page* self) { gboolean result = FALSE; + gboolean _tmp0_; g_return_val_if_fail (self != NULL, FALSE); - result = self->priv->has_crop_; + _tmp0_ = self->priv->has_crop_; + result = _tmp0_; return result; } void page_get_crop (Page* self, gint* x, gint* y, gint* width, gint* height) { - gint _x = 0; - gint _y = 0; - gint _width = 0; - gint _height = 0; + gint _vala_x = 0; + gint _vala_y = 0; + gint _vala_width = 0; + gint _vala_height = 0; + gint _tmp0_; + gint _tmp1_; + gint _tmp2_; + gint _tmp3_; g_return_if_fail (self != NULL); - _x = self->priv->crop_x; - _y = self->priv->crop_y; - _width = self->priv->crop_width; - _height = self->priv->crop_height; + _tmp0_ = self->priv->crop_x; + _vala_x = _tmp0_; + _tmp1_ = self->priv->crop_y; + _vala_y = _tmp1_; + _tmp2_ = self->priv->crop_width; + _vala_width = _tmp2_; + _tmp3_ = self->priv->crop_height; + _vala_height = _tmp3_; if (x) { - *x = _x; + *x = _vala_x; } if (y) { - *y = _y; + *y = _vala_y; } if (width) { - *width = _width; + *width = _vala_width; } if (height) { - *height = _height; + *height = _vala_height; } } gchar* page_get_named_crop (Page* self) { gchar* result = NULL; - gchar* _tmp0_; + const gchar* _tmp0_; + gchar* _tmp1_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = g_strdup (self->priv->crop_name); - result = _tmp0_; + _tmp0_ = self->priv->crop_name; + _tmp1_ = g_strdup (_tmp0_); + result = _tmp1_; return result; } @@ -1006,12 +1442,18 @@ gchar* page_get_named_crop (Page* self) { guchar* page_get_pixels (Page* self, int* result_length1) { guchar* result = NULL; guchar* _tmp0_; + gint _tmp0__length1; + guchar* _tmp1_; + gint _tmp1__length1; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = self->priv->pixels; + _tmp0__length1 = self->priv->pixels_length1; + _tmp1_ = _tmp0_; + _tmp1__length1 = _tmp0__length1; if (result_length1) { - *result_length1 = self->priv->pixels_length1; + *result_length1 = _tmp1__length1; } - result = _tmp0_; + result = _tmp1_; return result; } @@ -1025,17 +1467,50 @@ static guchar page_get_sample (Page* self, guchar* pixels, int pixels_length1, g static void page_get_pixel (Page* self, gint x, gint y, guchar* pixel, int pixel_length1, gint offset) { - ScanDirection _tmp0_; - gint _tmp5_; + ScanDirection _tmp0_ = 0; + gint _tmp13_ = 0; gint depth; - gint _tmp6_; + gint _tmp14_ = 0; gint n_channels; - gint _tmp7_; + gint _tmp15_ = 0; + gint _tmp16_; gint line_offset; - gboolean _tmp8_ = FALSE; - guchar _tmp14_; - guchar _tmp15_; - guchar _tmp16_; + gboolean _tmp17_ = FALSE; + gint _tmp18_; + gboolean _tmp20_; + guchar* _tmp104_; + gint _tmp104__length1; + gint _tmp105_; + guchar* _tmp106_; + gint _tmp106__length1; + gint _tmp107_; + gint _tmp108_; + gint _tmp109_; + gint _tmp110_; + guchar _tmp111_ = '\0'; + guchar _tmp112_; + guchar* _tmp113_; + gint _tmp113__length1; + gint _tmp114_; + guchar* _tmp115_; + gint _tmp115__length1; + gint _tmp116_; + gint _tmp117_; + gint _tmp118_; + gint _tmp119_; + guchar _tmp120_ = '\0'; + guchar _tmp121_; + guchar* _tmp122_; + gint _tmp122__length1; + gint _tmp123_; + guchar* _tmp124_; + gint _tmp124__length1; + gint _tmp125_; + gint _tmp126_; + gint _tmp127_; + gint _tmp128_; + guchar _tmp129_ = '\0'; + guchar _tmp130_; g_return_if_fail (self != NULL); _tmp0_ = page_get_scan_direction (self); switch (_tmp0_) { @@ -1045,123 +1520,366 @@ static void page_get_pixel (Page* self, gint x, gint y, guchar* pixel, int pixel } case SCAN_DIRECTION_BOTTOM_TO_TOP: { - gint _tmp1_; + gint _tmp1_ = 0; gint _tmp2_; + gint _tmp3_ = 0; + gint _tmp4_; _tmp1_ = page_get_scan_width (self); - x = (_tmp1_ - x) - 1; - _tmp2_ = page_get_scan_height (self); - y = (_tmp2_ - y) - 1; + _tmp2_ = x; + x = (_tmp1_ - _tmp2_) - 1; + _tmp3_ = page_get_scan_height (self); + _tmp4_ = y; + y = (_tmp3_ - _tmp4_) - 1; break; } case SCAN_DIRECTION_LEFT_TO_RIGHT: { + gint _tmp5_; gint t; - gint _tmp3_; - t = x; - _tmp3_ = page_get_scan_width (self); - x = (_tmp3_ - y) - 1; - y = t; + gint _tmp6_ = 0; + gint _tmp7_; + gint _tmp8_; + _tmp5_ = x; + t = _tmp5_; + _tmp6_ = page_get_scan_width (self); + _tmp7_ = y; + x = (_tmp6_ - _tmp7_) - 1; + _tmp8_ = t; + y = _tmp8_; break; } case SCAN_DIRECTION_RIGHT_TO_LEFT: { + gint _tmp9_; gint t; - gint _tmp4_; - t = x; - x = y; - _tmp4_ = page_get_scan_height (self); - y = (_tmp4_ - t) - 1; + gint _tmp10_; + gint _tmp11_ = 0; + gint _tmp12_; + _tmp9_ = x; + t = _tmp9_; + _tmp10_ = y; + x = _tmp10_; + _tmp11_ = page_get_scan_height (self); + _tmp12_ = t; + y = (_tmp11_ - _tmp12_) - 1; break; } default: break; } - _tmp5_ = page_get_depth (self); - depth = _tmp5_; - _tmp6_ = page_get_n_channels (self); - n_channels = _tmp6_; - _tmp7_ = page_get_rowstride (self); - line_offset = _tmp7_ * y; - if (depth == 8) { - _tmp8_ = n_channels == 3; + _tmp13_ = page_get_depth (self); + depth = _tmp13_; + _tmp14_ = page_get_n_channels (self); + n_channels = _tmp14_; + _tmp15_ = page_get_rowstride (self); + _tmp16_ = y; + line_offset = _tmp15_ * _tmp16_; + _tmp18_ = depth; + if (_tmp18_ == 8) { + gint _tmp19_; + _tmp19_ = n_channels; + _tmp17_ = _tmp19_ == 3; } else { - _tmp8_ = FALSE; + _tmp17_ = FALSE; } - if (_tmp8_) { + _tmp20_ = _tmp17_; + if (_tmp20_) { + gint _tmp21_; + gint _tmp22_; + gint _tmp23_; gint o; - o = line_offset + (x * n_channels); - pixel[offset + 0] = self->priv->pixels[o]; - pixel[offset + 1] = self->priv->pixels[o + 1]; - pixel[offset + 2] = self->priv->pixels[o + 2]; + guchar* _tmp24_; + gint _tmp24__length1; + gint _tmp25_; + guchar* _tmp26_; + gint _tmp26__length1; + gint _tmp27_; + guchar _tmp28_; + guchar _tmp29_; + guchar* _tmp30_; + gint _tmp30__length1; + gint _tmp31_; + guchar* _tmp32_; + gint _tmp32__length1; + gint _tmp33_; + guchar _tmp34_; + guchar _tmp35_; + guchar* _tmp36_; + gint _tmp36__length1; + gint _tmp37_; + guchar* _tmp38_; + gint _tmp38__length1; + gint _tmp39_; + guchar _tmp40_; + guchar _tmp41_; + _tmp21_ = line_offset; + _tmp22_ = x; + _tmp23_ = n_channels; + o = _tmp21_ + (_tmp22_ * _tmp23_); + _tmp24_ = pixel; + _tmp24__length1 = pixel_length1; + _tmp25_ = offset; + _tmp26_ = self->priv->pixels; + _tmp26__length1 = self->priv->pixels_length1; + _tmp27_ = o; + _tmp28_ = _tmp26_[_tmp27_]; + _tmp24_[_tmp25_ + 0] = _tmp28_; + _tmp29_ = _tmp24_[_tmp25_ + 0]; + _tmp30_ = pixel; + _tmp30__length1 = pixel_length1; + _tmp31_ = offset; + _tmp32_ = self->priv->pixels; + _tmp32__length1 = self->priv->pixels_length1; + _tmp33_ = o; + _tmp34_ = _tmp32_[_tmp33_ + 1]; + _tmp30_[_tmp31_ + 1] = _tmp34_; + _tmp35_ = _tmp30_[_tmp31_ + 1]; + _tmp36_ = pixel; + _tmp36__length1 = pixel_length1; + _tmp37_ = offset; + _tmp38_ = self->priv->pixels; + _tmp38__length1 = self->priv->pixels_length1; + _tmp39_ = o; + _tmp40_ = _tmp38_[_tmp39_ + 2]; + _tmp36_[_tmp37_ + 2] = _tmp40_; + _tmp41_ = _tmp36_[_tmp37_ + 2]; return; } else { - gboolean _tmp9_ = FALSE; - if (depth == 8) { - _tmp9_ = n_channels == 1; + gboolean _tmp42_ = FALSE; + gint _tmp43_; + gboolean _tmp45_; + _tmp43_ = depth; + if (_tmp43_ == 8) { + gint _tmp44_; + _tmp44_ = n_channels; + _tmp42_ = _tmp44_ == 1; } else { - _tmp9_ = FALSE; + _tmp42_ = FALSE; } - if (_tmp9_) { + _tmp45_ = _tmp42_; + if (_tmp45_) { + guchar* _tmp46_; + gint _tmp46__length1; + gint _tmp47_; + gint _tmp48_; + guchar _tmp49_; guchar p; - p = self->priv->pixels[line_offset + x]; - pixel[offset + 2] = p; - pixel[offset + 1] = pixel[offset + 2]; - pixel[offset + 0] = pixel[offset + 1]; + guchar* _tmp50_; + gint _tmp50__length1; + gint _tmp51_; + guchar* _tmp52_; + gint _tmp52__length1; + gint _tmp53_; + guchar* _tmp54_; + gint _tmp54__length1; + gint _tmp55_; + guchar _tmp56_; + guchar _tmp57_; + guchar _tmp58_; + guchar _tmp59_; + _tmp46_ = self->priv->pixels; + _tmp46__length1 = self->priv->pixels_length1; + _tmp47_ = line_offset; + _tmp48_ = x; + _tmp49_ = _tmp46_[_tmp47_ + _tmp48_]; + p = _tmp49_; + _tmp50_ = pixel; + _tmp50__length1 = pixel_length1; + _tmp51_ = offset; + _tmp52_ = pixel; + _tmp52__length1 = pixel_length1; + _tmp53_ = offset; + _tmp54_ = pixel; + _tmp54__length1 = pixel_length1; + _tmp55_ = offset; + _tmp56_ = p; + _tmp54_[_tmp55_ + 2] = _tmp56_; + _tmp57_ = _tmp54_[_tmp55_ + 2]; + _tmp52_[_tmp53_ + 1] = _tmp57_; + _tmp58_ = _tmp52_[_tmp53_ + 1]; + _tmp50_[_tmp51_ + 0] = _tmp58_; + _tmp59_ = _tmp50_[_tmp51_ + 0]; return; } else { - gboolean _tmp10_ = FALSE; - if (depth == 1) { - _tmp10_ = n_channels == 1; + gboolean _tmp60_ = FALSE; + gint _tmp61_; + gboolean _tmp63_; + _tmp61_ = depth; + if (_tmp61_ == 1) { + gint _tmp62_; + _tmp62_ = n_channels; + _tmp60_ = _tmp62_ == 1; } else { - _tmp10_ = FALSE; + _tmp60_ = FALSE; } - if (_tmp10_) { + _tmp63_ = _tmp60_; + if (_tmp63_) { + guchar* _tmp64_; + gint _tmp64__length1; + gint _tmp65_; + gint _tmp66_; + guchar _tmp67_; guchar p; - gint _tmp11_ = 0; - p = self->priv->pixels[line_offset + (x / 8)]; - if (((gint) (p & (0x80 >> (x % 8)))) != 0) { - _tmp11_ = 0x00; + gint _tmp68_ = 0; + guchar _tmp69_; + gint _tmp70_; + guchar* _tmp71_; + gint _tmp71__length1; + gint _tmp72_; + guchar* _tmp73_; + gint _tmp73__length1; + gint _tmp74_; + guchar* _tmp75_; + gint _tmp75__length1; + gint _tmp76_; + gint _tmp77_; + guchar _tmp78_; + guchar _tmp79_; + guchar _tmp80_; + _tmp64_ = self->priv->pixels; + _tmp64__length1 = self->priv->pixels_length1; + _tmp65_ = line_offset; + _tmp66_ = x; + _tmp67_ = _tmp64_[_tmp65_ + (_tmp66_ / 8)]; + p = _tmp67_; + _tmp69_ = p; + _tmp70_ = x; + if (((gint) (_tmp69_ & (0x80 >> (_tmp70_ % 8)))) != 0) { + _tmp68_ = 0x00; } else { - _tmp11_ = 0xFF; + _tmp68_ = 0xFF; } - pixel[offset + 2] = (guchar) _tmp11_; - pixel[offset + 1] = pixel[offset + 2]; - pixel[offset + 0] = pixel[offset + 1]; + _tmp71_ = pixel; + _tmp71__length1 = pixel_length1; + _tmp72_ = offset; + _tmp73_ = pixel; + _tmp73__length1 = pixel_length1; + _tmp74_ = offset; + _tmp75_ = pixel; + _tmp75__length1 = pixel_length1; + _tmp76_ = offset; + _tmp77_ = _tmp68_; + _tmp75_[_tmp76_ + 2] = (guchar) _tmp77_; + _tmp78_ = _tmp75_[_tmp76_ + 2]; + _tmp73_[_tmp74_ + 1] = _tmp78_; + _tmp79_ = _tmp73_[_tmp74_ + 1]; + _tmp71_[_tmp72_ + 0] = _tmp79_; + _tmp80_ = _tmp71_[_tmp72_ + 0]; return; } else { - gboolean _tmp12_ = FALSE; - if (depth == 2) { - _tmp12_ = n_channels == 1; + gboolean _tmp81_ = FALSE; + gint _tmp82_; + gboolean _tmp84_; + _tmp82_ = depth; + if (_tmp82_ == 2) { + gint _tmp83_; + _tmp83_ = n_channels; + _tmp81_ = _tmp83_ == 1; } else { - _tmp12_ = FALSE; + _tmp81_ = FALSE; } - if (_tmp12_) { - gint _tmp13_[4] = {0}; + _tmp84_ = _tmp81_; + if (_tmp84_) { + gint _tmp85_[4] = {0}; gint block_shift[4]; + guchar* _tmp86_; + gint _tmp86__length1; + gint _tmp87_; + gint _tmp88_; + guchar _tmp89_; guchar p; + guchar _tmp90_; + gint _tmp91_; + gint _tmp92_; gint sample; - _tmp13_[0] = 6; - _tmp13_[1] = 4; - _tmp13_[2] = 2; - _tmp13_[3] = 0; - memcpy (block_shift, _tmp13_, 4 * sizeof (gint)); - p = self->priv->pixels[line_offset + (x / 4)]; - sample = (p >> block_shift[x % 4]) & 0x3; - sample = (sample * 255) / 3; - pixel[offset + 2] = (guchar) sample; - pixel[offset + 1] = pixel[offset + 2]; - pixel[offset + 0] = pixel[offset + 1]; + gint _tmp93_; + guchar* _tmp94_; + gint _tmp94__length1; + gint _tmp95_; + guchar* _tmp96_; + gint _tmp96__length1; + gint _tmp97_; + guchar* _tmp98_; + gint _tmp98__length1; + gint _tmp99_; + gint _tmp100_; + guchar _tmp101_; + guchar _tmp102_; + guchar _tmp103_; + _tmp85_[0] = 6; + _tmp85_[1] = 4; + _tmp85_[2] = 2; + _tmp85_[3] = 0; + memcpy (block_shift, _tmp85_, 4 * sizeof (gint)); + _tmp86_ = self->priv->pixels; + _tmp86__length1 = self->priv->pixels_length1; + _tmp87_ = line_offset; + _tmp88_ = x; + _tmp89_ = _tmp86_[_tmp87_ + (_tmp88_ / 4)]; + p = _tmp89_; + _tmp90_ = p; + _tmp91_ = x; + _tmp92_ = block_shift[_tmp91_ % 4]; + sample = (_tmp90_ >> _tmp92_) & 0x3; + _tmp93_ = sample; + sample = (_tmp93_ * 255) / 3; + _tmp94_ = pixel; + _tmp94__length1 = pixel_length1; + _tmp95_ = offset; + _tmp96_ = pixel; + _tmp96__length1 = pixel_length1; + _tmp97_ = offset; + _tmp98_ = pixel; + _tmp98__length1 = pixel_length1; + _tmp99_ = offset; + _tmp100_ = sample; + _tmp98_[_tmp99_ + 2] = (guchar) _tmp100_; + _tmp101_ = _tmp98_[_tmp99_ + 2]; + _tmp96_[_tmp97_ + 1] = _tmp101_; + _tmp102_ = _tmp96_[_tmp97_ + 1]; + _tmp94_[_tmp95_ + 0] = _tmp102_; + _tmp103_ = _tmp94_[_tmp95_ + 0]; return; } } } } - _tmp14_ = page_get_sample (self, self->priv->pixels, self->priv->pixels_length1, line_offset, x, depth, n_channels, 0); - pixel[offset + 0] = _tmp14_; - _tmp15_ = page_get_sample (self, self->priv->pixels, self->priv->pixels_length1, line_offset, x, depth, n_channels, 1); - pixel[offset + 1] = _tmp15_; - _tmp16_ = page_get_sample (self, self->priv->pixels, self->priv->pixels_length1, line_offset, x, depth, n_channels, 2); - pixel[offset + 2] = _tmp16_; + _tmp104_ = pixel; + _tmp104__length1 = pixel_length1; + _tmp105_ = offset; + _tmp106_ = self->priv->pixels; + _tmp106__length1 = self->priv->pixels_length1; + _tmp107_ = line_offset; + _tmp108_ = x; + _tmp109_ = depth; + _tmp110_ = n_channels; + _tmp111_ = page_get_sample (self, _tmp106_, _tmp106__length1, _tmp107_, _tmp108_, _tmp109_, _tmp110_, 0); + _tmp104_[_tmp105_ + 0] = _tmp111_; + _tmp112_ = _tmp104_[_tmp105_ + 0]; + _tmp113_ = pixel; + _tmp113__length1 = pixel_length1; + _tmp114_ = offset; + _tmp115_ = self->priv->pixels; + _tmp115__length1 = self->priv->pixels_length1; + _tmp116_ = line_offset; + _tmp117_ = x; + _tmp118_ = depth; + _tmp119_ = n_channels; + _tmp120_ = page_get_sample (self, _tmp115_, _tmp115__length1, _tmp116_, _tmp117_, _tmp118_, _tmp119_, 1); + _tmp113_[_tmp114_ + 1] = _tmp120_; + _tmp121_ = _tmp113_[_tmp114_ + 1]; + _tmp122_ = pixel; + _tmp122__length1 = pixel_length1; + _tmp123_ = offset; + _tmp124_ = self->priv->pixels; + _tmp124__length1 = self->priv->pixels_length1; + _tmp125_ = line_offset; + _tmp126_ = x; + _tmp127_ = depth; + _tmp128_ = n_channels; + _tmp129_ = page_get_sample (self, _tmp124_, _tmp124__length1, _tmp125_, _tmp126_, _tmp127_, _tmp128_, 2); + _tmp122_[_tmp123_ + 2] = _tmp129_; + _tmp130_ = _tmp122_[_tmp123_ + 2]; } @@ -1172,92 +1890,168 @@ GdkPixbuf* page_get_image (Page* self, gboolean apply_crop) { gint t = 0; gint b = 0; gboolean _tmp0_ = FALSE; - GdkPixbuf* _tmp7_ = NULL; + gboolean _tmp1_; + gboolean _tmp3_; + gint _tmp20_; + gint _tmp21_; + gint _tmp22_; + gint _tmp23_; + GdkPixbuf* _tmp24_; GdkPixbuf* image; - guint8* _tmp8_ = NULL; + GdkPixbuf* _tmp25_; + guint8* _tmp26_ = NULL; guint8* image_pixels; gint image_pixels_length1; gint _image_pixels_size_; g_return_val_if_fail (self != NULL, NULL); - if (apply_crop) { - _tmp0_ = self->priv->has_crop_; + _tmp1_ = apply_crop; + if (_tmp1_) { + gboolean _tmp2_; + _tmp2_ = self->priv->has_crop_; + _tmp0_ = _tmp2_; } else { _tmp0_ = FALSE; } - if (_tmp0_) { - gint _tmp1_; - gint _tmp3_; - l = self->priv->crop_x; - r = l + self->priv->crop_width; - t = self->priv->crop_y; - b = t + self->priv->crop_height; - if (l < 0) { + _tmp3_ = _tmp0_; + if (_tmp3_) { + gint _tmp4_; + gint _tmp5_; + gint _tmp6_; + gint _tmp7_; + gint _tmp8_; + gint _tmp9_; + gint _tmp10_; + gint _tmp11_; + gint _tmp12_ = 0; + gint _tmp14_; + gint _tmp15_; + gint _tmp16_ = 0; + _tmp4_ = self->priv->crop_x; + l = _tmp4_; + _tmp5_ = l; + _tmp6_ = self->priv->crop_width; + r = _tmp5_ + _tmp6_; + _tmp7_ = self->priv->crop_y; + t = _tmp7_; + _tmp8_ = t; + _tmp9_ = self->priv->crop_height; + b = _tmp8_ + _tmp9_; + _tmp10_ = l; + if (_tmp10_ < 0) { l = 0; } - _tmp1_ = page_get_width (self); - if (r > _tmp1_) { - gint _tmp2_; - _tmp2_ = page_get_width (self); - r = _tmp2_; + _tmp11_ = r; + _tmp12_ = page_get_width (self); + if (_tmp11_ > _tmp12_) { + gint _tmp13_ = 0; + _tmp13_ = page_get_width (self); + r = _tmp13_; } - if (t < 0) { + _tmp14_ = t; + if (_tmp14_ < 0) { t = 0; } - _tmp3_ = page_get_height (self); - if (b > _tmp3_) { - gint _tmp4_; - _tmp4_ = page_get_height (self); - b = _tmp4_; + _tmp15_ = b; + _tmp16_ = page_get_height (self); + if (_tmp15_ > _tmp16_) { + gint _tmp17_ = 0; + _tmp17_ = page_get_height (self); + b = _tmp17_; } } else { - gint _tmp5_; - gint _tmp6_; + gint _tmp18_ = 0; + gint _tmp19_ = 0; l = 0; - _tmp5_ = page_get_width (self); - r = _tmp5_; + _tmp18_ = page_get_width (self); + r = _tmp18_; t = 0; - _tmp6_ = page_get_height (self); - b = _tmp6_; - } - _tmp7_ = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, r - l, b - t); - image = _tmp7_; - _tmp8_ = gdk_pixbuf_get_pixels (image); - image_pixels = _tmp8_; + _tmp19_ = page_get_height (self); + b = _tmp19_; + } + _tmp20_ = r; + _tmp21_ = l; + _tmp22_ = b; + _tmp23_ = t; + _tmp24_ = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, _tmp20_ - _tmp21_, _tmp22_ - _tmp23_); + image = _tmp24_; + _tmp25_ = image; + _tmp26_ = gdk_pixbuf_get_pixels (_tmp25_); + image_pixels = _tmp26_; image_pixels_length1 = -1; _image_pixels_size_ = image_pixels_length1; { + gint _tmp27_; gint y; - y = t; + _tmp27_ = t; + y = _tmp27_; { - gboolean _tmp9_; - _tmp9_ = TRUE; + gboolean _tmp28_; + _tmp28_ = TRUE; while (TRUE) { - gint _tmp10_; + gboolean _tmp29_; + gint _tmp31_; + gint _tmp32_; + GdkPixbuf* _tmp33_; + gint _tmp34_ = 0; + gint _tmp35_; + gint _tmp36_; gint offset; - if (!_tmp9_) { - y++; + _tmp29_ = _tmp28_; + if (!_tmp29_) { + gint _tmp30_; + _tmp30_ = y; + y = _tmp30_ + 1; } - _tmp9_ = FALSE; - if (!(y < b)) { + _tmp28_ = FALSE; + _tmp31_ = y; + _tmp32_ = b; + if (!(_tmp31_ < _tmp32_)) { break; } - _tmp10_ = gdk_pixbuf_get_rowstride (image); - offset = _tmp10_ * (y - t); + _tmp33_ = image; + _tmp34_ = gdk_pixbuf_get_rowstride (_tmp33_); + _tmp35_ = y; + _tmp36_ = t; + offset = _tmp34_ * (_tmp35_ - _tmp36_); { + gint _tmp37_; gint x; - x = l; + _tmp37_ = l; + x = _tmp37_; { - gboolean _tmp11_; - _tmp11_ = TRUE; + gboolean _tmp38_; + _tmp38_ = TRUE; while (TRUE) { - if (!_tmp11_) { - x++; + gboolean _tmp39_; + gint _tmp41_; + gint _tmp42_; + gint _tmp43_; + gint _tmp44_; + guint8* _tmp45_; + gint _tmp45__length1; + gint _tmp46_; + gint _tmp47_; + gint _tmp48_; + _tmp39_ = _tmp38_; + if (!_tmp39_) { + gint _tmp40_; + _tmp40_ = x; + x = _tmp40_ + 1; } - _tmp11_ = FALSE; - if (!(x < r)) { + _tmp38_ = FALSE; + _tmp41_ = x; + _tmp42_ = r; + if (!(_tmp41_ < _tmp42_)) { break; } - page_get_pixel (self, x, y, image_pixels, image_pixels_length1, offset + ((x - l) * 3)); + _tmp43_ = x; + _tmp44_ = y; + _tmp45_ = image_pixels; + _tmp45__length1 = image_pixels_length1; + _tmp46_ = offset; + _tmp47_ = x; + _tmp48_ = l; + page_get_pixel (self, _tmp43_, _tmp44_, _tmp45_, _tmp45__length1, _tmp46_ + ((_tmp47_ - _tmp48_) * 3)); } } } @@ -1272,26 +2066,38 @@ GdkPixbuf* page_get_image (Page* self, gboolean apply_crop) { static gchar* string_to_utf8 (const gchar* self, int* result_length1) { gchar* result = NULL; gint _tmp0_; - gchar* _tmp1_ = NULL; + gint _tmp1_; + gchar* _tmp2_ = NULL; gchar* _result_; gint _result__length1; gint __result__size_; - gint _tmp2_; - gchar* _tmp3_; + gint _tmp3_; + gchar* _tmp4_; + gint _tmp4__length1; + gint _tmp5_; + gint _tmp6_; + gchar* _tmp7_; + gint _tmp7__length1; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = strlen (self); - _tmp1_ = g_new0 (gchar, _tmp0_ + 1); - _result_ = _tmp1_; - _result__length1 = _tmp0_ + 1; + _tmp1_ = _tmp0_; + _tmp2_ = g_new0 (gchar, _tmp1_ + 1); + _result_ = _tmp2_; + _result__length1 = _tmp1_ + 1; __result__size_ = _result__length1; - _result__length1--; - _tmp2_ = strlen (self); - memcpy (_result_, self, (gsize) _tmp2_); - _tmp3_ = _result_; + _tmp3_ = _result__length1; + _result__length1 = _tmp3_ - 1; + _tmp4_ = _result_; + _tmp4__length1 = _result__length1; + _tmp5_ = strlen (self); + _tmp6_ = _tmp5_; + memcpy (_tmp4_, self, (gsize) _tmp6_); + _tmp7_ = _result_; + _tmp7__length1 = _result__length1; if (result_length1) { - *result_length1 = _result__length1; + *result_length1 = _tmp7__length1; } - result = _tmp3_; + result = _tmp7_; return result; } @@ -1299,20 +2105,23 @@ static gchar* string_to_utf8 (const gchar* self, int* result_length1) { static gchar* page_get_icc_data_encoded (Page* self, const gchar* icc_profile_filename) { gchar* result = NULL; gchar* contents = NULL; - gint _tmp1_; - gchar* _tmp2_ = NULL; - guchar* _tmp3_; - gint _tmp3__length1; - gchar* _tmp4_ = NULL; - gchar* _tmp5_; + const gchar* _tmp4_; + gint _tmp5_ = 0; + gchar* _tmp6_ = NULL; + guchar* _tmp7_; + gint _tmp7__length1; + gchar* _tmp8_ = NULL; + gchar* _tmp9_; GError * _inner_error_ = NULL; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (icc_profile_filename != NULL, NULL); { - gchar* _tmp0_ = NULL; - g_file_get_contents (icc_profile_filename, &_tmp0_, NULL, &_inner_error_); + const gchar* _tmp0_; + gchar* _tmp1_ = NULL; + _tmp0_ = icc_profile_filename; + g_file_get_contents (_tmp0_, &_tmp1_, NULL, &_inner_error_); _g_free0 (contents); - contents = _tmp0_; + contents = _tmp1_; if (_inner_error_ != NULL) { goto __catch2_g_error; } @@ -1321,9 +2130,13 @@ static gchar* page_get_icc_data_encoded (Page* self, const gchar* icc_profile_fi __catch2_g_error: { GError* e = NULL; + GError* _tmp2_; + const gchar* _tmp3_; e = _inner_error_; _inner_error_ = NULL; - g_warning ("page.vala:670: failed to get icc profile data: %s", e->message); + _tmp2_ = e; + _tmp3_ = _tmp2_->message; + g_warning ("page.vala:670: failed to get icc profile data: %s", _tmp3_); result = NULL; _g_error_free0 (e); _g_free0 (contents); @@ -1336,75 +2149,100 @@ static gchar* page_get_icc_data_encoded (Page* self, const gchar* icc_profile_fi g_clear_error (&_inner_error_); return NULL; } - _tmp2_ = string_to_utf8 (contents, &_tmp1_); - _tmp3_ = (guchar*) _tmp2_; - _tmp3__length1 = _tmp1_; - _tmp4_ = g_base64_encode (_tmp3_, _tmp1_); - _tmp5_ = _tmp4_; - _tmp3_ = (g_free (_tmp3_), NULL); - result = _tmp5_; + _tmp4_ = contents; + _tmp6_ = string_to_utf8 (_tmp4_, &_tmp5_); + _tmp7_ = (guchar*) _tmp6_; + _tmp7__length1 = _tmp5_; + _tmp8_ = g_base64_encode (_tmp7_, _tmp5_); + _tmp9_ = _tmp8_; + _tmp7_ = (g_free (_tmp7_), NULL); + result = _tmp9_; _g_free0 (contents); return result; } void page_save (Page* self, const gchar* type, GFile* file, GError** error) { - GFileOutputStream* _tmp0_ = NULL; + GFile* _tmp0_; + GFileOutputStream* _tmp1_ = NULL; GFileOutputStream* stream; - PixbufWriter* _tmp1_ = NULL; + GFileOutputStream* _tmp2_; + PixbufWriter* _tmp3_; PixbufWriter* writer; - GdkPixbuf* _tmp2_ = NULL; + GdkPixbuf* _tmp4_ = NULL; GdkPixbuf* image; gchar* icc_profile_data; - gint _tmp4_; + const gchar* _tmp5_; + GCompareFunc _tmp8_; + const gchar* _tmp9_; + gint _tmp10_ = 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_file_replace (file, NULL, FALSE, G_FILE_CREATE_NONE, NULL, &_inner_error_); - stream = _tmp0_; + _tmp0_ = file; + _tmp1_ = g_file_replace (_tmp0_, NULL, FALSE, G_FILE_CREATE_NONE, NULL, &_inner_error_); + stream = _tmp1_; if (_inner_error_ != NULL) { g_propagate_error (error, _inner_error_); return; } - _tmp1_ = pixbuf_writer_new (stream); - writer = _tmp1_; - _tmp2_ = page_get_image (self, TRUE); - image = _tmp2_; + _tmp2_ = stream; + _tmp3_ = pixbuf_writer_new (_tmp2_); + writer = _tmp3_; + _tmp4_ = page_get_image (self, TRUE); + image = _tmp4_; icc_profile_data = NULL; - if (self->priv->color_profile != NULL) { - gchar* _tmp3_ = NULL; - _tmp3_ = page_get_icc_data_encoded (self, self->priv->color_profile); + _tmp5_ = self->priv->color_profile; + if (_tmp5_ != NULL) { + const gchar* _tmp6_; + gchar* _tmp7_ = NULL; + _tmp6_ = self->priv->color_profile; + _tmp7_ = page_get_icc_data_encoded (self, _tmp6_); _g_free0 (icc_profile_data); - icc_profile_data = _tmp3_; - } - _tmp4_ = g_strcmp0 (type, "jpeg"); - if (_tmp4_ == 0) { - gchar* _tmp5_; - gchar** _tmp6_ = NULL; + icc_profile_data = _tmp7_; + } + _tmp8_ = g_strcmp0; + _tmp9_ = type; + _tmp10_ = _tmp8_ (_tmp9_, "jpeg"); + if (_tmp10_ == 0) { + gchar* _tmp11_; + gchar** _tmp12_ = NULL; gchar** keys; gint keys_length1; gint _keys_size_; - gchar* _tmp7_; - gchar** _tmp8_ = NULL; + gchar* _tmp13_; + gchar** _tmp14_ = NULL; gchar** values; gint values_length1; gint _values_size_; - _tmp5_ = g_strdup ("quality"); - _tmp6_ = g_new0 (gchar*, 2 + 1); - _tmp6_[0] = _tmp5_; - _tmp6_[1] = NULL; - keys = _tmp6_; + PixbufWriter* _tmp15_; + GdkPixbuf* _tmp16_; + gchar** _tmp17_; + gint _tmp17__length1; + gchar** _tmp18_; + gint _tmp18__length1; + _tmp11_ = g_strdup ("quality"); + _tmp12_ = g_new0 (gchar*, 2 + 1); + _tmp12_[0] = _tmp11_; + _tmp12_[1] = NULL; + keys = _tmp12_; keys_length1 = 2; _keys_size_ = keys_length1; - _tmp7_ = g_strdup ("90"); - _tmp8_ = g_new0 (gchar*, 2 + 1); - _tmp8_[0] = _tmp7_; - _tmp8_[1] = NULL; - values = _tmp8_; + _tmp13_ = g_strdup ("90"); + _tmp14_ = g_new0 (gchar*, 2 + 1); + _tmp14_[0] = _tmp13_; + _tmp14_[1] = NULL; + values = _tmp14_; values_length1 = 2; _values_size_ = values_length1; - pixbuf_writer_save (writer, image, "jpeg", keys, keys_length1, values, values_length1, &_inner_error_); + _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_); if (_inner_error_ != NULL) { g_propagate_error (error, _inner_error_); values = (_vala_array_free (values, values_length1, (GDestroyNotify) g_free), NULL); @@ -1418,40 +2256,64 @@ void page_save (Page* self, const gchar* type, GFile* file, GError** error) { values = (_vala_array_free (values, values_length1, (GDestroyNotify) g_free), NULL); keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL); } else { - gint _tmp9_; - _tmp9_ = g_strcmp0 (type, "png"); - if (_tmp9_ == 0) { - gchar* _tmp10_; - gchar** _tmp11_ = NULL; + 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; gchar** keys; gint keys_length1; gint _keys_size_; - gchar* _tmp12_; - gchar** _tmp13_ = NULL; + const gchar* _tmp24_; + gchar* _tmp25_; + gchar** _tmp26_ = NULL; gchar** values; gint values_length1; gint _values_size_; - _tmp10_ = g_strdup ("icc-profile"); - _tmp11_ = g_new0 (gchar*, 2 + 1); - _tmp11_[0] = _tmp10_; - _tmp11_[1] = NULL; - keys = _tmp11_; + 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_; keys_length1 = 2; _keys_size_ = keys_length1; - _tmp12_ = g_strdup (icc_profile_data); - _tmp13_ = g_new0 (gchar*, 2 + 1); - _tmp13_[0] = _tmp12_; - _tmp13_[1] = NULL; - values = _tmp13_; + _tmp24_ = icc_profile_data; + _tmp25_ = g_strdup (_tmp24_); + _tmp26_ = g_new0 (gchar*, 2 + 1); + _tmp26_[0] = _tmp25_; + _tmp26_[1] = NULL; + values = _tmp26_; values_length1 = 2; _values_size_ = values_length1; - if (icc_profile_data == NULL) { - gchar* _tmp14_; - _tmp14_ = NULL; - _g_free0 (keys[0]); - keys[0] = _tmp14_; + _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]; } - pixbuf_writer_save (writer, image, "png", keys, keys_length1, values, values_length1, &_inner_error_); + _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_); if (_inner_error_ != NULL) { g_propagate_error (error, _inner_error_); values = (_vala_array_free (values, values_length1, (GDestroyNotify) g_free), NULL); @@ -1465,46 +2327,70 @@ void page_save (Page* self, const gchar* type, GFile* file, GError** error) { values = (_vala_array_free (values, values_length1, (GDestroyNotify) g_free), NULL); keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL); } else { - gint _tmp15_; - _tmp15_ = g_strcmp0 (type, "tiff"); - if (_tmp15_ == 0) { - gchar* _tmp16_; - gchar* _tmp17_; - gchar** _tmp18_ = NULL; + 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; gchar** keys; gint keys_length1; gint _keys_size_; - gchar* _tmp19_; - gchar* _tmp20_; - gchar** _tmp21_ = NULL; + gchar* _tmp40_; + const gchar* _tmp41_; + gchar* _tmp42_; + gchar** _tmp43_ = NULL; gchar** values; gint values_length1; gint _values_size_; - _tmp16_ = g_strdup ("compression"); - _tmp17_ = g_strdup ("icc-profile"); - _tmp18_ = g_new0 (gchar*, 3 + 1); - _tmp18_[0] = _tmp16_; - _tmp18_[1] = _tmp17_; - _tmp18_[2] = NULL; - keys = _tmp18_; + 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_; keys_length1 = 3; _keys_size_ = keys_length1; - _tmp19_ = g_strdup ("8"); - _tmp20_ = g_strdup (icc_profile_data); - _tmp21_ = g_new0 (gchar*, 3 + 1); - _tmp21_[0] = _tmp19_; - _tmp21_[1] = _tmp20_; - _tmp21_[2] = NULL; - values = _tmp21_; + _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_; values_length1 = 3; _values_size_ = values_length1; - if (icc_profile_data == NULL) { - gchar* _tmp22_; - _tmp22_ = NULL; - _g_free0 (keys[1]); - keys[1] = _tmp22_; + _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]; } - pixbuf_writer_save (writer, image, "tiff", keys, keys_length1, values, values_length1, &_inner_error_); + _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_); if (_inner_error_ != NULL) { g_propagate_error (error, _inner_error_); values = (_vala_array_free (values, values_length1, (GDestroyNotify) g_free), NULL); @@ -1706,11 +2592,13 @@ static gpointer _g_object_ref0 (gpointer self) { PixbufWriter* pixbuf_writer_construct (GType object_type, GFileOutputStream* stream) { PixbufWriter* self = NULL; GFileOutputStream* _tmp0_; + GFileOutputStream* _tmp1_; g_return_val_if_fail (stream != NULL, NULL); self = (PixbufWriter*) g_type_create_instance (object_type); - _tmp0_ = _g_object_ref0 (stream); + _tmp0_ = stream; + _tmp1_ = _g_object_ref0 (_tmp0_); _g_object_unref0 (self->stream); - self->stream = _tmp0_; + self->stream = _tmp1_; return self; } @@ -1728,11 +2616,23 @@ static gboolean _pixbuf_writer_write_pixbuf_data_gdk_pixbuf_save_func (guint8* b void pixbuf_writer_save (PixbufWriter* self, GdkPixbuf* image, const gchar* type, gchar** option_keys, int option_keys_length1, gchar** option_values, int option_values_length1, GError** error) { + GdkPixbuf* _tmp0_; + const gchar* _tmp1_; + gchar** _tmp2_; + gint _tmp2__length1; + gchar** _tmp3_; + gint _tmp3__length1; GError * _inner_error_ = NULL; g_return_if_fail (self != NULL); g_return_if_fail (image != NULL); g_return_if_fail (type != NULL); - gdk_pixbuf_save_to_callbackv (image, _pixbuf_writer_write_pixbuf_data_gdk_pixbuf_save_func, self, type, option_keys, option_values, &_inner_error_); + _tmp0_ = image; + _tmp1_ = type; + _tmp2_ = option_keys; + _tmp2__length1 = option_keys_length1; + _tmp3_ = option_values; + _tmp3__length1 = option_values_length1; + gdk_pixbuf_save_to_callbackv (_tmp0_, _pixbuf_writer_write_pixbuf_data_gdk_pixbuf_save_func, self, _tmp1_, _tmp2_, _tmp3_, &_inner_error_); if (_inner_error_ != NULL) { g_propagate_error (error, _inner_error_); return; @@ -1742,9 +2642,15 @@ void pixbuf_writer_save (PixbufWriter* self, GdkPixbuf* image, const gchar* type static gboolean pixbuf_writer_write_pixbuf_data (PixbufWriter* self, guint8* buf, int buf_length1, GError** error) { gboolean result = FALSE; + GFileOutputStream* _tmp0_; + guint8* _tmp1_; + gint _tmp1__length1; GError * _inner_error_ = NULL; g_return_val_if_fail (self != NULL, FALSE); - g_output_stream_write_all ((GOutputStream*) self->stream, buf, (gsize) buf_length1, NULL, NULL, &_inner_error_); + _tmp0_ = self->stream; + _tmp1_ = buf; + _tmp1__length1 = buf_length1; + g_output_stream_write_all ((GOutputStream*) _tmp0_, _tmp1_, (gsize) _tmp1__length1, NULL, NULL, &_inner_error_); if (_inner_error_ != NULL) { g_propagate_error (error, _inner_error_); return FALSE; diff --git a/src/sane.vapi b/src/sane.vapi index ae69940..aa3d90c 100644 --- a/src/sane.vapi +++ b/src/sane.vapi @@ -7,19 +7,19 @@ namespace Sane { } [SimpleType] - [IntegerType] + [IntegerType (rank = 9)] public struct Int { } [SimpleType] - [IntegerType] + [IntegerType (rank = 9)] public struct Fixed { } [SimpleType] - [IntegerType] + [IntegerType (rank = 9)] public struct Word { } @@ -155,7 +155,7 @@ namespace Sane { MICROSECOND } - [CCode (cname = "const SANE_Constraint_Type", cprefix = "SANE_CONSTRAINT_")] + [CCode (cname = "SANE_Constraint_Type", cprefix = "SANE_CONSTRAINT_")] public enum ConstraintType { NONE, @@ -183,26 +183,24 @@ namespace Sane { ADVANCED } - [CCode (cname = "const SANE_Option_Descriptor", ref_function = "", unref_function = "")] + [CCode (cname = "SANE_Option_Descriptor", ref_function = "", unref_function = "")] public class OptionDescriptor { - public string name; - public string title; - public string desc; + public unowned string name; + public unowned string title; + public unowned string desc; public ValueType type; public Unit unit; public Int size; public Int cap; public ConstraintType constraint_type; - public struct _Constraint - { - [CCode (array_length = false, null_terminated = true)] - public string[] string_list; - public Word[] word_list; - public Range range; - } - public _Constraint constraint; + [CCode (cname = "constraint.string_list", array_length = false, null_terminated = true)] + public string[] string_list; + [CCode (cname = "constraint.word_list", array_length = false)] + public Word[] word_list; + [CCode (cname = "constraint.range")] + public Range range; } [CCode (type = "Int", cprefix = "SANE_INFO_")] @@ -754,4 +752,3 @@ namespace Sane { [CCode (cname = "SANE_VALUE_SCAN_MODE_LINEART", cheader_filename = "sane/saneopts.h")] public static string VALUE_SCAN_MODE_LINEART; } - diff --git a/src/scanner.c b/src/scanner.c index c26d691..fc0fb07 100644 --- a/src/scanner.c +++ b/src/scanner.c @@ -1,4 +1,4 @@ -/* scanner.c generated by valac 0.13.1, the Vala compiler +/* scanner.c generated by valac 0.13.4, the Vala compiler * generated from scanner.vala, do not modify */ /* @@ -912,13 +912,13 @@ static gint scanner_get_device_weight (const gchar* device); static gint scanner_compare_devices (ScanDevice* device1, ScanDevice* device2); static void scanner_do_redetect (Scanner* self); static gint _scanner_compare_devices_gcompare_func (gconstpointer a, gconstpointer b); -static gboolean scanner_set_default_option (Scanner* self, SANE_Handle handle, const SANE_Option_Descriptor* option, SANE_Int option_index); -static void scanner_set_bool_option (Scanner* self, SANE_Handle handle, const SANE_Option_Descriptor* option, SANE_Int option_index, gboolean value, gboolean* _result_); -static void scanner_set_int_option (Scanner* self, SANE_Handle handle, const SANE_Option_Descriptor* option, SANE_Int option_index, gint value, gint* _result_); -static void scanner_set_fixed_option (Scanner* self, SANE_Handle handle, const SANE_Option_Descriptor* option, SANE_Int option_index, gdouble value, gdouble* _result_); -static gboolean scanner_set_string_option (Scanner* self, SANE_Handle handle, const SANE_Option_Descriptor* option, SANE_Int option_index, const gchar* value, gchar** _result_); -static gboolean scanner_set_constrained_string_option (Scanner* self, SANE_Handle handle, const SANE_Option_Descriptor* option, SANE_Int option_index, gchar** values, int values_length1, gchar** _result_); -static void scanner_log_option (Scanner* self, SANE_Int index, const SANE_Option_Descriptor* option); +static gboolean scanner_set_default_option (Scanner* self, SANE_Handle handle, SANE_Option_Descriptor* option, SANE_Int option_index); +static void scanner_set_bool_option (Scanner* self, SANE_Handle handle, SANE_Option_Descriptor* option, SANE_Int option_index, gboolean value, gboolean* _result_); +static void scanner_set_int_option (Scanner* self, SANE_Handle handle, SANE_Option_Descriptor* option, SANE_Int option_index, gint value, gint* _result_); +static void scanner_set_fixed_option (Scanner* self, SANE_Handle handle, SANE_Option_Descriptor* option, SANE_Int option_index, gdouble value, gdouble* _result_); +static gboolean scanner_set_string_option (Scanner* self, SANE_Handle handle, SANE_Option_Descriptor* option, SANE_Int option_index, const gchar* value, gchar** _result_); +static gboolean scanner_set_constrained_string_option (Scanner* self, SANE_Handle handle, SANE_Option_Descriptor* option, SANE_Int option_index, gchar** values, int values_length1, gchar** _result_); +static void scanner_log_option (Scanner* self, SANE_Int index, SANE_Option_Descriptor* option); static void scanner_authorization_cb (const gchar* resource, gchar* username, int username_length1, gchar* password, int password_length1); void scanner_authorize (Scanner* self, const gchar* username, const gchar* password); static void scanner_close_device (Scanner* self); @@ -2332,12 +2332,12 @@ GType scan_state_get_type (void) { static void notify_real_run (Notify* self, Scanner* scanner) { - g_return_if_fail (self != NULL); g_return_if_fail (scanner != NULL); } void notify_run (Notify* self, Scanner* scanner) { + g_return_if_fail (self != NULL); NOTIFY_GET_CLASS (self)->run (self, scanner); } @@ -2516,9 +2516,11 @@ void notify_unref (gpointer instance) { static void notify_scanning_changed_real_run (Notify* base, Scanner* scanner) { NotifyScanningChanged * self; + Scanner* _tmp0_; self = (NotifyScanningChanged*) base; g_return_if_fail (scanner != NULL); - g_signal_emit_by_name (scanner, "scanning-changed"); + _tmp0_ = scanner; + g_signal_emit_by_name (_tmp0_, "scanning-changed"); } @@ -2587,9 +2589,13 @@ NotifyUpdateDevices* notify_update_devices_new (GList* devices) { static void notify_update_devices_real_run (Notify* base, Scanner* scanner) { NotifyUpdateDevices * self; + Scanner* _tmp0_; + GList* _tmp1_; self = (NotifyUpdateDevices*) base; g_return_if_fail (scanner != NULL); - g_signal_emit_by_name (scanner, "update-devices", self->priv->devices); + _tmp0_ = scanner; + _tmp1_ = self->priv->devices; + g_signal_emit_by_name (_tmp0_, "update-devices", _tmp1_); } @@ -2628,12 +2634,14 @@ GType notify_update_devices_get_type (void) { NotifyRequestAuthorization* notify_request_authorization_construct (GType object_type, const gchar* resource) { NotifyRequestAuthorization* self = NULL; - gchar* _tmp0_; + const gchar* _tmp0_; + gchar* _tmp1_; g_return_val_if_fail (resource != NULL, NULL); self = (NotifyRequestAuthorization*) notify_construct (object_type); - _tmp0_ = g_strdup (resource); + _tmp0_ = resource; + _tmp1_ = g_strdup (_tmp0_); _g_free0 (self->priv->resource); - self->priv->resource = _tmp0_; + self->priv->resource = _tmp1_; return self; } @@ -2645,9 +2653,13 @@ NotifyRequestAuthorization* notify_request_authorization_new (const gchar* resou static void notify_request_authorization_real_run (Notify* base, Scanner* scanner) { NotifyRequestAuthorization * self; + Scanner* _tmp0_; + const gchar* _tmp1_; self = (NotifyRequestAuthorization*) base; g_return_if_fail (scanner != NULL); - g_signal_emit_by_name (scanner, "request-authorization", self->priv->resource); + _tmp0_ = scanner; + _tmp1_ = self->priv->resource; + g_signal_emit_by_name (_tmp0_, "request-authorization", _tmp1_); } @@ -2686,13 +2698,17 @@ GType notify_request_authorization_get_type (void) { NotifyScanFailed* notify_scan_failed_construct (GType object_type, gint error_code, const gchar* error_string) { NotifyScanFailed* self = NULL; - gchar* _tmp0_; + gint _tmp0_; + const gchar* _tmp1_; + gchar* _tmp2_; g_return_val_if_fail (error_string != NULL, NULL); self = (NotifyScanFailed*) notify_construct (object_type); - self->priv->error_code = error_code; - _tmp0_ = g_strdup (error_string); + _tmp0_ = error_code; + self->priv->error_code = _tmp0_; + _tmp1_ = error_string; + _tmp2_ = g_strdup (_tmp1_); _g_free0 (self->priv->error_string); - self->priv->error_string = _tmp0_; + self->priv->error_string = _tmp2_; return self; } @@ -2704,9 +2720,15 @@ NotifyScanFailed* notify_scan_failed_new (gint error_code, const gchar* error_st static void notify_scan_failed_real_run (Notify* base, Scanner* scanner) { NotifyScanFailed * self; + Scanner* _tmp0_; + gint _tmp1_; + const gchar* _tmp2_; self = (NotifyScanFailed*) base; g_return_if_fail (scanner != NULL); - g_signal_emit_by_name (scanner, "scan-failed", self->priv->error_code, self->priv->error_string); + _tmp0_ = scanner; + _tmp1_ = self->priv->error_code; + _tmp2_ = self->priv->error_string; + g_signal_emit_by_name (_tmp0_, "scan-failed", _tmp1_, _tmp2_); } @@ -2745,9 +2767,11 @@ GType notify_scan_failed_get_type (void) { static void notify_document_done_real_run (Notify* base, Scanner* scanner) { NotifyDocumentDone * self; + Scanner* _tmp0_; self = (NotifyDocumentDone*) base; g_return_if_fail (scanner != NULL); - g_signal_emit_by_name (scanner, "document-done"); + _tmp0_ = scanner; + g_signal_emit_by_name (_tmp0_, "document-done"); } @@ -2787,9 +2811,11 @@ GType notify_document_done_get_type (void) { static void notify_expect_page_real_run (Notify* base, Scanner* scanner) { NotifyExpectPage * self; + Scanner* _tmp0_; self = (NotifyExpectPage*) base; g_return_if_fail (scanner != NULL); - g_signal_emit_by_name (scanner, "expect-page"); + _tmp0_ = scanner; + g_signal_emit_by_name (_tmp0_, "expect-page"); } @@ -2835,11 +2861,13 @@ static gpointer _scan_page_info_ref0 (gpointer self) { NotifyGotPageInfo* notify_got_page_info_construct (GType object_type, ScanPageInfo* info) { NotifyGotPageInfo* self = NULL; ScanPageInfo* _tmp0_; + ScanPageInfo* _tmp1_; g_return_val_if_fail (info != NULL, NULL); self = (NotifyGotPageInfo*) notify_construct (object_type); - _tmp0_ = _scan_page_info_ref0 (info); + _tmp0_ = info; + _tmp1_ = _scan_page_info_ref0 (_tmp0_); _scan_page_info_unref0 (self->priv->info); - self->priv->info = _tmp0_; + self->priv->info = _tmp1_; return self; } @@ -2851,9 +2879,13 @@ NotifyGotPageInfo* notify_got_page_info_new (ScanPageInfo* info) { static void notify_got_page_info_real_run (Notify* base, Scanner* scanner) { NotifyGotPageInfo * self; + Scanner* _tmp0_; + ScanPageInfo* _tmp1_; self = (NotifyGotPageInfo*) base; g_return_if_fail (scanner != NULL); - g_signal_emit_by_name (scanner, "got-page-info", self->priv->info); + _tmp0_ = scanner; + _tmp1_ = self->priv->info; + g_signal_emit_by_name (_tmp0_, "got-page-info", _tmp1_); } @@ -2892,9 +2924,11 @@ GType notify_got_page_info_get_type (void) { static void notify_page_done_real_run (Notify* base, Scanner* scanner) { NotifyPageDone * self; + Scanner* _tmp0_; self = (NotifyPageDone*) base; g_return_if_fail (scanner != NULL); - g_signal_emit_by_name (scanner, "page-done"); + _tmp0_ = scanner; + g_signal_emit_by_name (_tmp0_, "page-done"); } @@ -2940,11 +2974,13 @@ static gpointer _scan_line_ref0 (gpointer self) { NotifyGotLine* notify_got_line_construct (GType object_type, ScanLine* line) { NotifyGotLine* self = NULL; ScanLine* _tmp0_; + ScanLine* _tmp1_; g_return_val_if_fail (line != NULL, NULL); self = (NotifyGotLine*) notify_construct (object_type); - _tmp0_ = _scan_line_ref0 (line); + _tmp0_ = line; + _tmp1_ = _scan_line_ref0 (_tmp0_); _scan_line_unref0 (self->priv->line); - self->priv->line = _tmp0_; + self->priv->line = _tmp1_; return self; } @@ -2956,9 +2992,13 @@ NotifyGotLine* notify_got_line_new (ScanLine* line) { static void notify_got_line_real_run (Notify* base, Scanner* scanner) { NotifyGotLine * self; + Scanner* _tmp0_; + ScanLine* _tmp1_; self = (NotifyGotLine*) base; g_return_if_fail (scanner != NULL); - g_signal_emit_by_name (scanner, "got-line", self->priv->line); + _tmp0_ = scanner; + _tmp1_ = self->priv->line; + g_signal_emit_by_name (_tmp0_, "got-line", _tmp1_); } @@ -3008,9 +3048,9 @@ static void _g_list_free__scan_job_unref0_ (GList* self) { static Scanner* scanner_construct (GType object_type) { Scanner* self = NULL; - GAsyncQueue* _tmp0_ = NULL; - GAsyncQueue* _tmp1_ = NULL; - GAsyncQueue* _tmp2_ = NULL; + GAsyncQueue* _tmp0_; + GAsyncQueue* _tmp1_; + GAsyncQueue* _tmp2_; self = (Scanner*) g_type_create_instance (object_type); _tmp0_ = g_async_queue_new (); _g_async_queue_unref0 (self->priv->request_queue); @@ -3037,26 +3077,32 @@ static gpointer _scanner_ref0 (gpointer self) { Scanner* scanner_get_instance (void) { Scanner* result = NULL; - Scanner* _tmp1_; - if (scanner_scanner_object == NULL) { - Scanner* _tmp0_ = NULL; - _tmp0_ = scanner_new (); + Scanner* _tmp0_; + Scanner* _tmp2_; + Scanner* _tmp3_; + _tmp0_ = scanner_scanner_object; + if (_tmp0_ == NULL) { + Scanner* _tmp1_; + _tmp1_ = scanner_new (); _scanner_unref0 (scanner_scanner_object); - scanner_scanner_object = _tmp0_; + scanner_scanner_object = _tmp1_; } - _tmp1_ = _scanner_ref0 (scanner_scanner_object); - result = _tmp1_; + _tmp2_ = scanner_scanner_object; + _tmp3_ = _scanner_ref0 (_tmp2_); + result = _tmp3_; return result; } static gboolean scanner_notify_idle_cb (Scanner* self) { gboolean result = FALSE; - gpointer _tmp0_ = NULL; + GAsyncQueue* _tmp0_; + gpointer _tmp1_ = NULL; Notify* notification; g_return_val_if_fail (self != NULL, FALSE); - _tmp0_ = g_async_queue_pop (self->priv->notify_queue); - notification = (Notify*) _tmp0_; + _tmp0_ = self->priv->notify_queue; + _tmp1_ = g_async_queue_pop (_tmp0_); + notification = (Notify*) _tmp1_; notify_run (notification, self); result = FALSE; _notify_unref0 (notification); @@ -3077,11 +3123,15 @@ static gboolean _scanner_notify_idle_cb_gsource_func (gpointer self) { static void scanner_notify (Scanner* self, Notify* notification) { - Notify* _tmp0_; + GAsyncQueue* _tmp0_; + Notify* _tmp1_; + Notify* _tmp2_; g_return_if_fail (self != NULL); g_return_if_fail (notification != NULL); - _tmp0_ = _notify_ref0 (notification); - g_async_queue_push (self->priv->notify_queue, _tmp0_); + _tmp0_ = self->priv->notify_queue; + _tmp1_ = notification; + _tmp2_ = _notify_ref0 (_tmp1_); + g_async_queue_push (_tmp0_, _tmp2_); g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _scanner_notify_idle_cb_gsource_func, scanner_ref (self), scanner_unref); } @@ -3089,59 +3139,81 @@ static void scanner_notify (Scanner* self, Notify* notification) { static void scanner_set_scanning (Scanner* self, gboolean is_scanning) { gboolean _tmp0_ = FALSE; gboolean _tmp1_ = FALSE; + gboolean _tmp2_; + gboolean _tmp4_; + gboolean _tmp9_; g_return_if_fail (self != NULL); - if (self->priv->scanning) { - _tmp1_ = !is_scanning; + _tmp2_ = self->priv->scanning; + if (_tmp2_) { + gboolean _tmp3_; + _tmp3_ = is_scanning; + _tmp1_ = !_tmp3_; } else { _tmp1_ = FALSE; } - if (_tmp1_) { + _tmp4_ = _tmp1_; + if (_tmp4_) { _tmp0_ = TRUE; } else { - gboolean _tmp2_ = FALSE; - if (!self->priv->scanning) { - _tmp2_ = is_scanning; + gboolean _tmp5_ = FALSE; + gboolean _tmp6_; + gboolean _tmp8_; + _tmp6_ = self->priv->scanning; + if (!_tmp6_) { + gboolean _tmp7_; + _tmp7_ = is_scanning; + _tmp5_ = _tmp7_; } else { - _tmp2_ = FALSE; + _tmp5_ = FALSE; } - _tmp0_ = _tmp2_; - } - if (_tmp0_) { - NotifyScanningChanged* _tmp3_ = NULL; - NotifyScanningChanged* _tmp4_; - self->priv->scanning = is_scanning; + _tmp8_ = _tmp5_; + _tmp0_ = _tmp8_; + } + _tmp9_ = _tmp0_; + if (_tmp9_) { + gboolean _tmp10_; + NotifyScanningChanged* _tmp11_; + NotifyScanningChanged* _tmp12_; + _tmp10_ = is_scanning; + self->priv->scanning = _tmp10_; g_signal_emit_by_name (self, "scanning-changed"); - _tmp3_ = notify_scanning_changed_new (); - _tmp4_ = _tmp3_; - scanner_notify (self, (Notify*) _tmp4_); - _notify_unref0 (_tmp4_); + _tmp11_ = notify_scanning_changed_new (); + _tmp12_ = _tmp11_; + scanner_notify (self, (Notify*) _tmp12_); + _notify_unref0 (_tmp12_); } } static gboolean string_contains (const gchar* self, const gchar* needle) { gboolean result = FALSE; - gchar* _tmp0_ = NULL; + const gchar* _tmp0_; + gchar* _tmp1_ = NULL; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (needle != NULL, FALSE); - _tmp0_ = strstr ((gchar*) self, (gchar*) needle); - result = _tmp0_ != NULL; + _tmp0_ = needle; + _tmp1_ = strstr ((gchar*) self, (gchar*) _tmp0_); + result = _tmp1_ != NULL; return result; } static gint scanner_get_device_weight (const gchar* device) { gint result = 0; - gboolean _tmp0_; - gboolean _tmp1_; + const gchar* _tmp0_; + gboolean _tmp1_ = FALSE; + const gchar* _tmp2_; + gboolean _tmp3_ = FALSE; g_return_val_if_fail (device != NULL, 0); - _tmp0_ = g_str_has_prefix (device, "vfl:"); - if (_tmp0_) { + _tmp0_ = device; + _tmp1_ = g_str_has_prefix (_tmp0_, "vfl:"); + if (_tmp1_) { result = 2; return result; } - _tmp1_ = string_contains (device, "usb"); - if (_tmp1_) { + _tmp2_ = device; + _tmp3_ = string_contains (_tmp2_, "usb"); + if (_tmp3_) { result = 0; return result; } @@ -3152,121 +3224,151 @@ static gint scanner_get_device_weight (const gchar* device) { static gint scanner_compare_devices (ScanDevice* device1, ScanDevice* device2) { gint result = 0; - gint _tmp0_; + ScanDevice* _tmp0_; + const gchar* _tmp1_; + gint _tmp2_ = 0; gint weight1; - gint _tmp1_; + ScanDevice* _tmp3_; + const gchar* _tmp4_; + gint _tmp5_ = 0; gint weight2; - gint _tmp2_; + gint _tmp6_; + gint _tmp7_; + GCompareFunc _tmp10_; + ScanDevice* _tmp11_; + const gchar* _tmp12_; + ScanDevice* _tmp13_; + const gchar* _tmp14_; + gint _tmp15_ = 0; g_return_val_if_fail (device1 != NULL, 0); g_return_val_if_fail (device2 != NULL, 0); - _tmp0_ = scanner_get_device_weight (device1->name); - weight1 = _tmp0_; - _tmp1_ = scanner_get_device_weight (device2->name); - weight2 = _tmp1_; - if (weight1 != weight2) { - result = weight1 - weight2; + _tmp0_ = device1; + _tmp1_ = _tmp0_->name; + _tmp2_ = scanner_get_device_weight (_tmp1_); + weight1 = _tmp2_; + _tmp3_ = device2; + _tmp4_ = _tmp3_->name; + _tmp5_ = scanner_get_device_weight (_tmp4_); + weight2 = _tmp5_; + _tmp6_ = weight1; + _tmp7_ = weight2; + if (_tmp6_ != _tmp7_) { + gint _tmp8_; + gint _tmp9_; + _tmp8_ = weight1; + _tmp9_ = weight2; + result = _tmp8_ - _tmp9_; return result; } - _tmp2_ = g_strcmp0 (device1->label, device2->label); - result = _tmp2_; + _tmp10_ = g_strcmp0; + _tmp11_ = device1; + _tmp12_ = _tmp11_->label; + _tmp13_ = device2; + _tmp14_ = _tmp13_->label; + _tmp15_ = _tmp10_ (_tmp12_, _tmp14_); + result = _tmp15_; return result; } static gchar* sane_status_to_string (SANE_Status status) { gchar* result = NULL; - switch (status) { + SANE_Status _tmp0_; + _tmp0_ = status; + switch (_tmp0_) { case SANE_STATUS_GOOD: - { - gchar* _tmp0_; - _tmp0_ = g_strdup ("SANE_STATUS_GOOD"); - result = _tmp0_; - return result; - } - case SANE_STATUS_UNSUPPORTED: { gchar* _tmp1_; - _tmp1_ = g_strdup ("SANE_STATUS_UNSUPPORTED"); + _tmp1_ = g_strdup ("SANE_STATUS_GOOD"); result = _tmp1_; return result; } - case SANE_STATUS_CANCELLED: + case SANE_STATUS_UNSUPPORTED: { gchar* _tmp2_; - _tmp2_ = g_strdup ("SANE_STATUS_CANCELLED"); + _tmp2_ = g_strdup ("SANE_STATUS_UNSUPPORTED"); result = _tmp2_; return result; } - case SANE_STATUS_DEVICE_BUSY: + case SANE_STATUS_CANCELLED: { gchar* _tmp3_; - _tmp3_ = g_strdup ("SANE_STATUS_DEVICE_BUSY"); + _tmp3_ = g_strdup ("SANE_STATUS_CANCELLED"); result = _tmp3_; return result; } - case SANE_STATUS_INVAL: + case SANE_STATUS_DEVICE_BUSY: { gchar* _tmp4_; - _tmp4_ = g_strdup ("SANE_STATUS_INVAL"); + _tmp4_ = g_strdup ("SANE_STATUS_DEVICE_BUSY"); result = _tmp4_; return result; } - case SANE_STATUS_EOF: + case SANE_STATUS_INVAL: { gchar* _tmp5_; - _tmp5_ = g_strdup ("SANE_STATUS_EOF"); + _tmp5_ = g_strdup ("SANE_STATUS_INVAL"); result = _tmp5_; return result; } - case SANE_STATUS_JAMMED: + case SANE_STATUS_EOF: { gchar* _tmp6_; - _tmp6_ = g_strdup ("SANE_STATUS_JAMMED"); + _tmp6_ = g_strdup ("SANE_STATUS_EOF"); result = _tmp6_; return result; } - case SANE_STATUS_NO_DOCS: + case SANE_STATUS_JAMMED: { gchar* _tmp7_; - _tmp7_ = g_strdup ("SANE_STATUS_NO_DOCS"); + _tmp7_ = g_strdup ("SANE_STATUS_JAMMED"); result = _tmp7_; return result; } - case SANE_STATUS_COVER_OPEN: + case SANE_STATUS_NO_DOCS: { gchar* _tmp8_; - _tmp8_ = g_strdup ("SANE_STATUS_COVER_OPEN"); + _tmp8_ = g_strdup ("SANE_STATUS_NO_DOCS"); result = _tmp8_; return result; } - case SANE_STATUS_IO_ERROR: + case SANE_STATUS_COVER_OPEN: { gchar* _tmp9_; - _tmp9_ = g_strdup ("SANE_STATUS_IO_ERROR"); + _tmp9_ = g_strdup ("SANE_STATUS_COVER_OPEN"); result = _tmp9_; return result; } - case SANE_STATUS_NO_MEM: + case SANE_STATUS_IO_ERROR: { gchar* _tmp10_; - _tmp10_ = g_strdup ("SANE_STATUS_NO_MEM"); + _tmp10_ = g_strdup ("SANE_STATUS_IO_ERROR"); result = _tmp10_; return result; } - case SANE_STATUS_ACCESS_DENIED: + case SANE_STATUS_NO_MEM: { gchar* _tmp11_; - _tmp11_ = g_strdup ("SANE_STATUS_ACCESS_DENIED"); + _tmp11_ = g_strdup ("SANE_STATUS_NO_MEM"); result = _tmp11_; return result; } - default: + case SANE_STATUS_ACCESS_DENIED: { - gchar* _tmp12_ = NULL; - _tmp12_ = g_strdup_printf ("SANE_STATUS(%d)", (gint) status); + gchar* _tmp12_; + _tmp12_ = g_strdup ("SANE_STATUS_ACCESS_DENIED"); result = _tmp12_; return result; } + default: + { + SANE_Status _tmp13_; + gchar* _tmp14_ = NULL; + _tmp13_ = status; + _tmp14_ = g_strdup_printf ("SANE_STATUS(%d)", (gint) _tmp13_); + result = _tmp14_; + return result; + } } } @@ -3278,19 +3380,23 @@ static gchar* string_replace (const gchar* self, const gchar* old, const gchar* g_return_val_if_fail (old != NULL, NULL); g_return_val_if_fail (replacement != NULL, NULL); { - gchar* _tmp0_ = NULL; - gchar* _tmp1_; - GRegex* _tmp2_ = NULL; + const gchar* _tmp0_; + gchar* _tmp1_ = NULL; + gchar* _tmp2_; GRegex* _tmp3_; + GRegex* _tmp4_; GRegex* regex; - gchar* _tmp4_ = NULL; - gchar* _tmp5_; - _tmp0_ = g_regex_escape_string (old, -1); - _tmp1_ = _tmp0_; - _tmp2_ = g_regex_new (_tmp1_, 0, 0, &_inner_error_); - _tmp3_ = _tmp2_; - _g_free0 (_tmp1_); - regex = _tmp3_; + GRegex* _tmp5_; + const gchar* _tmp6_; + gchar* _tmp7_ = NULL; + gchar* _tmp8_; + _tmp0_ = old; + _tmp1_ = g_regex_escape_string (_tmp0_, -1); + _tmp2_ = _tmp1_; + _tmp3_ = g_regex_new (_tmp2_, 0, 0, &_inner_error_); + _tmp4_ = _tmp3_; + _g_free0 (_tmp2_); + regex = _tmp4_; if (_inner_error_ != NULL) { if (_inner_error_->domain == G_REGEX_ERROR) { goto __catch9_g_regex_error; @@ -3299,8 +3405,10 @@ static gchar* string_replace (const gchar* self, const gchar* old, const gchar* g_clear_error (&_inner_error_); return NULL; } - _tmp4_ = g_regex_replace_literal (regex, self, (gssize) (-1), 0, replacement, 0, &_inner_error_); - _tmp5_ = _tmp4_; + _tmp5_ = regex; + _tmp6_ = replacement; + _tmp7_ = g_regex_replace_literal (_tmp5_, self, (gssize) (-1), 0, _tmp6_, 0, &_inner_error_); + _tmp8_ = _tmp7_; if (_inner_error_ != NULL) { _g_regex_unref0 (regex); if (_inner_error_->domain == G_REGEX_ERROR) { @@ -3311,7 +3419,7 @@ static gchar* string_replace (const gchar* self, const gchar* old, const gchar* g_clear_error (&_inner_error_); return NULL; } - result = _tmp5_; + result = _tmp8_; _g_regex_unref0 (regex); return result; } @@ -3350,14 +3458,17 @@ static void scanner_do_redetect (Scanner* self) { gint device_list_length1; gint _device_list_size_; SANE_Device** _tmp0_ = NULL; - SANE_Status _tmp1_; + SANE_Status _tmp1_ = 0; SANE_Status status; - gchar* _tmp2_ = NULL; - gchar* _tmp3_; + SANE_Status _tmp2_; + gchar* _tmp3_ = NULL; + gchar* _tmp4_; + SANE_Status _tmp5_; GList* devices; - GList* _tmp17_; - NotifyUpdateDevices* _tmp18_ = NULL; - NotifyUpdateDevices* _tmp19_; + GList* _tmp57_; + GList* _tmp64_; + NotifyUpdateDevices* _tmp65_; + NotifyUpdateDevices* _tmp66_; g_return_if_fail (self != NULL); device_list = NULL; device_list_length1 = 0; @@ -3367,14 +3478,18 @@ static void scanner_do_redetect (Scanner* self) { device_list_length1 = -1; _device_list_size_ = device_list_length1; status = _tmp1_; - _tmp2_ = sane_status_to_string (status); - _tmp3_ = _tmp2_; - g_debug ("scanner.vala:318: sane_get_devices () -> %s", _tmp3_); - _g_free0 (_tmp3_); - if (status != SANE_STATUS_GOOD) { - const gchar* _tmp4_ = NULL; - _tmp4_ = sane_strstatus (status); - g_warning ("scanner.vala:321: Unable to get SANE devices: %s", _tmp4_); + _tmp2_ = status; + _tmp3_ = sane_status_to_string (_tmp2_); + _tmp4_ = _tmp3_; + g_debug ("scanner.vala:318: sane_get_devices () -> %s", _tmp4_); + _g_free0 (_tmp4_); + _tmp5_ = status; + if (_tmp5_ != SANE_STATUS_GOOD) { + SANE_Status _tmp6_; + const gchar* _tmp7_ = NULL; + _tmp6_ = status; + _tmp7_ = sane_strstatus (_tmp6_); + g_warning ("scanner.vala:321: Unable to get SANE devices: %s", _tmp7_); self->priv->need_redetect = FALSE; self->priv->state = SCAN_STATE_IDLE; return; @@ -3384,48 +3499,144 @@ static void scanner_do_redetect (Scanner* self) { gint i; i = 0; { - gboolean _tmp5_; - _tmp5_ = TRUE; + gboolean _tmp8_; + _tmp8_ = TRUE; while (TRUE) { - ScanDevice* _tmp6_ = NULL; + gboolean _tmp9_; + SANE_Device** _tmp11_; + gint _tmp11__length1; + gint _tmp12_; + SANE_Device* _tmp13_; + SANE_Device** _tmp14_; + gint _tmp14__length1; + gint _tmp15_; + SANE_Device* _tmp16_; + const gchar* _tmp17_; + SANE_Device** _tmp18_; + gint _tmp18__length1; + gint _tmp19_; + SANE_Device* _tmp20_; + const gchar* _tmp21_; + SANE_Device** _tmp22_; + gint _tmp22__length1; + gint _tmp23_; + SANE_Device* _tmp24_; + const gchar* _tmp25_; + SANE_Device** _tmp26_; + gint _tmp26__length1; + gint _tmp27_; + SANE_Device* _tmp28_; + const gchar* _tmp29_; + ScanDevice* _tmp30_; ScanDevice* scan_device; - gchar* _tmp7_; - gchar* _tmp8_; + ScanDevice* _tmp31_; + SANE_Device** _tmp32_; + gint _tmp32__length1; + gint _tmp33_; + SANE_Device* _tmp34_; + const gchar* _tmp35_; + gchar* _tmp36_; + SANE_Device** _tmp37_; + gint _tmp37__length1; + gint _tmp38_; + SANE_Device* _tmp39_; + const gchar* _tmp40_; + gchar* _tmp41_; gchar* vendor; - gchar* _tmp10_ = NULL; - gchar* _tmp11_ = NULL; - gchar* _tmp12_; - ScanDevice* _tmp13_; - if (!_tmp5_) { - i++; + const gchar* _tmp42_; + ScanDevice* _tmp44_; + const gchar* _tmp45_; + SANE_Device** _tmp46_; + gint _tmp46__length1; + gint _tmp47_; + SANE_Device* _tmp48_; + const gchar* _tmp49_; + gchar* _tmp50_ = NULL; + ScanDevice* _tmp51_; + const gchar* _tmp52_; + gchar* _tmp53_ = NULL; + gchar* _tmp54_; + ScanDevice* _tmp55_; + ScanDevice* _tmp56_; + _tmp9_ = _tmp8_; + if (!_tmp9_) { + gint _tmp10_; + _tmp10_ = i; + i = _tmp10_ + 1; } - _tmp5_ = FALSE; - if (!(device_list[i] != NULL)) { + _tmp8_ = FALSE; + _tmp11_ = device_list; + _tmp11__length1 = device_list_length1; + _tmp12_ = i; + _tmp13_ = _tmp11_[_tmp12_]; + if (!(_tmp13_ != NULL)) { break; } + _tmp14_ = device_list; + _tmp14__length1 = device_list_length1; + _tmp15_ = i; + _tmp16_ = _tmp14_[_tmp15_]; + _tmp17_ = _tmp16_->name; + _tmp18_ = device_list; + _tmp18__length1 = device_list_length1; + _tmp19_ = i; + _tmp20_ = _tmp18_[_tmp19_]; + _tmp21_ = _tmp20_->vendor; + _tmp22_ = device_list; + _tmp22__length1 = device_list_length1; + _tmp23_ = i; + _tmp24_ = _tmp22_[_tmp23_]; + _tmp25_ = _tmp24_->model; + _tmp26_ = device_list; + _tmp26__length1 = device_list_length1; + _tmp27_ = i; + _tmp28_ = _tmp26_[_tmp27_]; + _tmp29_ = _tmp28_->type; g_debug ("scanner.vala:330: Device: name=\"%s\" vendor=\"%s\" model=\"%s\" type=" \ -"\"%s\"", device_list[i]->name, device_list[i]->vendor, device_list[i]->model, device_list[i]->type); - _tmp6_ = scan_device_new (); - scan_device = _tmp6_; - _tmp7_ = g_strdup (device_list[i]->name); - _g_free0 (scan_device->name); - scan_device->name = _tmp7_; - _tmp8_ = g_strdup (device_list[i]->vendor); - vendor = _tmp8_; - if (g_strcmp0 (vendor, "Hewlett-Packard") == 0) { - gchar* _tmp9_; - _tmp9_ = g_strdup ("HP"); +"\"%s\"", _tmp17_, _tmp21_, _tmp25_, _tmp29_); + _tmp30_ = scan_device_new (); + scan_device = _tmp30_; + _tmp31_ = scan_device; + _tmp32_ = device_list; + _tmp32__length1 = device_list_length1; + _tmp33_ = i; + _tmp34_ = _tmp32_[_tmp33_]; + _tmp35_ = _tmp34_->name; + _tmp36_ = g_strdup (_tmp35_); + _g_free0 (_tmp31_->name); + _tmp31_->name = _tmp36_; + _tmp37_ = device_list; + _tmp37__length1 = device_list_length1; + _tmp38_ = i; + _tmp39_ = _tmp37_[_tmp38_]; + _tmp40_ = _tmp39_->vendor; + _tmp41_ = g_strdup (_tmp40_); + vendor = _tmp41_; + _tmp42_ = vendor; + if (g_strcmp0 (_tmp42_, "Hewlett-Packard") == 0) { + gchar* _tmp43_; + _tmp43_ = g_strdup ("HP"); _g_free0 (vendor); - vendor = _tmp9_; + vendor = _tmp43_; } - _tmp10_ = g_strdup_printf ("%s %s", vendor, device_list[i]->model); - _g_free0 (scan_device->label); - scan_device->label = _tmp10_; - _tmp11_ = string_replace (scan_device->label, "_", " "); - _tmp12_ = _tmp11_; - _g_free0 (_tmp12_); - _tmp13_ = _scan_device_ref0 (scan_device); - devices = g_list_append (devices, _tmp13_); + _tmp44_ = scan_device; + _tmp45_ = vendor; + _tmp46_ = device_list; + _tmp46__length1 = device_list_length1; + _tmp47_ = i; + _tmp48_ = _tmp46_[_tmp47_]; + _tmp49_ = _tmp48_->model; + _tmp50_ = g_strdup_printf ("%s %s", _tmp45_, _tmp49_); + _g_free0 (_tmp44_->label); + _tmp44_->label = _tmp50_; + _tmp51_ = scan_device; + _tmp52_ = _tmp51_->label; + _tmp53_ = string_replace (_tmp52_, "_", " "); + _tmp54_ = _tmp53_; + _g_free0 (_tmp54_); + _tmp55_ = scan_device; + _tmp56_ = _scan_device_ref0 (_tmp55_); + devices = g_list_append (devices, _tmp56_); _g_free0 (vendor); _scan_device_unref0 (scan_device); } @@ -3434,380 +3645,772 @@ static void scanner_do_redetect (Scanner* self) { devices = g_list_sort (devices, _scanner_compare_devices_gcompare_func); self->priv->need_redetect = FALSE; self->priv->state = SCAN_STATE_IDLE; - if (devices != NULL) { - gconstpointer _tmp14_ = NULL; - ScanDevice* _tmp15_; + _tmp57_ = devices; + if (_tmp57_ != NULL) { + GList* _tmp58_; + gconstpointer _tmp59_ = NULL; + ScanDevice* _tmp60_; ScanDevice* device; - gchar* _tmp16_; - _tmp14_ = g_list_nth_data (devices, (guint) 0); - _tmp15_ = _scan_device_ref0 ((ScanDevice*) _tmp14_); - device = _tmp15_; - _tmp16_ = g_strdup (device->name); + ScanDevice* _tmp61_; + const gchar* _tmp62_; + gchar* _tmp63_; + _tmp58_ = devices; + _tmp59_ = g_list_nth_data (_tmp58_, (guint) 0); + _tmp60_ = _scan_device_ref0 ((ScanDevice*) _tmp59_); + device = _tmp60_; + _tmp61_ = device; + _tmp62_ = _tmp61_->name; + _tmp63_ = g_strdup (_tmp62_); _g_free0 (self->priv->default_device); - self->priv->default_device = _tmp16_; + self->priv->default_device = _tmp63_; _scan_device_unref0 (device); } else { _g_free0 (self->priv->default_device); self->priv->default_device = NULL; } - _tmp17_ = devices; + _tmp64_ = devices; devices = NULL; - _tmp18_ = notify_update_devices_new (_tmp17_); - _tmp19_ = _tmp18_; - scanner_notify (self, (Notify*) _tmp19_); - _notify_unref0 (_tmp19_); + _tmp65_ = notify_update_devices_new (_tmp64_); + _tmp66_ = _tmp65_; + scanner_notify (self, (Notify*) _tmp66_); + _notify_unref0 (_tmp66_); __g_list_free__scan_device_unref0_0 (devices); } -static gboolean scanner_set_default_option (Scanner* self, SANE_Handle handle, const SANE_Option_Descriptor* option, SANE_Int option_index) { +static gboolean scanner_set_default_option (Scanner* self, SANE_Handle handle, SANE_Option_Descriptor* option, SANE_Int option_index) { gboolean result = FALSE; - SANE_Status _tmp0_; + SANE_Option_Descriptor* _tmp0_; + SANE_Int _tmp1_; + SANE_Handle _tmp2_; + SANE_Int _tmp3_; + SANE_Status _tmp4_ = 0; SANE_Status status; - gchar* _tmp1_ = NULL; - gchar* _tmp2_; + SANE_Int _tmp5_; + SANE_Status _tmp6_; + gchar* _tmp7_ = NULL; + gchar* _tmp8_; + SANE_Status _tmp9_; + SANE_Status _tmp14_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (option != NULL, FALSE); - if (((gint) (option->cap & SANE_CAP_AUTOMATIC)) == 0) { + _tmp0_ = option; + _tmp1_ = _tmp0_->cap; + if ((_tmp1_ & SANE_CAP_AUTOMATIC) == ((SANE_Int) 0)) { result = FALSE; return result; } - _tmp0_ = sane_control_option (handle, option_index, SANE_ACTION_SET_AUTO, NULL, NULL); - status = _tmp0_; - _tmp1_ = sane_status_to_string (status); - _tmp2_ = _tmp1_; - g_debug ("scanner.vala:372: sane_control_option (%d, SANE_ACTION_SET_AUTO) -> %s", (gint) option_index, _tmp2_); - _g_free0 (_tmp2_); - if (status != SANE_STATUS_GOOD) { - const gchar* _tmp3_ = NULL; - _tmp3_ = sane_strstatus (status); - g_warning ("scanner.vala:374: Error setting default option %s: %s", option->name, _tmp3_); - } - result = status == SANE_STATUS_GOOD; + _tmp2_ = handle; + _tmp3_ = option_index; + _tmp4_ = sane_control_option (_tmp2_, _tmp3_, SANE_ACTION_SET_AUTO, NULL, NULL); + status = _tmp4_; + _tmp5_ = option_index; + _tmp6_ = status; + _tmp7_ = sane_status_to_string (_tmp6_); + _tmp8_ = _tmp7_; + g_debug ("scanner.vala:372: sane_control_option (%d, SANE_ACTION_SET_AUTO) -> %s", (gint) _tmp5_, _tmp8_); + _g_free0 (_tmp8_); + _tmp9_ = status; + if (_tmp9_ != SANE_STATUS_GOOD) { + SANE_Option_Descriptor* _tmp10_; + const gchar* _tmp11_; + SANE_Status _tmp12_; + const gchar* _tmp13_ = NULL; + _tmp10_ = option; + _tmp11_ = _tmp10_->name; + _tmp12_ = status; + _tmp13_ = sane_strstatus (_tmp12_); + g_warning ("scanner.vala:374: Error setting default option %s: %s", _tmp11_, _tmp13_); + } + _tmp14_ = status; + result = _tmp14_ == SANE_STATUS_GOOD; return result; } -static void scanner_set_bool_option (Scanner* self, SANE_Handle handle, const SANE_Option_Descriptor* option, SANE_Int option_index, gboolean value, gboolean* _result_) { - gboolean _result = FALSE; +static void scanner_set_bool_option (Scanner* self, SANE_Handle handle, SANE_Option_Descriptor* option, SANE_Int option_index, gboolean value, gboolean* _result_) { + gboolean _vala_result = FALSE; + SANE_Option_Descriptor* _tmp0_; + SANE_Value_Type _tmp1_; + gboolean _tmp2_; SANE_Bool v; - SANE_Status _tmp0_; + SANE_Handle _tmp3_; + SANE_Int _tmp4_; + SANE_Status _tmp5_ = 0; SANE_Status status; - const gchar* _tmp1_ = NULL; - const gchar* _tmp2_ = NULL; - gchar* _tmp3_ = NULL; - gchar* _tmp4_; + SANE_Bool _tmp6_; + const gchar* _tmp7_ = NULL; + gboolean _tmp8_; + const gchar* _tmp9_ = NULL; + gboolean _tmp10_; + SANE_Int _tmp11_; + const gchar* _tmp12_; + SANE_Status _tmp13_; + gchar* _tmp14_ = NULL; + gchar* _tmp15_; + const gchar* _tmp16_; g_return_if_fail (self != NULL); g_return_if_fail (option != NULL); - g_return_if_fail (option->type == SANE_TYPE_BOOL); - v = (SANE_Bool) value; - _tmp0_ = sane_control_option (handle, option_index, SANE_ACTION_SET_VALUE, &v, NULL); - status = _tmp0_; - _result = (gboolean) v; - if (value) { - _tmp1_ = "SANE_TRUE"; + _tmp0_ = option; + _tmp1_ = _tmp0_->type; + g_return_if_fail (_tmp1_ == SANE_TYPE_BOOL); + _tmp2_ = value; + v = (SANE_Bool) _tmp2_; + _tmp3_ = handle; + _tmp4_ = option_index; + _tmp5_ = sane_control_option (_tmp3_, _tmp4_, SANE_ACTION_SET_VALUE, &v, NULL); + status = _tmp5_; + _tmp6_ = v; + _vala_result = (gboolean) _tmp6_; + _tmp8_ = value; + if (_tmp8_) { + _tmp7_ = "SANE_TRUE"; } else { - _tmp1_ = "SANE_FALSE"; + _tmp7_ = "SANE_FALSE"; } - if (_result) { - _tmp2_ = "SANE_TRUE"; + _tmp10_ = _vala_result; + if (_tmp10_) { + _tmp9_ = "SANE_TRUE"; } else { - _tmp2_ = "SANE_FALSE"; - } - _tmp3_ = sane_status_to_string (status); - _tmp4_ = _tmp3_; + _tmp9_ = "SANE_FALSE"; + } + _tmp11_ = option_index; + _tmp12_ = _tmp7_; + _tmp13_ = status; + _tmp14_ = sane_status_to_string (_tmp13_); + _tmp15_ = _tmp14_; + _tmp16_ = _tmp9_; g_debug ("scanner.vala:386: sane_control_option (%d, SANE_ACTION_SET_VALUE, %s) " \ -"-> (%s, %s)", (gint) option_index, _tmp1_, _tmp4_, _tmp2_); - _g_free0 (_tmp4_); +"-> (%s, %s)", (gint) _tmp11_, _tmp12_, _tmp15_, _tmp16_); + _g_free0 (_tmp15_); if (_result_) { - *_result_ = _result; + *_result_ = _vala_result; } } -static void scanner_set_int_option (Scanner* self, SANE_Handle handle, const SANE_Option_Descriptor* option, SANE_Int option_index, gint value, gint* _result_) { - gint _result = 0; +static void scanner_set_int_option (Scanner* self, SANE_Handle handle, SANE_Option_Descriptor* option, SANE_Int option_index, gint value, gint* _result_) { + gint _vala_result = 0; + SANE_Option_Descriptor* _tmp0_; + SANE_Value_Type _tmp1_; + gint _tmp2_; SANE_Int v; - SANE_Status _tmp2_; + SANE_Option_Descriptor* _tmp3_; + SANE_Constraint_Type _tmp4_; + SANE_Handle _tmp49_; + SANE_Int _tmp50_; + SANE_Status _tmp51_ = 0; SANE_Status status; - gchar* _tmp3_ = NULL; - gchar* _tmp4_; + SANE_Int _tmp52_; + gint _tmp53_; + gchar* _tmp54_ = NULL; + gchar* _tmp55_; + SANE_Int _tmp56_; + SANE_Int _tmp57_; g_return_if_fail (self != NULL); g_return_if_fail (option != NULL); - g_return_if_fail (option->type == SANE_TYPE_INT); - v = (SANE_Int) value; - if (option->constraint_type == SANE_CONSTRAINT_RANGE) { - if (((gint) option->constraint.range->quant) != 0) { - v = v * option->constraint.range->quant; + _tmp0_ = option; + _tmp1_ = _tmp0_->type; + g_return_if_fail (_tmp1_ == SANE_TYPE_INT); + _tmp2_ = value; + v = (SANE_Int) _tmp2_; + _tmp3_ = option; + _tmp4_ = _tmp3_->constraint_type; + if (_tmp4_ == SANE_CONSTRAINT_RANGE) { + SANE_Option_Descriptor* _tmp5_; + SANE_Range* _tmp6_; + SANE_Word _tmp7_; + SANE_Int _tmp12_; + SANE_Option_Descriptor* _tmp13_; + SANE_Range* _tmp14_; + SANE_Word _tmp15_; + SANE_Int _tmp19_; + SANE_Option_Descriptor* _tmp20_; + SANE_Range* _tmp21_; + SANE_Word _tmp22_; + _tmp5_ = option; + _tmp6_ = _tmp5_->constraint.range; + _tmp7_ = _tmp6_->quant; + if (_tmp7_ != ((SANE_Word) 0)) { + SANE_Int _tmp8_; + SANE_Option_Descriptor* _tmp9_; + SANE_Range* _tmp10_; + SANE_Word _tmp11_; + _tmp8_ = v; + _tmp9_ = option; + _tmp10_ = _tmp9_->constraint.range; + _tmp11_ = _tmp10_->quant; + v = _tmp8_ * _tmp11_; } - if (v < ((SANE_Int) option->constraint.range->min)) { - v = (SANE_Int) option->constraint.range->min; + _tmp12_ = v; + _tmp13_ = option; + _tmp14_ = _tmp13_->constraint.range; + _tmp15_ = _tmp14_->min; + if (_tmp12_ < ((SANE_Int) _tmp15_)) { + SANE_Option_Descriptor* _tmp16_; + SANE_Range* _tmp17_; + SANE_Word _tmp18_; + _tmp16_ = option; + _tmp17_ = _tmp16_->constraint.range; + _tmp18_ = _tmp17_->min; + v = (SANE_Int) _tmp18_; } - if (v > ((SANE_Int) option->constraint.range->max)) { - v = (SANE_Int) option->constraint.range->max; + _tmp19_ = v; + _tmp20_ = option; + _tmp21_ = _tmp20_->constraint.range; + _tmp22_ = _tmp21_->max; + if (_tmp19_ > ((SANE_Int) _tmp22_)) { + SANE_Option_Descriptor* _tmp23_; + SANE_Range* _tmp24_; + SANE_Word _tmp25_; + _tmp23_ = option; + _tmp24_ = _tmp23_->constraint.range; + _tmp25_ = _tmp24_->max; + v = (SANE_Int) _tmp25_; } } else { - if (option->constraint_type == SANE_CONSTRAINT_WORD_LIST) { + SANE_Option_Descriptor* _tmp26_; + SANE_Constraint_Type _tmp27_; + _tmp26_ = option; + _tmp27_ = _tmp26_->constraint_type; + if (_tmp27_ == SANE_CONSTRAINT_WORD_LIST) { + gint _tmp28_; gint distance; gint nearest; - distance = G_MAXINT; + gint _tmp48_; + _tmp28_ = G_MAXINT; + distance = _tmp28_; nearest = 0; { gint i; i = 0; { - gboolean _tmp0_; - _tmp0_ = TRUE; + gboolean _tmp29_; + _tmp29_ = TRUE; while (TRUE) { + gboolean _tmp30_; + gint _tmp32_; + SANE_Option_Descriptor* _tmp33_; + SANE_Word* _tmp34_; + gint _tmp34__length1; + SANE_Word _tmp35_; + SANE_Option_Descriptor* _tmp36_; + SANE_Word* _tmp37_; + gint _tmp37__length1; + gint _tmp38_; + SANE_Word _tmp39_; gint x; - gint _tmp1_; + gint _tmp40_; + SANE_Int _tmp41_; gint d; - if (!_tmp0_) { - i++; + gint _tmp42_; + gint _tmp43_ = 0; + gint _tmp44_; + gint _tmp45_; + _tmp30_ = _tmp29_; + if (!_tmp30_) { + gint _tmp31_; + _tmp31_ = i; + i = _tmp31_ + 1; } - _tmp0_ = FALSE; - if (!(i < ((gint) option->constraint.word_list[0]))) { + _tmp29_ = FALSE; + _tmp32_ = i; + _tmp33_ = option; + _tmp34_ = _tmp33_->constraint.word_list; + _tmp34__length1 = -1; + _tmp35_ = _tmp34_[0]; + if (!(((SANE_Word) _tmp32_) < _tmp35_)) { break; } - x = (gint) option->constraint.word_list[i + 1]; - _tmp1_ = abs (x - v); - d = _tmp1_; - if (d < distance) { - distance = d; - nearest = x; + _tmp36_ = option; + _tmp37_ = _tmp36_->constraint.word_list; + _tmp37__length1 = -1; + _tmp38_ = i; + _tmp39_ = _tmp37_[_tmp38_ + 1]; + x = (gint) _tmp39_; + _tmp40_ = x; + _tmp41_ = v; + d = (gint) (_tmp40_ - _tmp41_); + _tmp42_ = d; + _tmp43_ = abs (_tmp42_); + d = _tmp43_; + _tmp44_ = d; + _tmp45_ = distance; + if (_tmp44_ < _tmp45_) { + gint _tmp46_; + gint _tmp47_; + _tmp46_ = d; + distance = _tmp46_; + _tmp47_ = x; + nearest = _tmp47_; } } } } - v = (SANE_Int) nearest; + _tmp48_ = nearest; + v = (SANE_Int) _tmp48_; } } - _tmp2_ = sane_control_option (handle, option_index, SANE_ACTION_SET_VALUE, &v, NULL); - status = _tmp2_; - _tmp3_ = sane_status_to_string (status); - _tmp4_ = _tmp3_; - g_debug ("scanner.vala:422: sane_control_option (%d, SANE_ACTION_SET_VALUE, %d) " \ -"-> (%s, %d)", (gint) option_index, value, _tmp4_, (gint) v); - _g_free0 (_tmp4_); - _result = (gint) v; + _tmp49_ = handle; + _tmp50_ = option_index; + _tmp51_ = sane_control_option (_tmp49_, _tmp50_, SANE_ACTION_SET_VALUE, &v, NULL); + status = _tmp51_; + _tmp52_ = option_index; + _tmp53_ = value; + _tmp54_ = sane_status_to_string (status); + _tmp55_ = _tmp54_; + _tmp56_ = v; + g_debug ("scanner.vala:423: sane_control_option (%d, SANE_ACTION_SET_VALUE, %d) " \ +"-> (%s, %d)", (gint) _tmp52_, _tmp53_, _tmp55_, (gint) _tmp56_); + _g_free0 (_tmp55_); + _tmp57_ = v; + _vala_result = (gint) _tmp57_; if (_result_) { - *_result_ = _result; + *_result_ = _vala_result; } } -static void scanner_set_fixed_option (Scanner* self, SANE_Handle handle, const SANE_Option_Descriptor* option, SANE_Int option_index, gdouble value, gdouble* _result_) { - gdouble _result = 0.0; +static void scanner_set_fixed_option (Scanner* self, SANE_Handle handle, SANE_Option_Descriptor* option, SANE_Int option_index, gdouble value, gdouble* _result_) { + gdouble _vala_result = 0.0; + gdouble _tmp0_; gdouble v; - SANE_Fixed v_fixed; - SANE_Fixed _tmp6_; - SANE_Status _tmp7_; + SANE_Fixed v_fixed = {0}; + SANE_Option_Descriptor* _tmp1_; + SANE_Value_Type _tmp2_; + SANE_Option_Descriptor* _tmp3_; + SANE_Constraint_Type _tmp4_; + gdouble _tmp43_; + SANE_Fixed _tmp44_ = {0}; + SANE_Handle _tmp45_; + SANE_Int _tmp46_; + SANE_Status _tmp47_ = 0; SANE_Status status; - gchar* _tmp8_ = NULL; - gchar* _tmp9_; - gdouble _tmp10_; - gdouble _tmp11_; + SANE_Int _tmp48_; + gdouble _tmp49_; + gchar* _tmp50_ = NULL; + gchar* _tmp51_; + gdouble _tmp52_ = 0.0; + gdouble _tmp53_ = 0.0; g_return_if_fail (self != NULL); g_return_if_fail (option != NULL); - v = value; - g_return_if_fail (option->type == SANE_TYPE_FIXED); - if (option->constraint_type == SANE_CONSTRAINT_RANGE) { - gdouble _tmp0_; + _tmp0_ = value; + v = _tmp0_; + _tmp1_ = option; + _tmp2_ = _tmp1_->type; + g_return_if_fail (_tmp2_ == SANE_TYPE_FIXED); + _tmp3_ = option; + _tmp4_ = _tmp3_->constraint_type; + if (_tmp4_ == SANE_CONSTRAINT_RANGE) { + SANE_Option_Descriptor* _tmp5_; + SANE_Range* _tmp6_; + SANE_Word _tmp7_; + gdouble _tmp8_ = 0.0; gdouble min; - gdouble _tmp1_; + SANE_Option_Descriptor* _tmp9_; + SANE_Range* _tmp10_; + SANE_Word _tmp11_; + gdouble _tmp12_ = 0.0; gdouble max; - _tmp0_ = SANE_UNFIX ((SANE_Fixed) option->constraint.range->min); - min = _tmp0_; - _tmp1_ = SANE_UNFIX ((SANE_Fixed) option->constraint.range->max); - max = _tmp1_; - if (v < min) { - v = min; + gdouble _tmp13_; + gdouble _tmp14_; + gdouble _tmp16_; + gdouble _tmp17_; + _tmp5_ = option; + _tmp6_ = _tmp5_->constraint.range; + _tmp7_ = _tmp6_->min; + _tmp8_ = SANE_UNFIX ((SANE_Fixed) _tmp7_); + min = _tmp8_; + _tmp9_ = option; + _tmp10_ = _tmp9_->constraint.range; + _tmp11_ = _tmp10_->max; + _tmp12_ = SANE_UNFIX ((SANE_Fixed) _tmp11_); + max = _tmp12_; + _tmp13_ = v; + _tmp14_ = min; + if (_tmp13_ < _tmp14_) { + gdouble _tmp15_; + _tmp15_ = min; + v = _tmp15_; } - if (v > max) { - v = max; + _tmp16_ = v; + _tmp17_ = max; + if (_tmp16_ > _tmp17_) { + gdouble _tmp18_; + _tmp18_ = max; + v = _tmp18_; } } else { - if (option->constraint_type == SANE_CONSTRAINT_WORD_LIST) { + SANE_Option_Descriptor* _tmp19_; + SANE_Constraint_Type _tmp20_; + _tmp19_ = option; + _tmp20_ = _tmp19_->constraint_type; + if (_tmp20_ == SANE_CONSTRAINT_WORD_LIST) { + gdouble _tmp21_; gdouble distance; gdouble nearest; - distance = DBL_MAX; + gdouble _tmp42_; + _tmp21_ = DBL_MAX; + distance = _tmp21_; nearest = 0.0; { gint i; i = 0; { - gboolean _tmp2_; - _tmp2_ = TRUE; + gboolean _tmp22_; + _tmp22_ = TRUE; while (TRUE) { - gdouble _tmp3_; + gboolean _tmp23_; + gint _tmp25_; + SANE_Option_Descriptor* _tmp26_; + SANE_Word* _tmp27_; + gint _tmp27__length1; + SANE_Word _tmp28_; + SANE_Option_Descriptor* _tmp29_; + SANE_Word* _tmp30_; + gint _tmp30__length1; + gint _tmp31_; + SANE_Word _tmp32_; + gdouble _tmp33_ = 0.0; gdouble x; - gdouble _tmp4_; - if (!_tmp2_) { - i++; + gdouble _tmp34_; + gdouble _tmp35_; + gdouble _tmp36_ = 0.0; + gdouble _tmp37_; + _tmp23_ = _tmp22_; + if (!_tmp23_) { + gint _tmp24_; + _tmp24_ = i; + i = _tmp24_ + 1; } - _tmp2_ = FALSE; - if (!(i < ((gint) option->constraint.word_list[0]))) { + _tmp22_ = FALSE; + _tmp25_ = i; + _tmp26_ = option; + _tmp27_ = _tmp26_->constraint.word_list; + _tmp27__length1 = -1; + _tmp28_ = _tmp27_[0]; + if (!(((SANE_Word) _tmp25_) < _tmp28_)) { break; } - _tmp3_ = SANE_UNFIX ((SANE_Fixed) option->constraint.word_list[i + 1]); - x = _tmp3_; - _tmp4_ = fabs (x - v); - if (_tmp4_ < distance) { - gdouble _tmp5_; - _tmp5_ = fabs (x - v); - distance = _tmp5_; - nearest = x; + _tmp29_ = option; + _tmp30_ = _tmp29_->constraint.word_list; + _tmp30__length1 = -1; + _tmp31_ = i; + _tmp32_ = _tmp30_[_tmp31_ + 1]; + _tmp33_ = SANE_UNFIX ((SANE_Fixed) _tmp32_); + x = _tmp33_; + _tmp34_ = x; + _tmp35_ = v; + _tmp36_ = fabs (_tmp34_ - _tmp35_); + _tmp37_ = distance; + if (_tmp36_ < _tmp37_) { + gdouble _tmp38_; + gdouble _tmp39_; + gdouble _tmp40_ = 0.0; + gdouble _tmp41_; + _tmp38_ = x; + _tmp39_ = v; + _tmp40_ = fabs (_tmp38_ - _tmp39_); + distance = _tmp40_; + _tmp41_ = x; + nearest = _tmp41_; } } } } - v = nearest; + _tmp42_ = nearest; + v = _tmp42_; } } - _tmp6_ = SANE_FIX (v); - v_fixed = _tmp6_; - _tmp7_ = sane_control_option (handle, option_index, SANE_ACTION_SET_VALUE, &v_fixed, NULL); - status = _tmp7_; - _tmp8_ = sane_status_to_string (status); - _tmp9_ = _tmp8_; - _tmp10_ = SANE_UNFIX (v_fixed); - g_debug ("scanner.vala:462: sane_control_option (%d, SANE_ACTION_SET_VALUE, %f) " \ -"-> (%s, %f)", (gint) option_index, value, _tmp9_, _tmp10_); - _g_free0 (_tmp9_); - _tmp11_ = SANE_UNFIX (v_fixed); - _result = _tmp11_; + _tmp43_ = v; + _tmp44_ = SANE_FIX (_tmp43_); + v_fixed = _tmp44_; + _tmp45_ = handle; + _tmp46_ = option_index; + _tmp47_ = sane_control_option (_tmp45_, _tmp46_, SANE_ACTION_SET_VALUE, &v_fixed, NULL); + status = _tmp47_; + _tmp48_ = option_index; + _tmp49_ = value; + _tmp50_ = sane_status_to_string (status); + _tmp51_ = _tmp50_; + _tmp52_ = SANE_UNFIX (v_fixed); + g_debug ("scanner.vala:463: sane_control_option (%d, SANE_ACTION_SET_VALUE, %f) " \ +"-> (%s, %f)", (gint) _tmp48_, _tmp49_, _tmp51_, _tmp52_); + _g_free0 (_tmp51_); + _tmp53_ = SANE_UNFIX (v_fixed); + _vala_result = _tmp53_; if (_result_) { - *_result_ = _result; + *_result_ = _vala_result; } } static gchar string_get (const gchar* self, glong index) { gchar result = '\0'; + glong _tmp0_; + gchar _tmp1_; g_return_val_if_fail (self != NULL, '\0'); - result = ((gchar*) self)[index]; + _tmp0_ = index; + _tmp1_ = ((gchar*) self)[_tmp0_]; + result = _tmp1_; return result; } -static gboolean scanner_set_string_option (Scanner* self, SANE_Handle handle, const SANE_Option_Descriptor* option, SANE_Int option_index, const gchar* value, gchar** _result_) { - gchar* _result = NULL; +static gboolean scanner_set_string_option (Scanner* self, SANE_Handle handle, SANE_Option_Descriptor* option, SANE_Int option_index, const gchar* value, gchar** _result_) { + gchar* _vala_result = NULL; gboolean result = FALSE; - gchar* _tmp0_ = NULL; + SANE_Option_Descriptor* _tmp0_; + SANE_Value_Type _tmp1_; + SANE_Option_Descriptor* _tmp2_; + SANE_Int _tmp3_; + gchar* _tmp4_ = NULL; gchar* s; gint s_length1; gint _s_size_; gint i; - SANE_Status _tmp5_; + gchar* _tmp22_; + gint _tmp22__length1; + gint _tmp23_; + gchar _tmp24_; + SANE_Handle _tmp25_; + SANE_Int _tmp26_; + gchar* _tmp27_; + gint _tmp27__length1; + SANE_Status _tmp28_ = 0; SANE_Status status; - gchar* _tmp6_; - gchar* _tmp7_ = NULL; - gchar* _tmp8_; + gchar* _tmp29_; + gint _tmp29__length1; + gchar* _tmp30_; + SANE_Int _tmp31_; + const gchar* _tmp32_; + gchar* _tmp33_ = NULL; + gchar* _tmp34_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (option != NULL, FALSE); g_return_val_if_fail (value != NULL, FALSE); - g_return_val_if_fail (option->type == SANE_TYPE_STRING, FALSE); - _tmp0_ = g_new0 (gchar, option->size); - s = _tmp0_; - s_length1 = option->size; + _tmp0_ = option; + _tmp1_ = _tmp0_->type; + g_return_val_if_fail (_tmp1_ == SANE_TYPE_STRING, FALSE); + _tmp2_ = option; + _tmp3_ = _tmp2_->size; + _tmp4_ = g_new0 (gchar, _tmp3_); + s = _tmp4_; + s_length1 = _tmp3_; _s_size_ = s_length1; i = 0; { - gboolean _tmp1_; - _tmp1_ = TRUE; + gboolean _tmp5_; + _tmp5_ = TRUE; while (TRUE) { - gboolean _tmp2_ = FALSE; - gchar _tmp4_; - if (!_tmp1_) { - i++; + gboolean _tmp6_; + gboolean _tmp8_ = FALSE; + gint _tmp9_; + SANE_Option_Descriptor* _tmp10_; + SANE_Int _tmp11_; + gboolean _tmp15_; + gchar* _tmp16_; + gint _tmp16__length1; + gint _tmp17_; + const gchar* _tmp18_; + gint _tmp19_; + gchar _tmp20_ = '\0'; + gchar _tmp21_; + _tmp6_ = _tmp5_; + if (!_tmp6_) { + gint _tmp7_; + _tmp7_ = i; + i = _tmp7_ + 1; } - _tmp1_ = FALSE; - if (i < (option->size - 1)) { - gchar _tmp3_; - _tmp3_ = string_get (value, (glong) i); - _tmp2_ = _tmp3_ != '\0'; + _tmp5_ = FALSE; + _tmp9_ = i; + _tmp10_ = option; + _tmp11_ = _tmp10_->size; + if (((SANE_Int) _tmp9_) < (_tmp11_ - 1)) { + const gchar* _tmp12_; + gint _tmp13_; + gchar _tmp14_ = '\0'; + _tmp12_ = value; + _tmp13_ = i; + _tmp14_ = string_get (_tmp12_, (glong) _tmp13_); + _tmp8_ = _tmp14_ != '\0'; } else { - _tmp2_ = FALSE; + _tmp8_ = FALSE; } - if (!_tmp2_) { + _tmp15_ = _tmp8_; + if (!_tmp15_) { break; } - _tmp4_ = string_get (value, (glong) i); - s[i] = _tmp4_; + _tmp16_ = s; + _tmp16__length1 = s_length1; + _tmp17_ = i; + _tmp18_ = value; + _tmp19_ = i; + _tmp20_ = string_get (_tmp18_, (glong) _tmp19_); + _tmp16_[_tmp17_] = _tmp20_; + _tmp21_ = _tmp16_[_tmp17_]; } } - s[i] = '\0'; - _tmp5_ = sane_control_option (handle, option_index, SANE_ACTION_SET_VALUE, s, NULL); - status = _tmp5_; - _tmp6_ = g_strdup ((const gchar*) s); - _g_free0 (_result); - _result = _tmp6_; - _tmp7_ = sane_status_to_string (status); - _tmp8_ = _tmp7_; - g_debug ("scanner.vala:478: sane_control_option (%d, SANE_ACTION_SET_VALUE, \"%s" \ -"\") -> (%s, \"%s\")", (gint) option_index, value, _tmp8_, _result); - _g_free0 (_tmp8_); + _tmp22_ = s; + _tmp22__length1 = s_length1; + _tmp23_ = i; + _tmp22_[_tmp23_] = '\0'; + _tmp24_ = _tmp22_[_tmp23_]; + _tmp25_ = handle; + _tmp26_ = option_index; + _tmp27_ = s; + _tmp27__length1 = s_length1; + _tmp28_ = sane_control_option (_tmp25_, _tmp26_, SANE_ACTION_SET_VALUE, _tmp27_, NULL); + status = _tmp28_; + _tmp29_ = s; + _tmp29__length1 = s_length1; + _tmp30_ = g_strdup ((const gchar*) _tmp29_); + _g_free0 (_vala_result); + _vala_result = _tmp30_; + _tmp31_ = option_index; + _tmp32_ = value; + _tmp33_ = sane_status_to_string (status); + _tmp34_ = _tmp33_; + g_debug ("scanner.vala:479: sane_control_option (%d, SANE_ACTION_SET_VALUE, \"%s" \ +"\") -> (%s, \"%s\")", (gint) _tmp31_, _tmp32_, _tmp34_, _vala_result); + _g_free0 (_tmp34_); result = status == SANE_STATUS_GOOD; s = (g_free (s), NULL); if (_result_) { - *_result_ = _result; + *_result_ = _vala_result; } else { - _g_free0 (_result); + _g_free0 (_vala_result); } return result; } -static gboolean scanner_set_constrained_string_option (Scanner* self, SANE_Handle handle, const SANE_Option_Descriptor* option, SANE_Int option_index, gchar** values, int values_length1, gchar** _result_) { - gchar* _result = NULL; +static gboolean scanner_set_constrained_string_option (Scanner* self, SANE_Handle handle, SANE_Option_Descriptor* option, SANE_Int option_index, gchar** values, int values_length1, gchar** _result_) { + gchar* _vala_result = NULL; gboolean result = FALSE; + SANE_Option_Descriptor* _tmp0_; + SANE_Value_Type _tmp1_; + SANE_Option_Descriptor* _tmp2_; + SANE_Constraint_Type _tmp3_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (option != NULL, FALSE); - g_return_val_if_fail (option->type == SANE_TYPE_STRING, FALSE); - g_return_val_if_fail (option->constraint_type == SANE_CONSTRAINT_STRING_LIST, FALSE); + _tmp0_ = option; + _tmp1_ = _tmp0_->type; + g_return_val_if_fail (_tmp1_ == SANE_TYPE_STRING, FALSE); + _tmp2_ = option; + _tmp3_ = _tmp2_->constraint_type; + g_return_val_if_fail (_tmp3_ == SANE_CONSTRAINT_STRING_LIST, FALSE); { gint i; i = 0; { - gboolean _tmp0_; - _tmp0_ = TRUE; + gboolean _tmp4_; + _tmp4_ = TRUE; while (TRUE) { + gboolean _tmp5_; + gchar** _tmp7_; + gint _tmp7__length1; + gint _tmp8_; + const gchar* _tmp9_; gint j; - if (!_tmp0_) { - i++; + SANE_Option_Descriptor* _tmp24_; + gchar** _tmp25_; + gint _tmp25__length1; + gint _tmp26_; + const gchar* _tmp27_; + _tmp5_ = _tmp4_; + if (!_tmp5_) { + gint _tmp6_; + _tmp6_ = i; + i = _tmp6_ + 1; } - _tmp0_ = FALSE; - if (!(values[i] != NULL)) { + _tmp4_ = FALSE; + _tmp7_ = values; + _tmp7__length1 = values_length1; + _tmp8_ = i; + _tmp9_ = _tmp7_[_tmp8_]; + if (!(_tmp9_ != NULL)) { break; } j = 0; { - gboolean _tmp1_; - _tmp1_ = TRUE; + gboolean _tmp10_; + _tmp10_ = TRUE; while (TRUE) { - if (!_tmp1_) { - j++; + gboolean _tmp11_; + SANE_Option_Descriptor* _tmp13_; + gchar** _tmp14_; + gint _tmp14__length1; + gint _tmp15_; + const gchar* _tmp16_; + gchar** _tmp17_; + gint _tmp17__length1; + gint _tmp18_; + const gchar* _tmp19_; + SANE_Option_Descriptor* _tmp20_; + gchar** _tmp21_; + gint _tmp21__length1; + gint _tmp22_; + const gchar* _tmp23_; + _tmp11_ = _tmp10_; + if (!_tmp11_) { + gint _tmp12_; + _tmp12_ = j; + j = _tmp12_ + 1; } - _tmp1_ = FALSE; - if (!(option->constraint.string_list[j] != NULL)) { + _tmp10_ = FALSE; + _tmp13_ = option; + _tmp14_ = _tmp13_->constraint.string_list; + _tmp14__length1 = -1; + _tmp15_ = j; + _tmp16_ = _tmp14_[_tmp15_]; + if (!(_tmp16_ != NULL)) { break; } - if (g_strcmp0 (values[i], option->constraint.string_list[j]) == 0) { + _tmp17_ = values; + _tmp17__length1 = values_length1; + _tmp18_ = i; + _tmp19_ = _tmp17_[_tmp18_]; + _tmp20_ = option; + _tmp21_ = _tmp20_->constraint.string_list; + _tmp21__length1 = -1; + _tmp22_ = j; + _tmp23_ = _tmp21_[_tmp22_]; + if (g_strcmp0 (_tmp19_, _tmp23_) == 0) { break; } } } - if (option->constraint.string_list[j] != NULL) { - gchar* _tmp2_ = NULL; - gboolean _tmp3_; - _tmp3_ = scanner_set_string_option (self, handle, option, option_index, values[i], &_tmp2_); - _g_free0 (_result); - _result = _tmp2_; - result = _tmp3_; + _tmp24_ = option; + _tmp25_ = _tmp24_->constraint.string_list; + _tmp25__length1 = -1; + _tmp26_ = j; + _tmp27_ = _tmp25_[_tmp26_]; + if (_tmp27_ != NULL) { + SANE_Handle _tmp28_; + SANE_Option_Descriptor* _tmp29_; + SANE_Int _tmp30_; + gchar** _tmp31_; + gint _tmp31__length1; + gint _tmp32_; + const gchar* _tmp33_; + gchar* _tmp34_ = NULL; + gboolean _tmp35_ = FALSE; + _tmp28_ = handle; + _tmp29_ = option; + _tmp30_ = option_index; + _tmp31_ = values; + _tmp31__length1 = values_length1; + _tmp32_ = i; + _tmp33_ = _tmp31_[_tmp32_]; + _tmp35_ = scanner_set_string_option (self, _tmp28_, _tmp29_, _tmp30_, _tmp33_, &_tmp34_); + _g_free0 (_vala_result); + _vala_result = _tmp34_; + result = _tmp35_; if (_result_) { - *_result_ = _result; + *_result_ = _vala_result; } else { - _g_free0 (_result); + _g_free0 (_vala_result); } return result; } @@ -3816,313 +4419,523 @@ static gboolean scanner_set_constrained_string_option (Scanner* self, SANE_Handl } result = FALSE; if (_result_) { - *_result_ = _result; + *_result_ = _vala_result; } else { - _g_free0 (_result); + _g_free0 (_vala_result); } return result; } -static void scanner_log_option (Scanner* self, SANE_Int index, const SANE_Option_Descriptor* option) { - gchar* _tmp0_ = NULL; +static void scanner_log_option (Scanner* self, SANE_Int index, SANE_Option_Descriptor* option) { + SANE_Int _tmp0_; + gchar* _tmp1_ = NULL; gchar* s; - gchar* _tmp16_ = NULL; - gchar* _tmp17_; - gchar* _tmp18_; + SANE_Option_Descriptor* _tmp2_; + const gchar* _tmp3_; + SANE_Option_Descriptor* _tmp10_; + const gchar* _tmp11_; + SANE_Option_Descriptor* _tmp18_; + SANE_Value_Type _tmp19_; + const gchar* _tmp38_; + SANE_Option_Descriptor* _tmp39_; + SANE_Int _tmp40_; + gchar* _tmp41_ = NULL; + gchar* _tmp42_; + gchar* _tmp43_; + SANE_Option_Descriptor* _tmp44_; + SANE_Unit _tmp45_; + SANE_Option_Descriptor* _tmp64_; + SANE_Constraint_Type _tmp65_; + SANE_Option_Descriptor* _tmp151_; + SANE_Int _tmp152_; SANE_Int cap; + SANE_Int _tmp153_; + const gchar* _tmp214_; + SANE_Option_Descriptor* _tmp215_; + const gchar* _tmp216_; g_return_if_fail (self != NULL); g_return_if_fail (option != NULL); - _tmp0_ = g_strdup_printf ("Option %d:", (gint) index); - s = _tmp0_; - if (g_strcmp0 (option->name, "") != 0) { - gchar* _tmp1_ = NULL; - gchar* _tmp2_; - gchar* _tmp3_; - _tmp1_ = g_strdup_printf (" name='%s'", option->name); - _tmp2_ = _tmp1_; - _tmp3_ = g_strconcat (s, _tmp2_, NULL); + _tmp0_ = index; + _tmp1_ = g_strdup_printf ("Option %d:", (gint) _tmp0_); + s = _tmp1_; + _tmp2_ = option; + _tmp3_ = _tmp2_->name; + if (g_strcmp0 (_tmp3_, "") != 0) { + const gchar* _tmp4_; + SANE_Option_Descriptor* _tmp5_; + const gchar* _tmp6_; + gchar* _tmp7_ = NULL; + gchar* _tmp8_; + gchar* _tmp9_; + _tmp4_ = s; + _tmp5_ = option; + _tmp6_ = _tmp5_->name; + _tmp7_ = g_strdup_printf (" name='%s'", _tmp6_); + _tmp8_ = _tmp7_; + _tmp9_ = g_strconcat (_tmp4_, _tmp8_, NULL); _g_free0 (s); - s = _tmp3_; - _g_free0 (_tmp2_); - } - if (g_strcmp0 (option->title, "") != 0) { - gchar* _tmp4_ = NULL; - gchar* _tmp5_; - gchar* _tmp6_; - _tmp4_ = g_strdup_printf (" title='%s'", option->title); - _tmp5_ = _tmp4_; - _tmp6_ = g_strconcat (s, _tmp5_, NULL); + s = _tmp9_; + _g_free0 (_tmp8_); + } + _tmp10_ = option; + _tmp11_ = _tmp10_->title; + if (g_strcmp0 (_tmp11_, "") != 0) { + const gchar* _tmp12_; + SANE_Option_Descriptor* _tmp13_; + const gchar* _tmp14_; + gchar* _tmp15_ = NULL; + gchar* _tmp16_; + gchar* _tmp17_; + _tmp12_ = s; + _tmp13_ = option; + _tmp14_ = _tmp13_->title; + _tmp15_ = g_strdup_printf (" title='%s'", _tmp14_); + _tmp16_ = _tmp15_; + _tmp17_ = g_strconcat (_tmp12_, _tmp16_, NULL); _g_free0 (s); - s = _tmp6_; - _g_free0 (_tmp5_); + s = _tmp17_; + _g_free0 (_tmp16_); } - switch (option->type) { + _tmp18_ = option; + _tmp19_ = _tmp18_->type; + switch (_tmp19_) { case SANE_TYPE_BOOL: { - gchar* _tmp7_; - _tmp7_ = g_strconcat (s, " type=bool", NULL); + const gchar* _tmp20_; + gchar* _tmp21_; + _tmp20_ = s; + _tmp21_ = g_strconcat (_tmp20_, " type=bool", NULL); _g_free0 (s); - s = _tmp7_; + s = _tmp21_; break; } case SANE_TYPE_INT: { - gchar* _tmp8_; - _tmp8_ = g_strconcat (s, " type=int", NULL); + const gchar* _tmp22_; + gchar* _tmp23_; + _tmp22_ = s; + _tmp23_ = g_strconcat (_tmp22_, " type=int", NULL); _g_free0 (s); - s = _tmp8_; + s = _tmp23_; break; } case SANE_TYPE_FIXED: { - gchar* _tmp9_; - _tmp9_ = g_strconcat (s, " type=fixed", NULL); + const gchar* _tmp24_; + gchar* _tmp25_; + _tmp24_ = s; + _tmp25_ = g_strconcat (_tmp24_, " type=fixed", NULL); _g_free0 (s); - s = _tmp9_; + s = _tmp25_; break; } case SANE_TYPE_STRING: { - gchar* _tmp10_; - _tmp10_ = g_strconcat (s, " type=string", NULL); + const gchar* _tmp26_; + gchar* _tmp27_; + _tmp26_ = s; + _tmp27_ = g_strconcat (_tmp26_, " type=string", NULL); _g_free0 (s); - s = _tmp10_; + s = _tmp27_; break; } case SANE_TYPE_BUTTON: { - gchar* _tmp11_; - _tmp11_ = g_strconcat (s, " type=button", NULL); + const gchar* _tmp28_; + gchar* _tmp29_; + _tmp28_ = s; + _tmp29_ = g_strconcat (_tmp28_, " type=button", NULL); _g_free0 (s); - s = _tmp11_; + s = _tmp29_; break; } case SANE_TYPE_GROUP: { - gchar* _tmp12_; - _tmp12_ = g_strconcat (s, " type=group", NULL); + const gchar* _tmp30_; + gchar* _tmp31_; + _tmp30_ = s; + _tmp31_ = g_strconcat (_tmp30_, " type=group", NULL); _g_free0 (s); - s = _tmp12_; + s = _tmp31_; break; } default: { - gchar* _tmp13_ = NULL; - gchar* _tmp14_; - gchar* _tmp15_; - _tmp13_ = g_strdup_printf (" type=%d", (gint) option->type); - _tmp14_ = _tmp13_; - _tmp15_ = g_strconcat (s, _tmp14_, NULL); + const gchar* _tmp32_; + SANE_Option_Descriptor* _tmp33_; + SANE_Value_Type _tmp34_; + gchar* _tmp35_ = NULL; + gchar* _tmp36_; + gchar* _tmp37_; + _tmp32_ = s; + _tmp33_ = option; + _tmp34_ = _tmp33_->type; + _tmp35_ = g_strdup_printf (" type=%d", (gint) _tmp34_); + _tmp36_ = _tmp35_; + _tmp37_ = g_strconcat (_tmp32_, _tmp36_, NULL); _g_free0 (s); - s = _tmp15_; - _g_free0 (_tmp14_); + s = _tmp37_; + _g_free0 (_tmp36_); break; } } - _tmp16_ = g_strdup_printf (" size=%d", (gint) option->size); - _tmp17_ = _tmp16_; - _tmp18_ = g_strconcat (s, _tmp17_, NULL); + _tmp38_ = s; + _tmp39_ = option; + _tmp40_ = _tmp39_->size; + _tmp41_ = g_strdup_printf (" size=%d", (gint) _tmp40_); + _tmp42_ = _tmp41_; + _tmp43_ = g_strconcat (_tmp38_, _tmp42_, NULL); _g_free0 (s); - s = _tmp18_; - _g_free0 (_tmp17_); - switch (option->unit) { + s = _tmp43_; + _g_free0 (_tmp42_); + _tmp44_ = option; + _tmp45_ = _tmp44_->unit; + switch (_tmp45_) { case SANE_UNIT_NONE: { break; } case SANE_UNIT_PIXEL: { - gchar* _tmp19_; - _tmp19_ = g_strconcat (s, " unit=pixels", NULL); + const gchar* _tmp46_; + gchar* _tmp47_; + _tmp46_ = s; + _tmp47_ = g_strconcat (_tmp46_, " unit=pixels", NULL); _g_free0 (s); - s = _tmp19_; + s = _tmp47_; break; } case SANE_UNIT_BIT: { - gchar* _tmp20_; - _tmp20_ = g_strconcat (s, " unit=bits", NULL); + const gchar* _tmp48_; + gchar* _tmp49_; + _tmp48_ = s; + _tmp49_ = g_strconcat (_tmp48_, " unit=bits", NULL); _g_free0 (s); - s = _tmp20_; + s = _tmp49_; break; } case SANE_UNIT_MM: { - gchar* _tmp21_; - _tmp21_ = g_strconcat (s, " unit=mm", NULL); + const gchar* _tmp50_; + gchar* _tmp51_; + _tmp50_ = s; + _tmp51_ = g_strconcat (_tmp50_, " unit=mm", NULL); _g_free0 (s); - s = _tmp21_; + s = _tmp51_; break; } case SANE_UNIT_DPI: { - gchar* _tmp22_; - _tmp22_ = g_strconcat (s, " unit=dpi", NULL); + const gchar* _tmp52_; + gchar* _tmp53_; + _tmp52_ = s; + _tmp53_ = g_strconcat (_tmp52_, " unit=dpi", NULL); _g_free0 (s); - s = _tmp22_; + s = _tmp53_; break; } case SANE_UNIT_PERCENT: { - gchar* _tmp23_; - _tmp23_ = g_strconcat (s, " unit=percent", NULL); + const gchar* _tmp54_; + gchar* _tmp55_; + _tmp54_ = s; + _tmp55_ = g_strconcat (_tmp54_, " unit=percent", NULL); _g_free0 (s); - s = _tmp23_; + s = _tmp55_; break; } case SANE_UNIT_MICROSECOND: { - gchar* _tmp24_; - _tmp24_ = g_strconcat (s, " unit=microseconds", NULL); + const gchar* _tmp56_; + gchar* _tmp57_; + _tmp56_ = s; + _tmp57_ = g_strconcat (_tmp56_, " unit=microseconds", NULL); _g_free0 (s); - s = _tmp24_; + s = _tmp57_; break; } default: { - gchar* _tmp25_ = NULL; - gchar* _tmp26_; - gchar* _tmp27_; - _tmp25_ = g_strdup_printf (" unit=%d", (gint) option->unit); - _tmp26_ = _tmp25_; - _tmp27_ = g_strconcat (s, _tmp26_, NULL); + const gchar* _tmp58_; + SANE_Option_Descriptor* _tmp59_; + SANE_Unit _tmp60_; + gchar* _tmp61_ = NULL; + gchar* _tmp62_; + gchar* _tmp63_; + _tmp58_ = s; + _tmp59_ = option; + _tmp60_ = _tmp59_->unit; + _tmp61_ = g_strdup_printf (" unit=%d", (gint) _tmp60_); + _tmp62_ = _tmp61_; + _tmp63_ = g_strconcat (_tmp58_, _tmp62_, NULL); _g_free0 (s); - s = _tmp27_; - _g_free0 (_tmp26_); + s = _tmp63_; + _g_free0 (_tmp62_); break; } } - switch (option->constraint_type) { + _tmp64_ = option; + _tmp65_ = _tmp64_->constraint_type; + switch (_tmp65_) { case SANE_CONSTRAINT_RANGE: { - if (option->type == SANE_TYPE_FIXED) { - gdouble _tmp28_; - gdouble _tmp29_; - gchar* _tmp30_ = NULL; - gchar* _tmp31_; - gchar* _tmp32_; - _tmp28_ = SANE_UNFIX ((SANE_Fixed) option->constraint.range->min); - _tmp29_ = SANE_UNFIX ((SANE_Fixed) option->constraint.range->max); - _tmp30_ = g_strdup_printf (" min=%f, max=%f, quant=%d", _tmp28_, _tmp29_, (gint) option->constraint.range->quant); - _tmp31_ = _tmp30_; - _tmp32_ = g_strconcat (s, _tmp31_, NULL); + SANE_Option_Descriptor* _tmp66_; + SANE_Value_Type _tmp67_; + _tmp66_ = option; + _tmp67_ = _tmp66_->type; + if (_tmp67_ == SANE_TYPE_FIXED) { + const gchar* _tmp68_; + SANE_Option_Descriptor* _tmp69_; + SANE_Range* _tmp70_; + SANE_Word _tmp71_; + gdouble _tmp72_ = 0.0; + SANE_Option_Descriptor* _tmp73_; + SANE_Range* _tmp74_; + SANE_Word _tmp75_; + gdouble _tmp76_ = 0.0; + SANE_Option_Descriptor* _tmp77_; + SANE_Range* _tmp78_; + SANE_Word _tmp79_; + gchar* _tmp80_ = NULL; + gchar* _tmp81_; + gchar* _tmp82_; + _tmp68_ = s; + _tmp69_ = option; + _tmp70_ = _tmp69_->constraint.range; + _tmp71_ = _tmp70_->min; + _tmp72_ = SANE_UNFIX ((SANE_Fixed) _tmp71_); + _tmp73_ = option; + _tmp74_ = _tmp73_->constraint.range; + _tmp75_ = _tmp74_->max; + _tmp76_ = SANE_UNFIX ((SANE_Fixed) _tmp75_); + _tmp77_ = option; + _tmp78_ = _tmp77_->constraint.range; + _tmp79_ = _tmp78_->quant; + _tmp80_ = g_strdup_printf (" min=%f, max=%f, quant=%d", _tmp72_, _tmp76_, (gint) _tmp79_); + _tmp81_ = _tmp80_; + _tmp82_ = g_strconcat (_tmp68_, _tmp81_, NULL); _g_free0 (s); - s = _tmp32_; - _g_free0 (_tmp31_); + s = _tmp82_; + _g_free0 (_tmp81_); } else { - gchar* _tmp33_ = NULL; - gchar* _tmp34_; - gchar* _tmp35_; - _tmp33_ = g_strdup_printf (" min=%d, max=%d, quant=%d", (gint) option->constraint.range->min, (gint) option->constraint.range->max, (gint) option->constraint.range->quant); - _tmp34_ = _tmp33_; - _tmp35_ = g_strconcat (s, _tmp34_, NULL); + const gchar* _tmp83_; + SANE_Option_Descriptor* _tmp84_; + SANE_Range* _tmp85_; + SANE_Word _tmp86_; + SANE_Option_Descriptor* _tmp87_; + SANE_Range* _tmp88_; + SANE_Word _tmp89_; + SANE_Option_Descriptor* _tmp90_; + SANE_Range* _tmp91_; + SANE_Word _tmp92_; + gchar* _tmp93_ = NULL; + gchar* _tmp94_; + gchar* _tmp95_; + _tmp83_ = s; + _tmp84_ = option; + _tmp85_ = _tmp84_->constraint.range; + _tmp86_ = _tmp85_->min; + _tmp87_ = option; + _tmp88_ = _tmp87_->constraint.range; + _tmp89_ = _tmp88_->max; + _tmp90_ = option; + _tmp91_ = _tmp90_->constraint.range; + _tmp92_ = _tmp91_->quant; + _tmp93_ = g_strdup_printf (" min=%d, max=%d, quant=%d", (gint) _tmp86_, (gint) _tmp89_, (gint) _tmp92_); + _tmp94_ = _tmp93_; + _tmp95_ = g_strconcat (_tmp83_, _tmp94_, NULL); _g_free0 (s); - s = _tmp35_; - _g_free0 (_tmp34_); + s = _tmp95_; + _g_free0 (_tmp94_); } break; } case SANE_CONSTRAINT_WORD_LIST: { - gchar* _tmp36_; - gchar* _tmp46_; - _tmp36_ = g_strconcat (s, " values=[", NULL); + const gchar* _tmp96_; + gchar* _tmp97_; + const gchar* _tmp127_; + gchar* _tmp128_; + _tmp96_ = s; + _tmp97_ = g_strconcat (_tmp96_, " values=[", NULL); _g_free0 (s); - s = _tmp36_; + s = _tmp97_; { gint i; i = 0; { - gboolean _tmp37_; - _tmp37_ = TRUE; + gboolean _tmp98_; + _tmp98_ = TRUE; while (TRUE) { - if (!_tmp37_) { - i++; + gboolean _tmp99_; + gint _tmp101_; + SANE_Option_Descriptor* _tmp102_; + SANE_Word* _tmp103_; + gint _tmp103__length1; + SANE_Word _tmp104_; + gint _tmp105_; + SANE_Option_Descriptor* _tmp108_; + SANE_Value_Type _tmp109_; + _tmp99_ = _tmp98_; + if (!_tmp99_) { + gint _tmp100_; + _tmp100_ = i; + i = _tmp100_ + 1; } - _tmp37_ = FALSE; - if (!(i < ((gint) option->constraint.word_list[0]))) { + _tmp98_ = FALSE; + _tmp101_ = i; + _tmp102_ = option; + _tmp103_ = _tmp102_->constraint.word_list; + _tmp103__length1 = -1; + _tmp104_ = _tmp103_[0]; + if (!(((SANE_Word) _tmp101_) < _tmp104_)) { break; } - if (i != 0) { - gchar* _tmp38_; - _tmp38_ = g_strconcat (s, ", ", NULL); + _tmp105_ = i; + if (_tmp105_ != 0) { + const gchar* _tmp106_; + gchar* _tmp107_; + _tmp106_ = s; + _tmp107_ = g_strconcat (_tmp106_, ", ", NULL); _g_free0 (s); - s = _tmp38_; + s = _tmp107_; } - if (option->type == SANE_TYPE_INT) { - gchar* _tmp39_ = NULL; - gchar* _tmp40_; - gchar* _tmp41_; - _tmp39_ = g_strdup_printf ("%d", (gint) option->constraint.word_list[i + 1]); - _tmp40_ = _tmp39_; - _tmp41_ = g_strconcat (s, _tmp40_, NULL); + _tmp108_ = option; + _tmp109_ = _tmp108_->type; + if (_tmp109_ == SANE_TYPE_INT) { + const gchar* _tmp110_; + SANE_Option_Descriptor* _tmp111_; + SANE_Word* _tmp112_; + gint _tmp112__length1; + gint _tmp113_; + SANE_Word _tmp114_; + gchar* _tmp115_ = NULL; + gchar* _tmp116_; + gchar* _tmp117_; + _tmp110_ = s; + _tmp111_ = option; + _tmp112_ = _tmp111_->constraint.word_list; + _tmp112__length1 = -1; + _tmp113_ = i; + _tmp114_ = _tmp112_[_tmp113_ + 1]; + _tmp115_ = g_strdup_printf ("%d", (gint) _tmp114_); + _tmp116_ = _tmp115_; + _tmp117_ = g_strconcat (_tmp110_, _tmp116_, NULL); _g_free0 (s); - s = _tmp41_; - _g_free0 (_tmp40_); + s = _tmp117_; + _g_free0 (_tmp116_); } else { - gdouble _tmp42_; - gchar* _tmp43_ = NULL; - gchar* _tmp44_; - gchar* _tmp45_; - _tmp42_ = SANE_UNFIX ((SANE_Fixed) option->constraint.word_list[i + 1]); - _tmp43_ = g_strdup_printf ("%f", _tmp42_); - _tmp44_ = _tmp43_; - _tmp45_ = g_strconcat (s, _tmp44_, NULL); + const gchar* _tmp118_; + SANE_Option_Descriptor* _tmp119_; + SANE_Word* _tmp120_; + gint _tmp120__length1; + gint _tmp121_; + SANE_Word _tmp122_; + gdouble _tmp123_ = 0.0; + gchar* _tmp124_ = NULL; + gchar* _tmp125_; + gchar* _tmp126_; + _tmp118_ = s; + _tmp119_ = option; + _tmp120_ = _tmp119_->constraint.word_list; + _tmp120__length1 = -1; + _tmp121_ = i; + _tmp122_ = _tmp120_[_tmp121_ + 1]; + _tmp123_ = SANE_UNFIX ((SANE_Fixed) _tmp122_); + _tmp124_ = g_strdup_printf ("%f", _tmp123_); + _tmp125_ = _tmp124_; + _tmp126_ = g_strconcat (_tmp118_, _tmp125_, NULL); _g_free0 (s); - s = _tmp45_; - _g_free0 (_tmp44_); + s = _tmp126_; + _g_free0 (_tmp125_); } } } } - _tmp46_ = g_strconcat (s, "]", NULL); + _tmp127_ = s; + _tmp128_ = g_strconcat (_tmp127_, "]", NULL); _g_free0 (s); - s = _tmp46_; + s = _tmp128_; break; } case SANE_CONSTRAINT_STRING_LIST: { - gchar* _tmp47_; - gchar* _tmp53_; - _tmp47_ = g_strconcat (s, " values=[", NULL); + const gchar* _tmp129_; + gchar* _tmp130_; + const gchar* _tmp149_; + gchar* _tmp150_; + _tmp129_ = s; + _tmp130_ = g_strconcat (_tmp129_, " values=[", NULL); _g_free0 (s); - s = _tmp47_; + s = _tmp130_; { gint i; i = 0; { - gboolean _tmp48_; - _tmp48_ = TRUE; + gboolean _tmp131_; + _tmp131_ = TRUE; while (TRUE) { - gchar* _tmp50_ = NULL; - gchar* _tmp51_; - gchar* _tmp52_; - if (!_tmp48_) { - i++; + gboolean _tmp132_; + SANE_Option_Descriptor* _tmp134_; + gchar** _tmp135_; + gint _tmp135__length1; + gint _tmp136_; + const gchar* _tmp137_; + gint _tmp138_; + const gchar* _tmp141_; + SANE_Option_Descriptor* _tmp142_; + gchar** _tmp143_; + gint _tmp143__length1; + gint _tmp144_; + const gchar* _tmp145_; + gchar* _tmp146_ = NULL; + gchar* _tmp147_; + gchar* _tmp148_; + _tmp132_ = _tmp131_; + if (!_tmp132_) { + gint _tmp133_; + _tmp133_ = i; + i = _tmp133_ + 1; } - _tmp48_ = FALSE; - if (!(option->constraint.string_list[i] != NULL)) { + _tmp131_ = FALSE; + _tmp134_ = option; + _tmp135_ = _tmp134_->constraint.string_list; + _tmp135__length1 = -1; + _tmp136_ = i; + _tmp137_ = _tmp135_[_tmp136_]; + if (!(_tmp137_ != NULL)) { break; } - if (i != 0) { - gchar* _tmp49_; - _tmp49_ = g_strconcat (s, ", ", NULL); + _tmp138_ = i; + if (_tmp138_ != 0) { + const gchar* _tmp139_; + gchar* _tmp140_; + _tmp139_ = s; + _tmp140_ = g_strconcat (_tmp139_, ", ", NULL); _g_free0 (s); - s = _tmp49_; + s = _tmp140_; } - _tmp50_ = g_strdup_printf ("\"%s\"", option->constraint.string_list[i]); - _tmp51_ = _tmp50_; - _tmp52_ = g_strconcat (s, _tmp51_, NULL); + _tmp141_ = s; + _tmp142_ = option; + _tmp143_ = _tmp142_->constraint.string_list; + _tmp143__length1 = -1; + _tmp144_ = i; + _tmp145_ = _tmp143_[_tmp144_]; + _tmp146_ = g_strdup_printf ("\"%s\"", _tmp145_); + _tmp147_ = _tmp146_; + _tmp148_ = g_strconcat (_tmp141_, _tmp147_, NULL); _g_free0 (s); - s = _tmp52_; - _g_free0 (_tmp51_); + s = _tmp148_; + _g_free0 (_tmp147_); } } } - _tmp53_ = g_strconcat (s, "]", NULL); + _tmp149_ = s; + _tmp150_ = g_strconcat (_tmp149_, "]", NULL); _g_free0 (s); - s = _tmp53_; + s = _tmp150_; break; } default: @@ -4130,166 +4943,296 @@ static void scanner_log_option (Scanner* self, SANE_Int index, const SANE_Option break; } } - cap = option->cap; - if (((gint) cap) != 0) { - gchar* _tmp54_; - _tmp54_ = g_strconcat (s, " cap=", NULL); + _tmp151_ = option; + _tmp152_ = _tmp151_->cap; + cap = _tmp152_; + _tmp153_ = cap; + if (_tmp153_ != ((SANE_Int) 0)) { + const gchar* _tmp154_; + gchar* _tmp155_; + SANE_Int _tmp156_; + SANE_Int _tmp163_; + SANE_Int _tmp170_; + SANE_Int _tmp177_; + SANE_Int _tmp184_; + SANE_Int _tmp191_; + SANE_Int _tmp198_; + SANE_Int _tmp205_; + _tmp154_ = s; + _tmp155_ = g_strconcat (_tmp154_, " cap=", NULL); _g_free0 (s); - s = _tmp54_; - if (((gint) (cap & SANE_CAP_SOFT_SELECT)) != 0) { - gchar* _tmp56_; - if (g_strcmp0 (s, "") != 0) { - gchar* _tmp55_; - _tmp55_ = g_strconcat (s, ",", NULL); + s = _tmp155_; + _tmp156_ = cap; + if ((_tmp156_ & SANE_CAP_SOFT_SELECT) != ((SANE_Int) 0)) { + const gchar* _tmp157_; + const gchar* _tmp160_; + gchar* _tmp161_; + SANE_Int _tmp162_; + _tmp157_ = s; + if (g_strcmp0 (_tmp157_, "") != 0) { + const gchar* _tmp158_; + gchar* _tmp159_; + _tmp158_ = s; + _tmp159_ = g_strconcat (_tmp158_, ",", NULL); _g_free0 (s); - s = _tmp55_; + s = _tmp159_; } - _tmp56_ = g_strconcat (s, "soft-select", NULL); + _tmp160_ = s; + _tmp161_ = g_strconcat (_tmp160_, "soft-select", NULL); _g_free0 (s); - s = _tmp56_; - cap = cap & (~SANE_CAP_SOFT_SELECT); + s = _tmp161_; + _tmp162_ = cap; + cap = _tmp162_ & (~SANE_CAP_SOFT_SELECT); } - if (((gint) (cap & SANE_CAP_HARD_SELECT)) != 0) { - gchar* _tmp58_; - if (g_strcmp0 (s, "") != 0) { - gchar* _tmp57_; - _tmp57_ = g_strconcat (s, ",", NULL); + _tmp163_ = cap; + if ((_tmp163_ & SANE_CAP_HARD_SELECT) != ((SANE_Int) 0)) { + const gchar* _tmp164_; + const gchar* _tmp167_; + gchar* _tmp168_; + SANE_Int _tmp169_; + _tmp164_ = s; + if (g_strcmp0 (_tmp164_, "") != 0) { + const gchar* _tmp165_; + gchar* _tmp166_; + _tmp165_ = s; + _tmp166_ = g_strconcat (_tmp165_, ",", NULL); _g_free0 (s); - s = _tmp57_; + s = _tmp166_; } - _tmp58_ = g_strconcat (s, "hard-select", NULL); + _tmp167_ = s; + _tmp168_ = g_strconcat (_tmp167_, "hard-select", NULL); _g_free0 (s); - s = _tmp58_; - cap = cap & (~SANE_CAP_HARD_SELECT); + s = _tmp168_; + _tmp169_ = cap; + cap = _tmp169_ & (~SANE_CAP_HARD_SELECT); } - if (((gint) (cap & SANE_CAP_SOFT_DETECT)) != 0) { - gchar* _tmp60_; - if (g_strcmp0 (s, "") != 0) { - gchar* _tmp59_; - _tmp59_ = g_strconcat (s, ",", NULL); + _tmp170_ = cap; + if ((_tmp170_ & SANE_CAP_SOFT_DETECT) != ((SANE_Int) 0)) { + const gchar* _tmp171_; + const gchar* _tmp174_; + gchar* _tmp175_; + SANE_Int _tmp176_; + _tmp171_ = s; + if (g_strcmp0 (_tmp171_, "") != 0) { + const gchar* _tmp172_; + gchar* _tmp173_; + _tmp172_ = s; + _tmp173_ = g_strconcat (_tmp172_, ",", NULL); _g_free0 (s); - s = _tmp59_; + s = _tmp173_; } - _tmp60_ = g_strconcat (s, "soft-detect", NULL); + _tmp174_ = s; + _tmp175_ = g_strconcat (_tmp174_, "soft-detect", NULL); _g_free0 (s); - s = _tmp60_; - cap = cap & (~SANE_CAP_SOFT_DETECT); + s = _tmp175_; + _tmp176_ = cap; + cap = _tmp176_ & (~SANE_CAP_SOFT_DETECT); } - if (((gint) (cap & SANE_CAP_EMULATED)) != 0) { - gchar* _tmp62_; - if (g_strcmp0 (s, "") != 0) { - gchar* _tmp61_; - _tmp61_ = g_strconcat (s, ",", NULL); + _tmp177_ = cap; + if ((_tmp177_ & SANE_CAP_EMULATED) != ((SANE_Int) 0)) { + const gchar* _tmp178_; + const gchar* _tmp181_; + gchar* _tmp182_; + SANE_Int _tmp183_; + _tmp178_ = s; + if (g_strcmp0 (_tmp178_, "") != 0) { + const gchar* _tmp179_; + gchar* _tmp180_; + _tmp179_ = s; + _tmp180_ = g_strconcat (_tmp179_, ",", NULL); _g_free0 (s); - s = _tmp61_; + s = _tmp180_; } - _tmp62_ = g_strconcat (s, "emulated", NULL); + _tmp181_ = s; + _tmp182_ = g_strconcat (_tmp181_, "emulated", NULL); _g_free0 (s); - s = _tmp62_; - cap = cap & (~SANE_CAP_EMULATED); + s = _tmp182_; + _tmp183_ = cap; + cap = _tmp183_ & (~SANE_CAP_EMULATED); } - if (((gint) (cap & SANE_CAP_AUTOMATIC)) != 0) { - gchar* _tmp64_; - if (g_strcmp0 (s, "") != 0) { - gchar* _tmp63_; - _tmp63_ = g_strconcat (s, ",", NULL); + _tmp184_ = cap; + if ((_tmp184_ & SANE_CAP_AUTOMATIC) != ((SANE_Int) 0)) { + const gchar* _tmp185_; + const gchar* _tmp188_; + gchar* _tmp189_; + SANE_Int _tmp190_; + _tmp185_ = s; + if (g_strcmp0 (_tmp185_, "") != 0) { + const gchar* _tmp186_; + gchar* _tmp187_; + _tmp186_ = s; + _tmp187_ = g_strconcat (_tmp186_, ",", NULL); _g_free0 (s); - s = _tmp63_; + s = _tmp187_; } - _tmp64_ = g_strconcat (s, "automatic", NULL); + _tmp188_ = s; + _tmp189_ = g_strconcat (_tmp188_, "automatic", NULL); _g_free0 (s); - s = _tmp64_; - cap = cap & (~SANE_CAP_AUTOMATIC); + s = _tmp189_; + _tmp190_ = cap; + cap = _tmp190_ & (~SANE_CAP_AUTOMATIC); } - if (((gint) (cap & SANE_CAP_INACTIVE)) != 0) { - gchar* _tmp66_; - if (g_strcmp0 (s, "") != 0) { - gchar* _tmp65_; - _tmp65_ = g_strconcat (s, ",", NULL); + _tmp191_ = cap; + if ((_tmp191_ & SANE_CAP_INACTIVE) != ((SANE_Int) 0)) { + const gchar* _tmp192_; + const gchar* _tmp195_; + gchar* _tmp196_; + SANE_Int _tmp197_; + _tmp192_ = s; + if (g_strcmp0 (_tmp192_, "") != 0) { + const gchar* _tmp193_; + gchar* _tmp194_; + _tmp193_ = s; + _tmp194_ = g_strconcat (_tmp193_, ",", NULL); _g_free0 (s); - s = _tmp65_; + s = _tmp194_; } - _tmp66_ = g_strconcat (s, "inactive", NULL); + _tmp195_ = s; + _tmp196_ = g_strconcat (_tmp195_, "inactive", NULL); _g_free0 (s); - s = _tmp66_; - cap = cap & (~SANE_CAP_INACTIVE); + s = _tmp196_; + _tmp197_ = cap; + cap = _tmp197_ & (~SANE_CAP_INACTIVE); } - if (((gint) (cap & SANE_CAP_ADVANCED)) != 0) { - gchar* _tmp68_; - if (g_strcmp0 (s, "") != 0) { - gchar* _tmp67_; - _tmp67_ = g_strconcat (s, ",", NULL); + _tmp198_ = cap; + if ((_tmp198_ & SANE_CAP_ADVANCED) != ((SANE_Int) 0)) { + const gchar* _tmp199_; + const gchar* _tmp202_; + gchar* _tmp203_; + SANE_Int _tmp204_; + _tmp199_ = s; + if (g_strcmp0 (_tmp199_, "") != 0) { + const gchar* _tmp200_; + gchar* _tmp201_; + _tmp200_ = s; + _tmp201_ = g_strconcat (_tmp200_, ",", NULL); _g_free0 (s); - s = _tmp67_; + s = _tmp201_; } - _tmp68_ = g_strconcat (s, "advanced", NULL); + _tmp202_ = s; + _tmp203_ = g_strconcat (_tmp202_, "advanced", NULL); _g_free0 (s); - s = _tmp68_; - cap = cap & (~SANE_CAP_ADVANCED); + s = _tmp203_; + _tmp204_ = cap; + cap = _tmp204_ & (~SANE_CAP_ADVANCED); } - if (((gint) cap) != 0) { - gchar* _tmp70_ = NULL; - gchar* _tmp71_; - gchar* _tmp72_; - if (g_strcmp0 (s, "") != 0) { - gchar* _tmp69_; - _tmp69_ = g_strconcat (s, ",", NULL); + _tmp205_ = cap; + if (_tmp205_ != ((SANE_Int) 0)) { + const gchar* _tmp206_; + const gchar* _tmp209_; + SANE_Int _tmp210_; + gchar* _tmp211_ = NULL; + gchar* _tmp212_; + gchar* _tmp213_; + _tmp206_ = s; + if (g_strcmp0 (_tmp206_, "") != 0) { + const gchar* _tmp207_; + gchar* _tmp208_; + _tmp207_ = s; + _tmp208_ = g_strconcat (_tmp207_, ",", NULL); _g_free0 (s); - s = _tmp69_; + s = _tmp208_; } - _tmp70_ = g_strdup_printf ("%x", (guint) cap); - _tmp71_ = _tmp70_; - _tmp72_ = g_strconcat (s, _tmp71_, NULL); + _tmp209_ = s; + _tmp210_ = cap; + _tmp211_ = g_strdup_printf ("%x", (guint) ((gint) _tmp210_)); + _tmp212_ = _tmp211_; + _tmp213_ = g_strconcat (_tmp209_, _tmp212_, NULL); _g_free0 (s); - s = _tmp72_; - _g_free0 (_tmp71_); + s = _tmp213_; + _g_free0 (_tmp212_); } } - g_debug ("scanner.vala:665: %s", s); - if (option->desc != NULL) { - g_debug ("scanner.vala:668: Description: %s", option->desc); + _tmp214_ = s; + g_debug ("scanner.vala:666: %s", _tmp214_); + _tmp215_ = option; + _tmp216_ = _tmp215_->desc; + if (_tmp216_ != NULL) { + SANE_Option_Descriptor* _tmp217_; + const gchar* _tmp218_; + _tmp217_ = option; + _tmp218_ = _tmp217_->desc; + g_debug ("scanner.vala:669: Description: %s", _tmp218_); } _g_free0 (s); } static void scanner_authorization_cb (const gchar* resource, gchar* username, int username_length1, gchar* password, int password_length1) { - NotifyRequestAuthorization* _tmp0_ = NULL; - NotifyRequestAuthorization* _tmp1_; - gpointer _tmp2_ = NULL; + Scanner* _tmp0_; + const gchar* _tmp1_; + NotifyRequestAuthorization* _tmp2_; + NotifyRequestAuthorization* _tmp3_; + Scanner* _tmp4_; + GAsyncQueue* _tmp5_; + gpointer _tmp6_ = NULL; Credentials* credentials; g_return_if_fail (resource != NULL); - _tmp0_ = notify_request_authorization_new (resource); - _tmp1_ = _tmp0_; - scanner_notify (scanner_scanner_object, (Notify*) _tmp1_); - _notify_unref0 (_tmp1_); - _tmp2_ = g_async_queue_pop (scanner_scanner_object->priv->authorize_queue); - credentials = (Credentials*) _tmp2_; + _tmp0_ = scanner_scanner_object; + _tmp1_ = resource; + _tmp2_ = notify_request_authorization_new (_tmp1_); + _tmp3_ = _tmp2_; + scanner_notify (_tmp0_, (Notify*) _tmp3_); + _notify_unref0 (_tmp3_); + _tmp4_ = scanner_scanner_object; + _tmp5_ = _tmp4_->priv->authorize_queue; + _tmp6_ = g_async_queue_pop (_tmp5_); + credentials = (Credentials*) _tmp6_; { gint i; i = 0; { - gboolean _tmp3_; - _tmp3_ = TRUE; + gboolean _tmp7_; + _tmp7_ = TRUE; while (TRUE) { - gboolean _tmp4_ = FALSE; - gchar _tmp5_; - gchar _tmp6_; - if (!_tmp3_) { - i++; + gboolean _tmp8_; + gboolean _tmp10_ = FALSE; + Credentials* _tmp11_; + const gchar* _tmp12_; + gint _tmp13_; + gchar _tmp14_ = '\0'; + gboolean _tmp17_; + gchar* _tmp18_; + gint _tmp18__length1; + gint _tmp19_; + Credentials* _tmp20_; + const gchar* _tmp21_; + gint _tmp22_; + gchar _tmp23_ = '\0'; + gchar _tmp24_; + _tmp8_ = _tmp7_; + if (!_tmp8_) { + gint _tmp9_; + _tmp9_ = i; + i = _tmp9_ + 1; } - _tmp3_ = FALSE; - _tmp5_ = string_get (credentials->username, (glong) i); - if (_tmp5_ != '\0') { - _tmp4_ = i < SANE_MAX_USERNAME_LEN; + _tmp7_ = FALSE; + _tmp11_ = credentials; + _tmp12_ = _tmp11_->username; + _tmp13_ = i; + _tmp14_ = string_get (_tmp12_, (glong) _tmp13_); + if (_tmp14_ != '\0') { + gint _tmp15_; + gint _tmp16_; + _tmp15_ = i; + _tmp16_ = SANE_MAX_USERNAME_LEN; + _tmp10_ = _tmp15_ < _tmp16_; } else { - _tmp4_ = FALSE; + _tmp10_ = FALSE; } - if (!_tmp4_) { + _tmp17_ = _tmp10_; + if (!_tmp17_) { break; } - _tmp6_ = string_get (credentials->username, (glong) i); - username[i] = _tmp6_; + _tmp18_ = username; + _tmp18__length1 = username_length1; + _tmp19_ = i; + _tmp20_ = credentials; + _tmp21_ = _tmp20_->username; + _tmp22_ = i; + _tmp23_ = string_get (_tmp21_, (glong) _tmp22_); + _tmp18_[_tmp19_] = _tmp23_; + _tmp24_ = _tmp18_[_tmp19_]; } } } @@ -4297,27 +5240,57 @@ static void scanner_authorization_cb (const gchar* resource, gchar* username, in gint i; i = 0; { - gboolean _tmp7_; - _tmp7_ = TRUE; + gboolean _tmp25_; + _tmp25_ = TRUE; while (TRUE) { - gboolean _tmp8_ = FALSE; - gchar _tmp9_; - gchar _tmp10_; - if (!_tmp7_) { - i++; + gboolean _tmp26_; + gboolean _tmp28_ = FALSE; + Credentials* _tmp29_; + const gchar* _tmp30_; + gint _tmp31_; + gchar _tmp32_ = '\0'; + gboolean _tmp35_; + gchar* _tmp36_; + gint _tmp36__length1; + gint _tmp37_; + Credentials* _tmp38_; + const gchar* _tmp39_; + gint _tmp40_; + gchar _tmp41_ = '\0'; + gchar _tmp42_; + _tmp26_ = _tmp25_; + if (!_tmp26_) { + gint _tmp27_; + _tmp27_ = i; + i = _tmp27_ + 1; } - _tmp7_ = FALSE; - _tmp9_ = string_get (credentials->password, (glong) i); - if (_tmp9_ != '\0') { - _tmp8_ = i < SANE_MAX_USERNAME_LEN; + _tmp25_ = FALSE; + _tmp29_ = credentials; + _tmp30_ = _tmp29_->password; + _tmp31_ = i; + _tmp32_ = string_get (_tmp30_, (glong) _tmp31_); + if (_tmp32_ != '\0') { + gint _tmp33_; + gint _tmp34_; + _tmp33_ = i; + _tmp34_ = SANE_MAX_USERNAME_LEN; + _tmp28_ = _tmp33_ < _tmp34_; } else { - _tmp8_ = FALSE; + _tmp28_ = FALSE; } - if (!_tmp8_) { + _tmp35_ = _tmp28_; + if (!_tmp35_) { break; } - _tmp10_ = string_get (credentials->password, (glong) i); - password[i] = _tmp10_; + _tmp36_ = password; + _tmp36__length1 = password_length1; + _tmp37_ = i; + _tmp38_ = credentials; + _tmp39_ = _tmp38_->password; + _tmp40_ = i; + _tmp41_ = string_get (_tmp39_, (glong) _tmp40_); + _tmp36_[_tmp37_] = _tmp41_; + _tmp42_ = _tmp36_[_tmp37_]; } } } @@ -4331,35 +5304,47 @@ static gpointer _credentials_ref0 (gpointer self) { void scanner_authorize (Scanner* self, const gchar* username, const gchar* password) { - Credentials* _tmp0_ = NULL; + Credentials* _tmp0_; Credentials* credentials; - gchar* _tmp1_; + const gchar* _tmp1_; gchar* _tmp2_; - Credentials* _tmp3_; + const gchar* _tmp3_; + gchar* _tmp4_; + GAsyncQueue* _tmp5_; + Credentials* _tmp6_; g_return_if_fail (self != NULL); g_return_if_fail (username != NULL); g_return_if_fail (password != NULL); _tmp0_ = credentials_new (); credentials = _tmp0_; - _tmp1_ = g_strdup (username); + _tmp1_ = username; + _tmp2_ = g_strdup (_tmp1_); _g_free0 (credentials->username); - credentials->username = _tmp1_; - _tmp2_ = g_strdup (password); + credentials->username = _tmp2_; + _tmp3_ = password; + _tmp4_ = g_strdup (_tmp3_); _g_free0 (credentials->password); - credentials->password = _tmp2_; - _tmp3_ = _credentials_ref0 (credentials); - g_async_queue_push (self->priv->authorize_queue, _tmp3_); + credentials->password = _tmp4_; + _tmp5_ = self->priv->authorize_queue; + _tmp6_ = _credentials_ref0 (credentials); + g_async_queue_push (_tmp5_, _tmp6_); _credentials_unref0 (credentials); } static void scanner_close_device (Scanner* self) { + gboolean _tmp0_; g_return_if_fail (self != NULL); - if (self->priv->have_handle) { - sane_cancel (self->priv->handle); - g_debug ("scanner.vala:695: sane_cancel ()"); - sane_close (self->priv->handle); - g_debug ("scanner.vala:698: sane_close ()"); + _tmp0_ = self->priv->have_handle; + if (_tmp0_) { + SANE_Handle _tmp1_; + SANE_Handle _tmp2_; + _tmp1_ = self->priv->handle; + sane_cancel (_tmp1_); + g_debug ("scanner.vala:696: sane_cancel ()"); + _tmp2_ = self->priv->handle; + sane_close (_tmp2_); + g_debug ("scanner.vala:699: sane_close ()"); self->priv->have_handle = FALSE; } self->priv->buffer = (g_free (self->priv->buffer), NULL); @@ -4373,16 +5358,20 @@ static void scanner_close_device (Scanner* self) { static void scanner_fail_scan (Scanner* self, gint error_code, const gchar* error_string) { - NotifyScanFailed* _tmp0_ = NULL; - NotifyScanFailed* _tmp1_; + gint _tmp0_; + const gchar* _tmp1_; + NotifyScanFailed* _tmp2_; + NotifyScanFailed* _tmp3_; g_return_if_fail (self != NULL); g_return_if_fail (error_string != NULL); scanner_close_device (self); self->priv->state = SCAN_STATE_IDLE; - _tmp0_ = notify_scan_failed_new (error_code, error_string); - _tmp1_ = _tmp0_; - scanner_notify (self, (Notify*) _tmp1_); - _notify_unref0 (_tmp1_); + _tmp0_ = error_code; + _tmp1_ = error_string; + _tmp2_ = notify_scan_failed_new (_tmp0_, _tmp1_); + _tmp3_ = _tmp2_; + scanner_notify (self, (Notify*) _tmp3_); + _notify_unref0 (_tmp3_); } @@ -4399,59 +5388,91 @@ static gpointer _scan_job_ref0 (gpointer self) { static gboolean scanner_handle_requests (Scanner* self) { gboolean result = FALSE; gboolean _tmp0_ = FALSE; + ScanState _tmp1_; + gboolean _tmp3_; gint request_count; g_return_val_if_fail (self != NULL, FALSE); - if (self->priv->state == SCAN_STATE_IDLE) { - _tmp0_ = self->priv->need_redetect; + _tmp1_ = self->priv->state; + if (_tmp1_ == SCAN_STATE_IDLE) { + gboolean _tmp2_; + _tmp2_ = self->priv->need_redetect; + _tmp0_ = _tmp2_; } else { _tmp0_ = FALSE; } - if (_tmp0_) { + _tmp3_ = _tmp0_; + if (_tmp3_) { self->priv->state = SCAN_STATE_REDETECT; } request_count = 0; while (TRUE) { Request* request = NULL; - gboolean _tmp1_ = FALSE; - gboolean _tmp2_ = FALSE; - if (self->priv->state == SCAN_STATE_IDLE) { - _tmp2_ = request_count == 0; + gboolean _tmp4_ = FALSE; + gboolean _tmp5_ = FALSE; + ScanState _tmp6_; + gboolean _tmp8_; + gboolean _tmp11_; + gint _tmp14_; + Request* _tmp15_; + _tmp6_ = self->priv->state; + if (_tmp6_ == SCAN_STATE_IDLE) { + gint _tmp7_; + _tmp7_ = request_count; + _tmp5_ = _tmp7_ == 0; } else { - _tmp2_ = FALSE; + _tmp5_ = FALSE; } - if (_tmp2_) { - _tmp1_ = TRUE; + _tmp8_ = _tmp5_; + if (_tmp8_) { + _tmp4_ = TRUE; } else { - gint _tmp3_; - _tmp3_ = g_async_queue_length (self->priv->request_queue); - _tmp1_ = _tmp3_ > 0; + GAsyncQueue* _tmp9_; + gint _tmp10_ = 0; + _tmp9_ = self->priv->request_queue; + _tmp10_ = g_async_queue_length (_tmp9_); + _tmp4_ = _tmp10_ > 0; } - if (_tmp1_) { - gpointer _tmp4_ = NULL; - _tmp4_ = g_async_queue_pop (self->priv->request_queue); + _tmp11_ = _tmp4_; + if (_tmp11_) { + GAsyncQueue* _tmp12_; + gpointer _tmp13_ = NULL; + _tmp12_ = self->priv->request_queue; + _tmp13_ = g_async_queue_pop (_tmp12_); _request_unref0 (request); - request = (Request*) _tmp4_; + request = (Request*) _tmp13_; } else { result = TRUE; _request_unref0 (request); return result; } - g_debug ("scanner.vala:732: Processing request"); - request_count++; - if (IS_REQUEST_START_SCAN (request)) { - RequestStartScan* _tmp5_; + g_debug ("scanner.vala:733: Processing request"); + _tmp14_ = request_count; + request_count = _tmp14_ + 1; + _tmp15_ = request; + if (IS_REQUEST_START_SCAN (_tmp15_)) { + Request* _tmp16_; + RequestStartScan* _tmp17_; RequestStartScan* r; - ScanJob* _tmp6_; - _tmp5_ = _request_ref0 (REQUEST_START_SCAN (request)); - r = _tmp5_; - _tmp6_ = _scan_job_ref0 (r->job); - self->priv->job_queue = g_list_append (self->priv->job_queue, _tmp6_); + RequestStartScan* _tmp18_; + ScanJob* _tmp19_; + ScanJob* _tmp20_; + _tmp16_ = request; + _tmp17_ = _request_ref0 (REQUEST_START_SCAN (_tmp16_)); + r = _tmp17_; + _tmp18_ = r; + _tmp19_ = _tmp18_->job; + _tmp20_ = _scan_job_ref0 (_tmp19_); + self->priv->job_queue = g_list_append (self->priv->job_queue, _tmp20_); _request_unref0 (r); } else { - if (IS_REQUEST_CANCEL (request)) { + Request* _tmp21_; + _tmp21_ = request; + if (IS_REQUEST_CANCEL (_tmp21_)) { scanner_fail_scan (self, (gint) SANE_STATUS_CANCELLED, "Scan cancelled - do not report this error"); } else { - if (IS_REQUEST_QUIT (request)) { + Request* _tmp22_; + _tmp22_ = request; + if (IS_REQUEST_QUIT (_tmp22_)) { scanner_close_device (self); result = FALSE; _request_unref0 (request); @@ -4465,18 +5486,36 @@ static gboolean scanner_handle_requests (Scanner* self) { static void scanner_do_open (Scanner* self) { - ScanJob* _tmp0_; + GList* _tmp0_; + gconstpointer _tmp1_; + ScanJob* _tmp2_; ScanJob* job; - gboolean _tmp1_ = FALSE; - SANE_Handle _tmp4_; - SANE_Status _tmp5_; + gboolean _tmp3_ = FALSE; + ScanJob* _tmp4_; + const gchar* _tmp5_; + gboolean _tmp7_; + ScanJob* _tmp11_; + const gchar* _tmp12_; + gboolean _tmp14_; + ScanJob* _tmp19_; + const gchar* _tmp20_; + SANE_Handle _tmp21_ = {0}; + SANE_Status _tmp22_ = 0; SANE_Status status; - gchar* _tmp6_ = NULL; - gchar* _tmp7_; - gchar* _tmp10_; + ScanJob* _tmp23_; + const gchar* _tmp24_; + SANE_Status _tmp25_; + gchar* _tmp26_ = NULL; + gchar* _tmp27_; + SANE_Status _tmp28_; + ScanJob* _tmp33_; + const gchar* _tmp34_; + gchar* _tmp35_; g_return_if_fail (self != NULL); - _tmp0_ = _scan_job_ref0 (SCAN_JOB ((ScanJob*) self->priv->job_queue->data)); - job = _tmp0_; + _tmp0_ = self->priv->job_queue; + _tmp1_ = _tmp0_->data; + _tmp2_ = _scan_job_ref0 (SCAN_JOB ((ScanJob*) _tmp1_)); + job = _tmp2_; self->priv->line_count = 0; self->priv->pass_number = 0; self->priv->page_number = 0; @@ -4484,106 +5523,246 @@ static void scanner_do_open (Scanner* self) { self->priv->option_index = (SANE_Int) 0; self->priv->br_x_option_index = (SANE_Int) 0; self->priv->br_y_option_index = (SANE_Int) 0; - if (job->device == NULL) { - _tmp1_ = self->priv->default_device != NULL; + _tmp4_ = job; + _tmp5_ = _tmp4_->device; + if (_tmp5_ == NULL) { + const gchar* _tmp6_; + _tmp6_ = self->priv->default_device; + _tmp3_ = _tmp6_ != NULL; } else { - _tmp1_ = FALSE; - } - if (_tmp1_) { - gchar* _tmp2_; - _tmp2_ = g_strdup (self->priv->default_device); - _g_free0 (job->device); - job->device = _tmp2_; - } - if (job->device == NULL) { - const gchar* _tmp3_ = NULL; - g_warning ("scanner.vala:769: No scan device available"); - _tmp3_ = _ ("No scanners available. Please connect a scanner."); - scanner_fail_scan (self, 0, _tmp3_); + _tmp3_ = FALSE; + } + _tmp7_ = _tmp3_; + if (_tmp7_) { + ScanJob* _tmp8_; + const gchar* _tmp9_; + gchar* _tmp10_; + _tmp8_ = job; + _tmp9_ = self->priv->default_device; + _tmp10_ = g_strdup (_tmp9_); + _g_free0 (_tmp8_->device); + _tmp8_->device = _tmp10_; + } + _tmp11_ = job; + _tmp12_ = _tmp11_->device; + if (_tmp12_ == NULL) { + const gchar* _tmp13_ = NULL; + g_warning ("scanner.vala:770: No scan device available"); + _tmp13_ = _ ("No scanners available. Please connect a scanner."); + scanner_fail_scan (self, 0, _tmp13_); _scan_job_unref0 (job); return; } - if (self->priv->have_handle) { - if (g_strcmp0 (self->priv->current_device, job->device) == 0) { + _tmp14_ = self->priv->have_handle; + if (_tmp14_) { + const gchar* _tmp15_; + ScanJob* _tmp16_; + const gchar* _tmp17_; + SANE_Handle _tmp18_; + _tmp15_ = self->priv->current_device; + _tmp16_ = job; + _tmp17_ = _tmp16_->device; + if (g_strcmp0 (_tmp15_, _tmp17_) == 0) { self->priv->state = SCAN_STATE_GET_OPTION; _scan_job_unref0 (job); return; } - sane_close (self->priv->handle); - g_debug ("scanner.vala:786: sane_close ()"); + _tmp18_ = self->priv->handle; + sane_close (_tmp18_); + g_debug ("scanner.vala:787: sane_close ()"); self->priv->have_handle = FALSE; } _g_free0 (self->priv->current_device); self->priv->current_device = NULL; self->priv->have_handle = FALSE; - _tmp5_ = sane_open (job->device, &_tmp4_); - self->priv->handle = _tmp4_; - status = _tmp5_; - _tmp6_ = sane_status_to_string (status); - _tmp7_ = _tmp6_; - g_debug ("scanner.vala:794: sane_open (\"%s\") -> %s", job->device, _tmp7_); - _g_free0 (_tmp7_); - if (status != SANE_STATUS_GOOD) { - const gchar* _tmp8_ = NULL; - const gchar* _tmp9_ = NULL; - _tmp8_ = sane_strstatus (status); - g_warning ("scanner.vala:798: Unable to get open device: %s", _tmp8_); - _tmp9_ = _ ("Unable to connect to scanner"); - scanner_fail_scan (self, (gint) status, _tmp9_); + _tmp19_ = job; + _tmp20_ = _tmp19_->device; + _tmp22_ = sane_open (_tmp20_, &_tmp21_); + self->priv->handle = _tmp21_; + status = _tmp22_; + _tmp23_ = job; + _tmp24_ = _tmp23_->device; + _tmp25_ = status; + _tmp26_ = sane_status_to_string (_tmp25_); + _tmp27_ = _tmp26_; + g_debug ("scanner.vala:795: sane_open (\"%s\") -> %s", _tmp24_, _tmp27_); + _g_free0 (_tmp27_); + _tmp28_ = status; + if (_tmp28_ != SANE_STATUS_GOOD) { + SANE_Status _tmp29_; + const gchar* _tmp30_ = NULL; + SANE_Status _tmp31_; + const gchar* _tmp32_ = NULL; + _tmp29_ = status; + _tmp30_ = sane_strstatus (_tmp29_); + g_warning ("scanner.vala:799: Unable to get open device: %s", _tmp30_); + _tmp31_ = status; + _tmp32_ = _ ("Unable to connect to scanner"); + scanner_fail_scan (self, (gint) _tmp31_, _tmp32_); _scan_job_unref0 (job); return; } self->priv->have_handle = TRUE; - _tmp10_ = g_strdup (job->device); + _tmp33_ = job; + _tmp34_ = _tmp33_->device; + _tmp35_ = g_strdup (_tmp34_); _g_free0 (self->priv->current_device); - self->priv->current_device = _tmp10_; + self->priv->current_device = _tmp35_; self->priv->state = SCAN_STATE_GET_OPTION; _scan_job_unref0 (job); } static void scanner_do_get_option (Scanner* self) { - ScanJob* _tmp0_; + GList* _tmp0_; + gconstpointer _tmp1_; + ScanJob* _tmp2_; ScanJob* job; - const SANE_Option_Descriptor* _tmp1_ = NULL; - const SANE_Option_Descriptor* option; + SANE_Handle _tmp3_; + SANE_Int _tmp4_; + SANE_Option_Descriptor* _tmp5_ = NULL; + SANE_Option_Descriptor* option; + SANE_Int _tmp6_; + SANE_Int _tmp7_; SANE_Int index; + SANE_Int _tmp8_; + SANE_Option_Descriptor* _tmp9_; + SANE_Int _tmp54_; + SANE_Option_Descriptor* _tmp55_; + SANE_Option_Descriptor* _tmp56_; + SANE_Value_Type _tmp57_; + SANE_Option_Descriptor* _tmp58_; + SANE_Int _tmp59_; + SANE_Option_Descriptor* _tmp60_; + const gchar* _tmp61_; + SANE_Option_Descriptor* _tmp62_; + const gchar* _tmp63_; + const gchar* _tmp64_; + const gchar* _tmp294_; g_return_if_fail (self != NULL); - _tmp0_ = _scan_job_ref0 (SCAN_JOB ((ScanJob*) self->priv->job_queue->data)); - job = _tmp0_; - _tmp1_ = sane_get_option_descriptor (self->priv->handle, self->priv->option_index); - option = _tmp1_; - g_debug ("scanner.vala:815: sane_get_option_descriptor (%d)", (gint) self->priv->option_index); - index = self->priv->option_index; - self->priv->option_index++; - if (option == NULL) { - if (((gint) self->priv->br_x_option_index) != 0) { - const SANE_Option_Descriptor* _tmp2_ = NULL; - _tmp2_ = sane_get_option_descriptor (self->priv->handle, self->priv->br_x_option_index); - option = _tmp2_; - g_debug ("scanner.vala:825: sane_get_option_descriptor (%d)", (gint) self->priv->br_x_option_index); - if (option->constraint_type == SANE_CONSTRAINT_RANGE) { - if (option->type == SANE_TYPE_FIXED) { - gdouble _tmp3_; - _tmp3_ = SANE_UNFIX ((SANE_Fixed) option->constraint.range->max); - scanner_set_fixed_option (self, self->priv->handle, option, self->priv->br_x_option_index, _tmp3_, NULL); + _tmp0_ = self->priv->job_queue; + _tmp1_ = _tmp0_->data; + _tmp2_ = _scan_job_ref0 (SCAN_JOB ((ScanJob*) _tmp1_)); + job = _tmp2_; + _tmp3_ = self->priv->handle; + _tmp4_ = self->priv->option_index; + _tmp5_ = sane_get_option_descriptor (_tmp3_, _tmp4_); + option = _tmp5_; + _tmp6_ = self->priv->option_index; + g_debug ("scanner.vala:816: sane_get_option_descriptor (%d)", (gint) _tmp6_); + _tmp7_ = self->priv->option_index; + index = _tmp7_; + _tmp8_ = self->priv->option_index; + self->priv->option_index = _tmp8_ + 1; + _tmp9_ = option; + if (_tmp9_ == NULL) { + SANE_Int _tmp10_; + SANE_Int _tmp32_; + _tmp10_ = self->priv->br_x_option_index; + if (_tmp10_ != ((SANE_Int) 0)) { + SANE_Handle _tmp11_; + SANE_Int _tmp12_; + SANE_Option_Descriptor* _tmp13_ = NULL; + SANE_Int _tmp14_; + SANE_Option_Descriptor* _tmp15_; + SANE_Constraint_Type _tmp16_; + _tmp11_ = self->priv->handle; + _tmp12_ = self->priv->br_x_option_index; + _tmp13_ = sane_get_option_descriptor (_tmp11_, _tmp12_); + option = _tmp13_; + _tmp14_ = self->priv->br_x_option_index; + g_debug ("scanner.vala:826: sane_get_option_descriptor (%d)", (gint) _tmp14_); + _tmp15_ = option; + _tmp16_ = _tmp15_->constraint_type; + if (_tmp16_ == SANE_CONSTRAINT_RANGE) { + SANE_Option_Descriptor* _tmp17_; + SANE_Value_Type _tmp18_; + _tmp17_ = option; + _tmp18_ = _tmp17_->type; + if (_tmp18_ == SANE_TYPE_FIXED) { + SANE_Handle _tmp19_; + SANE_Option_Descriptor* _tmp20_; + SANE_Int _tmp21_; + SANE_Option_Descriptor* _tmp22_; + SANE_Range* _tmp23_; + SANE_Word _tmp24_; + gdouble _tmp25_ = 0.0; + _tmp19_ = self->priv->handle; + _tmp20_ = option; + _tmp21_ = self->priv->br_x_option_index; + _tmp22_ = option; + _tmp23_ = _tmp22_->constraint.range; + _tmp24_ = _tmp23_->max; + _tmp25_ = SANE_UNFIX ((SANE_Fixed) _tmp24_); + scanner_set_fixed_option (self, _tmp19_, _tmp20_, _tmp21_, _tmp25_, NULL); } else { - scanner_set_int_option (self, self->priv->handle, option, self->priv->br_x_option_index, (gint) option->constraint.range->max, NULL); + SANE_Handle _tmp26_; + SANE_Option_Descriptor* _tmp27_; + SANE_Int _tmp28_; + SANE_Option_Descriptor* _tmp29_; + SANE_Range* _tmp30_; + SANE_Word _tmp31_; + _tmp26_ = self->priv->handle; + _tmp27_ = option; + _tmp28_ = self->priv->br_x_option_index; + _tmp29_ = option; + _tmp30_ = _tmp29_->constraint.range; + _tmp31_ = _tmp30_->max; + scanner_set_int_option (self, _tmp26_, _tmp27_, _tmp28_, (gint) _tmp31_, NULL); } } } - if (((gint) self->priv->br_y_option_index) != 0) { - const SANE_Option_Descriptor* _tmp4_ = NULL; - _tmp4_ = sane_get_option_descriptor (self->priv->handle, self->priv->br_y_option_index); - option = _tmp4_; - g_debug ("scanner.vala:837: sane_get_option_descriptor (%d)", (gint) self->priv->br_y_option_index); - if (option->constraint_type == SANE_CONSTRAINT_RANGE) { - if (option->type == SANE_TYPE_FIXED) { - gdouble _tmp5_; - _tmp5_ = SANE_UNFIX ((SANE_Fixed) option->constraint.range->max); - scanner_set_fixed_option (self, self->priv->handle, option, self->priv->br_y_option_index, _tmp5_, NULL); + _tmp32_ = self->priv->br_y_option_index; + if (_tmp32_ != ((SANE_Int) 0)) { + SANE_Handle _tmp33_; + SANE_Int _tmp34_; + SANE_Option_Descriptor* _tmp35_ = NULL; + SANE_Int _tmp36_; + SANE_Option_Descriptor* _tmp37_; + SANE_Constraint_Type _tmp38_; + _tmp33_ = self->priv->handle; + _tmp34_ = self->priv->br_y_option_index; + _tmp35_ = sane_get_option_descriptor (_tmp33_, _tmp34_); + option = _tmp35_; + _tmp36_ = self->priv->br_y_option_index; + g_debug ("scanner.vala:838: sane_get_option_descriptor (%d)", (gint) _tmp36_); + _tmp37_ = option; + _tmp38_ = _tmp37_->constraint_type; + if (_tmp38_ == SANE_CONSTRAINT_RANGE) { + SANE_Option_Descriptor* _tmp39_; + SANE_Value_Type _tmp40_; + _tmp39_ = option; + _tmp40_ = _tmp39_->type; + if (_tmp40_ == SANE_TYPE_FIXED) { + SANE_Handle _tmp41_; + SANE_Option_Descriptor* _tmp42_; + SANE_Int _tmp43_; + SANE_Option_Descriptor* _tmp44_; + SANE_Range* _tmp45_; + SANE_Word _tmp46_; + gdouble _tmp47_ = 0.0; + _tmp41_ = self->priv->handle; + _tmp42_ = option; + _tmp43_ = self->priv->br_y_option_index; + _tmp44_ = option; + _tmp45_ = _tmp44_->constraint.range; + _tmp46_ = _tmp45_->max; + _tmp47_ = SANE_UNFIX ((SANE_Fixed) _tmp46_); + scanner_set_fixed_option (self, _tmp41_, _tmp42_, _tmp43_, _tmp47_, NULL); } else { - scanner_set_int_option (self, self->priv->handle, option, self->priv->br_y_option_index, (gint) option->constraint.range->max, NULL); + SANE_Handle _tmp48_; + SANE_Option_Descriptor* _tmp49_; + SANE_Int _tmp50_; + SANE_Option_Descriptor* _tmp51_; + SANE_Range* _tmp52_; + SANE_Word _tmp53_; + _tmp48_ = self->priv->handle; + _tmp49_ = option; + _tmp50_ = self->priv->br_y_option_index; + _tmp51_ = option; + _tmp52_ = _tmp51_->constraint.range; + _tmp53_ = _tmp52_->max; + scanner_set_int_option (self, _tmp48_, _tmp49_, _tmp50_, (gint) _tmp53_, NULL); } } } @@ -4591,190 +5770,317 @@ static void scanner_do_get_option (Scanner* self) { _scan_job_unref0 (job); return; } - scanner_log_option (self, index, option); - if (option->type == SANE_TYPE_GROUP) { + _tmp54_ = index; + _tmp55_ = option; + scanner_log_option (self, _tmp54_, _tmp55_); + _tmp56_ = option; + _tmp57_ = _tmp56_->type; + if (_tmp57_ == SANE_TYPE_GROUP) { _scan_job_unref0 (job); return; } - if (((gint) (option->cap & SANE_CAP_INACTIVE)) != 0) { + _tmp58_ = option; + _tmp59_ = _tmp58_->cap; + if ((_tmp59_ & SANE_CAP_INACTIVE) != ((SANE_Int) 0)) { _scan_job_unref0 (job); return; } - if (option->name == NULL) { + _tmp60_ = option; + _tmp61_ = _tmp60_->name; + if (_tmp61_ == NULL) { _scan_job_unref0 (job); return; } - if (g_strcmp0 (option->name, SANE_NAME_SCAN_RESOLUTION) == 0) { - if (option->type == SANE_TYPE_FIXED) { - gdouble _tmp6_; - scanner_set_fixed_option (self, self->priv->handle, option, index, job->dpi, &_tmp6_); - job->dpi = _tmp6_; + _tmp62_ = option; + _tmp63_ = _tmp62_->name; + _tmp64_ = SANE_NAME_SCAN_RESOLUTION; + if (g_strcmp0 (_tmp63_, _tmp64_) == 0) { + SANE_Option_Descriptor* _tmp65_; + SANE_Value_Type _tmp66_; + _tmp65_ = option; + _tmp66_ = _tmp65_->type; + if (_tmp66_ == SANE_TYPE_FIXED) { + SANE_Handle _tmp67_; + SANE_Option_Descriptor* _tmp68_; + SANE_Int _tmp69_; + ScanJob* _tmp70_; + gdouble _tmp71_; + ScanJob* _tmp72_; + gdouble _tmp73_ = 0.0; + _tmp67_ = self->priv->handle; + _tmp68_ = option; + _tmp69_ = index; + _tmp70_ = job; + _tmp71_ = _tmp70_->dpi; + _tmp72_ = job; + scanner_set_fixed_option (self, _tmp67_, _tmp68_, _tmp69_, _tmp71_, &_tmp73_); + _tmp72_->dpi = _tmp73_; } else { gint dpi = 0; - gint _tmp7_; - scanner_set_int_option (self, self->priv->handle, option, index, (gint) job->dpi, &_tmp7_); - dpi = _tmp7_; - job->dpi = (gdouble) dpi; + SANE_Handle _tmp74_; + SANE_Option_Descriptor* _tmp75_; + SANE_Int _tmp76_; + ScanJob* _tmp77_; + gdouble _tmp78_; + gint _tmp79_ = 0; + ScanJob* _tmp80_; + gint _tmp81_; + _tmp74_ = self->priv->handle; + _tmp75_ = option; + _tmp76_ = index; + _tmp77_ = job; + _tmp78_ = _tmp77_->dpi; + scanner_set_int_option (self, _tmp74_, _tmp75_, _tmp76_, (gint) _tmp78_, &_tmp79_); + dpi = _tmp79_; + _tmp80_ = job; + _tmp81_ = dpi; + _tmp80_->dpi = (gdouble) _tmp81_; } } else { - if (g_strcmp0 (option->name, SANE_NAME_SCAN_SOURCE) == 0) { - gchar* _tmp8_; - const gchar* _tmp9_ = NULL; - gchar* _tmp10_; - gchar* _tmp11_; - const gchar* _tmp12_ = NULL; - gchar* _tmp13_; - gchar* _tmp14_; - gchar* _tmp15_; - const gchar* _tmp16_ = NULL; - gchar* _tmp17_; - gchar** _tmp18_ = NULL; + SANE_Option_Descriptor* _tmp82_; + const gchar* _tmp83_; + const gchar* _tmp84_; + _tmp82_ = option; + _tmp83_ = _tmp82_->name; + _tmp84_ = SANE_NAME_SCAN_SOURCE; + if (g_strcmp0 (_tmp83_, _tmp84_) == 0) { + gchar* _tmp85_; + const gchar* _tmp86_ = NULL; + gchar* _tmp87_; + gchar* _tmp88_; + const gchar* _tmp89_ = NULL; + gchar* _tmp90_; + gchar* _tmp91_; + gchar* _tmp92_; + const gchar* _tmp93_ = NULL; + gchar* _tmp94_; + gchar** _tmp95_ = NULL; gchar** flatbed_sources; gint flatbed_sources_length1; gint _flatbed_sources_size_; - gchar* _tmp19_; - const gchar* _tmp20_ = NULL; - gchar* _tmp21_; - gchar* _tmp22_; - gchar* _tmp23_; - gchar* _tmp24_; - gchar** _tmp25_ = NULL; + gchar* _tmp96_; + const gchar* _tmp97_ = NULL; + gchar* _tmp98_; + gchar* _tmp99_; + gchar* _tmp100_; + gchar* _tmp101_; + gchar** _tmp102_ = NULL; gchar** adf_sources; gint adf_sources_length1; gint _adf_sources_size_; - gchar* _tmp26_; - const gchar* _tmp27_ = NULL; - gchar* _tmp28_; - gchar** _tmp29_ = NULL; + gchar* _tmp103_; + const gchar* _tmp104_ = NULL; + gchar* _tmp105_; + gchar** _tmp106_ = NULL; gchar** adf_front_sources; gint adf_front_sources_length1; gint _adf_front_sources_size_; - gchar* _tmp30_; - const gchar* _tmp31_ = NULL; - gchar* _tmp32_; - gchar** _tmp33_ = NULL; + gchar* _tmp107_; + const gchar* _tmp108_ = NULL; + gchar* _tmp109_; + gchar** _tmp110_ = NULL; gchar** adf_back_sources; gint adf_back_sources_length1; gint _adf_back_sources_size_; - gchar* _tmp34_; - const gchar* _tmp35_ = NULL; - gchar* _tmp36_; - gchar** _tmp37_ = NULL; + gchar* _tmp111_; + const gchar* _tmp112_ = NULL; + gchar* _tmp113_; + gchar** _tmp114_ = NULL; gchar** adf_duplex_sources; gint adf_duplex_sources_length1; gint _adf_duplex_sources_size_; - _tmp8_ = g_strdup ("Auto"); - _tmp9_ = SANE_I18N ("Auto"); - _tmp10_ = g_strdup (_tmp9_); - _tmp11_ = g_strdup ("Flatbed"); - _tmp12_ = SANE_I18N ("Flatbed"); - _tmp13_ = g_strdup (_tmp12_); - _tmp14_ = g_strdup ("FlatBed"); - _tmp15_ = g_strdup ("Normal"); - _tmp16_ = SANE_I18N ("Normal"); - _tmp17_ = g_strdup (_tmp16_); - _tmp18_ = g_new0 (gchar*, 7 + 1); - _tmp18_[0] = _tmp8_; - _tmp18_[1] = _tmp10_; - _tmp18_[2] = _tmp11_; - _tmp18_[3] = _tmp13_; - _tmp18_[4] = _tmp14_; - _tmp18_[5] = _tmp15_; - _tmp18_[6] = _tmp17_; - flatbed_sources = _tmp18_; + ScanJob* _tmp115_; + ScanType _tmp116_; + _tmp85_ = g_strdup ("Auto"); + _tmp86_ = SANE_I18N ("Auto"); + _tmp87_ = g_strdup (_tmp86_); + _tmp88_ = g_strdup ("Flatbed"); + _tmp89_ = SANE_I18N ("Flatbed"); + _tmp90_ = g_strdup (_tmp89_); + _tmp91_ = g_strdup ("FlatBed"); + _tmp92_ = g_strdup ("Normal"); + _tmp93_ = SANE_I18N ("Normal"); + _tmp94_ = g_strdup (_tmp93_); + _tmp95_ = g_new0 (gchar*, 7 + 1); + _tmp95_[0] = _tmp85_; + _tmp95_[1] = _tmp87_; + _tmp95_[2] = _tmp88_; + _tmp95_[3] = _tmp90_; + _tmp95_[4] = _tmp91_; + _tmp95_[5] = _tmp92_; + _tmp95_[6] = _tmp94_; + flatbed_sources = _tmp95_; flatbed_sources_length1 = 7; _flatbed_sources_size_ = flatbed_sources_length1; - _tmp19_ = g_strdup ("Automatic Document Feeder"); - _tmp20_ = SANE_I18N ("Automatic Document Feeder"); - _tmp21_ = g_strdup (_tmp20_); - _tmp22_ = g_strdup ("ADF"); - _tmp23_ = g_strdup ("Automatic Document Feeder(left aligned)"); - _tmp24_ = g_strdup ("Automatic Document Feeder(centrally aligned)"); - _tmp25_ = g_new0 (gchar*, 5 + 1); - _tmp25_[0] = _tmp19_; - _tmp25_[1] = _tmp21_; - _tmp25_[2] = _tmp22_; - _tmp25_[3] = _tmp23_; - _tmp25_[4] = _tmp24_; - adf_sources = _tmp25_; + _tmp96_ = g_strdup ("Automatic Document Feeder"); + _tmp97_ = SANE_I18N ("Automatic Document Feeder"); + _tmp98_ = g_strdup (_tmp97_); + _tmp99_ = g_strdup ("ADF"); + _tmp100_ = g_strdup ("Automatic Document Feeder(left aligned)"); + _tmp101_ = g_strdup ("Automatic Document Feeder(centrally aligned)"); + _tmp102_ = g_new0 (gchar*, 5 + 1); + _tmp102_[0] = _tmp96_; + _tmp102_[1] = _tmp98_; + _tmp102_[2] = _tmp99_; + _tmp102_[3] = _tmp100_; + _tmp102_[4] = _tmp101_; + adf_sources = _tmp102_; adf_sources_length1 = 5; _adf_sources_size_ = adf_sources_length1; - _tmp26_ = g_strdup ("ADF Front"); - _tmp27_ = SANE_I18N ("ADF Front"); - _tmp28_ = g_strdup (_tmp27_); - _tmp29_ = g_new0 (gchar*, 2 + 1); - _tmp29_[0] = _tmp26_; - _tmp29_[1] = _tmp28_; - adf_front_sources = _tmp29_; + _tmp103_ = g_strdup ("ADF Front"); + _tmp104_ = SANE_I18N ("ADF Front"); + _tmp105_ = g_strdup (_tmp104_); + _tmp106_ = g_new0 (gchar*, 2 + 1); + _tmp106_[0] = _tmp103_; + _tmp106_[1] = _tmp105_; + adf_front_sources = _tmp106_; adf_front_sources_length1 = 2; _adf_front_sources_size_ = adf_front_sources_length1; - _tmp30_ = g_strdup ("ADF Back"); - _tmp31_ = SANE_I18N ("ADF Back"); - _tmp32_ = g_strdup (_tmp31_); - _tmp33_ = g_new0 (gchar*, 2 + 1); - _tmp33_[0] = _tmp30_; - _tmp33_[1] = _tmp32_; - adf_back_sources = _tmp33_; + _tmp107_ = g_strdup ("ADF Back"); + _tmp108_ = SANE_I18N ("ADF Back"); + _tmp109_ = g_strdup (_tmp108_); + _tmp110_ = g_new0 (gchar*, 2 + 1); + _tmp110_[0] = _tmp107_; + _tmp110_[1] = _tmp109_; + adf_back_sources = _tmp110_; adf_back_sources_length1 = 2; _adf_back_sources_size_ = adf_back_sources_length1; - _tmp34_ = g_strdup ("ADF Duplex"); - _tmp35_ = SANE_I18N ("ADF Duplex"); - _tmp36_ = g_strdup (_tmp35_); - _tmp37_ = g_new0 (gchar*, 2 + 1); - _tmp37_[0] = _tmp34_; - _tmp37_[1] = _tmp36_; - adf_duplex_sources = _tmp37_; + _tmp111_ = g_strdup ("ADF Duplex"); + _tmp112_ = SANE_I18N ("ADF Duplex"); + _tmp113_ = g_strdup (_tmp112_); + _tmp114_ = g_new0 (gchar*, 2 + 1); + _tmp114_[0] = _tmp111_; + _tmp114_[1] = _tmp113_; + adf_duplex_sources = _tmp114_; adf_duplex_sources_length1 = 2; _adf_duplex_sources_size_ = adf_duplex_sources_length1; - switch (job->type) { + _tmp115_ = job; + _tmp116_ = _tmp115_->type; + switch (_tmp116_) { case SCAN_TYPE_SINGLE: { - gboolean _tmp38_; - _tmp38_ = scanner_set_default_option (self, self->priv->handle, option, index); - if (!_tmp38_) { - gboolean _tmp39_; - _tmp39_ = scanner_set_constrained_string_option (self, self->priv->handle, option, index, flatbed_sources, flatbed_sources_length1, NULL); - if (!_tmp39_) { - g_warning ("scanner.vala:921: Unable to set single page source, please file a bug"); + SANE_Handle _tmp117_; + SANE_Option_Descriptor* _tmp118_; + SANE_Int _tmp119_; + gboolean _tmp120_ = FALSE; + _tmp117_ = self->priv->handle; + _tmp118_ = option; + _tmp119_ = index; + _tmp120_ = scanner_set_default_option (self, _tmp117_, _tmp118_, _tmp119_); + if (!_tmp120_) { + SANE_Handle _tmp121_; + SANE_Option_Descriptor* _tmp122_; + SANE_Int _tmp123_; + gchar** _tmp124_; + gint _tmp124__length1; + gboolean _tmp125_ = FALSE; + _tmp121_ = self->priv->handle; + _tmp122_ = option; + _tmp123_ = index; + _tmp124_ = flatbed_sources; + _tmp124__length1 = flatbed_sources_length1; + _tmp125_ = scanner_set_constrained_string_option (self, _tmp121_, _tmp122_, _tmp123_, _tmp124_, _tmp124__length1, NULL); + if (!_tmp125_) { + g_warning ("scanner.vala:922: Unable to set single page source, please file a bug"); } } break; } case SCAN_TYPE_ADF_FRONT: { - gboolean _tmp40_; - _tmp40_ = scanner_set_constrained_string_option (self, self->priv->handle, option, index, adf_front_sources, adf_front_sources_length1, NULL); - if (!_tmp40_) { - gboolean _tmp41_; - _tmp41_ = scanner_set_constrained_string_option (self, self->priv->handle, option, index, adf_sources, adf_sources_length1, NULL); - if (!(!_tmp41_)) { - g_warning ("scanner.vala:926: Unable to set front ADF source, please file a bug"); + SANE_Handle _tmp126_; + SANE_Option_Descriptor* _tmp127_; + SANE_Int _tmp128_; + gchar** _tmp129_; + gint _tmp129__length1; + gboolean _tmp130_ = FALSE; + _tmp126_ = self->priv->handle; + _tmp127_ = option; + _tmp128_ = index; + _tmp129_ = adf_front_sources; + _tmp129__length1 = adf_front_sources_length1; + _tmp130_ = scanner_set_constrained_string_option (self, _tmp126_, _tmp127_, _tmp128_, _tmp129_, _tmp129__length1, NULL); + if (!_tmp130_) { + SANE_Handle _tmp131_; + SANE_Option_Descriptor* _tmp132_; + SANE_Int _tmp133_; + gchar** _tmp134_; + gint _tmp134__length1; + gboolean _tmp135_ = FALSE; + _tmp131_ = self->priv->handle; + _tmp132_ = option; + _tmp133_ = index; + _tmp134_ = adf_sources; + _tmp134__length1 = adf_sources_length1; + _tmp135_ = scanner_set_constrained_string_option (self, _tmp131_, _tmp132_, _tmp133_, _tmp134_, _tmp134__length1, NULL); + if (!(!_tmp135_)) { + g_warning ("scanner.vala:927: Unable to set front ADF source, please file a bug"); } } break; } case SCAN_TYPE_ADF_BACK: { - gboolean _tmp42_; - _tmp42_ = scanner_set_constrained_string_option (self, self->priv->handle, option, index, adf_back_sources, adf_back_sources_length1, NULL); - if (!_tmp42_) { - gboolean _tmp43_; - _tmp43_ = scanner_set_constrained_string_option (self, self->priv->handle, option, index, adf_sources, adf_sources_length1, NULL); - if (!_tmp43_) { - g_warning ("scanner.vala:931: Unable to set back ADF source, please file a bug"); + SANE_Handle _tmp136_; + SANE_Option_Descriptor* _tmp137_; + SANE_Int _tmp138_; + gchar** _tmp139_; + gint _tmp139__length1; + gboolean _tmp140_ = FALSE; + _tmp136_ = self->priv->handle; + _tmp137_ = option; + _tmp138_ = index; + _tmp139_ = adf_back_sources; + _tmp139__length1 = adf_back_sources_length1; + _tmp140_ = scanner_set_constrained_string_option (self, _tmp136_, _tmp137_, _tmp138_, _tmp139_, _tmp139__length1, NULL); + if (!_tmp140_) { + SANE_Handle _tmp141_; + SANE_Option_Descriptor* _tmp142_; + SANE_Int _tmp143_; + gchar** _tmp144_; + gint _tmp144__length1; + gboolean _tmp145_ = FALSE; + _tmp141_ = self->priv->handle; + _tmp142_ = option; + _tmp143_ = index; + _tmp144_ = adf_sources; + _tmp144__length1 = adf_sources_length1; + _tmp145_ = scanner_set_constrained_string_option (self, _tmp141_, _tmp142_, _tmp143_, _tmp144_, _tmp144__length1, NULL); + if (!_tmp145_) { + g_warning ("scanner.vala:932: Unable to set back ADF source, please file a bug"); } } break; } case SCAN_TYPE_ADF_BOTH: { - gboolean _tmp44_; - _tmp44_ = scanner_set_constrained_string_option (self, self->priv->handle, option, index, adf_duplex_sources, adf_duplex_sources_length1, NULL); - if (!_tmp44_) { - gboolean _tmp45_; - _tmp45_ = scanner_set_constrained_string_option (self, self->priv->handle, option, index, adf_sources, adf_sources_length1, NULL); - if (!_tmp45_) { - g_warning ("scanner.vala:936: Unable to set duplex ADF source, please file a bug"); + SANE_Handle _tmp146_; + SANE_Option_Descriptor* _tmp147_; + SANE_Int _tmp148_; + gchar** _tmp149_; + gint _tmp149__length1; + gboolean _tmp150_ = FALSE; + _tmp146_ = self->priv->handle; + _tmp147_ = option; + _tmp148_ = index; + _tmp149_ = adf_duplex_sources; + _tmp149__length1 = adf_duplex_sources_length1; + _tmp150_ = scanner_set_constrained_string_option (self, _tmp146_, _tmp147_, _tmp148_, _tmp149_, _tmp149__length1, NULL); + if (!_tmp150_) { + SANE_Handle _tmp151_; + SANE_Option_Descriptor* _tmp152_; + SANE_Int _tmp153_; + gchar** _tmp154_; + gint _tmp154__length1; + gboolean _tmp155_ = FALSE; + _tmp151_ = self->priv->handle; + _tmp152_ = option; + _tmp153_ = index; + _tmp154_ = adf_sources; + _tmp154__length1 = adf_sources_length1; + _tmp155_ = scanner_set_constrained_string_option (self, _tmp151_, _tmp152_, _tmp153_, _tmp154_, _tmp154__length1, NULL); + if (!_tmp155_) { + g_warning ("scanner.vala:937: Unable to set duplex ADF source, please file a bug"); } } break; @@ -4788,147 +6094,251 @@ static void scanner_do_get_option (Scanner* self) { adf_sources = (_vala_array_free (adf_sources, adf_sources_length1, (GDestroyNotify) g_free), NULL); flatbed_sources = (_vala_array_free (flatbed_sources, flatbed_sources_length1, (GDestroyNotify) g_free), NULL); } else { - if (g_strcmp0 (option->name, "duplex") == 0) { - if (option->type == SANE_TYPE_BOOL) { - scanner_set_bool_option (self, self->priv->handle, option, index, job->type == SCAN_TYPE_ADF_BOTH, NULL); + SANE_Option_Descriptor* _tmp156_; + const gchar* _tmp157_; + _tmp156_ = option; + _tmp157_ = _tmp156_->name; + if (g_strcmp0 (_tmp157_, "duplex") == 0) { + SANE_Option_Descriptor* _tmp158_; + SANE_Value_Type _tmp159_; + _tmp158_ = option; + _tmp159_ = _tmp158_->type; + if (_tmp159_ == SANE_TYPE_BOOL) { + SANE_Handle _tmp160_; + SANE_Option_Descriptor* _tmp161_; + SANE_Int _tmp162_; + ScanJob* _tmp163_; + ScanType _tmp164_; + _tmp160_ = self->priv->handle; + _tmp161_ = option; + _tmp162_ = index; + _tmp163_ = job; + _tmp164_ = _tmp163_->type; + scanner_set_bool_option (self, _tmp160_, _tmp161_, _tmp162_, _tmp164_ == SCAN_TYPE_ADF_BOTH, NULL); } } else { - if (g_strcmp0 (option->name, "batch-scan") == 0) { - if (option->type == SANE_TYPE_BOOL) { - scanner_set_bool_option (self, self->priv->handle, option, index, job->type != SCAN_TYPE_SINGLE, NULL); + SANE_Option_Descriptor* _tmp165_; + const gchar* _tmp166_; + _tmp165_ = option; + _tmp166_ = _tmp165_->name; + if (g_strcmp0 (_tmp166_, "batch-scan") == 0) { + SANE_Option_Descriptor* _tmp167_; + SANE_Value_Type _tmp168_; + _tmp167_ = option; + _tmp168_ = _tmp167_->type; + if (_tmp168_ == SANE_TYPE_BOOL) { + SANE_Handle _tmp169_; + SANE_Option_Descriptor* _tmp170_; + SANE_Int _tmp171_; + ScanJob* _tmp172_; + ScanType _tmp173_; + _tmp169_ = self->priv->handle; + _tmp170_ = option; + _tmp171_ = index; + _tmp172_ = job; + _tmp173_ = _tmp172_->type; + scanner_set_bool_option (self, _tmp169_, _tmp170_, _tmp171_, _tmp173_ != SCAN_TYPE_SINGLE, NULL); } } else { - if (g_strcmp0 (option->name, SANE_NAME_BIT_DEPTH) == 0) { - if (job->depth > 0) { - scanner_set_int_option (self, self->priv->handle, option, index, job->depth, NULL); + SANE_Option_Descriptor* _tmp174_; + const gchar* _tmp175_; + const gchar* _tmp176_; + _tmp174_ = option; + _tmp175_ = _tmp174_->name; + _tmp176_ = SANE_NAME_BIT_DEPTH; + if (g_strcmp0 (_tmp175_, _tmp176_) == 0) { + ScanJob* _tmp177_; + gint _tmp178_; + _tmp177_ = job; + _tmp178_ = _tmp177_->depth; + if (_tmp178_ > 0) { + SANE_Handle _tmp179_; + SANE_Option_Descriptor* _tmp180_; + SANE_Int _tmp181_; + ScanJob* _tmp182_; + gint _tmp183_; + _tmp179_ = self->priv->handle; + _tmp180_ = option; + _tmp181_ = index; + _tmp182_ = job; + _tmp183_ = _tmp182_->depth; + scanner_set_int_option (self, _tmp179_, _tmp180_, _tmp181_, _tmp183_, NULL); } } else { - if (g_strcmp0 (option->name, SANE_NAME_SCAN_MODE) == 0) { - gchar* _tmp46_; - gchar* _tmp47_; - gchar* _tmp48_; - gchar** _tmp49_ = NULL; + SANE_Option_Descriptor* _tmp184_; + const gchar* _tmp185_; + const gchar* _tmp186_; + _tmp184_ = option; + _tmp185_ = _tmp184_->name; + _tmp186_ = SANE_NAME_SCAN_MODE; + if (g_strcmp0 (_tmp185_, _tmp186_) == 0) { + const gchar* _tmp187_; + gchar* _tmp188_; + gchar* _tmp189_; + gchar* _tmp190_; + gchar** _tmp191_ = NULL; gchar** color_scan_modes; gint color_scan_modes_length1; gint _color_scan_modes_size_; - gchar* _tmp50_; - gchar* _tmp51_; - gchar* _tmp52_; - const gchar* _tmp53_ = NULL; - gchar* _tmp54_; - gchar* _tmp55_; - gchar** _tmp56_ = NULL; + const gchar* _tmp192_; + gchar* _tmp193_; + gchar* _tmp194_; + gchar* _tmp195_; + const gchar* _tmp196_ = NULL; + gchar* _tmp197_; + gchar* _tmp198_; + gchar** _tmp199_ = NULL; gchar** gray_scan_modes; gint gray_scan_modes_length1; gint _gray_scan_modes_size_; - gchar* _tmp57_; - gchar* _tmp58_; - gchar* _tmp59_; - const gchar* _tmp60_ = NULL; - gchar* _tmp61_; - gchar* _tmp62_; - const gchar* _tmp63_ = NULL; - gchar* _tmp64_; - gchar* _tmp65_; - const gchar* _tmp66_ = NULL; - gchar* _tmp67_; - gchar* _tmp68_; - gchar* _tmp69_; - gchar* _tmp70_; - gchar* _tmp71_; - const gchar* _tmp72_ = NULL; - gchar* _tmp73_; - gchar* _tmp74_; - gchar** _tmp75_ = NULL; + const gchar* _tmp200_; + gchar* _tmp201_; + gchar* _tmp202_; + gchar* _tmp203_; + const gchar* _tmp204_ = NULL; + gchar* _tmp205_; + gchar* _tmp206_; + const gchar* _tmp207_ = NULL; + gchar* _tmp208_; + gchar* _tmp209_; + const gchar* _tmp210_ = NULL; + gchar* _tmp211_; + gchar* _tmp212_; + const gchar* _tmp213_; + gchar* _tmp214_; + gchar* _tmp215_; + gchar* _tmp216_; + const gchar* _tmp217_ = NULL; + gchar* _tmp218_; + gchar* _tmp219_; + gchar** _tmp220_ = NULL; gchar** lineart_scan_modes; gint lineart_scan_modes_length1; gint _lineart_scan_modes_size_; - _tmp46_ = g_strdup (SANE_VALUE_SCAN_MODE_COLOR); - _tmp47_ = g_strdup ("Color"); - _tmp48_ = g_strdup ("24bit Color"); - _tmp49_ = g_new0 (gchar*, 3 + 1); - _tmp49_[0] = _tmp46_; - _tmp49_[1] = _tmp47_; - _tmp49_[2] = _tmp48_; - color_scan_modes = _tmp49_; + ScanJob* _tmp221_; + ScanMode _tmp222_; + _tmp187_ = SANE_VALUE_SCAN_MODE_COLOR; + _tmp188_ = g_strdup (_tmp187_); + _tmp189_ = g_strdup ("Color"); + _tmp190_ = g_strdup ("24bit Color"); + _tmp191_ = g_new0 (gchar*, 3 + 1); + _tmp191_[0] = _tmp188_; + _tmp191_[1] = _tmp189_; + _tmp191_[2] = _tmp190_; + color_scan_modes = _tmp191_; color_scan_modes_length1 = 3; _color_scan_modes_size_ = color_scan_modes_length1; - _tmp50_ = g_strdup (SANE_VALUE_SCAN_MODE_GRAY); - _tmp51_ = g_strdup ("Gray"); - _tmp52_ = g_strdup ("Grayscale"); - _tmp53_ = SANE_I18N ("Grayscale"); - _tmp54_ = g_strdup (_tmp53_); - _tmp55_ = g_strdup ("True Gray"); - _tmp56_ = g_new0 (gchar*, 5 + 1); - _tmp56_[0] = _tmp50_; - _tmp56_[1] = _tmp51_; - _tmp56_[2] = _tmp52_; - _tmp56_[3] = _tmp54_; - _tmp56_[4] = _tmp55_; - gray_scan_modes = _tmp56_; + _tmp192_ = SANE_VALUE_SCAN_MODE_GRAY; + _tmp193_ = g_strdup (_tmp192_); + _tmp194_ = g_strdup ("Gray"); + _tmp195_ = g_strdup ("Grayscale"); + _tmp196_ = SANE_I18N ("Grayscale"); + _tmp197_ = g_strdup (_tmp196_); + _tmp198_ = g_strdup ("True Gray"); + _tmp199_ = g_new0 (gchar*, 5 + 1); + _tmp199_[0] = _tmp193_; + _tmp199_[1] = _tmp194_; + _tmp199_[2] = _tmp195_; + _tmp199_[3] = _tmp197_; + _tmp199_[4] = _tmp198_; + gray_scan_modes = _tmp199_; gray_scan_modes_length1 = 5; _gray_scan_modes_size_ = gray_scan_modes_length1; - _tmp57_ = g_strdup (SANE_VALUE_SCAN_MODE_LINEART); - _tmp58_ = g_strdup ("Lineart"); - _tmp59_ = g_strdup ("LineArt"); - _tmp60_ = SANE_I18N ("LineArt"); - _tmp61_ = g_strdup (_tmp60_); - _tmp62_ = g_strdup ("Black & White"); - _tmp63_ = SANE_I18N ("Black & White"); - _tmp64_ = g_strdup (_tmp63_); - _tmp65_ = g_strdup ("Binary"); - _tmp66_ = SANE_I18N ("Binary"); - _tmp67_ = g_strdup (_tmp66_); - _tmp68_ = g_strdup ("Thresholded"); - _tmp69_ = g_strdup (SANE_VALUE_SCAN_MODE_GRAY); - _tmp70_ = g_strdup ("Gray"); - _tmp71_ = g_strdup ("Grayscale"); - _tmp72_ = SANE_I18N ("Grayscale"); - _tmp73_ = g_strdup (_tmp72_); - _tmp74_ = g_strdup ("True Gray"); - _tmp75_ = g_new0 (gchar*, 14 + 1); - _tmp75_[0] = _tmp57_; - _tmp75_[1] = _tmp58_; - _tmp75_[2] = _tmp59_; - _tmp75_[3] = _tmp61_; - _tmp75_[4] = _tmp62_; - _tmp75_[5] = _tmp64_; - _tmp75_[6] = _tmp65_; - _tmp75_[7] = _tmp67_; - _tmp75_[8] = _tmp68_; - _tmp75_[9] = _tmp69_; - _tmp75_[10] = _tmp70_; - _tmp75_[11] = _tmp71_; - _tmp75_[12] = _tmp73_; - _tmp75_[13] = _tmp74_; - lineart_scan_modes = _tmp75_; + _tmp200_ = SANE_VALUE_SCAN_MODE_LINEART; + _tmp201_ = g_strdup (_tmp200_); + _tmp202_ = g_strdup ("Lineart"); + _tmp203_ = g_strdup ("LineArt"); + _tmp204_ = SANE_I18N ("LineArt"); + _tmp205_ = g_strdup (_tmp204_); + _tmp206_ = g_strdup ("Black & White"); + _tmp207_ = SANE_I18N ("Black & White"); + _tmp208_ = g_strdup (_tmp207_); + _tmp209_ = g_strdup ("Binary"); + _tmp210_ = SANE_I18N ("Binary"); + _tmp211_ = g_strdup (_tmp210_); + _tmp212_ = g_strdup ("Thresholded"); + _tmp213_ = SANE_VALUE_SCAN_MODE_GRAY; + _tmp214_ = g_strdup (_tmp213_); + _tmp215_ = g_strdup ("Gray"); + _tmp216_ = g_strdup ("Grayscale"); + _tmp217_ = SANE_I18N ("Grayscale"); + _tmp218_ = g_strdup (_tmp217_); + _tmp219_ = g_strdup ("True Gray"); + _tmp220_ = g_new0 (gchar*, 14 + 1); + _tmp220_[0] = _tmp201_; + _tmp220_[1] = _tmp202_; + _tmp220_[2] = _tmp203_; + _tmp220_[3] = _tmp205_; + _tmp220_[4] = _tmp206_; + _tmp220_[5] = _tmp208_; + _tmp220_[6] = _tmp209_; + _tmp220_[7] = _tmp211_; + _tmp220_[8] = _tmp212_; + _tmp220_[9] = _tmp214_; + _tmp220_[10] = _tmp215_; + _tmp220_[11] = _tmp216_; + _tmp220_[12] = _tmp218_; + _tmp220_[13] = _tmp219_; + lineart_scan_modes = _tmp220_; lineart_scan_modes_length1 = 14; _lineart_scan_modes_size_ = lineart_scan_modes_length1; - switch (job->scan_mode) { + _tmp221_ = job; + _tmp222_ = _tmp221_->scan_mode; + switch (_tmp222_) { case SCAN_MODE_COLOR: { - gboolean _tmp76_; - _tmp76_ = scanner_set_constrained_string_option (self, self->priv->handle, option, index, color_scan_modes, color_scan_modes_length1, NULL); - if (!_tmp76_) { - g_warning ("scanner.vala:994: Unable to set Color mode, please file a bug"); + SANE_Handle _tmp223_; + SANE_Option_Descriptor* _tmp224_; + SANE_Int _tmp225_; + gchar** _tmp226_; + gint _tmp226__length1; + gboolean _tmp227_ = FALSE; + _tmp223_ = self->priv->handle; + _tmp224_ = option; + _tmp225_ = index; + _tmp226_ = color_scan_modes; + _tmp226__length1 = color_scan_modes_length1; + _tmp227_ = scanner_set_constrained_string_option (self, _tmp223_, _tmp224_, _tmp225_, _tmp226_, _tmp226__length1, NULL); + if (!_tmp227_) { + g_warning ("scanner.vala:995: Unable to set Color mode, please file a bug"); } break; } case SCAN_MODE_GRAY: { - gboolean _tmp77_; - _tmp77_ = scanner_set_constrained_string_option (self, self->priv->handle, option, index, gray_scan_modes, gray_scan_modes_length1, NULL); - if (!_tmp77_) { - g_warning ("scanner.vala:998: Unable to set Gray mode, please file a bug"); + SANE_Handle _tmp228_; + SANE_Option_Descriptor* _tmp229_; + SANE_Int _tmp230_; + gchar** _tmp231_; + gint _tmp231__length1; + gboolean _tmp232_ = FALSE; + _tmp228_ = self->priv->handle; + _tmp229_ = option; + _tmp230_ = index; + _tmp231_ = gray_scan_modes; + _tmp231__length1 = gray_scan_modes_length1; + _tmp232_ = scanner_set_constrained_string_option (self, _tmp228_, _tmp229_, _tmp230_, _tmp231_, _tmp231__length1, NULL); + if (!_tmp232_) { + g_warning ("scanner.vala:999: Unable to set Gray mode, please file a bug"); } break; } case SCAN_MODE_LINEART: { - gboolean _tmp78_; - _tmp78_ = scanner_set_constrained_string_option (self, self->priv->handle, option, index, lineart_scan_modes, lineart_scan_modes_length1, NULL); - if (!_tmp78_) { - g_warning ("scanner.vala:1002: Unable to set Lineart mode, please file a bug"); + SANE_Handle _tmp233_; + SANE_Option_Descriptor* _tmp234_; + SANE_Int _tmp235_; + gchar** _tmp236_; + gint _tmp236__length1; + gboolean _tmp237_ = FALSE; + _tmp233_ = self->priv->handle; + _tmp234_ = option; + _tmp235_ = index; + _tmp236_ = lineart_scan_modes; + _tmp236__length1 = lineart_scan_modes_length1; + _tmp237_ = scanner_set_constrained_string_option (self, _tmp233_, _tmp234_, _tmp235_, _tmp236_, _tmp236__length1, NULL); + if (!_tmp237_) { + g_warning ("scanner.vala:1003: Unable to set Lineart mode, please file a bug"); } break; } @@ -4941,59 +6351,157 @@ static void scanner_do_get_option (Scanner* self) { gray_scan_modes = (_vala_array_free (gray_scan_modes, gray_scan_modes_length1, (GDestroyNotify) g_free), NULL); color_scan_modes = (_vala_array_free (color_scan_modes, color_scan_modes_length1, (GDestroyNotify) g_free), NULL); } else { - if (g_strcmp0 (option->name, "compression") == 0) { - const gchar* _tmp79_ = NULL; - gchar* _tmp80_; - const gchar* _tmp81_ = NULL; - gchar* _tmp82_; - gchar* _tmp83_; - gchar* _tmp84_; - gchar** _tmp85_ = NULL; + SANE_Option_Descriptor* _tmp238_; + const gchar* _tmp239_; + _tmp238_ = option; + _tmp239_ = _tmp238_->name; + if (g_strcmp0 (_tmp239_, "compression") == 0) { + const gchar* _tmp240_ = NULL; + gchar* _tmp241_; + const gchar* _tmp242_ = NULL; + gchar* _tmp243_; + gchar* _tmp244_; + gchar* _tmp245_; + gchar** _tmp246_ = NULL; gchar** disable_compression_names; gint disable_compression_names_length1; gint _disable_compression_names_size_; - gboolean _tmp86_; - _tmp79_ = SANE_I18N ("None"); - _tmp80_ = g_strdup (_tmp79_); - _tmp81_ = SANE_I18N ("none"); - _tmp82_ = g_strdup (_tmp81_); - _tmp83_ = g_strdup ("None"); - _tmp84_ = g_strdup ("none"); - _tmp85_ = g_new0 (gchar*, 4 + 1); - _tmp85_[0] = _tmp80_; - _tmp85_[1] = _tmp82_; - _tmp85_[2] = _tmp83_; - _tmp85_[3] = _tmp84_; - disable_compression_names = _tmp85_; + SANE_Handle _tmp247_; + SANE_Option_Descriptor* _tmp248_; + SANE_Int _tmp249_; + gchar** _tmp250_; + gint _tmp250__length1; + gboolean _tmp251_ = FALSE; + _tmp240_ = SANE_I18N ("None"); + _tmp241_ = g_strdup (_tmp240_); + _tmp242_ = SANE_I18N ("none"); + _tmp243_ = g_strdup (_tmp242_); + _tmp244_ = g_strdup ("None"); + _tmp245_ = g_strdup ("none"); + _tmp246_ = g_new0 (gchar*, 4 + 1); + _tmp246_[0] = _tmp241_; + _tmp246_[1] = _tmp243_; + _tmp246_[2] = _tmp244_; + _tmp246_[3] = _tmp245_; + disable_compression_names = _tmp246_; disable_compression_names_length1 = 4; _disable_compression_names_size_ = disable_compression_names_length1; - _tmp86_ = scanner_set_constrained_string_option (self, self->priv->handle, option, index, disable_compression_names, disable_compression_names_length1, NULL); - if (!_tmp86_) { - g_warning ("scanner.vala:1020: Unable to disable compression, please file a bug"); + _tmp247_ = self->priv->handle; + _tmp248_ = option; + _tmp249_ = index; + _tmp250_ = disable_compression_names; + _tmp250__length1 = disable_compression_names_length1; + _tmp251_ = scanner_set_constrained_string_option (self, _tmp247_, _tmp248_, _tmp249_, _tmp250_, _tmp250__length1, NULL); + if (!_tmp251_) { + g_warning ("scanner.vala:1021: Unable to disable compression, please file a bug"); } disable_compression_names = (_vala_array_free (disable_compression_names, disable_compression_names_length1, (GDestroyNotify) g_free), NULL); } else { - if (g_strcmp0 (option->name, SANE_NAME_SCAN_BR_X) == 0) { - self->priv->br_x_option_index = index; + SANE_Option_Descriptor* _tmp252_; + const gchar* _tmp253_; + const gchar* _tmp254_; + _tmp252_ = option; + _tmp253_ = _tmp252_->name; + _tmp254_ = SANE_NAME_SCAN_BR_X; + if (g_strcmp0 (_tmp253_, _tmp254_) == 0) { + SANE_Int _tmp255_; + _tmp255_ = index; + self->priv->br_x_option_index = _tmp255_; } else { - if (g_strcmp0 (option->name, SANE_NAME_SCAN_BR_Y) == 0) { - self->priv->br_y_option_index = index; + SANE_Option_Descriptor* _tmp256_; + const gchar* _tmp257_; + const gchar* _tmp258_; + _tmp256_ = option; + _tmp257_ = _tmp256_->name; + _tmp258_ = SANE_NAME_SCAN_BR_Y; + if (g_strcmp0 (_tmp257_, _tmp258_) == 0) { + SANE_Int _tmp259_; + _tmp259_ = index; + self->priv->br_y_option_index = _tmp259_; } else { - if (g_strcmp0 (option->name, SANE_NAME_PAGE_WIDTH) == 0) { - if (((gdouble) job->page_width) > 0.0) { - if (option->type == SANE_TYPE_FIXED) { - scanner_set_fixed_option (self, self->priv->handle, option, index, job->page_width / 10.0, NULL); + SANE_Option_Descriptor* _tmp260_; + const gchar* _tmp261_; + const gchar* _tmp262_; + _tmp260_ = option; + _tmp261_ = _tmp260_->name; + _tmp262_ = SANE_NAME_PAGE_WIDTH; + if (g_strcmp0 (_tmp261_, _tmp262_) == 0) { + ScanJob* _tmp263_; + gint _tmp264_; + _tmp263_ = job; + _tmp264_ = _tmp263_->page_width; + if (((gdouble) _tmp264_) > 0.0) { + SANE_Option_Descriptor* _tmp265_; + SANE_Value_Type _tmp266_; + _tmp265_ = option; + _tmp266_ = _tmp265_->type; + if (_tmp266_ == SANE_TYPE_FIXED) { + SANE_Handle _tmp267_; + SANE_Option_Descriptor* _tmp268_; + SANE_Int _tmp269_; + ScanJob* _tmp270_; + gint _tmp271_; + _tmp267_ = self->priv->handle; + _tmp268_ = option; + _tmp269_ = index; + _tmp270_ = job; + _tmp271_ = _tmp270_->page_width; + scanner_set_fixed_option (self, _tmp267_, _tmp268_, _tmp269_, _tmp271_ / 10.0, NULL); } else { - scanner_set_int_option (self, self->priv->handle, option, index, job->page_width / 10, NULL); + SANE_Handle _tmp272_; + SANE_Option_Descriptor* _tmp273_; + SANE_Int _tmp274_; + ScanJob* _tmp275_; + gint _tmp276_; + _tmp272_ = self->priv->handle; + _tmp273_ = option; + _tmp274_ = index; + _tmp275_ = job; + _tmp276_ = _tmp275_->page_width; + scanner_set_int_option (self, _tmp272_, _tmp273_, _tmp274_, _tmp276_ / 10, NULL); } } } else { - if (g_strcmp0 (option->name, SANE_NAME_PAGE_HEIGHT) == 0) { - if (((gdouble) job->page_height) > 0.0) { - if (option->type == SANE_TYPE_FIXED) { - scanner_set_fixed_option (self, self->priv->handle, option, index, job->page_height / 10.0, NULL); + SANE_Option_Descriptor* _tmp277_; + const gchar* _tmp278_; + const gchar* _tmp279_; + _tmp277_ = option; + _tmp278_ = _tmp277_->name; + _tmp279_ = SANE_NAME_PAGE_HEIGHT; + if (g_strcmp0 (_tmp278_, _tmp279_) == 0) { + ScanJob* _tmp280_; + gint _tmp281_; + _tmp280_ = job; + _tmp281_ = _tmp280_->page_height; + if (((gdouble) _tmp281_) > 0.0) { + SANE_Option_Descriptor* _tmp282_; + SANE_Value_Type _tmp283_; + _tmp282_ = option; + _tmp283_ = _tmp282_->type; + if (_tmp283_ == SANE_TYPE_FIXED) { + SANE_Handle _tmp284_; + SANE_Option_Descriptor* _tmp285_; + SANE_Int _tmp286_; + ScanJob* _tmp287_; + gint _tmp288_; + _tmp284_ = self->priv->handle; + _tmp285_ = option; + _tmp286_ = index; + _tmp287_ = job; + _tmp288_ = _tmp287_->page_height; + scanner_set_fixed_option (self, _tmp284_, _tmp285_, _tmp286_, _tmp288_ / 10.0, NULL); } else { - scanner_set_int_option (self, self->priv->handle, option, index, job->page_height / 10, NULL); + SANE_Handle _tmp289_; + SANE_Option_Descriptor* _tmp290_; + SANE_Int _tmp291_; + ScanJob* _tmp292_; + gint _tmp293_; + _tmp289_ = self->priv->handle; + _tmp290_ = option; + _tmp291_ = index; + _tmp292_ = job; + _tmp293_ = _tmp292_->page_height; + scanner_set_int_option (self, _tmp289_, _tmp290_, _tmp291_, _tmp293_ / 10, NULL); } } } @@ -5007,21 +6515,72 @@ static void scanner_do_get_option (Scanner* self) { } } } - if (g_strcmp0 (self->priv->current_device, "test") == 0) { - if (g_strcmp0 (option->name, "hand-scanner") == 0) { - scanner_set_bool_option (self, self->priv->handle, option, index, FALSE, NULL); + _tmp294_ = self->priv->current_device; + if (g_strcmp0 (_tmp294_, "test") == 0) { + SANE_Option_Descriptor* _tmp295_; + const gchar* _tmp296_; + _tmp295_ = option; + _tmp296_ = _tmp295_->name; + if (g_strcmp0 (_tmp296_, "hand-scanner") == 0) { + SANE_Handle _tmp297_; + SANE_Option_Descriptor* _tmp298_; + SANE_Int _tmp299_; + _tmp297_ = self->priv->handle; + _tmp298_ = option; + _tmp299_ = index; + scanner_set_bool_option (self, _tmp297_, _tmp298_, _tmp299_, FALSE, NULL); } else { - if (g_strcmp0 (option->name, "three-pass") == 0) { - scanner_set_bool_option (self, self->priv->handle, option, index, FALSE, NULL); + SANE_Option_Descriptor* _tmp300_; + const gchar* _tmp301_; + _tmp300_ = option; + _tmp301_ = _tmp300_->name; + if (g_strcmp0 (_tmp301_, "three-pass") == 0) { + SANE_Handle _tmp302_; + SANE_Option_Descriptor* _tmp303_; + SANE_Int _tmp304_; + _tmp302_ = self->priv->handle; + _tmp303_ = option; + _tmp304_ = index; + scanner_set_bool_option (self, _tmp302_, _tmp303_, _tmp304_, FALSE, NULL); } else { - if (g_strcmp0 (option->name, "test-picture") == 0) { - scanner_set_string_option (self, self->priv->handle, option, index, "Color pattern", NULL); + SANE_Option_Descriptor* _tmp305_; + const gchar* _tmp306_; + _tmp305_ = option; + _tmp306_ = _tmp305_->name; + if (g_strcmp0 (_tmp306_, "test-picture") == 0) { + SANE_Handle _tmp307_; + SANE_Option_Descriptor* _tmp308_; + SANE_Int _tmp309_; + _tmp307_ = self->priv->handle; + _tmp308_ = option; + _tmp309_ = index; + scanner_set_string_option (self, _tmp307_, _tmp308_, _tmp309_, "Color pattern", NULL); } else { - if (g_strcmp0 (option->name, "read-delay") == 0) { - scanner_set_bool_option (self, self->priv->handle, option, index, TRUE, NULL); + SANE_Option_Descriptor* _tmp310_; + const gchar* _tmp311_; + _tmp310_ = option; + _tmp311_ = _tmp310_->name; + if (g_strcmp0 (_tmp311_, "read-delay") == 0) { + SANE_Handle _tmp312_; + SANE_Option_Descriptor* _tmp313_; + SANE_Int _tmp314_; + _tmp312_ = self->priv->handle; + _tmp313_ = option; + _tmp314_ = index; + scanner_set_bool_option (self, _tmp312_, _tmp313_, _tmp314_, TRUE, NULL); } else { - if (g_strcmp0 (option->name, "read-delay-duration") == 0) { - scanner_set_int_option (self, self->priv->handle, option, index, 200000, NULL); + SANE_Option_Descriptor* _tmp315_; + const gchar* _tmp316_; + _tmp315_ = option; + _tmp316_ = _tmp315_->name; + if (g_strcmp0 (_tmp316_, "read-delay-duration") == 0) { + SANE_Handle _tmp317_; + SANE_Option_Descriptor* _tmp318_; + SANE_Int _tmp319_; + _tmp317_ = self->priv->handle; + _tmp318_ = option; + _tmp319_ = index; + scanner_set_int_option (self, _tmp317_, _tmp318_, _tmp319_, 200000, NULL); } } } @@ -5033,53 +6592,73 @@ static void scanner_do_get_option (Scanner* self) { static void scanner_do_complete_document (Scanner* self) { - NotifyDocumentDone* _tmp0_ = NULL; - NotifyDocumentDone* _tmp1_; + GList* _tmp0_; + GList* _tmp1_; + NotifyDocumentDone* _tmp2_; + NotifyDocumentDone* _tmp3_; g_return_if_fail (self != NULL); - self->priv->job_queue = g_list_remove_link (self->priv->job_queue, self->priv->job_queue); + _tmp0_ = self->priv->job_queue; + self->priv->job_queue = g_list_remove_link (self->priv->job_queue, _tmp0_); self->priv->state = SCAN_STATE_IDLE; - if (self->priv->job_queue != NULL) { + _tmp1_ = self->priv->job_queue; + if (_tmp1_ != NULL) { self->priv->state = SCAN_STATE_OPEN; return; } - _tmp0_ = notify_document_done_new (); - _tmp1_ = _tmp0_; - scanner_notify (self, (Notify*) _tmp1_); - _notify_unref0 (_tmp1_); + _tmp2_ = notify_document_done_new (); + _tmp3_ = _tmp2_; + scanner_notify (self, (Notify*) _tmp3_); + _notify_unref0 (_tmp3_); scanner_set_scanning (self, FALSE); } static void scanner_do_start (Scanner* self) { SANE_Status status = 0; - NotifyExpectPage* _tmp0_ = NULL; + NotifyExpectPage* _tmp0_; NotifyExpectPage* _tmp1_; - SANE_Status _tmp2_; - gchar* _tmp3_ = NULL; - gchar* _tmp4_; + SANE_Handle _tmp2_; + SANE_Status _tmp3_ = 0; + gint _tmp4_; + gint _tmp5_; + SANE_Status _tmp6_; + gchar* _tmp7_ = NULL; + gchar* _tmp8_; + SANE_Status _tmp9_; g_return_if_fail (self != NULL); _tmp0_ = notify_expect_page_new (); _tmp1_ = _tmp0_; scanner_notify (self, (Notify*) _tmp1_); _notify_unref0 (_tmp1_); - _tmp2_ = sane_start (self->priv->handle); - status = _tmp2_; - _tmp3_ = sane_status_to_string (status); - _tmp4_ = _tmp3_; - g_debug ("scanner.vala:1090: sane_start (page=%d, pass=%d) -> %s", self->priv->page_number, self->priv->pass_number, _tmp4_); - _g_free0 (_tmp4_); - if (status == SANE_STATUS_GOOD) { + _tmp2_ = self->priv->handle; + _tmp3_ = sane_start (_tmp2_); + status = _tmp3_; + _tmp4_ = self->priv->page_number; + _tmp5_ = self->priv->pass_number; + _tmp6_ = status; + _tmp7_ = sane_status_to_string (_tmp6_); + _tmp8_ = _tmp7_; + g_debug ("scanner.vala:1091: sane_start (page=%d, pass=%d) -> %s", _tmp4_, _tmp5_, _tmp8_); + _g_free0 (_tmp8_); + _tmp9_ = status; + if (_tmp9_ == SANE_STATUS_GOOD) { self->priv->state = SCAN_STATE_GET_PARAMETERS; } else { - if (status == SANE_STATUS_NO_DOCS) { + SANE_Status _tmp10_; + _tmp10_ = status; + if (_tmp10_ == SANE_STATUS_NO_DOCS) { scanner_do_complete_document (self); } else { - const gchar* _tmp5_ = NULL; - const gchar* _tmp6_ = NULL; - _tmp5_ = sane_strstatus (status); - g_warning ("scanner.vala:1097: Unable to start device: %s", _tmp5_); - _tmp6_ = _ ("Unable to start scan"); - scanner_fail_scan (self, (gint) status, _tmp6_); + SANE_Status _tmp11_; + const gchar* _tmp12_ = NULL; + SANE_Status _tmp13_; + const gchar* _tmp14_ = NULL; + _tmp11_ = status; + _tmp12_ = sane_strstatus (_tmp11_); + g_warning ("scanner.vala:1098: Unable to start device: %s", _tmp12_); + _tmp13_ = status; + _tmp14_ = _ ("Unable to start scan"); + scanner_fail_scan (self, (gint) _tmp13_, _tmp14_); } } } @@ -5087,149 +6666,271 @@ static void scanner_do_start (Scanner* self) { static gchar* sane_frame_to_string (SANE_Frame frame) { gchar* result = NULL; - switch (frame) { + SANE_Frame _tmp0_; + _tmp0_ = frame; + switch (_tmp0_) { case SANE_FRAME_GRAY: - { - gchar* _tmp0_; - _tmp0_ = g_strdup ("SANE_FRAME_GRAY"); - result = _tmp0_; - return result; - } - case SANE_FRAME_RGB: { gchar* _tmp1_; - _tmp1_ = g_strdup ("SANE_FRAME_RGB"); + _tmp1_ = g_strdup ("SANE_FRAME_GRAY"); result = _tmp1_; return result; } - case SANE_FRAME_RED: + case SANE_FRAME_RGB: { gchar* _tmp2_; - _tmp2_ = g_strdup ("SANE_FRAME_RED"); + _tmp2_ = g_strdup ("SANE_FRAME_RGB"); result = _tmp2_; return result; } - case SANE_FRAME_GREEN: + case SANE_FRAME_RED: { gchar* _tmp3_; - _tmp3_ = g_strdup ("SANE_FRAME_GREEN"); + _tmp3_ = g_strdup ("SANE_FRAME_RED"); result = _tmp3_; return result; } - case SANE_FRAME_BLUE: + case SANE_FRAME_GREEN: { gchar* _tmp4_; - _tmp4_ = g_strdup ("SANE_FRAME_BLUE"); + _tmp4_ = g_strdup ("SANE_FRAME_GREEN"); result = _tmp4_; return result; } - default: + case SANE_FRAME_BLUE: { - gchar* _tmp5_ = NULL; - _tmp5_ = g_strdup_printf ("SANE_FRAME(%d)", (gint) frame); + gchar* _tmp5_; + _tmp5_ = g_strdup ("SANE_FRAME_BLUE"); result = _tmp5_; return result; } + default: + { + SANE_Frame _tmp6_; + gchar* _tmp7_ = NULL; + _tmp6_ = frame; + _tmp7_ = g_strdup_printf ("SANE_FRAME(%d)", (gint) _tmp6_); + result = _tmp7_; + return result; + } } } static void scanner_do_get_parameters (Scanner* self) { - SANE_Parameters _tmp0_ = {0}; - SANE_Status _tmp1_; + SANE_Handle _tmp0_; + SANE_Parameters _tmp1_ = {0}; + SANE_Status _tmp2_ = 0; SANE_Status status; - gchar* _tmp2_ = NULL; - gchar* _tmp3_; - ScanJob* _tmp6_; + SANE_Status _tmp3_; + gchar* _tmp4_ = NULL; + gchar* _tmp5_; + SANE_Status _tmp6_; + GList* _tmp11_; + gconstpointer _tmp12_; + ScanJob* _tmp13_; ScanJob* job; - const gchar* _tmp7_ = NULL; - gchar* _tmp8_ = NULL; - gchar* _tmp9_; - ScanPageInfo* _tmp10_ = NULL; + const gchar* _tmp14_ = NULL; + SANE_Parameters _tmp15_; + gboolean _tmp16_; + SANE_Parameters _tmp17_; + SANE_Frame _tmp18_; + gchar* _tmp19_ = NULL; + gchar* _tmp20_; + const gchar* _tmp21_; + SANE_Parameters _tmp22_; + gint _tmp23_; + SANE_Parameters _tmp24_; + gint _tmp25_; + SANE_Parameters _tmp26_; + gint _tmp27_; + SANE_Parameters _tmp28_; + gint _tmp29_; + ScanPageInfo* _tmp30_; ScanPageInfo* info; - gboolean _tmp11_ = FALSE; - gboolean _tmp12_ = FALSE; - gboolean _tmp13_ = FALSE; - gint _tmp14_ = 0; - gchar* _tmp15_; + ScanPageInfo* _tmp31_; + SANE_Parameters _tmp32_; + gint _tmp33_; + ScanPageInfo* _tmp34_; + SANE_Parameters _tmp35_; + gint _tmp36_; + ScanPageInfo* _tmp37_; + SANE_Parameters _tmp38_; + gint _tmp39_; + gboolean _tmp40_ = FALSE; + gboolean _tmp41_ = FALSE; + gboolean _tmp42_ = FALSE; + SANE_Parameters _tmp43_; + gint _tmp44_; + gboolean _tmp47_; + gboolean _tmp50_; + gboolean _tmp53_; + gint _tmp57_ = 0; + SANE_Parameters _tmp58_; + SANE_Frame _tmp59_; + ScanPageInfo* _tmp60_; + gint _tmp61_; + ScanPageInfo* _tmp62_; + ScanJob* _tmp63_; + gdouble _tmp64_; + ScanPageInfo* _tmp65_; + const gchar* _tmp66_; + gchar* _tmp67_; + gint _tmp68_; + gint _tmp69_; + SANE_Parameters _tmp74_; + gint _tmp75_; gint buffer_size; - guchar* _tmp18_ = NULL; + gint _tmp76_; + guchar* _tmp77_ = NULL; g_return_if_fail (self != NULL); - _tmp1_ = sane_get_parameters (self->priv->handle, &_tmp0_); - self->priv->parameters = _tmp0_; - status = _tmp1_; - _tmp2_ = sane_status_to_string (status); - _tmp3_ = _tmp2_; - g_debug ("scanner.vala:1107: sane_get_parameters () -> %s", _tmp3_); - _g_free0 (_tmp3_); - if (status != SANE_STATUS_GOOD) { - const gchar* _tmp4_ = NULL; - const gchar* _tmp5_ = NULL; - _tmp4_ = sane_strstatus (status); - g_warning ("scanner.vala:1110: Unable to get device parameters: %s", _tmp4_); - _tmp5_ = _ ("Error communicating with scanner"); - scanner_fail_scan (self, (gint) status, _tmp5_); + _tmp0_ = self->priv->handle; + _tmp2_ = sane_get_parameters (_tmp0_, &_tmp1_); + self->priv->parameters = _tmp1_; + status = _tmp2_; + _tmp3_ = status; + _tmp4_ = sane_status_to_string (_tmp3_); + _tmp5_ = _tmp4_; + g_debug ("scanner.vala:1108: sane_get_parameters () -> %s", _tmp5_); + _g_free0 (_tmp5_); + _tmp6_ = status; + if (_tmp6_ != SANE_STATUS_GOOD) { + SANE_Status _tmp7_; + const gchar* _tmp8_ = NULL; + SANE_Status _tmp9_; + const gchar* _tmp10_ = NULL; + _tmp7_ = status; + _tmp8_ = sane_strstatus (_tmp7_); + g_warning ("scanner.vala:1111: Unable to get device parameters: %s", _tmp8_); + _tmp9_ = status; + _tmp10_ = _ ("Error communicating with scanner"); + scanner_fail_scan (self, (gint) _tmp9_, _tmp10_); return; } - _tmp6_ = _scan_job_ref0 (SCAN_JOB ((ScanJob*) self->priv->job_queue->data)); - job = _tmp6_; - if (self->priv->parameters.last_frame) { - _tmp7_ = "SANE_TRUE"; + _tmp11_ = self->priv->job_queue; + _tmp12_ = _tmp11_->data; + _tmp13_ = _scan_job_ref0 (SCAN_JOB ((ScanJob*) _tmp12_)); + job = _tmp13_; + _tmp15_ = self->priv->parameters; + _tmp16_ = _tmp15_.last_frame; + if (_tmp16_) { + _tmp14_ = "SANE_TRUE"; } else { - _tmp7_ = "SANE_FALSE"; - } - _tmp8_ = sane_frame_to_string (self->priv->parameters.format); - _tmp9_ = _tmp8_; - g_debug ("scanner.vala:1119: Parameters: format=%s last_frame=%s bytes_per_line=" \ -"%d pixels_per_line=%d lines=%d depth=%d", _tmp9_, _tmp7_, self->priv->parameters.bytes_per_line, self->priv->parameters.pixels_per_line, self->priv->parameters.lines, self->priv->parameters.depth); - _g_free0 (_tmp9_); - _tmp10_ = scan_page_info_new (); - info = _tmp10_; - info->width = self->priv->parameters.pixels_per_line; - info->height = self->priv->parameters.lines; - info->depth = self->priv->parameters.depth; - if (self->priv->parameters.depth == 8) { - _tmp13_ = self->priv->parameters.format == SANE_FRAME_GRAY; + _tmp14_ = "SANE_FALSE"; + } + _tmp17_ = self->priv->parameters; + _tmp18_ = _tmp17_.format; + _tmp19_ = sane_frame_to_string (_tmp18_); + _tmp20_ = _tmp19_; + _tmp21_ = _tmp14_; + _tmp22_ = self->priv->parameters; + _tmp23_ = _tmp22_.bytes_per_line; + _tmp24_ = self->priv->parameters; + _tmp25_ = _tmp24_.pixels_per_line; + _tmp26_ = self->priv->parameters; + _tmp27_ = _tmp26_.lines; + _tmp28_ = self->priv->parameters; + _tmp29_ = _tmp28_.depth; + g_debug ("scanner.vala:1120: Parameters: format=%s last_frame=%s bytes_per_line=" \ +"%d pixels_per_line=%d lines=%d depth=%d", _tmp20_, _tmp21_, _tmp23_, _tmp25_, _tmp27_, _tmp29_); + _g_free0 (_tmp20_); + _tmp30_ = scan_page_info_new (); + info = _tmp30_; + _tmp31_ = info; + _tmp32_ = self->priv->parameters; + _tmp33_ = _tmp32_.pixels_per_line; + _tmp31_->width = _tmp33_; + _tmp34_ = info; + _tmp35_ = self->priv->parameters; + _tmp36_ = _tmp35_.lines; + _tmp34_->height = _tmp36_; + _tmp37_ = info; + _tmp38_ = self->priv->parameters; + _tmp39_ = _tmp38_.depth; + _tmp37_->depth = _tmp39_; + _tmp43_ = self->priv->parameters; + _tmp44_ = _tmp43_.depth; + if (_tmp44_ == 8) { + SANE_Parameters _tmp45_; + SANE_Frame _tmp46_; + _tmp45_ = self->priv->parameters; + _tmp46_ = _tmp45_.format; + _tmp42_ = _tmp46_ == SANE_FRAME_GRAY; } else { - _tmp13_ = FALSE; - } - if (_tmp13_) { - _tmp12_ = job->depth == 2; + _tmp42_ = FALSE; + } + _tmp47_ = _tmp42_; + if (_tmp47_) { + ScanJob* _tmp48_; + gint _tmp49_; + _tmp48_ = job; + _tmp49_ = _tmp48_->depth; + _tmp41_ = _tmp49_ == 2; } else { - _tmp12_ = FALSE; - } - if (_tmp12_) { - _tmp11_ = job->scan_mode == SCAN_MODE_GRAY; + _tmp41_ = FALSE; + } + _tmp50_ = _tmp41_; + if (_tmp50_) { + ScanJob* _tmp51_; + ScanMode _tmp52_; + _tmp51_ = job; + _tmp52_ = _tmp51_->scan_mode; + _tmp40_ = _tmp52_ == SCAN_MODE_GRAY; } else { - _tmp11_ = FALSE; - } - if (_tmp11_) { - info->depth = job->depth; - } - if (self->priv->parameters.format == SANE_FRAME_GRAY) { - _tmp14_ = 1; + _tmp40_ = FALSE; + } + _tmp53_ = _tmp40_; + if (_tmp53_) { + ScanPageInfo* _tmp54_; + ScanJob* _tmp55_; + gint _tmp56_; + _tmp54_ = info; + _tmp55_ = job; + _tmp56_ = _tmp55_->depth; + _tmp54_->depth = _tmp56_; + } + _tmp58_ = self->priv->parameters; + _tmp59_ = _tmp58_.format; + if (_tmp59_ == SANE_FRAME_GRAY) { + _tmp57_ = 1; } else { - _tmp14_ = 3; - } - info->n_channels = _tmp14_; - info->dpi = job->dpi; - _tmp15_ = g_strdup (self->priv->current_device); - _g_free0 (info->device); - info->device = _tmp15_; - if (self->priv->page_number != self->priv->notified_page) { - NotifyGotPageInfo* _tmp16_ = NULL; - NotifyGotPageInfo* _tmp17_; - _tmp16_ = notify_got_page_info_new (info); - _tmp17_ = _tmp16_; - scanner_notify (self, (Notify*) _tmp17_); - _notify_unref0 (_tmp17_); - self->priv->notified_page = self->priv->page_number; - } - buffer_size = self->priv->parameters.bytes_per_line + 1; - _tmp18_ = g_new0 (guchar, buffer_size); + _tmp57_ = 3; + } + _tmp60_ = info; + _tmp61_ = _tmp57_; + _tmp60_->n_channels = _tmp61_; + _tmp62_ = info; + _tmp63_ = job; + _tmp64_ = _tmp63_->dpi; + _tmp62_->dpi = _tmp64_; + _tmp65_ = info; + _tmp66_ = self->priv->current_device; + _tmp67_ = g_strdup (_tmp66_); + _g_free0 (_tmp65_->device); + _tmp65_->device = _tmp67_; + _tmp68_ = self->priv->page_number; + _tmp69_ = self->priv->notified_page; + if (_tmp68_ != _tmp69_) { + ScanPageInfo* _tmp70_; + NotifyGotPageInfo* _tmp71_; + NotifyGotPageInfo* _tmp72_; + gint _tmp73_; + _tmp70_ = info; + _tmp71_ = notify_got_page_info_new (_tmp70_); + _tmp72_ = _tmp71_; + scanner_notify (self, (Notify*) _tmp72_); + _notify_unref0 (_tmp72_); + _tmp73_ = self->priv->page_number; + self->priv->notified_page = _tmp73_; + } + _tmp74_ = self->priv->parameters; + _tmp75_ = _tmp74_.bytes_per_line; + buffer_size = _tmp75_ + 1; + _tmp76_ = buffer_size; + _tmp77_ = g_new0 (guchar, _tmp76_); self->priv->buffer = (g_free (self->priv->buffer), NULL); - self->priv->buffer = _tmp18_; - self->priv->buffer_length1 = buffer_size; + self->priv->buffer = _tmp77_; + self->priv->buffer_length1 = _tmp76_; self->priv->_buffer_size_ = self->priv->buffer_length1; self->priv->n_used = 0; self->priv->line_count = 0; @@ -5241,210 +6942,446 @@ static void scanner_do_get_parameters (Scanner* self) { static void scanner_do_complete_page (Scanner* self) { - NotifyPageDone* _tmp0_ = NULL; + NotifyPageDone* _tmp0_; NotifyPageDone* _tmp1_; - ScanJob* _tmp2_; + GList* _tmp2_; + gconstpointer _tmp3_; + ScanJob* _tmp4_; ScanJob* job; + SANE_Parameters _tmp5_; + gboolean _tmp6_; + ScanJob* _tmp8_; + ScanType _tmp9_; + SANE_Handle _tmp13_; g_return_if_fail (self != NULL); _tmp0_ = notify_page_done_new (); _tmp1_ = _tmp0_; scanner_notify (self, (Notify*) _tmp1_); _notify_unref0 (_tmp1_); - _tmp2_ = _scan_job_ref0 (SCAN_JOB ((ScanJob*) self->priv->job_queue->data)); - job = _tmp2_; - if (!self->priv->parameters.last_frame) { - self->priv->pass_number++; + _tmp2_ = self->priv->job_queue; + _tmp3_ = _tmp2_->data; + _tmp4_ = _scan_job_ref0 (SCAN_JOB ((ScanJob*) _tmp3_)); + job = _tmp4_; + _tmp5_ = self->priv->parameters; + _tmp6_ = _tmp5_.last_frame; + if (!_tmp6_) { + gint _tmp7_; + _tmp7_ = self->priv->pass_number; + self->priv->pass_number = _tmp7_ + 1; self->priv->state = SCAN_STATE_START; _scan_job_unref0 (job); return; } - if (job->type != SCAN_TYPE_SINGLE) { - NotifyPageDone* _tmp3_ = NULL; - NotifyPageDone* _tmp4_; - self->priv->page_number++; + _tmp8_ = job; + _tmp9_ = _tmp8_->type; + if (_tmp9_ != SCAN_TYPE_SINGLE) { + gint _tmp10_; + NotifyPageDone* _tmp11_; + NotifyPageDone* _tmp12_; + _tmp10_ = self->priv->page_number; + self->priv->page_number = _tmp10_ + 1; self->priv->pass_number = 0; - _tmp3_ = notify_page_done_new (); - _tmp4_ = _tmp3_; - scanner_notify (self, (Notify*) _tmp4_); - _notify_unref0 (_tmp4_); + _tmp11_ = notify_page_done_new (); + _tmp12_ = _tmp11_; + scanner_notify (self, (Notify*) _tmp12_); + _notify_unref0 (_tmp12_); self->priv->state = SCAN_STATE_START; _scan_job_unref0 (job); return; } - sane_cancel (self->priv->handle); - g_debug ("scanner.vala:1179: sane_cancel ()"); + _tmp13_ = self->priv->handle; + sane_cancel (_tmp13_); + g_debug ("scanner.vala:1180: sane_cancel ()"); scanner_do_complete_document (self); _scan_job_unref0 (job); } static void scanner_do_read (Scanner* self) { - ScanJob* _tmp0_; + GList* _tmp0_; + gconstpointer _tmp1_; + ScanJob* _tmp2_; ScanJob* job; + guchar* _tmp3_; + gint _tmp3__length1; + gint _tmp4_; gint n_to_read; - SANE_Int n_read; + SANE_Int n_read = {0}; + guchar* _tmp5_; + gint _tmp5__length1; guchar* b; - SANE_Int _tmp1_; - SANE_Status _tmp2_; + SANE_Handle _tmp6_; + guchar* _tmp7_; + gint _tmp8_; + gint _tmp9_; + SANE_Int _tmp10_ = {0}; + SANE_Status _tmp11_ = 0; SANE_Status status; - gchar* _tmp3_ = NULL; - gchar* _tmp4_; + gint _tmp12_; + SANE_Status _tmp13_; + gchar* _tmp14_ = NULL; + gchar* _tmp15_; + SANE_Int _tmp16_; + SANE_Status _tmp17_; + SANE_Status _tmp31_; gboolean full_read; - gboolean _tmp8_ = FALSE; + gboolean _tmp36_ = FALSE; + gint _tmp37_; + gboolean _tmp40_; + gint _tmp41_; + SANE_Int _tmp42_; + gint _tmp43_; + SANE_Parameters _tmp44_; + gint _tmp45_; g_return_if_fail (self != NULL); - _tmp0_ = _scan_job_ref0 (SCAN_JOB ((ScanJob*) self->priv->job_queue->data)); - job = _tmp0_; - n_to_read = self->priv->buffer_length1 - self->priv->n_used; - b = (guchar*) self->priv->buffer; - _tmp2_ = sane_read (self->priv->handle, (guint8*) (b + self->priv->n_used), (SANE_Int) n_to_read, &_tmp1_); - n_read = _tmp1_; - status = _tmp2_; - _tmp3_ = sane_status_to_string (status); - _tmp4_ = _tmp3_; - g_debug ("scanner.vala:1194: sane_read (%d) -> (%s, %d)", n_to_read, _tmp4_, (gint) n_read); - _g_free0 (_tmp4_); - if (status == SANE_STATUS_EOF) { - gboolean _tmp5_ = FALSE; - if (self->priv->parameters.lines > 0) { - _tmp5_ = self->priv->line_count != self->priv->parameters.lines; + _tmp0_ = self->priv->job_queue; + _tmp1_ = _tmp0_->data; + _tmp2_ = _scan_job_ref0 (SCAN_JOB ((ScanJob*) _tmp1_)); + job = _tmp2_; + _tmp3_ = self->priv->buffer; + _tmp3__length1 = self->priv->buffer_length1; + _tmp4_ = self->priv->n_used; + n_to_read = _tmp3__length1 - _tmp4_; + _tmp5_ = self->priv->buffer; + _tmp5__length1 = self->priv->buffer_length1; + b = (guchar*) _tmp5_; + _tmp6_ = self->priv->handle; + _tmp7_ = b; + _tmp8_ = self->priv->n_used; + _tmp9_ = n_to_read; + _tmp11_ = sane_read (_tmp6_, (guint8*) (_tmp7_ + _tmp8_), (SANE_Int) _tmp9_, &_tmp10_); + n_read = _tmp10_; + status = _tmp11_; + _tmp12_ = n_to_read; + _tmp13_ = status; + _tmp14_ = sane_status_to_string (_tmp13_); + _tmp15_ = _tmp14_; + _tmp16_ = n_read; + g_debug ("scanner.vala:1195: sane_read (%d) -> (%s, %d)", _tmp12_, _tmp15_, (gint) _tmp16_); + _g_free0 (_tmp15_); + _tmp17_ = status; + if (_tmp17_ == SANE_STATUS_EOF) { + gboolean _tmp18_ = FALSE; + SANE_Parameters _tmp19_; + gint _tmp20_; + gboolean _tmp24_; + gint _tmp29_; + _tmp19_ = self->priv->parameters; + _tmp20_ = _tmp19_.lines; + if (_tmp20_ > 0) { + gint _tmp21_; + SANE_Parameters _tmp22_; + gint _tmp23_; + _tmp21_ = self->priv->line_count; + _tmp22_ = self->priv->parameters; + _tmp23_ = _tmp22_.lines; + _tmp18_ = _tmp21_ != _tmp23_; } else { - _tmp5_ = FALSE; + _tmp18_ = FALSE; } - if (_tmp5_) { - g_warning ("scanner.vala:1200: Scan completed with %d lines, expected %d lines", self->priv->parameters.lines, self->priv->parameters.lines); + _tmp24_ = _tmp18_; + if (_tmp24_) { + SANE_Parameters _tmp25_; + gint _tmp26_; + SANE_Parameters _tmp27_; + gint _tmp28_; + _tmp25_ = self->priv->parameters; + _tmp26_ = _tmp25_.lines; + _tmp27_ = self->priv->parameters; + _tmp28_ = _tmp27_.lines; + g_warning ("scanner.vala:1201: Scan completed with %d lines, expected %d lines", _tmp26_, _tmp28_); } - if (self->priv->n_used > 0) { - g_warning ("scanner.vala:1202: Scan complete with %d bytes of unused data", self->priv->n_used); + _tmp29_ = self->priv->n_used; + if (_tmp29_ > 0) { + gint _tmp30_; + _tmp30_ = self->priv->n_used; + g_warning ("scanner.vala:1203: Scan complete with %d bytes of unused data", _tmp30_); } scanner_do_complete_page (self); _scan_job_unref0 (job); return; } - if (status != SANE_STATUS_GOOD) { - const gchar* _tmp6_ = NULL; - const gchar* _tmp7_ = NULL; - _tmp6_ = sane_strstatus (status); - g_warning ("scanner.vala:1210: Unable to read frame from device: %s", _tmp6_); - _tmp7_ = _ ("Error communicating with scanner"); - scanner_fail_scan (self, (gint) status, _tmp7_); + _tmp31_ = status; + if (_tmp31_ != SANE_STATUS_GOOD) { + SANE_Status _tmp32_; + const gchar* _tmp33_ = NULL; + SANE_Status _tmp34_; + const gchar* _tmp35_ = NULL; + _tmp32_ = status; + _tmp33_ = sane_strstatus (_tmp32_); + g_warning ("scanner.vala:1211: Unable to read frame from device: %s", _tmp33_); + _tmp34_ = status; + _tmp35_ = _ ("Error communicating with scanner"); + scanner_fail_scan (self, (gint) _tmp34_, _tmp35_); _scan_job_unref0 (job); return; } full_read = FALSE; - if (self->priv->n_used == 0) { - _tmp8_ = ((gint) n_read) == self->priv->buffer_length1; + _tmp37_ = self->priv->n_used; + if (_tmp37_ == 0) { + SANE_Int _tmp38_; + guchar* _tmp39_; + gint _tmp39__length1; + _tmp38_ = n_read; + _tmp39_ = self->priv->buffer; + _tmp39__length1 = self->priv->buffer_length1; + _tmp36_ = _tmp38_ == ((SANE_Int) _tmp39__length1); } else { - _tmp8_ = FALSE; + _tmp36_ = FALSE; } - if (_tmp8_) { + _tmp40_ = _tmp36_; + if (_tmp40_) { full_read = TRUE; } - self->priv->n_used = self->priv->n_used + n_read; - if (self->priv->n_used >= self->priv->parameters.bytes_per_line) { - ScanLine* _tmp9_ = NULL; + _tmp41_ = self->priv->n_used; + _tmp42_ = n_read; + self->priv->n_used = _tmp41_ + ((gint) _tmp42_); + _tmp43_ = self->priv->n_used; + _tmp44_ = self->priv->parameters; + _tmp45_ = _tmp44_.bytes_per_line; + if (_tmp43_ >= _tmp45_) { + ScanLine* _tmp46_; ScanLine* line; - guchar* _tmp10_; - gint _tmp11_; + SANE_Parameters _tmp47_; + SANE_Frame _tmp48_; + ScanLine* _tmp54_; + SANE_Parameters _tmp55_; + gint _tmp56_; + ScanLine* _tmp57_; + SANE_Parameters _tmp58_; + gint _tmp59_; + ScanLine* _tmp60_; + guchar* _tmp61_; + gint _tmp61__length1; + ScanLine* _tmp62_; + SANE_Parameters _tmp63_; + gint _tmp64_; + ScanLine* _tmp65_; + gint _tmp66_; + ScanLine* _tmp67_; + gint _tmp68_; + ScanLine* _tmp69_; + gint _tmp70_; + gint _tmp71_; + ScanLine* _tmp72_; + gint _tmp73_; + guchar* _tmp74_; + gint _tmp74__length1; gint buffer_size; - guchar* _tmp12_ = NULL; + gboolean _tmp75_; + gint _tmp79_; + guchar* _tmp80_ = NULL; + gint _tmp81_; + ScanLine* _tmp82_; + gint _tmp83_; + ScanLine* _tmp84_; + gint _tmp85_; gint n_remaining; - gboolean _tmp14_ = FALSE; - gboolean _tmp15_ = FALSE; - gboolean _tmp16_ = FALSE; - NotifyGotLine* _tmp19_ = NULL; - NotifyGotLine* _tmp20_; - _tmp9_ = scan_line_new (); - line = _tmp9_; - switch (self->priv->parameters.format) { + gboolean _tmp103_ = FALSE; + gboolean _tmp104_ = FALSE; + gboolean _tmp105_ = FALSE; + SANE_Parameters _tmp106_; + gint _tmp107_; + gboolean _tmp110_; + gboolean _tmp113_; + gboolean _tmp116_; + ScanLine* _tmp161_; + NotifyGotLine* _tmp162_; + NotifyGotLine* _tmp163_; + _tmp46_ = scan_line_new (); + line = _tmp46_; + _tmp47_ = self->priv->parameters; + _tmp48_ = _tmp47_.format; + switch (_tmp48_) { case SANE_FRAME_GRAY: { - line->channel = 0; + ScanLine* _tmp49_; + _tmp49_ = line; + _tmp49_->channel = 0; break; } case SANE_FRAME_RGB: { - line->channel = -1; + ScanLine* _tmp50_; + _tmp50_ = line; + _tmp50_->channel = -1; break; } case SANE_FRAME_RED: { - line->channel = 0; + ScanLine* _tmp51_; + _tmp51_ = line; + _tmp51_->channel = 0; break; } case SANE_FRAME_GREEN: { - line->channel = 1; + ScanLine* _tmp52_; + _tmp52_ = line; + _tmp52_->channel = 1; break; } case SANE_FRAME_BLUE: { - line->channel = 2; + ScanLine* _tmp53_; + _tmp53_ = line; + _tmp53_->channel = 2; break; } default: break; } - line->width = self->priv->parameters.pixels_per_line; - line->depth = self->priv->parameters.depth; - _tmp10_ = self->priv->buffer; - _tmp11_ = self->priv->buffer_length1; + _tmp54_ = line; + _tmp55_ = self->priv->parameters; + _tmp56_ = _tmp55_.pixels_per_line; + _tmp54_->width = _tmp56_; + _tmp57_ = line; + _tmp58_ = self->priv->parameters; + _tmp59_ = _tmp58_.depth; + _tmp57_->depth = _tmp59_; + _tmp60_ = line; + _tmp61_ = self->priv->buffer; + _tmp61__length1 = self->priv->buffer_length1; self->priv->buffer = NULL; - line->data = (g_free (line->data), NULL); - line->data = _tmp10_; - line->data_length1 = _tmp11_; - line->data_length = self->priv->parameters.bytes_per_line; - line->number = self->priv->line_count; - line->n_lines = self->priv->n_used / line->data_length; - self->priv->line_count = self->priv->line_count + line->n_lines; - buffer_size = self->priv->buffer_length1; - if (full_read) { - buffer_size = buffer_size + self->priv->parameters.bytes_per_line; + _tmp60_->data = (g_free (_tmp60_->data), NULL); + _tmp60_->data = _tmp61_; + _tmp60_->data_length1 = _tmp61__length1; + _tmp62_ = line; + _tmp63_ = self->priv->parameters; + _tmp64_ = _tmp63_.bytes_per_line; + _tmp62_->data_length = _tmp64_; + _tmp65_ = line; + _tmp66_ = self->priv->line_count; + _tmp65_->number = _tmp66_; + _tmp67_ = line; + _tmp68_ = self->priv->n_used; + _tmp69_ = line; + _tmp70_ = _tmp69_->data_length; + _tmp67_->n_lines = _tmp68_ / _tmp70_; + _tmp71_ = self->priv->line_count; + _tmp72_ = line; + _tmp73_ = _tmp72_->n_lines; + self->priv->line_count = _tmp71_ + _tmp73_; + _tmp74_ = self->priv->buffer; + _tmp74__length1 = self->priv->buffer_length1; + buffer_size = _tmp74__length1; + _tmp75_ = full_read; + if (_tmp75_) { + gint _tmp76_; + SANE_Parameters _tmp77_; + gint _tmp78_; + _tmp76_ = buffer_size; + _tmp77_ = self->priv->parameters; + _tmp78_ = _tmp77_.bytes_per_line; + buffer_size = _tmp76_ + _tmp78_; } - _tmp12_ = g_new0 (guchar, buffer_size); + _tmp79_ = buffer_size; + _tmp80_ = g_new0 (guchar, _tmp79_); self->priv->buffer = (g_free (self->priv->buffer), NULL); - self->priv->buffer = _tmp12_; - self->priv->buffer_length1 = buffer_size; + self->priv->buffer = _tmp80_; + self->priv->buffer_length1 = _tmp79_; self->priv->_buffer_size_ = self->priv->buffer_length1; - n_remaining = self->priv->n_used - (line->n_lines * line->data_length); + _tmp81_ = self->priv->n_used; + _tmp82_ = line; + _tmp83_ = _tmp82_->n_lines; + _tmp84_ = line; + _tmp85_ = _tmp84_->data_length; + n_remaining = _tmp81_ - (_tmp83_ * _tmp85_); self->priv->n_used = 0; { gint i; i = 0; { - gboolean _tmp13_; - _tmp13_ = TRUE; + gboolean _tmp86_; + _tmp86_ = TRUE; while (TRUE) { - if (!_tmp13_) { - i++; + gboolean _tmp87_; + gint _tmp89_; + gint _tmp90_; + guchar* _tmp91_; + gint _tmp91__length1; + gint _tmp92_; + ScanLine* _tmp93_; + guchar* _tmp94_; + gint _tmp94__length1; + gint _tmp95_; + ScanLine* _tmp96_; + gint _tmp97_; + ScanLine* _tmp98_; + gint _tmp99_; + guchar _tmp100_; + guchar _tmp101_; + gint _tmp102_; + _tmp87_ = _tmp86_; + if (!_tmp87_) { + gint _tmp88_; + _tmp88_ = i; + i = _tmp88_ + 1; } - _tmp13_ = FALSE; - if (!(i < n_remaining)) { + _tmp86_ = FALSE; + _tmp89_ = i; + _tmp90_ = n_remaining; + if (!(_tmp89_ < _tmp90_)) { break; } - self->priv->buffer[i] = line->data[i + (line->n_lines * line->data_length)]; - self->priv->n_used++; + _tmp91_ = self->priv->buffer; + _tmp91__length1 = self->priv->buffer_length1; + _tmp92_ = i; + _tmp93_ = line; + _tmp94_ = _tmp93_->data; + _tmp94__length1 = _tmp93_->data_length1; + _tmp95_ = i; + _tmp96_ = line; + _tmp97_ = _tmp96_->n_lines; + _tmp98_ = line; + _tmp99_ = _tmp98_->data_length; + _tmp100_ = _tmp94_[_tmp95_ + (_tmp97_ * _tmp99_)]; + _tmp91_[_tmp92_] = _tmp100_; + _tmp101_ = _tmp91_[_tmp92_]; + _tmp102_ = self->priv->n_used; + self->priv->n_used = _tmp102_ + 1; } } } - if (self->priv->parameters.depth == 8) { - _tmp16_ = self->priv->parameters.format == SANE_FRAME_GRAY; + _tmp106_ = self->priv->parameters; + _tmp107_ = _tmp106_.depth; + if (_tmp107_ == 8) { + SANE_Parameters _tmp108_; + SANE_Frame _tmp109_; + _tmp108_ = self->priv->parameters; + _tmp109_ = _tmp108_.format; + _tmp105_ = _tmp109_ == SANE_FRAME_GRAY; } else { - _tmp16_ = FALSE; + _tmp105_ = FALSE; } - if (_tmp16_) { - _tmp15_ = job->depth == 2; + _tmp110_ = _tmp105_; + if (_tmp110_) { + ScanJob* _tmp111_; + gint _tmp112_; + _tmp111_ = job; + _tmp112_ = _tmp111_->depth; + _tmp104_ = _tmp112_ == 2; } else { - _tmp15_ = FALSE; + _tmp104_ = FALSE; } - if (_tmp15_) { - _tmp14_ = job->scan_mode == SCAN_MODE_GRAY; + _tmp113_ = _tmp104_; + if (_tmp113_) { + ScanJob* _tmp114_; + ScanMode _tmp115_; + _tmp114_ = job; + _tmp115_ = _tmp114_->scan_mode; + _tmp103_ = _tmp115_ == SCAN_MODE_GRAY; } else { - _tmp14_ = FALSE; + _tmp103_ = FALSE; } - if (_tmp14_) { + _tmp116_ = _tmp103_; + if (_tmp116_) { guchar block; gint write_offset; gint block_shift; + ScanLine* _tmp158_; + ScanLine* _tmp159_; + gint _tmp160_; block = (guchar) 0; write_offset = 0; block_shift = 6; @@ -5452,75 +7389,163 @@ static void scanner_do_read (Scanner* self) { gint i; i = 0; { - gboolean _tmp17_; - _tmp17_ = TRUE; + gboolean _tmp117_; + _tmp117_ = TRUE; while (TRUE) { + gboolean _tmp118_; + gint _tmp120_; + ScanLine* _tmp121_; + gint _tmp122_; + gint _tmp123_; + ScanLine* _tmp124_; + gint _tmp125_; gint offset; - if (!_tmp17_) { - i++; + gint _tmp151_; + _tmp118_ = _tmp117_; + if (!_tmp118_) { + gint _tmp119_; + _tmp119_ = i; + i = _tmp119_ + 1; } - _tmp17_ = FALSE; - if (!(i < line->n_lines)) { + _tmp117_ = FALSE; + _tmp120_ = i; + _tmp121_ = line; + _tmp122_ = _tmp121_->n_lines; + if (!(_tmp120_ < _tmp122_)) { break; } - offset = i * line->data_length; + _tmp123_ = i; + _tmp124_ = line; + _tmp125_ = _tmp124_->data_length; + offset = _tmp123_ * _tmp125_; { gint x; x = 0; { - gboolean _tmp18_; - _tmp18_ = TRUE; + gboolean _tmp126_; + _tmp126_ = TRUE; while (TRUE) { + gboolean _tmp127_; + gint _tmp129_; + ScanLine* _tmp130_; + gint _tmp131_; + ScanLine* _tmp132_; + guchar* _tmp133_; + gint _tmp133__length1; + gint _tmp134_; + gint _tmp135_; + guchar _tmp136_; guchar p; guchar sample = '\0'; - if (!_tmp18_) { - x++; + guchar _tmp137_; + guchar _tmp140_; + guchar _tmp141_; + gint _tmp142_; + gint _tmp143_; + _tmp127_ = _tmp126_; + if (!_tmp127_) { + gint _tmp128_; + _tmp128_ = x; + x = _tmp128_ + 1; } - _tmp18_ = FALSE; - if (!(x < line->width)) { + _tmp126_ = FALSE; + _tmp129_ = x; + _tmp130_ = line; + _tmp131_ = _tmp130_->width; + if (!(_tmp129_ < _tmp131_)) { break; } - p = line->data[offset + x]; - if (((gint) p) >= 192) { + _tmp132_ = line; + _tmp133_ = _tmp132_->data; + _tmp133__length1 = _tmp132_->data_length1; + _tmp134_ = offset; + _tmp135_ = x; + _tmp136_ = _tmp133_[_tmp134_ + _tmp135_]; + p = _tmp136_; + _tmp137_ = p; + if (((gint) _tmp137_) >= 192) { sample = (guchar) 3; } else { - if (((gint) p) >= 128) { + guchar _tmp138_; + _tmp138_ = p; + if (((gint) _tmp138_) >= 128) { sample = (guchar) 2; } else { - if (((gint) p) >= 64) { + guchar _tmp139_; + _tmp139_ = p; + if (((gint) _tmp139_) >= 64) { sample = (guchar) 1; } else { sample = (guchar) 0; } } } - block = block | (sample << block_shift); - if (block_shift == 0) { - line->data[write_offset] = block; - write_offset++; + _tmp140_ = block; + _tmp141_ = sample; + _tmp142_ = block_shift; + block = _tmp140_ | (_tmp141_ << _tmp142_); + _tmp143_ = block_shift; + if (_tmp143_ == 0) { + ScanLine* _tmp144_; + guchar* _tmp145_; + gint _tmp145__length1; + gint _tmp146_; + guchar _tmp147_; + guchar _tmp148_; + gint _tmp149_; + _tmp144_ = line; + _tmp145_ = _tmp144_->data; + _tmp145__length1 = _tmp144_->data_length1; + _tmp146_ = write_offset; + _tmp147_ = block; + _tmp145_[_tmp146_] = _tmp147_; + _tmp148_ = _tmp145_[_tmp146_]; + _tmp149_ = write_offset; + write_offset = _tmp149_ + 1; block = (guchar) 0; block_shift = 6; } else { - block_shift = block_shift - 2; + gint _tmp150_; + _tmp150_ = block_shift; + block_shift = _tmp150_ - 2; } } } } - if (block_shift != 6) { - line->data[write_offset] = block; - write_offset++; + _tmp151_ = block_shift; + if (_tmp151_ != 6) { + ScanLine* _tmp152_; + guchar* _tmp153_; + gint _tmp153__length1; + gint _tmp154_; + guchar _tmp155_; + guchar _tmp156_; + gint _tmp157_; + _tmp152_ = line; + _tmp153_ = _tmp152_->data; + _tmp153__length1 = _tmp152_->data_length1; + _tmp154_ = write_offset; + _tmp155_ = block; + _tmp153_[_tmp154_] = _tmp155_; + _tmp156_ = _tmp153_[_tmp154_]; + _tmp157_ = write_offset; + write_offset = _tmp157_ + 1; block = (guchar) 0; block_shift = 6; } } } } - line->data_length = ((line->width * 2) + 7) / 8; + _tmp158_ = line; + _tmp159_ = line; + _tmp160_ = _tmp159_->width; + _tmp158_->data_length = ((_tmp160_ * 2) + 7) / 8; } - _tmp19_ = notify_got_line_new (line); - _tmp20_ = _tmp19_; - scanner_notify (self, (Notify*) _tmp20_); - _notify_unref0 (_tmp20_); + _tmp161_ = line; + _tmp162_ = notify_got_line_new (_tmp161_); + _tmp163_ = _tmp162_; + scanner_notify (self, (Notify*) _tmp163_); + _notify_unref0 (_tmp163_); _scan_line_unref0 (line); } _scan_job_unref0 (job); @@ -5534,46 +7559,62 @@ static void _scanner_authorization_cb_sane_authcallback (const gchar* resource, static void* scanner_scan_thread (Scanner* self) { void* result = NULL; - SANE_Int version_code; - SANE_Int _tmp0_; - SANE_Status _tmp1_; + SANE_Int version_code = {0}; + SANE_Int _tmp0_ = {0}; + SANE_Status _tmp1_ = 0; SANE_Status status; - gchar* _tmp2_ = NULL; - gchar* _tmp3_; - gint _tmp5_; - gint _tmp6_; - gint _tmp7_; + SANE_Status _tmp2_; + gchar* _tmp3_ = NULL; + gchar* _tmp4_; + SANE_Status _tmp5_; + SANE_Int _tmp8_; + gint _tmp9_ = 0; + SANE_Int _tmp10_; + gint _tmp11_ = 0; + SANE_Int _tmp12_; + gint _tmp13_ = 0; g_return_val_if_fail (self != NULL, NULL); self->priv->state = SCAN_STATE_IDLE; _tmp1_ = sane_init (&_tmp0_, _scanner_authorization_cb_sane_authcallback); version_code = _tmp0_; status = _tmp1_; - _tmp2_ = sane_status_to_string (status); - _tmp3_ = _tmp2_; - g_debug ("scanner.vala:1327: sane_init () -> %s", _tmp3_); - _g_free0 (_tmp3_); - if (status != SANE_STATUS_GOOD) { - const gchar* _tmp4_ = NULL; - _tmp4_ = sane_strstatus (status); - g_warning ("scanner.vala:1330: Unable to initialize SANE backend: %s", _tmp4_); + _tmp2_ = status; + _tmp3_ = sane_status_to_string (_tmp2_); + _tmp4_ = _tmp3_; + g_debug ("scanner.vala:1328: sane_init () -> %s", _tmp4_); + _g_free0 (_tmp4_); + _tmp5_ = status; + if (_tmp5_ != SANE_STATUS_GOOD) { + SANE_Status _tmp6_; + const gchar* _tmp7_ = NULL; + _tmp6_ = status; + _tmp7_ = sane_strstatus (_tmp6_); + g_warning ("scanner.vala:1331: Unable to initialize SANE backend: %s", _tmp7_); result = NULL; return result; } - _tmp5_ = SANE_VERSION_MAJOR (version_code); - _tmp6_ = SANE_VERSION_MINOR (version_code); - _tmp7_ = SANE_VERSION_BUILD (version_code); - g_debug ("scanner.vala:1333: SANE version %d.%d.%d", _tmp5_, _tmp6_, _tmp7_); + _tmp8_ = version_code; + _tmp9_ = SANE_VERSION_MAJOR (_tmp8_); + _tmp10_ = version_code; + _tmp11_ = SANE_VERSION_MINOR (_tmp10_); + _tmp12_ = version_code; + _tmp13_ = SANE_VERSION_BUILD (_tmp12_); + g_debug ("scanner.vala:1334: SANE version %d.%d.%d", _tmp9_, _tmp11_, _tmp13_); scanner_redetect (self); while (TRUE) { - gboolean _tmp8_; - _tmp8_ = scanner_handle_requests (self); - if (!_tmp8_) { + gboolean _tmp14_ = FALSE; + ScanState _tmp15_; + _tmp14_ = scanner_handle_requests (self); + if (!_tmp14_) { break; } - switch (self->priv->state) { + _tmp15_ = self->priv->state; + switch (_tmp15_) { case SCAN_STATE_IDLE: { - if (self->priv->job_queue != NULL) { + GList* _tmp16_; + _tmp16_ = self->priv->job_queue; + if (_tmp16_ != NULL) { scanner_set_scanning (self, TRUE); self->priv->state = SCAN_STATE_OPEN; } @@ -5642,9 +7683,13 @@ void scanner_start (Scanner* self) { __catch10_g_error: { GError* e = NULL; + GError* _tmp2_; + const gchar* _tmp3_; e = _inner_error_; _inner_error_ = NULL; - g_critical ("scanner.vala:1384: Unable to create thread: %s", e->message); + _tmp2_ = e; + _tmp3_ = _tmp2_->message; + g_critical ("scanner.vala:1385: Unable to create thread: %s", _tmp3_); _g_error_free0 (e); } __finally10: @@ -5657,177 +7702,271 @@ void scanner_start (Scanner* self) { void scanner_redetect (Scanner* self) { - RequestRedetect* _tmp0_ = NULL; + gboolean _tmp0_; + GAsyncQueue* _tmp1_; + RequestRedetect* _tmp2_; g_return_if_fail (self != NULL); - if (self->priv->need_redetect) { + _tmp0_ = self->priv->need_redetect; + if (_tmp0_) { return; } self->priv->need_redetect = TRUE; - g_debug ("scanner.vala:1394: Requesting redetection of scan devices"); - _tmp0_ = request_redetect_new (); - g_async_queue_push (self->priv->request_queue, (Request*) _tmp0_); + g_debug ("scanner.vala:1395: Requesting redetection of scan devices"); + _tmp1_ = self->priv->request_queue; + _tmp2_ = request_redetect_new (); + g_async_queue_push (_tmp1_, (Request*) _tmp2_); } gboolean scanner_is_scanning (Scanner* self) { gboolean result = FALSE; + gboolean _tmp0_; g_return_val_if_fail (self != NULL, FALSE); - result = self->priv->scanning; + _tmp0_ = self->priv->scanning; + result = _tmp0_; return result; } static gchar* scanner_get_scan_mode_string (Scanner* self, ScanMode mode) { gchar* result = NULL; + ScanMode _tmp0_; g_return_val_if_fail (self != NULL, NULL); - switch (mode) { + _tmp0_ = mode; + switch (_tmp0_) { case SCAN_MODE_DEFAULT: - { - gchar* _tmp0_; - _tmp0_ = g_strdup ("ScanMode.DEFAULT"); - result = _tmp0_; - return result; - } - case SCAN_MODE_COLOR: { gchar* _tmp1_; - _tmp1_ = g_strdup ("ScanMode.COLOR"); + _tmp1_ = g_strdup ("ScanMode.DEFAULT"); result = _tmp1_; return result; } - case SCAN_MODE_GRAY: + case SCAN_MODE_COLOR: { gchar* _tmp2_; - _tmp2_ = g_strdup ("ScanMode.GRAY"); + _tmp2_ = g_strdup ("ScanMode.COLOR"); result = _tmp2_; return result; } - case SCAN_MODE_LINEART: + case SCAN_MODE_GRAY: { gchar* _tmp3_; - _tmp3_ = g_strdup ("ScanMode.LINEART"); + _tmp3_ = g_strdup ("ScanMode.GRAY"); result = _tmp3_; return result; } - default: + case SCAN_MODE_LINEART: { - gchar* _tmp4_ = NULL; - _tmp4_ = g_strdup_printf ("%d", (gint) mode); + gchar* _tmp4_; + _tmp4_ = g_strdup ("ScanMode.LINEART"); result = _tmp4_; return result; } + default: + { + ScanMode _tmp5_; + gchar* _tmp6_ = NULL; + _tmp5_ = mode; + _tmp6_ = g_strdup_printf ("%d", (gint) _tmp5_); + result = _tmp6_; + return result; + } } } static gchar* scanner_get_scan_type_string (Scanner* self, ScanType type) { gchar* result = NULL; + ScanType _tmp0_; g_return_val_if_fail (self != NULL, NULL); - switch (type) { + _tmp0_ = type; + switch (_tmp0_) { case SCAN_TYPE_SINGLE: - { - gchar* _tmp0_; - _tmp0_ = g_strdup ("ScanType.SINGLE"); - result = _tmp0_; - return result; - } - case SCAN_TYPE_ADF_FRONT: { gchar* _tmp1_; - _tmp1_ = g_strdup ("ScanType.ADF_FRONT"); + _tmp1_ = g_strdup ("ScanType.SINGLE"); result = _tmp1_; return result; } - case SCAN_TYPE_ADF_BACK: + case SCAN_TYPE_ADF_FRONT: { gchar* _tmp2_; - _tmp2_ = g_strdup ("ScanType.ADF_BACK"); + _tmp2_ = g_strdup ("ScanType.ADF_FRONT"); result = _tmp2_; return result; } - case SCAN_TYPE_ADF_BOTH: + case SCAN_TYPE_ADF_BACK: { gchar* _tmp3_; - _tmp3_ = g_strdup ("ScanType.ADF_BOTH"); + _tmp3_ = g_strdup ("ScanType.ADF_BACK"); result = _tmp3_; return result; } - default: + case SCAN_TYPE_ADF_BOTH: { - gchar* _tmp4_ = NULL; - _tmp4_ = g_strdup_printf ("%d", (gint) type); + gchar* _tmp4_; + _tmp4_ = g_strdup ("ScanType.ADF_BOTH"); result = _tmp4_; return result; } + default: + { + ScanType _tmp5_; + gchar* _tmp6_ = NULL; + _tmp5_ = type; + _tmp6_ = g_strdup_printf ("%d", (gint) _tmp5_); + result = _tmp6_; + return result; + } } } void scanner_scan (Scanner* self, const gchar* device, ScanOptions* options) { const gchar* _tmp0_ = NULL; - gchar* _tmp1_ = NULL; - gchar* _tmp2_; - gchar* _tmp3_ = NULL; - gchar* _tmp4_; - RequestStartScan* _tmp5_ = NULL; + const gchar* _tmp1_; + const gchar* _tmp3_; + ScanOptions* _tmp4_; + gint _tmp5_; + ScanOptions* _tmp6_; + ScanMode _tmp7_; + gchar* _tmp8_ = NULL; + gchar* _tmp9_; + ScanOptions* _tmp10_; + gint _tmp11_; + ScanOptions* _tmp12_; + ScanType _tmp13_; + gchar* _tmp14_ = NULL; + gchar* _tmp15_; + ScanOptions* _tmp16_; + gint _tmp17_; + ScanOptions* _tmp18_; + gint _tmp19_; + RequestStartScan* _tmp20_; RequestStartScan* request; - ScanJob* _tmp6_ = NULL; - gchar* _tmp7_; - Request* _tmp8_; + ScanJob* _tmp21_; + ScanJob* _tmp22_; + const gchar* _tmp23_; + gchar* _tmp24_; + ScanJob* _tmp25_; + ScanOptions* _tmp26_; + gint _tmp27_; + ScanJob* _tmp28_; + ScanOptions* _tmp29_; + ScanMode _tmp30_; + ScanJob* _tmp31_; + ScanOptions* _tmp32_; + gint _tmp33_; + ScanJob* _tmp34_; + ScanOptions* _tmp35_; + ScanType _tmp36_; + ScanJob* _tmp37_; + ScanOptions* _tmp38_; + gint _tmp39_; + ScanJob* _tmp40_; + ScanOptions* _tmp41_; + gint _tmp42_; + GAsyncQueue* _tmp43_; + Request* _tmp44_; g_return_if_fail (self != NULL); g_return_if_fail (options != NULL); - if (device != NULL) { - _tmp0_ = device; + _tmp1_ = device; + if (_tmp1_ != NULL) { + const gchar* _tmp2_; + _tmp2_ = device; + _tmp0_ = _tmp2_; } else { _tmp0_ = "(null)"; } - _tmp1_ = scanner_get_scan_mode_string (self, options->scan_mode); - _tmp2_ = _tmp1_; - _tmp3_ = scanner_get_scan_type_string (self, options->type); - _tmp4_ = _tmp3_; - g_debug ("scanner.vala:1440: Scanner.scan (\"%s\", dpi=%d, scan_mode=%s, depth=%" \ -"d, type=%s, paper_width=%d, paper_height=%d)", _tmp0_, options->dpi, _tmp2_, options->depth, _tmp4_, options->paper_width, options->paper_height); - _g_free0 (_tmp4_); - _g_free0 (_tmp2_); - _tmp5_ = request_start_scan_new (); - request = _tmp5_; - _tmp6_ = scan_job_new (); + _tmp3_ = _tmp0_; + _tmp4_ = options; + _tmp5_ = _tmp4_->dpi; + _tmp6_ = options; + _tmp7_ = _tmp6_->scan_mode; + _tmp8_ = scanner_get_scan_mode_string (self, _tmp7_); + _tmp9_ = _tmp8_; + _tmp10_ = options; + _tmp11_ = _tmp10_->depth; + _tmp12_ = options; + _tmp13_ = _tmp12_->type; + _tmp14_ = scanner_get_scan_type_string (self, _tmp13_); + _tmp15_ = _tmp14_; + _tmp16_ = options; + _tmp17_ = _tmp16_->paper_width; + _tmp18_ = options; + _tmp19_ = _tmp18_->paper_height; + g_debug ("scanner.vala:1441: Scanner.scan (\"%s\", dpi=%d, scan_mode=%s, depth=%" \ +"d, type=%s, paper_width=%d, paper_height=%d)", _tmp3_, _tmp5_, _tmp9_, _tmp11_, _tmp15_, _tmp17_, _tmp19_); + _g_free0 (_tmp15_); + _g_free0 (_tmp9_); + _tmp20_ = request_start_scan_new (); + request = _tmp20_; + _tmp21_ = scan_job_new (); _scan_job_unref0 (request->job); - request->job = _tmp6_; - _tmp7_ = g_strdup (device); - _g_free0 (request->job->device); - request->job->device = _tmp7_; - request->job->dpi = (gdouble) options->dpi; - request->job->scan_mode = options->scan_mode; - request->job->depth = options->depth; - request->job->type = options->type; - request->job->page_width = options->paper_width; - request->job->page_height = options->paper_height; - _tmp8_ = _request_ref0 ((Request*) request); - g_async_queue_push (self->priv->request_queue, _tmp8_); + request->job = _tmp21_; + _tmp22_ = request->job; + _tmp23_ = device; + _tmp24_ = g_strdup (_tmp23_); + _g_free0 (_tmp22_->device); + _tmp22_->device = _tmp24_; + _tmp25_ = request->job; + _tmp26_ = options; + _tmp27_ = _tmp26_->dpi; + _tmp25_->dpi = (gdouble) _tmp27_; + _tmp28_ = request->job; + _tmp29_ = options; + _tmp30_ = _tmp29_->scan_mode; + _tmp28_->scan_mode = _tmp30_; + _tmp31_ = request->job; + _tmp32_ = options; + _tmp33_ = _tmp32_->depth; + _tmp31_->depth = _tmp33_; + _tmp34_ = request->job; + _tmp35_ = options; + _tmp36_ = _tmp35_->type; + _tmp34_->type = _tmp36_; + _tmp37_ = request->job; + _tmp38_ = options; + _tmp39_ = _tmp38_->paper_width; + _tmp37_->page_width = _tmp39_; + _tmp40_ = request->job; + _tmp41_ = options; + _tmp42_ = _tmp41_->paper_height; + _tmp40_->page_height = _tmp42_; + _tmp43_ = self->priv->request_queue; + _tmp44_ = _request_ref0 ((Request*) request); + g_async_queue_push (_tmp43_, _tmp44_); _request_unref0 (request); } void scanner_cancel (Scanner* self) { - RequestCancel* _tmp0_ = NULL; + GAsyncQueue* _tmp0_; + RequestCancel* _tmp1_; g_return_if_fail (self != NULL); - _tmp0_ = request_cancel_new (); - g_async_queue_push (self->priv->request_queue, (Request*) _tmp0_); + _tmp0_ = self->priv->request_queue; + _tmp1_ = request_cancel_new (); + g_async_queue_push (_tmp0_, (Request*) _tmp1_); } void scanner_free (Scanner* self) { - RequestQuit* _tmp0_ = NULL; + GAsyncQueue* _tmp0_; + RequestQuit* _tmp1_; + GThread* _tmp2_; g_return_if_fail (self != NULL); - g_debug ("scanner.vala:1462: Stopping scan thread"); - _tmp0_ = request_quit_new (); - g_async_queue_push (self->priv->request_queue, (Request*) _tmp0_); - if (self->priv->thread != NULL) { - g_thread_join (self->priv->thread); + g_debug ("scanner.vala:1463: Stopping scan thread"); + _tmp0_ = self->priv->request_queue; + _tmp1_ = request_quit_new (); + g_async_queue_push (_tmp0_, (Request*) _tmp1_); + _tmp2_ = self->priv->thread; + if (_tmp2_ != NULL) { + GThread* _tmp3_; + _tmp3_ = self->priv->thread; + g_thread_join (_tmp3_); } sane_exit (); - g_debug ("scanner.vala:1470: sane_exit ()"); + g_debug ("scanner.vala:1471: sane_exit ()"); } diff --git a/src/scanner.vala b/src/scanner.vala index 02aa69d..371fe83 100644 --- a/src/scanner.vala +++ b/src/scanner.vala @@ -369,7 +369,7 @@ public class Scanner return false; var status = Sane.control_option (handle, option_index, Sane.Action.SET_AUTO, null, null); - debug ("sane_control_option (%d, SANE_ACTION_SET_AUTO) -> %s", option_index, Sane.status_to_string (status)); + debug ("sane_control_option (%d, SANE_ACTION_SET_AUTO) -> %s", (int) option_index, Sane.status_to_string (status)); if (status != Sane.Status.GOOD) warning ("Error setting default option %s: %s", option.name, Sane.strstatus(status)); @@ -383,7 +383,7 @@ public class Scanner Sane.Bool v = (Sane.Bool) value; var status = Sane.control_option (handle, option_index, Sane.Action.SET_VALUE, &v, null); result = (bool) v; - debug ("sane_control_option (%d, SANE_ACTION_SET_VALUE, %s) -> (%s, %s)", option_index, value ? "SANE_TRUE" : "SANE_FALSE", Sane.status_to_string (status), result ? "SANE_TRUE" : "SANE_FALSE"); + debug ("sane_control_option (%d, SANE_ACTION_SET_VALUE, %s) -> (%s, %s)", (int) option_index, value ? "SANE_TRUE" : "SANE_FALSE", Sane.status_to_string (status), result ? "SANE_TRUE" : "SANE_FALSE"); } private void set_int_option (Sane.Handle handle, Sane.OptionDescriptor option, Sane.Int option_index, int value, out int result) @@ -393,22 +393,23 @@ public class Scanner Sane.Int v = (Sane.Int) value; if (option.constraint_type == Sane.ConstraintType.RANGE) { - if (option.constraint.range.quant != 0) - v *= option.constraint.range.quant; - if (v < option.constraint.range.min) - v = option.constraint.range.min; - if (v > option.constraint.range.max) - v = option.constraint.range.max; + if (option.range.quant != 0) + v *= option.range.quant; + if (v < option.range.min) + v = option.range.min; + if (v > option.range.max) + v = option.range.max; } else if (option.constraint_type == Sane.ConstraintType.WORD_LIST) { int distance = int.MAX, nearest = 0; /* Find nearest value to requested */ - for (var i = 0; i < option.constraint.word_list[0]; i++) + for (var i = 0; i < option.word_list[0]; i++) { - var x = (int) option.constraint.word_list[i+1]; - var d = (x - v).abs (); + var x = (int) option.word_list[i+1]; + var d = (int) (x - v); + d = d.abs (); if (d < distance) { distance = d; @@ -419,8 +420,8 @@ public class Scanner } var status = Sane.control_option (handle, option_index, Sane.Action.SET_VALUE, &v, null); - debug ("sane_control_option (%d, SANE_ACTION_SET_VALUE, %d) -> (%s, %d)", option_index, value, Sane.status_to_string (status), v); - result = v; + debug ("sane_control_option (%d, SANE_ACTION_SET_VALUE, %d) -> (%s, %d)", (int) option_index, value, Sane.status_to_string (status), (int) v); + result = (int) v; } private void set_fixed_option (Sane.Handle handle, Sane.OptionDescriptor option, Sane.Int option_index, double value, out double result) @@ -432,8 +433,8 @@ public class Scanner if (option.constraint_type == Sane.ConstraintType.RANGE) { - double min = Sane.UNFIX (option.constraint.range.min); - double max = Sane.UNFIX (option.constraint.range.max); + double min = Sane.UNFIX (option.range.min); + double max = Sane.UNFIX (option.range.max); if (v < min) v = min; @@ -445,9 +446,9 @@ public class Scanner double distance = double.MAX, nearest = 0.0; /* Find nearest value to requested */ - for (var i = 0; i < option.constraint.word_list[0]; i++) + for (var i = 0; i < option.word_list[0]; i++) { - double x = Sane.UNFIX (option.constraint.word_list[i+1]); + double x = Sane.UNFIX (option.word_list[i+1]); if (Math.fabs (x - v) < distance) { distance = Math.fabs (x - v); @@ -459,7 +460,7 @@ public class Scanner v_fixed = Sane.FIX (v); var status = Sane.control_option (handle, option_index, Sane.Action.SET_VALUE, &v_fixed, null); - debug ("sane_control_option (%d, SANE_ACTION_SET_VALUE, %f) -> (%s, %f)", option_index, value, Sane.status_to_string (status), Sane.UNFIX (v_fixed)); + debug ("sane_control_option (%d, SANE_ACTION_SET_VALUE, %f) -> (%s, %f)", (int) option_index, value, Sane.status_to_string (status), Sane.UNFIX (v_fixed)); result = Sane.UNFIX (v_fixed); } @@ -475,7 +476,7 @@ public class Scanner s[i] = '\0'; var status = Sane.control_option (handle, option_index, Sane.Action.SET_VALUE, s, null); result = (string) s; - debug ("sane_control_option (%d, SANE_ACTION_SET_VALUE, \"%s\") -> (%s, \"%s\")", option_index, value, Sane.status_to_string (status), result); + debug ("sane_control_option (%d, SANE_ACTION_SET_VALUE, \"%s\") -> (%s, \"%s\")", (int) option_index, value, Sane.status_to_string (status), result); return status == Sane.Status.GOOD; } @@ -488,13 +489,13 @@ public class Scanner for (var i = 0; values[i] != null; i++) { var j = 0; - for (; option.constraint.string_list[j] != null; j++) + for (; option.string_list[j] != null; j++) { - if (values[i] == option.constraint.string_list[j]) + if (values[i] == option.string_list[j]) break; } - if (option.constraint.string_list[j] != null) + if (option.string_list[j] != null) return set_string_option (handle, option, option_index, values[i], out result); } @@ -503,7 +504,7 @@ public class Scanner private void log_option (Sane.Int index, Sane.OptionDescriptor option) { - var s = "Option %d:".printf (index); + var s = "Option %d:".printf ((int) index); if (option.name != "") s += " name='%s'".printf (option.name); @@ -536,7 +537,7 @@ public class Scanner break; } - s += " size=%d".printf (option.size); + s += " size=%d".printf ((int) option.size); switch (option.unit) { @@ -569,30 +570,30 @@ public class Scanner { case Sane.ConstraintType.RANGE: if (option.type == Sane.ValueType.FIXED) - s += " min=%f, max=%f, quant=%d".printf (Sane.UNFIX (option.constraint.range.min), Sane.UNFIX (option.constraint.range.max), option.constraint.range.quant); + s += " min=%f, max=%f, quant=%d".printf (Sane.UNFIX (option.range.min), Sane.UNFIX (option.range.max), (int) option.range.quant); else - s += " min=%d, max=%d, quant=%d".printf (option.constraint.range.min, option.constraint.range.max, option.constraint.range.quant); + s += " min=%d, max=%d, quant=%d".printf ((int) option.range.min, (int) option.range.max, (int) option.range.quant); break; case Sane.ConstraintType.WORD_LIST: s += " values=["; - for (var i = 0; i < option.constraint.word_list[0]; i++) + for (var i = 0; i < option.word_list[0]; i++) { if (i != 0) s += ", "; if (option.type == Sane.ValueType.INT) - s += "%d".printf (option.constraint.word_list[i+1]); + s += "%d".printf ((int) option.word_list[i+1]); else - s += "%f".printf (Sane.UNFIX (option.constraint.word_list[i+1])); + s += "%f".printf (Sane.UNFIX (option.word_list[i+1])); } s += "]"; break; case Sane.ConstraintType.STRING_LIST: s += " values=["; - for (var i = 0; option.constraint.string_list[i] != null; i++) + for (var i = 0; option.string_list[i] != null; i++) { if (i != 0) s += ", "; - s += "\"%s\"".printf (option.constraint.string_list[i]); + s += "\"%s\"".printf (option.string_list[i]); } s += "]"; break; @@ -658,7 +659,7 @@ public class Scanner { if (s != "") s += ","; - s += "%x".printf (cap); + s += "%x".printf ((int) cap); } } @@ -812,7 +813,7 @@ public class Scanner var job = (ScanJob) job_queue.data; var option = Sane.get_option_descriptor (handle, option_index); - debug ("sane_get_option_descriptor (%d)", option_index); + debug ("sane_get_option_descriptor (%d)", (int) option_index); var index = option_index; option_index++; @@ -822,25 +823,25 @@ public class Scanner if (br_x_option_index != 0) { option = Sane.get_option_descriptor (handle, br_x_option_index); - debug ("sane_get_option_descriptor (%d)", br_x_option_index); + debug ("sane_get_option_descriptor (%d)", (int) br_x_option_index); if (option.constraint_type == Sane.ConstraintType.RANGE) { if (option.type == Sane.ValueType.FIXED) - set_fixed_option (handle, option, br_x_option_index, Sane.UNFIX (option.constraint.range.max), null); + set_fixed_option (handle, option, br_x_option_index, Sane.UNFIX (option.range.max), null); else - set_int_option (handle, option, br_x_option_index, option.constraint.range.max, null); + set_int_option (handle, option, br_x_option_index, (int) option.range.max, null); } } if (br_y_option_index != 0) { option = Sane.get_option_descriptor (handle, br_y_option_index); - debug ("sane_get_option_descriptor (%d)", br_y_option_index); + debug ("sane_get_option_descriptor (%d)", (int) br_y_option_index); if (option.constraint_type == Sane.ConstraintType.RANGE) { if (option.type == Sane.ValueType.FIXED) - set_fixed_option (handle, option, br_y_option_index, Sane.UNFIX (option.constraint.range.max), null); + set_fixed_option (handle, option, br_y_option_index, Sane.UNFIX (option.range.max), null); else - set_int_option (handle, option, br_y_option_index, option.constraint.range.max, null); + set_int_option (handle, option, br_y_option_index, (int) option.range.max, null); } } @@ -1191,7 +1192,7 @@ public class Scanner Sane.Int n_read; var b = (uchar *) buffer; var status = Sane.read (handle, (uint8[]) (b + n_used), (Sane.Int) n_to_read, out n_read); - debug ("sane_read (%d) -> (%s, %d)", n_to_read, Sane.status_to_string (status), n_read); + debug ("sane_read (%d) -> (%s, %d)", n_to_read, Sane.status_to_string (status), (int) n_read); /* Completed read */ if (status == Sane.Status.EOF) @@ -1217,7 +1218,7 @@ public class Scanner bool full_read = false; if (n_used == 0 && n_read == buffer.length) full_read = true; - n_used += n_read; + n_used += (int) n_read; /* Feed out lines */ if (n_used >= parameters.bytes_per_line) diff --git a/src/simple-scan.c b/src/simple-scan.c index 85943bf..21dc633 100644 --- a/src/simple-scan.c +++ b/src/simple-scan.c @@ -1,4 +1,4 @@ -/* simple-scan.c generated by valac 0.13.1, the Vala compiler +/* simple-scan.c generated by valac 0.13.4, the Vala compiler * generated from simple-scan.vala, do not modify */ /* @@ -503,60 +503,110 @@ static void _g_list_free__scan_device_unref0_ (GList* self) { Application* application_construct (GType object_type, ScanDevice* device) { Application* self = NULL; ScanDevice* _tmp0_; - SimpleScan* _tmp1_ = NULL; - Book* _tmp2_ = NULL; - Scanner* _tmp3_ = NULL; - gchar* _tmp4_; - gchar** _tmp5_ = NULL; + ScanDevice* _tmp1_; + SimpleScan* _tmp2_; + SimpleScan* _tmp3_; + Book* _tmp4_ = NULL; + SimpleScan* _tmp5_; + SimpleScan* _tmp6_; + SimpleScan* _tmp7_; + SimpleScan* _tmp8_; + Scanner* _tmp9_ = NULL; + Scanner* _tmp10_; + Scanner* _tmp11_; + Scanner* _tmp12_; + Scanner* _tmp13_; + Scanner* _tmp14_; + Scanner* _tmp15_; + Scanner* _tmp16_; + Scanner* _tmp17_; + Scanner* _tmp18_; + gchar* _tmp19_; + gchar** _tmp20_ = NULL; gchar** subsystems; gint subsystems_length1; gint _subsystems_size_; - GUdevClient* _tmp6_ = NULL; + gchar** _tmp21_; + gint _tmp21__length1; + GUdevClient* _tmp22_; + GUdevClient* _tmp23_; + ScanDevice* _tmp24_; self = (Application*) g_type_create_instance (object_type); - _tmp0_ = _scan_device_ref0 (device); + _tmp0_ = device; + _tmp1_ = _scan_device_ref0 (_tmp0_); _scan_device_unref0 (self->priv->default_device); - self->priv->default_device = _tmp0_; - _tmp1_ = simple_scan_new (); + self->priv->default_device = _tmp1_; + _tmp2_ = simple_scan_new (); _simple_scan_unref0 (self->priv->ui); - self->priv->ui = _tmp1_; - _tmp2_ = simple_scan_get_book (self->priv->ui); + self->priv->ui = _tmp2_; + _tmp3_ = self->priv->ui; + _tmp4_ = simple_scan_get_book (_tmp3_); _book_unref0 (self->priv->book); - self->priv->book = _tmp2_; - g_signal_connect (self->priv->ui, "start-scan", (GCallback) _application_scan_cb_simple_scan_start_scan, self); - g_signal_connect (self->priv->ui, "stop-scan", (GCallback) _application_cancel_cb_simple_scan_stop_scan, self); - g_signal_connect (self->priv->ui, "email", (GCallback) _application_email_cb_simple_scan_email, self); - g_signal_connect (self->priv->ui, "quit", (GCallback) _application_quit_cb_simple_scan_quit, self); - _tmp3_ = scanner_get_instance (); + self->priv->book = _tmp4_; + _tmp5_ = self->priv->ui; + g_signal_connect (_tmp5_, "start-scan", (GCallback) _application_scan_cb_simple_scan_start_scan, self); + _tmp6_ = self->priv->ui; + g_signal_connect (_tmp6_, "stop-scan", (GCallback) _application_cancel_cb_simple_scan_stop_scan, self); + _tmp7_ = self->priv->ui; + g_signal_connect (_tmp7_, "email", (GCallback) _application_email_cb_simple_scan_email, self); + _tmp8_ = self->priv->ui; + g_signal_connect (_tmp8_, "quit", (GCallback) _application_quit_cb_simple_scan_quit, self); + _tmp9_ = scanner_get_instance (); _scanner_unref0 (self->priv->scanner); - self->priv->scanner = _tmp3_; - g_signal_connect (self->priv->scanner, "update-devices", (GCallback) _application_update_scan_devices_cb_scanner_update_devices, self); - g_signal_connect (self->priv->scanner, "request-authorization", (GCallback) _application_authorize_cb_scanner_request_authorization, self); - g_signal_connect (self->priv->scanner, "expect-page", (GCallback) _application_scanner_new_page_cb_scanner_expect_page, self); - g_signal_connect (self->priv->scanner, "got-page-info", (GCallback) _application_scanner_page_info_cb_scanner_got_page_info, self); - g_signal_connect (self->priv->scanner, "got-line", (GCallback) _application_scanner_line_cb_scanner_got_line, self); - g_signal_connect (self->priv->scanner, "page-done", (GCallback) _application_scanner_page_done_cb_scanner_page_done, self); - g_signal_connect (self->priv->scanner, "document-done", (GCallback) _application_scanner_document_done_cb_scanner_document_done, self); - g_signal_connect (self->priv->scanner, "scan-failed", (GCallback) _application_scanner_failed_cb_scanner_scan_failed, self); - g_signal_connect (self->priv->scanner, "scanning-changed", (GCallback) _application_scanner_scanning_changed_cb_scanner_scanning_changed, self); - _tmp4_ = g_strdup ("usb"); - _tmp5_ = g_new0 (gchar*, 2 + 1); - _tmp5_[0] = _tmp4_; - _tmp5_[1] = NULL; - subsystems = _tmp5_; + self->priv->scanner = _tmp9_; + _tmp10_ = self->priv->scanner; + g_signal_connect (_tmp10_, "update-devices", (GCallback) _application_update_scan_devices_cb_scanner_update_devices, self); + _tmp11_ = self->priv->scanner; + g_signal_connect (_tmp11_, "request-authorization", (GCallback) _application_authorize_cb_scanner_request_authorization, self); + _tmp12_ = self->priv->scanner; + g_signal_connect (_tmp12_, "expect-page", (GCallback) _application_scanner_new_page_cb_scanner_expect_page, self); + _tmp13_ = self->priv->scanner; + g_signal_connect (_tmp13_, "got-page-info", (GCallback) _application_scanner_page_info_cb_scanner_got_page_info, self); + _tmp14_ = self->priv->scanner; + g_signal_connect (_tmp14_, "got-line", (GCallback) _application_scanner_line_cb_scanner_got_line, self); + _tmp15_ = self->priv->scanner; + g_signal_connect (_tmp15_, "page-done", (GCallback) _application_scanner_page_done_cb_scanner_page_done, self); + _tmp16_ = self->priv->scanner; + g_signal_connect (_tmp16_, "document-done", (GCallback) _application_scanner_document_done_cb_scanner_document_done, self); + _tmp17_ = self->priv->scanner; + g_signal_connect (_tmp17_, "scan-failed", (GCallback) _application_scanner_failed_cb_scanner_scan_failed, self); + _tmp18_ = self->priv->scanner; + g_signal_connect (_tmp18_, "scanning-changed", (GCallback) _application_scanner_scanning_changed_cb_scanner_scanning_changed, self); + _tmp19_ = g_strdup ("usb"); + _tmp20_ = g_new0 (gchar*, 2 + 1); + _tmp20_[0] = _tmp19_; + _tmp20_[1] = NULL; + subsystems = _tmp20_; subsystems_length1 = 2; _subsystems_size_ = subsystems_length1; - _tmp6_ = g_udev_client_new (subsystems); + _tmp21_ = subsystems; + _tmp21__length1 = subsystems_length1; + _tmp22_ = g_udev_client_new (_tmp21_); _g_object_unref0 (self->priv->udev_client); - self->priv->udev_client = _tmp6_; - g_signal_connect (self->priv->udev_client, "uevent", (GCallback) _application_on_uevent_g_udev_client_uevent, self); - if (self->priv->default_device != NULL) { + self->priv->udev_client = _tmp22_; + _tmp23_ = self->priv->udev_client; + g_signal_connect (_tmp23_, "uevent", (GCallback) _application_on_uevent_g_udev_client_uevent, self); + _tmp24_ = self->priv->default_device; + if (_tmp24_ != NULL) { GList* device_list; - ScanDevice* _tmp7_; + ScanDevice* _tmp25_; + ScanDevice* _tmp26_; + SimpleScan* _tmp27_; + GList* _tmp28_; + SimpleScan* _tmp29_; + ScanDevice* _tmp30_; + const gchar* _tmp31_; device_list = NULL; - _tmp7_ = _scan_device_ref0 (self->priv->default_device); - device_list = g_list_append (device_list, _tmp7_); - simple_scan_set_scan_devices (self->priv->ui, device_list); - simple_scan_set_selected_device (self->priv->ui, self->priv->default_device->name); + _tmp25_ = self->priv->default_device; + _tmp26_ = _scan_device_ref0 (_tmp25_); + device_list = g_list_append (device_list, _tmp26_); + _tmp27_ = self->priv->ui; + _tmp28_ = device_list; + simple_scan_set_scan_devices (_tmp27_, _tmp28_); + _tmp29_ = self->priv->ui; + _tmp30_ = self->priv->default_device; + _tmp31_ = _tmp30_->name; + simple_scan_set_selected_device (_tmp29_, _tmp31_); __g_list_free__scan_device_unref0_0 (device_list); } subsystems = (_vala_array_free (subsystems, subsystems_length1, (GDestroyNotify) g_free), NULL); @@ -570,45 +620,73 @@ Application* application_new (ScanDevice* device) { void application_start (Application* self) { + SimpleScan* _tmp0_; + Scanner* _tmp1_; g_return_if_fail (self != NULL); - simple_scan_start (self->priv->ui); - scanner_start (self->priv->scanner); + _tmp0_ = self->priv->ui; + simple_scan_start (_tmp0_); + _tmp1_ = self->priv->scanner; + scanner_start (_tmp1_); } static void application_update_scan_devices_cb (Application* self, Scanner* scanner, GList* devices) { - GList* _tmp0_ = NULL; + GList* _tmp0_; + GList* _tmp1_ = NULL; GList* devices_copy; - guint _tmp1_; + ScanDevice* _tmp2_; + GList* _tmp10_; + guint _tmp11_ = 0U; + SimpleScan* _tmp12_; + GList* _tmp13_; g_return_if_fail (self != NULL); g_return_if_fail (scanner != NULL); - _tmp0_ = g_list_copy (devices); - devices_copy = _tmp0_; - if (self->priv->default_device != NULL) { + _tmp0_ = devices; + _tmp1_ = g_list_copy (_tmp0_); + devices_copy = _tmp1_; + _tmp2_ = self->priv->default_device; + if (_tmp2_ != NULL) { gboolean default_in_list; + GList* _tmp3_; + gboolean _tmp8_; default_in_list = FALSE; + _tmp3_ = devices_copy; { GList* device_collection = NULL; GList* device_it = NULL; - device_collection = devices_copy; + device_collection = _tmp3_; for (device_it = device_collection; device_it != NULL; device_it = device_it->next) { ScanDevice* device = NULL; device = (ScanDevice*) device_it->data; { - if (g_strcmp0 (device->name, self->priv->default_device->name) == 0) { + ScanDevice* _tmp4_; + const gchar* _tmp5_; + ScanDevice* _tmp6_; + const gchar* _tmp7_; + _tmp4_ = device; + _tmp5_ = _tmp4_->name; + _tmp6_ = self->priv->default_device; + _tmp7_ = _tmp6_->name; + if (g_strcmp0 (_tmp5_, _tmp7_) == 0) { default_in_list = TRUE; break; } } } } - if (!default_in_list) { - devices_copy = g_list_prepend (devices_copy, self->priv->default_device); + _tmp8_ = default_in_list; + if (!_tmp8_) { + ScanDevice* _tmp9_; + _tmp9_ = self->priv->default_device; + devices_copy = g_list_prepend (devices_copy, _tmp9_); } } - _tmp1_ = g_list_length (devices_copy); - self->priv->have_devices = _tmp1_ > ((guint) 0); - simple_scan_set_scan_devices (self->priv->ui, devices_copy); + _tmp10_ = devices_copy; + _tmp11_ = g_list_length (_tmp10_); + self->priv->have_devices = _tmp11_ > ((guint) 0); + _tmp12_ = self->priv->ui; + _tmp13_ = devices_copy; + simple_scan_set_scan_devices (_tmp12_, _tmp13_); _g_list_free0 (devices_copy); } @@ -616,17 +694,23 @@ static void application_update_scan_devices_cb (Application* self, Scanner* scan static void application_authorize_cb (Application* self, Scanner* scanner, const gchar* resource) { gchar* username = NULL; gchar* password = NULL; - gchar* _tmp0_ = NULL; - gchar* _tmp1_ = NULL; + SimpleScan* _tmp0_; + const gchar* _tmp1_; + gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; + Scanner* _tmp4_; g_return_if_fail (self != NULL); g_return_if_fail (scanner != NULL); g_return_if_fail (resource != NULL); - simple_scan_authorize (self->priv->ui, resource, &_tmp0_, &_tmp1_); + _tmp0_ = self->priv->ui; + _tmp1_ = resource; + simple_scan_authorize (_tmp0_, _tmp1_, &_tmp2_, &_tmp3_); _g_free0 (username); - username = _tmp0_; + username = _tmp2_; _g_free0 (password); - password = _tmp1_; - scanner_authorize (scanner, username, password); + password = _tmp3_; + _tmp4_ = scanner; + scanner_authorize (_tmp4_, username, password); _g_free0 (password); _g_free0 (username); } @@ -634,9 +718,12 @@ static void application_authorize_cb (Application* self, Scanner* scanner, const static Page* application_append_page (Application* self) { Page* result = NULL; - Page* _tmp0_ = NULL; + Book* _tmp0_; + Page* _tmp1_ = NULL; Page* page; - gboolean _tmp1_ = FALSE; + gboolean _tmp2_ = FALSE; + Page* _tmp3_; + gboolean _tmp6_; ScanDirection scan_direction; gboolean do_crop; gchar* named_crop; @@ -647,20 +734,41 @@ static Page* application_append_page (Application* self) { gint cy; gint cw; gint ch; - Page* _tmp13_ = NULL; + Page* _tmp10_; + Book* _tmp29_; + gint _tmp30_; + gint _tmp31_; + gint _tmp32_; + ScanDirection _tmp33_; + Page* _tmp34_ = NULL; + gboolean _tmp35_; + SimpleScan* _tmp45_; + Page* _tmp46_; + Page* _tmp47_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = book_get_page (self->priv->book, -1); - page = _tmp0_; - if (page != NULL) { - gboolean _tmp2_; - _tmp2_ = page_has_data (page); - _tmp1_ = !_tmp2_; + _tmp0_ = self->priv->book; + _tmp1_ = book_get_page (_tmp0_, -1); + page = _tmp1_; + _tmp3_ = page; + if (_tmp3_ != NULL) { + Page* _tmp4_; + gboolean _tmp5_ = FALSE; + _tmp4_ = page; + _tmp5_ = page_has_data (_tmp4_); + _tmp2_ = !_tmp5_; } else { - _tmp1_ = FALSE; + _tmp2_ = FALSE; } - if (_tmp1_) { - simple_scan_set_selected_page (self->priv->ui, page); - page_start (page); + _tmp6_ = _tmp2_; + if (_tmp6_) { + SimpleScan* _tmp7_; + Page* _tmp8_; + Page* _tmp9_; + _tmp7_ = self->priv->ui; + _tmp8_ = page; + simple_scan_set_selected_page (_tmp7_, _tmp8_); + _tmp9_ = page; + page_start (_tmp9_); result = page; return result; } @@ -674,51 +782,95 @@ static Page* application_append_page (Application* self) { cy = 0; cw = 0; ch = 0; - if (page != NULL) { - ScanDirection _tmp3_; - gint _tmp4_; - gint _tmp5_; - gint _tmp6_; - gboolean _tmp7_; - _tmp3_ = page_get_scan_direction (page); - scan_direction = _tmp3_; - _tmp4_ = page_get_width (page); - width = _tmp4_; - _tmp5_ = page_get_height (page); - height = _tmp5_; - _tmp6_ = page_get_dpi (page); - dpi = _tmp6_; - _tmp7_ = page_has_crop (page); - do_crop = _tmp7_; - if (do_crop) { - gchar* _tmp8_ = NULL; - gint _tmp9_; - gint _tmp10_; - gint _tmp11_; - gint _tmp12_; - _tmp8_ = page_get_named_crop (page); + _tmp10_ = page; + if (_tmp10_ != NULL) { + Page* _tmp11_; + ScanDirection _tmp12_ = 0; + Page* _tmp13_; + gint _tmp14_ = 0; + Page* _tmp15_; + gint _tmp16_ = 0; + Page* _tmp17_; + gint _tmp18_ = 0; + Page* _tmp19_; + gboolean _tmp20_ = FALSE; + gboolean _tmp21_; + _tmp11_ = page; + _tmp12_ = page_get_scan_direction (_tmp11_); + scan_direction = _tmp12_; + _tmp13_ = page; + _tmp14_ = page_get_width (_tmp13_); + width = _tmp14_; + _tmp15_ = page; + _tmp16_ = page_get_height (_tmp15_); + height = _tmp16_; + _tmp17_ = page; + _tmp18_ = page_get_dpi (_tmp17_); + dpi = _tmp18_; + _tmp19_ = page; + _tmp20_ = page_has_crop (_tmp19_); + do_crop = _tmp20_; + _tmp21_ = do_crop; + if (_tmp21_) { + Page* _tmp22_; + gchar* _tmp23_ = NULL; + Page* _tmp24_; + gint _tmp25_ = 0; + gint _tmp26_ = 0; + gint _tmp27_ = 0; + gint _tmp28_ = 0; + _tmp22_ = page; + _tmp23_ = page_get_named_crop (_tmp22_); _g_free0 (named_crop); - named_crop = _tmp8_; - page_get_crop (page, &_tmp9_, &_tmp10_, &_tmp11_, &_tmp12_); - cx = _tmp9_; - cy = _tmp10_; - cw = _tmp11_; - ch = _tmp12_; + named_crop = _tmp23_; + _tmp24_ = page; + page_get_crop (_tmp24_, &_tmp25_, &_tmp26_, &_tmp27_, &_tmp28_); + cx = _tmp25_; + cy = _tmp26_; + cw = _tmp27_; + ch = _tmp28_; } } - _tmp13_ = book_append_page (self->priv->book, width, height, dpi, scan_direction); + _tmp29_ = self->priv->book; + _tmp30_ = width; + _tmp31_ = height; + _tmp32_ = dpi; + _tmp33_ = scan_direction; + _tmp34_ = book_append_page (_tmp29_, _tmp30_, _tmp31_, _tmp32_, _tmp33_); _page_unref0 (page); - page = _tmp13_; - if (do_crop) { - if (named_crop != NULL) { - page_set_named_crop (page, named_crop); + page = _tmp34_; + _tmp35_ = do_crop; + if (_tmp35_) { + const gchar* _tmp36_; + Page* _tmp42_; + gint _tmp43_; + gint _tmp44_; + _tmp36_ = named_crop; + if (_tmp36_ != NULL) { + Page* _tmp37_; + const gchar* _tmp38_; + _tmp37_ = page; + _tmp38_ = named_crop; + page_set_named_crop (_tmp37_, _tmp38_); } else { - page_set_custom_crop (page, cw, ch); + Page* _tmp39_; + gint _tmp40_; + gint _tmp41_; + _tmp39_ = page; + _tmp40_ = cw; + _tmp41_ = ch; + page_set_custom_crop (_tmp39_, _tmp40_, _tmp41_); } - page_move_crop (page, cx, cy); + _tmp42_ = page; + _tmp43_ = cx; + _tmp44_ = cy; + page_move_crop (_tmp42_, _tmp43_, _tmp44_); } - simple_scan_set_selected_page (self->priv->ui, page); - page_start (page); + _tmp45_ = self->priv->ui; + _tmp46_ = page; + simple_scan_set_selected_page (_tmp45_, _tmp46_); + _tmp47_ = page; + page_start (_tmp47_); result = page; _g_free0 (named_crop); return result; @@ -746,69 +898,109 @@ static gchar* application_get_profile_for_device (Application* self, const gchar static void application_scanner_page_info_cb (Application* self, Scanner* scanner, ScanPageInfo* info) { - Page* _tmp0_ = NULL; + ScanPageInfo* _tmp0_; + gint _tmp1_; + ScanPageInfo* _tmp2_; + gint _tmp3_; + ScanPageInfo* _tmp4_; + gint _tmp5_; + Page* _tmp6_ = NULL; Page* page; - gchar* _tmp1_ = NULL; - gchar* _tmp2_; + ScanPageInfo* _tmp7_; + ScanPageInfo* _tmp8_; + const gchar* _tmp9_; + gchar* _tmp10_ = NULL; + gchar* _tmp11_; g_return_if_fail (self != NULL); g_return_if_fail (scanner != NULL); g_return_if_fail (info != NULL); + _tmp0_ = info; + _tmp1_ = _tmp0_->width; + _tmp2_ = info; + _tmp3_ = _tmp2_->height; + _tmp4_ = info; + _tmp5_ = _tmp4_->depth; g_debug ("simple-scan.vala:236: Page is %d pixels wide, %d pixels high, %d bits " \ -"per pixel", info->width, info->height, info->depth); - _tmp0_ = application_append_page (self); - page = _tmp0_; - page_set_page_info (page, info); - _tmp1_ = application_get_profile_for_device (self, info->device); - _tmp2_ = _tmp1_; - page_set_color_profile (page, _tmp2_); - _g_free0 (_tmp2_); +"per pixel", _tmp1_, _tmp3_, _tmp5_); + _tmp6_ = application_append_page (self); + page = _tmp6_; + _tmp7_ = info; + page_set_page_info (page, _tmp7_); + _tmp8_ = info; + _tmp9_ = _tmp8_->device; + _tmp10_ = application_get_profile_for_device (self, _tmp9_); + _tmp11_ = _tmp10_; + page_set_color_profile (page, _tmp11_); + _g_free0 (_tmp11_); _page_unref0 (page); } static void application_scanner_line_cb (Application* self, Scanner* scanner, ScanLine* line) { - guint _tmp0_; - Page* _tmp1_ = NULL; + Book* _tmp0_; + Book* _tmp1_; + guint _tmp2_ = 0U; + Page* _tmp3_ = NULL; Page* page; + ScanLine* _tmp4_; g_return_if_fail (self != NULL); g_return_if_fail (scanner != NULL); g_return_if_fail (line != NULL); - _tmp0_ = book_get_n_pages (self->priv->book); - _tmp1_ = book_get_page (self->priv->book, ((gint) _tmp0_) - 1); - page = _tmp1_; - page_parse_scan_line (page, line); + _tmp0_ = self->priv->book; + _tmp1_ = self->priv->book; + _tmp2_ = book_get_n_pages (_tmp1_); + _tmp3_ = book_get_page (_tmp0_, ((gint) _tmp2_) - 1); + page = _tmp3_; + _tmp4_ = line; + page_parse_scan_line (page, _tmp4_); _page_unref0 (page); } static void application_scanner_page_done_cb (Application* self, Scanner* scanner) { - guint _tmp0_; - Page* _tmp1_ = NULL; + Book* _tmp0_; + Book* _tmp1_; + guint _tmp2_ = 0U; + Page* _tmp3_ = NULL; Page* page; g_return_if_fail (self != NULL); g_return_if_fail (scanner != NULL); - _tmp0_ = book_get_n_pages (self->priv->book); - _tmp1_ = book_get_page (self->priv->book, ((gint) _tmp0_) - 1); - page = _tmp1_; + _tmp0_ = self->priv->book; + _tmp1_ = self->priv->book; + _tmp2_ = book_get_n_pages (_tmp1_); + _tmp3_ = book_get_page (_tmp0_, ((gint) _tmp2_) - 1); + page = _tmp3_; page_finish (page); _page_unref0 (page); } static void application_remove_empty_page (Application* self) { - guint _tmp0_; - Page* _tmp1_ = NULL; + Book* _tmp0_; + Book* _tmp1_; + guint _tmp2_ = 0U; + Page* _tmp3_ = NULL; Page* page; - gboolean _tmp2_; + Page* _tmp4_; + gboolean _tmp5_ = FALSE; g_return_if_fail (self != NULL); - _tmp0_ = book_get_n_pages (self->priv->book); - _tmp1_ = book_get_page (self->priv->book, ((gint) _tmp0_) - 1); - page = _tmp1_; - _tmp2_ = page_has_data (page); - if (_tmp2_) { - page_finish (page); + _tmp0_ = self->priv->book; + _tmp1_ = self->priv->book; + _tmp2_ = book_get_n_pages (_tmp1_); + _tmp3_ = book_get_page (_tmp0_, ((gint) _tmp2_) - 1); + page = _tmp3_; + _tmp4_ = page; + _tmp5_ = page_has_data (_tmp4_); + if (_tmp5_) { + Page* _tmp6_; + _tmp6_ = page; + page_finish (_tmp6_); } else { - book_delete_page (self->priv->book, page); + Book* _tmp7_; + Page* _tmp8_; + _tmp7_ = self->priv->book; + _tmp8_ = page; + book_delete_page (_tmp7_, _tmp8_); } _page_unref0 (page); } @@ -822,65 +1014,101 @@ static void application_scanner_document_done_cb (Application* self, Scanner* sc static void application_scanner_failed_cb (Application* self, Scanner* scanner, gint error_code, const gchar* error_string) { + gint _tmp0_; g_return_if_fail (self != NULL); g_return_if_fail (scanner != NULL); g_return_if_fail (error_string != NULL); application_remove_empty_page (self); - if (error_code != ((gint) SANE_STATUS_CANCELLED)) { - const gchar* _tmp0_ = NULL; - _tmp0_ = _ ("Failed to scan"); - simple_scan_show_error (self->priv->ui, _tmp0_, error_string, self->priv->have_devices); + _tmp0_ = error_code; + if (_tmp0_ != ((gint) SANE_STATUS_CANCELLED)) { + SimpleScan* _tmp1_; + const gchar* _tmp2_ = NULL; + const gchar* _tmp3_; + gboolean _tmp4_; + _tmp1_ = self->priv->ui; + _tmp2_ = _ ("Failed to scan"); + _tmp3_ = error_string; + _tmp4_ = self->priv->have_devices; + simple_scan_show_error (_tmp1_, _tmp2_, _tmp3_, _tmp4_); } } static void application_scanner_scanning_changed_cb (Application* self, Scanner* scanner) { - gboolean _tmp0_; + SimpleScan* _tmp0_; + Scanner* _tmp1_; + gboolean _tmp2_ = FALSE; g_return_if_fail (self != NULL); g_return_if_fail (scanner != NULL); - _tmp0_ = scanner_is_scanning (scanner); - simple_scan_set_scanning (self->priv->ui, _tmp0_); + _tmp0_ = self->priv->ui; + _tmp1_ = scanner; + _tmp2_ = scanner_is_scanning (_tmp1_); + simple_scan_set_scanning (_tmp0_, _tmp2_); } static void application_scan_cb (Application* self, SimpleScan* ui, const gchar* device, ScanOptions* options) { - gboolean _tmp0_; - const gchar* _tmp3_ = NULL; - gchar* _tmp4_; + ScanOptions* _tmp0_; + gint _tmp1_; + const gchar* _tmp2_; + Scanner* _tmp3_; + gboolean _tmp4_ = FALSE; + const gchar* _tmp7_ = NULL; + gchar* _tmp8_; gchar* filename_prefix; gchar* extension = NULL; - gchar* _tmp7_ = NULL; + ScanOptions* _tmp9_; + ScanMode _tmp10_; + const gchar* _tmp13_; + const gchar* _tmp14_; + gchar* _tmp15_ = NULL; gchar* filename; + SimpleScan* _tmp16_; + Scanner* _tmp17_; + const gchar* _tmp18_; + ScanOptions* _tmp19_; g_return_if_fail (self != NULL); g_return_if_fail (ui != NULL); g_return_if_fail (options != NULL); - g_debug ("simple-scan.vala:296: Requesting scan at %d dpi from device '%s'", options->dpi, device); - _tmp0_ = scanner_is_scanning (self->priv->scanner); - if (!_tmp0_) { - Page* _tmp1_ = NULL; - Page* _tmp2_; - _tmp1_ = application_append_page (self); - _tmp2_ = _tmp1_; - _page_unref0 (_tmp2_); + _tmp0_ = options; + _tmp1_ = _tmp0_->dpi; + _tmp2_ = device; + g_debug ("simple-scan.vala:296: Requesting scan at %d dpi from device '%s'", _tmp1_, _tmp2_); + _tmp3_ = self->priv->scanner; + _tmp4_ = scanner_is_scanning (_tmp3_); + if (!_tmp4_) { + Page* _tmp5_ = NULL; + Page* _tmp6_; + _tmp5_ = application_append_page (self); + _tmp6_ = _tmp5_; + _page_unref0 (_tmp6_); } - _tmp3_ = _ ("Scanned Document"); - _tmp4_ = g_strdup (_tmp3_); - filename_prefix = _tmp4_; - if (options->scan_mode == SCAN_MODE_COLOR) { - gchar* _tmp5_; - _tmp5_ = g_strdup ("jpg"); + _tmp7_ = _ ("Scanned Document"); + _tmp8_ = g_strdup (_tmp7_); + filename_prefix = _tmp8_; + _tmp9_ = options; + _tmp10_ = _tmp9_->scan_mode; + if (_tmp10_ == SCAN_MODE_COLOR) { + gchar* _tmp11_; + _tmp11_ = g_strdup ("jpg"); _g_free0 (extension); - extension = _tmp5_; + extension = _tmp11_; } else { - gchar* _tmp6_; - _tmp6_ = g_strdup ("pdf"); + gchar* _tmp12_; + _tmp12_ = g_strdup ("pdf"); _g_free0 (extension); - extension = _tmp6_; + extension = _tmp12_; } - _tmp7_ = g_strdup_printf ("%s.%s", filename_prefix, extension); - filename = _tmp7_; - simple_scan_set_default_file_name (ui, filename); - scanner_scan (self->priv->scanner, device, options); + _tmp13_ = filename_prefix; + _tmp14_ = extension; + _tmp15_ = g_strdup_printf ("%s.%s", _tmp13_, _tmp14_); + filename = _tmp15_; + _tmp16_ = ui; + simple_scan_set_default_file_name (_tmp16_, filename); + _tmp17_ = self->priv->scanner; + _tmp18_ = device; + _tmp19_ = options; + scanner_scan (_tmp17_, _tmp18_, _tmp19_); _g_free0 (filename); _g_free0 (extension); _g_free0 (filename_prefix); @@ -888,43 +1116,57 @@ static void application_scan_cb (Application* self, SimpleScan* ui, const gchar* static void application_cancel_cb (Application* self, SimpleScan* ui) { + Scanner* _tmp0_; g_return_if_fail (self != NULL); g_return_if_fail (ui != NULL); - scanner_cancel (self->priv->scanner); + _tmp0_ = self->priv->scanner; + scanner_cancel (_tmp0_); } static gchar* application_get_temporary_filename (Application* self, const gchar* prefix, const gchar* extension) { gchar* result = NULL; - gchar* _tmp0_ = NULL; + const gchar* _tmp0_; + const gchar* _tmp1_; + gchar* _tmp2_ = NULL; gchar* filename; gchar* path = NULL; GError * _inner_error_ = NULL; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (prefix != NULL, NULL); g_return_val_if_fail (extension != NULL, NULL); - _tmp0_ = g_strdup_printf ("%sXXXXXX.%s", prefix, extension); - filename = _tmp0_; + _tmp0_ = prefix; + _tmp1_ = extension; + _tmp2_ = g_strdup_printf ("%sXXXXXX.%s", _tmp0_, _tmp1_); + filename = _tmp2_; { - gchar* _tmp1_ = NULL; - gint _tmp2_; + const gchar* _tmp3_; + gchar* _tmp4_ = NULL; + gint _tmp5_ = 0; gint fd; - _tmp2_ = g_file_open_tmp (filename, &_tmp1_, &_inner_error_); + gint _tmp6_; + _tmp3_ = filename; + _tmp5_ = g_file_open_tmp (_tmp3_, &_tmp4_, &_inner_error_); _g_free0 (path); - path = _tmp1_; - fd = _tmp2_; + path = _tmp4_; + fd = _tmp5_; if (_inner_error_ != NULL) { goto __catch3_g_error; } - close (fd); + _tmp6_ = fd; + close (_tmp6_); } goto __finally3; __catch3_g_error: { GError* e = NULL; + GError* _tmp7_; + const gchar* _tmp8_; e = _inner_error_; _inner_error_ = NULL; - g_warning ("simple-scan.vala:332: Error saving email attachment: %s", e->message); + _tmp7_ = e; + _tmp8_ = _tmp7_->message; + g_warning ("simple-scan.vala:332: Error saving email attachment: %s", _tmp8_); result = NULL; _g_error_free0 (e); _g_free0 (path); @@ -949,6 +1191,8 @@ static void application_email_cb (Application* self, SimpleScan* ui, const gchar gboolean saved; gchar* _tmp0_; gchar* command_line; + const gchar* _tmp1_; + const gchar* _tmp38_; GError * _inner_error_ = NULL; g_return_if_fail (self != NULL); g_return_if_fail (ui != NULL); @@ -956,21 +1200,32 @@ static void application_email_cb (Application* self, SimpleScan* ui, const gchar saved = FALSE; _tmp0_ = g_strdup ("xdg-email"); command_line = _tmp0_; - if (g_strcmp0 (profile, "text") == 0) { - gchar* _tmp1_ = NULL; + _tmp1_ = profile; + if (g_strcmp0 (_tmp1_, "text") == 0) { + gchar* _tmp2_ = NULL; gchar* path; - _tmp1_ = application_get_temporary_filename (self, "scan", "pdf"); - path = _tmp1_; - if (path != NULL) { - GFile* _tmp2_ = NULL; + const gchar* _tmp3_; + _tmp2_ = application_get_temporary_filename (self, "scan", "pdf"); + path = _tmp2_; + _tmp3_ = path; + if (_tmp3_ != NULL) { + const gchar* _tmp4_; + GFile* _tmp5_ = NULL; GFile* file; - gchar* _tmp3_ = NULL; - gchar* _tmp4_; - gchar* _tmp5_; - _tmp2_ = g_file_new_for_path (path); - file = _tmp2_; + const gchar* _tmp10_; + const gchar* _tmp11_; + gchar* _tmp12_ = NULL; + gchar* _tmp13_; + gchar* _tmp14_; + _tmp4_ = path; + _tmp5_ = g_file_new_for_path (_tmp4_); + file = _tmp5_; { - book_save (self->priv->book, "pdf", file, &_inner_error_); + Book* _tmp6_; + GFile* _tmp7_; + _tmp6_ = self->priv->book; + _tmp7_ = file; + book_save (_tmp6_, "pdf", _tmp7_, &_inner_error_); if (_inner_error_ != NULL) { goto __catch4_g_error; } @@ -979,9 +1234,13 @@ static void application_email_cb (Application* self, SimpleScan* ui, const gchar __catch4_g_error: { GError* e = NULL; + GError* _tmp8_; + const gchar* _tmp9_; e = _inner_error_; _inner_error_ = NULL; - g_warning ("simple-scan.vala:358: Unable to save email file: %s", e->message); + _tmp8_ = e; + _tmp9_ = _tmp8_->message; + g_warning ("simple-scan.vala:358: Unable to save email file: %s", _tmp9_); _g_error_free0 (e); _g_object_unref0 (file); _g_free0 (path); @@ -997,12 +1256,14 @@ static void application_email_cb (Application* self, SimpleScan* ui, const gchar g_clear_error (&_inner_error_); return; } - _tmp3_ = g_strdup_printf (" --attach %s", path); - _tmp4_ = _tmp3_; - _tmp5_ = g_strconcat (command_line, _tmp4_, NULL); + _tmp10_ = command_line; + _tmp11_ = path; + _tmp12_ = g_strdup_printf (" --attach %s", _tmp11_); + _tmp13_ = _tmp12_; + _tmp14_ = g_strconcat (_tmp10_, _tmp13_, NULL); _g_free0 (command_line); - command_line = _tmp5_; - _g_free0 (_tmp4_); + command_line = _tmp14_; + _g_free0 (_tmp13_); _g_object_unref0 (file); } _g_free0 (path); @@ -1011,41 +1272,62 @@ static void application_email_cb (Application* self, SimpleScan* ui, const gchar gint i; i = 0; { - gboolean _tmp6_; - _tmp6_ = TRUE; + gboolean _tmp15_; + _tmp15_ = TRUE; while (TRUE) { - guint _tmp7_; - gchar* _tmp8_ = NULL; + gboolean _tmp16_; + gint _tmp18_; + Book* _tmp19_; + guint _tmp20_ = 0U; + gchar* _tmp21_ = NULL; gchar* path; - GFile* _tmp9_ = NULL; + const gchar* _tmp22_; + const gchar* _tmp23_; + GFile* _tmp24_ = NULL; GFile* file; - gchar* _tmp12_ = NULL; - gchar* _tmp13_; - gchar* _tmp14_; - if (!_tmp6_) { - i++; + const gchar* _tmp32_; + const gchar* _tmp33_; + gchar* _tmp34_ = NULL; + gchar* _tmp35_; + gchar* _tmp36_; + gboolean _tmp37_; + _tmp16_ = _tmp15_; + if (!_tmp16_) { + gint _tmp17_; + _tmp17_ = i; + i = _tmp17_ + 1; } - _tmp6_ = FALSE; - _tmp7_ = book_get_n_pages (self->priv->book); - if (!(((guint) i) < _tmp7_)) { + _tmp15_ = FALSE; + _tmp18_ = i; + _tmp19_ = self->priv->book; + _tmp20_ = book_get_n_pages (_tmp19_); + if (!(((guint) _tmp18_) < _tmp20_)) { break; } - _tmp8_ = application_get_temporary_filename (self, "scan", "jpg"); - path = _tmp8_; - if (path == NULL) { + _tmp21_ = application_get_temporary_filename (self, "scan", "jpg"); + path = _tmp21_; + _tmp22_ = path; + if (_tmp22_ == NULL) { saved = FALSE; _g_free0 (path); break; } - _tmp9_ = g_file_new_for_path (path); - file = _tmp9_; + _tmp23_ = path; + _tmp24_ = g_file_new_for_path (_tmp23_); + file = _tmp24_; { - Page* _tmp10_ = NULL; - Page* _tmp11_; - _tmp10_ = book_get_page (self->priv->book, i); - _tmp11_ = _tmp10_; - page_save (_tmp11_, "jpeg", file, &_inner_error_); - _page_unref0 (_tmp11_); + Book* _tmp25_; + gint _tmp26_; + Page* _tmp27_ = NULL; + Page* _tmp28_; + GFile* _tmp29_; + _tmp25_ = self->priv->book; + _tmp26_ = i; + _tmp27_ = book_get_page (_tmp25_, _tmp26_); + _tmp28_ = _tmp27_; + _tmp29_ = file; + page_save (_tmp28_, "jpeg", _tmp29_, &_inner_error_); + _page_unref0 (_tmp28_); if (_inner_error_ != NULL) { goto __catch5_g_error; } @@ -1054,9 +1336,13 @@ static void application_email_cb (Application* self, SimpleScan* ui, const gchar __catch5_g_error: { GError* e = NULL; + GError* _tmp30_; + const gchar* _tmp31_; e = _inner_error_; _inner_error_ = NULL; - g_warning ("simple-scan.vala:382: Unable to save email file: %s", e->message); + _tmp30_ = e; + _tmp31_ = _tmp30_->message; + g_warning ("simple-scan.vala:382: Unable to save email file: %s", _tmp31_); _g_error_free0 (e); _g_object_unref0 (file); _g_free0 (path); @@ -1072,13 +1358,16 @@ static void application_email_cb (Application* self, SimpleScan* ui, const gchar g_clear_error (&_inner_error_); return; } - _tmp12_ = g_strdup_printf (" --attach %s", path); - _tmp13_ = _tmp12_; - _tmp14_ = g_strconcat (command_line, _tmp13_, NULL); + _tmp32_ = command_line; + _tmp33_ = path; + _tmp34_ = g_strdup_printf (" --attach %s", _tmp33_); + _tmp35_ = _tmp34_; + _tmp36_ = g_strconcat (_tmp32_, _tmp35_, NULL); _g_free0 (command_line); - command_line = _tmp14_; - _g_free0 (_tmp13_); - if (!saved) { + command_line = _tmp36_; + _g_free0 (_tmp35_); + _tmp37_ = saved; + if (!_tmp37_) { _g_object_unref0 (file); _g_free0 (path); break; @@ -1089,9 +1378,12 @@ static void application_email_cb (Application* self, SimpleScan* ui, const gchar } } } - g_debug ("simple-scan.vala:392: Launching email client: %s", command_line); + _tmp38_ = command_line; + g_debug ("simple-scan.vala:392: Launching email client: %s", _tmp38_); { - g_spawn_command_line_async (command_line, &_inner_error_); + const gchar* _tmp39_; + _tmp39_ = command_line; + g_spawn_command_line_async (_tmp39_, &_inner_error_); if (_inner_error_ != NULL) { goto __catch6_g_error; } @@ -1100,9 +1392,13 @@ static void application_email_cb (Application* self, SimpleScan* ui, const gchar __catch6_g_error: { GError* e = NULL; + GError* _tmp40_; + const gchar* _tmp41_; e = _inner_error_; _inner_error_ = NULL; - g_warning ("simple-scan.vala:399: Unable to start email: %s", e->message); + _tmp40_ = e; + _tmp41_ = _tmp40_->message; + g_warning ("simple-scan.vala:399: Unable to start email: %s", _tmp41_); _g_error_free0 (e); } __finally6: @@ -1117,6 +1413,7 @@ static void application_email_cb (Application* self, SimpleScan* ui, const gchar static void application_quit_cb (Application* self, SimpleScan* ui) { + Scanner* _tmp0_; g_return_if_fail (self != NULL); g_return_if_fail (ui != NULL); _book_unref0 (self->priv->book); @@ -1124,108 +1421,159 @@ static void application_quit_cb (Application* self, SimpleScan* ui) { ui = NULL; _g_object_unref0 (self->priv->udev_client); self->priv->udev_client = NULL; - scanner_free (self->priv->scanner); + _tmp0_ = self->priv->scanner; + scanner_free (_tmp0_); gtk_main_quit (); } static void application_log_cb (const gchar* log_domain, GLogLevelFlags log_level, const gchar* message) { + FILE* _tmp0_; + GLogLevelFlags _tmp14_; g_return_if_fail (message != NULL); - if (application_log_file != NULL) { + _tmp0_ = application_log_file; + if (_tmp0_ != NULL) { gchar* prefix = NULL; - gdouble _tmp7_; - switch (log_level & G_LOG_LEVEL_MASK) { + GLogLevelFlags _tmp1_; + FILE* _tmp9_; + GTimer* _tmp10_; + gdouble _tmp11_ = 0.0; + const gchar* _tmp12_; + const gchar* _tmp13_; + _tmp1_ = log_level; + switch (_tmp1_ & G_LOG_LEVEL_MASK) { case G_LOG_LEVEL_ERROR: { - gchar* _tmp0_; - _tmp0_ = g_strdup ("ERROR:"); + gchar* _tmp2_; + _tmp2_ = g_strdup ("ERROR:"); _g_free0 (prefix); - prefix = _tmp0_; + prefix = _tmp2_; break; } case G_LOG_LEVEL_CRITICAL: { - gchar* _tmp1_; - _tmp1_ = g_strdup ("CRITICAL:"); + gchar* _tmp3_; + _tmp3_ = g_strdup ("CRITICAL:"); _g_free0 (prefix); - prefix = _tmp1_; + prefix = _tmp3_; break; } case G_LOG_LEVEL_WARNING: { - gchar* _tmp2_; - _tmp2_ = g_strdup ("WARNING:"); + gchar* _tmp4_; + _tmp4_ = g_strdup ("WARNING:"); _g_free0 (prefix); - prefix = _tmp2_; + prefix = _tmp4_; break; } case G_LOG_LEVEL_MESSAGE: { - gchar* _tmp3_; - _tmp3_ = g_strdup ("MESSAGE:"); + gchar* _tmp5_; + _tmp5_ = g_strdup ("MESSAGE:"); _g_free0 (prefix); - prefix = _tmp3_; + prefix = _tmp5_; break; } case G_LOG_LEVEL_INFO: { - gchar* _tmp4_; - _tmp4_ = g_strdup ("INFO:"); + gchar* _tmp6_; + _tmp6_ = g_strdup ("INFO:"); _g_free0 (prefix); - prefix = _tmp4_; + prefix = _tmp6_; break; } case G_LOG_LEVEL_DEBUG: { - gchar* _tmp5_; - _tmp5_ = g_strdup ("DEBUG:"); + gchar* _tmp7_; + _tmp7_ = g_strdup ("DEBUG:"); _g_free0 (prefix); - prefix = _tmp5_; + prefix = _tmp7_; break; } default: { - gchar* _tmp6_; - _tmp6_ = g_strdup ("LOG:"); + gchar* _tmp8_; + _tmp8_ = g_strdup ("LOG:"); _g_free0 (prefix); - prefix = _tmp6_; + prefix = _tmp8_; break; } } - _tmp7_ = g_timer_elapsed (application_log_timer, NULL); - fprintf (application_log_file, "[%+.2fs] %s %s\n", _tmp7_, prefix, message); + _tmp9_ = application_log_file; + _tmp10_ = application_log_timer; + _tmp11_ = g_timer_elapsed (_tmp10_, NULL); + _tmp12_ = prefix; + _tmp13_ = message; + fprintf (_tmp9_, "[%+.2fs] %s %s\n", _tmp11_, _tmp12_, _tmp13_); _g_free0 (prefix); } - if ((log_level & G_LOG_LEVEL_DEBUG) != 0) { - if (application_debug_enabled) { - g_log_default_handler (log_domain, log_level, message, NULL); + _tmp14_ = log_level; + if ((_tmp14_ & G_LOG_LEVEL_DEBUG) != 0) { + gboolean _tmp15_; + _tmp15_ = application_debug_enabled; + if (_tmp15_) { + GLogFunc _tmp16_; + void* _tmp16__target; + const gchar* _tmp17_; + GLogLevelFlags _tmp18_; + const gchar* _tmp19_; + _tmp16_ = g_log_default_handler; + _tmp16__target = NULL; + _tmp17_ = log_domain; + _tmp18_ = log_level; + _tmp19_ = message; + _tmp16_ (_tmp17_, _tmp18_, _tmp19_, _tmp16__target); } } else { - g_log_default_handler (log_domain, log_level, message, NULL); + GLogFunc _tmp20_; + void* _tmp20__target; + const gchar* _tmp21_; + GLogLevelFlags _tmp22_; + const gchar* _tmp23_; + _tmp20_ = g_log_default_handler; + _tmp20__target = NULL; + _tmp21_ = log_domain; + _tmp22_ = log_level; + _tmp23_ = message; + _tmp20_ (_tmp21_, _tmp22_, _tmp23_, _tmp20__target); } } static void application_on_uevent (Application* self, GUdevClient* client, const gchar* action, GUdevDevice* device) { + Scanner* _tmp0_; g_return_if_fail (self != NULL); g_return_if_fail (client != NULL); g_return_if_fail (action != NULL); g_return_if_fail (device != NULL); - scanner_redetect (self->priv->scanner); + _tmp0_ = self->priv->scanner; + scanner_redetect (_tmp0_); } static glong string_strnlen (gchar* str, glong maxlen) { glong result = 0L; - gchar* _tmp0_ = NULL; + gchar* _tmp0_; + glong _tmp1_; + gchar* _tmp2_ = NULL; gchar* end; - _tmp0_ = memchr (str, 0, (gsize) maxlen); - end = _tmp0_; - if (end == NULL) { - result = maxlen; + gchar* _tmp3_; + _tmp0_ = str; + _tmp1_ = maxlen; + _tmp2_ = memchr (_tmp0_, 0, (gsize) _tmp1_); + end = _tmp2_; + _tmp3_ = end; + if (_tmp3_ == NULL) { + glong _tmp4_; + _tmp4_ = maxlen; + result = _tmp4_; return result; } else { - result = (glong) (end - str); + gchar* _tmp5_; + gchar* _tmp6_; + _tmp5_ = end; + _tmp6_ = str; + result = (glong) (_tmp5_ - _tmp6_); return result; } } @@ -1235,34 +1583,74 @@ static gchar* string_substring (const gchar* self, glong offset, glong len) { gchar* result = NULL; glong string_length = 0L; gboolean _tmp0_ = FALSE; - gchar* _tmp3_ = NULL; + glong _tmp1_; + gboolean _tmp3_; + glong _tmp9_; + glong _tmp15_; + glong _tmp18_; + glong _tmp19_; + glong _tmp20_; + glong _tmp21_; + glong _tmp22_; + gchar* _tmp23_ = NULL; g_return_val_if_fail (self != NULL, NULL); - if (offset >= ((glong) 0)) { - _tmp0_ = len >= ((glong) 0); + _tmp1_ = offset; + if (_tmp1_ >= ((glong) 0)) { + glong _tmp2_; + _tmp2_ = len; + _tmp0_ = _tmp2_ >= ((glong) 0); } else { _tmp0_ = FALSE; } - if (_tmp0_) { - glong _tmp1_; - _tmp1_ = string_strnlen ((gchar*) self, offset + len); - string_length = _tmp1_; + _tmp3_ = _tmp0_; + if (_tmp3_) { + glong _tmp4_; + glong _tmp5_; + glong _tmp6_ = 0L; + _tmp4_ = offset; + _tmp5_ = len; + _tmp6_ = string_strnlen ((gchar*) self, _tmp4_ + _tmp5_); + string_length = _tmp6_; } else { - gint _tmp2_; - _tmp2_ = strlen (self); - string_length = (glong) _tmp2_; + gint _tmp7_; + gint _tmp8_; + _tmp7_ = strlen (self); + _tmp8_ = _tmp7_; + string_length = (glong) _tmp8_; } - if (offset < ((glong) 0)) { - offset = string_length + offset; - g_return_val_if_fail (offset >= ((glong) 0), NULL); + _tmp9_ = offset; + if (_tmp9_ < ((glong) 0)) { + glong _tmp10_; + glong _tmp11_; + glong _tmp12_; + _tmp10_ = string_length; + _tmp11_ = offset; + offset = _tmp10_ + _tmp11_; + _tmp12_ = offset; + g_return_val_if_fail (_tmp12_ >= ((glong) 0), NULL); } else { - g_return_val_if_fail (offset <= string_length, NULL); + glong _tmp13_; + glong _tmp14_; + _tmp13_ = offset; + _tmp14_ = string_length; + g_return_val_if_fail (_tmp13_ <= _tmp14_, NULL); } - if (len < ((glong) 0)) { - len = string_length - offset; + _tmp15_ = len; + if (_tmp15_ < ((glong) 0)) { + glong _tmp16_; + glong _tmp17_; + _tmp16_ = string_length; + _tmp17_ = offset; + len = _tmp16_ - _tmp17_; } - g_return_val_if_fail ((offset + len) <= string_length, NULL); - _tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len); - result = _tmp3_; + _tmp18_ = offset; + _tmp19_ = len; + _tmp20_ = string_length; + g_return_val_if_fail ((_tmp18_ + _tmp19_) <= _tmp20_, NULL); + _tmp21_ = offset; + _tmp22_ = len; + _tmp23_ = g_strndup (((gchar*) self) + _tmp21_, (gsize) _tmp22_); + result = _tmp23_; return result; } @@ -1271,156 +1659,282 @@ static void application_fix_pdf (const gchar* filename, GError** error) { guint8* data = NULL; gint data_length1 = 0; gint _data_size_ = 0; - guint8* _tmp0_ = NULL; - size_t _tmp1_; - gchar* _tmp2_; - gchar* _tmp3_; - FILE* _tmp4_ = NULL; - FILE* _tmp5_; + const gchar* _tmp0_; + guint8* _tmp1_ = NULL; + size_t _tmp2_; + const gchar* _tmp3_; + gchar* _tmp4_; + gchar* _tmp5_; + FILE* _tmp6_ = NULL; + FILE* _tmp7_; FILE* fixed_file; gint offset; gint line_number; gint xref_offset; gint xref_line; - GRegex* _tmp6_ = NULL; + GRegex* _tmp8_; GRegex* xref_regex; GMatchInfo* xref_match = NULL; - GString* _tmp7_ = NULL; + GString* _tmp9_; GString* line; - gchar* _tmp25_; - gchar* _tmp26_; - gint _tmp27_; - gboolean _tmp28_; + const gchar* _tmp84_; + const gchar* _tmp85_; + gchar* _tmp86_; + gchar* _tmp87_; + gint _tmp88_ = 0; + gboolean _tmp89_; GError * _inner_error_ = NULL; g_return_if_fail (filename != NULL); - g_file_get_contents (filename, (gchar**) (&_tmp0_), &_tmp1_, &_inner_error_); + _tmp0_ = filename; + g_file_get_contents (_tmp0_, (gchar**) (&_tmp1_), &_tmp2_, &_inner_error_); data = (g_free (data), NULL); - data = _tmp0_; - data_length1 = _tmp1_; + data = _tmp1_; + data_length1 = _tmp2_; _data_size_ = data_length1; if (_inner_error_ != NULL) { g_propagate_error (error, _inner_error_); data = (g_free (data), NULL); return; } - _tmp2_ = g_strconcat (filename, ".fixed", NULL); - _tmp3_ = _tmp2_; - _tmp4_ = fopen (_tmp3_, "w"); + _tmp3_ = filename; + _tmp4_ = g_strconcat (_tmp3_, ".fixed", NULL); _tmp5_ = _tmp4_; - _g_free0 (_tmp3_); - fixed_file = _tmp5_; + _tmp6_ = fopen (_tmp5_, "w"); + _tmp7_ = _tmp6_; + _g_free0 (_tmp5_); + fixed_file = _tmp7_; offset = 0; line_number = 0; xref_offset = 0; xref_line = -1; - _tmp6_ = g_regex_new ("^\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d 0000 n$", 0, 0, &_inner_error_); - xref_regex = _tmp6_; + _tmp8_ = g_regex_new ("^\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d 0000 n$", 0, 0, &_inner_error_); + xref_regex = _tmp8_; if (_inner_error_ != NULL) { g_propagate_error (error, _inner_error_); _fclose0 (fixed_file); data = (g_free (data), NULL); return; } - _tmp7_ = g_string_new (""); - line = _tmp7_; + _tmp9_ = g_string_new (""); + line = _tmp9_; while (TRUE) { + gint _tmp10_; + guint8* _tmp11_; + gint _tmp11__length1; + gint _tmp12_; gint end_offset; - gboolean _tmp8_ = FALSE; - if (!(offset < data_length1)) { + GString* _tmp13_; + GString* _tmp23_; + const gchar* _tmp24_; + gboolean _tmp26_ = FALSE; + gint _tmp27_; + gboolean _tmp31_; + gint _tmp82_; + gint _tmp83_; + _tmp10_ = offset; + _tmp11_ = data; + _tmp11__length1 = data_length1; + if (!(_tmp10_ < _tmp11__length1)) { break; } - end_offset = offset; - g_string_assign (line, ""); + _tmp12_ = offset; + end_offset = _tmp12_; + _tmp13_ = line; + g_string_assign (_tmp13_, ""); while (TRUE) { + gint _tmp14_; + guint8* _tmp15_; + gint _tmp15__length1; + guint8* _tmp16_; + gint _tmp16__length1; + gint _tmp17_; + guint8 _tmp18_; guint8 c; - if (!(end_offset < data_length1)) { + GString* _tmp19_; + guint8 _tmp20_; + gint _tmp21_; + guint8 _tmp22_; + _tmp14_ = end_offset; + _tmp15_ = data; + _tmp15__length1 = data_length1; + if (!(_tmp14_ < _tmp15__length1)) { break; } - c = data[end_offset]; - g_string_append_c (line, (gchar) c); - end_offset++; - if (c == ((guint8) '\n')) { + _tmp16_ = data; + _tmp16__length1 = data_length1; + _tmp17_ = end_offset; + _tmp18_ = _tmp16_[_tmp17_]; + c = _tmp18_; + _tmp19_ = line; + _tmp20_ = c; + g_string_append_c (_tmp19_, (gchar) _tmp20_); + _tmp21_ = end_offset; + end_offset = _tmp21_ + 1; + _tmp22_ = c; + if (_tmp22_ == ((guint8) '\n')) { break; } } - if (g_strcmp0 (line->str, "startxref\n") == 0) { - xref_line = line_number; + _tmp23_ = line; + _tmp24_ = _tmp23_->str; + if (g_strcmp0 (_tmp24_, "startxref\n") == 0) { + gint _tmp25_; + _tmp25_ = line_number; + xref_line = _tmp25_; } - if (line_number < 2) { - gboolean _tmp9_; - _tmp9_ = g_str_has_prefix (line->str, "%%"); - _tmp8_ = _tmp9_; + _tmp27_ = line_number; + if (_tmp27_ < 2) { + GString* _tmp28_; + const gchar* _tmp29_; + gboolean _tmp30_ = FALSE; + _tmp28_ = line; + _tmp29_ = _tmp28_->str; + _tmp30_ = g_str_has_prefix (_tmp29_, "%%"); + _tmp26_ = _tmp30_; } else { - _tmp8_ = FALSE; + _tmp26_ = FALSE; } - if (_tmp8_) { - gchar* _tmp10_ = NULL; - gchar* _tmp11_; - xref_offset--; - _tmp10_ = string_substring (line->str, (glong) 1, (glong) (-1)); - _tmp11_ = _tmp10_; - fprintf (fixed_file, "%s", _tmp11_); - _g_free0 (_tmp11_); + _tmp31_ = _tmp26_; + if (_tmp31_) { + gint _tmp32_; + FILE* _tmp33_; + GString* _tmp34_; + const gchar* _tmp35_; + gchar* _tmp36_ = NULL; + gchar* _tmp37_; + _tmp32_ = xref_offset; + xref_offset = _tmp32_ - 1; + _tmp33_ = fixed_file; + _tmp34_ = line; + _tmp35_ = _tmp34_->str; + _tmp36_ = string_substring (_tmp35_, (glong) 1, (glong) (-1)); + _tmp37_ = _tmp36_; + fprintf (_tmp33_, "%s", _tmp37_); + _g_free0 (_tmp37_); } else { - GMatchInfo* _tmp12_ = NULL; - gboolean _tmp13_; - _tmp13_ = g_regex_match (xref_regex, line->str, 0, &_tmp12_); + GRegex* _tmp38_; + GString* _tmp39_; + const gchar* _tmp40_; + GMatchInfo* _tmp41_ = NULL; + gboolean _tmp42_ = FALSE; + _tmp38_ = xref_regex; + _tmp39_ = line; + _tmp40_ = _tmp39_->str; + _tmp42_ = g_regex_match (_tmp38_, _tmp40_, 0, &_tmp41_); _g_match_info_free0 (xref_match); - xref_match = _tmp12_; - if (_tmp13_) { - const gchar* _tmp14_ = NULL; - gint _tmp15_; - _tmp14_ = g_match_info_get_string (xref_match); - _tmp15_ = atoi (_tmp14_); - fprintf (fixed_file, "%010d 00000 n \n", _tmp15_ + xref_offset); + xref_match = _tmp41_; + if (_tmp42_) { + FILE* _tmp43_; + GMatchInfo* _tmp44_; + const gchar* _tmp45_ = NULL; + gint _tmp46_ = 0; + gint _tmp47_; + _tmp43_ = fixed_file; + _tmp44_ = xref_match; + _tmp45_ = g_match_info_get_string (_tmp44_); + _tmp46_ = atoi (_tmp45_); + _tmp47_ = xref_offset; + fprintf (_tmp43_, "%010d 00000 n \n", _tmp46_ + _tmp47_); } else { - gboolean _tmp16_ = FALSE; - if (xref_line > 0) { - _tmp16_ = line_number == (xref_line + 1); + gboolean _tmp48_ = FALSE; + gint _tmp49_; + gboolean _tmp52_; + _tmp49_ = xref_line; + if (_tmp49_ > 0) { + gint _tmp50_; + gint _tmp51_; + _tmp50_ = line_number; + _tmp51_ = xref_line; + _tmp48_ = _tmp50_ == (_tmp51_ + 1); } else { - _tmp16_ = FALSE; + _tmp48_ = FALSE; } - if (_tmp16_) { - gint _tmp17_; - gchar* _tmp18_ = NULL; - gchar* _tmp19_; - _tmp17_ = atoi (line->str); - _tmp18_ = g_strdup_printf ("%d\n", _tmp17_ + xref_offset); - _tmp19_ = _tmp18_; - fprintf (fixed_file, "%s", _tmp19_); - _g_free0 (_tmp19_); + _tmp52_ = _tmp48_; + if (_tmp52_) { + FILE* _tmp53_; + GString* _tmp54_; + const gchar* _tmp55_; + gint _tmp56_ = 0; + gint _tmp57_; + gchar* _tmp58_ = NULL; + gchar* _tmp59_; + _tmp53_ = fixed_file; + _tmp54_ = line; + _tmp55_ = _tmp54_->str; + _tmp56_ = atoi (_tmp55_); + _tmp57_ = xref_offset; + _tmp58_ = g_strdup_printf ("%d\n", _tmp56_ + _tmp57_); + _tmp59_ = _tmp58_; + fprintf (_tmp53_, "%s", _tmp59_); + _g_free0 (_tmp59_); } else { - gboolean _tmp20_ = FALSE; - if (line_number == (xref_line + 2)) { - gboolean _tmp21_; - _tmp21_ = g_str_has_prefix (line->str, "%%%%"); - _tmp20_ = _tmp21_; + gboolean _tmp60_ = FALSE; + gint _tmp61_; + gint _tmp62_; + gboolean _tmp66_; + _tmp61_ = line_number; + _tmp62_ = xref_line; + if (_tmp61_ == (_tmp62_ + 2)) { + GString* _tmp63_; + const gchar* _tmp64_; + gboolean _tmp65_ = FALSE; + _tmp63_ = line; + _tmp64_ = _tmp63_->str; + _tmp65_ = g_str_has_prefix (_tmp64_, "%%%%"); + _tmp60_ = _tmp65_; } else { - _tmp20_ = FALSE; + _tmp60_ = FALSE; } - if (_tmp20_) { - gchar* _tmp22_ = NULL; - gchar* _tmp23_; - _tmp22_ = string_substring (line->str, (glong) 2, (glong) (-1)); - _tmp23_ = _tmp22_; - fprintf (fixed_file, "%s", _tmp23_); - _g_free0 (_tmp23_); + _tmp66_ = _tmp60_; + if (_tmp66_) { + FILE* _tmp67_; + GString* _tmp68_; + const gchar* _tmp69_; + gchar* _tmp70_ = NULL; + gchar* _tmp71_; + _tmp67_ = fixed_file; + _tmp68_ = line; + _tmp69_ = _tmp68_->str; + _tmp70_ = string_substring (_tmp69_, (glong) 2, (glong) (-1)); + _tmp71_ = _tmp70_; + fprintf (_tmp67_, "%s", _tmp71_); + _g_free0 (_tmp71_); } else { { + gint _tmp72_; gint i; - i = offset; + _tmp72_ = offset; + i = _tmp72_; { - gboolean _tmp24_; - _tmp24_ = TRUE; + gboolean _tmp73_; + _tmp73_ = TRUE; while (TRUE) { - if (!_tmp24_) { - i++; + gboolean _tmp74_; + gint _tmp76_; + gint _tmp77_; + FILE* _tmp78_; + guint8* _tmp79_; + gint _tmp79__length1; + gint _tmp80_; + guint8 _tmp81_; + _tmp74_ = _tmp73_; + if (!_tmp74_) { + gint _tmp75_; + _tmp75_ = i; + i = _tmp75_ + 1; } - _tmp24_ = FALSE; - if (!(i < end_offset)) { + _tmp73_ = FALSE; + _tmp76_ = i; + _tmp77_ = end_offset; + if (!(_tmp76_ < _tmp77_)) { break; } - fputc ((gchar) data[i], fixed_file); + _tmp78_ = fixed_file; + _tmp79_ = data; + _tmp79__length1 = data_length1; + _tmp80_ = i; + _tmp81_ = _tmp79_[_tmp80_]; + fputc ((gchar) _tmp81_, _tmp78_); } } } @@ -1428,21 +1942,29 @@ static void application_fix_pdf (const gchar* filename, GError** error) { } } } - line_number++; - offset = end_offset; + _tmp82_ = line_number; + line_number = _tmp82_ + 1; + _tmp83_ = end_offset; + offset = _tmp83_; } - _tmp25_ = g_strconcat (filename, "~", NULL); - _tmp26_ = _tmp25_; - _tmp27_ = g_rename (filename, _tmp26_); - _tmp28_ = _tmp27_ >= 0; - _g_free0 (_tmp26_); - if (_tmp28_) { - gchar* _tmp29_; - gchar* _tmp30_; - _tmp29_ = g_strconcat (filename, ".fixed", NULL); - _tmp30_ = _tmp29_; - g_rename (_tmp30_, filename); - _g_free0 (_tmp30_); + _tmp84_ = filename; + _tmp85_ = filename; + _tmp86_ = g_strconcat (_tmp85_, "~", NULL); + _tmp87_ = _tmp86_; + _tmp88_ = g_rename (_tmp84_, _tmp87_); + _tmp89_ = _tmp88_ >= 0; + _g_free0 (_tmp87_); + if (_tmp89_) { + const gchar* _tmp90_; + gchar* _tmp91_; + gchar* _tmp92_; + const gchar* _tmp93_; + _tmp90_ = filename; + _tmp91_ = g_strconcat (_tmp90_, ".fixed", NULL); + _tmp92_ = _tmp91_; + _tmp93_ = filename; + g_rename (_tmp92_, _tmp93_); + _g_free0 (_tmp92_); } _g_string_free0 (line); _g_match_info_free0 (xref_match); @@ -1460,20 +1982,30 @@ static void _application_log_cb_glog_func (const gchar* log_domain, GLogLevelFla gint application_main (gchar** args, int args_length1) { gint result = 0; const gchar* _tmp0_ = NULL; - GOptionContext* _tmp1_ = NULL; + GOptionContext* _tmp1_; GOptionContext* c; - GOptionGroup* _tmp2_ = NULL; + GOptionContext* _tmp2_; + GOptionContext* _tmp3_; + GOptionGroup* _tmp4_ = NULL; + gboolean _tmp14_; + const gchar* _tmp16_; ScanDevice* device; - GTimer* _tmp8_ = NULL; - const gchar* _tmp9_ = NULL; - gchar* _tmp10_ = NULL; + gchar** _tmp29_; + gint _tmp29__length1; + GTimer* _tmp39_; + const gchar* _tmp40_ = NULL; + gchar* _tmp41_ = NULL; gchar* path; - const gchar* _tmp11_ = NULL; - gchar* _tmp12_ = NULL; - FILE* _tmp13_ = NULL; - pid_t _tmp14_; - Application* _tmp15_ = NULL; + const gchar* _tmp42_; + const gchar* _tmp43_ = NULL; + gchar* _tmp44_ = NULL; + const gchar* _tmp45_; + FILE* _tmp46_ = NULL; + pid_t _tmp47_ = 0; + ScanDevice* _tmp48_; + Application* _tmp49_; Application* app; + Application* _tmp50_; GError * _inner_error_ = NULL; setlocale (LC_ALL, ""); bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); @@ -1483,11 +2015,15 @@ gint application_main (gchar** args, int args_length1) { _tmp0_ = _ ("[DEVICE...] - Scanning utility"); _tmp1_ = g_option_context_new (_tmp0_); c = _tmp1_; - g_option_context_add_main_entries (c, APPLICATION_options, GETTEXT_PACKAGE); - _tmp2_ = gtk_get_option_group (TRUE); - g_option_context_add_group (c, _tmp2_); + _tmp2_ = c; + g_option_context_add_main_entries (_tmp2_, APPLICATION_options, GETTEXT_PACKAGE); + _tmp3_ = c; + _tmp4_ = gtk_get_option_group (TRUE); + g_option_context_add_group (_tmp3_, _tmp4_); { - g_option_context_parse (c, &args_length1, &args, &_inner_error_); + GOptionContext* _tmp5_; + _tmp5_ = c; + g_option_context_parse (_tmp5_, &args_length1, &args, &_inner_error_); if (_inner_error_ != NULL) { goto __catch7_g_error; } @@ -1496,13 +2032,29 @@ gint application_main (gchar** args, int args_length1) { __catch7_g_error: { GError* e = NULL; - const gchar* _tmp3_ = NULL; + FILE* _tmp6_; + GError* _tmp7_; + const gchar* _tmp8_; + FILE* _tmp9_; + const gchar* _tmp10_ = NULL; + gchar** _tmp11_; + gint _tmp11__length1; + const gchar* _tmp12_; + FILE* _tmp13_; e = _inner_error_; _inner_error_ = NULL; - fprintf (stderr, "%s\n", e->message); - _tmp3_ = _ ("Run '%s --help' to see a full list of available command line options."); - fprintf (stderr, _tmp3_, args[0]); - fprintf (stderr, "\n"); + _tmp6_ = stderr; + _tmp7_ = e; + _tmp8_ = _tmp7_->message; + fprintf (_tmp6_, "%s\n", _tmp8_); + _tmp9_ = stderr; + _tmp10_ = _ ("Run '%s --help' to see a full list of available command line options."); + _tmp11_ = args; + _tmp11__length1 = args_length1; + _tmp12_ = _tmp11_[0]; + fprintf (_tmp9_, _tmp10_, _tmp12_); + _tmp13_ = stderr; + fprintf (_tmp13_, "\n"); result = EXIT_FAILURE; _g_error_free0 (e); _g_option_context_free0 (c); @@ -1515,15 +2067,21 @@ gint application_main (gchar** args, int args_length1) { g_clear_error (&_inner_error_); return 0; } - if (application_show_version) { - fprintf (stderr, "simple-scan %s\n", VERSION); + _tmp14_ = application_show_version; + if (_tmp14_) { + FILE* _tmp15_; + _tmp15_ = stderr; + fprintf (_tmp15_, "simple-scan %s\n", VERSION); result = EXIT_SUCCESS; _g_option_context_free0 (c); return result; } - if (application_fix_pdf_filename != NULL) { + _tmp16_ = application_fix_pdf_filename; + if (_tmp16_ != NULL) { { - application_fix_pdf (application_fix_pdf_filename, &_inner_error_); + const gchar* _tmp17_; + _tmp17_ = application_fix_pdf_filename; + application_fix_pdf (_tmp17_, &_inner_error_); if (_inner_error_ != NULL) { goto __catch8_g_error; } @@ -1531,17 +2089,35 @@ gint application_main (gchar** args, int args_length1) { gint i; i = 1; { - gboolean _tmp4_; - _tmp4_ = TRUE; + gboolean _tmp18_; + _tmp18_ = TRUE; while (TRUE) { - if (!_tmp4_) { - i++; + gboolean _tmp19_; + gint _tmp21_; + gchar** _tmp22_; + gint _tmp22__length1; + gchar** _tmp23_; + gint _tmp23__length1; + gint _tmp24_; + const gchar* _tmp25_; + _tmp19_ = _tmp18_; + if (!_tmp19_) { + gint _tmp20_; + _tmp20_ = i; + i = _tmp20_ + 1; } - _tmp4_ = FALSE; - if (!(i < args_length1)) { + _tmp18_ = FALSE; + _tmp21_ = i; + _tmp22_ = args; + _tmp22__length1 = args_length1; + if (!(_tmp21_ < _tmp22__length1)) { break; } - application_fix_pdf (args[i], &_inner_error_); + _tmp23_ = args; + _tmp23__length1 = args_length1; + _tmp24_ = i; + _tmp25_ = _tmp23_[_tmp24_]; + application_fix_pdf (_tmp25_, &_inner_error_); if (_inner_error_ != NULL) { goto __catch8_g_error; } @@ -1553,9 +2129,15 @@ gint application_main (gchar** args, int args_length1) { __catch8_g_error: { GError* e = NULL; + FILE* _tmp26_; + GError* _tmp27_; + const gchar* _tmp28_; e = _inner_error_; _inner_error_ = NULL; - fprintf (stderr, "Error fixing PDF file: %s", e->message); + _tmp26_ = stderr; + _tmp27_ = e; + _tmp28_ = _tmp27_->message; + fprintf (_tmp26_, "Error fixing PDF file: %s", _tmp28_); result = EXIT_FAILURE; _g_error_free0 (e); _g_option_context_free0 (c); @@ -1573,40 +2155,62 @@ gint application_main (gchar** args, int args_length1) { return result; } device = NULL; - if (args_length1 > 1) { - ScanDevice* _tmp5_ = NULL; - gchar* _tmp6_; - gchar* _tmp7_; - _tmp5_ = scan_device_new (); + _tmp29_ = args; + _tmp29__length1 = args_length1; + if (_tmp29__length1 > 1) { + ScanDevice* _tmp30_; + ScanDevice* _tmp31_; + gchar** _tmp32_; + gint _tmp32__length1; + const gchar* _tmp33_; + gchar* _tmp34_; + ScanDevice* _tmp35_; + gchar** _tmp36_; + gint _tmp36__length1; + const gchar* _tmp37_; + gchar* _tmp38_; + _tmp30_ = scan_device_new (); _scan_device_unref0 (device); - device = _tmp5_; - _tmp6_ = g_strdup (args[1]); - _g_free0 (device->name); - device->name = _tmp6_; - _tmp7_ = g_strdup (args[1]); - _g_free0 (device->label); - device->label = _tmp7_; + device = _tmp30_; + _tmp31_ = device; + _tmp32_ = args; + _tmp32__length1 = args_length1; + _tmp33_ = _tmp32_[1]; + _tmp34_ = g_strdup (_tmp33_); + _g_free0 (_tmp31_->name); + _tmp31_->name = _tmp34_; + _tmp35_ = device; + _tmp36_ = args; + _tmp36__length1 = args_length1; + _tmp37_ = _tmp36_[1]; + _tmp38_ = g_strdup (_tmp37_); + _g_free0 (_tmp35_->label); + _tmp35_->label = _tmp38_; } - _tmp8_ = g_timer_new (); + _tmp39_ = g_timer_new (); _g_timer_destroy0 (application_log_timer); - application_log_timer = _tmp8_; - _tmp9_ = g_get_user_cache_dir (); - _tmp10_ = g_build_filename (_tmp9_, "simple-scan", NULL, NULL); - path = _tmp10_; - g_mkdir_with_parents (path, 0700); - _tmp11_ = g_get_user_cache_dir (); - _tmp12_ = g_build_filename (_tmp11_, "simple-scan", "simple-scan.log", NULL, NULL); + application_log_timer = _tmp39_; + _tmp40_ = g_get_user_cache_dir (); + _tmp41_ = g_build_filename (_tmp40_, "simple-scan", NULL, NULL); + path = _tmp41_; + _tmp42_ = path; + g_mkdir_with_parents (_tmp42_, 0700); + _tmp43_ = g_get_user_cache_dir (); + _tmp44_ = g_build_filename (_tmp43_, "simple-scan", "simple-scan.log", NULL, NULL); _g_free0 (path); - path = _tmp12_; - _tmp13_ = fopen (path, "w"); + path = _tmp44_; + _tmp45_ = path; + _tmp46_ = fopen (_tmp45_, "w"); _fclose0 (application_log_file); - application_log_file = _tmp13_; + application_log_file = _tmp46_; g_log_set_default_handler (_application_log_cb_glog_func, NULL); - _tmp14_ = getpid (); - g_debug ("simple-scan.vala:586: Starting Simple Scan %s, PID=%i", VERSION, (gint) _tmp14_); - _tmp15_ = application_new (device); - app = _tmp15_; - application_start (app); + _tmp47_ = getpid (); + g_debug ("simple-scan.vala:586: Starting Simple Scan %s, PID=%i", VERSION, (gint) _tmp47_); + _tmp48_ = device; + _tmp49_ = application_new (_tmp48_); + app = _tmp49_; + _tmp50_ = app; + application_start (_tmp50_); gtk_main (); result = EXIT_SUCCESS; _application_unref0 (app); diff --git a/src/ui.c b/src/ui.c index 93a4506..8f9003c 100644 --- a/src/ui.c +++ b/src/ui.c @@ -1,4 +1,4 @@ -/* ui.c generated by valac 0.13.1, the Vala compiler +/* ui.c generated by valac 0.13.4, the Vala compiler * generated from ui.vala, do not modify */ /* @@ -428,17 +428,21 @@ static void _simple_scan_page_added_cb_book_page_added (Book* _sender, Page* pag SimpleScan* simple_scan_construct (GType object_type) { SimpleScan* self = NULL; - Book* _tmp0_ = NULL; - GSettings* _tmp1_ = NULL; + Book* _tmp0_; + Book* _tmp1_; + Book* _tmp2_; + GSettings* _tmp3_; self = (SimpleScan*) g_type_create_instance (object_type); _tmp0_ = book_new (); _book_unref0 (self->priv->book); self->priv->book = _tmp0_; - g_signal_connect (self->priv->book, "page-removed", (GCallback) _simple_scan_page_removed_cb_book_page_removed, self); - g_signal_connect (self->priv->book, "page-added", (GCallback) _simple_scan_page_added_cb_book_page_added, self); - _tmp1_ = g_settings_new ("org.gnome.SimpleScan"); + _tmp1_ = self->priv->book; + g_signal_connect (_tmp1_, "page-removed", (GCallback) _simple_scan_page_removed_cb_book_page_removed, self); + _tmp2_ = self->priv->book; + g_signal_connect (_tmp2_, "page-added", (GCallback) _simple_scan_page_added_cb_book_page_added, self); + _tmp3_ = g_settings_new ("org.gnome.SimpleScan"); _g_object_unref0 (self->priv->settings); - self->priv->settings = _tmp1_; + self->priv->settings = _tmp3_; simple_scan_load (self); return self; } @@ -450,38 +454,56 @@ SimpleScan* simple_scan_new (void) { static gboolean simple_scan_find_scan_device (SimpleScan* self, const gchar* device, GtkTreeIter* iter) { - GtkTreeIter _iter = {0}; + GtkTreeIter _vala_iter = {0}; gboolean result = FALSE; gboolean have_iter; - GtkTreeIter _tmp0_ = {0}; - gboolean _tmp1_; + GtkListStore* _tmp0_; + GtkTreeIter _tmp1_ = {0}; + gboolean _tmp2_ = FALSE; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (device != NULL, FALSE); have_iter = FALSE; - _tmp1_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) self->priv->device_model, &_tmp0_); - _iter = _tmp0_; - if (_tmp1_) { + _tmp0_ = self->priv->device_model; + _tmp2_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) _tmp0_, &_tmp1_); + _vala_iter = _tmp1_; + if (_tmp2_) { { - gboolean _tmp2_; - _tmp2_ = TRUE; + gboolean _tmp3_; + _tmp3_ = TRUE; while (TRUE) { + gboolean _tmp4_; gchar* d = NULL; - if (!_tmp2_) { - gboolean _tmp3_ = FALSE; - if (!have_iter) { - gboolean _tmp4_; - _tmp4_ = gtk_tree_model_iter_next ((GtkTreeModel*) self->priv->device_model, &_iter); - _tmp3_ = _tmp4_; + GtkListStore* _tmp10_; + GtkTreeIter _tmp11_; + const gchar* _tmp12_; + const gchar* _tmp13_; + _tmp4_ = _tmp3_; + if (!_tmp4_) { + gboolean _tmp5_ = FALSE; + gboolean _tmp6_; + gboolean _tmp9_; + _tmp6_ = have_iter; + if (!_tmp6_) { + GtkListStore* _tmp7_; + gboolean _tmp8_ = FALSE; + _tmp7_ = self->priv->device_model; + _tmp8_ = gtk_tree_model_iter_next ((GtkTreeModel*) _tmp7_, &_vala_iter); + _tmp5_ = _tmp8_; } else { - _tmp3_ = FALSE; + _tmp5_ = FALSE; } - if (!_tmp3_) { + _tmp9_ = _tmp5_; + if (!_tmp9_) { break; } } - _tmp2_ = FALSE; - gtk_tree_model_get ((GtkTreeModel*) self->priv->device_model, &_iter, 0, &d, -1, -1); - if (g_strcmp0 (d, device) == 0) { + _tmp3_ = FALSE; + _tmp10_ = self->priv->device_model; + _tmp11_ = _vala_iter; + gtk_tree_model_get ((GtkTreeModel*) _tmp10_, &_tmp11_, 0, &d, -1, -1); + _tmp12_ = d; + _tmp13_ = device; + if (g_strcmp0 (_tmp12_, _tmp13_) == 0) { have_iter = TRUE; } _g_free0 (d); @@ -490,84 +512,114 @@ static gboolean simple_scan_find_scan_device (SimpleScan* self, const gchar* dev } result = have_iter; if (iter) { - *iter = _iter; + *iter = _vala_iter; } return result; } static void simple_scan_show_error_dialog (SimpleScan* self, const gchar* error_title, const gchar* error_text) { - GtkMessageDialog* _tmp0_ = NULL; + GtkWindow* _tmp0_; + const gchar* _tmp1_; + GtkMessageDialog* _tmp2_; + GtkMessageDialog* _tmp3_; GtkMessageDialog* dialog; + const gchar* _tmp4_; g_return_if_fail (self != NULL); g_return_if_fail (error_title != NULL); g_return_if_fail (error_text != NULL); - _tmp0_ = (GtkMessageDialog*) gtk_message_dialog_new (self->priv->window, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE, "%s", error_title); - dialog = g_object_ref_sink (_tmp0_); + _tmp0_ = self->priv->window; + _tmp1_ = error_title; + _tmp2_ = (GtkMessageDialog*) gtk_message_dialog_new (_tmp0_, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE, "%s", _tmp1_); + _tmp3_ = g_object_ref_sink (_tmp2_); + dialog = _tmp3_; gtk_dialog_add_button ((GtkDialog*) dialog, GTK_STOCK_CLOSE, 0); - gtk_message_dialog_format_secondary_text (dialog, "%s", error_text, NULL); + _tmp4_ = error_text; + gtk_message_dialog_format_secondary_text (dialog, "%s", _tmp4_); gtk_widget_destroy ((GtkWidget*) dialog); _g_object_unref0 (dialog); } void simple_scan_set_default_file_name (SimpleScan* self, const gchar* default_file_name) { - gchar* _tmp0_; + const gchar* _tmp0_; + gchar* _tmp1_; g_return_if_fail (self != NULL); g_return_if_fail (default_file_name != NULL); - _tmp0_ = g_strdup (default_file_name); + _tmp0_ = default_file_name; + _tmp1_ = g_strdup (_tmp0_); _g_free0 (self->priv->default_file_name); - self->priv->default_file_name = _tmp0_; + self->priv->default_file_name = _tmp1_; } void simple_scan_authorize (SimpleScan* self, const gchar* resource, gchar** username, gchar** password) { - gchar* _username = NULL; - gchar* _password = NULL; + gchar* _vala_username = NULL; + gchar* _vala_password = NULL; const gchar* _tmp0_ = NULL; - gchar* _tmp1_ = NULL; + const gchar* _tmp1_; + gchar* _tmp2_ = NULL; gchar* description; - const gchar* _tmp2_ = NULL; - gchar* _tmp3_; - const gchar* _tmp4_ = NULL; - gchar* _tmp5_; + GtkEntry* _tmp3_; + GtkEntry* _tmp4_; + GtkLabel* _tmp5_; + GtkDialog* _tmp6_; + GtkDialog* _tmp7_; + GtkDialog* _tmp8_; + GtkEntry* _tmp9_; + const gchar* _tmp10_ = NULL; + gchar* _tmp11_; + GtkEntry* _tmp12_; + const gchar* _tmp13_ = NULL; + gchar* _tmp14_; g_return_if_fail (self != NULL); g_return_if_fail (resource != NULL); _tmp0_ = _ ("Username and password required to access '%s'"); - _tmp1_ = g_strdup_printf (_tmp0_, resource); - description = _tmp1_; - gtk_entry_set_text (self->priv->username_entry, ""); - gtk_entry_set_text (self->priv->password_entry, ""); - gtk_label_set_text (self->priv->authorize_label, description); - gtk_widget_show ((GtkWidget*) self->priv->authorize_dialog); - gtk_dialog_run (self->priv->authorize_dialog); - gtk_widget_hide ((GtkWidget*) self->priv->authorize_dialog); - _tmp2_ = gtk_entry_get_text (self->priv->username_entry); - _tmp3_ = g_strdup (_tmp2_); - _g_free0 (_username); - _username = _tmp3_; - _tmp4_ = gtk_entry_get_text (self->priv->password_entry); - _tmp5_ = g_strdup (_tmp4_); - _g_free0 (_password); - _password = _tmp5_; + _tmp1_ = resource; + _tmp2_ = g_strdup_printf (_tmp0_, _tmp1_); + description = _tmp2_; + _tmp3_ = self->priv->username_entry; + gtk_entry_set_text (_tmp3_, ""); + _tmp4_ = self->priv->password_entry; + gtk_entry_set_text (_tmp4_, ""); + _tmp5_ = self->priv->authorize_label; + gtk_label_set_text (_tmp5_, description); + _tmp6_ = self->priv->authorize_dialog; + gtk_widget_show ((GtkWidget*) _tmp6_); + _tmp7_ = self->priv->authorize_dialog; + gtk_dialog_run (_tmp7_); + _tmp8_ = self->priv->authorize_dialog; + gtk_widget_hide ((GtkWidget*) _tmp8_); + _tmp9_ = self->priv->username_entry; + _tmp10_ = gtk_entry_get_text (_tmp9_); + _tmp11_ = g_strdup (_tmp10_); + _g_free0 (_vala_username); + _vala_username = _tmp11_; + _tmp12_ = self->priv->password_entry; + _tmp13_ = gtk_entry_get_text (_tmp12_); + _tmp14_ = g_strdup (_tmp13_); + _g_free0 (_vala_password); + _vala_password = _tmp14_; _g_free0 (description); if (username) { - *username = _username; + *username = _vala_username; } else { - _g_free0 (_username); + _g_free0 (_vala_username); } if (password) { - *password = _password; + *password = _vala_password; } else { - _g_free0 (_password); + _g_free0 (_vala_password); } } void G_MODULE_EXPORT device_combo_changed_cb (GtkWidget* widget, SimpleScan* self) { + gboolean _tmp0_; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - if (self->priv->setting_devices) { + _tmp0_ = self->priv->setting_devices; + if (_tmp0_) { return; } self->priv->user_selected_device = TRUE; @@ -581,64 +633,102 @@ static void simple_scan_update_info_bar (SimpleScan* self) { gchar* image_id = NULL; gboolean show_close_button; gboolean show_change_scanner_button; - gchar* _tmp9_ = NULL; + gboolean _tmp0_; + GtkInfoBar* _tmp15_; + GtkMessageType _tmp16_; + GtkImage* _tmp17_; + const gchar* _tmp18_; + const gchar* _tmp19_; + const gchar* _tmp20_; + gchar* _tmp21_ = NULL; gchar* message; + GtkLabel* _tmp22_; + const gchar* _tmp23_; + GtkButton* _tmp24_; + gboolean _tmp25_; + GtkButton* _tmp26_; + gboolean _tmp27_; + GtkInfoBar* _tmp28_; g_return_if_fail (self != NULL); show_close_button = FALSE; show_change_scanner_button = FALSE; - if (self->priv->have_error) { - gchar* _tmp0_; + _tmp0_ = self->priv->have_error; + if (_tmp0_) { gchar* _tmp1_; - gchar* _tmp2_; + const gchar* _tmp2_; + gchar* _tmp3_; + const gchar* _tmp4_; + gchar* _tmp5_; + gboolean _tmp6_; type = GTK_MESSAGE_ERROR; - _tmp0_ = g_strdup (GTK_STOCK_DIALOG_ERROR); + _tmp1_ = g_strdup (GTK_STOCK_DIALOG_ERROR); _g_free0 (image_id); - image_id = _tmp0_; - _tmp1_ = g_strdup (self->priv->error_title); + image_id = _tmp1_; + _tmp2_ = self->priv->error_title; + _tmp3_ = g_strdup (_tmp2_); _g_free0 (title); - title = _tmp1_; - _tmp2_ = g_strdup (self->priv->error_text); + title = _tmp3_; + _tmp4_ = self->priv->error_text; + _tmp5_ = g_strdup (_tmp4_); _g_free0 (text); - text = _tmp2_; + text = _tmp5_; show_close_button = TRUE; - show_change_scanner_button = self->priv->error_change_scanner_hint; + _tmp6_ = self->priv->error_change_scanner_hint; + show_change_scanner_button = _tmp6_; } else { - gint _tmp3_; - _tmp3_ = gtk_tree_model_iter_n_children ((GtkTreeModel*) self->priv->device_model, NULL); - if (_tmp3_ == 0) { - gchar* _tmp4_; - const gchar* _tmp5_ = NULL; - gchar* _tmp6_; - const gchar* _tmp7_ = NULL; - gchar* _tmp8_; + GtkListStore* _tmp7_; + gint _tmp8_ = 0; + _tmp7_ = self->priv->device_model; + _tmp8_ = gtk_tree_model_iter_n_children ((GtkTreeModel*) _tmp7_, NULL); + if (_tmp8_ == 0) { + gchar* _tmp9_; + const gchar* _tmp10_ = NULL; + gchar* _tmp11_; + const gchar* _tmp12_ = NULL; + gchar* _tmp13_; type = GTK_MESSAGE_WARNING; - _tmp4_ = g_strdup (GTK_STOCK_DIALOG_WARNING); + _tmp9_ = g_strdup (GTK_STOCK_DIALOG_WARNING); _g_free0 (image_id); - image_id = _tmp4_; - _tmp5_ = _ ("No scanners detected"); - _tmp6_ = g_strdup (_tmp5_); + image_id = _tmp9_; + _tmp10_ = _ ("No scanners detected"); + _tmp11_ = g_strdup (_tmp10_); _g_free0 (title); - title = _tmp6_; - _tmp7_ = _ ("Please check your scanner is connected and powered on"); - _tmp8_ = g_strdup (_tmp7_); + title = _tmp11_; + _tmp12_ = _ ("Please check your scanner is connected and powered on"); + _tmp13_ = g_strdup (_tmp12_); _g_free0 (text); - text = _tmp8_; + text = _tmp13_; } else { - gtk_widget_hide ((GtkWidget*) self->priv->info_bar); + GtkInfoBar* _tmp14_; + _tmp14_ = self->priv->info_bar; + gtk_widget_hide ((GtkWidget*) _tmp14_); _g_free0 (image_id); _g_free0 (text); _g_free0 (title); return; } } - gtk_info_bar_set_message_type (self->priv->info_bar, type); - gtk_image_set_from_stock (self->priv->info_bar_image, image_id, GTK_ICON_SIZE_DIALOG); - _tmp9_ = g_strdup_printf ("%s\n\n%s", title, text); - message = _tmp9_; - gtk_label_set_markup (self->priv->info_bar_label, message); - gtk_widget_set_visible ((GtkWidget*) self->priv->info_bar_close_button, show_close_button); - gtk_widget_set_visible ((GtkWidget*) self->priv->info_bar_change_scanner_button, show_change_scanner_button); - gtk_widget_show ((GtkWidget*) self->priv->info_bar); + _tmp15_ = self->priv->info_bar; + _tmp16_ = type; + gtk_info_bar_set_message_type (_tmp15_, _tmp16_); + _tmp17_ = self->priv->info_bar_image; + _tmp18_ = image_id; + gtk_image_set_from_stock (_tmp17_, _tmp18_, GTK_ICON_SIZE_DIALOG); + _tmp19_ = title; + _tmp20_ = text; + _tmp21_ = g_strdup_printf ("%s\n\n%s", _tmp19_, _tmp20_); + message = _tmp21_; + _tmp22_ = self->priv->info_bar_label; + _tmp23_ = message; + gtk_label_set_markup (_tmp22_, _tmp23_); + _tmp24_ = self->priv->info_bar_close_button; + _tmp25_ = show_close_button; + gtk_widget_set_visible ((GtkWidget*) _tmp24_, _tmp25_); + _tmp26_ = self->priv->info_bar_change_scanner_button; + _tmp27_ = show_change_scanner_button; + gtk_widget_set_visible ((GtkWidget*) _tmp26_, _tmp27_); + _tmp28_ = self->priv->info_bar; + gtk_widget_show ((GtkWidget*) _tmp28_); _g_free0 (message); _g_free0 (image_id); _g_free0 (text); @@ -655,110 +745,200 @@ void simple_scan_set_scan_devices (SimpleScan* self, GList* devices) { gboolean have_selection; gint index = 0; GtkTreeIter iter = {0}; - gboolean _tmp11_ = FALSE; + gboolean _tmp0_; + GList* _tmp3_; + gboolean _tmp52_ = FALSE; + gboolean _tmp53_; + gboolean _tmp55_; g_return_if_fail (self != NULL); have_selection = FALSE; self->priv->setting_devices = TRUE; - if (self->priv->user_selected_device) { - gint _tmp0_; - _tmp0_ = gtk_combo_box_get_active (self->priv->device_combo); - have_selection = _tmp0_ >= 0; + _tmp0_ = self->priv->user_selected_device; + if (_tmp0_) { + GtkComboBox* _tmp1_; + gint _tmp2_ = 0; + _tmp1_ = self->priv->device_combo; + _tmp2_ = gtk_combo_box_get_active (_tmp1_); + have_selection = _tmp2_ >= 0; } index = 0; + _tmp3_ = devices; { GList* device_collection = NULL; GList* device_it = NULL; - device_collection = devices; + device_collection = _tmp3_; for (device_it = device_collection; device_it != NULL; device_it = device_it->next) { - ScanDevice* _tmp1_; + ScanDevice* _tmp4_; ScanDevice* device = NULL; - _tmp1_ = _scan_device_ref0 ((ScanDevice*) device_it->data); - device = _tmp1_; + _tmp4_ = _scan_device_ref0 ((ScanDevice*) device_it->data); + device = _tmp4_; { gint n_delete; - GtkTreeIter _tmp2_ = {0}; - gboolean _tmp3_; + GtkListStore* _tmp5_; + gint _tmp6_; + GtkTreeIter _tmp7_ = {0}; + gboolean _tmp8_ = FALSE; + gint _tmp21_; + gint _tmp45_; n_delete = -1; - _tmp3_ = gtk_tree_model_iter_nth_child ((GtkTreeModel*) self->priv->device_model, &_tmp2_, NULL, index); - iter = _tmp2_; - if (_tmp3_) { + _tmp5_ = self->priv->device_model; + _tmp6_ = index; + _tmp8_ = gtk_tree_model_iter_nth_child ((GtkTreeModel*) _tmp5_, &_tmp7_, NULL, _tmp6_); + iter = _tmp7_; + if (_tmp8_) { gint i; i = 0; { - gboolean _tmp4_; - _tmp4_ = TRUE; + gboolean _tmp9_; + _tmp9_ = TRUE; while (TRUE) { + gboolean _tmp10_; gchar* name = NULL; gboolean matched = FALSE; - if (!_tmp4_) { - gboolean _tmp5_; - _tmp5_ = gtk_tree_model_iter_next ((GtkTreeModel*) self->priv->device_model, &iter); - if (!_tmp5_) { + GtkListStore* _tmp13_; + GtkTreeIter _tmp14_; + const gchar* _tmp15_; + ScanDevice* _tmp16_; + const gchar* _tmp17_; + gboolean _tmp18_; + gint _tmp20_; + _tmp10_ = _tmp9_; + if (!_tmp10_) { + GtkListStore* _tmp11_; + gboolean _tmp12_ = FALSE; + _tmp11_ = self->priv->device_model; + _tmp12_ = gtk_tree_model_iter_next ((GtkTreeModel*) _tmp11_, &iter); + if (!_tmp12_) { break; } } - _tmp4_ = FALSE; - gtk_tree_model_get ((GtkTreeModel*) self->priv->device_model, &iter, 0, &name, -1, -1); - matched = g_strcmp0 (name, device->name) == 0; - if (matched) { - n_delete = i; + _tmp9_ = FALSE; + _tmp13_ = self->priv->device_model; + _tmp14_ = iter; + gtk_tree_model_get ((GtkTreeModel*) _tmp13_, &_tmp14_, 0, &name, -1, -1); + _tmp15_ = name; + _tmp16_ = device; + _tmp17_ = _tmp16_->name; + matched = g_strcmp0 (_tmp15_, _tmp17_) == 0; + _tmp18_ = matched; + if (_tmp18_) { + gint _tmp19_; + _tmp19_ = i; + n_delete = _tmp19_; _g_free0 (name); break; } - i++; + _tmp20_ = i; + i = _tmp20_ + 1; _g_free0 (name); } } } - if (n_delete >= 0) { + _tmp21_ = n_delete; + if (_tmp21_ >= 0) { gint i = 0; - gtk_list_store_set (self->priv->device_model, &iter, 1, device->label, -1, -1); + GtkListStore* _tmp22_; + GtkTreeIter _tmp23_; + ScanDevice* _tmp24_; + const gchar* _tmp25_; + _tmp22_ = self->priv->device_model; + _tmp23_ = iter; + _tmp24_ = device; + _tmp25_ = _tmp24_->label; + gtk_list_store_set (_tmp22_, &_tmp23_, 1, _tmp25_, -1, -1); { - gboolean _tmp6_; + gboolean _tmp26_; i = 0; - _tmp6_ = TRUE; + _tmp26_ = TRUE; while (TRUE) { - GtkTreeIter _tmp7_ = {0}; - if (!_tmp6_) { - i++; + gboolean _tmp27_; + gint _tmp29_; + gint _tmp30_; + GtkListStore* _tmp31_; + gint _tmp32_; + GtkTreeIter _tmp33_ = {0}; + GtkListStore* _tmp34_; + GtkTreeIter _tmp35_; + _tmp27_ = _tmp26_; + if (!_tmp27_) { + gint _tmp28_; + _tmp28_ = i; + i = _tmp28_ + 1; } - _tmp6_ = FALSE; - if (!(i < n_delete)) { + _tmp26_ = FALSE; + _tmp29_ = i; + _tmp30_ = n_delete; + if (!(_tmp29_ < _tmp30_)) { break; } - gtk_tree_model_iter_nth_child ((GtkTreeModel*) self->priv->device_model, &_tmp7_, NULL, index); - iter = _tmp7_; - gtk_list_store_remove (self->priv->device_model, &iter); + _tmp31_ = self->priv->device_model; + _tmp32_ = index; + gtk_tree_model_iter_nth_child ((GtkTreeModel*) _tmp31_, &_tmp33_, NULL, _tmp32_); + iter = _tmp33_; + _tmp34_ = self->priv->device_model; + _tmp35_ = iter; + gtk_list_store_remove (_tmp34_, &_tmp35_); } } } else { - GtkTreeIter _tmp8_ = {0}; - gtk_list_store_insert (self->priv->device_model, &_tmp8_, index); - iter = _tmp8_; - gtk_list_store_set (self->priv->device_model, &iter, 0, device->name, 1, device->label, -1, -1); + GtkListStore* _tmp36_; + gint _tmp37_; + GtkTreeIter _tmp38_ = {0}; + GtkListStore* _tmp39_; + GtkTreeIter _tmp40_; + ScanDevice* _tmp41_; + const gchar* _tmp42_; + ScanDevice* _tmp43_; + const gchar* _tmp44_; + _tmp36_ = self->priv->device_model; + _tmp37_ = index; + gtk_list_store_insert (_tmp36_, &_tmp38_, _tmp37_); + iter = _tmp38_; + _tmp39_ = self->priv->device_model; + _tmp40_ = iter; + _tmp41_ = device; + _tmp42_ = _tmp41_->name; + _tmp43_ = device; + _tmp44_ = _tmp43_->label; + gtk_list_store_set (_tmp39_, &_tmp40_, 0, _tmp42_, 1, _tmp44_, -1, -1); } - index++; + _tmp45_ = index; + index = _tmp45_ + 1; _scan_device_unref0 (device); } } } while (TRUE) { - GtkTreeIter _tmp9_ = {0}; - gboolean _tmp10_; - _tmp10_ = gtk_tree_model_iter_nth_child ((GtkTreeModel*) self->priv->device_model, &_tmp9_, NULL, index); - iter = _tmp9_; - if (!_tmp10_) { + GtkListStore* _tmp46_; + gint _tmp47_; + GtkTreeIter _tmp48_ = {0}; + gboolean _tmp49_ = FALSE; + GtkListStore* _tmp50_; + GtkTreeIter _tmp51_; + _tmp46_ = self->priv->device_model; + _tmp47_ = index; + _tmp49_ = gtk_tree_model_iter_nth_child ((GtkTreeModel*) _tmp46_, &_tmp48_, NULL, _tmp47_); + iter = _tmp48_; + if (!_tmp49_) { break; } - gtk_list_store_remove (self->priv->device_model, &iter); + _tmp50_ = self->priv->device_model; + _tmp51_ = iter; + gtk_list_store_remove (_tmp50_, &_tmp51_); } - if (!have_selection) { - _tmp11_ = devices != NULL; + _tmp53_ = have_selection; + if (!_tmp53_) { + GList* _tmp54_; + _tmp54_ = devices; + _tmp52_ = _tmp54_ != NULL; } else { - _tmp11_ = FALSE; + _tmp52_ = FALSE; } - if (_tmp11_) { - gtk_combo_box_set_active (self->priv->device_combo, 0); + _tmp55_ = _tmp52_; + if (_tmp55_) { + GtkComboBox* _tmp56_; + _tmp56_ = self->priv->device_combo; + gtk_combo_box_set_active (_tmp56_, 0); } self->priv->setting_devices = FALSE; simple_scan_update_info_bar (self); @@ -768,14 +948,20 @@ void simple_scan_set_scan_devices (SimpleScan* self, GList* devices) { static gchar* simple_scan_get_selected_device (SimpleScan* self) { gchar* result = NULL; GtkTreeIter iter = {0}; - GtkTreeIter _tmp0_ = {0}; - gboolean _tmp1_; + GtkComboBox* _tmp0_; + GtkTreeIter _tmp1_ = {0}; + gboolean _tmp2_ = FALSE; g_return_val_if_fail (self != NULL, NULL); - _tmp1_ = gtk_combo_box_get_active_iter (self->priv->device_combo, &_tmp0_); - iter = _tmp0_; - if (_tmp1_) { + _tmp0_ = self->priv->device_combo; + _tmp2_ = gtk_combo_box_get_active_iter (_tmp0_, &_tmp1_); + iter = _tmp1_; + if (_tmp2_) { gchar* device = NULL; - gtk_tree_model_get ((GtkTreeModel*) self->priv->device_model, &iter, 0, &device, -1, -1); + GtkListStore* _tmp3_; + GtkTreeIter _tmp4_; + _tmp3_ = self->priv->device_model; + _tmp4_ = iter; + gtk_tree_model_get ((GtkTreeModel*) _tmp3_, &_tmp4_, 0, &device, -1, -1); result = device; return result; } @@ -786,27 +972,45 @@ static gchar* simple_scan_get_selected_device (SimpleScan* self) { void simple_scan_set_selected_device (SimpleScan* self, const gchar* device) { GtkTreeIter iter = {0}; - GtkTreeIter _tmp0_ = {0}; - gboolean _tmp1_; + const gchar* _tmp0_; + GtkTreeIter _tmp1_ = {0}; + gboolean _tmp2_ = FALSE; + GtkComboBox* _tmp3_; + GtkTreeIter _tmp4_; g_return_if_fail (self != NULL); g_return_if_fail (device != NULL); - _tmp1_ = simple_scan_find_scan_device (self, device, &_tmp0_); - iter = _tmp0_; - if (!_tmp1_) { + _tmp0_ = device; + _tmp2_ = simple_scan_find_scan_device (self, _tmp0_, &_tmp1_); + iter = _tmp1_; + if (!_tmp2_) { return; } - gtk_combo_box_set_active_iter (self->priv->device_combo, &iter); + _tmp3_ = self->priv->device_combo; + _tmp4_ = iter; + gtk_combo_box_set_active_iter (_tmp3_, &_tmp4_); self->priv->user_selected_device = TRUE; } static void simple_scan_add_default_page (SimpleScan* self) { - Page* _tmp0_ = NULL; + Book* _tmp0_; + gint _tmp1_; + gint _tmp2_; + gint _tmp3_; + ScanDirection _tmp4_; + Page* _tmp5_ = NULL; Page* page; + BookView* _tmp6_; g_return_if_fail (self != NULL); - _tmp0_ = book_append_page (self->priv->book, self->priv->default_page_width, self->priv->default_page_height, self->priv->default_page_dpi, self->priv->default_page_scan_direction); - page = _tmp0_; - book_view_select_page (self->priv->book_view, page); + _tmp0_ = self->priv->book; + _tmp1_ = self->priv->default_page_width; + _tmp2_ = self->priv->default_page_height; + _tmp3_ = self->priv->default_page_dpi; + _tmp4_ = self->priv->default_page_scan_direction; + _tmp5_ = book_append_page (_tmp0_, _tmp1_, _tmp2_, _tmp3_, _tmp4_); + page = _tmp5_; + _tmp6_ = self->priv->book_view; + book_view_select_page (_tmp6_, page); _page_unref0 (page); } @@ -818,13 +1022,21 @@ static gpointer _g_object_ref0 (gpointer self) { static gint string_last_index_of_char (const gchar* self, gunichar c, gint start_index) { gint result = 0; - gchar* _tmp0_ = NULL; + gint _tmp0_; + gunichar _tmp1_; + gchar* _tmp2_ = NULL; gchar* _result_; + gchar* _tmp3_; g_return_val_if_fail (self != NULL, 0); - _tmp0_ = g_utf8_strrchr (((gchar*) self) + start_index, (gssize) (-1), c); - _result_ = _tmp0_; - if (_result_ != NULL) { - result = (gint) (_result_ - ((gchar*) self)); + _tmp0_ = start_index; + _tmp1_ = c; + _tmp2_ = g_utf8_strrchr (((gchar*) self) + _tmp0_, (gssize) (-1), _tmp1_); + _result_ = _tmp2_; + _tmp3_ = _result_; + if (_tmp3_ != NULL) { + gchar* _tmp4_; + _tmp4_ = _result_; + result = (gint) (_tmp4_ - ((gchar*) self)); return result; } else { result = -1; @@ -836,34 +1048,74 @@ static gint string_last_index_of_char (const gchar* self, gunichar c, gint start static gchar* string_slice (const gchar* self, glong start, glong end) { gchar* result = NULL; gint _tmp0_; + gint _tmp1_; glong string_length; - gboolean _tmp1_ = FALSE; - gboolean _tmp2_ = FALSE; - gchar* _tmp3_ = NULL; + glong _tmp2_; + glong _tmp5_; + gboolean _tmp8_ = FALSE; + glong _tmp9_; + gboolean _tmp12_; + gboolean _tmp13_ = FALSE; + glong _tmp14_; + gboolean _tmp17_; + glong _tmp18_; + glong _tmp19_; + glong _tmp20_; + glong _tmp21_; + glong _tmp22_; + gchar* _tmp23_ = NULL; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = strlen (self); - string_length = (glong) _tmp0_; - if (start < ((glong) 0)) { - start = string_length + start; + _tmp1_ = _tmp0_; + string_length = (glong) _tmp1_; + _tmp2_ = start; + if (_tmp2_ < ((glong) 0)) { + glong _tmp3_; + glong _tmp4_; + _tmp3_ = string_length; + _tmp4_ = start; + start = _tmp3_ + _tmp4_; } - if (end < ((glong) 0)) { - end = string_length + end; + _tmp5_ = end; + if (_tmp5_ < ((glong) 0)) { + glong _tmp6_; + glong _tmp7_; + _tmp6_ = string_length; + _tmp7_ = end; + end = _tmp6_ + _tmp7_; } - if (start >= ((glong) 0)) { - _tmp1_ = start <= string_length; + _tmp9_ = start; + if (_tmp9_ >= ((glong) 0)) { + glong _tmp10_; + glong _tmp11_; + _tmp10_ = start; + _tmp11_ = string_length; + _tmp8_ = _tmp10_ <= _tmp11_; } else { - _tmp1_ = FALSE; + _tmp8_ = FALSE; } - g_return_val_if_fail (_tmp1_, NULL); - if (end >= ((glong) 0)) { - _tmp2_ = end <= string_length; + _tmp12_ = _tmp8_; + g_return_val_if_fail (_tmp12_, NULL); + _tmp14_ = end; + if (_tmp14_ >= ((glong) 0)) { + glong _tmp15_; + glong _tmp16_; + _tmp15_ = end; + _tmp16_ = string_length; + _tmp13_ = _tmp15_ <= _tmp16_; } else { - _tmp2_ = FALSE; + _tmp13_ = FALSE; } - g_return_val_if_fail (_tmp2_, NULL); - g_return_val_if_fail (start <= end, NULL); - _tmp3_ = g_strndup (((gchar*) self) + start, (gsize) (end - start)); - result = _tmp3_; + _tmp17_ = _tmp13_; + g_return_val_if_fail (_tmp17_, NULL); + _tmp18_ = start; + _tmp19_ = end; + g_return_val_if_fail (_tmp18_ <= _tmp19_, NULL); + _tmp20_ = start; + _tmp21_ = end; + _tmp22_ = start; + _tmp23_ = g_strndup (((gchar*) self) + _tmp20_, (gsize) (_tmp21_ - _tmp22_)); + result = _tmp23_; return result; } @@ -871,46 +1123,72 @@ static gchar* string_slice (const gchar* self, glong start, glong end) { static void simple_scan_on_file_type_changed (SimpleScan* self, GtkTreeSelection* selection) { GtkTreeModel* model = NULL; GtkTreeIter iter = {0}; - GtkTreeModel* _tmp0_ = NULL; - GtkTreeIter _tmp1_ = {0}; - gboolean _tmp2_; - GtkTreeModel* _tmp3_; + GtkTreeSelection* _tmp0_; + GtkTreeModel* _tmp1_ = NULL; + GtkTreeIter _tmp2_ = {0}; + gboolean _tmp3_ = FALSE; + GtkTreeModel* _tmp4_; gchar* extension = NULL; - gchar* _tmp4_ = NULL; + GtkTreeModel* _tmp5_; + GtkTreeIter _tmp6_; + GtkFileChooserDialog* _tmp7_; + gchar* _tmp8_ = NULL; gchar* path; - gchar* _tmp5_ = NULL; + const gchar* _tmp9_; + gchar* _tmp10_ = NULL; gchar* filename; - gint _tmp6_; + const gchar* _tmp11_; + gint _tmp12_ = 0; gint extension_index; - gchar* _tmp8_; + gint _tmp13_; + const gchar* _tmp17_; + const gchar* _tmp18_; + gchar* _tmp19_; + GtkFileChooserDialog* _tmp20_; + const gchar* _tmp21_; g_return_if_fail (self != NULL); g_return_if_fail (selection != NULL); - _tmp2_ = gtk_tree_selection_get_selected (selection, &_tmp0_, &_tmp1_); + _tmp0_ = selection; + _tmp3_ = gtk_tree_selection_get_selected (_tmp0_, &_tmp1_, &_tmp2_); _g_object_unref0 (model); - _tmp3_ = _g_object_ref0 (_tmp0_); - model = _tmp3_; - iter = _tmp1_; - if (!_tmp2_) { + _tmp4_ = _g_object_ref0 (_tmp1_); + model = _tmp4_; + iter = _tmp2_; + if (!_tmp3_) { _g_object_unref0 (model); return; } - gtk_tree_model_get (model, &iter, 1, &extension, -1, -1); - _tmp4_ = gtk_file_chooser_get_filename ((GtkFileChooser*) self->priv->save_dialog); - path = _tmp4_; - _tmp5_ = g_path_get_basename (path); - filename = _tmp5_; - _tmp6_ = string_last_index_of_char (filename, (gunichar) '.', 0); - extension_index = _tmp6_; - if (extension_index >= 0) { - gchar* _tmp7_ = NULL; - _tmp7_ = string_slice (filename, (glong) 0, (glong) extension_index); + _tmp5_ = model; + _tmp6_ = iter; + gtk_tree_model_get (_tmp5_, &_tmp6_, 1, &extension, -1, -1); + _tmp7_ = self->priv->save_dialog; + _tmp8_ = gtk_file_chooser_get_filename ((GtkFileChooser*) _tmp7_); + path = _tmp8_; + _tmp9_ = path; + _tmp10_ = g_path_get_basename (_tmp9_); + filename = _tmp10_; + _tmp11_ = filename; + _tmp12_ = string_last_index_of_char (_tmp11_, (gunichar) '.', 0); + extension_index = _tmp12_; + _tmp13_ = extension_index; + if (_tmp13_ >= 0) { + const gchar* _tmp14_; + gint _tmp15_; + gchar* _tmp16_ = NULL; + _tmp14_ = filename; + _tmp15_ = extension_index; + _tmp16_ = string_slice (_tmp14_, (glong) 0, (glong) _tmp15_); _g_free0 (filename); - filename = _tmp7_; + filename = _tmp16_; } - _tmp8_ = g_strconcat (filename, extension, NULL); + _tmp17_ = filename; + _tmp18_ = extension; + _tmp19_ = g_strconcat (_tmp17_, _tmp18_, NULL); _g_free0 (filename); - filename = _tmp8_; - gtk_file_chooser_set_current_name ((GtkFileChooser*) self->priv->save_dialog, filename); + filename = _tmp19_; + _tmp20_ = self->priv->save_dialog; + _tmp21_ = filename; + gtk_file_chooser_set_current_name ((GtkFileChooser*) _tmp20_, _tmp21_); _g_free0 (filename); _g_free0 (path); _g_free0 (extension); @@ -926,170 +1204,302 @@ static void _simple_scan_on_file_type_changed_gtk_tree_selection_changed (GtkTre static gchar* simple_scan_choose_file_location (SimpleScan* self) { gchar* result = NULL; gchar* directory; - gchar* _tmp0_ = NULL; - gboolean _tmp1_ = FALSE; - const gchar* _tmp4_ = NULL; - GtkFileChooserDialog* _tmp5_ = NULL; - GtkFileFilter* _tmp6_ = NULL; + GSettings* _tmp0_; + gchar* _tmp1_ = NULL; + gboolean _tmp2_ = FALSE; + const gchar* _tmp3_; + gboolean _tmp5_; + const gchar* _tmp8_ = NULL; + GtkWindow* _tmp9_; + GtkFileChooserDialog* _tmp10_; + GtkFileChooserDialog* _tmp11_; + GtkFileChooserDialog* _tmp12_; + GtkFileChooserDialog* _tmp13_; + GtkFileChooserDialog* _tmp14_; + const gchar* _tmp15_; + GtkFileChooserDialog* _tmp16_; + const gchar* _tmp17_; + GtkFileFilter* _tmp18_; + GtkFileFilter* _tmp19_; GtkFileFilter* filter; - const gchar* _tmp7_ = NULL; - GtkFileFilter* _tmp8_ = NULL; - const gchar* _tmp9_ = NULL; - const gchar* _tmp10_ = NULL; - GtkExpander* _tmp11_ = NULL; + GtkFileFilter* _tmp20_; + const gchar* _tmp21_ = NULL; + GtkFileFilter* _tmp22_; + GtkFileFilter* _tmp23_; + GtkFileChooserDialog* _tmp24_; + GtkFileFilter* _tmp25_; + GtkFileFilter* _tmp26_; + GtkFileFilter* _tmp27_; + GtkFileFilter* _tmp28_; + const gchar* _tmp29_ = NULL; + GtkFileFilter* _tmp30_; + GtkFileChooserDialog* _tmp31_; + GtkFileFilter* _tmp32_; + const gchar* _tmp33_ = NULL; + GtkExpander* _tmp34_; + GtkExpander* _tmp35_; GtkExpander* expander; - gchar* _tmp12_; + GtkExpander* _tmp36_; + GtkFileChooserDialog* _tmp37_; + GtkExpander* _tmp38_; + gchar* _tmp39_; gchar* extension; - gint _tmp13_; + const gchar* _tmp40_; + gint _tmp41_ = 0; gint index; - GtkListStore* _tmp15_ = NULL; + gint _tmp42_; + GtkListStore* _tmp46_; GtkListStore* file_type_store; GtkTreeIter iter = {0}; - GtkTreeIter _tmp16_ = {0}; - const gchar* _tmp17_ = NULL; - GtkTreeIter _tmp18_ = {0}; - const gchar* _tmp19_ = NULL; - GtkTreeIter _tmp20_ = {0}; - const gchar* _tmp21_ = NULL; - GtkTreeView* _tmp22_ = NULL; + GtkListStore* _tmp47_; + GtkTreeIter _tmp48_ = {0}; + GtkListStore* _tmp49_; + GtkTreeIter _tmp50_; + const gchar* _tmp51_ = NULL; + GtkListStore* _tmp52_; + GtkTreeIter _tmp53_ = {0}; + GtkListStore* _tmp54_; + GtkTreeIter _tmp55_; + const gchar* _tmp56_ = NULL; + GtkListStore* _tmp57_; + GtkTreeIter _tmp58_ = {0}; + GtkListStore* _tmp59_; + GtkTreeIter _tmp60_; + const gchar* _tmp61_ = NULL; + GtkListStore* _tmp62_; + GtkTreeView* _tmp63_; + GtkTreeView* _tmp64_; GtkTreeView* file_type_view; - GtkCellRendererText* _tmp23_ = NULL; - GtkCellRendererText* _tmp24_; - GtkTreeViewColumn* _tmp25_ = NULL; - GtkTreeViewColumn* _tmp26_; + GtkTreeView* _tmp65_; + GtkTreeView* _tmp66_; + GtkCellRendererText* _tmp67_; + GtkCellRendererText* _tmp68_; + GtkTreeViewColumn* _tmp69_; + GtkTreeViewColumn* _tmp70_; + GtkTreeViewColumn* _tmp71_; GtkTreeViewColumn* column; - GtkTreeIter _tmp27_ = {0}; - gboolean _tmp28_; - GtkTreeSelection* _tmp32_ = NULL; - gint _tmp33_; + GtkTreeView* _tmp72_; + GtkTreeViewColumn* _tmp73_; + GtkExpander* _tmp74_; + GtkTreeView* _tmp75_; + GtkListStore* _tmp76_; + GtkTreeIter _tmp77_ = {0}; + gboolean _tmp78_ = FALSE; + GtkTreeView* _tmp90_; + GtkTreeSelection* _tmp91_ = NULL; + GtkExpander* _tmp92_; + GtkFileChooserDialog* _tmp93_; + gint _tmp94_ = 0; gint response; gchar* uri; - gchar* _tmp35_ = NULL; - gchar* _tmp36_; + gint _tmp95_; + GSettings* _tmp98_; + GtkFileChooserDialog* _tmp99_; + gchar* _tmp100_ = NULL; + gchar* _tmp101_; + GtkFileChooserDialog* _tmp102_; g_return_val_if_fail (self != NULL, NULL); directory = NULL; - _tmp0_ = g_settings_get_string (self->priv->settings, "save-directory"); + _tmp0_ = self->priv->settings; + _tmp1_ = g_settings_get_string (_tmp0_, "save-directory"); _g_free0 (directory); - directory = _tmp0_; - if (directory == NULL) { - _tmp1_ = TRUE; + directory = _tmp1_; + _tmp3_ = directory; + if (_tmp3_ == NULL) { + _tmp2_ = TRUE; } else { - _tmp1_ = g_strcmp0 (directory, "") == 0; + const gchar* _tmp4_; + _tmp4_ = directory; + _tmp2_ = g_strcmp0 (_tmp4_, "") == 0; } - if (_tmp1_) { - const gchar* _tmp2_ = NULL; - gchar* _tmp3_; - _tmp2_ = g_get_user_special_dir (G_USER_DIRECTORY_DOCUMENTS); - _tmp3_ = g_strdup (_tmp2_); + _tmp5_ = _tmp2_; + if (_tmp5_) { + const gchar* _tmp6_ = NULL; + gchar* _tmp7_; + _tmp6_ = g_get_user_special_dir (G_USER_DIRECTORY_DOCUMENTS); + _tmp7_ = g_strdup (_tmp6_); _g_free0 (directory); - directory = _tmp3_; + directory = _tmp7_; } - _tmp4_ = _ ("Save As..."); - _tmp5_ = (GtkFileChooserDialog*) gtk_file_chooser_dialog_new (_tmp4_, self->priv->window, GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL, NULL); + _tmp8_ = _ ("Save As..."); + _tmp9_ = self->priv->window; + _tmp10_ = (GtkFileChooserDialog*) gtk_file_chooser_dialog_new (_tmp8_, _tmp9_, GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL, NULL); + _tmp11_ = g_object_ref_sink (_tmp10_); _g_object_unref0 (self->priv->save_dialog); - self->priv->save_dialog = g_object_ref_sink (_tmp5_); - gtk_file_chooser_set_do_overwrite_confirmation ((GtkFileChooser*) self->priv->save_dialog, TRUE); - gtk_file_chooser_set_local_only ((GtkFileChooser*) self->priv->save_dialog, FALSE); - gtk_file_chooser_set_current_folder ((GtkFileChooser*) self->priv->save_dialog, directory); - gtk_file_chooser_set_current_name ((GtkFileChooser*) self->priv->save_dialog, self->priv->default_file_name); - _tmp6_ = gtk_file_filter_new (); - filter = g_object_ref_sink (_tmp6_); - _tmp7_ = _ ("Image Files"); - gtk_buildable_set_name ((GtkBuildable*) filter, _tmp7_); - gtk_file_filter_add_pixbuf_formats (filter); - gtk_file_filter_add_mime_type (filter, "application/pdf"); - gtk_file_chooser_add_filter ((GtkFileChooser*) self->priv->save_dialog, filter); - _tmp8_ = gtk_file_filter_new (); + self->priv->save_dialog = _tmp11_; + _tmp12_ = self->priv->save_dialog; + gtk_file_chooser_set_do_overwrite_confirmation ((GtkFileChooser*) _tmp12_, TRUE); + _tmp13_ = self->priv->save_dialog; + gtk_file_chooser_set_local_only ((GtkFileChooser*) _tmp13_, FALSE); + _tmp14_ = self->priv->save_dialog; + _tmp15_ = directory; + gtk_file_chooser_set_current_folder ((GtkFileChooser*) _tmp14_, _tmp15_); + _tmp16_ = self->priv->save_dialog; + _tmp17_ = self->priv->default_file_name; + gtk_file_chooser_set_current_name ((GtkFileChooser*) _tmp16_, _tmp17_); + _tmp18_ = gtk_file_filter_new (); + _tmp19_ = g_object_ref_sink (_tmp18_); + filter = _tmp19_; + _tmp20_ = filter; + _tmp21_ = _ ("Image Files"); + gtk_buildable_set_name ((GtkBuildable*) _tmp20_, _tmp21_); + _tmp22_ = filter; + gtk_file_filter_add_pixbuf_formats (_tmp22_); + _tmp23_ = filter; + gtk_file_filter_add_mime_type (_tmp23_, "application/pdf"); + _tmp24_ = self->priv->save_dialog; + _tmp25_ = filter; + gtk_file_chooser_add_filter ((GtkFileChooser*) _tmp24_, _tmp25_); + _tmp26_ = gtk_file_filter_new (); + _tmp27_ = g_object_ref_sink (_tmp26_); _g_object_unref0 (filter); - filter = g_object_ref_sink (_tmp8_); - _tmp9_ = _ ("All Files"); - gtk_buildable_set_name ((GtkBuildable*) filter, _tmp9_); - gtk_file_filter_add_pattern (filter, "*"); - gtk_file_chooser_add_filter ((GtkFileChooser*) self->priv->save_dialog, filter); - _tmp10_ = _ ("Select File _Type"); - _tmp11_ = (GtkExpander*) gtk_expander_new_with_mnemonic (_tmp10_); - expander = g_object_ref_sink (_tmp11_); - gtk_expander_set_spacing (expander, 5); - gtk_file_chooser_set_extra_widget ((GtkFileChooser*) self->priv->save_dialog, (GtkWidget*) expander); - _tmp12_ = g_strdup (""); - extension = _tmp12_; - _tmp13_ = string_last_index_of_char (self->priv->default_file_name, (gunichar) '.', 0); - index = _tmp13_; - if (index >= 0) { - gchar* _tmp14_ = NULL; - _tmp14_ = string_slice (self->priv->default_file_name, (glong) 0, (glong) index); + filter = _tmp27_; + _tmp28_ = filter; + _tmp29_ = _ ("All Files"); + gtk_buildable_set_name ((GtkBuildable*) _tmp28_, _tmp29_); + _tmp30_ = filter; + gtk_file_filter_add_pattern (_tmp30_, "*"); + _tmp31_ = self->priv->save_dialog; + _tmp32_ = filter; + gtk_file_chooser_add_filter ((GtkFileChooser*) _tmp31_, _tmp32_); + _tmp33_ = _ ("Select File _Type"); + _tmp34_ = (GtkExpander*) gtk_expander_new_with_mnemonic (_tmp33_); + _tmp35_ = g_object_ref_sink (_tmp34_); + expander = _tmp35_; + _tmp36_ = expander; + gtk_expander_set_spacing (_tmp36_, 5); + _tmp37_ = self->priv->save_dialog; + _tmp38_ = expander; + gtk_file_chooser_set_extra_widget ((GtkFileChooser*) _tmp37_, (GtkWidget*) _tmp38_); + _tmp39_ = g_strdup (""); + extension = _tmp39_; + _tmp40_ = self->priv->default_file_name; + _tmp41_ = string_last_index_of_char (_tmp40_, (gunichar) '.', 0); + index = _tmp41_; + _tmp42_ = index; + if (_tmp42_ >= 0) { + const gchar* _tmp43_; + gint _tmp44_; + gchar* _tmp45_ = NULL; + _tmp43_ = self->priv->default_file_name; + _tmp44_ = index; + _tmp45_ = string_slice (_tmp43_, (glong) 0, (glong) _tmp44_); _g_free0 (extension); - extension = _tmp14_; - } - _tmp15_ = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING); - file_type_store = _tmp15_; - gtk_list_store_append (file_type_store, &_tmp16_); - iter = _tmp16_; - _tmp17_ = _ ("PDF (multi-page document)"); - gtk_list_store_set (file_type_store, &iter, 0, _tmp17_, 1, ".pdf", -1, -1); - gtk_list_store_append (file_type_store, &_tmp18_); - iter = _tmp18_; - _tmp19_ = _ ("JPEG (compressed)"); - gtk_list_store_set (file_type_store, &iter, 0, _tmp19_, 1, ".jpg", -1, -1); - gtk_list_store_append (file_type_store, &_tmp20_); - iter = _tmp20_; - _tmp21_ = _ ("PNG (lossless)"); - gtk_list_store_set (file_type_store, &iter, 0, _tmp21_, 1, ".png", -1, -1); - _tmp22_ = (GtkTreeView*) gtk_tree_view_new_with_model ((GtkTreeModel*) file_type_store); - file_type_view = g_object_ref_sink (_tmp22_); - gtk_tree_view_set_headers_visible (file_type_view, FALSE); - gtk_tree_view_set_rules_hint (file_type_view, TRUE); - _tmp23_ = (GtkCellRendererText*) gtk_cell_renderer_text_new (); - _tmp24_ = g_object_ref_sink (_tmp23_); - _tmp25_ = gtk_tree_view_column_new_with_attributes ("", (GtkCellRenderer*) _tmp24_, "text", 0, NULL, NULL); - _tmp26_ = g_object_ref_sink (_tmp25_); - _g_object_unref0 (_tmp24_); - column = _tmp26_; - gtk_tree_view_append_column (file_type_view, column); - gtk_container_add ((GtkContainer*) expander, (GtkWidget*) file_type_view); - _tmp28_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) file_type_store, &_tmp27_); - iter = _tmp27_; - if (_tmp28_) { + extension = _tmp45_; + } + _tmp46_ = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING); + file_type_store = _tmp46_; + _tmp47_ = file_type_store; + gtk_list_store_append (_tmp47_, &_tmp48_); + iter = _tmp48_; + _tmp49_ = file_type_store; + _tmp50_ = iter; + _tmp51_ = _ ("PDF (multi-page document)"); + gtk_list_store_set (_tmp49_, &_tmp50_, 0, _tmp51_, 1, ".pdf", -1, -1); + _tmp52_ = file_type_store; + gtk_list_store_append (_tmp52_, &_tmp53_); + iter = _tmp53_; + _tmp54_ = file_type_store; + _tmp55_ = iter; + _tmp56_ = _ ("JPEG (compressed)"); + gtk_list_store_set (_tmp54_, &_tmp55_, 0, _tmp56_, 1, ".jpg", -1, -1); + _tmp57_ = file_type_store; + gtk_list_store_append (_tmp57_, &_tmp58_); + iter = _tmp58_; + _tmp59_ = file_type_store; + _tmp60_ = iter; + _tmp61_ = _ ("PNG (lossless)"); + gtk_list_store_set (_tmp59_, &_tmp60_, 0, _tmp61_, 1, ".png", -1, -1); + _tmp62_ = file_type_store; + _tmp63_ = (GtkTreeView*) gtk_tree_view_new_with_model ((GtkTreeModel*) _tmp62_); + _tmp64_ = g_object_ref_sink (_tmp63_); + file_type_view = _tmp64_; + _tmp65_ = file_type_view; + gtk_tree_view_set_headers_visible (_tmp65_, FALSE); + _tmp66_ = file_type_view; + gtk_tree_view_set_rules_hint (_tmp66_, TRUE); + _tmp67_ = (GtkCellRendererText*) gtk_cell_renderer_text_new (); + _tmp68_ = g_object_ref_sink (_tmp67_); + _tmp69_ = gtk_tree_view_column_new_with_attributes ("", (GtkCellRenderer*) _tmp68_, "text", 0, NULL, NULL); + _tmp70_ = g_object_ref_sink (_tmp69_); + _tmp71_ = _tmp70_; + _g_object_unref0 (_tmp68_); + column = _tmp71_; + _tmp72_ = file_type_view; + _tmp73_ = column; + gtk_tree_view_append_column (_tmp72_, _tmp73_); + _tmp74_ = expander; + _tmp75_ = file_type_view; + gtk_container_add ((GtkContainer*) _tmp74_, (GtkWidget*) _tmp75_); + _tmp76_ = file_type_store; + _tmp78_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) _tmp76_, &_tmp77_); + iter = _tmp77_; + if (_tmp78_) { { - gboolean _tmp29_; - _tmp29_ = TRUE; + gboolean _tmp79_; + _tmp79_ = TRUE; while (TRUE) { + gboolean _tmp80_; gchar* e = NULL; - if (!_tmp29_) { - gboolean _tmp30_; - _tmp30_ = gtk_tree_model_iter_next ((GtkTreeModel*) file_type_store, &iter); - if (!_tmp30_) { + GtkListStore* _tmp83_; + GtkTreeIter _tmp84_; + const gchar* _tmp85_; + const gchar* _tmp86_; + _tmp80_ = _tmp79_; + if (!_tmp80_) { + GtkListStore* _tmp81_; + gboolean _tmp82_ = FALSE; + _tmp81_ = file_type_store; + _tmp82_ = gtk_tree_model_iter_next ((GtkTreeModel*) _tmp81_, &iter); + if (!_tmp82_) { break; } } - _tmp29_ = FALSE; - gtk_tree_model_get ((GtkTreeModel*) file_type_store, &iter, 1, &e, -1, -1); - if (g_strcmp0 (extension, e) == 0) { - GtkTreeSelection* _tmp31_ = NULL; - _tmp31_ = gtk_tree_view_get_selection (file_type_view); - gtk_tree_selection_select_iter (_tmp31_, &iter); + _tmp79_ = FALSE; + _tmp83_ = file_type_store; + _tmp84_ = iter; + gtk_tree_model_get ((GtkTreeModel*) _tmp83_, &_tmp84_, 1, &e, -1, -1); + _tmp85_ = extension; + _tmp86_ = e; + if (g_strcmp0 (_tmp85_, _tmp86_) == 0) { + GtkTreeView* _tmp87_; + GtkTreeSelection* _tmp88_ = NULL; + GtkTreeIter _tmp89_; + _tmp87_ = file_type_view; + _tmp88_ = gtk_tree_view_get_selection (_tmp87_); + _tmp89_ = iter; + gtk_tree_selection_select_iter (_tmp88_, &_tmp89_); } _g_free0 (e); } } } - _tmp32_ = gtk_tree_view_get_selection (file_type_view); - g_signal_connect (_tmp32_, "changed", (GCallback) _simple_scan_on_file_type_changed_gtk_tree_selection_changed, self); - gtk_widget_show_all ((GtkWidget*) expander); - _tmp33_ = gtk_dialog_run ((GtkDialog*) self->priv->save_dialog); - response = _tmp33_; + _tmp90_ = file_type_view; + _tmp91_ = gtk_tree_view_get_selection (_tmp90_); + g_signal_connect (_tmp91_, "changed", (GCallback) _simple_scan_on_file_type_changed_gtk_tree_selection_changed, self); + _tmp92_ = expander; + gtk_widget_show_all ((GtkWidget*) _tmp92_); + _tmp93_ = self->priv->save_dialog; + _tmp94_ = gtk_dialog_run ((GtkDialog*) _tmp93_); + response = _tmp94_; uri = NULL; - if (response == ((gint) GTK_RESPONSE_ACCEPT)) { - gchar* _tmp34_ = NULL; - _tmp34_ = gtk_file_chooser_get_uri ((GtkFileChooser*) self->priv->save_dialog); + _tmp95_ = response; + if (_tmp95_ == ((gint) GTK_RESPONSE_ACCEPT)) { + GtkFileChooserDialog* _tmp96_; + gchar* _tmp97_ = NULL; + _tmp96_ = self->priv->save_dialog; + _tmp97_ = gtk_file_chooser_get_uri ((GtkFileChooser*) _tmp96_); _g_free0 (uri); - uri = _tmp34_; + uri = _tmp97_; } - _tmp35_ = gtk_file_chooser_get_current_folder ((GtkFileChooser*) self->priv->save_dialog); - _tmp36_ = _tmp35_; - g_settings_set_string (self->priv->settings, "save-directory", _tmp36_); - _g_free0 (_tmp36_); - gtk_widget_destroy ((GtkWidget*) self->priv->save_dialog); + _tmp98_ = self->priv->settings; + _tmp99_ = self->priv->save_dialog; + _tmp100_ = gtk_file_chooser_get_current_folder ((GtkFileChooser*) _tmp99_); + _tmp101_ = _tmp100_; + g_settings_set_string (_tmp98_, "save-directory", _tmp101_); + _g_free0 (_tmp101_); + _tmp102_ = self->priv->save_dialog; + gtk_widget_destroy ((GtkWidget*) _tmp102_); _g_object_unref0 (self->priv->save_dialog); self->priv->save_dialog = NULL; result = uri; @@ -1108,88 +1518,124 @@ static gboolean simple_scan_save_document (SimpleScan* self, gboolean force_choo gboolean result = FALSE; gchar* uri = NULL; gboolean _tmp0_ = FALSE; - GFile* _tmp3_ = NULL; + const gchar* _tmp1_; + gboolean _tmp3_; + const gchar* _tmp7_; + const gchar* _tmp8_; + GFile* _tmp9_ = NULL; GFile* file; - gchar* _tmp4_ = NULL; + const gchar* _tmp10_; + const gchar* _tmp11_; + gchar* _tmp12_ = NULL; gchar* uri_lower; - gchar* _tmp5_; + gchar* _tmp13_; gchar* format; - gboolean _tmp6_; - gchar* _tmp17_; + const gchar* _tmp14_; + gboolean _tmp15_ = FALSE; + const gchar* _tmp38_; + gchar* _tmp39_; + Book* _tmp40_; GError * _inner_error_ = NULL; g_return_val_if_fail (self != NULL, FALSE); - if (self->priv->book_uri != NULL) { - _tmp0_ = !force_choose_location; + _tmp1_ = self->priv->book_uri; + if (_tmp1_ != NULL) { + gboolean _tmp2_; + _tmp2_ = force_choose_location; + _tmp0_ = !_tmp2_; } else { _tmp0_ = FALSE; } - if (_tmp0_) { - gchar* _tmp1_; - _tmp1_ = g_strdup (self->priv->book_uri); + _tmp3_ = _tmp0_; + if (_tmp3_) { + const gchar* _tmp4_; + gchar* _tmp5_; + _tmp4_ = self->priv->book_uri; + _tmp5_ = g_strdup (_tmp4_); _g_free0 (uri); - uri = _tmp1_; + uri = _tmp5_; } else { - gchar* _tmp2_ = NULL; - _tmp2_ = simple_scan_choose_file_location (self); + gchar* _tmp6_ = NULL; + _tmp6_ = simple_scan_choose_file_location (self); _g_free0 (uri); - uri = _tmp2_; + uri = _tmp6_; } - if (uri == NULL) { + _tmp7_ = uri; + if (_tmp7_ == NULL) { result = FALSE; _g_free0 (uri); return result; } - _tmp3_ = g_file_new_for_uri (uri); - file = _tmp3_; - g_debug ("ui.vala:445: Saving to '%s'", uri); - _tmp4_ = g_utf8_strdown (uri, (gssize) (-1)); - uri_lower = _tmp4_; - _tmp5_ = g_strdup ("jpeg"); - format = _tmp5_; - _tmp6_ = g_str_has_suffix (uri_lower, ".pdf"); - if (_tmp6_) { - gchar* _tmp7_; - _tmp7_ = g_strdup ("pdf"); + _tmp8_ = uri; + _tmp9_ = g_file_new_for_uri (_tmp8_); + file = _tmp9_; + _tmp10_ = uri; + g_debug ("ui.vala:445: Saving to '%s'", _tmp10_); + _tmp11_ = uri; + _tmp12_ = g_utf8_strdown (_tmp11_, (gssize) (-1)); + uri_lower = _tmp12_; + _tmp13_ = g_strdup ("jpeg"); + format = _tmp13_; + _tmp14_ = uri_lower; + _tmp15_ = g_str_has_suffix (_tmp14_, ".pdf"); + if (_tmp15_) { + gchar* _tmp16_; + _tmp16_ = g_strdup ("pdf"); _g_free0 (format); - format = _tmp7_; + format = _tmp16_; } else { - gboolean _tmp8_; - _tmp8_ = g_str_has_suffix (uri_lower, ".ps"); - if (_tmp8_) { - gchar* _tmp9_; - _tmp9_ = g_strdup ("ps"); + const gchar* _tmp17_; + gboolean _tmp18_ = FALSE; + _tmp17_ = uri_lower; + _tmp18_ = g_str_has_suffix (_tmp17_, ".ps"); + if (_tmp18_) { + gchar* _tmp19_; + _tmp19_ = g_strdup ("ps"); _g_free0 (format); - format = _tmp9_; + format = _tmp19_; } else { - gboolean _tmp10_; - _tmp10_ = g_str_has_suffix (uri_lower, ".png"); - if (_tmp10_) { - gchar* _tmp11_; - _tmp11_ = g_strdup ("png"); + const gchar* _tmp20_; + gboolean _tmp21_ = FALSE; + _tmp20_ = uri_lower; + _tmp21_ = g_str_has_suffix (_tmp20_, ".png"); + if (_tmp21_) { + gchar* _tmp22_; + _tmp22_ = g_strdup ("png"); _g_free0 (format); - format = _tmp11_; + format = _tmp22_; } else { - gboolean _tmp12_ = FALSE; - gboolean _tmp13_; - _tmp13_ = g_str_has_suffix (uri_lower, ".tif"); - if (_tmp13_) { - _tmp12_ = TRUE; + gboolean _tmp23_ = FALSE; + const gchar* _tmp24_; + gboolean _tmp25_ = FALSE; + gboolean _tmp28_; + _tmp24_ = uri_lower; + _tmp25_ = g_str_has_suffix (_tmp24_, ".tif"); + if (_tmp25_) { + _tmp23_ = TRUE; } else { - gboolean _tmp14_; - _tmp14_ = g_str_has_suffix (uri_lower, ".tiff"); - _tmp12_ = _tmp14_; + const gchar* _tmp26_; + gboolean _tmp27_ = FALSE; + _tmp26_ = uri_lower; + _tmp27_ = g_str_has_suffix (_tmp26_, ".tiff"); + _tmp23_ = _tmp27_; } - if (_tmp12_) { - gchar* _tmp15_; - _tmp15_ = g_strdup ("tiff"); + _tmp28_ = _tmp23_; + if (_tmp28_) { + gchar* _tmp29_; + _tmp29_ = g_strdup ("tiff"); _g_free0 (format); - format = _tmp15_; + format = _tmp29_; } } } } { - book_save (self->priv->book, format, file, &_inner_error_); + Book* _tmp30_; + const gchar* _tmp31_; + GFile* _tmp32_; + _tmp30_ = self->priv->book; + _tmp31_ = format; + _tmp32_ = file; + book_save (_tmp30_, _tmp31_, _tmp32_, &_inner_error_); if (_inner_error_ != NULL) { goto __catch11_g_error; } @@ -1198,12 +1644,20 @@ static gboolean simple_scan_save_document (SimpleScan* self, gboolean force_choo __catch11_g_error: { GError* e = NULL; - const gchar* _tmp16_ = NULL; + GError* _tmp33_; + const gchar* _tmp34_; + const gchar* _tmp35_ = NULL; + GError* _tmp36_; + const gchar* _tmp37_; e = _inner_error_; _inner_error_ = NULL; - g_warning ("ui.vala:464: Error saving file: %s", e->message); - _tmp16_ = _ ("Failed to save file"); - simple_scan_show_error (self, _tmp16_, e->message, FALSE); + _tmp33_ = e; + _tmp34_ = _tmp33_->message; + g_warning ("ui.vala:464: Error saving file: %s", _tmp34_); + _tmp35_ = _ ("Failed to save file"); + _tmp36_ = e; + _tmp37_ = _tmp36_->message; + simple_scan_show_error (self, _tmp35_, _tmp37_, FALSE); result = FALSE; _g_error_free0 (e); _g_free0 (format); @@ -1222,10 +1676,12 @@ static gboolean simple_scan_save_document (SimpleScan* self, gboolean force_choo g_clear_error (&_inner_error_); return FALSE; } - _tmp17_ = g_strdup (uri); + _tmp38_ = uri; + _tmp39_ = g_strdup (_tmp38_); _g_free0 (self->priv->book_uri); - self->priv->book_uri = _tmp17_; - book_set_needs_saving (self->priv->book, FALSE); + self->priv->book_uri = _tmp39_; + _tmp40_ = self->priv->book; + book_set_needs_saving (_tmp40_, FALSE); result = TRUE; _g_free0 (format); _g_free0 (uri_lower); @@ -1237,36 +1693,60 @@ static gboolean simple_scan_save_document (SimpleScan* self, gboolean force_choo static gboolean simple_scan_prompt_to_save (SimpleScan* self, const gchar* title, const gchar* discard_label) { gboolean result = FALSE; - gboolean _tmp0_; - GtkMessageDialog* _tmp1_ = NULL; + Book* _tmp0_; + gboolean _tmp1_ = FALSE; + GtkWindow* _tmp2_; + const gchar* _tmp3_; + GtkMessageDialog* _tmp4_; + GtkMessageDialog* _tmp5_; GtkMessageDialog* dialog; - const gchar* _tmp2_ = NULL; - gint _tmp3_; + GtkMessageDialog* _tmp6_; + const gchar* _tmp7_ = NULL; + GtkMessageDialog* _tmp8_; + const gchar* _tmp9_; + GtkMessageDialog* _tmp10_; + GtkMessageDialog* _tmp11_; + GtkMessageDialog* _tmp12_; + gint _tmp13_ = 0; gint response; + GtkMessageDialog* _tmp14_; + gint _tmp15_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (title != NULL, FALSE); g_return_val_if_fail (discard_label != NULL, FALSE); - _tmp0_ = book_get_needs_saving (self->priv->book); - if (!_tmp0_) { + _tmp0_ = self->priv->book; + _tmp1_ = book_get_needs_saving (_tmp0_); + if (!_tmp1_) { result = TRUE; return result; } - _tmp1_ = (GtkMessageDialog*) gtk_message_dialog_new (self->priv->window, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE, "%s", title); - dialog = g_object_ref_sink (_tmp1_); - _tmp2_ = _ ("If you don't save, changes will be permanently lost."); - gtk_message_dialog_format_secondary_text (dialog, "%s", _tmp2_, NULL); - gtk_dialog_add_button ((GtkDialog*) dialog, discard_label, (gint) GTK_RESPONSE_NO); - gtk_dialog_add_button ((GtkDialog*) dialog, GTK_STOCK_CANCEL, (gint) GTK_RESPONSE_CANCEL); - gtk_dialog_add_button ((GtkDialog*) dialog, GTK_STOCK_SAVE, (gint) GTK_RESPONSE_YES); - _tmp3_ = gtk_dialog_run ((GtkDialog*) dialog); - response = _tmp3_; - gtk_widget_destroy ((GtkWidget*) dialog); - switch (response) { + _tmp2_ = self->priv->window; + _tmp3_ = title; + _tmp4_ = (GtkMessageDialog*) gtk_message_dialog_new (_tmp2_, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE, "%s", _tmp3_); + _tmp5_ = g_object_ref_sink (_tmp4_); + dialog = _tmp5_; + _tmp6_ = dialog; + _tmp7_ = _ ("If you don't save, changes will be permanently lost."); + gtk_message_dialog_format_secondary_text (_tmp6_, "%s", _tmp7_); + _tmp8_ = dialog; + _tmp9_ = discard_label; + gtk_dialog_add_button ((GtkDialog*) _tmp8_, _tmp9_, (gint) GTK_RESPONSE_NO); + _tmp10_ = dialog; + gtk_dialog_add_button ((GtkDialog*) _tmp10_, GTK_STOCK_CANCEL, (gint) GTK_RESPONSE_CANCEL); + _tmp11_ = dialog; + gtk_dialog_add_button ((GtkDialog*) _tmp11_, GTK_STOCK_SAVE, (gint) GTK_RESPONSE_YES); + _tmp12_ = dialog; + _tmp13_ = gtk_dialog_run ((GtkDialog*) _tmp12_); + response = _tmp13_; + _tmp14_ = dialog; + gtk_widget_destroy ((GtkWidget*) _tmp14_); + _tmp15_ = response; + switch (_tmp15_) { case GTK_RESPONSE_YES: { - gboolean _tmp4_; - _tmp4_ = simple_scan_save_document (self, FALSE); - if (_tmp4_) { + gboolean _tmp16_ = FALSE; + _tmp16_ = simple_scan_save_document (self, FALSE); + if (_tmp16_) { result = TRUE; _g_object_unref0 (dialog); return result; @@ -1295,20 +1775,26 @@ static gboolean simple_scan_prompt_to_save (SimpleScan* self, const gchar* title static void simple_scan_clear_document (SimpleScan* self) { + Book* _tmp0_; + Book* _tmp1_; + GtkMenuItem* _tmp2_; g_return_if_fail (self != NULL); - book_clear (self->priv->book); + _tmp0_ = self->priv->book; + book_clear (_tmp0_); simple_scan_add_default_page (self); _g_free0 (self->priv->book_uri); self->priv->book_uri = NULL; - book_set_needs_saving (self->priv->book, FALSE); - gtk_widget_set_sensitive ((GtkWidget*) self->priv->save_as_menuitem, FALSE); + _tmp1_ = self->priv->book; + book_set_needs_saving (_tmp1_, FALSE); + _tmp2_ = self->priv->save_as_menuitem; + gtk_widget_set_sensitive ((GtkWidget*) _tmp2_, FALSE); } void G_MODULE_EXPORT new_button_clicked_cb (GtkWidget* widget, SimpleScan* self) { const gchar* _tmp0_ = NULL; const gchar* _tmp1_ = NULL; - gboolean _tmp2_; + gboolean _tmp2_ = FALSE; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); _tmp0_ = _ ("Save current document?"); @@ -1322,41 +1808,59 @@ void G_MODULE_EXPORT new_button_clicked_cb (GtkWidget* widget, SimpleScan* self) static void simple_scan_set_document_hint (SimpleScan* self, const gchar* document_hint) { - gchar* _tmp0_; + const gchar* _tmp0_; + gchar* _tmp1_; + const gchar* _tmp2_; g_return_if_fail (self != NULL); g_return_if_fail (document_hint != NULL); - _tmp0_ = g_strdup (document_hint); + _tmp0_ = document_hint; + _tmp1_ = g_strdup (_tmp0_); _g_free0 (self->priv->document_hint); - self->priv->document_hint = _tmp0_; - if (g_strcmp0 (document_hint, "text") == 0) { - gtk_check_menu_item_set_active ((GtkCheckMenuItem*) self->priv->text_toolbar_menuitem, TRUE); - gtk_check_menu_item_set_active ((GtkCheckMenuItem*) self->priv->text_menu_menuitem, TRUE); + self->priv->document_hint = _tmp1_; + _tmp2_ = document_hint; + if (g_strcmp0 (_tmp2_, "text") == 0) { + GtkRadioMenuItem* _tmp3_; + GtkRadioMenuItem* _tmp4_; + _tmp3_ = self->priv->text_toolbar_menuitem; + gtk_check_menu_item_set_active ((GtkCheckMenuItem*) _tmp3_, TRUE); + _tmp4_ = self->priv->text_menu_menuitem; + gtk_check_menu_item_set_active ((GtkCheckMenuItem*) _tmp4_, TRUE); } else { - if (g_strcmp0 (document_hint, "photo") == 0) { - gtk_check_menu_item_set_active ((GtkCheckMenuItem*) self->priv->photo_toolbar_menuitem, TRUE); - gtk_check_menu_item_set_active ((GtkCheckMenuItem*) self->priv->photo_menu_menuitem, TRUE); + const gchar* _tmp5_; + _tmp5_ = document_hint; + if (g_strcmp0 (_tmp5_, "photo") == 0) { + GtkRadioMenuItem* _tmp6_; + GtkRadioMenuItem* _tmp7_; + _tmp6_ = self->priv->photo_toolbar_menuitem; + gtk_check_menu_item_set_active ((GtkCheckMenuItem*) _tmp6_, TRUE); + _tmp7_ = self->priv->photo_menu_menuitem; + gtk_check_menu_item_set_active ((GtkCheckMenuItem*) _tmp7_, TRUE); } } } void G_MODULE_EXPORT text_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) { - gboolean _tmp0_; + GtkCheckMenuItem* _tmp0_; + gboolean _tmp1_ = FALSE; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - _tmp0_ = gtk_check_menu_item_get_active (widget); - if (_tmp0_) { + _tmp0_ = widget; + _tmp1_ = gtk_check_menu_item_get_active (_tmp0_); + if (_tmp1_) { simple_scan_set_document_hint (self, "text"); } } void G_MODULE_EXPORT photo_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) { - gboolean _tmp0_; + GtkCheckMenuItem* _tmp0_; + gboolean _tmp1_ = FALSE; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - _tmp0_ = gtk_check_menu_item_get_active (widget); - if (_tmp0_) { + _tmp0_ = widget; + _tmp1_ = gtk_check_menu_item_get_active (_tmp0_); + if (_tmp1_) { simple_scan_set_document_hint (self, "photo"); } } @@ -1364,28 +1868,46 @@ void G_MODULE_EXPORT photo_menuitem_toggled_cb (GtkCheckMenuItem* widget, Simple static void simple_scan_set_page_side (SimpleScan* self, ScanType page_side) { GtkTreeIter iter = {0}; - GtkTreeIter _tmp0_ = {0}; - gboolean _tmp1_; + GtkListStore* _tmp0_; + GtkTreeIter _tmp1_ = {0}; + gboolean _tmp2_ = FALSE; g_return_if_fail (self != NULL); - _tmp1_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) self->priv->page_side_model, &_tmp0_); - iter = _tmp0_; - if (_tmp1_) { + _tmp0_ = self->priv->page_side_model; + _tmp2_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) _tmp0_, &_tmp1_); + iter = _tmp1_; + if (_tmp2_) { { - gboolean _tmp2_; - _tmp2_ = TRUE; + gboolean _tmp3_; + _tmp3_ = TRUE; while (TRUE) { + gboolean _tmp4_; gint s = 0; - if (!_tmp2_) { - gboolean _tmp3_; - _tmp3_ = gtk_tree_model_iter_next ((GtkTreeModel*) self->priv->page_side_model, &iter); - if (!_tmp3_) { + GtkListStore* _tmp7_; + GtkTreeIter _tmp8_; + gint _tmp9_; + ScanType _tmp10_; + _tmp4_ = _tmp3_; + if (!_tmp4_) { + GtkListStore* _tmp5_; + gboolean _tmp6_ = FALSE; + _tmp5_ = self->priv->page_side_model; + _tmp6_ = gtk_tree_model_iter_next ((GtkTreeModel*) _tmp5_, &iter); + if (!_tmp6_) { break; } } - _tmp2_ = FALSE; - gtk_tree_model_get ((GtkTreeModel*) self->priv->page_side_model, &iter, 0, &s, -1, -1); - if (s == ((gint) page_side)) { - gtk_combo_box_set_active_iter (self->priv->page_side_combo, &iter); + _tmp3_ = FALSE; + _tmp7_ = self->priv->page_side_model; + _tmp8_ = iter; + gtk_tree_model_get ((GtkTreeModel*) _tmp7_, &_tmp8_, 0, &s, -1, -1); + _tmp9_ = s; + _tmp10_ = page_side; + if (_tmp9_ == ((gint) _tmp10_)) { + GtkComboBox* _tmp11_; + GtkTreeIter _tmp12_; + _tmp11_ = self->priv->page_side_combo; + _tmp12_ = iter; + gtk_combo_box_set_active_iter (_tmp11_, &_tmp12_); return; } } @@ -1397,48 +1919,80 @@ static void simple_scan_set_page_side (SimpleScan* self, ScanType page_side) { static void simple_scan_set_paper_size (SimpleScan* self, gint width, gint height) { GtkTreeIter iter = {0}; gboolean have_iter = FALSE; + gboolean _tmp16_; + gboolean _tmp20_; g_return_if_fail (self != NULL); { - GtkTreeIter _tmp0_ = {0}; - gboolean _tmp1_; - gboolean _tmp2_; - _tmp1_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) self->priv->paper_size_model, &_tmp0_); - iter = _tmp0_; - have_iter = _tmp1_; - _tmp2_ = TRUE; + GtkListStore* _tmp0_; + GtkTreeIter _tmp1_ = {0}; + gboolean _tmp2_ = FALSE; + gboolean _tmp3_; + _tmp0_ = self->priv->paper_size_model; + _tmp2_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) _tmp0_, &_tmp1_); + iter = _tmp1_; + have_iter = _tmp2_; + _tmp3_ = TRUE; while (TRUE) { + gboolean _tmp4_; + gboolean _tmp7_; gint w = 0; gint h = 0; - gboolean _tmp4_ = FALSE; - if (!_tmp2_) { - gboolean _tmp3_; - _tmp3_ = gtk_tree_model_iter_next ((GtkTreeModel*) self->priv->paper_size_model, &iter); - have_iter = _tmp3_; + GtkListStore* _tmp8_; + GtkTreeIter _tmp9_; + gboolean _tmp10_ = FALSE; + gint _tmp11_; + gint _tmp12_; + gboolean _tmp15_; + _tmp4_ = _tmp3_; + if (!_tmp4_) { + GtkListStore* _tmp5_; + gboolean _tmp6_ = FALSE; + _tmp5_ = self->priv->paper_size_model; + _tmp6_ = gtk_tree_model_iter_next ((GtkTreeModel*) _tmp5_, &iter); + have_iter = _tmp6_; } - _tmp2_ = FALSE; - if (!have_iter) { + _tmp3_ = FALSE; + _tmp7_ = have_iter; + if (!_tmp7_) { break; } - gtk_tree_model_get ((GtkTreeModel*) self->priv->paper_size_model, &iter, 0, &w, 1, &h, -1, -1); - if (w == width) { - _tmp4_ = h == height; + _tmp8_ = self->priv->paper_size_model; + _tmp9_ = iter; + gtk_tree_model_get ((GtkTreeModel*) _tmp8_, &_tmp9_, 0, &w, 1, &h, -1, -1); + _tmp11_ = w; + _tmp12_ = width; + if (_tmp11_ == _tmp12_) { + gint _tmp13_; + gint _tmp14_; + _tmp13_ = h; + _tmp14_ = height; + _tmp10_ = _tmp13_ == _tmp14_; } else { - _tmp4_ = FALSE; + _tmp10_ = FALSE; } - if (_tmp4_) { + _tmp15_ = _tmp10_; + if (_tmp15_) { break; } } } - if (!have_iter) { - GtkTreeIter _tmp5_ = {0}; - gboolean _tmp6_; - _tmp6_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) self->priv->paper_size_model, &_tmp5_); - iter = _tmp5_; - have_iter = _tmp6_; + _tmp16_ = have_iter; + if (!_tmp16_) { + GtkListStore* _tmp17_; + GtkTreeIter _tmp18_ = {0}; + gboolean _tmp19_ = FALSE; + _tmp17_ = self->priv->paper_size_model; + _tmp19_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) _tmp17_, &_tmp18_); + iter = _tmp18_; + have_iter = _tmp19_; } - if (have_iter) { - gtk_combo_box_set_active_iter (self->priv->paper_size_combo, &iter); + _tmp20_ = have_iter; + if (_tmp20_) { + GtkComboBox* _tmp21_; + GtkTreeIter _tmp22_; + _tmp21_ = self->priv->paper_size_combo; + _tmp22_ = iter; + gtk_combo_box_set_active_iter (_tmp21_, &_tmp22_); } } @@ -1447,14 +2001,20 @@ static gint simple_scan_get_text_dpi (SimpleScan* self) { gint result = 0; GtkTreeIter iter = {0}; gint dpi; - GtkTreeIter _tmp0_ = {0}; - gboolean _tmp1_; + GtkComboBox* _tmp0_; + GtkTreeIter _tmp1_ = {0}; + gboolean _tmp2_ = FALSE; g_return_val_if_fail (self != NULL, 0); dpi = SIMPLE_SCAN_DEFAULT_TEXT_DPI; - _tmp1_ = gtk_combo_box_get_active_iter (self->priv->text_dpi_combo, &_tmp0_); - iter = _tmp0_; - if (_tmp1_) { - gtk_tree_model_get ((GtkTreeModel*) self->priv->text_dpi_model, &iter, 0, &dpi, -1, -1); + _tmp0_ = self->priv->text_dpi_combo; + _tmp2_ = gtk_combo_box_get_active_iter (_tmp0_, &_tmp1_); + iter = _tmp1_; + if (_tmp2_) { + GtkListStore* _tmp3_; + GtkTreeIter _tmp4_; + _tmp3_ = self->priv->text_dpi_model; + _tmp4_ = iter; + gtk_tree_model_get ((GtkTreeModel*) _tmp3_, &_tmp4_, 0, &dpi, -1, -1); } result = dpi; return result; @@ -1465,14 +2025,20 @@ static gint simple_scan_get_photo_dpi (SimpleScan* self) { gint result = 0; GtkTreeIter iter = {0}; gint dpi; - GtkTreeIter _tmp0_ = {0}; - gboolean _tmp1_; + GtkComboBox* _tmp0_; + GtkTreeIter _tmp1_ = {0}; + gboolean _tmp2_ = FALSE; g_return_val_if_fail (self != NULL, 0); dpi = SIMPLE_SCAN_DEFAULT_PHOTO_DPI; - _tmp1_ = gtk_combo_box_get_active_iter (self->priv->photo_dpi_combo, &_tmp0_); - iter = _tmp0_; - if (_tmp1_) { - gtk_tree_model_get ((GtkTreeModel*) self->priv->photo_dpi_model, &iter, 0, &dpi, -1, -1); + _tmp0_ = self->priv->photo_dpi_combo; + _tmp2_ = gtk_combo_box_get_active_iter (_tmp0_, &_tmp1_); + iter = _tmp1_; + if (_tmp2_) { + GtkListStore* _tmp3_; + GtkTreeIter _tmp4_; + _tmp3_ = self->priv->photo_dpi_model; + _tmp4_ = iter; + gtk_tree_model_get ((GtkTreeModel*) _tmp3_, &_tmp4_, 0, &dpi, -1, -1); } result = dpi; return result; @@ -1483,47 +2049,61 @@ static ScanType simple_scan_get_page_side (SimpleScan* self) { ScanType result = 0; GtkTreeIter iter = {0}; gint page_side; - GtkTreeIter _tmp0_ = {0}; - gboolean _tmp1_; + GtkComboBox* _tmp0_; + GtkTreeIter _tmp1_ = {0}; + gboolean _tmp2_ = FALSE; + gint _tmp5_; g_return_val_if_fail (self != NULL, 0); page_side = (gint) SCAN_TYPE_ADF_BOTH; - _tmp1_ = gtk_combo_box_get_active_iter (self->priv->page_side_combo, &_tmp0_); - iter = _tmp0_; - if (_tmp1_) { - gtk_tree_model_get ((GtkTreeModel*) self->priv->page_side_model, &iter, 0, &page_side, -1, -1); + _tmp0_ = self->priv->page_side_combo; + _tmp2_ = gtk_combo_box_get_active_iter (_tmp0_, &_tmp1_); + iter = _tmp1_; + if (_tmp2_) { + GtkListStore* _tmp3_; + GtkTreeIter _tmp4_; + _tmp3_ = self->priv->page_side_model; + _tmp4_ = iter; + gtk_tree_model_get ((GtkTreeModel*) _tmp3_, &_tmp4_, 0, &page_side, -1, -1); } - result = (ScanType) page_side; + _tmp5_ = page_side; + result = (ScanType) _tmp5_; return result; } static gboolean simple_scan_get_paper_size (SimpleScan* self, gint* width, gint* height) { - gint _width = 0; - gint _height = 0; + gint _vala_width = 0; + gint _vala_height = 0; gboolean result = FALSE; GtkTreeIter iter = {0}; - GtkTreeIter _tmp0_ = {0}; - gboolean _tmp1_; + GtkComboBox* _tmp0_; + GtkTreeIter _tmp1_ = {0}; + gboolean _tmp2_ = FALSE; g_return_val_if_fail (self != NULL, FALSE); - _tmp1_ = gtk_combo_box_get_active_iter (self->priv->paper_size_combo, &_tmp0_); - iter = _tmp0_; - if (_tmp1_) { - gtk_tree_model_get ((GtkTreeModel*) self->priv->paper_size_model, &iter, 0, &_width, 1, &_height, -1, -1); + _tmp0_ = self->priv->paper_size_combo; + _tmp2_ = gtk_combo_box_get_active_iter (_tmp0_, &_tmp1_); + iter = _tmp1_; + if (_tmp2_) { + GtkListStore* _tmp3_; + GtkTreeIter _tmp4_; + _tmp3_ = self->priv->paper_size_model; + _tmp4_ = iter; + gtk_tree_model_get ((GtkTreeModel*) _tmp3_, &_tmp4_, 0, &_vala_width, 1, &_vala_height, -1, -1); result = TRUE; if (width) { - *width = _width; + *width = _vala_width; } if (height) { - *height = _height; + *height = _vala_height; } return result; } result = FALSE; if (width) { - *width = _width; + *width = _vala_width; } if (height) { - *height = _height; + *height = _vala_height; } return result; } @@ -1531,29 +2111,47 @@ static gboolean simple_scan_get_paper_size (SimpleScan* self, gint* width, gint* static ScanOptions* simple_scan_get_scan_options (SimpleScan* self) { ScanOptions* result = NULL; - ScanOptions* _tmp0_ = NULL; + ScanOptions* _tmp0_; ScanOptions* options; - gint _tmp3_; - gint _tmp4_; + const gchar* _tmp1_; + ScanOptions* _tmp10_; + ScanOptions* _tmp11_; + gint _tmp12_ = 0; + gint _tmp13_ = 0; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = scan_options_new (); options = _tmp0_; - if (g_strcmp0 (self->priv->document_hint, "text") == 0) { - gint _tmp1_; - options->scan_mode = SCAN_MODE_GRAY; - _tmp1_ = simple_scan_get_text_dpi (self); - options->dpi = _tmp1_; - options->depth = 2; + _tmp1_ = self->priv->document_hint; + if (g_strcmp0 (_tmp1_, "text") == 0) { + ScanOptions* _tmp2_; + ScanOptions* _tmp3_; + gint _tmp4_ = 0; + ScanOptions* _tmp5_; + _tmp2_ = options; + _tmp2_->scan_mode = SCAN_MODE_GRAY; + _tmp3_ = options; + _tmp4_ = simple_scan_get_text_dpi (self); + _tmp3_->dpi = _tmp4_; + _tmp5_ = options; + _tmp5_->depth = 2; } else { - gint _tmp2_; - options->scan_mode = SCAN_MODE_COLOR; - _tmp2_ = simple_scan_get_photo_dpi (self); - options->dpi = _tmp2_; - options->depth = 8; - } - simple_scan_get_paper_size (self, &_tmp3_, &_tmp4_); - options->paper_width = _tmp3_; - options->paper_height = _tmp4_; + ScanOptions* _tmp6_; + ScanOptions* _tmp7_; + gint _tmp8_ = 0; + ScanOptions* _tmp9_; + _tmp6_ = options; + _tmp6_->scan_mode = SCAN_MODE_COLOR; + _tmp7_ = options; + _tmp8_ = simple_scan_get_photo_dpi (self); + _tmp7_->dpi = _tmp8_; + _tmp9_ = options; + _tmp9_->depth = 8; + } + _tmp10_ = options; + _tmp11_ = options; + simple_scan_get_paper_size (self, &_tmp12_, &_tmp13_); + _tmp10_->paper_width = _tmp12_; + _tmp11_->paper_height = _tmp13_; result = options; return result; } @@ -1585,33 +2183,41 @@ void G_MODULE_EXPORT stop_scan_button_clicked_cb (GtkWidget* widget, SimpleScan* void G_MODULE_EXPORT continuous_scan_button_clicked_cb (GtkWidget* widget, SimpleScan* self) { + gboolean _tmp0_; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - if (self->priv->scanning) { + _tmp0_ = self->priv->scanning; + if (_tmp0_) { g_signal_emit_by_name (self, "stop-scan"); } else { - ScanOptions* _tmp0_ = NULL; + ScanOptions* _tmp1_ = NULL; ScanOptions* options; - ScanType _tmp1_; - gchar* _tmp2_ = NULL; - gchar* _tmp3_; - _tmp0_ = simple_scan_get_scan_options (self); - options = _tmp0_; - _tmp1_ = simple_scan_get_page_side (self); - options->type = _tmp1_; - _tmp2_ = simple_scan_get_selected_device (self); - _tmp3_ = _tmp2_; - g_signal_emit_by_name (self, "start-scan", _tmp3_, options); - _g_free0 (_tmp3_); + ScanOptions* _tmp2_; + ScanType _tmp3_ = 0; + gchar* _tmp4_ = NULL; + gchar* _tmp5_; + ScanOptions* _tmp6_; + _tmp1_ = simple_scan_get_scan_options (self); + options = _tmp1_; + _tmp2_ = options; + _tmp3_ = simple_scan_get_page_side (self); + _tmp2_->type = _tmp3_; + _tmp4_ = simple_scan_get_selected_device (self); + _tmp5_ = _tmp4_; + _tmp6_ = options; + g_signal_emit_by_name (self, "start-scan", _tmp5_, _tmp6_); + _g_free0 (_tmp5_); _scan_options_unref0 (options); } } void G_MODULE_EXPORT preferences_button_clicked_cb (GtkWidget* widget, SimpleScan* self) { + GtkDialog* _tmp0_; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - gtk_window_present ((GtkWindow*) self->priv->preferences_dialog); + _tmp0_ = self->priv->preferences_dialog; + gtk_window_present ((GtkWindow*) _tmp0_); } @@ -1625,95 +2231,145 @@ gboolean G_MODULE_EXPORT preferences_dialog_delete_event_cb (GtkWidget* widget, void G_MODULE_EXPORT preferences_dialog_response_cb (GtkWidget* widget, gint response_id, SimpleScan* self) { + GtkDialog* _tmp0_; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - gtk_widget_hide ((GtkWidget*) self->priv->preferences_dialog); + _tmp0_ = self->priv->preferences_dialog; + gtk_widget_hide ((GtkWidget*) _tmp0_); } static void simple_scan_update_page_menu (SimpleScan* self) { - Page* _tmp0_ = NULL; + BookView* _tmp0_; + Page* _tmp1_ = NULL; Page* page; + Page* _tmp2_; g_return_if_fail (self != NULL); - _tmp0_ = book_view_get_selected (self->priv->book_view); - page = _tmp0_; - if (page == NULL) { - gtk_widget_set_sensitive ((GtkWidget*) self->priv->page_move_left_menuitem, FALSE); - gtk_widget_set_sensitive ((GtkWidget*) self->priv->page_move_right_menuitem, FALSE); + _tmp0_ = self->priv->book_view; + _tmp1_ = book_view_get_selected (_tmp0_); + page = _tmp1_; + _tmp2_ = page; + if (_tmp2_ == NULL) { + GtkMenuItem* _tmp3_; + GtkMenuItem* _tmp4_; + _tmp3_ = self->priv->page_move_left_menuitem; + gtk_widget_set_sensitive ((GtkWidget*) _tmp3_, FALSE); + _tmp4_ = self->priv->page_move_right_menuitem; + gtk_widget_set_sensitive ((GtkWidget*) _tmp4_, FALSE); } else { - guint _tmp1_; + Book* _tmp5_; + Page* _tmp6_; + guint _tmp7_ = 0U; guint index; - guint _tmp2_; - _tmp1_ = book_get_page_index (self->priv->book, page); - index = _tmp1_; - gtk_widget_set_sensitive ((GtkWidget*) self->priv->page_move_left_menuitem, index > ((guint) 0)); - _tmp2_ = book_get_n_pages (self->priv->book); - gtk_widget_set_sensitive ((GtkWidget*) self->priv->page_move_right_menuitem, index < (_tmp2_ - 1)); + GtkMenuItem* _tmp8_; + guint _tmp9_; + GtkMenuItem* _tmp10_; + guint _tmp11_; + Book* _tmp12_; + guint _tmp13_ = 0U; + _tmp5_ = self->priv->book; + _tmp6_ = page; + _tmp7_ = book_get_page_index (_tmp5_, _tmp6_); + index = _tmp7_; + _tmp8_ = self->priv->page_move_left_menuitem; + _tmp9_ = index; + gtk_widget_set_sensitive ((GtkWidget*) _tmp8_, _tmp9_ > ((guint) 0)); + _tmp10_ = self->priv->page_move_right_menuitem; + _tmp11_ = index; + _tmp12_ = self->priv->book; + _tmp13_ = book_get_n_pages (_tmp12_); + gtk_widget_set_sensitive ((GtkWidget*) _tmp10_, _tmp11_ < (_tmp13_ - 1)); } _page_unref0 (page); } static void simple_scan_page_selected_cb (SimpleScan* self, BookView* view, Page* page) { + Page* _tmp0_; gchar* name; - gboolean _tmp0_; - GObject* _tmp10_ = NULL; - GtkRadioMenuItem* _tmp11_; + Page* _tmp1_; + gboolean _tmp2_ = FALSE; + GtkBuilder* _tmp20_; + const gchar* _tmp21_; + GObject* _tmp22_ = NULL; + GtkRadioMenuItem* _tmp23_; GtkRadioMenuItem* menuitem; - GObject* _tmp12_ = NULL; - GtkToggleToolButton* _tmp13_; + GtkRadioMenuItem* _tmp24_; + GtkBuilder* _tmp25_; + GObject* _tmp26_ = NULL; + GtkToggleToolButton* _tmp27_; GtkToggleToolButton* toolbutton; - gboolean _tmp14_; + GtkToggleToolButton* _tmp28_; + Page* _tmp29_; + gboolean _tmp30_ = FALSE; g_return_if_fail (self != NULL); g_return_if_fail (view != NULL); - if (page == NULL) { + _tmp0_ = page; + if (_tmp0_ == NULL) { return; } self->priv->updating_page_menu = TRUE; simple_scan_update_page_menu (self); name = NULL; - _tmp0_ = page_has_crop (page); - if (_tmp0_) { - gchar* _tmp1_ = NULL; + _tmp1_ = page; + _tmp2_ = page_has_crop (_tmp1_); + if (_tmp2_) { + Page* _tmp3_; + gchar* _tmp4_ = NULL; gchar* crop_name; - _tmp1_ = page_get_named_crop (page); - crop_name = _tmp1_; - if (crop_name != NULL) { - if (g_strcmp0 (crop_name, "A4") == 0) { - gchar* _tmp2_; - _tmp2_ = g_strdup ("a4_menuitem"); + const gchar* _tmp5_; + _tmp3_ = page; + _tmp4_ = page_get_named_crop (_tmp3_); + crop_name = _tmp4_; + _tmp5_ = crop_name; + if (_tmp5_ != NULL) { + const gchar* _tmp6_; + _tmp6_ = crop_name; + if (g_strcmp0 (_tmp6_, "A4") == 0) { + gchar* _tmp7_; + _tmp7_ = g_strdup ("a4_menuitem"); _g_free0 (name); - name = _tmp2_; + name = _tmp7_; } else { - if (g_strcmp0 (crop_name, "A5") == 0) { - gchar* _tmp3_; - _tmp3_ = g_strdup ("a5_menuitem"); + const gchar* _tmp8_; + _tmp8_ = crop_name; + if (g_strcmp0 (_tmp8_, "A5") == 0) { + gchar* _tmp9_; + _tmp9_ = g_strdup ("a5_menuitem"); _g_free0 (name); - name = _tmp3_; + name = _tmp9_; } else { - if (g_strcmp0 (crop_name, "A6") == 0) { - gchar* _tmp4_; - _tmp4_ = g_strdup ("a6_menuitem"); + const gchar* _tmp10_; + _tmp10_ = crop_name; + if (g_strcmp0 (_tmp10_, "A6") == 0) { + gchar* _tmp11_; + _tmp11_ = g_strdup ("a6_menuitem"); _g_free0 (name); - name = _tmp4_; + name = _tmp11_; } else { - if (g_strcmp0 (crop_name, "letter") == 0) { - gchar* _tmp5_; - _tmp5_ = g_strdup ("letter_menuitem"); + const gchar* _tmp12_; + _tmp12_ = crop_name; + if (g_strcmp0 (_tmp12_, "letter") == 0) { + gchar* _tmp13_; + _tmp13_ = g_strdup ("letter_menuitem"); _g_free0 (name); - name = _tmp5_; + name = _tmp13_; } else { - if (g_strcmp0 (crop_name, "legal") == 0) { - gchar* _tmp6_; - _tmp6_ = g_strdup ("legal_menuitem"); + const gchar* _tmp14_; + _tmp14_ = crop_name; + if (g_strcmp0 (_tmp14_, "legal") == 0) { + gchar* _tmp15_; + _tmp15_ = g_strdup ("legal_menuitem"); _g_free0 (name); - name = _tmp6_; + name = _tmp15_; } else { - if (g_strcmp0 (crop_name, "4x6") == 0) { - gchar* _tmp7_; - _tmp7_ = g_strdup ("4x6_menuitem"); + const gchar* _tmp16_; + _tmp16_ = crop_name; + if (g_strcmp0 (_tmp16_, "4x6") == 0) { + gchar* _tmp17_; + _tmp17_ = g_strdup ("4x6_menuitem"); _g_free0 (name); - name = _tmp7_; + name = _tmp17_; } } } @@ -1721,27 +2377,33 @@ static void simple_scan_page_selected_cb (SimpleScan* self, BookView* view, Page } } } else { - gchar* _tmp8_; - _tmp8_ = g_strdup ("custom_crop_menuitem"); + gchar* _tmp18_; + _tmp18_ = g_strdup ("custom_crop_menuitem"); _g_free0 (name); - name = _tmp8_; + name = _tmp18_; } _g_free0 (crop_name); } else { - gchar* _tmp9_; - _tmp9_ = g_strdup ("no_crop_menuitem"); + gchar* _tmp19_; + _tmp19_ = g_strdup ("no_crop_menuitem"); _g_free0 (name); - name = _tmp9_; - } - _tmp10_ = gtk_builder_get_object (self->priv->builder, name); - _tmp11_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp10_)); - menuitem = _tmp11_; - gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menuitem, TRUE); - _tmp12_ = gtk_builder_get_object (self->priv->builder, "crop_toolbutton"); - _tmp13_ = _g_object_ref0 (GTK_TOGGLE_TOOL_BUTTON (_tmp12_)); - toolbutton = _tmp13_; - _tmp14_ = page_has_crop (page); - gtk_toggle_tool_button_set_active (toolbutton, _tmp14_); + name = _tmp19_; + } + _tmp20_ = self->priv->builder; + _tmp21_ = name; + _tmp22_ = gtk_builder_get_object (_tmp20_, _tmp21_); + _tmp23_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp22_)); + menuitem = _tmp23_; + _tmp24_ = menuitem; + gtk_check_menu_item_set_active ((GtkCheckMenuItem*) _tmp24_, TRUE); + _tmp25_ = self->priv->builder; + _tmp26_ = gtk_builder_get_object (_tmp25_, "crop_toolbutton"); + _tmp27_ = _g_object_ref0 (GTK_TOGGLE_TOOL_BUTTON (_tmp26_)); + toolbutton = _tmp27_; + _tmp28_ = toolbutton; + _tmp29_ = page; + _tmp30_ = page_has_crop (_tmp29_); + gtk_toggle_tool_button_set_active (_tmp28_, _tmp30_); self->priv->updating_page_menu = FALSE; _g_object_unref0 (toolbutton); _g_object_unref0 (menuitem); @@ -1751,35 +2413,47 @@ static void simple_scan_page_selected_cb (SimpleScan* self, BookView* view, Page static gchar* simple_scan_get_temporary_filename (SimpleScan* self, const gchar* prefix, const gchar* extension) { gchar* result = NULL; - gchar* _tmp0_ = NULL; + const gchar* _tmp0_; + const gchar* _tmp1_; + gchar* _tmp2_ = NULL; gchar* filename; gchar* path = NULL; GError * _inner_error_ = NULL; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (prefix != NULL, NULL); g_return_val_if_fail (extension != NULL, NULL); - _tmp0_ = g_strdup_printf ("%sXXXXXX.%s", prefix, extension); - filename = _tmp0_; + _tmp0_ = prefix; + _tmp1_ = extension; + _tmp2_ = g_strdup_printf ("%sXXXXXX.%s", _tmp0_, _tmp1_); + filename = _tmp2_; { - gchar* _tmp1_ = NULL; - gint _tmp2_; + const gchar* _tmp3_; + gchar* _tmp4_ = NULL; + gint _tmp5_ = 0; gint fd; - _tmp2_ = g_file_open_tmp (filename, &_tmp1_, &_inner_error_); + gint _tmp6_; + _tmp3_ = filename; + _tmp5_ = g_file_open_tmp (_tmp3_, &_tmp4_, &_inner_error_); _g_free0 (path); - path = _tmp1_; - fd = _tmp2_; + path = _tmp4_; + fd = _tmp5_; if (_inner_error_ != NULL) { goto __catch12_g_error; } - close (fd); + _tmp6_ = fd; + close (_tmp6_); } goto __finally12; __catch12_g_error: { GError* e = NULL; + GError* _tmp7_; + const gchar* _tmp8_; e = _inner_error_; _inner_error_ = NULL; - g_warning ("ui.vala:788: Error saving email attachment: %s", e->message); + _tmp7_ = e; + _tmp8_ = _tmp7_->message; + g_warning ("ui.vala:788: Error saving email attachment: %s", _tmp8_); result = NULL; _g_error_free0 (e); _g_free0 (path); @@ -1803,7 +2477,9 @@ static gchar* simple_scan_get_temporary_filename (SimpleScan* self, const gchar* static void simple_scan_show_page_cb (SimpleScan* self, BookView* view, Page* page) { gchar* _tmp0_ = NULL; gchar* path; - GFile* _tmp1_ = NULL; + const gchar* _tmp1_; + const gchar* _tmp2_; + GFile* _tmp3_ = NULL; GFile* file; GError * _inner_error_ = NULL; g_return_if_fail (self != NULL); @@ -1811,14 +2487,20 @@ static void simple_scan_show_page_cb (SimpleScan* self, BookView* view, Page* pa g_return_if_fail (page != NULL); _tmp0_ = simple_scan_get_temporary_filename (self, "scanned-page", "tiff"); path = _tmp0_; - if (path == NULL) { + _tmp1_ = path; + if (_tmp1_ == NULL) { _g_free0 (path); return; } - _tmp1_ = g_file_new_for_path (path); - file = _tmp1_; + _tmp2_ = path; + _tmp3_ = g_file_new_for_path (_tmp2_); + file = _tmp3_; { - page_save (page, "tiff", file, &_inner_error_); + Page* _tmp4_; + GFile* _tmp5_; + _tmp4_ = page; + _tmp5_ = file; + page_save (_tmp4_, "tiff", _tmp5_, &_inner_error_); if (_inner_error_ != NULL) { goto __catch13_g_error; } @@ -1827,11 +2509,15 @@ static void simple_scan_show_page_cb (SimpleScan* self, BookView* view, Page* pa __catch13_g_error: { GError* e = NULL; - const gchar* _tmp2_ = NULL; + const gchar* _tmp6_ = NULL; + GError* _tmp7_; + const gchar* _tmp8_; e = _inner_error_; _inner_error_ = NULL; - _tmp2_ = _ ("Unable to save image for preview"); - simple_scan_show_error_dialog (self, _tmp2_, e->message); + _tmp6_ = _ ("Unable to save image for preview"); + _tmp7_ = e; + _tmp8_ = _tmp7_->message; + simple_scan_show_error_dialog (self, _tmp6_, _tmp8_); _g_error_free0 (e); _g_object_unref0 (file); _g_free0 (path); @@ -1846,16 +2532,20 @@ static void simple_scan_show_page_cb (SimpleScan* self, BookView* view, Page* pa return; } { - GdkScreen* _tmp3_ = NULL; - gchar* _tmp4_ = NULL; - gchar* _tmp5_; - guint32 _tmp6_; - _tmp3_ = gtk_window_get_screen (self->priv->window); - _tmp4_ = g_file_get_uri (file); - _tmp5_ = _tmp4_; - _tmp6_ = gtk_get_current_event_time (); - gtk_show_uri (_tmp3_, _tmp5_, _tmp6_, &_inner_error_); - _g_free0 (_tmp5_); + GtkWindow* _tmp9_; + GdkScreen* _tmp10_ = NULL; + GFile* _tmp11_; + gchar* _tmp12_ = NULL; + gchar* _tmp13_; + guint32 _tmp14_ = 0U; + _tmp9_ = self->priv->window; + _tmp10_ = gtk_window_get_screen (_tmp9_); + _tmp11_ = file; + _tmp12_ = g_file_get_uri (_tmp11_); + _tmp13_ = _tmp12_; + _tmp14_ = gtk_get_current_event_time (); + gtk_show_uri (_tmp10_, _tmp13_, _tmp14_, &_inner_error_); + _g_free0 (_tmp13_); if (_inner_error_ != NULL) { goto __catch14_g_error; } @@ -1864,11 +2554,15 @@ static void simple_scan_show_page_cb (SimpleScan* self, BookView* view, Page* pa __catch14_g_error: { GError* e = NULL; - const gchar* _tmp7_ = NULL; + const gchar* _tmp15_ = NULL; + GError* _tmp16_; + const gchar* _tmp17_; e = _inner_error_; _inner_error_ = NULL; - _tmp7_ = _ ("Unable to open image preview application"); - simple_scan_show_error_dialog (self, _tmp7_, e->message); + _tmp15_ = _ ("Unable to open image preview application"); + _tmp16_ = e; + _tmp17_ = _tmp16_->message; + simple_scan_show_error_dialog (self, _tmp15_, _tmp17_); _g_error_free0 (e); } __finally14: @@ -1885,91 +2579,153 @@ static void simple_scan_show_page_cb (SimpleScan* self, BookView* view, Page* pa static void simple_scan_show_page_menu_cb (SimpleScan* self, BookView* view) { - GObject* _tmp0_ = NULL; - GtkMenu* _tmp1_; + GtkBuilder* _tmp0_; + GObject* _tmp1_ = NULL; + GtkMenu* _tmp2_; GtkMenu* menu; - guint32 _tmp2_; + guint32 _tmp3_ = 0U; g_return_if_fail (self != NULL); g_return_if_fail (view != NULL); - _tmp0_ = gtk_builder_get_object (self->priv->builder, "page_menu"); - _tmp1_ = _g_object_ref0 (GTK_MENU (_tmp0_)); - menu = _tmp1_; - _tmp2_ = gtk_get_current_event_time (); - gtk_menu_popup (menu, NULL, NULL, NULL, NULL, (guint) 3, _tmp2_); + _tmp0_ = self->priv->builder; + _tmp1_ = gtk_builder_get_object (_tmp0_, "page_menu"); + _tmp2_ = _g_object_ref0 (GTK_MENU (_tmp1_)); + menu = _tmp2_; + _tmp3_ = gtk_get_current_event_time (); + gtk_menu_popup (menu, NULL, NULL, NULL, NULL, (guint) 3, _tmp3_); _g_object_unref0 (menu); } void G_MODULE_EXPORT rotate_left_button_clicked_cb (GtkWidget* widget, SimpleScan* self) { - Page* _tmp0_ = NULL; + gboolean _tmp0_; + BookView* _tmp1_; + Page* _tmp2_ = NULL; Page* page; + Page* _tmp3_; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - if (self->priv->updating_page_menu) { + _tmp0_ = self->priv->updating_page_menu; + if (_tmp0_) { return; } - _tmp0_ = book_view_get_selected (self->priv->book_view); - page = _tmp0_; - if (page != NULL) { - page_rotate_left (page); + _tmp1_ = self->priv->book_view; + _tmp2_ = book_view_get_selected (_tmp1_); + page = _tmp2_; + _tmp3_ = page; + if (_tmp3_ != NULL) { + Page* _tmp4_; + _tmp4_ = page; + page_rotate_left (_tmp4_); } _page_unref0 (page); } void G_MODULE_EXPORT rotate_right_button_clicked_cb (GtkWidget* widget, SimpleScan* self) { - Page* _tmp0_ = NULL; + gboolean _tmp0_; + BookView* _tmp1_; + Page* _tmp2_ = NULL; Page* page; + Page* _tmp3_; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - if (self->priv->updating_page_menu) { + _tmp0_ = self->priv->updating_page_menu; + if (_tmp0_) { return; } - _tmp0_ = book_view_get_selected (self->priv->book_view); - page = _tmp0_; - if (page != NULL) { - page_rotate_right (page); + _tmp1_ = self->priv->book_view; + _tmp2_ = book_view_get_selected (_tmp1_); + page = _tmp2_; + _tmp3_ = page; + if (_tmp3_ != NULL) { + Page* _tmp4_; + _tmp4_ = page; + page_rotate_right (_tmp4_); } _page_unref0 (page); } static void simple_scan_set_crop (SimpleScan* self, const gchar* crop_name) { - Page* _tmp0_ = NULL; + GtkMenuItem* _tmp0_; + const gchar* _tmp1_; + gboolean _tmp2_; + BookView* _tmp3_; + Page* _tmp4_ = NULL; Page* page; + Page* _tmp5_; + const gchar* _tmp6_; g_return_if_fail (self != NULL); - gtk_widget_set_sensitive ((GtkWidget*) self->priv->crop_rotate_menuitem, crop_name != NULL); - if (self->priv->updating_page_menu) { + _tmp0_ = self->priv->crop_rotate_menuitem; + _tmp1_ = crop_name; + gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, _tmp1_ != NULL); + _tmp2_ = self->priv->updating_page_menu; + if (_tmp2_) { return; } - _tmp0_ = book_view_get_selected (self->priv->book_view); - page = _tmp0_; - if (page == NULL) { + _tmp3_ = self->priv->book_view; + _tmp4_ = book_view_get_selected (_tmp3_); + page = _tmp4_; + _tmp5_ = page; + if (_tmp5_ == NULL) { _page_unref0 (page); return; } - if (crop_name == NULL) { - page_set_no_crop (page); + _tmp6_ = crop_name; + if (_tmp6_ == NULL) { + Page* _tmp7_; + _tmp7_ = page; + page_set_no_crop (_tmp7_); _page_unref0 (page); return; } else { - if (g_strcmp0 (crop_name, "custom") == 0) { - gint _tmp1_; + const gchar* _tmp8_; + _tmp8_ = crop_name; + if (g_strcmp0 (_tmp8_, "custom") == 0) { + Page* _tmp9_; + gint _tmp10_ = 0; gint width; - gint _tmp2_; + Page* _tmp11_; + gint _tmp12_ = 0; gint height; + gint _tmp13_; gint crop_width; + gint _tmp14_; gint crop_height; - _tmp1_ = page_get_width (page); - width = _tmp1_; - _tmp2_ = page_get_height (page); - height = _tmp2_; - crop_width = (gint) ((width * 0.8) + 0.5); - crop_height = (gint) ((height * 0.8) + 0.5); - page_set_custom_crop (page, crop_width, crop_height); - page_move_crop (page, (width - crop_width) / 2, (height - crop_height) / 2); + Page* _tmp15_; + gint _tmp16_; + gint _tmp17_; + Page* _tmp18_; + gint _tmp19_; + gint _tmp20_; + gint _tmp21_; + gint _tmp22_; + _tmp9_ = page; + _tmp10_ = page_get_width (_tmp9_); + width = _tmp10_; + _tmp11_ = page; + _tmp12_ = page_get_height (_tmp11_); + height = _tmp12_; + _tmp13_ = width; + crop_width = (gint) ((_tmp13_ * 0.8) + 0.5); + _tmp14_ = height; + crop_height = (gint) ((_tmp14_ * 0.8) + 0.5); + _tmp15_ = page; + _tmp16_ = crop_width; + _tmp17_ = crop_height; + page_set_custom_crop (_tmp15_, _tmp16_, _tmp17_); + _tmp18_ = page; + _tmp19_ = width; + _tmp20_ = crop_width; + _tmp21_ = height; + _tmp22_ = crop_height; + page_move_crop (_tmp18_, (_tmp19_ - _tmp20_) / 2, (_tmp21_ - _tmp22_) / 2); } else { - page_set_named_crop (page, crop_name); + Page* _tmp23_; + const gchar* _tmp24_; + _tmp23_ = page; + _tmp24_ = crop_name; + page_set_named_crop (_tmp23_, _tmp24_); } } _page_unref0 (page); @@ -1977,151 +2733,197 @@ static void simple_scan_set_crop (SimpleScan* self, const gchar* crop_name) { void G_MODULE_EXPORT no_crop_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) { - gboolean _tmp0_; + GtkCheckMenuItem* _tmp0_; + gboolean _tmp1_ = FALSE; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - _tmp0_ = gtk_check_menu_item_get_active (widget); - if (_tmp0_) { + _tmp0_ = widget; + _tmp1_ = gtk_check_menu_item_get_active (_tmp0_); + if (_tmp1_) { simple_scan_set_crop (self, NULL); } } void G_MODULE_EXPORT custom_crop_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) { - gboolean _tmp0_; + GtkCheckMenuItem* _tmp0_; + gboolean _tmp1_ = FALSE; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - _tmp0_ = gtk_check_menu_item_get_active (widget); - if (_tmp0_) { + _tmp0_ = widget; + _tmp1_ = gtk_check_menu_item_get_active (_tmp0_); + if (_tmp1_) { simple_scan_set_crop (self, "custom"); } } void G_MODULE_EXPORT crop_toolbutton_toggled_cb (GtkToggleToolButton* widget, SimpleScan* self) { - GtkRadioMenuItem* menuitem = NULL; gboolean _tmp0_; + GtkRadioMenuItem* menuitem = NULL; + GtkToggleToolButton* _tmp1_; + gboolean _tmp2_ = FALSE; + GtkRadioMenuItem* _tmp9_; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - if (self->priv->updating_page_menu) { + _tmp0_ = self->priv->updating_page_menu; + if (_tmp0_) { return; } - _tmp0_ = gtk_toggle_tool_button_get_active (widget); - if (_tmp0_) { - GObject* _tmp1_ = NULL; - GtkRadioMenuItem* _tmp2_; - _tmp1_ = gtk_builder_get_object (self->priv->builder, "custom_crop_menuitem"); - _tmp2_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp1_)); + _tmp1_ = widget; + _tmp2_ = gtk_toggle_tool_button_get_active (_tmp1_); + if (_tmp2_) { + GtkBuilder* _tmp3_; + GObject* _tmp4_ = NULL; + GtkRadioMenuItem* _tmp5_; + _tmp3_ = self->priv->builder; + _tmp4_ = gtk_builder_get_object (_tmp3_, "custom_crop_menuitem"); + _tmp5_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp4_)); _g_object_unref0 (menuitem); - menuitem = _tmp2_; + menuitem = _tmp5_; } else { - GObject* _tmp3_ = NULL; - GtkRadioMenuItem* _tmp4_; - _tmp3_ = gtk_builder_get_object (self->priv->builder, "no_crop_menuitem"); - _tmp4_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp3_)); + GtkBuilder* _tmp6_; + GObject* _tmp7_ = NULL; + GtkRadioMenuItem* _tmp8_; + _tmp6_ = self->priv->builder; + _tmp7_ = gtk_builder_get_object (_tmp6_, "no_crop_menuitem"); + _tmp8_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp7_)); _g_object_unref0 (menuitem); - menuitem = _tmp4_; + menuitem = _tmp8_; } - gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menuitem, TRUE); + _tmp9_ = menuitem; + gtk_check_menu_item_set_active ((GtkCheckMenuItem*) _tmp9_, TRUE); _g_object_unref0 (menuitem); } void G_MODULE_EXPORT four_by_six_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) { - gboolean _tmp0_; + GtkCheckMenuItem* _tmp0_; + gboolean _tmp1_ = FALSE; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - _tmp0_ = gtk_check_menu_item_get_active (widget); - if (_tmp0_) { + _tmp0_ = widget; + _tmp1_ = gtk_check_menu_item_get_active (_tmp0_); + if (_tmp1_) { simple_scan_set_crop (self, "4x6"); } } void G_MODULE_EXPORT legal_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) { - gboolean _tmp0_; + GtkCheckMenuItem* _tmp0_; + gboolean _tmp1_ = FALSE; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - _tmp0_ = gtk_check_menu_item_get_active (widget); - if (_tmp0_) { + _tmp0_ = widget; + _tmp1_ = gtk_check_menu_item_get_active (_tmp0_); + if (_tmp1_) { simple_scan_set_crop (self, "legal"); } } void G_MODULE_EXPORT letter_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) { - gboolean _tmp0_; + GtkCheckMenuItem* _tmp0_; + gboolean _tmp1_ = FALSE; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - _tmp0_ = gtk_check_menu_item_get_active (widget); - if (_tmp0_) { + _tmp0_ = widget; + _tmp1_ = gtk_check_menu_item_get_active (_tmp0_); + if (_tmp1_) { simple_scan_set_crop (self, "letter"); } } void G_MODULE_EXPORT a6_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) { - gboolean _tmp0_; + GtkCheckMenuItem* _tmp0_; + gboolean _tmp1_ = FALSE; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - _tmp0_ = gtk_check_menu_item_get_active (widget); - if (_tmp0_) { + _tmp0_ = widget; + _tmp1_ = gtk_check_menu_item_get_active (_tmp0_); + if (_tmp1_) { simple_scan_set_crop (self, "A6"); } } void G_MODULE_EXPORT a5_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) { - gboolean _tmp0_; + GtkCheckMenuItem* _tmp0_; + gboolean _tmp1_ = FALSE; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - _tmp0_ = gtk_check_menu_item_get_active (widget); - if (_tmp0_) { + _tmp0_ = widget; + _tmp1_ = gtk_check_menu_item_get_active (_tmp0_); + if (_tmp1_) { simple_scan_set_crop (self, "A5"); } } void G_MODULE_EXPORT a4_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) { - gboolean _tmp0_; + GtkCheckMenuItem* _tmp0_; + gboolean _tmp1_ = FALSE; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - _tmp0_ = gtk_check_menu_item_get_active (widget); - if (_tmp0_) { + _tmp0_ = widget; + _tmp1_ = gtk_check_menu_item_get_active (_tmp0_); + if (_tmp1_) { simple_scan_set_crop (self, "A4"); } } void G_MODULE_EXPORT crop_rotate_menuitem_activate_cb (GtkWidget* widget, SimpleScan* self) { - Page* _tmp0_ = NULL; + BookView* _tmp0_; + Page* _tmp1_ = NULL; Page* page; + Page* _tmp2_; + Page* _tmp3_; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - _tmp0_ = book_view_get_selected (self->priv->book_view); - page = _tmp0_; - if (page == NULL) { + _tmp0_ = self->priv->book_view; + _tmp1_ = book_view_get_selected (_tmp0_); + page = _tmp1_; + _tmp2_ = page; + if (_tmp2_ == NULL) { _page_unref0 (page); return; } - page_rotate_crop (page); + _tmp3_ = page; + page_rotate_crop (_tmp3_); _page_unref0 (page); } void G_MODULE_EXPORT page_move_left_menuitem_activate_cb (GtkWidget* widget, SimpleScan* self) { - Page* _tmp0_ = NULL; + BookView* _tmp0_; + Page* _tmp1_ = NULL; Page* page; - guint _tmp1_; + Book* _tmp2_; + Page* _tmp3_; + guint _tmp4_ = 0U; guint index; + guint _tmp5_; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - _tmp0_ = book_view_get_selected (self->priv->book_view); - page = _tmp0_; - _tmp1_ = book_get_page_index (self->priv->book, page); - index = _tmp1_; - if (index > ((guint) 0)) { - book_move_page (self->priv->book, page, index - 1); + _tmp0_ = self->priv->book_view; + _tmp1_ = book_view_get_selected (_tmp0_); + page = _tmp1_; + _tmp2_ = self->priv->book; + _tmp3_ = page; + _tmp4_ = book_get_page_index (_tmp2_, _tmp3_); + index = _tmp4_; + _tmp5_ = index; + if (_tmp5_ > ((guint) 0)) { + Book* _tmp6_; + Page* _tmp7_; + guint _tmp8_; + _tmp6_ = self->priv->book; + _tmp7_ = page; + _tmp8_ = index; + book_move_page (_tmp6_, _tmp7_, _tmp8_ - 1); } simple_scan_update_page_menu (self); _page_unref0 (page); @@ -2129,22 +2931,40 @@ void G_MODULE_EXPORT page_move_left_menuitem_activate_cb (GtkWidget* widget, Sim void G_MODULE_EXPORT page_move_right_menuitem_activate_cb (GtkWidget* widget, SimpleScan* self) { - Page* _tmp0_ = NULL; + BookView* _tmp0_; + Page* _tmp1_ = NULL; Page* page; - guint _tmp1_; + Book* _tmp2_; + Page* _tmp3_; + guint _tmp4_ = 0U; guint index; - guint _tmp2_; + guint _tmp5_; + Book* _tmp6_; + guint _tmp7_ = 0U; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - _tmp0_ = book_view_get_selected (self->priv->book_view); - page = _tmp0_; - _tmp1_ = book_get_page_index (self->priv->book, page); - index = _tmp1_; - _tmp2_ = book_get_n_pages (self->priv->book); - if (index < (_tmp2_ - 1)) { - guint _tmp3_; - _tmp3_ = book_get_page_index (self->priv->book, page); - book_move_page (self->priv->book, page, _tmp3_ + 1); + _tmp0_ = self->priv->book_view; + _tmp1_ = book_view_get_selected (_tmp0_); + page = _tmp1_; + _tmp2_ = self->priv->book; + _tmp3_ = page; + _tmp4_ = book_get_page_index (_tmp2_, _tmp3_); + index = _tmp4_; + _tmp5_ = index; + _tmp6_ = self->priv->book; + _tmp7_ = book_get_n_pages (_tmp6_); + if (_tmp5_ < (_tmp7_ - 1)) { + Book* _tmp8_; + Page* _tmp9_; + Book* _tmp10_; + Page* _tmp11_; + guint _tmp12_ = 0U; + _tmp8_ = self->priv->book; + _tmp9_ = page; + _tmp10_ = self->priv->book; + _tmp11_ = page; + _tmp12_ = book_get_page_index (_tmp10_, _tmp11_); + book_move_page (_tmp8_, _tmp9_, _tmp12_ + 1); } simple_scan_update_page_menu (self); _page_unref0 (page); @@ -2152,19 +2972,23 @@ void G_MODULE_EXPORT page_move_right_menuitem_activate_cb (GtkWidget* widget, Si void G_MODULE_EXPORT page_delete_menuitem_activate_cb (GtkWidget* widget, SimpleScan* self) { - Book* _tmp0_ = NULL; - Book* _tmp1_; - Page* _tmp2_ = NULL; - Page* _tmp3_; + BookView* _tmp0_; + Book* _tmp1_ = NULL; + Book* _tmp2_; + BookView* _tmp3_; + Page* _tmp4_ = NULL; + Page* _tmp5_; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - _tmp0_ = book_view_get_book (self->priv->book_view); - _tmp1_ = _tmp0_; - _tmp2_ = book_view_get_selected (self->priv->book_view); - _tmp3_ = _tmp2_; - book_delete_page (_tmp1_, _tmp3_); - _page_unref0 (_tmp3_); - _book_unref0 (_tmp1_); + _tmp0_ = self->priv->book_view; + _tmp1_ = book_view_get_book (_tmp0_); + _tmp2_ = _tmp1_; + _tmp3_ = self->priv->book_view; + _tmp4_ = book_view_get_selected (_tmp3_); + _tmp5_ = _tmp4_; + book_delete_page (_tmp2_, _tmp5_); + _page_unref0 (_tmp5_); + _book_unref0 (_tmp2_); } @@ -2188,51 +3012,87 @@ static gpointer _cairo_reference0 (gpointer self) { static void simple_scan_draw_page (SimpleScan* self, GtkPrintOperation* operation, GtkPrintContext* print_context, gint page_number) { - cairo_t* _tmp0_ = NULL; - cairo_t* _tmp1_; + GtkPrintContext* _tmp0_; + cairo_t* _tmp1_ = NULL; + cairo_t* _tmp2_; cairo_t* context; - Page* _tmp2_ = NULL; + Book* _tmp3_; + gint _tmp4_; + Page* _tmp5_ = NULL; Page* page; gboolean is_landscape; - gdouble _tmp3_; - gdouble _tmp4_; - gboolean _tmp5_; - gdouble _tmp7_; - gint _tmp8_; - gdouble _tmp9_; - gint _tmp10_; - GdkPixbuf* _tmp11_ = NULL; + GtkPrintContext* _tmp6_; + gdouble _tmp7_ = 0.0; + GtkPrintContext* _tmp8_; + gdouble _tmp9_ = 0.0; + Page* _tmp10_; + gboolean _tmp11_ = FALSE; + gboolean _tmp12_; + cairo_t* _tmp17_; + GtkPrintContext* _tmp18_; + gdouble _tmp19_ = 0.0; + Page* _tmp20_; + gint _tmp21_ = 0; + GtkPrintContext* _tmp22_; + gdouble _tmp23_ = 0.0; + Page* _tmp24_; + gint _tmp25_ = 0; + Page* _tmp26_; + GdkPixbuf* _tmp27_ = NULL; GdkPixbuf* image; + cairo_t* _tmp28_; + cairo_t* _tmp29_; g_return_if_fail (self != NULL); g_return_if_fail (operation != NULL); g_return_if_fail (print_context != NULL); - _tmp0_ = gtk_print_context_get_cairo_context (print_context); - _tmp1_ = _cairo_reference0 (_tmp0_); - context = _tmp1_; - _tmp2_ = book_get_page (self->priv->book, page_number); - page = _tmp2_; + _tmp0_ = print_context; + _tmp1_ = gtk_print_context_get_cairo_context (_tmp0_); + _tmp2_ = _cairo_reference0 (_tmp1_); + context = _tmp2_; + _tmp3_ = self->priv->book; + _tmp4_ = page_number; + _tmp5_ = book_get_page (_tmp3_, _tmp4_); + page = _tmp5_; is_landscape = FALSE; - _tmp3_ = gtk_print_context_get_width (print_context); - _tmp4_ = gtk_print_context_get_height (print_context); - if (_tmp3_ > _tmp4_) { + _tmp6_ = print_context; + _tmp7_ = gtk_print_context_get_width (_tmp6_); + _tmp8_ = print_context; + _tmp9_ = gtk_print_context_get_height (_tmp8_); + if (_tmp7_ > _tmp9_) { is_landscape = TRUE; } - _tmp5_ = page_is_landscape (page); - if (_tmp5_ != is_landscape) { - gdouble _tmp6_; - _tmp6_ = gtk_print_context_get_width (print_context); - cairo_translate (context, _tmp6_, (gdouble) 0); - cairo_rotate (context, G_PI_2); - } - _tmp7_ = gtk_print_context_get_dpi_x (print_context); - _tmp8_ = page_get_dpi (page); - _tmp9_ = gtk_print_context_get_dpi_y (print_context); - _tmp10_ = page_get_dpi (page); - cairo_scale (context, _tmp7_ / _tmp8_, _tmp9_ / _tmp10_); - _tmp11_ = page_get_image (page, TRUE); - image = _tmp11_; - gdk_cairo_set_source_pixbuf (context, image, (gdouble) 0, (gdouble) 0); - cairo_paint (context); + _tmp10_ = page; + _tmp11_ = page_is_landscape (_tmp10_); + _tmp12_ = is_landscape; + if (_tmp11_ != _tmp12_) { + cairo_t* _tmp13_; + GtkPrintContext* _tmp14_; + gdouble _tmp15_ = 0.0; + cairo_t* _tmp16_; + _tmp13_ = context; + _tmp14_ = print_context; + _tmp15_ = gtk_print_context_get_width (_tmp14_); + cairo_translate (_tmp13_, _tmp15_, (gdouble) 0); + _tmp16_ = context; + cairo_rotate (_tmp16_, G_PI_2); + } + _tmp17_ = context; + _tmp18_ = print_context; + _tmp19_ = gtk_print_context_get_dpi_x (_tmp18_); + _tmp20_ = page; + _tmp21_ = page_get_dpi (_tmp20_); + _tmp22_ = print_context; + _tmp23_ = gtk_print_context_get_dpi_y (_tmp22_); + _tmp24_ = page; + _tmp25_ = page_get_dpi (_tmp24_); + cairo_scale (_tmp17_, _tmp19_ / _tmp21_, _tmp23_ / _tmp25_); + _tmp26_ = page; + _tmp27_ = page_get_image (_tmp26_, TRUE); + image = _tmp27_; + _tmp28_ = context; + gdk_cairo_set_source_pixbuf (_tmp28_, image, (gdouble) 0, (gdouble) 0); + _tmp29_ = context; + cairo_paint (_tmp29_); _g_object_unref0 (image); _page_unref0 (page); _cairo_destroy0 (context); @@ -2240,9 +3100,11 @@ static void simple_scan_draw_page (SimpleScan* self, GtkPrintOperation* operatio void G_MODULE_EXPORT email_button_clicked_cb (GtkWidget* widget, SimpleScan* self) { + const gchar* _tmp0_; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - g_signal_emit_by_name (self, "email", self->priv->document_hint); + _tmp0_ = self->priv->document_hint; + g_signal_emit_by_name (self, "email", _tmp0_); } @@ -2252,19 +3114,23 @@ static void _simple_scan_draw_page_gtk_print_operation_draw_page (GtkPrintOperat void G_MODULE_EXPORT print_button_clicked_cb (GtkWidget* widget, SimpleScan* self) { - GtkPrintOperation* _tmp0_ = NULL; + GtkPrintOperation* _tmp0_; GtkPrintOperation* print; - guint _tmp1_; + Book* _tmp1_; + guint _tmp2_ = 0U; GError * _inner_error_ = NULL; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); _tmp0_ = gtk_print_operation_new (); print = _tmp0_; - _tmp1_ = book_get_n_pages (self->priv->book); - gtk_print_operation_set_n_pages (print, (gint) _tmp1_); + _tmp1_ = self->priv->book; + _tmp2_ = book_get_n_pages (_tmp1_); + gtk_print_operation_set_n_pages (print, (gint) _tmp2_); g_signal_connect (print, "draw-page", (GCallback) _simple_scan_draw_page_gtk_print_operation_draw_page, self); { - gtk_print_operation_run (print, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, self->priv->window, &_inner_error_); + GtkWindow* _tmp3_; + _tmp3_ = self->priv->window; + gtk_print_operation_run (print, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, _tmp3_, &_inner_error_); if (_inner_error_ != NULL) { goto __catch15_g_error; } @@ -2273,9 +3139,13 @@ void G_MODULE_EXPORT print_button_clicked_cb (GtkWidget* widget, SimpleScan* sel __catch15_g_error: { GError* e = NULL; + GError* _tmp4_; + const gchar* _tmp5_; e = _inner_error_; _inner_error_ = NULL; - g_warning ("ui.vala:1044: Error printing: %s", e->message); + _tmp4_ = e; + _tmp5_ = _tmp4_->message; + g_warning ("ui.vala:1044: Error printing: %s", _tmp5_); _g_error_free0 (e); } __finally15: @@ -2294,11 +3164,13 @@ void G_MODULE_EXPORT help_contents_menuitem_activate_cb (GtkWidget* widget, Simp g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); { - GdkScreen* _tmp0_ = NULL; - guint32 _tmp1_; - _tmp0_ = gtk_window_get_screen (self->priv->window); - _tmp1_ = gtk_get_current_event_time (); - gtk_show_uri (_tmp0_, "ghelp:simple-scan", _tmp1_, &_inner_error_); + GtkWindow* _tmp0_; + GdkScreen* _tmp1_ = NULL; + guint32 _tmp2_ = 0U; + _tmp0_ = self->priv->window; + _tmp1_ = gtk_window_get_screen (_tmp0_); + _tmp2_ = gtk_get_current_event_time (); + gtk_show_uri (_tmp1_, "ghelp:simple-scan", _tmp2_, &_inner_error_); if (_inner_error_ != NULL) { goto __catch16_g_error; } @@ -2307,11 +3179,15 @@ void G_MODULE_EXPORT help_contents_menuitem_activate_cb (GtkWidget* widget, Simp __catch16_g_error: { GError* e = NULL; - const gchar* _tmp2_ = NULL; + const gchar* _tmp3_ = NULL; + GError* _tmp4_; + const gchar* _tmp5_; e = _inner_error_; _inner_error_ = NULL; - _tmp2_ = _ ("Unable to open help file"); - simple_scan_show_error_dialog (self, _tmp2_, e->message); + _tmp3_ = _ ("Unable to open help file"); + _tmp4_ = e; + _tmp5_ = _tmp4_->message; + simple_scan_show_error_dialog (self, _tmp3_, _tmp5_); _g_error_free0 (e); } __finally16: @@ -2338,7 +3214,8 @@ void G_MODULE_EXPORT about_menuitem_activate_cb (GtkWidget* widget, SimpleScan* const gchar* _tmp6_ = NULL; gchar* _tmp7_; gchar* description; - const gchar* _tmp8_ = NULL; + GtkWindow* _tmp8_; + const gchar* _tmp9_ = NULL; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); _tmp0_ = g_strdup ("Robert Ancell "); @@ -2367,8 +3244,9 @@ void G_MODULE_EXPORT about_menuitem_activate_cb (GtkWidget* widget, SimpleScan* _tmp6_ = _ ("Simple document scanning tool"); _tmp7_ = g_strdup (_tmp6_); description = _tmp7_; - _tmp8_ = _ ("translator-credits"); - gtk_show_about_dialog (self->priv->window, "title", title, "program-name", "Simple Scan", "version", VERSION, "comments", description, "logo-icon-name", "scanner", "authors", authors, "translator-credits", _tmp8_, "website", "https://launchpad.net/simple-scan", "copyright", "Copyright © 2009-2011 Canonical Ltd.", "license", license, "wrap-license", TRUE, NULL, NULL); + _tmp8_ = self->priv->window; + _tmp9_ = _ ("translator-credits"); + gtk_show_about_dialog (_tmp8_, "title", title, "program-name", "Simple Scan", "version", VERSION, "comments", description, "logo-icon-name", "scanner", "authors", authors, "translator-credits", _tmp9_, "website", "https://launchpad.net/simple-scan", "copyright", "Copyright © 2009-2011 Canonical Ltd.", "license", license, "wrap-license", TRUE, NULL, NULL); _g_free0 (description); _g_free0 (title); _g_free0 (license); @@ -2380,16 +3258,40 @@ static gboolean simple_scan_on_quit (SimpleScan* self) { gboolean result = FALSE; const gchar* _tmp0_ = NULL; const gchar* _tmp1_ = NULL; - gboolean _tmp2_; + gboolean _tmp2_ = FALSE; gchar* _tmp3_ = NULL; gchar* device; gint paper_width; gint paper_height; - gint _tmp4_; - gint _tmp5_; - gint _tmp6_; - gint _tmp7_; - ScanType _tmp8_; + gint _tmp4_ = 0; + gint _tmp5_ = 0; + const gchar* _tmp6_; + GSettings* _tmp9_; + const gchar* _tmp10_; + GSettings* _tmp11_; + gint _tmp12_ = 0; + GSettings* _tmp13_; + gint _tmp14_ = 0; + GSettings* _tmp15_; + ScanType _tmp16_ = 0; + GSettings* _tmp17_; + gint _tmp18_; + GSettings* _tmp19_; + gint _tmp20_; + GSettings* _tmp21_; + gint _tmp22_; + GSettings* _tmp23_; + gint _tmp24_; + GSettings* _tmp25_; + gboolean _tmp26_; + GSettings* _tmp27_; + ScanDirection _tmp28_; + GSettings* _tmp29_; + gint _tmp30_; + GSettings* _tmp31_; + gint _tmp32_; + GSettings* _tmp33_; + gint _tmp34_; g_return_val_if_fail (self != NULL, FALSE); _tmp0_ = _ ("Save document before quitting?"); _tmp1_ = _ ("Quit without Saving"); @@ -2405,25 +3307,53 @@ static gboolean simple_scan_on_quit (SimpleScan* self) { simple_scan_get_paper_size (self, &_tmp4_, &_tmp5_); paper_width = _tmp4_; paper_height = _tmp5_; - if (device != NULL) { - g_settings_set_string (self->priv->settings, "selected-device", device); - } - g_settings_set_string (self->priv->settings, "document-type", self->priv->document_hint); - _tmp6_ = simple_scan_get_text_dpi (self); - g_settings_set_int (self->priv->settings, "text-dpi", _tmp6_); - _tmp7_ = simple_scan_get_photo_dpi (self); - g_settings_set_int (self->priv->settings, "photo-dpi", _tmp7_); - _tmp8_ = simple_scan_get_page_side (self); - g_settings_set_enum (self->priv->settings, "page-side", (gint) _tmp8_); - g_settings_set_int (self->priv->settings, "paper-width", paper_width); - g_settings_set_int (self->priv->settings, "paper-height", paper_height); - g_settings_set_int (self->priv->settings, "window-width", self->priv->window_width); - g_settings_set_int (self->priv->settings, "window-height", self->priv->window_height); - g_settings_set_boolean (self->priv->settings, "window-is-maximized", self->priv->window_is_maximized); - g_settings_set_enum (self->priv->settings, "scan-direction", (gint) self->priv->default_page_scan_direction); - g_settings_set_int (self->priv->settings, "page-width", self->priv->default_page_width); - g_settings_set_int (self->priv->settings, "page-height", self->priv->default_page_height); - g_settings_set_int (self->priv->settings, "page-dpi", self->priv->default_page_dpi); + _tmp6_ = device; + if (_tmp6_ != NULL) { + GSettings* _tmp7_; + const gchar* _tmp8_; + _tmp7_ = self->priv->settings; + _tmp8_ = device; + g_settings_set_string (_tmp7_, "selected-device", _tmp8_); + } + _tmp9_ = self->priv->settings; + _tmp10_ = self->priv->document_hint; + g_settings_set_string (_tmp9_, "document-type", _tmp10_); + _tmp11_ = self->priv->settings; + _tmp12_ = simple_scan_get_text_dpi (self); + g_settings_set_int (_tmp11_, "text-dpi", _tmp12_); + _tmp13_ = self->priv->settings; + _tmp14_ = simple_scan_get_photo_dpi (self); + g_settings_set_int (_tmp13_, "photo-dpi", _tmp14_); + _tmp15_ = self->priv->settings; + _tmp16_ = simple_scan_get_page_side (self); + g_settings_set_enum (_tmp15_, "page-side", (gint) _tmp16_); + _tmp17_ = self->priv->settings; + _tmp18_ = paper_width; + g_settings_set_int (_tmp17_, "paper-width", _tmp18_); + _tmp19_ = self->priv->settings; + _tmp20_ = paper_height; + g_settings_set_int (_tmp19_, "paper-height", _tmp20_); + _tmp21_ = self->priv->settings; + _tmp22_ = self->priv->window_width; + g_settings_set_int (_tmp21_, "window-width", _tmp22_); + _tmp23_ = self->priv->settings; + _tmp24_ = self->priv->window_height; + g_settings_set_int (_tmp23_, "window-height", _tmp24_); + _tmp25_ = self->priv->settings; + _tmp26_ = self->priv->window_is_maximized; + g_settings_set_boolean (_tmp25_, "window-is-maximized", _tmp26_); + _tmp27_ = self->priv->settings; + _tmp28_ = self->priv->default_page_scan_direction; + g_settings_set_enum (_tmp27_, "scan-direction", (gint) _tmp28_); + _tmp29_ = self->priv->settings; + _tmp30_ = self->priv->default_page_width; + g_settings_set_int (_tmp29_, "page-width", _tmp30_); + _tmp31_ = self->priv->settings; + _tmp32_ = self->priv->default_page_height; + g_settings_set_int (_tmp31_, "page-height", _tmp32_); + _tmp33_ = self->priv->settings; + _tmp34_ = self->priv->default_page_dpi; + g_settings_set_int (_tmp33_, "page-dpi", _tmp34_); g_signal_emit_by_name (self, "quit"); result = TRUE; _g_free0 (device); @@ -2440,11 +3370,22 @@ void G_MODULE_EXPORT quit_menuitem_activate_cb (GtkWidget* widget, SimpleScan* s gboolean G_MODULE_EXPORT simple_scan_window_configure_event_cb (GtkWidget* widget, GdkEventConfigure* event, SimpleScan* self) { gboolean result = FALSE; + gboolean _tmp0_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (widget != NULL, FALSE); - if (!self->priv->window_is_maximized) { - self->priv->window_width = (*event).width; - self->priv->window_height = (*event).height; + g_return_val_if_fail (event != NULL, FALSE); + _tmp0_ = self->priv->window_is_maximized; + if (!_tmp0_) { + GdkEventConfigure _tmp1_; + gint _tmp2_; + GdkEventConfigure _tmp3_; + gint _tmp4_; + _tmp1_ = *event; + _tmp2_ = _tmp1_.width; + self->priv->window_width = _tmp2_; + _tmp3_ = *event; + _tmp4_ = _tmp3_.height; + self->priv->window_height = _tmp4_; } result = FALSE; return result; @@ -2452,11 +3393,17 @@ gboolean G_MODULE_EXPORT simple_scan_window_configure_event_cb (GtkWidget* widge static void simple_scan_info_bar_response_cb (SimpleScan* self, GtkInfoBar* widget, gint response_id) { + gint _tmp0_; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - if (response_id == 1) { - gtk_widget_grab_focus ((GtkWidget*) self->priv->device_combo); - gtk_window_present ((GtkWindow*) self->priv->preferences_dialog); + _tmp0_ = response_id; + if (_tmp0_ == 1) { + GtkComboBox* _tmp1_; + GtkDialog* _tmp2_; + _tmp1_ = self->priv->device_combo; + gtk_widget_grab_focus ((GtkWidget*) _tmp1_); + _tmp2_ = self->priv->preferences_dialog; + gtk_window_present ((GtkWindow*) _tmp2_); } else { self->priv->have_error = FALSE; _g_free0 (self->priv->error_title); @@ -2470,10 +3417,19 @@ static void simple_scan_info_bar_response_cb (SimpleScan* self, GtkInfoBar* widg gboolean G_MODULE_EXPORT simple_scan_window_window_state_event_cb (GtkWidget* widget, GdkEventWindowState* event, SimpleScan* self) { gboolean result = FALSE; + GdkEventWindowState _tmp0_; + GdkWindowState _tmp1_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (widget != NULL, FALSE); - if (((*event).changed_mask & GDK_WINDOW_STATE_MAXIMIZED) != 0) { - self->priv->window_is_maximized = ((*event).new_window_state & GDK_WINDOW_STATE_MAXIMIZED) != 0; + g_return_val_if_fail (event != NULL, FALSE); + _tmp0_ = *event; + _tmp1_ = _tmp0_.changed_mask; + if ((_tmp1_ & GDK_WINDOW_STATE_MAXIMIZED) != 0) { + GdkEventWindowState _tmp2_; + GdkWindowState _tmp3_; + _tmp2_ = *event; + _tmp3_ = _tmp2_.new_window_state; + self->priv->window_is_maximized = (_tmp3_ & GDK_WINDOW_STATE_MAXIMIZED) != 0; } result = FALSE; return result; @@ -2482,7 +3438,7 @@ gboolean G_MODULE_EXPORT simple_scan_window_window_state_event_cb (GtkWidget* wi gboolean G_MODULE_EXPORT window_delete_event_cb (GtkWidget* widget, GdkEvent* event, SimpleScan* self) { gboolean result = FALSE; - gboolean _tmp0_; + gboolean _tmp0_ = FALSE; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (event != NULL, FALSE); @@ -2493,26 +3449,34 @@ gboolean G_MODULE_EXPORT window_delete_event_cb (GtkWidget* widget, GdkEvent* ev static void simple_scan_page_size_changed_cb (SimpleScan* self, Page* page) { - gint _tmp0_; - gint _tmp1_; - gint _tmp2_; + Page* _tmp0_; + gint _tmp1_ = 0; + Page* _tmp2_; + gint _tmp3_ = 0; + Page* _tmp4_; + gint _tmp5_ = 0; g_return_if_fail (self != NULL); g_return_if_fail (page != NULL); - _tmp0_ = page_get_width (page); - self->priv->default_page_width = _tmp0_; - _tmp1_ = page_get_height (page); - self->priv->default_page_height = _tmp1_; - _tmp2_ = page_get_dpi (page); - self->priv->default_page_dpi = _tmp2_; + _tmp0_ = page; + _tmp1_ = page_get_width (_tmp0_); + self->priv->default_page_width = _tmp1_; + _tmp2_ = page; + _tmp3_ = page_get_height (_tmp2_); + self->priv->default_page_height = _tmp3_; + _tmp4_ = page; + _tmp5_ = page_get_dpi (_tmp4_); + self->priv->default_page_dpi = _tmp5_; } static void simple_scan_page_scan_direction_changed_cb (SimpleScan* self, Page* page) { - ScanDirection _tmp0_; + Page* _tmp0_; + ScanDirection _tmp1_ = 0; g_return_if_fail (self != NULL); g_return_if_fail (page != NULL); - _tmp0_ = page_get_scan_direction (page); - self->priv->default_page_scan_direction = _tmp0_; + _tmp0_ = page; + _tmp1_ = page_get_scan_direction (_tmp0_); + self->priv->default_page_scan_direction = _tmp1_; } @@ -2527,34 +3491,48 @@ static void _simple_scan_page_scan_direction_changed_cb_page_scan_direction_chan static void simple_scan_page_added_cb (SimpleScan* self, Book* book, Page* page) { - gint _tmp0_; - gint _tmp1_; - gint _tmp2_; - ScanDirection _tmp3_; + Page* _tmp0_; + gint _tmp1_ = 0; + Page* _tmp2_; + gint _tmp3_ = 0; + Page* _tmp4_; + gint _tmp5_ = 0; + Page* _tmp6_; + ScanDirection _tmp7_ = 0; + Page* _tmp8_; + Page* _tmp9_; g_return_if_fail (self != NULL); g_return_if_fail (book != NULL); g_return_if_fail (page != NULL); - _tmp0_ = page_get_width (page); - self->priv->default_page_width = _tmp0_; - _tmp1_ = page_get_height (page); - self->priv->default_page_height = _tmp1_; - _tmp2_ = page_get_dpi (page); - self->priv->default_page_dpi = _tmp2_; - _tmp3_ = page_get_scan_direction (page); - self->priv->default_page_scan_direction = _tmp3_; - g_signal_connect (page, "size-changed", (GCallback) _simple_scan_page_size_changed_cb_page_size_changed, self); - g_signal_connect (page, "scan-direction-changed", (GCallback) _simple_scan_page_scan_direction_changed_cb_page_scan_direction_changed, self); + _tmp0_ = page; + _tmp1_ = page_get_width (_tmp0_); + self->priv->default_page_width = _tmp1_; + _tmp2_ = page; + _tmp3_ = page_get_height (_tmp2_); + self->priv->default_page_height = _tmp3_; + _tmp4_ = page; + _tmp5_ = page_get_dpi (_tmp4_); + self->priv->default_page_dpi = _tmp5_; + _tmp6_ = page; + _tmp7_ = page_get_scan_direction (_tmp6_); + self->priv->default_page_scan_direction = _tmp7_; + _tmp8_ = page; + g_signal_connect (_tmp8_, "size-changed", (GCallback) _simple_scan_page_size_changed_cb_page_size_changed, self); + _tmp9_ = page; + g_signal_connect (_tmp9_, "scan-direction-changed", (GCallback) _simple_scan_page_scan_direction_changed_cb_page_scan_direction_changed, self); simple_scan_update_page_menu (self); } static void simple_scan_page_removed_cb (SimpleScan* self, Book* book, Page* page) { - guint _tmp0_; + Book* _tmp0_; + guint _tmp1_ = 0U; g_return_if_fail (self != NULL); g_return_if_fail (book != NULL); g_return_if_fail (page != NULL); - _tmp0_ = book_get_n_pages (book); - if (_tmp0_ == ((guint) 1)) { + _tmp0_ = book; + _tmp1_ = book_get_n_pages (_tmp0_); + if (_tmp1_ == ((guint) 1)) { simple_scan_add_default_page (self); } simple_scan_update_page_menu (self); @@ -2562,86 +3540,136 @@ static void simple_scan_page_removed_cb (SimpleScan* self, Book* book, Page* pag static void simple_scan_set_dpi_combo (SimpleScan* self, GtkComboBox* combo, gint default_dpi, gint current_dpi) { - GtkCellRendererText* _tmp0_ = NULL; + GtkCellRendererText* _tmp0_; + GtkCellRendererText* _tmp1_; GtkCellRendererText* renderer; - GtkTreeModel* _tmp1_ = NULL; - GtkListStore* _tmp2_; + GtkComboBox* _tmp2_; + GtkCellRendererText* _tmp3_; + GtkComboBox* _tmp4_; + GtkCellRendererText* _tmp5_; + GtkComboBox* _tmp6_; + GtkTreeModel* _tmp7_ = NULL; + GtkListStore* _tmp8_; GtkListStore* model; - gint* _tmp3_ = NULL; + gint* _tmp9_ = NULL; gint* scan_resolutions; gint scan_resolutions_length1; gint _scan_resolutions_size_; + gint* _tmp10_; + gint _tmp10__length1; g_return_if_fail (self != NULL); g_return_if_fail (combo != NULL); _tmp0_ = (GtkCellRendererText*) gtk_cell_renderer_text_new (); - renderer = g_object_ref_sink (_tmp0_); - gtk_cell_layout_pack_start ((GtkCellLayout*) combo, (GtkCellRenderer*) renderer, TRUE); - gtk_cell_layout_add_attribute ((GtkCellLayout*) combo, (GtkCellRenderer*) renderer, "text", 1); - _tmp1_ = gtk_combo_box_get_model (combo); - _tmp2_ = _g_object_ref0 (GTK_LIST_STORE (_tmp1_)); - model = _tmp2_; - _tmp3_ = g_new0 (gint, 6); - _tmp3_[0] = 75; - _tmp3_[1] = 150; - _tmp3_[2] = 300; - _tmp3_[3] = 600; - _tmp3_[4] = 1200; - _tmp3_[5] = 2400; - scan_resolutions = _tmp3_; + _tmp1_ = g_object_ref_sink (_tmp0_); + renderer = _tmp1_; + _tmp2_ = combo; + _tmp3_ = renderer; + gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp2_, (GtkCellRenderer*) _tmp3_, TRUE); + _tmp4_ = combo; + _tmp5_ = renderer; + gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp4_, (GtkCellRenderer*) _tmp5_, "text", 1); + _tmp6_ = combo; + _tmp7_ = gtk_combo_box_get_model (_tmp6_); + _tmp8_ = _g_object_ref0 (GTK_LIST_STORE (_tmp7_)); + model = _tmp8_; + _tmp9_ = g_new0 (gint, 6); + _tmp9_[0] = 75; + _tmp9_[1] = 150; + _tmp9_[2] = 300; + _tmp9_[3] = 600; + _tmp9_[4] = 1200; + _tmp9_[5] = 2400; + scan_resolutions = _tmp9_; scan_resolutions_length1 = 6; _scan_resolutions_size_ = scan_resolutions_length1; + _tmp10_ = scan_resolutions; + _tmp10__length1 = scan_resolutions_length1; { gint* dpi_collection = NULL; gint dpi_collection_length1 = 0; gint _dpi_collection_size_ = 0; - gint dpi_it; - dpi_collection = scan_resolutions; - dpi_collection_length1 = scan_resolutions_length1; - for (dpi_it = 0; dpi_it < scan_resolutions_length1; dpi_it = dpi_it + 1) { + gint dpi_it = 0; + dpi_collection = _tmp10_; + dpi_collection_length1 = _tmp10__length1; + for (dpi_it = 0; dpi_it < _tmp10__length1; dpi_it = dpi_it + 1) { gint dpi = 0; dpi = dpi_collection[dpi_it]; { gchar* label = NULL; + gint _tmp11_; + gint _tmp12_; GtkTreeIter iter = {0}; - GtkTreeIter _tmp12_ = {0}; - if (dpi == default_dpi) { - const gchar* _tmp4_ = NULL; - gchar* _tmp5_ = NULL; - _tmp4_ = _ ("%d dpi (default)"); - _tmp5_ = g_strdup_printf (_tmp4_, dpi); + GtkListStore* _tmp27_; + GtkTreeIter _tmp28_ = {0}; + GtkListStore* _tmp29_; + GtkTreeIter _tmp30_; + gint _tmp31_; + const gchar* _tmp32_; + gint _tmp33_; + gint _tmp34_; + _tmp11_ = dpi; + _tmp12_ = default_dpi; + if (_tmp11_ == _tmp12_) { + const gchar* _tmp13_ = NULL; + gint _tmp14_; + gchar* _tmp15_ = NULL; + _tmp13_ = _ ("%d dpi (default)"); + _tmp14_ = dpi; + _tmp15_ = g_strdup_printf (_tmp13_, _tmp14_); _g_free0 (label); - label = _tmp5_; + label = _tmp15_; } else { - if (dpi == 75) { - const gchar* _tmp6_ = NULL; - gchar* _tmp7_ = NULL; - _tmp6_ = _ ("%d dpi (draft)"); - _tmp7_ = g_strdup_printf (_tmp6_, dpi); + gint _tmp16_; + _tmp16_ = dpi; + if (_tmp16_ == 75) { + const gchar* _tmp17_ = NULL; + gint _tmp18_; + gchar* _tmp19_ = NULL; + _tmp17_ = _ ("%d dpi (draft)"); + _tmp18_ = dpi; + _tmp19_ = g_strdup_printf (_tmp17_, _tmp18_); _g_free0 (label); - label = _tmp7_; + label = _tmp19_; } else { - if (dpi == 1200) { - const gchar* _tmp8_ = NULL; - gchar* _tmp9_ = NULL; - _tmp8_ = _ ("%d dpi (high resolution)"); - _tmp9_ = g_strdup_printf (_tmp8_, dpi); + gint _tmp20_; + _tmp20_ = dpi; + if (_tmp20_ == 1200) { + const gchar* _tmp21_ = NULL; + gint _tmp22_; + gchar* _tmp23_ = NULL; + _tmp21_ = _ ("%d dpi (high resolution)"); + _tmp22_ = dpi; + _tmp23_ = g_strdup_printf (_tmp21_, _tmp22_); _g_free0 (label); - label = _tmp9_; + label = _tmp23_; } else { - const gchar* _tmp10_ = NULL; - gchar* _tmp11_ = NULL; - _tmp10_ = _ ("%d dpi"); - _tmp11_ = g_strdup_printf (_tmp10_, dpi); + const gchar* _tmp24_ = NULL; + gint _tmp25_; + gchar* _tmp26_ = NULL; + _tmp24_ = _ ("%d dpi"); + _tmp25_ = dpi; + _tmp26_ = g_strdup_printf (_tmp24_, _tmp25_); _g_free0 (label); - label = _tmp11_; + label = _tmp26_; } } } - gtk_list_store_append (model, &_tmp12_); - iter = _tmp12_; - gtk_list_store_set (model, &iter, 0, dpi, 1, label, -1, -1); - if (dpi == current_dpi) { - gtk_combo_box_set_active_iter (combo, &iter); + _tmp27_ = model; + gtk_list_store_append (_tmp27_, &_tmp28_); + iter = _tmp28_; + _tmp29_ = model; + _tmp30_ = iter; + _tmp31_ = dpi; + _tmp32_ = label; + gtk_list_store_set (_tmp29_, &_tmp30_, 0, _tmp31_, 1, _tmp32_, -1, -1); + _tmp33_ = dpi; + _tmp34_ = current_dpi; + if (_tmp33_ == _tmp34_) { + GtkComboBox* _tmp35_; + GtkTreeIter _tmp36_; + _tmp35_ = combo; + _tmp36_ = iter; + gtk_combo_box_set_active_iter (_tmp35_, &_tmp36_); } _g_free0 (label); } @@ -2654,18 +3682,30 @@ static void simple_scan_set_dpi_combo (SimpleScan* self, GtkComboBox* combo, gin static void simple_scan_needs_saving_cb (SimpleScan* self, Book* book) { - gboolean _tmp0_; - gboolean _tmp1_; - gboolean _tmp2_; + GtkMenuItem* _tmp0_; + Book* _tmp1_; + gboolean _tmp2_ = FALSE; + GtkToolButton* _tmp3_; + Book* _tmp4_; + gboolean _tmp5_ = FALSE; + Book* _tmp6_; + gboolean _tmp7_ = FALSE; g_return_if_fail (self != NULL); g_return_if_fail (book != NULL); - _tmp0_ = book_get_needs_saving (book); - gtk_widget_set_sensitive ((GtkWidget*) self->priv->save_menuitem, _tmp0_); - _tmp1_ = book_get_needs_saving (book); - gtk_widget_set_sensitive ((GtkWidget*) self->priv->save_toolbutton, _tmp1_); - _tmp2_ = book_get_needs_saving (book); - if (_tmp2_) { - gtk_widget_set_sensitive ((GtkWidget*) self->priv->save_as_menuitem, TRUE); + _tmp0_ = self->priv->save_menuitem; + _tmp1_ = book; + _tmp2_ = book_get_needs_saving (_tmp1_); + gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, _tmp2_); + _tmp3_ = self->priv->save_toolbutton; + _tmp4_ = book; + _tmp5_ = book_get_needs_saving (_tmp4_); + gtk_widget_set_sensitive ((GtkWidget*) _tmp3_, _tmp5_); + _tmp6_ = book; + _tmp7_ = book_get_needs_saving (_tmp6_); + if (_tmp7_) { + GtkMenuItem* _tmp8_; + _tmp8_ = self->priv->save_as_menuitem; + gtk_widget_set_sensitive ((GtkWidget*) _tmp8_, TRUE); } } @@ -2697,116 +3737,250 @@ static void _simple_scan_needs_saving_cb_book_needs_saving_changed (Book* _sende static void simple_scan_load (SimpleScan* self) { GtkIconTheme* _tmp0_ = NULL; - GtkBuilder* _tmp1_ = NULL; + GtkBuilder* _tmp1_; gchar* _tmp2_ = NULL; gchar* filename; - GObject* _tmp5_ = NULL; - GtkWindow* _tmp6_; - GObject* _tmp7_ = NULL; - GtkVBox* _tmp8_; - GObject* _tmp9_ = NULL; - GtkMenuItem* _tmp10_; - GObject* _tmp11_ = NULL; - GtkMenuItem* _tmp12_; + GtkBuilder* _tmp8_; + GtkBuilder* _tmp9_; + GObject* _tmp10_ = NULL; + GtkWindow* _tmp11_; + GtkBuilder* _tmp12_; GObject* _tmp13_ = NULL; - GtkMenuItem* _tmp14_; - GObject* _tmp15_ = NULL; - GtkMenuItem* _tmp16_; - GObject* _tmp17_ = NULL; - GtkMenuItem* _tmp18_; + GtkVBox* _tmp14_; + GtkBuilder* _tmp15_; + GObject* _tmp16_ = NULL; + GtkMenuItem* _tmp17_; + GtkBuilder* _tmp18_; GObject* _tmp19_ = NULL; GtkMenuItem* _tmp20_; - GObject* _tmp21_ = NULL; - GtkToolButton* _tmp22_; - GObject* _tmp23_ = NULL; - GtkMenuItem* _tmp24_; + GtkBuilder* _tmp21_; + GObject* _tmp22_ = NULL; + GtkMenuItem* _tmp23_; + GtkBuilder* _tmp24_; GObject* _tmp25_ = NULL; - GtkToolButton* _tmp26_; - GObject* _tmp27_ = NULL; - GtkRadioMenuItem* _tmp28_; - GObject* _tmp29_ = NULL; - GtkRadioMenuItem* _tmp30_; + GtkMenuItem* _tmp26_; + GtkBuilder* _tmp27_; + GObject* _tmp28_ = NULL; + GtkMenuItem* _tmp29_; + GtkBuilder* _tmp30_; GObject* _tmp31_ = NULL; - GtkRadioMenuItem* _tmp32_; - GObject* _tmp33_ = NULL; - GtkRadioMenuItem* _tmp34_; - GObject* _tmp35_ = NULL; - GtkDialog* _tmp36_; + GtkMenuItem* _tmp32_; + GtkBuilder* _tmp33_; + GObject* _tmp34_ = NULL; + GtkToolButton* _tmp35_; + GtkBuilder* _tmp36_; GObject* _tmp37_ = NULL; - GtkLabel* _tmp38_; - GObject* _tmp39_ = NULL; - GtkEntry* _tmp40_; - GObject* _tmp41_ = NULL; - GtkEntry* _tmp42_; + GtkMenuItem* _tmp38_; + GtkBuilder* _tmp39_; + GObject* _tmp40_ = NULL; + GtkToolButton* _tmp41_; + GtkBuilder* _tmp42_; GObject* _tmp43_ = NULL; - GtkDialog* _tmp44_; - GObject* _tmp45_ = NULL; - GtkComboBox* _tmp46_; - GtkTreeModel* _tmp47_ = NULL; - GtkListStore* _tmp48_; + GtkRadioMenuItem* _tmp44_; + GtkBuilder* _tmp45_; + GObject* _tmp46_ = NULL; + GtkRadioMenuItem* _tmp47_; + GtkBuilder* _tmp48_; GObject* _tmp49_ = NULL; - GtkComboBox* _tmp50_; - GtkTreeModel* _tmp51_ = NULL; - GtkListStore* _tmp52_; - GObject* _tmp53_ = NULL; - GtkComboBox* _tmp54_; - GtkTreeModel* _tmp55_ = NULL; - GtkListStore* _tmp56_; - GObject* _tmp57_ = NULL; - GtkComboBox* _tmp58_; - GtkTreeModel* _tmp59_ = NULL; - GtkListStore* _tmp60_; + GtkRadioMenuItem* _tmp50_; + GtkBuilder* _tmp51_; + GObject* _tmp52_ = NULL; + GtkRadioMenuItem* _tmp53_; + GtkBuilder* _tmp54_; + GObject* _tmp55_ = NULL; + GtkDialog* _tmp56_; + GtkBuilder* _tmp57_; + GObject* _tmp58_ = NULL; + GtkLabel* _tmp59_; + GtkBuilder* _tmp60_; GObject* _tmp61_ = NULL; - GtkComboBox* _tmp62_; - GtkTreeModel* _tmp63_ = NULL; - GtkListStore* _tmp64_; - GtkInfoBar* _tmp65_ = NULL; - GtkHBox* _tmp66_ = NULL; + GtkEntry* _tmp62_; + GtkBuilder* _tmp63_; + GObject* _tmp64_ = NULL; + GtkEntry* _tmp65_; + GtkBuilder* _tmp66_; + GObject* _tmp67_ = NULL; + GtkDialog* _tmp68_; + GtkBuilder* _tmp69_; + GObject* _tmp70_ = NULL; + GtkComboBox* _tmp71_; + GtkComboBox* _tmp72_; + GtkTreeModel* _tmp73_ = NULL; + GtkListStore* _tmp74_; + GtkBuilder* _tmp75_; + GObject* _tmp76_ = NULL; + GtkComboBox* _tmp77_; + GtkComboBox* _tmp78_; + GtkTreeModel* _tmp79_ = NULL; + GtkListStore* _tmp80_; + GtkBuilder* _tmp81_; + GObject* _tmp82_ = NULL; + GtkComboBox* _tmp83_; + GtkComboBox* _tmp84_; + GtkTreeModel* _tmp85_ = NULL; + GtkListStore* _tmp86_; + GtkBuilder* _tmp87_; + GObject* _tmp88_ = NULL; + GtkComboBox* _tmp89_; + GtkComboBox* _tmp90_; + GtkTreeModel* _tmp91_ = NULL; + GtkListStore* _tmp92_; + GtkBuilder* _tmp93_; + GObject* _tmp94_ = NULL; + GtkComboBox* _tmp95_; + GtkComboBox* _tmp96_; + GtkTreeModel* _tmp97_ = NULL; + GtkListStore* _tmp98_; + GtkInfoBar* _tmp99_; + GtkInfoBar* _tmp100_; + GtkInfoBar* _tmp101_; + GtkVBox* _tmp102_; + GtkInfoBar* _tmp103_; + GtkHBox* _tmp104_; + GtkHBox* _tmp105_; GtkHBox* hbox; - GtkWidget* _tmp67_ = NULL; - GtkContainer* _tmp68_; + GtkInfoBar* _tmp106_; + GtkWidget* _tmp107_ = NULL; + GtkContainer* _tmp108_; GtkContainer* content_area; - GtkImage* _tmp69_ = NULL; - GtkLabel* _tmp70_ = NULL; - GtkWidget* _tmp71_ = NULL; - GtkButton* _tmp72_; - const gchar* _tmp73_ = NULL; - GtkWidget* _tmp74_ = NULL; - GtkButton* _tmp75_; + GtkContainer* _tmp109_; + GtkHBox* _tmp110_; + GtkHBox* _tmp111_; + GtkImage* _tmp112_; + GtkImage* _tmp113_; + GtkHBox* _tmp114_; + GtkImage* _tmp115_; + GtkImage* _tmp116_; + GtkLabel* _tmp117_; + GtkLabel* _tmp118_; + GtkLabel* _tmp119_; + GtkHBox* _tmp120_; + GtkLabel* _tmp121_; + GtkLabel* _tmp122_; + GtkInfoBar* _tmp123_; + GtkWidget* _tmp124_ = NULL; + GtkButton* _tmp125_; + GtkInfoBar* _tmp126_; + const gchar* _tmp127_ = NULL; + GtkWidget* _tmp128_ = NULL; + GtkButton* _tmp129_; GtkTreeIter iter = {0}; - GtkTreeIter _tmp76_ = {0}; - const gchar* _tmp77_ = NULL; - GtkTreeIter _tmp78_ = {0}; - GtkTreeIter _tmp79_ = {0}; - GtkTreeIter _tmp80_ = {0}; - GtkTreeIter _tmp81_ = {0}; - GtkTreeIter _tmp82_ = {0}; - GtkTreeIter _tmp83_ = {0}; - gint _tmp84_; + GtkListStore* _tmp130_; + GtkTreeIter _tmp131_ = {0}; + GtkListStore* _tmp132_; + GtkTreeIter _tmp133_; + const gchar* _tmp134_ = NULL; + GtkListStore* _tmp135_; + GtkTreeIter _tmp136_ = {0}; + GtkListStore* _tmp137_; + GtkTreeIter _tmp138_; + GtkListStore* _tmp139_; + GtkTreeIter _tmp140_ = {0}; + GtkListStore* _tmp141_; + GtkTreeIter _tmp142_; + GtkListStore* _tmp143_; + GtkTreeIter _tmp144_ = {0}; + GtkListStore* _tmp145_; + GtkTreeIter _tmp146_; + GtkListStore* _tmp147_; + GtkTreeIter _tmp148_ = {0}; + GtkListStore* _tmp149_; + GtkTreeIter _tmp150_; + GtkListStore* _tmp151_; + GtkTreeIter _tmp152_ = {0}; + GtkListStore* _tmp153_; + GtkTreeIter _tmp154_; + GtkListStore* _tmp155_; + GtkTreeIter _tmp156_ = {0}; + GtkListStore* _tmp157_; + GtkTreeIter _tmp158_; + GSettings* _tmp159_; + gint _tmp160_ = 0; gint dpi; - gint _tmp85_; - GtkCellRendererText* _tmp86_ = NULL; + gint _tmp161_; + GtkComboBox* _tmp162_; + gint _tmp163_; + GSettings* _tmp164_; + gint _tmp165_ = 0; + gint _tmp166_; + GtkComboBox* _tmp167_; + gint _tmp168_; + GtkCellRendererText* _tmp169_; + GtkCellRendererText* _tmp170_; GtkCellRendererText* renderer; - GtkCellRendererText* _tmp87_ = NULL; - gint _tmp88_; - GtkCellRendererText* _tmp89_ = NULL; - gint _tmp90_; + GtkComboBox* _tmp171_; + GtkCellRendererText* _tmp172_; + GtkComboBox* _tmp173_; + GtkCellRendererText* _tmp174_; + GtkCellRendererText* _tmp175_; + GtkCellRendererText* _tmp176_; + GtkComboBox* _tmp177_; + GtkCellRendererText* _tmp178_; + GtkComboBox* _tmp179_; + GtkCellRendererText* _tmp180_; + GSettings* _tmp181_; + gint _tmp182_ = 0; + GtkCellRendererText* _tmp183_; + GtkCellRendererText* _tmp184_; + GtkComboBox* _tmp185_; + GtkCellRendererText* _tmp186_; + GtkComboBox* _tmp187_; + GtkCellRendererText* _tmp188_; + GSettings* _tmp189_; + gint _tmp190_ = 0; gint paper_width; - gint _tmp91_; + GSettings* _tmp191_; + gint _tmp192_ = 0; gint paper_height; - gchar* _tmp92_ = NULL; + gint _tmp193_; + gint _tmp194_; + GSettings* _tmp195_; + gchar* _tmp196_ = NULL; gchar* device; - gchar* _tmp95_ = NULL; + const gchar* _tmp197_; + GSettings* _tmp203_; + gchar* _tmp204_ = NULL; gchar* document_type; - BookView* _tmp96_ = NULL; - gint _tmp97_; - gint _tmp98_; - gint _tmp99_; - gint _tmp100_; - gint _tmp101_; - gint _tmp102_; - gboolean _tmp103_; - guint _tmp104_; + const gchar* _tmp205_; + Book* _tmp207_; + BookView* _tmp208_; + BookView* _tmp209_; + BookView* _tmp210_; + GtkVBox* _tmp211_; + BookView* _tmp212_; + BookView* _tmp213_; + BookView* _tmp214_; + BookView* _tmp215_; + BookView* _tmp216_; + GSettings* _tmp217_; + gint _tmp218_ = 0; + GSettings* _tmp219_; + gint _tmp220_ = 0; + gint _tmp221_; + GSettings* _tmp222_; + gint _tmp223_ = 0; + gint _tmp224_; + GSettings* _tmp225_; + gint _tmp226_ = 0; + gint _tmp227_; + GSettings* _tmp228_; + gint _tmp229_ = 0; + gint _tmp230_; + GSettings* _tmp231_; + gint _tmp232_ = 0; + gint _tmp233_; + gint _tmp234_; + gint _tmp235_; + GtkWindow* _tmp236_; + gint _tmp237_; + gint _tmp238_; + GSettings* _tmp239_; + gboolean _tmp240_ = FALSE; + gboolean _tmp241_; + Book* _tmp243_; + guint _tmp244_ = 0U; + Book* _tmp245_; + Book* _tmp246_; GError * _inner_error_ = NULL; g_return_if_fail (self != NULL); _tmp0_ = gtk_icon_theme_get_default (); @@ -2818,7 +3992,9 @@ static void simple_scan_load (SimpleScan* self) { _tmp2_ = g_build_filename (UI_DIR, "simple-scan.ui", NULL, NULL); filename = _tmp2_; { - gtk_builder_add_from_file (self->priv->builder, filename, &_inner_error_); + GtkBuilder* _tmp3_; + _tmp3_ = self->priv->builder; + gtk_builder_add_from_file (_tmp3_, filename, &_inner_error_); if (_inner_error_ != NULL) { goto __catch17_g_error; } @@ -2827,14 +4003,18 @@ static void simple_scan_load (SimpleScan* self) { __catch17_g_error: { GError* e = NULL; - const gchar* _tmp3_ = NULL; - const gchar* _tmp4_ = NULL; + GError* _tmp4_; + const gchar* _tmp5_; + const gchar* _tmp6_ = NULL; + const gchar* _tmp7_ = NULL; e = _inner_error_; _inner_error_ = NULL; - g_critical ("ui.vala:1261: Unable to load UI %s: %s\n", filename, e->message); - _tmp3_ = _ ("Files missing"); - _tmp4_ = _ ("Please check your installation"); - simple_scan_show_error_dialog (self, _tmp3_, _tmp4_); + _tmp4_ = e; + _tmp5_ = _tmp4_->message; + g_critical ("ui.vala:1261: Unable to load UI %s: %s\n", filename, _tmp5_); + _tmp6_ = _ ("Files missing"); + _tmp7_ = _ ("Please check your installation"); + simple_scan_show_error_dialog (self, _tmp6_, _tmp7_); exit (EXIT_FAILURE); _g_error_free0 (e); } @@ -2845,280 +4025,424 @@ static void simple_scan_load (SimpleScan* self) { g_clear_error (&_inner_error_); return; } - gtk_builder_connect_signals (self->priv->builder, self); - _tmp5_ = gtk_builder_get_object (self->priv->builder, "simple_scan_window"); - _tmp6_ = _g_object_ref0 (GTK_WINDOW (_tmp5_)); + _tmp8_ = self->priv->builder; + gtk_builder_connect_signals (_tmp8_, self); + _tmp9_ = self->priv->builder; + _tmp10_ = gtk_builder_get_object (_tmp9_, "simple_scan_window"); + _tmp11_ = _g_object_ref0 (GTK_WINDOW (_tmp10_)); _g_object_unref0 (self->priv->window); - self->priv->window = _tmp6_; - _tmp7_ = gtk_builder_get_object (self->priv->builder, "main_vbox"); - _tmp8_ = _g_object_ref0 (GTK_VBOX (_tmp7_)); + self->priv->window = _tmp11_; + _tmp12_ = self->priv->builder; + _tmp13_ = gtk_builder_get_object (_tmp12_, "main_vbox"); + _tmp14_ = _g_object_ref0 (GTK_VBOX (_tmp13_)); _g_object_unref0 (self->priv->main_vbox); - self->priv->main_vbox = _tmp8_; - _tmp9_ = gtk_builder_get_object (self->priv->builder, "page_move_left_menuitem"); - _tmp10_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp9_)); + self->priv->main_vbox = _tmp14_; + _tmp15_ = self->priv->builder; + _tmp16_ = gtk_builder_get_object (_tmp15_, "page_move_left_menuitem"); + _tmp17_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp16_)); _g_object_unref0 (self->priv->page_move_left_menuitem); - self->priv->page_move_left_menuitem = _tmp10_; - _tmp11_ = gtk_builder_get_object (self->priv->builder, "page_move_right_menuitem"); - _tmp12_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp11_)); + self->priv->page_move_left_menuitem = _tmp17_; + _tmp18_ = self->priv->builder; + _tmp19_ = gtk_builder_get_object (_tmp18_, "page_move_right_menuitem"); + _tmp20_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp19_)); _g_object_unref0 (self->priv->page_move_right_menuitem); - self->priv->page_move_right_menuitem = _tmp12_; - _tmp13_ = gtk_builder_get_object (self->priv->builder, "page_delete_menuitem"); - _tmp14_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp13_)); + self->priv->page_move_right_menuitem = _tmp20_; + _tmp21_ = self->priv->builder; + _tmp22_ = gtk_builder_get_object (_tmp21_, "page_delete_menuitem"); + _tmp23_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp22_)); _g_object_unref0 (self->priv->page_delete_menuitem); - self->priv->page_delete_menuitem = _tmp14_; - _tmp15_ = gtk_builder_get_object (self->priv->builder, "crop_rotate_menuitem"); - _tmp16_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp15_)); + self->priv->page_delete_menuitem = _tmp23_; + _tmp24_ = self->priv->builder; + _tmp25_ = gtk_builder_get_object (_tmp24_, "crop_rotate_menuitem"); + _tmp26_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp25_)); _g_object_unref0 (self->priv->crop_rotate_menuitem); - self->priv->crop_rotate_menuitem = _tmp16_; - _tmp17_ = gtk_builder_get_object (self->priv->builder, "save_menuitem"); - _tmp18_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp17_)); + self->priv->crop_rotate_menuitem = _tmp26_; + _tmp27_ = self->priv->builder; + _tmp28_ = gtk_builder_get_object (_tmp27_, "save_menuitem"); + _tmp29_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp28_)); _g_object_unref0 (self->priv->save_menuitem); - self->priv->save_menuitem = _tmp18_; - _tmp19_ = gtk_builder_get_object (self->priv->builder, "save_as_menuitem"); - _tmp20_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp19_)); + self->priv->save_menuitem = _tmp29_; + _tmp30_ = self->priv->builder; + _tmp31_ = gtk_builder_get_object (_tmp30_, "save_as_menuitem"); + _tmp32_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp31_)); _g_object_unref0 (self->priv->save_as_menuitem); - self->priv->save_as_menuitem = _tmp20_; - _tmp21_ = gtk_builder_get_object (self->priv->builder, "save_toolbutton"); - _tmp22_ = _g_object_ref0 (GTK_TOOL_BUTTON (_tmp21_)); + self->priv->save_as_menuitem = _tmp32_; + _tmp33_ = self->priv->builder; + _tmp34_ = gtk_builder_get_object (_tmp33_, "save_toolbutton"); + _tmp35_ = _g_object_ref0 (GTK_TOOL_BUTTON (_tmp34_)); _g_object_unref0 (self->priv->save_toolbutton); - self->priv->save_toolbutton = _tmp22_; - _tmp23_ = gtk_builder_get_object (self->priv->builder, "stop_scan_menuitem"); - _tmp24_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp23_)); + self->priv->save_toolbutton = _tmp35_; + _tmp36_ = self->priv->builder; + _tmp37_ = gtk_builder_get_object (_tmp36_, "stop_scan_menuitem"); + _tmp38_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp37_)); _g_object_unref0 (self->priv->stop_menuitem); - self->priv->stop_menuitem = _tmp24_; - _tmp25_ = gtk_builder_get_object (self->priv->builder, "stop_toolbutton"); - _tmp26_ = _g_object_ref0 (GTK_TOOL_BUTTON (_tmp25_)); + self->priv->stop_menuitem = _tmp38_; + _tmp39_ = self->priv->builder; + _tmp40_ = gtk_builder_get_object (_tmp39_, "stop_toolbutton"); + _tmp41_ = _g_object_ref0 (GTK_TOOL_BUTTON (_tmp40_)); _g_object_unref0 (self->priv->stop_toolbutton); - self->priv->stop_toolbutton = _tmp26_; - _tmp27_ = gtk_builder_get_object (self->priv->builder, "text_toolbutton_menuitem"); - _tmp28_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp27_)); + self->priv->stop_toolbutton = _tmp41_; + _tmp42_ = self->priv->builder; + _tmp43_ = gtk_builder_get_object (_tmp42_, "text_toolbutton_menuitem"); + _tmp44_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp43_)); _g_object_unref0 (self->priv->text_toolbar_menuitem); - self->priv->text_toolbar_menuitem = _tmp28_; - _tmp29_ = gtk_builder_get_object (self->priv->builder, "text_menuitem"); - _tmp30_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp29_)); + self->priv->text_toolbar_menuitem = _tmp44_; + _tmp45_ = self->priv->builder; + _tmp46_ = gtk_builder_get_object (_tmp45_, "text_menuitem"); + _tmp47_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp46_)); _g_object_unref0 (self->priv->text_menu_menuitem); - self->priv->text_menu_menuitem = _tmp30_; - _tmp31_ = gtk_builder_get_object (self->priv->builder, "photo_toolbutton_menuitem"); - _tmp32_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp31_)); + self->priv->text_menu_menuitem = _tmp47_; + _tmp48_ = self->priv->builder; + _tmp49_ = gtk_builder_get_object (_tmp48_, "photo_toolbutton_menuitem"); + _tmp50_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp49_)); _g_object_unref0 (self->priv->photo_toolbar_menuitem); - self->priv->photo_toolbar_menuitem = _tmp32_; - _tmp33_ = gtk_builder_get_object (self->priv->builder, "photo_menuitem"); - _tmp34_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp33_)); + self->priv->photo_toolbar_menuitem = _tmp50_; + _tmp51_ = self->priv->builder; + _tmp52_ = gtk_builder_get_object (_tmp51_, "photo_menuitem"); + _tmp53_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp52_)); _g_object_unref0 (self->priv->photo_menu_menuitem); - self->priv->photo_menu_menuitem = _tmp34_; - _tmp35_ = gtk_builder_get_object (self->priv->builder, "authorize_dialog"); - _tmp36_ = _g_object_ref0 (GTK_DIALOG (_tmp35_)); + self->priv->photo_menu_menuitem = _tmp53_; + _tmp54_ = self->priv->builder; + _tmp55_ = gtk_builder_get_object (_tmp54_, "authorize_dialog"); + _tmp56_ = _g_object_ref0 (GTK_DIALOG (_tmp55_)); _g_object_unref0 (self->priv->authorize_dialog); - self->priv->authorize_dialog = _tmp36_; - _tmp37_ = gtk_builder_get_object (self->priv->builder, "authorize_label"); - _tmp38_ = _g_object_ref0 (GTK_LABEL (_tmp37_)); + self->priv->authorize_dialog = _tmp56_; + _tmp57_ = self->priv->builder; + _tmp58_ = gtk_builder_get_object (_tmp57_, "authorize_label"); + _tmp59_ = _g_object_ref0 (GTK_LABEL (_tmp58_)); _g_object_unref0 (self->priv->authorize_label); - self->priv->authorize_label = _tmp38_; - _tmp39_ = gtk_builder_get_object (self->priv->builder, "username_entry"); - _tmp40_ = _g_object_ref0 (GTK_ENTRY (_tmp39_)); + self->priv->authorize_label = _tmp59_; + _tmp60_ = self->priv->builder; + _tmp61_ = gtk_builder_get_object (_tmp60_, "username_entry"); + _tmp62_ = _g_object_ref0 (GTK_ENTRY (_tmp61_)); _g_object_unref0 (self->priv->username_entry); - self->priv->username_entry = _tmp40_; - _tmp41_ = gtk_builder_get_object (self->priv->builder, "password_entry"); - _tmp42_ = _g_object_ref0 (GTK_ENTRY (_tmp41_)); + self->priv->username_entry = _tmp62_; + _tmp63_ = self->priv->builder; + _tmp64_ = gtk_builder_get_object (_tmp63_, "password_entry"); + _tmp65_ = _g_object_ref0 (GTK_ENTRY (_tmp64_)); _g_object_unref0 (self->priv->password_entry); - self->priv->password_entry = _tmp42_; - _tmp43_ = gtk_builder_get_object (self->priv->builder, "preferences_dialog"); - _tmp44_ = _g_object_ref0 (GTK_DIALOG (_tmp43_)); + self->priv->password_entry = _tmp65_; + _tmp66_ = self->priv->builder; + _tmp67_ = gtk_builder_get_object (_tmp66_, "preferences_dialog"); + _tmp68_ = _g_object_ref0 (GTK_DIALOG (_tmp67_)); _g_object_unref0 (self->priv->preferences_dialog); - self->priv->preferences_dialog = _tmp44_; - _tmp45_ = gtk_builder_get_object (self->priv->builder, "device_combo"); - _tmp46_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp45_)); + self->priv->preferences_dialog = _tmp68_; + _tmp69_ = self->priv->builder; + _tmp70_ = gtk_builder_get_object (_tmp69_, "device_combo"); + _tmp71_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp70_)); _g_object_unref0 (self->priv->device_combo); - self->priv->device_combo = _tmp46_; - _tmp47_ = gtk_combo_box_get_model (self->priv->device_combo); - _tmp48_ = _g_object_ref0 (GTK_LIST_STORE (_tmp47_)); + self->priv->device_combo = _tmp71_; + _tmp72_ = self->priv->device_combo; + _tmp73_ = gtk_combo_box_get_model (_tmp72_); + _tmp74_ = _g_object_ref0 (GTK_LIST_STORE (_tmp73_)); _g_object_unref0 (self->priv->device_model); - self->priv->device_model = _tmp48_; - _tmp49_ = gtk_builder_get_object (self->priv->builder, "text_dpi_combo"); - _tmp50_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp49_)); + self->priv->device_model = _tmp74_; + _tmp75_ = self->priv->builder; + _tmp76_ = gtk_builder_get_object (_tmp75_, "text_dpi_combo"); + _tmp77_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp76_)); _g_object_unref0 (self->priv->text_dpi_combo); - self->priv->text_dpi_combo = _tmp50_; - _tmp51_ = gtk_combo_box_get_model (self->priv->text_dpi_combo); - _tmp52_ = _g_object_ref0 (GTK_LIST_STORE (_tmp51_)); + self->priv->text_dpi_combo = _tmp77_; + _tmp78_ = self->priv->text_dpi_combo; + _tmp79_ = gtk_combo_box_get_model (_tmp78_); + _tmp80_ = _g_object_ref0 (GTK_LIST_STORE (_tmp79_)); _g_object_unref0 (self->priv->text_dpi_model); - self->priv->text_dpi_model = _tmp52_; - _tmp53_ = gtk_builder_get_object (self->priv->builder, "photo_dpi_combo"); - _tmp54_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp53_)); + self->priv->text_dpi_model = _tmp80_; + _tmp81_ = self->priv->builder; + _tmp82_ = gtk_builder_get_object (_tmp81_, "photo_dpi_combo"); + _tmp83_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp82_)); _g_object_unref0 (self->priv->photo_dpi_combo); - self->priv->photo_dpi_combo = _tmp54_; - _tmp55_ = gtk_combo_box_get_model (self->priv->photo_dpi_combo); - _tmp56_ = _g_object_ref0 (GTK_LIST_STORE (_tmp55_)); + self->priv->photo_dpi_combo = _tmp83_; + _tmp84_ = self->priv->photo_dpi_combo; + _tmp85_ = gtk_combo_box_get_model (_tmp84_); + _tmp86_ = _g_object_ref0 (GTK_LIST_STORE (_tmp85_)); _g_object_unref0 (self->priv->photo_dpi_model); - self->priv->photo_dpi_model = _tmp56_; - _tmp57_ = gtk_builder_get_object (self->priv->builder, "page_side_combo"); - _tmp58_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp57_)); + self->priv->photo_dpi_model = _tmp86_; + _tmp87_ = self->priv->builder; + _tmp88_ = gtk_builder_get_object (_tmp87_, "page_side_combo"); + _tmp89_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp88_)); _g_object_unref0 (self->priv->page_side_combo); - self->priv->page_side_combo = _tmp58_; - _tmp59_ = gtk_combo_box_get_model (self->priv->page_side_combo); - _tmp60_ = _g_object_ref0 (GTK_LIST_STORE (_tmp59_)); + self->priv->page_side_combo = _tmp89_; + _tmp90_ = self->priv->page_side_combo; + _tmp91_ = gtk_combo_box_get_model (_tmp90_); + _tmp92_ = _g_object_ref0 (GTK_LIST_STORE (_tmp91_)); _g_object_unref0 (self->priv->page_side_model); - self->priv->page_side_model = _tmp60_; - _tmp61_ = gtk_builder_get_object (self->priv->builder, "paper_size_combo"); - _tmp62_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp61_)); + self->priv->page_side_model = _tmp92_; + _tmp93_ = self->priv->builder; + _tmp94_ = gtk_builder_get_object (_tmp93_, "paper_size_combo"); + _tmp95_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp94_)); _g_object_unref0 (self->priv->paper_size_combo); - self->priv->paper_size_combo = _tmp62_; - _tmp63_ = gtk_combo_box_get_model (self->priv->paper_size_combo); - _tmp64_ = _g_object_ref0 (GTK_LIST_STORE (_tmp63_)); + self->priv->paper_size_combo = _tmp95_; + _tmp96_ = self->priv->paper_size_combo; + _tmp97_ = gtk_combo_box_get_model (_tmp96_); + _tmp98_ = _g_object_ref0 (GTK_LIST_STORE (_tmp97_)); _g_object_unref0 (self->priv->paper_size_model); - self->priv->paper_size_model = _tmp64_; - _tmp65_ = (GtkInfoBar*) gtk_info_bar_new (); + self->priv->paper_size_model = _tmp98_; + _tmp99_ = (GtkInfoBar*) gtk_info_bar_new (); + _tmp100_ = g_object_ref_sink (_tmp99_); _g_object_unref0 (self->priv->info_bar); - self->priv->info_bar = g_object_ref_sink (_tmp65_); - g_signal_connect (self->priv->info_bar, "response", (GCallback) _simple_scan_info_bar_response_cb_gtk_info_bar_response, self); - gtk_box_pack_start ((GtkBox*) self->priv->main_vbox, (GtkWidget*) self->priv->info_bar, FALSE, TRUE, (guint) 0); - _tmp66_ = (GtkHBox*) gtk_hbox_new (FALSE, 12); - hbox = g_object_ref_sink (_tmp66_); - _tmp67_ = gtk_info_bar_get_content_area (self->priv->info_bar); - _tmp68_ = _g_object_ref0 (GTK_CONTAINER (_tmp67_)); - content_area = _tmp68_; - gtk_container_add (content_area, (GtkWidget*) hbox); - gtk_widget_show ((GtkWidget*) hbox); - _tmp69_ = (GtkImage*) gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG); + self->priv->info_bar = _tmp100_; + _tmp101_ = self->priv->info_bar; + g_signal_connect (_tmp101_, "response", (GCallback) _simple_scan_info_bar_response_cb_gtk_info_bar_response, self); + _tmp102_ = self->priv->main_vbox; + _tmp103_ = self->priv->info_bar; + gtk_box_pack_start ((GtkBox*) _tmp102_, (GtkWidget*) _tmp103_, FALSE, TRUE, (guint) 0); + _tmp104_ = (GtkHBox*) gtk_hbox_new (FALSE, 12); + _tmp105_ = g_object_ref_sink (_tmp104_); + hbox = _tmp105_; + _tmp106_ = self->priv->info_bar; + _tmp107_ = gtk_info_bar_get_content_area (_tmp106_); + _tmp108_ = _g_object_ref0 (GTK_CONTAINER (_tmp107_)); + content_area = _tmp108_; + _tmp109_ = content_area; + _tmp110_ = hbox; + gtk_container_add (_tmp109_, (GtkWidget*) _tmp110_); + _tmp111_ = hbox; + gtk_widget_show ((GtkWidget*) _tmp111_); + _tmp112_ = (GtkImage*) gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG); + _tmp113_ = g_object_ref_sink (_tmp112_); _g_object_unref0 (self->priv->info_bar_image); - self->priv->info_bar_image = g_object_ref_sink (_tmp69_); - gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) self->priv->info_bar_image, FALSE, TRUE, (guint) 0); - gtk_widget_show ((GtkWidget*) self->priv->info_bar_image); - _tmp70_ = (GtkLabel*) gtk_label_new (NULL); + self->priv->info_bar_image = _tmp113_; + _tmp114_ = hbox; + _tmp115_ = self->priv->info_bar_image; + gtk_box_pack_start ((GtkBox*) _tmp114_, (GtkWidget*) _tmp115_, FALSE, TRUE, (guint) 0); + _tmp116_ = self->priv->info_bar_image; + gtk_widget_show ((GtkWidget*) _tmp116_); + _tmp117_ = (GtkLabel*) gtk_label_new (NULL); + _tmp118_ = g_object_ref_sink (_tmp117_); _g_object_unref0 (self->priv->info_bar_label); - self->priv->info_bar_label = g_object_ref_sink (_tmp70_); - gtk_misc_set_alignment ((GtkMisc*) self->priv->info_bar_label, 0.0f, 0.5f); - gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) self->priv->info_bar_label, TRUE, TRUE, (guint) 0); - gtk_widget_show ((GtkWidget*) self->priv->info_bar_label); - _tmp71_ = gtk_info_bar_add_button (self->priv->info_bar, GTK_STOCK_CLOSE, (gint) GTK_RESPONSE_CLOSE); - _tmp72_ = _g_object_ref0 (GTK_BUTTON (_tmp71_)); + self->priv->info_bar_label = _tmp118_; + _tmp119_ = self->priv->info_bar_label; + gtk_misc_set_alignment ((GtkMisc*) _tmp119_, 0.0f, 0.5f); + _tmp120_ = hbox; + _tmp121_ = self->priv->info_bar_label; + gtk_box_pack_start ((GtkBox*) _tmp120_, (GtkWidget*) _tmp121_, TRUE, TRUE, (guint) 0); + _tmp122_ = self->priv->info_bar_label; + gtk_widget_show ((GtkWidget*) _tmp122_); + _tmp123_ = self->priv->info_bar; + _tmp124_ = gtk_info_bar_add_button (_tmp123_, GTK_STOCK_CLOSE, (gint) GTK_RESPONSE_CLOSE); + _tmp125_ = _g_object_ref0 (GTK_BUTTON (_tmp124_)); _g_object_unref0 (self->priv->info_bar_close_button); - self->priv->info_bar_close_button = _tmp72_; - _tmp73_ = _ ("Change _Scanner"); - _tmp74_ = gtk_info_bar_add_button (self->priv->info_bar, _tmp73_, 1); - _tmp75_ = _g_object_ref0 (GTK_BUTTON (_tmp74_)); + self->priv->info_bar_close_button = _tmp125_; + _tmp126_ = self->priv->info_bar; + _tmp127_ = _ ("Change _Scanner"); + _tmp128_ = gtk_info_bar_add_button (_tmp126_, _tmp127_, 1); + _tmp129_ = _g_object_ref0 (GTK_BUTTON (_tmp128_)); _g_object_unref0 (self->priv->info_bar_change_scanner_button); - self->priv->info_bar_change_scanner_button = _tmp75_; - gtk_list_store_append (self->priv->paper_size_model, &_tmp76_); - iter = _tmp76_; - _tmp77_ = _ ("Automatic"); - gtk_list_store_set (self->priv->paper_size_model, &iter, 0, 0, 1, 0, 2, _tmp77_, -1, -1); - gtk_list_store_append (self->priv->paper_size_model, &_tmp78_); - iter = _tmp78_; - gtk_list_store_set (self->priv->paper_size_model, &iter, 0, 1050, 1, 1480, 2, "A6", -1, -1); - gtk_list_store_append (self->priv->paper_size_model, &_tmp79_); - iter = _tmp79_; - gtk_list_store_set (self->priv->paper_size_model, &iter, 0, 1480, 1, 2100, 2, "A5", -1, -1); - gtk_list_store_append (self->priv->paper_size_model, &_tmp80_); - iter = _tmp80_; - gtk_list_store_set (self->priv->paper_size_model, &iter, 0, 2100, 1, 2970, 2, "A4", -1, -1); - gtk_list_store_append (self->priv->paper_size_model, &_tmp81_); - iter = _tmp81_; - gtk_list_store_set (self->priv->paper_size_model, &iter, 0, 2159, 1, 2794, 2, "Letter", -1, -1); - gtk_list_store_append (self->priv->paper_size_model, &_tmp82_); - iter = _tmp82_; - gtk_list_store_set (self->priv->paper_size_model, &iter, 0, 2159, 1, 3556, 2, "Legal", -1, -1); - gtk_list_store_append (self->priv->paper_size_model, &_tmp83_); - iter = _tmp83_; - gtk_list_store_set (self->priv->paper_size_model, &iter, 0, 1016, 1, 1524, 2, "4×6", -1, -1); - _tmp84_ = g_settings_get_int (self->priv->settings, "text-dpi"); - dpi = _tmp84_; - if (dpi <= 0) { + self->priv->info_bar_change_scanner_button = _tmp129_; + _tmp130_ = self->priv->paper_size_model; + gtk_list_store_append (_tmp130_, &_tmp131_); + iter = _tmp131_; + _tmp132_ = self->priv->paper_size_model; + _tmp133_ = iter; + _tmp134_ = _ ("Automatic"); + gtk_list_store_set (_tmp132_, &_tmp133_, 0, 0, 1, 0, 2, _tmp134_, -1, -1); + _tmp135_ = self->priv->paper_size_model; + gtk_list_store_append (_tmp135_, &_tmp136_); + iter = _tmp136_; + _tmp137_ = self->priv->paper_size_model; + _tmp138_ = iter; + gtk_list_store_set (_tmp137_, &_tmp138_, 0, 1050, 1, 1480, 2, "A6", -1, -1); + _tmp139_ = self->priv->paper_size_model; + gtk_list_store_append (_tmp139_, &_tmp140_); + iter = _tmp140_; + _tmp141_ = self->priv->paper_size_model; + _tmp142_ = iter; + gtk_list_store_set (_tmp141_, &_tmp142_, 0, 1480, 1, 2100, 2, "A5", -1, -1); + _tmp143_ = self->priv->paper_size_model; + gtk_list_store_append (_tmp143_, &_tmp144_); + iter = _tmp144_; + _tmp145_ = self->priv->paper_size_model; + _tmp146_ = iter; + gtk_list_store_set (_tmp145_, &_tmp146_, 0, 2100, 1, 2970, 2, "A4", -1, -1); + _tmp147_ = self->priv->paper_size_model; + gtk_list_store_append (_tmp147_, &_tmp148_); + iter = _tmp148_; + _tmp149_ = self->priv->paper_size_model; + _tmp150_ = iter; + gtk_list_store_set (_tmp149_, &_tmp150_, 0, 2159, 1, 2794, 2, "Letter", -1, -1); + _tmp151_ = self->priv->paper_size_model; + gtk_list_store_append (_tmp151_, &_tmp152_); + iter = _tmp152_; + _tmp153_ = self->priv->paper_size_model; + _tmp154_ = iter; + gtk_list_store_set (_tmp153_, &_tmp154_, 0, 2159, 1, 3556, 2, "Legal", -1, -1); + _tmp155_ = self->priv->paper_size_model; + gtk_list_store_append (_tmp155_, &_tmp156_); + iter = _tmp156_; + _tmp157_ = self->priv->paper_size_model; + _tmp158_ = iter; + gtk_list_store_set (_tmp157_, &_tmp158_, 0, 1016, 1, 1524, 2, "4×6", -1, -1); + _tmp159_ = self->priv->settings; + _tmp160_ = g_settings_get_int (_tmp159_, "text-dpi"); + dpi = _tmp160_; + _tmp161_ = dpi; + if (_tmp161_ <= 0) { dpi = SIMPLE_SCAN_DEFAULT_TEXT_DPI; } - simple_scan_set_dpi_combo (self, self->priv->text_dpi_combo, SIMPLE_SCAN_DEFAULT_TEXT_DPI, dpi); - _tmp85_ = g_settings_get_int (self->priv->settings, "photo-dpi"); - dpi = _tmp85_; - if (dpi <= 0) { + _tmp162_ = self->priv->text_dpi_combo; + _tmp163_ = dpi; + simple_scan_set_dpi_combo (self, _tmp162_, SIMPLE_SCAN_DEFAULT_TEXT_DPI, _tmp163_); + _tmp164_ = self->priv->settings; + _tmp165_ = g_settings_get_int (_tmp164_, "photo-dpi"); + dpi = _tmp165_; + _tmp166_ = dpi; + if (_tmp166_ <= 0) { dpi = SIMPLE_SCAN_DEFAULT_PHOTO_DPI; } - simple_scan_set_dpi_combo (self, self->priv->photo_dpi_combo, SIMPLE_SCAN_DEFAULT_PHOTO_DPI, dpi); - _tmp86_ = (GtkCellRendererText*) gtk_cell_renderer_text_new (); - renderer = g_object_ref_sink (_tmp86_); - gtk_cell_layout_pack_start ((GtkCellLayout*) self->priv->device_combo, (GtkCellRenderer*) renderer, TRUE); - gtk_cell_layout_add_attribute ((GtkCellLayout*) self->priv->device_combo, (GtkCellRenderer*) renderer, "text", 1); - _tmp87_ = (GtkCellRendererText*) gtk_cell_renderer_text_new (); + _tmp167_ = self->priv->photo_dpi_combo; + _tmp168_ = dpi; + simple_scan_set_dpi_combo (self, _tmp167_, SIMPLE_SCAN_DEFAULT_PHOTO_DPI, _tmp168_); + _tmp169_ = (GtkCellRendererText*) gtk_cell_renderer_text_new (); + _tmp170_ = g_object_ref_sink (_tmp169_); + renderer = _tmp170_; + _tmp171_ = self->priv->device_combo; + _tmp172_ = renderer; + gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp171_, (GtkCellRenderer*) _tmp172_, TRUE); + _tmp173_ = self->priv->device_combo; + _tmp174_ = renderer; + gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp173_, (GtkCellRenderer*) _tmp174_, "text", 1); + _tmp175_ = (GtkCellRendererText*) gtk_cell_renderer_text_new (); + _tmp176_ = g_object_ref_sink (_tmp175_); _g_object_unref0 (renderer); - renderer = g_object_ref_sink (_tmp87_); - gtk_cell_layout_pack_start ((GtkCellLayout*) self->priv->page_side_combo, (GtkCellRenderer*) renderer, TRUE); - gtk_cell_layout_add_attribute ((GtkCellLayout*) self->priv->page_side_combo, (GtkCellRenderer*) renderer, "text", 1); - _tmp88_ = g_settings_get_enum (self->priv->settings, "page-side"); - simple_scan_set_page_side (self, (ScanType) _tmp88_); - _tmp89_ = (GtkCellRendererText*) gtk_cell_renderer_text_new (); + renderer = _tmp176_; + _tmp177_ = self->priv->page_side_combo; + _tmp178_ = renderer; + gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp177_, (GtkCellRenderer*) _tmp178_, TRUE); + _tmp179_ = self->priv->page_side_combo; + _tmp180_ = renderer; + gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp179_, (GtkCellRenderer*) _tmp180_, "text", 1); + _tmp181_ = self->priv->settings; + _tmp182_ = g_settings_get_enum (_tmp181_, "page-side"); + simple_scan_set_page_side (self, (ScanType) _tmp182_); + _tmp183_ = (GtkCellRendererText*) gtk_cell_renderer_text_new (); + _tmp184_ = g_object_ref_sink (_tmp183_); _g_object_unref0 (renderer); - renderer = g_object_ref_sink (_tmp89_); - gtk_cell_layout_pack_start ((GtkCellLayout*) self->priv->paper_size_combo, (GtkCellRenderer*) renderer, TRUE); - gtk_cell_layout_add_attribute ((GtkCellLayout*) self->priv->paper_size_combo, (GtkCellRenderer*) renderer, "text", 2); - _tmp90_ = g_settings_get_int (self->priv->settings, "paper-width"); - paper_width = _tmp90_; - _tmp91_ = g_settings_get_int (self->priv->settings, "paper-height"); - paper_height = _tmp91_; - simple_scan_set_paper_size (self, paper_width, paper_height); - _tmp92_ = g_settings_get_string (self->priv->settings, "selected-device"); - device = _tmp92_; - if (device != NULL) { - GtkTreeIter _tmp93_ = {0}; - gboolean _tmp94_; - _tmp94_ = simple_scan_find_scan_device (self, device, &_tmp93_); - iter = _tmp93_; - if (_tmp94_) { - gtk_combo_box_set_active_iter (self->priv->device_combo, &iter); + renderer = _tmp184_; + _tmp185_ = self->priv->paper_size_combo; + _tmp186_ = renderer; + gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp185_, (GtkCellRenderer*) _tmp186_, TRUE); + _tmp187_ = self->priv->paper_size_combo; + _tmp188_ = renderer; + gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp187_, (GtkCellRenderer*) _tmp188_, "text", 2); + _tmp189_ = self->priv->settings; + _tmp190_ = g_settings_get_int (_tmp189_, "paper-width"); + paper_width = _tmp190_; + _tmp191_ = self->priv->settings; + _tmp192_ = g_settings_get_int (_tmp191_, "paper-height"); + paper_height = _tmp192_; + _tmp193_ = paper_width; + _tmp194_ = paper_height; + simple_scan_set_paper_size (self, _tmp193_, _tmp194_); + _tmp195_ = self->priv->settings; + _tmp196_ = g_settings_get_string (_tmp195_, "selected-device"); + device = _tmp196_; + _tmp197_ = device; + if (_tmp197_ != NULL) { + const gchar* _tmp198_; + GtkTreeIter _tmp199_ = {0}; + gboolean _tmp200_ = FALSE; + _tmp198_ = device; + _tmp200_ = simple_scan_find_scan_device (self, _tmp198_, &_tmp199_); + iter = _tmp199_; + if (_tmp200_) { + GtkComboBox* _tmp201_; + GtkTreeIter _tmp202_; + _tmp201_ = self->priv->device_combo; + _tmp202_ = iter; + gtk_combo_box_set_active_iter (_tmp201_, &_tmp202_); } } - _tmp95_ = g_settings_get_string (self->priv->settings, "document-type"); - document_type = _tmp95_; - if (document_type != NULL) { - simple_scan_set_document_hint (self, document_type); + _tmp203_ = self->priv->settings; + _tmp204_ = g_settings_get_string (_tmp203_, "document-type"); + document_type = _tmp204_; + _tmp205_ = document_type; + if (_tmp205_ != NULL) { + const gchar* _tmp206_; + _tmp206_ = document_type; + simple_scan_set_document_hint (self, _tmp206_); } - _tmp96_ = book_view_new (self->priv->book); + _tmp207_ = self->priv->book; + _tmp208_ = book_view_new (_tmp207_); + _tmp209_ = g_object_ref_sink (_tmp208_); _g_object_unref0 (self->priv->book_view); - self->priv->book_view = g_object_ref_sink (_tmp96_); - gtk_container_set_border_width ((GtkContainer*) self->priv->book_view, (guint) 18); - gtk_box_pack_end ((GtkBox*) self->priv->main_vbox, (GtkWidget*) self->priv->book_view, TRUE, TRUE, (guint) 0); - g_signal_connect (self->priv->book_view, "page-selected", (GCallback) _simple_scan_page_selected_cb_book_view_page_selected, self); - g_signal_connect (self->priv->book_view, "show-page", (GCallback) _simple_scan_show_page_cb_book_view_show_page, self); - g_signal_connect (self->priv->book_view, "show-menu", (GCallback) _simple_scan_show_page_menu_cb_book_view_show_menu, self); - gtk_widget_show ((GtkWidget*) self->priv->book_view); - _tmp97_ = g_settings_get_enum (self->priv->settings, "scan-direction"); - self->priv->default_page_scan_direction = (ScanDirection) _tmp97_; - _tmp98_ = g_settings_get_int (self->priv->settings, "page-width"); - self->priv->default_page_width = _tmp98_; - if (self->priv->default_page_width <= 0) { + self->priv->book_view = _tmp209_; + _tmp210_ = self->priv->book_view; + gtk_container_set_border_width ((GtkContainer*) _tmp210_, (guint) 18); + _tmp211_ = self->priv->main_vbox; + _tmp212_ = self->priv->book_view; + gtk_box_pack_end ((GtkBox*) _tmp211_, (GtkWidget*) _tmp212_, TRUE, TRUE, (guint) 0); + _tmp213_ = self->priv->book_view; + g_signal_connect (_tmp213_, "page-selected", (GCallback) _simple_scan_page_selected_cb_book_view_page_selected, self); + _tmp214_ = self->priv->book_view; + g_signal_connect (_tmp214_, "show-page", (GCallback) _simple_scan_show_page_cb_book_view_show_page, self); + _tmp215_ = self->priv->book_view; + g_signal_connect (_tmp215_, "show-menu", (GCallback) _simple_scan_show_page_menu_cb_book_view_show_menu, self); + _tmp216_ = self->priv->book_view; + gtk_widget_show ((GtkWidget*) _tmp216_); + _tmp217_ = self->priv->settings; + _tmp218_ = g_settings_get_enum (_tmp217_, "scan-direction"); + self->priv->default_page_scan_direction = (ScanDirection) _tmp218_; + _tmp219_ = self->priv->settings; + _tmp220_ = g_settings_get_int (_tmp219_, "page-width"); + self->priv->default_page_width = _tmp220_; + _tmp221_ = self->priv->default_page_width; + if (_tmp221_ <= 0) { self->priv->default_page_width = 595; } - _tmp99_ = g_settings_get_int (self->priv->settings, "page-height"); - self->priv->default_page_height = _tmp99_; - if (self->priv->default_page_height <= 0) { + _tmp222_ = self->priv->settings; + _tmp223_ = g_settings_get_int (_tmp222_, "page-height"); + self->priv->default_page_height = _tmp223_; + _tmp224_ = self->priv->default_page_height; + if (_tmp224_ <= 0) { self->priv->default_page_height = 842; } - _tmp100_ = g_settings_get_int (self->priv->settings, "page-dpi"); - self->priv->default_page_dpi = _tmp100_; - if (self->priv->default_page_dpi <= 0) { + _tmp225_ = self->priv->settings; + _tmp226_ = g_settings_get_int (_tmp225_, "page-dpi"); + self->priv->default_page_dpi = _tmp226_; + _tmp227_ = self->priv->default_page_dpi; + if (_tmp227_ <= 0) { self->priv->default_page_dpi = 72; } - _tmp101_ = g_settings_get_int (self->priv->settings, "window-width"); - self->priv->window_width = _tmp101_; - if (self->priv->window_width <= 0) { + _tmp228_ = self->priv->settings; + _tmp229_ = g_settings_get_int (_tmp228_, "window-width"); + self->priv->window_width = _tmp229_; + _tmp230_ = self->priv->window_width; + if (_tmp230_ <= 0) { self->priv->window_width = 600; } - _tmp102_ = g_settings_get_int (self->priv->settings, "window-height"); - self->priv->window_height = _tmp102_; - if (self->priv->window_height <= 0) { + _tmp231_ = self->priv->settings; + _tmp232_ = g_settings_get_int (_tmp231_, "window-height"); + self->priv->window_height = _tmp232_; + _tmp233_ = self->priv->window_height; + if (_tmp233_ <= 0) { self->priv->window_height = 400; } - g_debug ("ui.vala:1407: Restoring window to %dx%d pixels", self->priv->window_width, self->priv->window_height); - gtk_window_set_default_size (self->priv->window, self->priv->window_width, self->priv->window_height); - _tmp103_ = g_settings_get_boolean (self->priv->settings, "window-is-maximized"); - self->priv->window_is_maximized = _tmp103_; - if (self->priv->window_is_maximized) { + _tmp234_ = self->priv->window_width; + _tmp235_ = self->priv->window_height; + g_debug ("ui.vala:1407: Restoring window to %dx%d pixels", _tmp234_, _tmp235_); + _tmp236_ = self->priv->window; + _tmp237_ = self->priv->window_width; + _tmp238_ = self->priv->window_height; + gtk_window_set_default_size (_tmp236_, _tmp237_, _tmp238_); + _tmp239_ = self->priv->settings; + _tmp240_ = g_settings_get_boolean (_tmp239_, "window-is-maximized"); + self->priv->window_is_maximized = _tmp240_; + _tmp241_ = self->priv->window_is_maximized; + if (_tmp241_) { + GtkWindow* _tmp242_; g_debug ("ui.vala:1412: Restoring window to maximized"); - gtk_window_maximize (self->priv->window); + _tmp242_ = self->priv->window; + gtk_window_maximize (_tmp242_); } - _tmp104_ = book_get_n_pages (self->priv->book); - if (_tmp104_ == ((guint) 0)) { + _tmp243_ = self->priv->book; + _tmp244_ = book_get_n_pages (_tmp243_); + if (_tmp244_ == ((guint) 0)) { simple_scan_add_default_page (self); } - book_set_needs_saving (self->priv->book, FALSE); - g_signal_connect (self->priv->book, "needs-saving-changed", (GCallback) _simple_scan_needs_saving_cb_book_needs_saving_changed, self); + _tmp245_ = self->priv->book; + book_set_needs_saving (_tmp245_, FALSE); + _tmp246_ = self->priv->book; + g_signal_connect (_tmp246_, "needs-saving-changed", (GCallback) _simple_scan_needs_saving_cb_book_needs_saving_changed, self); _g_free0 (document_type); _g_free0 (device); _g_object_unref0 (renderer); @@ -3136,60 +4460,90 @@ static gpointer _book_ref0 (gpointer self) { Book* simple_scan_get_book (SimpleScan* self) { Book* result = NULL; Book* _tmp0_; + Book* _tmp1_; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = _book_ref0 (self->priv->book); - result = _tmp0_; + _tmp0_ = self->priv->book; + _tmp1_ = _book_ref0 (_tmp0_); + result = _tmp1_; return result; } void simple_scan_set_selected_page (SimpleScan* self, Page* page) { + BookView* _tmp0_; + Page* _tmp1_; g_return_if_fail (self != NULL); g_return_if_fail (page != NULL); - book_view_select_page (self->priv->book_view, page); + _tmp0_ = self->priv->book_view; + _tmp1_ = page; + book_view_select_page (_tmp0_, _tmp1_); } Page* simple_scan_get_selected_page (SimpleScan* self) { Page* result = NULL; - Page* _tmp0_ = NULL; + BookView* _tmp0_; + Page* _tmp1_ = NULL; g_return_val_if_fail (self != NULL, NULL); - _tmp0_ = book_view_get_selected (self->priv->book_view); - result = _tmp0_; + _tmp0_ = self->priv->book_view; + _tmp1_ = book_view_get_selected (_tmp0_); + result = _tmp1_; return result; } void simple_scan_set_scanning (SimpleScan* self, gboolean scanning) { + gboolean _tmp0_; + GtkMenuItem* _tmp1_; + gboolean _tmp2_; + GtkMenuItem* _tmp3_; + gboolean _tmp4_; + GtkToolButton* _tmp5_; + gboolean _tmp6_; g_return_if_fail (self != NULL); - self->priv->scanning = scanning; - gtk_widget_set_sensitive ((GtkWidget*) self->priv->page_delete_menuitem, !scanning); - gtk_widget_set_sensitive ((GtkWidget*) self->priv->stop_menuitem, scanning); - gtk_widget_set_sensitive ((GtkWidget*) self->priv->stop_toolbutton, scanning); + _tmp0_ = scanning; + self->priv->scanning = _tmp0_; + _tmp1_ = self->priv->page_delete_menuitem; + _tmp2_ = scanning; + gtk_widget_set_sensitive ((GtkWidget*) _tmp1_, !_tmp2_); + _tmp3_ = self->priv->stop_menuitem; + _tmp4_ = scanning; + gtk_widget_set_sensitive ((GtkWidget*) _tmp3_, _tmp4_); + _tmp5_ = self->priv->stop_toolbutton; + _tmp6_ = scanning; + gtk_widget_set_sensitive ((GtkWidget*) _tmp5_, _tmp6_); } void simple_scan_show_error (SimpleScan* self, const gchar* error_title, const gchar* error_text, gboolean change_scanner_hint) { - gchar* _tmp0_; + const gchar* _tmp0_; gchar* _tmp1_; + const gchar* _tmp2_; + gchar* _tmp3_; + gboolean _tmp4_; g_return_if_fail (self != NULL); g_return_if_fail (error_title != NULL); g_return_if_fail (error_text != NULL); self->priv->have_error = TRUE; - _tmp0_ = g_strdup (error_title); + _tmp0_ = error_title; + _tmp1_ = g_strdup (_tmp0_); _g_free0 (self->priv->error_title); - self->priv->error_title = _tmp0_; - _tmp1_ = g_strdup (error_text); + self->priv->error_title = _tmp1_; + _tmp2_ = error_text; + _tmp3_ = g_strdup (_tmp2_); _g_free0 (self->priv->error_text); - self->priv->error_text = _tmp1_; - self->priv->error_change_scanner_hint = change_scanner_hint; + self->priv->error_text = _tmp3_; + _tmp4_ = change_scanner_hint; + self->priv->error_change_scanner_hint = _tmp4_; simple_scan_update_info_bar (self); } void simple_scan_start (SimpleScan* self) { + GtkWindow* _tmp0_; g_return_if_fail (self != NULL); - gtk_widget_show ((GtkWidget*) self->priv->window); + _tmp0_ = self->priv->window; + gtk_widget_show ((GtkWidget*) _tmp0_); } -- cgit v1.2.3