summaryrefslogtreecommitdiff
path: root/src/ui.c
diff options
context:
space:
mode:
authorAlessio Treglia <alessio@debian.org>2011-09-15 09:50:37 +0200
committerAlessio Treglia <alessio@debian.org>2011-09-15 09:50:37 +0200
commit9097fc9898cbe625774298600a0bb64f71b0fefa (patch)
tree2af66b8acaa9c1fb562169d0e31e39a801e125b5 /src/ui.c
parentd5a65678615027cd6efd4a34d43b945a5b765f73 (diff)
parent23a3dc6838d8b60b0b4b0c3c33e7ba489d3906ff (diff)
Merge commit 'upstream/3.1.91'
Diffstat (limited to 'src/ui.c')
-rw-r--r--src/ui.c3896
1 files changed, 2625 insertions, 1271 deletions
diff --git a/src/ui.c b/src/ui.c
index 93a4506..8f9003c 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -1,4 +1,4 @@
-/* ui.c generated by valac 0.13.1, the Vala compiler
+/* ui.c generated by valac 0.13.4, the Vala compiler
* generated from ui.vala, do not modify */
/*
@@ -428,17 +428,21 @@ static void _simple_scan_page_added_cb_book_page_added (Book* _sender, Page* pag
SimpleScan* simple_scan_construct (GType object_type) {
SimpleScan* self = NULL;
- Book* _tmp0_ = NULL;
- GSettings* _tmp1_ = NULL;
+ Book* _tmp0_;
+ Book* _tmp1_;
+ Book* _tmp2_;
+ GSettings* _tmp3_;
self = (SimpleScan*) g_type_create_instance (object_type);
_tmp0_ = book_new ();
_book_unref0 (self->priv->book);
self->priv->book = _tmp0_;
- g_signal_connect (self->priv->book, "page-removed", (GCallback) _simple_scan_page_removed_cb_book_page_removed, self);
- g_signal_connect (self->priv->book, "page-added", (GCallback) _simple_scan_page_added_cb_book_page_added, self);
- _tmp1_ = g_settings_new ("org.gnome.SimpleScan");
+ _tmp1_ = self->priv->book;
+ g_signal_connect (_tmp1_, "page-removed", (GCallback) _simple_scan_page_removed_cb_book_page_removed, self);
+ _tmp2_ = self->priv->book;
+ g_signal_connect (_tmp2_, "page-added", (GCallback) _simple_scan_page_added_cb_book_page_added, self);
+ _tmp3_ = g_settings_new ("org.gnome.SimpleScan");
_g_object_unref0 (self->priv->settings);
- self->priv->settings = _tmp1_;
+ self->priv->settings = _tmp3_;
simple_scan_load (self);
return self;
}
@@ -450,38 +454,56 @@ SimpleScan* simple_scan_new (void) {
static gboolean simple_scan_find_scan_device (SimpleScan* self, const gchar* device, GtkTreeIter* iter) {
- GtkTreeIter _iter = {0};
+ GtkTreeIter _vala_iter = {0};
gboolean result = FALSE;
gboolean have_iter;
- GtkTreeIter _tmp0_ = {0};
- gboolean _tmp1_;
+ GtkListStore* _tmp0_;
+ GtkTreeIter _tmp1_ = {0};
+ gboolean _tmp2_ = FALSE;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (device != NULL, FALSE);
have_iter = FALSE;
- _tmp1_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) self->priv->device_model, &_tmp0_);
- _iter = _tmp0_;
- if (_tmp1_) {
+ _tmp0_ = self->priv->device_model;
+ _tmp2_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) _tmp0_, &_tmp1_);
+ _vala_iter = _tmp1_;
+ if (_tmp2_) {
{
- gboolean _tmp2_;
- _tmp2_ = TRUE;
+ gboolean _tmp3_;
+ _tmp3_ = TRUE;
while (TRUE) {
+ gboolean _tmp4_;
gchar* d = NULL;
- if (!_tmp2_) {
- gboolean _tmp3_ = FALSE;
- if (!have_iter) {
- gboolean _tmp4_;
- _tmp4_ = gtk_tree_model_iter_next ((GtkTreeModel*) self->priv->device_model, &_iter);
- _tmp3_ = _tmp4_;
+ GtkListStore* _tmp10_;
+ GtkTreeIter _tmp11_;
+ const gchar* _tmp12_;
+ const gchar* _tmp13_;
+ _tmp4_ = _tmp3_;
+ if (!_tmp4_) {
+ gboolean _tmp5_ = FALSE;
+ gboolean _tmp6_;
+ gboolean _tmp9_;
+ _tmp6_ = have_iter;
+ if (!_tmp6_) {
+ GtkListStore* _tmp7_;
+ gboolean _tmp8_ = FALSE;
+ _tmp7_ = self->priv->device_model;
+ _tmp8_ = gtk_tree_model_iter_next ((GtkTreeModel*) _tmp7_, &_vala_iter);
+ _tmp5_ = _tmp8_;
} else {
- _tmp3_ = FALSE;
+ _tmp5_ = FALSE;
}
- if (!_tmp3_) {
+ _tmp9_ = _tmp5_;
+ if (!_tmp9_) {
break;
}
}
- _tmp2_ = FALSE;
- gtk_tree_model_get ((GtkTreeModel*) self->priv->device_model, &_iter, 0, &d, -1, -1);
- if (g_strcmp0 (d, device) == 0) {
+ _tmp3_ = FALSE;
+ _tmp10_ = self->priv->device_model;
+ _tmp11_ = _vala_iter;
+ gtk_tree_model_get ((GtkTreeModel*) _tmp10_, &_tmp11_, 0, &d, -1, -1);
+ _tmp12_ = d;
+ _tmp13_ = device;
+ if (g_strcmp0 (_tmp12_, _tmp13_) == 0) {
have_iter = TRUE;
}
_g_free0 (d);
@@ -490,84 +512,114 @@ static gboolean simple_scan_find_scan_device (SimpleScan* self, const gchar* dev
}
result = have_iter;
if (iter) {
- *iter = _iter;
+ *iter = _vala_iter;
}
return result;
}
static void simple_scan_show_error_dialog (SimpleScan* self, const gchar* error_title, const gchar* error_text) {
- GtkMessageDialog* _tmp0_ = NULL;
+ GtkWindow* _tmp0_;
+ const gchar* _tmp1_;
+ GtkMessageDialog* _tmp2_;
+ GtkMessageDialog* _tmp3_;
GtkMessageDialog* dialog;
+ const gchar* _tmp4_;
g_return_if_fail (self != NULL);
g_return_if_fail (error_title != NULL);
g_return_if_fail (error_text != NULL);
- _tmp0_ = (GtkMessageDialog*) gtk_message_dialog_new (self->priv->window, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE, "%s", error_title);
- dialog = g_object_ref_sink (_tmp0_);
+ _tmp0_ = self->priv->window;
+ _tmp1_ = error_title;
+ _tmp2_ = (GtkMessageDialog*) gtk_message_dialog_new (_tmp0_, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE, "%s", _tmp1_);
+ _tmp3_ = g_object_ref_sink (_tmp2_);
+ dialog = _tmp3_;
gtk_dialog_add_button ((GtkDialog*) dialog, GTK_STOCK_CLOSE, 0);
- gtk_message_dialog_format_secondary_text (dialog, "%s", error_text, NULL);
+ _tmp4_ = error_text;
+ gtk_message_dialog_format_secondary_text (dialog, "%s", _tmp4_);
gtk_widget_destroy ((GtkWidget*) dialog);
_g_object_unref0 (dialog);
}
void simple_scan_set_default_file_name (SimpleScan* self, const gchar* default_file_name) {
- gchar* _tmp0_;
+ const gchar* _tmp0_;
+ gchar* _tmp1_;
g_return_if_fail (self != NULL);
g_return_if_fail (default_file_name != NULL);
- _tmp0_ = g_strdup (default_file_name);
+ _tmp0_ = default_file_name;
+ _tmp1_ = g_strdup (_tmp0_);
_g_free0 (self->priv->default_file_name);
- self->priv->default_file_name = _tmp0_;
+ self->priv->default_file_name = _tmp1_;
}
void simple_scan_authorize (SimpleScan* self, const gchar* resource, gchar** username, gchar** password) {
- gchar* _username = NULL;
- gchar* _password = NULL;
+ gchar* _vala_username = NULL;
+ gchar* _vala_password = NULL;
const gchar* _tmp0_ = NULL;
- gchar* _tmp1_ = NULL;
+ const gchar* _tmp1_;
+ gchar* _tmp2_ = NULL;
gchar* description;
- const gchar* _tmp2_ = NULL;
- gchar* _tmp3_;
- const gchar* _tmp4_ = NULL;
- gchar* _tmp5_;
+ GtkEntry* _tmp3_;
+ GtkEntry* _tmp4_;
+ GtkLabel* _tmp5_;
+ GtkDialog* _tmp6_;
+ GtkDialog* _tmp7_;
+ GtkDialog* _tmp8_;
+ GtkEntry* _tmp9_;
+ const gchar* _tmp10_ = NULL;
+ gchar* _tmp11_;
+ GtkEntry* _tmp12_;
+ const gchar* _tmp13_ = NULL;
+ gchar* _tmp14_;
g_return_if_fail (self != NULL);
g_return_if_fail (resource != NULL);
_tmp0_ = _ ("Username and password required to access '%s'");
- _tmp1_ = g_strdup_printf (_tmp0_, resource);
- description = _tmp1_;
- gtk_entry_set_text (self->priv->username_entry, "");
- gtk_entry_set_text (self->priv->password_entry, "");
- gtk_label_set_text (self->priv->authorize_label, description);
- gtk_widget_show ((GtkWidget*) self->priv->authorize_dialog);
- gtk_dialog_run (self->priv->authorize_dialog);
- gtk_widget_hide ((GtkWidget*) self->priv->authorize_dialog);
- _tmp2_ = gtk_entry_get_text (self->priv->username_entry);
- _tmp3_ = g_strdup (_tmp2_);
- _g_free0 (_username);
- _username = _tmp3_;
- _tmp4_ = gtk_entry_get_text (self->priv->password_entry);
- _tmp5_ = g_strdup (_tmp4_);
- _g_free0 (_password);
- _password = _tmp5_;
+ _tmp1_ = resource;
+ _tmp2_ = g_strdup_printf (_tmp0_, _tmp1_);
+ description = _tmp2_;
+ _tmp3_ = self->priv->username_entry;
+ gtk_entry_set_text (_tmp3_, "");
+ _tmp4_ = self->priv->password_entry;
+ gtk_entry_set_text (_tmp4_, "");
+ _tmp5_ = self->priv->authorize_label;
+ gtk_label_set_text (_tmp5_, description);
+ _tmp6_ = self->priv->authorize_dialog;
+ gtk_widget_show ((GtkWidget*) _tmp6_);
+ _tmp7_ = self->priv->authorize_dialog;
+ gtk_dialog_run (_tmp7_);
+ _tmp8_ = self->priv->authorize_dialog;
+ gtk_widget_hide ((GtkWidget*) _tmp8_);
+ _tmp9_ = self->priv->username_entry;
+ _tmp10_ = gtk_entry_get_text (_tmp9_);
+ _tmp11_ = g_strdup (_tmp10_);
+ _g_free0 (_vala_username);
+ _vala_username = _tmp11_;
+ _tmp12_ = self->priv->password_entry;
+ _tmp13_ = gtk_entry_get_text (_tmp12_);
+ _tmp14_ = g_strdup (_tmp13_);
+ _g_free0 (_vala_password);
+ _vala_password = _tmp14_;
_g_free0 (description);
if (username) {
- *username = _username;
+ *username = _vala_username;
} else {
- _g_free0 (_username);
+ _g_free0 (_vala_username);
}
if (password) {
- *password = _password;
+ *password = _vala_password;
} else {
- _g_free0 (_password);
+ _g_free0 (_vala_password);
}
}
void G_MODULE_EXPORT device_combo_changed_cb (GtkWidget* widget, SimpleScan* self) {
+ gboolean _tmp0_;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
- if (self->priv->setting_devices) {
+ _tmp0_ = self->priv->setting_devices;
+ if (_tmp0_) {
return;
}
self->priv->user_selected_device = TRUE;
@@ -581,64 +633,102 @@ static void simple_scan_update_info_bar (SimpleScan* self) {
gchar* image_id = NULL;
gboolean show_close_button;
gboolean show_change_scanner_button;
- gchar* _tmp9_ = NULL;
+ gboolean _tmp0_;
+ GtkInfoBar* _tmp15_;
+ GtkMessageType _tmp16_;
+ GtkImage* _tmp17_;
+ const gchar* _tmp18_;
+ const gchar* _tmp19_;
+ const gchar* _tmp20_;
+ gchar* _tmp21_ = NULL;
gchar* message;
+ GtkLabel* _tmp22_;
+ const gchar* _tmp23_;
+ GtkButton* _tmp24_;
+ gboolean _tmp25_;
+ GtkButton* _tmp26_;
+ gboolean _tmp27_;
+ GtkInfoBar* _tmp28_;
g_return_if_fail (self != NULL);
show_close_button = FALSE;
show_change_scanner_button = FALSE;
- if (self->priv->have_error) {
- gchar* _tmp0_;
+ _tmp0_ = self->priv->have_error;
+ if (_tmp0_) {
gchar* _tmp1_;
- gchar* _tmp2_;
+ const gchar* _tmp2_;
+ gchar* _tmp3_;
+ const gchar* _tmp4_;
+ gchar* _tmp5_;
+ gboolean _tmp6_;
type = GTK_MESSAGE_ERROR;
- _tmp0_ = g_strdup (GTK_STOCK_DIALOG_ERROR);
+ _tmp1_ = g_strdup (GTK_STOCK_DIALOG_ERROR);
_g_free0 (image_id);
- image_id = _tmp0_;
- _tmp1_ = g_strdup (self->priv->error_title);
+ image_id = _tmp1_;
+ _tmp2_ = self->priv->error_title;
+ _tmp3_ = g_strdup (_tmp2_);
_g_free0 (title);
- title = _tmp1_;
- _tmp2_ = g_strdup (self->priv->error_text);
+ title = _tmp3_;
+ _tmp4_ = self->priv->error_text;
+ _tmp5_ = g_strdup (_tmp4_);
_g_free0 (text);
- text = _tmp2_;
+ text = _tmp5_;
show_close_button = TRUE;
- show_change_scanner_button = self->priv->error_change_scanner_hint;
+ _tmp6_ = self->priv->error_change_scanner_hint;
+ show_change_scanner_button = _tmp6_;
} else {
- gint _tmp3_;
- _tmp3_ = gtk_tree_model_iter_n_children ((GtkTreeModel*) self->priv->device_model, NULL);
- if (_tmp3_ == 0) {
- gchar* _tmp4_;
- const gchar* _tmp5_ = NULL;
- gchar* _tmp6_;
- const gchar* _tmp7_ = NULL;
- gchar* _tmp8_;
+ GtkListStore* _tmp7_;
+ gint _tmp8_ = 0;
+ _tmp7_ = self->priv->device_model;
+ _tmp8_ = gtk_tree_model_iter_n_children ((GtkTreeModel*) _tmp7_, NULL);
+ if (_tmp8_ == 0) {
+ gchar* _tmp9_;
+ const gchar* _tmp10_ = NULL;
+ gchar* _tmp11_;
+ const gchar* _tmp12_ = NULL;
+ gchar* _tmp13_;
type = GTK_MESSAGE_WARNING;
- _tmp4_ = g_strdup (GTK_STOCK_DIALOG_WARNING);
+ _tmp9_ = g_strdup (GTK_STOCK_DIALOG_WARNING);
_g_free0 (image_id);
- image_id = _tmp4_;
- _tmp5_ = _ ("No scanners detected");
- _tmp6_ = g_strdup (_tmp5_);
+ image_id = _tmp9_;
+ _tmp10_ = _ ("No scanners detected");
+ _tmp11_ = g_strdup (_tmp10_);
_g_free0 (title);
- title = _tmp6_;
- _tmp7_ = _ ("Please check your scanner is connected and powered on");
- _tmp8_ = g_strdup (_tmp7_);
+ title = _tmp11_;
+ _tmp12_ = _ ("Please check your scanner is connected and powered on");
+ _tmp13_ = g_strdup (_tmp12_);
_g_free0 (text);
- text = _tmp8_;
+ text = _tmp13_;
} else {
- gtk_widget_hide ((GtkWidget*) self->priv->info_bar);
+ GtkInfoBar* _tmp14_;
+ _tmp14_ = self->priv->info_bar;
+ gtk_widget_hide ((GtkWidget*) _tmp14_);
_g_free0 (image_id);
_g_free0 (text);
_g_free0 (title);
return;
}
}
- gtk_info_bar_set_message_type (self->priv->info_bar, type);
- gtk_image_set_from_stock (self->priv->info_bar_image, image_id, GTK_ICON_SIZE_DIALOG);
- _tmp9_ = g_strdup_printf ("<big><b>%s</b></big>\n\n%s", title, text);
- message = _tmp9_;
- gtk_label_set_markup (self->priv->info_bar_label, message);
- gtk_widget_set_visible ((GtkWidget*) self->priv->info_bar_close_button, show_close_button);
- gtk_widget_set_visible ((GtkWidget*) self->priv->info_bar_change_scanner_button, show_change_scanner_button);
- gtk_widget_show ((GtkWidget*) self->priv->info_bar);
+ _tmp15_ = self->priv->info_bar;
+ _tmp16_ = type;
+ gtk_info_bar_set_message_type (_tmp15_, _tmp16_);
+ _tmp17_ = self->priv->info_bar_image;
+ _tmp18_ = image_id;
+ gtk_image_set_from_stock (_tmp17_, _tmp18_, GTK_ICON_SIZE_DIALOG);
+ _tmp19_ = title;
+ _tmp20_ = text;
+ _tmp21_ = g_strdup_printf ("<big><b>%s</b></big>\n\n%s", _tmp19_, _tmp20_);
+ message = _tmp21_;
+ _tmp22_ = self->priv->info_bar_label;
+ _tmp23_ = message;
+ gtk_label_set_markup (_tmp22_, _tmp23_);
+ _tmp24_ = self->priv->info_bar_close_button;
+ _tmp25_ = show_close_button;
+ gtk_widget_set_visible ((GtkWidget*) _tmp24_, _tmp25_);
+ _tmp26_ = self->priv->info_bar_change_scanner_button;
+ _tmp27_ = show_change_scanner_button;
+ gtk_widget_set_visible ((GtkWidget*) _tmp26_, _tmp27_);
+ _tmp28_ = self->priv->info_bar;
+ gtk_widget_show ((GtkWidget*) _tmp28_);
_g_free0 (message);
_g_free0 (image_id);
_g_free0 (text);
@@ -655,110 +745,200 @@ void simple_scan_set_scan_devices (SimpleScan* self, GList* devices) {
gboolean have_selection;
gint index = 0;
GtkTreeIter iter = {0};
- gboolean _tmp11_ = FALSE;
+ gboolean _tmp0_;
+ GList* _tmp3_;
+ gboolean _tmp52_ = FALSE;
+ gboolean _tmp53_;
+ gboolean _tmp55_;
g_return_if_fail (self != NULL);
have_selection = FALSE;
self->priv->setting_devices = TRUE;
- if (self->priv->user_selected_device) {
- gint _tmp0_;
- _tmp0_ = gtk_combo_box_get_active (self->priv->device_combo);
- have_selection = _tmp0_ >= 0;
+ _tmp0_ = self->priv->user_selected_device;
+ if (_tmp0_) {
+ GtkComboBox* _tmp1_;
+ gint _tmp2_ = 0;
+ _tmp1_ = self->priv->device_combo;
+ _tmp2_ = gtk_combo_box_get_active (_tmp1_);
+ have_selection = _tmp2_ >= 0;
}
index = 0;
+ _tmp3_ = devices;
{
GList* device_collection = NULL;
GList* device_it = NULL;
- device_collection = devices;
+ device_collection = _tmp3_;
for (device_it = device_collection; device_it != NULL; device_it = device_it->next) {
- ScanDevice* _tmp1_;
+ ScanDevice* _tmp4_;
ScanDevice* device = NULL;
- _tmp1_ = _scan_device_ref0 ((ScanDevice*) device_it->data);
- device = _tmp1_;
+ _tmp4_ = _scan_device_ref0 ((ScanDevice*) device_it->data);
+ device = _tmp4_;
{
gint n_delete;
- GtkTreeIter _tmp2_ = {0};
- gboolean _tmp3_;
+ GtkListStore* _tmp5_;
+ gint _tmp6_;
+ GtkTreeIter _tmp7_ = {0};
+ gboolean _tmp8_ = FALSE;
+ gint _tmp21_;
+ gint _tmp45_;
n_delete = -1;
- _tmp3_ = gtk_tree_model_iter_nth_child ((GtkTreeModel*) self->priv->device_model, &_tmp2_, NULL, index);
- iter = _tmp2_;
- if (_tmp3_) {
+ _tmp5_ = self->priv->device_model;
+ _tmp6_ = index;
+ _tmp8_ = gtk_tree_model_iter_nth_child ((GtkTreeModel*) _tmp5_, &_tmp7_, NULL, _tmp6_);
+ iter = _tmp7_;
+ if (_tmp8_) {
gint i;
i = 0;
{
- gboolean _tmp4_;
- _tmp4_ = TRUE;
+ gboolean _tmp9_;
+ _tmp9_ = TRUE;
while (TRUE) {
+ gboolean _tmp10_;
gchar* name = NULL;
gboolean matched = FALSE;
- if (!_tmp4_) {
- gboolean _tmp5_;
- _tmp5_ = gtk_tree_model_iter_next ((GtkTreeModel*) self->priv->device_model, &iter);
- if (!_tmp5_) {
+ GtkListStore* _tmp13_;
+ GtkTreeIter _tmp14_;
+ const gchar* _tmp15_;
+ ScanDevice* _tmp16_;
+ const gchar* _tmp17_;
+ gboolean _tmp18_;
+ gint _tmp20_;
+ _tmp10_ = _tmp9_;
+ if (!_tmp10_) {
+ GtkListStore* _tmp11_;
+ gboolean _tmp12_ = FALSE;
+ _tmp11_ = self->priv->device_model;
+ _tmp12_ = gtk_tree_model_iter_next ((GtkTreeModel*) _tmp11_, &iter);
+ if (!_tmp12_) {
break;
}
}
- _tmp4_ = FALSE;
- gtk_tree_model_get ((GtkTreeModel*) self->priv->device_model, &iter, 0, &name, -1, -1);
- matched = g_strcmp0 (name, device->name) == 0;
- if (matched) {
- n_delete = i;
+ _tmp9_ = FALSE;
+ _tmp13_ = self->priv->device_model;
+ _tmp14_ = iter;
+ gtk_tree_model_get ((GtkTreeModel*) _tmp13_, &_tmp14_, 0, &name, -1, -1);
+ _tmp15_ = name;
+ _tmp16_ = device;
+ _tmp17_ = _tmp16_->name;
+ matched = g_strcmp0 (_tmp15_, _tmp17_) == 0;
+ _tmp18_ = matched;
+ if (_tmp18_) {
+ gint _tmp19_;
+ _tmp19_ = i;
+ n_delete = _tmp19_;
_g_free0 (name);
break;
}
- i++;
+ _tmp20_ = i;
+ i = _tmp20_ + 1;
_g_free0 (name);
}
}
}
- if (n_delete >= 0) {
+ _tmp21_ = n_delete;
+ if (_tmp21_ >= 0) {
gint i = 0;
- gtk_list_store_set (self->priv->device_model, &iter, 1, device->label, -1, -1);
+ GtkListStore* _tmp22_;
+ GtkTreeIter _tmp23_;
+ ScanDevice* _tmp24_;
+ const gchar* _tmp25_;
+ _tmp22_ = self->priv->device_model;
+ _tmp23_ = iter;
+ _tmp24_ = device;
+ _tmp25_ = _tmp24_->label;
+ gtk_list_store_set (_tmp22_, &_tmp23_, 1, _tmp25_, -1, -1);
{
- gboolean _tmp6_;
+ gboolean _tmp26_;
i = 0;
- _tmp6_ = TRUE;
+ _tmp26_ = TRUE;
while (TRUE) {
- GtkTreeIter _tmp7_ = {0};
- if (!_tmp6_) {
- i++;
+ gboolean _tmp27_;
+ gint _tmp29_;
+ gint _tmp30_;
+ GtkListStore* _tmp31_;
+ gint _tmp32_;
+ GtkTreeIter _tmp33_ = {0};
+ GtkListStore* _tmp34_;
+ GtkTreeIter _tmp35_;
+ _tmp27_ = _tmp26_;
+ if (!_tmp27_) {
+ gint _tmp28_;
+ _tmp28_ = i;
+ i = _tmp28_ + 1;
}
- _tmp6_ = FALSE;
- if (!(i < n_delete)) {
+ _tmp26_ = FALSE;
+ _tmp29_ = i;
+ _tmp30_ = n_delete;
+ if (!(_tmp29_ < _tmp30_)) {
break;
}
- gtk_tree_model_iter_nth_child ((GtkTreeModel*) self->priv->device_model, &_tmp7_, NULL, index);
- iter = _tmp7_;
- gtk_list_store_remove (self->priv->device_model, &iter);
+ _tmp31_ = self->priv->device_model;
+ _tmp32_ = index;
+ gtk_tree_model_iter_nth_child ((GtkTreeModel*) _tmp31_, &_tmp33_, NULL, _tmp32_);
+ iter = _tmp33_;
+ _tmp34_ = self->priv->device_model;
+ _tmp35_ = iter;
+ gtk_list_store_remove (_tmp34_, &_tmp35_);
}
}
} else {
- GtkTreeIter _tmp8_ = {0};
- gtk_list_store_insert (self->priv->device_model, &_tmp8_, index);
- iter = _tmp8_;
- gtk_list_store_set (self->priv->device_model, &iter, 0, device->name, 1, device->label, -1, -1);
+ GtkListStore* _tmp36_;
+ gint _tmp37_;
+ GtkTreeIter _tmp38_ = {0};
+ GtkListStore* _tmp39_;
+ GtkTreeIter _tmp40_;
+ ScanDevice* _tmp41_;
+ const gchar* _tmp42_;
+ ScanDevice* _tmp43_;
+ const gchar* _tmp44_;
+ _tmp36_ = self->priv->device_model;
+ _tmp37_ = index;
+ gtk_list_store_insert (_tmp36_, &_tmp38_, _tmp37_);
+ iter = _tmp38_;
+ _tmp39_ = self->priv->device_model;
+ _tmp40_ = iter;
+ _tmp41_ = device;
+ _tmp42_ = _tmp41_->name;
+ _tmp43_ = device;
+ _tmp44_ = _tmp43_->label;
+ gtk_list_store_set (_tmp39_, &_tmp40_, 0, _tmp42_, 1, _tmp44_, -1, -1);
}
- index++;
+ _tmp45_ = index;
+ index = _tmp45_ + 1;
_scan_device_unref0 (device);
}
}
}
while (TRUE) {
- GtkTreeIter _tmp9_ = {0};
- gboolean _tmp10_;
- _tmp10_ = gtk_tree_model_iter_nth_child ((GtkTreeModel*) self->priv->device_model, &_tmp9_, NULL, index);
- iter = _tmp9_;
- if (!_tmp10_) {
+ GtkListStore* _tmp46_;
+ gint _tmp47_;
+ GtkTreeIter _tmp48_ = {0};
+ gboolean _tmp49_ = FALSE;
+ GtkListStore* _tmp50_;
+ GtkTreeIter _tmp51_;
+ _tmp46_ = self->priv->device_model;
+ _tmp47_ = index;
+ _tmp49_ = gtk_tree_model_iter_nth_child ((GtkTreeModel*) _tmp46_, &_tmp48_, NULL, _tmp47_);
+ iter = _tmp48_;
+ if (!_tmp49_) {
break;
}
- gtk_list_store_remove (self->priv->device_model, &iter);
+ _tmp50_ = self->priv->device_model;
+ _tmp51_ = iter;
+ gtk_list_store_remove (_tmp50_, &_tmp51_);
}
- if (!have_selection) {
- _tmp11_ = devices != NULL;
+ _tmp53_ = have_selection;
+ if (!_tmp53_) {
+ GList* _tmp54_;
+ _tmp54_ = devices;
+ _tmp52_ = _tmp54_ != NULL;
} else {
- _tmp11_ = FALSE;
+ _tmp52_ = FALSE;
}
- if (_tmp11_) {
- gtk_combo_box_set_active (self->priv->device_combo, 0);
+ _tmp55_ = _tmp52_;
+ if (_tmp55_) {
+ GtkComboBox* _tmp56_;
+ _tmp56_ = self->priv->device_combo;
+ gtk_combo_box_set_active (_tmp56_, 0);
}
self->priv->setting_devices = FALSE;
simple_scan_update_info_bar (self);
@@ -768,14 +948,20 @@ void simple_scan_set_scan_devices (SimpleScan* self, GList* devices) {
static gchar* simple_scan_get_selected_device (SimpleScan* self) {
gchar* result = NULL;
GtkTreeIter iter = {0};
- GtkTreeIter _tmp0_ = {0};
- gboolean _tmp1_;
+ GtkComboBox* _tmp0_;
+ GtkTreeIter _tmp1_ = {0};
+ gboolean _tmp2_ = FALSE;
g_return_val_if_fail (self != NULL, NULL);
- _tmp1_ = gtk_combo_box_get_active_iter (self->priv->device_combo, &_tmp0_);
- iter = _tmp0_;
- if (_tmp1_) {
+ _tmp0_ = self->priv->device_combo;
+ _tmp2_ = gtk_combo_box_get_active_iter (_tmp0_, &_tmp1_);
+ iter = _tmp1_;
+ if (_tmp2_) {
gchar* device = NULL;
- gtk_tree_model_get ((GtkTreeModel*) self->priv->device_model, &iter, 0, &device, -1, -1);
+ GtkListStore* _tmp3_;
+ GtkTreeIter _tmp4_;
+ _tmp3_ = self->priv->device_model;
+ _tmp4_ = iter;
+ gtk_tree_model_get ((GtkTreeModel*) _tmp3_, &_tmp4_, 0, &device, -1, -1);
result = device;
return result;
}
@@ -786,27 +972,45 @@ static gchar* simple_scan_get_selected_device (SimpleScan* self) {
void simple_scan_set_selected_device (SimpleScan* self, const gchar* device) {
GtkTreeIter iter = {0};
- GtkTreeIter _tmp0_ = {0};
- gboolean _tmp1_;
+ const gchar* _tmp0_;
+ GtkTreeIter _tmp1_ = {0};
+ gboolean _tmp2_ = FALSE;
+ GtkComboBox* _tmp3_;
+ GtkTreeIter _tmp4_;
g_return_if_fail (self != NULL);
g_return_if_fail (device != NULL);
- _tmp1_ = simple_scan_find_scan_device (self, device, &_tmp0_);
- iter = _tmp0_;
- if (!_tmp1_) {
+ _tmp0_ = device;
+ _tmp2_ = simple_scan_find_scan_device (self, _tmp0_, &_tmp1_);
+ iter = _tmp1_;
+ if (!_tmp2_) {
return;
}
- gtk_combo_box_set_active_iter (self->priv->device_combo, &iter);
+ _tmp3_ = self->priv->device_combo;
+ _tmp4_ = iter;
+ gtk_combo_box_set_active_iter (_tmp3_, &_tmp4_);
self->priv->user_selected_device = TRUE;
}
static void simple_scan_add_default_page (SimpleScan* self) {
- Page* _tmp0_ = NULL;
+ Book* _tmp0_;
+ gint _tmp1_;
+ gint _tmp2_;
+ gint _tmp3_;
+ ScanDirection _tmp4_;
+ Page* _tmp5_ = NULL;
Page* page;
+ BookView* _tmp6_;
g_return_if_fail (self != NULL);
- _tmp0_ = book_append_page (self->priv->book, self->priv->default_page_width, self->priv->default_page_height, self->priv->default_page_dpi, self->priv->default_page_scan_direction);
- page = _tmp0_;
- book_view_select_page (self->priv->book_view, page);
+ _tmp0_ = self->priv->book;
+ _tmp1_ = self->priv->default_page_width;
+ _tmp2_ = self->priv->default_page_height;
+ _tmp3_ = self->priv->default_page_dpi;
+ _tmp4_ = self->priv->default_page_scan_direction;
+ _tmp5_ = book_append_page (_tmp0_, _tmp1_, _tmp2_, _tmp3_, _tmp4_);
+ page = _tmp5_;
+ _tmp6_ = self->priv->book_view;
+ book_view_select_page (_tmp6_, page);
_page_unref0 (page);
}
@@ -818,13 +1022,21 @@ static gpointer _g_object_ref0 (gpointer self) {
static gint string_last_index_of_char (const gchar* self, gunichar c, gint start_index) {
gint result = 0;
- gchar* _tmp0_ = NULL;
+ gint _tmp0_;
+ gunichar _tmp1_;
+ gchar* _tmp2_ = NULL;
gchar* _result_;
+ gchar* _tmp3_;
g_return_val_if_fail (self != NULL, 0);
- _tmp0_ = g_utf8_strrchr (((gchar*) self) + start_index, (gssize) (-1), c);
- _result_ = _tmp0_;
- if (_result_ != NULL) {
- result = (gint) (_result_ - ((gchar*) self));
+ _tmp0_ = start_index;
+ _tmp1_ = c;
+ _tmp2_ = g_utf8_strrchr (((gchar*) self) + _tmp0_, (gssize) (-1), _tmp1_);
+ _result_ = _tmp2_;
+ _tmp3_ = _result_;
+ if (_tmp3_ != NULL) {
+ gchar* _tmp4_;
+ _tmp4_ = _result_;
+ result = (gint) (_tmp4_ - ((gchar*) self));
return result;
} else {
result = -1;
@@ -836,34 +1048,74 @@ static gint string_last_index_of_char (const gchar* self, gunichar c, gint start
static gchar* string_slice (const gchar* self, glong start, glong end) {
gchar* result = NULL;
gint _tmp0_;
+ gint _tmp1_;
glong string_length;
- gboolean _tmp1_ = FALSE;
- gboolean _tmp2_ = FALSE;
- gchar* _tmp3_ = NULL;
+ glong _tmp2_;
+ glong _tmp5_;
+ gboolean _tmp8_ = FALSE;
+ glong _tmp9_;
+ gboolean _tmp12_;
+ gboolean _tmp13_ = FALSE;
+ glong _tmp14_;
+ gboolean _tmp17_;
+ glong _tmp18_;
+ glong _tmp19_;
+ glong _tmp20_;
+ glong _tmp21_;
+ glong _tmp22_;
+ gchar* _tmp23_ = NULL;
g_return_val_if_fail (self != NULL, NULL);
_tmp0_ = strlen (self);
- string_length = (glong) _tmp0_;
- if (start < ((glong) 0)) {
- start = string_length + start;
+ _tmp1_ = _tmp0_;
+ string_length = (glong) _tmp1_;
+ _tmp2_ = start;
+ if (_tmp2_ < ((glong) 0)) {
+ glong _tmp3_;
+ glong _tmp4_;
+ _tmp3_ = string_length;
+ _tmp4_ = start;
+ start = _tmp3_ + _tmp4_;
}
- if (end < ((glong) 0)) {
- end = string_length + end;
+ _tmp5_ = end;
+ if (_tmp5_ < ((glong) 0)) {
+ glong _tmp6_;
+ glong _tmp7_;
+ _tmp6_ = string_length;
+ _tmp7_ = end;
+ end = _tmp6_ + _tmp7_;
}
- if (start >= ((glong) 0)) {
- _tmp1_ = start <= string_length;
+ _tmp9_ = start;
+ if (_tmp9_ >= ((glong) 0)) {
+ glong _tmp10_;
+ glong _tmp11_;
+ _tmp10_ = start;
+ _tmp11_ = string_length;
+ _tmp8_ = _tmp10_ <= _tmp11_;
} else {
- _tmp1_ = FALSE;
+ _tmp8_ = FALSE;
}
- g_return_val_if_fail (_tmp1_, NULL);
- if (end >= ((glong) 0)) {
- _tmp2_ = end <= string_length;
+ _tmp12_ = _tmp8_;
+ g_return_val_if_fail (_tmp12_, NULL);
+ _tmp14_ = end;
+ if (_tmp14_ >= ((glong) 0)) {
+ glong _tmp15_;
+ glong _tmp16_;
+ _tmp15_ = end;
+ _tmp16_ = string_length;
+ _tmp13_ = _tmp15_ <= _tmp16_;
} else {
- _tmp2_ = FALSE;
+ _tmp13_ = FALSE;
}
- g_return_val_if_fail (_tmp2_, NULL);
- g_return_val_if_fail (start <= end, NULL);
- _tmp3_ = g_strndup (((gchar*) self) + start, (gsize) (end - start));
- result = _tmp3_;
+ _tmp17_ = _tmp13_;
+ g_return_val_if_fail (_tmp17_, NULL);
+ _tmp18_ = start;
+ _tmp19_ = end;
+ g_return_val_if_fail (_tmp18_ <= _tmp19_, NULL);
+ _tmp20_ = start;
+ _tmp21_ = end;
+ _tmp22_ = start;
+ _tmp23_ = g_strndup (((gchar*) self) + _tmp20_, (gsize) (_tmp21_ - _tmp22_));
+ result = _tmp23_;
return result;
}
@@ -871,46 +1123,72 @@ static gchar* string_slice (const gchar* self, glong start, glong end) {
static void simple_scan_on_file_type_changed (SimpleScan* self, GtkTreeSelection* selection) {
GtkTreeModel* model = NULL;
GtkTreeIter iter = {0};
- GtkTreeModel* _tmp0_ = NULL;
- GtkTreeIter _tmp1_ = {0};
- gboolean _tmp2_;
- GtkTreeModel* _tmp3_;
+ GtkTreeSelection* _tmp0_;
+ GtkTreeModel* _tmp1_ = NULL;
+ GtkTreeIter _tmp2_ = {0};
+ gboolean _tmp3_ = FALSE;
+ GtkTreeModel* _tmp4_;
gchar* extension = NULL;
- gchar* _tmp4_ = NULL;
+ GtkTreeModel* _tmp5_;
+ GtkTreeIter _tmp6_;
+ GtkFileChooserDialog* _tmp7_;
+ gchar* _tmp8_ = NULL;
gchar* path;
- gchar* _tmp5_ = NULL;
+ const gchar* _tmp9_;
+ gchar* _tmp10_ = NULL;
gchar* filename;
- gint _tmp6_;
+ const gchar* _tmp11_;
+ gint _tmp12_ = 0;
gint extension_index;
- gchar* _tmp8_;
+ gint _tmp13_;
+ const gchar* _tmp17_;
+ const gchar* _tmp18_;
+ gchar* _tmp19_;
+ GtkFileChooserDialog* _tmp20_;
+ const gchar* _tmp21_;
g_return_if_fail (self != NULL);
g_return_if_fail (selection != NULL);
- _tmp2_ = gtk_tree_selection_get_selected (selection, &_tmp0_, &_tmp1_);
+ _tmp0_ = selection;
+ _tmp3_ = gtk_tree_selection_get_selected (_tmp0_, &_tmp1_, &_tmp2_);
_g_object_unref0 (model);
- _tmp3_ = _g_object_ref0 (_tmp0_);
- model = _tmp3_;
- iter = _tmp1_;
- if (!_tmp2_) {
+ _tmp4_ = _g_object_ref0 (_tmp1_);
+ model = _tmp4_;
+ iter = _tmp2_;
+ if (!_tmp3_) {
_g_object_unref0 (model);
return;
}
- gtk_tree_model_get (model, &iter, 1, &extension, -1, -1);
- _tmp4_ = gtk_file_chooser_get_filename ((GtkFileChooser*) self->priv->save_dialog);
- path = _tmp4_;
- _tmp5_ = g_path_get_basename (path);
- filename = _tmp5_;
- _tmp6_ = string_last_index_of_char (filename, (gunichar) '.', 0);
- extension_index = _tmp6_;
- if (extension_index >= 0) {
- gchar* _tmp7_ = NULL;
- _tmp7_ = string_slice (filename, (glong) 0, (glong) extension_index);
+ _tmp5_ = model;
+ _tmp6_ = iter;
+ gtk_tree_model_get (_tmp5_, &_tmp6_, 1, &extension, -1, -1);
+ _tmp7_ = self->priv->save_dialog;
+ _tmp8_ = gtk_file_chooser_get_filename ((GtkFileChooser*) _tmp7_);
+ path = _tmp8_;
+ _tmp9_ = path;
+ _tmp10_ = g_path_get_basename (_tmp9_);
+ filename = _tmp10_;
+ _tmp11_ = filename;
+ _tmp12_ = string_last_index_of_char (_tmp11_, (gunichar) '.', 0);
+ extension_index = _tmp12_;
+ _tmp13_ = extension_index;
+ if (_tmp13_ >= 0) {
+ const gchar* _tmp14_;
+ gint _tmp15_;
+ gchar* _tmp16_ = NULL;
+ _tmp14_ = filename;
+ _tmp15_ = extension_index;
+ _tmp16_ = string_slice (_tmp14_, (glong) 0, (glong) _tmp15_);
_g_free0 (filename);
- filename = _tmp7_;
+ filename = _tmp16_;
}
- _tmp8_ = g_strconcat (filename, extension, NULL);
+ _tmp17_ = filename;
+ _tmp18_ = extension;
+ _tmp19_ = g_strconcat (_tmp17_, _tmp18_, NULL);
_g_free0 (filename);
- filename = _tmp8_;
- gtk_file_chooser_set_current_name ((GtkFileChooser*) self->priv->save_dialog, filename);
+ filename = _tmp19_;
+ _tmp20_ = self->priv->save_dialog;
+ _tmp21_ = filename;
+ gtk_file_chooser_set_current_name ((GtkFileChooser*) _tmp20_, _tmp21_);
_g_free0 (filename);
_g_free0 (path);
_g_free0 (extension);
@@ -926,170 +1204,302 @@ static void _simple_scan_on_file_type_changed_gtk_tree_selection_changed (GtkTre
static gchar* simple_scan_choose_file_location (SimpleScan* self) {
gchar* result = NULL;
gchar* directory;
- gchar* _tmp0_ = NULL;
- gboolean _tmp1_ = FALSE;
- const gchar* _tmp4_ = NULL;
- GtkFileChooserDialog* _tmp5_ = NULL;
- GtkFileFilter* _tmp6_ = NULL;
+ GSettings* _tmp0_;
+ gchar* _tmp1_ = NULL;
+ gboolean _tmp2_ = FALSE;
+ const gchar* _tmp3_;
+ gboolean _tmp5_;
+ const gchar* _tmp8_ = NULL;
+ GtkWindow* _tmp9_;
+ GtkFileChooserDialog* _tmp10_;
+ GtkFileChooserDialog* _tmp11_;
+ GtkFileChooserDialog* _tmp12_;
+ GtkFileChooserDialog* _tmp13_;
+ GtkFileChooserDialog* _tmp14_;
+ const gchar* _tmp15_;
+ GtkFileChooserDialog* _tmp16_;
+ const gchar* _tmp17_;
+ GtkFileFilter* _tmp18_;
+ GtkFileFilter* _tmp19_;
GtkFileFilter* filter;
- const gchar* _tmp7_ = NULL;
- GtkFileFilter* _tmp8_ = NULL;
- const gchar* _tmp9_ = NULL;
- const gchar* _tmp10_ = NULL;
- GtkExpander* _tmp11_ = NULL;
+ GtkFileFilter* _tmp20_;
+ const gchar* _tmp21_ = NULL;
+ GtkFileFilter* _tmp22_;
+ GtkFileFilter* _tmp23_;
+ GtkFileChooserDialog* _tmp24_;
+ GtkFileFilter* _tmp25_;
+ GtkFileFilter* _tmp26_;
+ GtkFileFilter* _tmp27_;
+ GtkFileFilter* _tmp28_;
+ const gchar* _tmp29_ = NULL;
+ GtkFileFilter* _tmp30_;
+ GtkFileChooserDialog* _tmp31_;
+ GtkFileFilter* _tmp32_;
+ const gchar* _tmp33_ = NULL;
+ GtkExpander* _tmp34_;
+ GtkExpander* _tmp35_;
GtkExpander* expander;
- gchar* _tmp12_;
+ GtkExpander* _tmp36_;
+ GtkFileChooserDialog* _tmp37_;
+ GtkExpander* _tmp38_;
+ gchar* _tmp39_;
gchar* extension;
- gint _tmp13_;
+ const gchar* _tmp40_;
+ gint _tmp41_ = 0;
gint index;
- GtkListStore* _tmp15_ = NULL;
+ gint _tmp42_;
+ GtkListStore* _tmp46_;
GtkListStore* file_type_store;
GtkTreeIter iter = {0};
- GtkTreeIter _tmp16_ = {0};
- const gchar* _tmp17_ = NULL;
- GtkTreeIter _tmp18_ = {0};
- const gchar* _tmp19_ = NULL;
- GtkTreeIter _tmp20_ = {0};
- const gchar* _tmp21_ = NULL;
- GtkTreeView* _tmp22_ = NULL;
+ GtkListStore* _tmp47_;
+ GtkTreeIter _tmp48_ = {0};
+ GtkListStore* _tmp49_;
+ GtkTreeIter _tmp50_;
+ const gchar* _tmp51_ = NULL;
+ GtkListStore* _tmp52_;
+ GtkTreeIter _tmp53_ = {0};
+ GtkListStore* _tmp54_;
+ GtkTreeIter _tmp55_;
+ const gchar* _tmp56_ = NULL;
+ GtkListStore* _tmp57_;
+ GtkTreeIter _tmp58_ = {0};
+ GtkListStore* _tmp59_;
+ GtkTreeIter _tmp60_;
+ const gchar* _tmp61_ = NULL;
+ GtkListStore* _tmp62_;
+ GtkTreeView* _tmp63_;
+ GtkTreeView* _tmp64_;
GtkTreeView* file_type_view;
- GtkCellRendererText* _tmp23_ = NULL;
- GtkCellRendererText* _tmp24_;
- GtkTreeViewColumn* _tmp25_ = NULL;
- GtkTreeViewColumn* _tmp26_;
+ GtkTreeView* _tmp65_;
+ GtkTreeView* _tmp66_;
+ GtkCellRendererText* _tmp67_;
+ GtkCellRendererText* _tmp68_;
+ GtkTreeViewColumn* _tmp69_;
+ GtkTreeViewColumn* _tmp70_;
+ GtkTreeViewColumn* _tmp71_;
GtkTreeViewColumn* column;
- GtkTreeIter _tmp27_ = {0};
- gboolean _tmp28_;
- GtkTreeSelection* _tmp32_ = NULL;
- gint _tmp33_;
+ GtkTreeView* _tmp72_;
+ GtkTreeViewColumn* _tmp73_;
+ GtkExpander* _tmp74_;
+ GtkTreeView* _tmp75_;
+ GtkListStore* _tmp76_;
+ GtkTreeIter _tmp77_ = {0};
+ gboolean _tmp78_ = FALSE;
+ GtkTreeView* _tmp90_;
+ GtkTreeSelection* _tmp91_ = NULL;
+ GtkExpander* _tmp92_;
+ GtkFileChooserDialog* _tmp93_;
+ gint _tmp94_ = 0;
gint response;
gchar* uri;
- gchar* _tmp35_ = NULL;
- gchar* _tmp36_;
+ gint _tmp95_;
+ GSettings* _tmp98_;
+ GtkFileChooserDialog* _tmp99_;
+ gchar* _tmp100_ = NULL;
+ gchar* _tmp101_;
+ GtkFileChooserDialog* _tmp102_;
g_return_val_if_fail (self != NULL, NULL);
directory = NULL;
- _tmp0_ = g_settings_get_string (self->priv->settings, "save-directory");
+ _tmp0_ = self->priv->settings;
+ _tmp1_ = g_settings_get_string (_tmp0_, "save-directory");
_g_free0 (directory);
- directory = _tmp0_;
- if (directory == NULL) {
- _tmp1_ = TRUE;
+ directory = _tmp1_;
+ _tmp3_ = directory;
+ if (_tmp3_ == NULL) {
+ _tmp2_ = TRUE;
} else {
- _tmp1_ = g_strcmp0 (directory, "") == 0;
+ const gchar* _tmp4_;
+ _tmp4_ = directory;
+ _tmp2_ = g_strcmp0 (_tmp4_, "") == 0;
}
- if (_tmp1_) {
- const gchar* _tmp2_ = NULL;
- gchar* _tmp3_;
- _tmp2_ = g_get_user_special_dir (G_USER_DIRECTORY_DOCUMENTS);
- _tmp3_ = g_strdup (_tmp2_);
+ _tmp5_ = _tmp2_;
+ if (_tmp5_) {
+ const gchar* _tmp6_ = NULL;
+ gchar* _tmp7_;
+ _tmp6_ = g_get_user_special_dir (G_USER_DIRECTORY_DOCUMENTS);
+ _tmp7_ = g_strdup (_tmp6_);
_g_free0 (directory);
- directory = _tmp3_;
+ directory = _tmp7_;
}
- _tmp4_ = _ ("Save As...");
- _tmp5_ = (GtkFileChooserDialog*) gtk_file_chooser_dialog_new (_tmp4_, self->priv->window, GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL, NULL);
+ _tmp8_ = _ ("Save As...");
+ _tmp9_ = self->priv->window;
+ _tmp10_ = (GtkFileChooserDialog*) gtk_file_chooser_dialog_new (_tmp8_, _tmp9_, GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL, NULL);
+ _tmp11_ = g_object_ref_sink (_tmp10_);
_g_object_unref0 (self->priv->save_dialog);
- self->priv->save_dialog = g_object_ref_sink (_tmp5_);
- gtk_file_chooser_set_do_overwrite_confirmation ((GtkFileChooser*) self->priv->save_dialog, TRUE);
- gtk_file_chooser_set_local_only ((GtkFileChooser*) self->priv->save_dialog, FALSE);
- gtk_file_chooser_set_current_folder ((GtkFileChooser*) self->priv->save_dialog, directory);
- gtk_file_chooser_set_current_name ((GtkFileChooser*) self->priv->save_dialog, self->priv->default_file_name);
- _tmp6_ = gtk_file_filter_new ();
- filter = g_object_ref_sink (_tmp6_);
- _tmp7_ = _ ("Image Files");
- gtk_buildable_set_name ((GtkBuildable*) filter, _tmp7_);
- gtk_file_filter_add_pixbuf_formats (filter);
- gtk_file_filter_add_mime_type (filter, "application/pdf");
- gtk_file_chooser_add_filter ((GtkFileChooser*) self->priv->save_dialog, filter);
- _tmp8_ = gtk_file_filter_new ();
+ self->priv->save_dialog = _tmp11_;
+ _tmp12_ = self->priv->save_dialog;
+ gtk_file_chooser_set_do_overwrite_confirmation ((GtkFileChooser*) _tmp12_, TRUE);
+ _tmp13_ = self->priv->save_dialog;
+ gtk_file_chooser_set_local_only ((GtkFileChooser*) _tmp13_, FALSE);
+ _tmp14_ = self->priv->save_dialog;
+ _tmp15_ = directory;
+ gtk_file_chooser_set_current_folder ((GtkFileChooser*) _tmp14_, _tmp15_);
+ _tmp16_ = self->priv->save_dialog;
+ _tmp17_ = self->priv->default_file_name;
+ gtk_file_chooser_set_current_name ((GtkFileChooser*) _tmp16_, _tmp17_);
+ _tmp18_ = gtk_file_filter_new ();
+ _tmp19_ = g_object_ref_sink (_tmp18_);
+ filter = _tmp19_;
+ _tmp20_ = filter;
+ _tmp21_ = _ ("Image Files");
+ gtk_buildable_set_name ((GtkBuildable*) _tmp20_, _tmp21_);
+ _tmp22_ = filter;
+ gtk_file_filter_add_pixbuf_formats (_tmp22_);
+ _tmp23_ = filter;
+ gtk_file_filter_add_mime_type (_tmp23_, "application/pdf");
+ _tmp24_ = self->priv->save_dialog;
+ _tmp25_ = filter;
+ gtk_file_chooser_add_filter ((GtkFileChooser*) _tmp24_, _tmp25_);
+ _tmp26_ = gtk_file_filter_new ();
+ _tmp27_ = g_object_ref_sink (_tmp26_);
_g_object_unref0 (filter);
- filter = g_object_ref_sink (_tmp8_);
- _tmp9_ = _ ("All Files");
- gtk_buildable_set_name ((GtkBuildable*) filter, _tmp9_);
- gtk_file_filter_add_pattern (filter, "*");
- gtk_file_chooser_add_filter ((GtkFileChooser*) self->priv->save_dialog, filter);
- _tmp10_ = _ ("Select File _Type");
- _tmp11_ = (GtkExpander*) gtk_expander_new_with_mnemonic (_tmp10_);
- expander = g_object_ref_sink (_tmp11_);
- gtk_expander_set_spacing (expander, 5);
- gtk_file_chooser_set_extra_widget ((GtkFileChooser*) self->priv->save_dialog, (GtkWidget*) expander);
- _tmp12_ = g_strdup ("");
- extension = _tmp12_;
- _tmp13_ = string_last_index_of_char (self->priv->default_file_name, (gunichar) '.', 0);
- index = _tmp13_;
- if (index >= 0) {
- gchar* _tmp14_ = NULL;
- _tmp14_ = string_slice (self->priv->default_file_name, (glong) 0, (glong) index);
+ filter = _tmp27_;
+ _tmp28_ = filter;
+ _tmp29_ = _ ("All Files");
+ gtk_buildable_set_name ((GtkBuildable*) _tmp28_, _tmp29_);
+ _tmp30_ = filter;
+ gtk_file_filter_add_pattern (_tmp30_, "*");
+ _tmp31_ = self->priv->save_dialog;
+ _tmp32_ = filter;
+ gtk_file_chooser_add_filter ((GtkFileChooser*) _tmp31_, _tmp32_);
+ _tmp33_ = _ ("Select File _Type");
+ _tmp34_ = (GtkExpander*) gtk_expander_new_with_mnemonic (_tmp33_);
+ _tmp35_ = g_object_ref_sink (_tmp34_);
+ expander = _tmp35_;
+ _tmp36_ = expander;
+ gtk_expander_set_spacing (_tmp36_, 5);
+ _tmp37_ = self->priv->save_dialog;
+ _tmp38_ = expander;
+ gtk_file_chooser_set_extra_widget ((GtkFileChooser*) _tmp37_, (GtkWidget*) _tmp38_);
+ _tmp39_ = g_strdup ("");
+ extension = _tmp39_;
+ _tmp40_ = self->priv->default_file_name;
+ _tmp41_ = string_last_index_of_char (_tmp40_, (gunichar) '.', 0);
+ index = _tmp41_;
+ _tmp42_ = index;
+ if (_tmp42_ >= 0) {
+ const gchar* _tmp43_;
+ gint _tmp44_;
+ gchar* _tmp45_ = NULL;
+ _tmp43_ = self->priv->default_file_name;
+ _tmp44_ = index;
+ _tmp45_ = string_slice (_tmp43_, (glong) 0, (glong) _tmp44_);
_g_free0 (extension);
- extension = _tmp14_;
- }
- _tmp15_ = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
- file_type_store = _tmp15_;
- gtk_list_store_append (file_type_store, &_tmp16_);
- iter = _tmp16_;
- _tmp17_ = _ ("PDF (multi-page document)");
- gtk_list_store_set (file_type_store, &iter, 0, _tmp17_, 1, ".pdf", -1, -1);
- gtk_list_store_append (file_type_store, &_tmp18_);
- iter = _tmp18_;
- _tmp19_ = _ ("JPEG (compressed)");
- gtk_list_store_set (file_type_store, &iter, 0, _tmp19_, 1, ".jpg", -1, -1);
- gtk_list_store_append (file_type_store, &_tmp20_);
- iter = _tmp20_;
- _tmp21_ = _ ("PNG (lossless)");
- gtk_list_store_set (file_type_store, &iter, 0, _tmp21_, 1, ".png", -1, -1);
- _tmp22_ = (GtkTreeView*) gtk_tree_view_new_with_model ((GtkTreeModel*) file_type_store);
- file_type_view = g_object_ref_sink (_tmp22_);
- gtk_tree_view_set_headers_visible (file_type_view, FALSE);
- gtk_tree_view_set_rules_hint (file_type_view, TRUE);
- _tmp23_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
- _tmp24_ = g_object_ref_sink (_tmp23_);
- _tmp25_ = gtk_tree_view_column_new_with_attributes ("", (GtkCellRenderer*) _tmp24_, "text", 0, NULL, NULL);
- _tmp26_ = g_object_ref_sink (_tmp25_);
- _g_object_unref0 (_tmp24_);
- column = _tmp26_;
- gtk_tree_view_append_column (file_type_view, column);
- gtk_container_add ((GtkContainer*) expander, (GtkWidget*) file_type_view);
- _tmp28_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) file_type_store, &_tmp27_);
- iter = _tmp27_;
- if (_tmp28_) {
+ extension = _tmp45_;
+ }
+ _tmp46_ = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
+ file_type_store = _tmp46_;
+ _tmp47_ = file_type_store;
+ gtk_list_store_append (_tmp47_, &_tmp48_);
+ iter = _tmp48_;
+ _tmp49_ = file_type_store;
+ _tmp50_ = iter;
+ _tmp51_ = _ ("PDF (multi-page document)");
+ gtk_list_store_set (_tmp49_, &_tmp50_, 0, _tmp51_, 1, ".pdf", -1, -1);
+ _tmp52_ = file_type_store;
+ gtk_list_store_append (_tmp52_, &_tmp53_);
+ iter = _tmp53_;
+ _tmp54_ = file_type_store;
+ _tmp55_ = iter;
+ _tmp56_ = _ ("JPEG (compressed)");
+ gtk_list_store_set (_tmp54_, &_tmp55_, 0, _tmp56_, 1, ".jpg", -1, -1);
+ _tmp57_ = file_type_store;
+ gtk_list_store_append (_tmp57_, &_tmp58_);
+ iter = _tmp58_;
+ _tmp59_ = file_type_store;
+ _tmp60_ = iter;
+ _tmp61_ = _ ("PNG (lossless)");
+ gtk_list_store_set (_tmp59_, &_tmp60_, 0, _tmp61_, 1, ".png", -1, -1);
+ _tmp62_ = file_type_store;
+ _tmp63_ = (GtkTreeView*) gtk_tree_view_new_with_model ((GtkTreeModel*) _tmp62_);
+ _tmp64_ = g_object_ref_sink (_tmp63_);
+ file_type_view = _tmp64_;
+ _tmp65_ = file_type_view;
+ gtk_tree_view_set_headers_visible (_tmp65_, FALSE);
+ _tmp66_ = file_type_view;
+ gtk_tree_view_set_rules_hint (_tmp66_, TRUE);
+ _tmp67_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
+ _tmp68_ = g_object_ref_sink (_tmp67_);
+ _tmp69_ = gtk_tree_view_column_new_with_attributes ("", (GtkCellRenderer*) _tmp68_, "text", 0, NULL, NULL);
+ _tmp70_ = g_object_ref_sink (_tmp69_);
+ _tmp71_ = _tmp70_;
+ _g_object_unref0 (_tmp68_);
+ column = _tmp71_;
+ _tmp72_ = file_type_view;
+ _tmp73_ = column;
+ gtk_tree_view_append_column (_tmp72_, _tmp73_);
+ _tmp74_ = expander;
+ _tmp75_ = file_type_view;
+ gtk_container_add ((GtkContainer*) _tmp74_, (GtkWidget*) _tmp75_);
+ _tmp76_ = file_type_store;
+ _tmp78_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) _tmp76_, &_tmp77_);
+ iter = _tmp77_;
+ if (_tmp78_) {
{
- gboolean _tmp29_;
- _tmp29_ = TRUE;
+ gboolean _tmp79_;
+ _tmp79_ = TRUE;
while (TRUE) {
+ gboolean _tmp80_;
gchar* e = NULL;
- if (!_tmp29_) {
- gboolean _tmp30_;
- _tmp30_ = gtk_tree_model_iter_next ((GtkTreeModel*) file_type_store, &iter);
- if (!_tmp30_) {
+ GtkListStore* _tmp83_;
+ GtkTreeIter _tmp84_;
+ const gchar* _tmp85_;
+ const gchar* _tmp86_;
+ _tmp80_ = _tmp79_;
+ if (!_tmp80_) {
+ GtkListStore* _tmp81_;
+ gboolean _tmp82_ = FALSE;
+ _tmp81_ = file_type_store;
+ _tmp82_ = gtk_tree_model_iter_next ((GtkTreeModel*) _tmp81_, &iter);
+ if (!_tmp82_) {
break;
}
}
- _tmp29_ = FALSE;
- gtk_tree_model_get ((GtkTreeModel*) file_type_store, &iter, 1, &e, -1, -1);
- if (g_strcmp0 (extension, e) == 0) {
- GtkTreeSelection* _tmp31_ = NULL;
- _tmp31_ = gtk_tree_view_get_selection (file_type_view);
- gtk_tree_selection_select_iter (_tmp31_, &iter);
+ _tmp79_ = FALSE;
+ _tmp83_ = file_type_store;
+ _tmp84_ = iter;
+ gtk_tree_model_get ((GtkTreeModel*) _tmp83_, &_tmp84_, 1, &e, -1, -1);
+ _tmp85_ = extension;
+ _tmp86_ = e;
+ if (g_strcmp0 (_tmp85_, _tmp86_) == 0) {
+ GtkTreeView* _tmp87_;
+ GtkTreeSelection* _tmp88_ = NULL;
+ GtkTreeIter _tmp89_;
+ _tmp87_ = file_type_view;
+ _tmp88_ = gtk_tree_view_get_selection (_tmp87_);
+ _tmp89_ = iter;
+ gtk_tree_selection_select_iter (_tmp88_, &_tmp89_);
}
_g_free0 (e);
}
}
}
- _tmp32_ = gtk_tree_view_get_selection (file_type_view);
- g_signal_connect (_tmp32_, "changed", (GCallback) _simple_scan_on_file_type_changed_gtk_tree_selection_changed, self);
- gtk_widget_show_all ((GtkWidget*) expander);
- _tmp33_ = gtk_dialog_run ((GtkDialog*) self->priv->save_dialog);
- response = _tmp33_;
+ _tmp90_ = file_type_view;
+ _tmp91_ = gtk_tree_view_get_selection (_tmp90_);
+ g_signal_connect (_tmp91_, "changed", (GCallback) _simple_scan_on_file_type_changed_gtk_tree_selection_changed, self);
+ _tmp92_ = expander;
+ gtk_widget_show_all ((GtkWidget*) _tmp92_);
+ _tmp93_ = self->priv->save_dialog;
+ _tmp94_ = gtk_dialog_run ((GtkDialog*) _tmp93_);
+ response = _tmp94_;
uri = NULL;
- if (response == ((gint) GTK_RESPONSE_ACCEPT)) {
- gchar* _tmp34_ = NULL;
- _tmp34_ = gtk_file_chooser_get_uri ((GtkFileChooser*) self->priv->save_dialog);
+ _tmp95_ = response;
+ if (_tmp95_ == ((gint) GTK_RESPONSE_ACCEPT)) {
+ GtkFileChooserDialog* _tmp96_;
+ gchar* _tmp97_ = NULL;
+ _tmp96_ = self->priv->save_dialog;
+ _tmp97_ = gtk_file_chooser_get_uri ((GtkFileChooser*) _tmp96_);
_g_free0 (uri);
- uri = _tmp34_;
+ uri = _tmp97_;
}
- _tmp35_ = gtk_file_chooser_get_current_folder ((GtkFileChooser*) self->priv->save_dialog);
- _tmp36_ = _tmp35_;
- g_settings_set_string (self->priv->settings, "save-directory", _tmp36_);
- _g_free0 (_tmp36_);
- gtk_widget_destroy ((GtkWidget*) self->priv->save_dialog);
+ _tmp98_ = self->priv->settings;
+ _tmp99_ = self->priv->save_dialog;
+ _tmp100_ = gtk_file_chooser_get_current_folder ((GtkFileChooser*) _tmp99_);
+ _tmp101_ = _tmp100_;
+ g_settings_set_string (_tmp98_, "save-directory", _tmp101_);
+ _g_free0 (_tmp101_);
+ _tmp102_ = self->priv->save_dialog;
+ gtk_widget_destroy ((GtkWidget*) _tmp102_);
_g_object_unref0 (self->priv->save_dialog);
self->priv->save_dialog = NULL;
result = uri;
@@ -1108,88 +1518,124 @@ static gboolean simple_scan_save_document (SimpleScan* self, gboolean force_choo
gboolean result = FALSE;
gchar* uri = NULL;
gboolean _tmp0_ = FALSE;
- GFile* _tmp3_ = NULL;
+ const gchar* _tmp1_;
+ gboolean _tmp3_;
+ const gchar* _tmp7_;
+ const gchar* _tmp8_;
+ GFile* _tmp9_ = NULL;
GFile* file;
- gchar* _tmp4_ = NULL;
+ const gchar* _tmp10_;
+ const gchar* _tmp11_;
+ gchar* _tmp12_ = NULL;
gchar* uri_lower;
- gchar* _tmp5_;
+ gchar* _tmp13_;
gchar* format;
- gboolean _tmp6_;
- gchar* _tmp17_;
+ const gchar* _tmp14_;
+ gboolean _tmp15_ = FALSE;
+ const gchar* _tmp38_;
+ gchar* _tmp39_;
+ Book* _tmp40_;
GError * _inner_error_ = NULL;
g_return_val_if_fail (self != NULL, FALSE);
- if (self->priv->book_uri != NULL) {
- _tmp0_ = !force_choose_location;
+ _tmp1_ = self->priv->book_uri;
+ if (_tmp1_ != NULL) {
+ gboolean _tmp2_;
+ _tmp2_ = force_choose_location;
+ _tmp0_ = !_tmp2_;
} else {
_tmp0_ = FALSE;
}
- if (_tmp0_) {
- gchar* _tmp1_;
- _tmp1_ = g_strdup (self->priv->book_uri);
+ _tmp3_ = _tmp0_;
+ if (_tmp3_) {
+ const gchar* _tmp4_;
+ gchar* _tmp5_;
+ _tmp4_ = self->priv->book_uri;
+ _tmp5_ = g_strdup (_tmp4_);
_g_free0 (uri);
- uri = _tmp1_;
+ uri = _tmp5_;
} else {
- gchar* _tmp2_ = NULL;
- _tmp2_ = simple_scan_choose_file_location (self);
+ gchar* _tmp6_ = NULL;
+ _tmp6_ = simple_scan_choose_file_location (self);
_g_free0 (uri);
- uri = _tmp2_;
+ uri = _tmp6_;
}
- if (uri == NULL) {
+ _tmp7_ = uri;
+ if (_tmp7_ == NULL) {
result = FALSE;
_g_free0 (uri);
return result;
}
- _tmp3_ = g_file_new_for_uri (uri);
- file = _tmp3_;
- g_debug ("ui.vala:445: Saving to '%s'", uri);
- _tmp4_ = g_utf8_strdown (uri, (gssize) (-1));
- uri_lower = _tmp4_;
- _tmp5_ = g_strdup ("jpeg");
- format = _tmp5_;
- _tmp6_ = g_str_has_suffix (uri_lower, ".pdf");
- if (_tmp6_) {
- gchar* _tmp7_;
- _tmp7_ = g_strdup ("pdf");
+ _tmp8_ = uri;
+ _tmp9_ = g_file_new_for_uri (_tmp8_);
+ file = _tmp9_;
+ _tmp10_ = uri;
+ g_debug ("ui.vala:445: Saving to '%s'", _tmp10_);
+ _tmp11_ = uri;
+ _tmp12_ = g_utf8_strdown (_tmp11_, (gssize) (-1));
+ uri_lower = _tmp12_;
+ _tmp13_ = g_strdup ("jpeg");
+ format = _tmp13_;
+ _tmp14_ = uri_lower;
+ _tmp15_ = g_str_has_suffix (_tmp14_, ".pdf");
+ if (_tmp15_) {
+ gchar* _tmp16_;
+ _tmp16_ = g_strdup ("pdf");
_g_free0 (format);
- format = _tmp7_;
+ format = _tmp16_;
} else {
- gboolean _tmp8_;
- _tmp8_ = g_str_has_suffix (uri_lower, ".ps");
- if (_tmp8_) {
- gchar* _tmp9_;
- _tmp9_ = g_strdup ("ps");
+ const gchar* _tmp17_;
+ gboolean _tmp18_ = FALSE;
+ _tmp17_ = uri_lower;
+ _tmp18_ = g_str_has_suffix (_tmp17_, ".ps");
+ if (_tmp18_) {
+ gchar* _tmp19_;
+ _tmp19_ = g_strdup ("ps");
_g_free0 (format);
- format = _tmp9_;
+ format = _tmp19_;
} else {
- gboolean _tmp10_;
- _tmp10_ = g_str_has_suffix (uri_lower, ".png");
- if (_tmp10_) {
- gchar* _tmp11_;
- _tmp11_ = g_strdup ("png");
+ const gchar* _tmp20_;
+ gboolean _tmp21_ = FALSE;
+ _tmp20_ = uri_lower;
+ _tmp21_ = g_str_has_suffix (_tmp20_, ".png");
+ if (_tmp21_) {
+ gchar* _tmp22_;
+ _tmp22_ = g_strdup ("png");
_g_free0 (format);
- format = _tmp11_;
+ format = _tmp22_;
} else {
- gboolean _tmp12_ = FALSE;
- gboolean _tmp13_;
- _tmp13_ = g_str_has_suffix (uri_lower, ".tif");
- if (_tmp13_) {
- _tmp12_ = TRUE;
+ gboolean _tmp23_ = FALSE;
+ const gchar* _tmp24_;
+ gboolean _tmp25_ = FALSE;
+ gboolean _tmp28_;
+ _tmp24_ = uri_lower;
+ _tmp25_ = g_str_has_suffix (_tmp24_, ".tif");
+ if (_tmp25_) {
+ _tmp23_ = TRUE;
} else {
- gboolean _tmp14_;
- _tmp14_ = g_str_has_suffix (uri_lower, ".tiff");
- _tmp12_ = _tmp14_;
+ const gchar* _tmp26_;
+ gboolean _tmp27_ = FALSE;
+ _tmp26_ = uri_lower;
+ _tmp27_ = g_str_has_suffix (_tmp26_, ".tiff");
+ _tmp23_ = _tmp27_;
}
- if (_tmp12_) {
- gchar* _tmp15_;
- _tmp15_ = g_strdup ("tiff");
+ _tmp28_ = _tmp23_;
+ if (_tmp28_) {
+ gchar* _tmp29_;
+ _tmp29_ = g_strdup ("tiff");
_g_free0 (format);
- format = _tmp15_;
+ format = _tmp29_;
}
}
}
}
{
- book_save (self->priv->book, format, file, &_inner_error_);
+ Book* _tmp30_;
+ const gchar* _tmp31_;
+ GFile* _tmp32_;
+ _tmp30_ = self->priv->book;
+ _tmp31_ = format;
+ _tmp32_ = file;
+ book_save (_tmp30_, _tmp31_, _tmp32_, &_inner_error_);
if (_inner_error_ != NULL) {
goto __catch11_g_error;
}
@@ -1198,12 +1644,20 @@ static gboolean simple_scan_save_document (SimpleScan* self, gboolean force_choo
__catch11_g_error:
{
GError* e = NULL;
- const gchar* _tmp16_ = NULL;
+ GError* _tmp33_;
+ const gchar* _tmp34_;
+ const gchar* _tmp35_ = NULL;
+ GError* _tmp36_;
+ const gchar* _tmp37_;
e = _inner_error_;
_inner_error_ = NULL;
- g_warning ("ui.vala:464: Error saving file: %s", e->message);
- _tmp16_ = _ ("Failed to save file");
- simple_scan_show_error (self, _tmp16_, e->message, FALSE);
+ _tmp33_ = e;
+ _tmp34_ = _tmp33_->message;
+ g_warning ("ui.vala:464: Error saving file: %s", _tmp34_);
+ _tmp35_ = _ ("Failed to save file");
+ _tmp36_ = e;
+ _tmp37_ = _tmp36_->message;
+ simple_scan_show_error (self, _tmp35_, _tmp37_, FALSE);
result = FALSE;
_g_error_free0 (e);
_g_free0 (format);
@@ -1222,10 +1676,12 @@ static gboolean simple_scan_save_document (SimpleScan* self, gboolean force_choo
g_clear_error (&_inner_error_);
return FALSE;
}
- _tmp17_ = g_strdup (uri);
+ _tmp38_ = uri;
+ _tmp39_ = g_strdup (_tmp38_);
_g_free0 (self->priv->book_uri);
- self->priv->book_uri = _tmp17_;
- book_set_needs_saving (self->priv->book, FALSE);
+ self->priv->book_uri = _tmp39_;
+ _tmp40_ = self->priv->book;
+ book_set_needs_saving (_tmp40_, FALSE);
result = TRUE;
_g_free0 (format);
_g_free0 (uri_lower);
@@ -1237,36 +1693,60 @@ static gboolean simple_scan_save_document (SimpleScan* self, gboolean force_choo
static gboolean simple_scan_prompt_to_save (SimpleScan* self, const gchar* title, const gchar* discard_label) {
gboolean result = FALSE;
- gboolean _tmp0_;
- GtkMessageDialog* _tmp1_ = NULL;
+ Book* _tmp0_;
+ gboolean _tmp1_ = FALSE;
+ GtkWindow* _tmp2_;
+ const gchar* _tmp3_;
+ GtkMessageDialog* _tmp4_;
+ GtkMessageDialog* _tmp5_;
GtkMessageDialog* dialog;
- const gchar* _tmp2_ = NULL;
- gint _tmp3_;
+ GtkMessageDialog* _tmp6_;
+ const gchar* _tmp7_ = NULL;
+ GtkMessageDialog* _tmp8_;
+ const gchar* _tmp9_;
+ GtkMessageDialog* _tmp10_;
+ GtkMessageDialog* _tmp11_;
+ GtkMessageDialog* _tmp12_;
+ gint _tmp13_ = 0;
gint response;
+ GtkMessageDialog* _tmp14_;
+ gint _tmp15_;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (title != NULL, FALSE);
g_return_val_if_fail (discard_label != NULL, FALSE);
- _tmp0_ = book_get_needs_saving (self->priv->book);
- if (!_tmp0_) {
+ _tmp0_ = self->priv->book;
+ _tmp1_ = book_get_needs_saving (_tmp0_);
+ if (!_tmp1_) {
result = TRUE;
return result;
}
- _tmp1_ = (GtkMessageDialog*) gtk_message_dialog_new (self->priv->window, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE, "%s", title);
- dialog = g_object_ref_sink (_tmp1_);
- _tmp2_ = _ ("If you don't save, changes will be permanently lost.");
- gtk_message_dialog_format_secondary_text (dialog, "%s", _tmp2_, NULL);
- gtk_dialog_add_button ((GtkDialog*) dialog, discard_label, (gint) GTK_RESPONSE_NO);
- gtk_dialog_add_button ((GtkDialog*) dialog, GTK_STOCK_CANCEL, (gint) GTK_RESPONSE_CANCEL);
- gtk_dialog_add_button ((GtkDialog*) dialog, GTK_STOCK_SAVE, (gint) GTK_RESPONSE_YES);
- _tmp3_ = gtk_dialog_run ((GtkDialog*) dialog);
- response = _tmp3_;
- gtk_widget_destroy ((GtkWidget*) dialog);
- switch (response) {
+ _tmp2_ = self->priv->window;
+ _tmp3_ = title;
+ _tmp4_ = (GtkMessageDialog*) gtk_message_dialog_new (_tmp2_, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE, "%s", _tmp3_);
+ _tmp5_ = g_object_ref_sink (_tmp4_);
+ dialog = _tmp5_;
+ _tmp6_ = dialog;
+ _tmp7_ = _ ("If you don't save, changes will be permanently lost.");
+ gtk_message_dialog_format_secondary_text (_tmp6_, "%s", _tmp7_);
+ _tmp8_ = dialog;
+ _tmp9_ = discard_label;
+ gtk_dialog_add_button ((GtkDialog*) _tmp8_, _tmp9_, (gint) GTK_RESPONSE_NO);
+ _tmp10_ = dialog;
+ gtk_dialog_add_button ((GtkDialog*) _tmp10_, GTK_STOCK_CANCEL, (gint) GTK_RESPONSE_CANCEL);
+ _tmp11_ = dialog;
+ gtk_dialog_add_button ((GtkDialog*) _tmp11_, GTK_STOCK_SAVE, (gint) GTK_RESPONSE_YES);
+ _tmp12_ = dialog;
+ _tmp13_ = gtk_dialog_run ((GtkDialog*) _tmp12_);
+ response = _tmp13_;
+ _tmp14_ = dialog;
+ gtk_widget_destroy ((GtkWidget*) _tmp14_);
+ _tmp15_ = response;
+ switch (_tmp15_) {
case GTK_RESPONSE_YES:
{
- gboolean _tmp4_;
- _tmp4_ = simple_scan_save_document (self, FALSE);
- if (_tmp4_) {
+ gboolean _tmp16_ = FALSE;
+ _tmp16_ = simple_scan_save_document (self, FALSE);
+ if (_tmp16_) {
result = TRUE;
_g_object_unref0 (dialog);
return result;
@@ -1295,20 +1775,26 @@ static gboolean simple_scan_prompt_to_save (SimpleScan* self, const gchar* title
static void simple_scan_clear_document (SimpleScan* self) {
+ Book* _tmp0_;
+ Book* _tmp1_;
+ GtkMenuItem* _tmp2_;
g_return_if_fail (self != NULL);
- book_clear (self->priv->book);
+ _tmp0_ = self->priv->book;
+ book_clear (_tmp0_);
simple_scan_add_default_page (self);
_g_free0 (self->priv->book_uri);
self->priv->book_uri = NULL;
- book_set_needs_saving (self->priv->book, FALSE);
- gtk_widget_set_sensitive ((GtkWidget*) self->priv->save_as_menuitem, FALSE);
+ _tmp1_ = self->priv->book;
+ book_set_needs_saving (_tmp1_, FALSE);
+ _tmp2_ = self->priv->save_as_menuitem;
+ gtk_widget_set_sensitive ((GtkWidget*) _tmp2_, FALSE);
}
void G_MODULE_EXPORT new_button_clicked_cb (GtkWidget* widget, SimpleScan* self) {
const gchar* _tmp0_ = NULL;
const gchar* _tmp1_ = NULL;
- gboolean _tmp2_;
+ gboolean _tmp2_ = FALSE;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
_tmp0_ = _ ("Save current document?");
@@ -1322,41 +1808,59 @@ void G_MODULE_EXPORT new_button_clicked_cb (GtkWidget* widget, SimpleScan* self)
static void simple_scan_set_document_hint (SimpleScan* self, const gchar* document_hint) {
- gchar* _tmp0_;
+ const gchar* _tmp0_;
+ gchar* _tmp1_;
+ const gchar* _tmp2_;
g_return_if_fail (self != NULL);
g_return_if_fail (document_hint != NULL);
- _tmp0_ = g_strdup (document_hint);
+ _tmp0_ = document_hint;
+ _tmp1_ = g_strdup (_tmp0_);
_g_free0 (self->priv->document_hint);
- self->priv->document_hint = _tmp0_;
- if (g_strcmp0 (document_hint, "text") == 0) {
- gtk_check_menu_item_set_active ((GtkCheckMenuItem*) self->priv->text_toolbar_menuitem, TRUE);
- gtk_check_menu_item_set_active ((GtkCheckMenuItem*) self->priv->text_menu_menuitem, TRUE);
+ self->priv->document_hint = _tmp1_;
+ _tmp2_ = document_hint;
+ if (g_strcmp0 (_tmp2_, "text") == 0) {
+ GtkRadioMenuItem* _tmp3_;
+ GtkRadioMenuItem* _tmp4_;
+ _tmp3_ = self->priv->text_toolbar_menuitem;
+ gtk_check_menu_item_set_active ((GtkCheckMenuItem*) _tmp3_, TRUE);
+ _tmp4_ = self->priv->text_menu_menuitem;
+ gtk_check_menu_item_set_active ((GtkCheckMenuItem*) _tmp4_, TRUE);
} else {
- if (g_strcmp0 (document_hint, "photo") == 0) {
- gtk_check_menu_item_set_active ((GtkCheckMenuItem*) self->priv->photo_toolbar_menuitem, TRUE);
- gtk_check_menu_item_set_active ((GtkCheckMenuItem*) self->priv->photo_menu_menuitem, TRUE);
+ const gchar* _tmp5_;
+ _tmp5_ = document_hint;
+ if (g_strcmp0 (_tmp5_, "photo") == 0) {
+ GtkRadioMenuItem* _tmp6_;
+ GtkRadioMenuItem* _tmp7_;
+ _tmp6_ = self->priv->photo_toolbar_menuitem;
+ gtk_check_menu_item_set_active ((GtkCheckMenuItem*) _tmp6_, TRUE);
+ _tmp7_ = self->priv->photo_menu_menuitem;
+ gtk_check_menu_item_set_active ((GtkCheckMenuItem*) _tmp7_, TRUE);
}
}
}
void G_MODULE_EXPORT text_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) {
- gboolean _tmp0_;
+ GtkCheckMenuItem* _tmp0_;
+ gboolean _tmp1_ = FALSE;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
- _tmp0_ = gtk_check_menu_item_get_active (widget);
- if (_tmp0_) {
+ _tmp0_ = widget;
+ _tmp1_ = gtk_check_menu_item_get_active (_tmp0_);
+ if (_tmp1_) {
simple_scan_set_document_hint (self, "text");
}
}
void G_MODULE_EXPORT photo_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) {
- gboolean _tmp0_;
+ GtkCheckMenuItem* _tmp0_;
+ gboolean _tmp1_ = FALSE;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
- _tmp0_ = gtk_check_menu_item_get_active (widget);
- if (_tmp0_) {
+ _tmp0_ = widget;
+ _tmp1_ = gtk_check_menu_item_get_active (_tmp0_);
+ if (_tmp1_) {
simple_scan_set_document_hint (self, "photo");
}
}
@@ -1364,28 +1868,46 @@ void G_MODULE_EXPORT photo_menuitem_toggled_cb (GtkCheckMenuItem* widget, Simple
static void simple_scan_set_page_side (SimpleScan* self, ScanType page_side) {
GtkTreeIter iter = {0};
- GtkTreeIter _tmp0_ = {0};
- gboolean _tmp1_;
+ GtkListStore* _tmp0_;
+ GtkTreeIter _tmp1_ = {0};
+ gboolean _tmp2_ = FALSE;
g_return_if_fail (self != NULL);
- _tmp1_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) self->priv->page_side_model, &_tmp0_);
- iter = _tmp0_;
- if (_tmp1_) {
+ _tmp0_ = self->priv->page_side_model;
+ _tmp2_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) _tmp0_, &_tmp1_);
+ iter = _tmp1_;
+ if (_tmp2_) {
{
- gboolean _tmp2_;
- _tmp2_ = TRUE;
+ gboolean _tmp3_;
+ _tmp3_ = TRUE;
while (TRUE) {
+ gboolean _tmp4_;
gint s = 0;
- if (!_tmp2_) {
- gboolean _tmp3_;
- _tmp3_ = gtk_tree_model_iter_next ((GtkTreeModel*) self->priv->page_side_model, &iter);
- if (!_tmp3_) {
+ GtkListStore* _tmp7_;
+ GtkTreeIter _tmp8_;
+ gint _tmp9_;
+ ScanType _tmp10_;
+ _tmp4_ = _tmp3_;
+ if (!_tmp4_) {
+ GtkListStore* _tmp5_;
+ gboolean _tmp6_ = FALSE;
+ _tmp5_ = self->priv->page_side_model;
+ _tmp6_ = gtk_tree_model_iter_next ((GtkTreeModel*) _tmp5_, &iter);
+ if (!_tmp6_) {
break;
}
}
- _tmp2_ = FALSE;
- gtk_tree_model_get ((GtkTreeModel*) self->priv->page_side_model, &iter, 0, &s, -1, -1);
- if (s == ((gint) page_side)) {
- gtk_combo_box_set_active_iter (self->priv->page_side_combo, &iter);
+ _tmp3_ = FALSE;
+ _tmp7_ = self->priv->page_side_model;
+ _tmp8_ = iter;
+ gtk_tree_model_get ((GtkTreeModel*) _tmp7_, &_tmp8_, 0, &s, -1, -1);
+ _tmp9_ = s;
+ _tmp10_ = page_side;
+ if (_tmp9_ == ((gint) _tmp10_)) {
+ GtkComboBox* _tmp11_;
+ GtkTreeIter _tmp12_;
+ _tmp11_ = self->priv->page_side_combo;
+ _tmp12_ = iter;
+ gtk_combo_box_set_active_iter (_tmp11_, &_tmp12_);
return;
}
}
@@ -1397,48 +1919,80 @@ static void simple_scan_set_page_side (SimpleScan* self, ScanType page_side) {
static void simple_scan_set_paper_size (SimpleScan* self, gint width, gint height) {
GtkTreeIter iter = {0};
gboolean have_iter = FALSE;
+ gboolean _tmp16_;
+ gboolean _tmp20_;
g_return_if_fail (self != NULL);
{
- GtkTreeIter _tmp0_ = {0};
- gboolean _tmp1_;
- gboolean _tmp2_;
- _tmp1_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) self->priv->paper_size_model, &_tmp0_);
- iter = _tmp0_;
- have_iter = _tmp1_;
- _tmp2_ = TRUE;
+ GtkListStore* _tmp0_;
+ GtkTreeIter _tmp1_ = {0};
+ gboolean _tmp2_ = FALSE;
+ gboolean _tmp3_;
+ _tmp0_ = self->priv->paper_size_model;
+ _tmp2_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) _tmp0_, &_tmp1_);
+ iter = _tmp1_;
+ have_iter = _tmp2_;
+ _tmp3_ = TRUE;
while (TRUE) {
+ gboolean _tmp4_;
+ gboolean _tmp7_;
gint w = 0;
gint h = 0;
- gboolean _tmp4_ = FALSE;
- if (!_tmp2_) {
- gboolean _tmp3_;
- _tmp3_ = gtk_tree_model_iter_next ((GtkTreeModel*) self->priv->paper_size_model, &iter);
- have_iter = _tmp3_;
+ GtkListStore* _tmp8_;
+ GtkTreeIter _tmp9_;
+ gboolean _tmp10_ = FALSE;
+ gint _tmp11_;
+ gint _tmp12_;
+ gboolean _tmp15_;
+ _tmp4_ = _tmp3_;
+ if (!_tmp4_) {
+ GtkListStore* _tmp5_;
+ gboolean _tmp6_ = FALSE;
+ _tmp5_ = self->priv->paper_size_model;
+ _tmp6_ = gtk_tree_model_iter_next ((GtkTreeModel*) _tmp5_, &iter);
+ have_iter = _tmp6_;
}
- _tmp2_ = FALSE;
- if (!have_iter) {
+ _tmp3_ = FALSE;
+ _tmp7_ = have_iter;
+ if (!_tmp7_) {
break;
}
- gtk_tree_model_get ((GtkTreeModel*) self->priv->paper_size_model, &iter, 0, &w, 1, &h, -1, -1);
- if (w == width) {
- _tmp4_ = h == height;
+ _tmp8_ = self->priv->paper_size_model;
+ _tmp9_ = iter;
+ gtk_tree_model_get ((GtkTreeModel*) _tmp8_, &_tmp9_, 0, &w, 1, &h, -1, -1);
+ _tmp11_ = w;
+ _tmp12_ = width;
+ if (_tmp11_ == _tmp12_) {
+ gint _tmp13_;
+ gint _tmp14_;
+ _tmp13_ = h;
+ _tmp14_ = height;
+ _tmp10_ = _tmp13_ == _tmp14_;
} else {
- _tmp4_ = FALSE;
+ _tmp10_ = FALSE;
}
- if (_tmp4_) {
+ _tmp15_ = _tmp10_;
+ if (_tmp15_) {
break;
}
}
}
- if (!have_iter) {
- GtkTreeIter _tmp5_ = {0};
- gboolean _tmp6_;
- _tmp6_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) self->priv->paper_size_model, &_tmp5_);
- iter = _tmp5_;
- have_iter = _tmp6_;
+ _tmp16_ = have_iter;
+ if (!_tmp16_) {
+ GtkListStore* _tmp17_;
+ GtkTreeIter _tmp18_ = {0};
+ gboolean _tmp19_ = FALSE;
+ _tmp17_ = self->priv->paper_size_model;
+ _tmp19_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) _tmp17_, &_tmp18_);
+ iter = _tmp18_;
+ have_iter = _tmp19_;
}
- if (have_iter) {
- gtk_combo_box_set_active_iter (self->priv->paper_size_combo, &iter);
+ _tmp20_ = have_iter;
+ if (_tmp20_) {
+ GtkComboBox* _tmp21_;
+ GtkTreeIter _tmp22_;
+ _tmp21_ = self->priv->paper_size_combo;
+ _tmp22_ = iter;
+ gtk_combo_box_set_active_iter (_tmp21_, &_tmp22_);
}
}
@@ -1447,14 +2001,20 @@ static gint simple_scan_get_text_dpi (SimpleScan* self) {
gint result = 0;
GtkTreeIter iter = {0};
gint dpi;
- GtkTreeIter _tmp0_ = {0};
- gboolean _tmp1_;
+ GtkComboBox* _tmp0_;
+ GtkTreeIter _tmp1_ = {0};
+ gboolean _tmp2_ = FALSE;
g_return_val_if_fail (self != NULL, 0);
dpi = SIMPLE_SCAN_DEFAULT_TEXT_DPI;
- _tmp1_ = gtk_combo_box_get_active_iter (self->priv->text_dpi_combo, &_tmp0_);
- iter = _tmp0_;
- if (_tmp1_) {
- gtk_tree_model_get ((GtkTreeModel*) self->priv->text_dpi_model, &iter, 0, &dpi, -1, -1);
+ _tmp0_ = self->priv->text_dpi_combo;
+ _tmp2_ = gtk_combo_box_get_active_iter (_tmp0_, &_tmp1_);
+ iter = _tmp1_;
+ if (_tmp2_) {
+ GtkListStore* _tmp3_;
+ GtkTreeIter _tmp4_;
+ _tmp3_ = self->priv->text_dpi_model;
+ _tmp4_ = iter;
+ gtk_tree_model_get ((GtkTreeModel*) _tmp3_, &_tmp4_, 0, &dpi, -1, -1);
}
result = dpi;
return result;
@@ -1465,14 +2025,20 @@ static gint simple_scan_get_photo_dpi (SimpleScan* self) {
gint result = 0;
GtkTreeIter iter = {0};
gint dpi;
- GtkTreeIter _tmp0_ = {0};
- gboolean _tmp1_;
+ GtkComboBox* _tmp0_;
+ GtkTreeIter _tmp1_ = {0};
+ gboolean _tmp2_ = FALSE;
g_return_val_if_fail (self != NULL, 0);
dpi = SIMPLE_SCAN_DEFAULT_PHOTO_DPI;
- _tmp1_ = gtk_combo_box_get_active_iter (self->priv->photo_dpi_combo, &_tmp0_);
- iter = _tmp0_;
- if (_tmp1_) {
- gtk_tree_model_get ((GtkTreeModel*) self->priv->photo_dpi_model, &iter, 0, &dpi, -1, -1);
+ _tmp0_ = self->priv->photo_dpi_combo;
+ _tmp2_ = gtk_combo_box_get_active_iter (_tmp0_, &_tmp1_);
+ iter = _tmp1_;
+ if (_tmp2_) {
+ GtkListStore* _tmp3_;
+ GtkTreeIter _tmp4_;
+ _tmp3_ = self->priv->photo_dpi_model;
+ _tmp4_ = iter;
+ gtk_tree_model_get ((GtkTreeModel*) _tmp3_, &_tmp4_, 0, &dpi, -1, -1);
}
result = dpi;
return result;
@@ -1483,47 +2049,61 @@ static ScanType simple_scan_get_page_side (SimpleScan* self) {
ScanType result = 0;
GtkTreeIter iter = {0};
gint page_side;
- GtkTreeIter _tmp0_ = {0};
- gboolean _tmp1_;
+ GtkComboBox* _tmp0_;
+ GtkTreeIter _tmp1_ = {0};
+ gboolean _tmp2_ = FALSE;
+ gint _tmp5_;
g_return_val_if_fail (self != NULL, 0);
page_side = (gint) SCAN_TYPE_ADF_BOTH;
- _tmp1_ = gtk_combo_box_get_active_iter (self->priv->page_side_combo, &_tmp0_);
- iter = _tmp0_;
- if (_tmp1_) {
- gtk_tree_model_get ((GtkTreeModel*) self->priv->page_side_model, &iter, 0, &page_side, -1, -1);
+ _tmp0_ = self->priv->page_side_combo;
+ _tmp2_ = gtk_combo_box_get_active_iter (_tmp0_, &_tmp1_);
+ iter = _tmp1_;
+ if (_tmp2_) {
+ GtkListStore* _tmp3_;
+ GtkTreeIter _tmp4_;
+ _tmp3_ = self->priv->page_side_model;
+ _tmp4_ = iter;
+ gtk_tree_model_get ((GtkTreeModel*) _tmp3_, &_tmp4_, 0, &page_side, -1, -1);
}
- result = (ScanType) page_side;
+ _tmp5_ = page_side;
+ result = (ScanType) _tmp5_;
return result;
}
static gboolean simple_scan_get_paper_size (SimpleScan* self, gint* width, gint* height) {
- gint _width = 0;
- gint _height = 0;
+ gint _vala_width = 0;
+ gint _vala_height = 0;
gboolean result = FALSE;
GtkTreeIter iter = {0};
- GtkTreeIter _tmp0_ = {0};
- gboolean _tmp1_;
+ GtkComboBox* _tmp0_;
+ GtkTreeIter _tmp1_ = {0};
+ gboolean _tmp2_ = FALSE;
g_return_val_if_fail (self != NULL, FALSE);
- _tmp1_ = gtk_combo_box_get_active_iter (self->priv->paper_size_combo, &_tmp0_);
- iter = _tmp0_;
- if (_tmp1_) {
- gtk_tree_model_get ((GtkTreeModel*) self->priv->paper_size_model, &iter, 0, &_width, 1, &_height, -1, -1);
+ _tmp0_ = self->priv->paper_size_combo;
+ _tmp2_ = gtk_combo_box_get_active_iter (_tmp0_, &_tmp1_);
+ iter = _tmp1_;
+ if (_tmp2_) {
+ GtkListStore* _tmp3_;
+ GtkTreeIter _tmp4_;
+ _tmp3_ = self->priv->paper_size_model;
+ _tmp4_ = iter;
+ gtk_tree_model_get ((GtkTreeModel*) _tmp3_, &_tmp4_, 0, &_vala_width, 1, &_vala_height, -1, -1);
result = TRUE;
if (width) {
- *width = _width;
+ *width = _vala_width;
}
if (height) {
- *height = _height;
+ *height = _vala_height;
}
return result;
}
result = FALSE;
if (width) {
- *width = _width;
+ *width = _vala_width;
}
if (height) {
- *height = _height;
+ *height = _vala_height;
}
return result;
}
@@ -1531,29 +2111,47 @@ static gboolean simple_scan_get_paper_size (SimpleScan* self, gint* width, gint*
static ScanOptions* simple_scan_get_scan_options (SimpleScan* self) {
ScanOptions* result = NULL;
- ScanOptions* _tmp0_ = NULL;
+ ScanOptions* _tmp0_;
ScanOptions* options;
- gint _tmp3_;
- gint _tmp4_;
+ const gchar* _tmp1_;
+ ScanOptions* _tmp10_;
+ ScanOptions* _tmp11_;
+ gint _tmp12_ = 0;
+ gint _tmp13_ = 0;
g_return_val_if_fail (self != NULL, NULL);
_tmp0_ = scan_options_new ();
options = _tmp0_;
- if (g_strcmp0 (self->priv->document_hint, "text") == 0) {
- gint _tmp1_;
- options->scan_mode = SCAN_MODE_GRAY;
- _tmp1_ = simple_scan_get_text_dpi (self);
- options->dpi = _tmp1_;
- options->depth = 2;
+ _tmp1_ = self->priv->document_hint;
+ if (g_strcmp0 (_tmp1_, "text") == 0) {
+ ScanOptions* _tmp2_;
+ ScanOptions* _tmp3_;
+ gint _tmp4_ = 0;
+ ScanOptions* _tmp5_;
+ _tmp2_ = options;
+ _tmp2_->scan_mode = SCAN_MODE_GRAY;
+ _tmp3_ = options;
+ _tmp4_ = simple_scan_get_text_dpi (self);
+ _tmp3_->dpi = _tmp4_;
+ _tmp5_ = options;
+ _tmp5_->depth = 2;
} else {
- gint _tmp2_;
- options->scan_mode = SCAN_MODE_COLOR;
- _tmp2_ = simple_scan_get_photo_dpi (self);
- options->dpi = _tmp2_;
- options->depth = 8;
- }
- simple_scan_get_paper_size (self, &_tmp3_, &_tmp4_);
- options->paper_width = _tmp3_;
- options->paper_height = _tmp4_;
+ ScanOptions* _tmp6_;
+ ScanOptions* _tmp7_;
+ gint _tmp8_ = 0;
+ ScanOptions* _tmp9_;
+ _tmp6_ = options;
+ _tmp6_->scan_mode = SCAN_MODE_COLOR;
+ _tmp7_ = options;
+ _tmp8_ = simple_scan_get_photo_dpi (self);
+ _tmp7_->dpi = _tmp8_;
+ _tmp9_ = options;
+ _tmp9_->depth = 8;
+ }
+ _tmp10_ = options;
+ _tmp11_ = options;
+ simple_scan_get_paper_size (self, &_tmp12_, &_tmp13_);
+ _tmp10_->paper_width = _tmp12_;
+ _tmp11_->paper_height = _tmp13_;
result = options;
return result;
}
@@ -1585,33 +2183,41 @@ void G_MODULE_EXPORT stop_scan_button_clicked_cb (GtkWidget* widget, SimpleScan*
void G_MODULE_EXPORT continuous_scan_button_clicked_cb (GtkWidget* widget, SimpleScan* self) {
+ gboolean _tmp0_;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
- if (self->priv->scanning) {
+ _tmp0_ = self->priv->scanning;
+ if (_tmp0_) {
g_signal_emit_by_name (self, "stop-scan");
} else {
- ScanOptions* _tmp0_ = NULL;
+ ScanOptions* _tmp1_ = NULL;
ScanOptions* options;
- ScanType _tmp1_;
- gchar* _tmp2_ = NULL;
- gchar* _tmp3_;
- _tmp0_ = simple_scan_get_scan_options (self);
- options = _tmp0_;
- _tmp1_ = simple_scan_get_page_side (self);
- options->type = _tmp1_;
- _tmp2_ = simple_scan_get_selected_device (self);
- _tmp3_ = _tmp2_;
- g_signal_emit_by_name (self, "start-scan", _tmp3_, options);
- _g_free0 (_tmp3_);
+ ScanOptions* _tmp2_;
+ ScanType _tmp3_ = 0;
+ gchar* _tmp4_ = NULL;
+ gchar* _tmp5_;
+ ScanOptions* _tmp6_;
+ _tmp1_ = simple_scan_get_scan_options (self);
+ options = _tmp1_;
+ _tmp2_ = options;
+ _tmp3_ = simple_scan_get_page_side (self);
+ _tmp2_->type = _tmp3_;
+ _tmp4_ = simple_scan_get_selected_device (self);
+ _tmp5_ = _tmp4_;
+ _tmp6_ = options;
+ g_signal_emit_by_name (self, "start-scan", _tmp5_, _tmp6_);
+ _g_free0 (_tmp5_);
_scan_options_unref0 (options);
}
}
void G_MODULE_EXPORT preferences_button_clicked_cb (GtkWidget* widget, SimpleScan* self) {
+ GtkDialog* _tmp0_;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
- gtk_window_present ((GtkWindow*) self->priv->preferences_dialog);
+ _tmp0_ = self->priv->preferences_dialog;
+ gtk_window_present ((GtkWindow*) _tmp0_);
}
@@ -1625,95 +2231,145 @@ gboolean G_MODULE_EXPORT preferences_dialog_delete_event_cb (GtkWidget* widget,
void G_MODULE_EXPORT preferences_dialog_response_cb (GtkWidget* widget, gint response_id, SimpleScan* self) {
+ GtkDialog* _tmp0_;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
- gtk_widget_hide ((GtkWidget*) self->priv->preferences_dialog);
+ _tmp0_ = self->priv->preferences_dialog;
+ gtk_widget_hide ((GtkWidget*) _tmp0_);
}
static void simple_scan_update_page_menu (SimpleScan* self) {
- Page* _tmp0_ = NULL;
+ BookView* _tmp0_;
+ Page* _tmp1_ = NULL;
Page* page;
+ Page* _tmp2_;
g_return_if_fail (self != NULL);
- _tmp0_ = book_view_get_selected (self->priv->book_view);
- page = _tmp0_;
- if (page == NULL) {
- gtk_widget_set_sensitive ((GtkWidget*) self->priv->page_move_left_menuitem, FALSE);
- gtk_widget_set_sensitive ((GtkWidget*) self->priv->page_move_right_menuitem, FALSE);
+ _tmp0_ = self->priv->book_view;
+ _tmp1_ = book_view_get_selected (_tmp0_);
+ page = _tmp1_;
+ _tmp2_ = page;
+ if (_tmp2_ == NULL) {
+ GtkMenuItem* _tmp3_;
+ GtkMenuItem* _tmp4_;
+ _tmp3_ = self->priv->page_move_left_menuitem;
+ gtk_widget_set_sensitive ((GtkWidget*) _tmp3_, FALSE);
+ _tmp4_ = self->priv->page_move_right_menuitem;
+ gtk_widget_set_sensitive ((GtkWidget*) _tmp4_, FALSE);
} else {
- guint _tmp1_;
+ Book* _tmp5_;
+ Page* _tmp6_;
+ guint _tmp7_ = 0U;
guint index;
- guint _tmp2_;
- _tmp1_ = book_get_page_index (self->priv->book, page);
- index = _tmp1_;
- gtk_widget_set_sensitive ((GtkWidget*) self->priv->page_move_left_menuitem, index > ((guint) 0));
- _tmp2_ = book_get_n_pages (self->priv->book);
- gtk_widget_set_sensitive ((GtkWidget*) self->priv->page_move_right_menuitem, index < (_tmp2_ - 1));
+ GtkMenuItem* _tmp8_;
+ guint _tmp9_;
+ GtkMenuItem* _tmp10_;
+ guint _tmp11_;
+ Book* _tmp12_;
+ guint _tmp13_ = 0U;
+ _tmp5_ = self->priv->book;
+ _tmp6_ = page;
+ _tmp7_ = book_get_page_index (_tmp5_, _tmp6_);
+ index = _tmp7_;
+ _tmp8_ = self->priv->page_move_left_menuitem;
+ _tmp9_ = index;
+ gtk_widget_set_sensitive ((GtkWidget*) _tmp8_, _tmp9_ > ((guint) 0));
+ _tmp10_ = self->priv->page_move_right_menuitem;
+ _tmp11_ = index;
+ _tmp12_ = self->priv->book;
+ _tmp13_ = book_get_n_pages (_tmp12_);
+ gtk_widget_set_sensitive ((GtkWidget*) _tmp10_, _tmp11_ < (_tmp13_ - 1));
}
_page_unref0 (page);
}
static void simple_scan_page_selected_cb (SimpleScan* self, BookView* view, Page* page) {
+ Page* _tmp0_;
gchar* name;
- gboolean _tmp0_;
- GObject* _tmp10_ = NULL;
- GtkRadioMenuItem* _tmp11_;
+ Page* _tmp1_;
+ gboolean _tmp2_ = FALSE;
+ GtkBuilder* _tmp20_;
+ const gchar* _tmp21_;
+ GObject* _tmp22_ = NULL;
+ GtkRadioMenuItem* _tmp23_;
GtkRadioMenuItem* menuitem;
- GObject* _tmp12_ = NULL;
- GtkToggleToolButton* _tmp13_;
+ GtkRadioMenuItem* _tmp24_;
+ GtkBuilder* _tmp25_;
+ GObject* _tmp26_ = NULL;
+ GtkToggleToolButton* _tmp27_;
GtkToggleToolButton* toolbutton;
- gboolean _tmp14_;
+ GtkToggleToolButton* _tmp28_;
+ Page* _tmp29_;
+ gboolean _tmp30_ = FALSE;
g_return_if_fail (self != NULL);
g_return_if_fail (view != NULL);
- if (page == NULL) {
+ _tmp0_ = page;
+ if (_tmp0_ == NULL) {
return;
}
self->priv->updating_page_menu = TRUE;
simple_scan_update_page_menu (self);
name = NULL;
- _tmp0_ = page_has_crop (page);
- if (_tmp0_) {
- gchar* _tmp1_ = NULL;
+ _tmp1_ = page;
+ _tmp2_ = page_has_crop (_tmp1_);
+ if (_tmp2_) {
+ Page* _tmp3_;
+ gchar* _tmp4_ = NULL;
gchar* crop_name;
- _tmp1_ = page_get_named_crop (page);
- crop_name = _tmp1_;
- if (crop_name != NULL) {
- if (g_strcmp0 (crop_name, "A4") == 0) {
- gchar* _tmp2_;
- _tmp2_ = g_strdup ("a4_menuitem");
+ const gchar* _tmp5_;
+ _tmp3_ = page;
+ _tmp4_ = page_get_named_crop (_tmp3_);
+ crop_name = _tmp4_;
+ _tmp5_ = crop_name;
+ if (_tmp5_ != NULL) {
+ const gchar* _tmp6_;
+ _tmp6_ = crop_name;
+ if (g_strcmp0 (_tmp6_, "A4") == 0) {
+ gchar* _tmp7_;
+ _tmp7_ = g_strdup ("a4_menuitem");
_g_free0 (name);
- name = _tmp2_;
+ name = _tmp7_;
} else {
- if (g_strcmp0 (crop_name, "A5") == 0) {
- gchar* _tmp3_;
- _tmp3_ = g_strdup ("a5_menuitem");
+ const gchar* _tmp8_;
+ _tmp8_ = crop_name;
+ if (g_strcmp0 (_tmp8_, "A5") == 0) {
+ gchar* _tmp9_;
+ _tmp9_ = g_strdup ("a5_menuitem");
_g_free0 (name);
- name = _tmp3_;
+ name = _tmp9_;
} else {
- if (g_strcmp0 (crop_name, "A6") == 0) {
- gchar* _tmp4_;
- _tmp4_ = g_strdup ("a6_menuitem");
+ const gchar* _tmp10_;
+ _tmp10_ = crop_name;
+ if (g_strcmp0 (_tmp10_, "A6") == 0) {
+ gchar* _tmp11_;
+ _tmp11_ = g_strdup ("a6_menuitem");
_g_free0 (name);
- name = _tmp4_;
+ name = _tmp11_;
} else {
- if (g_strcmp0 (crop_name, "letter") == 0) {
- gchar* _tmp5_;
- _tmp5_ = g_strdup ("letter_menuitem");
+ const gchar* _tmp12_;
+ _tmp12_ = crop_name;
+ if (g_strcmp0 (_tmp12_, "letter") == 0) {
+ gchar* _tmp13_;
+ _tmp13_ = g_strdup ("letter_menuitem");
_g_free0 (name);
- name = _tmp5_;
+ name = _tmp13_;
} else {
- if (g_strcmp0 (crop_name, "legal") == 0) {
- gchar* _tmp6_;
- _tmp6_ = g_strdup ("legal_menuitem");
+ const gchar* _tmp14_;
+ _tmp14_ = crop_name;
+ if (g_strcmp0 (_tmp14_, "legal") == 0) {
+ gchar* _tmp15_;
+ _tmp15_ = g_strdup ("legal_menuitem");
_g_free0 (name);
- name = _tmp6_;
+ name = _tmp15_;
} else {
- if (g_strcmp0 (crop_name, "4x6") == 0) {
- gchar* _tmp7_;
- _tmp7_ = g_strdup ("4x6_menuitem");
+ const gchar* _tmp16_;
+ _tmp16_ = crop_name;
+ if (g_strcmp0 (_tmp16_, "4x6") == 0) {
+ gchar* _tmp17_;
+ _tmp17_ = g_strdup ("4x6_menuitem");
_g_free0 (name);
- name = _tmp7_;
+ name = _tmp17_;
}
}
}
@@ -1721,27 +2377,33 @@ static void simple_scan_page_selected_cb (SimpleScan* self, BookView* view, Page
}
}
} else {
- gchar* _tmp8_;
- _tmp8_ = g_strdup ("custom_crop_menuitem");
+ gchar* _tmp18_;
+ _tmp18_ = g_strdup ("custom_crop_menuitem");
_g_free0 (name);
- name = _tmp8_;
+ name = _tmp18_;
}
_g_free0 (crop_name);
} else {
- gchar* _tmp9_;
- _tmp9_ = g_strdup ("no_crop_menuitem");
+ gchar* _tmp19_;
+ _tmp19_ = g_strdup ("no_crop_menuitem");
_g_free0 (name);
- name = _tmp9_;
- }
- _tmp10_ = gtk_builder_get_object (self->priv->builder, name);
- _tmp11_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp10_));
- menuitem = _tmp11_;
- gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menuitem, TRUE);
- _tmp12_ = gtk_builder_get_object (self->priv->builder, "crop_toolbutton");
- _tmp13_ = _g_object_ref0 (GTK_TOGGLE_TOOL_BUTTON (_tmp12_));
- toolbutton = _tmp13_;
- _tmp14_ = page_has_crop (page);
- gtk_toggle_tool_button_set_active (toolbutton, _tmp14_);
+ name = _tmp19_;
+ }
+ _tmp20_ = self->priv->builder;
+ _tmp21_ = name;
+ _tmp22_ = gtk_builder_get_object (_tmp20_, _tmp21_);
+ _tmp23_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp22_));
+ menuitem = _tmp23_;
+ _tmp24_ = menuitem;
+ gtk_check_menu_item_set_active ((GtkCheckMenuItem*) _tmp24_, TRUE);
+ _tmp25_ = self->priv->builder;
+ _tmp26_ = gtk_builder_get_object (_tmp25_, "crop_toolbutton");
+ _tmp27_ = _g_object_ref0 (GTK_TOGGLE_TOOL_BUTTON (_tmp26_));
+ toolbutton = _tmp27_;
+ _tmp28_ = toolbutton;
+ _tmp29_ = page;
+ _tmp30_ = page_has_crop (_tmp29_);
+ gtk_toggle_tool_button_set_active (_tmp28_, _tmp30_);
self->priv->updating_page_menu = FALSE;
_g_object_unref0 (toolbutton);
_g_object_unref0 (menuitem);
@@ -1751,35 +2413,47 @@ static void simple_scan_page_selected_cb (SimpleScan* self, BookView* view, Page
static gchar* simple_scan_get_temporary_filename (SimpleScan* self, const gchar* prefix, const gchar* extension) {
gchar* result = NULL;
- gchar* _tmp0_ = NULL;
+ const gchar* _tmp0_;
+ const gchar* _tmp1_;
+ gchar* _tmp2_ = NULL;
gchar* filename;
gchar* path = NULL;
GError * _inner_error_ = NULL;
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (prefix != NULL, NULL);
g_return_val_if_fail (extension != NULL, NULL);
- _tmp0_ = g_strdup_printf ("%sXXXXXX.%s", prefix, extension);
- filename = _tmp0_;
+ _tmp0_ = prefix;
+ _tmp1_ = extension;
+ _tmp2_ = g_strdup_printf ("%sXXXXXX.%s", _tmp0_, _tmp1_);
+ filename = _tmp2_;
{
- gchar* _tmp1_ = NULL;
- gint _tmp2_;
+ const gchar* _tmp3_;
+ gchar* _tmp4_ = NULL;
+ gint _tmp5_ = 0;
gint fd;
- _tmp2_ = g_file_open_tmp (filename, &_tmp1_, &_inner_error_);
+ gint _tmp6_;
+ _tmp3_ = filename;
+ _tmp5_ = g_file_open_tmp (_tmp3_, &_tmp4_, &_inner_error_);
_g_free0 (path);
- path = _tmp1_;
- fd = _tmp2_;
+ path = _tmp4_;
+ fd = _tmp5_;
if (_inner_error_ != NULL) {
goto __catch12_g_error;
}
- close (fd);
+ _tmp6_ = fd;
+ close (_tmp6_);
}
goto __finally12;
__catch12_g_error:
{
GError* e = NULL;
+ GError* _tmp7_;
+ const gchar* _tmp8_;
e = _inner_error_;
_inner_error_ = NULL;
- g_warning ("ui.vala:788: Error saving email attachment: %s", e->message);
+ _tmp7_ = e;
+ _tmp8_ = _tmp7_->message;
+ g_warning ("ui.vala:788: Error saving email attachment: %s", _tmp8_);
result = NULL;
_g_error_free0 (e);
_g_free0 (path);
@@ -1803,7 +2477,9 @@ static gchar* simple_scan_get_temporary_filename (SimpleScan* self, const gchar*
static void simple_scan_show_page_cb (SimpleScan* self, BookView* view, Page* page) {
gchar* _tmp0_ = NULL;
gchar* path;
- GFile* _tmp1_ = NULL;
+ const gchar* _tmp1_;
+ const gchar* _tmp2_;
+ GFile* _tmp3_ = NULL;
GFile* file;
GError * _inner_error_ = NULL;
g_return_if_fail (self != NULL);
@@ -1811,14 +2487,20 @@ static void simple_scan_show_page_cb (SimpleScan* self, BookView* view, Page* pa
g_return_if_fail (page != NULL);
_tmp0_ = simple_scan_get_temporary_filename (self, "scanned-page", "tiff");
path = _tmp0_;
- if (path == NULL) {
+ _tmp1_ = path;
+ if (_tmp1_ == NULL) {
_g_free0 (path);
return;
}
- _tmp1_ = g_file_new_for_path (path);
- file = _tmp1_;
+ _tmp2_ = path;
+ _tmp3_ = g_file_new_for_path (_tmp2_);
+ file = _tmp3_;
{
- page_save (page, "tiff", file, &_inner_error_);
+ Page* _tmp4_;
+ GFile* _tmp5_;
+ _tmp4_ = page;
+ _tmp5_ = file;
+ page_save (_tmp4_, "tiff", _tmp5_, &_inner_error_);
if (_inner_error_ != NULL) {
goto __catch13_g_error;
}
@@ -1827,11 +2509,15 @@ static void simple_scan_show_page_cb (SimpleScan* self, BookView* view, Page* pa
__catch13_g_error:
{
GError* e = NULL;
- const gchar* _tmp2_ = NULL;
+ const gchar* _tmp6_ = NULL;
+ GError* _tmp7_;
+ const gchar* _tmp8_;
e = _inner_error_;
_inner_error_ = NULL;
- _tmp2_ = _ ("Unable to save image for preview");
- simple_scan_show_error_dialog (self, _tmp2_, e->message);
+ _tmp6_ = _ ("Unable to save image for preview");
+ _tmp7_ = e;
+ _tmp8_ = _tmp7_->message;
+ simple_scan_show_error_dialog (self, _tmp6_, _tmp8_);
_g_error_free0 (e);
_g_object_unref0 (file);
_g_free0 (path);
@@ -1846,16 +2532,20 @@ static void simple_scan_show_page_cb (SimpleScan* self, BookView* view, Page* pa
return;
}
{
- GdkScreen* _tmp3_ = NULL;
- gchar* _tmp4_ = NULL;
- gchar* _tmp5_;
- guint32 _tmp6_;
- _tmp3_ = gtk_window_get_screen (self->priv->window);
- _tmp4_ = g_file_get_uri (file);
- _tmp5_ = _tmp4_;
- _tmp6_ = gtk_get_current_event_time ();
- gtk_show_uri (_tmp3_, _tmp5_, _tmp6_, &_inner_error_);
- _g_free0 (_tmp5_);
+ GtkWindow* _tmp9_;
+ GdkScreen* _tmp10_ = NULL;
+ GFile* _tmp11_;
+ gchar* _tmp12_ = NULL;
+ gchar* _tmp13_;
+ guint32 _tmp14_ = 0U;
+ _tmp9_ = self->priv->window;
+ _tmp10_ = gtk_window_get_screen (_tmp9_);
+ _tmp11_ = file;
+ _tmp12_ = g_file_get_uri (_tmp11_);
+ _tmp13_ = _tmp12_;
+ _tmp14_ = gtk_get_current_event_time ();
+ gtk_show_uri (_tmp10_, _tmp13_, _tmp14_, &_inner_error_);
+ _g_free0 (_tmp13_);
if (_inner_error_ != NULL) {
goto __catch14_g_error;
}
@@ -1864,11 +2554,15 @@ static void simple_scan_show_page_cb (SimpleScan* self, BookView* view, Page* pa
__catch14_g_error:
{
GError* e = NULL;
- const gchar* _tmp7_ = NULL;
+ const gchar* _tmp15_ = NULL;
+ GError* _tmp16_;
+ const gchar* _tmp17_;
e = _inner_error_;
_inner_error_ = NULL;
- _tmp7_ = _ ("Unable to open image preview application");
- simple_scan_show_error_dialog (self, _tmp7_, e->message);
+ _tmp15_ = _ ("Unable to open image preview application");
+ _tmp16_ = e;
+ _tmp17_ = _tmp16_->message;
+ simple_scan_show_error_dialog (self, _tmp15_, _tmp17_);
_g_error_free0 (e);
}
__finally14:
@@ -1885,91 +2579,153 @@ static void simple_scan_show_page_cb (SimpleScan* self, BookView* view, Page* pa
static void simple_scan_show_page_menu_cb (SimpleScan* self, BookView* view) {
- GObject* _tmp0_ = NULL;
- GtkMenu* _tmp1_;
+ GtkBuilder* _tmp0_;
+ GObject* _tmp1_ = NULL;
+ GtkMenu* _tmp2_;
GtkMenu* menu;
- guint32 _tmp2_;
+ guint32 _tmp3_ = 0U;
g_return_if_fail (self != NULL);
g_return_if_fail (view != NULL);
- _tmp0_ = gtk_builder_get_object (self->priv->builder, "page_menu");
- _tmp1_ = _g_object_ref0 (GTK_MENU (_tmp0_));
- menu = _tmp1_;
- _tmp2_ = gtk_get_current_event_time ();
- gtk_menu_popup (menu, NULL, NULL, NULL, NULL, (guint) 3, _tmp2_);
+ _tmp0_ = self->priv->builder;
+ _tmp1_ = gtk_builder_get_object (_tmp0_, "page_menu");
+ _tmp2_ = _g_object_ref0 (GTK_MENU (_tmp1_));
+ menu = _tmp2_;
+ _tmp3_ = gtk_get_current_event_time ();
+ gtk_menu_popup (menu, NULL, NULL, NULL, NULL, (guint) 3, _tmp3_);
_g_object_unref0 (menu);
}
void G_MODULE_EXPORT rotate_left_button_clicked_cb (GtkWidget* widget, SimpleScan* self) {
- Page* _tmp0_ = NULL;
+ gboolean _tmp0_;
+ BookView* _tmp1_;
+ Page* _tmp2_ = NULL;
Page* page;
+ Page* _tmp3_;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
- if (self->priv->updating_page_menu) {
+ _tmp0_ = self->priv->updating_page_menu;
+ if (_tmp0_) {
return;
}
- _tmp0_ = book_view_get_selected (self->priv->book_view);
- page = _tmp0_;
- if (page != NULL) {
- page_rotate_left (page);
+ _tmp1_ = self->priv->book_view;
+ _tmp2_ = book_view_get_selected (_tmp1_);
+ page = _tmp2_;
+ _tmp3_ = page;
+ if (_tmp3_ != NULL) {
+ Page* _tmp4_;
+ _tmp4_ = page;
+ page_rotate_left (_tmp4_);
}
_page_unref0 (page);
}
void G_MODULE_EXPORT rotate_right_button_clicked_cb (GtkWidget* widget, SimpleScan* self) {
- Page* _tmp0_ = NULL;
+ gboolean _tmp0_;
+ BookView* _tmp1_;
+ Page* _tmp2_ = NULL;
Page* page;
+ Page* _tmp3_;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
- if (self->priv->updating_page_menu) {
+ _tmp0_ = self->priv->updating_page_menu;
+ if (_tmp0_) {
return;
}
- _tmp0_ = book_view_get_selected (self->priv->book_view);
- page = _tmp0_;
- if (page != NULL) {
- page_rotate_right (page);
+ _tmp1_ = self->priv->book_view;
+ _tmp2_ = book_view_get_selected (_tmp1_);
+ page = _tmp2_;
+ _tmp3_ = page;
+ if (_tmp3_ != NULL) {
+ Page* _tmp4_;
+ _tmp4_ = page;
+ page_rotate_right (_tmp4_);
}
_page_unref0 (page);
}
static void simple_scan_set_crop (SimpleScan* self, const gchar* crop_name) {
- Page* _tmp0_ = NULL;
+ GtkMenuItem* _tmp0_;
+ const gchar* _tmp1_;
+ gboolean _tmp2_;
+ BookView* _tmp3_;
+ Page* _tmp4_ = NULL;
Page* page;
+ Page* _tmp5_;
+ const gchar* _tmp6_;
g_return_if_fail (self != NULL);
- gtk_widget_set_sensitive ((GtkWidget*) self->priv->crop_rotate_menuitem, crop_name != NULL);
- if (self->priv->updating_page_menu) {
+ _tmp0_ = self->priv->crop_rotate_menuitem;
+ _tmp1_ = crop_name;
+ gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, _tmp1_ != NULL);
+ _tmp2_ = self->priv->updating_page_menu;
+ if (_tmp2_) {
return;
}
- _tmp0_ = book_view_get_selected (self->priv->book_view);
- page = _tmp0_;
- if (page == NULL) {
+ _tmp3_ = self->priv->book_view;
+ _tmp4_ = book_view_get_selected (_tmp3_);
+ page = _tmp4_;
+ _tmp5_ = page;
+ if (_tmp5_ == NULL) {
_page_unref0 (page);
return;
}
- if (crop_name == NULL) {
- page_set_no_crop (page);
+ _tmp6_ = crop_name;
+ if (_tmp6_ == NULL) {
+ Page* _tmp7_;
+ _tmp7_ = page;
+ page_set_no_crop (_tmp7_);
_page_unref0 (page);
return;
} else {
- if (g_strcmp0 (crop_name, "custom") == 0) {
- gint _tmp1_;
+ const gchar* _tmp8_;
+ _tmp8_ = crop_name;
+ if (g_strcmp0 (_tmp8_, "custom") == 0) {
+ Page* _tmp9_;
+ gint _tmp10_ = 0;
gint width;
- gint _tmp2_;
+ Page* _tmp11_;
+ gint _tmp12_ = 0;
gint height;
+ gint _tmp13_;
gint crop_width;
+ gint _tmp14_;
gint crop_height;
- _tmp1_ = page_get_width (page);
- width = _tmp1_;
- _tmp2_ = page_get_height (page);
- height = _tmp2_;
- crop_width = (gint) ((width * 0.8) + 0.5);
- crop_height = (gint) ((height * 0.8) + 0.5);
- page_set_custom_crop (page, crop_width, crop_height);
- page_move_crop (page, (width - crop_width) / 2, (height - crop_height) / 2);
+ Page* _tmp15_;
+ gint _tmp16_;
+ gint _tmp17_;
+ Page* _tmp18_;
+ gint _tmp19_;
+ gint _tmp20_;
+ gint _tmp21_;
+ gint _tmp22_;
+ _tmp9_ = page;
+ _tmp10_ = page_get_width (_tmp9_);
+ width = _tmp10_;
+ _tmp11_ = page;
+ _tmp12_ = page_get_height (_tmp11_);
+ height = _tmp12_;
+ _tmp13_ = width;
+ crop_width = (gint) ((_tmp13_ * 0.8) + 0.5);
+ _tmp14_ = height;
+ crop_height = (gint) ((_tmp14_ * 0.8) + 0.5);
+ _tmp15_ = page;
+ _tmp16_ = crop_width;
+ _tmp17_ = crop_height;
+ page_set_custom_crop (_tmp15_, _tmp16_, _tmp17_);
+ _tmp18_ = page;
+ _tmp19_ = width;
+ _tmp20_ = crop_width;
+ _tmp21_ = height;
+ _tmp22_ = crop_height;
+ page_move_crop (_tmp18_, (_tmp19_ - _tmp20_) / 2, (_tmp21_ - _tmp22_) / 2);
} else {
- page_set_named_crop (page, crop_name);
+ Page* _tmp23_;
+ const gchar* _tmp24_;
+ _tmp23_ = page;
+ _tmp24_ = crop_name;
+ page_set_named_crop (_tmp23_, _tmp24_);
}
}
_page_unref0 (page);
@@ -1977,151 +2733,197 @@ static void simple_scan_set_crop (SimpleScan* self, const gchar* crop_name) {
void G_MODULE_EXPORT no_crop_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) {
- gboolean _tmp0_;
+ GtkCheckMenuItem* _tmp0_;
+ gboolean _tmp1_ = FALSE;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
- _tmp0_ = gtk_check_menu_item_get_active (widget);
- if (_tmp0_) {
+ _tmp0_ = widget;
+ _tmp1_ = gtk_check_menu_item_get_active (_tmp0_);
+ if (_tmp1_) {
simple_scan_set_crop (self, NULL);
}
}
void G_MODULE_EXPORT custom_crop_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) {
- gboolean _tmp0_;
+ GtkCheckMenuItem* _tmp0_;
+ gboolean _tmp1_ = FALSE;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
- _tmp0_ = gtk_check_menu_item_get_active (widget);
- if (_tmp0_) {
+ _tmp0_ = widget;
+ _tmp1_ = gtk_check_menu_item_get_active (_tmp0_);
+ if (_tmp1_) {
simple_scan_set_crop (self, "custom");
}
}
void G_MODULE_EXPORT crop_toolbutton_toggled_cb (GtkToggleToolButton* widget, SimpleScan* self) {
- GtkRadioMenuItem* menuitem = NULL;
gboolean _tmp0_;
+ GtkRadioMenuItem* menuitem = NULL;
+ GtkToggleToolButton* _tmp1_;
+ gboolean _tmp2_ = FALSE;
+ GtkRadioMenuItem* _tmp9_;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
- if (self->priv->updating_page_menu) {
+ _tmp0_ = self->priv->updating_page_menu;
+ if (_tmp0_) {
return;
}
- _tmp0_ = gtk_toggle_tool_button_get_active (widget);
- if (_tmp0_) {
- GObject* _tmp1_ = NULL;
- GtkRadioMenuItem* _tmp2_;
- _tmp1_ = gtk_builder_get_object (self->priv->builder, "custom_crop_menuitem");
- _tmp2_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp1_));
+ _tmp1_ = widget;
+ _tmp2_ = gtk_toggle_tool_button_get_active (_tmp1_);
+ if (_tmp2_) {
+ GtkBuilder* _tmp3_;
+ GObject* _tmp4_ = NULL;
+ GtkRadioMenuItem* _tmp5_;
+ _tmp3_ = self->priv->builder;
+ _tmp4_ = gtk_builder_get_object (_tmp3_, "custom_crop_menuitem");
+ _tmp5_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp4_));
_g_object_unref0 (menuitem);
- menuitem = _tmp2_;
+ menuitem = _tmp5_;
} else {
- GObject* _tmp3_ = NULL;
- GtkRadioMenuItem* _tmp4_;
- _tmp3_ = gtk_builder_get_object (self->priv->builder, "no_crop_menuitem");
- _tmp4_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp3_));
+ GtkBuilder* _tmp6_;
+ GObject* _tmp7_ = NULL;
+ GtkRadioMenuItem* _tmp8_;
+ _tmp6_ = self->priv->builder;
+ _tmp7_ = gtk_builder_get_object (_tmp6_, "no_crop_menuitem");
+ _tmp8_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp7_));
_g_object_unref0 (menuitem);
- menuitem = _tmp4_;
+ menuitem = _tmp8_;
}
- gtk_check_menu_item_set_active ((GtkCheckMenuItem*) menuitem, TRUE);
+ _tmp9_ = menuitem;
+ gtk_check_menu_item_set_active ((GtkCheckMenuItem*) _tmp9_, TRUE);
_g_object_unref0 (menuitem);
}
void G_MODULE_EXPORT four_by_six_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) {
- gboolean _tmp0_;
+ GtkCheckMenuItem* _tmp0_;
+ gboolean _tmp1_ = FALSE;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
- _tmp0_ = gtk_check_menu_item_get_active (widget);
- if (_tmp0_) {
+ _tmp0_ = widget;
+ _tmp1_ = gtk_check_menu_item_get_active (_tmp0_);
+ if (_tmp1_) {
simple_scan_set_crop (self, "4x6");
}
}
void G_MODULE_EXPORT legal_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) {
- gboolean _tmp0_;
+ GtkCheckMenuItem* _tmp0_;
+ gboolean _tmp1_ = FALSE;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
- _tmp0_ = gtk_check_menu_item_get_active (widget);
- if (_tmp0_) {
+ _tmp0_ = widget;
+ _tmp1_ = gtk_check_menu_item_get_active (_tmp0_);
+ if (_tmp1_) {
simple_scan_set_crop (self, "legal");
}
}
void G_MODULE_EXPORT letter_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) {
- gboolean _tmp0_;
+ GtkCheckMenuItem* _tmp0_;
+ gboolean _tmp1_ = FALSE;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
- _tmp0_ = gtk_check_menu_item_get_active (widget);
- if (_tmp0_) {
+ _tmp0_ = widget;
+ _tmp1_ = gtk_check_menu_item_get_active (_tmp0_);
+ if (_tmp1_) {
simple_scan_set_crop (self, "letter");
}
}
void G_MODULE_EXPORT a6_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) {
- gboolean _tmp0_;
+ GtkCheckMenuItem* _tmp0_;
+ gboolean _tmp1_ = FALSE;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
- _tmp0_ = gtk_check_menu_item_get_active (widget);
- if (_tmp0_) {
+ _tmp0_ = widget;
+ _tmp1_ = gtk_check_menu_item_get_active (_tmp0_);
+ if (_tmp1_) {
simple_scan_set_crop (self, "A6");
}
}
void G_MODULE_EXPORT a5_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) {
- gboolean _tmp0_;
+ GtkCheckMenuItem* _tmp0_;
+ gboolean _tmp1_ = FALSE;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
- _tmp0_ = gtk_check_menu_item_get_active (widget);
- if (_tmp0_) {
+ _tmp0_ = widget;
+ _tmp1_ = gtk_check_menu_item_get_active (_tmp0_);
+ if (_tmp1_) {
simple_scan_set_crop (self, "A5");
}
}
void G_MODULE_EXPORT a4_menuitem_toggled_cb (GtkCheckMenuItem* widget, SimpleScan* self) {
- gboolean _tmp0_;
+ GtkCheckMenuItem* _tmp0_;
+ gboolean _tmp1_ = FALSE;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
- _tmp0_ = gtk_check_menu_item_get_active (widget);
- if (_tmp0_) {
+ _tmp0_ = widget;
+ _tmp1_ = gtk_check_menu_item_get_active (_tmp0_);
+ if (_tmp1_) {
simple_scan_set_crop (self, "A4");
}
}
void G_MODULE_EXPORT crop_rotate_menuitem_activate_cb (GtkWidget* widget, SimpleScan* self) {
- Page* _tmp0_ = NULL;
+ BookView* _tmp0_;
+ Page* _tmp1_ = NULL;
Page* page;
+ Page* _tmp2_;
+ Page* _tmp3_;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
- _tmp0_ = book_view_get_selected (self->priv->book_view);
- page = _tmp0_;
- if (page == NULL) {
+ _tmp0_ = self->priv->book_view;
+ _tmp1_ = book_view_get_selected (_tmp0_);
+ page = _tmp1_;
+ _tmp2_ = page;
+ if (_tmp2_ == NULL) {
_page_unref0 (page);
return;
}
- page_rotate_crop (page);
+ _tmp3_ = page;
+ page_rotate_crop (_tmp3_);
_page_unref0 (page);
}
void G_MODULE_EXPORT page_move_left_menuitem_activate_cb (GtkWidget* widget, SimpleScan* self) {
- Page* _tmp0_ = NULL;
+ BookView* _tmp0_;
+ Page* _tmp1_ = NULL;
Page* page;
- guint _tmp1_;
+ Book* _tmp2_;
+ Page* _tmp3_;
+ guint _tmp4_ = 0U;
guint index;
+ guint _tmp5_;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
- _tmp0_ = book_view_get_selected (self->priv->book_view);
- page = _tmp0_;
- _tmp1_ = book_get_page_index (self->priv->book, page);
- index = _tmp1_;
- if (index > ((guint) 0)) {
- book_move_page (self->priv->book, page, index - 1);
+ _tmp0_ = self->priv->book_view;
+ _tmp1_ = book_view_get_selected (_tmp0_);
+ page = _tmp1_;
+ _tmp2_ = self->priv->book;
+ _tmp3_ = page;
+ _tmp4_ = book_get_page_index (_tmp2_, _tmp3_);
+ index = _tmp4_;
+ _tmp5_ = index;
+ if (_tmp5_ > ((guint) 0)) {
+ Book* _tmp6_;
+ Page* _tmp7_;
+ guint _tmp8_;
+ _tmp6_ = self->priv->book;
+ _tmp7_ = page;
+ _tmp8_ = index;
+ book_move_page (_tmp6_, _tmp7_, _tmp8_ - 1);
}
simple_scan_update_page_menu (self);
_page_unref0 (page);
@@ -2129,22 +2931,40 @@ void G_MODULE_EXPORT page_move_left_menuitem_activate_cb (GtkWidget* widget, Sim
void G_MODULE_EXPORT page_move_right_menuitem_activate_cb (GtkWidget* widget, SimpleScan* self) {
- Page* _tmp0_ = NULL;
+ BookView* _tmp0_;
+ Page* _tmp1_ = NULL;
Page* page;
- guint _tmp1_;
+ Book* _tmp2_;
+ Page* _tmp3_;
+ guint _tmp4_ = 0U;
guint index;
- guint _tmp2_;
+ guint _tmp5_;
+ Book* _tmp6_;
+ guint _tmp7_ = 0U;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
- _tmp0_ = book_view_get_selected (self->priv->book_view);
- page = _tmp0_;
- _tmp1_ = book_get_page_index (self->priv->book, page);
- index = _tmp1_;
- _tmp2_ = book_get_n_pages (self->priv->book);
- if (index < (_tmp2_ - 1)) {
- guint _tmp3_;
- _tmp3_ = book_get_page_index (self->priv->book, page);
- book_move_page (self->priv->book, page, _tmp3_ + 1);
+ _tmp0_ = self->priv->book_view;
+ _tmp1_ = book_view_get_selected (_tmp0_);
+ page = _tmp1_;
+ _tmp2_ = self->priv->book;
+ _tmp3_ = page;
+ _tmp4_ = book_get_page_index (_tmp2_, _tmp3_);
+ index = _tmp4_;
+ _tmp5_ = index;
+ _tmp6_ = self->priv->book;
+ _tmp7_ = book_get_n_pages (_tmp6_);
+ if (_tmp5_ < (_tmp7_ - 1)) {
+ Book* _tmp8_;
+ Page* _tmp9_;
+ Book* _tmp10_;
+ Page* _tmp11_;
+ guint _tmp12_ = 0U;
+ _tmp8_ = self->priv->book;
+ _tmp9_ = page;
+ _tmp10_ = self->priv->book;
+ _tmp11_ = page;
+ _tmp12_ = book_get_page_index (_tmp10_, _tmp11_);
+ book_move_page (_tmp8_, _tmp9_, _tmp12_ + 1);
}
simple_scan_update_page_menu (self);
_page_unref0 (page);
@@ -2152,19 +2972,23 @@ void G_MODULE_EXPORT page_move_right_menuitem_activate_cb (GtkWidget* widget, Si
void G_MODULE_EXPORT page_delete_menuitem_activate_cb (GtkWidget* widget, SimpleScan* self) {
- Book* _tmp0_ = NULL;
- Book* _tmp1_;
- Page* _tmp2_ = NULL;
- Page* _tmp3_;
+ BookView* _tmp0_;
+ Book* _tmp1_ = NULL;
+ Book* _tmp2_;
+ BookView* _tmp3_;
+ Page* _tmp4_ = NULL;
+ Page* _tmp5_;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
- _tmp0_ = book_view_get_book (self->priv->book_view);
- _tmp1_ = _tmp0_;
- _tmp2_ = book_view_get_selected (self->priv->book_view);
- _tmp3_ = _tmp2_;
- book_delete_page (_tmp1_, _tmp3_);
- _page_unref0 (_tmp3_);
- _book_unref0 (_tmp1_);
+ _tmp0_ = self->priv->book_view;
+ _tmp1_ = book_view_get_book (_tmp0_);
+ _tmp2_ = _tmp1_;
+ _tmp3_ = self->priv->book_view;
+ _tmp4_ = book_view_get_selected (_tmp3_);
+ _tmp5_ = _tmp4_;
+ book_delete_page (_tmp2_, _tmp5_);
+ _page_unref0 (_tmp5_);
+ _book_unref0 (_tmp2_);
}
@@ -2188,51 +3012,87 @@ static gpointer _cairo_reference0 (gpointer self) {
static void simple_scan_draw_page (SimpleScan* self, GtkPrintOperation* operation, GtkPrintContext* print_context, gint page_number) {
- cairo_t* _tmp0_ = NULL;
- cairo_t* _tmp1_;
+ GtkPrintContext* _tmp0_;
+ cairo_t* _tmp1_ = NULL;
+ cairo_t* _tmp2_;
cairo_t* context;
- Page* _tmp2_ = NULL;
+ Book* _tmp3_;
+ gint _tmp4_;
+ Page* _tmp5_ = NULL;
Page* page;
gboolean is_landscape;
- gdouble _tmp3_;
- gdouble _tmp4_;
- gboolean _tmp5_;
- gdouble _tmp7_;
- gint _tmp8_;
- gdouble _tmp9_;
- gint _tmp10_;
- GdkPixbuf* _tmp11_ = NULL;
+ GtkPrintContext* _tmp6_;
+ gdouble _tmp7_ = 0.0;
+ GtkPrintContext* _tmp8_;
+ gdouble _tmp9_ = 0.0;
+ Page* _tmp10_;
+ gboolean _tmp11_ = FALSE;
+ gboolean _tmp12_;
+ cairo_t* _tmp17_;
+ GtkPrintContext* _tmp18_;
+ gdouble _tmp19_ = 0.0;
+ Page* _tmp20_;
+ gint _tmp21_ = 0;
+ GtkPrintContext* _tmp22_;
+ gdouble _tmp23_ = 0.0;
+ Page* _tmp24_;
+ gint _tmp25_ = 0;
+ Page* _tmp26_;
+ GdkPixbuf* _tmp27_ = NULL;
GdkPixbuf* image;
+ cairo_t* _tmp28_;
+ cairo_t* _tmp29_;
g_return_if_fail (self != NULL);
g_return_if_fail (operation != NULL);
g_return_if_fail (print_context != NULL);
- _tmp0_ = gtk_print_context_get_cairo_context (print_context);
- _tmp1_ = _cairo_reference0 (_tmp0_);
- context = _tmp1_;
- _tmp2_ = book_get_page (self->priv->book, page_number);
- page = _tmp2_;
+ _tmp0_ = print_context;
+ _tmp1_ = gtk_print_context_get_cairo_context (_tmp0_);
+ _tmp2_ = _cairo_reference0 (_tmp1_);
+ context = _tmp2_;
+ _tmp3_ = self->priv->book;
+ _tmp4_ = page_number;
+ _tmp5_ = book_get_page (_tmp3_, _tmp4_);
+ page = _tmp5_;
is_landscape = FALSE;
- _tmp3_ = gtk_print_context_get_width (print_context);
- _tmp4_ = gtk_print_context_get_height (print_context);
- if (_tmp3_ > _tmp4_) {
+ _tmp6_ = print_context;
+ _tmp7_ = gtk_print_context_get_width (_tmp6_);
+ _tmp8_ = print_context;
+ _tmp9_ = gtk_print_context_get_height (_tmp8_);
+ if (_tmp7_ > _tmp9_) {
is_landscape = TRUE;
}
- _tmp5_ = page_is_landscape (page);
- if (_tmp5_ != is_landscape) {
- gdouble _tmp6_;
- _tmp6_ = gtk_print_context_get_width (print_context);
- cairo_translate (context, _tmp6_, (gdouble) 0);
- cairo_rotate (context, G_PI_2);
- }
- _tmp7_ = gtk_print_context_get_dpi_x (print_context);
- _tmp8_ = page_get_dpi (page);
- _tmp9_ = gtk_print_context_get_dpi_y (print_context);
- _tmp10_ = page_get_dpi (page);
- cairo_scale (context, _tmp7_ / _tmp8_, _tmp9_ / _tmp10_);
- _tmp11_ = page_get_image (page, TRUE);
- image = _tmp11_;
- gdk_cairo_set_source_pixbuf (context, image, (gdouble) 0, (gdouble) 0);
- cairo_paint (context);
+ _tmp10_ = page;
+ _tmp11_ = page_is_landscape (_tmp10_);
+ _tmp12_ = is_landscape;
+ if (_tmp11_ != _tmp12_) {
+ cairo_t* _tmp13_;
+ GtkPrintContext* _tmp14_;
+ gdouble _tmp15_ = 0.0;
+ cairo_t* _tmp16_;
+ _tmp13_ = context;
+ _tmp14_ = print_context;
+ _tmp15_ = gtk_print_context_get_width (_tmp14_);
+ cairo_translate (_tmp13_, _tmp15_, (gdouble) 0);
+ _tmp16_ = context;
+ cairo_rotate (_tmp16_, G_PI_2);
+ }
+ _tmp17_ = context;
+ _tmp18_ = print_context;
+ _tmp19_ = gtk_print_context_get_dpi_x (_tmp18_);
+ _tmp20_ = page;
+ _tmp21_ = page_get_dpi (_tmp20_);
+ _tmp22_ = print_context;
+ _tmp23_ = gtk_print_context_get_dpi_y (_tmp22_);
+ _tmp24_ = page;
+ _tmp25_ = page_get_dpi (_tmp24_);
+ cairo_scale (_tmp17_, _tmp19_ / _tmp21_, _tmp23_ / _tmp25_);
+ _tmp26_ = page;
+ _tmp27_ = page_get_image (_tmp26_, TRUE);
+ image = _tmp27_;
+ _tmp28_ = context;
+ gdk_cairo_set_source_pixbuf (_tmp28_, image, (gdouble) 0, (gdouble) 0);
+ _tmp29_ = context;
+ cairo_paint (_tmp29_);
_g_object_unref0 (image);
_page_unref0 (page);
_cairo_destroy0 (context);
@@ -2240,9 +3100,11 @@ static void simple_scan_draw_page (SimpleScan* self, GtkPrintOperation* operatio
void G_MODULE_EXPORT email_button_clicked_cb (GtkWidget* widget, SimpleScan* self) {
+ const gchar* _tmp0_;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
- g_signal_emit_by_name (self, "email", self->priv->document_hint);
+ _tmp0_ = self->priv->document_hint;
+ g_signal_emit_by_name (self, "email", _tmp0_);
}
@@ -2252,19 +3114,23 @@ static void _simple_scan_draw_page_gtk_print_operation_draw_page (GtkPrintOperat
void G_MODULE_EXPORT print_button_clicked_cb (GtkWidget* widget, SimpleScan* self) {
- GtkPrintOperation* _tmp0_ = NULL;
+ GtkPrintOperation* _tmp0_;
GtkPrintOperation* print;
- guint _tmp1_;
+ Book* _tmp1_;
+ guint _tmp2_ = 0U;
GError * _inner_error_ = NULL;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
_tmp0_ = gtk_print_operation_new ();
print = _tmp0_;
- _tmp1_ = book_get_n_pages (self->priv->book);
- gtk_print_operation_set_n_pages (print, (gint) _tmp1_);
+ _tmp1_ = self->priv->book;
+ _tmp2_ = book_get_n_pages (_tmp1_);
+ gtk_print_operation_set_n_pages (print, (gint) _tmp2_);
g_signal_connect (print, "draw-page", (GCallback) _simple_scan_draw_page_gtk_print_operation_draw_page, self);
{
- gtk_print_operation_run (print, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, self->priv->window, &_inner_error_);
+ GtkWindow* _tmp3_;
+ _tmp3_ = self->priv->window;
+ gtk_print_operation_run (print, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, _tmp3_, &_inner_error_);
if (_inner_error_ != NULL) {
goto __catch15_g_error;
}
@@ -2273,9 +3139,13 @@ void G_MODULE_EXPORT print_button_clicked_cb (GtkWidget* widget, SimpleScan* sel
__catch15_g_error:
{
GError* e = NULL;
+ GError* _tmp4_;
+ const gchar* _tmp5_;
e = _inner_error_;
_inner_error_ = NULL;
- g_warning ("ui.vala:1044: Error printing: %s", e->message);
+ _tmp4_ = e;
+ _tmp5_ = _tmp4_->message;
+ g_warning ("ui.vala:1044: Error printing: %s", _tmp5_);
_g_error_free0 (e);
}
__finally15:
@@ -2294,11 +3164,13 @@ void G_MODULE_EXPORT help_contents_menuitem_activate_cb (GtkWidget* widget, Simp
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
{
- GdkScreen* _tmp0_ = NULL;
- guint32 _tmp1_;
- _tmp0_ = gtk_window_get_screen (self->priv->window);
- _tmp1_ = gtk_get_current_event_time ();
- gtk_show_uri (_tmp0_, "ghelp:simple-scan", _tmp1_, &_inner_error_);
+ GtkWindow* _tmp0_;
+ GdkScreen* _tmp1_ = NULL;
+ guint32 _tmp2_ = 0U;
+ _tmp0_ = self->priv->window;
+ _tmp1_ = gtk_window_get_screen (_tmp0_);
+ _tmp2_ = gtk_get_current_event_time ();
+ gtk_show_uri (_tmp1_, "ghelp:simple-scan", _tmp2_, &_inner_error_);
if (_inner_error_ != NULL) {
goto __catch16_g_error;
}
@@ -2307,11 +3179,15 @@ void G_MODULE_EXPORT help_contents_menuitem_activate_cb (GtkWidget* widget, Simp
__catch16_g_error:
{
GError* e = NULL;
- const gchar* _tmp2_ = NULL;
+ const gchar* _tmp3_ = NULL;
+ GError* _tmp4_;
+ const gchar* _tmp5_;
e = _inner_error_;
_inner_error_ = NULL;
- _tmp2_ = _ ("Unable to open help file");
- simple_scan_show_error_dialog (self, _tmp2_, e->message);
+ _tmp3_ = _ ("Unable to open help file");
+ _tmp4_ = e;
+ _tmp5_ = _tmp4_->message;
+ simple_scan_show_error_dialog (self, _tmp3_, _tmp5_);
_g_error_free0 (e);
}
__finally16:
@@ -2338,7 +3214,8 @@ void G_MODULE_EXPORT about_menuitem_activate_cb (GtkWidget* widget, SimpleScan*
const gchar* _tmp6_ = NULL;
gchar* _tmp7_;
gchar* description;
- const gchar* _tmp8_ = NULL;
+ GtkWindow* _tmp8_;
+ const gchar* _tmp9_ = NULL;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
_tmp0_ = g_strdup ("Robert Ancell <robert.ancell@canonical.com>");
@@ -2367,8 +3244,9 @@ void G_MODULE_EXPORT about_menuitem_activate_cb (GtkWidget* widget, SimpleScan*
_tmp6_ = _ ("Simple document scanning tool");
_tmp7_ = g_strdup (_tmp6_);
description = _tmp7_;
- _tmp8_ = _ ("translator-credits");
- gtk_show_about_dialog (self->priv->window, "title", title, "program-name", "Simple Scan", "version", VERSION, "comments", description, "logo-icon-name", "scanner", "authors", authors, "translator-credits", _tmp8_, "website", "https://launchpad.net/simple-scan", "copyright", "Copyright © 2009-2011 Canonical Ltd.", "license", license, "wrap-license", TRUE, NULL, NULL);
+ _tmp8_ = self->priv->window;
+ _tmp9_ = _ ("translator-credits");
+ gtk_show_about_dialog (_tmp8_, "title", title, "program-name", "Simple Scan", "version", VERSION, "comments", description, "logo-icon-name", "scanner", "authors", authors, "translator-credits", _tmp9_, "website", "https://launchpad.net/simple-scan", "copyright", "Copyright © 2009-2011 Canonical Ltd.", "license", license, "wrap-license", TRUE, NULL, NULL);
_g_free0 (description);
_g_free0 (title);
_g_free0 (license);
@@ -2380,16 +3258,40 @@ static gboolean simple_scan_on_quit (SimpleScan* self) {
gboolean result = FALSE;
const gchar* _tmp0_ = NULL;
const gchar* _tmp1_ = NULL;
- gboolean _tmp2_;
+ gboolean _tmp2_ = FALSE;
gchar* _tmp3_ = NULL;
gchar* device;
gint paper_width;
gint paper_height;
- gint _tmp4_;
- gint _tmp5_;
- gint _tmp6_;
- gint _tmp7_;
- ScanType _tmp8_;
+ gint _tmp4_ = 0;
+ gint _tmp5_ = 0;
+ const gchar* _tmp6_;
+ GSettings* _tmp9_;
+ const gchar* _tmp10_;
+ GSettings* _tmp11_;
+ gint _tmp12_ = 0;
+ GSettings* _tmp13_;
+ gint _tmp14_ = 0;
+ GSettings* _tmp15_;
+ ScanType _tmp16_ = 0;
+ GSettings* _tmp17_;
+ gint _tmp18_;
+ GSettings* _tmp19_;
+ gint _tmp20_;
+ GSettings* _tmp21_;
+ gint _tmp22_;
+ GSettings* _tmp23_;
+ gint _tmp24_;
+ GSettings* _tmp25_;
+ gboolean _tmp26_;
+ GSettings* _tmp27_;
+ ScanDirection _tmp28_;
+ GSettings* _tmp29_;
+ gint _tmp30_;
+ GSettings* _tmp31_;
+ gint _tmp32_;
+ GSettings* _tmp33_;
+ gint _tmp34_;
g_return_val_if_fail (self != NULL, FALSE);
_tmp0_ = _ ("Save document before quitting?");
_tmp1_ = _ ("Quit without Saving");
@@ -2405,25 +3307,53 @@ static gboolean simple_scan_on_quit (SimpleScan* self) {
simple_scan_get_paper_size (self, &_tmp4_, &_tmp5_);
paper_width = _tmp4_;
paper_height = _tmp5_;
- if (device != NULL) {
- g_settings_set_string (self->priv->settings, "selected-device", device);
- }
- g_settings_set_string (self->priv->settings, "document-type", self->priv->document_hint);
- _tmp6_ = simple_scan_get_text_dpi (self);
- g_settings_set_int (self->priv->settings, "text-dpi", _tmp6_);
- _tmp7_ = simple_scan_get_photo_dpi (self);
- g_settings_set_int (self->priv->settings, "photo-dpi", _tmp7_);
- _tmp8_ = simple_scan_get_page_side (self);
- g_settings_set_enum (self->priv->settings, "page-side", (gint) _tmp8_);
- g_settings_set_int (self->priv->settings, "paper-width", paper_width);
- g_settings_set_int (self->priv->settings, "paper-height", paper_height);
- g_settings_set_int (self->priv->settings, "window-width", self->priv->window_width);
- g_settings_set_int (self->priv->settings, "window-height", self->priv->window_height);
- g_settings_set_boolean (self->priv->settings, "window-is-maximized", self->priv->window_is_maximized);
- g_settings_set_enum (self->priv->settings, "scan-direction", (gint) self->priv->default_page_scan_direction);
- g_settings_set_int (self->priv->settings, "page-width", self->priv->default_page_width);
- g_settings_set_int (self->priv->settings, "page-height", self->priv->default_page_height);
- g_settings_set_int (self->priv->settings, "page-dpi", self->priv->default_page_dpi);
+ _tmp6_ = device;
+ if (_tmp6_ != NULL) {
+ GSettings* _tmp7_;
+ const gchar* _tmp8_;
+ _tmp7_ = self->priv->settings;
+ _tmp8_ = device;
+ g_settings_set_string (_tmp7_, "selected-device", _tmp8_);
+ }
+ _tmp9_ = self->priv->settings;
+ _tmp10_ = self->priv->document_hint;
+ g_settings_set_string (_tmp9_, "document-type", _tmp10_);
+ _tmp11_ = self->priv->settings;
+ _tmp12_ = simple_scan_get_text_dpi (self);
+ g_settings_set_int (_tmp11_, "text-dpi", _tmp12_);
+ _tmp13_ = self->priv->settings;
+ _tmp14_ = simple_scan_get_photo_dpi (self);
+ g_settings_set_int (_tmp13_, "photo-dpi", _tmp14_);
+ _tmp15_ = self->priv->settings;
+ _tmp16_ = simple_scan_get_page_side (self);
+ g_settings_set_enum (_tmp15_, "page-side", (gint) _tmp16_);
+ _tmp17_ = self->priv->settings;
+ _tmp18_ = paper_width;
+ g_settings_set_int (_tmp17_, "paper-width", _tmp18_);
+ _tmp19_ = self->priv->settings;
+ _tmp20_ = paper_height;
+ g_settings_set_int (_tmp19_, "paper-height", _tmp20_);
+ _tmp21_ = self->priv->settings;
+ _tmp22_ = self->priv->window_width;
+ g_settings_set_int (_tmp21_, "window-width", _tmp22_);
+ _tmp23_ = self->priv->settings;
+ _tmp24_ = self->priv->window_height;
+ g_settings_set_int (_tmp23_, "window-height", _tmp24_);
+ _tmp25_ = self->priv->settings;
+ _tmp26_ = self->priv->window_is_maximized;
+ g_settings_set_boolean (_tmp25_, "window-is-maximized", _tmp26_);
+ _tmp27_ = self->priv->settings;
+ _tmp28_ = self->priv->default_page_scan_direction;
+ g_settings_set_enum (_tmp27_, "scan-direction", (gint) _tmp28_);
+ _tmp29_ = self->priv->settings;
+ _tmp30_ = self->priv->default_page_width;
+ g_settings_set_int (_tmp29_, "page-width", _tmp30_);
+ _tmp31_ = self->priv->settings;
+ _tmp32_ = self->priv->default_page_height;
+ g_settings_set_int (_tmp31_, "page-height", _tmp32_);
+ _tmp33_ = self->priv->settings;
+ _tmp34_ = self->priv->default_page_dpi;
+ g_settings_set_int (_tmp33_, "page-dpi", _tmp34_);
g_signal_emit_by_name (self, "quit");
result = TRUE;
_g_free0 (device);
@@ -2440,11 +3370,22 @@ void G_MODULE_EXPORT quit_menuitem_activate_cb (GtkWidget* widget, SimpleScan* s
gboolean G_MODULE_EXPORT simple_scan_window_configure_event_cb (GtkWidget* widget, GdkEventConfigure* event, SimpleScan* self) {
gboolean result = FALSE;
+ gboolean _tmp0_;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (widget != NULL, FALSE);
- if (!self->priv->window_is_maximized) {
- self->priv->window_width = (*event).width;
- self->priv->window_height = (*event).height;
+ g_return_val_if_fail (event != NULL, FALSE);
+ _tmp0_ = self->priv->window_is_maximized;
+ if (!_tmp0_) {
+ GdkEventConfigure _tmp1_;
+ gint _tmp2_;
+ GdkEventConfigure _tmp3_;
+ gint _tmp4_;
+ _tmp1_ = *event;
+ _tmp2_ = _tmp1_.width;
+ self->priv->window_width = _tmp2_;
+ _tmp3_ = *event;
+ _tmp4_ = _tmp3_.height;
+ self->priv->window_height = _tmp4_;
}
result = FALSE;
return result;
@@ -2452,11 +3393,17 @@ gboolean G_MODULE_EXPORT simple_scan_window_configure_event_cb (GtkWidget* widge
static void simple_scan_info_bar_response_cb (SimpleScan* self, GtkInfoBar* widget, gint response_id) {
+ gint _tmp0_;
g_return_if_fail (self != NULL);
g_return_if_fail (widget != NULL);
- if (response_id == 1) {
- gtk_widget_grab_focus ((GtkWidget*) self->priv->device_combo);
- gtk_window_present ((GtkWindow*) self->priv->preferences_dialog);
+ _tmp0_ = response_id;
+ if (_tmp0_ == 1) {
+ GtkComboBox* _tmp1_;
+ GtkDialog* _tmp2_;
+ _tmp1_ = self->priv->device_combo;
+ gtk_widget_grab_focus ((GtkWidget*) _tmp1_);
+ _tmp2_ = self->priv->preferences_dialog;
+ gtk_window_present ((GtkWindow*) _tmp2_);
} else {
self->priv->have_error = FALSE;
_g_free0 (self->priv->error_title);
@@ -2470,10 +3417,19 @@ static void simple_scan_info_bar_response_cb (SimpleScan* self, GtkInfoBar* widg
gboolean G_MODULE_EXPORT simple_scan_window_window_state_event_cb (GtkWidget* widget, GdkEventWindowState* event, SimpleScan* self) {
gboolean result = FALSE;
+ GdkEventWindowState _tmp0_;
+ GdkWindowState _tmp1_;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (widget != NULL, FALSE);
- if (((*event).changed_mask & GDK_WINDOW_STATE_MAXIMIZED) != 0) {
- self->priv->window_is_maximized = ((*event).new_window_state & GDK_WINDOW_STATE_MAXIMIZED) != 0;
+ g_return_val_if_fail (event != NULL, FALSE);
+ _tmp0_ = *event;
+ _tmp1_ = _tmp0_.changed_mask;
+ if ((_tmp1_ & GDK_WINDOW_STATE_MAXIMIZED) != 0) {
+ GdkEventWindowState _tmp2_;
+ GdkWindowState _tmp3_;
+ _tmp2_ = *event;
+ _tmp3_ = _tmp2_.new_window_state;
+ self->priv->window_is_maximized = (_tmp3_ & GDK_WINDOW_STATE_MAXIMIZED) != 0;
}
result = FALSE;
return result;
@@ -2482,7 +3438,7 @@ gboolean G_MODULE_EXPORT simple_scan_window_window_state_event_cb (GtkWidget* wi
gboolean G_MODULE_EXPORT window_delete_event_cb (GtkWidget* widget, GdkEvent* event, SimpleScan* self) {
gboolean result = FALSE;
- gboolean _tmp0_;
+ gboolean _tmp0_ = FALSE;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (event != NULL, FALSE);
@@ -2493,26 +3449,34 @@ gboolean G_MODULE_EXPORT window_delete_event_cb (GtkWidget* widget, GdkEvent* ev
static void simple_scan_page_size_changed_cb (SimpleScan* self, Page* page) {
- gint _tmp0_;
- gint _tmp1_;
- gint _tmp2_;
+ Page* _tmp0_;
+ gint _tmp1_ = 0;
+ Page* _tmp2_;
+ gint _tmp3_ = 0;
+ Page* _tmp4_;
+ gint _tmp5_ = 0;
g_return_if_fail (self != NULL);
g_return_if_fail (page != NULL);
- _tmp0_ = page_get_width (page);
- self->priv->default_page_width = _tmp0_;
- _tmp1_ = page_get_height (page);
- self->priv->default_page_height = _tmp1_;
- _tmp2_ = page_get_dpi (page);
- self->priv->default_page_dpi = _tmp2_;
+ _tmp0_ = page;
+ _tmp1_ = page_get_width (_tmp0_);
+ self->priv->default_page_width = _tmp1_;
+ _tmp2_ = page;
+ _tmp3_ = page_get_height (_tmp2_);
+ self->priv->default_page_height = _tmp3_;
+ _tmp4_ = page;
+ _tmp5_ = page_get_dpi (_tmp4_);
+ self->priv->default_page_dpi = _tmp5_;
}
static void simple_scan_page_scan_direction_changed_cb (SimpleScan* self, Page* page) {
- ScanDirection _tmp0_;
+ Page* _tmp0_;
+ ScanDirection _tmp1_ = 0;
g_return_if_fail (self != NULL);
g_return_if_fail (page != NULL);
- _tmp0_ = page_get_scan_direction (page);
- self->priv->default_page_scan_direction = _tmp0_;
+ _tmp0_ = page;
+ _tmp1_ = page_get_scan_direction (_tmp0_);
+ self->priv->default_page_scan_direction = _tmp1_;
}
@@ -2527,34 +3491,48 @@ static void _simple_scan_page_scan_direction_changed_cb_page_scan_direction_chan
static void simple_scan_page_added_cb (SimpleScan* self, Book* book, Page* page) {
- gint _tmp0_;
- gint _tmp1_;
- gint _tmp2_;
- ScanDirection _tmp3_;
+ Page* _tmp0_;
+ gint _tmp1_ = 0;
+ Page* _tmp2_;
+ gint _tmp3_ = 0;
+ Page* _tmp4_;
+ gint _tmp5_ = 0;
+ Page* _tmp6_;
+ ScanDirection _tmp7_ = 0;
+ Page* _tmp8_;
+ Page* _tmp9_;
g_return_if_fail (self != NULL);
g_return_if_fail (book != NULL);
g_return_if_fail (page != NULL);
- _tmp0_ = page_get_width (page);
- self->priv->default_page_width = _tmp0_;
- _tmp1_ = page_get_height (page);
- self->priv->default_page_height = _tmp1_;
- _tmp2_ = page_get_dpi (page);
- self->priv->default_page_dpi = _tmp2_;
- _tmp3_ = page_get_scan_direction (page);
- self->priv->default_page_scan_direction = _tmp3_;
- g_signal_connect (page, "size-changed", (GCallback) _simple_scan_page_size_changed_cb_page_size_changed, self);
- g_signal_connect (page, "scan-direction-changed", (GCallback) _simple_scan_page_scan_direction_changed_cb_page_scan_direction_changed, self);
+ _tmp0_ = page;
+ _tmp1_ = page_get_width (_tmp0_);
+ self->priv->default_page_width = _tmp1_;
+ _tmp2_ = page;
+ _tmp3_ = page_get_height (_tmp2_);
+ self->priv->default_page_height = _tmp3_;
+ _tmp4_ = page;
+ _tmp5_ = page_get_dpi (_tmp4_);
+ self->priv->default_page_dpi = _tmp5_;
+ _tmp6_ = page;
+ _tmp7_ = page_get_scan_direction (_tmp6_);
+ self->priv->default_page_scan_direction = _tmp7_;
+ _tmp8_ = page;
+ g_signal_connect (_tmp8_, "size-changed", (GCallback) _simple_scan_page_size_changed_cb_page_size_changed, self);
+ _tmp9_ = page;
+ g_signal_connect (_tmp9_, "scan-direction-changed", (GCallback) _simple_scan_page_scan_direction_changed_cb_page_scan_direction_changed, self);
simple_scan_update_page_menu (self);
}
static void simple_scan_page_removed_cb (SimpleScan* self, Book* book, Page* page) {
- guint _tmp0_;
+ Book* _tmp0_;
+ guint _tmp1_ = 0U;
g_return_if_fail (self != NULL);
g_return_if_fail (book != NULL);
g_return_if_fail (page != NULL);
- _tmp0_ = book_get_n_pages (book);
- if (_tmp0_ == ((guint) 1)) {
+ _tmp0_ = book;
+ _tmp1_ = book_get_n_pages (_tmp0_);
+ if (_tmp1_ == ((guint) 1)) {
simple_scan_add_default_page (self);
}
simple_scan_update_page_menu (self);
@@ -2562,86 +3540,136 @@ static void simple_scan_page_removed_cb (SimpleScan* self, Book* book, Page* pag
static void simple_scan_set_dpi_combo (SimpleScan* self, GtkComboBox* combo, gint default_dpi, gint current_dpi) {
- GtkCellRendererText* _tmp0_ = NULL;
+ GtkCellRendererText* _tmp0_;
+ GtkCellRendererText* _tmp1_;
GtkCellRendererText* renderer;
- GtkTreeModel* _tmp1_ = NULL;
- GtkListStore* _tmp2_;
+ GtkComboBox* _tmp2_;
+ GtkCellRendererText* _tmp3_;
+ GtkComboBox* _tmp4_;
+ GtkCellRendererText* _tmp5_;
+ GtkComboBox* _tmp6_;
+ GtkTreeModel* _tmp7_ = NULL;
+ GtkListStore* _tmp8_;
GtkListStore* model;
- gint* _tmp3_ = NULL;
+ gint* _tmp9_ = NULL;
gint* scan_resolutions;
gint scan_resolutions_length1;
gint _scan_resolutions_size_;
+ gint* _tmp10_;
+ gint _tmp10__length1;
g_return_if_fail (self != NULL);
g_return_if_fail (combo != NULL);
_tmp0_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
- renderer = g_object_ref_sink (_tmp0_);
- gtk_cell_layout_pack_start ((GtkCellLayout*) combo, (GtkCellRenderer*) renderer, TRUE);
- gtk_cell_layout_add_attribute ((GtkCellLayout*) combo, (GtkCellRenderer*) renderer, "text", 1);
- _tmp1_ = gtk_combo_box_get_model (combo);
- _tmp2_ = _g_object_ref0 (GTK_LIST_STORE (_tmp1_));
- model = _tmp2_;
- _tmp3_ = g_new0 (gint, 6);
- _tmp3_[0] = 75;
- _tmp3_[1] = 150;
- _tmp3_[2] = 300;
- _tmp3_[3] = 600;
- _tmp3_[4] = 1200;
- _tmp3_[5] = 2400;
- scan_resolutions = _tmp3_;
+ _tmp1_ = g_object_ref_sink (_tmp0_);
+ renderer = _tmp1_;
+ _tmp2_ = combo;
+ _tmp3_ = renderer;
+ gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp2_, (GtkCellRenderer*) _tmp3_, TRUE);
+ _tmp4_ = combo;
+ _tmp5_ = renderer;
+ gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp4_, (GtkCellRenderer*) _tmp5_, "text", 1);
+ _tmp6_ = combo;
+ _tmp7_ = gtk_combo_box_get_model (_tmp6_);
+ _tmp8_ = _g_object_ref0 (GTK_LIST_STORE (_tmp7_));
+ model = _tmp8_;
+ _tmp9_ = g_new0 (gint, 6);
+ _tmp9_[0] = 75;
+ _tmp9_[1] = 150;
+ _tmp9_[2] = 300;
+ _tmp9_[3] = 600;
+ _tmp9_[4] = 1200;
+ _tmp9_[5] = 2400;
+ scan_resolutions = _tmp9_;
scan_resolutions_length1 = 6;
_scan_resolutions_size_ = scan_resolutions_length1;
+ _tmp10_ = scan_resolutions;
+ _tmp10__length1 = scan_resolutions_length1;
{
gint* dpi_collection = NULL;
gint dpi_collection_length1 = 0;
gint _dpi_collection_size_ = 0;
- gint dpi_it;
- dpi_collection = scan_resolutions;
- dpi_collection_length1 = scan_resolutions_length1;
- for (dpi_it = 0; dpi_it < scan_resolutions_length1; dpi_it = dpi_it + 1) {
+ gint dpi_it = 0;
+ dpi_collection = _tmp10_;
+ dpi_collection_length1 = _tmp10__length1;
+ for (dpi_it = 0; dpi_it < _tmp10__length1; dpi_it = dpi_it + 1) {
gint dpi = 0;
dpi = dpi_collection[dpi_it];
{
gchar* label = NULL;
+ gint _tmp11_;
+ gint _tmp12_;
GtkTreeIter iter = {0};
- GtkTreeIter _tmp12_ = {0};
- if (dpi == default_dpi) {
- const gchar* _tmp4_ = NULL;
- gchar* _tmp5_ = NULL;
- _tmp4_ = _ ("%d dpi (default)");
- _tmp5_ = g_strdup_printf (_tmp4_, dpi);
+ GtkListStore* _tmp27_;
+ GtkTreeIter _tmp28_ = {0};
+ GtkListStore* _tmp29_;
+ GtkTreeIter _tmp30_;
+ gint _tmp31_;
+ const gchar* _tmp32_;
+ gint _tmp33_;
+ gint _tmp34_;
+ _tmp11_ = dpi;
+ _tmp12_ = default_dpi;
+ if (_tmp11_ == _tmp12_) {
+ const gchar* _tmp13_ = NULL;
+ gint _tmp14_;
+ gchar* _tmp15_ = NULL;
+ _tmp13_ = _ ("%d dpi (default)");
+ _tmp14_ = dpi;
+ _tmp15_ = g_strdup_printf (_tmp13_, _tmp14_);
_g_free0 (label);
- label = _tmp5_;
+ label = _tmp15_;
} else {
- if (dpi == 75) {
- const gchar* _tmp6_ = NULL;
- gchar* _tmp7_ = NULL;
- _tmp6_ = _ ("%d dpi (draft)");
- _tmp7_ = g_strdup_printf (_tmp6_, dpi);
+ gint _tmp16_;
+ _tmp16_ = dpi;
+ if (_tmp16_ == 75) {
+ const gchar* _tmp17_ = NULL;
+ gint _tmp18_;
+ gchar* _tmp19_ = NULL;
+ _tmp17_ = _ ("%d dpi (draft)");
+ _tmp18_ = dpi;
+ _tmp19_ = g_strdup_printf (_tmp17_, _tmp18_);
_g_free0 (label);
- label = _tmp7_;
+ label = _tmp19_;
} else {
- if (dpi == 1200) {
- const gchar* _tmp8_ = NULL;
- gchar* _tmp9_ = NULL;
- _tmp8_ = _ ("%d dpi (high resolution)");
- _tmp9_ = g_strdup_printf (_tmp8_, dpi);
+ gint _tmp20_;
+ _tmp20_ = dpi;
+ if (_tmp20_ == 1200) {
+ const gchar* _tmp21_ = NULL;
+ gint _tmp22_;
+ gchar* _tmp23_ = NULL;
+ _tmp21_ = _ ("%d dpi (high resolution)");
+ _tmp22_ = dpi;
+ _tmp23_ = g_strdup_printf (_tmp21_, _tmp22_);
_g_free0 (label);
- label = _tmp9_;
+ label = _tmp23_;
} else {
- const gchar* _tmp10_ = NULL;
- gchar* _tmp11_ = NULL;
- _tmp10_ = _ ("%d dpi");
- _tmp11_ = g_strdup_printf (_tmp10_, dpi);
+ const gchar* _tmp24_ = NULL;
+ gint _tmp25_;
+ gchar* _tmp26_ = NULL;
+ _tmp24_ = _ ("%d dpi");
+ _tmp25_ = dpi;
+ _tmp26_ = g_strdup_printf (_tmp24_, _tmp25_);
_g_free0 (label);
- label = _tmp11_;
+ label = _tmp26_;
}
}
}
- gtk_list_store_append (model, &_tmp12_);
- iter = _tmp12_;
- gtk_list_store_set (model, &iter, 0, dpi, 1, label, -1, -1);
- if (dpi == current_dpi) {
- gtk_combo_box_set_active_iter (combo, &iter);
+ _tmp27_ = model;
+ gtk_list_store_append (_tmp27_, &_tmp28_);
+ iter = _tmp28_;
+ _tmp29_ = model;
+ _tmp30_ = iter;
+ _tmp31_ = dpi;
+ _tmp32_ = label;
+ gtk_list_store_set (_tmp29_, &_tmp30_, 0, _tmp31_, 1, _tmp32_, -1, -1);
+ _tmp33_ = dpi;
+ _tmp34_ = current_dpi;
+ if (_tmp33_ == _tmp34_) {
+ GtkComboBox* _tmp35_;
+ GtkTreeIter _tmp36_;
+ _tmp35_ = combo;
+ _tmp36_ = iter;
+ gtk_combo_box_set_active_iter (_tmp35_, &_tmp36_);
}
_g_free0 (label);
}
@@ -2654,18 +3682,30 @@ static void simple_scan_set_dpi_combo (SimpleScan* self, GtkComboBox* combo, gin
static void simple_scan_needs_saving_cb (SimpleScan* self, Book* book) {
- gboolean _tmp0_;
- gboolean _tmp1_;
- gboolean _tmp2_;
+ GtkMenuItem* _tmp0_;
+ Book* _tmp1_;
+ gboolean _tmp2_ = FALSE;
+ GtkToolButton* _tmp3_;
+ Book* _tmp4_;
+ gboolean _tmp5_ = FALSE;
+ Book* _tmp6_;
+ gboolean _tmp7_ = FALSE;
g_return_if_fail (self != NULL);
g_return_if_fail (book != NULL);
- _tmp0_ = book_get_needs_saving (book);
- gtk_widget_set_sensitive ((GtkWidget*) self->priv->save_menuitem, _tmp0_);
- _tmp1_ = book_get_needs_saving (book);
- gtk_widget_set_sensitive ((GtkWidget*) self->priv->save_toolbutton, _tmp1_);
- _tmp2_ = book_get_needs_saving (book);
- if (_tmp2_) {
- gtk_widget_set_sensitive ((GtkWidget*) self->priv->save_as_menuitem, TRUE);
+ _tmp0_ = self->priv->save_menuitem;
+ _tmp1_ = book;
+ _tmp2_ = book_get_needs_saving (_tmp1_);
+ gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, _tmp2_);
+ _tmp3_ = self->priv->save_toolbutton;
+ _tmp4_ = book;
+ _tmp5_ = book_get_needs_saving (_tmp4_);
+ gtk_widget_set_sensitive ((GtkWidget*) _tmp3_, _tmp5_);
+ _tmp6_ = book;
+ _tmp7_ = book_get_needs_saving (_tmp6_);
+ if (_tmp7_) {
+ GtkMenuItem* _tmp8_;
+ _tmp8_ = self->priv->save_as_menuitem;
+ gtk_widget_set_sensitive ((GtkWidget*) _tmp8_, TRUE);
}
}
@@ -2697,116 +3737,250 @@ static void _simple_scan_needs_saving_cb_book_needs_saving_changed (Book* _sende
static void simple_scan_load (SimpleScan* self) {
GtkIconTheme* _tmp0_ = NULL;
- GtkBuilder* _tmp1_ = NULL;
+ GtkBuilder* _tmp1_;
gchar* _tmp2_ = NULL;
gchar* filename;
- GObject* _tmp5_ = NULL;
- GtkWindow* _tmp6_;
- GObject* _tmp7_ = NULL;
- GtkVBox* _tmp8_;
- GObject* _tmp9_ = NULL;
- GtkMenuItem* _tmp10_;
- GObject* _tmp11_ = NULL;
- GtkMenuItem* _tmp12_;
+ GtkBuilder* _tmp8_;
+ GtkBuilder* _tmp9_;
+ GObject* _tmp10_ = NULL;
+ GtkWindow* _tmp11_;
+ GtkBuilder* _tmp12_;
GObject* _tmp13_ = NULL;
- GtkMenuItem* _tmp14_;
- GObject* _tmp15_ = NULL;
- GtkMenuItem* _tmp16_;
- GObject* _tmp17_ = NULL;
- GtkMenuItem* _tmp18_;
+ GtkVBox* _tmp14_;
+ GtkBuilder* _tmp15_;
+ GObject* _tmp16_ = NULL;
+ GtkMenuItem* _tmp17_;
+ GtkBuilder* _tmp18_;
GObject* _tmp19_ = NULL;
GtkMenuItem* _tmp20_;
- GObject* _tmp21_ = NULL;
- GtkToolButton* _tmp22_;
- GObject* _tmp23_ = NULL;
- GtkMenuItem* _tmp24_;
+ GtkBuilder* _tmp21_;
+ GObject* _tmp22_ = NULL;
+ GtkMenuItem* _tmp23_;
+ GtkBuilder* _tmp24_;
GObject* _tmp25_ = NULL;
- GtkToolButton* _tmp26_;
- GObject* _tmp27_ = NULL;
- GtkRadioMenuItem* _tmp28_;
- GObject* _tmp29_ = NULL;
- GtkRadioMenuItem* _tmp30_;
+ GtkMenuItem* _tmp26_;
+ GtkBuilder* _tmp27_;
+ GObject* _tmp28_ = NULL;
+ GtkMenuItem* _tmp29_;
+ GtkBuilder* _tmp30_;
GObject* _tmp31_ = NULL;
- GtkRadioMenuItem* _tmp32_;
- GObject* _tmp33_ = NULL;
- GtkRadioMenuItem* _tmp34_;
- GObject* _tmp35_ = NULL;
- GtkDialog* _tmp36_;
+ GtkMenuItem* _tmp32_;
+ GtkBuilder* _tmp33_;
+ GObject* _tmp34_ = NULL;
+ GtkToolButton* _tmp35_;
+ GtkBuilder* _tmp36_;
GObject* _tmp37_ = NULL;
- GtkLabel* _tmp38_;
- GObject* _tmp39_ = NULL;
- GtkEntry* _tmp40_;
- GObject* _tmp41_ = NULL;
- GtkEntry* _tmp42_;
+ GtkMenuItem* _tmp38_;
+ GtkBuilder* _tmp39_;
+ GObject* _tmp40_ = NULL;
+ GtkToolButton* _tmp41_;
+ GtkBuilder* _tmp42_;
GObject* _tmp43_ = NULL;
- GtkDialog* _tmp44_;
- GObject* _tmp45_ = NULL;
- GtkComboBox* _tmp46_;
- GtkTreeModel* _tmp47_ = NULL;
- GtkListStore* _tmp48_;
+ GtkRadioMenuItem* _tmp44_;
+ GtkBuilder* _tmp45_;
+ GObject* _tmp46_ = NULL;
+ GtkRadioMenuItem* _tmp47_;
+ GtkBuilder* _tmp48_;
GObject* _tmp49_ = NULL;
- GtkComboBox* _tmp50_;
- GtkTreeModel* _tmp51_ = NULL;
- GtkListStore* _tmp52_;
- GObject* _tmp53_ = NULL;
- GtkComboBox* _tmp54_;
- GtkTreeModel* _tmp55_ = NULL;
- GtkListStore* _tmp56_;
- GObject* _tmp57_ = NULL;
- GtkComboBox* _tmp58_;
- GtkTreeModel* _tmp59_ = NULL;
- GtkListStore* _tmp60_;
+ GtkRadioMenuItem* _tmp50_;
+ GtkBuilder* _tmp51_;
+ GObject* _tmp52_ = NULL;
+ GtkRadioMenuItem* _tmp53_;
+ GtkBuilder* _tmp54_;
+ GObject* _tmp55_ = NULL;
+ GtkDialog* _tmp56_;
+ GtkBuilder* _tmp57_;
+ GObject* _tmp58_ = NULL;
+ GtkLabel* _tmp59_;
+ GtkBuilder* _tmp60_;
GObject* _tmp61_ = NULL;
- GtkComboBox* _tmp62_;
- GtkTreeModel* _tmp63_ = NULL;
- GtkListStore* _tmp64_;
- GtkInfoBar* _tmp65_ = NULL;
- GtkHBox* _tmp66_ = NULL;
+ GtkEntry* _tmp62_;
+ GtkBuilder* _tmp63_;
+ GObject* _tmp64_ = NULL;
+ GtkEntry* _tmp65_;
+ GtkBuilder* _tmp66_;
+ GObject* _tmp67_ = NULL;
+ GtkDialog* _tmp68_;
+ GtkBuilder* _tmp69_;
+ GObject* _tmp70_ = NULL;
+ GtkComboBox* _tmp71_;
+ GtkComboBox* _tmp72_;
+ GtkTreeModel* _tmp73_ = NULL;
+ GtkListStore* _tmp74_;
+ GtkBuilder* _tmp75_;
+ GObject* _tmp76_ = NULL;
+ GtkComboBox* _tmp77_;
+ GtkComboBox* _tmp78_;
+ GtkTreeModel* _tmp79_ = NULL;
+ GtkListStore* _tmp80_;
+ GtkBuilder* _tmp81_;
+ GObject* _tmp82_ = NULL;
+ GtkComboBox* _tmp83_;
+ GtkComboBox* _tmp84_;
+ GtkTreeModel* _tmp85_ = NULL;
+ GtkListStore* _tmp86_;
+ GtkBuilder* _tmp87_;
+ GObject* _tmp88_ = NULL;
+ GtkComboBox* _tmp89_;
+ GtkComboBox* _tmp90_;
+ GtkTreeModel* _tmp91_ = NULL;
+ GtkListStore* _tmp92_;
+ GtkBuilder* _tmp93_;
+ GObject* _tmp94_ = NULL;
+ GtkComboBox* _tmp95_;
+ GtkComboBox* _tmp96_;
+ GtkTreeModel* _tmp97_ = NULL;
+ GtkListStore* _tmp98_;
+ GtkInfoBar* _tmp99_;
+ GtkInfoBar* _tmp100_;
+ GtkInfoBar* _tmp101_;
+ GtkVBox* _tmp102_;
+ GtkInfoBar* _tmp103_;
+ GtkHBox* _tmp104_;
+ GtkHBox* _tmp105_;
GtkHBox* hbox;
- GtkWidget* _tmp67_ = NULL;
- GtkContainer* _tmp68_;
+ GtkInfoBar* _tmp106_;
+ GtkWidget* _tmp107_ = NULL;
+ GtkContainer* _tmp108_;
GtkContainer* content_area;
- GtkImage* _tmp69_ = NULL;
- GtkLabel* _tmp70_ = NULL;
- GtkWidget* _tmp71_ = NULL;
- GtkButton* _tmp72_;
- const gchar* _tmp73_ = NULL;
- GtkWidget* _tmp74_ = NULL;
- GtkButton* _tmp75_;
+ GtkContainer* _tmp109_;
+ GtkHBox* _tmp110_;
+ GtkHBox* _tmp111_;
+ GtkImage* _tmp112_;
+ GtkImage* _tmp113_;
+ GtkHBox* _tmp114_;
+ GtkImage* _tmp115_;
+ GtkImage* _tmp116_;
+ GtkLabel* _tmp117_;
+ GtkLabel* _tmp118_;
+ GtkLabel* _tmp119_;
+ GtkHBox* _tmp120_;
+ GtkLabel* _tmp121_;
+ GtkLabel* _tmp122_;
+ GtkInfoBar* _tmp123_;
+ GtkWidget* _tmp124_ = NULL;
+ GtkButton* _tmp125_;
+ GtkInfoBar* _tmp126_;
+ const gchar* _tmp127_ = NULL;
+ GtkWidget* _tmp128_ = NULL;
+ GtkButton* _tmp129_;
GtkTreeIter iter = {0};
- GtkTreeIter _tmp76_ = {0};
- const gchar* _tmp77_ = NULL;
- GtkTreeIter _tmp78_ = {0};
- GtkTreeIter _tmp79_ = {0};
- GtkTreeIter _tmp80_ = {0};
- GtkTreeIter _tmp81_ = {0};
- GtkTreeIter _tmp82_ = {0};
- GtkTreeIter _tmp83_ = {0};
- gint _tmp84_;
+ GtkListStore* _tmp130_;
+ GtkTreeIter _tmp131_ = {0};
+ GtkListStore* _tmp132_;
+ GtkTreeIter _tmp133_;
+ const gchar* _tmp134_ = NULL;
+ GtkListStore* _tmp135_;
+ GtkTreeIter _tmp136_ = {0};
+ GtkListStore* _tmp137_;
+ GtkTreeIter _tmp138_;
+ GtkListStore* _tmp139_;
+ GtkTreeIter _tmp140_ = {0};
+ GtkListStore* _tmp141_;
+ GtkTreeIter _tmp142_;
+ GtkListStore* _tmp143_;
+ GtkTreeIter _tmp144_ = {0};
+ GtkListStore* _tmp145_;
+ GtkTreeIter _tmp146_;
+ GtkListStore* _tmp147_;
+ GtkTreeIter _tmp148_ = {0};
+ GtkListStore* _tmp149_;
+ GtkTreeIter _tmp150_;
+ GtkListStore* _tmp151_;
+ GtkTreeIter _tmp152_ = {0};
+ GtkListStore* _tmp153_;
+ GtkTreeIter _tmp154_;
+ GtkListStore* _tmp155_;
+ GtkTreeIter _tmp156_ = {0};
+ GtkListStore* _tmp157_;
+ GtkTreeIter _tmp158_;
+ GSettings* _tmp159_;
+ gint _tmp160_ = 0;
gint dpi;
- gint _tmp85_;
- GtkCellRendererText* _tmp86_ = NULL;
+ gint _tmp161_;
+ GtkComboBox* _tmp162_;
+ gint _tmp163_;
+ GSettings* _tmp164_;
+ gint _tmp165_ = 0;
+ gint _tmp166_;
+ GtkComboBox* _tmp167_;
+ gint _tmp168_;
+ GtkCellRendererText* _tmp169_;
+ GtkCellRendererText* _tmp170_;
GtkCellRendererText* renderer;
- GtkCellRendererText* _tmp87_ = NULL;
- gint _tmp88_;
- GtkCellRendererText* _tmp89_ = NULL;
- gint _tmp90_;
+ GtkComboBox* _tmp171_;
+ GtkCellRendererText* _tmp172_;
+ GtkComboBox* _tmp173_;
+ GtkCellRendererText* _tmp174_;
+ GtkCellRendererText* _tmp175_;
+ GtkCellRendererText* _tmp176_;
+ GtkComboBox* _tmp177_;
+ GtkCellRendererText* _tmp178_;
+ GtkComboBox* _tmp179_;
+ GtkCellRendererText* _tmp180_;
+ GSettings* _tmp181_;
+ gint _tmp182_ = 0;
+ GtkCellRendererText* _tmp183_;
+ GtkCellRendererText* _tmp184_;
+ GtkComboBox* _tmp185_;
+ GtkCellRendererText* _tmp186_;
+ GtkComboBox* _tmp187_;
+ GtkCellRendererText* _tmp188_;
+ GSettings* _tmp189_;
+ gint _tmp190_ = 0;
gint paper_width;
- gint _tmp91_;
+ GSettings* _tmp191_;
+ gint _tmp192_ = 0;
gint paper_height;
- gchar* _tmp92_ = NULL;
+ gint _tmp193_;
+ gint _tmp194_;
+ GSettings* _tmp195_;
+ gchar* _tmp196_ = NULL;
gchar* device;
- gchar* _tmp95_ = NULL;
+ const gchar* _tmp197_;
+ GSettings* _tmp203_;
+ gchar* _tmp204_ = NULL;
gchar* document_type;
- BookView* _tmp96_ = NULL;
- gint _tmp97_;
- gint _tmp98_;
- gint _tmp99_;
- gint _tmp100_;
- gint _tmp101_;
- gint _tmp102_;
- gboolean _tmp103_;
- guint _tmp104_;
+ const gchar* _tmp205_;
+ Book* _tmp207_;
+ BookView* _tmp208_;
+ BookView* _tmp209_;
+ BookView* _tmp210_;
+ GtkVBox* _tmp211_;
+ BookView* _tmp212_;
+ BookView* _tmp213_;
+ BookView* _tmp214_;
+ BookView* _tmp215_;
+ BookView* _tmp216_;
+ GSettings* _tmp217_;
+ gint _tmp218_ = 0;
+ GSettings* _tmp219_;
+ gint _tmp220_ = 0;
+ gint _tmp221_;
+ GSettings* _tmp222_;
+ gint _tmp223_ = 0;
+ gint _tmp224_;
+ GSettings* _tmp225_;
+ gint _tmp226_ = 0;
+ gint _tmp227_;
+ GSettings* _tmp228_;
+ gint _tmp229_ = 0;
+ gint _tmp230_;
+ GSettings* _tmp231_;
+ gint _tmp232_ = 0;
+ gint _tmp233_;
+ gint _tmp234_;
+ gint _tmp235_;
+ GtkWindow* _tmp236_;
+ gint _tmp237_;
+ gint _tmp238_;
+ GSettings* _tmp239_;
+ gboolean _tmp240_ = FALSE;
+ gboolean _tmp241_;
+ Book* _tmp243_;
+ guint _tmp244_ = 0U;
+ Book* _tmp245_;
+ Book* _tmp246_;
GError * _inner_error_ = NULL;
g_return_if_fail (self != NULL);
_tmp0_ = gtk_icon_theme_get_default ();
@@ -2818,7 +3992,9 @@ static void simple_scan_load (SimpleScan* self) {
_tmp2_ = g_build_filename (UI_DIR, "simple-scan.ui", NULL, NULL);
filename = _tmp2_;
{
- gtk_builder_add_from_file (self->priv->builder, filename, &_inner_error_);
+ GtkBuilder* _tmp3_;
+ _tmp3_ = self->priv->builder;
+ gtk_builder_add_from_file (_tmp3_, filename, &_inner_error_);
if (_inner_error_ != NULL) {
goto __catch17_g_error;
}
@@ -2827,14 +4003,18 @@ static void simple_scan_load (SimpleScan* self) {
__catch17_g_error:
{
GError* e = NULL;
- const gchar* _tmp3_ = NULL;
- const gchar* _tmp4_ = NULL;
+ GError* _tmp4_;
+ const gchar* _tmp5_;
+ const gchar* _tmp6_ = NULL;
+ const gchar* _tmp7_ = NULL;
e = _inner_error_;
_inner_error_ = NULL;
- g_critical ("ui.vala:1261: Unable to load UI %s: %s\n", filename, e->message);
- _tmp3_ = _ ("Files missing");
- _tmp4_ = _ ("Please check your installation");
- simple_scan_show_error_dialog (self, _tmp3_, _tmp4_);
+ _tmp4_ = e;
+ _tmp5_ = _tmp4_->message;
+ g_critical ("ui.vala:1261: Unable to load UI %s: %s\n", filename, _tmp5_);
+ _tmp6_ = _ ("Files missing");
+ _tmp7_ = _ ("Please check your installation");
+ simple_scan_show_error_dialog (self, _tmp6_, _tmp7_);
exit (EXIT_FAILURE);
_g_error_free0 (e);
}
@@ -2845,280 +4025,424 @@ static void simple_scan_load (SimpleScan* self) {
g_clear_error (&_inner_error_);
return;
}
- gtk_builder_connect_signals (self->priv->builder, self);
- _tmp5_ = gtk_builder_get_object (self->priv->builder, "simple_scan_window");
- _tmp6_ = _g_object_ref0 (GTK_WINDOW (_tmp5_));
+ _tmp8_ = self->priv->builder;
+ gtk_builder_connect_signals (_tmp8_, self);
+ _tmp9_ = self->priv->builder;
+ _tmp10_ = gtk_builder_get_object (_tmp9_, "simple_scan_window");
+ _tmp11_ = _g_object_ref0 (GTK_WINDOW (_tmp10_));
_g_object_unref0 (self->priv->window);
- self->priv->window = _tmp6_;
- _tmp7_ = gtk_builder_get_object (self->priv->builder, "main_vbox");
- _tmp8_ = _g_object_ref0 (GTK_VBOX (_tmp7_));
+ self->priv->window = _tmp11_;
+ _tmp12_ = self->priv->builder;
+ _tmp13_ = gtk_builder_get_object (_tmp12_, "main_vbox");
+ _tmp14_ = _g_object_ref0 (GTK_VBOX (_tmp13_));
_g_object_unref0 (self->priv->main_vbox);
- self->priv->main_vbox = _tmp8_;
- _tmp9_ = gtk_builder_get_object (self->priv->builder, "page_move_left_menuitem");
- _tmp10_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp9_));
+ self->priv->main_vbox = _tmp14_;
+ _tmp15_ = self->priv->builder;
+ _tmp16_ = gtk_builder_get_object (_tmp15_, "page_move_left_menuitem");
+ _tmp17_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp16_));
_g_object_unref0 (self->priv->page_move_left_menuitem);
- self->priv->page_move_left_menuitem = _tmp10_;
- _tmp11_ = gtk_builder_get_object (self->priv->builder, "page_move_right_menuitem");
- _tmp12_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp11_));
+ self->priv->page_move_left_menuitem = _tmp17_;
+ _tmp18_ = self->priv->builder;
+ _tmp19_ = gtk_builder_get_object (_tmp18_, "page_move_right_menuitem");
+ _tmp20_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp19_));
_g_object_unref0 (self->priv->page_move_right_menuitem);
- self->priv->page_move_right_menuitem = _tmp12_;
- _tmp13_ = gtk_builder_get_object (self->priv->builder, "page_delete_menuitem");
- _tmp14_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp13_));
+ self->priv->page_move_right_menuitem = _tmp20_;
+ _tmp21_ = self->priv->builder;
+ _tmp22_ = gtk_builder_get_object (_tmp21_, "page_delete_menuitem");
+ _tmp23_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp22_));
_g_object_unref0 (self->priv->page_delete_menuitem);
- self->priv->page_delete_menuitem = _tmp14_;
- _tmp15_ = gtk_builder_get_object (self->priv->builder, "crop_rotate_menuitem");
- _tmp16_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp15_));
+ self->priv->page_delete_menuitem = _tmp23_;
+ _tmp24_ = self->priv->builder;
+ _tmp25_ = gtk_builder_get_object (_tmp24_, "crop_rotate_menuitem");
+ _tmp26_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp25_));
_g_object_unref0 (self->priv->crop_rotate_menuitem);
- self->priv->crop_rotate_menuitem = _tmp16_;
- _tmp17_ = gtk_builder_get_object (self->priv->builder, "save_menuitem");
- _tmp18_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp17_));
+ self->priv->crop_rotate_menuitem = _tmp26_;
+ _tmp27_ = self->priv->builder;
+ _tmp28_ = gtk_builder_get_object (_tmp27_, "save_menuitem");
+ _tmp29_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp28_));
_g_object_unref0 (self->priv->save_menuitem);
- self->priv->save_menuitem = _tmp18_;
- _tmp19_ = gtk_builder_get_object (self->priv->builder, "save_as_menuitem");
- _tmp20_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp19_));
+ self->priv->save_menuitem = _tmp29_;
+ _tmp30_ = self->priv->builder;
+ _tmp31_ = gtk_builder_get_object (_tmp30_, "save_as_menuitem");
+ _tmp32_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp31_));
_g_object_unref0 (self->priv->save_as_menuitem);
- self->priv->save_as_menuitem = _tmp20_;
- _tmp21_ = gtk_builder_get_object (self->priv->builder, "save_toolbutton");
- _tmp22_ = _g_object_ref0 (GTK_TOOL_BUTTON (_tmp21_));
+ self->priv->save_as_menuitem = _tmp32_;
+ _tmp33_ = self->priv->builder;
+ _tmp34_ = gtk_builder_get_object (_tmp33_, "save_toolbutton");
+ _tmp35_ = _g_object_ref0 (GTK_TOOL_BUTTON (_tmp34_));
_g_object_unref0 (self->priv->save_toolbutton);
- self->priv->save_toolbutton = _tmp22_;
- _tmp23_ = gtk_builder_get_object (self->priv->builder, "stop_scan_menuitem");
- _tmp24_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp23_));
+ self->priv->save_toolbutton = _tmp35_;
+ _tmp36_ = self->priv->builder;
+ _tmp37_ = gtk_builder_get_object (_tmp36_, "stop_scan_menuitem");
+ _tmp38_ = _g_object_ref0 (GTK_MENU_ITEM (_tmp37_));
_g_object_unref0 (self->priv->stop_menuitem);
- self->priv->stop_menuitem = _tmp24_;
- _tmp25_ = gtk_builder_get_object (self->priv->builder, "stop_toolbutton");
- _tmp26_ = _g_object_ref0 (GTK_TOOL_BUTTON (_tmp25_));
+ self->priv->stop_menuitem = _tmp38_;
+ _tmp39_ = self->priv->builder;
+ _tmp40_ = gtk_builder_get_object (_tmp39_, "stop_toolbutton");
+ _tmp41_ = _g_object_ref0 (GTK_TOOL_BUTTON (_tmp40_));
_g_object_unref0 (self->priv->stop_toolbutton);
- self->priv->stop_toolbutton = _tmp26_;
- _tmp27_ = gtk_builder_get_object (self->priv->builder, "text_toolbutton_menuitem");
- _tmp28_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp27_));
+ self->priv->stop_toolbutton = _tmp41_;
+ _tmp42_ = self->priv->builder;
+ _tmp43_ = gtk_builder_get_object (_tmp42_, "text_toolbutton_menuitem");
+ _tmp44_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp43_));
_g_object_unref0 (self->priv->text_toolbar_menuitem);
- self->priv->text_toolbar_menuitem = _tmp28_;
- _tmp29_ = gtk_builder_get_object (self->priv->builder, "text_menuitem");
- _tmp30_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp29_));
+ self->priv->text_toolbar_menuitem = _tmp44_;
+ _tmp45_ = self->priv->builder;
+ _tmp46_ = gtk_builder_get_object (_tmp45_, "text_menuitem");
+ _tmp47_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp46_));
_g_object_unref0 (self->priv->text_menu_menuitem);
- self->priv->text_menu_menuitem = _tmp30_;
- _tmp31_ = gtk_builder_get_object (self->priv->builder, "photo_toolbutton_menuitem");
- _tmp32_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp31_));
+ self->priv->text_menu_menuitem = _tmp47_;
+ _tmp48_ = self->priv->builder;
+ _tmp49_ = gtk_builder_get_object (_tmp48_, "photo_toolbutton_menuitem");
+ _tmp50_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp49_));
_g_object_unref0 (self->priv->photo_toolbar_menuitem);
- self->priv->photo_toolbar_menuitem = _tmp32_;
- _tmp33_ = gtk_builder_get_object (self->priv->builder, "photo_menuitem");
- _tmp34_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp33_));
+ self->priv->photo_toolbar_menuitem = _tmp50_;
+ _tmp51_ = self->priv->builder;
+ _tmp52_ = gtk_builder_get_object (_tmp51_, "photo_menuitem");
+ _tmp53_ = _g_object_ref0 (GTK_RADIO_MENU_ITEM (_tmp52_));
_g_object_unref0 (self->priv->photo_menu_menuitem);
- self->priv->photo_menu_menuitem = _tmp34_;
- _tmp35_ = gtk_builder_get_object (self->priv->builder, "authorize_dialog");
- _tmp36_ = _g_object_ref0 (GTK_DIALOG (_tmp35_));
+ self->priv->photo_menu_menuitem = _tmp53_;
+ _tmp54_ = self->priv->builder;
+ _tmp55_ = gtk_builder_get_object (_tmp54_, "authorize_dialog");
+ _tmp56_ = _g_object_ref0 (GTK_DIALOG (_tmp55_));
_g_object_unref0 (self->priv->authorize_dialog);
- self->priv->authorize_dialog = _tmp36_;
- _tmp37_ = gtk_builder_get_object (self->priv->builder, "authorize_label");
- _tmp38_ = _g_object_ref0 (GTK_LABEL (_tmp37_));
+ self->priv->authorize_dialog = _tmp56_;
+ _tmp57_ = self->priv->builder;
+ _tmp58_ = gtk_builder_get_object (_tmp57_, "authorize_label");
+ _tmp59_ = _g_object_ref0 (GTK_LABEL (_tmp58_));
_g_object_unref0 (self->priv->authorize_label);
- self->priv->authorize_label = _tmp38_;
- _tmp39_ = gtk_builder_get_object (self->priv->builder, "username_entry");
- _tmp40_ = _g_object_ref0 (GTK_ENTRY (_tmp39_));
+ self->priv->authorize_label = _tmp59_;
+ _tmp60_ = self->priv->builder;
+ _tmp61_ = gtk_builder_get_object (_tmp60_, "username_entry");
+ _tmp62_ = _g_object_ref0 (GTK_ENTRY (_tmp61_));
_g_object_unref0 (self->priv->username_entry);
- self->priv->username_entry = _tmp40_;
- _tmp41_ = gtk_builder_get_object (self->priv->builder, "password_entry");
- _tmp42_ = _g_object_ref0 (GTK_ENTRY (_tmp41_));
+ self->priv->username_entry = _tmp62_;
+ _tmp63_ = self->priv->builder;
+ _tmp64_ = gtk_builder_get_object (_tmp63_, "password_entry");
+ _tmp65_ = _g_object_ref0 (GTK_ENTRY (_tmp64_));
_g_object_unref0 (self->priv->password_entry);
- self->priv->password_entry = _tmp42_;
- _tmp43_ = gtk_builder_get_object (self->priv->builder, "preferences_dialog");
- _tmp44_ = _g_object_ref0 (GTK_DIALOG (_tmp43_));
+ self->priv->password_entry = _tmp65_;
+ _tmp66_ = self->priv->builder;
+ _tmp67_ = gtk_builder_get_object (_tmp66_, "preferences_dialog");
+ _tmp68_ = _g_object_ref0 (GTK_DIALOG (_tmp67_));
_g_object_unref0 (self->priv->preferences_dialog);
- self->priv->preferences_dialog = _tmp44_;
- _tmp45_ = gtk_builder_get_object (self->priv->builder, "device_combo");
- _tmp46_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp45_));
+ self->priv->preferences_dialog = _tmp68_;
+ _tmp69_ = self->priv->builder;
+ _tmp70_ = gtk_builder_get_object (_tmp69_, "device_combo");
+ _tmp71_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp70_));
_g_object_unref0 (self->priv->device_combo);
- self->priv->device_combo = _tmp46_;
- _tmp47_ = gtk_combo_box_get_model (self->priv->device_combo);
- _tmp48_ = _g_object_ref0 (GTK_LIST_STORE (_tmp47_));
+ self->priv->device_combo = _tmp71_;
+ _tmp72_ = self->priv->device_combo;
+ _tmp73_ = gtk_combo_box_get_model (_tmp72_);
+ _tmp74_ = _g_object_ref0 (GTK_LIST_STORE (_tmp73_));
_g_object_unref0 (self->priv->device_model);
- self->priv->device_model = _tmp48_;
- _tmp49_ = gtk_builder_get_object (self->priv->builder, "text_dpi_combo");
- _tmp50_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp49_));
+ self->priv->device_model = _tmp74_;
+ _tmp75_ = self->priv->builder;
+ _tmp76_ = gtk_builder_get_object (_tmp75_, "text_dpi_combo");
+ _tmp77_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp76_));
_g_object_unref0 (self->priv->text_dpi_combo);
- self->priv->text_dpi_combo = _tmp50_;
- _tmp51_ = gtk_combo_box_get_model (self->priv->text_dpi_combo);
- _tmp52_ = _g_object_ref0 (GTK_LIST_STORE (_tmp51_));
+ self->priv->text_dpi_combo = _tmp77_;
+ _tmp78_ = self->priv->text_dpi_combo;
+ _tmp79_ = gtk_combo_box_get_model (_tmp78_);
+ _tmp80_ = _g_object_ref0 (GTK_LIST_STORE (_tmp79_));
_g_object_unref0 (self->priv->text_dpi_model);
- self->priv->text_dpi_model = _tmp52_;
- _tmp53_ = gtk_builder_get_object (self->priv->builder, "photo_dpi_combo");
- _tmp54_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp53_));
+ self->priv->text_dpi_model = _tmp80_;
+ _tmp81_ = self->priv->builder;
+ _tmp82_ = gtk_builder_get_object (_tmp81_, "photo_dpi_combo");
+ _tmp83_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp82_));
_g_object_unref0 (self->priv->photo_dpi_combo);
- self->priv->photo_dpi_combo = _tmp54_;
- _tmp55_ = gtk_combo_box_get_model (self->priv->photo_dpi_combo);
- _tmp56_ = _g_object_ref0 (GTK_LIST_STORE (_tmp55_));
+ self->priv->photo_dpi_combo = _tmp83_;
+ _tmp84_ = self->priv->photo_dpi_combo;
+ _tmp85_ = gtk_combo_box_get_model (_tmp84_);
+ _tmp86_ = _g_object_ref0 (GTK_LIST_STORE (_tmp85_));
_g_object_unref0 (self->priv->photo_dpi_model);
- self->priv->photo_dpi_model = _tmp56_;
- _tmp57_ = gtk_builder_get_object (self->priv->builder, "page_side_combo");
- _tmp58_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp57_));
+ self->priv->photo_dpi_model = _tmp86_;
+ _tmp87_ = self->priv->builder;
+ _tmp88_ = gtk_builder_get_object (_tmp87_, "page_side_combo");
+ _tmp89_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp88_));
_g_object_unref0 (self->priv->page_side_combo);
- self->priv->page_side_combo = _tmp58_;
- _tmp59_ = gtk_combo_box_get_model (self->priv->page_side_combo);
- _tmp60_ = _g_object_ref0 (GTK_LIST_STORE (_tmp59_));
+ self->priv->page_side_combo = _tmp89_;
+ _tmp90_ = self->priv->page_side_combo;
+ _tmp91_ = gtk_combo_box_get_model (_tmp90_);
+ _tmp92_ = _g_object_ref0 (GTK_LIST_STORE (_tmp91_));
_g_object_unref0 (self->priv->page_side_model);
- self->priv->page_side_model = _tmp60_;
- _tmp61_ = gtk_builder_get_object (self->priv->builder, "paper_size_combo");
- _tmp62_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp61_));
+ self->priv->page_side_model = _tmp92_;
+ _tmp93_ = self->priv->builder;
+ _tmp94_ = gtk_builder_get_object (_tmp93_, "paper_size_combo");
+ _tmp95_ = _g_object_ref0 (GTK_COMBO_BOX (_tmp94_));
_g_object_unref0 (self->priv->paper_size_combo);
- self->priv->paper_size_combo = _tmp62_;
- _tmp63_ = gtk_combo_box_get_model (self->priv->paper_size_combo);
- _tmp64_ = _g_object_ref0 (GTK_LIST_STORE (_tmp63_));
+ self->priv->paper_size_combo = _tmp95_;
+ _tmp96_ = self->priv->paper_size_combo;
+ _tmp97_ = gtk_combo_box_get_model (_tmp96_);
+ _tmp98_ = _g_object_ref0 (GTK_LIST_STORE (_tmp97_));
_g_object_unref0 (self->priv->paper_size_model);
- self->priv->paper_size_model = _tmp64_;
- _tmp65_ = (GtkInfoBar*) gtk_info_bar_new ();
+ self->priv->paper_size_model = _tmp98_;
+ _tmp99_ = (GtkInfoBar*) gtk_info_bar_new ();
+ _tmp100_ = g_object_ref_sink (_tmp99_);
_g_object_unref0 (self->priv->info_bar);
- self->priv->info_bar = g_object_ref_sink (_tmp65_);
- g_signal_connect (self->priv->info_bar, "response", (GCallback) _simple_scan_info_bar_response_cb_gtk_info_bar_response, self);
- gtk_box_pack_start ((GtkBox*) self->priv->main_vbox, (GtkWidget*) self->priv->info_bar, FALSE, TRUE, (guint) 0);
- _tmp66_ = (GtkHBox*) gtk_hbox_new (FALSE, 12);
- hbox = g_object_ref_sink (_tmp66_);
- _tmp67_ = gtk_info_bar_get_content_area (self->priv->info_bar);
- _tmp68_ = _g_object_ref0 (GTK_CONTAINER (_tmp67_));
- content_area = _tmp68_;
- gtk_container_add (content_area, (GtkWidget*) hbox);
- gtk_widget_show ((GtkWidget*) hbox);
- _tmp69_ = (GtkImage*) gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG);
+ self->priv->info_bar = _tmp100_;
+ _tmp101_ = self->priv->info_bar;
+ g_signal_connect (_tmp101_, "response", (GCallback) _simple_scan_info_bar_response_cb_gtk_info_bar_response, self);
+ _tmp102_ = self->priv->main_vbox;
+ _tmp103_ = self->priv->info_bar;
+ gtk_box_pack_start ((GtkBox*) _tmp102_, (GtkWidget*) _tmp103_, FALSE, TRUE, (guint) 0);
+ _tmp104_ = (GtkHBox*) gtk_hbox_new (FALSE, 12);
+ _tmp105_ = g_object_ref_sink (_tmp104_);
+ hbox = _tmp105_;
+ _tmp106_ = self->priv->info_bar;
+ _tmp107_ = gtk_info_bar_get_content_area (_tmp106_);
+ _tmp108_ = _g_object_ref0 (GTK_CONTAINER (_tmp107_));
+ content_area = _tmp108_;
+ _tmp109_ = content_area;
+ _tmp110_ = hbox;
+ gtk_container_add (_tmp109_, (GtkWidget*) _tmp110_);
+ _tmp111_ = hbox;
+ gtk_widget_show ((GtkWidget*) _tmp111_);
+ _tmp112_ = (GtkImage*) gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG);
+ _tmp113_ = g_object_ref_sink (_tmp112_);
_g_object_unref0 (self->priv->info_bar_image);
- self->priv->info_bar_image = g_object_ref_sink (_tmp69_);
- gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) self->priv->info_bar_image, FALSE, TRUE, (guint) 0);
- gtk_widget_show ((GtkWidget*) self->priv->info_bar_image);
- _tmp70_ = (GtkLabel*) gtk_label_new (NULL);
+ self->priv->info_bar_image = _tmp113_;
+ _tmp114_ = hbox;
+ _tmp115_ = self->priv->info_bar_image;
+ gtk_box_pack_start ((GtkBox*) _tmp114_, (GtkWidget*) _tmp115_, FALSE, TRUE, (guint) 0);
+ _tmp116_ = self->priv->info_bar_image;
+ gtk_widget_show ((GtkWidget*) _tmp116_);
+ _tmp117_ = (GtkLabel*) gtk_label_new (NULL);
+ _tmp118_ = g_object_ref_sink (_tmp117_);
_g_object_unref0 (self->priv->info_bar_label);
- self->priv->info_bar_label = g_object_ref_sink (_tmp70_);
- gtk_misc_set_alignment ((GtkMisc*) self->priv->info_bar_label, 0.0f, 0.5f);
- gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) self->priv->info_bar_label, TRUE, TRUE, (guint) 0);
- gtk_widget_show ((GtkWidget*) self->priv->info_bar_label);
- _tmp71_ = gtk_info_bar_add_button (self->priv->info_bar, GTK_STOCK_CLOSE, (gint) GTK_RESPONSE_CLOSE);
- _tmp72_ = _g_object_ref0 (GTK_BUTTON (_tmp71_));
+ self->priv->info_bar_label = _tmp118_;
+ _tmp119_ = self->priv->info_bar_label;
+ gtk_misc_set_alignment ((GtkMisc*) _tmp119_, 0.0f, 0.5f);
+ _tmp120_ = hbox;
+ _tmp121_ = self->priv->info_bar_label;
+ gtk_box_pack_start ((GtkBox*) _tmp120_, (GtkWidget*) _tmp121_, TRUE, TRUE, (guint) 0);
+ _tmp122_ = self->priv->info_bar_label;
+ gtk_widget_show ((GtkWidget*) _tmp122_);
+ _tmp123_ = self->priv->info_bar;
+ _tmp124_ = gtk_info_bar_add_button (_tmp123_, GTK_STOCK_CLOSE, (gint) GTK_RESPONSE_CLOSE);
+ _tmp125_ = _g_object_ref0 (GTK_BUTTON (_tmp124_));
_g_object_unref0 (self->priv->info_bar_close_button);
- self->priv->info_bar_close_button = _tmp72_;
- _tmp73_ = _ ("Change _Scanner");
- _tmp74_ = gtk_info_bar_add_button (self->priv->info_bar, _tmp73_, 1);
- _tmp75_ = _g_object_ref0 (GTK_BUTTON (_tmp74_));
+ self->priv->info_bar_close_button = _tmp125_;
+ _tmp126_ = self->priv->info_bar;
+ _tmp127_ = _ ("Change _Scanner");
+ _tmp128_ = gtk_info_bar_add_button (_tmp126_, _tmp127_, 1);
+ _tmp129_ = _g_object_ref0 (GTK_BUTTON (_tmp128_));
_g_object_unref0 (self->priv->info_bar_change_scanner_button);
- self->priv->info_bar_change_scanner_button = _tmp75_;
- gtk_list_store_append (self->priv->paper_size_model, &_tmp76_);
- iter = _tmp76_;
- _tmp77_ = _ ("Automatic");
- gtk_list_store_set (self->priv->paper_size_model, &iter, 0, 0, 1, 0, 2, _tmp77_, -1, -1);
- gtk_list_store_append (self->priv->paper_size_model, &_tmp78_);
- iter = _tmp78_;
- gtk_list_store_set (self->priv->paper_size_model, &iter, 0, 1050, 1, 1480, 2, "A6", -1, -1);
- gtk_list_store_append (self->priv->paper_size_model, &_tmp79_);
- iter = _tmp79_;
- gtk_list_store_set (self->priv->paper_size_model, &iter, 0, 1480, 1, 2100, 2, "A5", -1, -1);
- gtk_list_store_append (self->priv->paper_size_model, &_tmp80_);
- iter = _tmp80_;
- gtk_list_store_set (self->priv->paper_size_model, &iter, 0, 2100, 1, 2970, 2, "A4", -1, -1);
- gtk_list_store_append (self->priv->paper_size_model, &_tmp81_);
- iter = _tmp81_;
- gtk_list_store_set (self->priv->paper_size_model, &iter, 0, 2159, 1, 2794, 2, "Letter", -1, -1);
- gtk_list_store_append (self->priv->paper_size_model, &_tmp82_);
- iter = _tmp82_;
- gtk_list_store_set (self->priv->paper_size_model, &iter, 0, 2159, 1, 3556, 2, "Legal", -1, -1);
- gtk_list_store_append (self->priv->paper_size_model, &_tmp83_);
- iter = _tmp83_;
- gtk_list_store_set (self->priv->paper_size_model, &iter, 0, 1016, 1, 1524, 2, "4×6", -1, -1);
- _tmp84_ = g_settings_get_int (self->priv->settings, "text-dpi");
- dpi = _tmp84_;
- if (dpi <= 0) {
+ self->priv->info_bar_change_scanner_button = _tmp129_;
+ _tmp130_ = self->priv->paper_size_model;
+ gtk_list_store_append (_tmp130_, &_tmp131_);
+ iter = _tmp131_;
+ _tmp132_ = self->priv->paper_size_model;
+ _tmp133_ = iter;
+ _tmp134_ = _ ("Automatic");
+ gtk_list_store_set (_tmp132_, &_tmp133_, 0, 0, 1, 0, 2, _tmp134_, -1, -1);
+ _tmp135_ = self->priv->paper_size_model;
+ gtk_list_store_append (_tmp135_, &_tmp136_);
+ iter = _tmp136_;
+ _tmp137_ = self->priv->paper_size_model;
+ _tmp138_ = iter;
+ gtk_list_store_set (_tmp137_, &_tmp138_, 0, 1050, 1, 1480, 2, "A6", -1, -1);
+ _tmp139_ = self->priv->paper_size_model;
+ gtk_list_store_append (_tmp139_, &_tmp140_);
+ iter = _tmp140_;
+ _tmp141_ = self->priv->paper_size_model;
+ _tmp142_ = iter;
+ gtk_list_store_set (_tmp141_, &_tmp142_, 0, 1480, 1, 2100, 2, "A5", -1, -1);
+ _tmp143_ = self->priv->paper_size_model;
+ gtk_list_store_append (_tmp143_, &_tmp144_);
+ iter = _tmp144_;
+ _tmp145_ = self->priv->paper_size_model;
+ _tmp146_ = iter;
+ gtk_list_store_set (_tmp145_, &_tmp146_, 0, 2100, 1, 2970, 2, "A4", -1, -1);
+ _tmp147_ = self->priv->paper_size_model;
+ gtk_list_store_append (_tmp147_, &_tmp148_);
+ iter = _tmp148_;
+ _tmp149_ = self->priv->paper_size_model;
+ _tmp150_ = iter;
+ gtk_list_store_set (_tmp149_, &_tmp150_, 0, 2159, 1, 2794, 2, "Letter", -1, -1);
+ _tmp151_ = self->priv->paper_size_model;
+ gtk_list_store_append (_tmp151_, &_tmp152_);
+ iter = _tmp152_;
+ _tmp153_ = self->priv->paper_size_model;
+ _tmp154_ = iter;
+ gtk_list_store_set (_tmp153_, &_tmp154_, 0, 2159, 1, 3556, 2, "Legal", -1, -1);
+ _tmp155_ = self->priv->paper_size_model;
+ gtk_list_store_append (_tmp155_, &_tmp156_);
+ iter = _tmp156_;
+ _tmp157_ = self->priv->paper_size_model;
+ _tmp158_ = iter;
+ gtk_list_store_set (_tmp157_, &_tmp158_, 0, 1016, 1, 1524, 2, "4×6", -1, -1);
+ _tmp159_ = self->priv->settings;
+ _tmp160_ = g_settings_get_int (_tmp159_, "text-dpi");
+ dpi = _tmp160_;
+ _tmp161_ = dpi;
+ if (_tmp161_ <= 0) {
dpi = SIMPLE_SCAN_DEFAULT_TEXT_DPI;
}
- simple_scan_set_dpi_combo (self, self->priv->text_dpi_combo, SIMPLE_SCAN_DEFAULT_TEXT_DPI, dpi);
- _tmp85_ = g_settings_get_int (self->priv->settings, "photo-dpi");
- dpi = _tmp85_;
- if (dpi <= 0) {
+ _tmp162_ = self->priv->text_dpi_combo;
+ _tmp163_ = dpi;
+ simple_scan_set_dpi_combo (self, _tmp162_, SIMPLE_SCAN_DEFAULT_TEXT_DPI, _tmp163_);
+ _tmp164_ = self->priv->settings;
+ _tmp165_ = g_settings_get_int (_tmp164_, "photo-dpi");
+ dpi = _tmp165_;
+ _tmp166_ = dpi;
+ if (_tmp166_ <= 0) {
dpi = SIMPLE_SCAN_DEFAULT_PHOTO_DPI;
}
- simple_scan_set_dpi_combo (self, self->priv->photo_dpi_combo, SIMPLE_SCAN_DEFAULT_PHOTO_DPI, dpi);
- _tmp86_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
- renderer = g_object_ref_sink (_tmp86_);
- gtk_cell_layout_pack_start ((GtkCellLayout*) self->priv->device_combo, (GtkCellRenderer*) renderer, TRUE);
- gtk_cell_layout_add_attribute ((GtkCellLayout*) self->priv->device_combo, (GtkCellRenderer*) renderer, "text", 1);
- _tmp87_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
+ _tmp167_ = self->priv->photo_dpi_combo;
+ _tmp168_ = dpi;
+ simple_scan_set_dpi_combo (self, _tmp167_, SIMPLE_SCAN_DEFAULT_PHOTO_DPI, _tmp168_);
+ _tmp169_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
+ _tmp170_ = g_object_ref_sink (_tmp169_);
+ renderer = _tmp170_;
+ _tmp171_ = self->priv->device_combo;
+ _tmp172_ = renderer;
+ gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp171_, (GtkCellRenderer*) _tmp172_, TRUE);
+ _tmp173_ = self->priv->device_combo;
+ _tmp174_ = renderer;
+ gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp173_, (GtkCellRenderer*) _tmp174_, "text", 1);
+ _tmp175_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
+ _tmp176_ = g_object_ref_sink (_tmp175_);
_g_object_unref0 (renderer);
- renderer = g_object_ref_sink (_tmp87_);
- gtk_cell_layout_pack_start ((GtkCellLayout*) self->priv->page_side_combo, (GtkCellRenderer*) renderer, TRUE);
- gtk_cell_layout_add_attribute ((GtkCellLayout*) self->priv->page_side_combo, (GtkCellRenderer*) renderer, "text", 1);
- _tmp88_ = g_settings_get_enum (self->priv->settings, "page-side");
- simple_scan_set_page_side (self, (ScanType) _tmp88_);
- _tmp89_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
+ renderer = _tmp176_;
+ _tmp177_ = self->priv->page_side_combo;
+ _tmp178_ = renderer;
+ gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp177_, (GtkCellRenderer*) _tmp178_, TRUE);
+ _tmp179_ = self->priv->page_side_combo;
+ _tmp180_ = renderer;
+ gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp179_, (GtkCellRenderer*) _tmp180_, "text", 1);
+ _tmp181_ = self->priv->settings;
+ _tmp182_ = g_settings_get_enum (_tmp181_, "page-side");
+ simple_scan_set_page_side (self, (ScanType) _tmp182_);
+ _tmp183_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
+ _tmp184_ = g_object_ref_sink (_tmp183_);
_g_object_unref0 (renderer);
- renderer = g_object_ref_sink (_tmp89_);
- gtk_cell_layout_pack_start ((GtkCellLayout*) self->priv->paper_size_combo, (GtkCellRenderer*) renderer, TRUE);
- gtk_cell_layout_add_attribute ((GtkCellLayout*) self->priv->paper_size_combo, (GtkCellRenderer*) renderer, "text", 2);
- _tmp90_ = g_settings_get_int (self->priv->settings, "paper-width");
- paper_width = _tmp90_;
- _tmp91_ = g_settings_get_int (self->priv->settings, "paper-height");
- paper_height = _tmp91_;
- simple_scan_set_paper_size (self, paper_width, paper_height);
- _tmp92_ = g_settings_get_string (self->priv->settings, "selected-device");
- device = _tmp92_;
- if (device != NULL) {
- GtkTreeIter _tmp93_ = {0};
- gboolean _tmp94_;
- _tmp94_ = simple_scan_find_scan_device (self, device, &_tmp93_);
- iter = _tmp93_;
- if (_tmp94_) {
- gtk_combo_box_set_active_iter (self->priv->device_combo, &iter);
+ renderer = _tmp184_;
+ _tmp185_ = self->priv->paper_size_combo;
+ _tmp186_ = renderer;
+ gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp185_, (GtkCellRenderer*) _tmp186_, TRUE);
+ _tmp187_ = self->priv->paper_size_combo;
+ _tmp188_ = renderer;
+ gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp187_, (GtkCellRenderer*) _tmp188_, "text", 2);
+ _tmp189_ = self->priv->settings;
+ _tmp190_ = g_settings_get_int (_tmp189_, "paper-width");
+ paper_width = _tmp190_;
+ _tmp191_ = self->priv->settings;
+ _tmp192_ = g_settings_get_int (_tmp191_, "paper-height");
+ paper_height = _tmp192_;
+ _tmp193_ = paper_width;
+ _tmp194_ = paper_height;
+ simple_scan_set_paper_size (self, _tmp193_, _tmp194_);
+ _tmp195_ = self->priv->settings;
+ _tmp196_ = g_settings_get_string (_tmp195_, "selected-device");
+ device = _tmp196_;
+ _tmp197_ = device;
+ if (_tmp197_ != NULL) {
+ const gchar* _tmp198_;
+ GtkTreeIter _tmp199_ = {0};
+ gboolean _tmp200_ = FALSE;
+ _tmp198_ = device;
+ _tmp200_ = simple_scan_find_scan_device (self, _tmp198_, &_tmp199_);
+ iter = _tmp199_;
+ if (_tmp200_) {
+ GtkComboBox* _tmp201_;
+ GtkTreeIter _tmp202_;
+ _tmp201_ = self->priv->device_combo;
+ _tmp202_ = iter;
+ gtk_combo_box_set_active_iter (_tmp201_, &_tmp202_);
}
}
- _tmp95_ = g_settings_get_string (self->priv->settings, "document-type");
- document_type = _tmp95_;
- if (document_type != NULL) {
- simple_scan_set_document_hint (self, document_type);
+ _tmp203_ = self->priv->settings;
+ _tmp204_ = g_settings_get_string (_tmp203_, "document-type");
+ document_type = _tmp204_;
+ _tmp205_ = document_type;
+ if (_tmp205_ != NULL) {
+ const gchar* _tmp206_;
+ _tmp206_ = document_type;
+ simple_scan_set_document_hint (self, _tmp206_);
}
- _tmp96_ = book_view_new (self->priv->book);
+ _tmp207_ = self->priv->book;
+ _tmp208_ = book_view_new (_tmp207_);
+ _tmp209_ = g_object_ref_sink (_tmp208_);
_g_object_unref0 (self->priv->book_view);
- self->priv->book_view = g_object_ref_sink (_tmp96_);
- gtk_container_set_border_width ((GtkContainer*) self->priv->book_view, (guint) 18);
- gtk_box_pack_end ((GtkBox*) self->priv->main_vbox, (GtkWidget*) self->priv->book_view, TRUE, TRUE, (guint) 0);
- g_signal_connect (self->priv->book_view, "page-selected", (GCallback) _simple_scan_page_selected_cb_book_view_page_selected, self);
- g_signal_connect (self->priv->book_view, "show-page", (GCallback) _simple_scan_show_page_cb_book_view_show_page, self);
- g_signal_connect (self->priv->book_view, "show-menu", (GCallback) _simple_scan_show_page_menu_cb_book_view_show_menu, self);
- gtk_widget_show ((GtkWidget*) self->priv->book_view);
- _tmp97_ = g_settings_get_enum (self->priv->settings, "scan-direction");
- self->priv->default_page_scan_direction = (ScanDirection) _tmp97_;
- _tmp98_ = g_settings_get_int (self->priv->settings, "page-width");
- self->priv->default_page_width = _tmp98_;
- if (self->priv->default_page_width <= 0) {
+ self->priv->book_view = _tmp209_;
+ _tmp210_ = self->priv->book_view;
+ gtk_container_set_border_width ((GtkContainer*) _tmp210_, (guint) 18);
+ _tmp211_ = self->priv->main_vbox;
+ _tmp212_ = self->priv->book_view;
+ gtk_box_pack_end ((GtkBox*) _tmp211_, (GtkWidget*) _tmp212_, TRUE, TRUE, (guint) 0);
+ _tmp213_ = self->priv->book_view;
+ g_signal_connect (_tmp213_, "page-selected", (GCallback) _simple_scan_page_selected_cb_book_view_page_selected, self);
+ _tmp214_ = self->priv->book_view;
+ g_signal_connect (_tmp214_, "show-page", (GCallback) _simple_scan_show_page_cb_book_view_show_page, self);
+ _tmp215_ = self->priv->book_view;
+ g_signal_connect (_tmp215_, "show-menu", (GCallback) _simple_scan_show_page_menu_cb_book_view_show_menu, self);
+ _tmp216_ = self->priv->book_view;
+ gtk_widget_show ((GtkWidget*) _tmp216_);
+ _tmp217_ = self->priv->settings;
+ _tmp218_ = g_settings_get_enum (_tmp217_, "scan-direction");
+ self->priv->default_page_scan_direction = (ScanDirection) _tmp218_;
+ _tmp219_ = self->priv->settings;
+ _tmp220_ = g_settings_get_int (_tmp219_, "page-width");
+ self->priv->default_page_width = _tmp220_;
+ _tmp221_ = self->priv->default_page_width;
+ if (_tmp221_ <= 0) {
self->priv->default_page_width = 595;
}
- _tmp99_ = g_settings_get_int (self->priv->settings, "page-height");
- self->priv->default_page_height = _tmp99_;
- if (self->priv->default_page_height <= 0) {
+ _tmp222_ = self->priv->settings;
+ _tmp223_ = g_settings_get_int (_tmp222_, "page-height");
+ self->priv->default_page_height = _tmp223_;
+ _tmp224_ = self->priv->default_page_height;
+ if (_tmp224_ <= 0) {
self->priv->default_page_height = 842;
}
- _tmp100_ = g_settings_get_int (self->priv->settings, "page-dpi");
- self->priv->default_page_dpi = _tmp100_;
- if (self->priv->default_page_dpi <= 0) {
+ _tmp225_ = self->priv->settings;
+ _tmp226_ = g_settings_get_int (_tmp225_, "page-dpi");
+ self->priv->default_page_dpi = _tmp226_;
+ _tmp227_ = self->priv->default_page_dpi;
+ if (_tmp227_ <= 0) {
self->priv->default_page_dpi = 72;
}
- _tmp101_ = g_settings_get_int (self->priv->settings, "window-width");
- self->priv->window_width = _tmp101_;
- if (self->priv->window_width <= 0) {
+ _tmp228_ = self->priv->settings;
+ _tmp229_ = g_settings_get_int (_tmp228_, "window-width");
+ self->priv->window_width = _tmp229_;
+ _tmp230_ = self->priv->window_width;
+ if (_tmp230_ <= 0) {
self->priv->window_width = 600;
}
- _tmp102_ = g_settings_get_int (self->priv->settings, "window-height");
- self->priv->window_height = _tmp102_;
- if (self->priv->window_height <= 0) {
+ _tmp231_ = self->priv->settings;
+ _tmp232_ = g_settings_get_int (_tmp231_, "window-height");
+ self->priv->window_height = _tmp232_;
+ _tmp233_ = self->priv->window_height;
+ if (_tmp233_ <= 0) {
self->priv->window_height = 400;
}
- g_debug ("ui.vala:1407: Restoring window to %dx%d pixels", self->priv->window_width, self->priv->window_height);
- gtk_window_set_default_size (self->priv->window, self->priv->window_width, self->priv->window_height);
- _tmp103_ = g_settings_get_boolean (self->priv->settings, "window-is-maximized");
- self->priv->window_is_maximized = _tmp103_;
- if (self->priv->window_is_maximized) {
+ _tmp234_ = self->priv->window_width;
+ _tmp235_ = self->priv->window_height;
+ g_debug ("ui.vala:1407: Restoring window to %dx%d pixels", _tmp234_, _tmp235_);
+ _tmp236_ = self->priv->window;
+ _tmp237_ = self->priv->window_width;
+ _tmp238_ = self->priv->window_height;
+ gtk_window_set_default_size (_tmp236_, _tmp237_, _tmp238_);
+ _tmp239_ = self->priv->settings;
+ _tmp240_ = g_settings_get_boolean (_tmp239_, "window-is-maximized");
+ self->priv->window_is_maximized = _tmp240_;
+ _tmp241_ = self->priv->window_is_maximized;
+ if (_tmp241_) {
+ GtkWindow* _tmp242_;
g_debug ("ui.vala:1412: Restoring window to maximized");
- gtk_window_maximize (self->priv->window);
+ _tmp242_ = self->priv->window;
+ gtk_window_maximize (_tmp242_);
}
- _tmp104_ = book_get_n_pages (self->priv->book);
- if (_tmp104_ == ((guint) 0)) {
+ _tmp243_ = self->priv->book;
+ _tmp244_ = book_get_n_pages (_tmp243_);
+ if (_tmp244_ == ((guint) 0)) {
simple_scan_add_default_page (self);
}
- book_set_needs_saving (self->priv->book, FALSE);
- g_signal_connect (self->priv->book, "needs-saving-changed", (GCallback) _simple_scan_needs_saving_cb_book_needs_saving_changed, self);
+ _tmp245_ = self->priv->book;
+ book_set_needs_saving (_tmp245_, FALSE);
+ _tmp246_ = self->priv->book;
+ g_signal_connect (_tmp246_, "needs-saving-changed", (GCallback) _simple_scan_needs_saving_cb_book_needs_saving_changed, self);
_g_free0 (document_type);
_g_free0 (device);
_g_object_unref0 (renderer);
@@ -3136,60 +4460,90 @@ static gpointer _book_ref0 (gpointer self) {
Book* simple_scan_get_book (SimpleScan* self) {
Book* result = NULL;
Book* _tmp0_;
+ Book* _tmp1_;
g_return_val_if_fail (self != NULL, NULL);
- _tmp0_ = _book_ref0 (self->priv->book);
- result = _tmp0_;
+ _tmp0_ = self->priv->book;
+ _tmp1_ = _book_ref0 (_tmp0_);
+ result = _tmp1_;
return result;
}
void simple_scan_set_selected_page (SimpleScan* self, Page* page) {
+ BookView* _tmp0_;
+ Page* _tmp1_;
g_return_if_fail (self != NULL);
g_return_if_fail (page != NULL);
- book_view_select_page (self->priv->book_view, page);
+ _tmp0_ = self->priv->book_view;
+ _tmp1_ = page;
+ book_view_select_page (_tmp0_, _tmp1_);
}
Page* simple_scan_get_selected_page (SimpleScan* self) {
Page* result = NULL;
- Page* _tmp0_ = NULL;
+ BookView* _tmp0_;
+ Page* _tmp1_ = NULL;
g_return_val_if_fail (self != NULL, NULL);
- _tmp0_ = book_view_get_selected (self->priv->book_view);
- result = _tmp0_;
+ _tmp0_ = self->priv->book_view;
+ _tmp1_ = book_view_get_selected (_tmp0_);
+ result = _tmp1_;
return result;
}
void simple_scan_set_scanning (SimpleScan* self, gboolean scanning) {
+ gboolean _tmp0_;
+ GtkMenuItem* _tmp1_;
+ gboolean _tmp2_;
+ GtkMenuItem* _tmp3_;
+ gboolean _tmp4_;
+ GtkToolButton* _tmp5_;
+ gboolean _tmp6_;
g_return_if_fail (self != NULL);
- self->priv->scanning = scanning;
- gtk_widget_set_sensitive ((GtkWidget*) self->priv->page_delete_menuitem, !scanning);
- gtk_widget_set_sensitive ((GtkWidget*) self->priv->stop_menuitem, scanning);
- gtk_widget_set_sensitive ((GtkWidget*) self->priv->stop_toolbutton, scanning);
+ _tmp0_ = scanning;
+ self->priv->scanning = _tmp0_;
+ _tmp1_ = self->priv->page_delete_menuitem;
+ _tmp2_ = scanning;
+ gtk_widget_set_sensitive ((GtkWidget*) _tmp1_, !_tmp2_);
+ _tmp3_ = self->priv->stop_menuitem;
+ _tmp4_ = scanning;
+ gtk_widget_set_sensitive ((GtkWidget*) _tmp3_, _tmp4_);
+ _tmp5_ = self->priv->stop_toolbutton;
+ _tmp6_ = scanning;
+ gtk_widget_set_sensitive ((GtkWidget*) _tmp5_, _tmp6_);
}
void simple_scan_show_error (SimpleScan* self, const gchar* error_title, const gchar* error_text, gboolean change_scanner_hint) {
- gchar* _tmp0_;
+ const gchar* _tmp0_;
gchar* _tmp1_;
+ const gchar* _tmp2_;
+ gchar* _tmp3_;
+ gboolean _tmp4_;
g_return_if_fail (self != NULL);
g_return_if_fail (error_title != NULL);
g_return_if_fail (error_text != NULL);
self->priv->have_error = TRUE;
- _tmp0_ = g_strdup (error_title);
+ _tmp0_ = error_title;
+ _tmp1_ = g_strdup (_tmp0_);
_g_free0 (self->priv->error_title);
- self->priv->error_title = _tmp0_;
- _tmp1_ = g_strdup (error_text);
+ self->priv->error_title = _tmp1_;
+ _tmp2_ = error_text;
+ _tmp3_ = g_strdup (_tmp2_);
_g_free0 (self->priv->error_text);
- self->priv->error_text = _tmp1_;
- self->priv->error_change_scanner_hint = change_scanner_hint;
+ self->priv->error_text = _tmp3_;
+ _tmp4_ = change_scanner_hint;
+ self->priv->error_change_scanner_hint = _tmp4_;
simple_scan_update_info_bar (self);
}
void simple_scan_start (SimpleScan* self) {
+ GtkWindow* _tmp0_;
g_return_if_fail (self != NULL);
- gtk_widget_show ((GtkWidget*) self->priv->window);
+ _tmp0_ = self->priv->window;
+ gtk_widget_show ((GtkWidget*) _tmp0_);
}