summaryrefslogtreecommitdiff
path: root/src/ui.c
diff options
context:
space:
mode:
authorAlessio Treglia <alessio@debian.org>2013-01-15 00:46:37 +0000
committerAlessio Treglia <alessio@debian.org>2013-01-15 00:46:37 +0000
commit8f1bef0c8abe53da0001b0d4df1f5439fecd9c3b (patch)
tree67137e06f48cbe06c0bf16052ea446edf63eb7a0 /src/ui.c
parentd723aded8c1b91731f391754358750e9119d6689 (diff)
parentb99db4e5834bb8668c249bb7ce30af9a4d23527e (diff)
Merge tag 'upstream/3.6.0'
Upstream version 3.6.0
Diffstat (limited to 'src/ui.c')
-rw-r--r--src/ui.c1990
1 files changed, 784 insertions, 1206 deletions
diff --git a/src/ui.c b/src/ui.c
index da21602..45be640 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -1,4 +1,4 @@
-/* ui.c generated by valac 0.16.1, the Vala compiler
+/* ui.c generated by valac 0.17.7, the Vala compiler
* generated from ui.vala, do not modify */
/*
@@ -51,16 +51,6 @@ typedef struct _UserInterfacePrivate UserInterfacePrivate;
typedef struct _ProgressBarDialog ProgressBarDialog;
typedef struct _ProgressBarDialogClass ProgressBarDialogClass;
-#define TYPE_DRAG_AND_DROP_HANDLER (drag_and_drop_handler_get_type ())
-#define DRAG_AND_DROP_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DRAG_AND_DROP_HANDLER, DragAndDropHandler))
-#define DRAG_AND_DROP_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DRAG_AND_DROP_HANDLER, DragAndDropHandlerClass))
-#define IS_DRAG_AND_DROP_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DRAG_AND_DROP_HANDLER))
-#define IS_DRAG_AND_DROP_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DRAG_AND_DROP_HANDLER))
-#define DRAG_AND_DROP_HANDLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DRAG_AND_DROP_HANDLER, DragAndDropHandlerClass))
-
-typedef struct _DragAndDropHandler DragAndDropHandler;
-typedef struct _DragAndDropHandlerClass DragAndDropHandlerClass;
-
#define TYPE_BOOK (book_get_type ())
#define BOOK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BOOK, Book))
#define BOOK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BOOK, BookClass))
@@ -82,10 +72,6 @@ typedef struct _BookView BookView;
typedef struct _BookViewClass BookViewClass;
#define TYPE_SCAN_DIRECTION (scan_direction_get_type ())
-#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
-#define _drag_and_drop_handler_unref0(var) ((var == NULL) ? NULL : (var = (drag_and_drop_handler_unref (var), NULL)))
-#define _g_free0(var) (var = (g_free (var), NULL))
-#define _book_unref0(var) ((var == NULL) ? NULL : (var = (book_unref (var), NULL)))
#define TYPE_PAGE (page_get_type ())
#define PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PAGE, Page))
@@ -96,6 +82,9 @@ typedef struct _BookViewClass BookViewClass;
typedef struct _Page Page;
typedef struct _PageClass PageClass;
+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
+#define _g_free0(var) (var = (g_free (var), NULL))
+#define _book_unref0(var) ((var == NULL) ? NULL : (var = (book_unref (var), NULL)))
#define TYPE_SCAN_DEVICE (scan_device_get_type ())
#define SCAN_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SCAN_DEVICE, ScanDevice))
@@ -129,11 +118,6 @@ typedef struct _ScanOptionsPrivate ScanOptionsPrivate;
#define _cairo_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_destroy (var), NULL)))
typedef struct _ParamSpecUserInterface ParamSpecUserInterface;
typedef struct _ProgressBarDialogPrivate ProgressBarDialogPrivate;
-typedef struct _DragAndDropHandlerPrivate DragAndDropHandlerPrivate;
-
-#define DRAG_AND_DROP_HANDLER_TYPE_TARGET_TYPE (drag_and_drop_handler_target_type_get_type ())
-#define _gtk_target_list_unref0(var) ((var == NULL) ? NULL : (var = (gtk_target_list_unref (var), NULL)))
-typedef struct _ParamSpecDragAndDropHandler ParamSpecDragAndDropHandler;
struct _UserInterface {
GTypeInstance parent_instance;
@@ -195,7 +179,6 @@ struct _UserInterfacePrivate {
gboolean user_selected_device;
GtkFileChooserDialog* save_dialog;
ProgressBarDialog* progress_dialog;
- DragAndDropHandler* dnd_handler;
gboolean have_error;
gchar* error_title;
gchar* error_text;
@@ -277,34 +260,9 @@ struct _ProgressBarDialogPrivate {
GtkProgressBar* bar;
};
-struct _DragAndDropHandler {
- GTypeInstance parent_instance;
- volatile int ref_count;
- DragAndDropHandlerPrivate * priv;
-};
-
-struct _DragAndDropHandlerClass {
- GTypeClass parent_class;
- void (*finalize) (DragAndDropHandler *self);
-};
-
-struct _DragAndDropHandlerPrivate {
- BookView* book_view;
-};
-
-typedef enum {
- DRAG_AND_DROP_HANDLER_TARGET_TYPE_IMAGE,
- DRAG_AND_DROP_HANDLER_TARGET_TYPE_URI
-} DragAndDropHandlerTargetType;
-
-struct _ParamSpecDragAndDropHandler {
- GParamSpec parent_instance;
-};
-
static gpointer user_interface_parent_class = NULL;
static gpointer progress_bar_dialog_parent_class = NULL;
-static gpointer drag_and_drop_handler_parent_class = NULL;
gpointer user_interface_ref (gpointer instance);
void user_interface_unref (gpointer instance);
@@ -314,13 +272,6 @@ void value_take_user_interface (GValue* value, gpointer v_object);
gpointer value_get_user_interface (const GValue* value);
GType user_interface_get_type (void) G_GNUC_CONST;
GType progress_bar_dialog_get_type (void) G_GNUC_CONST;
-gpointer drag_and_drop_handler_ref (gpointer instance);
-void drag_and_drop_handler_unref (gpointer instance);
-GParamSpec* param_spec_drag_and_drop_handler (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
-void value_set_drag_and_drop_handler (GValue* value, gpointer v_object);
-void value_take_drag_and_drop_handler (GValue* value, gpointer v_object);
-gpointer value_get_drag_and_drop_handler (const GValue* value);
-GType drag_and_drop_handler_get_type (void) G_GNUC_CONST;
gpointer book_ref (gpointer instance);
void book_unref (gpointer instance);
GParamSpec* param_spec_book (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
@@ -334,12 +285,6 @@ GType scan_direction_get_type (void) G_GNUC_CONST;
enum {
USER_INTERFACE_DUMMY_PROPERTY
};
-#define USER_INTERFACE_DEFAULT_TEXT_DPI 150
-#define USER_INTERFACE_DEFAULT_PHOTO_DPI 300
-UserInterface* user_interface_new (void);
-UserInterface* user_interface_construct (GType object_type);
-Book* book_new (void);
-Book* book_construct (GType object_type);
gpointer page_ref (gpointer instance);
void page_unref (gpointer instance);
GParamSpec* param_spec_page (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
@@ -351,6 +296,12 @@ static void user_interface_page_removed_cb (UserInterface* self, Book* book, Pag
static void _user_interface_page_removed_cb_book_page_removed (Book* _sender, Page* page, gpointer self);
static void user_interface_page_added_cb (UserInterface* self, Book* book, Page* page);
static void _user_interface_page_added_cb_book_page_added (Book* _sender, Page* page, gpointer self);
+#define USER_INTERFACE_DEFAULT_TEXT_DPI 150
+#define USER_INTERFACE_DEFAULT_PHOTO_DPI 300
+UserInterface* user_interface_new (void);
+UserInterface* user_interface_construct (GType object_type);
+Book* book_new (void);
+Book* book_construct (GType object_type);
static void user_interface_load (UserInterface* self);
static gboolean user_interface_find_scan_device (UserInterface* self, const gchar* device, GtkTreeIter* iter);
static void user_interface_show_error_dialog (UserInterface* self, const gchar* error_title, const gchar* error_text);
@@ -487,8 +438,6 @@ ProgressBarDialog* progress_bar_dialog_new (GtkWindow* parent, const gchar* titl
ProgressBarDialog* progress_bar_dialog_construct (GType object_type, GtkWindow* parent, const gchar* title);
static void user_interface_book_saving_cb (UserInterface* self, gint page_number);
static void _user_interface_book_saving_cb_book_saving (Book* _sender, gint i, gpointer self);
-DragAndDropHandler* drag_and_drop_handler_new (BookView* book_view);
-DragAndDropHandler* drag_and_drop_handler_construct (GType object_type, BookView* book_view);
static gboolean ___lambda2_ (UserInterface* self);
static gboolean ____lambda2__gsource_func (gpointer self);
void progress_bar_dialog_set_fraction (ProgressBarDialog* self, gdouble percent);
@@ -505,16 +454,6 @@ enum {
PROGRESS_BAR_DIALOG_DUMMY_PROPERTY
};
static void progress_bar_dialog_finalize (GObject* obj);
-#define DRAG_AND_DROP_HANDLER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_DRAG_AND_DROP_HANDLER, DragAndDropHandlerPrivate))
-enum {
- DRAG_AND_DROP_HANDLER_DUMMY_PROPERTY
-};
-static GType drag_and_drop_handler_target_type_get_type (void) G_GNUC_UNUSED;
-GtkWidget* book_view_get_event_source (BookView* self);
-static void drag_and_drop_handler_set_targets (DragAndDropHandler* self, GtkWidget* event_source);
-static void drag_and_drop_handler_on_drag_data_get (DragAndDropHandler* self, GdkDragContext* context, GtkSelectionData* selection, guint target_type, guint time);
-static void _drag_and_drop_handler_on_drag_data_get_gtk_widget_drag_data_get (GtkWidget* _sender, GdkDragContext* context, GtkSelectionData* selection_data, guint info, guint time_, gpointer self);
-static void drag_and_drop_handler_finalize (DragAndDropHandler* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
@@ -625,20 +564,19 @@ static void user_interface_show_error_dialog (UserInterface* self, const gchar*
GtkWindow* _tmp0_;
const gchar* _tmp1_;
GtkMessageDialog* _tmp2_;
- GtkMessageDialog* _tmp3_;
GtkMessageDialog* dialog;
- const gchar* _tmp4_;
+ const gchar* _tmp3_;
g_return_if_fail (self != NULL);
g_return_if_fail (error_title != NULL);
g_return_if_fail (error_text != NULL);
_tmp0_ = self->priv->window;
_tmp1_ = error_title;
_tmp2_ = (GtkMessageDialog*) gtk_message_dialog_new (_tmp0_, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE, "%s", _tmp1_);
- _tmp3_ = g_object_ref_sink (_tmp2_);
- dialog = _tmp3_;
+ g_object_ref_sink (_tmp2_);
+ dialog = _tmp2_;
gtk_dialog_add_button ((GtkDialog*) dialog, GTK_STOCK_CLOSE, 0);
- _tmp4_ = error_text;
- gtk_message_dialog_format_secondary_text (dialog, "%s", _tmp4_);
+ _tmp3_ = error_text;
+ gtk_message_dialog_format_secondary_text (dialog, "%s", _tmp3_);
gtk_widget_destroy ((GtkWidget*) dialog);
_g_object_unref0 (dialog);
}
@@ -1318,89 +1256,86 @@ static gchar* user_interface_choose_file_location (UserInterface* self) {
GtkFileChooserDialog* _tmp11_;
GtkFileChooserDialog* _tmp12_;
GtkFileChooserDialog* _tmp13_;
- GtkFileChooserDialog* _tmp14_;
- const gchar* _tmp15_;
- GtkFileChooserDialog* _tmp16_;
- const gchar* _tmp17_;
- GtkFileFilter* _tmp18_;
- GtkFileFilter* _tmp19_;
+ const gchar* _tmp14_;
+ GtkFileChooserDialog* _tmp15_;
+ const gchar* _tmp16_;
+ GtkFileFilter* _tmp17_;
GtkFileFilter* filter;
+ GtkFileFilter* _tmp18_;
+ const gchar* _tmp19_ = NULL;
GtkFileFilter* _tmp20_;
- const gchar* _tmp21_ = NULL;
- GtkFileFilter* _tmp22_;
+ GtkFileFilter* _tmp21_;
+ GtkFileChooserDialog* _tmp22_;
GtkFileFilter* _tmp23_;
- GtkFileChooserDialog* _tmp24_;
+ GtkFileFilter* _tmp24_;
GtkFileFilter* _tmp25_;
- GtkFileFilter* _tmp26_;
+ const gchar* _tmp26_ = NULL;
GtkFileFilter* _tmp27_;
- GtkFileFilter* _tmp28_;
- const gchar* _tmp29_ = NULL;
- GtkFileFilter* _tmp30_;
- GtkFileChooserDialog* _tmp31_;
- GtkFileFilter* _tmp32_;
- const gchar* _tmp33_ = NULL;
- GtkExpander* _tmp34_;
- GtkExpander* _tmp35_;
+ GtkFileChooserDialog* _tmp28_;
+ GtkFileFilter* _tmp29_;
+ const gchar* _tmp30_ = NULL;
+ GtkExpander* _tmp31_;
GtkExpander* expander;
- GtkExpander* _tmp36_;
- GtkFileChooserDialog* _tmp37_;
- GtkExpander* _tmp38_;
- gchar* _tmp39_;
+ GtkExpander* _tmp32_;
+ GtkFileChooserDialog* _tmp33_;
+ GtkExpander* _tmp34_;
+ gchar* _tmp35_;
gchar* extension;
- const gchar* _tmp40_;
- gint _tmp41_ = 0;
+ const gchar* _tmp36_;
+ gint _tmp37_ = 0;
gint index;
- gint _tmp42_;
- GtkListStore* _tmp46_;
+ gint _tmp38_;
+ GtkListStore* _tmp42_;
GtkListStore* file_type_store;
GtkTreeIter iter = {0};
- GtkListStore* _tmp47_;
- GtkTreeIter _tmp48_ = {0};
- GtkListStore* _tmp49_;
- GtkTreeIter _tmp50_;
- const gchar* _tmp51_ = NULL;
- GtkListStore* _tmp52_;
- GtkTreeIter _tmp53_ = {0};
- GtkListStore* _tmp54_;
- GtkTreeIter _tmp55_;
- const gchar* _tmp56_ = NULL;
- GtkListStore* _tmp57_;
- GtkTreeIter _tmp58_ = {0};
- GtkListStore* _tmp59_;
- GtkTreeIter _tmp60_;
- const gchar* _tmp61_ = NULL;
- GtkListStore* _tmp62_;
- GtkTreeView* _tmp63_;
- GtkTreeView* _tmp64_;
+ GtkListStore* _tmp43_;
+ GtkTreeIter _tmp44_ = {0};
+ GtkListStore* _tmp45_;
+ GtkTreeIter _tmp46_;
+ const gchar* _tmp47_ = NULL;
+ GtkListStore* _tmp48_;
+ GtkTreeIter _tmp49_ = {0};
+ GtkListStore* _tmp50_;
+ GtkTreeIter _tmp51_;
+ const gchar* _tmp52_ = NULL;
+ GtkListStore* _tmp53_;
+ GtkTreeIter _tmp54_ = {0};
+ GtkListStore* _tmp55_;
+ GtkTreeIter _tmp56_;
+ const gchar* _tmp57_ = NULL;
+ GtkListStore* _tmp58_;
+ GtkTreeView* _tmp59_;
GtkTreeView* file_type_view;
- GtkTreeView* _tmp65_;
- GtkTreeView* _tmp66_;
- GtkCellRendererText* _tmp67_;
- GtkCellRendererText* _tmp68_;
- GtkTreeViewColumn* _tmp69_;
- GtkTreeViewColumn* _tmp70_;
- GtkTreeViewColumn* _tmp71_;
+ GtkTreeView* _tmp60_;
+ GtkTreeView* _tmp61_;
+ GtkCellRendererText* _tmp62_;
+ GtkCellRendererText* _tmp63_;
+ GtkTreeViewColumn* _tmp64_;
+ GtkTreeViewColumn* _tmp65_;
GtkTreeViewColumn* column;
- GtkTreeView* _tmp72_;
- GtkTreeViewColumn* _tmp73_;
- GtkExpander* _tmp74_;
- GtkTreeView* _tmp75_;
- GtkListStore* _tmp76_;
- GtkTreeIter _tmp77_ = {0};
- gboolean _tmp78_ = FALSE;
- GtkTreeView* _tmp90_;
- GtkTreeSelection* _tmp91_ = NULL;
- GtkExpander* _tmp92_;
- GtkFileChooserDialog* _tmp93_;
- gint _tmp94_ = 0;
+ GtkTreeView* _tmp66_;
+ GtkTreeViewColumn* _tmp67_;
+ GtkExpander* _tmp68_;
+ GtkTreeView* _tmp69_;
+ GtkListStore* _tmp70_;
+ GtkTreeIter _tmp71_ = {0};
+ gboolean _tmp72_ = FALSE;
+ GtkTreeView* _tmp84_;
+ GtkTreeSelection* _tmp85_ = NULL;
+ GtkExpander* _tmp86_;
+ GtkFileChooserDialog* _tmp87_;
+ gint _tmp88_ = 0;
gint response;
gchar* uri;
- gint _tmp95_;
- GSettings* _tmp98_;
+ gint _tmp89_;
+ GSettings* _tmp92_;
+ GtkFileChooserDialog* _tmp93_;
+ gchar* _tmp94_ = NULL;
+ gchar* _tmp95_;
+ GtkTreeView* _tmp96_;
+ GtkTreeSelection* _tmp97_ = NULL;
+ guint _tmp98_ = 0U;
GtkFileChooserDialog* _tmp99_;
- gchar* _tmp100_ = NULL;
- gchar* _tmp101_;
- GtkFileChooserDialog* _tmp102_;
g_return_val_if_fail (self != NULL, NULL);
directory = NULL;
_tmp0_ = self->priv->settings;
@@ -1427,182 +1362,187 @@ static gchar* user_interface_choose_file_location (UserInterface* self) {
_tmp8_ = _ ("Save As...");
_tmp9_ = self->priv->window;
_tmp10_ = (GtkFileChooserDialog*) gtk_file_chooser_dialog_new (_tmp8_, _tmp9_, GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL, NULL);
- _tmp11_ = g_object_ref_sink (_tmp10_);
+ g_object_ref_sink (_tmp10_);
_g_object_unref0 (self->priv->save_dialog);
- self->priv->save_dialog = _tmp11_;
+ self->priv->save_dialog = _tmp10_;
+ _tmp11_ = self->priv->save_dialog;
+ gtk_file_chooser_set_do_overwrite_confirmation ((GtkFileChooser*) _tmp11_, TRUE);
_tmp12_ = self->priv->save_dialog;
- gtk_file_chooser_set_do_overwrite_confirmation ((GtkFileChooser*) _tmp12_, TRUE);
+ gtk_file_chooser_set_local_only ((GtkFileChooser*) _tmp12_, FALSE);
_tmp13_ = self->priv->save_dialog;
- gtk_file_chooser_set_local_only ((GtkFileChooser*) _tmp13_, FALSE);
- _tmp14_ = self->priv->save_dialog;
- _tmp15_ = directory;
- gtk_file_chooser_set_current_folder ((GtkFileChooser*) _tmp14_, _tmp15_);
- _tmp16_ = self->priv->save_dialog;
- _tmp17_ = self->priv->default_file_name;
- gtk_file_chooser_set_current_name ((GtkFileChooser*) _tmp16_, _tmp17_);
- _tmp18_ = gtk_file_filter_new ();
- _tmp19_ = g_object_ref_sink (_tmp18_);
- filter = _tmp19_;
+ _tmp14_ = directory;
+ gtk_file_chooser_set_current_folder ((GtkFileChooser*) _tmp13_, _tmp14_);
+ _tmp15_ = self->priv->save_dialog;
+ _tmp16_ = self->priv->default_file_name;
+ gtk_file_chooser_set_current_name ((GtkFileChooser*) _tmp15_, _tmp16_);
+ _tmp17_ = gtk_file_filter_new ();
+ g_object_ref_sink (_tmp17_);
+ filter = _tmp17_;
+ _tmp18_ = filter;
+ _tmp19_ = _ ("Image Files");
+ gtk_file_filter_set_name (_tmp18_, _tmp19_);
_tmp20_ = filter;
- _tmp21_ = _ ("Image Files");
- gtk_file_filter_set_name (_tmp20_, _tmp21_);
- _tmp22_ = filter;
- gtk_file_filter_add_pixbuf_formats (_tmp22_);
+ gtk_file_filter_add_pixbuf_formats (_tmp20_);
+ _tmp21_ = filter;
+ gtk_file_filter_add_mime_type (_tmp21_, "application/pdf");
+ _tmp22_ = self->priv->save_dialog;
_tmp23_ = filter;
- gtk_file_filter_add_mime_type (_tmp23_, "application/pdf");
- _tmp24_ = self->priv->save_dialog;
- _tmp25_ = filter;
- gtk_file_chooser_add_filter ((GtkFileChooser*) _tmp24_, _tmp25_);
- _tmp26_ = gtk_file_filter_new ();
- _tmp27_ = g_object_ref_sink (_tmp26_);
+ gtk_file_chooser_add_filter ((GtkFileChooser*) _tmp22_, _tmp23_);
+ _tmp24_ = gtk_file_filter_new ();
+ g_object_ref_sink (_tmp24_);
_g_object_unref0 (filter);
- filter = _tmp27_;
- _tmp28_ = filter;
- _tmp29_ = _ ("All Files");
- gtk_file_filter_set_name (_tmp28_, _tmp29_);
- _tmp30_ = filter;
- gtk_file_filter_add_pattern (_tmp30_, "*");
- _tmp31_ = self->priv->save_dialog;
- _tmp32_ = filter;
- gtk_file_chooser_add_filter ((GtkFileChooser*) _tmp31_, _tmp32_);
- _tmp33_ = _ ("Select File _Type");
- _tmp34_ = (GtkExpander*) gtk_expander_new_with_mnemonic (_tmp33_);
- _tmp35_ = g_object_ref_sink (_tmp34_);
- expander = _tmp35_;
- _tmp36_ = expander;
- gtk_expander_set_spacing (_tmp36_, 5);
- _tmp37_ = self->priv->save_dialog;
- _tmp38_ = expander;
- gtk_file_chooser_set_extra_widget ((GtkFileChooser*) _tmp37_, (GtkWidget*) _tmp38_);
- _tmp39_ = g_strdup ("");
- extension = _tmp39_;
- _tmp40_ = self->priv->default_file_name;
- _tmp41_ = string_last_index_of_char (_tmp40_, (gunichar) '.', 0);
- index = _tmp41_;
- _tmp42_ = index;
- if (_tmp42_ >= 0) {
- const gchar* _tmp43_;
- gint _tmp44_;
- gchar* _tmp45_ = NULL;
- _tmp43_ = self->priv->default_file_name;
- _tmp44_ = index;
- _tmp45_ = string_slice (_tmp43_, (glong) 0, (glong) _tmp44_);
+ filter = _tmp24_;
+ _tmp25_ = filter;
+ _tmp26_ = _ ("All Files");
+ gtk_file_filter_set_name (_tmp25_, _tmp26_);
+ _tmp27_ = filter;
+ gtk_file_filter_add_pattern (_tmp27_, "*");
+ _tmp28_ = self->priv->save_dialog;
+ _tmp29_ = filter;
+ gtk_file_chooser_add_filter ((GtkFileChooser*) _tmp28_, _tmp29_);
+ _tmp30_ = _ ("Select File _Type");
+ _tmp31_ = (GtkExpander*) gtk_expander_new_with_mnemonic (_tmp30_);
+ g_object_ref_sink (_tmp31_);
+ expander = _tmp31_;
+ _tmp32_ = expander;
+ gtk_expander_set_spacing (_tmp32_, 5);
+ _tmp33_ = self->priv->save_dialog;
+ _tmp34_ = expander;
+ gtk_file_chooser_set_extra_widget ((GtkFileChooser*) _tmp33_, (GtkWidget*) _tmp34_);
+ _tmp35_ = g_strdup ("");
+ extension = _tmp35_;
+ _tmp36_ = self->priv->default_file_name;
+ _tmp37_ = string_last_index_of_char (_tmp36_, (gunichar) '.', 0);
+ index = _tmp37_;
+ _tmp38_ = index;
+ if (_tmp38_ >= 0) {
+ const gchar* _tmp39_;
+ gint _tmp40_;
+ gchar* _tmp41_ = NULL;
+ _tmp39_ = self->priv->default_file_name;
+ _tmp40_ = index;
+ _tmp41_ = string_slice (_tmp39_, (glong) 0, (glong) _tmp40_);
_g_free0 (extension);
- extension = _tmp45_;
- }
- _tmp46_ = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
- file_type_store = _tmp46_;
- _tmp47_ = file_type_store;
- gtk_list_store_append (_tmp47_, &_tmp48_);
- iter = _tmp48_;
- _tmp49_ = file_type_store;
- _tmp50_ = iter;
- _tmp51_ = _ ("PDF (multi-page document)");
- gtk_list_store_set (_tmp49_, &_tmp50_, 0, _tmp51_, 1, ".pdf", -1, -1);
- _tmp52_ = file_type_store;
- gtk_list_store_append (_tmp52_, &_tmp53_);
- iter = _tmp53_;
- _tmp54_ = file_type_store;
- _tmp55_ = iter;
- _tmp56_ = _ ("JPEG (compressed)");
- gtk_list_store_set (_tmp54_, &_tmp55_, 0, _tmp56_, 1, ".jpg", -1, -1);
- _tmp57_ = file_type_store;
- gtk_list_store_append (_tmp57_, &_tmp58_);
- iter = _tmp58_;
- _tmp59_ = file_type_store;
- _tmp60_ = iter;
- _tmp61_ = _ ("PNG (lossless)");
- gtk_list_store_set (_tmp59_, &_tmp60_, 0, _tmp61_, 1, ".png", -1, -1);
- _tmp62_ = file_type_store;
- _tmp63_ = (GtkTreeView*) gtk_tree_view_new_with_model ((GtkTreeModel*) _tmp62_);
- _tmp64_ = g_object_ref_sink (_tmp63_);
- file_type_view = _tmp64_;
- _tmp65_ = file_type_view;
- gtk_tree_view_set_headers_visible (_tmp65_, FALSE);
+ extension = _tmp41_;
+ }
+ _tmp42_ = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
+ file_type_store = _tmp42_;
+ _tmp43_ = file_type_store;
+ gtk_list_store_append (_tmp43_, &_tmp44_);
+ iter = _tmp44_;
+ _tmp45_ = file_type_store;
+ _tmp46_ = iter;
+ _tmp47_ = _ ("PDF (multi-page document)");
+ gtk_list_store_set (_tmp45_, &_tmp46_, 0, _tmp47_, 1, ".pdf", -1, -1);
+ _tmp48_ = file_type_store;
+ gtk_list_store_append (_tmp48_, &_tmp49_);
+ iter = _tmp49_;
+ _tmp50_ = file_type_store;
+ _tmp51_ = iter;
+ _tmp52_ = _ ("JPEG (compressed)");
+ gtk_list_store_set (_tmp50_, &_tmp51_, 0, _tmp52_, 1, ".jpg", -1, -1);
+ _tmp53_ = file_type_store;
+ gtk_list_store_append (_tmp53_, &_tmp54_);
+ iter = _tmp54_;
+ _tmp55_ = file_type_store;
+ _tmp56_ = iter;
+ _tmp57_ = _ ("PNG (lossless)");
+ gtk_list_store_set (_tmp55_, &_tmp56_, 0, _tmp57_, 1, ".png", -1, -1);
+ _tmp58_ = file_type_store;
+ _tmp59_ = (GtkTreeView*) gtk_tree_view_new_with_model ((GtkTreeModel*) _tmp58_);
+ g_object_ref_sink (_tmp59_);
+ file_type_view = _tmp59_;
+ _tmp60_ = file_type_view;
+ gtk_tree_view_set_headers_visible (_tmp60_, FALSE);
+ _tmp61_ = file_type_view;
+ gtk_tree_view_set_rules_hint (_tmp61_, TRUE);
+ _tmp62_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
+ g_object_ref_sink (_tmp62_);
+ _tmp63_ = _tmp62_;
+ _tmp64_ = gtk_tree_view_column_new_with_attributes ("", (GtkCellRenderer*) _tmp63_, "text", 0, NULL, NULL);
+ g_object_ref_sink (_tmp64_);
+ _tmp65_ = _tmp64_;
+ _g_object_unref0 (_tmp63_);
+ column = _tmp65_;
_tmp66_ = file_type_view;
- gtk_tree_view_set_rules_hint (_tmp66_, TRUE);
- _tmp67_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
- _tmp68_ = g_object_ref_sink (_tmp67_);
- _tmp69_ = gtk_tree_view_column_new_with_attributes ("", (GtkCellRenderer*) _tmp68_, "text", 0, NULL, NULL);
- _tmp70_ = g_object_ref_sink (_tmp69_);
- _tmp71_ = _tmp70_;
- _g_object_unref0 (_tmp68_);
- column = _tmp71_;
- _tmp72_ = file_type_view;
- _tmp73_ = column;
- gtk_tree_view_append_column (_tmp72_, _tmp73_);
- _tmp74_ = expander;
- _tmp75_ = file_type_view;
- gtk_container_add ((GtkContainer*) _tmp74_, (GtkWidget*) _tmp75_);
- _tmp76_ = file_type_store;
- _tmp78_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) _tmp76_, &_tmp77_);
- iter = _tmp77_;
- if (_tmp78_) {
+ _tmp67_ = column;
+ gtk_tree_view_append_column (_tmp66_, _tmp67_);
+ _tmp68_ = expander;
+ _tmp69_ = file_type_view;
+ gtk_container_add ((GtkContainer*) _tmp68_, (GtkWidget*) _tmp69_);
+ _tmp70_ = file_type_store;
+ _tmp72_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) _tmp70_, &_tmp71_);
+ iter = _tmp71_;
+ if (_tmp72_) {
{
- gboolean _tmp79_;
- _tmp79_ = TRUE;
+ gboolean _tmp73_;
+ _tmp73_ = TRUE;
while (TRUE) {
- gboolean _tmp80_;
+ gboolean _tmp74_;
gchar* e = NULL;
- GtkListStore* _tmp83_;
- GtkTreeIter _tmp84_;
- const gchar* _tmp85_;
- const gchar* _tmp86_;
- _tmp80_ = _tmp79_;
- if (!_tmp80_) {
- GtkListStore* _tmp81_;
- gboolean _tmp82_ = FALSE;
- _tmp81_ = file_type_store;
- _tmp82_ = gtk_tree_model_iter_next ((GtkTreeModel*) _tmp81_, &iter);
- if (!_tmp82_) {
+ GtkListStore* _tmp77_;
+ GtkTreeIter _tmp78_;
+ const gchar* _tmp79_;
+ const gchar* _tmp80_;
+ _tmp74_ = _tmp73_;
+ if (!_tmp74_) {
+ GtkListStore* _tmp75_;
+ gboolean _tmp76_ = FALSE;
+ _tmp75_ = file_type_store;
+ _tmp76_ = gtk_tree_model_iter_next ((GtkTreeModel*) _tmp75_, &iter);
+ if (!_tmp76_) {
break;
}
}
- _tmp79_ = FALSE;
- _tmp83_ = file_type_store;
- _tmp84_ = iter;
- gtk_tree_model_get ((GtkTreeModel*) _tmp83_, &_tmp84_, 1, &e, -1, -1);
- _tmp85_ = extension;
- _tmp86_ = e;
- if (g_strcmp0 (_tmp85_, _tmp86_) == 0) {
- GtkTreeView* _tmp87_;
- GtkTreeSelection* _tmp88_ = NULL;
- GtkTreeIter _tmp89_;
- _tmp87_ = file_type_view;
- _tmp88_ = gtk_tree_view_get_selection (_tmp87_);
- _tmp89_ = iter;
- gtk_tree_selection_select_iter (_tmp88_, &_tmp89_);
+ _tmp73_ = FALSE;
+ _tmp77_ = file_type_store;
+ _tmp78_ = iter;
+ gtk_tree_model_get ((GtkTreeModel*) _tmp77_, &_tmp78_, 1, &e, -1, -1);
+ _tmp79_ = extension;
+ _tmp80_ = e;
+ if (g_strcmp0 (_tmp79_, _tmp80_) == 0) {
+ GtkTreeView* _tmp81_;
+ GtkTreeSelection* _tmp82_ = NULL;
+ GtkTreeIter _tmp83_;
+ _tmp81_ = file_type_view;
+ _tmp82_ = gtk_tree_view_get_selection (_tmp81_);
+ _tmp83_ = iter;
+ gtk_tree_selection_select_iter (_tmp82_, &_tmp83_);
}
_g_free0 (e);
}
}
}
- _tmp90_ = file_type_view;
- _tmp91_ = gtk_tree_view_get_selection (_tmp90_);
- g_signal_connect (_tmp91_, "changed", (GCallback) _user_interface_on_file_type_changed_gtk_tree_selection_changed, self);
- _tmp92_ = expander;
- gtk_widget_show_all ((GtkWidget*) _tmp92_);
- _tmp93_ = self->priv->save_dialog;
- _tmp94_ = gtk_dialog_run ((GtkDialog*) _tmp93_);
- response = _tmp94_;
+ _tmp84_ = file_type_view;
+ _tmp85_ = gtk_tree_view_get_selection (_tmp84_);
+ g_signal_connect (_tmp85_, "changed", (GCallback) _user_interface_on_file_type_changed_gtk_tree_selection_changed, self);
+ _tmp86_ = expander;
+ gtk_widget_show_all ((GtkWidget*) _tmp86_);
+ _tmp87_ = self->priv->save_dialog;
+ _tmp88_ = gtk_dialog_run ((GtkDialog*) _tmp87_);
+ response = _tmp88_;
uri = NULL;
- _tmp95_ = response;
- if (_tmp95_ == ((gint) GTK_RESPONSE_ACCEPT)) {
- GtkFileChooserDialog* _tmp96_;
- gchar* _tmp97_ = NULL;
- _tmp96_ = self->priv->save_dialog;
- _tmp97_ = gtk_file_chooser_get_uri ((GtkFileChooser*) _tmp96_);
+ _tmp89_ = response;
+ if (_tmp89_ == ((gint) GTK_RESPONSE_ACCEPT)) {
+ GtkFileChooserDialog* _tmp90_;
+ gchar* _tmp91_ = NULL;
+ _tmp90_ = self->priv->save_dialog;
+ _tmp91_ = gtk_file_chooser_get_uri ((GtkFileChooser*) _tmp90_);
_g_free0 (uri);
- uri = _tmp97_;
+ uri = _tmp91_;
}
- _tmp98_ = self->priv->settings;
+ _tmp92_ = self->priv->settings;
+ _tmp93_ = self->priv->save_dialog;
+ _tmp94_ = gtk_file_chooser_get_current_folder ((GtkFileChooser*) _tmp93_);
+ _tmp95_ = _tmp94_;
+ g_settings_set_string (_tmp92_, "save-directory", _tmp95_);
+ _g_free0 (_tmp95_);
+ _tmp96_ = file_type_view;
+ _tmp97_ = gtk_tree_view_get_selection (_tmp96_);
+ g_signal_parse_name ("changed", GTK_TYPE_TREE_SELECTION, &_tmp98_, NULL, FALSE);
+ g_signal_handlers_disconnect_matched (_tmp97_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp98_, 0, NULL, (GCallback) _user_interface_on_file_type_changed_gtk_tree_selection_changed, self);
_tmp99_ = self->priv->save_dialog;
- _tmp100_ = gtk_file_chooser_get_current_folder ((GtkFileChooser*) _tmp99_);
- _tmp101_ = _tmp100_;
- g_settings_set_string (_tmp98_, "save-directory", _tmp101_);
- _g_free0 (_tmp101_);
- _tmp102_ = self->priv->save_dialog;
- gtk_widget_destroy ((GtkWidget*) _tmp102_);
+ gtk_widget_destroy ((GtkWidget*) _tmp99_);
_g_object_unref0 (self->priv->save_dialog);
self->priv->save_dialog = NULL;
result = uri;
@@ -1672,7 +1612,7 @@ static gboolean user_interface_save_document (UserInterface* self, gboolean forc
_tmp9_ = g_file_new_for_uri (_tmp8_);
file = _tmp9_;
_tmp10_ = uri;
- g_debug ("ui.vala:446: Saving to '%s'", _tmp10_);
+ g_debug ("ui.vala:452: Saving to '%s'", _tmp10_);
_tmp11_ = uri;
_tmp12_ = g_utf8_strdown (_tmp11_, (gssize) (-1));
uri_lower = _tmp12_;
@@ -1758,7 +1698,7 @@ static gboolean user_interface_save_document (UserInterface* self, gboolean forc
user_interface_hide_progress_dialog (self);
_tmp33_ = e;
_tmp34_ = _tmp33_->message;
- g_warning ("ui.vala:467: Error saving file: %s", _tmp34_);
+ g_warning ("ui.vala:473: Error saving file: %s", _tmp34_);
_tmp35_ = _ ("Failed to save file");
_tmp36_ = e;
_tmp37_ = _tmp36_->message;
@@ -1803,19 +1743,18 @@ static gboolean user_interface_prompt_to_save (UserInterface* self, const gchar*
GtkWindow* _tmp2_;
const gchar* _tmp3_;
GtkMessageDialog* _tmp4_;
- GtkMessageDialog* _tmp5_;
GtkMessageDialog* dialog;
- GtkMessageDialog* _tmp6_;
- const gchar* _tmp7_ = NULL;
- GtkMessageDialog* _tmp8_;
- const gchar* _tmp9_;
+ GtkMessageDialog* _tmp5_;
+ const gchar* _tmp6_ = NULL;
+ GtkMessageDialog* _tmp7_;
+ const gchar* _tmp8_;
+ GtkMessageDialog* _tmp9_;
GtkMessageDialog* _tmp10_;
GtkMessageDialog* _tmp11_;
- GtkMessageDialog* _tmp12_;
- gint _tmp13_ = 0;
+ gint _tmp12_ = 0;
gint response;
- GtkMessageDialog* _tmp14_;
- gint _tmp15_;
+ GtkMessageDialog* _tmp13_;
+ gint _tmp14_;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (title != NULL, FALSE);
g_return_val_if_fail (discard_label != NULL, FALSE);
@@ -1828,30 +1767,30 @@ static gboolean user_interface_prompt_to_save (UserInterface* self, const gchar*
_tmp2_ = self->priv->window;
_tmp3_ = title;
_tmp4_ = (GtkMessageDialog*) gtk_message_dialog_new (_tmp2_, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE, "%s", _tmp3_);
- _tmp5_ = g_object_ref_sink (_tmp4_);
- dialog = _tmp5_;
- _tmp6_ = dialog;
- _tmp7_ = _ ("If you don't save, changes will be permanently lost.");
- gtk_message_dialog_format_secondary_text (_tmp6_, "%s", _tmp7_);
- _tmp8_ = dialog;
- _tmp9_ = discard_label;
- gtk_dialog_add_button ((GtkDialog*) _tmp8_, _tmp9_, (gint) GTK_RESPONSE_NO);
+ g_object_ref_sink (_tmp4_);
+ dialog = _tmp4_;
+ _tmp5_ = dialog;
+ _tmp6_ = _ ("If you don't save, changes will be permanently lost.");
+ gtk_message_dialog_format_secondary_text (_tmp5_, "%s", _tmp6_);
+ _tmp7_ = dialog;
+ _tmp8_ = discard_label;
+ gtk_dialog_add_button ((GtkDialog*) _tmp7_, _tmp8_, (gint) GTK_RESPONSE_NO);
+ _tmp9_ = dialog;
+ gtk_dialog_add_button ((GtkDialog*) _tmp9_, GTK_STOCK_CANCEL, (gint) GTK_RESPONSE_CANCEL);
_tmp10_ = dialog;
- gtk_dialog_add_button ((GtkDialog*) _tmp10_, GTK_STOCK_CANCEL, (gint) GTK_RESPONSE_CANCEL);
+ gtk_dialog_add_button ((GtkDialog*) _tmp10_, GTK_STOCK_SAVE, (gint) GTK_RESPONSE_YES);
_tmp11_ = dialog;
- gtk_dialog_add_button ((GtkDialog*) _tmp11_, GTK_STOCK_SAVE, (gint) GTK_RESPONSE_YES);
- _tmp12_ = dialog;
- _tmp13_ = gtk_dialog_run ((GtkDialog*) _tmp12_);
- response = _tmp13_;
- _tmp14_ = dialog;
- gtk_widget_destroy ((GtkWidget*) _tmp14_);
- _tmp15_ = response;
- switch (_tmp15_) {
+ _tmp12_ = gtk_dialog_run ((GtkDialog*) _tmp11_);
+ response = _tmp12_;
+ _tmp13_ = dialog;
+ gtk_widget_destroy ((GtkWidget*) _tmp13_);
+ _tmp14_ = response;
+ switch (_tmp14_) {
case GTK_RESPONSE_YES:
{
- gboolean _tmp16_ = FALSE;
- _tmp16_ = user_interface_save_document (self, FALSE);
- if (_tmp16_) {
+ gboolean _tmp15_ = FALSE;
+ _tmp15_ = user_interface_save_document (self, FALSE);
+ if (_tmp15_) {
result = TRUE;
_g_object_unref0 (dialog);
return result;
@@ -1900,6 +1839,7 @@ void G_MODULE_EXPORT new_button_clicked_cb (GtkWidget* widget, UserInterface* se
const gchar* _tmp0_ = NULL;
const gchar* _tmp1_ = NULL;
gboolean _tmp2_ = FALSE;
+ gboolean _tmp3_;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
_tmp0_ = _ ("Save current document?");
@@ -1908,6 +1848,10 @@ void G_MODULE_EXPORT new_button_clicked_cb (GtkWidget* widget, UserInterface* se
if (!_tmp2_) {
return;
}
+ _tmp3_ = self->priv->scanning;
+ if (_tmp3_) {
+ g_signal_emit_by_name (self, "stop-scan");
+ }
user_interface_clear_document (self);
}
@@ -2501,13 +2445,13 @@ static void user_interface_page_selected_cb (UserInterface* self, BookView* view
_tmp20_ = self->priv->builder;
_tmp21_ = name;
_tmp22_ = gtk_builder_get_object (_tmp20_, _tmp21_);
- _tmp23_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp22_));
+ _tmp23_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, GTK_TYPE_RADIO_MENU_ITEM, GtkRadioMenuItem));
menuitem = _tmp23_;
_tmp24_ = menuitem;
gtk_check_menu_item_set_active ((GtkCheckMenuItem*) _tmp24_, TRUE);
_tmp25_ = self->priv->builder;
_tmp26_ = gtk_builder_get_object (_tmp25_, "crop_toolbutton");
- _tmp27_ = _g_object_ref0 (GTK_TOGGLE_TOOL_BUTTON (_tmp26_));
+ _tmp27_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, GTK_TYPE_TOGGLE_TOOL_BUTTON, GtkToggleToolButton));
toolbutton = _tmp27_;
_tmp28_ = toolbutton;
_tmp29_ = page;
@@ -2634,7 +2578,7 @@ static void user_interface_show_page_menu_cb (UserInterface* self, BookView* vie
g_return_if_fail (view != NULL);
_tmp0_ = self->priv->builder;
_tmp1_ = gtk_builder_get_object (_tmp0_, "page_menu");
- _tmp2_ = _g_object_ref0 (GTK_MENU (_tmp1_));
+ _tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GTK_TYPE_MENU, GtkMenu));
menu = _tmp2_;
_tmp3_ = gtk_get_current_event_time ();
gtk_menu_popup (menu, NULL, NULL, NULL, NULL, (guint) 3, _tmp3_);
@@ -2824,7 +2768,7 @@ void G_MODULE_EXPORT crop_toolbutton_toggled_cb (GtkToggleToolButton* widget, Us
GtkRadioMenuItem* _tmp5_;
_tmp3_ = self->priv->builder;
_tmp4_ = gtk_builder_get_object (_tmp3_, "custom_crop_menuitem");
- _tmp5_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp4_));
+ _tmp5_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GTK_TYPE_RADIO_MENU_ITEM, GtkRadioMenuItem));
_g_object_unref0 (menuitem);
menuitem = _tmp5_;
} else {
@@ -2833,7 +2777,7 @@ void G_MODULE_EXPORT crop_toolbutton_toggled_cb (GtkToggleToolButton* widget, Us
GtkRadioMenuItem* _tmp8_;
_tmp6_ = self->priv->builder;
_tmp7_ = gtk_builder_get_object (_tmp6_, "no_crop_menuitem");
- _tmp8_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp7_));
+ _tmp8_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GTK_TYPE_RADIO_MENU_ITEM, GtkRadioMenuItem));
_g_object_unref0 (menuitem);
menuitem = _tmp8_;
}
@@ -3164,6 +3108,7 @@ void G_MODULE_EXPORT print_button_clicked_cb (GtkWidget* widget, UserInterface*
GtkPrintOperation* print;
Book* _tmp1_;
guint _tmp2_ = 0U;
+ guint _tmp6_ = 0U;
GError * _inner_error_ = NULL;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
@@ -3191,7 +3136,7 @@ void G_MODULE_EXPORT print_button_clicked_cb (GtkWidget* widget, UserInterface*
_inner_error_ = NULL;
_tmp4_ = e;
_tmp5_ = _tmp4_->message;
- g_warning ("ui.vala:1026: Error printing: %s", _tmp5_);
+ g_warning ("ui.vala:1034: Error printing: %s", _tmp5_);
_g_error_free0 (e);
}
__finally18:
@@ -3201,6 +3146,8 @@ void G_MODULE_EXPORT print_button_clicked_cb (GtkWidget* widget, UserInterface*
g_clear_error (&_inner_error_);
return;
}
+ g_signal_parse_name ("draw-page", GTK_TYPE_PRINT_OPERATION, &_tmp6_, NULL, FALSE);
+ g_signal_handlers_disconnect_matched (print, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp6_, 0, NULL, (GCallback) _user_interface_draw_page_gtk_print_operation_draw_page, self);
_g_object_unref0 (print);
}
@@ -3573,14 +3520,24 @@ static void user_interface_page_added_cb (UserInterface* self, Book* book, Page*
static void user_interface_page_removed_cb (UserInterface* self, Book* book, Page* page) {
- Book* _tmp0_;
+ Page* _tmp0_;
guint _tmp1_ = 0U;
+ Page* _tmp2_;
+ guint _tmp3_ = 0U;
+ Book* _tmp4_;
+ guint _tmp5_ = 0U;
g_return_if_fail (self != NULL);
g_return_if_fail (book != NULL);
g_return_if_fail (page != NULL);
- _tmp0_ = book;
- _tmp1_ = book_get_n_pages (_tmp0_);
- if (_tmp1_ == ((guint) 1)) {
+ _tmp0_ = page;
+ g_signal_parse_name ("size-changed", TYPE_PAGE, &_tmp1_, NULL, FALSE);
+ g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _user_interface_page_size_changed_cb_page_size_changed, self);
+ _tmp2_ = page;
+ g_signal_parse_name ("scan-direction-changed", TYPE_PAGE, &_tmp3_, NULL, FALSE);
+ g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _user_interface_page_scan_direction_changed_cb_page_scan_direction_changed, self);
+ _tmp4_ = book;
+ _tmp5_ = book_get_n_pages (_tmp4_);
+ if (_tmp5_ == ((guint) 1)) {
user_interface_add_default_page (self);
}
user_interface_update_page_menu (self);
@@ -3589,135 +3546,134 @@ static void user_interface_page_removed_cb (UserInterface* self, Book* book, Pag
static void user_interface_set_dpi_combo (UserInterface* self, GtkComboBox* combo, gint default_dpi, gint current_dpi) {
GtkCellRendererText* _tmp0_;
- GtkCellRendererText* _tmp1_;
GtkCellRendererText* renderer;
- GtkComboBox* _tmp2_;
- GtkCellRendererText* _tmp3_;
- GtkComboBox* _tmp4_;
- GtkCellRendererText* _tmp5_;
- GtkComboBox* _tmp6_;
- GtkTreeModel* _tmp7_ = NULL;
- GtkListStore* _tmp8_;
+ GtkComboBox* _tmp1_;
+ GtkCellRendererText* _tmp2_;
+ GtkComboBox* _tmp3_;
+ GtkCellRendererText* _tmp4_;
+ GtkComboBox* _tmp5_;
+ GtkTreeModel* _tmp6_ = NULL;
+ GtkListStore* _tmp7_;
GtkListStore* model;
- gint* _tmp9_ = NULL;
+ gint* _tmp8_ = NULL;
gint* scan_resolutions;
gint scan_resolutions_length1;
gint _scan_resolutions_size_;
- gint* _tmp10_;
- gint _tmp10__length1;
+ gint* _tmp9_;
+ gint _tmp9__length1;
g_return_if_fail (self != NULL);
g_return_if_fail (combo != NULL);
_tmp0_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
- _tmp1_ = g_object_ref_sink (_tmp0_);
- renderer = _tmp1_;
- _tmp2_ = combo;
- _tmp3_ = renderer;
- gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp2_, (GtkCellRenderer*) _tmp3_, TRUE);
- _tmp4_ = combo;
- _tmp5_ = renderer;
- gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp4_, (GtkCellRenderer*) _tmp5_, "text", 1);
- _tmp6_ = combo;
- _tmp7_ = gtk_combo_box_get_model (_tmp6_);
- _tmp8_ = _g_object_ref0 (GTK_LIST_STORE (_tmp7_));
- model = _tmp8_;
- _tmp9_ = g_new0 (gint, 6);
- _tmp9_[0] = 75;
- _tmp9_[1] = 150;
- _tmp9_[2] = 300;
- _tmp9_[3] = 600;
- _tmp9_[4] = 1200;
- _tmp9_[5] = 2400;
- scan_resolutions = _tmp9_;
+ g_object_ref_sink (_tmp0_);
+ renderer = _tmp0_;
+ _tmp1_ = combo;
+ _tmp2_ = renderer;
+ gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp1_, (GtkCellRenderer*) _tmp2_, TRUE);
+ _tmp3_ = combo;
+ _tmp4_ = renderer;
+ gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp3_, (GtkCellRenderer*) _tmp4_, "text", 1);
+ _tmp5_ = combo;
+ _tmp6_ = gtk_combo_box_get_model (_tmp5_);
+ _tmp7_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GTK_TYPE_LIST_STORE, GtkListStore));
+ model = _tmp7_;
+ _tmp8_ = g_new0 (gint, 6);
+ _tmp8_[0] = 75;
+ _tmp8_[1] = 150;
+ _tmp8_[2] = 300;
+ _tmp8_[3] = 600;
+ _tmp8_[4] = 1200;
+ _tmp8_[5] = 2400;
+ scan_resolutions = _tmp8_;
scan_resolutions_length1 = 6;
_scan_resolutions_size_ = scan_resolutions_length1;
- _tmp10_ = scan_resolutions;
- _tmp10__length1 = scan_resolutions_length1;
+ _tmp9_ = scan_resolutions;
+ _tmp9__length1 = scan_resolutions_length1;
{
gint* dpi_collection = NULL;
gint dpi_collection_length1 = 0;
gint _dpi_collection_size_ = 0;
gint dpi_it = 0;
- dpi_collection = _tmp10_;
- dpi_collection_length1 = _tmp10__length1;
- for (dpi_it = 0; dpi_it < _tmp10__length1; dpi_it = dpi_it + 1) {
+ dpi_collection = _tmp9_;
+ dpi_collection_length1 = _tmp9__length1;
+ for (dpi_it = 0; dpi_it < _tmp9__length1; dpi_it = dpi_it + 1) {
gint dpi = 0;
dpi = dpi_collection[dpi_it];
{
gchar* label = NULL;
+ gint _tmp10_;
gint _tmp11_;
- gint _tmp12_;
GtkTreeIter iter = {0};
- GtkListStore* _tmp27_;
- GtkTreeIter _tmp28_ = {0};
- GtkListStore* _tmp29_;
- GtkTreeIter _tmp30_;
- gint _tmp31_;
- const gchar* _tmp32_;
+ GtkListStore* _tmp26_;
+ GtkTreeIter _tmp27_ = {0};
+ GtkListStore* _tmp28_;
+ GtkTreeIter _tmp29_;
+ gint _tmp30_;
+ const gchar* _tmp31_;
+ gint _tmp32_;
gint _tmp33_;
- gint _tmp34_;
- _tmp11_ = dpi;
- _tmp12_ = default_dpi;
- if (_tmp11_ == _tmp12_) {
- const gchar* _tmp13_ = NULL;
- gint _tmp14_;
- gchar* _tmp15_ = NULL;
- _tmp13_ = _ ("%d dpi (default)");
- _tmp14_ = dpi;
- _tmp15_ = g_strdup_printf (_tmp13_, _tmp14_);
+ _tmp10_ = dpi;
+ _tmp11_ = default_dpi;
+ if (_tmp10_ == _tmp11_) {
+ const gchar* _tmp12_ = NULL;
+ gint _tmp13_;
+ gchar* _tmp14_ = NULL;
+ _tmp12_ = _ ("%d dpi (default)");
+ _tmp13_ = dpi;
+ _tmp14_ = g_strdup_printf (_tmp12_, _tmp13_);
_g_free0 (label);
- label = _tmp15_;
+ label = _tmp14_;
} else {
- gint _tmp16_;
- _tmp16_ = dpi;
- if (_tmp16_ == 75) {
- const gchar* _tmp17_ = NULL;
- gint _tmp18_;
- gchar* _tmp19_ = NULL;
- _tmp17_ = _ ("%d dpi (draft)");
- _tmp18_ = dpi;
- _tmp19_ = g_strdup_printf (_tmp17_, _tmp18_);
+ gint _tmp15_;
+ _tmp15_ = dpi;
+ if (_tmp15_ == 75) {
+ const gchar* _tmp16_ = NULL;
+ gint _tmp17_;
+ gchar* _tmp18_ = NULL;
+ _tmp16_ = _ ("%d dpi (draft)");
+ _tmp17_ = dpi;
+ _tmp18_ = g_strdup_printf (_tmp16_, _tmp17_);
_g_free0 (label);
- label = _tmp19_;
+ label = _tmp18_;
} else {
- gint _tmp20_;
- _tmp20_ = dpi;
- if (_tmp20_ == 1200) {
- const gchar* _tmp21_ = NULL;
- gint _tmp22_;
- gchar* _tmp23_ = NULL;
- _tmp21_ = _ ("%d dpi (high resolution)");
- _tmp22_ = dpi;
- _tmp23_ = g_strdup_printf (_tmp21_, _tmp22_);
+ gint _tmp19_;
+ _tmp19_ = dpi;
+ if (_tmp19_ == 1200) {
+ const gchar* _tmp20_ = NULL;
+ gint _tmp21_;
+ gchar* _tmp22_ = NULL;
+ _tmp20_ = _ ("%d dpi (high resolution)");
+ _tmp21_ = dpi;
+ _tmp22_ = g_strdup_printf (_tmp20_, _tmp21_);
_g_free0 (label);
- label = _tmp23_;
+ label = _tmp22_;
} else {
- const gchar* _tmp24_ = NULL;
- gint _tmp25_;
- gchar* _tmp26_ = NULL;
- _tmp24_ = _ ("%d dpi");
- _tmp25_ = dpi;
- _tmp26_ = g_strdup_printf (_tmp24_, _tmp25_);
+ const gchar* _tmp23_ = NULL;
+ gint _tmp24_;
+ gchar* _tmp25_ = NULL;
+ _tmp23_ = _ ("%d dpi");
+ _tmp24_ = dpi;
+ _tmp25_ = g_strdup_printf (_tmp23_, _tmp24_);
_g_free0 (label);
- label = _tmp26_;
+ label = _tmp25_;
}
}
}
- _tmp27_ = model;
- gtk_list_store_append (_tmp27_, &_tmp28_);
- iter = _tmp28_;
- _tmp29_ = model;
- _tmp30_ = iter;
- _tmp31_ = dpi;
- _tmp32_ = label;
- gtk_list_store_set (_tmp29_, &_tmp30_, 0, _tmp31_, 1, _tmp32_, -1, -1);
- _tmp33_ = dpi;
- _tmp34_ = current_dpi;
- if (_tmp33_ == _tmp34_) {
- GtkComboBox* _tmp35_;
- GtkTreeIter _tmp36_;
- _tmp35_ = combo;
- _tmp36_ = iter;
- gtk_combo_box_set_active_iter (_tmp35_, &_tmp36_);
+ _tmp26_ = model;
+ gtk_list_store_append (_tmp26_, &_tmp27_);
+ iter = _tmp27_;
+ _tmp28_ = model;
+ _tmp29_ = iter;
+ _tmp30_ = dpi;
+ _tmp31_ = label;
+ gtk_list_store_set (_tmp28_, &_tmp29_, 0, _tmp30_, 1, _tmp31_, -1, -1);
+ _tmp32_ = dpi;
+ _tmp33_ = current_dpi;
+ if (_tmp32_ == _tmp33_) {
+ GtkComboBox* _tmp34_;
+ GtkTreeIter _tmp35_;
+ _tmp34_ = combo;
+ _tmp35_ = iter;
+ gtk_combo_box_set_active_iter (_tmp34_, &_tmp35_);
}
_g_free0 (label);
}
@@ -3891,43 +3847,43 @@ static void user_interface_load (UserInterface* self) {
GtkListStore* _tmp102_;
GtkInfoBar* _tmp103_;
GtkInfoBar* _tmp104_;
- GtkInfoBar* _tmp105_;
- GtkVBox* _tmp106_;
- GtkInfoBar* _tmp107_;
- GtkBox* _tmp108_;
- GtkBox* _tmp109_;
+ GtkVBox* _tmp105_;
+ GtkInfoBar* _tmp106_;
+ GtkBox* _tmp107_;
GtkBox* hbox;
- GtkInfoBar* _tmp110_;
- GtkWidget* _tmp111_ = NULL;
- GtkContainer* _tmp112_;
+ GtkInfoBar* _tmp108_;
+ GtkWidget* _tmp109_ = NULL;
+ GtkContainer* _tmp110_;
GtkContainer* content_area;
- GtkContainer* _tmp113_;
- GtkBox* _tmp114_;
+ GtkContainer* _tmp111_;
+ GtkBox* _tmp112_;
+ GtkBox* _tmp113_;
+ GtkImage* _tmp114_;
GtkBox* _tmp115_;
GtkImage* _tmp116_;
GtkImage* _tmp117_;
- GtkBox* _tmp118_;
- GtkImage* _tmp119_;
- GtkImage* _tmp120_;
+ GtkLabel* _tmp118_;
+ GtkLabel* _tmp119_;
+ GtkBox* _tmp120_;
GtkLabel* _tmp121_;
GtkLabel* _tmp122_;
- GtkLabel* _tmp123_;
- GtkBox* _tmp124_;
- GtkLabel* _tmp125_;
- GtkLabel* _tmp126_;
- GtkInfoBar* _tmp127_;
+ GtkInfoBar* _tmp123_;
+ GtkWidget* _tmp124_ = NULL;
+ GtkButton* _tmp125_;
+ GtkInfoBar* _tmp126_;
+ const gchar* _tmp127_ = NULL;
GtkWidget* _tmp128_ = NULL;
GtkButton* _tmp129_;
- GtkInfoBar* _tmp130_;
- const gchar* _tmp131_ = NULL;
- GtkWidget* _tmp132_ = NULL;
- GtkButton* _tmp133_;
GtkTreeIter iter = {0};
- GtkListStore* _tmp134_;
- GtkTreeIter _tmp135_ = {0};
- GtkListStore* _tmp136_;
- GtkTreeIter _tmp137_;
- const gchar* _tmp138_ = NULL;
+ GtkListStore* _tmp130_;
+ GtkTreeIter _tmp131_ = {0};
+ GtkListStore* _tmp132_;
+ GtkTreeIter _tmp133_;
+ const gchar* _tmp134_ = NULL;
+ GtkListStore* _tmp135_;
+ GtkTreeIter _tmp136_ = {0};
+ GtkListStore* _tmp137_;
+ GtkTreeIter _tmp138_;
GtkListStore* _tmp139_;
GtkTreeIter _tmp140_ = {0};
GtkListStore* _tmp141_;
@@ -3948,104 +3904,93 @@ static void user_interface_load (UserInterface* self) {
GtkTreeIter _tmp156_ = {0};
GtkListStore* _tmp157_;
GtkTreeIter _tmp158_;
- GtkListStore* _tmp159_;
- GtkTreeIter _tmp160_ = {0};
- GtkListStore* _tmp161_;
- GtkTreeIter _tmp162_;
- GSettings* _tmp163_;
- gint _tmp164_ = 0;
+ GSettings* _tmp159_;
+ gint _tmp160_ = 0;
gint dpi;
- gint _tmp165_;
- GtkComboBox* _tmp166_;
- gint _tmp167_;
- GSettings* _tmp168_;
- gint _tmp169_ = 0;
- gint _tmp170_;
- GtkComboBox* _tmp171_;
- gint _tmp172_;
+ gint _tmp161_;
+ GtkComboBox* _tmp162_;
+ gint _tmp163_;
+ GSettings* _tmp164_;
+ gint _tmp165_ = 0;
+ gint _tmp166_;
+ GtkComboBox* _tmp167_;
+ gint _tmp168_;
+ GtkCellRendererText* _tmp169_;
+ GtkCellRendererText* renderer;
+ GtkComboBox* _tmp170_;
+ GtkCellRendererText* _tmp171_;
+ GtkComboBox* _tmp172_;
GtkCellRendererText* _tmp173_;
GtkCellRendererText* _tmp174_;
- GtkCellRendererText* renderer;
GtkComboBox* _tmp175_;
GtkCellRendererText* _tmp176_;
GtkComboBox* _tmp177_;
GtkCellRendererText* _tmp178_;
- GtkCellRendererText* _tmp179_;
- GtkCellRendererText* _tmp180_;
- GtkComboBox* _tmp181_;
- GtkCellRendererText* _tmp182_;
- GtkComboBox* _tmp183_;
- GtkCellRendererText* _tmp184_;
- GSettings* _tmp185_;
- gint _tmp186_ = 0;
- GtkCellRendererText* _tmp187_;
- GtkCellRendererText* _tmp188_;
- GtkComboBox* _tmp189_;
- GtkCellRendererText* _tmp190_;
- GtkComboBox* _tmp191_;
- GtkCellRendererText* _tmp192_;
- GSettings* _tmp193_;
- gint _tmp194_ = 0;
+ GSettings* _tmp179_;
+ gint _tmp180_ = 0;
+ GtkCellRendererText* _tmp181_;
+ GtkComboBox* _tmp182_;
+ GtkCellRendererText* _tmp183_;
+ GtkComboBox* _tmp184_;
+ GtkCellRendererText* _tmp185_;
+ GSettings* _tmp186_;
+ gint _tmp187_ = 0;
gint paper_width;
- GSettings* _tmp195_;
- gint _tmp196_ = 0;
+ GSettings* _tmp188_;
+ gint _tmp189_ = 0;
gint paper_height;
- gint _tmp197_;
- gint _tmp198_;
- GSettings* _tmp199_;
- gchar* _tmp200_ = NULL;
+ gint _tmp190_;
+ gint _tmp191_;
+ GSettings* _tmp192_;
+ gchar* _tmp193_ = NULL;
gchar* device;
- const gchar* _tmp201_;
- GSettings* _tmp207_;
- gchar* _tmp208_ = NULL;
+ const gchar* _tmp194_;
+ GSettings* _tmp200_;
+ gchar* _tmp201_ = NULL;
gchar* document_type;
- const gchar* _tmp209_;
- Book* _tmp211_;
+ const gchar* _tmp202_;
+ Book* _tmp204_;
+ BookView* _tmp205_;
+ BookView* _tmp206_;
+ GtkVBox* _tmp207_;
+ BookView* _tmp208_;
+ BookView* _tmp209_;
+ BookView* _tmp210_;
+ BookView* _tmp211_;
BookView* _tmp212_;
- BookView* _tmp213_;
- BookView* _tmp214_;
- GtkVBox* _tmp215_;
- BookView* _tmp216_;
- BookView* _tmp217_;
- BookView* _tmp218_;
- BookView* _tmp219_;
- BookView* _tmp220_;
+ GSettings* _tmp213_;
+ gint _tmp214_ = 0;
+ GSettings* _tmp215_;
+ gint _tmp216_ = 0;
+ gint _tmp217_;
+ GSettings* _tmp218_;
+ gint _tmp219_ = 0;
+ gint _tmp220_;
GSettings* _tmp221_;
gint _tmp222_ = 0;
- GSettings* _tmp223_;
- gint _tmp224_ = 0;
- gint _tmp225_;
- GSettings* _tmp226_;
- gint _tmp227_ = 0;
- gint _tmp228_;
- GSettings* _tmp229_;
- gint _tmp230_ = 0;
+ gint _tmp223_;
+ GSettings* _tmp224_;
+ gint _tmp225_ = 0;
+ gint _tmp226_;
+ GSettings* _tmp227_;
+ gint _tmp228_ = 0;
+ gint _tmp229_;
+ gint _tmp230_;
gint _tmp231_;
- GSettings* _tmp232_;
- gint _tmp233_ = 0;
+ GtkWindow* _tmp232_;
+ gint _tmp233_;
gint _tmp234_;
GSettings* _tmp235_;
- gint _tmp236_ = 0;
- gint _tmp237_;
- gint _tmp238_;
- gint _tmp239_;
- GtkWindow* _tmp240_;
- gint _tmp241_;
- gint _tmp242_;
- GSettings* _tmp243_;
- gboolean _tmp244_ = FALSE;
- gboolean _tmp245_;
- Book* _tmp247_;
- guint _tmp248_ = 0U;
- Book* _tmp249_;
- Book* _tmp250_;
- GtkWindow* _tmp251_;
- const gchar* _tmp252_ = NULL;
- ProgressBarDialog* _tmp253_;
- ProgressBarDialog* _tmp254_;
- Book* _tmp255_;
- BookView* _tmp256_;
- DragAndDropHandler* _tmp257_;
+ gboolean _tmp236_ = FALSE;
+ gboolean _tmp237_;
+ Book* _tmp239_;
+ guint _tmp240_ = 0U;
+ Book* _tmp241_;
+ Book* _tmp242_;
+ GtkWindow* _tmp243_;
+ const gchar* _tmp244_ = NULL;
+ ProgressBarDialog* _tmp245_;
+ Book* _tmp246_;
GError * _inner_error_ = NULL;
g_return_if_fail (self != NULL);
_tmp0_ = gtk_icon_theme_get_default ();
@@ -4076,7 +4021,7 @@ static void user_interface_load (UserInterface* self) {
_inner_error_ = NULL;
_tmp4_ = e;
_tmp5_ = _tmp4_->message;
- g_critical ("ui.vala:1243: Unable to load UI %s: %s\n", filename, _tmp5_);
+ g_critical ("ui.vala:1256: Unable to load UI %s: %s\n", filename, _tmp5_);
_tmp6_ = _ ("Files missing");
_tmp7_ = _ ("Please check your installation");
user_interface_show_error_dialog (self, _tmp6_, _tmp7_);
@@ -4094,438 +4039,434 @@ static void user_interface_load (UserInterface* self) {
gtk_builder_connect_signals (_tmp8_, self);
_tmp9_ = self->priv->builder;
_tmp10_ = gtk_builder_get_object (_tmp9_, "simple_scan_window");
- _tmp11_ = _g_object_ref0 (GTK_WINDOW (_tmp10_));
+ _tmp11_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, GTK_TYPE_WINDOW, GtkWindow));
_g_object_unref0 (self->priv->window);
self->priv->window = _tmp11_;
_tmp12_ = g_application_get_default ();
- _tmp13_ = _g_object_ref0 (GTK_IS_APPLICATION (_tmp12_) ? ((GtkApplication*) _tmp12_) : NULL);
+ _tmp13_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, GTK_TYPE_APPLICATION) ? ((GtkApplication*) _tmp12_) : NULL);
app = _tmp13_;
_tmp14_ = app;
_tmp15_ = self->priv->window;
gtk_application_add_window (_tmp14_, _tmp15_);
_tmp16_ = self->priv->builder;
_tmp17_ = gtk_builder_get_object (_tmp16_, "main_vbox");
- _tmp18_ = _g_object_ref0 (GTK_VBOX (_tmp17_));
+ _tmp18_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, GTK_TYPE_VBOX, GtkVBox));
_g_object_unref0 (self->priv->main_vbox);
self->priv->main_vbox = _tmp18_;
_tmp19_ = self->priv->builder;
_tmp20_ = gtk_builder_get_object (_tmp19_, "page_move_left_menuitem");
- _tmp21_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp20_));
+ _tmp21_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, GTK_TYPE_MENU_ITEM, GtkMenuItem));
_g_object_unref0 (self->priv->page_move_left_menuitem);
self->priv->page_move_left_menuitem = _tmp21_;
_tmp22_ = self->priv->builder;
_tmp23_ = gtk_builder_get_object (_tmp22_, "page_move_right_menuitem");
- _tmp24_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp23_));
+ _tmp24_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, GTK_TYPE_MENU_ITEM, GtkMenuItem));
_g_object_unref0 (self->priv->page_move_right_menuitem);
self->priv->page_move_right_menuitem = _tmp24_;
_tmp25_ = self->priv->builder;
_tmp26_ = gtk_builder_get_object (_tmp25_, "page_delete_menuitem");
- _tmp27_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp26_));
+ _tmp27_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, GTK_TYPE_MENU_ITEM, GtkMenuItem));
_g_object_unref0 (self->priv->page_delete_menuitem);
self->priv->page_delete_menuitem = _tmp27_;
_tmp28_ = self->priv->builder;
_tmp29_ = gtk_builder_get_object (_tmp28_, "crop_rotate_menuitem");
- _tmp30_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp29_));
+ _tmp30_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, GTK_TYPE_MENU_ITEM, GtkMenuItem));
_g_object_unref0 (self->priv->crop_rotate_menuitem);
self->priv->crop_rotate_menuitem = _tmp30_;
_tmp31_ = self->priv->builder;
_tmp32_ = gtk_builder_get_object (_tmp31_, "save_menuitem");
- _tmp33_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp32_));
+ _tmp33_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, GTK_TYPE_MENU_ITEM, GtkMenuItem));
_g_object_unref0 (self->priv->save_menuitem);
self->priv->save_menuitem = _tmp33_;
_tmp34_ = self->priv->builder;
_tmp35_ = gtk_builder_get_object (_tmp34_, "save_as_menuitem");
- _tmp36_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp35_));
+ _tmp36_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp35_, GTK_TYPE_MENU_ITEM, GtkMenuItem));
_g_object_unref0 (self->priv->save_as_menuitem);
self->priv->save_as_menuitem = _tmp36_;
_tmp37_ = self->priv->builder;
_tmp38_ = gtk_builder_get_object (_tmp37_, "save_toolbutton");
- _tmp39_ = _g_object_ref0 (GTK_TOOL_BUTTON (_tmp38_));
+ _tmp39_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp38_, GTK_TYPE_TOOL_BUTTON, GtkToolButton));
_g_object_unref0 (self->priv->save_toolbutton);
self->priv->save_toolbutton = _tmp39_;
_tmp40_ = self->priv->builder;
_tmp41_ = gtk_builder_get_object (_tmp40_, "stop_scan_menuitem");
- _tmp42_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp41_));
+ _tmp42_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp41_, GTK_TYPE_MENU_ITEM, GtkMenuItem));
_g_object_unref0 (self->priv->stop_menuitem);
self->priv->stop_menuitem = _tmp42_;
_tmp43_ = self->priv->builder;
_tmp44_ = gtk_builder_get_object (_tmp43_, "stop_toolbutton");
- _tmp45_ = _g_object_ref0 (GTK_TOOL_BUTTON (_tmp44_));
+ _tmp45_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp44_, GTK_TYPE_TOOL_BUTTON, GtkToolButton));
_g_object_unref0 (self->priv->stop_toolbutton);
self->priv->stop_toolbutton = _tmp45_;
_tmp46_ = self->priv->builder;
_tmp47_ = gtk_builder_get_object (_tmp46_, "text_toolbutton_menuitem");
- _tmp48_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp47_));
+ _tmp48_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp47_, GTK_TYPE_RADIO_MENU_ITEM, GtkRadioMenuItem));
_g_object_unref0 (self->priv->text_toolbar_menuitem);
self->priv->text_toolbar_menuitem = _tmp48_;
_tmp49_ = self->priv->builder;
_tmp50_ = gtk_builder_get_object (_tmp49_, "text_menuitem");
- _tmp51_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp50_));
+ _tmp51_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp50_, GTK_TYPE_RADIO_MENU_ITEM, GtkRadioMenuItem));
_g_object_unref0 (self->priv->text_menu_menuitem);
self->priv->text_menu_menuitem = _tmp51_;
_tmp52_ = self->priv->builder;
_tmp53_ = gtk_builder_get_object (_tmp52_, "photo_toolbutton_menuitem");
- _tmp54_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp53_));
+ _tmp54_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp53_, GTK_TYPE_RADIO_MENU_ITEM, GtkRadioMenuItem));
_g_object_unref0 (self->priv->photo_toolbar_menuitem);
self->priv->photo_toolbar_menuitem = _tmp54_;
_tmp55_ = self->priv->builder;
_tmp56_ = gtk_builder_get_object (_tmp55_, "photo_menuitem");
- _tmp57_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp56_));
+ _tmp57_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp56_, GTK_TYPE_RADIO_MENU_ITEM, GtkRadioMenuItem));
_g_object_unref0 (self->priv->photo_menu_menuitem);
self->priv->photo_menu_menuitem = _tmp57_;
_tmp58_ = self->priv->builder;
_tmp59_ = gtk_builder_get_object (_tmp58_, "authorize_dialog");
- _tmp60_ = _g_object_ref0 (GTK_DIALOG (_tmp59_));
+ _tmp60_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp59_, GTK_TYPE_DIALOG, GtkDialog));
_g_object_unref0 (self->priv->authorize_dialog);
self->priv->authorize_dialog = _tmp60_;
_tmp61_ = self->priv->builder;
_tmp62_ = gtk_builder_get_object (_tmp61_, "authorize_label");
- _tmp63_ = _g_object_ref0 (GTK_LABEL (_tmp62_));
+ _tmp63_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp62_, GTK_TYPE_LABEL, GtkLabel));
_g_object_unref0 (self->priv->authorize_label);
self->priv->authorize_label = _tmp63_;
_tmp64_ = self->priv->builder;
_tmp65_ = gtk_builder_get_object (_tmp64_, "username_entry");
- _tmp66_ = _g_object_ref0 (GTK_ENTRY (_tmp65_));
+ _tmp66_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp65_, GTK_TYPE_ENTRY, GtkEntry));
_g_object_unref0 (self->priv->username_entry);
self->priv->username_entry = _tmp66_;
_tmp67_ = self->priv->builder;
_tmp68_ = gtk_builder_get_object (_tmp67_, "password_entry");
- _tmp69_ = _g_object_ref0 (GTK_ENTRY (_tmp68_));
+ _tmp69_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp68_, GTK_TYPE_ENTRY, GtkEntry));
_g_object_unref0 (self->priv->password_entry);
self->priv->password_entry = _tmp69_;
_tmp70_ = self->priv->builder;
_tmp71_ = gtk_builder_get_object (_tmp70_, "preferences_dialog");
- _tmp72_ = _g_object_ref0 (GTK_DIALOG (_tmp71_));
+ _tmp72_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp71_, GTK_TYPE_DIALOG, GtkDialog));
_g_object_unref0 (self->priv->preferences_dialog);
self->priv->preferences_dialog = _tmp72_;
_tmp73_ = self->priv->builder;
_tmp74_ = gtk_builder_get_object (_tmp73_, "device_combo");
- _tmp75_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp74_));
+ _tmp75_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp74_, GTK_TYPE_COMBO_BOX, GtkComboBox));
_g_object_unref0 (self->priv->device_combo);
self->priv->device_combo = _tmp75_;
_tmp76_ = self->priv->device_combo;
_tmp77_ = gtk_combo_box_get_model (_tmp76_);
- _tmp78_ = _g_object_ref0 (GTK_LIST_STORE (_tmp77_));
+ _tmp78_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp77_, GTK_TYPE_LIST_STORE, GtkListStore));
_g_object_unref0 (self->priv->device_model);
self->priv->device_model = _tmp78_;
_tmp79_ = self->priv->builder;
_tmp80_ = gtk_builder_get_object (_tmp79_, "text_dpi_combo");
- _tmp81_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp80_));
+ _tmp81_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp80_, GTK_TYPE_COMBO_BOX, GtkComboBox));
_g_object_unref0 (self->priv->text_dpi_combo);
self->priv->text_dpi_combo = _tmp81_;
_tmp82_ = self->priv->text_dpi_combo;
_tmp83_ = gtk_combo_box_get_model (_tmp82_);
- _tmp84_ = _g_object_ref0 (GTK_LIST_STORE (_tmp83_));
+ _tmp84_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp83_, GTK_TYPE_LIST_STORE, GtkListStore));
_g_object_unref0 (self->priv->text_dpi_model);
self->priv->text_dpi_model = _tmp84_;
_tmp85_ = self->priv->builder;
_tmp86_ = gtk_builder_get_object (_tmp85_, "photo_dpi_combo");
- _tmp87_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp86_));
+ _tmp87_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp86_, GTK_TYPE_COMBO_BOX, GtkComboBox));
_g_object_unref0 (self->priv->photo_dpi_combo);
self->priv->photo_dpi_combo = _tmp87_;
_tmp88_ = self->priv->photo_dpi_combo;
_tmp89_ = gtk_combo_box_get_model (_tmp88_);
- _tmp90_ = _g_object_ref0 (GTK_LIST_STORE (_tmp89_));
+ _tmp90_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp89_, GTK_TYPE_LIST_STORE, GtkListStore));
_g_object_unref0 (self->priv->photo_dpi_model);
self->priv->photo_dpi_model = _tmp90_;
_tmp91_ = self->priv->builder;
_tmp92_ = gtk_builder_get_object (_tmp91_, "page_side_combo");
- _tmp93_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp92_));
+ _tmp93_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp92_, GTK_TYPE_COMBO_BOX, GtkComboBox));
_g_object_unref0 (self->priv->page_side_combo);
self->priv->page_side_combo = _tmp93_;
_tmp94_ = self->priv->page_side_combo;
_tmp95_ = gtk_combo_box_get_model (_tmp94_);
- _tmp96_ = _g_object_ref0 (GTK_LIST_STORE (_tmp95_));
+ _tmp96_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp95_, GTK_TYPE_LIST_STORE, GtkListStore));
_g_object_unref0 (self->priv->page_side_model);
self->priv->page_side_model = _tmp96_;
_tmp97_ = self->priv->builder;
_tmp98_ = gtk_builder_get_object (_tmp97_, "paper_size_combo");
- _tmp99_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp98_));
+ _tmp99_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp98_, GTK_TYPE_COMBO_BOX, GtkComboBox));
_g_object_unref0 (self->priv->paper_size_combo);
self->priv->paper_size_combo = _tmp99_;
_tmp100_ = self->priv->paper_size_combo;
_tmp101_ = gtk_combo_box_get_model (_tmp100_);
- _tmp102_ = _g_object_ref0 (GTK_LIST_STORE (_tmp101_));
+ _tmp102_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp101_, GTK_TYPE_LIST_STORE, GtkListStore));
_g_object_unref0 (self->priv->paper_size_model);
self->priv->paper_size_model = _tmp102_;
_tmp103_ = (GtkInfoBar*) gtk_info_bar_new ();
- _tmp104_ = g_object_ref_sink (_tmp103_);
+ g_object_ref_sink (_tmp103_);
_g_object_unref0 (self->priv->info_bar);
- self->priv->info_bar = _tmp104_;
- _tmp105_ = self->priv->info_bar;
- g_signal_connect (_tmp105_, "response", (GCallback) _user_interface_info_bar_response_cb_gtk_info_bar_response, self);
- _tmp106_ = self->priv->main_vbox;
- _tmp107_ = self->priv->info_bar;
- gtk_box_pack_start ((GtkBox*) _tmp106_, (GtkWidget*) _tmp107_, FALSE, TRUE, (guint) 0);
- _tmp108_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
- _tmp109_ = g_object_ref_sink (_tmp108_);
- hbox = _tmp109_;
- _tmp110_ = self->priv->info_bar;
- _tmp111_ = gtk_info_bar_get_content_area (_tmp110_);
- _tmp112_ = _g_object_ref0 (GTK_CONTAINER (_tmp111_));
- content_area = _tmp112_;
- _tmp113_ = content_area;
- _tmp114_ = hbox;
- gtk_container_add (_tmp113_, (GtkWidget*) _tmp114_);
- _tmp115_ = hbox;
- gtk_widget_show ((GtkWidget*) _tmp115_);
- _tmp116_ = (GtkImage*) gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG);
- _tmp117_ = g_object_ref_sink (_tmp116_);
+ self->priv->info_bar = _tmp103_;
+ _tmp104_ = self->priv->info_bar;
+ g_signal_connect (_tmp104_, "response", (GCallback) _user_interface_info_bar_response_cb_gtk_info_bar_response, self);
+ _tmp105_ = self->priv->main_vbox;
+ _tmp106_ = self->priv->info_bar;
+ gtk_box_pack_start ((GtkBox*) _tmp105_, (GtkWidget*) _tmp106_, FALSE, TRUE, (guint) 0);
+ _tmp107_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
+ g_object_ref_sink (_tmp107_);
+ hbox = _tmp107_;
+ _tmp108_ = self->priv->info_bar;
+ _tmp109_ = gtk_info_bar_get_content_area (_tmp108_);
+ _tmp110_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp109_, GTK_TYPE_CONTAINER, GtkContainer));
+ content_area = _tmp110_;
+ _tmp111_ = content_area;
+ _tmp112_ = hbox;
+ gtk_container_add (_tmp111_, (GtkWidget*) _tmp112_);
+ _tmp113_ = hbox;
+ gtk_widget_show ((GtkWidget*) _tmp113_);
+ _tmp114_ = (GtkImage*) gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG);
+ g_object_ref_sink (_tmp114_);
_g_object_unref0 (self->priv->info_bar_image);
- self->priv->info_bar_image = _tmp117_;
- _tmp118_ = hbox;
- _tmp119_ = self->priv->info_bar_image;
- gtk_box_pack_start (_tmp118_, (GtkWidget*) _tmp119_, FALSE, TRUE, (guint) 0);
- _tmp120_ = self->priv->info_bar_image;
- gtk_widget_show ((GtkWidget*) _tmp120_);
- _tmp121_ = (GtkLabel*) gtk_label_new (NULL);
- _tmp122_ = g_object_ref_sink (_tmp121_);
+ self->priv->info_bar_image = _tmp114_;
+ _tmp115_ = hbox;
+ _tmp116_ = self->priv->info_bar_image;
+ gtk_box_pack_start (_tmp115_, (GtkWidget*) _tmp116_, FALSE, TRUE, (guint) 0);
+ _tmp117_ = self->priv->info_bar_image;
+ gtk_widget_show ((GtkWidget*) _tmp117_);
+ _tmp118_ = (GtkLabel*) gtk_label_new (NULL);
+ g_object_ref_sink (_tmp118_);
_g_object_unref0 (self->priv->info_bar_label);
- self->priv->info_bar_label = _tmp122_;
- _tmp123_ = self->priv->info_bar_label;
- gtk_misc_set_alignment ((GtkMisc*) _tmp123_, 0.0f, 0.5f);
- _tmp124_ = hbox;
- _tmp125_ = self->priv->info_bar_label;
- gtk_box_pack_start (_tmp124_, (GtkWidget*) _tmp125_, TRUE, TRUE, (guint) 0);
- _tmp126_ = self->priv->info_bar_label;
- gtk_widget_show ((GtkWidget*) _tmp126_);
- _tmp127_ = self->priv->info_bar;
- _tmp128_ = gtk_info_bar_add_button (_tmp127_, GTK_STOCK_CLOSE, (gint) GTK_RESPONSE_CLOSE);
- _tmp129_ = _g_object_ref0 (GTK_BUTTON (_tmp128_));
+ self->priv->info_bar_label = _tmp118_;
+ _tmp119_ = self->priv->info_bar_label;
+ gtk_misc_set_alignment ((GtkMisc*) _tmp119_, 0.0f, 0.5f);
+ _tmp120_ = hbox;
+ _tmp121_ = self->priv->info_bar_label;
+ gtk_box_pack_start (_tmp120_, (GtkWidget*) _tmp121_, TRUE, TRUE, (guint) 0);
+ _tmp122_ = self->priv->info_bar_label;
+ gtk_widget_show ((GtkWidget*) _tmp122_);
+ _tmp123_ = self->priv->info_bar;
+ _tmp124_ = gtk_info_bar_add_button (_tmp123_, GTK_STOCK_CLOSE, (gint) GTK_RESPONSE_CLOSE);
+ _tmp125_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp124_, GTK_TYPE_BUTTON, GtkButton));
_g_object_unref0 (self->priv->info_bar_close_button);
- self->priv->info_bar_close_button = _tmp129_;
- _tmp130_ = self->priv->info_bar;
- _tmp131_ = _ ("Change _Scanner");
- _tmp132_ = gtk_info_bar_add_button (_tmp130_, _tmp131_, 1);
- _tmp133_ = _g_object_ref0 (GTK_BUTTON (_tmp132_));
+ self->priv->info_bar_close_button = _tmp125_;
+ _tmp126_ = self->priv->info_bar;
+ _tmp127_ = _ ("Change _Scanner");
+ _tmp128_ = gtk_info_bar_add_button (_tmp126_, _tmp127_, 1);
+ _tmp129_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp128_, GTK_TYPE_BUTTON, GtkButton));
_g_object_unref0 (self->priv->info_bar_change_scanner_button);
- self->priv->info_bar_change_scanner_button = _tmp133_;
- _tmp134_ = self->priv->paper_size_model;
- gtk_list_store_append (_tmp134_, &_tmp135_);
- iter = _tmp135_;
- _tmp136_ = self->priv->paper_size_model;
- _tmp137_ = iter;
- _tmp138_ = _ ("Automatic");
- gtk_list_store_set (_tmp136_, &_tmp137_, 0, 0, 1, 0, 2, _tmp138_, -1, -1);
+ self->priv->info_bar_change_scanner_button = _tmp129_;
+ _tmp130_ = self->priv->paper_size_model;
+ gtk_list_store_append (_tmp130_, &_tmp131_);
+ iter = _tmp131_;
+ _tmp132_ = self->priv->paper_size_model;
+ _tmp133_ = iter;
+ _tmp134_ = _ ("Automatic");
+ gtk_list_store_set (_tmp132_, &_tmp133_, 0, 0, 1, 0, 2, _tmp134_, -1, -1);
+ _tmp135_ = self->priv->paper_size_model;
+ gtk_list_store_append (_tmp135_, &_tmp136_);
+ iter = _tmp136_;
+ _tmp137_ = self->priv->paper_size_model;
+ _tmp138_ = iter;
+ gtk_list_store_set (_tmp137_, &_tmp138_, 0, 1050, 1, 1480, 2, "A6", -1, -1);
_tmp139_ = self->priv->paper_size_model;
gtk_list_store_append (_tmp139_, &_tmp140_);
iter = _tmp140_;
_tmp141_ = self->priv->paper_size_model;
_tmp142_ = iter;
- gtk_list_store_set (_tmp141_, &_tmp142_, 0, 1050, 1, 1480, 2, "A6", -1, -1);
+ gtk_list_store_set (_tmp141_, &_tmp142_, 0, 1480, 1, 2100, 2, "A5", -1, -1);
_tmp143_ = self->priv->paper_size_model;
gtk_list_store_append (_tmp143_, &_tmp144_);
iter = _tmp144_;
_tmp145_ = self->priv->paper_size_model;
_tmp146_ = iter;
- gtk_list_store_set (_tmp145_, &_tmp146_, 0, 1480, 1, 2100, 2, "A5", -1, -1);
+ gtk_list_store_set (_tmp145_, &_tmp146_, 0, 2100, 1, 2970, 2, "A4", -1, -1);
_tmp147_ = self->priv->paper_size_model;
gtk_list_store_append (_tmp147_, &_tmp148_);
iter = _tmp148_;
_tmp149_ = self->priv->paper_size_model;
_tmp150_ = iter;
- gtk_list_store_set (_tmp149_, &_tmp150_, 0, 2100, 1, 2970, 2, "A4", -1, -1);
+ gtk_list_store_set (_tmp149_, &_tmp150_, 0, 2159, 1, 2794, 2, "Letter", -1, -1);
_tmp151_ = self->priv->paper_size_model;
gtk_list_store_append (_tmp151_, &_tmp152_);
iter = _tmp152_;
_tmp153_ = self->priv->paper_size_model;
_tmp154_ = iter;
- gtk_list_store_set (_tmp153_, &_tmp154_, 0, 2159, 1, 2794, 2, "Letter", -1, -1);
+ gtk_list_store_set (_tmp153_, &_tmp154_, 0, 2159, 1, 3556, 2, "Legal", -1, -1);
_tmp155_ = self->priv->paper_size_model;
gtk_list_store_append (_tmp155_, &_tmp156_);
iter = _tmp156_;
_tmp157_ = self->priv->paper_size_model;
_tmp158_ = iter;
- gtk_list_store_set (_tmp157_, &_tmp158_, 0, 2159, 1, 3556, 2, "Legal", -1, -1);
- _tmp159_ = self->priv->paper_size_model;
- gtk_list_store_append (_tmp159_, &_tmp160_);
- iter = _tmp160_;
- _tmp161_ = self->priv->paper_size_model;
- _tmp162_ = iter;
- gtk_list_store_set (_tmp161_, &_tmp162_, 0, 1016, 1, 1524, 2, "4×6", -1, -1);
- _tmp163_ = self->priv->settings;
- _tmp164_ = g_settings_get_int (_tmp163_, "text-dpi");
- dpi = _tmp164_;
- _tmp165_ = dpi;
- if (_tmp165_ <= 0) {
+ gtk_list_store_set (_tmp157_, &_tmp158_, 0, 1016, 1, 1524, 2, "4×6", -1, -1);
+ _tmp159_ = self->priv->settings;
+ _tmp160_ = g_settings_get_int (_tmp159_, "text-dpi");
+ dpi = _tmp160_;
+ _tmp161_ = dpi;
+ if (_tmp161_ <= 0) {
dpi = USER_INTERFACE_DEFAULT_TEXT_DPI;
}
- _tmp166_ = self->priv->text_dpi_combo;
- _tmp167_ = dpi;
- user_interface_set_dpi_combo (self, _tmp166_, USER_INTERFACE_DEFAULT_TEXT_DPI, _tmp167_);
- _tmp168_ = self->priv->settings;
- _tmp169_ = g_settings_get_int (_tmp168_, "photo-dpi");
- dpi = _tmp169_;
- _tmp170_ = dpi;
- if (_tmp170_ <= 0) {
+ _tmp162_ = self->priv->text_dpi_combo;
+ _tmp163_ = dpi;
+ user_interface_set_dpi_combo (self, _tmp162_, USER_INTERFACE_DEFAULT_TEXT_DPI, _tmp163_);
+ _tmp164_ = self->priv->settings;
+ _tmp165_ = g_settings_get_int (_tmp164_, "photo-dpi");
+ dpi = _tmp165_;
+ _tmp166_ = dpi;
+ if (_tmp166_ <= 0) {
dpi = USER_INTERFACE_DEFAULT_PHOTO_DPI;
}
- _tmp171_ = self->priv->photo_dpi_combo;
- _tmp172_ = dpi;
- user_interface_set_dpi_combo (self, _tmp171_, USER_INTERFACE_DEFAULT_PHOTO_DPI, _tmp172_);
- _tmp173_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
- _tmp174_ = g_object_ref_sink (_tmp173_);
+ _tmp167_ = self->priv->photo_dpi_combo;
+ _tmp168_ = dpi;
+ user_interface_set_dpi_combo (self, _tmp167_, USER_INTERFACE_DEFAULT_PHOTO_DPI, _tmp168_);
+ _tmp169_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
+ g_object_ref_sink (_tmp169_);
+ renderer = _tmp169_;
+ _tmp170_ = self->priv->device_combo;
+ _tmp171_ = renderer;
+ gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp170_, (GtkCellRenderer*) _tmp171_, TRUE);
+ _tmp172_ = self->priv->device_combo;
+ _tmp173_ = renderer;
+ gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp172_, (GtkCellRenderer*) _tmp173_, "text", 1);
+ _tmp174_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
+ g_object_ref_sink (_tmp174_);
+ _g_object_unref0 (renderer);
renderer = _tmp174_;
- _tmp175_ = self->priv->device_combo;
+ _tmp175_ = self->priv->page_side_combo;
_tmp176_ = renderer;
gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp175_, (GtkCellRenderer*) _tmp176_, TRUE);
- _tmp177_ = self->priv->device_combo;
+ _tmp177_ = self->priv->page_side_combo;
_tmp178_ = renderer;
gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp177_, (GtkCellRenderer*) _tmp178_, "text", 1);
- _tmp179_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
- _tmp180_ = g_object_ref_sink (_tmp179_);
+ _tmp179_ = self->priv->settings;
+ _tmp180_ = g_settings_get_enum (_tmp179_, "page-side");
+ user_interface_set_page_side (self, (ScanType) _tmp180_);
+ _tmp181_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
+ g_object_ref_sink (_tmp181_);
_g_object_unref0 (renderer);
- renderer = _tmp180_;
- _tmp181_ = self->priv->page_side_combo;
- _tmp182_ = renderer;
- gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp181_, (GtkCellRenderer*) _tmp182_, TRUE);
- _tmp183_ = self->priv->page_side_combo;
- _tmp184_ = renderer;
- gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp183_, (GtkCellRenderer*) _tmp184_, "text", 1);
- _tmp185_ = self->priv->settings;
- _tmp186_ = g_settings_get_enum (_tmp185_, "page-side");
- user_interface_set_page_side (self, (ScanType) _tmp186_);
- _tmp187_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
- _tmp188_ = g_object_ref_sink (_tmp187_);
- _g_object_unref0 (renderer);
- renderer = _tmp188_;
- _tmp189_ = self->priv->paper_size_combo;
- _tmp190_ = renderer;
- gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp189_, (GtkCellRenderer*) _tmp190_, TRUE);
- _tmp191_ = self->priv->paper_size_combo;
- _tmp192_ = renderer;
- gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp191_, (GtkCellRenderer*) _tmp192_, "text", 2);
- _tmp193_ = self->priv->settings;
- _tmp194_ = g_settings_get_int (_tmp193_, "paper-width");
- paper_width = _tmp194_;
- _tmp195_ = self->priv->settings;
- _tmp196_ = g_settings_get_int (_tmp195_, "paper-height");
- paper_height = _tmp196_;
- _tmp197_ = paper_width;
- _tmp198_ = paper_height;
- user_interface_set_paper_size (self, _tmp197_, _tmp198_);
- _tmp199_ = self->priv->settings;
- _tmp200_ = g_settings_get_string (_tmp199_, "selected-device");
- device = _tmp200_;
- _tmp201_ = device;
- if (_tmp201_ != NULL) {
- const gchar* _tmp202_;
- GtkTreeIter _tmp203_ = {0};
- gboolean _tmp204_ = FALSE;
- _tmp202_ = device;
- _tmp204_ = user_interface_find_scan_device (self, _tmp202_, &_tmp203_);
- iter = _tmp203_;
- if (_tmp204_) {
- GtkComboBox* _tmp205_;
- GtkTreeIter _tmp206_;
- _tmp205_ = self->priv->device_combo;
- _tmp206_ = iter;
- gtk_combo_box_set_active_iter (_tmp205_, &_tmp206_);
+ renderer = _tmp181_;
+ _tmp182_ = self->priv->paper_size_combo;
+ _tmp183_ = renderer;
+ gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp182_, (GtkCellRenderer*) _tmp183_, TRUE);
+ _tmp184_ = self->priv->paper_size_combo;
+ _tmp185_ = renderer;
+ gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp184_, (GtkCellRenderer*) _tmp185_, "text", 2);
+ _tmp186_ = self->priv->settings;
+ _tmp187_ = g_settings_get_int (_tmp186_, "paper-width");
+ paper_width = _tmp187_;
+ _tmp188_ = self->priv->settings;
+ _tmp189_ = g_settings_get_int (_tmp188_, "paper-height");
+ paper_height = _tmp189_;
+ _tmp190_ = paper_width;
+ _tmp191_ = paper_height;
+ user_interface_set_paper_size (self, _tmp190_, _tmp191_);
+ _tmp192_ = self->priv->settings;
+ _tmp193_ = g_settings_get_string (_tmp192_, "selected-device");
+ device = _tmp193_;
+ _tmp194_ = device;
+ if (_tmp194_ != NULL) {
+ const gchar* _tmp195_;
+ GtkTreeIter _tmp196_ = {0};
+ gboolean _tmp197_ = FALSE;
+ _tmp195_ = device;
+ _tmp197_ = user_interface_find_scan_device (self, _tmp195_, &_tmp196_);
+ iter = _tmp196_;
+ if (_tmp197_) {
+ GtkComboBox* _tmp198_;
+ GtkTreeIter _tmp199_;
+ _tmp198_ = self->priv->device_combo;
+ _tmp199_ = iter;
+ gtk_combo_box_set_active_iter (_tmp198_, &_tmp199_);
}
}
- _tmp207_ = self->priv->settings;
- _tmp208_ = g_settings_get_string (_tmp207_, "document-type");
- document_type = _tmp208_;
- _tmp209_ = document_type;
- if (_tmp209_ != NULL) {
- const gchar* _tmp210_;
- _tmp210_ = document_type;
- user_interface_set_document_hint (self, _tmp210_);
- }
- _tmp211_ = self->priv->book;
- _tmp212_ = book_view_new (_tmp211_);
- _tmp213_ = g_object_ref_sink (_tmp212_);
+ _tmp200_ = self->priv->settings;
+ _tmp201_ = g_settings_get_string (_tmp200_, "document-type");
+ document_type = _tmp201_;
+ _tmp202_ = document_type;
+ if (_tmp202_ != NULL) {
+ const gchar* _tmp203_;
+ _tmp203_ = document_type;
+ user_interface_set_document_hint (self, _tmp203_);
+ }
+ _tmp204_ = self->priv->book;
+ _tmp205_ = book_view_new (_tmp204_);
+ g_object_ref_sink (_tmp205_);
_g_object_unref0 (self->priv->book_view);
- self->priv->book_view = _tmp213_;
- _tmp214_ = self->priv->book_view;
- gtk_container_set_border_width ((GtkContainer*) _tmp214_, (guint) 18);
- _tmp215_ = self->priv->main_vbox;
- _tmp216_ = self->priv->book_view;
- gtk_box_pack_end ((GtkBox*) _tmp215_, (GtkWidget*) _tmp216_, TRUE, TRUE, (guint) 0);
- _tmp217_ = self->priv->book_view;
- g_signal_connect (_tmp217_, "page-selected", (GCallback) _user_interface_page_selected_cb_book_view_page_selected, self);
- _tmp218_ = self->priv->book_view;
- g_signal_connect (_tmp218_, "show-page", (GCallback) _user_interface_show_page_cb_book_view_show_page, self);
- _tmp219_ = self->priv->book_view;
- g_signal_connect (_tmp219_, "show-menu", (GCallback) _user_interface_show_page_menu_cb_book_view_show_menu, self);
- _tmp220_ = self->priv->book_view;
- gtk_widget_show ((GtkWidget*) _tmp220_);
- _tmp221_ = self->priv->settings;
- _tmp222_ = g_settings_get_enum (_tmp221_, "scan-direction");
- self->priv->default_page_scan_direction = (ScanDirection) _tmp222_;
- _tmp223_ = self->priv->settings;
- _tmp224_ = g_settings_get_int (_tmp223_, "page-width");
- self->priv->default_page_width = _tmp224_;
- _tmp225_ = self->priv->default_page_width;
- if (_tmp225_ <= 0) {
+ self->priv->book_view = _tmp205_;
+ _tmp206_ = self->priv->book_view;
+ gtk_container_set_border_width ((GtkContainer*) _tmp206_, (guint) 18);
+ _tmp207_ = self->priv->main_vbox;
+ _tmp208_ = self->priv->book_view;
+ gtk_box_pack_end ((GtkBox*) _tmp207_, (GtkWidget*) _tmp208_, TRUE, TRUE, (guint) 0);
+ _tmp209_ = self->priv->book_view;
+ g_signal_connect (_tmp209_, "page-selected", (GCallback) _user_interface_page_selected_cb_book_view_page_selected, self);
+ _tmp210_ = self->priv->book_view;
+ g_signal_connect (_tmp210_, "show-page", (GCallback) _user_interface_show_page_cb_book_view_show_page, self);
+ _tmp211_ = self->priv->book_view;
+ g_signal_connect (_tmp211_, "show-menu", (GCallback) _user_interface_show_page_menu_cb_book_view_show_menu, self);
+ _tmp212_ = self->priv->book_view;
+ gtk_widget_show ((GtkWidget*) _tmp212_);
+ _tmp213_ = self->priv->settings;
+ _tmp214_ = g_settings_get_enum (_tmp213_, "scan-direction");
+ self->priv->default_page_scan_direction = (ScanDirection) _tmp214_;
+ _tmp215_ = self->priv->settings;
+ _tmp216_ = g_settings_get_int (_tmp215_, "page-width");
+ self->priv->default_page_width = _tmp216_;
+ _tmp217_ = self->priv->default_page_width;
+ if (_tmp217_ <= 0) {
self->priv->default_page_width = 595;
}
- _tmp226_ = self->priv->settings;
- _tmp227_ = g_settings_get_int (_tmp226_, "page-height");
- self->priv->default_page_height = _tmp227_;
- _tmp228_ = self->priv->default_page_height;
- if (_tmp228_ <= 0) {
+ _tmp218_ = self->priv->settings;
+ _tmp219_ = g_settings_get_int (_tmp218_, "page-height");
+ self->priv->default_page_height = _tmp219_;
+ _tmp220_ = self->priv->default_page_height;
+ if (_tmp220_ <= 0) {
self->priv->default_page_height = 842;
}
- _tmp229_ = self->priv->settings;
- _tmp230_ = g_settings_get_int (_tmp229_, "page-dpi");
- self->priv->default_page_dpi = _tmp230_;
- _tmp231_ = self->priv->default_page_dpi;
- if (_tmp231_ <= 0) {
+ _tmp221_ = self->priv->settings;
+ _tmp222_ = g_settings_get_int (_tmp221_, "page-dpi");
+ self->priv->default_page_dpi = _tmp222_;
+ _tmp223_ = self->priv->default_page_dpi;
+ if (_tmp223_ <= 0) {
self->priv->default_page_dpi = 72;
}
- _tmp232_ = self->priv->settings;
- _tmp233_ = g_settings_get_int (_tmp232_, "window-width");
- self->priv->window_width = _tmp233_;
- _tmp234_ = self->priv->window_width;
- if (_tmp234_ <= 0) {
+ _tmp224_ = self->priv->settings;
+ _tmp225_ = g_settings_get_int (_tmp224_, "window-width");
+ self->priv->window_width = _tmp225_;
+ _tmp226_ = self->priv->window_width;
+ if (_tmp226_ <= 0) {
self->priv->window_width = 600;
}
- _tmp235_ = self->priv->settings;
- _tmp236_ = g_settings_get_int (_tmp235_, "window-height");
- self->priv->window_height = _tmp236_;
- _tmp237_ = self->priv->window_height;
- if (_tmp237_ <= 0) {
+ _tmp227_ = self->priv->settings;
+ _tmp228_ = g_settings_get_int (_tmp227_, "window-height");
+ self->priv->window_height = _tmp228_;
+ _tmp229_ = self->priv->window_height;
+ if (_tmp229_ <= 0) {
self->priv->window_height = 400;
}
- _tmp238_ = self->priv->window_width;
- _tmp239_ = self->priv->window_height;
- g_debug ("ui.vala:1391: Restoring window to %dx%d pixels", _tmp238_, _tmp239_);
- _tmp240_ = self->priv->window;
- _tmp241_ = self->priv->window_width;
- _tmp242_ = self->priv->window_height;
- gtk_window_set_default_size (_tmp240_, _tmp241_, _tmp242_);
- _tmp243_ = self->priv->settings;
- _tmp244_ = g_settings_get_boolean (_tmp243_, "window-is-maximized");
- self->priv->window_is_maximized = _tmp244_;
- _tmp245_ = self->priv->window_is_maximized;
- if (_tmp245_) {
- GtkWindow* _tmp246_;
- g_debug ("ui.vala:1396: Restoring window to maximized");
- _tmp246_ = self->priv->window;
- gtk_window_maximize (_tmp246_);
- }
- _tmp247_ = self->priv->book;
- _tmp248_ = book_get_n_pages (_tmp247_);
- if (_tmp248_ == ((guint) 0)) {
+ _tmp230_ = self->priv->window_width;
+ _tmp231_ = self->priv->window_height;
+ g_debug ("ui.vala:1404: Restoring window to %dx%d pixels", _tmp230_, _tmp231_);
+ _tmp232_ = self->priv->window;
+ _tmp233_ = self->priv->window_width;
+ _tmp234_ = self->priv->window_height;
+ gtk_window_set_default_size (_tmp232_, _tmp233_, _tmp234_);
+ _tmp235_ = self->priv->settings;
+ _tmp236_ = g_settings_get_boolean (_tmp235_, "window-is-maximized");
+ self->priv->window_is_maximized = _tmp236_;
+ _tmp237_ = self->priv->window_is_maximized;
+ if (_tmp237_) {
+ GtkWindow* _tmp238_;
+ g_debug ("ui.vala:1409: Restoring window to maximized");
+ _tmp238_ = self->priv->window;
+ gtk_window_maximize (_tmp238_);
+ }
+ _tmp239_ = self->priv->book;
+ _tmp240_ = book_get_n_pages (_tmp239_);
+ if (_tmp240_ == ((guint) 0)) {
user_interface_add_default_page (self);
}
- _tmp249_ = self->priv->book;
- book_set_needs_saving (_tmp249_, FALSE);
- _tmp250_ = self->priv->book;
- g_signal_connect (_tmp250_, "needs-saving-changed", (GCallback) _user_interface_needs_saving_cb_book_needs_saving_changed, self);
- _tmp251_ = self->priv->window;
- _tmp252_ = _ ("Saving document...");
- _tmp253_ = progress_bar_dialog_new (_tmp251_, _tmp252_);
- _tmp254_ = g_object_ref_sink (_tmp253_);
+ _tmp241_ = self->priv->book;
+ book_set_needs_saving (_tmp241_, FALSE);
+ _tmp242_ = self->priv->book;
+ g_signal_connect (_tmp242_, "needs-saving-changed", (GCallback) _user_interface_needs_saving_cb_book_needs_saving_changed, self);
+ _tmp243_ = self->priv->window;
+ _tmp244_ = _ ("Saving document...");
+ _tmp245_ = progress_bar_dialog_new (_tmp243_, _tmp244_);
+ g_object_ref_sink (_tmp245_);
_g_object_unref0 (self->priv->progress_dialog);
- self->priv->progress_dialog = _tmp254_;
- _tmp255_ = self->priv->book;
- g_signal_connect (_tmp255_, "saving", (GCallback) _user_interface_book_saving_cb_book_saving, self);
- _tmp256_ = self->priv->book_view;
- _tmp257_ = drag_and_drop_handler_new (_tmp256_);
- _drag_and_drop_handler_unref0 (self->priv->dnd_handler);
- self->priv->dnd_handler = _tmp257_;
+ self->priv->progress_dialog = _tmp245_;
+ _tmp246_ = self->priv->book;
+ g_signal_connect (_tmp246_, "saving", (GCallback) _user_interface_book_saving_cb_book_saving, self);
_g_free0 (document_type);
_g_free0 (device);
_g_object_unref0 (renderer);
@@ -4862,7 +4803,6 @@ static void user_interface_instance_init (UserInterface * self) {
const gchar* _tmp1_ = NULL;
gchar* _tmp2_;
self->priv = USER_INTERFACE_GET_PRIVATE (self);
- self->priv->dnd_handler = NULL;
self->priv->book_uri = NULL;
_tmp0_ = g_strdup ("photo");
self->priv->document_hint = _tmp0_;
@@ -4876,7 +4816,17 @@ static void user_interface_instance_init (UserInterface * self) {
static void user_interface_finalize (UserInterface* obj) {
UserInterface * self;
- self = USER_INTERFACE (obj);
+ Book* _tmp0_;
+ guint _tmp1_ = 0U;
+ Book* _tmp2_;
+ guint _tmp3_ = 0U;
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_USER_INTERFACE, UserInterface);
+ _tmp0_ = self->priv->book;
+ g_signal_parse_name ("page-removed", TYPE_BOOK, &_tmp1_, NULL, FALSE);
+ g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _user_interface_page_removed_cb_book_page_removed, self);
+ _tmp2_ = self->priv->book;
+ g_signal_parse_name ("page-added", TYPE_BOOK, &_tmp3_, NULL, FALSE);
+ g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _user_interface_page_added_cb_book_page_added, self);
_g_object_unref0 (self->priv->settings);
_g_object_unref0 (self->priv->builder);
_g_object_unref0 (self->priv->window);
@@ -4916,7 +4866,6 @@ static void user_interface_finalize (UserInterface* obj) {
_g_object_unref0 (self->priv->paper_size_model);
_g_object_unref0 (self->priv->save_dialog);
_g_object_unref0 (self->priv->progress_dialog);
- _drag_and_drop_handler_unref0 (self->priv->dnd_handler);
_g_free0 (self->priv->error_title);
_g_free0 (self->priv->error_text);
_book_unref0 (self->priv->book);
@@ -4962,56 +4911,53 @@ void user_interface_unref (gpointer instance) {
ProgressBarDialog* progress_bar_dialog_construct (GType object_type, GtkWindow* parent, const gchar* title) {
ProgressBarDialog * self = NULL;
GtkProgressBar* _tmp0_;
- GtkProgressBar* _tmp1_;
- GtkBox* _tmp2_;
- GtkBox* _tmp3_;
+ GtkBox* _tmp1_;
GtkBox* hbox;
- GtkBox* _tmp4_;
- GtkBox* _tmp5_;
+ GtkBox* _tmp2_;
GtkBox* vbox;
+ GtkProgressBar* _tmp3_;
+ GtkProgressBar* _tmp4_;
+ GtkProgressBar* _tmp5_;
GtkProgressBar* _tmp6_;
- GtkProgressBar* _tmp7_;
- GtkProgressBar* _tmp8_;
+ const gchar* _tmp7_;
+ GtkWindow* _tmp8_;
GtkProgressBar* _tmp9_;
- const gchar* _tmp10_;
- GtkWindow* _tmp11_;
- GtkProgressBar* _tmp12_;
g_return_val_if_fail (parent != NULL, NULL);
g_return_val_if_fail (title != NULL, NULL);
self = (ProgressBarDialog*) g_object_new (object_type, NULL);
_tmp0_ = (GtkProgressBar*) gtk_progress_bar_new ();
- _tmp1_ = g_object_ref_sink (_tmp0_);
+ g_object_ref_sink (_tmp0_);
_g_object_unref0 (self->priv->bar);
- self->priv->bar = _tmp1_;
- _tmp2_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
- _tmp3_ = g_object_ref_sink (_tmp2_);
- hbox = _tmp3_;
- _tmp4_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
- _tmp5_ = g_object_ref_sink (_tmp4_);
- vbox = _tmp5_;
+ self->priv->bar = _tmp0_;
+ _tmp1_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
+ g_object_ref_sink (_tmp1_);
+ hbox = _tmp1_;
+ _tmp2_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
+ g_object_ref_sink (_tmp2_);
+ vbox = _tmp2_;
gtk_widget_set_hexpand ((GtkWidget*) hbox, TRUE);
- _tmp6_ = self->priv->bar;
- gtk_progress_bar_set_text (_tmp6_, "");
- _tmp7_ = self->priv->bar;
- gtk_progress_bar_set_show_text (_tmp7_, TRUE);
- _tmp8_ = self->priv->bar;
- gtk_widget_set_size_request ((GtkWidget*) _tmp8_, 225, 25);
+ _tmp3_ = self->priv->bar;
+ gtk_progress_bar_set_text (_tmp3_, "");
+ _tmp4_ = self->priv->bar;
+ gtk_progress_bar_set_show_text (_tmp4_, TRUE);
+ _tmp5_ = self->priv->bar;
+ gtk_widget_set_size_request ((GtkWidget*) _tmp5_, 225, 25);
gtk_widget_set_size_request ((GtkWidget*) self, 250, 50);
- _tmp9_ = self->priv->bar;
- gtk_box_pack_start (vbox, (GtkWidget*) _tmp9_, TRUE, FALSE, (guint) 0);
+ _tmp6_ = self->priv->bar;
+ gtk_box_pack_start (vbox, (GtkWidget*) _tmp6_, TRUE, FALSE, (guint) 0);
gtk_box_pack_start (hbox, (GtkWidget*) vbox, TRUE, FALSE, (guint) 0);
gtk_container_add ((GtkContainer*) self, (GtkWidget*) hbox);
- _tmp10_ = title;
- gtk_window_set_title ((GtkWindow*) self, _tmp10_);
- _tmp11_ = parent;
- gtk_window_set_transient_for ((GtkWindow*) self, _tmp11_);
+ _tmp7_ = title;
+ gtk_window_set_title ((GtkWindow*) self, _tmp7_);
+ _tmp8_ = parent;
+ gtk_window_set_transient_for ((GtkWindow*) self, _tmp8_);
gtk_window_set_position ((GtkWindow*) self, GTK_WIN_POS_CENTER_ON_PARENT);
gtk_window_set_modal ((GtkWindow*) self, TRUE);
gtk_window_set_resizable ((GtkWindow*) self, FALSE);
gtk_widget_show ((GtkWidget*) hbox);
gtk_widget_show ((GtkWidget*) vbox);
- _tmp12_ = self->priv->bar;
- gtk_widget_show ((GtkWidget*) _tmp12_);
+ _tmp9_ = self->priv->bar;
+ gtk_widget_show ((GtkWidget*) _tmp9_);
_g_object_unref0 (vbox);
_g_object_unref0 (hbox);
return self;
@@ -5058,7 +5004,7 @@ static void progress_bar_dialog_instance_init (ProgressBarDialog * self) {
static void progress_bar_dialog_finalize (GObject* obj) {
ProgressBarDialog * self;
- self = PROGRESS_BAR_DIALOG (obj);
+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PROGRESS_BAR_DIALOG, ProgressBarDialog);
_g_object_unref0 (self->priv->bar);
G_OBJECT_CLASS (progress_bar_dialog_parent_class)->finalize (obj);
}
@@ -5076,374 +5022,6 @@ GType progress_bar_dialog_get_type (void) {
}
-static GType drag_and_drop_handler_target_type_get_type (void) {
- static volatile gsize drag_and_drop_handler_target_type_type_id__volatile = 0;
- if (g_once_init_enter (&drag_and_drop_handler_target_type_type_id__volatile)) {
- static const GEnumValue values[] = {{DRAG_AND_DROP_HANDLER_TARGET_TYPE_IMAGE, "DRAG_AND_DROP_HANDLER_TARGET_TYPE_IMAGE", "image"}, {DRAG_AND_DROP_HANDLER_TARGET_TYPE_URI, "DRAG_AND_DROP_HANDLER_TARGET_TYPE_URI", "uri"}, {0, NULL, NULL}};
- GType drag_and_drop_handler_target_type_type_id;
- drag_and_drop_handler_target_type_type_id = g_enum_register_static ("DragAndDropHandlerTargetType", values);
- g_once_init_leave (&drag_and_drop_handler_target_type_type_id__volatile, drag_and_drop_handler_target_type_type_id);
- }
- return drag_and_drop_handler_target_type_type_id__volatile;
-}
-
-
-static void _drag_and_drop_handler_on_drag_data_get_gtk_widget_drag_data_get (GtkWidget* _sender, GdkDragContext* context, GtkSelectionData* selection_data, guint info, guint time_, gpointer self) {
- drag_and_drop_handler_on_drag_data_get (self, context, selection_data, info, time_);
-}
-
-
-DragAndDropHandler* drag_and_drop_handler_construct (GType object_type, BookView* book_view) {
- DragAndDropHandler* self = NULL;
- BookView* _tmp0_;
- BookView* _tmp1_;
- BookView* _tmp2_;
- GtkWidget* _tmp3_ = NULL;
- GtkWidget* event_source;
- g_return_val_if_fail (book_view != NULL, NULL);
- self = (DragAndDropHandler*) g_type_create_instance (object_type);
- _tmp0_ = book_view;
- _tmp1_ = _g_object_ref0 (_tmp0_);
- _g_object_unref0 (self->priv->book_view);
- self->priv->book_view = _tmp1_;
- _tmp2_ = book_view;
- _tmp3_ = book_view_get_event_source (_tmp2_);
- event_source = _tmp3_;
- drag_and_drop_handler_set_targets (self, event_source);
- g_signal_connect (event_source, "drag-data-get", (GCallback) _drag_and_drop_handler_on_drag_data_get_gtk_widget_drag_data_get, self);
- _g_object_unref0 (event_source);
- return self;
-}
-
-
-DragAndDropHandler* drag_and_drop_handler_new (BookView* book_view) {
- return drag_and_drop_handler_construct (TYPE_DRAG_AND_DROP_HANDLER, book_view);
-}
-
-
-static void drag_and_drop_handler_set_targets (DragAndDropHandler* self, GtkWidget* event_source) {
- GtkTargetEntry* _tmp0_ = NULL;
- GtkTargetEntry* table;
- gint table_length1;
- gint _table_size_;
- GtkTargetList* _tmp1_;
- GtkTargetList* targets;
- GtkWidget* _tmp2_;
- GtkWidget* _tmp3_;
- g_return_if_fail (self != NULL);
- g_return_if_fail (event_source != NULL);
- _tmp0_ = g_new0 (GtkTargetEntry, 0);
- table = _tmp0_;
- table_length1 = 0;
- _table_size_ = table_length1;
- _tmp1_ = gtk_target_list_new (table, table_length1);
- targets = _tmp1_;
- gtk_target_list_add_uri_targets (targets, (guint) DRAG_AND_DROP_HANDLER_TARGET_TYPE_URI);
- gtk_target_list_add_image_targets (targets, (guint) DRAG_AND_DROP_HANDLER_TARGET_TYPE_IMAGE, TRUE);
- _tmp2_ = event_source;
- gtk_drag_source_set (_tmp2_, GDK_BUTTON1_MASK, table, table_length1, GDK_ACTION_COPY);
- _tmp3_ = event_source;
- gtk_drag_source_set_target_list (_tmp3_, targets);
- _gtk_target_list_unref0 (targets);
- table = (g_free (table), NULL);
-}
-
-
-static void drag_and_drop_handler_on_drag_data_get (DragAndDropHandler* self, GdkDragContext* context, GtkSelectionData* selection, guint target_type, guint time) {
- BookView* _tmp0_;
- Page* _tmp1_ = NULL;
- Page* page;
- Page* _tmp2_;
- guint _tmp3_;
- GError * _inner_error_ = NULL;
- g_return_if_fail (self != NULL);
- g_return_if_fail (context != NULL);
- g_return_if_fail (selection != NULL);
- _tmp0_ = self->priv->book_view;
- _tmp1_ = book_view_get_selected (_tmp0_);
- page = _tmp1_;
- _tmp2_ = page;
- g_return_if_fail (_tmp2_ != NULL);
- _tmp3_ = target_type;
- switch (_tmp3_) {
- case DRAG_AND_DROP_HANDLER_TARGET_TYPE_IMAGE:
- {
- Page* _tmp4_;
- GdkPixbuf* _tmp5_ = NULL;
- GdkPixbuf* image;
- GtkSelectionData* _tmp6_;
- GdkPixbuf* _tmp7_;
- _tmp4_ = page;
- _tmp5_ = page_get_image (_tmp4_, TRUE);
- image = _tmp5_;
- _tmp6_ = selection;
- _tmp7_ = image;
- gtk_selection_data_set_pixbuf (_tmp6_, _tmp7_);
- g_debug ("ui.vala:1562: Saving page to pixbuf");
- _g_object_unref0 (image);
- break;
- }
- case DRAG_AND_DROP_HANDLER_TARGET_TYPE_URI:
- {
- gchar* _tmp8_;
- gchar* filetype;
- const gchar* _tmp9_;
- gchar* _tmp10_ = NULL;
- gchar* path;
- const gchar* _tmp11_;
- const gchar* _tmp12_;
- GFile* _tmp13_ = NULL;
- GFile* file;
- GFile* _tmp14_;
- gchar* _tmp15_ = NULL;
- gchar* uri;
- _tmp8_ = g_strdup ("png");
- filetype = _tmp8_;
- _tmp9_ = filetype;
- _tmp10_ = get_temporary_filename ("scanned-page", _tmp9_);
- path = _tmp10_;
- _tmp11_ = path;
- g_return_if_fail (_tmp11_ != NULL);
- _tmp12_ = path;
- _tmp13_ = g_file_new_for_path (_tmp12_);
- file = _tmp13_;
- _tmp14_ = file;
- _tmp15_ = g_file_get_uri (_tmp14_);
- uri = _tmp15_;
- {
- Page* _tmp16_;
- const gchar* _tmp17_;
- GFile* _tmp18_;
- GtkSelectionData* _tmp19_;
- const gchar* _tmp20_;
- gchar* _tmp21_;
- gchar** _tmp22_ = NULL;
- gchar** _tmp23_;
- gint _tmp23__length1;
- const gchar* _tmp24_;
- _tmp16_ = page;
- _tmp17_ = filetype;
- _tmp18_ = file;
- page_save (_tmp16_, _tmp17_, _tmp18_, &_inner_error_);
- if (_inner_error_ != NULL) {
- goto __catch21_g_error;
- }
- _tmp19_ = selection;
- _tmp20_ = uri;
- _tmp21_ = g_strdup (_tmp20_);
- _tmp22_ = g_new0 (gchar*, 1 + 1);
- _tmp22_[0] = _tmp21_;
- _tmp23_ = _tmp22_;
- _tmp23__length1 = 1;
- gtk_selection_data_set_uris (_tmp19_, _tmp23_);
- _tmp23_ = (_vala_array_free (_tmp23_, _tmp23__length1, (GDestroyNotify) g_free), NULL);
- _tmp24_ = uri;
- g_debug ("ui.vala:1577: Saving page to %s", _tmp24_);
- }
- goto __finally21;
- __catch21_g_error:
- {
- GError* e = NULL;
- GError* _tmp25_;
- const gchar* _tmp26_;
- e = _inner_error_;
- _inner_error_ = NULL;
- _tmp25_ = e;
- _tmp26_ = _tmp25_->message;
- g_warning ("ui.vala:1581: Unable to save file using drag-drop %s", _tmp26_);
- _g_error_free0 (e);
- }
- __finally21:
- if (_inner_error_ != NULL) {
- _g_free0 (uri);
- _g_object_unref0 (file);
- _g_free0 (path);
- _g_free0 (filetype);
- _page_unref0 (page);
- g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- return;
- }
- _g_free0 (uri);
- _g_object_unref0 (file);
- _g_free0 (path);
- _g_free0 (filetype);
- break;
- }
- default:
- {
- guint _tmp27_;
- _tmp27_ = target_type;
- g_warning ("ui.vala:1586: Invalid DND target type %u", _tmp27_);
- break;
- }
- }
- _page_unref0 (page);
-}
-
-
-static void value_drag_and_drop_handler_init (GValue* value) {
- value->data[0].v_pointer = NULL;
-}
-
-
-static void value_drag_and_drop_handler_free_value (GValue* value) {
- if (value->data[0].v_pointer) {
- drag_and_drop_handler_unref (value->data[0].v_pointer);
- }
-}
-
-
-static void value_drag_and_drop_handler_copy_value (const GValue* src_value, GValue* dest_value) {
- if (src_value->data[0].v_pointer) {
- dest_value->data[0].v_pointer = drag_and_drop_handler_ref (src_value->data[0].v_pointer);
- } else {
- dest_value->data[0].v_pointer = NULL;
- }
-}
-
-
-static gpointer value_drag_and_drop_handler_peek_pointer (const GValue* value) {
- return value->data[0].v_pointer;
-}
-
-
-static gchar* value_drag_and_drop_handler_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
- if (collect_values[0].v_pointer) {
- DragAndDropHandler* object;
- object = collect_values[0].v_pointer;
- if (object->parent_instance.g_class == NULL) {
- return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
- } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
- return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
- }
- value->data[0].v_pointer = drag_and_drop_handler_ref (object);
- } else {
- value->data[0].v_pointer = NULL;
- }
- return NULL;
-}
-
-
-static gchar* value_drag_and_drop_handler_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
- DragAndDropHandler** object_p;
- object_p = collect_values[0].v_pointer;
- if (!object_p) {
- return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
- }
- if (!value->data[0].v_pointer) {
- *object_p = NULL;
- } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
- *object_p = value->data[0].v_pointer;
- } else {
- *object_p = drag_and_drop_handler_ref (value->data[0].v_pointer);
- }
- return NULL;
-}
-
-
-GParamSpec* param_spec_drag_and_drop_handler (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
- ParamSpecDragAndDropHandler* spec;
- g_return_val_if_fail (g_type_is_a (object_type, TYPE_DRAG_AND_DROP_HANDLER), NULL);
- spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
- G_PARAM_SPEC (spec)->value_type = object_type;
- return G_PARAM_SPEC (spec);
-}
-
-
-gpointer value_get_drag_and_drop_handler (const GValue* value) {
- g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_DRAG_AND_DROP_HANDLER), NULL);
- return value->data[0].v_pointer;
-}
-
-
-void value_set_drag_and_drop_handler (GValue* value, gpointer v_object) {
- DragAndDropHandler* old;
- g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_DRAG_AND_DROP_HANDLER));
- old = value->data[0].v_pointer;
- if (v_object) {
- g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_DRAG_AND_DROP_HANDLER));
- g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
- value->data[0].v_pointer = v_object;
- drag_and_drop_handler_ref (value->data[0].v_pointer);
- } else {
- value->data[0].v_pointer = NULL;
- }
- if (old) {
- drag_and_drop_handler_unref (old);
- }
-}
-
-
-void value_take_drag_and_drop_handler (GValue* value, gpointer v_object) {
- DragAndDropHandler* old;
- g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_DRAG_AND_DROP_HANDLER));
- old = value->data[0].v_pointer;
- if (v_object) {
- g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_DRAG_AND_DROP_HANDLER));
- g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
- value->data[0].v_pointer = v_object;
- } else {
- value->data[0].v_pointer = NULL;
- }
- if (old) {
- drag_and_drop_handler_unref (old);
- }
-}
-
-
-static void drag_and_drop_handler_class_init (DragAndDropHandlerClass * klass) {
- drag_and_drop_handler_parent_class = g_type_class_peek_parent (klass);
- DRAG_AND_DROP_HANDLER_CLASS (klass)->finalize = drag_and_drop_handler_finalize;
- g_type_class_add_private (klass, sizeof (DragAndDropHandlerPrivate));
-}
-
-
-static void drag_and_drop_handler_instance_init (DragAndDropHandler * self) {
- self->priv = DRAG_AND_DROP_HANDLER_GET_PRIVATE (self);
- self->ref_count = 1;
-}
-
-
-static void drag_and_drop_handler_finalize (DragAndDropHandler* obj) {
- DragAndDropHandler * self;
- self = DRAG_AND_DROP_HANDLER (obj);
- _g_object_unref0 (self->priv->book_view);
-}
-
-
-GType drag_and_drop_handler_get_type (void) {
- static volatile gsize drag_and_drop_handler_type_id__volatile = 0;
- if (g_once_init_enter (&drag_and_drop_handler_type_id__volatile)) {
- static const GTypeValueTable g_define_type_value_table = { value_drag_and_drop_handler_init, value_drag_and_drop_handler_free_value, value_drag_and_drop_handler_copy_value, value_drag_and_drop_handler_peek_pointer, "p", value_drag_and_drop_handler_collect_value, "p", value_drag_and_drop_handler_lcopy_value };
- static const GTypeInfo g_define_type_info = { sizeof (DragAndDropHandlerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) drag_and_drop_handler_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DragAndDropHandler), 0, (GInstanceInitFunc) drag_and_drop_handler_instance_init, &g_define_type_value_table };
- static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
- GType drag_and_drop_handler_type_id;
- drag_and_drop_handler_type_id = g_type_register_fundamental (g_type_fundamental_next (), "DragAndDropHandler", &g_define_type_info, &g_define_type_fundamental_info, 0);
- g_once_init_leave (&drag_and_drop_handler_type_id__volatile, drag_and_drop_handler_type_id);
- }
- return drag_and_drop_handler_type_id__volatile;
-}
-
-
-gpointer drag_and_drop_handler_ref (gpointer instance) {
- DragAndDropHandler* self;
- self = instance;
- g_atomic_int_inc (&self->ref_count);
- return instance;
-}
-
-
-void drag_and_drop_handler_unref (gpointer instance) {
- DragAndDropHandler* self;
- self = instance;
- if (g_atomic_int_dec_and_test (&self->ref_count)) {
- DRAG_AND_DROP_HANDLER_GET_CLASS (self)->finalize (self);
- g_type_free_instance ((GTypeInstance *) self);
- }
-}
-
-
gchar* get_temporary_filename (const gchar* prefix, const gchar* extension) {
gchar* result = NULL;
const gchar* _tmp0_;
@@ -5470,13 +5048,13 @@ gchar* get_temporary_filename (const gchar* prefix, const gchar* extension) {
path = _tmp4_;
fd = _tmp5_;
if (_inner_error_ != NULL) {
- goto __catch22_g_error;
+ goto __catch21_g_error;
}
_tmp6_ = fd;
close (_tmp6_);
}
- goto __finally22;
- __catch22_g_error:
+ goto __finally21;
+ __catch21_g_error:
{
GError* e = NULL;
GError* _tmp7_;
@@ -5485,14 +5063,14 @@ gchar* get_temporary_filename (const gchar* prefix, const gchar* extension) {
_inner_error_ = NULL;
_tmp7_ = e;
_tmp8_ = _tmp7_->message;
- g_warning ("ui.vala:1607: Error saving email attachment: %s", _tmp8_);
+ g_warning ("ui.vala:1547: Error saving email attachment: %s", _tmp8_);
result = NULL;
_g_error_free0 (e);
_g_free0 (path);
_g_free0 (filename);
return result;
}
- __finally22:
+ __finally21:
if (_inner_error_ != NULL) {
_g_free0 (path);
_g_free0 (filename);