diff options
author | Alessio Treglia <alessio@debian.org> | 2012-08-07 18:56:06 +0200 |
---|---|---|
committer | Alessio Treglia <alessio@debian.org> | 2012-08-07 18:56:06 +0200 |
commit | 9593993c7d0c8ea122f55cb7d5c2a6348a0daa1a (patch) | |
tree | 8fa94b9a5176e3809a2d082a4164fc57d81d4e9c /src/ui.c | |
parent | df5fff91e1df71a8e9d9932183e28ad48a4c4e81 (diff) | |
parent | 026e231507aa5dae486255b6450b410f37e3abb0 (diff) |
Merge tag 'upstream/3.5.3'
Upstream version 3.5.3
Diffstat (limited to 'src/ui.c')
-rw-r--r-- | src/ui.c | 2617 |
1 files changed, 1666 insertions, 951 deletions
@@ -1,4 +1,4 @@ -/* ui.c generated by valac 0.16.0, the Vala compiler +/* ui.c generated by valac 0.16.1, the Vala compiler * generated from ui.vala, do not modify */ /* @@ -19,27 +19,47 @@ #include <stdlib.h> #include <string.h> #include <glib/gi18n-lib.h> -#include <glib/gstdio.h> -#include <unistd.h> #include <cairo.h> #include <float.h> #include <math.h> #include <gdk-pixbuf/gdk-pixbuf.h> #include <gdk/gdk.h> #include "config.h" +#include <glib/gstdio.h> +#include <unistd.h> #include <gobject/gvaluecollector.h> -#define TYPE_SIMPLE_SCAN (simple_scan_get_type ()) -#define SIMPLE_SCAN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SIMPLE_SCAN, SimpleScan)) -#define SIMPLE_SCAN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SIMPLE_SCAN, SimpleScanClass)) -#define IS_SIMPLE_SCAN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SIMPLE_SCAN)) -#define IS_SIMPLE_SCAN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SIMPLE_SCAN)) -#define SIMPLE_SCAN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SIMPLE_SCAN, SimpleScanClass)) +#define TYPE_USER_INTERFACE (user_interface_get_type ()) +#define USER_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_USER_INTERFACE, UserInterface)) +#define USER_INTERFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_USER_INTERFACE, UserInterfaceClass)) +#define IS_USER_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_USER_INTERFACE)) +#define IS_USER_INTERFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_USER_INTERFACE)) +#define USER_INTERFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_USER_INTERFACE, UserInterfaceClass)) + +typedef struct _UserInterface UserInterface; +typedef struct _UserInterfaceClass UserInterfaceClass; +typedef struct _UserInterfacePrivate UserInterfacePrivate; + +#define TYPE_PROGRESS_BAR_DIALOG (progress_bar_dialog_get_type ()) +#define PROGRESS_BAR_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PROGRESS_BAR_DIALOG, ProgressBarDialog)) +#define PROGRESS_BAR_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PROGRESS_BAR_DIALOG, ProgressBarDialogClass)) +#define IS_PROGRESS_BAR_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PROGRESS_BAR_DIALOG)) +#define IS_PROGRESS_BAR_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PROGRESS_BAR_DIALOG)) +#define PROGRESS_BAR_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PROGRESS_BAR_DIALOG, ProgressBarDialogClass)) + +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 _SimpleScan SimpleScan; -typedef struct _SimpleScanClass SimpleScanClass; -typedef struct _SimpleScanPrivate SimpleScanPrivate; +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)) @@ -63,6 +83,7 @@ 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))) @@ -106,17 +127,23 @@ typedef struct _ScanOptionsClass ScanOptionsClass; typedef struct _ScanOptionsPrivate ScanOptionsPrivate; #define _scan_options_unref0(var) ((var == NULL) ? NULL : (var = (scan_options_unref (var), NULL))) #define _cairo_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_destroy (var), NULL))) -typedef struct _ParamSpecSimpleScan ParamSpecSimpleScan; +typedef struct _ParamSpecUserInterface ParamSpecUserInterface; +typedef struct _ProgressBarDialogPrivate ProgressBarDialogPrivate; +typedef struct _DragAndDropHandlerPrivate DragAndDropHandlerPrivate; -struct _SimpleScan { +#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; volatile int ref_count; - SimpleScanPrivate * priv; + UserInterfacePrivate * priv; }; -struct _SimpleScanClass { +struct _UserInterfaceClass { GTypeClass parent_class; - void (*finalize) (SimpleScan *self); + void (*finalize) (UserInterface *self); }; typedef enum { @@ -126,7 +153,7 @@ typedef enum { SCAN_DIRECTION_RIGHT_TO_LEFT } ScanDirection; -struct _SimpleScanPrivate { +struct _UserInterfacePrivate { GSettings* settings; GtkBuilder* builder; GtkWindow* window; @@ -167,6 +194,8 @@ struct _SimpleScanPrivate { gboolean setting_devices; gboolean user_selected_device; GtkFileChooserDialog* save_dialog; + ProgressBarDialog* progress_dialog; + DragAndDropHandler* dnd_handler; gboolean have_error; gchar* error_title; gchar* error_text; @@ -231,20 +260,67 @@ struct _ScanOptionsClass { void (*finalize) (ScanOptions *self); }; -struct _ParamSpecSimpleScan { +struct _ParamSpecUserInterface { GParamSpec parent_instance; }; +struct _ProgressBarDialog { + GtkWindow parent_instance; + ProgressBarDialogPrivate * priv; +}; + +struct _ProgressBarDialogClass { + GtkWindowClass parent_class; +}; + +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 simple_scan_parent_class = NULL; -gpointer simple_scan_ref (gpointer instance); -void simple_scan_unref (gpointer instance); -GParamSpec* param_spec_simple_scan (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); -void value_set_simple_scan (GValue* value, gpointer v_object); -void value_take_simple_scan (GValue* value, gpointer v_object); -gpointer value_get_simple_scan (const GValue* value); -GType simple_scan_get_type (void) G_GNUC_CONST; +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); +GParamSpec* param_spec_user_interface (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void value_set_user_interface (GValue* value, gpointer v_object); +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); @@ -254,14 +330,14 @@ gpointer value_get_book (const GValue* value); GType book_get_type (void) G_GNUC_CONST; GType book_view_get_type (void) G_GNUC_CONST; GType scan_direction_get_type (void) G_GNUC_CONST; -#define SIMPLE_SCAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_SIMPLE_SCAN, SimpleScanPrivate)) +#define USER_INTERFACE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_USER_INTERFACE, UserInterfacePrivate)) enum { - SIMPLE_SCAN_DUMMY_PROPERTY + USER_INTERFACE_DUMMY_PROPERTY }; -#define SIMPLE_SCAN_DEFAULT_TEXT_DPI 150 -#define SIMPLE_SCAN_DEFAULT_PHOTO_DPI 300 -SimpleScan* simple_scan_new (void); -SimpleScan* simple_scan_construct (GType object_type); +#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); @@ -271,17 +347,17 @@ void value_set_page (GValue* value, gpointer v_object); void value_take_page (GValue* value, gpointer v_object); gpointer value_get_page (const GValue* value); GType page_get_type (void) G_GNUC_CONST; -static void simple_scan_page_removed_cb (SimpleScan* self, Book* book, Page* page); -static void _simple_scan_page_removed_cb_book_page_removed (Book* _sender, Page* page, gpointer self); -static void simple_scan_page_added_cb (SimpleScan* self, Book* book, Page* page); -static void _simple_scan_page_added_cb_book_page_added (Book* _sender, Page* page, gpointer self); -static void simple_scan_load (SimpleScan* self); -static gboolean simple_scan_find_scan_device (SimpleScan* self, const gchar* device, GtkTreeIter* iter); -static void simple_scan_show_error_dialog (SimpleScan* self, const gchar* error_title, const gchar* error_text); -void simple_scan_set_default_file_name (SimpleScan* self, const gchar* default_file_name); -void simple_scan_authorize (SimpleScan* self, const gchar* resource, gchar** username, gchar** password); -void G_MODULE_EXPORT device_combo_changed_cb (GtkWidget* widget, SimpleScan* self); -static void simple_scan_update_info_bar (SimpleScan* self); +static void user_interface_page_removed_cb (UserInterface* self, Book* book, Page* page); +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); +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); +void user_interface_set_default_file_name (UserInterface* self, const gchar* default_file_name); +void user_interface_authorize (UserInterface* self, const gchar* resource, gchar** username, gchar** password); +void G_MODULE_EXPORT device_combo_changed_cb (GtkWidget* widget, UserInterface* self); +static void user_interface_update_info_bar (UserInterface* self); gpointer scan_device_ref (gpointer instance); void scan_device_unref (gpointer instance); GParamSpec* param_spec_scan_device (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); @@ -289,34 +365,36 @@ void value_set_scan_device (GValue* value, gpointer v_object); void value_take_scan_device (GValue* value, gpointer v_object); gpointer value_get_scan_device (const GValue* value); GType scan_device_get_type (void) G_GNUC_CONST; -void simple_scan_set_scan_devices (SimpleScan* self, GList* devices); -static gchar* simple_scan_get_selected_device (SimpleScan* self); -void simple_scan_set_selected_device (SimpleScan* self, const gchar* device); -static void simple_scan_add_default_page (SimpleScan* self); +void user_interface_set_scan_devices (UserInterface* self, GList* devices); +static gchar* user_interface_get_selected_device (UserInterface* self); +void user_interface_set_selected_device (UserInterface* self, const gchar* device); +static void user_interface_add_default_page (UserInterface* self); Page* book_append_page (Book* self, gint width, gint height, gint dpi, ScanDirection scan_direction); void book_view_select_page (BookView* self, Page* page); -static void simple_scan_on_file_type_changed (SimpleScan* self, GtkTreeSelection* selection); -static gchar* simple_scan_choose_file_location (SimpleScan* self); -static void _simple_scan_on_file_type_changed_gtk_tree_selection_changed (GtkTreeSelection* _sender, gpointer self); -static gboolean simple_scan_save_document (SimpleScan* self, gboolean force_choose_location); +static void user_interface_on_file_type_changed (UserInterface* self, GtkTreeSelection* selection); +static gchar* user_interface_choose_file_location (UserInterface* self); +static void _user_interface_on_file_type_changed_gtk_tree_selection_changed (GtkTreeSelection* _sender, gpointer self); +static gboolean user_interface_save_document (UserInterface* self, gboolean force_choose_location); +void user_interface_show_progress_dialog (UserInterface* self); void book_save (Book* self, const gchar* type, GFile* file, GError** error); -void simple_scan_show_error (SimpleScan* self, const gchar* error_title, const gchar* error_text, gboolean change_scanner_hint); +void user_interface_hide_progress_dialog (UserInterface* self); +void user_interface_show_error (UserInterface* self, const gchar* error_title, const gchar* error_text, gboolean change_scanner_hint); void book_set_needs_saving (Book* self, gboolean needs_saving); -static gboolean simple_scan_prompt_to_save (SimpleScan* self, const gchar* title, const gchar* discard_label); +static gboolean user_interface_prompt_to_save (UserInterface* self, const gchar* title, const gchar* discard_label); gboolean book_get_needs_saving (Book* self); -static void simple_scan_clear_document (SimpleScan* self); +static void user_interface_clear_document (UserInterface* self); void book_clear (Book* self); -void G_MODULE_EXPORT new_button_clicked_cb (GtkWidget* widget, SimpleScan* self); -static void simple_scan_set_document_hint (SimpleScan* self, const gchar* document_hint); -void G_MODULE_EXPORT text_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self); -void G_MODULE_EXPORT photo_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self); +void G_MODULE_EXPORT new_button_clicked_cb (GtkWidget* widget, UserInterface* self); +static void user_interface_set_document_hint (UserInterface* self, const gchar* document_hint); +void G_MODULE_EXPORT text_menuitem_toggled_cb (GtkCheckMenuItem* widget, UserInterface* self); +void G_MODULE_EXPORT photo_menuitem_toggled_cb (GtkCheckMenuItem* widget, UserInterface* self); GType scan_type_get_type (void) G_GNUC_CONST; -static void simple_scan_set_page_side (SimpleScan* self, ScanType page_side); -static void simple_scan_set_paper_size (SimpleScan* self, gint width, gint height); -static gint simple_scan_get_text_dpi (SimpleScan* self); -static gint simple_scan_get_photo_dpi (SimpleScan* self); -static ScanType simple_scan_get_page_side (SimpleScan* self); -static gboolean simple_scan_get_paper_size (SimpleScan* self, gint* width, gint* height); +static void user_interface_set_page_side (UserInterface* self, ScanType page_side); +static void user_interface_set_paper_size (UserInterface* self, gint width, gint height); +static gint user_interface_get_text_dpi (UserInterface* self); +static gint user_interface_get_photo_dpi (UserInterface* self); +static ScanType user_interface_get_page_side (UserInterface* self); +static gboolean user_interface_get_paper_size (UserInterface* self, gint* width, gint* height); gpointer scan_options_ref (gpointer instance); void scan_options_unref (gpointer instance); GParamSpec* param_spec_scan_options (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); @@ -324,136 +402,161 @@ void value_set_scan_options (GValue* value, gpointer v_object); void value_take_scan_options (GValue* value, gpointer v_object); gpointer value_get_scan_options (const GValue* value); GType scan_options_get_type (void) G_GNUC_CONST; -static ScanOptions* simple_scan_get_scan_options (SimpleScan* self); +static ScanOptions* user_interface_get_scan_options (UserInterface* self); ScanOptions* scan_options_new (void); ScanOptions* scan_options_construct (GType object_type); GType scan_mode_get_type (void) G_GNUC_CONST; -void G_MODULE_EXPORT scan_button_clicked_cb (GtkWidget* widget, SimpleScan* self); -void G_MODULE_EXPORT stop_scan_button_clicked_cb (GtkWidget* widget, SimpleScan* self); -void G_MODULE_EXPORT continuous_scan_button_clicked_cb (GtkWidget* widget, SimpleScan* self); -void G_MODULE_EXPORT preferences_button_clicked_cb (GtkWidget* widget, SimpleScan* self); -gboolean G_MODULE_EXPORT preferences_dialog_delete_event_cb (GtkWidget* widget, SimpleScan* self); -void G_MODULE_EXPORT preferences_dialog_response_cb (GtkWidget* widget, gint response_id, SimpleScan* self); -static void simple_scan_update_page_menu (SimpleScan* self); +void G_MODULE_EXPORT scan_button_clicked_cb (GtkWidget* widget, UserInterface* self); +void G_MODULE_EXPORT stop_scan_button_clicked_cb (GtkWidget* widget, UserInterface* self); +void G_MODULE_EXPORT continuous_scan_button_clicked_cb (GtkWidget* widget, UserInterface* self); +void G_MODULE_EXPORT preferences_button_clicked_cb (GtkWidget* widget, UserInterface* self); +gboolean G_MODULE_EXPORT preferences_dialog_delete_event_cb (GtkWidget* widget, UserInterface* self); +void G_MODULE_EXPORT preferences_dialog_response_cb (GtkWidget* widget, gint response_id, UserInterface* self); +static void user_interface_update_page_menu (UserInterface* self); Page* book_view_get_selected (BookView* self); guint book_get_page_index (Book* self, Page* page); guint book_get_n_pages (Book* self); -static void simple_scan_page_selected_cb (SimpleScan* self, BookView* view, Page* page); +static void user_interface_page_selected_cb (UserInterface* self, BookView* view, Page* page); gboolean page_has_crop (Page* self); gchar* page_get_named_crop (Page* self); -static gchar* simple_scan_get_temporary_filename (SimpleScan* self, const gchar* prefix, const gchar* extension); -static void simple_scan_show_page_cb (SimpleScan* self, BookView* view, Page* page); +static void user_interface_show_page_cb (UserInterface* self, BookView* view, Page* page); +gchar* get_temporary_filename (const gchar* prefix, const gchar* extension); void page_save (Page* self, const gchar* type, GFile* file, GError** error); -static void simple_scan_show_page_menu_cb (SimpleScan* self, BookView* view); -void G_MODULE_EXPORT rotate_left_button_clicked_cb (GtkWidget* widget, SimpleScan* self); +static void user_interface_show_page_menu_cb (UserInterface* self, BookView* view); +void G_MODULE_EXPORT rotate_left_button_clicked_cb (GtkWidget* widget, UserInterface* self); void page_rotate_left (Page* self); -void G_MODULE_EXPORT rotate_right_button_clicked_cb (GtkWidget* widget, SimpleScan* self); +void G_MODULE_EXPORT rotate_right_button_clicked_cb (GtkWidget* widget, UserInterface* self); void page_rotate_right (Page* self); -static void simple_scan_set_crop (SimpleScan* self, const gchar* crop_name); +static void user_interface_set_crop (UserInterface* self, const gchar* crop_name); void page_set_no_crop (Page* self); gint page_get_width (Page* self); gint page_get_height (Page* self); void page_set_custom_crop (Page* self, gint width, gint height); void page_move_crop (Page* self, gint x, gint y); void page_set_named_crop (Page* self, const gchar* name); -void G_MODULE_EXPORT no_crop_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self); -void G_MODULE_EXPORT custom_crop_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self); -void G_MODULE_EXPORT crop_toolbutton_toggled_cb (GtkToggleToolButton* widget, SimpleScan* self); -void G_MODULE_EXPORT four_by_six_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self); -void G_MODULE_EXPORT legal_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self); -void G_MODULE_EXPORT letter_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self); -void G_MODULE_EXPORT a6_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self); -void G_MODULE_EXPORT a5_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self); -void G_MODULE_EXPORT a4_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self); -void G_MODULE_EXPORT crop_rotate_menuitem_activate_cb (GtkWidget* widget, SimpleScan* self); +void G_MODULE_EXPORT no_crop_menuitem_toggled_cb (GtkCheckMenuItem* widget, UserInterface* self); +void G_MODULE_EXPORT custom_crop_menuitem_toggled_cb (GtkCheckMenuItem* widget, UserInterface* self); +void G_MODULE_EXPORT crop_toolbutton_toggled_cb (GtkToggleToolButton* widget, UserInterface* self); +void G_MODULE_EXPORT four_by_six_menuitem_toggled_cb (GtkCheckMenuItem* widget, UserInterface* self); +void G_MODULE_EXPORT legal_menuitem_toggled_cb (GtkCheckMenuItem* widget, UserInterface* self); +void G_MODULE_EXPORT letter_menuitem_toggled_cb (GtkCheckMenuItem* widget, UserInterface* self); +void G_MODULE_EXPORT a6_menuitem_toggled_cb (GtkCheckMenuItem* widget, UserInterface* self); +void G_MODULE_EXPORT a5_menuitem_toggled_cb (GtkCheckMenuItem* widget, UserInterface* self); +void G_MODULE_EXPORT a4_menuitem_toggled_cb (GtkCheckMenuItem* widget, UserInterface* self); +void G_MODULE_EXPORT crop_rotate_menuitem_activate_cb (GtkWidget* widget, UserInterface* self); void page_rotate_crop (Page* self); -void G_MODULE_EXPORT page_move_left_menuitem_activate_cb (GtkWidget* widget, SimpleScan* self); +void G_MODULE_EXPORT page_move_left_menuitem_activate_cb (GtkWidget* widget, UserInterface* self); void book_move_page (Book* self, Page* page, guint location); -void G_MODULE_EXPORT page_move_right_menuitem_activate_cb (GtkWidget* widget, SimpleScan* self); -void G_MODULE_EXPORT page_delete_menuitem_activate_cb (GtkWidget* widget, SimpleScan* self); +void G_MODULE_EXPORT page_move_right_menuitem_activate_cb (GtkWidget* widget, UserInterface* self); +void G_MODULE_EXPORT page_delete_menuitem_activate_cb (GtkWidget* widget, UserInterface* self); Book* book_view_get_book (BookView* self); void book_delete_page (Book* self, Page* page); -void G_MODULE_EXPORT save_file_button_clicked_cb (GtkWidget* widget, SimpleScan* self); -void G_MODULE_EXPORT save_as_file_button_clicked_cb (GtkWidget* widget, SimpleScan* self); -static void simple_scan_draw_page (SimpleScan* self, GtkPrintOperation* operation, GtkPrintContext* print_context, gint page_number); +void G_MODULE_EXPORT save_file_button_clicked_cb (GtkWidget* widget, UserInterface* self); +void G_MODULE_EXPORT save_as_file_button_clicked_cb (GtkWidget* widget, UserInterface* self); +static void user_interface_draw_page (UserInterface* self, GtkPrintOperation* operation, GtkPrintContext* print_context, gint page_number); Page* book_get_page (Book* self, gint page_number); gboolean page_is_landscape (Page* self); gint page_get_dpi (Page* self); GdkPixbuf* page_get_image (Page* self, gboolean apply_crop); -void G_MODULE_EXPORT email_button_clicked_cb (GtkWidget* widget, SimpleScan* self); -void G_MODULE_EXPORT print_button_clicked_cb (GtkWidget* widget, SimpleScan* self); -static void _simple_scan_draw_page_gtk_print_operation_draw_page (GtkPrintOperation* _sender, GtkPrintContext* context, gint page_nr, gpointer self); -void G_MODULE_EXPORT help_contents_menuitem_activate_cb (GtkWidget* widget, SimpleScan* self); -void G_MODULE_EXPORT about_menuitem_activate_cb (GtkWidget* widget, SimpleScan* self); -static gboolean simple_scan_on_quit (SimpleScan* self); -void G_MODULE_EXPORT quit_menuitem_activate_cb (GtkWidget* widget, SimpleScan* self); -gboolean G_MODULE_EXPORT simple_scan_window_configure_event_cb (GtkWidget* widget, GdkEventConfigure* event, SimpleScan* self); -static void simple_scan_info_bar_response_cb (SimpleScan* self, GtkInfoBar* widget, gint response_id); -gboolean G_MODULE_EXPORT simple_scan_window_window_state_event_cb (GtkWidget* widget, GdkEventWindowState* event, SimpleScan* self); -gboolean G_MODULE_EXPORT window_delete_event_cb (GtkWidget* widget, GdkEvent* event, SimpleScan* self); -static void simple_scan_page_size_changed_cb (SimpleScan* self, Page* page); -static void simple_scan_page_scan_direction_changed_cb (SimpleScan* self, Page* page); +void G_MODULE_EXPORT email_button_clicked_cb (GtkWidget* widget, UserInterface* self); +void G_MODULE_EXPORT print_button_clicked_cb (GtkWidget* widget, UserInterface* self); +static void _user_interface_draw_page_gtk_print_operation_draw_page (GtkPrintOperation* _sender, GtkPrintContext* context, gint page_nr, gpointer self); +void G_MODULE_EXPORT help_contents_menuitem_activate_cb (GtkWidget* widget, UserInterface* self); +void G_MODULE_EXPORT about_menuitem_activate_cb (GtkWidget* widget, UserInterface* self); +static gboolean user_interface_on_quit (UserInterface* self); +void G_MODULE_EXPORT quit_menuitem_activate_cb (GtkWidget* widget, UserInterface* self); +gboolean G_MODULE_EXPORT simple_scan_window_configure_event_cb (GtkWidget* widget, GdkEventConfigure* event, UserInterface* self); +static void user_interface_info_bar_response_cb (UserInterface* self, GtkInfoBar* widget, gint response_id); +gboolean G_MODULE_EXPORT simple_scan_window_window_state_event_cb (GtkWidget* widget, GdkEventWindowState* event, UserInterface* self); +gboolean G_MODULE_EXPORT window_delete_event_cb (GtkWidget* widget, GdkEvent* event, UserInterface* self); +static void user_interface_page_size_changed_cb (UserInterface* self, Page* page); +static void user_interface_page_scan_direction_changed_cb (UserInterface* self, Page* page); ScanDirection page_get_scan_direction (Page* self); -static void _simple_scan_page_size_changed_cb_page_size_changed (Page* _sender, gpointer self); -static void _simple_scan_page_scan_direction_changed_cb_page_scan_direction_changed (Page* _sender, gpointer self); -static void simple_scan_set_dpi_combo (SimpleScan* self, GtkComboBox* combo, gint default_dpi, gint current_dpi); -static void simple_scan_needs_saving_cb (SimpleScan* self, Book* book); -static void _simple_scan_info_bar_response_cb_gtk_info_bar_response (GtkInfoBar* _sender, gint response_id, gpointer self); +static void _user_interface_page_size_changed_cb_page_size_changed (Page* _sender, gpointer self); +static void _user_interface_page_scan_direction_changed_cb_page_scan_direction_changed (Page* _sender, gpointer self); +static void user_interface_set_dpi_combo (UserInterface* self, GtkComboBox* combo, gint default_dpi, gint current_dpi); +static void user_interface_needs_saving_cb (UserInterface* self, Book* book); +static void _user_interface_info_bar_response_cb_gtk_info_bar_response (GtkInfoBar* _sender, gint response_id, gpointer self); BookView* book_view_new (Book* book); BookView* book_view_construct (GType object_type, Book* book); -static void _simple_scan_page_selected_cb_book_view_page_selected (BookView* _sender, Page* page, gpointer self); -static void _simple_scan_show_page_cb_book_view_show_page (BookView* _sender, Page* page, gpointer self); -static void _simple_scan_show_page_menu_cb_book_view_show_menu (BookView* _sender, gpointer self); -static void _simple_scan_needs_saving_cb_book_needs_saving_changed (Book* _sender, gpointer self); -Book* simple_scan_get_book (SimpleScan* self); -void simple_scan_set_selected_page (SimpleScan* self, Page* page); -Page* simple_scan_get_selected_page (SimpleScan* self); -void simple_scan_set_scanning (SimpleScan* self, gboolean scanning); -void simple_scan_start (SimpleScan* self); +static void _user_interface_page_selected_cb_book_view_page_selected (BookView* _sender, Page* page, gpointer self); +static void _user_interface_show_page_cb_book_view_show_page (BookView* _sender, Page* page, gpointer self); +static void _user_interface_show_page_menu_cb_book_view_show_menu (BookView* _sender, gpointer self); +static void _user_interface_needs_saving_cb_book_needs_saving_changed (Book* _sender, gpointer self); +ProgressBarDialog* progress_bar_dialog_new (GtkWindow* parent, const gchar* title); +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); +void progress_bar_dialog_set_message (ProgressBarDialog* self, const gchar* message); +Book* user_interface_get_book (UserInterface* self); +void user_interface_set_selected_page (UserInterface* self, Page* page); +Page* user_interface_get_selected_page (UserInterface* self); +void user_interface_set_scanning (UserInterface* self, gboolean scanning); +void user_interface_start (UserInterface* self); static void g_cclosure_user_marshal_VOID__STRING_SCAN_OPTIONS (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data); -static void simple_scan_finalize (SimpleScan* obj); +static void user_interface_finalize (UserInterface* obj); +#define PROGRESS_BAR_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_PROGRESS_BAR_DIALOG, ProgressBarDialogPrivate)) +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); -static void _simple_scan_page_removed_cb_book_page_removed (Book* _sender, Page* page, gpointer self) { - simple_scan_page_removed_cb (self, _sender, page); +static void _user_interface_page_removed_cb_book_page_removed (Book* _sender, Page* page, gpointer self) { + user_interface_page_removed_cb (self, _sender, page); } -static void _simple_scan_page_added_cb_book_page_added (Book* _sender, Page* page, gpointer self) { - simple_scan_page_added_cb (self, _sender, page); +static void _user_interface_page_added_cb_book_page_added (Book* _sender, Page* page, gpointer self) { + user_interface_page_added_cb (self, _sender, page); } -SimpleScan* simple_scan_construct (GType object_type) { - SimpleScan* self = NULL; +UserInterface* user_interface_construct (GType object_type) { + UserInterface* self = NULL; Book* _tmp0_; Book* _tmp1_; Book* _tmp2_; GSettings* _tmp3_; - self = (SimpleScan*) g_type_create_instance (object_type); + self = (UserInterface*) g_type_create_instance (object_type); _tmp0_ = book_new (); _book_unref0 (self->priv->book); self->priv->book = _tmp0_; _tmp1_ = self->priv->book; - g_signal_connect (_tmp1_, "page-removed", (GCallback) _simple_scan_page_removed_cb_book_page_removed, self); + g_signal_connect (_tmp1_, "page-removed", (GCallback) _user_interface_page_removed_cb_book_page_removed, self); _tmp2_ = self->priv->book; - g_signal_connect (_tmp2_, "page-added", (GCallback) _simple_scan_page_added_cb_book_page_added, self); + g_signal_connect (_tmp2_, "page-added", (GCallback) _user_interface_page_added_cb_book_page_added, self); _tmp3_ = g_settings_new ("org.gnome.SimpleScan"); _g_object_unref0 (self->priv->settings); self->priv->settings = _tmp3_; - simple_scan_load (self); + user_interface_load (self); return self; } -SimpleScan* simple_scan_new (void) { - return simple_scan_construct (TYPE_SIMPLE_SCAN); +UserInterface* user_interface_new (void) { + return user_interface_construct (TYPE_USER_INTERFACE); } -static gboolean simple_scan_find_scan_device (SimpleScan* self, const gchar* device, GtkTreeIter* iter) { +static gboolean user_interface_find_scan_device (UserInterface* self, const gchar* device, GtkTreeIter* iter) { GtkTreeIter _vala_iter = {0}; gboolean result = FALSE; gboolean have_iter; @@ -518,7 +621,7 @@ static gboolean simple_scan_find_scan_device (SimpleScan* self, const gchar* dev } -static void simple_scan_show_error_dialog (SimpleScan* self, const gchar* error_title, const gchar* error_text) { +static void user_interface_show_error_dialog (UserInterface* self, const gchar* error_title, const gchar* error_text) { GtkWindow* _tmp0_; const gchar* _tmp1_; GtkMessageDialog* _tmp2_; @@ -541,7 +644,7 @@ static void simple_scan_show_error_dialog (SimpleScan* self, const gchar* error_ } -void simple_scan_set_default_file_name (SimpleScan* self, const gchar* default_file_name) { +void user_interface_set_default_file_name (UserInterface* self, const gchar* default_file_name) { const gchar* _tmp0_; gchar* _tmp1_; g_return_if_fail (self != NULL); @@ -553,7 +656,7 @@ void simple_scan_set_default_file_name (SimpleScan* self, const gchar* default_f } -void simple_scan_authorize (SimpleScan* self, const gchar* resource, gchar** username, gchar** password) { +void user_interface_authorize (UserInterface* self, const gchar* resource, gchar** username, gchar** password) { gchar* _vala_username = NULL; gchar* _vala_password = NULL; const gchar* _tmp0_ = NULL; @@ -614,7 +717,7 @@ void simple_scan_authorize (SimpleScan* self, const gchar* resource, gchar** use } -void G_MODULE_EXPORT device_combo_changed_cb (GtkWidget* widget, SimpleScan* self) { +void G_MODULE_EXPORT device_combo_changed_cb (GtkWidget* widget, UserInterface* self) { gboolean _tmp0_; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); @@ -626,7 +729,7 @@ void G_MODULE_EXPORT device_combo_changed_cb (GtkWidget* widget, SimpleScan* sel } -static void simple_scan_update_info_bar (SimpleScan* self) { +static void user_interface_update_info_bar (UserInterface* self) { GtkMessageType type = 0; gchar* title = NULL; gchar* text = NULL; @@ -741,7 +844,7 @@ static gpointer _scan_device_ref0 (gpointer self) { } -void simple_scan_set_scan_devices (SimpleScan* self, GList* devices) { +void user_interface_set_scan_devices (UserInterface* self, GList* devices) { gboolean have_selection; gint index = 0; GtkTreeIter iter = {0}; @@ -941,11 +1044,11 @@ void simple_scan_set_scan_devices (SimpleScan* self, GList* devices) { gtk_combo_box_set_active (_tmp56_, 0); } self->priv->setting_devices = FALSE; - simple_scan_update_info_bar (self); + user_interface_update_info_bar (self); } -static gchar* simple_scan_get_selected_device (SimpleScan* self) { +static gchar* user_interface_get_selected_device (UserInterface* self) { gchar* result = NULL; GtkTreeIter iter = {0}; GtkComboBox* _tmp0_; @@ -970,7 +1073,7 @@ static gchar* simple_scan_get_selected_device (SimpleScan* self) { } -void simple_scan_set_selected_device (SimpleScan* self, const gchar* device) { +void user_interface_set_selected_device (UserInterface* self, const gchar* device) { GtkTreeIter iter = {0}; const gchar* _tmp0_; GtkTreeIter _tmp1_ = {0}; @@ -980,7 +1083,7 @@ void simple_scan_set_selected_device (SimpleScan* self, const gchar* device) { g_return_if_fail (self != NULL); g_return_if_fail (device != NULL); _tmp0_ = device; - _tmp2_ = simple_scan_find_scan_device (self, _tmp0_, &_tmp1_); + _tmp2_ = user_interface_find_scan_device (self, _tmp0_, &_tmp1_); iter = _tmp1_; if (!_tmp2_) { return; @@ -992,7 +1095,7 @@ void simple_scan_set_selected_device (SimpleScan* self, const gchar* device) { } -static void simple_scan_add_default_page (SimpleScan* self) { +static void user_interface_add_default_page (UserInterface* self) { Book* _tmp0_; gint _tmp1_; gint _tmp2_; @@ -1120,7 +1223,7 @@ static gchar* string_slice (const gchar* self, glong start, glong end) { } -static void simple_scan_on_file_type_changed (SimpleScan* self, GtkTreeSelection* selection) { +static void user_interface_on_file_type_changed (UserInterface* self, GtkTreeSelection* selection) { GtkTreeModel* model = NULL; GtkTreeIter iter = {0}; GtkTreeSelection* _tmp0_; @@ -1196,12 +1299,12 @@ static void simple_scan_on_file_type_changed (SimpleScan* self, GtkTreeSelection } -static void _simple_scan_on_file_type_changed_gtk_tree_selection_changed (GtkTreeSelection* _sender, gpointer self) { - simple_scan_on_file_type_changed (self, _sender); +static void _user_interface_on_file_type_changed_gtk_tree_selection_changed (GtkTreeSelection* _sender, gpointer self) { + user_interface_on_file_type_changed (self, _sender); } -static gchar* simple_scan_choose_file_location (SimpleScan* self) { +static gchar* user_interface_choose_file_location (UserInterface* self) { gchar* result = NULL; gchar* directory; GSettings* _tmp0_; @@ -1476,7 +1579,7 @@ static gchar* simple_scan_choose_file_location (SimpleScan* self) { } _tmp90_ = file_type_view; _tmp91_ = gtk_tree_view_get_selection (_tmp90_); - g_signal_connect (_tmp91_, "changed", (GCallback) _simple_scan_on_file_type_changed_gtk_tree_selection_changed, self); + 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; @@ -1514,7 +1617,7 @@ static gchar* simple_scan_choose_file_location (SimpleScan* self) { } -static gboolean simple_scan_save_document (SimpleScan* self, gboolean force_choose_location) { +static gboolean user_interface_save_document (UserInterface* self, gboolean force_choose_location) { gboolean result = FALSE; gchar* uri = NULL; gboolean _tmp0_ = FALSE; @@ -1555,7 +1658,7 @@ static gboolean simple_scan_save_document (SimpleScan* self, gboolean force_choo uri = _tmp5_; } else { gchar* _tmp6_ = NULL; - _tmp6_ = simple_scan_choose_file_location (self); + _tmp6_ = user_interface_choose_file_location (self); _g_free0 (uri); uri = _tmp6_; } @@ -1569,7 +1672,7 @@ static gboolean simple_scan_save_document (SimpleScan* self, gboolean force_choo _tmp9_ = g_file_new_for_uri (_tmp8_); file = _tmp9_; _tmp10_ = uri; - g_debug ("ui.vala:445: Saving to '%s'", _tmp10_); + g_debug ("ui.vala:446: Saving to '%s'", _tmp10_); _tmp11_ = uri; _tmp12_ = g_utf8_strdown (_tmp11_, (gssize) (-1)); uri_lower = _tmp12_; @@ -1628,6 +1731,7 @@ static gboolean simple_scan_save_document (SimpleScan* self, gboolean force_choo } } } + user_interface_show_progress_dialog (self); { Book* _tmp30_; const gchar* _tmp31_; @@ -1651,13 +1755,14 @@ static gboolean simple_scan_save_document (SimpleScan* self, gboolean force_choo const gchar* _tmp37_; e = _inner_error_; _inner_error_ = NULL; + user_interface_hide_progress_dialog (self); _tmp33_ = e; _tmp34_ = _tmp33_->message; - g_warning ("ui.vala:464: Error saving file: %s", _tmp34_); + g_warning ("ui.vala:467: Error saving file: %s", _tmp34_); _tmp35_ = _ ("Failed to save file"); _tmp36_ = e; _tmp37_ = _tmp36_->message; - simple_scan_show_error (self, _tmp35_, _tmp37_, FALSE); + user_interface_show_error (self, _tmp35_, _tmp37_, FALSE); result = FALSE; _g_error_free0 (e); _g_free0 (format); @@ -1691,7 +1796,7 @@ static gboolean simple_scan_save_document (SimpleScan* self, gboolean force_choo } -static gboolean simple_scan_prompt_to_save (SimpleScan* self, const gchar* title, const gchar* discard_label) { +static gboolean user_interface_prompt_to_save (UserInterface* self, const gchar* title, const gchar* discard_label) { gboolean result = FALSE; Book* _tmp0_; gboolean _tmp1_ = FALSE; @@ -1745,7 +1850,7 @@ static gboolean simple_scan_prompt_to_save (SimpleScan* self, const gchar* title case GTK_RESPONSE_YES: { gboolean _tmp16_ = FALSE; - _tmp16_ = simple_scan_save_document (self, FALSE); + _tmp16_ = user_interface_save_document (self, FALSE); if (_tmp16_) { result = TRUE; _g_object_unref0 (dialog); @@ -1774,14 +1879,14 @@ static gboolean simple_scan_prompt_to_save (SimpleScan* self, const gchar* title } -static void simple_scan_clear_document (SimpleScan* self) { +static void user_interface_clear_document (UserInterface* self) { Book* _tmp0_; Book* _tmp1_; GtkMenuItem* _tmp2_; g_return_if_fail (self != NULL); _tmp0_ = self->priv->book; book_clear (_tmp0_); - simple_scan_add_default_page (self); + user_interface_add_default_page (self); _g_free0 (self->priv->book_uri); self->priv->book_uri = NULL; _tmp1_ = self->priv->book; @@ -1791,7 +1896,7 @@ static void simple_scan_clear_document (SimpleScan* self) { } -void G_MODULE_EXPORT new_button_clicked_cb (GtkWidget* widget, SimpleScan* self) { +void G_MODULE_EXPORT new_button_clicked_cb (GtkWidget* widget, UserInterface* self) { const gchar* _tmp0_ = NULL; const gchar* _tmp1_ = NULL; gboolean _tmp2_ = FALSE; @@ -1799,15 +1904,15 @@ void G_MODULE_EXPORT new_button_clicked_cb (GtkWidget* widget, SimpleScan* self) g_return_if_fail (widget != NULL); _tmp0_ = _ ("Save current document?"); _tmp1_ = _ ("Discard Changes"); - _tmp2_ = simple_scan_prompt_to_save (self, _tmp0_, _tmp1_); + _tmp2_ = user_interface_prompt_to_save (self, _tmp0_, _tmp1_); if (!_tmp2_) { return; } - simple_scan_clear_document (self); + user_interface_clear_document (self); } -static void simple_scan_set_document_hint (SimpleScan* self, const gchar* document_hint) { +static void user_interface_set_document_hint (UserInterface* self, const gchar* document_hint) { const gchar* _tmp0_; gchar* _tmp1_; const gchar* _tmp2_; @@ -1840,7 +1945,7 @@ static void simple_scan_set_document_hint (SimpleScan* self, const gchar* docume } -void G_MODULE_EXPORT text_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) { +void G_MODULE_EXPORT text_menuitem_toggled_cb (GtkCheckMenuItem* widget, UserInterface* self) { GtkCheckMenuItem* _tmp0_; gboolean _tmp1_ = FALSE; g_return_if_fail (self != NULL); @@ -1848,12 +1953,12 @@ void G_MODULE_EXPORT text_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleS _tmp0_ = widget; _tmp1_ = gtk_check_menu_item_get_active (_tmp0_); if (_tmp1_) { - simple_scan_set_document_hint (self, "text"); + user_interface_set_document_hint (self, "text"); } } -void G_MODULE_EXPORT photo_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) { +void G_MODULE_EXPORT photo_menuitem_toggled_cb (GtkCheckMenuItem* widget, UserInterface* self) { GtkCheckMenuItem* _tmp0_; gboolean _tmp1_ = FALSE; g_return_if_fail (self != NULL); @@ -1861,12 +1966,12 @@ void G_MODULE_EXPORT photo_menuitem_toggled_cb (GtkCheckMenuItem* widget, Simple _tmp0_ = widget; _tmp1_ = gtk_check_menu_item_get_active (_tmp0_); if (_tmp1_) { - simple_scan_set_document_hint (self, "photo"); + user_interface_set_document_hint (self, "photo"); } } -static void simple_scan_set_page_side (SimpleScan* self, ScanType page_side) { +static void user_interface_set_page_side (UserInterface* self, ScanType page_side) { GtkTreeIter iter = {0}; GtkListStore* _tmp0_; GtkTreeIter _tmp1_ = {0}; @@ -1916,7 +2021,7 @@ static void simple_scan_set_page_side (SimpleScan* self, ScanType page_side) { } -static void simple_scan_set_paper_size (SimpleScan* self, gint width, gint height) { +static void user_interface_set_paper_size (UserInterface* self, gint width, gint height) { GtkTreeIter iter = {0}; gboolean have_iter = FALSE; gboolean _tmp16_; @@ -1997,7 +2102,7 @@ static void simple_scan_set_paper_size (SimpleScan* self, gint width, gint heigh } -static gint simple_scan_get_text_dpi (SimpleScan* self) { +static gint user_interface_get_text_dpi (UserInterface* self) { gint result = 0; GtkTreeIter iter = {0}; gint dpi; @@ -2005,7 +2110,7 @@ static gint simple_scan_get_text_dpi (SimpleScan* self) { GtkTreeIter _tmp1_ = {0}; gboolean _tmp2_ = FALSE; g_return_val_if_fail (self != NULL, 0); - dpi = SIMPLE_SCAN_DEFAULT_TEXT_DPI; + dpi = USER_INTERFACE_DEFAULT_TEXT_DPI; _tmp0_ = self->priv->text_dpi_combo; _tmp2_ = gtk_combo_box_get_active_iter (_tmp0_, &_tmp1_); iter = _tmp1_; @@ -2021,7 +2126,7 @@ static gint simple_scan_get_text_dpi (SimpleScan* self) { } -static gint simple_scan_get_photo_dpi (SimpleScan* self) { +static gint user_interface_get_photo_dpi (UserInterface* self) { gint result = 0; GtkTreeIter iter = {0}; gint dpi; @@ -2029,7 +2134,7 @@ static gint simple_scan_get_photo_dpi (SimpleScan* self) { GtkTreeIter _tmp1_ = {0}; gboolean _tmp2_ = FALSE; g_return_val_if_fail (self != NULL, 0); - dpi = SIMPLE_SCAN_DEFAULT_PHOTO_DPI; + dpi = USER_INTERFACE_DEFAULT_PHOTO_DPI; _tmp0_ = self->priv->photo_dpi_combo; _tmp2_ = gtk_combo_box_get_active_iter (_tmp0_, &_tmp1_); iter = _tmp1_; @@ -2045,7 +2150,7 @@ static gint simple_scan_get_photo_dpi (SimpleScan* self) { } -static ScanType simple_scan_get_page_side (SimpleScan* self) { +static ScanType user_interface_get_page_side (UserInterface* self) { ScanType result = 0; GtkTreeIter iter = {0}; gint page_side; @@ -2071,7 +2176,7 @@ static ScanType simple_scan_get_page_side (SimpleScan* self) { } -static gboolean simple_scan_get_paper_size (SimpleScan* self, gint* width, gint* height) { +static gboolean user_interface_get_paper_size (UserInterface* self, gint* width, gint* height) { gint _vala_width = 0; gint _vala_height = 0; gboolean result = FALSE; @@ -2113,7 +2218,7 @@ static gboolean simple_scan_get_paper_size (SimpleScan* self, gint* width, gint* } -static ScanOptions* simple_scan_get_scan_options (SimpleScan* self) { +static ScanOptions* user_interface_get_scan_options (UserInterface* self) { ScanOptions* result = NULL; ScanOptions* _tmp0_; ScanOptions* options; @@ -2134,7 +2239,7 @@ static ScanOptions* simple_scan_get_scan_options (SimpleScan* self) { _tmp2_ = options; _tmp2_->scan_mode = SCAN_MODE_GRAY; _tmp3_ = options; - _tmp4_ = simple_scan_get_text_dpi (self); + _tmp4_ = user_interface_get_text_dpi (self); _tmp3_->dpi = _tmp4_; _tmp5_ = options; _tmp5_->depth = 2; @@ -2146,14 +2251,14 @@ static ScanOptions* simple_scan_get_scan_options (SimpleScan* self) { _tmp6_ = options; _tmp6_->scan_mode = SCAN_MODE_COLOR; _tmp7_ = options; - _tmp8_ = simple_scan_get_photo_dpi (self); + _tmp8_ = user_interface_get_photo_dpi (self); _tmp7_->dpi = _tmp8_; _tmp9_ = options; _tmp9_->depth = 8; } _tmp10_ = options; _tmp11_ = options; - simple_scan_get_paper_size (self, &_tmp12_, &_tmp13_); + user_interface_get_paper_size (self, &_tmp12_, &_tmp13_); _tmp10_->paper_width = _tmp12_; _tmp11_->paper_height = _tmp13_; result = options; @@ -2161,17 +2266,17 @@ static ScanOptions* simple_scan_get_scan_options (SimpleScan* self) { } -void G_MODULE_EXPORT scan_button_clicked_cb (GtkWidget* widget, SimpleScan* self) { +void G_MODULE_EXPORT scan_button_clicked_cb (GtkWidget* widget, UserInterface* self) { ScanOptions* _tmp0_ = NULL; ScanOptions* options; gchar* _tmp1_ = NULL; gchar* _tmp2_; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - _tmp0_ = simple_scan_get_scan_options (self); + _tmp0_ = user_interface_get_scan_options (self); options = _tmp0_; options->type = SCAN_TYPE_SINGLE; - _tmp1_ = simple_scan_get_selected_device (self); + _tmp1_ = user_interface_get_selected_device (self); _tmp2_ = _tmp1_; g_signal_emit_by_name (self, "start-scan", _tmp2_, options); _g_free0 (_tmp2_); @@ -2179,14 +2284,14 @@ void G_MODULE_EXPORT scan_button_clicked_cb (GtkWidget* widget, SimpleScan* self } -void G_MODULE_EXPORT stop_scan_button_clicked_cb (GtkWidget* widget, SimpleScan* self) { +void G_MODULE_EXPORT stop_scan_button_clicked_cb (GtkWidget* widget, UserInterface* self) { g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); g_signal_emit_by_name (self, "stop-scan"); } -void G_MODULE_EXPORT continuous_scan_button_clicked_cb (GtkWidget* widget, SimpleScan* self) { +void G_MODULE_EXPORT continuous_scan_button_clicked_cb (GtkWidget* widget, UserInterface* self) { gboolean _tmp0_; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); @@ -2201,12 +2306,12 @@ void G_MODULE_EXPORT continuous_scan_button_clicked_cb (GtkWidget* widget, Simpl gchar* _tmp4_ = NULL; gchar* _tmp5_; ScanOptions* _tmp6_; - _tmp1_ = simple_scan_get_scan_options (self); + _tmp1_ = user_interface_get_scan_options (self); options = _tmp1_; _tmp2_ = options; - _tmp3_ = simple_scan_get_page_side (self); + _tmp3_ = user_interface_get_page_side (self); _tmp2_->type = _tmp3_; - _tmp4_ = simple_scan_get_selected_device (self); + _tmp4_ = user_interface_get_selected_device (self); _tmp5_ = _tmp4_; _tmp6_ = options; g_signal_emit_by_name (self, "start-scan", _tmp5_, _tmp6_); @@ -2216,7 +2321,7 @@ void G_MODULE_EXPORT continuous_scan_button_clicked_cb (GtkWidget* widget, Simpl } -void G_MODULE_EXPORT preferences_button_clicked_cb (GtkWidget* widget, SimpleScan* self) { +void G_MODULE_EXPORT preferences_button_clicked_cb (GtkWidget* widget, UserInterface* self) { GtkDialog* _tmp0_; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); @@ -2225,7 +2330,7 @@ void G_MODULE_EXPORT preferences_button_clicked_cb (GtkWidget* widget, SimpleSca } -gboolean G_MODULE_EXPORT preferences_dialog_delete_event_cb (GtkWidget* widget, SimpleScan* self) { +gboolean G_MODULE_EXPORT preferences_dialog_delete_event_cb (GtkWidget* widget, UserInterface* self) { gboolean result = FALSE; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (widget != NULL, FALSE); @@ -2234,7 +2339,7 @@ gboolean G_MODULE_EXPORT preferences_dialog_delete_event_cb (GtkWidget* widget, } -void G_MODULE_EXPORT preferences_dialog_response_cb (GtkWidget* widget, gint response_id, SimpleScan* self) { +void G_MODULE_EXPORT preferences_dialog_response_cb (GtkWidget* widget, gint response_id, UserInterface* self) { GtkDialog* _tmp0_; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); @@ -2243,7 +2348,7 @@ void G_MODULE_EXPORT preferences_dialog_response_cb (GtkWidget* widget, gint res } -static void simple_scan_update_page_menu (SimpleScan* self) { +static void user_interface_update_page_menu (UserInterface* self) { BookView* _tmp0_; Page* _tmp1_ = NULL; Page* page; @@ -2288,7 +2393,7 @@ static void simple_scan_update_page_menu (SimpleScan* self) { } -static void simple_scan_page_selected_cb (SimpleScan* self, BookView* view, Page* page) { +static void user_interface_page_selected_cb (UserInterface* self, BookView* view, Page* page) { Page* _tmp0_; gchar* name; Page* _tmp1_; @@ -2313,7 +2418,7 @@ static void simple_scan_page_selected_cb (SimpleScan* self, BookView* view, Page return; } self->priv->updating_page_menu = TRUE; - simple_scan_update_page_menu (self); + user_interface_update_page_menu (self); name = NULL; _tmp1_ = page; _tmp2_ = page_has_crop (_tmp1_); @@ -2415,70 +2520,7 @@ static void simple_scan_page_selected_cb (SimpleScan* self, BookView* view, Page } -static gchar* simple_scan_get_temporary_filename (SimpleScan* self, const gchar* prefix, const gchar* extension) { - gchar* result = NULL; - const gchar* _tmp0_; - const gchar* _tmp1_; - gchar* _tmp2_ = NULL; - gchar* filename; - gchar* path = NULL; - GError * _inner_error_ = NULL; - g_return_val_if_fail (self != NULL, NULL); - g_return_val_if_fail (prefix != NULL, NULL); - g_return_val_if_fail (extension != NULL, NULL); - _tmp0_ = prefix; - _tmp1_ = extension; - _tmp2_ = g_strdup_printf ("%sXXXXXX.%s", _tmp0_, _tmp1_); - filename = _tmp2_; - { - const gchar* _tmp3_; - gchar* _tmp4_ = NULL; - gint _tmp5_ = 0; - gint fd; - gint _tmp6_; - _tmp3_ = filename; - _tmp5_ = g_file_open_tmp (_tmp3_, &_tmp4_, &_inner_error_); - _g_free0 (path); - path = _tmp4_; - fd = _tmp5_; - if (_inner_error_ != NULL) { - goto __catch16_g_error; - } - _tmp6_ = fd; - close (_tmp6_); - } - goto __finally16; - __catch16_g_error: - { - GError* e = NULL; - GError* _tmp7_; - const gchar* _tmp8_; - e = _inner_error_; - _inner_error_ = NULL; - _tmp7_ = e; - _tmp8_ = _tmp7_->message; - g_warning ("ui.vala:789: Error saving email attachment: %s", _tmp8_); - result = NULL; - _g_error_free0 (e); - _g_free0 (path); - _g_free0 (filename); - return result; - } - __finally16: - if (_inner_error_ != NULL) { - _g_free0 (path); - _g_free0 (filename); - 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 NULL; - } - result = path; - _g_free0 (filename); - return result; -} - - -static void simple_scan_show_page_cb (SimpleScan* self, BookView* view, Page* page) { +static void user_interface_show_page_cb (UserInterface* self, BookView* view, Page* page) { gchar* _tmp0_ = NULL; gchar* path; const gchar* _tmp1_; @@ -2489,7 +2531,7 @@ static void simple_scan_show_page_cb (SimpleScan* self, BookView* view, Page* pa g_return_if_fail (self != NULL); g_return_if_fail (view != NULL); g_return_if_fail (page != NULL); - _tmp0_ = simple_scan_get_temporary_filename (self, "scanned-page", "tiff"); + _tmp0_ = get_temporary_filename ("scanned-page", "tiff"); path = _tmp0_; _tmp1_ = path; if (_tmp1_ == NULL) { @@ -2506,11 +2548,11 @@ static void simple_scan_show_page_cb (SimpleScan* self, BookView* view, Page* pa _tmp5_ = file; page_save (_tmp4_, "tiff", _tmp5_, &_inner_error_); if (_inner_error_ != NULL) { - goto __catch17_g_error; + goto __catch16_g_error; } } - goto __finally17; - __catch17_g_error: + goto __finally16; + __catch16_g_error: { GError* e = NULL; const gchar* _tmp6_ = NULL; @@ -2521,13 +2563,13 @@ static void simple_scan_show_page_cb (SimpleScan* self, BookView* view, Page* pa _tmp6_ = _ ("Unable to save image for preview"); _tmp7_ = e; _tmp8_ = _tmp7_->message; - simple_scan_show_error_dialog (self, _tmp6_, _tmp8_); + user_interface_show_error_dialog (self, _tmp6_, _tmp8_); _g_error_free0 (e); _g_object_unref0 (file); _g_free0 (path); return; } - __finally17: + __finally16: if (_inner_error_ != NULL) { _g_object_unref0 (file); _g_free0 (path); @@ -2551,11 +2593,11 @@ static void simple_scan_show_page_cb (SimpleScan* self, BookView* view, Page* pa gtk_show_uri (_tmp10_, _tmp13_, _tmp14_, &_inner_error_); _g_free0 (_tmp13_); if (_inner_error_ != NULL) { - goto __catch18_g_error; + goto __catch17_g_error; } } - goto __finally18; - __catch18_g_error: + goto __finally17; + __catch17_g_error: { GError* e = NULL; const gchar* _tmp15_ = NULL; @@ -2566,10 +2608,10 @@ static void simple_scan_show_page_cb (SimpleScan* self, BookView* view, Page* pa _tmp15_ = _ ("Unable to open image preview application"); _tmp16_ = e; _tmp17_ = _tmp16_->message; - simple_scan_show_error_dialog (self, _tmp15_, _tmp17_); + user_interface_show_error_dialog (self, _tmp15_, _tmp17_); _g_error_free0 (e); } - __finally18: + __finally17: if (_inner_error_ != NULL) { _g_object_unref0 (file); _g_free0 (path); @@ -2582,7 +2624,7 @@ static void simple_scan_show_page_cb (SimpleScan* self, BookView* view, Page* pa } -static void simple_scan_show_page_menu_cb (SimpleScan* self, BookView* view) { +static void user_interface_show_page_menu_cb (UserInterface* self, BookView* view) { GtkBuilder* _tmp0_; GObject* _tmp1_ = NULL; GtkMenu* _tmp2_; @@ -2600,7 +2642,7 @@ static void simple_scan_show_page_menu_cb (SimpleScan* self, BookView* view) { } -void G_MODULE_EXPORT rotate_left_button_clicked_cb (GtkWidget* widget, SimpleScan* self) { +void G_MODULE_EXPORT rotate_left_button_clicked_cb (GtkWidget* widget, UserInterface* self) { gboolean _tmp0_; BookView* _tmp1_; Page* _tmp2_ = NULL; @@ -2625,7 +2667,7 @@ void G_MODULE_EXPORT rotate_left_button_clicked_cb (GtkWidget* widget, SimpleSca } -void G_MODULE_EXPORT rotate_right_button_clicked_cb (GtkWidget* widget, SimpleScan* self) { +void G_MODULE_EXPORT rotate_right_button_clicked_cb (GtkWidget* widget, UserInterface* self) { gboolean _tmp0_; BookView* _tmp1_; Page* _tmp2_ = NULL; @@ -2650,7 +2692,7 @@ void G_MODULE_EXPORT rotate_right_button_clicked_cb (GtkWidget* widget, SimpleSc } -static void simple_scan_set_crop (SimpleScan* self, const gchar* crop_name) { +static void user_interface_set_crop (UserInterface* self, const gchar* crop_name) { GtkMenuItem* _tmp0_; const gchar* _tmp1_; gboolean _tmp2_; @@ -2736,7 +2778,7 @@ static void simple_scan_set_crop (SimpleScan* self, const gchar* crop_name) { } -void G_MODULE_EXPORT no_crop_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) { +void G_MODULE_EXPORT no_crop_menuitem_toggled_cb (GtkCheckMenuItem* widget, UserInterface* self) { GtkCheckMenuItem* _tmp0_; gboolean _tmp1_ = FALSE; g_return_if_fail (self != NULL); @@ -2744,12 +2786,12 @@ void G_MODULE_EXPORT no_crop_menuitem_toggled_cb (GtkCheckMenuItem* widget, Simp _tmp0_ = widget; _tmp1_ = gtk_check_menu_item_get_active (_tmp0_); if (_tmp1_) { - simple_scan_set_crop (self, NULL); + user_interface_set_crop (self, NULL); } } -void G_MODULE_EXPORT custom_crop_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) { +void G_MODULE_EXPORT custom_crop_menuitem_toggled_cb (GtkCheckMenuItem* widget, UserInterface* self) { GtkCheckMenuItem* _tmp0_; gboolean _tmp1_ = FALSE; g_return_if_fail (self != NULL); @@ -2757,12 +2799,12 @@ void G_MODULE_EXPORT custom_crop_menuitem_toggled_cb (GtkCheckMenuItem* widget, _tmp0_ = widget; _tmp1_ = gtk_check_menu_item_get_active (_tmp0_); if (_tmp1_) { - simple_scan_set_crop (self, "custom"); + user_interface_set_crop (self, "custom"); } } -void G_MODULE_EXPORT crop_toolbutton_toggled_cb (GtkToggleToolButton* widget, SimpleScan* self) { +void G_MODULE_EXPORT crop_toolbutton_toggled_cb (GtkToggleToolButton* widget, UserInterface* self) { gboolean _tmp0_; GtkRadioMenuItem* menuitem = NULL; GtkToggleToolButton* _tmp1_; @@ -2801,7 +2843,7 @@ void G_MODULE_EXPORT crop_toolbutton_toggled_cb (GtkToggleToolButton* widget, Si } -void G_MODULE_EXPORT four_by_six_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) { +void G_MODULE_EXPORT four_by_six_menuitem_toggled_cb (GtkCheckMenuItem* widget, UserInterface* self) { GtkCheckMenuItem* _tmp0_; gboolean _tmp1_ = FALSE; g_return_if_fail (self != NULL); @@ -2809,12 +2851,12 @@ void G_MODULE_EXPORT four_by_six_menuitem_toggled_cb (GtkCheckMenuItem* widget, _tmp0_ = widget; _tmp1_ = gtk_check_menu_item_get_active (_tmp0_); if (_tmp1_) { - simple_scan_set_crop (self, "4x6"); + user_interface_set_crop (self, "4x6"); } } -void G_MODULE_EXPORT legal_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) { +void G_MODULE_EXPORT legal_menuitem_toggled_cb (GtkCheckMenuItem* widget, UserInterface* self) { GtkCheckMenuItem* _tmp0_; gboolean _tmp1_ = FALSE; g_return_if_fail (self != NULL); @@ -2822,12 +2864,12 @@ void G_MODULE_EXPORT legal_menuitem_toggled_cb (GtkCheckMenuItem* widget, Simple _tmp0_ = widget; _tmp1_ = gtk_check_menu_item_get_active (_tmp0_); if (_tmp1_) { - simple_scan_set_crop (self, "legal"); + user_interface_set_crop (self, "legal"); } } -void G_MODULE_EXPORT letter_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) { +void G_MODULE_EXPORT letter_menuitem_toggled_cb (GtkCheckMenuItem* widget, UserInterface* self) { GtkCheckMenuItem* _tmp0_; gboolean _tmp1_ = FALSE; g_return_if_fail (self != NULL); @@ -2835,12 +2877,12 @@ void G_MODULE_EXPORT letter_menuitem_toggled_cb (GtkCheckMenuItem* widget, Simpl _tmp0_ = widget; _tmp1_ = gtk_check_menu_item_get_active (_tmp0_); if (_tmp1_) { - simple_scan_set_crop (self, "letter"); + user_interface_set_crop (self, "letter"); } } -void G_MODULE_EXPORT a6_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) { +void G_MODULE_EXPORT a6_menuitem_toggled_cb (GtkCheckMenuItem* widget, UserInterface* self) { GtkCheckMenuItem* _tmp0_; gboolean _tmp1_ = FALSE; g_return_if_fail (self != NULL); @@ -2848,12 +2890,12 @@ void G_MODULE_EXPORT a6_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleSca _tmp0_ = widget; _tmp1_ = gtk_check_menu_item_get_active (_tmp0_); if (_tmp1_) { - simple_scan_set_crop (self, "A6"); + user_interface_set_crop (self, "A6"); } } -void G_MODULE_EXPORT a5_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) { +void G_MODULE_EXPORT a5_menuitem_toggled_cb (GtkCheckMenuItem* widget, UserInterface* self) { GtkCheckMenuItem* _tmp0_; gboolean _tmp1_ = FALSE; g_return_if_fail (self != NULL); @@ -2861,12 +2903,12 @@ void G_MODULE_EXPORT a5_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleSca _tmp0_ = widget; _tmp1_ = gtk_check_menu_item_get_active (_tmp0_); if (_tmp1_) { - simple_scan_set_crop (self, "A5"); + user_interface_set_crop (self, "A5"); } } -void G_MODULE_EXPORT a4_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) { +void G_MODULE_EXPORT a4_menuitem_toggled_cb (GtkCheckMenuItem* widget, UserInterface* self) { GtkCheckMenuItem* _tmp0_; gboolean _tmp1_ = FALSE; g_return_if_fail (self != NULL); @@ -2874,12 +2916,12 @@ void G_MODULE_EXPORT a4_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleSca _tmp0_ = widget; _tmp1_ = gtk_check_menu_item_get_active (_tmp0_); if (_tmp1_) { - simple_scan_set_crop (self, "A4"); + user_interface_set_crop (self, "A4"); } } -void G_MODULE_EXPORT crop_rotate_menuitem_activate_cb (GtkWidget* widget, SimpleScan* self) { +void G_MODULE_EXPORT crop_rotate_menuitem_activate_cb (GtkWidget* widget, UserInterface* self) { BookView* _tmp0_; Page* _tmp1_ = NULL; Page* page; @@ -2901,7 +2943,7 @@ void G_MODULE_EXPORT crop_rotate_menuitem_activate_cb (GtkWidget* widget, Simple } -void G_MODULE_EXPORT page_move_left_menuitem_activate_cb (GtkWidget* widget, SimpleScan* self) { +void G_MODULE_EXPORT page_move_left_menuitem_activate_cb (GtkWidget* widget, UserInterface* self) { BookView* _tmp0_; Page* _tmp1_ = NULL; Page* page; @@ -2929,12 +2971,12 @@ void G_MODULE_EXPORT page_move_left_menuitem_activate_cb (GtkWidget* widget, Sim _tmp8_ = index; book_move_page (_tmp6_, _tmp7_, _tmp8_ - 1); } - simple_scan_update_page_menu (self); + user_interface_update_page_menu (self); _page_unref0 (page); } -void G_MODULE_EXPORT page_move_right_menuitem_activate_cb (GtkWidget* widget, SimpleScan* self) { +void G_MODULE_EXPORT page_move_right_menuitem_activate_cb (GtkWidget* widget, UserInterface* self) { BookView* _tmp0_; Page* _tmp1_ = NULL; Page* page; @@ -2970,12 +3012,12 @@ void G_MODULE_EXPORT page_move_right_menuitem_activate_cb (GtkWidget* widget, Si _tmp12_ = book_get_page_index (_tmp10_, _tmp11_); book_move_page (_tmp8_, _tmp9_, _tmp12_ + 1); } - simple_scan_update_page_menu (self); + user_interface_update_page_menu (self); _page_unref0 (page); } -void G_MODULE_EXPORT page_delete_menuitem_activate_cb (GtkWidget* widget, SimpleScan* self) { +void G_MODULE_EXPORT page_delete_menuitem_activate_cb (GtkWidget* widget, UserInterface* self) { BookView* _tmp0_; Book* _tmp1_ = NULL; Book* _tmp2_; @@ -2996,17 +3038,17 @@ void G_MODULE_EXPORT page_delete_menuitem_activate_cb (GtkWidget* widget, Simple } -void G_MODULE_EXPORT save_file_button_clicked_cb (GtkWidget* widget, SimpleScan* self) { +void G_MODULE_EXPORT save_file_button_clicked_cb (GtkWidget* widget, UserInterface* self) { g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - simple_scan_save_document (self, FALSE); + user_interface_save_document (self, FALSE); } -void G_MODULE_EXPORT save_as_file_button_clicked_cb (GtkWidget* widget, SimpleScan* self) { +void G_MODULE_EXPORT save_as_file_button_clicked_cb (GtkWidget* widget, UserInterface* self) { g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - simple_scan_save_document (self, TRUE); + user_interface_save_document (self, TRUE); } @@ -3015,7 +3057,7 @@ static gpointer _cairo_reference0 (gpointer self) { } -static void simple_scan_draw_page (SimpleScan* self, GtkPrintOperation* operation, GtkPrintContext* print_context, gint page_number) { +static void user_interface_draw_page (UserInterface* self, GtkPrintOperation* operation, GtkPrintContext* print_context, gint page_number) { GtkPrintContext* _tmp0_; cairo_t* _tmp1_ = NULL; cairo_t* _tmp2_; @@ -3103,7 +3145,7 @@ static void simple_scan_draw_page (SimpleScan* self, GtkPrintOperation* operatio } -void G_MODULE_EXPORT email_button_clicked_cb (GtkWidget* widget, SimpleScan* self) { +void G_MODULE_EXPORT email_button_clicked_cb (GtkWidget* widget, UserInterface* self) { const gchar* _tmp0_; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); @@ -3112,12 +3154,12 @@ void G_MODULE_EXPORT email_button_clicked_cb (GtkWidget* widget, SimpleScan* sel } -static void _simple_scan_draw_page_gtk_print_operation_draw_page (GtkPrintOperation* _sender, GtkPrintContext* context, gint page_nr, gpointer self) { - simple_scan_draw_page (self, _sender, context, page_nr); +static void _user_interface_draw_page_gtk_print_operation_draw_page (GtkPrintOperation* _sender, GtkPrintContext* context, gint page_nr, gpointer self) { + user_interface_draw_page (self, _sender, context, page_nr); } -void G_MODULE_EXPORT print_button_clicked_cb (GtkWidget* widget, SimpleScan* self) { +void G_MODULE_EXPORT print_button_clicked_cb (GtkWidget* widget, UserInterface* self) { GtkPrintOperation* _tmp0_; GtkPrintOperation* print; Book* _tmp1_; @@ -3130,17 +3172,17 @@ void G_MODULE_EXPORT print_button_clicked_cb (GtkWidget* widget, SimpleScan* sel _tmp1_ = self->priv->book; _tmp2_ = book_get_n_pages (_tmp1_); gtk_print_operation_set_n_pages (print, (gint) _tmp2_); - g_signal_connect (print, "draw-page", (GCallback) _simple_scan_draw_page_gtk_print_operation_draw_page, self); + g_signal_connect (print, "draw-page", (GCallback) _user_interface_draw_page_gtk_print_operation_draw_page, self); { GtkWindow* _tmp3_; _tmp3_ = self->priv->window; gtk_print_operation_run (print, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, _tmp3_, &_inner_error_); if (_inner_error_ != NULL) { - goto __catch19_g_error; + goto __catch18_g_error; } } - goto __finally19; - __catch19_g_error: + goto __finally18; + __catch18_g_error: { GError* e = NULL; GError* _tmp4_; @@ -3149,10 +3191,10 @@ void G_MODULE_EXPORT print_button_clicked_cb (GtkWidget* widget, SimpleScan* sel _inner_error_ = NULL; _tmp4_ = e; _tmp5_ = _tmp4_->message; - g_warning ("ui.vala:1045: Error printing: %s", _tmp5_); + g_warning ("ui.vala:1026: Error printing: %s", _tmp5_); _g_error_free0 (e); } - __finally19: + __finally18: if (_inner_error_ != NULL) { _g_object_unref0 (print); 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); @@ -3163,7 +3205,7 @@ void G_MODULE_EXPORT print_button_clicked_cb (GtkWidget* widget, SimpleScan* sel } -void G_MODULE_EXPORT help_contents_menuitem_activate_cb (GtkWidget* widget, SimpleScan* self) { +void G_MODULE_EXPORT help_contents_menuitem_activate_cb (GtkWidget* widget, UserInterface* self) { GError * _inner_error_ = NULL; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); @@ -3176,11 +3218,11 @@ void G_MODULE_EXPORT help_contents_menuitem_activate_cb (GtkWidget* widget, Simp _tmp2_ = gtk_get_current_event_time (); gtk_show_uri (_tmp1_, "help:simple-scan", _tmp2_, &_inner_error_); if (_inner_error_ != NULL) { - goto __catch20_g_error; + goto __catch19_g_error; } } - goto __finally20; - __catch20_g_error: + goto __finally19; + __catch19_g_error: { GError* e = NULL; const gchar* _tmp3_ = NULL; @@ -3191,10 +3233,10 @@ void G_MODULE_EXPORT help_contents_menuitem_activate_cb (GtkWidget* widget, Simp _tmp3_ = _ ("Unable to open help file"); _tmp4_ = e; _tmp5_ = _tmp4_->message; - simple_scan_show_error_dialog (self, _tmp3_, _tmp5_); + user_interface_show_error_dialog (self, _tmp3_, _tmp5_); _g_error_free0 (e); } - __finally20: + __finally19: if (_inner_error_ != NULL) { 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_); @@ -3203,7 +3245,7 @@ void G_MODULE_EXPORT help_contents_menuitem_activate_cb (GtkWidget* widget, Simp } -void G_MODULE_EXPORT about_menuitem_activate_cb (GtkWidget* widget, SimpleScan* self) { +void G_MODULE_EXPORT about_menuitem_activate_cb (GtkWidget* widget, UserInterface* self) { gchar* _tmp0_; gchar** _tmp1_ = NULL; gchar** authors; @@ -3258,7 +3300,7 @@ void G_MODULE_EXPORT about_menuitem_activate_cb (GtkWidget* widget, SimpleScan* } -static gboolean simple_scan_on_quit (SimpleScan* self) { +static gboolean user_interface_on_quit (UserInterface* self) { gboolean result = FALSE; const gchar* _tmp0_ = NULL; const gchar* _tmp1_ = NULL; @@ -3296,19 +3338,20 @@ static gboolean simple_scan_on_quit (SimpleScan* self) { gint _tmp32_; GSettings* _tmp33_; gint _tmp34_; + GtkWindow* _tmp35_; g_return_val_if_fail (self != NULL, FALSE); _tmp0_ = _ ("Save document before quitting?"); _tmp1_ = _ ("Quit without Saving"); - _tmp2_ = simple_scan_prompt_to_save (self, _tmp0_, _tmp1_); + _tmp2_ = user_interface_prompt_to_save (self, _tmp0_, _tmp1_); if (!_tmp2_) { result = FALSE; return result; } - _tmp3_ = simple_scan_get_selected_device (self); + _tmp3_ = user_interface_get_selected_device (self); device = _tmp3_; paper_width = 0; paper_height = 0; - simple_scan_get_paper_size (self, &_tmp4_, &_tmp5_); + user_interface_get_paper_size (self, &_tmp4_, &_tmp5_); paper_width = _tmp4_; paper_height = _tmp5_; _tmp6_ = device; @@ -3323,13 +3366,13 @@ static gboolean simple_scan_on_quit (SimpleScan* self) { _tmp10_ = self->priv->document_hint; g_settings_set_string (_tmp9_, "document-type", _tmp10_); _tmp11_ = self->priv->settings; - _tmp12_ = simple_scan_get_text_dpi (self); + _tmp12_ = user_interface_get_text_dpi (self); g_settings_set_int (_tmp11_, "text-dpi", _tmp12_); _tmp13_ = self->priv->settings; - _tmp14_ = simple_scan_get_photo_dpi (self); + _tmp14_ = user_interface_get_photo_dpi (self); g_settings_set_int (_tmp13_, "photo-dpi", _tmp14_); _tmp15_ = self->priv->settings; - _tmp16_ = simple_scan_get_page_side (self); + _tmp16_ = user_interface_get_page_side (self); g_settings_set_enum (_tmp15_, "page-side", (gint) _tmp16_); _tmp17_ = self->priv->settings; _tmp18_ = paper_width; @@ -3358,21 +3401,22 @@ static gboolean simple_scan_on_quit (SimpleScan* self) { _tmp33_ = self->priv->settings; _tmp34_ = self->priv->default_page_dpi; g_settings_set_int (_tmp33_, "page-dpi", _tmp34_); - g_signal_emit_by_name (self, "quit"); + _tmp35_ = self->priv->window; + gtk_widget_destroy ((GtkWidget*) _tmp35_); result = TRUE; _g_free0 (device); return result; } -void G_MODULE_EXPORT quit_menuitem_activate_cb (GtkWidget* widget, SimpleScan* self) { +void G_MODULE_EXPORT quit_menuitem_activate_cb (GtkWidget* widget, UserInterface* self) { g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); - simple_scan_on_quit (self); + user_interface_on_quit (self); } -gboolean G_MODULE_EXPORT simple_scan_window_configure_event_cb (GtkWidget* widget, GdkEventConfigure* event, SimpleScan* self) { +gboolean G_MODULE_EXPORT simple_scan_window_configure_event_cb (GtkWidget* widget, GdkEventConfigure* event, UserInterface* self) { gboolean result = FALSE; gboolean _tmp0_; g_return_val_if_fail (self != NULL, FALSE); @@ -3396,7 +3440,7 @@ gboolean G_MODULE_EXPORT simple_scan_window_configure_event_cb (GtkWidget* widge } -static void simple_scan_info_bar_response_cb (SimpleScan* self, GtkInfoBar* widget, gint response_id) { +static void user_interface_info_bar_response_cb (UserInterface* self, GtkInfoBar* widget, gint response_id) { gint _tmp0_; g_return_if_fail (self != NULL); g_return_if_fail (widget != NULL); @@ -3414,12 +3458,12 @@ static void simple_scan_info_bar_response_cb (SimpleScan* self, GtkInfoBar* widg self->priv->error_title = NULL; _g_free0 (self->priv->error_text); self->priv->error_text = NULL; - simple_scan_update_info_bar (self); + user_interface_update_info_bar (self); } } -gboolean G_MODULE_EXPORT simple_scan_window_window_state_event_cb (GtkWidget* widget, GdkEventWindowState* event, SimpleScan* self) { +gboolean G_MODULE_EXPORT simple_scan_window_window_state_event_cb (GtkWidget* widget, GdkEventWindowState* event, UserInterface* self) { gboolean result = FALSE; GdkEventWindowState _tmp0_; GdkWindowState _tmp1_; @@ -3440,19 +3484,19 @@ gboolean G_MODULE_EXPORT simple_scan_window_window_state_event_cb (GtkWidget* wi } -gboolean G_MODULE_EXPORT window_delete_event_cb (GtkWidget* widget, GdkEvent* event, SimpleScan* self) { +gboolean G_MODULE_EXPORT window_delete_event_cb (GtkWidget* widget, GdkEvent* event, UserInterface* self) { gboolean result = FALSE; gboolean _tmp0_ = FALSE; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (event != NULL, FALSE); - _tmp0_ = simple_scan_on_quit (self); + _tmp0_ = user_interface_on_quit (self); result = !_tmp0_; return result; } -static void simple_scan_page_size_changed_cb (SimpleScan* self, Page* page) { +static void user_interface_page_size_changed_cb (UserInterface* self, Page* page) { Page* _tmp0_; gint _tmp1_ = 0; Page* _tmp2_; @@ -3473,7 +3517,7 @@ static void simple_scan_page_size_changed_cb (SimpleScan* self, Page* page) { } -static void simple_scan_page_scan_direction_changed_cb (SimpleScan* self, Page* page) { +static void user_interface_page_scan_direction_changed_cb (UserInterface* self, Page* page) { Page* _tmp0_; ScanDirection _tmp1_ = 0; g_return_if_fail (self != NULL); @@ -3484,17 +3528,17 @@ static void simple_scan_page_scan_direction_changed_cb (SimpleScan* self, Page* } -static void _simple_scan_page_size_changed_cb_page_size_changed (Page* _sender, gpointer self) { - simple_scan_page_size_changed_cb (self, _sender); +static void _user_interface_page_size_changed_cb_page_size_changed (Page* _sender, gpointer self) { + user_interface_page_size_changed_cb (self, _sender); } -static void _simple_scan_page_scan_direction_changed_cb_page_scan_direction_changed (Page* _sender, gpointer self) { - simple_scan_page_scan_direction_changed_cb (self, _sender); +static void _user_interface_page_scan_direction_changed_cb_page_scan_direction_changed (Page* _sender, gpointer self) { + user_interface_page_scan_direction_changed_cb (self, _sender); } -static void simple_scan_page_added_cb (SimpleScan* self, Book* book, Page* page) { +static void user_interface_page_added_cb (UserInterface* self, Book* book, Page* page) { Page* _tmp0_; gint _tmp1_ = 0; Page* _tmp2_; @@ -3521,14 +3565,14 @@ static void simple_scan_page_added_cb (SimpleScan* self, Book* book, Page* page) _tmp7_ = page_get_scan_direction (_tmp6_); self->priv->default_page_scan_direction = _tmp7_; _tmp8_ = page; - g_signal_connect (_tmp8_, "size-changed", (GCallback) _simple_scan_page_size_changed_cb_page_size_changed, self); + g_signal_connect (_tmp8_, "size-changed", (GCallback) _user_interface_page_size_changed_cb_page_size_changed, self); _tmp9_ = page; - g_signal_connect (_tmp9_, "scan-direction-changed", (GCallback) _simple_scan_page_scan_direction_changed_cb_page_scan_direction_changed, self); - simple_scan_update_page_menu (self); + g_signal_connect (_tmp9_, "scan-direction-changed", (GCallback) _user_interface_page_scan_direction_changed_cb_page_scan_direction_changed, self); + user_interface_update_page_menu (self); } -static void simple_scan_page_removed_cb (SimpleScan* self, Book* book, Page* page) { +static void user_interface_page_removed_cb (UserInterface* self, Book* book, Page* page) { Book* _tmp0_; guint _tmp1_ = 0U; g_return_if_fail (self != NULL); @@ -3537,13 +3581,13 @@ static void simple_scan_page_removed_cb (SimpleScan* self, Book* book, Page* pag _tmp0_ = book; _tmp1_ = book_get_n_pages (_tmp0_); if (_tmp1_ == ((guint) 1)) { - simple_scan_add_default_page (self); + user_interface_add_default_page (self); } - simple_scan_update_page_menu (self); + user_interface_update_page_menu (self); } -static void simple_scan_set_dpi_combo (SimpleScan* self, GtkComboBox* combo, gint default_dpi, gint current_dpi) { +static void user_interface_set_dpi_combo (UserInterface* self, GtkComboBox* combo, gint default_dpi, gint current_dpi) { GtkCellRendererText* _tmp0_; GtkCellRendererText* _tmp1_; GtkCellRendererText* renderer; @@ -3685,7 +3729,7 @@ static void simple_scan_set_dpi_combo (SimpleScan* self, GtkComboBox* combo, gin } -static void simple_scan_needs_saving_cb (SimpleScan* self, Book* book) { +static void user_interface_needs_saving_cb (UserInterface* self, Book* book) { GtkMenuItem* _tmp0_; Book* _tmp1_; gboolean _tmp2_ = FALSE; @@ -3714,32 +3758,37 @@ static void simple_scan_needs_saving_cb (SimpleScan* self, Book* book) { } -static void _simple_scan_info_bar_response_cb_gtk_info_bar_response (GtkInfoBar* _sender, gint response_id, gpointer self) { - simple_scan_info_bar_response_cb (self, _sender, response_id); +static void _user_interface_info_bar_response_cb_gtk_info_bar_response (GtkInfoBar* _sender, gint response_id, gpointer self) { + user_interface_info_bar_response_cb (self, _sender, response_id); } -static void _simple_scan_page_selected_cb_book_view_page_selected (BookView* _sender, Page* page, gpointer self) { - simple_scan_page_selected_cb (self, _sender, page); +static void _user_interface_page_selected_cb_book_view_page_selected (BookView* _sender, Page* page, gpointer self) { + user_interface_page_selected_cb (self, _sender, page); } -static void _simple_scan_show_page_cb_book_view_show_page (BookView* _sender, Page* page, gpointer self) { - simple_scan_show_page_cb (self, _sender, page); +static void _user_interface_show_page_cb_book_view_show_page (BookView* _sender, Page* page, gpointer self) { + user_interface_show_page_cb (self, _sender, page); } -static void _simple_scan_show_page_menu_cb_book_view_show_menu (BookView* _sender, gpointer self) { - simple_scan_show_page_menu_cb (self, _sender); +static void _user_interface_show_page_menu_cb_book_view_show_menu (BookView* _sender, gpointer self) { + user_interface_show_page_menu_cb (self, _sender); } -static void _simple_scan_needs_saving_cb_book_needs_saving_changed (Book* _sender, gpointer self) { - simple_scan_needs_saving_cb (self, _sender); +static void _user_interface_needs_saving_cb_book_needs_saving_changed (Book* _sender, gpointer self) { + user_interface_needs_saving_cb (self, _sender); } -static void simple_scan_load (SimpleScan* self) { +static void _user_interface_book_saving_cb_book_saving (Book* _sender, gint i, gpointer self) { + user_interface_book_saving_cb (self, i); +} + + +static void user_interface_load (UserInterface* self) { GtkIconTheme* _tmp0_ = NULL; GtkBuilder* _tmp1_; gchar* _tmp2_ = NULL; @@ -3748,136 +3797,137 @@ static void simple_scan_load (SimpleScan* self) { GtkBuilder* _tmp9_; GObject* _tmp10_ = NULL; GtkWindow* _tmp11_; - GtkBuilder* _tmp12_; - GObject* _tmp13_ = NULL; - GtkVBox* _tmp14_; - GtkBuilder* _tmp15_; - GObject* _tmp16_ = NULL; - GtkMenuItem* _tmp17_; - GtkBuilder* _tmp18_; - GObject* _tmp19_ = NULL; - GtkMenuItem* _tmp20_; - GtkBuilder* _tmp21_; - GObject* _tmp22_ = NULL; - GtkMenuItem* _tmp23_; - GtkBuilder* _tmp24_; - GObject* _tmp25_ = NULL; - GtkMenuItem* _tmp26_; - GtkBuilder* _tmp27_; - GObject* _tmp28_ = NULL; - GtkMenuItem* _tmp29_; - GtkBuilder* _tmp30_; - GObject* _tmp31_ = NULL; - GtkMenuItem* _tmp32_; - GtkBuilder* _tmp33_; - GObject* _tmp34_ = NULL; - GtkToolButton* _tmp35_; - GtkBuilder* _tmp36_; - GObject* _tmp37_ = NULL; - GtkMenuItem* _tmp38_; - GtkBuilder* _tmp39_; - GObject* _tmp40_ = NULL; - GtkToolButton* _tmp41_; - GtkBuilder* _tmp42_; - GObject* _tmp43_ = NULL; - GtkRadioMenuItem* _tmp44_; - GtkBuilder* _tmp45_; - GObject* _tmp46_ = NULL; - GtkRadioMenuItem* _tmp47_; - GtkBuilder* _tmp48_; - GObject* _tmp49_ = NULL; - GtkRadioMenuItem* _tmp50_; - GtkBuilder* _tmp51_; - GObject* _tmp52_ = NULL; - GtkRadioMenuItem* _tmp53_; - GtkBuilder* _tmp54_; - GObject* _tmp55_ = NULL; - GtkDialog* _tmp56_; - GtkBuilder* _tmp57_; - GObject* _tmp58_ = NULL; - GtkLabel* _tmp59_; - GtkBuilder* _tmp60_; - GObject* _tmp61_ = NULL; - GtkEntry* _tmp62_; - GtkBuilder* _tmp63_; - GObject* _tmp64_ = NULL; - GtkEntry* _tmp65_; - GtkBuilder* _tmp66_; - GObject* _tmp67_ = NULL; - GtkDialog* _tmp68_; - GtkBuilder* _tmp69_; - GObject* _tmp70_ = NULL; - GtkComboBox* _tmp71_; - GtkComboBox* _tmp72_; - GtkTreeModel* _tmp73_ = NULL; - GtkListStore* _tmp74_; - GtkBuilder* _tmp75_; - GObject* _tmp76_ = NULL; - GtkComboBox* _tmp77_; - GtkComboBox* _tmp78_; - GtkTreeModel* _tmp79_ = NULL; - GtkListStore* _tmp80_; - GtkBuilder* _tmp81_; - GObject* _tmp82_ = NULL; - GtkComboBox* _tmp83_; - GtkComboBox* _tmp84_; - GtkTreeModel* _tmp85_ = NULL; - GtkListStore* _tmp86_; - GtkBuilder* _tmp87_; - GObject* _tmp88_ = NULL; - GtkComboBox* _tmp89_; - GtkComboBox* _tmp90_; - GtkTreeModel* _tmp91_ = NULL; - GtkListStore* _tmp92_; - GtkBuilder* _tmp93_; - GObject* _tmp94_ = NULL; - GtkComboBox* _tmp95_; - GtkComboBox* _tmp96_; - GtkTreeModel* _tmp97_ = NULL; - GtkListStore* _tmp98_; - GtkInfoBar* _tmp99_; - GtkInfoBar* _tmp100_; - GtkInfoBar* _tmp101_; - GtkVBox* _tmp102_; + GApplication* _tmp12_ = NULL; + GtkApplication* _tmp13_; + GtkApplication* app; + GtkApplication* _tmp14_; + GtkWindow* _tmp15_; + GtkBuilder* _tmp16_; + GObject* _tmp17_ = NULL; + GtkVBox* _tmp18_; + GtkBuilder* _tmp19_; + GObject* _tmp20_ = NULL; + GtkMenuItem* _tmp21_; + GtkBuilder* _tmp22_; + GObject* _tmp23_ = NULL; + GtkMenuItem* _tmp24_; + GtkBuilder* _tmp25_; + GObject* _tmp26_ = NULL; + GtkMenuItem* _tmp27_; + GtkBuilder* _tmp28_; + GObject* _tmp29_ = NULL; + GtkMenuItem* _tmp30_; + GtkBuilder* _tmp31_; + GObject* _tmp32_ = NULL; + GtkMenuItem* _tmp33_; + GtkBuilder* _tmp34_; + GObject* _tmp35_ = NULL; + GtkMenuItem* _tmp36_; + GtkBuilder* _tmp37_; + GObject* _tmp38_ = NULL; + GtkToolButton* _tmp39_; + GtkBuilder* _tmp40_; + GObject* _tmp41_ = NULL; + GtkMenuItem* _tmp42_; + GtkBuilder* _tmp43_; + GObject* _tmp44_ = NULL; + GtkToolButton* _tmp45_; + GtkBuilder* _tmp46_; + GObject* _tmp47_ = NULL; + GtkRadioMenuItem* _tmp48_; + GtkBuilder* _tmp49_; + GObject* _tmp50_ = NULL; + GtkRadioMenuItem* _tmp51_; + GtkBuilder* _tmp52_; + GObject* _tmp53_ = NULL; + GtkRadioMenuItem* _tmp54_; + GtkBuilder* _tmp55_; + GObject* _tmp56_ = NULL; + GtkRadioMenuItem* _tmp57_; + GtkBuilder* _tmp58_; + GObject* _tmp59_ = NULL; + GtkDialog* _tmp60_; + GtkBuilder* _tmp61_; + GObject* _tmp62_ = NULL; + GtkLabel* _tmp63_; + GtkBuilder* _tmp64_; + GObject* _tmp65_ = NULL; + GtkEntry* _tmp66_; + GtkBuilder* _tmp67_; + GObject* _tmp68_ = NULL; + GtkEntry* _tmp69_; + GtkBuilder* _tmp70_; + GObject* _tmp71_ = NULL; + GtkDialog* _tmp72_; + GtkBuilder* _tmp73_; + GObject* _tmp74_ = NULL; + GtkComboBox* _tmp75_; + GtkComboBox* _tmp76_; + GtkTreeModel* _tmp77_ = NULL; + GtkListStore* _tmp78_; + GtkBuilder* _tmp79_; + GObject* _tmp80_ = NULL; + GtkComboBox* _tmp81_; + GtkComboBox* _tmp82_; + GtkTreeModel* _tmp83_ = NULL; + GtkListStore* _tmp84_; + GtkBuilder* _tmp85_; + GObject* _tmp86_ = NULL; + GtkComboBox* _tmp87_; + GtkComboBox* _tmp88_; + GtkTreeModel* _tmp89_ = NULL; + GtkListStore* _tmp90_; + GtkBuilder* _tmp91_; + GObject* _tmp92_ = NULL; + GtkComboBox* _tmp93_; + GtkComboBox* _tmp94_; + GtkTreeModel* _tmp95_ = NULL; + GtkListStore* _tmp96_; + GtkBuilder* _tmp97_; + GObject* _tmp98_ = NULL; + GtkComboBox* _tmp99_; + GtkComboBox* _tmp100_; + GtkTreeModel* _tmp101_ = NULL; + GtkListStore* _tmp102_; GtkInfoBar* _tmp103_; - GtkBox* _tmp104_; - GtkBox* _tmp105_; + GtkInfoBar* _tmp104_; + GtkInfoBar* _tmp105_; + GtkVBox* _tmp106_; + GtkInfoBar* _tmp107_; + GtkBox* _tmp108_; + GtkBox* _tmp109_; GtkBox* hbox; - GtkInfoBar* _tmp106_; - GtkWidget* _tmp107_ = NULL; - GtkContainer* _tmp108_; + GtkInfoBar* _tmp110_; + GtkWidget* _tmp111_ = NULL; + GtkContainer* _tmp112_; GtkContainer* content_area; - GtkContainer* _tmp109_; - GtkBox* _tmp110_; - GtkBox* _tmp111_; - GtkImage* _tmp112_; - GtkImage* _tmp113_; + GtkContainer* _tmp113_; GtkBox* _tmp114_; - GtkImage* _tmp115_; + GtkBox* _tmp115_; GtkImage* _tmp116_; - GtkLabel* _tmp117_; - GtkLabel* _tmp118_; - GtkLabel* _tmp119_; - GtkBox* _tmp120_; + GtkImage* _tmp117_; + GtkBox* _tmp118_; + GtkImage* _tmp119_; + GtkImage* _tmp120_; GtkLabel* _tmp121_; GtkLabel* _tmp122_; - GtkInfoBar* _tmp123_; - GtkWidget* _tmp124_ = NULL; - GtkButton* _tmp125_; - GtkInfoBar* _tmp126_; - const gchar* _tmp127_ = NULL; + GtkLabel* _tmp123_; + GtkBox* _tmp124_; + GtkLabel* _tmp125_; + GtkLabel* _tmp126_; + GtkInfoBar* _tmp127_; GtkWidget* _tmp128_ = NULL; GtkButton* _tmp129_; + GtkInfoBar* _tmp130_; + const gchar* _tmp131_ = NULL; + GtkWidget* _tmp132_ = NULL; + GtkButton* _tmp133_; GtkTreeIter iter = {0}; - GtkListStore* _tmp130_; - GtkTreeIter _tmp131_ = {0}; - GtkListStore* _tmp132_; - GtkTreeIter _tmp133_; - const gchar* _tmp134_ = NULL; - GtkListStore* _tmp135_; - GtkTreeIter _tmp136_ = {0}; - GtkListStore* _tmp137_; - GtkTreeIter _tmp138_; + GtkListStore* _tmp134_; + GtkTreeIter _tmp135_ = {0}; + GtkListStore* _tmp136_; + GtkTreeIter _tmp137_; + const gchar* _tmp138_ = NULL; GtkListStore* _tmp139_; GtkTreeIter _tmp140_ = {0}; GtkListStore* _tmp141_; @@ -3898,93 +3948,104 @@ static void simple_scan_load (SimpleScan* self) { GtkTreeIter _tmp156_ = {0}; GtkListStore* _tmp157_; GtkTreeIter _tmp158_; - GSettings* _tmp159_; - gint _tmp160_ = 0; + GtkListStore* _tmp159_; + GtkTreeIter _tmp160_ = {0}; + GtkListStore* _tmp161_; + GtkTreeIter _tmp162_; + GSettings* _tmp163_; + gint _tmp164_ = 0; gint dpi; - gint _tmp161_; - GtkComboBox* _tmp162_; - gint _tmp163_; - GSettings* _tmp164_; - gint _tmp165_ = 0; - gint _tmp166_; - GtkComboBox* _tmp167_; - gint _tmp168_; - GtkCellRendererText* _tmp169_; - GtkCellRendererText* _tmp170_; - GtkCellRendererText* renderer; + gint _tmp165_; + GtkComboBox* _tmp166_; + gint _tmp167_; + GSettings* _tmp168_; + gint _tmp169_ = 0; + gint _tmp170_; GtkComboBox* _tmp171_; - GtkCellRendererText* _tmp172_; - GtkComboBox* _tmp173_; + gint _tmp172_; + GtkCellRendererText* _tmp173_; GtkCellRendererText* _tmp174_; - GtkCellRendererText* _tmp175_; + GtkCellRendererText* renderer; + GtkComboBox* _tmp175_; GtkCellRendererText* _tmp176_; GtkComboBox* _tmp177_; GtkCellRendererText* _tmp178_; - GtkComboBox* _tmp179_; + GtkCellRendererText* _tmp179_; GtkCellRendererText* _tmp180_; - GSettings* _tmp181_; - gint _tmp182_ = 0; - GtkCellRendererText* _tmp183_; + GtkComboBox* _tmp181_; + GtkCellRendererText* _tmp182_; + GtkComboBox* _tmp183_; GtkCellRendererText* _tmp184_; - GtkComboBox* _tmp185_; - GtkCellRendererText* _tmp186_; - GtkComboBox* _tmp187_; + GSettings* _tmp185_; + gint _tmp186_ = 0; + GtkCellRendererText* _tmp187_; GtkCellRendererText* _tmp188_; - GSettings* _tmp189_; - gint _tmp190_ = 0; + GtkComboBox* _tmp189_; + GtkCellRendererText* _tmp190_; + GtkComboBox* _tmp191_; + GtkCellRendererText* _tmp192_; + GSettings* _tmp193_; + gint _tmp194_ = 0; gint paper_width; - GSettings* _tmp191_; - gint _tmp192_ = 0; - gint paper_height; - gint _tmp193_; - gint _tmp194_; GSettings* _tmp195_; - gchar* _tmp196_ = NULL; + gint _tmp196_ = 0; + gint paper_height; + gint _tmp197_; + gint _tmp198_; + GSettings* _tmp199_; + gchar* _tmp200_ = NULL; gchar* device; - const gchar* _tmp197_; - GSettings* _tmp203_; - gchar* _tmp204_ = NULL; + const gchar* _tmp201_; + GSettings* _tmp207_; + gchar* _tmp208_ = NULL; gchar* document_type; - const gchar* _tmp205_; - Book* _tmp207_; - BookView* _tmp208_; - BookView* _tmp209_; - BookView* _tmp210_; - GtkVBox* _tmp211_; + const gchar* _tmp209_; + Book* _tmp211_; BookView* _tmp212_; BookView* _tmp213_; BookView* _tmp214_; - BookView* _tmp215_; + GtkVBox* _tmp215_; BookView* _tmp216_; - GSettings* _tmp217_; - gint _tmp218_ = 0; - GSettings* _tmp219_; - gint _tmp220_ = 0; - gint _tmp221_; - GSettings* _tmp222_; - gint _tmp223_ = 0; - gint _tmp224_; - GSettings* _tmp225_; - gint _tmp226_ = 0; - gint _tmp227_; - GSettings* _tmp228_; - gint _tmp229_ = 0; - gint _tmp230_; - GSettings* _tmp231_; - gint _tmp232_ = 0; - gint _tmp233_; + BookView* _tmp217_; + BookView* _tmp218_; + BookView* _tmp219_; + BookView* _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 _tmp231_; + GSettings* _tmp232_; + gint _tmp233_ = 0; gint _tmp234_; - gint _tmp235_; - GtkWindow* _tmp236_; + GSettings* _tmp235_; + gint _tmp236_ = 0; gint _tmp237_; gint _tmp238_; - GSettings* _tmp239_; - gboolean _tmp240_ = FALSE; - gboolean _tmp241_; - Book* _tmp243_; - guint _tmp244_ = 0U; - Book* _tmp245_; - Book* _tmp246_; + 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_; GError * _inner_error_ = NULL; g_return_if_fail (self != NULL); _tmp0_ = gtk_icon_theme_get_default (); @@ -4000,11 +4061,11 @@ static void simple_scan_load (SimpleScan* self) { _tmp3_ = self->priv->builder; gtk_builder_add_from_file (_tmp3_, filename, &_inner_error_); if (_inner_error_ != NULL) { - goto __catch21_g_error; + goto __catch20_g_error; } } - goto __finally21; - __catch21_g_error: + goto __finally20; + __catch20_g_error: { GError* e = NULL; GError* _tmp4_; @@ -4015,14 +4076,14 @@ static void simple_scan_load (SimpleScan* self) { _inner_error_ = NULL; _tmp4_ = e; _tmp5_ = _tmp4_->message; - g_critical ("ui.vala:1262: Unable to load UI %s: %s\n", filename, _tmp5_); + g_critical ("ui.vala:1243: Unable to load UI %s: %s\n", filename, _tmp5_); _tmp6_ = _ ("Files missing"); _tmp7_ = _ ("Please check your installation"); - simple_scan_show_error_dialog (self, _tmp6_, _tmp7_); + user_interface_show_error_dialog (self, _tmp6_, _tmp7_); exit (EXIT_FAILURE); _g_error_free0 (e); } - __finally21: + __finally20: if (_inner_error_ != NULL) { _g_free0 (filename); 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); @@ -4036,432 +4097,537 @@ static void simple_scan_load (SimpleScan* self) { _tmp11_ = _g_object_ref0 (GTK_WINDOW (_tmp10_)); _g_object_unref0 (self->priv->window); self->priv->window = _tmp11_; - _tmp12_ = self->priv->builder; - _tmp13_ = gtk_builder_get_object (_tmp12_, "main_vbox"); - _tmp14_ = _g_object_ref0 (GTK_VBOX (_tmp13_)); + _tmp12_ = g_application_get_default (); + _tmp13_ = _g_object_ref0 (GTK_IS_APPLICATION (_tmp12_) ? ((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_)); _g_object_unref0 (self->priv->main_vbox); - self->priv->main_vbox = _tmp14_; - _tmp15_ = self->priv->builder; - _tmp16_ = gtk_builder_get_object (_tmp15_, "page_move_left_menuitem"); - _tmp17_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp16_)); + 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_)); _g_object_unref0 (self->priv->page_move_left_menuitem); - self->priv->page_move_left_menuitem = _tmp17_; - _tmp18_ = self->priv->builder; - _tmp19_ = gtk_builder_get_object (_tmp18_, "page_move_right_menuitem"); - _tmp20_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp19_)); + 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_)); _g_object_unref0 (self->priv->page_move_right_menuitem); - self->priv->page_move_right_menuitem = _tmp20_; - _tmp21_ = self->priv->builder; - _tmp22_ = gtk_builder_get_object (_tmp21_, "page_delete_menuitem"); - _tmp23_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp22_)); + 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_)); _g_object_unref0 (self->priv->page_delete_menuitem); - self->priv->page_delete_menuitem = _tmp23_; - _tmp24_ = self->priv->builder; - _tmp25_ = gtk_builder_get_object (_tmp24_, "crop_rotate_menuitem"); - _tmp26_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp25_)); + 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_)); _g_object_unref0 (self->priv->crop_rotate_menuitem); - self->priv->crop_rotate_menuitem = _tmp26_; - _tmp27_ = self->priv->builder; - _tmp28_ = gtk_builder_get_object (_tmp27_, "save_menuitem"); - _tmp29_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp28_)); + 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_)); _g_object_unref0 (self->priv->save_menuitem); - self->priv->save_menuitem = _tmp29_; - _tmp30_ = self->priv->builder; - _tmp31_ = gtk_builder_get_object (_tmp30_, "save_as_menuitem"); - _tmp32_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp31_)); + 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_)); _g_object_unref0 (self->priv->save_as_menuitem); - self->priv->save_as_menuitem = _tmp32_; - _tmp33_ = self->priv->builder; - _tmp34_ = gtk_builder_get_object (_tmp33_, "save_toolbutton"); - _tmp35_ = _g_object_ref0 (GTK_TOOL_BUTTON (_tmp34_)); + 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_)); _g_object_unref0 (self->priv->save_toolbutton); - self->priv->save_toolbutton = _tmp35_; - _tmp36_ = self->priv->builder; - _tmp37_ = gtk_builder_get_object (_tmp36_, "stop_scan_menuitem"); - _tmp38_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp37_)); + 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_)); _g_object_unref0 (self->priv->stop_menuitem); - self->priv->stop_menuitem = _tmp38_; - _tmp39_ = self->priv->builder; - _tmp40_ = gtk_builder_get_object (_tmp39_, "stop_toolbutton"); - _tmp41_ = _g_object_ref0 (GTK_TOOL_BUTTON (_tmp40_)); + 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_)); _g_object_unref0 (self->priv->stop_toolbutton); - self->priv->stop_toolbutton = _tmp41_; - _tmp42_ = self->priv->builder; - _tmp43_ = gtk_builder_get_object (_tmp42_, "text_toolbutton_menuitem"); - _tmp44_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp43_)); + 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_)); _g_object_unref0 (self->priv->text_toolbar_menuitem); - self->priv->text_toolbar_menuitem = _tmp44_; - _tmp45_ = self->priv->builder; - _tmp46_ = gtk_builder_get_object (_tmp45_, "text_menuitem"); - _tmp47_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp46_)); + 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_)); _g_object_unref0 (self->priv->text_menu_menuitem); - self->priv->text_menu_menuitem = _tmp47_; - _tmp48_ = self->priv->builder; - _tmp49_ = gtk_builder_get_object (_tmp48_, "photo_toolbutton_menuitem"); - _tmp50_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp49_)); + 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_)); _g_object_unref0 (self->priv->photo_toolbar_menuitem); - self->priv->photo_toolbar_menuitem = _tmp50_; - _tmp51_ = self->priv->builder; - _tmp52_ = gtk_builder_get_object (_tmp51_, "photo_menuitem"); - _tmp53_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp52_)); + 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_)); _g_object_unref0 (self->priv->photo_menu_menuitem); - self->priv->photo_menu_menuitem = _tmp53_; - _tmp54_ = self->priv->builder; - _tmp55_ = gtk_builder_get_object (_tmp54_, "authorize_dialog"); - _tmp56_ = _g_object_ref0 (GTK_DIALOG (_tmp55_)); + 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_)); _g_object_unref0 (self->priv->authorize_dialog); - self->priv->authorize_dialog = _tmp56_; - _tmp57_ = self->priv->builder; - _tmp58_ = gtk_builder_get_object (_tmp57_, "authorize_label"); - _tmp59_ = _g_object_ref0 (GTK_LABEL (_tmp58_)); + self->priv->authorize_dialog = _tmp60_; + _tmp61_ = self->priv->builder; + _tmp62_ = gtk_builder_get_object (_tmp61_, "authorize_label"); + _tmp63_ = _g_object_ref0 (GTK_LABEL (_tmp62_)); _g_object_unref0 (self->priv->authorize_label); - self->priv->authorize_label = _tmp59_; - _tmp60_ = self->priv->builder; - _tmp61_ = gtk_builder_get_object (_tmp60_, "username_entry"); - _tmp62_ = _g_object_ref0 (GTK_ENTRY (_tmp61_)); + self->priv->authorize_label = _tmp63_; + _tmp64_ = self->priv->builder; + _tmp65_ = gtk_builder_get_object (_tmp64_, "username_entry"); + _tmp66_ = _g_object_ref0 (GTK_ENTRY (_tmp65_)); _g_object_unref0 (self->priv->username_entry); - self->priv->username_entry = _tmp62_; - _tmp63_ = self->priv->builder; - _tmp64_ = gtk_builder_get_object (_tmp63_, "password_entry"); - _tmp65_ = _g_object_ref0 (GTK_ENTRY (_tmp64_)); + self->priv->username_entry = _tmp66_; + _tmp67_ = self->priv->builder; + _tmp68_ = gtk_builder_get_object (_tmp67_, "password_entry"); + _tmp69_ = _g_object_ref0 (GTK_ENTRY (_tmp68_)); _g_object_unref0 (self->priv->password_entry); - self->priv->password_entry = _tmp65_; - _tmp66_ = self->priv->builder; - _tmp67_ = gtk_builder_get_object (_tmp66_, "preferences_dialog"); - _tmp68_ = _g_object_ref0 (GTK_DIALOG (_tmp67_)); + self->priv->password_entry = _tmp69_; + _tmp70_ = self->priv->builder; + _tmp71_ = gtk_builder_get_object (_tmp70_, "preferences_dialog"); + _tmp72_ = _g_object_ref0 (GTK_DIALOG (_tmp71_)); _g_object_unref0 (self->priv->preferences_dialog); - self->priv->preferences_dialog = _tmp68_; - _tmp69_ = self->priv->builder; - _tmp70_ = gtk_builder_get_object (_tmp69_, "device_combo"); - _tmp71_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp70_)); + 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_)); _g_object_unref0 (self->priv->device_combo); - self->priv->device_combo = _tmp71_; - _tmp72_ = self->priv->device_combo; - _tmp73_ = gtk_combo_box_get_model (_tmp72_); - _tmp74_ = _g_object_ref0 (GTK_LIST_STORE (_tmp73_)); + 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_)); _g_object_unref0 (self->priv->device_model); - self->priv->device_model = _tmp74_; - _tmp75_ = self->priv->builder; - _tmp76_ = gtk_builder_get_object (_tmp75_, "text_dpi_combo"); - _tmp77_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp76_)); + 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_)); _g_object_unref0 (self->priv->text_dpi_combo); - self->priv->text_dpi_combo = _tmp77_; - _tmp78_ = self->priv->text_dpi_combo; - _tmp79_ = gtk_combo_box_get_model (_tmp78_); - _tmp80_ = _g_object_ref0 (GTK_LIST_STORE (_tmp79_)); + 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_)); _g_object_unref0 (self->priv->text_dpi_model); - self->priv->text_dpi_model = _tmp80_; - _tmp81_ = self->priv->builder; - _tmp82_ = gtk_builder_get_object (_tmp81_, "photo_dpi_combo"); - _tmp83_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp82_)); + 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_)); _g_object_unref0 (self->priv->photo_dpi_combo); - self->priv->photo_dpi_combo = _tmp83_; - _tmp84_ = self->priv->photo_dpi_combo; - _tmp85_ = gtk_combo_box_get_model (_tmp84_); - _tmp86_ = _g_object_ref0 (GTK_LIST_STORE (_tmp85_)); + 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_)); _g_object_unref0 (self->priv->photo_dpi_model); - self->priv->photo_dpi_model = _tmp86_; - _tmp87_ = self->priv->builder; - _tmp88_ = gtk_builder_get_object (_tmp87_, "page_side_combo"); - _tmp89_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp88_)); + 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_)); _g_object_unref0 (self->priv->page_side_combo); - self->priv->page_side_combo = _tmp89_; - _tmp90_ = self->priv->page_side_combo; - _tmp91_ = gtk_combo_box_get_model (_tmp90_); - _tmp92_ = _g_object_ref0 (GTK_LIST_STORE (_tmp91_)); + 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_)); _g_object_unref0 (self->priv->page_side_model); - self->priv->page_side_model = _tmp92_; - _tmp93_ = self->priv->builder; - _tmp94_ = gtk_builder_get_object (_tmp93_, "paper_size_combo"); - _tmp95_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp94_)); + 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_)); _g_object_unref0 (self->priv->paper_size_combo); - self->priv->paper_size_combo = _tmp95_; - _tmp96_ = self->priv->paper_size_combo; - _tmp97_ = gtk_combo_box_get_model (_tmp96_); - _tmp98_ = _g_object_ref0 (GTK_LIST_STORE (_tmp97_)); + 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_)); _g_object_unref0 (self->priv->paper_size_model); - self->priv->paper_size_model = _tmp98_; - _tmp99_ = (GtkInfoBar*) gtk_info_bar_new (); - _tmp100_ = g_object_ref_sink (_tmp99_); + self->priv->paper_size_model = _tmp102_; + _tmp103_ = (GtkInfoBar*) gtk_info_bar_new (); + _tmp104_ = g_object_ref_sink (_tmp103_); _g_object_unref0 (self->priv->info_bar); - self->priv->info_bar = _tmp100_; - _tmp101_ = self->priv->info_bar; - g_signal_connect (_tmp101_, "response", (GCallback) _simple_scan_info_bar_response_cb_gtk_info_bar_response, self); - _tmp102_ = self->priv->main_vbox; - _tmp103_ = self->priv->info_bar; - gtk_box_pack_start ((GtkBox*) _tmp102_, (GtkWidget*) _tmp103_, FALSE, TRUE, (guint) 0); - _tmp104_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12); - _tmp105_ = g_object_ref_sink (_tmp104_); - hbox = _tmp105_; - _tmp106_ = self->priv->info_bar; - _tmp107_ = gtk_info_bar_get_content_area (_tmp106_); - _tmp108_ = _g_object_ref0 (GTK_CONTAINER (_tmp107_)); - content_area = _tmp108_; - _tmp109_ = content_area; - _tmp110_ = hbox; - gtk_container_add (_tmp109_, (GtkWidget*) _tmp110_); - _tmp111_ = hbox; - gtk_widget_show ((GtkWidget*) _tmp111_); - _tmp112_ = (GtkImage*) gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG); - _tmp113_ = g_object_ref_sink (_tmp112_); - _g_object_unref0 (self->priv->info_bar_image); - self->priv->info_bar_image = _tmp113_; + 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; - _tmp115_ = self->priv->info_bar_image; - gtk_box_pack_start (_tmp114_, (GtkWidget*) _tmp115_, FALSE, TRUE, (guint) 0); - _tmp116_ = self->priv->info_bar_image; - gtk_widget_show ((GtkWidget*) _tmp116_); - _tmp117_ = (GtkLabel*) gtk_label_new (NULL); - _tmp118_ = g_object_ref_sink (_tmp117_); + 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_); + _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_); _g_object_unref0 (self->priv->info_bar_label); - 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 (GTK_BUTTON (_tmp124_)); - _g_object_unref0 (self->priv->info_bar_close_button); - self->priv->info_bar_close_button = _tmp125_; - _tmp126_ = self->priv->info_bar; - _tmp127_ = _ ("Change _Scanner"); - _tmp128_ = gtk_info_bar_add_button (_tmp126_, _tmp127_, 1); + 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_)); + _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_)); _g_object_unref0 (self->priv->info_bar_change_scanner_button); - 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); + 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); _tmp139_ = self->priv->paper_size_model; gtk_list_store_append (_tmp139_, &_tmp140_); iter = _tmp140_; _tmp141_ = self->priv->paper_size_model; _tmp142_ = iter; - gtk_list_store_set (_tmp141_, &_tmp142_, 0, 1480, 1, 2100, 2, "A5", -1, -1); + gtk_list_store_set (_tmp141_, &_tmp142_, 0, 1050, 1, 1480, 2, "A6", -1, -1); _tmp143_ = self->priv->paper_size_model; gtk_list_store_append (_tmp143_, &_tmp144_); iter = _tmp144_; _tmp145_ = self->priv->paper_size_model; _tmp146_ = iter; - gtk_list_store_set (_tmp145_, &_tmp146_, 0, 2100, 1, 2970, 2, "A4", -1, -1); + gtk_list_store_set (_tmp145_, &_tmp146_, 0, 1480, 1, 2100, 2, "A5", -1, -1); _tmp147_ = self->priv->paper_size_model; gtk_list_store_append (_tmp147_, &_tmp148_); iter = _tmp148_; _tmp149_ = self->priv->paper_size_model; _tmp150_ = iter; - gtk_list_store_set (_tmp149_, &_tmp150_, 0, 2159, 1, 2794, 2, "Letter", -1, -1); + gtk_list_store_set (_tmp149_, &_tmp150_, 0, 2100, 1, 2970, 2, "A4", -1, -1); _tmp151_ = self->priv->paper_size_model; gtk_list_store_append (_tmp151_, &_tmp152_); iter = _tmp152_; _tmp153_ = self->priv->paper_size_model; _tmp154_ = iter; - gtk_list_store_set (_tmp153_, &_tmp154_, 0, 2159, 1, 3556, 2, "Legal", -1, -1); + gtk_list_store_set (_tmp153_, &_tmp154_, 0, 2159, 1, 2794, 2, "Letter", -1, -1); _tmp155_ = self->priv->paper_size_model; gtk_list_store_append (_tmp155_, &_tmp156_); iter = _tmp156_; _tmp157_ = self->priv->paper_size_model; _tmp158_ = iter; - gtk_list_store_set (_tmp157_, &_tmp158_, 0, 1016, 1, 1524, 2, "4×6", -1, -1); - _tmp159_ = self->priv->settings; - _tmp160_ = g_settings_get_int (_tmp159_, "text-dpi"); - dpi = _tmp160_; - _tmp161_ = dpi; - if (_tmp161_ <= 0) { - dpi = SIMPLE_SCAN_DEFAULT_TEXT_DPI; - } - _tmp162_ = self->priv->text_dpi_combo; - _tmp163_ = dpi; - simple_scan_set_dpi_combo (self, _tmp162_, SIMPLE_SCAN_DEFAULT_TEXT_DPI, _tmp163_); - _tmp164_ = self->priv->settings; - _tmp165_ = g_settings_get_int (_tmp164_, "photo-dpi"); - dpi = _tmp165_; - _tmp166_ = dpi; - if (_tmp166_ <= 0) { - dpi = SIMPLE_SCAN_DEFAULT_PHOTO_DPI; - } - _tmp167_ = self->priv->photo_dpi_combo; - _tmp168_ = dpi; - simple_scan_set_dpi_combo (self, _tmp167_, SIMPLE_SCAN_DEFAULT_PHOTO_DPI, _tmp168_); - _tmp169_ = (GtkCellRendererText*) gtk_cell_renderer_text_new (); - _tmp170_ = g_object_ref_sink (_tmp169_); - renderer = _tmp170_; - _tmp171_ = self->priv->device_combo; - _tmp172_ = renderer; - gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp171_, (GtkCellRenderer*) _tmp172_, TRUE); - _tmp173_ = self->priv->device_combo; - _tmp174_ = renderer; - gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp173_, (GtkCellRenderer*) _tmp174_, "text", 1); - _tmp175_ = (GtkCellRendererText*) gtk_cell_renderer_text_new (); - _tmp176_ = g_object_ref_sink (_tmp175_); - _g_object_unref0 (renderer); - renderer = _tmp176_; - _tmp177_ = self->priv->page_side_combo; + 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) { + 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) { + 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_); + renderer = _tmp174_; + _tmp175_ = self->priv->device_combo; + _tmp176_ = renderer; + gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp175_, (GtkCellRenderer*) _tmp176_, TRUE); + _tmp177_ = self->priv->device_combo; _tmp178_ = renderer; - gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp177_, (GtkCellRenderer*) _tmp178_, TRUE); - _tmp179_ = self->priv->page_side_combo; - _tmp180_ = renderer; - gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp179_, (GtkCellRenderer*) _tmp180_, "text", 1); - _tmp181_ = self->priv->settings; - _tmp182_ = g_settings_get_enum (_tmp181_, "page-side"); - simple_scan_set_page_side (self, (ScanType) _tmp182_); - _tmp183_ = (GtkCellRendererText*) gtk_cell_renderer_text_new (); - _tmp184_ = g_object_ref_sink (_tmp183_); + gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp177_, (GtkCellRenderer*) _tmp178_, "text", 1); + _tmp179_ = (GtkCellRendererText*) gtk_cell_renderer_text_new (); + _tmp180_ = g_object_ref_sink (_tmp179_); + _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 = _tmp184_; - _tmp185_ = self->priv->paper_size_combo; - _tmp186_ = renderer; - gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp185_, (GtkCellRenderer*) _tmp186_, TRUE); - _tmp187_ = self->priv->paper_size_combo; - _tmp188_ = renderer; - gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp187_, (GtkCellRenderer*) _tmp188_, "text", 2); - _tmp189_ = self->priv->settings; - _tmp190_ = g_settings_get_int (_tmp189_, "paper-width"); - paper_width = _tmp190_; - _tmp191_ = self->priv->settings; - _tmp192_ = g_settings_get_int (_tmp191_, "paper-height"); - paper_height = _tmp192_; - _tmp193_ = paper_width; - _tmp194_ = paper_height; - simple_scan_set_paper_size (self, _tmp193_, _tmp194_); + 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_string (_tmp195_, "selected-device"); - device = _tmp196_; - _tmp197_ = device; - if (_tmp197_ != NULL) { - const gchar* _tmp198_; - GtkTreeIter _tmp199_ = {0}; - gboolean _tmp200_ = FALSE; - _tmp198_ = device; - _tmp200_ = simple_scan_find_scan_device (self, _tmp198_, &_tmp199_); - iter = _tmp199_; - if (_tmp200_) { - GtkComboBox* _tmp201_; - GtkTreeIter _tmp202_; - _tmp201_ = self->priv->device_combo; - _tmp202_ = iter; - gtk_combo_box_set_active_iter (_tmp201_, &_tmp202_); + _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_); } } - _tmp203_ = self->priv->settings; - _tmp204_ = g_settings_get_string (_tmp203_, "document-type"); - document_type = _tmp204_; - _tmp205_ = document_type; - if (_tmp205_ != NULL) { - const gchar* _tmp206_; - _tmp206_ = document_type; - simple_scan_set_document_hint (self, _tmp206_); - } - _tmp207_ = self->priv->book; - _tmp208_ = book_view_new (_tmp207_); - _tmp209_ = g_object_ref_sink (_tmp208_); + _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_); _g_object_unref0 (self->priv->book_view); - self->priv->book_view = _tmp209_; - _tmp210_ = self->priv->book_view; - gtk_container_set_border_width ((GtkContainer*) _tmp210_, (guint) 18); - _tmp211_ = self->priv->main_vbox; - _tmp212_ = self->priv->book_view; - gtk_box_pack_end ((GtkBox*) _tmp211_, (GtkWidget*) _tmp212_, TRUE, TRUE, (guint) 0); - _tmp213_ = self->priv->book_view; - g_signal_connect (_tmp213_, "page-selected", (GCallback) _simple_scan_page_selected_cb_book_view_page_selected, self); + self->priv->book_view = _tmp213_; _tmp214_ = self->priv->book_view; - g_signal_connect (_tmp214_, "show-page", (GCallback) _simple_scan_show_page_cb_book_view_show_page, self); - _tmp215_ = self->priv->book_view; - g_signal_connect (_tmp215_, "show-menu", (GCallback) _simple_scan_show_page_menu_cb_book_view_show_menu, self); + gtk_container_set_border_width ((GtkContainer*) _tmp214_, (guint) 18); + _tmp215_ = self->priv->main_vbox; _tmp216_ = self->priv->book_view; - gtk_widget_show ((GtkWidget*) _tmp216_); - _tmp217_ = self->priv->settings; - _tmp218_ = g_settings_get_enum (_tmp217_, "scan-direction"); - self->priv->default_page_scan_direction = (ScanDirection) _tmp218_; - _tmp219_ = self->priv->settings; - _tmp220_ = g_settings_get_int (_tmp219_, "page-width"); - self->priv->default_page_width = _tmp220_; - _tmp221_ = self->priv->default_page_width; - if (_tmp221_ <= 0) { + 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->default_page_width = 595; } - _tmp222_ = self->priv->settings; - _tmp223_ = g_settings_get_int (_tmp222_, "page-height"); - self->priv->default_page_height = _tmp223_; - _tmp224_ = self->priv->default_page_height; - if (_tmp224_ <= 0) { + _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) { self->priv->default_page_height = 842; } - _tmp225_ = self->priv->settings; - _tmp226_ = g_settings_get_int (_tmp225_, "page-dpi"); - self->priv->default_page_dpi = _tmp226_; - _tmp227_ = self->priv->default_page_dpi; - if (_tmp227_ <= 0) { + _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) { self->priv->default_page_dpi = 72; } - _tmp228_ = self->priv->settings; - _tmp229_ = g_settings_get_int (_tmp228_, "window-width"); - self->priv->window_width = _tmp229_; - _tmp230_ = self->priv->window_width; - if (_tmp230_ <= 0) { + _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) { self->priv->window_width = 600; } - _tmp231_ = self->priv->settings; - _tmp232_ = g_settings_get_int (_tmp231_, "window-height"); - self->priv->window_height = _tmp232_; - _tmp233_ = self->priv->window_height; - if (_tmp233_ <= 0) { + _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) { self->priv->window_height = 400; } - _tmp234_ = self->priv->window_width; - _tmp235_ = self->priv->window_height; - g_debug ("ui.vala:1408: Restoring window to %dx%d pixels", _tmp234_, _tmp235_); - _tmp236_ = self->priv->window; - _tmp237_ = self->priv->window_width; - _tmp238_ = self->priv->window_height; - gtk_window_set_default_size (_tmp236_, _tmp237_, _tmp238_); - _tmp239_ = self->priv->settings; - _tmp240_ = g_settings_get_boolean (_tmp239_, "window-is-maximized"); - self->priv->window_is_maximized = _tmp240_; - _tmp241_ = self->priv->window_is_maximized; - if (_tmp241_) { - GtkWindow* _tmp242_; - g_debug ("ui.vala:1413: Restoring window to maximized"); - _tmp242_ = self->priv->window; - gtk_window_maximize (_tmp242_); - } - _tmp243_ = self->priv->book; - _tmp244_ = book_get_n_pages (_tmp243_); - if (_tmp244_ == ((guint) 0)) { - simple_scan_add_default_page (self); - } - _tmp245_ = self->priv->book; - book_set_needs_saving (_tmp245_, FALSE); - _tmp246_ = self->priv->book; - g_signal_connect (_tmp246_, "needs-saving-changed", (GCallback) _simple_scan_needs_saving_cb_book_needs_saving_changed, self); + _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)) { + 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_); + _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_; _g_free0 (document_type); _g_free0 (device); _g_object_unref0 (renderer); _g_object_unref0 (content_area); _g_object_unref0 (hbox); + _g_object_unref0 (app); _g_free0 (filename); } +static gboolean ___lambda2_ (UserInterface* self) { + gboolean result = FALSE; + ProgressBarDialog* _tmp0_; + _tmp0_ = self->priv->progress_dialog; + gtk_widget_hide ((GtkWidget*) _tmp0_); + result = FALSE; + return result; +} + + +static gboolean ____lambda2__gsource_func (gpointer self) { + gboolean result; + result = ___lambda2_ (self); + return result; +} + + +static void user_interface_book_saving_cb (UserInterface* self, gint page_number) { + Book* _tmp1_; + guint _tmp2_ = 0U; + gint total; + gint _tmp3_; + gint _tmp4_; + gdouble fraction; + gdouble _tmp5_; + gboolean complete; + gboolean _tmp6_; + const gchar* _tmp7_ = NULL; + gint _tmp8_; + gint _tmp9_; + gchar* _tmp10_ = NULL; + gchar* message; + ProgressBarDialog* _tmp11_; + gdouble _tmp12_; + ProgressBarDialog* _tmp13_; + g_return_if_fail (self != NULL); + while (TRUE) { + gboolean _tmp0_ = FALSE; + _tmp0_ = gtk_events_pending (); + if (!_tmp0_) { + break; + } + gtk_main_iteration (); + } + _tmp1_ = self->priv->book; + _tmp2_ = book_get_n_pages (_tmp1_); + total = (gint) _tmp2_; + _tmp3_ = page_number; + _tmp4_ = total; + fraction = (_tmp3_ + 1.0) / _tmp4_; + _tmp5_ = fraction; + complete = _tmp5_ == 1.0; + _tmp6_ = complete; + if (_tmp6_) { + g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 500, ____lambda2__gsource_func, user_interface_ref (self), user_interface_unref); + } + _tmp7_ = _ ("Saving page %d out of %d"); + _tmp8_ = page_number; + _tmp9_ = total; + _tmp10_ = g_strdup_printf (_tmp7_, _tmp8_ + 1, _tmp9_); + message = _tmp10_; + _tmp11_ = self->priv->progress_dialog; + _tmp12_ = fraction; + progress_bar_dialog_set_fraction (_tmp11_, _tmp12_); + _tmp13_ = self->priv->progress_dialog; + progress_bar_dialog_set_message (_tmp13_, message); + _g_free0 (message); +} + + +void user_interface_show_progress_dialog (UserInterface* self) { + ProgressBarDialog* _tmp0_; + g_return_if_fail (self != NULL); + _tmp0_ = self->priv->progress_dialog; + gtk_widget_show ((GtkWidget*) _tmp0_); +} + + +void user_interface_hide_progress_dialog (UserInterface* self) { + ProgressBarDialog* _tmp0_; + g_return_if_fail (self != NULL); + _tmp0_ = self->priv->progress_dialog; + gtk_widget_hide ((GtkWidget*) _tmp0_); +} + + static gpointer _book_ref0 (gpointer self) { return self ? book_ref (self) : NULL; } -Book* simple_scan_get_book (SimpleScan* self) { +Book* user_interface_get_book (UserInterface* self) { Book* result = NULL; Book* _tmp0_; Book* _tmp1_; @@ -4473,7 +4639,7 @@ Book* simple_scan_get_book (SimpleScan* self) { } -void simple_scan_set_selected_page (SimpleScan* self, Page* page) { +void user_interface_set_selected_page (UserInterface* self, Page* page) { BookView* _tmp0_; Page* _tmp1_; g_return_if_fail (self != NULL); @@ -4484,7 +4650,7 @@ void simple_scan_set_selected_page (SimpleScan* self, Page* page) { } -Page* simple_scan_get_selected_page (SimpleScan* self) { +Page* user_interface_get_selected_page (UserInterface* self) { Page* result = NULL; BookView* _tmp0_; Page* _tmp1_ = NULL; @@ -4496,7 +4662,7 @@ Page* simple_scan_get_selected_page (SimpleScan* self) { } -void simple_scan_set_scanning (SimpleScan* self, gboolean scanning) { +void user_interface_set_scanning (UserInterface* self, gboolean scanning) { gboolean _tmp0_; GtkMenuItem* _tmp1_; gboolean _tmp2_; @@ -4519,7 +4685,7 @@ void simple_scan_set_scanning (SimpleScan* self, gboolean scanning) { } -void simple_scan_show_error (SimpleScan* self, const gchar* error_title, const gchar* error_text, gboolean change_scanner_hint) { +void user_interface_show_error (UserInterface* self, const gchar* error_title, const gchar* error_text, gboolean change_scanner_hint) { const gchar* _tmp0_; gchar* _tmp1_; const gchar* _tmp2_; @@ -4539,11 +4705,11 @@ void simple_scan_show_error (SimpleScan* self, const gchar* error_title, const g self->priv->error_text = _tmp3_; _tmp4_ = change_scanner_hint; self->priv->error_change_scanner_hint = _tmp4_; - simple_scan_update_info_bar (self); + user_interface_update_info_bar (self); } -void simple_scan_start (SimpleScan* self) { +void user_interface_start (UserInterface* self) { GtkWindow* _tmp0_; g_return_if_fail (self != NULL); _tmp0_ = self->priv->window; @@ -4571,42 +4737,42 @@ static void g_cclosure_user_marshal_VOID__STRING_SCAN_OPTIONS (GClosure * closur } -static void value_simple_scan_init (GValue* value) { +static void value_user_interface_init (GValue* value) { value->data[0].v_pointer = NULL; } -static void value_simple_scan_free_value (GValue* value) { +static void value_user_interface_free_value (GValue* value) { if (value->data[0].v_pointer) { - simple_scan_unref (value->data[0].v_pointer); + user_interface_unref (value->data[0].v_pointer); } } -static void value_simple_scan_copy_value (const GValue* src_value, GValue* dest_value) { +static void value_user_interface_copy_value (const GValue* src_value, GValue* dest_value) { if (src_value->data[0].v_pointer) { - dest_value->data[0].v_pointer = simple_scan_ref (src_value->data[0].v_pointer); + dest_value->data[0].v_pointer = user_interface_ref (src_value->data[0].v_pointer); } else { dest_value->data[0].v_pointer = NULL; } } -static gpointer value_simple_scan_peek_pointer (const GValue* value) { +static gpointer value_user_interface_peek_pointer (const GValue* value) { return value->data[0].v_pointer; } -static gchar* value_simple_scan_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { +static gchar* value_user_interface_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { if (collect_values[0].v_pointer) { - SimpleScan* object; + UserInterface* 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 = simple_scan_ref (object); + value->data[0].v_pointer = user_interface_ref (object); } else { value->data[0].v_pointer = NULL; } @@ -4614,8 +4780,8 @@ static gchar* value_simple_scan_collect_value (GValue* value, guint n_collect_va } -static gchar* value_simple_scan_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { - SimpleScan** object_p; +static gchar* value_user_interface_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { + UserInterface** 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)); @@ -4625,78 +4791,78 @@ static gchar* value_simple_scan_lcopy_value (const GValue* value, guint n_collec } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) { *object_p = value->data[0].v_pointer; } else { - *object_p = simple_scan_ref (value->data[0].v_pointer); + *object_p = user_interface_ref (value->data[0].v_pointer); } return NULL; } -GParamSpec* param_spec_simple_scan (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) { - ParamSpecSimpleScan* spec; - g_return_val_if_fail (g_type_is_a (object_type, TYPE_SIMPLE_SCAN), NULL); +GParamSpec* param_spec_user_interface (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) { + ParamSpecUserInterface* spec; + g_return_val_if_fail (g_type_is_a (object_type, TYPE_USER_INTERFACE), 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_simple_scan (const GValue* value) { - g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_SIMPLE_SCAN), NULL); +gpointer value_get_user_interface (const GValue* value) { + g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_USER_INTERFACE), NULL); return value->data[0].v_pointer; } -void value_set_simple_scan (GValue* value, gpointer v_object) { - SimpleScan* old; - g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_SIMPLE_SCAN)); +void value_set_user_interface (GValue* value, gpointer v_object) { + UserInterface* old; + g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_USER_INTERFACE)); old = value->data[0].v_pointer; if (v_object) { - g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_SIMPLE_SCAN)); + g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_USER_INTERFACE)); 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; - simple_scan_ref (value->data[0].v_pointer); + user_interface_ref (value->data[0].v_pointer); } else { value->data[0].v_pointer = NULL; } if (old) { - simple_scan_unref (old); + user_interface_unref (old); } } -void value_take_simple_scan (GValue* value, gpointer v_object) { - SimpleScan* old; - g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_SIMPLE_SCAN)); +void value_take_user_interface (GValue* value, gpointer v_object) { + UserInterface* old; + g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_USER_INTERFACE)); old = value->data[0].v_pointer; if (v_object) { - g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_SIMPLE_SCAN)); + g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_USER_INTERFACE)); 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) { - simple_scan_unref (old); + user_interface_unref (old); } } -static void simple_scan_class_init (SimpleScanClass * klass) { - simple_scan_parent_class = g_type_class_peek_parent (klass); - SIMPLE_SCAN_CLASS (klass)->finalize = simple_scan_finalize; - g_type_class_add_private (klass, sizeof (SimpleScanPrivate)); - g_signal_new ("start_scan", TYPE_SIMPLE_SCAN, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_SCAN_OPTIONS, G_TYPE_NONE, 2, G_TYPE_STRING, TYPE_SCAN_OPTIONS); - g_signal_new ("stop_scan", TYPE_SIMPLE_SCAN, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); - g_signal_new ("email", TYPE_SIMPLE_SCAN, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); - g_signal_new ("quit", TYPE_SIMPLE_SCAN, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); +static void user_interface_class_init (UserInterfaceClass * klass) { + user_interface_parent_class = g_type_class_peek_parent (klass); + USER_INTERFACE_CLASS (klass)->finalize = user_interface_finalize; + g_type_class_add_private (klass, sizeof (UserInterfacePrivate)); + g_signal_new ("start_scan", TYPE_USER_INTERFACE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_SCAN_OPTIONS, G_TYPE_NONE, 2, G_TYPE_STRING, TYPE_SCAN_OPTIONS); + g_signal_new ("stop_scan", TYPE_USER_INTERFACE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); + g_signal_new ("email", TYPE_USER_INTERFACE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); } -static void simple_scan_instance_init (SimpleScan * self) { +static void user_interface_instance_init (UserInterface * self) { gchar* _tmp0_; const gchar* _tmp1_ = NULL; gchar* _tmp2_; - self->priv = SIMPLE_SCAN_GET_PRIVATE (self); + 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_; @@ -4708,9 +4874,9 @@ static void simple_scan_instance_init (SimpleScan * self) { } -static void simple_scan_finalize (SimpleScan* obj) { - SimpleScan * self; - self = SIMPLE_SCAN (obj); +static void user_interface_finalize (UserInterface* obj) { + UserInterface * self; + self = USER_INTERFACE (obj); _g_object_unref0 (self->priv->settings); _g_object_unref0 (self->priv->builder); _g_object_unref0 (self->priv->window); @@ -4749,6 +4915,8 @@ static void simple_scan_finalize (SimpleScan* obj) { _g_object_unref0 (self->priv->page_side_model); _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); @@ -4759,38 +4927,585 @@ static void simple_scan_finalize (SimpleScan* obj) { } -GType simple_scan_get_type (void) { - static volatile gsize simple_scan_type_id__volatile = 0; - if (g_once_init_enter (&simple_scan_type_id__volatile)) { - static const GTypeValueTable g_define_type_value_table = { value_simple_scan_init, value_simple_scan_free_value, value_simple_scan_copy_value, value_simple_scan_peek_pointer, "p", value_simple_scan_collect_value, "p", value_simple_scan_lcopy_value }; - static const GTypeInfo g_define_type_info = { sizeof (SimpleScanClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) simple_scan_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SimpleScan), 0, (GInstanceInitFunc) simple_scan_instance_init, &g_define_type_value_table }; +GType user_interface_get_type (void) { + static volatile gsize user_interface_type_id__volatile = 0; + if (g_once_init_enter (&user_interface_type_id__volatile)) { + static const GTypeValueTable g_define_type_value_table = { value_user_interface_init, value_user_interface_free_value, value_user_interface_copy_value, value_user_interface_peek_pointer, "p", value_user_interface_collect_value, "p", value_user_interface_lcopy_value }; + static const GTypeInfo g_define_type_info = { sizeof (UserInterfaceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) user_interface_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UserInterface), 0, (GInstanceInitFunc) user_interface_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 user_interface_type_id; + user_interface_type_id = g_type_register_fundamental (g_type_fundamental_next (), "UserInterface", &g_define_type_info, &g_define_type_fundamental_info, 0); + g_once_init_leave (&user_interface_type_id__volatile, user_interface_type_id); + } + return user_interface_type_id__volatile; +} + + +gpointer user_interface_ref (gpointer instance) { + UserInterface* self; + self = instance; + g_atomic_int_inc (&self->ref_count); + return instance; +} + + +void user_interface_unref (gpointer instance) { + UserInterface* self; + self = instance; + if (g_atomic_int_dec_and_test (&self->ref_count)) { + USER_INTERFACE_GET_CLASS (self)->finalize (self); + g_type_free_instance ((GTypeInstance *) self); + } +} + + +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* hbox; + GtkBox* _tmp4_; + GtkBox* _tmp5_; + GtkBox* vbox; + GtkProgressBar* _tmp6_; + GtkProgressBar* _tmp7_; + GtkProgressBar* _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_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_; + 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); + gtk_widget_set_size_request ((GtkWidget*) self, 250, 50); + _tmp9_ = self->priv->bar; + gtk_box_pack_start (vbox, (GtkWidget*) _tmp9_, 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_); + 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_); + _g_object_unref0 (vbox); + _g_object_unref0 (hbox); + return self; +} + + +ProgressBarDialog* progress_bar_dialog_new (GtkWindow* parent, const gchar* title) { + return progress_bar_dialog_construct (TYPE_PROGRESS_BAR_DIALOG, parent, title); +} + + +void progress_bar_dialog_set_fraction (ProgressBarDialog* self, gdouble percent) { + GtkProgressBar* _tmp0_; + gdouble _tmp1_; + g_return_if_fail (self != NULL); + _tmp0_ = self->priv->bar; + _tmp1_ = percent; + gtk_progress_bar_set_fraction (_tmp0_, _tmp1_); +} + + +void progress_bar_dialog_set_message (ProgressBarDialog* self, const gchar* message) { + GtkProgressBar* _tmp0_; + const gchar* _tmp1_; + g_return_if_fail (self != NULL); + g_return_if_fail (message != NULL); + _tmp0_ = self->priv->bar; + _tmp1_ = message; + gtk_progress_bar_set_text (_tmp0_, _tmp1_); +} + + +static void progress_bar_dialog_class_init (ProgressBarDialogClass * klass) { + progress_bar_dialog_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (ProgressBarDialogPrivate)); + G_OBJECT_CLASS (klass)->finalize = progress_bar_dialog_finalize; +} + + +static void progress_bar_dialog_instance_init (ProgressBarDialog * self) { + self->priv = PROGRESS_BAR_DIALOG_GET_PRIVATE (self); +} + + +static void progress_bar_dialog_finalize (GObject* obj) { + ProgressBarDialog * self; + self = PROGRESS_BAR_DIALOG (obj); + _g_object_unref0 (self->priv->bar); + G_OBJECT_CLASS (progress_bar_dialog_parent_class)->finalize (obj); +} + + +GType progress_bar_dialog_get_type (void) { + static volatile gsize progress_bar_dialog_type_id__volatile = 0; + if (g_once_init_enter (&progress_bar_dialog_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (ProgressBarDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) progress_bar_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProgressBarDialog), 0, (GInstanceInitFunc) progress_bar_dialog_instance_init, NULL }; + GType progress_bar_dialog_type_id; + progress_bar_dialog_type_id = g_type_register_static (GTK_TYPE_WINDOW, "ProgressBarDialog", &g_define_type_info, 0); + g_once_init_leave (&progress_bar_dialog_type_id__volatile, progress_bar_dialog_type_id); + } + return progress_bar_dialog_type_id__volatile; +} + + +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 simple_scan_type_id; - simple_scan_type_id = g_type_register_fundamental (g_type_fundamental_next (), "SimpleScan", &g_define_type_info, &g_define_type_fundamental_info, 0); - g_once_init_leave (&simple_scan_type_id__volatile, simple_scan_type_id); + 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 simple_scan_type_id__volatile; + return drag_and_drop_handler_type_id__volatile; } -gpointer simple_scan_ref (gpointer instance) { - SimpleScan* self; +gpointer drag_and_drop_handler_ref (gpointer instance) { + DragAndDropHandler* self; self = instance; g_atomic_int_inc (&self->ref_count); return instance; } -void simple_scan_unref (gpointer instance) { - SimpleScan* self; +void drag_and_drop_handler_unref (gpointer instance) { + DragAndDropHandler* self; self = instance; if (g_atomic_int_dec_and_test (&self->ref_count)) { - SIMPLE_SCAN_GET_CLASS (self)->finalize (self); + 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_; + const gchar* _tmp1_; + gchar* _tmp2_ = NULL; + gchar* filename; + gchar* path = NULL; + GError * _inner_error_ = NULL; + g_return_val_if_fail (prefix != NULL, NULL); + g_return_val_if_fail (extension != NULL, NULL); + _tmp0_ = prefix; + _tmp1_ = extension; + _tmp2_ = g_strdup_printf ("%sXXXXXX.%s", _tmp0_, _tmp1_); + filename = _tmp2_; + { + const gchar* _tmp3_; + gchar* _tmp4_ = NULL; + gint _tmp5_ = 0; + gint fd; + gint _tmp6_; + _tmp3_ = filename; + _tmp5_ = g_file_open_tmp (_tmp3_, &_tmp4_, &_inner_error_); + _g_free0 (path); + path = _tmp4_; + fd = _tmp5_; + if (_inner_error_ != NULL) { + goto __catch22_g_error; + } + _tmp6_ = fd; + close (_tmp6_); + } + goto __finally22; + __catch22_g_error: + { + GError* e = NULL; + GError* _tmp7_; + const gchar* _tmp8_; + e = _inner_error_; + _inner_error_ = NULL; + _tmp7_ = e; + _tmp8_ = _tmp7_->message; + g_warning ("ui.vala:1607: Error saving email attachment: %s", _tmp8_); + result = NULL; + _g_error_free0 (e); + _g_free0 (path); + _g_free0 (filename); + return result; + } + __finally22: + if (_inner_error_ != NULL) { + _g_free0 (path); + _g_free0 (filename); + 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 NULL; + } + result = path; + _g_free0 (filename); + return result; +} + + static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { if ((array != NULL) && (destroy_func != NULL)) { int i; |