summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlessio Treglia <alessio@debian.org>2013-01-15 00:46:37 +0000
committerAlessio Treglia <alessio@debian.org>2013-01-15 00:46:37 +0000
commit8f1bef0c8abe53da0001b0d4df1f5439fecd9c3b (patch)
tree67137e06f48cbe06c0bf16052ea446edf63eb7a0 /src
parentd723aded8c1b91731f391754358750e9119d6689 (diff)
parentb99db4e5834bb8668c249bb7ce30af9a4d23527e (diff)
Merge tag 'upstream/3.6.0'
Upstream version 3.6.0
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.in2
-rw-r--r--src/book-view.c235
-rw-r--r--src/book-view.vala27
-rw-r--r--src/book.c112
-rw-r--r--src/book.vala23
-rw-r--r--src/page-view.c43
-rw-r--r--src/page-view.vala11
-rw-r--r--src/page.c10
-rw-r--r--src/page.vala8
-rw-r--r--src/scanner.c631
-rw-r--r--src/scanner.vala41
-rw-r--r--src/simple-scan.c202
-rw-r--r--src/simple-scan.vala75
-rw-r--r--src/ui.c1990
-rw-r--r--src/ui.vala105
15 files changed, 1663 insertions, 1852 deletions
diff --git a/src/Makefile.in b/src/Makefile.in
index 4e60a15..2ec6077 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.5 from Makefile.am.
+# Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/src/book-view.c b/src/book-view.c
index f418d37..53e2ad8 100644
--- a/src/book-view.c
+++ b/src/book-view.c
@@ -1,4 +1,4 @@
-/* book-view.c generated by valac 0.16.1, the Vala compiler
+/* book-view.c generated by valac 0.17.7, the Vala compiler
* generated from book-view.vala, do not modify */
/*
@@ -120,12 +120,7 @@ GType page_view_get_type (void) G_GNUC_CONST;
enum {
BOOK_VIEW_DUMMY_PROPERTY
};
-BookView* book_view_new (Book* book);
-BookView* book_view_construct (GType object_type, Book* book);
-guint book_get_n_pages (Book* self);
-Page* book_get_page (Book* self, gint page_number);
static void book_view_add_cb (BookView* self, Book* book, Page* page);
-void book_view_select_page (BookView* self, Page* page);
static void _book_view_add_cb_book_page_added (Book* _sender, Page* page, gpointer self);
static void book_view_remove_cb (BookView* self, Book* book, Page* page);
static void _book_view_remove_cb_book_page_removed (Book* _sender, Page* page, gpointer self);
@@ -133,8 +128,6 @@ static void book_view_reorder_cb (BookView* self, Book* book);
static void _book_view_reorder_cb_book_reordered (Book* _sender, gpointer self);
static void book_view_clear_cb (BookView* self, Book* book);
static void _book_view_clear_cb_book_cleared (Book* _sender, gpointer self);
-static void _page_unref0_ (gpointer var);
-static void _page_view_unref0_ (gpointer var);
static gboolean book_view_configure_cb (BookView* self, GtkWidget* widget, GdkEventConfigure* event);
static gboolean _book_view_configure_cb_gtk_widget_configure_event (GtkWidget* _sender, GdkEventConfigure* event, gpointer self);
static gboolean book_view_draw_cb (BookView* self, GtkWidget* widget, cairo_t* context);
@@ -151,6 +144,13 @@ static gboolean _book_view_focus_cb_gtk_widget_focus_in_event (GtkWidget* _sende
static gboolean _book_view_focus_cb_gtk_widget_focus_out_event (GtkWidget* _sender, GdkEventFocus* event, gpointer self);
static void book_view_scroll_cb (BookView* self, GtkAdjustment* adjustment);
static void _book_view_scroll_cb_gtk_adjustment_value_changed (GtkAdjustment* _sender, gpointer self);
+BookView* book_view_new (Book* book);
+BookView* book_view_construct (GType object_type, Book* book);
+guint book_get_n_pages (Book* self);
+Page* book_get_page (Book* self, gint page_number);
+void book_view_select_page (BookView* self, Page* page);
+static void _page_unref0_ (gpointer var);
+static void _page_view_unref0_ (gpointer var);
static PageView* book_view_get_nth_page (BookView* self, gint n);
static PageView* book_view_get_next_page (BookView* self, PageView* page);
Page* page_view_get_page (PageView* self);
@@ -193,16 +193,10 @@ void page_view_motion (PageView* self, gint x, gint y);
GdkCursorType page_view_get_cursor (PageView* self);
void book_view_select_next_page (BookView* self);
void book_view_select_prev_page (BookView* self);
-GtkWidget* book_view_get_event_source (BookView* self);
static void g_cclosure_user_marshal_VOID__PAGE (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
static void book_view_finalize (GObject* obj);
-static gpointer _book_ref0 (gpointer self) {
- return self ? book_ref (self) : NULL;
-}
-
-
static void _book_view_add_cb_book_page_added (Book* _sender, Page* page, gpointer self) {
book_view_add_cb (self, _sender, page);
}
@@ -223,21 +217,6 @@ static void _book_view_clear_cb_book_cleared (Book* _sender, gpointer self) {
}
-static void _page_unref0_ (gpointer var) {
- (var == NULL) ? NULL : (var = (page_unref (var), NULL));
-}
-
-
-static void _page_view_unref0_ (gpointer var) {
- (var == NULL) ? NULL : (var = (page_view_unref (var), NULL));
-}
-
-
-static gpointer _g_object_ref0 (gpointer self) {
- return self ? g_object_ref (self) : NULL;
-}
-
-
static gboolean _book_view_configure_cb_gtk_widget_configure_event (GtkWidget* _sender, GdkEventConfigure* event, gpointer self) {
gboolean result;
result = book_view_configure_cb (self, _sender, event);
@@ -299,6 +278,26 @@ static void _book_view_scroll_cb_gtk_adjustment_value_changed (GtkAdjustment* _s
}
+static gpointer _book_ref0 (gpointer self) {
+ return self ? book_ref (self) : NULL;
+}
+
+
+static void _page_unref0_ (gpointer var) {
+ (var == NULL) ? NULL : (var = (page_unref (var), NULL));
+}
+
+
+static void _page_view_unref0_ (gpointer var) {
+ (var == NULL) ? NULL : (var = (page_view_unref (var), NULL));
+}
+
+
+static gpointer _g_object_ref0 (gpointer self) {
+ return self ? g_object_ref (self) : NULL;
+}
+
+
BookView* book_view_construct (GType object_type, Book* book) {
BookView * self = NULL;
Book* _tmp0_;
@@ -318,23 +317,21 @@ BookView* book_view_construct (GType object_type, Book* book) {
GtkWidget* _tmp25_;
GtkWidget* _tmp26_;
GtkWidget* _tmp27_;
- GtkWidget* _tmp28_;
+ GtkScrollbar* _tmp28_;
GtkScrollbar* _tmp29_;
- GtkScrollbar* _tmp30_;
- GtkScrollbar* _tmp31_;
- GtkAdjustment* _tmp32_ = NULL;
- GtkAdjustment* _tmp33_;
- GtkScrollbar* _tmp34_;
+ GtkAdjustment* _tmp30_ = NULL;
+ GtkAdjustment* _tmp31_;
+ GtkScrollbar* _tmp32_;
+ GtkWidget* _tmp33_;
+ GtkWidget* _tmp34_;
GtkWidget* _tmp35_;
GtkWidget* _tmp36_;
GtkWidget* _tmp37_;
GtkWidget* _tmp38_;
GtkWidget* _tmp39_;
GtkWidget* _tmp40_;
- GtkWidget* _tmp41_;
+ GtkAdjustment* _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;
@@ -403,48 +400,48 @@ BookView* book_view_construct (GType object_type, Book* book) {
self->priv->page_data = _tmp22_;
self->priv->cursor = GDK_ARROW;
_tmp23_ = (GtkDrawingArea*) gtk_drawing_area_new ();
- _tmp24_ = (GtkWidget*) g_object_ref_sink (_tmp23_);
+ g_object_ref_sink (_tmp23_);
_g_object_unref0 (self->priv->drawing_area);
- self->priv->drawing_area = _tmp24_;
+ self->priv->drawing_area = (GtkWidget*) _tmp23_;
+ _tmp24_ = self->priv->drawing_area;
+ gtk_widget_set_size_request (_tmp24_, 200, 100);
_tmp25_ = self->priv->drawing_area;
- gtk_widget_set_size_request (_tmp25_, 200, 100);
+ gtk_widget_set_can_focus (_tmp25_, TRUE);
_tmp26_ = self->priv->drawing_area;
- gtk_widget_set_can_focus (_tmp26_, TRUE);
+ gtk_widget_set_events (_tmp26_, (gint) (((((GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK) | GDK_BUTTON_RELEASE_MASK) | GDK_FOCUS_CHANGE_MASK) | GDK_STRUCTURE_MASK) | GDK_SCROLL_MASK));
_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_ = (GtkScrollbar*) gtk_scrollbar_new (GTK_ORIENTATION_HORIZONTAL, NULL);
- _tmp30_ = g_object_ref_sink (_tmp29_);
+ gtk_box_pack_start ((GtkBox*) self, _tmp27_, TRUE, TRUE, (guint) 0);
+ _tmp28_ = (GtkScrollbar*) gtk_scrollbar_new (GTK_ORIENTATION_HORIZONTAL, NULL);
+ g_object_ref_sink (_tmp28_);
_g_object_unref0 (self->priv->scroll);
- self->priv->scroll = _tmp30_;
- _tmp31_ = self->priv->scroll;
- _tmp32_ = gtk_range_get_adjustment ((GtkRange*) _tmp31_);
- _tmp33_ = _g_object_ref0 (_tmp32_);
+ self->priv->scroll = _tmp28_;
+ _tmp29_ = self->priv->scroll;
+ _tmp30_ = gtk_range_get_adjustment ((GtkRange*) _tmp29_);
+ _tmp31_ = _g_object_ref0 (_tmp30_);
_g_object_unref0 (self->priv->adjustment);
- self->priv->adjustment = _tmp33_;
- _tmp34_ = self->priv->scroll;
- gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) _tmp34_, FALSE, TRUE, (guint) 0);
+ self->priv->adjustment = _tmp31_;
+ _tmp32_ = self->priv->scroll;
+ gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) _tmp32_, FALSE, TRUE, (guint) 0);
+ _tmp33_ = self->priv->drawing_area;
+ g_signal_connect_object (_tmp33_, "configure-event", (GCallback) _book_view_configure_cb_gtk_widget_configure_event, self, 0);
+ _tmp34_ = self->priv->drawing_area;
+ g_signal_connect_object (_tmp34_, "draw", (GCallback) _book_view_draw_cb_gtk_widget_draw, self, 0);
_tmp35_ = self->priv->drawing_area;
- g_signal_connect_object (_tmp35_, "configure-event", (GCallback) _book_view_configure_cb_gtk_widget_configure_event, self, 0);
+ g_signal_connect_object (_tmp35_, "motion-notify-event", (GCallback) _book_view_motion_cb_gtk_widget_motion_notify_event, self, 0);
_tmp36_ = self->priv->drawing_area;
- g_signal_connect_object (_tmp36_, "draw", (GCallback) _book_view_draw_cb_gtk_widget_draw, self, 0);
+ g_signal_connect_object (_tmp36_, "key-press-event", (GCallback) _book_view_key_cb_gtk_widget_key_press_event, 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);
+ g_signal_connect_object (_tmp37_, "button-press-event", (GCallback) _book_view_button_cb_gtk_widget_button_press_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);
+ g_signal_connect_object (_tmp38_, "button-release-event", (GCallback) _book_view_button_cb_gtk_widget_button_release_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);
+ g_signal_connect_object (_tmp39_, "focus-in-event", (GCallback) _book_view_focus_cb_gtk_widget_focus_in_event, self, G_CONNECT_AFTER);
_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);
+ g_signal_connect_object (_tmp40_, "focus-out-event", (GCallback) _book_view_focus_cb_gtk_widget_focus_out_event, self, G_CONNECT_AFTER);
+ _tmp41_ = self->priv->adjustment;
+ g_signal_connect_object (_tmp41_, "value-changed", (GCallback) _book_view_scroll_cb_gtk_adjustment_value_changed, self, 0);
_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_);
+ gtk_widget_show (_tmp42_);
return self;
}
@@ -894,7 +891,14 @@ static void book_view_remove_cb (BookView* self, Book* book, Page* page) {
gboolean _tmp5_;
GHashTable* _tmp12_;
Page* _tmp13_;
- PageView* _tmp14_;
+ gconstpointer _tmp14_ = NULL;
+ PageView* _tmp15_;
+ PageView* page_view;
+ guint _tmp16_ = 0U;
+ guint _tmp17_ = 0U;
+ GHashTable* _tmp18_;
+ Page* _tmp19_;
+ PageView* _tmp20_;
g_return_if_fail (self != NULL);
g_return_if_fail (book != NULL);
g_return_if_fail (page != NULL);
@@ -930,11 +934,21 @@ static void book_view_remove_cb (BookView* self, Book* book, Page* page) {
}
_tmp12_ = self->priv->page_data;
_tmp13_ = page;
- g_hash_table_remove (_tmp12_, _tmp13_);
- _tmp14_ = new_selection;
- book_view_select_page_view (self, _tmp14_);
+ _tmp14_ = g_hash_table_lookup (_tmp12_, _tmp13_);
+ _tmp15_ = _page_view_ref0 ((PageView*) _tmp14_);
+ page_view = _tmp15_;
+ g_signal_parse_name ("changed", TYPE_PAGE_VIEW, &_tmp16_, NULL, FALSE);
+ g_signal_handlers_disconnect_matched (page_view, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp16_, 0, NULL, (GCallback) _book_view_page_view_changed_cb_page_view_changed, self);
+ g_signal_parse_name ("size-changed", TYPE_PAGE_VIEW, &_tmp17_, NULL, FALSE);
+ g_signal_handlers_disconnect_matched (page_view, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp17_, 0, NULL, (GCallback) _book_view_page_view_size_changed_cb_page_view_size_changed, self);
+ _tmp18_ = self->priv->page_data;
+ _tmp19_ = page;
+ g_hash_table_remove (_tmp18_, _tmp19_);
+ _tmp20_ = new_selection;
+ book_view_select_page_view (self, _tmp20_);
self->priv->need_layout = TRUE;
book_view_redraw (self);
+ _page_view_unref0 (page_view);
_page_view_unref0 (new_selection);
}
@@ -2216,18 +2230,6 @@ Page* book_view_get_selected (BookView* self) {
}
-GtkWidget* book_view_get_event_source (BookView* self) {
- GtkWidget* result = NULL;
- GtkWidget* _tmp0_;
- GtkWidget* _tmp1_;
- g_return_val_if_fail (self != NULL, NULL);
- _tmp0_ = self->priv->drawing_area;
- _tmp1_ = _g_object_ref0 (_tmp0_);
- result = _tmp1_;
- return result;
-}
-
-
static void g_cclosure_user_marshal_VOID__PAGE (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
typedef void (*GMarshalFunc_VOID__PAGE) (gpointer data1, gpointer arg_1, gpointer data2);
register GMarshalFunc_VOID__PAGE callback;
@@ -2266,7 +2268,72 @@ static void book_view_instance_init (BookView * self) {
static void book_view_finalize (GObject* obj) {
BookView * self;
- self = BOOK_VIEW (obj);
+ Book* _tmp0_;
+ guint _tmp1_ = 0U;
+ Book* _tmp2_;
+ guint _tmp3_ = 0U;
+ Book* _tmp4_;
+ guint _tmp5_ = 0U;
+ Book* _tmp6_;
+ guint _tmp7_ = 0U;
+ GtkWidget* _tmp8_;
+ guint _tmp9_ = 0U;
+ GtkWidget* _tmp10_;
+ guint _tmp11_ = 0U;
+ GtkWidget* _tmp12_;
+ guint _tmp13_ = 0U;
+ GtkWidget* _tmp14_;
+ guint _tmp15_ = 0U;
+ GtkWidget* _tmp16_;
+ guint _tmp17_ = 0U;
+ GtkWidget* _tmp18_;
+ guint _tmp19_ = 0U;
+ GtkWidget* _tmp20_;
+ guint _tmp21_ = 0U;
+ GtkWidget* _tmp22_;
+ guint _tmp23_ = 0U;
+ GtkAdjustment* _tmp24_;
+ guint _tmp25_ = 0U;
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_BOOK_VIEW, BookView);
+ _tmp0_ = self->priv->book;
+ g_signal_parse_name ("page-added", TYPE_BOOK, &_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_view_add_cb_book_page_added, self);
+ _tmp2_ = self->priv->book;
+ g_signal_parse_name ("page-removed", TYPE_BOOK, &_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_view_remove_cb_book_page_removed, self);
+ _tmp4_ = self->priv->book;
+ g_signal_parse_name ("reordered", TYPE_BOOK, &_tmp5_, NULL, FALSE);
+ g_signal_handlers_disconnect_matched (_tmp4_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp5_, 0, NULL, (GCallback) _book_view_reorder_cb_book_reordered, self);
+ _tmp6_ = self->priv->book;
+ g_signal_parse_name ("cleared", TYPE_BOOK, &_tmp7_, NULL, FALSE);
+ g_signal_handlers_disconnect_matched (_tmp6_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp7_, 0, NULL, (GCallback) _book_view_clear_cb_book_cleared, self);
+ _tmp8_ = self->priv->drawing_area;
+ g_signal_parse_name ("configure-event", GTK_TYPE_WIDGET, &_tmp9_, NULL, FALSE);
+ g_signal_handlers_disconnect_matched (_tmp8_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp9_, 0, NULL, (GCallback) _book_view_configure_cb_gtk_widget_configure_event, self);
+ _tmp10_ = self->priv->drawing_area;
+ g_signal_parse_name ("draw", GTK_TYPE_WIDGET, &_tmp11_, NULL, FALSE);
+ g_signal_handlers_disconnect_matched (_tmp10_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp11_, 0, NULL, (GCallback) _book_view_draw_cb_gtk_widget_draw, self);
+ _tmp12_ = self->priv->drawing_area;
+ g_signal_parse_name ("motion-notify-event", GTK_TYPE_WIDGET, &_tmp13_, NULL, FALSE);
+ g_signal_handlers_disconnect_matched (_tmp12_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp13_, 0, NULL, (GCallback) _book_view_motion_cb_gtk_widget_motion_notify_event, self);
+ _tmp14_ = self->priv->drawing_area;
+ g_signal_parse_name ("key-press-event", GTK_TYPE_WIDGET, &_tmp15_, NULL, FALSE);
+ g_signal_handlers_disconnect_matched (_tmp14_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp15_, 0, NULL, (GCallback) _book_view_key_cb_gtk_widget_key_press_event, self);
+ _tmp16_ = self->priv->drawing_area;
+ g_signal_parse_name ("button-press-event", GTK_TYPE_WIDGET, &_tmp17_, NULL, FALSE);
+ g_signal_handlers_disconnect_matched (_tmp16_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp17_, 0, NULL, (GCallback) _book_view_button_cb_gtk_widget_button_press_event, self);
+ _tmp18_ = self->priv->drawing_area;
+ g_signal_parse_name ("button-release-event", GTK_TYPE_WIDGET, &_tmp19_, NULL, FALSE);
+ g_signal_handlers_disconnect_matched (_tmp18_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp19_, 0, NULL, (GCallback) _book_view_button_cb_gtk_widget_button_release_event, self);
+ _tmp20_ = self->priv->drawing_area;
+ g_signal_parse_name ("focus-in-event", GTK_TYPE_WIDGET, &_tmp21_, NULL, FALSE);
+ g_signal_handlers_disconnect_matched (_tmp20_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp21_, 0, NULL, (GCallback) _book_view_focus_cb_gtk_widget_focus_in_event, self);
+ _tmp22_ = self->priv->drawing_area;
+ g_signal_parse_name ("focus-out-event", GTK_TYPE_WIDGET, &_tmp23_, NULL, FALSE);
+ g_signal_handlers_disconnect_matched (_tmp22_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp23_, 0, NULL, (GCallback) _book_view_focus_cb_gtk_widget_focus_out_event, self);
+ _tmp24_ = self->priv->adjustment;
+ g_signal_parse_name ("value-changed", GTK_TYPE_ADJUSTMENT, &_tmp25_, NULL, FALSE);
+ g_signal_handlers_disconnect_matched (_tmp24_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp25_, 0, NULL, (GCallback) _book_view_scroll_cb_gtk_adjustment_value_changed, self);
_book_unref0 (self->priv->book);
_g_hash_table_unref0 (self->priv->page_data);
_page_view_unref0 (self->priv->selected_page);
diff --git a/src/book-view.vala b/src/book-view.vala
index faf1199..4796ec1 100644
--- a/src/book-view.vala
+++ b/src/book-view.vala
@@ -34,7 +34,7 @@ public class BookView : Gtk.VBox
private Gtk.Adjustment adjustment;
private Gdk.CursorType cursor;
-
+
public signal void page_selected (Page? page);
public signal void show_page (Page page);
public signal void show_menu ();
@@ -85,6 +85,23 @@ public class BookView : Gtk.VBox
drawing_area.show ();
}
+ ~BookView ()
+ {
+ book.page_added.disconnect (add_cb);
+ book.page_removed.disconnect (remove_cb);
+ book.reordered.disconnect (reorder_cb);
+ book.cleared.disconnect (clear_cb);
+ drawing_area.configure_event.disconnect (configure_cb);
+ drawing_area.draw.disconnect (draw_cb);
+ drawing_area.motion_notify_event.disconnect (motion_cb);
+ drawing_area.key_press_event.disconnect (key_cb);
+ drawing_area.button_press_event.disconnect (button_cb);
+ drawing_area.button_release_event.disconnect (button_cb);
+ drawing_area.focus_in_event.disconnect (focus_cb);
+ drawing_area.focus_out_event.disconnect (focus_cb);
+ adjustment.value_changed.disconnect (scroll_cb);
+ }
+
private PageView get_nth_page (int n)
{
Page page = book.get_page (n);
@@ -221,6 +238,9 @@ public class BookView : Gtk.VBox
selected_page = null;
}
+ var page_view = page_data.lookup (page);
+ page_view.changed.disconnect (page_view_changed_cb);
+ page_view.size_changed.disconnect (page_view_size_changed_cb);
page_data.remove (page);
select_page_view (new_selection);
@@ -588,9 +608,4 @@ public class BookView : Gtk.VBox
else
return null;
}
-
- public Gtk.Widget get_event_source ()
- {
- return drawing_area;
- }
}
diff --git a/src/book.c b/src/book.c
index c59870c..de54fb4 100644
--- a/src/book.c
+++ b/src/book.c
@@ -1,4 +1,4 @@
-/* book.c generated by valac 0.16.1, the Vala compiler
+/* book.c generated by valac 0.17.7, the Vala compiler
* generated from book.vala, do not modify */
/*
@@ -49,10 +49,10 @@ typedef struct _BookPrivate BookPrivate;
typedef struct _Page Page;
typedef struct _PageClass PageClass;
+#define _page_unref0(var) ((var == NULL) ? NULL : (var = (page_unref (var), NULL)))
#define __g_list_free__page_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__page_unref0_ (var), NULL)))
#define TYPE_SCAN_DIRECTION (scan_direction_get_type ())
-#define _page_unref0(var) ((var == NULL) ? NULL : (var = (page_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _cairo_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_destroy (var), NULL)))
@@ -175,19 +175,19 @@ GType page_get_type (void) G_GNUC_CONST;
enum {
BOOK_DUMMY_PROPERTY
};
+static void book_page_changed_cb (Book* self, Page* page);
+static void _book_page_changed_cb_page_pixels_changed (Page* _sender, gpointer self);
+static void _book_page_changed_cb_page_crop_changed (Page* _sender, gpointer self);
static void _page_unref0_ (gpointer var);
static void _g_list_free__page_unref0_ (GList* self);
Book* book_new (void);
Book* book_construct (GType object_type);
void book_clear (Book* self);
-static void book_page_changed_cb (Book* self, Page* page);
void book_set_needs_saving (Book* self, gboolean needs_saving);
GType scan_direction_get_type (void) G_GNUC_CONST;
Page* book_append_page (Book* self, gint width, gint height, gint dpi, ScanDirection scan_direction);
Page* page_new (gint width, gint height, gint dpi, ScanDirection scan_direction);
Page* page_construct (GType object_type, gint width, gint height, gint dpi, ScanDirection scan_direction);
-static void _book_page_changed_cb_page_pixels_changed (Page* _sender, gpointer self);
-static void _book_page_changed_cb_page_crop_changed (Page* _sender, gpointer self);
void book_move_page (Book* self, Page* page, guint location);
void book_delete_page (Book* self, Page* page);
guint book_get_n_pages (Book* self);
@@ -251,6 +251,21 @@ static cairo_status_t _ps_writer_write_cairo_data_cairo_write_func_t (gpointer s
static void ps_writer_finalize (PsWriter* obj);
+static gpointer _page_ref0 (gpointer self) {
+ return self ? page_ref (self) : NULL;
+}
+
+
+static void _book_page_changed_cb_page_pixels_changed (Page* _sender, gpointer self) {
+ book_page_changed_cb (self, _sender);
+}
+
+
+static void _book_page_changed_cb_page_crop_changed (Page* _sender, gpointer self) {
+ book_page_changed_cb (self, _sender);
+}
+
+
static void _page_unref0_ (gpointer var) {
(var == NULL) ? NULL : (var = (page_unref (var), NULL));
}
@@ -265,6 +280,8 @@ static void _g_list_free__page_unref0_ (GList* self) {
Book* book_construct (GType object_type) {
Book* self = NULL;
self = (Book*) g_type_create_instance (object_type);
+ __g_list_free__page_unref0_0 (self->priv->pages);
+ self->priv->pages = NULL;
return self;
}
@@ -275,7 +292,33 @@ Book* book_new (void) {
void book_clear (Book* self) {
+ GList* _tmp0_;
g_return_if_fail (self != NULL);
+ _tmp0_ = self->priv->pages;
+ {
+ GList* page_collection = NULL;
+ GList* page_it = NULL;
+ page_collection = _tmp0_;
+ for (page_it = page_collection; page_it != NULL; page_it = page_it->next) {
+ Page* _tmp1_;
+ Page* page = NULL;
+ _tmp1_ = _page_ref0 ((Page*) page_it->data);
+ page = _tmp1_;
+ {
+ Page* _tmp2_;
+ guint _tmp3_ = 0U;
+ Page* _tmp4_;
+ guint _tmp5_ = 0U;
+ _tmp2_ = page;
+ g_signal_parse_name ("pixels-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_pixels_changed, self);
+ _tmp4_ = page;
+ g_signal_parse_name ("crop-changed", TYPE_PAGE, &_tmp5_, NULL, FALSE);
+ g_signal_handlers_disconnect_matched (_tmp4_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp5_, 0, NULL, (GCallback) _book_page_changed_cb_page_crop_changed, self);
+ _page_unref0 (page);
+ }
+ }
+ }
__g_list_free__page_unref0_0 (self->priv->pages);
self->priv->pages = NULL;
g_signal_emit_by_name (self, "cleared");
@@ -289,21 +332,6 @@ static void book_page_changed_cb (Book* self, Page* page) {
}
-static void _book_page_changed_cb_page_pixels_changed (Page* _sender, gpointer self) {
- book_page_changed_cb (self, _sender);
-}
-
-
-static void _book_page_changed_cb_page_crop_changed (Page* _sender, gpointer self) {
- book_page_changed_cb (self, _sender);
-}
-
-
-static gpointer _page_ref0 (gpointer self) {
- return self ? page_ref (self) : NULL;
-}
-
-
Page* book_append_page (Book* self, gint width, gint height, gint dpi, ScanDirection scan_direction) {
Page* result = NULL;
gint _tmp0_;
@@ -2408,7 +2436,7 @@ static void book_save_pdf (Book* self, GFile* file, GError** error) {
offset_collection = _tmp373_;
for (offset_it = offset_collection; offset_it != NULL; offset_it = offset_it->next) {
guint offset = 0U;
- offset = GPOINTER_TO_UINT (offset_it->data);
+ offset = (guint) ((guintptr) offset_it->data);
{
PDFWriter* _tmp374_;
guint _tmp375_;
@@ -2708,7 +2736,33 @@ static void book_instance_init (Book * self) {
static void book_finalize (Book* obj) {
Book * self;
- self = BOOK (obj);
+ GList* _tmp0_;
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_BOOK, Book);
+ _tmp0_ = self->priv->pages;
+ {
+ GList* page_collection = NULL;
+ GList* page_it = NULL;
+ page_collection = _tmp0_;
+ for (page_it = page_collection; page_it != NULL; page_it = page_it->next) {
+ Page* _tmp1_;
+ Page* page = NULL;
+ _tmp1_ = _page_ref0 ((Page*) page_it->data);
+ page = _tmp1_;
+ {
+ Page* _tmp2_;
+ guint _tmp3_ = 0U;
+ Page* _tmp4_;
+ guint _tmp5_ = 0U;
+ _tmp2_ = page;
+ g_signal_parse_name ("pixels-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_pixels_changed, self);
+ _tmp4_ = page;
+ g_signal_parse_name ("crop-changed", TYPE_PAGE, &_tmp5_, NULL, FALSE);
+ g_signal_handlers_disconnect_matched (_tmp4_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp5_, 0, NULL, (GCallback) _book_page_changed_cb_page_crop_changed, self);
+ _page_unref0 (page);
+ }
+ }
+ }
__g_list_free__page_unref0_0 (self->priv->pages);
}
@@ -2797,7 +2851,7 @@ void pdf_writer_write (PDFWriter* self, guint8* data, int data_length1) {
_inner_error_ = NULL;
_tmp2_ = e;
_tmp3_ = _tmp2_->message;
- g_warning ("book.vala:547: Error writing PDF: %s", _tmp3_);
+ g_warning ("book.vala:562: Error writing PDF: %s", _tmp3_);
_g_error_free0 (e);
}
__finally0:
@@ -2863,8 +2917,8 @@ void pdf_writer_write_string (PDFWriter* self, const gchar* text) {
_tmp0_ = text;
_tmp2_ = string_to_utf8 (_tmp0_, &_tmp1_);
_tmp3_ = (guint8*) _tmp2_;
- _tmp3__length1 = _tmp1_;
- pdf_writer_write (self, _tmp3_, _tmp1_);
+ _tmp3__length1 = (_tmp1_ * sizeof (gchar)) / sizeof (guint8);
+ pdf_writer_write (self, _tmp3_, (_tmp1_ * sizeof (gchar)) / sizeof (guint8));
_tmp3_ = (g_free (_tmp3_), NULL);
}
@@ -2876,7 +2930,7 @@ guint pdf_writer_start_object (PDFWriter* self) {
guint _tmp2_ = 0U;
g_return_val_if_fail (self != NULL, 0U);
_tmp0_ = self->offset;
- self->object_offsets = g_list_append (self->object_offsets, GUINT_TO_POINTER ((guint) _tmp0_));
+ self->object_offsets = g_list_append (self->object_offsets, (gpointer) ((guintptr) ((guint) _tmp0_)));
_tmp1_ = self->object_offsets;
_tmp2_ = g_list_length (_tmp1_);
result = _tmp2_;
@@ -3010,7 +3064,7 @@ static void pdf_writer_instance_init (PDFWriter * self) {
static void pdf_writer_finalize (PDFWriter* obj) {
PDFWriter * self;
- self = PDF_WRITER (obj);
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PDF_WRITER, PDFWriter);
_g_list_free0 (self->object_offsets);
_g_object_unref0 (self->priv->stream);
}
@@ -3104,7 +3158,7 @@ static cairo_status_t ps_writer_write_cairo_data (PsWriter* self, guint8* data,
_inner_error_ = NULL;
_tmp2_ = e;
_tmp3_ = _tmp2_->message;
- g_warning ("book.vala:583: Error writing data: %s", _tmp3_);
+ g_warning ("book.vala:598: Error writing data: %s", _tmp3_);
result = CAIRO_STATUS_WRITE_ERROR;
_g_error_free0 (e);
return result;
@@ -3243,7 +3297,7 @@ static void ps_writer_instance_init (PsWriter * self) {
static void ps_writer_finalize (PsWriter* obj) {
PsWriter * self;
- self = PS_WRITER (obj);
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PS_WRITER, PsWriter);
_cairo_surface_destroy0 (self->surface);
_g_object_unref0 (self->stream);
}
diff --git a/src/book.vala b/src/book.vala
index 15e79c6..6740fcb 100644
--- a/src/book.vala
+++ b/src/book.vala
@@ -14,7 +14,7 @@ public class Book
private List<Page> pages;
private bool needs_saving;
-
+
public signal void page_added (Page page);
public signal void page_removed (Page page);
public signal void reordered ();
@@ -24,10 +24,25 @@ public class Book
public Book ()
{
+ pages = new List<Page> ();
+ }
+
+ ~Book ()
+ {
+ foreach (var page in pages)
+ {
+ page.pixels_changed.disconnect (page_changed_cb);
+ page.crop_changed.disconnect (page_changed_cb);
+ }
}
public void clear ()
{
+ foreach (var page in pages)
+ {
+ page.pixels_changed.disconnect (page_changed_cb);
+ page.crop_changed.disconnect (page_changed_cb);
+ }
pages = null;
cleared ();
}
@@ -94,7 +109,7 @@ public class Book
string prefix = uri, suffix = "";
var extension_index = basename.last_index_of_char ('.');
if (extension_index >= 0)
- {
+ {
suffix = basename.slice (extension_index, basename.length);
prefix = uri.slice (0, uri.length - suffix.length);
}
@@ -460,7 +475,7 @@ public class Book
writer.write_string ("\n");
writer.write_string ("endstream\n");
writer.write_string ("endobj\n");
-
+
saving (i);
}
@@ -585,5 +600,5 @@ public class PsWriter
}
return Cairo.Status.SUCCESS;
- }
+ }
}
diff --git a/src/page-view.c b/src/page-view.c
index 517b383..53cf3a9 100644
--- a/src/page-view.c
+++ b/src/page-view.c
@@ -1,4 +1,4 @@
-/* page-view.c generated by valac 0.16.1, the Vala compiler
+/* page-view.c generated by valac 0.17.7, the Vala compiler
* generated from page-view.vala, do not modify */
/*
@@ -136,8 +136,6 @@ GType scan_direction_get_type (void) G_GNUC_CONST;
enum {
PAGE_VIEW_DUMMY_PROPERTY
};
-PageView* page_view_new (Page* page);
-PageView* page_view_construct (GType object_type, Page* page);
static void page_view_page_pixels_changed_cb (PageView* self, Page* p);
static void _page_view_page_pixels_changed_cb_page_pixels_changed (Page* _sender, gpointer self);
static void page_view_page_size_changed_cb (PageView* self, Page* p);
@@ -147,6 +145,8 @@ static void _page_view_page_overlay_changed_cb_page_crop_changed (Page* _sender,
static void _page_view_page_overlay_changed_cb_page_scan_line_changed (Page* _sender, gpointer self);
static void page_view_scan_direction_changed_cb (PageView* self, Page* p);
static void _page_view_scan_direction_changed_cb_page_scan_direction_changed (Page* _sender, gpointer self);
+PageView* page_view_new (Page* page);
+PageView* page_view_construct (GType object_type, Page* page);
Page* page_view_get_page (PageView* self);
void page_view_set_selected (PageView* self, gboolean selected);
gboolean page_view_get_selected (PageView* self);
@@ -210,11 +210,6 @@ GType crop_location_get_type (void) {
}
-static gpointer _page_ref0 (gpointer self) {
- return self ? page_ref (self) : NULL;
-}
-
-
static void _page_view_page_pixels_changed_cb_page_pixels_changed (Page* _sender, gpointer self) {
page_view_page_pixels_changed_cb (self, _sender);
}
@@ -240,6 +235,11 @@ static void _page_view_scan_direction_changed_cb_page_scan_direction_changed (Pa
}
+static gpointer _page_ref0 (gpointer self) {
+ return self ? page_ref (self) : NULL;
+}
+
+
PageView* page_view_construct (GType object_type, Page* page) {
PageView* self = NULL;
Page* _tmp0_;
@@ -4240,7 +4240,32 @@ static void page_view_instance_init (PageView * self) {
static void page_view_finalize (PageView* obj) {
PageView * self;
- self = PAGE_VIEW (obj);
+ Page* _tmp0_;
+ guint _tmp1_ = 0U;
+ Page* _tmp2_;
+ guint _tmp3_ = 0U;
+ Page* _tmp4_;
+ guint _tmp5_ = 0U;
+ Page* _tmp6_;
+ guint _tmp7_ = 0U;
+ Page* _tmp8_;
+ guint _tmp9_ = 0U;
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PAGE_VIEW, PageView);
+ _tmp0_ = self->priv->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) _page_view_page_pixels_changed_cb_page_pixels_changed, self);
+ _tmp2_ = self->priv->page;
+ g_signal_parse_name ("size-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) _page_view_page_size_changed_cb_page_size_changed, self);
+ _tmp4_ = self->priv->page;
+ g_signal_parse_name ("crop-changed", TYPE_PAGE, &_tmp5_, NULL, FALSE);
+ g_signal_handlers_disconnect_matched (_tmp4_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp5_, 0, NULL, (GCallback) _page_view_page_overlay_changed_cb_page_crop_changed, self);
+ _tmp6_ = self->priv->page;
+ g_signal_parse_name ("scan-line-changed", TYPE_PAGE, &_tmp7_, NULL, FALSE);
+ g_signal_handlers_disconnect_matched (_tmp6_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp7_, 0, NULL, (GCallback) _page_view_page_overlay_changed_cb_page_scan_line_changed, self);
+ _tmp8_ = self->priv->page;
+ g_signal_parse_name ("scan-direction-changed", TYPE_PAGE, &_tmp9_, NULL, FALSE);
+ g_signal_handlers_disconnect_matched (_tmp8_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp9_, 0, NULL, (GCallback) _page_view_scan_direction_changed_cb_page_scan_direction_changed, self);
_page_unref0 (self->priv->page);
_g_object_unref0 (self->priv->image);
}
diff --git a/src/page-view.vala b/src/page-view.vala
index 97bcaf0..7d228e4 100644
--- a/src/page-view.vala
+++ b/src/page-view.vala
@@ -80,6 +80,15 @@ public class PageView
page.scan_direction_changed.connect (scan_direction_changed_cb);
}
+ ~PageView ()
+ {
+ page.pixels_changed.disconnect (page_pixels_changed_cb);
+ page.size_changed.disconnect (page_size_changed_cb);
+ page.crop_changed.disconnect (page_overlay_changed_cb);
+ page.scan_line_changed.disconnect (page_overlay_changed_cb);
+ page.scan_direction_changed.disconnect (scan_direction_changed_cb);
+ }
+
public Page get_page ()
{
return page;
@@ -882,7 +891,7 @@ public class PageView
var y = outer_radius * (Math.cos (arc) - 1.0);
var inner_radius = 0.6 * Math.sqrt (x*x + y*y);
- double offset = 0.0;
+ double offset = 0.0;
for (var i = 0; i < animate_n_segments; i++, offset += arc * 2)
{
x = w / 2 + outer_radius * Math.sin (offset);
diff --git a/src/page.c b/src/page.c
index a6d0673..8fa7c81 100644
--- a/src/page.c
+++ b/src/page.c
@@ -1,4 +1,4 @@
-/* page.c generated by valac 0.16.1, the Vala compiler
+/* page.c generated by valac 0.17.7, the Vala compiler
* generated from page.vala, do not modify */
/*
@@ -2152,8 +2152,8 @@ static gchar* page_get_icc_data_encoded (Page* self, const gchar* icc_profile_fi
_tmp4_ = contents;
_tmp6_ = string_to_utf8 (_tmp4_, &_tmp5_);
_tmp7_ = (guchar*) _tmp6_;
- _tmp7__length1 = _tmp5_;
- _tmp8_ = g_base64_encode (_tmp7_, _tmp5_);
+ _tmp7__length1 = (_tmp5_ * sizeof (gchar)) / sizeof (guchar);
+ _tmp8_ = g_base64_encode (_tmp7_, (_tmp5_ * sizeof (gchar)) / sizeof (guchar));
_tmp9_ = _tmp8_;
_tmp7_ = (g_free (_tmp7_), NULL);
result = _tmp9_;
@@ -2545,7 +2545,7 @@ static void page_instance_init (Page * self) {
static void page_finalize (Page* obj) {
Page * self;
- self = PAGE (obj);
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PAGE, Page);
_g_free0 (self->priv->color_profile);
self->priv->pixels = (g_free (self->priv->pixels), NULL);
_g_free0 (self->priv->crop_name);
@@ -2783,7 +2783,7 @@ static void pixbuf_writer_instance_init (PixbufWriter * self) {
static void pixbuf_writer_finalize (PixbufWriter* obj) {
PixbufWriter * self;
- self = PIXBUF_WRITER (obj);
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PIXBUF_WRITER, PixbufWriter);
_g_object_unref0 (self->stream);
}
diff --git a/src/page.vala b/src/page.vala
index ef7ddb6..3bf34d7 100644
--- a/src/page.vala
+++ b/src/page.vala
@@ -57,7 +57,7 @@ public class Page
private int crop_y;
private int crop_width;
private int crop_height;
-
+
public signal void pixels_changed ();
public signal void size_changed ();
public signal void scan_line_changed ();
@@ -84,7 +84,7 @@ public class Page
{
expected_rows = info.height;
dpi = (int) info.dpi;
-
+
/* Create a white page */
width = info.width;
n_rows = info.height;
@@ -406,13 +406,13 @@ public class Page
public void set_named_crop (string name)
{
- double width, height;
+ double width, height;
switch (name)
{
case "A4":
width = 8.3;
height = 11.7;
- break;
+ break;
case "A5":
width = 5.8;
height = 8.3;
diff --git a/src/scanner.c b/src/scanner.c
index e80ae99..8319ee3 100644
--- a/src/scanner.c
+++ b/src/scanner.c
@@ -1,4 +1,4 @@
-/* scanner.c generated by valac 0.16.1, the Vala compiler
+/* scanner.c generated by valac 0.17.7, the Vala compiler
* generated from scanner.vala, do not modify */
/*
@@ -261,6 +261,7 @@ typedef struct _NotifyGotPageInfo NotifyGotPageInfo;
typedef struct _NotifyGotPageInfoClass NotifyGotPageInfoClass;
typedef struct _NotifyGotPageInfoPrivate NotifyGotPageInfoPrivate;
#define _scan_page_info_unref0(var) ((var == NULL) ? NULL : (var = (scan_page_info_unref (var), NULL)))
+typedef struct _ScannerPrivate ScannerPrivate;
#define TYPE_NOTIFY_PAGE_DONE (notify_page_done_get_type ())
#define NOTIFY_PAGE_DONE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_NOTIFY_PAGE_DONE, NotifyPageDone))
@@ -284,7 +285,6 @@ typedef struct _NotifyGotLine NotifyGotLine;
typedef struct _NotifyGotLineClass NotifyGotLineClass;
typedef struct _NotifyGotLinePrivate NotifyGotLinePrivate;
#define _scan_line_unref0(var) ((var == NULL) ? NULL : (var = (scan_line_unref (var), NULL)))
-typedef struct _ScannerPrivate ScannerPrivate;
#define _g_async_queue_unref0(var) ((var == NULL) ? NULL : (var = (g_async_queue_unref (var), NULL)))
#define __g_list_free__scan_job_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__scan_job_unref0_ (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
@@ -397,6 +397,7 @@ struct _ScanJob {
GTypeInstance parent_instance;
volatile int ref_count;
ScanJobPrivate * priv;
+ gint id;
gchar* device;
gdouble dpi;
ScanMode scan_mode;
@@ -587,9 +588,23 @@ struct _NotifyGotPageInfoClass {
};
struct _NotifyGotPageInfoPrivate {
+ gint job_id;
ScanPageInfo* info;
};
+struct _Scanner {
+ GTypeInstance parent_instance;
+ volatile int ref_count;
+ ScannerPrivate * priv;
+ gint first_job_id;
+ gint job_id;
+};
+
+struct _ScannerClass {
+ GTypeClass parent_class;
+ void (*finalize) (Scanner *self);
+};
+
struct _NotifyPageDone {
Notify parent_instance;
NotifyPageDonePrivate * priv;
@@ -599,6 +614,10 @@ struct _NotifyPageDoneClass {
NotifyClass parent_class;
};
+struct _NotifyPageDonePrivate {
+ gint job_id;
+};
+
struct _NotifyGotLine {
Notify parent_instance;
NotifyGotLinePrivate * priv;
@@ -609,20 +628,10 @@ struct _NotifyGotLineClass {
};
struct _NotifyGotLinePrivate {
+ gint job_id;
ScanLine* line;
};
-struct _Scanner {
- GTypeInstance parent_instance;
- volatile int ref_count;
- ScannerPrivate * priv;
-};
-
-struct _ScannerClass {
- GTypeClass parent_class;
- void (*finalize) (Scanner *self);
-};
-
struct _ScannerPrivate {
GThread* thread;
GAsyncQueue* request_queue;
@@ -875,24 +884,26 @@ GType notify_got_page_info_get_type (void) G_GNUC_CONST;
enum {
NOTIFY_GOT_PAGE_INFO_DUMMY_PROPERTY
};
-NotifyGotPageInfo* notify_got_page_info_new (ScanPageInfo* info);
-NotifyGotPageInfo* notify_got_page_info_construct (GType object_type, ScanPageInfo* info);
+NotifyGotPageInfo* notify_got_page_info_new (gint job_id, ScanPageInfo* info);
+NotifyGotPageInfo* notify_got_page_info_construct (GType object_type, gint job_id, ScanPageInfo* info);
static void notify_got_page_info_real_run (Notify* base, Scanner* scanner);
static void notify_got_page_info_finalize (Notify* obj);
GType notify_page_done_get_type (void) G_GNUC_CONST;
+#define NOTIFY_PAGE_DONE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_NOTIFY_PAGE_DONE, NotifyPageDonePrivate))
enum {
NOTIFY_PAGE_DONE_DUMMY_PROPERTY
};
+NotifyPageDone* notify_page_done_new (gint job_id);
+NotifyPageDone* notify_page_done_construct (GType object_type, gint job_id);
static void notify_page_done_real_run (Notify* base, Scanner* scanner);
-NotifyPageDone* notify_page_done_new (void);
-NotifyPageDone* notify_page_done_construct (GType object_type);
+static void notify_page_done_finalize (Notify* obj);
GType notify_got_line_get_type (void) G_GNUC_CONST;
#define NOTIFY_GOT_LINE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_NOTIFY_GOT_LINE, NotifyGotLinePrivate))
enum {
NOTIFY_GOT_LINE_DUMMY_PROPERTY
};
-NotifyGotLine* notify_got_line_new (ScanLine* line);
-NotifyGotLine* notify_got_line_construct (GType object_type, ScanLine* line);
+NotifyGotLine* notify_got_line_new (gint job_id, ScanLine* line);
+NotifyGotLine* notify_got_line_construct (GType object_type, gint job_id, ScanLine* line);
static void notify_got_line_real_run (Notify* base, Scanner* scanner);
static void notify_got_line_finalize (Notify* obj);
#define SCANNER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_SCANNER, ScannerPrivate))
@@ -1087,7 +1098,7 @@ static void scan_device_instance_init (ScanDevice * self) {
static void scan_device_finalize (ScanDevice* obj) {
ScanDevice * self;
- self = SCAN_DEVICE (obj);
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SCAN_DEVICE, ScanDevice);
_g_free0 (self->name);
_g_free0 (self->label);
}
@@ -1260,7 +1271,7 @@ static void scan_page_info_instance_init (ScanPageInfo * self) {
static void scan_page_info_finalize (ScanPageInfo* obj) {
ScanPageInfo * self;
- self = SCAN_PAGE_INFO (obj);
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SCAN_PAGE_INFO, ScanPageInfo);
_g_free0 (self->device);
}
@@ -1432,7 +1443,7 @@ static void scan_line_instance_init (ScanLine * self) {
static void scan_line_finalize (ScanLine* obj) {
ScanLine * self;
- self = SCAN_LINE (obj);
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SCAN_LINE, ScanLine);
self->data = (g_free (self->data), NULL);
}
@@ -1628,7 +1639,7 @@ static void scan_options_instance_init (ScanOptions * self) {
static void scan_options_finalize (ScanOptions* obj) {
ScanOptions * self;
- self = SCAN_OPTIONS (obj);
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SCAN_OPTIONS, ScanOptions);
}
@@ -1799,7 +1810,7 @@ static void scan_job_instance_init (ScanJob * self) {
static void scan_job_finalize (ScanJob* obj) {
ScanJob * self;
- self = SCAN_JOB (obj);
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SCAN_JOB, ScanJob);
_g_free0 (self->device);
}
@@ -1971,7 +1982,7 @@ static void request_instance_init (Request * self) {
static void request_finalize (Request* obj) {
Request * self;
- self = REQUEST (obj);
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_REQUEST, Request);
}
@@ -2097,7 +2108,7 @@ static void request_start_scan_instance_init (RequestStartScan * self) {
static void request_start_scan_finalize (Request* obj) {
RequestStartScan * self;
- self = REQUEST_START_SCAN (obj);
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_REQUEST_START_SCAN, RequestStartScan);
_scan_job_unref0 (self->job);
REQUEST_CLASS (request_start_scan_parent_class)->finalize (obj);
}
@@ -2283,7 +2294,7 @@ static void credentials_instance_init (Credentials * self) {
static void credentials_finalize (Credentials* obj) {
Credentials * self;
- self = CREDENTIALS (obj);
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_CREDENTIALS, Credentials);
_g_free0 (self->username);
_g_free0 (self->password);
}
@@ -2480,7 +2491,7 @@ static void notify_instance_init (Notify * self) {
static void notify_finalize (Notify* obj) {
Notify * self;
- self = NOTIFY (obj);
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_NOTIFY, Notify);
}
@@ -2616,7 +2627,7 @@ static void notify_update_devices_instance_init (NotifyUpdateDevices * self) {
static void notify_update_devices_finalize (Notify* obj) {
NotifyUpdateDevices * self;
- self = NOTIFY_UPDATE_DEVICES (obj);
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_NOTIFY_UPDATE_DEVICES, NotifyUpdateDevices);
__g_list_free__scan_device_unref0_0 (self->priv->devices);
NOTIFY_CLASS (notify_update_devices_parent_class)->finalize (obj);
}
@@ -2680,7 +2691,7 @@ static void notify_request_authorization_instance_init (NotifyRequestAuthorizati
static void notify_request_authorization_finalize (Notify* obj) {
NotifyRequestAuthorization * self;
- self = NOTIFY_REQUEST_AUTHORIZATION (obj);
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_NOTIFY_REQUEST_AUTHORIZATION, NotifyRequestAuthorization);
_g_free0 (self->priv->resource);
NOTIFY_CLASS (notify_request_authorization_parent_class)->finalize (obj);
}
@@ -2749,7 +2760,7 @@ static void notify_scan_failed_instance_init (NotifyScanFailed * self) {
static void notify_scan_failed_finalize (Notify* obj) {
NotifyScanFailed * self;
- self = NOTIFY_SCAN_FAILED (obj);
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_NOTIFY_SCAN_FAILED, NotifyScanFailed);
_g_free0 (self->priv->error_string);
NOTIFY_CLASS (notify_scan_failed_parent_class)->finalize (obj);
}
@@ -2860,34 +2871,59 @@ static gpointer _scan_page_info_ref0 (gpointer self) {
}
-NotifyGotPageInfo* notify_got_page_info_construct (GType object_type, ScanPageInfo* info) {
+NotifyGotPageInfo* notify_got_page_info_construct (GType object_type, gint job_id, ScanPageInfo* info) {
NotifyGotPageInfo* self = NULL;
- ScanPageInfo* _tmp0_;
+ gint _tmp0_;
ScanPageInfo* _tmp1_;
+ ScanPageInfo* _tmp2_;
g_return_val_if_fail (info != NULL, NULL);
self = (NotifyGotPageInfo*) notify_construct (object_type);
- _tmp0_ = info;
- _tmp1_ = _scan_page_info_ref0 (_tmp0_);
+ _tmp0_ = job_id;
+ self->priv->job_id = _tmp0_;
+ _tmp1_ = info;
+ _tmp2_ = _scan_page_info_ref0 (_tmp1_);
_scan_page_info_unref0 (self->priv->info);
- self->priv->info = _tmp1_;
+ self->priv->info = _tmp2_;
return self;
}
-NotifyGotPageInfo* notify_got_page_info_new (ScanPageInfo* info) {
- return notify_got_page_info_construct (TYPE_NOTIFY_GOT_PAGE_INFO, info);
+NotifyGotPageInfo* notify_got_page_info_new (gint job_id, ScanPageInfo* info) {
+ return notify_got_page_info_construct (TYPE_NOTIFY_GOT_PAGE_INFO, job_id, info);
}
static void notify_got_page_info_real_run (Notify* base, Scanner* scanner) {
NotifyGotPageInfo * self;
- Scanner* _tmp0_;
- ScanPageInfo* _tmp1_;
+ gboolean _tmp0_ = FALSE;
+ gint _tmp1_;
+ Scanner* _tmp2_;
+ gint _tmp3_;
+ gboolean _tmp7_;
self = (NotifyGotPageInfo*) base;
g_return_if_fail (scanner != NULL);
- _tmp0_ = scanner;
- _tmp1_ = self->priv->info;
- g_signal_emit_by_name (_tmp0_, "got-page-info", _tmp1_);
+ _tmp1_ = self->priv->job_id;
+ _tmp2_ = scanner;
+ _tmp3_ = _tmp2_->first_job_id;
+ if (_tmp1_ >= _tmp3_) {
+ gint _tmp4_;
+ Scanner* _tmp5_;
+ gint _tmp6_;
+ _tmp4_ = self->priv->job_id;
+ _tmp5_ = scanner;
+ _tmp6_ = _tmp5_->job_id;
+ _tmp0_ = _tmp4_ < _tmp6_;
+ } else {
+ _tmp0_ = FALSE;
+ }
+ _tmp7_ = _tmp0_;
+ if (_tmp7_) {
+ Scanner* _tmp8_;
+ ScanPageInfo* _tmp9_;
+ _tmp8_ = scanner;
+ _tmp9_ = self->priv->info;
+ g_signal_emit_by_name (_tmp8_, "got-page-info", _tmp9_);
+ }
}
@@ -2906,7 +2942,7 @@ static void notify_got_page_info_instance_init (NotifyGotPageInfo * self) {
static void notify_got_page_info_finalize (Notify* obj) {
NotifyGotPageInfo * self;
- self = NOTIFY_GOT_PAGE_INFO (obj);
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_NOTIFY_GOT_PAGE_INFO, NotifyGotPageInfo);
_scan_page_info_unref0 (self->priv->info);
NOTIFY_CLASS (notify_got_page_info_parent_class)->finalize (obj);
}
@@ -2924,35 +2960,70 @@ 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);
- _tmp0_ = scanner;
- g_signal_emit_by_name (_tmp0_, "page-done");
-}
-
-
-NotifyPageDone* notify_page_done_construct (GType object_type) {
+NotifyPageDone* notify_page_done_construct (GType object_type, gint job_id) {
NotifyPageDone* self = NULL;
+ gint _tmp0_;
self = (NotifyPageDone*) notify_construct (object_type);
+ _tmp0_ = job_id;
+ self->priv->job_id = _tmp0_;
return self;
}
-NotifyPageDone* notify_page_done_new (void) {
- return notify_page_done_construct (TYPE_NOTIFY_PAGE_DONE);
+NotifyPageDone* notify_page_done_new (gint job_id) {
+ return notify_page_done_construct (TYPE_NOTIFY_PAGE_DONE, job_id);
+}
+
+
+static void notify_page_done_real_run (Notify* base, Scanner* scanner) {
+ NotifyPageDone * self;
+ gboolean _tmp0_ = FALSE;
+ gint _tmp1_;
+ Scanner* _tmp2_;
+ gint _tmp3_;
+ gboolean _tmp7_;
+ self = (NotifyPageDone*) base;
+ g_return_if_fail (scanner != NULL);
+ _tmp1_ = self->priv->job_id;
+ _tmp2_ = scanner;
+ _tmp3_ = _tmp2_->first_job_id;
+ if (_tmp1_ >= _tmp3_) {
+ gint _tmp4_;
+ Scanner* _tmp5_;
+ gint _tmp6_;
+ _tmp4_ = self->priv->job_id;
+ _tmp5_ = scanner;
+ _tmp6_ = _tmp5_->job_id;
+ _tmp0_ = _tmp4_ < _tmp6_;
+ } else {
+ _tmp0_ = FALSE;
+ }
+ _tmp7_ = _tmp0_;
+ if (_tmp7_) {
+ Scanner* _tmp8_;
+ _tmp8_ = scanner;
+ g_signal_emit_by_name (_tmp8_, "page-done");
+ }
}
static void notify_page_done_class_init (NotifyPageDoneClass * klass) {
notify_page_done_parent_class = g_type_class_peek_parent (klass);
+ NOTIFY_CLASS (klass)->finalize = notify_page_done_finalize;
+ g_type_class_add_private (klass, sizeof (NotifyPageDonePrivate));
NOTIFY_CLASS (klass)->run = notify_page_done_real_run;
}
static void notify_page_done_instance_init (NotifyPageDone * self) {
+ self->priv = NOTIFY_PAGE_DONE_GET_PRIVATE (self);
+}
+
+
+static void notify_page_done_finalize (Notify* obj) {
+ NotifyPageDone * self;
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_NOTIFY_PAGE_DONE, NotifyPageDone);
+ NOTIFY_CLASS (notify_page_done_parent_class)->finalize (obj);
}
@@ -2973,34 +3044,59 @@ static gpointer _scan_line_ref0 (gpointer self) {
}
-NotifyGotLine* notify_got_line_construct (GType object_type, ScanLine* line) {
+NotifyGotLine* notify_got_line_construct (GType object_type, gint job_id, ScanLine* line) {
NotifyGotLine* self = NULL;
- ScanLine* _tmp0_;
+ gint _tmp0_;
ScanLine* _tmp1_;
+ ScanLine* _tmp2_;
g_return_val_if_fail (line != NULL, NULL);
self = (NotifyGotLine*) notify_construct (object_type);
- _tmp0_ = line;
- _tmp1_ = _scan_line_ref0 (_tmp0_);
+ _tmp0_ = job_id;
+ self->priv->job_id = _tmp0_;
+ _tmp1_ = line;
+ _tmp2_ = _scan_line_ref0 (_tmp1_);
_scan_line_unref0 (self->priv->line);
- self->priv->line = _tmp1_;
+ self->priv->line = _tmp2_;
return self;
}
-NotifyGotLine* notify_got_line_new (ScanLine* line) {
- return notify_got_line_construct (TYPE_NOTIFY_GOT_LINE, line);
+NotifyGotLine* notify_got_line_new (gint job_id, ScanLine* line) {
+ return notify_got_line_construct (TYPE_NOTIFY_GOT_LINE, job_id, line);
}
static void notify_got_line_real_run (Notify* base, Scanner* scanner) {
NotifyGotLine * self;
- Scanner* _tmp0_;
- ScanLine* _tmp1_;
+ gboolean _tmp0_ = FALSE;
+ gint _tmp1_;
+ Scanner* _tmp2_;
+ gint _tmp3_;
+ gboolean _tmp7_;
self = (NotifyGotLine*) base;
g_return_if_fail (scanner != NULL);
- _tmp0_ = scanner;
- _tmp1_ = self->priv->line;
- g_signal_emit_by_name (_tmp0_, "got-line", _tmp1_);
+ _tmp1_ = self->priv->job_id;
+ _tmp2_ = scanner;
+ _tmp3_ = _tmp2_->first_job_id;
+ if (_tmp1_ >= _tmp3_) {
+ gint _tmp4_;
+ Scanner* _tmp5_;
+ gint _tmp6_;
+ _tmp4_ = self->priv->job_id;
+ _tmp5_ = scanner;
+ _tmp6_ = _tmp5_->job_id;
+ _tmp0_ = _tmp4_ < _tmp6_;
+ } else {
+ _tmp0_ = FALSE;
+ }
+ _tmp7_ = _tmp0_;
+ if (_tmp7_) {
+ Scanner* _tmp8_;
+ ScanLine* _tmp9_;
+ _tmp8_ = scanner;
+ _tmp9_ = self->priv->line;
+ g_signal_emit_by_name (_tmp8_, "got-line", _tmp9_);
+ }
}
@@ -3019,7 +3115,7 @@ static void notify_got_line_instance_init (NotifyGotLine * self) {
static void notify_got_line_finalize (Notify* obj) {
NotifyGotLine * self;
- self = NOTIFY_GOT_LINE (obj);
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_NOTIFY_GOT_LINE, NotifyGotLine);
_scan_line_unref0 (self->priv->line);
NOTIFY_CLASS (notify_got_line_parent_class)->finalize (obj);
}
@@ -3178,7 +3274,6 @@ static void scanner_set_scanning (Scanner* self, gboolean is_scanning) {
NotifyScanningChanged* _tmp12_;
_tmp10_ = is_scanning;
self->priv->scanning = _tmp10_;
- g_signal_emit_by_name (self, "scanning-changed");
_tmp11_ = notify_scanning_changed_new ();
_tmp12_ = _tmp11_;
scanner_notify (self, (Notify*) _tmp12_);
@@ -3483,7 +3578,7 @@ static void scanner_do_redetect (Scanner* self) {
_tmp2_ = status;
_tmp3_ = sane_status_to_string (_tmp2_);
_tmp4_ = _tmp3_;
- g_debug ("scanner.vala:317: sane_get_devices () -> %s", _tmp4_);
+ g_debug ("scanner.vala:334: sane_get_devices () -> %s", _tmp4_);
_g_free0 (_tmp4_);
_tmp5_ = status;
if (_tmp5_ != SANE_STATUS_GOOD) {
@@ -3491,7 +3586,7 @@ static void scanner_do_redetect (Scanner* self) {
const gchar* _tmp7_ = NULL;
_tmp6_ = status;
_tmp7_ = sane_strstatus (_tmp6_);
- g_warning ("scanner.vala:320: Unable to get SANE devices: %s", _tmp7_);
+ g_warning ("scanner.vala:337: Unable to get SANE devices: %s", _tmp7_);
self->priv->need_redetect = FALSE;
self->priv->state = SCAN_STATE_IDLE;
return;
@@ -3594,7 +3689,7 @@ static void scanner_do_redetect (Scanner* self) {
_tmp27_ = i;
_tmp28_ = _tmp26_[_tmp27_];
_tmp29_ = _tmp28_->type;
- g_debug ("scanner.vala:329: Device: name=\"%s\" vendor=\"%s\" model=\"%s\" type=" \
+ g_debug ("scanner.vala:346: Device: name=\"%s\" vendor=\"%s\" model=\"%s\" type=" \
"\"%s\"", _tmp17_, _tmp21_, _tmp25_, _tmp29_);
_tmp30_ = scan_device_new ();
scan_device = _tmp30_;
@@ -3710,7 +3805,7 @@ static gboolean scanner_set_default_option (Scanner* self, SANE_Handle handle, S
_tmp6_ = status;
_tmp7_ = sane_status_to_string (_tmp6_);
_tmp8_ = _tmp7_;
- g_debug ("scanner.vala:371: sane_control_option (%d, SANE_ACTION_SET_AUTO) -> %s", (gint) _tmp5_, _tmp8_);
+ g_debug ("scanner.vala:388: sane_control_option (%d, SANE_ACTION_SET_AUTO) -> %s", (gint) _tmp5_, _tmp8_);
_g_free0 (_tmp8_);
_tmp9_ = status;
if (_tmp9_ != SANE_STATUS_GOOD) {
@@ -3722,7 +3817,7 @@ static gboolean scanner_set_default_option (Scanner* self, SANE_Handle handle, S
_tmp11_ = _tmp10_->name;
_tmp12_ = status;
_tmp13_ = sane_strstatus (_tmp12_);
- g_warning ("scanner.vala:373: Error setting default option %s: %s", _tmp11_, _tmp13_);
+ g_warning ("scanner.vala:390: Error setting default option %s: %s", _tmp11_, _tmp13_);
}
_tmp14_ = status;
result = _tmp14_ == SANE_STATUS_GOOD;
@@ -3782,7 +3877,7 @@ static void scanner_set_bool_option (Scanner* self, SANE_Handle handle, SANE_Opt
_tmp14_ = sane_status_to_string (_tmp13_);
_tmp15_ = _tmp14_;
_tmp16_ = _tmp9_;
- g_debug ("scanner.vala:385: sane_control_option (%d, SANE_ACTION_SET_VALUE, %s) " \
+ g_debug ("scanner.vala:402: sane_control_option (%d, SANE_ACTION_SET_VALUE, %s) " \
"-> (%s, %s)", (gint) _tmp11_, _tmp12_, _tmp15_, _tmp16_);
_g_free0 (_tmp15_);
if (_result_) {
@@ -3962,7 +4057,7 @@ static void scanner_set_int_option (Scanner* self, SANE_Handle handle, SANE_Opti
_tmp54_ = sane_status_to_string (status);
_tmp55_ = _tmp54_;
_tmp56_ = v;
- g_debug ("scanner.vala:422: sane_control_option (%d, SANE_ACTION_SET_VALUE, %d) " \
+ g_debug ("scanner.vala:439: sane_control_option (%d, SANE_ACTION_SET_VALUE, %d) " \
"-> (%s, %d)", (gint) _tmp52_, _tmp53_, _tmp55_, (gint) _tmp56_);
_g_free0 (_tmp55_);
_tmp57_ = v;
@@ -4136,7 +4231,7 @@ static void scanner_set_fixed_option (Scanner* self, SANE_Handle handle, SANE_Op
_tmp50_ = sane_status_to_string (status);
_tmp51_ = _tmp50_;
_tmp52_ = SANE_UNFIX (v_fixed);
- g_debug ("scanner.vala:462: sane_control_option (%d, SANE_ACTION_SET_VALUE, %f) " \
+ g_debug ("scanner.vala:479: sane_control_option (%d, SANE_ACTION_SET_VALUE, %f) " \
"-> (%s, %f)", (gint) _tmp48_, _tmp49_, _tmp51_, _tmp52_);
_g_free0 (_tmp51_);
_tmp53_ = SANE_UNFIX (v_fixed);
@@ -4279,7 +4374,7 @@ static gboolean scanner_set_string_option (Scanner* self, SANE_Handle handle, SA
_tmp34_ = sane_status_to_string (status);
_tmp35_ = _tmp34_;
_tmp36_ = _vala_result;
- g_debug ("scanner.vala:480: sane_control_option (%d, SANE_ACTION_SET_VALUE, \"%s" \
+ g_debug ("scanner.vala:497: sane_control_option (%d, SANE_ACTION_SET_VALUE, \"%s" \
"\") -> (%s, \"%s\")", (gint) _tmp32_, _tmp33_, _tmp35_, _tmp36_);
_g_free0 (_tmp35_);
result = status == SANE_STATUS_GOOD;
@@ -5156,7 +5251,7 @@ static void scanner_log_option (Scanner* self, SANE_Int index, SANE_Option_Descr
}
}
_tmp214_ = s;
- g_debug ("scanner.vala:668: %s", _tmp214_);
+ g_debug ("scanner.vala:685: %s", _tmp214_);
_tmp215_ = option;
_tmp216_ = _tmp215_->desc;
if (_tmp216_ != NULL) {
@@ -5164,7 +5259,7 @@ static void scanner_log_option (Scanner* self, SANE_Int index, SANE_Option_Descr
const gchar* _tmp218_;
_tmp217_ = option;
_tmp218_ = _tmp217_->desc;
- g_debug ("scanner.vala:671: Description: %s", _tmp218_);
+ g_debug ("scanner.vala:688: Description: %s", _tmp218_);
}
_g_free0 (s);
}
@@ -5353,10 +5448,10 @@ static void scanner_close_device (Scanner* self) {
SANE_Handle _tmp2_;
_tmp1_ = self->priv->handle;
sane_cancel (_tmp1_);
- g_debug ("scanner.vala:698: sane_cancel ()");
+ g_debug ("scanner.vala:715: sane_cancel ()");
_tmp2_ = self->priv->handle;
sane_close (_tmp2_);
- g_debug ("scanner.vala:701: sane_close ()");
+ g_debug ("scanner.vala:718: sane_close ()");
self->priv->have_handle = FALSE;
_g_hash_table_unref0 (self->priv->options);
self->priv->options = NULL;
@@ -5459,11 +5554,11 @@ static gboolean scanner_handle_requests (Scanner* self) {
_request_unref0 (request);
return result;
}
- g_debug ("scanner.vala:736: Processing request");
+ g_debug ("scanner.vala:753: Processing request");
_tmp14_ = request_count;
request_count = _tmp14_ + 1;
_tmp15_ = request;
- if (IS_REQUEST_START_SCAN (_tmp15_)) {
+ if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, TYPE_REQUEST_START_SCAN)) {
Request* _tmp16_;
RequestStartScan* _tmp17_;
RequestStartScan* r;
@@ -5471,7 +5566,7 @@ static gboolean scanner_handle_requests (Scanner* self) {
ScanJob* _tmp19_;
ScanJob* _tmp20_;
_tmp16_ = request;
- _tmp17_ = _request_ref0 (REQUEST_START_SCAN (_tmp16_));
+ _tmp17_ = _request_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, TYPE_REQUEST_START_SCAN, RequestStartScan));
r = _tmp17_;
_tmp18_ = r;
_tmp19_ = _tmp18_->job;
@@ -5481,12 +5576,12 @@ static gboolean scanner_handle_requests (Scanner* self) {
} else {
Request* _tmp21_;
_tmp21_ = request;
- if (IS_REQUEST_CANCEL (_tmp21_)) {
+ if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp21_, TYPE_REQUEST_CANCEL)) {
scanner_fail_scan (self, (gint) SANE_STATUS_CANCELLED, "Scan cancelled - do not report this error");
} else {
Request* _tmp22_;
_tmp22_ = request;
- if (IS_REQUEST_QUIT (_tmp22_)) {
+ if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp22_, TYPE_REQUEST_QUIT)) {
scanner_close_device (self);
result = FALSE;
_request_unref0 (request);
@@ -5536,7 +5631,7 @@ static void scanner_do_open (Scanner* self) {
g_return_if_fail (self != NULL);
_tmp0_ = self->priv->job_queue;
_tmp1_ = _tmp0_->data;
- _tmp2_ = _scan_job_ref0 (SCAN_JOB ((ScanJob*) _tmp1_));
+ _tmp2_ = _scan_job_ref0 (G_TYPE_CHECK_INSTANCE_CAST ((ScanJob*) _tmp1_, TYPE_SCAN_JOB, ScanJob));
job = _tmp2_;
self->priv->line_count = 0;
self->priv->pass_number = 0;
@@ -5567,7 +5662,7 @@ static void scanner_do_open (Scanner* self) {
_tmp12_ = _tmp11_->device;
if (_tmp12_ == NULL) {
const gchar* _tmp13_ = NULL;
- g_warning ("scanner.vala:771: No scan device available");
+ g_warning ("scanner.vala:788: No scan device available");
_tmp13_ = _ ("No scanners available. Please connect a scanner.");
scanner_fail_scan (self, 0, _tmp13_);
_scan_job_unref0 (job);
@@ -5589,7 +5684,7 @@ static void scanner_do_open (Scanner* self) {
}
_tmp18_ = self->priv->handle;
sane_close (_tmp18_);
- g_debug ("scanner.vala:788: sane_close ()");
+ g_debug ("scanner.vala:805: sane_close ()");
self->priv->have_handle = FALSE;
}
_g_free0 (self->priv->current_device);
@@ -5610,7 +5705,7 @@ static void scanner_do_open (Scanner* self) {
_tmp28_ = status;
_tmp29_ = sane_status_to_string (_tmp28_);
_tmp30_ = _tmp29_;
- g_debug ("scanner.vala:797: sane_open (\"%s\") -> %s", _tmp27_, _tmp30_);
+ g_debug ("scanner.vala:814: sane_open (\"%s\") -> %s", _tmp27_, _tmp30_);
_g_free0 (_tmp30_);
_tmp31_ = status;
if (_tmp31_ != SANE_STATUS_GOOD) {
@@ -5620,7 +5715,7 @@ static void scanner_do_open (Scanner* self) {
const gchar* _tmp35_ = NULL;
_tmp32_ = status;
_tmp33_ = sane_strstatus (_tmp32_);
- g_warning ("scanner.vala:801: Unable to get open device: %s", _tmp33_);
+ g_warning ("scanner.vala:818: Unable to get open device: %s", _tmp33_);
_tmp34_ = status;
_tmp35_ = _ ("Unable to connect to scanner");
scanner_fail_scan (self, (gint) _tmp34_, _tmp35_);
@@ -5668,14 +5763,14 @@ static void scanner_do_get_option (Scanner* self) {
g_return_if_fail (self != NULL);
_tmp0_ = self->priv->job_queue;
_tmp1_ = _tmp0_->data;
- _tmp2_ = _scan_job_ref0 (SCAN_JOB ((ScanJob*) _tmp1_));
+ _tmp2_ = _scan_job_ref0 (G_TYPE_CHECK_INSTANCE_CAST ((ScanJob*) _tmp1_, TYPE_SCAN_JOB, ScanJob));
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:818: sane_get_option_descriptor (%d)", (gint) _tmp6_);
+ g_debug ("scanner.vala:835: sane_get_option_descriptor (%d)", (gint) _tmp6_);
_tmp7_ = self->priv->option_index;
index = _tmp7_;
_tmp8_ = self->priv->option_index;
@@ -5874,7 +5969,7 @@ static void scanner_do_get_option (Scanner* self) {
_tmp54__length1 = flatbed_sources_length1;
_tmp55_ = scanner_set_constrained_string_option (self, _tmp51_, _tmp52_, _tmp53_, _tmp54_, _tmp54__length1, NULL);
if (!_tmp55_) {
- g_warning ("scanner.vala:872: Unable to set single page source, please file a bug");
+ g_warning ("scanner.vala:889: Unable to set single page source, please file a bug");
}
}
break;
@@ -5907,7 +6002,7 @@ static void scanner_do_get_option (Scanner* self) {
_tmp64__length1 = adf_sources_length1;
_tmp65_ = scanner_set_constrained_string_option (self, _tmp61_, _tmp62_, _tmp63_, _tmp64_, _tmp64__length1, NULL);
if (!(!_tmp65_)) {
- g_warning ("scanner.vala:877: Unable to set front ADF source, please file a bug");
+ g_warning ("scanner.vala:894: Unable to set front ADF source, please file a bug");
}
}
break;
@@ -5940,7 +6035,7 @@ static void scanner_do_get_option (Scanner* self) {
_tmp74__length1 = adf_sources_length1;
_tmp75_ = scanner_set_constrained_string_option (self, _tmp71_, _tmp72_, _tmp73_, _tmp74_, _tmp74__length1, NULL);
if (!_tmp75_) {
- g_warning ("scanner.vala:882: Unable to set back ADF source, please file a bug");
+ g_warning ("scanner.vala:899: Unable to set back ADF source, please file a bug");
}
}
break;
@@ -5973,7 +6068,7 @@ static void scanner_do_get_option (Scanner* self) {
_tmp84__length1 = adf_sources_length1;
_tmp85_ = scanner_set_constrained_string_option (self, _tmp81_, _tmp82_, _tmp83_, _tmp84_, _tmp84__length1, NULL);
if (!_tmp85_) {
- g_warning ("scanner.vala:887: Unable to set duplex ADF source, please file a bug");
+ g_warning ("scanner.vala:904: Unable to set duplex ADF source, please file a bug");
}
}
break;
@@ -6122,7 +6217,7 @@ static void scanner_do_get_option (Scanner* self) {
_tmp130__length1 = color_scan_modes_length1;
_tmp131_ = scanner_set_constrained_string_option (self, _tmp127_, _tmp128_, _tmp129_, _tmp130_, _tmp130__length1, NULL);
if (!_tmp131_) {
- g_warning ("scanner.vala:933: Unable to set Color mode, please file a bug");
+ g_warning ("scanner.vala:950: Unable to set Color mode, please file a bug");
}
break;
}
@@ -6141,7 +6236,7 @@ static void scanner_do_get_option (Scanner* self) {
_tmp135__length1 = gray_scan_modes_length1;
_tmp136_ = scanner_set_constrained_string_option (self, _tmp132_, _tmp133_, _tmp134_, _tmp135_, _tmp135__length1, NULL);
if (!_tmp136_) {
- g_warning ("scanner.vala:937: Unable to set Gray mode, please file a bug");
+ g_warning ("scanner.vala:954: Unable to set Gray mode, please file a bug");
}
break;
}
@@ -6160,7 +6255,7 @@ static void scanner_do_get_option (Scanner* self) {
_tmp140__length1 = lineart_scan_modes_length1;
_tmp141_ = scanner_set_constrained_string_option (self, _tmp137_, _tmp138_, _tmp139_, _tmp140_, _tmp140__length1, NULL);
if (!_tmp141_) {
- g_warning ("scanner.vala:941: Unable to set Lineart mode, please file a bug");
+ g_warning ("scanner.vala:958: Unable to set Lineart mode, please file a bug");
}
break;
}
@@ -6264,7 +6359,7 @@ static void scanner_do_get_option (Scanner* self) {
_tmp178__length1 = disable_compression_names_length1;
_tmp179_ = scanner_set_constrained_string_option (self, _tmp175_, _tmp176_, _tmp177_, _tmp178_, _tmp178__length1, NULL);
if (!_tmp179_) {
- g_warning ("scanner.vala:977: Unable to disable compression, please file a bug");
+ g_warning ("scanner.vala:994: 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);
}
@@ -6654,7 +6749,7 @@ static void scanner_do_get_option (Scanner* self) {
_tmp342_ = _tmp341_->name;
_tmp343_ = g_strdup (_tmp342_);
_tmp344_ = index;
- g_hash_table_insert (_tmp340_, _tmp343_, GINT_TO_POINTER ((gint) _tmp344_));
+ g_hash_table_insert (_tmp340_, _tmp343_, (gpointer) ((gintptr) ((gint) _tmp344_)));
_scan_job_unref0 (job);
}
@@ -6674,7 +6769,7 @@ static SANE_Option_Descriptor* scanner_get_option_by_name (Scanner* self, SANE_H
_tmp0_ = self->priv->options;
_tmp1_ = name;
_tmp2_ = g_hash_table_lookup (_tmp0_, _tmp1_);
- _vala_index = GPOINTER_TO_INT (_tmp2_);
+ _vala_index = (gint) ((gintptr) _tmp2_);
_tmp3_ = _vala_index;
if (_tmp3_ == 0) {
result = NULL;
@@ -6741,7 +6836,7 @@ static void scanner_do_start (Scanner* self) {
_tmp6_ = status;
_tmp7_ = sane_status_to_string (_tmp6_);
_tmp8_ = _tmp7_;
- g_debug ("scanner.vala:1124: sane_start (page=%d, pass=%d) -> %s", _tmp4_, _tmp5_, _tmp8_);
+ g_debug ("scanner.vala:1141: sane_start (page=%d, pass=%d) -> %s", _tmp4_, _tmp5_, _tmp8_);
_g_free0 (_tmp8_);
_tmp9_ = status;
if (_tmp9_ == SANE_STATUS_GOOD) {
@@ -6758,7 +6853,7 @@ static void scanner_do_start (Scanner* self) {
const gchar* _tmp14_ = NULL;
_tmp11_ = status;
_tmp12_ = sane_strstatus (_tmp11_);
- g_warning ("scanner.vala:1131: Unable to start device: %s", _tmp12_);
+ g_warning ("scanner.vala:1148: Unable to start device: %s", _tmp12_);
_tmp13_ = status;
_tmp14_ = _ ("Unable to start scan");
scanner_fail_scan (self, (gint) _tmp13_, _tmp14_);
@@ -6881,11 +6976,11 @@ static void scanner_do_get_parameters (Scanner* self) {
gchar* _tmp67_;
gint _tmp68_;
gint _tmp69_;
- SANE_Parameters _tmp74_;
- gint _tmp75_;
+ SANE_Parameters _tmp76_;
+ gint _tmp77_;
gint buffer_size;
- gint _tmp76_;
- guchar* _tmp77_ = NULL;
+ gint _tmp78_;
+ guchar* _tmp79_ = NULL;
g_return_if_fail (self != NULL);
_tmp0_ = self->priv->handle;
_tmp2_ = sane_get_parameters (_tmp0_, &_tmp1_);
@@ -6894,7 +6989,7 @@ static void scanner_do_get_parameters (Scanner* self) {
_tmp3_ = status;
_tmp4_ = sane_status_to_string (_tmp3_);
_tmp5_ = _tmp4_;
- g_debug ("scanner.vala:1141: sane_get_parameters () -> %s", _tmp5_);
+ g_debug ("scanner.vala:1158: sane_get_parameters () -> %s", _tmp5_);
_g_free0 (_tmp5_);
_tmp6_ = status;
if (_tmp6_ != SANE_STATUS_GOOD) {
@@ -6904,7 +6999,7 @@ static void scanner_do_get_parameters (Scanner* self) {
const gchar* _tmp10_ = NULL;
_tmp7_ = status;
_tmp8_ = sane_strstatus (_tmp7_);
- g_warning ("scanner.vala:1144: Unable to get device parameters: %s", _tmp8_);
+ g_warning ("scanner.vala:1161: Unable to get device parameters: %s", _tmp8_);
_tmp9_ = status;
_tmp10_ = _ ("Error communicating with scanner");
scanner_fail_scan (self, (gint) _tmp9_, _tmp10_);
@@ -6912,7 +7007,7 @@ static void scanner_do_get_parameters (Scanner* self) {
}
_tmp11_ = self->priv->job_queue;
_tmp12_ = _tmp11_->data;
- _tmp13_ = _scan_job_ref0 (SCAN_JOB ((ScanJob*) _tmp12_));
+ _tmp13_ = _scan_job_ref0 (G_TYPE_CHECK_INSTANCE_CAST ((ScanJob*) _tmp12_, TYPE_SCAN_JOB, ScanJob));
job = _tmp13_;
_tmp15_ = self->priv->parameters;
_tmp16_ = _tmp15_.last_frame;
@@ -6934,7 +7029,7 @@ static void scanner_do_get_parameters (Scanner* self) {
_tmp27_ = _tmp26_.lines;
_tmp28_ = self->priv->parameters;
_tmp29_ = _tmp28_.depth;
- g_debug ("scanner.vala:1153: Parameters: format=%s last_frame=%s bytes_per_line=" \
+ g_debug ("scanner.vala:1170: 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 ();
@@ -7014,26 +7109,30 @@ static void scanner_do_get_parameters (Scanner* self) {
_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_);
+ ScanJob* _tmp70_;
+ gint _tmp71_;
+ ScanPageInfo* _tmp72_;
+ NotifyGotPageInfo* _tmp73_;
+ NotifyGotPageInfo* _tmp74_;
+ gint _tmp75_;
+ _tmp70_ = job;
+ _tmp71_ = _tmp70_->id;
+ _tmp72_ = info;
+ _tmp73_ = notify_got_page_info_new (_tmp71_, _tmp72_);
+ _tmp74_ = _tmp73_;
+ scanner_notify (self, (Notify*) _tmp74_);
+ _notify_unref0 (_tmp74_);
+ _tmp75_ = self->priv->page_number;
+ self->priv->notified_page = _tmp75_;
+ }
+ _tmp76_ = self->priv->parameters;
+ _tmp77_ = _tmp76_.bytes_per_line;
+ buffer_size = _tmp77_ + 1;
+ _tmp78_ = buffer_size;
+ _tmp79_ = g_new0 (guchar, _tmp78_);
self->priv->buffer = (g_free (self->priv->buffer), NULL);
- self->priv->buffer = _tmp77_;
- self->priv->buffer_length1 = _tmp76_;
+ self->priv->buffer = _tmp79_;
+ self->priv->buffer_length1 = _tmp78_;
self->priv->_buffer_size_ = self->priv->buffer_length1;
self->priv->n_used = 0;
self->priv->line_count = 0;
@@ -7045,56 +7144,64 @@ static void scanner_do_get_parameters (Scanner* self) {
static void scanner_do_complete_page (Scanner* self) {
- NotifyPageDone* _tmp0_;
- NotifyPageDone* _tmp1_;
- GList* _tmp2_;
- gconstpointer _tmp3_;
- ScanJob* _tmp4_;
+ GList* _tmp0_;
+ gconstpointer _tmp1_;
+ ScanJob* _tmp2_;
ScanJob* job;
- SANE_Parameters _tmp5_;
- gboolean _tmp6_;
- ScanJob* _tmp8_;
- ScanType _tmp9_;
- SANE_Handle _tmp13_;
+ ScanJob* _tmp3_;
+ gint _tmp4_;
+ NotifyPageDone* _tmp5_;
+ NotifyPageDone* _tmp6_;
+ SANE_Parameters _tmp7_;
+ gboolean _tmp8_;
+ ScanJob* _tmp10_;
+ ScanType _tmp11_;
+ SANE_Handle _tmp17_;
g_return_if_fail (self != NULL);
- _tmp0_ = notify_page_done_new ();
- _tmp1_ = _tmp0_;
- scanner_notify (self, (Notify*) _tmp1_);
- _notify_unref0 (_tmp1_);
- _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;
+ _tmp0_ = self->priv->job_queue;
+ _tmp1_ = _tmp0_->data;
+ _tmp2_ = _scan_job_ref0 (G_TYPE_CHECK_INSTANCE_CAST ((ScanJob*) _tmp1_, TYPE_SCAN_JOB, ScanJob));
+ job = _tmp2_;
+ _tmp3_ = job;
+ _tmp4_ = _tmp3_->id;
+ _tmp5_ = notify_page_done_new (_tmp4_);
+ _tmp6_ = _tmp5_;
+ scanner_notify (self, (Notify*) _tmp6_);
+ _notify_unref0 (_tmp6_);
+ _tmp7_ = self->priv->parameters;
+ _tmp8_ = _tmp7_.last_frame;
+ if (!_tmp8_) {
+ gint _tmp9_;
+ _tmp9_ = self->priv->pass_number;
+ self->priv->pass_number = _tmp9_ + 1;
self->priv->state = SCAN_STATE_START;
_scan_job_unref0 (job);
return;
}
- _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;
+ _tmp10_ = job;
+ _tmp11_ = _tmp10_->type;
+ if (_tmp11_ != SCAN_TYPE_SINGLE) {
+ gint _tmp12_;
+ ScanJob* _tmp13_;
+ gint _tmp14_;
+ NotifyPageDone* _tmp15_;
+ NotifyPageDone* _tmp16_;
+ _tmp12_ = self->priv->page_number;
+ self->priv->page_number = _tmp12_ + 1;
self->priv->pass_number = 0;
- _tmp11_ = notify_page_done_new ();
- _tmp12_ = _tmp11_;
- scanner_notify (self, (Notify*) _tmp12_);
- _notify_unref0 (_tmp12_);
+ _tmp13_ = job;
+ _tmp14_ = _tmp13_->id;
+ _tmp15_ = notify_page_done_new (_tmp14_);
+ _tmp16_ = _tmp15_;
+ scanner_notify (self, (Notify*) _tmp16_);
+ _notify_unref0 (_tmp16_);
self->priv->state = SCAN_STATE_START;
_scan_job_unref0 (job);
return;
}
- _tmp13_ = self->priv->handle;
- sane_cancel (_tmp13_);
- g_debug ("scanner.vala:1213: sane_cancel ()");
+ _tmp17_ = self->priv->handle;
+ sane_cancel (_tmp17_);
+ g_debug ("scanner.vala:1230: sane_cancel ()");
scanner_do_complete_document (self);
_scan_job_unref0 (job);
}
@@ -7139,7 +7246,7 @@ static void scanner_do_read (Scanner* self) {
g_return_if_fail (self != NULL);
_tmp0_ = self->priv->job_queue;
_tmp1_ = _tmp0_->data;
- _tmp2_ = _scan_job_ref0 (SCAN_JOB ((ScanJob*) _tmp1_));
+ _tmp2_ = _scan_job_ref0 (G_TYPE_CHECK_INSTANCE_CAST ((ScanJob*) _tmp1_, TYPE_SCAN_JOB, ScanJob));
job = _tmp2_;
_tmp3_ = self->priv->buffer;
_tmp3__length1 = self->priv->buffer_length1;
@@ -7160,7 +7267,7 @@ static void scanner_do_read (Scanner* self) {
_tmp14_ = sane_status_to_string (_tmp13_);
_tmp15_ = _tmp14_;
_tmp16_ = n_read;
- g_debug ("scanner.vala:1228: sane_read (%d) -> (%s, %d)", _tmp12_, _tmp15_, (gint) _tmp16_);
+ g_debug ("scanner.vala:1245: sane_read (%d) -> (%s, %d)", _tmp12_, _tmp15_, (gint) _tmp16_);
_g_free0 (_tmp15_);
_tmp17_ = status;
if (_tmp17_ == SANE_STATUS_EOF) {
@@ -7190,13 +7297,13 @@ static void scanner_do_read (Scanner* self) {
_tmp25_ = self->priv->line_count;
_tmp26_ = self->priv->parameters;
_tmp27_ = _tmp26_.lines;
- g_warning ("scanner.vala:1234: Scan completed with %d lines, expected %d lines", _tmp25_, _tmp27_);
+ g_warning ("scanner.vala:1251: Scan completed with %d lines, expected %d lines", _tmp25_, _tmp27_);
}
_tmp28_ = self->priv->n_used;
if (_tmp28_ > 0) {
gint _tmp29_;
_tmp29_ = self->priv->n_used;
- g_warning ("scanner.vala:1236: Scan complete with %d bytes of unused data", _tmp29_);
+ g_warning ("scanner.vala:1253: Scan complete with %d bytes of unused data", _tmp29_);
}
scanner_do_complete_page (self);
_scan_job_unref0 (job);
@@ -7210,7 +7317,7 @@ static void scanner_do_read (Scanner* self) {
const gchar* _tmp34_ = NULL;
_tmp31_ = status;
_tmp32_ = sane_strstatus (_tmp31_);
- g_warning ("scanner.vala:1244: Unable to read frame from device: %s", _tmp32_);
+ g_warning ("scanner.vala:1261: Unable to read frame from device: %s", _tmp32_);
_tmp33_ = status;
_tmp34_ = _ ("Error communicating with scanner");
scanner_fail_scan (self, (gint) _tmp33_, _tmp34_);
@@ -7286,9 +7393,11 @@ static void scanner_do_read (Scanner* self) {
gboolean _tmp109_;
gboolean _tmp112_;
gboolean _tmp115_;
- ScanLine* _tmp160_;
- NotifyGotLine* _tmp161_;
- NotifyGotLine* _tmp162_;
+ ScanJob* _tmp160_;
+ gint _tmp161_;
+ ScanLine* _tmp162_;
+ NotifyGotLine* _tmp163_;
+ NotifyGotLine* _tmp164_;
_tmp45_ = scan_line_new ();
line = _tmp45_;
_tmp46_ = self->priv->parameters;
@@ -7642,11 +7751,13 @@ static void scanner_do_read (Scanner* self) {
_tmp159_ = _tmp158_->width;
_tmp157_->data_length = ((_tmp159_ * 2) + 7) / 8;
}
- _tmp160_ = line;
- _tmp161_ = notify_got_line_new (_tmp160_);
- _tmp162_ = _tmp161_;
- scanner_notify (self, (Notify*) _tmp162_);
- _notify_unref0 (_tmp162_);
+ _tmp160_ = job;
+ _tmp161_ = _tmp160_->id;
+ _tmp162_ = line;
+ _tmp163_ = notify_got_line_new (_tmp161_, _tmp162_);
+ _tmp164_ = _tmp163_;
+ scanner_notify (self, (Notify*) _tmp164_);
+ _notify_unref0 (_tmp164_);
_scan_line_unref0 (line);
}
_scan_job_unref0 (job);
@@ -7682,7 +7793,7 @@ static void* scanner_scan_thread (Scanner* self) {
_tmp2_ = status;
_tmp3_ = sane_status_to_string (_tmp2_);
_tmp4_ = _tmp3_;
- g_debug ("scanner.vala:1361: sane_init () -> %s", _tmp4_);
+ g_debug ("scanner.vala:1378: sane_init () -> %s", _tmp4_);
_g_free0 (_tmp4_);
_tmp5_ = status;
if (_tmp5_ != SANE_STATUS_GOOD) {
@@ -7690,7 +7801,7 @@ static void* scanner_scan_thread (Scanner* self) {
const gchar* _tmp7_ = NULL;
_tmp6_ = status;
_tmp7_ = sane_strstatus (_tmp6_);
- g_warning ("scanner.vala:1364: Unable to initialize SANE backend: %s", _tmp7_);
+ g_warning ("scanner.vala:1381: Unable to initialize SANE backend: %s", _tmp7_);
result = NULL;
return result;
}
@@ -7700,7 +7811,7 @@ static void* scanner_scan_thread (Scanner* self) {
_tmp11_ = SANE_VERSION_MINOR (_tmp10_);
_tmp12_ = version_code;
_tmp13_ = SANE_VERSION_BUILD (_tmp12_);
- g_debug ("scanner.vala:1367: SANE version %d.%d.%d", _tmp9_, _tmp11_, _tmp13_);
+ g_debug ("scanner.vala:1384: SANE version %d.%d.%d", _tmp9_, _tmp11_, _tmp13_);
scanner_redetect (self);
while (TRUE) {
gboolean _tmp14_ = FALSE;
@@ -7763,6 +7874,7 @@ static void* scanner_scan_thread (Scanner* self) {
static gpointer _scanner_scan_thread_gthread_func (gpointer self) {
gpointer result;
result = scanner_scan_thread (self);
+ scanner_unref (self);
return result;
}
@@ -7773,7 +7885,7 @@ void scanner_start (Scanner* self) {
{
GThread* _tmp0_ = NULL;
GThread* _tmp1_;
- _tmp0_ = g_thread_create (_scanner_scan_thread_gthread_func, self, TRUE, &_inner_error_);
+ _tmp0_ = g_thread_create (_scanner_scan_thread_gthread_func, scanner_ref (self), TRUE, &_inner_error_);
_tmp1_ = _tmp0_;
if (_inner_error_ != NULL) {
goto __catch14_g_error;
@@ -7790,7 +7902,7 @@ void scanner_start (Scanner* self) {
_inner_error_ = NULL;
_tmp2_ = e;
_tmp3_ = _tmp2_->message;
- g_critical ("scanner.vala:1418: Unable to create thread: %s", _tmp3_);
+ g_critical ("scanner.vala:1435: Unable to create thread: %s", _tmp3_);
_g_error_free0 (e);
}
__finally14:
@@ -7812,7 +7924,7 @@ void scanner_redetect (Scanner* self) {
return;
}
self->priv->need_redetect = TRUE;
- g_debug ("scanner.vala:1428: Requesting redetection of scan devices");
+ g_debug ("scanner.vala:1445: Requesting redetection of scan devices");
_tmp1_ = self->priv->request_queue;
_tmp2_ = request_redetect_new ();
g_async_queue_push (_tmp1_, (Request*) _tmp2_);
@@ -7947,28 +8059,30 @@ void scanner_scan (Scanner* self, const gchar* device, ScanOptions* options) {
RequestStartScan* request;
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_;
+ gint _tmp23_;
+ ScanJob* _tmp24_;
+ const gchar* _tmp25_;
+ gchar* _tmp26_;
+ ScanJob* _tmp27_;
+ ScanOptions* _tmp28_;
+ gint _tmp29_;
+ ScanJob* _tmp30_;
+ ScanOptions* _tmp31_;
+ ScanMode _tmp32_;
+ ScanJob* _tmp33_;
+ ScanOptions* _tmp34_;
+ gint _tmp35_;
+ ScanJob* _tmp36_;
+ ScanOptions* _tmp37_;
+ ScanType _tmp38_;
+ ScanJob* _tmp39_;
+ ScanOptions* _tmp40_;
+ gint _tmp41_;
+ ScanJob* _tmp42_;
+ ScanOptions* _tmp43_;
+ gint _tmp44_;
+ GAsyncQueue* _tmp45_;
+ Request* _tmp46_;
g_return_if_fail (self != NULL);
g_return_if_fail (options != NULL);
_tmp1_ = device;
@@ -7996,7 +8110,7 @@ void scanner_scan (Scanner* self, const gchar* device, ScanOptions* options) {
_tmp17_ = _tmp16_->paper_width;
_tmp18_ = options;
_tmp19_ = _tmp18_->paper_height;
- g_debug ("scanner.vala:1474: Scanner.scan (\"%s\", dpi=%d, scan_mode=%s, depth=%" \
+ g_debug ("scanner.vala:1491: 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_);
@@ -8006,48 +8120,55 @@ void scanner_scan (Scanner* self, const gchar* device, ScanOptions* options) {
_scan_job_unref0 (request->job);
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_);
+ _tmp23_ = self->job_id;
+ self->job_id = _tmp23_ + 1;
+ _tmp22_->id = _tmp23_;
+ _tmp24_ = request->job;
+ _tmp25_ = device;
+ _tmp26_ = g_strdup (_tmp25_);
+ _g_free0 (_tmp24_->device);
+ _tmp24_->device = _tmp26_;
+ _tmp27_ = request->job;
+ _tmp28_ = options;
+ _tmp29_ = _tmp28_->dpi;
+ _tmp27_->dpi = (gdouble) _tmp29_;
+ _tmp30_ = request->job;
+ _tmp31_ = options;
+ _tmp32_ = _tmp31_->scan_mode;
+ _tmp30_->scan_mode = _tmp32_;
+ _tmp33_ = request->job;
+ _tmp34_ = options;
+ _tmp35_ = _tmp34_->depth;
+ _tmp33_->depth = _tmp35_;
+ _tmp36_ = request->job;
+ _tmp37_ = options;
+ _tmp38_ = _tmp37_->type;
+ _tmp36_->type = _tmp38_;
+ _tmp39_ = request->job;
+ _tmp40_ = options;
+ _tmp41_ = _tmp40_->paper_width;
+ _tmp39_->page_width = _tmp41_;
+ _tmp42_ = request->job;
+ _tmp43_ = options;
+ _tmp44_ = _tmp43_->paper_height;
+ _tmp42_->page_height = _tmp44_;
+ _tmp45_ = self->priv->request_queue;
+ _tmp46_ = _request_ref0 ((Request*) request);
+ g_async_queue_push (_tmp45_, _tmp46_);
_request_unref0 (request);
}
void scanner_cancel (Scanner* self) {
- GAsyncQueue* _tmp0_;
- RequestCancel* _tmp1_;
+ gint _tmp0_;
+ GAsyncQueue* _tmp1_;
+ RequestCancel* _tmp2_;
g_return_if_fail (self != NULL);
- _tmp0_ = self->priv->request_queue;
- _tmp1_ = request_cancel_new ();
- g_async_queue_push (_tmp0_, (Request*) _tmp1_);
+ _tmp0_ = self->job_id;
+ self->first_job_id = _tmp0_;
+ _tmp1_ = self->priv->request_queue;
+ _tmp2_ = request_cancel_new ();
+ g_async_queue_push (_tmp1_, (Request*) _tmp2_);
}
@@ -8056,7 +8177,7 @@ void scanner_free (Scanner* self) {
RequestQuit* _tmp1_;
GThread* _tmp2_;
g_return_if_fail (self != NULL);
- g_debug ("scanner.vala:1496: Stopping scan thread");
+ g_debug ("scanner.vala:1515: Stopping scan thread");
_tmp0_ = self->priv->request_queue;
_tmp1_ = request_quit_new ();
g_async_queue_push (_tmp0_, (Request*) _tmp1_);
@@ -8067,7 +8188,7 @@ void scanner_free (Scanner* self) {
g_thread_join (_tmp3_);
}
sane_exit ();
- g_debug ("scanner.vala:1504: sane_exit ()");
+ g_debug ("scanner.vala:1523: sane_exit ()");
}
@@ -8265,7 +8386,7 @@ static void scanner_instance_init (Scanner * self) {
static void scanner_finalize (Scanner* obj) {
Scanner * self;
- self = SCANNER (obj);
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SCANNER, Scanner);
_g_async_queue_unref0 (self->priv->request_queue);
_g_async_queue_unref0 (self->priv->notify_queue);
_g_async_queue_unref0 (self->priv->authorize_queue);
diff --git a/src/scanner.vala b/src/scanner.vala
index 158fa50..03f1e24 100644
--- a/src/scanner.vala
+++ b/src/scanner.vala
@@ -84,6 +84,7 @@ public class ScanOptions
private class ScanJob
{
+ public int id;
public string device;
public double dpi;
public ScanMode scan_mode;
@@ -167,23 +168,36 @@ private class NotifyExpectPage : Notify
private class NotifyGotPageInfo : Notify
{
- public NotifyGotPageInfo (ScanPageInfo info) { this.info = info; }
+ public NotifyGotPageInfo (int job_id, ScanPageInfo info) { this.job_id = job_id; this.info = info; }
+ private int job_id;
private ScanPageInfo info;
- public override void run (Scanner scanner) { scanner.got_page_info (info); }
+ public override void run (Scanner scanner)
+ {
+ if (job_id >= scanner.first_job_id && job_id < scanner.job_id)
+ scanner.got_page_info (info);
+ }
}
private class NotifyPageDone : Notify
{
- public override void run (Scanner scanner) { scanner.page_done (); }
+ public NotifyPageDone (int job_id) { this.job_id = job_id; }
+ private int job_id;
+ public override void run (Scanner scanner)
+ {
+ if (job_id >= scanner.first_job_id && job_id < scanner.job_id)
+ scanner.page_done ();
+ }
}
private class NotifyGotLine : Notify
{
- public NotifyGotLine (ScanLine line) { this.line = line; }
+ public NotifyGotLine (int job_id, ScanLine line) { this.job_id = job_id; this.line = line; }
+ private int job_id;
private ScanLine line;
public override void run (Scanner scanner)
{
- scanner.got_line (line);
+ if (job_id >= scanner.first_job_id && job_id < scanner.job_id)
+ scanner.got_line (line);
}
}
@@ -204,6 +218,10 @@ public class Scanner
/* Queue of responses to authorization requests */
private AsyncQueue<Credentials> authorize_queue;
+ /* ID for the current job */
+ public int first_job_id;
+ public int job_id;
+
private string? default_device;
private ScanState state;
@@ -278,7 +296,6 @@ public class Scanner
if ((scanning && !is_scanning) || (!scanning && is_scanning))
{
scanning = is_scanning;
- scanning_changed ();
notify (new NotifyScanningChanged ());
}
}
@@ -1172,7 +1189,7 @@ public class Scanner
if (page_number != notified_page)
{
- notify (new NotifyGotPageInfo (info));
+ notify (new NotifyGotPageInfo (job.id, info));
notified_page = page_number;
}
@@ -1187,10 +1204,10 @@ public class Scanner
private void do_complete_page ()
{
- notify (new NotifyPageDone ());
-
var job = (ScanJob) job_queue.data;
+ notify (new NotifyPageDone (job.id));
+
/* If multi-pass then scan another page */
if (!parameters.last_frame)
{
@@ -1204,7 +1221,7 @@ public class Scanner
{
page_number++;
pass_number = 0;
- notify (new NotifyPageDone ());
+ notify (new NotifyPageDone (job.id));
state = ScanState.START;
return;
}
@@ -1348,7 +1365,7 @@ public class Scanner
line.data_length = (line.width * 2 + 7) / 8;
}
- notify (new NotifyGotLine (line));
+ notify (new NotifyGotLine (job.id, line));
}
}
@@ -1476,6 +1493,7 @@ public class Scanner
get_scan_type_string (options.type), options.paper_width, options.paper_height);
var request = new RequestStartScan ();
request.job = new ScanJob ();
+ request.job.id = job_id++;
request.job.device = device;
request.job.dpi = options.dpi;
request.job.scan_mode = options.scan_mode;
@@ -1488,6 +1506,7 @@ public class Scanner
public void cancel ()
{
+ first_job_id = job_id;
request_queue.push (new RequestCancel ());
}
diff --git a/src/simple-scan.c b/src/simple-scan.c
index 4ead7e5..aa96f80 100644
--- a/src/simple-scan.c
+++ b/src/simple-scan.c
@@ -1,4 +1,4 @@
-/* simple-scan.c generated by valac 0.16.1, the Vala compiler
+/* simple-scan.c generated by valac 0.17.7, the Vala compiler
* generated from simple-scan.vala, do not modify */
/*
@@ -530,7 +530,7 @@ static void simple_scan_real_startup (GApplication* base) {
GUdevClient* _tmp20_;
ScanDevice* _tmp21_;
self = (SimpleScan*) base;
- G_APPLICATION_CLASS (simple_scan_parent_class)->startup ((GApplication*) GTK_APPLICATION (self));
+ G_APPLICATION_CLASS (simple_scan_parent_class)->startup ((GApplication*) G_TYPE_CHECK_INSTANCE_CAST (self, GTK_TYPE_APPLICATION, GtkApplication));
_tmp0_ = user_interface_new ();
_user_interface_unref0 (self->priv->ui);
self->priv->ui = _tmp0_;
@@ -611,7 +611,7 @@ static void simple_scan_real_activate (GApplication* base) {
UserInterface* _tmp0_;
Scanner* _tmp1_;
self = (SimpleScan*) base;
- G_APPLICATION_CLASS (simple_scan_parent_class)->activate ((GApplication*) GTK_APPLICATION (self));
+ G_APPLICATION_CLASS (simple_scan_parent_class)->activate ((GApplication*) G_TYPE_CHECK_INSTANCE_CAST (self, GTK_TYPE_APPLICATION, GtkApplication));
_tmp0_ = self->priv->ui;
user_interface_start (_tmp0_);
_tmp1_ = self->priv->scanner;
@@ -623,7 +623,7 @@ static void simple_scan_real_shutdown (GApplication* base) {
SimpleScan * self;
Scanner* _tmp0_;
self = (SimpleScan*) base;
- G_APPLICATION_CLASS (simple_scan_parent_class)->shutdown ((GApplication*) GTK_APPLICATION (self));
+ G_APPLICATION_CLASS (simple_scan_parent_class)->shutdown ((GApplication*) G_TYPE_CHECK_INSTANCE_CAST (self, GTK_TYPE_APPLICATION, GtkApplication));
_book_unref0 (self->priv->book);
self->priv->book = NULL;
_user_interface_unref0 (self->priv->ui);
@@ -1649,115 +1649,95 @@ static void simple_scan_email_cb (SimpleScan* self, UserInterface* ui, const gch
static void simple_scan_log_cb (const gchar* log_domain, GLogLevelFlags log_level, const gchar* message) {
- FILE* _tmp0_;
- GLogLevelFlags _tmp14_;
+ gchar* prefix = NULL;
+ GLogLevelFlags _tmp0_;
+ FILE* _tmp8_;
+ GTimer* _tmp9_;
+ gdouble _tmp10_ = 0.0;
+ const gchar* _tmp11_;
+ const gchar* _tmp12_;
+ gboolean _tmp13_;
g_return_if_fail (message != NULL);
- _tmp0_ = simple_scan_log_file;
- if (_tmp0_ != NULL) {
- gchar* prefix = NULL;
- 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* _tmp2_;
- _tmp2_ = g_strdup ("ERROR:");
- _g_free0 (prefix);
- prefix = _tmp2_;
- break;
- }
- case G_LOG_LEVEL_CRITICAL:
- {
- gchar* _tmp3_;
- _tmp3_ = g_strdup ("CRITICAL:");
- _g_free0 (prefix);
- prefix = _tmp3_;
- break;
- }
- case G_LOG_LEVEL_WARNING:
- {
- gchar* _tmp4_;
- _tmp4_ = g_strdup ("WARNING:");
- _g_free0 (prefix);
- prefix = _tmp4_;
- break;
- }
- case G_LOG_LEVEL_MESSAGE:
- {
- gchar* _tmp5_;
- _tmp5_ = g_strdup ("MESSAGE:");
- _g_free0 (prefix);
- prefix = _tmp5_;
- break;
- }
- case G_LOG_LEVEL_INFO:
- {
- gchar* _tmp6_;
- _tmp6_ = g_strdup ("INFO:");
- _g_free0 (prefix);
- prefix = _tmp6_;
- break;
- }
- case G_LOG_LEVEL_DEBUG:
- {
- gchar* _tmp7_;
- _tmp7_ = g_strdup ("DEBUG:");
- _g_free0 (prefix);
- prefix = _tmp7_;
- break;
- }
- default:
- {
- gchar* _tmp8_;
- _tmp8_ = g_strdup ("LOG:");
- _g_free0 (prefix);
- prefix = _tmp8_;
- break;
- }
+ _tmp0_ = log_level;
+ switch (_tmp0_ & G_LOG_LEVEL_MASK) {
+ case G_LOG_LEVEL_ERROR:
+ {
+ gchar* _tmp1_;
+ _tmp1_ = g_strdup ("ERROR:");
+ _g_free0 (prefix);
+ prefix = _tmp1_;
+ break;
}
- _tmp9_ = simple_scan_log_file;
- _tmp10_ = simple_scan_log_timer;
- _tmp11_ = g_timer_elapsed (_tmp10_, NULL);
- _tmp12_ = prefix;
- _tmp13_ = message;
- fprintf (_tmp9_, "[%+.2fs] %s %s\n", _tmp11_, _tmp12_, _tmp13_);
- _g_free0 (prefix);
- }
- _tmp14_ = log_level;
- if ((_tmp14_ & G_LOG_LEVEL_DEBUG) != 0) {
- gboolean _tmp15_;
- _tmp15_ = simple_scan_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);
+ case G_LOG_LEVEL_CRITICAL:
+ {
+ gchar* _tmp2_;
+ _tmp2_ = g_strdup ("CRITICAL:");
+ _g_free0 (prefix);
+ prefix = _tmp2_;
+ break;
}
- } else {
- 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);
+ case G_LOG_LEVEL_WARNING:
+ {
+ gchar* _tmp3_;
+ _tmp3_ = g_strdup ("WARNING:");
+ _g_free0 (prefix);
+ prefix = _tmp3_;
+ break;
+ }
+ case G_LOG_LEVEL_MESSAGE:
+ {
+ gchar* _tmp4_;
+ _tmp4_ = g_strdup ("MESSAGE:");
+ _g_free0 (prefix);
+ prefix = _tmp4_;
+ break;
+ }
+ case G_LOG_LEVEL_INFO:
+ {
+ gchar* _tmp5_;
+ _tmp5_ = g_strdup ("INFO:");
+ _g_free0 (prefix);
+ prefix = _tmp5_;
+ break;
+ }
+ case G_LOG_LEVEL_DEBUG:
+ {
+ gchar* _tmp6_;
+ _tmp6_ = g_strdup ("DEBUG:");
+ _g_free0 (prefix);
+ prefix = _tmp6_;
+ break;
+ }
+ default:
+ {
+ gchar* _tmp7_;
+ _tmp7_ = g_strdup ("LOG:");
+ _g_free0 (prefix);
+ prefix = _tmp7_;
+ break;
+ }
+ }
+ _tmp8_ = simple_scan_log_file;
+ _tmp9_ = simple_scan_log_timer;
+ _tmp10_ = g_timer_elapsed (_tmp9_, NULL);
+ _tmp11_ = prefix;
+ _tmp12_ = message;
+ fprintf (_tmp8_, "[%+.2fs] %s %s\n", _tmp10_, _tmp11_, _tmp12_);
+ _tmp13_ = simple_scan_debug_enabled;
+ if (_tmp13_) {
+ FILE* _tmp14_;
+ GTimer* _tmp15_;
+ gdouble _tmp16_ = 0.0;
+ const gchar* _tmp17_;
+ const gchar* _tmp18_;
+ _tmp14_ = stderr;
+ _tmp15_ = simple_scan_log_timer;
+ _tmp16_ = g_timer_elapsed (_tmp15_, NULL);
+ _tmp17_ = prefix;
+ _tmp18_ = message;
+ fprintf (_tmp14_, "[%+.2fs] %s %s\n", _tmp16_, _tmp17_, _tmp18_);
}
+ _g_free0 (prefix);
}
@@ -2427,7 +2407,7 @@ gint simple_scan_main (gchar** args, int args_length1) {
simple_scan_log_file = _tmp46_;
g_log_set_default_handler (_simple_scan_log_cb_glog_func, NULL);
_tmp47_ = getpid ();
- g_debug ("simple-scan.vala:593: Starting Simple Scan %s, PID=%i", VERSION, (gint) _tmp47_);
+ g_debug ("simple-scan.vala:582: Starting Simple Scan %s, PID=%i", VERSION, (gint) _tmp47_);
_tmp48_ = device;
_tmp49_ = simple_scan_new (_tmp48_);
app = _tmp49_;
@@ -2467,7 +2447,7 @@ static void simple_scan_instance_init (SimpleScan * self) {
static void simple_scan_finalize (GObject* obj) {
SimpleScan * self;
- self = SIMPLE_SCAN (obj);
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SIMPLE_SCAN, SimpleScan);
_scan_device_unref0 (self->priv->default_device);
_g_object_unref0 (self->priv->udev_client);
_user_interface_unref0 (self->priv->ui);
diff --git a/src/simple-scan.vala b/src/simple-scan.vala
index 0cc2c8d..1176053 100644
--- a/src/simple-scan.vala
+++ b/src/simple-scan.vala
@@ -91,7 +91,7 @@ public class SimpleScan : Gtk.Application
udev_client = null;
scanner.free ();
}
-
+
private void update_scan_devices_cb (Scanner scanner, List<ScanDevice> devices)
{
var devices_copy = devices.copy ();
@@ -242,7 +242,7 @@ public class SimpleScan : Gtk.Application
return profile.filename;
#else
return null;
-#endif
+#endif
}
private void scanner_page_info_cb (Scanner scanner, ScanPageInfo info)
@@ -418,54 +418,43 @@ public class SimpleScan : Gtk.Application
private static void log_cb (string? log_domain, LogLevelFlags log_level, string message)
{
- /* Log everything to a file */
- if (log_file != null)
- {
- string prefix;
-
- switch (log_level & LogLevelFlags.LEVEL_MASK)
- {
- case LogLevelFlags.LEVEL_ERROR:
- prefix = "ERROR:";
- break;
- case LogLevelFlags.LEVEL_CRITICAL:
- prefix = "CRITICAL:";
- break;
- case LogLevelFlags.LEVEL_WARNING:
- prefix = "WARNING:";
- break;
- case LogLevelFlags.LEVEL_MESSAGE:
- prefix = "MESSAGE:";
- break;
- case LogLevelFlags.LEVEL_INFO:
- prefix = "INFO:";
- break;
- case LogLevelFlags.LEVEL_DEBUG:
- prefix = "DEBUG:";
- break;
- default:
- prefix = "LOG:";
- break;
- }
+ string prefix;
- log_file.printf ("[%+.2fs] %s %s\n", log_timer.elapsed (), prefix, message);
- }
-
- /* Only show debug if requested */
- if ((log_level & LogLevelFlags.LEVEL_DEBUG) != 0)
+ switch (log_level & LogLevelFlags.LEVEL_MASK)
{
- if (debug_enabled)
- Log.default_handler (log_domain, log_level, message);
+ case LogLevelFlags.LEVEL_ERROR:
+ prefix = "ERROR:";
+ break;
+ case LogLevelFlags.LEVEL_CRITICAL:
+ prefix = "CRITICAL:";
+ break;
+ case LogLevelFlags.LEVEL_WARNING:
+ prefix = "WARNING:";
+ break;
+ case LogLevelFlags.LEVEL_MESSAGE:
+ prefix = "MESSAGE:";
+ break;
+ case LogLevelFlags.LEVEL_INFO:
+ prefix = "INFO:";
+ break;
+ case LogLevelFlags.LEVEL_DEBUG:
+ prefix = "DEBUG:";
+ break;
+ default:
+ prefix = "LOG:";
+ break;
}
- else
- Log.default_handler (log_domain, log_level, message);
+
+ log_file.printf ("[%+.2fs] %s %s\n", log_timer.elapsed (), prefix, message);
+ if (debug_enabled)
+ stderr.printf ("[%+.2fs] %s %s\n", log_timer.elapsed (), prefix, message);
}
private void on_uevent (GUdev.Client client, string action, GUdev.Device device)
{
scanner.redetect ();
}
-
+
private static void fix_pdf (string filename) throws Error
{
uint8[] data;
@@ -522,7 +511,7 @@ public class SimpleScan : Gtk.Application
line_number++;
offset = end_offset;
}
-
+
if (FileUtils.rename (filename, filename + "~") >= 0)
FileUtils.rename (filename + ".fixed", filename);
}
@@ -569,7 +558,7 @@ public class SimpleScan : Gtk.Application
catch (Error e)
{
stderr.printf ("Error fixing PDF file: %s", e.message);
- return Posix.EXIT_FAILURE;
+ return Posix.EXIT_FAILURE;
}
return Posix.EXIT_SUCCESS;
}
diff --git a/src/ui.c b/src/ui.c
index da21602..45be640 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -1,4 +1,4 @@
-/* ui.c generated by valac 0.16.1, the Vala compiler
+/* ui.c generated by valac 0.17.7, the Vala compiler
* generated from ui.vala, do not modify */
/*
@@ -51,16 +51,6 @@ typedef struct _UserInterfacePrivate UserInterfacePrivate;
typedef struct _ProgressBarDialog ProgressBarDialog;
typedef struct _ProgressBarDialogClass ProgressBarDialogClass;
-#define TYPE_DRAG_AND_DROP_HANDLER (drag_and_drop_handler_get_type ())
-#define DRAG_AND_DROP_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DRAG_AND_DROP_HANDLER, DragAndDropHandler))
-#define DRAG_AND_DROP_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DRAG_AND_DROP_HANDLER, DragAndDropHandlerClass))
-#define IS_DRAG_AND_DROP_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DRAG_AND_DROP_HANDLER))
-#define IS_DRAG_AND_DROP_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DRAG_AND_DROP_HANDLER))
-#define DRAG_AND_DROP_HANDLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DRAG_AND_DROP_HANDLER, DragAndDropHandlerClass))
-
-typedef struct _DragAndDropHandler DragAndDropHandler;
-typedef struct _DragAndDropHandlerClass DragAndDropHandlerClass;
-
#define TYPE_BOOK (book_get_type ())
#define BOOK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BOOK, Book))
#define BOOK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BOOK, BookClass))
@@ -82,10 +72,6 @@ typedef struct _BookView BookView;
typedef struct _BookViewClass BookViewClass;
#define TYPE_SCAN_DIRECTION (scan_direction_get_type ())
-#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
-#define _drag_and_drop_handler_unref0(var) ((var == NULL) ? NULL : (var = (drag_and_drop_handler_unref (var), NULL)))
-#define _g_free0(var) (var = (g_free (var), NULL))
-#define _book_unref0(var) ((var == NULL) ? NULL : (var = (book_unref (var), NULL)))
#define TYPE_PAGE (page_get_type ())
#define PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PAGE, Page))
@@ -96,6 +82,9 @@ typedef struct _BookViewClass BookViewClass;
typedef struct _Page Page;
typedef struct _PageClass PageClass;
+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
+#define _g_free0(var) (var = (g_free (var), NULL))
+#define _book_unref0(var) ((var == NULL) ? NULL : (var = (book_unref (var), NULL)))
#define TYPE_SCAN_DEVICE (scan_device_get_type ())
#define SCAN_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SCAN_DEVICE, ScanDevice))
@@ -129,11 +118,6 @@ typedef struct _ScanOptionsPrivate ScanOptionsPrivate;
#define _cairo_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_destroy (var), NULL)))
typedef struct _ParamSpecUserInterface ParamSpecUserInterface;
typedef struct _ProgressBarDialogPrivate ProgressBarDialogPrivate;
-typedef struct _DragAndDropHandlerPrivate DragAndDropHandlerPrivate;
-
-#define DRAG_AND_DROP_HANDLER_TYPE_TARGET_TYPE (drag_and_drop_handler_target_type_get_type ())
-#define _gtk_target_list_unref0(var) ((var == NULL) ? NULL : (var = (gtk_target_list_unref (var), NULL)))
-typedef struct _ParamSpecDragAndDropHandler ParamSpecDragAndDropHandler;
struct _UserInterface {
GTypeInstance parent_instance;
@@ -195,7 +179,6 @@ struct _UserInterfacePrivate {
gboolean user_selected_device;
GtkFileChooserDialog* save_dialog;
ProgressBarDialog* progress_dialog;
- DragAndDropHandler* dnd_handler;
gboolean have_error;
gchar* error_title;
gchar* error_text;
@@ -277,34 +260,9 @@ struct _ProgressBarDialogPrivate {
GtkProgressBar* bar;
};
-struct _DragAndDropHandler {
- GTypeInstance parent_instance;
- volatile int ref_count;
- DragAndDropHandlerPrivate * priv;
-};
-
-struct _DragAndDropHandlerClass {
- GTypeClass parent_class;
- void (*finalize) (DragAndDropHandler *self);
-};
-
-struct _DragAndDropHandlerPrivate {
- BookView* book_view;
-};
-
-typedef enum {
- DRAG_AND_DROP_HANDLER_TARGET_TYPE_IMAGE,
- DRAG_AND_DROP_HANDLER_TARGET_TYPE_URI
-} DragAndDropHandlerTargetType;
-
-struct _ParamSpecDragAndDropHandler {
- GParamSpec parent_instance;
-};
-
static gpointer user_interface_parent_class = NULL;
static gpointer progress_bar_dialog_parent_class = NULL;
-static gpointer drag_and_drop_handler_parent_class = NULL;
gpointer user_interface_ref (gpointer instance);
void user_interface_unref (gpointer instance);
@@ -314,13 +272,6 @@ void value_take_user_interface (GValue* value, gpointer v_object);
gpointer value_get_user_interface (const GValue* value);
GType user_interface_get_type (void) G_GNUC_CONST;
GType progress_bar_dialog_get_type (void) G_GNUC_CONST;
-gpointer drag_and_drop_handler_ref (gpointer instance);
-void drag_and_drop_handler_unref (gpointer instance);
-GParamSpec* param_spec_drag_and_drop_handler (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
-void value_set_drag_and_drop_handler (GValue* value, gpointer v_object);
-void value_take_drag_and_drop_handler (GValue* value, gpointer v_object);
-gpointer value_get_drag_and_drop_handler (const GValue* value);
-GType drag_and_drop_handler_get_type (void) G_GNUC_CONST;
gpointer book_ref (gpointer instance);
void book_unref (gpointer instance);
GParamSpec* param_spec_book (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
@@ -334,12 +285,6 @@ GType scan_direction_get_type (void) G_GNUC_CONST;
enum {
USER_INTERFACE_DUMMY_PROPERTY
};
-#define USER_INTERFACE_DEFAULT_TEXT_DPI 150
-#define USER_INTERFACE_DEFAULT_PHOTO_DPI 300
-UserInterface* user_interface_new (void);
-UserInterface* user_interface_construct (GType object_type);
-Book* book_new (void);
-Book* book_construct (GType object_type);
gpointer page_ref (gpointer instance);
void page_unref (gpointer instance);
GParamSpec* param_spec_page (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
@@ -351,6 +296,12 @@ static void user_interface_page_removed_cb (UserInterface* self, Book* book, Pag
static void _user_interface_page_removed_cb_book_page_removed (Book* _sender, Page* page, gpointer self);
static void user_interface_page_added_cb (UserInterface* self, Book* book, Page* page);
static void _user_interface_page_added_cb_book_page_added (Book* _sender, Page* page, gpointer self);
+#define USER_INTERFACE_DEFAULT_TEXT_DPI 150
+#define USER_INTERFACE_DEFAULT_PHOTO_DPI 300
+UserInterface* user_interface_new (void);
+UserInterface* user_interface_construct (GType object_type);
+Book* book_new (void);
+Book* book_construct (GType object_type);
static void user_interface_load (UserInterface* self);
static gboolean user_interface_find_scan_device (UserInterface* self, const gchar* device, GtkTreeIter* iter);
static void user_interface_show_error_dialog (UserInterface* self, const gchar* error_title, const gchar* error_text);
@@ -487,8 +438,6 @@ ProgressBarDialog* progress_bar_dialog_new (GtkWindow* parent, const gchar* titl
ProgressBarDialog* progress_bar_dialog_construct (GType object_type, GtkWindow* parent, const gchar* title);
static void user_interface_book_saving_cb (UserInterface* self, gint page_number);
static void _user_interface_book_saving_cb_book_saving (Book* _sender, gint i, gpointer self);
-DragAndDropHandler* drag_and_drop_handler_new (BookView* book_view);
-DragAndDropHandler* drag_and_drop_handler_construct (GType object_type, BookView* book_view);
static gboolean ___lambda2_ (UserInterface* self);
static gboolean ____lambda2__gsource_func (gpointer self);
void progress_bar_dialog_set_fraction (ProgressBarDialog* self, gdouble percent);
@@ -505,16 +454,6 @@ enum {
PROGRESS_BAR_DIALOG_DUMMY_PROPERTY
};
static void progress_bar_dialog_finalize (GObject* obj);
-#define DRAG_AND_DROP_HANDLER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_DRAG_AND_DROP_HANDLER, DragAndDropHandlerPrivate))
-enum {
- DRAG_AND_DROP_HANDLER_DUMMY_PROPERTY
-};
-static GType drag_and_drop_handler_target_type_get_type (void) G_GNUC_UNUSED;
-GtkWidget* book_view_get_event_source (BookView* self);
-static void drag_and_drop_handler_set_targets (DragAndDropHandler* self, GtkWidget* event_source);
-static void drag_and_drop_handler_on_drag_data_get (DragAndDropHandler* self, GdkDragContext* context, GtkSelectionData* selection, guint target_type, guint time);
-static void _drag_and_drop_handler_on_drag_data_get_gtk_widget_drag_data_get (GtkWidget* _sender, GdkDragContext* context, GtkSelectionData* selection_data, guint info, guint time_, gpointer self);
-static void drag_and_drop_handler_finalize (DragAndDropHandler* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
@@ -625,20 +564,19 @@ static void user_interface_show_error_dialog (UserInterface* self, const gchar*
GtkWindow* _tmp0_;
const gchar* _tmp1_;
GtkMessageDialog* _tmp2_;
- GtkMessageDialog* _tmp3_;
GtkMessageDialog* dialog;
- const gchar* _tmp4_;
+ const gchar* _tmp3_;
g_return_if_fail (self != NULL);
g_return_if_fail (error_title != NULL);
g_return_if_fail (error_text != NULL);
_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_;
+ g_object_ref_sink (_tmp2_);
+ dialog = _tmp2_;
gtk_dialog_add_button ((GtkDialog*) dialog, GTK_STOCK_CLOSE, 0);
- _tmp4_ = error_text;
- gtk_message_dialog_format_secondary_text (dialog, "%s", _tmp4_);
+ _tmp3_ = error_text;
+ gtk_message_dialog_format_secondary_text (dialog, "%s", _tmp3_);
gtk_widget_destroy ((GtkWidget*) dialog);
_g_object_unref0 (dialog);
}
@@ -1318,89 +1256,86 @@ static gchar* user_interface_choose_file_location (UserInterface* self) {
GtkFileChooserDialog* _tmp11_;
GtkFileChooserDialog* _tmp12_;
GtkFileChooserDialog* _tmp13_;
- GtkFileChooserDialog* _tmp14_;
- const gchar* _tmp15_;
- GtkFileChooserDialog* _tmp16_;
- const gchar* _tmp17_;
- GtkFileFilter* _tmp18_;
- GtkFileFilter* _tmp19_;
+ const gchar* _tmp14_;
+ GtkFileChooserDialog* _tmp15_;
+ const gchar* _tmp16_;
+ GtkFileFilter* _tmp17_;
GtkFileFilter* filter;
+ GtkFileFilter* _tmp18_;
+ const gchar* _tmp19_ = NULL;
GtkFileFilter* _tmp20_;
- const gchar* _tmp21_ = NULL;
- GtkFileFilter* _tmp22_;
+ GtkFileFilter* _tmp21_;
+ GtkFileChooserDialog* _tmp22_;
GtkFileFilter* _tmp23_;
- GtkFileChooserDialog* _tmp24_;
+ GtkFileFilter* _tmp24_;
GtkFileFilter* _tmp25_;
- GtkFileFilter* _tmp26_;
+ const gchar* _tmp26_ = NULL;
GtkFileFilter* _tmp27_;
- GtkFileFilter* _tmp28_;
- const gchar* _tmp29_ = NULL;
- GtkFileFilter* _tmp30_;
- GtkFileChooserDialog* _tmp31_;
- GtkFileFilter* _tmp32_;
- const gchar* _tmp33_ = NULL;
- GtkExpander* _tmp34_;
- GtkExpander* _tmp35_;
+ GtkFileChooserDialog* _tmp28_;
+ GtkFileFilter* _tmp29_;
+ const gchar* _tmp30_ = NULL;
+ GtkExpander* _tmp31_;
GtkExpander* expander;
- GtkExpander* _tmp36_;
- GtkFileChooserDialog* _tmp37_;
- GtkExpander* _tmp38_;
- gchar* _tmp39_;
+ GtkExpander* _tmp32_;
+ GtkFileChooserDialog* _tmp33_;
+ GtkExpander* _tmp34_;
+ gchar* _tmp35_;
gchar* extension;
- const gchar* _tmp40_;
- gint _tmp41_ = 0;
+ const gchar* _tmp36_;
+ gint _tmp37_ = 0;
gint index;
- gint _tmp42_;
- GtkListStore* _tmp46_;
+ gint _tmp38_;
+ GtkListStore* _tmp42_;
GtkListStore* file_type_store;
GtkTreeIter iter = {0};
- 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_;
+ GtkListStore* _tmp43_;
+ GtkTreeIter _tmp44_ = {0};
+ GtkListStore* _tmp45_;
+ GtkTreeIter _tmp46_;
+ const gchar* _tmp47_ = NULL;
+ GtkListStore* _tmp48_;
+ GtkTreeIter _tmp49_ = {0};
+ GtkListStore* _tmp50_;
+ GtkTreeIter _tmp51_;
+ const gchar* _tmp52_ = NULL;
+ GtkListStore* _tmp53_;
+ GtkTreeIter _tmp54_ = {0};
+ GtkListStore* _tmp55_;
+ GtkTreeIter _tmp56_;
+ const gchar* _tmp57_ = NULL;
+ GtkListStore* _tmp58_;
+ GtkTreeView* _tmp59_;
GtkTreeView* file_type_view;
- GtkTreeView* _tmp65_;
- GtkTreeView* _tmp66_;
- GtkCellRendererText* _tmp67_;
- GtkCellRendererText* _tmp68_;
- GtkTreeViewColumn* _tmp69_;
- GtkTreeViewColumn* _tmp70_;
- GtkTreeViewColumn* _tmp71_;
+ GtkTreeView* _tmp60_;
+ GtkTreeView* _tmp61_;
+ GtkCellRendererText* _tmp62_;
+ GtkCellRendererText* _tmp63_;
+ GtkTreeViewColumn* _tmp64_;
+ GtkTreeViewColumn* _tmp65_;
GtkTreeViewColumn* column;
- 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;
+ GtkTreeView* _tmp66_;
+ GtkTreeViewColumn* _tmp67_;
+ GtkExpander* _tmp68_;
+ GtkTreeView* _tmp69_;
+ GtkListStore* _tmp70_;
+ GtkTreeIter _tmp71_ = {0};
+ gboolean _tmp72_ = FALSE;
+ GtkTreeView* _tmp84_;
+ GtkTreeSelection* _tmp85_ = NULL;
+ GtkExpander* _tmp86_;
+ GtkFileChooserDialog* _tmp87_;
+ gint _tmp88_ = 0;
gint response;
gchar* uri;
- gint _tmp95_;
- GSettings* _tmp98_;
+ gint _tmp89_;
+ GSettings* _tmp92_;
+ GtkFileChooserDialog* _tmp93_;
+ gchar* _tmp94_ = NULL;
+ gchar* _tmp95_;
+ GtkTreeView* _tmp96_;
+ GtkTreeSelection* _tmp97_ = NULL;
+ guint _tmp98_ = 0U;
GtkFileChooserDialog* _tmp99_;
- gchar* _tmp100_ = NULL;
- gchar* _tmp101_;
- GtkFileChooserDialog* _tmp102_;
g_return_val_if_fail (self != NULL, NULL);
directory = NULL;
_tmp0_ = self->priv->settings;
@@ -1427,182 +1362,187 @@ static gchar* user_interface_choose_file_location (UserInterface* self) {
_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_ref_sink (_tmp10_);
_g_object_unref0 (self->priv->save_dialog);
- self->priv->save_dialog = _tmp11_;
+ self->priv->save_dialog = _tmp10_;
+ _tmp11_ = self->priv->save_dialog;
+ gtk_file_chooser_set_do_overwrite_confirmation ((GtkFileChooser*) _tmp11_, TRUE);
_tmp12_ = self->priv->save_dialog;
- gtk_file_chooser_set_do_overwrite_confirmation ((GtkFileChooser*) _tmp12_, TRUE);
+ gtk_file_chooser_set_local_only ((GtkFileChooser*) _tmp12_, FALSE);
_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_;
+ _tmp14_ = directory;
+ gtk_file_chooser_set_current_folder ((GtkFileChooser*) _tmp13_, _tmp14_);
+ _tmp15_ = self->priv->save_dialog;
+ _tmp16_ = self->priv->default_file_name;
+ gtk_file_chooser_set_current_name ((GtkFileChooser*) _tmp15_, _tmp16_);
+ _tmp17_ = gtk_file_filter_new ();
+ g_object_ref_sink (_tmp17_);
+ filter = _tmp17_;
+ _tmp18_ = filter;
+ _tmp19_ = _ ("Image Files");
+ gtk_file_filter_set_name (_tmp18_, _tmp19_);
_tmp20_ = filter;
- _tmp21_ = _ ("Image Files");
- gtk_file_filter_set_name (_tmp20_, _tmp21_);
- _tmp22_ = filter;
- gtk_file_filter_add_pixbuf_formats (_tmp22_);
+ gtk_file_filter_add_pixbuf_formats (_tmp20_);
+ _tmp21_ = filter;
+ gtk_file_filter_add_mime_type (_tmp21_, "application/pdf");
+ _tmp22_ = self->priv->save_dialog;
_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_);
+ gtk_file_chooser_add_filter ((GtkFileChooser*) _tmp22_, _tmp23_);
+ _tmp24_ = gtk_file_filter_new ();
+ g_object_ref_sink (_tmp24_);
_g_object_unref0 (filter);
- filter = _tmp27_;
- _tmp28_ = filter;
- _tmp29_ = _ ("All Files");
- gtk_file_filter_set_name (_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_);
+ filter = _tmp24_;
+ _tmp25_ = filter;
+ _tmp26_ = _ ("All Files");
+ gtk_file_filter_set_name (_tmp25_, _tmp26_);
+ _tmp27_ = filter;
+ gtk_file_filter_add_pattern (_tmp27_, "*");
+ _tmp28_ = self->priv->save_dialog;
+ _tmp29_ = filter;
+ gtk_file_chooser_add_filter ((GtkFileChooser*) _tmp28_, _tmp29_);
+ _tmp30_ = _ ("Select File _Type");
+ _tmp31_ = (GtkExpander*) gtk_expander_new_with_mnemonic (_tmp30_);
+ g_object_ref_sink (_tmp31_);
+ expander = _tmp31_;
+ _tmp32_ = expander;
+ gtk_expander_set_spacing (_tmp32_, 5);
+ _tmp33_ = self->priv->save_dialog;
+ _tmp34_ = expander;
+ gtk_file_chooser_set_extra_widget ((GtkFileChooser*) _tmp33_, (GtkWidget*) _tmp34_);
+ _tmp35_ = g_strdup ("");
+ extension = _tmp35_;
+ _tmp36_ = self->priv->default_file_name;
+ _tmp37_ = string_last_index_of_char (_tmp36_, (gunichar) '.', 0);
+ index = _tmp37_;
+ _tmp38_ = index;
+ if (_tmp38_ >= 0) {
+ const gchar* _tmp39_;
+ gint _tmp40_;
+ gchar* _tmp41_ = NULL;
+ _tmp39_ = self->priv->default_file_name;
+ _tmp40_ = index;
+ _tmp41_ = string_slice (_tmp39_, (glong) 0, (glong) _tmp40_);
_g_free0 (extension);
- 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);
+ extension = _tmp41_;
+ }
+ _tmp42_ = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
+ file_type_store = _tmp42_;
+ _tmp43_ = file_type_store;
+ gtk_list_store_append (_tmp43_, &_tmp44_);
+ iter = _tmp44_;
+ _tmp45_ = file_type_store;
+ _tmp46_ = iter;
+ _tmp47_ = _ ("PDF (multi-page document)");
+ gtk_list_store_set (_tmp45_, &_tmp46_, 0, _tmp47_, 1, ".pdf", -1, -1);
+ _tmp48_ = file_type_store;
+ gtk_list_store_append (_tmp48_, &_tmp49_);
+ iter = _tmp49_;
+ _tmp50_ = file_type_store;
+ _tmp51_ = iter;
+ _tmp52_ = _ ("JPEG (compressed)");
+ gtk_list_store_set (_tmp50_, &_tmp51_, 0, _tmp52_, 1, ".jpg", -1, -1);
+ _tmp53_ = file_type_store;
+ gtk_list_store_append (_tmp53_, &_tmp54_);
+ iter = _tmp54_;
+ _tmp55_ = file_type_store;
+ _tmp56_ = iter;
+ _tmp57_ = _ ("PNG (lossless)");
+ gtk_list_store_set (_tmp55_, &_tmp56_, 0, _tmp57_, 1, ".png", -1, -1);
+ _tmp58_ = file_type_store;
+ _tmp59_ = (GtkTreeView*) gtk_tree_view_new_with_model ((GtkTreeModel*) _tmp58_);
+ g_object_ref_sink (_tmp59_);
+ file_type_view = _tmp59_;
+ _tmp60_ = file_type_view;
+ gtk_tree_view_set_headers_visible (_tmp60_, FALSE);
+ _tmp61_ = file_type_view;
+ gtk_tree_view_set_rules_hint (_tmp61_, TRUE);
+ _tmp62_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
+ g_object_ref_sink (_tmp62_);
+ _tmp63_ = _tmp62_;
+ _tmp64_ = gtk_tree_view_column_new_with_attributes ("", (GtkCellRenderer*) _tmp63_, "text", 0, NULL, NULL);
+ g_object_ref_sink (_tmp64_);
+ _tmp65_ = _tmp64_;
+ _g_object_unref0 (_tmp63_);
+ column = _tmp65_;
_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_) {
+ _tmp67_ = column;
+ gtk_tree_view_append_column (_tmp66_, _tmp67_);
+ _tmp68_ = expander;
+ _tmp69_ = file_type_view;
+ gtk_container_add ((GtkContainer*) _tmp68_, (GtkWidget*) _tmp69_);
+ _tmp70_ = file_type_store;
+ _tmp72_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) _tmp70_, &_tmp71_);
+ iter = _tmp71_;
+ if (_tmp72_) {
{
- gboolean _tmp79_;
- _tmp79_ = TRUE;
+ gboolean _tmp73_;
+ _tmp73_ = TRUE;
while (TRUE) {
- gboolean _tmp80_;
+ gboolean _tmp74_;
gchar* e = NULL;
- 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_) {
+ GtkListStore* _tmp77_;
+ GtkTreeIter _tmp78_;
+ const gchar* _tmp79_;
+ const gchar* _tmp80_;
+ _tmp74_ = _tmp73_;
+ if (!_tmp74_) {
+ GtkListStore* _tmp75_;
+ gboolean _tmp76_ = FALSE;
+ _tmp75_ = file_type_store;
+ _tmp76_ = gtk_tree_model_iter_next ((GtkTreeModel*) _tmp75_, &iter);
+ if (!_tmp76_) {
break;
}
}
- _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_);
+ _tmp73_ = FALSE;
+ _tmp77_ = file_type_store;
+ _tmp78_ = iter;
+ gtk_tree_model_get ((GtkTreeModel*) _tmp77_, &_tmp78_, 1, &e, -1, -1);
+ _tmp79_ = extension;
+ _tmp80_ = e;
+ if (g_strcmp0 (_tmp79_, _tmp80_) == 0) {
+ GtkTreeView* _tmp81_;
+ GtkTreeSelection* _tmp82_ = NULL;
+ GtkTreeIter _tmp83_;
+ _tmp81_ = file_type_view;
+ _tmp82_ = gtk_tree_view_get_selection (_tmp81_);
+ _tmp83_ = iter;
+ gtk_tree_selection_select_iter (_tmp82_, &_tmp83_);
}
_g_free0 (e);
}
}
}
- _tmp90_ = file_type_view;
- _tmp91_ = gtk_tree_view_get_selection (_tmp90_);
- g_signal_connect (_tmp91_, "changed", (GCallback) _user_interface_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_;
+ _tmp84_ = file_type_view;
+ _tmp85_ = gtk_tree_view_get_selection (_tmp84_);
+ g_signal_connect (_tmp85_, "changed", (GCallback) _user_interface_on_file_type_changed_gtk_tree_selection_changed, self);
+ _tmp86_ = expander;
+ gtk_widget_show_all ((GtkWidget*) _tmp86_);
+ _tmp87_ = self->priv->save_dialog;
+ _tmp88_ = gtk_dialog_run ((GtkDialog*) _tmp87_);
+ response = _tmp88_;
uri = NULL;
- _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_);
+ _tmp89_ = response;
+ if (_tmp89_ == ((gint) GTK_RESPONSE_ACCEPT)) {
+ GtkFileChooserDialog* _tmp90_;
+ gchar* _tmp91_ = NULL;
+ _tmp90_ = self->priv->save_dialog;
+ _tmp91_ = gtk_file_chooser_get_uri ((GtkFileChooser*) _tmp90_);
_g_free0 (uri);
- uri = _tmp97_;
+ uri = _tmp91_;
}
- _tmp98_ = self->priv->settings;
+ _tmp92_ = self->priv->settings;
+ _tmp93_ = self->priv->save_dialog;
+ _tmp94_ = gtk_file_chooser_get_current_folder ((GtkFileChooser*) _tmp93_);
+ _tmp95_ = _tmp94_;
+ g_settings_set_string (_tmp92_, "save-directory", _tmp95_);
+ _g_free0 (_tmp95_);
+ _tmp96_ = file_type_view;
+ _tmp97_ = gtk_tree_view_get_selection (_tmp96_);
+ g_signal_parse_name ("changed", GTK_TYPE_TREE_SELECTION, &_tmp98_, NULL, FALSE);
+ g_signal_handlers_disconnect_matched (_tmp97_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp98_, 0, NULL, (GCallback) _user_interface_on_file_type_changed_gtk_tree_selection_changed, self);
_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_);
+ gtk_widget_destroy ((GtkWidget*) _tmp99_);
_g_object_unref0 (self->priv->save_dialog);
self->priv->save_dialog = NULL;
result = uri;
@@ -1672,7 +1612,7 @@ static gboolean user_interface_save_document (UserInterface* self, gboolean forc
_tmp9_ = g_file_new_for_uri (_tmp8_);
file = _tmp9_;
_tmp10_ = uri;
- g_debug ("ui.vala:446: Saving to '%s'", _tmp10_);
+ g_debug ("ui.vala:452: Saving to '%s'", _tmp10_);
_tmp11_ = uri;
_tmp12_ = g_utf8_strdown (_tmp11_, (gssize) (-1));
uri_lower = _tmp12_;
@@ -1758,7 +1698,7 @@ static gboolean user_interface_save_document (UserInterface* self, gboolean forc
user_interface_hide_progress_dialog (self);
_tmp33_ = e;
_tmp34_ = _tmp33_->message;
- g_warning ("ui.vala:467: Error saving file: %s", _tmp34_);
+ g_warning ("ui.vala:473: Error saving file: %s", _tmp34_);
_tmp35_ = _ ("Failed to save file");
_tmp36_ = e;
_tmp37_ = _tmp36_->message;
@@ -1803,19 +1743,18 @@ static gboolean user_interface_prompt_to_save (UserInterface* self, const gchar*
GtkWindow* _tmp2_;
const gchar* _tmp3_;
GtkMessageDialog* _tmp4_;
- GtkMessageDialog* _tmp5_;
GtkMessageDialog* dialog;
- GtkMessageDialog* _tmp6_;
- const gchar* _tmp7_ = NULL;
- GtkMessageDialog* _tmp8_;
- const gchar* _tmp9_;
+ GtkMessageDialog* _tmp5_;
+ const gchar* _tmp6_ = NULL;
+ GtkMessageDialog* _tmp7_;
+ const gchar* _tmp8_;
+ GtkMessageDialog* _tmp9_;
GtkMessageDialog* _tmp10_;
GtkMessageDialog* _tmp11_;
- GtkMessageDialog* _tmp12_;
- gint _tmp13_ = 0;
+ gint _tmp12_ = 0;
gint response;
- GtkMessageDialog* _tmp14_;
- gint _tmp15_;
+ GtkMessageDialog* _tmp13_;
+ gint _tmp14_;
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);
@@ -1828,30 +1767,30 @@ static gboolean user_interface_prompt_to_save (UserInterface* self, const gchar*
_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);
+ g_object_ref_sink (_tmp4_);
+ dialog = _tmp4_;
+ _tmp5_ = dialog;
+ _tmp6_ = _ ("If you don't save, changes will be permanently lost.");
+ gtk_message_dialog_format_secondary_text (_tmp5_, "%s", _tmp6_);
+ _tmp7_ = dialog;
+ _tmp8_ = discard_label;
+ gtk_dialog_add_button ((GtkDialog*) _tmp7_, _tmp8_, (gint) GTK_RESPONSE_NO);
+ _tmp9_ = dialog;
+ gtk_dialog_add_button ((GtkDialog*) _tmp9_, GTK_STOCK_CANCEL, (gint) GTK_RESPONSE_CANCEL);
_tmp10_ = dialog;
- gtk_dialog_add_button ((GtkDialog*) _tmp10_, GTK_STOCK_CANCEL, (gint) GTK_RESPONSE_CANCEL);
+ gtk_dialog_add_button ((GtkDialog*) _tmp10_, GTK_STOCK_SAVE, (gint) GTK_RESPONSE_YES);
_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_) {
+ _tmp12_ = gtk_dialog_run ((GtkDialog*) _tmp11_);
+ response = _tmp12_;
+ _tmp13_ = dialog;
+ gtk_widget_destroy ((GtkWidget*) _tmp13_);
+ _tmp14_ = response;
+ switch (_tmp14_) {
case GTK_RESPONSE_YES:
{
- gboolean _tmp16_ = FALSE;
- _tmp16_ = user_interface_save_document (self, FALSE);
- if (_tmp16_) {
+ gboolean _tmp15_ = FALSE;
+ _tmp15_ = user_interface_save_document (self, FALSE);
+ if (_tmp15_) {
result = TRUE;
_g_object_unref0 (dialog);
return result;
@@ -1900,6 +1839,7 @@ void G_MODULE_EXPORT new_button_clicked_cb (GtkWidget* widget, UserInterface* se
const gchar* _tmp0_ = NULL;
const gchar* _tmp1_ = NULL;
gboolean _tmp2_ = FALSE;
+ gboolean _tmp3_;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
_tmp0_ = _ ("Save current document?");
@@ -1908,6 +1848,10 @@ void G_MODULE_EXPORT new_button_clicked_cb (GtkWidget* widget, UserInterface* se
if (!_tmp2_) {
return;
}
+ _tmp3_ = self->priv->scanning;
+ if (_tmp3_) {
+ g_signal_emit_by_name (self, "stop-scan");
+ }
user_interface_clear_document (self);
}
@@ -2501,13 +2445,13 @@ static void user_interface_page_selected_cb (UserInterface* self, BookView* view
_tmp20_ = self->priv->builder;
_tmp21_ = name;
_tmp22_ = gtk_builder_get_object (_tmp20_, _tmp21_);
- _tmp23_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp22_));
+ _tmp23_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, GTK_TYPE_RADIO_MENU_ITEM, GtkRadioMenuItem));
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_));
+ _tmp27_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, GTK_TYPE_TOGGLE_TOOL_BUTTON, GtkToggleToolButton));
toolbutton = _tmp27_;
_tmp28_ = toolbutton;
_tmp29_ = page;
@@ -2634,7 +2578,7 @@ static void user_interface_show_page_menu_cb (UserInterface* self, BookView* vie
g_return_if_fail (view != NULL);
_tmp0_ = self->priv->builder;
_tmp1_ = gtk_builder_get_object (_tmp0_, "page_menu");
- _tmp2_ = _g_object_ref0 (GTK_MENU (_tmp1_));
+ _tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GTK_TYPE_MENU, GtkMenu));
menu = _tmp2_;
_tmp3_ = gtk_get_current_event_time ();
gtk_menu_popup (menu, NULL, NULL, NULL, NULL, (guint) 3, _tmp3_);
@@ -2824,7 +2768,7 @@ void G_MODULE_EXPORT crop_toolbutton_toggled_cb (GtkToggleToolButton* widget, Us
GtkRadioMenuItem* _tmp5_;
_tmp3_ = self->priv->builder;
_tmp4_ = gtk_builder_get_object (_tmp3_, "custom_crop_menuitem");
- _tmp5_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp4_));
+ _tmp5_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GTK_TYPE_RADIO_MENU_ITEM, GtkRadioMenuItem));
_g_object_unref0 (menuitem);
menuitem = _tmp5_;
} else {
@@ -2833,7 +2777,7 @@ void G_MODULE_EXPORT crop_toolbutton_toggled_cb (GtkToggleToolButton* widget, Us
GtkRadioMenuItem* _tmp8_;
_tmp6_ = self->priv->builder;
_tmp7_ = gtk_builder_get_object (_tmp6_, "no_crop_menuitem");
- _tmp8_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp7_));
+ _tmp8_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GTK_TYPE_RADIO_MENU_ITEM, GtkRadioMenuItem));
_g_object_unref0 (menuitem);
menuitem = _tmp8_;
}
@@ -3164,6 +3108,7 @@ void G_MODULE_EXPORT print_button_clicked_cb (GtkWidget* widget, UserInterface*
GtkPrintOperation* print;
Book* _tmp1_;
guint _tmp2_ = 0U;
+ guint _tmp6_ = 0U;
GError * _inner_error_ = NULL;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
@@ -3191,7 +3136,7 @@ void G_MODULE_EXPORT print_button_clicked_cb (GtkWidget* widget, UserInterface*
_inner_error_ = NULL;
_tmp4_ = e;
_tmp5_ = _tmp4_->message;
- g_warning ("ui.vala:1026: Error printing: %s", _tmp5_);
+ g_warning ("ui.vala:1034: Error printing: %s", _tmp5_);
_g_error_free0 (e);
}
__finally18:
@@ -3201,6 +3146,8 @@ void G_MODULE_EXPORT print_button_clicked_cb (GtkWidget* widget, UserInterface*
g_clear_error (&_inner_error_);
return;
}
+ g_signal_parse_name ("draw-page", GTK_TYPE_PRINT_OPERATION, &_tmp6_, NULL, FALSE);
+ g_signal_handlers_disconnect_matched (print, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp6_, 0, NULL, (GCallback) _user_interface_draw_page_gtk_print_operation_draw_page, self);
_g_object_unref0 (print);
}
@@ -3573,14 +3520,24 @@ static void user_interface_page_added_cb (UserInterface* self, Book* book, Page*
static void user_interface_page_removed_cb (UserInterface* self, Book* book, Page* page) {
- Book* _tmp0_;
+ Page* _tmp0_;
guint _tmp1_ = 0U;
+ Page* _tmp2_;
+ guint _tmp3_ = 0U;
+ Book* _tmp4_;
+ guint _tmp5_ = 0U;
g_return_if_fail (self != NULL);
g_return_if_fail (book != NULL);
g_return_if_fail (page != NULL);
- _tmp0_ = book;
- _tmp1_ = book_get_n_pages (_tmp0_);
- if (_tmp1_ == ((guint) 1)) {
+ _tmp0_ = page;
+ g_signal_parse_name ("size-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) _user_interface_page_size_changed_cb_page_size_changed, self);
+ _tmp2_ = page;
+ g_signal_parse_name ("scan-direction-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) _user_interface_page_scan_direction_changed_cb_page_scan_direction_changed, self);
+ _tmp4_ = book;
+ _tmp5_ = book_get_n_pages (_tmp4_);
+ if (_tmp5_ == ((guint) 1)) {
user_interface_add_default_page (self);
}
user_interface_update_page_menu (self);
@@ -3589,135 +3546,134 @@ static void user_interface_page_removed_cb (UserInterface* self, Book* book, Pag
static void user_interface_set_dpi_combo (UserInterface* self, GtkComboBox* combo, gint default_dpi, gint current_dpi) {
GtkCellRendererText* _tmp0_;
- GtkCellRendererText* _tmp1_;
GtkCellRendererText* renderer;
- GtkComboBox* _tmp2_;
- GtkCellRendererText* _tmp3_;
- GtkComboBox* _tmp4_;
- GtkCellRendererText* _tmp5_;
- GtkComboBox* _tmp6_;
- GtkTreeModel* _tmp7_ = NULL;
- GtkListStore* _tmp8_;
+ GtkComboBox* _tmp1_;
+ GtkCellRendererText* _tmp2_;
+ GtkComboBox* _tmp3_;
+ GtkCellRendererText* _tmp4_;
+ GtkComboBox* _tmp5_;
+ GtkTreeModel* _tmp6_ = NULL;
+ GtkListStore* _tmp7_;
GtkListStore* model;
- gint* _tmp9_ = NULL;
+ gint* _tmp8_ = NULL;
gint* scan_resolutions;
gint scan_resolutions_length1;
gint _scan_resolutions_size_;
- gint* _tmp10_;
- gint _tmp10__length1;
+ gint* _tmp9_;
+ gint _tmp9__length1;
g_return_if_fail (self != NULL);
g_return_if_fail (combo != NULL);
_tmp0_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
- _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_;
+ g_object_ref_sink (_tmp0_);
+ renderer = _tmp0_;
+ _tmp1_ = combo;
+ _tmp2_ = renderer;
+ gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp1_, (GtkCellRenderer*) _tmp2_, TRUE);
+ _tmp3_ = combo;
+ _tmp4_ = renderer;
+ gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp3_, (GtkCellRenderer*) _tmp4_, "text", 1);
+ _tmp5_ = combo;
+ _tmp6_ = gtk_combo_box_get_model (_tmp5_);
+ _tmp7_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GTK_TYPE_LIST_STORE, GtkListStore));
+ model = _tmp7_;
+ _tmp8_ = g_new0 (gint, 6);
+ _tmp8_[0] = 75;
+ _tmp8_[1] = 150;
+ _tmp8_[2] = 300;
+ _tmp8_[3] = 600;
+ _tmp8_[4] = 1200;
+ _tmp8_[5] = 2400;
+ scan_resolutions = _tmp8_;
scan_resolutions_length1 = 6;
_scan_resolutions_size_ = scan_resolutions_length1;
- _tmp10_ = scan_resolutions;
- _tmp10__length1 = scan_resolutions_length1;
+ _tmp9_ = scan_resolutions;
+ _tmp9__length1 = scan_resolutions_length1;
{
gint* dpi_collection = NULL;
gint dpi_collection_length1 = 0;
gint _dpi_collection_size_ = 0;
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) {
+ dpi_collection = _tmp9_;
+ dpi_collection_length1 = _tmp9__length1;
+ for (dpi_it = 0; dpi_it < _tmp9__length1; dpi_it = dpi_it + 1) {
gint dpi = 0;
dpi = dpi_collection[dpi_it];
{
gchar* label = NULL;
+ gint _tmp10_;
gint _tmp11_;
- gint _tmp12_;
GtkTreeIter iter = {0};
- GtkListStore* _tmp27_;
- GtkTreeIter _tmp28_ = {0};
- GtkListStore* _tmp29_;
- GtkTreeIter _tmp30_;
- gint _tmp31_;
- const gchar* _tmp32_;
+ GtkListStore* _tmp26_;
+ GtkTreeIter _tmp27_ = {0};
+ GtkListStore* _tmp28_;
+ GtkTreeIter _tmp29_;
+ gint _tmp30_;
+ const gchar* _tmp31_;
+ gint _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_);
+ _tmp10_ = dpi;
+ _tmp11_ = default_dpi;
+ if (_tmp10_ == _tmp11_) {
+ const gchar* _tmp12_ = NULL;
+ gint _tmp13_;
+ gchar* _tmp14_ = NULL;
+ _tmp12_ = _ ("%d dpi (default)");
+ _tmp13_ = dpi;
+ _tmp14_ = g_strdup_printf (_tmp12_, _tmp13_);
_g_free0 (label);
- label = _tmp15_;
+ label = _tmp14_;
} else {
- 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_);
+ gint _tmp15_;
+ _tmp15_ = dpi;
+ if (_tmp15_ == 75) {
+ const gchar* _tmp16_ = NULL;
+ gint _tmp17_;
+ gchar* _tmp18_ = NULL;
+ _tmp16_ = _ ("%d dpi (draft)");
+ _tmp17_ = dpi;
+ _tmp18_ = g_strdup_printf (_tmp16_, _tmp17_);
_g_free0 (label);
- label = _tmp19_;
+ label = _tmp18_;
} else {
- 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_);
+ gint _tmp19_;
+ _tmp19_ = dpi;
+ if (_tmp19_ == 1200) {
+ const gchar* _tmp20_ = NULL;
+ gint _tmp21_;
+ gchar* _tmp22_ = NULL;
+ _tmp20_ = _ ("%d dpi (high resolution)");
+ _tmp21_ = dpi;
+ _tmp22_ = g_strdup_printf (_tmp20_, _tmp21_);
_g_free0 (label);
- label = _tmp23_;
+ label = _tmp22_;
} else {
- const gchar* _tmp24_ = NULL;
- gint _tmp25_;
- gchar* _tmp26_ = NULL;
- _tmp24_ = _ ("%d dpi");
- _tmp25_ = dpi;
- _tmp26_ = g_strdup_printf (_tmp24_, _tmp25_);
+ const gchar* _tmp23_ = NULL;
+ gint _tmp24_;
+ gchar* _tmp25_ = NULL;
+ _tmp23_ = _ ("%d dpi");
+ _tmp24_ = dpi;
+ _tmp25_ = g_strdup_printf (_tmp23_, _tmp24_);
_g_free0 (label);
- label = _tmp26_;
+ label = _tmp25_;
}
}
}
- _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_);
+ _tmp26_ = model;
+ gtk_list_store_append (_tmp26_, &_tmp27_);
+ iter = _tmp27_;
+ _tmp28_ = model;
+ _tmp29_ = iter;
+ _tmp30_ = dpi;
+ _tmp31_ = label;
+ gtk_list_store_set (_tmp28_, &_tmp29_, 0, _tmp30_, 1, _tmp31_, -1, -1);
+ _tmp32_ = dpi;
+ _tmp33_ = current_dpi;
+ if (_tmp32_ == _tmp33_) {
+ GtkComboBox* _tmp34_;
+ GtkTreeIter _tmp35_;
+ _tmp34_ = combo;
+ _tmp35_ = iter;
+ gtk_combo_box_set_active_iter (_tmp34_, &_tmp35_);
}
_g_free0 (label);
}
@@ -3891,43 +3847,43 @@ static void user_interface_load (UserInterface* self) {
GtkListStore* _tmp102_;
GtkInfoBar* _tmp103_;
GtkInfoBar* _tmp104_;
- GtkInfoBar* _tmp105_;
- GtkVBox* _tmp106_;
- GtkInfoBar* _tmp107_;
- GtkBox* _tmp108_;
- GtkBox* _tmp109_;
+ GtkVBox* _tmp105_;
+ GtkInfoBar* _tmp106_;
+ GtkBox* _tmp107_;
GtkBox* hbox;
- GtkInfoBar* _tmp110_;
- GtkWidget* _tmp111_ = NULL;
- GtkContainer* _tmp112_;
+ GtkInfoBar* _tmp108_;
+ GtkWidget* _tmp109_ = NULL;
+ GtkContainer* _tmp110_;
GtkContainer* content_area;
- GtkContainer* _tmp113_;
- GtkBox* _tmp114_;
+ GtkContainer* _tmp111_;
+ GtkBox* _tmp112_;
+ GtkBox* _tmp113_;
+ GtkImage* _tmp114_;
GtkBox* _tmp115_;
GtkImage* _tmp116_;
GtkImage* _tmp117_;
- GtkBox* _tmp118_;
- GtkImage* _tmp119_;
- GtkImage* _tmp120_;
+ GtkLabel* _tmp118_;
+ GtkLabel* _tmp119_;
+ GtkBox* _tmp120_;
GtkLabel* _tmp121_;
GtkLabel* _tmp122_;
- GtkLabel* _tmp123_;
- GtkBox* _tmp124_;
- GtkLabel* _tmp125_;
- GtkLabel* _tmp126_;
- GtkInfoBar* _tmp127_;
+ GtkInfoBar* _tmp123_;
+ GtkWidget* _tmp124_ = NULL;
+ GtkButton* _tmp125_;
+ GtkInfoBar* _tmp126_;
+ const gchar* _tmp127_ = NULL;
GtkWidget* _tmp128_ = NULL;
GtkButton* _tmp129_;
- GtkInfoBar* _tmp130_;
- const gchar* _tmp131_ = NULL;
- GtkWidget* _tmp132_ = NULL;
- GtkButton* _tmp133_;
GtkTreeIter iter = {0};
- GtkListStore* _tmp134_;
- GtkTreeIter _tmp135_ = {0};
- GtkListStore* _tmp136_;
- GtkTreeIter _tmp137_;
- const gchar* _tmp138_ = NULL;
+ 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_;
@@ -3948,104 +3904,93 @@ static void user_interface_load (UserInterface* self) {
GtkTreeIter _tmp156_ = {0};
GtkListStore* _tmp157_;
GtkTreeIter _tmp158_;
- GtkListStore* _tmp159_;
- GtkTreeIter _tmp160_ = {0};
- GtkListStore* _tmp161_;
- GtkTreeIter _tmp162_;
- GSettings* _tmp163_;
- gint _tmp164_ = 0;
+ GSettings* _tmp159_;
+ gint _tmp160_ = 0;
gint dpi;
- gint _tmp165_;
- GtkComboBox* _tmp166_;
- gint _tmp167_;
- GSettings* _tmp168_;
- gint _tmp169_ = 0;
- gint _tmp170_;
- GtkComboBox* _tmp171_;
- gint _tmp172_;
+ gint _tmp161_;
+ GtkComboBox* _tmp162_;
+ gint _tmp163_;
+ GSettings* _tmp164_;
+ gint _tmp165_ = 0;
+ gint _tmp166_;
+ GtkComboBox* _tmp167_;
+ gint _tmp168_;
+ GtkCellRendererText* _tmp169_;
+ GtkCellRendererText* renderer;
+ GtkComboBox* _tmp170_;
+ GtkCellRendererText* _tmp171_;
+ GtkComboBox* _tmp172_;
GtkCellRendererText* _tmp173_;
GtkCellRendererText* _tmp174_;
- GtkCellRendererText* renderer;
GtkComboBox* _tmp175_;
GtkCellRendererText* _tmp176_;
GtkComboBox* _tmp177_;
GtkCellRendererText* _tmp178_;
- GtkCellRendererText* _tmp179_;
- GtkCellRendererText* _tmp180_;
- GtkComboBox* _tmp181_;
- GtkCellRendererText* _tmp182_;
- GtkComboBox* _tmp183_;
- GtkCellRendererText* _tmp184_;
- GSettings* _tmp185_;
- gint _tmp186_ = 0;
- GtkCellRendererText* _tmp187_;
- GtkCellRendererText* _tmp188_;
- GtkComboBox* _tmp189_;
- GtkCellRendererText* _tmp190_;
- GtkComboBox* _tmp191_;
- GtkCellRendererText* _tmp192_;
- GSettings* _tmp193_;
- gint _tmp194_ = 0;
+ GSettings* _tmp179_;
+ gint _tmp180_ = 0;
+ GtkCellRendererText* _tmp181_;
+ GtkComboBox* _tmp182_;
+ GtkCellRendererText* _tmp183_;
+ GtkComboBox* _tmp184_;
+ GtkCellRendererText* _tmp185_;
+ GSettings* _tmp186_;
+ gint _tmp187_ = 0;
gint paper_width;
- GSettings* _tmp195_;
- gint _tmp196_ = 0;
+ GSettings* _tmp188_;
+ gint _tmp189_ = 0;
gint paper_height;
- gint _tmp197_;
- gint _tmp198_;
- GSettings* _tmp199_;
- gchar* _tmp200_ = NULL;
+ gint _tmp190_;
+ gint _tmp191_;
+ GSettings* _tmp192_;
+ gchar* _tmp193_ = NULL;
gchar* device;
- const gchar* _tmp201_;
- GSettings* _tmp207_;
- gchar* _tmp208_ = NULL;
+ const gchar* _tmp194_;
+ GSettings* _tmp200_;
+ gchar* _tmp201_ = NULL;
gchar* document_type;
- const gchar* _tmp209_;
- Book* _tmp211_;
+ const gchar* _tmp202_;
+ Book* _tmp204_;
+ BookView* _tmp205_;
+ BookView* _tmp206_;
+ GtkVBox* _tmp207_;
+ BookView* _tmp208_;
+ BookView* _tmp209_;
+ BookView* _tmp210_;
+ BookView* _tmp211_;
BookView* _tmp212_;
- BookView* _tmp213_;
- BookView* _tmp214_;
- GtkVBox* _tmp215_;
- BookView* _tmp216_;
- BookView* _tmp217_;
- BookView* _tmp218_;
- BookView* _tmp219_;
- BookView* _tmp220_;
+ GSettings* _tmp213_;
+ gint _tmp214_ = 0;
+ GSettings* _tmp215_;
+ gint _tmp216_ = 0;
+ gint _tmp217_;
+ GSettings* _tmp218_;
+ gint _tmp219_ = 0;
+ gint _tmp220_;
GSettings* _tmp221_;
gint _tmp222_ = 0;
- GSettings* _tmp223_;
- gint _tmp224_ = 0;
- gint _tmp225_;
- GSettings* _tmp226_;
- gint _tmp227_ = 0;
- gint _tmp228_;
- GSettings* _tmp229_;
- gint _tmp230_ = 0;
+ gint _tmp223_;
+ GSettings* _tmp224_;
+ gint _tmp225_ = 0;
+ gint _tmp226_;
+ GSettings* _tmp227_;
+ gint _tmp228_ = 0;
+ gint _tmp229_;
+ gint _tmp230_;
gint _tmp231_;
- GSettings* _tmp232_;
- gint _tmp233_ = 0;
+ GtkWindow* _tmp232_;
+ gint _tmp233_;
gint _tmp234_;
GSettings* _tmp235_;
- gint _tmp236_ = 0;
- gint _tmp237_;
- gint _tmp238_;
- gint _tmp239_;
- GtkWindow* _tmp240_;
- gint _tmp241_;
- gint _tmp242_;
- GSettings* _tmp243_;
- gboolean _tmp244_ = FALSE;
- gboolean _tmp245_;
- Book* _tmp247_;
- guint _tmp248_ = 0U;
- Book* _tmp249_;
- Book* _tmp250_;
- GtkWindow* _tmp251_;
- const gchar* _tmp252_ = NULL;
- ProgressBarDialog* _tmp253_;
- ProgressBarDialog* _tmp254_;
- Book* _tmp255_;
- BookView* _tmp256_;
- DragAndDropHandler* _tmp257_;
+ gboolean _tmp236_ = FALSE;
+ gboolean _tmp237_;
+ Book* _tmp239_;
+ guint _tmp240_ = 0U;
+ Book* _tmp241_;
+ Book* _tmp242_;
+ GtkWindow* _tmp243_;
+ const gchar* _tmp244_ = NULL;
+ ProgressBarDialog* _tmp245_;
+ Book* _tmp246_;
GError * _inner_error_ = NULL;
g_return_if_fail (self != NULL);
_tmp0_ = gtk_icon_theme_get_default ();
@@ -4076,7 +4021,7 @@ static void user_interface_load (UserInterface* self) {
_inner_error_ = NULL;
_tmp4_ = e;
_tmp5_ = _tmp4_->message;
- g_critical ("ui.vala:1243: Unable to load UI %s: %s\n", filename, _tmp5_);
+ g_critical ("ui.vala:1256: Unable to load UI %s: %s\n", filename, _tmp5_);
_tmp6_ = _ ("Files missing");
_tmp7_ = _ ("Please check your installation");
user_interface_show_error_dialog (self, _tmp6_, _tmp7_);
@@ -4094,438 +4039,434 @@ static void user_interface_load (UserInterface* self) {
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_));
+ _tmp11_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, GTK_TYPE_WINDOW, GtkWindow));
_g_object_unref0 (self->priv->window);
self->priv->window = _tmp11_;
_tmp12_ = g_application_get_default ();
- _tmp13_ = _g_object_ref0 (GTK_IS_APPLICATION (_tmp12_) ? ((GtkApplication*) _tmp12_) : NULL);
+ _tmp13_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, GTK_TYPE_APPLICATION) ? ((GtkApplication*) _tmp12_) : NULL);
app = _tmp13_;
_tmp14_ = app;
_tmp15_ = self->priv->window;
gtk_application_add_window (_tmp14_, _tmp15_);
_tmp16_ = self->priv->builder;
_tmp17_ = gtk_builder_get_object (_tmp16_, "main_vbox");
- _tmp18_ = _g_object_ref0 (GTK_VBOX (_tmp17_));
+ _tmp18_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, GTK_TYPE_VBOX, GtkVBox));
_g_object_unref0 (self->priv->main_vbox);
self->priv->main_vbox = _tmp18_;
_tmp19_ = self->priv->builder;
_tmp20_ = gtk_builder_get_object (_tmp19_, "page_move_left_menuitem");
- _tmp21_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp20_));
+ _tmp21_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, GTK_TYPE_MENU_ITEM, GtkMenuItem));
_g_object_unref0 (self->priv->page_move_left_menuitem);
self->priv->page_move_left_menuitem = _tmp21_;
_tmp22_ = self->priv->builder;
_tmp23_ = gtk_builder_get_object (_tmp22_, "page_move_right_menuitem");
- _tmp24_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp23_));
+ _tmp24_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, GTK_TYPE_MENU_ITEM, GtkMenuItem));
_g_object_unref0 (self->priv->page_move_right_menuitem);
self->priv->page_move_right_menuitem = _tmp24_;
_tmp25_ = self->priv->builder;
_tmp26_ = gtk_builder_get_object (_tmp25_, "page_delete_menuitem");
- _tmp27_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp26_));
+ _tmp27_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, GTK_TYPE_MENU_ITEM, GtkMenuItem));
_g_object_unref0 (self->priv->page_delete_menuitem);
self->priv->page_delete_menuitem = _tmp27_;
_tmp28_ = self->priv->builder;
_tmp29_ = gtk_builder_get_object (_tmp28_, "crop_rotate_menuitem");
- _tmp30_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp29_));
+ _tmp30_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, GTK_TYPE_MENU_ITEM, GtkMenuItem));
_g_object_unref0 (self->priv->crop_rotate_menuitem);
self->priv->crop_rotate_menuitem = _tmp30_;
_tmp31_ = self->priv->builder;
_tmp32_ = gtk_builder_get_object (_tmp31_, "save_menuitem");
- _tmp33_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp32_));
+ _tmp33_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, GTK_TYPE_MENU_ITEM, GtkMenuItem));
_g_object_unref0 (self->priv->save_menuitem);
self->priv->save_menuitem = _tmp33_;
_tmp34_ = self->priv->builder;
_tmp35_ = gtk_builder_get_object (_tmp34_, "save_as_menuitem");
- _tmp36_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp35_));
+ _tmp36_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp35_, GTK_TYPE_MENU_ITEM, GtkMenuItem));
_g_object_unref0 (self->priv->save_as_menuitem);
self->priv->save_as_menuitem = _tmp36_;
_tmp37_ = self->priv->builder;
_tmp38_ = gtk_builder_get_object (_tmp37_, "save_toolbutton");
- _tmp39_ = _g_object_ref0 (GTK_TOOL_BUTTON (_tmp38_));
+ _tmp39_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp38_, GTK_TYPE_TOOL_BUTTON, GtkToolButton));
_g_object_unref0 (self->priv->save_toolbutton);
self->priv->save_toolbutton = _tmp39_;
_tmp40_ = self->priv->builder;
_tmp41_ = gtk_builder_get_object (_tmp40_, "stop_scan_menuitem");
- _tmp42_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp41_));
+ _tmp42_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp41_, GTK_TYPE_MENU_ITEM, GtkMenuItem));
_g_object_unref0 (self->priv->stop_menuitem);
self->priv->stop_menuitem = _tmp42_;
_tmp43_ = self->priv->builder;
_tmp44_ = gtk_builder_get_object (_tmp43_, "stop_toolbutton");
- _tmp45_ = _g_object_ref0 (GTK_TOOL_BUTTON (_tmp44_));
+ _tmp45_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp44_, GTK_TYPE_TOOL_BUTTON, GtkToolButton));
_g_object_unref0 (self->priv->stop_toolbutton);
self->priv->stop_toolbutton = _tmp45_;
_tmp46_ = self->priv->builder;
_tmp47_ = gtk_builder_get_object (_tmp46_, "text_toolbutton_menuitem");
- _tmp48_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp47_));
+ _tmp48_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp47_, GTK_TYPE_RADIO_MENU_ITEM, GtkRadioMenuItem));
_g_object_unref0 (self->priv->text_toolbar_menuitem);
self->priv->text_toolbar_menuitem = _tmp48_;
_tmp49_ = self->priv->builder;
_tmp50_ = gtk_builder_get_object (_tmp49_, "text_menuitem");
- _tmp51_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp50_));
+ _tmp51_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp50_, GTK_TYPE_RADIO_MENU_ITEM, GtkRadioMenuItem));
_g_object_unref0 (self->priv->text_menu_menuitem);
self->priv->text_menu_menuitem = _tmp51_;
_tmp52_ = self->priv->builder;
_tmp53_ = gtk_builder_get_object (_tmp52_, "photo_toolbutton_menuitem");
- _tmp54_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp53_));
+ _tmp54_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp53_, GTK_TYPE_RADIO_MENU_ITEM, GtkRadioMenuItem));
_g_object_unref0 (self->priv->photo_toolbar_menuitem);
self->priv->photo_toolbar_menuitem = _tmp54_;
_tmp55_ = self->priv->builder;
_tmp56_ = gtk_builder_get_object (_tmp55_, "photo_menuitem");
- _tmp57_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp56_));
+ _tmp57_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp56_, GTK_TYPE_RADIO_MENU_ITEM, GtkRadioMenuItem));
_g_object_unref0 (self->priv->photo_menu_menuitem);
self->priv->photo_menu_menuitem = _tmp57_;
_tmp58_ = self->priv->builder;
_tmp59_ = gtk_builder_get_object (_tmp58_, "authorize_dialog");
- _tmp60_ = _g_object_ref0 (GTK_DIALOG (_tmp59_));
+ _tmp60_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp59_, GTK_TYPE_DIALOG, GtkDialog));
_g_object_unref0 (self->priv->authorize_dialog);
self->priv->authorize_dialog = _tmp60_;
_tmp61_ = self->priv->builder;
_tmp62_ = gtk_builder_get_object (_tmp61_, "authorize_label");
- _tmp63_ = _g_object_ref0 (GTK_LABEL (_tmp62_));
+ _tmp63_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp62_, GTK_TYPE_LABEL, GtkLabel));
_g_object_unref0 (self->priv->authorize_label);
self->priv->authorize_label = _tmp63_;
_tmp64_ = self->priv->builder;
_tmp65_ = gtk_builder_get_object (_tmp64_, "username_entry");
- _tmp66_ = _g_object_ref0 (GTK_ENTRY (_tmp65_));
+ _tmp66_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp65_, GTK_TYPE_ENTRY, GtkEntry));
_g_object_unref0 (self->priv->username_entry);
self->priv->username_entry = _tmp66_;
_tmp67_ = self->priv->builder;
_tmp68_ = gtk_builder_get_object (_tmp67_, "password_entry");
- _tmp69_ = _g_object_ref0 (GTK_ENTRY (_tmp68_));
+ _tmp69_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp68_, GTK_TYPE_ENTRY, GtkEntry));
_g_object_unref0 (self->priv->password_entry);
self->priv->password_entry = _tmp69_;
_tmp70_ = self->priv->builder;
_tmp71_ = gtk_builder_get_object (_tmp70_, "preferences_dialog");
- _tmp72_ = _g_object_ref0 (GTK_DIALOG (_tmp71_));
+ _tmp72_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp71_, GTK_TYPE_DIALOG, GtkDialog));
_g_object_unref0 (self->priv->preferences_dialog);
self->priv->preferences_dialog = _tmp72_;
_tmp73_ = self->priv->builder;
_tmp74_ = gtk_builder_get_object (_tmp73_, "device_combo");
- _tmp75_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp74_));
+ _tmp75_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp74_, GTK_TYPE_COMBO_BOX, GtkComboBox));
_g_object_unref0 (self->priv->device_combo);
self->priv->device_combo = _tmp75_;
_tmp76_ = self->priv->device_combo;
_tmp77_ = gtk_combo_box_get_model (_tmp76_);
- _tmp78_ = _g_object_ref0 (GTK_LIST_STORE (_tmp77_));
+ _tmp78_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp77_, GTK_TYPE_LIST_STORE, GtkListStore));
_g_object_unref0 (self->priv->device_model);
self->priv->device_model = _tmp78_;
_tmp79_ = self->priv->builder;
_tmp80_ = gtk_builder_get_object (_tmp79_, "text_dpi_combo");
- _tmp81_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp80_));
+ _tmp81_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp80_, GTK_TYPE_COMBO_BOX, GtkComboBox));
_g_object_unref0 (self->priv->text_dpi_combo);
self->priv->text_dpi_combo = _tmp81_;
_tmp82_ = self->priv->text_dpi_combo;
_tmp83_ = gtk_combo_box_get_model (_tmp82_);
- _tmp84_ = _g_object_ref0 (GTK_LIST_STORE (_tmp83_));
+ _tmp84_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp83_, GTK_TYPE_LIST_STORE, GtkListStore));
_g_object_unref0 (self->priv->text_dpi_model);
self->priv->text_dpi_model = _tmp84_;
_tmp85_ = self->priv->builder;
_tmp86_ = gtk_builder_get_object (_tmp85_, "photo_dpi_combo");
- _tmp87_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp86_));
+ _tmp87_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp86_, GTK_TYPE_COMBO_BOX, GtkComboBox));
_g_object_unref0 (self->priv->photo_dpi_combo);
self->priv->photo_dpi_combo = _tmp87_;
_tmp88_ = self->priv->photo_dpi_combo;
_tmp89_ = gtk_combo_box_get_model (_tmp88_);
- _tmp90_ = _g_object_ref0 (GTK_LIST_STORE (_tmp89_));
+ _tmp90_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp89_, GTK_TYPE_LIST_STORE, GtkListStore));
_g_object_unref0 (self->priv->photo_dpi_model);
self->priv->photo_dpi_model = _tmp90_;
_tmp91_ = self->priv->builder;
_tmp92_ = gtk_builder_get_object (_tmp91_, "page_side_combo");
- _tmp93_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp92_));
+ _tmp93_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp92_, GTK_TYPE_COMBO_BOX, GtkComboBox));
_g_object_unref0 (self->priv->page_side_combo);
self->priv->page_side_combo = _tmp93_;
_tmp94_ = self->priv->page_side_combo;
_tmp95_ = gtk_combo_box_get_model (_tmp94_);
- _tmp96_ = _g_object_ref0 (GTK_LIST_STORE (_tmp95_));
+ _tmp96_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp95_, GTK_TYPE_LIST_STORE, GtkListStore));
_g_object_unref0 (self->priv->page_side_model);
self->priv->page_side_model = _tmp96_;
_tmp97_ = self->priv->builder;
_tmp98_ = gtk_builder_get_object (_tmp97_, "paper_size_combo");
- _tmp99_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp98_));
+ _tmp99_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp98_, GTK_TYPE_COMBO_BOX, GtkComboBox));
_g_object_unref0 (self->priv->paper_size_combo);
self->priv->paper_size_combo = _tmp99_;
_tmp100_ = self->priv->paper_size_combo;
_tmp101_ = gtk_combo_box_get_model (_tmp100_);
- _tmp102_ = _g_object_ref0 (GTK_LIST_STORE (_tmp101_));
+ _tmp102_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp101_, GTK_TYPE_LIST_STORE, GtkListStore));
_g_object_unref0 (self->priv->paper_size_model);
self->priv->paper_size_model = _tmp102_;
_tmp103_ = (GtkInfoBar*) gtk_info_bar_new ();
- _tmp104_ = g_object_ref_sink (_tmp103_);
+ g_object_ref_sink (_tmp103_);
_g_object_unref0 (self->priv->info_bar);
- self->priv->info_bar = _tmp104_;
- _tmp105_ = self->priv->info_bar;
- g_signal_connect (_tmp105_, "response", (GCallback) _user_interface_info_bar_response_cb_gtk_info_bar_response, self);
- _tmp106_ = self->priv->main_vbox;
- _tmp107_ = self->priv->info_bar;
- gtk_box_pack_start ((GtkBox*) _tmp106_, (GtkWidget*) _tmp107_, FALSE, TRUE, (guint) 0);
- _tmp108_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
- _tmp109_ = g_object_ref_sink (_tmp108_);
- hbox = _tmp109_;
- _tmp110_ = self->priv->info_bar;
- _tmp111_ = gtk_info_bar_get_content_area (_tmp110_);
- _tmp112_ = _g_object_ref0 (GTK_CONTAINER (_tmp111_));
- content_area = _tmp112_;
- _tmp113_ = content_area;
- _tmp114_ = hbox;
- gtk_container_add (_tmp113_, (GtkWidget*) _tmp114_);
- _tmp115_ = hbox;
- gtk_widget_show ((GtkWidget*) _tmp115_);
- _tmp116_ = (GtkImage*) gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG);
- _tmp117_ = g_object_ref_sink (_tmp116_);
+ self->priv->info_bar = _tmp103_;
+ _tmp104_ = self->priv->info_bar;
+ g_signal_connect (_tmp104_, "response", (GCallback) _user_interface_info_bar_response_cb_gtk_info_bar_response, self);
+ _tmp105_ = self->priv->main_vbox;
+ _tmp106_ = self->priv->info_bar;
+ gtk_box_pack_start ((GtkBox*) _tmp105_, (GtkWidget*) _tmp106_, FALSE, TRUE, (guint) 0);
+ _tmp107_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
+ g_object_ref_sink (_tmp107_);
+ hbox = _tmp107_;
+ _tmp108_ = self->priv->info_bar;
+ _tmp109_ = gtk_info_bar_get_content_area (_tmp108_);
+ _tmp110_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp109_, GTK_TYPE_CONTAINER, GtkContainer));
+ content_area = _tmp110_;
+ _tmp111_ = content_area;
+ _tmp112_ = hbox;
+ gtk_container_add (_tmp111_, (GtkWidget*) _tmp112_);
+ _tmp113_ = hbox;
+ gtk_widget_show ((GtkWidget*) _tmp113_);
+ _tmp114_ = (GtkImage*) gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG);
+ g_object_ref_sink (_tmp114_);
_g_object_unref0 (self->priv->info_bar_image);
- self->priv->info_bar_image = _tmp117_;
- _tmp118_ = hbox;
- _tmp119_ = self->priv->info_bar_image;
- gtk_box_pack_start (_tmp118_, (GtkWidget*) _tmp119_, FALSE, TRUE, (guint) 0);
- _tmp120_ = self->priv->info_bar_image;
- gtk_widget_show ((GtkWidget*) _tmp120_);
- _tmp121_ = (GtkLabel*) gtk_label_new (NULL);
- _tmp122_ = g_object_ref_sink (_tmp121_);
+ self->priv->info_bar_image = _tmp114_;
+ _tmp115_ = hbox;
+ _tmp116_ = self->priv->info_bar_image;
+ gtk_box_pack_start (_tmp115_, (GtkWidget*) _tmp116_, FALSE, TRUE, (guint) 0);
+ _tmp117_ = self->priv->info_bar_image;
+ gtk_widget_show ((GtkWidget*) _tmp117_);
+ _tmp118_ = (GtkLabel*) gtk_label_new (NULL);
+ g_object_ref_sink (_tmp118_);
_g_object_unref0 (self->priv->info_bar_label);
- self->priv->info_bar_label = _tmp122_;
- _tmp123_ = self->priv->info_bar_label;
- gtk_misc_set_alignment ((GtkMisc*) _tmp123_, 0.0f, 0.5f);
- _tmp124_ = hbox;
- _tmp125_ = self->priv->info_bar_label;
- gtk_box_pack_start (_tmp124_, (GtkWidget*) _tmp125_, TRUE, TRUE, (guint) 0);
- _tmp126_ = self->priv->info_bar_label;
- gtk_widget_show ((GtkWidget*) _tmp126_);
- _tmp127_ = self->priv->info_bar;
- _tmp128_ = gtk_info_bar_add_button (_tmp127_, GTK_STOCK_CLOSE, (gint) GTK_RESPONSE_CLOSE);
- _tmp129_ = _g_object_ref0 (GTK_BUTTON (_tmp128_));
+ 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 (_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 (G_TYPE_CHECK_INSTANCE_CAST (_tmp124_, GTK_TYPE_BUTTON, GtkButton));
_g_object_unref0 (self->priv->info_bar_close_button);
- self->priv->info_bar_close_button = _tmp129_;
- _tmp130_ = self->priv->info_bar;
- _tmp131_ = _ ("Change _Scanner");
- _tmp132_ = gtk_info_bar_add_button (_tmp130_, _tmp131_, 1);
- _tmp133_ = _g_object_ref0 (GTK_BUTTON (_tmp132_));
+ 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 (G_TYPE_CHECK_INSTANCE_CAST (_tmp128_, GTK_TYPE_BUTTON, GtkButton));
_g_object_unref0 (self->priv->info_bar_change_scanner_button);
- self->priv->info_bar_change_scanner_button = _tmp133_;
- _tmp134_ = self->priv->paper_size_model;
- gtk_list_store_append (_tmp134_, &_tmp135_);
- iter = _tmp135_;
- _tmp136_ = self->priv->paper_size_model;
- _tmp137_ = iter;
- _tmp138_ = _ ("Automatic");
- gtk_list_store_set (_tmp136_, &_tmp137_, 0, 0, 1, 0, 2, _tmp138_, -1, -1);
+ 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, 1050, 1, 1480, 2, "A6", -1, -1);
+ 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, 1480, 1, 2100, 2, "A5", -1, -1);
+ 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, 2100, 1, 2970, 2, "A4", -1, -1);
+ 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, 2794, 2, "Letter", -1, -1);
+ 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, 2159, 1, 3556, 2, "Legal", -1, -1);
- _tmp159_ = self->priv->paper_size_model;
- gtk_list_store_append (_tmp159_, &_tmp160_);
- iter = _tmp160_;
- _tmp161_ = self->priv->paper_size_model;
- _tmp162_ = iter;
- gtk_list_store_set (_tmp161_, &_tmp162_, 0, 1016, 1, 1524, 2, "4×6", -1, -1);
- _tmp163_ = self->priv->settings;
- _tmp164_ = g_settings_get_int (_tmp163_, "text-dpi");
- dpi = _tmp164_;
- _tmp165_ = dpi;
- if (_tmp165_ <= 0) {
+ 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 = USER_INTERFACE_DEFAULT_TEXT_DPI;
}
- _tmp166_ = self->priv->text_dpi_combo;
- _tmp167_ = dpi;
- user_interface_set_dpi_combo (self, _tmp166_, USER_INTERFACE_DEFAULT_TEXT_DPI, _tmp167_);
- _tmp168_ = self->priv->settings;
- _tmp169_ = g_settings_get_int (_tmp168_, "photo-dpi");
- dpi = _tmp169_;
- _tmp170_ = dpi;
- if (_tmp170_ <= 0) {
+ _tmp162_ = self->priv->text_dpi_combo;
+ _tmp163_ = dpi;
+ user_interface_set_dpi_combo (self, _tmp162_, USER_INTERFACE_DEFAULT_TEXT_DPI, _tmp163_);
+ _tmp164_ = self->priv->settings;
+ _tmp165_ = g_settings_get_int (_tmp164_, "photo-dpi");
+ dpi = _tmp165_;
+ _tmp166_ = dpi;
+ if (_tmp166_ <= 0) {
dpi = USER_INTERFACE_DEFAULT_PHOTO_DPI;
}
- _tmp171_ = self->priv->photo_dpi_combo;
- _tmp172_ = dpi;
- user_interface_set_dpi_combo (self, _tmp171_, USER_INTERFACE_DEFAULT_PHOTO_DPI, _tmp172_);
- _tmp173_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
- _tmp174_ = g_object_ref_sink (_tmp173_);
+ _tmp167_ = self->priv->photo_dpi_combo;
+ _tmp168_ = dpi;
+ user_interface_set_dpi_combo (self, _tmp167_, USER_INTERFACE_DEFAULT_PHOTO_DPI, _tmp168_);
+ _tmp169_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
+ g_object_ref_sink (_tmp169_);
+ renderer = _tmp169_;
+ _tmp170_ = self->priv->device_combo;
+ _tmp171_ = renderer;
+ gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp170_, (GtkCellRenderer*) _tmp171_, TRUE);
+ _tmp172_ = self->priv->device_combo;
+ _tmp173_ = renderer;
+ gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp172_, (GtkCellRenderer*) _tmp173_, "text", 1);
+ _tmp174_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
+ g_object_ref_sink (_tmp174_);
+ _g_object_unref0 (renderer);
renderer = _tmp174_;
- _tmp175_ = self->priv->device_combo;
+ _tmp175_ = self->priv->page_side_combo;
_tmp176_ = renderer;
gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp175_, (GtkCellRenderer*) _tmp176_, TRUE);
- _tmp177_ = self->priv->device_combo;
+ _tmp177_ = self->priv->page_side_combo;
_tmp178_ = renderer;
gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp177_, (GtkCellRenderer*) _tmp178_, "text", 1);
- _tmp179_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
- _tmp180_ = g_object_ref_sink (_tmp179_);
+ _tmp179_ = self->priv->settings;
+ _tmp180_ = g_settings_get_enum (_tmp179_, "page-side");
+ user_interface_set_page_side (self, (ScanType) _tmp180_);
+ _tmp181_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
+ g_object_ref_sink (_tmp181_);
_g_object_unref0 (renderer);
- renderer = _tmp180_;
- _tmp181_ = self->priv->page_side_combo;
- _tmp182_ = renderer;
- gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp181_, (GtkCellRenderer*) _tmp182_, TRUE);
- _tmp183_ = self->priv->page_side_combo;
- _tmp184_ = renderer;
- gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp183_, (GtkCellRenderer*) _tmp184_, "text", 1);
- _tmp185_ = self->priv->settings;
- _tmp186_ = g_settings_get_enum (_tmp185_, "page-side");
- user_interface_set_page_side (self, (ScanType) _tmp186_);
- _tmp187_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
- _tmp188_ = g_object_ref_sink (_tmp187_);
- _g_object_unref0 (renderer);
- renderer = _tmp188_;
- _tmp189_ = self->priv->paper_size_combo;
- _tmp190_ = renderer;
- gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp189_, (GtkCellRenderer*) _tmp190_, TRUE);
- _tmp191_ = self->priv->paper_size_combo;
- _tmp192_ = renderer;
- gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp191_, (GtkCellRenderer*) _tmp192_, "text", 2);
- _tmp193_ = self->priv->settings;
- _tmp194_ = g_settings_get_int (_tmp193_, "paper-width");
- paper_width = _tmp194_;
- _tmp195_ = self->priv->settings;
- _tmp196_ = g_settings_get_int (_tmp195_, "paper-height");
- paper_height = _tmp196_;
- _tmp197_ = paper_width;
- _tmp198_ = paper_height;
- user_interface_set_paper_size (self, _tmp197_, _tmp198_);
- _tmp199_ = self->priv->settings;
- _tmp200_ = g_settings_get_string (_tmp199_, "selected-device");
- device = _tmp200_;
- _tmp201_ = device;
- if (_tmp201_ != NULL) {
- const gchar* _tmp202_;
- GtkTreeIter _tmp203_ = {0};
- gboolean _tmp204_ = FALSE;
- _tmp202_ = device;
- _tmp204_ = user_interface_find_scan_device (self, _tmp202_, &_tmp203_);
- iter = _tmp203_;
- if (_tmp204_) {
- GtkComboBox* _tmp205_;
- GtkTreeIter _tmp206_;
- _tmp205_ = self->priv->device_combo;
- _tmp206_ = iter;
- gtk_combo_box_set_active_iter (_tmp205_, &_tmp206_);
+ renderer = _tmp181_;
+ _tmp182_ = self->priv->paper_size_combo;
+ _tmp183_ = renderer;
+ gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp182_, (GtkCellRenderer*) _tmp183_, TRUE);
+ _tmp184_ = self->priv->paper_size_combo;
+ _tmp185_ = renderer;
+ gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp184_, (GtkCellRenderer*) _tmp185_, "text", 2);
+ _tmp186_ = self->priv->settings;
+ _tmp187_ = g_settings_get_int (_tmp186_, "paper-width");
+ paper_width = _tmp187_;
+ _tmp188_ = self->priv->settings;
+ _tmp189_ = g_settings_get_int (_tmp188_, "paper-height");
+ paper_height = _tmp189_;
+ _tmp190_ = paper_width;
+ _tmp191_ = paper_height;
+ user_interface_set_paper_size (self, _tmp190_, _tmp191_);
+ _tmp192_ = self->priv->settings;
+ _tmp193_ = g_settings_get_string (_tmp192_, "selected-device");
+ device = _tmp193_;
+ _tmp194_ = device;
+ if (_tmp194_ != NULL) {
+ const gchar* _tmp195_;
+ GtkTreeIter _tmp196_ = {0};
+ gboolean _tmp197_ = FALSE;
+ _tmp195_ = device;
+ _tmp197_ = user_interface_find_scan_device (self, _tmp195_, &_tmp196_);
+ iter = _tmp196_;
+ if (_tmp197_) {
+ GtkComboBox* _tmp198_;
+ GtkTreeIter _tmp199_;
+ _tmp198_ = self->priv->device_combo;
+ _tmp199_ = iter;
+ gtk_combo_box_set_active_iter (_tmp198_, &_tmp199_);
}
}
- _tmp207_ = self->priv->settings;
- _tmp208_ = g_settings_get_string (_tmp207_, "document-type");
- document_type = _tmp208_;
- _tmp209_ = document_type;
- if (_tmp209_ != NULL) {
- const gchar* _tmp210_;
- _tmp210_ = document_type;
- user_interface_set_document_hint (self, _tmp210_);
- }
- _tmp211_ = self->priv->book;
- _tmp212_ = book_view_new (_tmp211_);
- _tmp213_ = g_object_ref_sink (_tmp212_);
+ _tmp200_ = self->priv->settings;
+ _tmp201_ = g_settings_get_string (_tmp200_, "document-type");
+ document_type = _tmp201_;
+ _tmp202_ = document_type;
+ if (_tmp202_ != NULL) {
+ const gchar* _tmp203_;
+ _tmp203_ = document_type;
+ user_interface_set_document_hint (self, _tmp203_);
+ }
+ _tmp204_ = self->priv->book;
+ _tmp205_ = book_view_new (_tmp204_);
+ g_object_ref_sink (_tmp205_);
_g_object_unref0 (self->priv->book_view);
- self->priv->book_view = _tmp213_;
- _tmp214_ = self->priv->book_view;
- gtk_container_set_border_width ((GtkContainer*) _tmp214_, (guint) 18);
- _tmp215_ = self->priv->main_vbox;
- _tmp216_ = self->priv->book_view;
- gtk_box_pack_end ((GtkBox*) _tmp215_, (GtkWidget*) _tmp216_, TRUE, TRUE, (guint) 0);
- _tmp217_ = self->priv->book_view;
- g_signal_connect (_tmp217_, "page-selected", (GCallback) _user_interface_page_selected_cb_book_view_page_selected, self);
- _tmp218_ = self->priv->book_view;
- g_signal_connect (_tmp218_, "show-page", (GCallback) _user_interface_show_page_cb_book_view_show_page, self);
- _tmp219_ = self->priv->book_view;
- g_signal_connect (_tmp219_, "show-menu", (GCallback) _user_interface_show_page_menu_cb_book_view_show_menu, self);
- _tmp220_ = self->priv->book_view;
- gtk_widget_show ((GtkWidget*) _tmp220_);
- _tmp221_ = self->priv->settings;
- _tmp222_ = g_settings_get_enum (_tmp221_, "scan-direction");
- self->priv->default_page_scan_direction = (ScanDirection) _tmp222_;
- _tmp223_ = self->priv->settings;
- _tmp224_ = g_settings_get_int (_tmp223_, "page-width");
- self->priv->default_page_width = _tmp224_;
- _tmp225_ = self->priv->default_page_width;
- if (_tmp225_ <= 0) {
+ self->priv->book_view = _tmp205_;
+ _tmp206_ = self->priv->book_view;
+ gtk_container_set_border_width ((GtkContainer*) _tmp206_, (guint) 18);
+ _tmp207_ = self->priv->main_vbox;
+ _tmp208_ = self->priv->book_view;
+ gtk_box_pack_end ((GtkBox*) _tmp207_, (GtkWidget*) _tmp208_, TRUE, TRUE, (guint) 0);
+ _tmp209_ = self->priv->book_view;
+ g_signal_connect (_tmp209_, "page-selected", (GCallback) _user_interface_page_selected_cb_book_view_page_selected, self);
+ _tmp210_ = self->priv->book_view;
+ g_signal_connect (_tmp210_, "show-page", (GCallback) _user_interface_show_page_cb_book_view_show_page, self);
+ _tmp211_ = self->priv->book_view;
+ g_signal_connect (_tmp211_, "show-menu", (GCallback) _user_interface_show_page_menu_cb_book_view_show_menu, self);
+ _tmp212_ = self->priv->book_view;
+ gtk_widget_show ((GtkWidget*) _tmp212_);
+ _tmp213_ = self->priv->settings;
+ _tmp214_ = g_settings_get_enum (_tmp213_, "scan-direction");
+ self->priv->default_page_scan_direction = (ScanDirection) _tmp214_;
+ _tmp215_ = self->priv->settings;
+ _tmp216_ = g_settings_get_int (_tmp215_, "page-width");
+ self->priv->default_page_width = _tmp216_;
+ _tmp217_ = self->priv->default_page_width;
+ if (_tmp217_ <= 0) {
self->priv->default_page_width = 595;
}
- _tmp226_ = self->priv->settings;
- _tmp227_ = g_settings_get_int (_tmp226_, "page-height");
- self->priv->default_page_height = _tmp227_;
- _tmp228_ = self->priv->default_page_height;
- if (_tmp228_ <= 0) {
+ _tmp218_ = self->priv->settings;
+ _tmp219_ = g_settings_get_int (_tmp218_, "page-height");
+ self->priv->default_page_height = _tmp219_;
+ _tmp220_ = self->priv->default_page_height;
+ if (_tmp220_ <= 0) {
self->priv->default_page_height = 842;
}
- _tmp229_ = self->priv->settings;
- _tmp230_ = g_settings_get_int (_tmp229_, "page-dpi");
- self->priv->default_page_dpi = _tmp230_;
- _tmp231_ = self->priv->default_page_dpi;
- if (_tmp231_ <= 0) {
+ _tmp221_ = self->priv->settings;
+ _tmp222_ = g_settings_get_int (_tmp221_, "page-dpi");
+ self->priv->default_page_dpi = _tmp222_;
+ _tmp223_ = self->priv->default_page_dpi;
+ if (_tmp223_ <= 0) {
self->priv->default_page_dpi = 72;
}
- _tmp232_ = self->priv->settings;
- _tmp233_ = g_settings_get_int (_tmp232_, "window-width");
- self->priv->window_width = _tmp233_;
- _tmp234_ = self->priv->window_width;
- if (_tmp234_ <= 0) {
+ _tmp224_ = self->priv->settings;
+ _tmp225_ = g_settings_get_int (_tmp224_, "window-width");
+ self->priv->window_width = _tmp225_;
+ _tmp226_ = self->priv->window_width;
+ if (_tmp226_ <= 0) {
self->priv->window_width = 600;
}
- _tmp235_ = self->priv->settings;
- _tmp236_ = g_settings_get_int (_tmp235_, "window-height");
- self->priv->window_height = _tmp236_;
- _tmp237_ = self->priv->window_height;
- if (_tmp237_ <= 0) {
+ _tmp227_ = self->priv->settings;
+ _tmp228_ = g_settings_get_int (_tmp227_, "window-height");
+ self->priv->window_height = _tmp228_;
+ _tmp229_ = self->priv->window_height;
+ if (_tmp229_ <= 0) {
self->priv->window_height = 400;
}
- _tmp238_ = self->priv->window_width;
- _tmp239_ = self->priv->window_height;
- g_debug ("ui.vala:1391: Restoring window to %dx%d pixels", _tmp238_, _tmp239_);
- _tmp240_ = self->priv->window;
- _tmp241_ = self->priv->window_width;
- _tmp242_ = self->priv->window_height;
- gtk_window_set_default_size (_tmp240_, _tmp241_, _tmp242_);
- _tmp243_ = self->priv->settings;
- _tmp244_ = g_settings_get_boolean (_tmp243_, "window-is-maximized");
- self->priv->window_is_maximized = _tmp244_;
- _tmp245_ = self->priv->window_is_maximized;
- if (_tmp245_) {
- GtkWindow* _tmp246_;
- g_debug ("ui.vala:1396: Restoring window to maximized");
- _tmp246_ = self->priv->window;
- gtk_window_maximize (_tmp246_);
- }
- _tmp247_ = self->priv->book;
- _tmp248_ = book_get_n_pages (_tmp247_);
- if (_tmp248_ == ((guint) 0)) {
+ _tmp230_ = self->priv->window_width;
+ _tmp231_ = self->priv->window_height;
+ g_debug ("ui.vala:1404: Restoring window to %dx%d pixels", _tmp230_, _tmp231_);
+ _tmp232_ = self->priv->window;
+ _tmp233_ = self->priv->window_width;
+ _tmp234_ = self->priv->window_height;
+ gtk_window_set_default_size (_tmp232_, _tmp233_, _tmp234_);
+ _tmp235_ = self->priv->settings;
+ _tmp236_ = g_settings_get_boolean (_tmp235_, "window-is-maximized");
+ self->priv->window_is_maximized = _tmp236_;
+ _tmp237_ = self->priv->window_is_maximized;
+ if (_tmp237_) {
+ GtkWindow* _tmp238_;
+ g_debug ("ui.vala:1409: Restoring window to maximized");
+ _tmp238_ = self->priv->window;
+ gtk_window_maximize (_tmp238_);
+ }
+ _tmp239_ = self->priv->book;
+ _tmp240_ = book_get_n_pages (_tmp239_);
+ if (_tmp240_ == ((guint) 0)) {
user_interface_add_default_page (self);
}
- _tmp249_ = self->priv->book;
- book_set_needs_saving (_tmp249_, FALSE);
- _tmp250_ = self->priv->book;
- g_signal_connect (_tmp250_, "needs-saving-changed", (GCallback) _user_interface_needs_saving_cb_book_needs_saving_changed, self);
- _tmp251_ = self->priv->window;
- _tmp252_ = _ ("Saving document...");
- _tmp253_ = progress_bar_dialog_new (_tmp251_, _tmp252_);
- _tmp254_ = g_object_ref_sink (_tmp253_);
+ _tmp241_ = self->priv->book;
+ book_set_needs_saving (_tmp241_, FALSE);
+ _tmp242_ = self->priv->book;
+ g_signal_connect (_tmp242_, "needs-saving-changed", (GCallback) _user_interface_needs_saving_cb_book_needs_saving_changed, self);
+ _tmp243_ = self->priv->window;
+ _tmp244_ = _ ("Saving document...");
+ _tmp245_ = progress_bar_dialog_new (_tmp243_, _tmp244_);
+ g_object_ref_sink (_tmp245_);
_g_object_unref0 (self->priv->progress_dialog);
- self->priv->progress_dialog = _tmp254_;
- _tmp255_ = self->priv->book;
- g_signal_connect (_tmp255_, "saving", (GCallback) _user_interface_book_saving_cb_book_saving, self);
- _tmp256_ = self->priv->book_view;
- _tmp257_ = drag_and_drop_handler_new (_tmp256_);
- _drag_and_drop_handler_unref0 (self->priv->dnd_handler);
- self->priv->dnd_handler = _tmp257_;
+ self->priv->progress_dialog = _tmp245_;
+ _tmp246_ = self->priv->book;
+ g_signal_connect (_tmp246_, "saving", (GCallback) _user_interface_book_saving_cb_book_saving, self);
_g_free0 (document_type);
_g_free0 (device);
_g_object_unref0 (renderer);
@@ -4862,7 +4803,6 @@ static void user_interface_instance_init (UserInterface * self) {
const gchar* _tmp1_ = NULL;
gchar* _tmp2_;
self->priv = USER_INTERFACE_GET_PRIVATE (self);
- self->priv->dnd_handler = NULL;
self->priv->book_uri = NULL;
_tmp0_ = g_strdup ("photo");
self->priv->document_hint = _tmp0_;
@@ -4876,7 +4816,17 @@ static void user_interface_instance_init (UserInterface * self) {
static void user_interface_finalize (UserInterface* obj) {
UserInterface * self;
- self = USER_INTERFACE (obj);
+ Book* _tmp0_;
+ guint _tmp1_ = 0U;
+ Book* _tmp2_;
+ guint _tmp3_ = 0U;
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_USER_INTERFACE, UserInterface);
+ _tmp0_ = self->priv->book;
+ g_signal_parse_name ("page-removed", TYPE_BOOK, &_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) _user_interface_page_removed_cb_book_page_removed, self);
+ _tmp2_ = self->priv->book;
+ g_signal_parse_name ("page-added", TYPE_BOOK, &_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) _user_interface_page_added_cb_book_page_added, self);
_g_object_unref0 (self->priv->settings);
_g_object_unref0 (self->priv->builder);
_g_object_unref0 (self->priv->window);
@@ -4916,7 +4866,6 @@ static void user_interface_finalize (UserInterface* obj) {
_g_object_unref0 (self->priv->paper_size_model);
_g_object_unref0 (self->priv->save_dialog);
_g_object_unref0 (self->priv->progress_dialog);
- _drag_and_drop_handler_unref0 (self->priv->dnd_handler);
_g_free0 (self->priv->error_title);
_g_free0 (self->priv->error_text);
_book_unref0 (self->priv->book);
@@ -4962,56 +4911,53 @@ void user_interface_unref (gpointer instance) {
ProgressBarDialog* progress_bar_dialog_construct (GType object_type, GtkWindow* parent, const gchar* title) {
ProgressBarDialog * self = NULL;
GtkProgressBar* _tmp0_;
- GtkProgressBar* _tmp1_;
- GtkBox* _tmp2_;
- GtkBox* _tmp3_;
+ GtkBox* _tmp1_;
GtkBox* hbox;
- GtkBox* _tmp4_;
- GtkBox* _tmp5_;
+ GtkBox* _tmp2_;
GtkBox* vbox;
+ GtkProgressBar* _tmp3_;
+ GtkProgressBar* _tmp4_;
+ GtkProgressBar* _tmp5_;
GtkProgressBar* _tmp6_;
- GtkProgressBar* _tmp7_;
- GtkProgressBar* _tmp8_;
+ const gchar* _tmp7_;
+ GtkWindow* _tmp8_;
GtkProgressBar* _tmp9_;
- const gchar* _tmp10_;
- GtkWindow* _tmp11_;
- GtkProgressBar* _tmp12_;
g_return_val_if_fail (parent != NULL, NULL);
g_return_val_if_fail (title != NULL, NULL);
self = (ProgressBarDialog*) g_object_new (object_type, NULL);
_tmp0_ = (GtkProgressBar*) gtk_progress_bar_new ();
- _tmp1_ = g_object_ref_sink (_tmp0_);
+ g_object_ref_sink (_tmp0_);
_g_object_unref0 (self->priv->bar);
- self->priv->bar = _tmp1_;
- _tmp2_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
- _tmp3_ = g_object_ref_sink (_tmp2_);
- hbox = _tmp3_;
- _tmp4_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
- _tmp5_ = g_object_ref_sink (_tmp4_);
- vbox = _tmp5_;
+ self->priv->bar = _tmp0_;
+ _tmp1_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
+ g_object_ref_sink (_tmp1_);
+ hbox = _tmp1_;
+ _tmp2_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
+ g_object_ref_sink (_tmp2_);
+ vbox = _tmp2_;
gtk_widget_set_hexpand ((GtkWidget*) hbox, TRUE);
- _tmp6_ = self->priv->bar;
- gtk_progress_bar_set_text (_tmp6_, "");
- _tmp7_ = self->priv->bar;
- gtk_progress_bar_set_show_text (_tmp7_, TRUE);
- _tmp8_ = self->priv->bar;
- gtk_widget_set_size_request ((GtkWidget*) _tmp8_, 225, 25);
+ _tmp3_ = self->priv->bar;
+ gtk_progress_bar_set_text (_tmp3_, "");
+ _tmp4_ = self->priv->bar;
+ gtk_progress_bar_set_show_text (_tmp4_, TRUE);
+ _tmp5_ = self->priv->bar;
+ gtk_widget_set_size_request ((GtkWidget*) _tmp5_, 225, 25);
gtk_widget_set_size_request ((GtkWidget*) self, 250, 50);
- _tmp9_ = self->priv->bar;
- gtk_box_pack_start (vbox, (GtkWidget*) _tmp9_, TRUE, FALSE, (guint) 0);
+ _tmp6_ = self->priv->bar;
+ gtk_box_pack_start (vbox, (GtkWidget*) _tmp6_, TRUE, FALSE, (guint) 0);
gtk_box_pack_start (hbox, (GtkWidget*) vbox, TRUE, FALSE, (guint) 0);
gtk_container_add ((GtkContainer*) self, (GtkWidget*) hbox);
- _tmp10_ = title;
- gtk_window_set_title ((GtkWindow*) self, _tmp10_);
- _tmp11_ = parent;
- gtk_window_set_transient_for ((GtkWindow*) self, _tmp11_);
+ _tmp7_ = title;
+ gtk_window_set_title ((GtkWindow*) self, _tmp7_);
+ _tmp8_ = parent;
+ gtk_window_set_transient_for ((GtkWindow*) self, _tmp8_);
gtk_window_set_position ((GtkWindow*) self, GTK_WIN_POS_CENTER_ON_PARENT);
gtk_window_set_modal ((GtkWindow*) self, TRUE);
gtk_window_set_resizable ((GtkWindow*) self, FALSE);
gtk_widget_show ((GtkWidget*) hbox);
gtk_widget_show ((GtkWidget*) vbox);
- _tmp12_ = self->priv->bar;
- gtk_widget_show ((GtkWidget*) _tmp12_);
+ _tmp9_ = self->priv->bar;
+ gtk_widget_show ((GtkWidget*) _tmp9_);
_g_object_unref0 (vbox);
_g_object_unref0 (hbox);
return self;
@@ -5058,7 +5004,7 @@ static void progress_bar_dialog_instance_init (ProgressBarDialog * self) {
static void progress_bar_dialog_finalize (GObject* obj) {
ProgressBarDialog * self;
- self = PROGRESS_BAR_DIALOG (obj);
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PROGRESS_BAR_DIALOG, ProgressBarDialog);
_g_object_unref0 (self->priv->bar);
G_OBJECT_CLASS (progress_bar_dialog_parent_class)->finalize (obj);
}
@@ -5076,374 +5022,6 @@ GType progress_bar_dialog_get_type (void) {
}
-static GType drag_and_drop_handler_target_type_get_type (void) {
- static volatile gsize drag_and_drop_handler_target_type_type_id__volatile = 0;
- if (g_once_init_enter (&drag_and_drop_handler_target_type_type_id__volatile)) {
- static const GEnumValue values[] = {{DRAG_AND_DROP_HANDLER_TARGET_TYPE_IMAGE, "DRAG_AND_DROP_HANDLER_TARGET_TYPE_IMAGE", "image"}, {DRAG_AND_DROP_HANDLER_TARGET_TYPE_URI, "DRAG_AND_DROP_HANDLER_TARGET_TYPE_URI", "uri"}, {0, NULL, NULL}};
- GType drag_and_drop_handler_target_type_type_id;
- drag_and_drop_handler_target_type_type_id = g_enum_register_static ("DragAndDropHandlerTargetType", values);
- g_once_init_leave (&drag_and_drop_handler_target_type_type_id__volatile, drag_and_drop_handler_target_type_type_id);
- }
- return drag_and_drop_handler_target_type_type_id__volatile;
-}
-
-
-static void _drag_and_drop_handler_on_drag_data_get_gtk_widget_drag_data_get (GtkWidget* _sender, GdkDragContext* context, GtkSelectionData* selection_data, guint info, guint time_, gpointer self) {
- drag_and_drop_handler_on_drag_data_get (self, context, selection_data, info, time_);
-}
-
-
-DragAndDropHandler* drag_and_drop_handler_construct (GType object_type, BookView* book_view) {
- DragAndDropHandler* self = NULL;
- BookView* _tmp0_;
- BookView* _tmp1_;
- BookView* _tmp2_;
- GtkWidget* _tmp3_ = NULL;
- GtkWidget* event_source;
- g_return_val_if_fail (book_view != NULL, NULL);
- self = (DragAndDropHandler*) g_type_create_instance (object_type);
- _tmp0_ = book_view;
- _tmp1_ = _g_object_ref0 (_tmp0_);
- _g_object_unref0 (self->priv->book_view);
- self->priv->book_view = _tmp1_;
- _tmp2_ = book_view;
- _tmp3_ = book_view_get_event_source (_tmp2_);
- event_source = _tmp3_;
- drag_and_drop_handler_set_targets (self, event_source);
- g_signal_connect (event_source, "drag-data-get", (GCallback) _drag_and_drop_handler_on_drag_data_get_gtk_widget_drag_data_get, self);
- _g_object_unref0 (event_source);
- return self;
-}
-
-
-DragAndDropHandler* drag_and_drop_handler_new (BookView* book_view) {
- return drag_and_drop_handler_construct (TYPE_DRAG_AND_DROP_HANDLER, book_view);
-}
-
-
-static void drag_and_drop_handler_set_targets (DragAndDropHandler* self, GtkWidget* event_source) {
- GtkTargetEntry* _tmp0_ = NULL;
- GtkTargetEntry* table;
- gint table_length1;
- gint _table_size_;
- GtkTargetList* _tmp1_;
- GtkTargetList* targets;
- GtkWidget* _tmp2_;
- GtkWidget* _tmp3_;
- g_return_if_fail (self != NULL);
- g_return_if_fail (event_source != NULL);
- _tmp0_ = g_new0 (GtkTargetEntry, 0);
- table = _tmp0_;
- table_length1 = 0;
- _table_size_ = table_length1;
- _tmp1_ = gtk_target_list_new (table, table_length1);
- targets = _tmp1_;
- gtk_target_list_add_uri_targets (targets, (guint) DRAG_AND_DROP_HANDLER_TARGET_TYPE_URI);
- gtk_target_list_add_image_targets (targets, (guint) DRAG_AND_DROP_HANDLER_TARGET_TYPE_IMAGE, TRUE);
- _tmp2_ = event_source;
- gtk_drag_source_set (_tmp2_, GDK_BUTTON1_MASK, table, table_length1, GDK_ACTION_COPY);
- _tmp3_ = event_source;
- gtk_drag_source_set_target_list (_tmp3_, targets);
- _gtk_target_list_unref0 (targets);
- table = (g_free (table), NULL);
-}
-
-
-static void drag_and_drop_handler_on_drag_data_get (DragAndDropHandler* self, GdkDragContext* context, GtkSelectionData* selection, guint target_type, guint time) {
- BookView* _tmp0_;
- Page* _tmp1_ = NULL;
- Page* page;
- Page* _tmp2_;
- guint _tmp3_;
- GError * _inner_error_ = NULL;
- g_return_if_fail (self != NULL);
- g_return_if_fail (context != NULL);
- g_return_if_fail (selection != NULL);
- _tmp0_ = self->priv->book_view;
- _tmp1_ = book_view_get_selected (_tmp0_);
- page = _tmp1_;
- _tmp2_ = page;
- g_return_if_fail (_tmp2_ != NULL);
- _tmp3_ = target_type;
- switch (_tmp3_) {
- case DRAG_AND_DROP_HANDLER_TARGET_TYPE_IMAGE:
- {
- Page* _tmp4_;
- GdkPixbuf* _tmp5_ = NULL;
- GdkPixbuf* image;
- GtkSelectionData* _tmp6_;
- GdkPixbuf* _tmp7_;
- _tmp4_ = page;
- _tmp5_ = page_get_image (_tmp4_, TRUE);
- image = _tmp5_;
- _tmp6_ = selection;
- _tmp7_ = image;
- gtk_selection_data_set_pixbuf (_tmp6_, _tmp7_);
- g_debug ("ui.vala:1562: Saving page to pixbuf");
- _g_object_unref0 (image);
- break;
- }
- case DRAG_AND_DROP_HANDLER_TARGET_TYPE_URI:
- {
- gchar* _tmp8_;
- gchar* filetype;
- const gchar* _tmp9_;
- gchar* _tmp10_ = NULL;
- gchar* path;
- const gchar* _tmp11_;
- const gchar* _tmp12_;
- GFile* _tmp13_ = NULL;
- GFile* file;
- GFile* _tmp14_;
- gchar* _tmp15_ = NULL;
- gchar* uri;
- _tmp8_ = g_strdup ("png");
- filetype = _tmp8_;
- _tmp9_ = filetype;
- _tmp10_ = get_temporary_filename ("scanned-page", _tmp9_);
- path = _tmp10_;
- _tmp11_ = path;
- g_return_if_fail (_tmp11_ != NULL);
- _tmp12_ = path;
- _tmp13_ = g_file_new_for_path (_tmp12_);
- file = _tmp13_;
- _tmp14_ = file;
- _tmp15_ = g_file_get_uri (_tmp14_);
- uri = _tmp15_;
- {
- Page* _tmp16_;
- const gchar* _tmp17_;
- GFile* _tmp18_;
- GtkSelectionData* _tmp19_;
- const gchar* _tmp20_;
- gchar* _tmp21_;
- gchar** _tmp22_ = NULL;
- gchar** _tmp23_;
- gint _tmp23__length1;
- const gchar* _tmp24_;
- _tmp16_ = page;
- _tmp17_ = filetype;
- _tmp18_ = file;
- page_save (_tmp16_, _tmp17_, _tmp18_, &_inner_error_);
- if (_inner_error_ != NULL) {
- goto __catch21_g_error;
- }
- _tmp19_ = selection;
- _tmp20_ = uri;
- _tmp21_ = g_strdup (_tmp20_);
- _tmp22_ = g_new0 (gchar*, 1 + 1);
- _tmp22_[0] = _tmp21_;
- _tmp23_ = _tmp22_;
- _tmp23__length1 = 1;
- gtk_selection_data_set_uris (_tmp19_, _tmp23_);
- _tmp23_ = (_vala_array_free (_tmp23_, _tmp23__length1, (GDestroyNotify) g_free), NULL);
- _tmp24_ = uri;
- g_debug ("ui.vala:1577: Saving page to %s", _tmp24_);
- }
- goto __finally21;
- __catch21_g_error:
- {
- GError* e = NULL;
- GError* _tmp25_;
- const gchar* _tmp26_;
- e = _inner_error_;
- _inner_error_ = NULL;
- _tmp25_ = e;
- _tmp26_ = _tmp25_->message;
- g_warning ("ui.vala:1581: Unable to save file using drag-drop %s", _tmp26_);
- _g_error_free0 (e);
- }
- __finally21:
- if (_inner_error_ != NULL) {
- _g_free0 (uri);
- _g_object_unref0 (file);
- _g_free0 (path);
- _g_free0 (filetype);
- _page_unref0 (page);
- g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- return;
- }
- _g_free0 (uri);
- _g_object_unref0 (file);
- _g_free0 (path);
- _g_free0 (filetype);
- break;
- }
- default:
- {
- guint _tmp27_;
- _tmp27_ = target_type;
- g_warning ("ui.vala:1586: Invalid DND target type %u", _tmp27_);
- break;
- }
- }
- _page_unref0 (page);
-}
-
-
-static void value_drag_and_drop_handler_init (GValue* value) {
- value->data[0].v_pointer = NULL;
-}
-
-
-static void value_drag_and_drop_handler_free_value (GValue* value) {
- if (value->data[0].v_pointer) {
- drag_and_drop_handler_unref (value->data[0].v_pointer);
- }
-}
-
-
-static void value_drag_and_drop_handler_copy_value (const GValue* src_value, GValue* dest_value) {
- if (src_value->data[0].v_pointer) {
- dest_value->data[0].v_pointer = drag_and_drop_handler_ref (src_value->data[0].v_pointer);
- } else {
- dest_value->data[0].v_pointer = NULL;
- }
-}
-
-
-static gpointer value_drag_and_drop_handler_peek_pointer (const GValue* value) {
- return value->data[0].v_pointer;
-}
-
-
-static gchar* value_drag_and_drop_handler_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
- if (collect_values[0].v_pointer) {
- DragAndDropHandler* object;
- object = collect_values[0].v_pointer;
- if (object->parent_instance.g_class == NULL) {
- return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
- } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
- return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
- }
- value->data[0].v_pointer = drag_and_drop_handler_ref (object);
- } else {
- value->data[0].v_pointer = NULL;
- }
- return NULL;
-}
-
-
-static gchar* value_drag_and_drop_handler_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
- DragAndDropHandler** object_p;
- object_p = collect_values[0].v_pointer;
- if (!object_p) {
- return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
- }
- if (!value->data[0].v_pointer) {
- *object_p = NULL;
- } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
- *object_p = value->data[0].v_pointer;
- } else {
- *object_p = drag_and_drop_handler_ref (value->data[0].v_pointer);
- }
- return NULL;
-}
-
-
-GParamSpec* param_spec_drag_and_drop_handler (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
- ParamSpecDragAndDropHandler* spec;
- g_return_val_if_fail (g_type_is_a (object_type, TYPE_DRAG_AND_DROP_HANDLER), NULL);
- spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
- G_PARAM_SPEC (spec)->value_type = object_type;
- return G_PARAM_SPEC (spec);
-}
-
-
-gpointer value_get_drag_and_drop_handler (const GValue* value) {
- g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_DRAG_AND_DROP_HANDLER), NULL);
- return value->data[0].v_pointer;
-}
-
-
-void value_set_drag_and_drop_handler (GValue* value, gpointer v_object) {
- DragAndDropHandler* old;
- g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_DRAG_AND_DROP_HANDLER));
- old = value->data[0].v_pointer;
- if (v_object) {
- g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_DRAG_AND_DROP_HANDLER));
- g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
- value->data[0].v_pointer = v_object;
- drag_and_drop_handler_ref (value->data[0].v_pointer);
- } else {
- value->data[0].v_pointer = NULL;
- }
- if (old) {
- drag_and_drop_handler_unref (old);
- }
-}
-
-
-void value_take_drag_and_drop_handler (GValue* value, gpointer v_object) {
- DragAndDropHandler* old;
- g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_DRAG_AND_DROP_HANDLER));
- old = value->data[0].v_pointer;
- if (v_object) {
- g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_DRAG_AND_DROP_HANDLER));
- g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
- value->data[0].v_pointer = v_object;
- } else {
- value->data[0].v_pointer = NULL;
- }
- if (old) {
- drag_and_drop_handler_unref (old);
- }
-}
-
-
-static void drag_and_drop_handler_class_init (DragAndDropHandlerClass * klass) {
- drag_and_drop_handler_parent_class = g_type_class_peek_parent (klass);
- DRAG_AND_DROP_HANDLER_CLASS (klass)->finalize = drag_and_drop_handler_finalize;
- g_type_class_add_private (klass, sizeof (DragAndDropHandlerPrivate));
-}
-
-
-static void drag_and_drop_handler_instance_init (DragAndDropHandler * self) {
- self->priv = DRAG_AND_DROP_HANDLER_GET_PRIVATE (self);
- self->ref_count = 1;
-}
-
-
-static void drag_and_drop_handler_finalize (DragAndDropHandler* obj) {
- DragAndDropHandler * self;
- self = DRAG_AND_DROP_HANDLER (obj);
- _g_object_unref0 (self->priv->book_view);
-}
-
-
-GType drag_and_drop_handler_get_type (void) {
- static volatile gsize drag_and_drop_handler_type_id__volatile = 0;
- if (g_once_init_enter (&drag_and_drop_handler_type_id__volatile)) {
- static const GTypeValueTable g_define_type_value_table = { value_drag_and_drop_handler_init, value_drag_and_drop_handler_free_value, value_drag_and_drop_handler_copy_value, value_drag_and_drop_handler_peek_pointer, "p", value_drag_and_drop_handler_collect_value, "p", value_drag_and_drop_handler_lcopy_value };
- static const GTypeInfo g_define_type_info = { sizeof (DragAndDropHandlerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) drag_and_drop_handler_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DragAndDropHandler), 0, (GInstanceInitFunc) drag_and_drop_handler_instance_init, &g_define_type_value_table };
- static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
- GType drag_and_drop_handler_type_id;
- drag_and_drop_handler_type_id = g_type_register_fundamental (g_type_fundamental_next (), "DragAndDropHandler", &g_define_type_info, &g_define_type_fundamental_info, 0);
- g_once_init_leave (&drag_and_drop_handler_type_id__volatile, drag_and_drop_handler_type_id);
- }
- return drag_and_drop_handler_type_id__volatile;
-}
-
-
-gpointer drag_and_drop_handler_ref (gpointer instance) {
- DragAndDropHandler* self;
- self = instance;
- g_atomic_int_inc (&self->ref_count);
- return instance;
-}
-
-
-void drag_and_drop_handler_unref (gpointer instance) {
- DragAndDropHandler* self;
- self = instance;
- if (g_atomic_int_dec_and_test (&self->ref_count)) {
- DRAG_AND_DROP_HANDLER_GET_CLASS (self)->finalize (self);
- g_type_free_instance ((GTypeInstance *) self);
- }
-}
-
-
gchar* get_temporary_filename (const gchar* prefix, const gchar* extension) {
gchar* result = NULL;
const gchar* _tmp0_;
@@ -5470,13 +5048,13 @@ gchar* get_temporary_filename (const gchar* prefix, const gchar* extension) {
path = _tmp4_;
fd = _tmp5_;
if (_inner_error_ != NULL) {
- goto __catch22_g_error;
+ goto __catch21_g_error;
}
_tmp6_ = fd;
close (_tmp6_);
}
- goto __finally22;
- __catch22_g_error:
+ goto __finally21;
+ __catch21_g_error:
{
GError* e = NULL;
GError* _tmp7_;
@@ -5485,14 +5063,14 @@ gchar* get_temporary_filename (const gchar* prefix, const gchar* extension) {
_inner_error_ = NULL;
_tmp7_ = e;
_tmp8_ = _tmp7_->message;
- g_warning ("ui.vala:1607: Error saving email attachment: %s", _tmp8_);
+ g_warning ("ui.vala:1547: Error saving email attachment: %s", _tmp8_);
result = NULL;
_g_error_free0 (e);
_g_free0 (path);
_g_free0 (filename);
return result;
}
- __finally22:
+ __finally21:
if (_inner_error_ != NULL) {
_g_free0 (path);
_g_free0 (filename);
diff --git a/src/ui.vala b/src/ui.vala
index 41b33b1..5b192d9 100644
--- a/src/ui.vala
+++ b/src/ui.vala
@@ -61,7 +61,6 @@ public class UserInterface
private Gtk.FileChooserDialog? save_dialog;
private ProgressBarDialog progress_dialog;
- private DragAndDropHandler dnd_handler = null;
private bool have_error;
private string error_title;
@@ -102,6 +101,12 @@ public class UserInterface
load ();
}
+ ~UserInterface ()
+ {
+ book.page_removed.disconnect (page_removed_cb);
+ book.page_added.disconnect (page_added_cb);
+ }
+
private bool find_scan_device (string device, out Gtk.TreeIter iter)
{
bool have_iter = false;
@@ -334,7 +339,7 @@ public class UserInterface
/* Get directory to save to */
string? directory = null;
directory = settings.get_string ("save-directory");
-
+
if (directory == null || directory == "")
directory = Environment.get_user_special_dir (UserDirectory.DOCUMENTS);
@@ -425,6 +430,7 @@ public class UserInterface
settings.set_string ("save-directory", save_dialog.get_current_folder ());
+ file_type_view.get_selection ().changed.disconnect (on_file_type_changed);
save_dialog.destroy ();
save_dialog = null;
@@ -530,6 +536,8 @@ public class UserInterface
_("Discard Changes")))
return;
+ if (scanning)
+ stop_scan ();
clear_document ();
}
@@ -792,7 +800,7 @@ public class UserInterface
e.message);
return;
}
-
+
try
{
Gtk.show_uri (window.get_screen (), file.get_uri (), Gtk.get_current_event_time ());
@@ -1025,6 +1033,8 @@ public class UserInterface
{
warning ("Error printing: %s", e.message);
}
+
+ print.draw_page.disconnect (draw_page);
}
[CCode (cname = "G_MODULE_EXPORT help_contents_menuitem_activate_cb", instance_pos = -1)]
@@ -1178,6 +1188,9 @@ public class UserInterface
private void page_removed_cb (Book book, Page page)
{
+ page.size_changed.disconnect (page_size_changed_cb);
+ page.scan_direction_changed.disconnect (page_scan_direction_changed_cb);
+
/* If this is the last page add a new blank one */
if (book.get_n_pages () == 1)
add_default_page ();
@@ -1401,13 +1414,11 @@ public class UserInterface
add_default_page ();
book.set_needs_saving (false);
book.needs_saving_changed.connect (needs_saving_cb);
-
+
progress_dialog = new ProgressBarDialog (window, _("Saving document..."));
book.saving.connect (book_saving_cb);
-
- dnd_handler = new DragAndDropHandler (book_view);
}
-
+
private void book_saving_cb (int page_number)
{
/* Prevent GUI from freezing */
@@ -1417,7 +1428,7 @@ public class UserInterface
var total = (int) book.get_n_pages ();
var fraction = (page_number + 1.0) / total;
var complete = fraction == 1.0;
- if (complete)
+ if (complete)
Timeout.add(500, () => {
progress_dialog.hide();
return false;
@@ -1427,12 +1438,12 @@ public class UserInterface
progress_dialog.set_fraction (fraction);
progress_dialog.set_message (message);
}
-
+
public void show_progress_dialog ()
{
progress_dialog.show ();
}
-
+
public void hide_progress_dialog ()
{
progress_dialog.hide ();
@@ -1511,84 +1522,13 @@ class ProgressBarDialog : Gtk.Window
{
bar.set_fraction (percent);
}
-
+
public void set_message (string message)
{
bar.set_text (message);
}
}
-class DragAndDropHandler
-{
- private enum TargetType
- {
- IMAGE,
- URI
- }
-
- private BookView book_view;
-
- public DragAndDropHandler (BookView book_view)
- {
- this.book_view = book_view;
- var event_source = book_view.get_event_source ();
-
- set_targets (event_source);
- event_source.drag_data_get.connect (on_drag_data_get);
- }
-
- private void set_targets (Gtk.Widget event_source)
- {
- var table = new Gtk.TargetEntry [0];
- var targets = new Gtk.TargetList (table);
- targets.add_uri_targets (TargetType.URI);
- targets.add_image_targets (TargetType.IMAGE, true);
-
- Gtk.drag_source_set (event_source, Gdk.ModifierType.BUTTON1_MASK, table, Gdk.DragAction.COPY);
- Gtk.drag_source_set_target_list (event_source, targets);
- }
-
- private void on_drag_data_get (Gdk.DragContext context, Gtk.SelectionData selection, uint target_type, uint time)
- {
- var page = book_view.get_selected ();
- return_if_fail (page != null);
-
- switch (target_type)
- {
- case TargetType.IMAGE:
- var image = page.get_image (true);
- selection.set_pixbuf (image);
-
- debug ("Saving page to pixbuf");
- break;
-
- case TargetType.URI:
- var filetype = "png";
- var path = get_temporary_filename ("scanned-page", filetype);
- return_if_fail (path != null);
-
- var file = File.new_for_path (path);
- var uri = file.get_uri ();
-
- try
- {
- page.save (filetype, file);
- selection.set_uris ({ uri });
- debug ("Saving page to %s", uri);
- }
- catch (Error e)
- {
- warning ("Unable to save file using drag-drop %s", e.message);
- }
- break;
-
- default:
- warning ("Invalid DND target type %u", target_type);
- break;
- }
- }
-}
-
// FIXME: Duplicated from simple-scan.vala
private string? get_temporary_filename (string prefix, string extension)
{
@@ -1610,4 +1550,3 @@ private string? get_temporary_filename (string prefix, string extension)
return path;
}
-