summaryrefslogtreecommitdiff
path: root/src/simple-scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/simple-scan.c')
-rw-r--r--src/simple-scan.c1530
1 files changed, 1067 insertions, 463 deletions
diff --git a/src/simple-scan.c b/src/simple-scan.c
index 85943bf..21dc633 100644
--- a/src/simple-scan.c
+++ b/src/simple-scan.c
@@ -1,4 +1,4 @@
-/* simple-scan.c generated by valac 0.13.1, the Vala compiler
+/* simple-scan.c generated by valac 0.13.4, the Vala compiler
* generated from simple-scan.vala, do not modify */
/*
@@ -503,60 +503,110 @@ static void _g_list_free__scan_device_unref0_ (GList* self) {
Application* application_construct (GType object_type, ScanDevice* device) {
Application* self = NULL;
ScanDevice* _tmp0_;
- SimpleScan* _tmp1_ = NULL;
- Book* _tmp2_ = NULL;
- Scanner* _tmp3_ = NULL;
- gchar* _tmp4_;
- gchar** _tmp5_ = NULL;
+ ScanDevice* _tmp1_;
+ SimpleScan* _tmp2_;
+ SimpleScan* _tmp3_;
+ Book* _tmp4_ = NULL;
+ SimpleScan* _tmp5_;
+ SimpleScan* _tmp6_;
+ SimpleScan* _tmp7_;
+ SimpleScan* _tmp8_;
+ Scanner* _tmp9_ = NULL;
+ Scanner* _tmp10_;
+ Scanner* _tmp11_;
+ Scanner* _tmp12_;
+ Scanner* _tmp13_;
+ Scanner* _tmp14_;
+ Scanner* _tmp15_;
+ Scanner* _tmp16_;
+ Scanner* _tmp17_;
+ Scanner* _tmp18_;
+ gchar* _tmp19_;
+ gchar** _tmp20_ = NULL;
gchar** subsystems;
gint subsystems_length1;
gint _subsystems_size_;
- GUdevClient* _tmp6_ = NULL;
+ gchar** _tmp21_;
+ gint _tmp21__length1;
+ GUdevClient* _tmp22_;
+ GUdevClient* _tmp23_;
+ ScanDevice* _tmp24_;
self = (Application*) g_type_create_instance (object_type);
- _tmp0_ = _scan_device_ref0 (device);
+ _tmp0_ = device;
+ _tmp1_ = _scan_device_ref0 (_tmp0_);
_scan_device_unref0 (self->priv->default_device);
- self->priv->default_device = _tmp0_;
- _tmp1_ = simple_scan_new ();
+ self->priv->default_device = _tmp1_;
+ _tmp2_ = simple_scan_new ();
_simple_scan_unref0 (self->priv->ui);
- self->priv->ui = _tmp1_;
- _tmp2_ = simple_scan_get_book (self->priv->ui);
+ self->priv->ui = _tmp2_;
+ _tmp3_ = self->priv->ui;
+ _tmp4_ = simple_scan_get_book (_tmp3_);
_book_unref0 (self->priv->book);
- self->priv->book = _tmp2_;
- g_signal_connect (self->priv->ui, "start-scan", (GCallback) _application_scan_cb_simple_scan_start_scan, self);
- g_signal_connect (self->priv->ui, "stop-scan", (GCallback) _application_cancel_cb_simple_scan_stop_scan, self);
- g_signal_connect (self->priv->ui, "email", (GCallback) _application_email_cb_simple_scan_email, self);
- g_signal_connect (self->priv->ui, "quit", (GCallback) _application_quit_cb_simple_scan_quit, self);
- _tmp3_ = scanner_get_instance ();
+ self->priv->book = _tmp4_;
+ _tmp5_ = self->priv->ui;
+ g_signal_connect (_tmp5_, "start-scan", (GCallback) _application_scan_cb_simple_scan_start_scan, self);
+ _tmp6_ = self->priv->ui;
+ g_signal_connect (_tmp6_, "stop-scan", (GCallback) _application_cancel_cb_simple_scan_stop_scan, self);
+ _tmp7_ = self->priv->ui;
+ g_signal_connect (_tmp7_, "email", (GCallback) _application_email_cb_simple_scan_email, self);
+ _tmp8_ = self->priv->ui;
+ g_signal_connect (_tmp8_, "quit", (GCallback) _application_quit_cb_simple_scan_quit, self);
+ _tmp9_ = scanner_get_instance ();
_scanner_unref0 (self->priv->scanner);
- self->priv->scanner = _tmp3_;
- g_signal_connect (self->priv->scanner, "update-devices", (GCallback) _application_update_scan_devices_cb_scanner_update_devices, self);
- g_signal_connect (self->priv->scanner, "request-authorization", (GCallback) _application_authorize_cb_scanner_request_authorization, self);
- g_signal_connect (self->priv->scanner, "expect-page", (GCallback) _application_scanner_new_page_cb_scanner_expect_page, self);
- g_signal_connect (self->priv->scanner, "got-page-info", (GCallback) _application_scanner_page_info_cb_scanner_got_page_info, self);
- g_signal_connect (self->priv->scanner, "got-line", (GCallback) _application_scanner_line_cb_scanner_got_line, self);
- g_signal_connect (self->priv->scanner, "page-done", (GCallback) _application_scanner_page_done_cb_scanner_page_done, self);
- g_signal_connect (self->priv->scanner, "document-done", (GCallback) _application_scanner_document_done_cb_scanner_document_done, self);
- g_signal_connect (self->priv->scanner, "scan-failed", (GCallback) _application_scanner_failed_cb_scanner_scan_failed, self);
- g_signal_connect (self->priv->scanner, "scanning-changed", (GCallback) _application_scanner_scanning_changed_cb_scanner_scanning_changed, self);
- _tmp4_ = g_strdup ("usb");
- _tmp5_ = g_new0 (gchar*, 2 + 1);
- _tmp5_[0] = _tmp4_;
- _tmp5_[1] = NULL;
- subsystems = _tmp5_;
+ self->priv->scanner = _tmp9_;
+ _tmp10_ = self->priv->scanner;
+ g_signal_connect (_tmp10_, "update-devices", (GCallback) _application_update_scan_devices_cb_scanner_update_devices, self);
+ _tmp11_ = self->priv->scanner;
+ g_signal_connect (_tmp11_, "request-authorization", (GCallback) _application_authorize_cb_scanner_request_authorization, self);
+ _tmp12_ = self->priv->scanner;
+ g_signal_connect (_tmp12_, "expect-page", (GCallback) _application_scanner_new_page_cb_scanner_expect_page, self);
+ _tmp13_ = self->priv->scanner;
+ g_signal_connect (_tmp13_, "got-page-info", (GCallback) _application_scanner_page_info_cb_scanner_got_page_info, self);
+ _tmp14_ = self->priv->scanner;
+ g_signal_connect (_tmp14_, "got-line", (GCallback) _application_scanner_line_cb_scanner_got_line, self);
+ _tmp15_ = self->priv->scanner;
+ g_signal_connect (_tmp15_, "page-done", (GCallback) _application_scanner_page_done_cb_scanner_page_done, self);
+ _tmp16_ = self->priv->scanner;
+ g_signal_connect (_tmp16_, "document-done", (GCallback) _application_scanner_document_done_cb_scanner_document_done, self);
+ _tmp17_ = self->priv->scanner;
+ g_signal_connect (_tmp17_, "scan-failed", (GCallback) _application_scanner_failed_cb_scanner_scan_failed, self);
+ _tmp18_ = self->priv->scanner;
+ g_signal_connect (_tmp18_, "scanning-changed", (GCallback) _application_scanner_scanning_changed_cb_scanner_scanning_changed, self);
+ _tmp19_ = g_strdup ("usb");
+ _tmp20_ = g_new0 (gchar*, 2 + 1);
+ _tmp20_[0] = _tmp19_;
+ _tmp20_[1] = NULL;
+ subsystems = _tmp20_;
subsystems_length1 = 2;
_subsystems_size_ = subsystems_length1;
- _tmp6_ = g_udev_client_new (subsystems);
+ _tmp21_ = subsystems;
+ _tmp21__length1 = subsystems_length1;
+ _tmp22_ = g_udev_client_new (_tmp21_);
_g_object_unref0 (self->priv->udev_client);
- self->priv->udev_client = _tmp6_;
- g_signal_connect (self->priv->udev_client, "uevent", (GCallback) _application_on_uevent_g_udev_client_uevent, self);
- if (self->priv->default_device != NULL) {
+ self->priv->udev_client = _tmp22_;
+ _tmp23_ = self->priv->udev_client;
+ g_signal_connect (_tmp23_, "uevent", (GCallback) _application_on_uevent_g_udev_client_uevent, self);
+ _tmp24_ = self->priv->default_device;
+ if (_tmp24_ != NULL) {
GList* device_list;
- ScanDevice* _tmp7_;
+ ScanDevice* _tmp25_;
+ ScanDevice* _tmp26_;
+ SimpleScan* _tmp27_;
+ GList* _tmp28_;
+ SimpleScan* _tmp29_;
+ ScanDevice* _tmp30_;
+ const gchar* _tmp31_;
device_list = NULL;
- _tmp7_ = _scan_device_ref0 (self->priv->default_device);
- device_list = g_list_append (device_list, _tmp7_);
- simple_scan_set_scan_devices (self->priv->ui, device_list);
- simple_scan_set_selected_device (self->priv->ui, self->priv->default_device->name);
+ _tmp25_ = self->priv->default_device;
+ _tmp26_ = _scan_device_ref0 (_tmp25_);
+ device_list = g_list_append (device_list, _tmp26_);
+ _tmp27_ = self->priv->ui;
+ _tmp28_ = device_list;
+ simple_scan_set_scan_devices (_tmp27_, _tmp28_);
+ _tmp29_ = self->priv->ui;
+ _tmp30_ = self->priv->default_device;
+ _tmp31_ = _tmp30_->name;
+ simple_scan_set_selected_device (_tmp29_, _tmp31_);
__g_list_free__scan_device_unref0_0 (device_list);
}
subsystems = (_vala_array_free (subsystems, subsystems_length1, (GDestroyNotify) g_free), NULL);
@@ -570,45 +620,73 @@ Application* application_new (ScanDevice* device) {
void application_start (Application* self) {
+ SimpleScan* _tmp0_;
+ Scanner* _tmp1_;
g_return_if_fail (self != NULL);
- simple_scan_start (self->priv->ui);
- scanner_start (self->priv->scanner);
+ _tmp0_ = self->priv->ui;
+ simple_scan_start (_tmp0_);
+ _tmp1_ = self->priv->scanner;
+ scanner_start (_tmp1_);
}
static void application_update_scan_devices_cb (Application* self, Scanner* scanner, GList* devices) {
- GList* _tmp0_ = NULL;
+ GList* _tmp0_;
+ GList* _tmp1_ = NULL;
GList* devices_copy;
- guint _tmp1_;
+ ScanDevice* _tmp2_;
+ GList* _tmp10_;
+ guint _tmp11_ = 0U;
+ SimpleScan* _tmp12_;
+ GList* _tmp13_;
g_return_if_fail (self != NULL);
g_return_if_fail (scanner != NULL);
- _tmp0_ = g_list_copy (devices);
- devices_copy = _tmp0_;
- if (self->priv->default_device != NULL) {
+ _tmp0_ = devices;
+ _tmp1_ = g_list_copy (_tmp0_);
+ devices_copy = _tmp1_;
+ _tmp2_ = self->priv->default_device;
+ if (_tmp2_ != NULL) {
gboolean default_in_list;
+ GList* _tmp3_;
+ gboolean _tmp8_;
default_in_list = FALSE;
+ _tmp3_ = devices_copy;
{
GList* device_collection = NULL;
GList* device_it = NULL;
- device_collection = devices_copy;
+ device_collection = _tmp3_;
for (device_it = device_collection; device_it != NULL; device_it = device_it->next) {
ScanDevice* device = NULL;
device = (ScanDevice*) device_it->data;
{
- if (g_strcmp0 (device->name, self->priv->default_device->name) == 0) {
+ ScanDevice* _tmp4_;
+ const gchar* _tmp5_;
+ ScanDevice* _tmp6_;
+ const gchar* _tmp7_;
+ _tmp4_ = device;
+ _tmp5_ = _tmp4_->name;
+ _tmp6_ = self->priv->default_device;
+ _tmp7_ = _tmp6_->name;
+ if (g_strcmp0 (_tmp5_, _tmp7_) == 0) {
default_in_list = TRUE;
break;
}
}
}
}
- if (!default_in_list) {
- devices_copy = g_list_prepend (devices_copy, self->priv->default_device);
+ _tmp8_ = default_in_list;
+ if (!_tmp8_) {
+ ScanDevice* _tmp9_;
+ _tmp9_ = self->priv->default_device;
+ devices_copy = g_list_prepend (devices_copy, _tmp9_);
}
}
- _tmp1_ = g_list_length (devices_copy);
- self->priv->have_devices = _tmp1_ > ((guint) 0);
- simple_scan_set_scan_devices (self->priv->ui, devices_copy);
+ _tmp10_ = devices_copy;
+ _tmp11_ = g_list_length (_tmp10_);
+ self->priv->have_devices = _tmp11_ > ((guint) 0);
+ _tmp12_ = self->priv->ui;
+ _tmp13_ = devices_copy;
+ simple_scan_set_scan_devices (_tmp12_, _tmp13_);
_g_list_free0 (devices_copy);
}
@@ -616,17 +694,23 @@ static void application_update_scan_devices_cb (Application* self, Scanner* scan
static void application_authorize_cb (Application* self, Scanner* scanner, const gchar* resource) {
gchar* username = NULL;
gchar* password = NULL;
- gchar* _tmp0_ = NULL;
- gchar* _tmp1_ = NULL;
+ SimpleScan* _tmp0_;
+ const gchar* _tmp1_;
+ gchar* _tmp2_ = NULL;
+ gchar* _tmp3_ = NULL;
+ Scanner* _tmp4_;
g_return_if_fail (self != NULL);
g_return_if_fail (scanner != NULL);
g_return_if_fail (resource != NULL);
- simple_scan_authorize (self->priv->ui, resource, &_tmp0_, &_tmp1_);
+ _tmp0_ = self->priv->ui;
+ _tmp1_ = resource;
+ simple_scan_authorize (_tmp0_, _tmp1_, &_tmp2_, &_tmp3_);
_g_free0 (username);
- username = _tmp0_;
+ username = _tmp2_;
_g_free0 (password);
- password = _tmp1_;
- scanner_authorize (scanner, username, password);
+ password = _tmp3_;
+ _tmp4_ = scanner;
+ scanner_authorize (_tmp4_, username, password);
_g_free0 (password);
_g_free0 (username);
}
@@ -634,9 +718,12 @@ static void application_authorize_cb (Application* self, Scanner* scanner, const
static Page* application_append_page (Application* self) {
Page* result = NULL;
- Page* _tmp0_ = NULL;
+ Book* _tmp0_;
+ Page* _tmp1_ = NULL;
Page* page;
- gboolean _tmp1_ = FALSE;
+ gboolean _tmp2_ = FALSE;
+ Page* _tmp3_;
+ gboolean _tmp6_;
ScanDirection scan_direction;
gboolean do_crop;
gchar* named_crop;
@@ -647,20 +734,41 @@ static Page* application_append_page (Application* self) {
gint cy;
gint cw;
gint ch;
- Page* _tmp13_ = NULL;
+ Page* _tmp10_;
+ Book* _tmp29_;
+ gint _tmp30_;
+ gint _tmp31_;
+ gint _tmp32_;
+ ScanDirection _tmp33_;
+ Page* _tmp34_ = NULL;
+ gboolean _tmp35_;
+ SimpleScan* _tmp45_;
+ Page* _tmp46_;
+ Page* _tmp47_;
g_return_val_if_fail (self != NULL, NULL);
- _tmp0_ = book_get_page (self->priv->book, -1);
- page = _tmp0_;
- if (page != NULL) {
- gboolean _tmp2_;
- _tmp2_ = page_has_data (page);
- _tmp1_ = !_tmp2_;
+ _tmp0_ = self->priv->book;
+ _tmp1_ = book_get_page (_tmp0_, -1);
+ page = _tmp1_;
+ _tmp3_ = page;
+ if (_tmp3_ != NULL) {
+ Page* _tmp4_;
+ gboolean _tmp5_ = FALSE;
+ _tmp4_ = page;
+ _tmp5_ = page_has_data (_tmp4_);
+ _tmp2_ = !_tmp5_;
} else {
- _tmp1_ = FALSE;
+ _tmp2_ = FALSE;
}
- if (_tmp1_) {
- simple_scan_set_selected_page (self->priv->ui, page);
- page_start (page);
+ _tmp6_ = _tmp2_;
+ if (_tmp6_) {
+ SimpleScan* _tmp7_;
+ Page* _tmp8_;
+ Page* _tmp9_;
+ _tmp7_ = self->priv->ui;
+ _tmp8_ = page;
+ simple_scan_set_selected_page (_tmp7_, _tmp8_);
+ _tmp9_ = page;
+ page_start (_tmp9_);
result = page;
return result;
}
@@ -674,51 +782,95 @@ static Page* application_append_page (Application* self) {
cy = 0;
cw = 0;
ch = 0;
- if (page != NULL) {
- ScanDirection _tmp3_;
- gint _tmp4_;
- gint _tmp5_;
- gint _tmp6_;
- gboolean _tmp7_;
- _tmp3_ = page_get_scan_direction (page);
- scan_direction = _tmp3_;
- _tmp4_ = page_get_width (page);
- width = _tmp4_;
- _tmp5_ = page_get_height (page);
- height = _tmp5_;
- _tmp6_ = page_get_dpi (page);
- dpi = _tmp6_;
- _tmp7_ = page_has_crop (page);
- do_crop = _tmp7_;
- if (do_crop) {
- gchar* _tmp8_ = NULL;
- gint _tmp9_;
- gint _tmp10_;
- gint _tmp11_;
- gint _tmp12_;
- _tmp8_ = page_get_named_crop (page);
+ _tmp10_ = page;
+ if (_tmp10_ != NULL) {
+ Page* _tmp11_;
+ ScanDirection _tmp12_ = 0;
+ Page* _tmp13_;
+ gint _tmp14_ = 0;
+ Page* _tmp15_;
+ gint _tmp16_ = 0;
+ Page* _tmp17_;
+ gint _tmp18_ = 0;
+ Page* _tmp19_;
+ gboolean _tmp20_ = FALSE;
+ gboolean _tmp21_;
+ _tmp11_ = page;
+ _tmp12_ = page_get_scan_direction (_tmp11_);
+ scan_direction = _tmp12_;
+ _tmp13_ = page;
+ _tmp14_ = page_get_width (_tmp13_);
+ width = _tmp14_;
+ _tmp15_ = page;
+ _tmp16_ = page_get_height (_tmp15_);
+ height = _tmp16_;
+ _tmp17_ = page;
+ _tmp18_ = page_get_dpi (_tmp17_);
+ dpi = _tmp18_;
+ _tmp19_ = page;
+ _tmp20_ = page_has_crop (_tmp19_);
+ do_crop = _tmp20_;
+ _tmp21_ = do_crop;
+ if (_tmp21_) {
+ Page* _tmp22_;
+ gchar* _tmp23_ = NULL;
+ Page* _tmp24_;
+ gint _tmp25_ = 0;
+ gint _tmp26_ = 0;
+ gint _tmp27_ = 0;
+ gint _tmp28_ = 0;
+ _tmp22_ = page;
+ _tmp23_ = page_get_named_crop (_tmp22_);
_g_free0 (named_crop);
- named_crop = _tmp8_;
- page_get_crop (page, &_tmp9_, &_tmp10_, &_tmp11_, &_tmp12_);
- cx = _tmp9_;
- cy = _tmp10_;
- cw = _tmp11_;
- ch = _tmp12_;
+ named_crop = _tmp23_;
+ _tmp24_ = page;
+ page_get_crop (_tmp24_, &_tmp25_, &_tmp26_, &_tmp27_, &_tmp28_);
+ cx = _tmp25_;
+ cy = _tmp26_;
+ cw = _tmp27_;
+ ch = _tmp28_;
}
}
- _tmp13_ = book_append_page (self->priv->book, width, height, dpi, scan_direction);
+ _tmp29_ = self->priv->book;
+ _tmp30_ = width;
+ _tmp31_ = height;
+ _tmp32_ = dpi;
+ _tmp33_ = scan_direction;
+ _tmp34_ = book_append_page (_tmp29_, _tmp30_, _tmp31_, _tmp32_, _tmp33_);
_page_unref0 (page);
- page = _tmp13_;
- if (do_crop) {
- if (named_crop != NULL) {
- page_set_named_crop (page, named_crop);
+ page = _tmp34_;
+ _tmp35_ = do_crop;
+ if (_tmp35_) {
+ const gchar* _tmp36_;
+ Page* _tmp42_;
+ gint _tmp43_;
+ gint _tmp44_;
+ _tmp36_ = named_crop;
+ if (_tmp36_ != NULL) {
+ Page* _tmp37_;
+ const gchar* _tmp38_;
+ _tmp37_ = page;
+ _tmp38_ = named_crop;
+ page_set_named_crop (_tmp37_, _tmp38_);
} else {
- page_set_custom_crop (page, cw, ch);
+ Page* _tmp39_;
+ gint _tmp40_;
+ gint _tmp41_;
+ _tmp39_ = page;
+ _tmp40_ = cw;
+ _tmp41_ = ch;
+ page_set_custom_crop (_tmp39_, _tmp40_, _tmp41_);
}
- page_move_crop (page, cx, cy);
+ _tmp42_ = page;
+ _tmp43_ = cx;
+ _tmp44_ = cy;
+ page_move_crop (_tmp42_, _tmp43_, _tmp44_);
}
- simple_scan_set_selected_page (self->priv->ui, page);
- page_start (page);
+ _tmp45_ = self->priv->ui;
+ _tmp46_ = page;
+ simple_scan_set_selected_page (_tmp45_, _tmp46_);
+ _tmp47_ = page;
+ page_start (_tmp47_);
result = page;
_g_free0 (named_crop);
return result;
@@ -746,69 +898,109 @@ static gchar* application_get_profile_for_device (Application* self, const gchar
static void application_scanner_page_info_cb (Application* self, Scanner* scanner, ScanPageInfo* info) {
- Page* _tmp0_ = NULL;
+ ScanPageInfo* _tmp0_;
+ gint _tmp1_;
+ ScanPageInfo* _tmp2_;
+ gint _tmp3_;
+ ScanPageInfo* _tmp4_;
+ gint _tmp5_;
+ Page* _tmp6_ = NULL;
Page* page;
- gchar* _tmp1_ = NULL;
- gchar* _tmp2_;
+ ScanPageInfo* _tmp7_;
+ ScanPageInfo* _tmp8_;
+ const gchar* _tmp9_;
+ gchar* _tmp10_ = NULL;
+ gchar* _tmp11_;
g_return_if_fail (self != NULL);
g_return_if_fail (scanner != NULL);
g_return_if_fail (info != NULL);
+ _tmp0_ = info;
+ _tmp1_ = _tmp0_->width;
+ _tmp2_ = info;
+ _tmp3_ = _tmp2_->height;
+ _tmp4_ = info;
+ _tmp5_ = _tmp4_->depth;
g_debug ("simple-scan.vala:236: Page is %d pixels wide, %d pixels high, %d bits " \
-"per pixel", info->width, info->height, info->depth);
- _tmp0_ = application_append_page (self);
- page = _tmp0_;
- page_set_page_info (page, info);
- _tmp1_ = application_get_profile_for_device (self, info->device);
- _tmp2_ = _tmp1_;
- page_set_color_profile (page, _tmp2_);
- _g_free0 (_tmp2_);
+"per pixel", _tmp1_, _tmp3_, _tmp5_);
+ _tmp6_ = application_append_page (self);
+ page = _tmp6_;
+ _tmp7_ = info;
+ page_set_page_info (page, _tmp7_);
+ _tmp8_ = info;
+ _tmp9_ = _tmp8_->device;
+ _tmp10_ = application_get_profile_for_device (self, _tmp9_);
+ _tmp11_ = _tmp10_;
+ page_set_color_profile (page, _tmp11_);
+ _g_free0 (_tmp11_);
_page_unref0 (page);
}
static void application_scanner_line_cb (Application* self, Scanner* scanner, ScanLine* line) {
- guint _tmp0_;
- Page* _tmp1_ = NULL;
+ Book* _tmp0_;
+ Book* _tmp1_;
+ guint _tmp2_ = 0U;
+ Page* _tmp3_ = NULL;
Page* page;
+ ScanLine* _tmp4_;
g_return_if_fail (self != NULL);
g_return_if_fail (scanner != NULL);
g_return_if_fail (line != NULL);
- _tmp0_ = book_get_n_pages (self->priv->book);
- _tmp1_ = book_get_page (self->priv->book, ((gint) _tmp0_) - 1);
- page = _tmp1_;
- page_parse_scan_line (page, line);
+ _tmp0_ = self->priv->book;
+ _tmp1_ = self->priv->book;
+ _tmp2_ = book_get_n_pages (_tmp1_);
+ _tmp3_ = book_get_page (_tmp0_, ((gint) _tmp2_) - 1);
+ page = _tmp3_;
+ _tmp4_ = line;
+ page_parse_scan_line (page, _tmp4_);
_page_unref0 (page);
}
static void application_scanner_page_done_cb (Application* self, Scanner* scanner) {
- guint _tmp0_;
- Page* _tmp1_ = NULL;
+ Book* _tmp0_;
+ Book* _tmp1_;
+ guint _tmp2_ = 0U;
+ Page* _tmp3_ = NULL;
Page* page;
g_return_if_fail (self != NULL);
g_return_if_fail (scanner != NULL);
- _tmp0_ = book_get_n_pages (self->priv->book);
- _tmp1_ = book_get_page (self->priv->book, ((gint) _tmp0_) - 1);
- page = _tmp1_;
+ _tmp0_ = self->priv->book;
+ _tmp1_ = self->priv->book;
+ _tmp2_ = book_get_n_pages (_tmp1_);
+ _tmp3_ = book_get_page (_tmp0_, ((gint) _tmp2_) - 1);
+ page = _tmp3_;
page_finish (page);
_page_unref0 (page);
}
static void application_remove_empty_page (Application* self) {
- guint _tmp0_;
- Page* _tmp1_ = NULL;
+ Book* _tmp0_;
+ Book* _tmp1_;
+ guint _tmp2_ = 0U;
+ Page* _tmp3_ = NULL;
Page* page;
- gboolean _tmp2_;
+ Page* _tmp4_;
+ gboolean _tmp5_ = FALSE;
g_return_if_fail (self != NULL);
- _tmp0_ = book_get_n_pages (self->priv->book);
- _tmp1_ = book_get_page (self->priv->book, ((gint) _tmp0_) - 1);
- page = _tmp1_;
- _tmp2_ = page_has_data (page);
- if (_tmp2_) {
- page_finish (page);
+ _tmp0_ = self->priv->book;
+ _tmp1_ = self->priv->book;
+ _tmp2_ = book_get_n_pages (_tmp1_);
+ _tmp3_ = book_get_page (_tmp0_, ((gint) _tmp2_) - 1);
+ page = _tmp3_;
+ _tmp4_ = page;
+ _tmp5_ = page_has_data (_tmp4_);
+ if (_tmp5_) {
+ Page* _tmp6_;
+ _tmp6_ = page;
+ page_finish (_tmp6_);
} else {
- book_delete_page (self->priv->book, page);
+ Book* _tmp7_;
+ Page* _tmp8_;
+ _tmp7_ = self->priv->book;
+ _tmp8_ = page;
+ book_delete_page (_tmp7_, _tmp8_);
}
_page_unref0 (page);
}
@@ -822,65 +1014,101 @@ static void application_scanner_document_done_cb (Application* self, Scanner* sc
static void application_scanner_failed_cb (Application* self, Scanner* scanner, gint error_code, const gchar* error_string) {
+ gint _tmp0_;
g_return_if_fail (self != NULL);
g_return_if_fail (scanner != NULL);
g_return_if_fail (error_string != NULL);
application_remove_empty_page (self);
- if (error_code != ((gint) SANE_STATUS_CANCELLED)) {
- const gchar* _tmp0_ = NULL;
- _tmp0_ = _ ("Failed to scan");
- simple_scan_show_error (self->priv->ui, _tmp0_, error_string, self->priv->have_devices);
+ _tmp0_ = error_code;
+ if (_tmp0_ != ((gint) SANE_STATUS_CANCELLED)) {
+ SimpleScan* _tmp1_;
+ const gchar* _tmp2_ = NULL;
+ const gchar* _tmp3_;
+ gboolean _tmp4_;
+ _tmp1_ = self->priv->ui;
+ _tmp2_ = _ ("Failed to scan");
+ _tmp3_ = error_string;
+ _tmp4_ = self->priv->have_devices;
+ simple_scan_show_error (_tmp1_, _tmp2_, _tmp3_, _tmp4_);
}
}
static void application_scanner_scanning_changed_cb (Application* self, Scanner* scanner) {
- gboolean _tmp0_;
+ SimpleScan* _tmp0_;
+ Scanner* _tmp1_;
+ gboolean _tmp2_ = FALSE;
g_return_if_fail (self != NULL);
g_return_if_fail (scanner != NULL);
- _tmp0_ = scanner_is_scanning (scanner);
- simple_scan_set_scanning (self->priv->ui, _tmp0_);
+ _tmp0_ = self->priv->ui;
+ _tmp1_ = scanner;
+ _tmp2_ = scanner_is_scanning (_tmp1_);
+ simple_scan_set_scanning (_tmp0_, _tmp2_);
}
static void application_scan_cb (Application* self, SimpleScan* ui, const gchar* device, ScanOptions* options) {
- gboolean _tmp0_;
- const gchar* _tmp3_ = NULL;
- gchar* _tmp4_;
+ ScanOptions* _tmp0_;
+ gint _tmp1_;
+ const gchar* _tmp2_;
+ Scanner* _tmp3_;
+ gboolean _tmp4_ = FALSE;
+ const gchar* _tmp7_ = NULL;
+ gchar* _tmp8_;
gchar* filename_prefix;
gchar* extension = NULL;
- gchar* _tmp7_ = NULL;
+ ScanOptions* _tmp9_;
+ ScanMode _tmp10_;
+ const gchar* _tmp13_;
+ const gchar* _tmp14_;
+ gchar* _tmp15_ = NULL;
gchar* filename;
+ SimpleScan* _tmp16_;
+ Scanner* _tmp17_;
+ const gchar* _tmp18_;
+ ScanOptions* _tmp19_;
g_return_if_fail (self != NULL);
g_return_if_fail (ui != NULL);
g_return_if_fail (options != NULL);
- g_debug ("simple-scan.vala:296: Requesting scan at %d dpi from device '%s'", options->dpi, device);
- _tmp0_ = scanner_is_scanning (self->priv->scanner);
- if (!_tmp0_) {
- Page* _tmp1_ = NULL;
- Page* _tmp2_;
- _tmp1_ = application_append_page (self);
- _tmp2_ = _tmp1_;
- _page_unref0 (_tmp2_);
+ _tmp0_ = options;
+ _tmp1_ = _tmp0_->dpi;
+ _tmp2_ = device;
+ g_debug ("simple-scan.vala:296: Requesting scan at %d dpi from device '%s'", _tmp1_, _tmp2_);
+ _tmp3_ = self->priv->scanner;
+ _tmp4_ = scanner_is_scanning (_tmp3_);
+ if (!_tmp4_) {
+ Page* _tmp5_ = NULL;
+ Page* _tmp6_;
+ _tmp5_ = application_append_page (self);
+ _tmp6_ = _tmp5_;
+ _page_unref0 (_tmp6_);
}
- _tmp3_ = _ ("Scanned Document");
- _tmp4_ = g_strdup (_tmp3_);
- filename_prefix = _tmp4_;
- if (options->scan_mode == SCAN_MODE_COLOR) {
- gchar* _tmp5_;
- _tmp5_ = g_strdup ("jpg");
+ _tmp7_ = _ ("Scanned Document");
+ _tmp8_ = g_strdup (_tmp7_);
+ filename_prefix = _tmp8_;
+ _tmp9_ = options;
+ _tmp10_ = _tmp9_->scan_mode;
+ if (_tmp10_ == SCAN_MODE_COLOR) {
+ gchar* _tmp11_;
+ _tmp11_ = g_strdup ("jpg");
_g_free0 (extension);
- extension = _tmp5_;
+ extension = _tmp11_;
} else {
- gchar* _tmp6_;
- _tmp6_ = g_strdup ("pdf");
+ gchar* _tmp12_;
+ _tmp12_ = g_strdup ("pdf");
_g_free0 (extension);
- extension = _tmp6_;
+ extension = _tmp12_;
}
- _tmp7_ = g_strdup_printf ("%s.%s", filename_prefix, extension);
- filename = _tmp7_;
- simple_scan_set_default_file_name (ui, filename);
- scanner_scan (self->priv->scanner, device, options);
+ _tmp13_ = filename_prefix;
+ _tmp14_ = extension;
+ _tmp15_ = g_strdup_printf ("%s.%s", _tmp13_, _tmp14_);
+ filename = _tmp15_;
+ _tmp16_ = ui;
+ simple_scan_set_default_file_name (_tmp16_, filename);
+ _tmp17_ = self->priv->scanner;
+ _tmp18_ = device;
+ _tmp19_ = options;
+ scanner_scan (_tmp17_, _tmp18_, _tmp19_);
_g_free0 (filename);
_g_free0 (extension);
_g_free0 (filename_prefix);
@@ -888,43 +1116,57 @@ static void application_scan_cb (Application* self, SimpleScan* ui, const gchar*
static void application_cancel_cb (Application* self, SimpleScan* ui) {
+ Scanner* _tmp0_;
g_return_if_fail (self != NULL);
g_return_if_fail (ui != NULL);
- scanner_cancel (self->priv->scanner);
+ _tmp0_ = self->priv->scanner;
+ scanner_cancel (_tmp0_);
}
static gchar* application_get_temporary_filename (Application* self, const gchar* prefix, const gchar* extension) {
gchar* result = NULL;
- gchar* _tmp0_ = NULL;
+ const gchar* _tmp0_;
+ const gchar* _tmp1_;
+ gchar* _tmp2_ = NULL;
gchar* filename;
gchar* path = NULL;
GError * _inner_error_ = NULL;
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (prefix != NULL, NULL);
g_return_val_if_fail (extension != NULL, NULL);
- _tmp0_ = g_strdup_printf ("%sXXXXXX.%s", prefix, extension);
- filename = _tmp0_;
+ _tmp0_ = prefix;
+ _tmp1_ = extension;
+ _tmp2_ = g_strdup_printf ("%sXXXXXX.%s", _tmp0_, _tmp1_);
+ filename = _tmp2_;
{
- gchar* _tmp1_ = NULL;
- gint _tmp2_;
+ const gchar* _tmp3_;
+ gchar* _tmp4_ = NULL;
+ gint _tmp5_ = 0;
gint fd;
- _tmp2_ = g_file_open_tmp (filename, &_tmp1_, &_inner_error_);
+ gint _tmp6_;
+ _tmp3_ = filename;
+ _tmp5_ = g_file_open_tmp (_tmp3_, &_tmp4_, &_inner_error_);
_g_free0 (path);
- path = _tmp1_;
- fd = _tmp2_;
+ path = _tmp4_;
+ fd = _tmp5_;
if (_inner_error_ != NULL) {
goto __catch3_g_error;
}
- close (fd);
+ _tmp6_ = fd;
+ close (_tmp6_);
}
goto __finally3;
__catch3_g_error:
{
GError* e = NULL;
+ GError* _tmp7_;
+ const gchar* _tmp8_;
e = _inner_error_;
_inner_error_ = NULL;
- g_warning ("simple-scan.vala:332: Error saving email attachment: %s", e->message);
+ _tmp7_ = e;
+ _tmp8_ = _tmp7_->message;
+ g_warning ("simple-scan.vala:332: Error saving email attachment: %s", _tmp8_);
result = NULL;
_g_error_free0 (e);
_g_free0 (path);
@@ -949,6 +1191,8 @@ static void application_email_cb (Application* self, SimpleScan* ui, const gchar
gboolean saved;
gchar* _tmp0_;
gchar* command_line;
+ const gchar* _tmp1_;
+ const gchar* _tmp38_;
GError * _inner_error_ = NULL;
g_return_if_fail (self != NULL);
g_return_if_fail (ui != NULL);
@@ -956,21 +1200,32 @@ static void application_email_cb (Application* self, SimpleScan* ui, const gchar
saved = FALSE;
_tmp0_ = g_strdup ("xdg-email");
command_line = _tmp0_;
- if (g_strcmp0 (profile, "text") == 0) {
- gchar* _tmp1_ = NULL;
+ _tmp1_ = profile;
+ if (g_strcmp0 (_tmp1_, "text") == 0) {
+ gchar* _tmp2_ = NULL;
gchar* path;
- _tmp1_ = application_get_temporary_filename (self, "scan", "pdf");
- path = _tmp1_;
- if (path != NULL) {
- GFile* _tmp2_ = NULL;
+ const gchar* _tmp3_;
+ _tmp2_ = application_get_temporary_filename (self, "scan", "pdf");
+ path = _tmp2_;
+ _tmp3_ = path;
+ if (_tmp3_ != NULL) {
+ const gchar* _tmp4_;
+ GFile* _tmp5_ = NULL;
GFile* file;
- gchar* _tmp3_ = NULL;
- gchar* _tmp4_;
- gchar* _tmp5_;
- _tmp2_ = g_file_new_for_path (path);
- file = _tmp2_;
+ const gchar* _tmp10_;
+ const gchar* _tmp11_;
+ gchar* _tmp12_ = NULL;
+ gchar* _tmp13_;
+ gchar* _tmp14_;
+ _tmp4_ = path;
+ _tmp5_ = g_file_new_for_path (_tmp4_);
+ file = _tmp5_;
{
- book_save (self->priv->book, "pdf", file, &_inner_error_);
+ Book* _tmp6_;
+ GFile* _tmp7_;
+ _tmp6_ = self->priv->book;
+ _tmp7_ = file;
+ book_save (_tmp6_, "pdf", _tmp7_, &_inner_error_);
if (_inner_error_ != NULL) {
goto __catch4_g_error;
}
@@ -979,9 +1234,13 @@ static void application_email_cb (Application* self, SimpleScan* ui, const gchar
__catch4_g_error:
{
GError* e = NULL;
+ GError* _tmp8_;
+ const gchar* _tmp9_;
e = _inner_error_;
_inner_error_ = NULL;
- g_warning ("simple-scan.vala:358: Unable to save email file: %s", e->message);
+ _tmp8_ = e;
+ _tmp9_ = _tmp8_->message;
+ g_warning ("simple-scan.vala:358: Unable to save email file: %s", _tmp9_);
_g_error_free0 (e);
_g_object_unref0 (file);
_g_free0 (path);
@@ -997,12 +1256,14 @@ static void application_email_cb (Application* self, SimpleScan* ui, const gchar
g_clear_error (&_inner_error_);
return;
}
- _tmp3_ = g_strdup_printf (" --attach %s", path);
- _tmp4_ = _tmp3_;
- _tmp5_ = g_strconcat (command_line, _tmp4_, NULL);
+ _tmp10_ = command_line;
+ _tmp11_ = path;
+ _tmp12_ = g_strdup_printf (" --attach %s", _tmp11_);
+ _tmp13_ = _tmp12_;
+ _tmp14_ = g_strconcat (_tmp10_, _tmp13_, NULL);
_g_free0 (command_line);
- command_line = _tmp5_;
- _g_free0 (_tmp4_);
+ command_line = _tmp14_;
+ _g_free0 (_tmp13_);
_g_object_unref0 (file);
}
_g_free0 (path);
@@ -1011,41 +1272,62 @@ static void application_email_cb (Application* self, SimpleScan* ui, const gchar
gint i;
i = 0;
{
- gboolean _tmp6_;
- _tmp6_ = TRUE;
+ gboolean _tmp15_;
+ _tmp15_ = TRUE;
while (TRUE) {
- guint _tmp7_;
- gchar* _tmp8_ = NULL;
+ gboolean _tmp16_;
+ gint _tmp18_;
+ Book* _tmp19_;
+ guint _tmp20_ = 0U;
+ gchar* _tmp21_ = NULL;
gchar* path;
- GFile* _tmp9_ = NULL;
+ const gchar* _tmp22_;
+ const gchar* _tmp23_;
+ GFile* _tmp24_ = NULL;
GFile* file;
- gchar* _tmp12_ = NULL;
- gchar* _tmp13_;
- gchar* _tmp14_;
- if (!_tmp6_) {
- i++;
+ const gchar* _tmp32_;
+ const gchar* _tmp33_;
+ gchar* _tmp34_ = NULL;
+ gchar* _tmp35_;
+ gchar* _tmp36_;
+ gboolean _tmp37_;
+ _tmp16_ = _tmp15_;
+ if (!_tmp16_) {
+ gint _tmp17_;
+ _tmp17_ = i;
+ i = _tmp17_ + 1;
}
- _tmp6_ = FALSE;
- _tmp7_ = book_get_n_pages (self->priv->book);
- if (!(((guint) i) < _tmp7_)) {
+ _tmp15_ = FALSE;
+ _tmp18_ = i;
+ _tmp19_ = self->priv->book;
+ _tmp20_ = book_get_n_pages (_tmp19_);
+ if (!(((guint) _tmp18_) < _tmp20_)) {
break;
}
- _tmp8_ = application_get_temporary_filename (self, "scan", "jpg");
- path = _tmp8_;
- if (path == NULL) {
+ _tmp21_ = application_get_temporary_filename (self, "scan", "jpg");
+ path = _tmp21_;
+ _tmp22_ = path;
+ if (_tmp22_ == NULL) {
saved = FALSE;
_g_free0 (path);
break;
}
- _tmp9_ = g_file_new_for_path (path);
- file = _tmp9_;
+ _tmp23_ = path;
+ _tmp24_ = g_file_new_for_path (_tmp23_);
+ file = _tmp24_;
{
- Page* _tmp10_ = NULL;
- Page* _tmp11_;
- _tmp10_ = book_get_page (self->priv->book, i);
- _tmp11_ = _tmp10_;
- page_save (_tmp11_, "jpeg", file, &_inner_error_);
- _page_unref0 (_tmp11_);
+ Book* _tmp25_;
+ gint _tmp26_;
+ Page* _tmp27_ = NULL;
+ Page* _tmp28_;
+ GFile* _tmp29_;
+ _tmp25_ = self->priv->book;
+ _tmp26_ = i;
+ _tmp27_ = book_get_page (_tmp25_, _tmp26_);
+ _tmp28_ = _tmp27_;
+ _tmp29_ = file;
+ page_save (_tmp28_, "jpeg", _tmp29_, &_inner_error_);
+ _page_unref0 (_tmp28_);
if (_inner_error_ != NULL) {
goto __catch5_g_error;
}
@@ -1054,9 +1336,13 @@ static void application_email_cb (Application* self, SimpleScan* ui, const gchar
__catch5_g_error:
{
GError* e = NULL;
+ GError* _tmp30_;
+ const gchar* _tmp31_;
e = _inner_error_;
_inner_error_ = NULL;
- g_warning ("simple-scan.vala:382: Unable to save email file: %s", e->message);
+ _tmp30_ = e;
+ _tmp31_ = _tmp30_->message;
+ g_warning ("simple-scan.vala:382: Unable to save email file: %s", _tmp31_);
_g_error_free0 (e);
_g_object_unref0 (file);
_g_free0 (path);
@@ -1072,13 +1358,16 @@ static void application_email_cb (Application* self, SimpleScan* ui, const gchar
g_clear_error (&_inner_error_);
return;
}
- _tmp12_ = g_strdup_printf (" --attach %s", path);
- _tmp13_ = _tmp12_;
- _tmp14_ = g_strconcat (command_line, _tmp13_, NULL);
+ _tmp32_ = command_line;
+ _tmp33_ = path;
+ _tmp34_ = g_strdup_printf (" --attach %s", _tmp33_);
+ _tmp35_ = _tmp34_;
+ _tmp36_ = g_strconcat (_tmp32_, _tmp35_, NULL);
_g_free0 (command_line);
- command_line = _tmp14_;
- _g_free0 (_tmp13_);
- if (!saved) {
+ command_line = _tmp36_;
+ _g_free0 (_tmp35_);
+ _tmp37_ = saved;
+ if (!_tmp37_) {
_g_object_unref0 (file);
_g_free0 (path);
break;
@@ -1089,9 +1378,12 @@ static void application_email_cb (Application* self, SimpleScan* ui, const gchar
}
}
}
- g_debug ("simple-scan.vala:392: Launching email client: %s", command_line);
+ _tmp38_ = command_line;
+ g_debug ("simple-scan.vala:392: Launching email client: %s", _tmp38_);
{
- g_spawn_command_line_async (command_line, &_inner_error_);
+ const gchar* _tmp39_;
+ _tmp39_ = command_line;
+ g_spawn_command_line_async (_tmp39_, &_inner_error_);
if (_inner_error_ != NULL) {
goto __catch6_g_error;
}
@@ -1100,9 +1392,13 @@ static void application_email_cb (Application* self, SimpleScan* ui, const gchar
__catch6_g_error:
{
GError* e = NULL;
+ GError* _tmp40_;
+ const gchar* _tmp41_;
e = _inner_error_;
_inner_error_ = NULL;
- g_warning ("simple-scan.vala:399: Unable to start email: %s", e->message);
+ _tmp40_ = e;
+ _tmp41_ = _tmp40_->message;
+ g_warning ("simple-scan.vala:399: Unable to start email: %s", _tmp41_);
_g_error_free0 (e);
}
__finally6:
@@ -1117,6 +1413,7 @@ static void application_email_cb (Application* self, SimpleScan* ui, const gchar
static void application_quit_cb (Application* self, SimpleScan* ui) {
+ Scanner* _tmp0_;
g_return_if_fail (self != NULL);
g_return_if_fail (ui != NULL);
_book_unref0 (self->priv->book);
@@ -1124,108 +1421,159 @@ static void application_quit_cb (Application* self, SimpleScan* ui) {
ui = NULL;
_g_object_unref0 (self->priv->udev_client);
self->priv->udev_client = NULL;
- scanner_free (self->priv->scanner);
+ _tmp0_ = self->priv->scanner;
+ scanner_free (_tmp0_);
gtk_main_quit ();
}
static void application_log_cb (const gchar* log_domain, GLogLevelFlags log_level, const gchar* message) {
+ FILE* _tmp0_;
+ GLogLevelFlags _tmp14_;
g_return_if_fail (message != NULL);
- if (application_log_file != NULL) {
+ _tmp0_ = application_log_file;
+ if (_tmp0_ != NULL) {
gchar* prefix = NULL;
- gdouble _tmp7_;
- switch (log_level & G_LOG_LEVEL_MASK) {
+ GLogLevelFlags _tmp1_;
+ FILE* _tmp9_;
+ GTimer* _tmp10_;
+ gdouble _tmp11_ = 0.0;
+ const gchar* _tmp12_;
+ const gchar* _tmp13_;
+ _tmp1_ = log_level;
+ switch (_tmp1_ & G_LOG_LEVEL_MASK) {
case G_LOG_LEVEL_ERROR:
{
- gchar* _tmp0_;
- _tmp0_ = g_strdup ("ERROR:");
+ gchar* _tmp2_;
+ _tmp2_ = g_strdup ("ERROR:");
_g_free0 (prefix);
- prefix = _tmp0_;
+ prefix = _tmp2_;
break;
}
case G_LOG_LEVEL_CRITICAL:
{
- gchar* _tmp1_;
- _tmp1_ = g_strdup ("CRITICAL:");
+ gchar* _tmp3_;
+ _tmp3_ = g_strdup ("CRITICAL:");
_g_free0 (prefix);
- prefix = _tmp1_;
+ prefix = _tmp3_;
break;
}
case G_LOG_LEVEL_WARNING:
{
- gchar* _tmp2_;
- _tmp2_ = g_strdup ("WARNING:");
+ gchar* _tmp4_;
+ _tmp4_ = g_strdup ("WARNING:");
_g_free0 (prefix);
- prefix = _tmp2_;
+ prefix = _tmp4_;
break;
}
case G_LOG_LEVEL_MESSAGE:
{
- gchar* _tmp3_;
- _tmp3_ = g_strdup ("MESSAGE:");
+ gchar* _tmp5_;
+ _tmp5_ = g_strdup ("MESSAGE:");
_g_free0 (prefix);
- prefix = _tmp3_;
+ prefix = _tmp5_;
break;
}
case G_LOG_LEVEL_INFO:
{
- gchar* _tmp4_;
- _tmp4_ = g_strdup ("INFO:");
+ gchar* _tmp6_;
+ _tmp6_ = g_strdup ("INFO:");
_g_free0 (prefix);
- prefix = _tmp4_;
+ prefix = _tmp6_;
break;
}
case G_LOG_LEVEL_DEBUG:
{
- gchar* _tmp5_;
- _tmp5_ = g_strdup ("DEBUG:");
+ gchar* _tmp7_;
+ _tmp7_ = g_strdup ("DEBUG:");
_g_free0 (prefix);
- prefix = _tmp5_;
+ prefix = _tmp7_;
break;
}
default:
{
- gchar* _tmp6_;
- _tmp6_ = g_strdup ("LOG:");
+ gchar* _tmp8_;
+ _tmp8_ = g_strdup ("LOG:");
_g_free0 (prefix);
- prefix = _tmp6_;
+ prefix = _tmp8_;
break;
}
}
- _tmp7_ = g_timer_elapsed (application_log_timer, NULL);
- fprintf (application_log_file, "[%+.2fs] %s %s\n", _tmp7_, prefix, message);
+ _tmp9_ = application_log_file;
+ _tmp10_ = application_log_timer;
+ _tmp11_ = g_timer_elapsed (_tmp10_, NULL);
+ _tmp12_ = prefix;
+ _tmp13_ = message;
+ fprintf (_tmp9_, "[%+.2fs] %s %s\n", _tmp11_, _tmp12_, _tmp13_);
_g_free0 (prefix);
}
- if ((log_level & G_LOG_LEVEL_DEBUG) != 0) {
- if (application_debug_enabled) {
- g_log_default_handler (log_domain, log_level, message, NULL);
+ _tmp14_ = log_level;
+ if ((_tmp14_ & G_LOG_LEVEL_DEBUG) != 0) {
+ gboolean _tmp15_;
+ _tmp15_ = application_debug_enabled;
+ if (_tmp15_) {
+ GLogFunc _tmp16_;
+ void* _tmp16__target;
+ const gchar* _tmp17_;
+ GLogLevelFlags _tmp18_;
+ const gchar* _tmp19_;
+ _tmp16_ = g_log_default_handler;
+ _tmp16__target = NULL;
+ _tmp17_ = log_domain;
+ _tmp18_ = log_level;
+ _tmp19_ = message;
+ _tmp16_ (_tmp17_, _tmp18_, _tmp19_, _tmp16__target);
}
} else {
- g_log_default_handler (log_domain, log_level, message, NULL);
+ GLogFunc _tmp20_;
+ void* _tmp20__target;
+ const gchar* _tmp21_;
+ GLogLevelFlags _tmp22_;
+ const gchar* _tmp23_;
+ _tmp20_ = g_log_default_handler;
+ _tmp20__target = NULL;
+ _tmp21_ = log_domain;
+ _tmp22_ = log_level;
+ _tmp23_ = message;
+ _tmp20_ (_tmp21_, _tmp22_, _tmp23_, _tmp20__target);
}
}
static void application_on_uevent (Application* self, GUdevClient* client, const gchar* action, GUdevDevice* device) {
+ Scanner* _tmp0_;
g_return_if_fail (self != NULL);
g_return_if_fail (client != NULL);
g_return_if_fail (action != NULL);
g_return_if_fail (device != NULL);
- scanner_redetect (self->priv->scanner);
+ _tmp0_ = self->priv->scanner;
+ scanner_redetect (_tmp0_);
}
static glong string_strnlen (gchar* str, glong maxlen) {
glong result = 0L;
- gchar* _tmp0_ = NULL;
+ gchar* _tmp0_;
+ glong _tmp1_;
+ gchar* _tmp2_ = NULL;
gchar* end;
- _tmp0_ = memchr (str, 0, (gsize) maxlen);
- end = _tmp0_;
- if (end == NULL) {
- result = maxlen;
+ gchar* _tmp3_;
+ _tmp0_ = str;
+ _tmp1_ = maxlen;
+ _tmp2_ = memchr (_tmp0_, 0, (gsize) _tmp1_);
+ end = _tmp2_;
+ _tmp3_ = end;
+ if (_tmp3_ == NULL) {
+ glong _tmp4_;
+ _tmp4_ = maxlen;
+ result = _tmp4_;
return result;
} else {
- result = (glong) (end - str);
+ gchar* _tmp5_;
+ gchar* _tmp6_;
+ _tmp5_ = end;
+ _tmp6_ = str;
+ result = (glong) (_tmp5_ - _tmp6_);
return result;
}
}
@@ -1235,34 +1583,74 @@ static gchar* string_substring (const gchar* self, glong offset, glong len) {
gchar* result = NULL;
glong string_length = 0L;
gboolean _tmp0_ = FALSE;
- gchar* _tmp3_ = NULL;
+ glong _tmp1_;
+ gboolean _tmp3_;
+ glong _tmp9_;
+ glong _tmp15_;
+ glong _tmp18_;
+ glong _tmp19_;
+ glong _tmp20_;
+ glong _tmp21_;
+ glong _tmp22_;
+ gchar* _tmp23_ = NULL;
g_return_val_if_fail (self != NULL, NULL);
- if (offset >= ((glong) 0)) {
- _tmp0_ = len >= ((glong) 0);
+ _tmp1_ = offset;
+ if (_tmp1_ >= ((glong) 0)) {
+ glong _tmp2_;
+ _tmp2_ = len;
+ _tmp0_ = _tmp2_ >= ((glong) 0);
} else {
_tmp0_ = FALSE;
}
- if (_tmp0_) {
- glong _tmp1_;
- _tmp1_ = string_strnlen ((gchar*) self, offset + len);
- string_length = _tmp1_;
+ _tmp3_ = _tmp0_;
+ if (_tmp3_) {
+ glong _tmp4_;
+ glong _tmp5_;
+ glong _tmp6_ = 0L;
+ _tmp4_ = offset;
+ _tmp5_ = len;
+ _tmp6_ = string_strnlen ((gchar*) self, _tmp4_ + _tmp5_);
+ string_length = _tmp6_;
} else {
- gint _tmp2_;
- _tmp2_ = strlen (self);
- string_length = (glong) _tmp2_;
+ gint _tmp7_;
+ gint _tmp8_;
+ _tmp7_ = strlen (self);
+ _tmp8_ = _tmp7_;
+ string_length = (glong) _tmp8_;
}
- if (offset < ((glong) 0)) {
- offset = string_length + offset;
- g_return_val_if_fail (offset >= ((glong) 0), NULL);
+ _tmp9_ = offset;
+ if (_tmp9_ < ((glong) 0)) {
+ glong _tmp10_;
+ glong _tmp11_;
+ glong _tmp12_;
+ _tmp10_ = string_length;
+ _tmp11_ = offset;
+ offset = _tmp10_ + _tmp11_;
+ _tmp12_ = offset;
+ g_return_val_if_fail (_tmp12_ >= ((glong) 0), NULL);
} else {
- g_return_val_if_fail (offset <= string_length, NULL);
+ glong _tmp13_;
+ glong _tmp14_;
+ _tmp13_ = offset;
+ _tmp14_ = string_length;
+ g_return_val_if_fail (_tmp13_ <= _tmp14_, NULL);
}
- if (len < ((glong) 0)) {
- len = string_length - offset;
+ _tmp15_ = len;
+ if (_tmp15_ < ((glong) 0)) {
+ glong _tmp16_;
+ glong _tmp17_;
+ _tmp16_ = string_length;
+ _tmp17_ = offset;
+ len = _tmp16_ - _tmp17_;
}
- g_return_val_if_fail ((offset + len) <= string_length, NULL);
- _tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
- result = _tmp3_;
+ _tmp18_ = offset;
+ _tmp19_ = len;
+ _tmp20_ = string_length;
+ g_return_val_if_fail ((_tmp18_ + _tmp19_) <= _tmp20_, NULL);
+ _tmp21_ = offset;
+ _tmp22_ = len;
+ _tmp23_ = g_strndup (((gchar*) self) + _tmp21_, (gsize) _tmp22_);
+ result = _tmp23_;
return result;
}
@@ -1271,156 +1659,282 @@ static void application_fix_pdf (const gchar* filename, GError** error) {
guint8* data = NULL;
gint data_length1 = 0;
gint _data_size_ = 0;
- guint8* _tmp0_ = NULL;
- size_t _tmp1_;
- gchar* _tmp2_;
- gchar* _tmp3_;
- FILE* _tmp4_ = NULL;
- FILE* _tmp5_;
+ const gchar* _tmp0_;
+ guint8* _tmp1_ = NULL;
+ size_t _tmp2_;
+ const gchar* _tmp3_;
+ gchar* _tmp4_;
+ gchar* _tmp5_;
+ FILE* _tmp6_ = NULL;
+ FILE* _tmp7_;
FILE* fixed_file;
gint offset;
gint line_number;
gint xref_offset;
gint xref_line;
- GRegex* _tmp6_ = NULL;
+ GRegex* _tmp8_;
GRegex* xref_regex;
GMatchInfo* xref_match = NULL;
- GString* _tmp7_ = NULL;
+ GString* _tmp9_;
GString* line;
- gchar* _tmp25_;
- gchar* _tmp26_;
- gint _tmp27_;
- gboolean _tmp28_;
+ const gchar* _tmp84_;
+ const gchar* _tmp85_;
+ gchar* _tmp86_;
+ gchar* _tmp87_;
+ gint _tmp88_ = 0;
+ gboolean _tmp89_;
GError * _inner_error_ = NULL;
g_return_if_fail (filename != NULL);
- g_file_get_contents (filename, (gchar**) (&_tmp0_), &_tmp1_, &_inner_error_);
+ _tmp0_ = filename;
+ g_file_get_contents (_tmp0_, (gchar**) (&_tmp1_), &_tmp2_, &_inner_error_);
data = (g_free (data), NULL);
- data = _tmp0_;
- data_length1 = _tmp1_;
+ data = _tmp1_;
+ data_length1 = _tmp2_;
_data_size_ = data_length1;
if (_inner_error_ != NULL) {
g_propagate_error (error, _inner_error_);
data = (g_free (data), NULL);
return;
}
- _tmp2_ = g_strconcat (filename, ".fixed", NULL);
- _tmp3_ = _tmp2_;
- _tmp4_ = fopen (_tmp3_, "w");
+ _tmp3_ = filename;
+ _tmp4_ = g_strconcat (_tmp3_, ".fixed", NULL);
_tmp5_ = _tmp4_;
- _g_free0 (_tmp3_);
- fixed_file = _tmp5_;
+ _tmp6_ = fopen (_tmp5_, "w");
+ _tmp7_ = _tmp6_;
+ _g_free0 (_tmp5_);
+ fixed_file = _tmp7_;
offset = 0;
line_number = 0;
xref_offset = 0;
xref_line = -1;
- _tmp6_ = g_regex_new ("^\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d 0000 n$", 0, 0, &_inner_error_);
- xref_regex = _tmp6_;
+ _tmp8_ = g_regex_new ("^\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d 0000 n$", 0, 0, &_inner_error_);
+ xref_regex = _tmp8_;
if (_inner_error_ != NULL) {
g_propagate_error (error, _inner_error_);
_fclose0 (fixed_file);
data = (g_free (data), NULL);
return;
}
- _tmp7_ = g_string_new ("");
- line = _tmp7_;
+ _tmp9_ = g_string_new ("");
+ line = _tmp9_;
while (TRUE) {
+ gint _tmp10_;
+ guint8* _tmp11_;
+ gint _tmp11__length1;
+ gint _tmp12_;
gint end_offset;
- gboolean _tmp8_ = FALSE;
- if (!(offset < data_length1)) {
+ GString* _tmp13_;
+ GString* _tmp23_;
+ const gchar* _tmp24_;
+ gboolean _tmp26_ = FALSE;
+ gint _tmp27_;
+ gboolean _tmp31_;
+ gint _tmp82_;
+ gint _tmp83_;
+ _tmp10_ = offset;
+ _tmp11_ = data;
+ _tmp11__length1 = data_length1;
+ if (!(_tmp10_ < _tmp11__length1)) {
break;
}
- end_offset = offset;
- g_string_assign (line, "");
+ _tmp12_ = offset;
+ end_offset = _tmp12_;
+ _tmp13_ = line;
+ g_string_assign (_tmp13_, "");
while (TRUE) {
+ gint _tmp14_;
+ guint8* _tmp15_;
+ gint _tmp15__length1;
+ guint8* _tmp16_;
+ gint _tmp16__length1;
+ gint _tmp17_;
+ guint8 _tmp18_;
guint8 c;
- if (!(end_offset < data_length1)) {
+ GString* _tmp19_;
+ guint8 _tmp20_;
+ gint _tmp21_;
+ guint8 _tmp22_;
+ _tmp14_ = end_offset;
+ _tmp15_ = data;
+ _tmp15__length1 = data_length1;
+ if (!(_tmp14_ < _tmp15__length1)) {
break;
}
- c = data[end_offset];
- g_string_append_c (line, (gchar) c);
- end_offset++;
- if (c == ((guint8) '\n')) {
+ _tmp16_ = data;
+ _tmp16__length1 = data_length1;
+ _tmp17_ = end_offset;
+ _tmp18_ = _tmp16_[_tmp17_];
+ c = _tmp18_;
+ _tmp19_ = line;
+ _tmp20_ = c;
+ g_string_append_c (_tmp19_, (gchar) _tmp20_);
+ _tmp21_ = end_offset;
+ end_offset = _tmp21_ + 1;
+ _tmp22_ = c;
+ if (_tmp22_ == ((guint8) '\n')) {
break;
}
}
- if (g_strcmp0 (line->str, "startxref\n") == 0) {
- xref_line = line_number;
+ _tmp23_ = line;
+ _tmp24_ = _tmp23_->str;
+ if (g_strcmp0 (_tmp24_, "startxref\n") == 0) {
+ gint _tmp25_;
+ _tmp25_ = line_number;
+ xref_line = _tmp25_;
}
- if (line_number < 2) {
- gboolean _tmp9_;
- _tmp9_ = g_str_has_prefix (line->str, "%%");
- _tmp8_ = _tmp9_;
+ _tmp27_ = line_number;
+ if (_tmp27_ < 2) {
+ GString* _tmp28_;
+ const gchar* _tmp29_;
+ gboolean _tmp30_ = FALSE;
+ _tmp28_ = line;
+ _tmp29_ = _tmp28_->str;
+ _tmp30_ = g_str_has_prefix (_tmp29_, "%%");
+ _tmp26_ = _tmp30_;
} else {
- _tmp8_ = FALSE;
+ _tmp26_ = FALSE;
}
- if (_tmp8_) {
- gchar* _tmp10_ = NULL;
- gchar* _tmp11_;
- xref_offset--;
- _tmp10_ = string_substring (line->str, (glong) 1, (glong) (-1));
- _tmp11_ = _tmp10_;
- fprintf (fixed_file, "%s", _tmp11_);
- _g_free0 (_tmp11_);
+ _tmp31_ = _tmp26_;
+ if (_tmp31_) {
+ gint _tmp32_;
+ FILE* _tmp33_;
+ GString* _tmp34_;
+ const gchar* _tmp35_;
+ gchar* _tmp36_ = NULL;
+ gchar* _tmp37_;
+ _tmp32_ = xref_offset;
+ xref_offset = _tmp32_ - 1;
+ _tmp33_ = fixed_file;
+ _tmp34_ = line;
+ _tmp35_ = _tmp34_->str;
+ _tmp36_ = string_substring (_tmp35_, (glong) 1, (glong) (-1));
+ _tmp37_ = _tmp36_;
+ fprintf (_tmp33_, "%s", _tmp37_);
+ _g_free0 (_tmp37_);
} else {
- GMatchInfo* _tmp12_ = NULL;
- gboolean _tmp13_;
- _tmp13_ = g_regex_match (xref_regex, line->str, 0, &_tmp12_);
+ GRegex* _tmp38_;
+ GString* _tmp39_;
+ const gchar* _tmp40_;
+ GMatchInfo* _tmp41_ = NULL;
+ gboolean _tmp42_ = FALSE;
+ _tmp38_ = xref_regex;
+ _tmp39_ = line;
+ _tmp40_ = _tmp39_->str;
+ _tmp42_ = g_regex_match (_tmp38_, _tmp40_, 0, &_tmp41_);
_g_match_info_free0 (xref_match);
- xref_match = _tmp12_;
- if (_tmp13_) {
- const gchar* _tmp14_ = NULL;
- gint _tmp15_;
- _tmp14_ = g_match_info_get_string (xref_match);
- _tmp15_ = atoi (_tmp14_);
- fprintf (fixed_file, "%010d 00000 n \n", _tmp15_ + xref_offset);
+ xref_match = _tmp41_;
+ if (_tmp42_) {
+ FILE* _tmp43_;
+ GMatchInfo* _tmp44_;
+ const gchar* _tmp45_ = NULL;
+ gint _tmp46_ = 0;
+ gint _tmp47_;
+ _tmp43_ = fixed_file;
+ _tmp44_ = xref_match;
+ _tmp45_ = g_match_info_get_string (_tmp44_);
+ _tmp46_ = atoi (_tmp45_);
+ _tmp47_ = xref_offset;
+ fprintf (_tmp43_, "%010d 00000 n \n", _tmp46_ + _tmp47_);
} else {
- gboolean _tmp16_ = FALSE;
- if (xref_line > 0) {
- _tmp16_ = line_number == (xref_line + 1);
+ gboolean _tmp48_ = FALSE;
+ gint _tmp49_;
+ gboolean _tmp52_;
+ _tmp49_ = xref_line;
+ if (_tmp49_ > 0) {
+ gint _tmp50_;
+ gint _tmp51_;
+ _tmp50_ = line_number;
+ _tmp51_ = xref_line;
+ _tmp48_ = _tmp50_ == (_tmp51_ + 1);
} else {
- _tmp16_ = FALSE;
+ _tmp48_ = FALSE;
}
- if (_tmp16_) {
- gint _tmp17_;
- gchar* _tmp18_ = NULL;
- gchar* _tmp19_;
- _tmp17_ = atoi (line->str);
- _tmp18_ = g_strdup_printf ("%d\n", _tmp17_ + xref_offset);
- _tmp19_ = _tmp18_;
- fprintf (fixed_file, "%s", _tmp19_);
- _g_free0 (_tmp19_);
+ _tmp52_ = _tmp48_;
+ if (_tmp52_) {
+ FILE* _tmp53_;
+ GString* _tmp54_;
+ const gchar* _tmp55_;
+ gint _tmp56_ = 0;
+ gint _tmp57_;
+ gchar* _tmp58_ = NULL;
+ gchar* _tmp59_;
+ _tmp53_ = fixed_file;
+ _tmp54_ = line;
+ _tmp55_ = _tmp54_->str;
+ _tmp56_ = atoi (_tmp55_);
+ _tmp57_ = xref_offset;
+ _tmp58_ = g_strdup_printf ("%d\n", _tmp56_ + _tmp57_);
+ _tmp59_ = _tmp58_;
+ fprintf (_tmp53_, "%s", _tmp59_);
+ _g_free0 (_tmp59_);
} else {
- gboolean _tmp20_ = FALSE;
- if (line_number == (xref_line + 2)) {
- gboolean _tmp21_;
- _tmp21_ = g_str_has_prefix (line->str, "%%%%");
- _tmp20_ = _tmp21_;
+ gboolean _tmp60_ = FALSE;
+ gint _tmp61_;
+ gint _tmp62_;
+ gboolean _tmp66_;
+ _tmp61_ = line_number;
+ _tmp62_ = xref_line;
+ if (_tmp61_ == (_tmp62_ + 2)) {
+ GString* _tmp63_;
+ const gchar* _tmp64_;
+ gboolean _tmp65_ = FALSE;
+ _tmp63_ = line;
+ _tmp64_ = _tmp63_->str;
+ _tmp65_ = g_str_has_prefix (_tmp64_, "%%%%");
+ _tmp60_ = _tmp65_;
} else {
- _tmp20_ = FALSE;
+ _tmp60_ = FALSE;
}
- if (_tmp20_) {
- gchar* _tmp22_ = NULL;
- gchar* _tmp23_;
- _tmp22_ = string_substring (line->str, (glong) 2, (glong) (-1));
- _tmp23_ = _tmp22_;
- fprintf (fixed_file, "%s", _tmp23_);
- _g_free0 (_tmp23_);
+ _tmp66_ = _tmp60_;
+ if (_tmp66_) {
+ FILE* _tmp67_;
+ GString* _tmp68_;
+ const gchar* _tmp69_;
+ gchar* _tmp70_ = NULL;
+ gchar* _tmp71_;
+ _tmp67_ = fixed_file;
+ _tmp68_ = line;
+ _tmp69_ = _tmp68_->str;
+ _tmp70_ = string_substring (_tmp69_, (glong) 2, (glong) (-1));
+ _tmp71_ = _tmp70_;
+ fprintf (_tmp67_, "%s", _tmp71_);
+ _g_free0 (_tmp71_);
} else {
{
+ gint _tmp72_;
gint i;
- i = offset;
+ _tmp72_ = offset;
+ i = _tmp72_;
{
- gboolean _tmp24_;
- _tmp24_ = TRUE;
+ gboolean _tmp73_;
+ _tmp73_ = TRUE;
while (TRUE) {
- if (!_tmp24_) {
- i++;
+ gboolean _tmp74_;
+ gint _tmp76_;
+ gint _tmp77_;
+ FILE* _tmp78_;
+ guint8* _tmp79_;
+ gint _tmp79__length1;
+ gint _tmp80_;
+ guint8 _tmp81_;
+ _tmp74_ = _tmp73_;
+ if (!_tmp74_) {
+ gint _tmp75_;
+ _tmp75_ = i;
+ i = _tmp75_ + 1;
}
- _tmp24_ = FALSE;
- if (!(i < end_offset)) {
+ _tmp73_ = FALSE;
+ _tmp76_ = i;
+ _tmp77_ = end_offset;
+ if (!(_tmp76_ < _tmp77_)) {
break;
}
- fputc ((gchar) data[i], fixed_file);
+ _tmp78_ = fixed_file;
+ _tmp79_ = data;
+ _tmp79__length1 = data_length1;
+ _tmp80_ = i;
+ _tmp81_ = _tmp79_[_tmp80_];
+ fputc ((gchar) _tmp81_, _tmp78_);
}
}
}
@@ -1428,21 +1942,29 @@ static void application_fix_pdf (const gchar* filename, GError** error) {
}
}
}
- line_number++;
- offset = end_offset;
+ _tmp82_ = line_number;
+ line_number = _tmp82_ + 1;
+ _tmp83_ = end_offset;
+ offset = _tmp83_;
}
- _tmp25_ = g_strconcat (filename, "~", NULL);
- _tmp26_ = _tmp25_;
- _tmp27_ = g_rename (filename, _tmp26_);
- _tmp28_ = _tmp27_ >= 0;
- _g_free0 (_tmp26_);
- if (_tmp28_) {
- gchar* _tmp29_;
- gchar* _tmp30_;
- _tmp29_ = g_strconcat (filename, ".fixed", NULL);
- _tmp30_ = _tmp29_;
- g_rename (_tmp30_, filename);
- _g_free0 (_tmp30_);
+ _tmp84_ = filename;
+ _tmp85_ = filename;
+ _tmp86_ = g_strconcat (_tmp85_, "~", NULL);
+ _tmp87_ = _tmp86_;
+ _tmp88_ = g_rename (_tmp84_, _tmp87_);
+ _tmp89_ = _tmp88_ >= 0;
+ _g_free0 (_tmp87_);
+ if (_tmp89_) {
+ const gchar* _tmp90_;
+ gchar* _tmp91_;
+ gchar* _tmp92_;
+ const gchar* _tmp93_;
+ _tmp90_ = filename;
+ _tmp91_ = g_strconcat (_tmp90_, ".fixed", NULL);
+ _tmp92_ = _tmp91_;
+ _tmp93_ = filename;
+ g_rename (_tmp92_, _tmp93_);
+ _g_free0 (_tmp92_);
}
_g_string_free0 (line);
_g_match_info_free0 (xref_match);
@@ -1460,20 +1982,30 @@ static void _application_log_cb_glog_func (const gchar* log_domain, GLogLevelFla
gint application_main (gchar** args, int args_length1) {
gint result = 0;
const gchar* _tmp0_ = NULL;
- GOptionContext* _tmp1_ = NULL;
+ GOptionContext* _tmp1_;
GOptionContext* c;
- GOptionGroup* _tmp2_ = NULL;
+ GOptionContext* _tmp2_;
+ GOptionContext* _tmp3_;
+ GOptionGroup* _tmp4_ = NULL;
+ gboolean _tmp14_;
+ const gchar* _tmp16_;
ScanDevice* device;
- GTimer* _tmp8_ = NULL;
- const gchar* _tmp9_ = NULL;
- gchar* _tmp10_ = NULL;
+ gchar** _tmp29_;
+ gint _tmp29__length1;
+ GTimer* _tmp39_;
+ const gchar* _tmp40_ = NULL;
+ gchar* _tmp41_ = NULL;
gchar* path;
- const gchar* _tmp11_ = NULL;
- gchar* _tmp12_ = NULL;
- FILE* _tmp13_ = NULL;
- pid_t _tmp14_;
- Application* _tmp15_ = NULL;
+ const gchar* _tmp42_;
+ const gchar* _tmp43_ = NULL;
+ gchar* _tmp44_ = NULL;
+ const gchar* _tmp45_;
+ FILE* _tmp46_ = NULL;
+ pid_t _tmp47_ = 0;
+ ScanDevice* _tmp48_;
+ Application* _tmp49_;
Application* app;
+ Application* _tmp50_;
GError * _inner_error_ = NULL;
setlocale (LC_ALL, "");
bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR);
@@ -1483,11 +2015,15 @@ gint application_main (gchar** args, int args_length1) {
_tmp0_ = _ ("[DEVICE...] - Scanning utility");
_tmp1_ = g_option_context_new (_tmp0_);
c = _tmp1_;
- g_option_context_add_main_entries (c, APPLICATION_options, GETTEXT_PACKAGE);
- _tmp2_ = gtk_get_option_group (TRUE);
- g_option_context_add_group (c, _tmp2_);
+ _tmp2_ = c;
+ g_option_context_add_main_entries (_tmp2_, APPLICATION_options, GETTEXT_PACKAGE);
+ _tmp3_ = c;
+ _tmp4_ = gtk_get_option_group (TRUE);
+ g_option_context_add_group (_tmp3_, _tmp4_);
{
- g_option_context_parse (c, &args_length1, &args, &_inner_error_);
+ GOptionContext* _tmp5_;
+ _tmp5_ = c;
+ g_option_context_parse (_tmp5_, &args_length1, &args, &_inner_error_);
if (_inner_error_ != NULL) {
goto __catch7_g_error;
}
@@ -1496,13 +2032,29 @@ gint application_main (gchar** args, int args_length1) {
__catch7_g_error:
{
GError* e = NULL;
- const gchar* _tmp3_ = NULL;
+ FILE* _tmp6_;
+ GError* _tmp7_;
+ const gchar* _tmp8_;
+ FILE* _tmp9_;
+ const gchar* _tmp10_ = NULL;
+ gchar** _tmp11_;
+ gint _tmp11__length1;
+ const gchar* _tmp12_;
+ FILE* _tmp13_;
e = _inner_error_;
_inner_error_ = NULL;
- fprintf (stderr, "%s\n", e->message);
- _tmp3_ = _ ("Run '%s --help' to see a full list of available command line options.");
- fprintf (stderr, _tmp3_, args[0]);
- fprintf (stderr, "\n");
+ _tmp6_ = stderr;
+ _tmp7_ = e;
+ _tmp8_ = _tmp7_->message;
+ fprintf (_tmp6_, "%s\n", _tmp8_);
+ _tmp9_ = stderr;
+ _tmp10_ = _ ("Run '%s --help' to see a full list of available command line options.");
+ _tmp11_ = args;
+ _tmp11__length1 = args_length1;
+ _tmp12_ = _tmp11_[0];
+ fprintf (_tmp9_, _tmp10_, _tmp12_);
+ _tmp13_ = stderr;
+ fprintf (_tmp13_, "\n");
result = EXIT_FAILURE;
_g_error_free0 (e);
_g_option_context_free0 (c);
@@ -1515,15 +2067,21 @@ gint application_main (gchar** args, int args_length1) {
g_clear_error (&_inner_error_);
return 0;
}
- if (application_show_version) {
- fprintf (stderr, "simple-scan %s\n", VERSION);
+ _tmp14_ = application_show_version;
+ if (_tmp14_) {
+ FILE* _tmp15_;
+ _tmp15_ = stderr;
+ fprintf (_tmp15_, "simple-scan %s\n", VERSION);
result = EXIT_SUCCESS;
_g_option_context_free0 (c);
return result;
}
- if (application_fix_pdf_filename != NULL) {
+ _tmp16_ = application_fix_pdf_filename;
+ if (_tmp16_ != NULL) {
{
- application_fix_pdf (application_fix_pdf_filename, &_inner_error_);
+ const gchar* _tmp17_;
+ _tmp17_ = application_fix_pdf_filename;
+ application_fix_pdf (_tmp17_, &_inner_error_);
if (_inner_error_ != NULL) {
goto __catch8_g_error;
}
@@ -1531,17 +2089,35 @@ gint application_main (gchar** args, int args_length1) {
gint i;
i = 1;
{
- gboolean _tmp4_;
- _tmp4_ = TRUE;
+ gboolean _tmp18_;
+ _tmp18_ = TRUE;
while (TRUE) {
- if (!_tmp4_) {
- i++;
+ gboolean _tmp19_;
+ gint _tmp21_;
+ gchar** _tmp22_;
+ gint _tmp22__length1;
+ gchar** _tmp23_;
+ gint _tmp23__length1;
+ gint _tmp24_;
+ const gchar* _tmp25_;
+ _tmp19_ = _tmp18_;
+ if (!_tmp19_) {
+ gint _tmp20_;
+ _tmp20_ = i;
+ i = _tmp20_ + 1;
}
- _tmp4_ = FALSE;
- if (!(i < args_length1)) {
+ _tmp18_ = FALSE;
+ _tmp21_ = i;
+ _tmp22_ = args;
+ _tmp22__length1 = args_length1;
+ if (!(_tmp21_ < _tmp22__length1)) {
break;
}
- application_fix_pdf (args[i], &_inner_error_);
+ _tmp23_ = args;
+ _tmp23__length1 = args_length1;
+ _tmp24_ = i;
+ _tmp25_ = _tmp23_[_tmp24_];
+ application_fix_pdf (_tmp25_, &_inner_error_);
if (_inner_error_ != NULL) {
goto __catch8_g_error;
}
@@ -1553,9 +2129,15 @@ gint application_main (gchar** args, int args_length1) {
__catch8_g_error:
{
GError* e = NULL;
+ FILE* _tmp26_;
+ GError* _tmp27_;
+ const gchar* _tmp28_;
e = _inner_error_;
_inner_error_ = NULL;
- fprintf (stderr, "Error fixing PDF file: %s", e->message);
+ _tmp26_ = stderr;
+ _tmp27_ = e;
+ _tmp28_ = _tmp27_->message;
+ fprintf (_tmp26_, "Error fixing PDF file: %s", _tmp28_);
result = EXIT_FAILURE;
_g_error_free0 (e);
_g_option_context_free0 (c);
@@ -1573,40 +2155,62 @@ gint application_main (gchar** args, int args_length1) {
return result;
}
device = NULL;
- if (args_length1 > 1) {
- ScanDevice* _tmp5_ = NULL;
- gchar* _tmp6_;
- gchar* _tmp7_;
- _tmp5_ = scan_device_new ();
+ _tmp29_ = args;
+ _tmp29__length1 = args_length1;
+ if (_tmp29__length1 > 1) {
+ ScanDevice* _tmp30_;
+ ScanDevice* _tmp31_;
+ gchar** _tmp32_;
+ gint _tmp32__length1;
+ const gchar* _tmp33_;
+ gchar* _tmp34_;
+ ScanDevice* _tmp35_;
+ gchar** _tmp36_;
+ gint _tmp36__length1;
+ const gchar* _tmp37_;
+ gchar* _tmp38_;
+ _tmp30_ = scan_device_new ();
_scan_device_unref0 (device);
- device = _tmp5_;
- _tmp6_ = g_strdup (args[1]);
- _g_free0 (device->name);
- device->name = _tmp6_;
- _tmp7_ = g_strdup (args[1]);
- _g_free0 (device->label);
- device->label = _tmp7_;
+ device = _tmp30_;
+ _tmp31_ = device;
+ _tmp32_ = args;
+ _tmp32__length1 = args_length1;
+ _tmp33_ = _tmp32_[1];
+ _tmp34_ = g_strdup (_tmp33_);
+ _g_free0 (_tmp31_->name);
+ _tmp31_->name = _tmp34_;
+ _tmp35_ = device;
+ _tmp36_ = args;
+ _tmp36__length1 = args_length1;
+ _tmp37_ = _tmp36_[1];
+ _tmp38_ = g_strdup (_tmp37_);
+ _g_free0 (_tmp35_->label);
+ _tmp35_->label = _tmp38_;
}
- _tmp8_ = g_timer_new ();
+ _tmp39_ = g_timer_new ();
_g_timer_destroy0 (application_log_timer);
- application_log_timer = _tmp8_;
- _tmp9_ = g_get_user_cache_dir ();
- _tmp10_ = g_build_filename (_tmp9_, "simple-scan", NULL, NULL);
- path = _tmp10_;
- g_mkdir_with_parents (path, 0700);
- _tmp11_ = g_get_user_cache_dir ();
- _tmp12_ = g_build_filename (_tmp11_, "simple-scan", "simple-scan.log", NULL, NULL);
+ application_log_timer = _tmp39_;
+ _tmp40_ = g_get_user_cache_dir ();
+ _tmp41_ = g_build_filename (_tmp40_, "simple-scan", NULL, NULL);
+ path = _tmp41_;
+ _tmp42_ = path;
+ g_mkdir_with_parents (_tmp42_, 0700);
+ _tmp43_ = g_get_user_cache_dir ();
+ _tmp44_ = g_build_filename (_tmp43_, "simple-scan", "simple-scan.log", NULL, NULL);
_g_free0 (path);
- path = _tmp12_;
- _tmp13_ = fopen (path, "w");
+ path = _tmp44_;
+ _tmp45_ = path;
+ _tmp46_ = fopen (_tmp45_, "w");
_fclose0 (application_log_file);
- application_log_file = _tmp13_;
+ application_log_file = _tmp46_;
g_log_set_default_handler (_application_log_cb_glog_func, NULL);
- _tmp14_ = getpid ();
- g_debug ("simple-scan.vala:586: Starting Simple Scan %s, PID=%i", VERSION, (gint) _tmp14_);
- _tmp15_ = application_new (device);
- app = _tmp15_;
- application_start (app);
+ _tmp47_ = getpid ();
+ g_debug ("simple-scan.vala:586: Starting Simple Scan %s, PID=%i", VERSION, (gint) _tmp47_);
+ _tmp48_ = device;
+ _tmp49_ = application_new (_tmp48_);
+ app = _tmp49_;
+ _tmp50_ = app;
+ application_start (_tmp50_);
gtk_main ();
result = EXIT_SUCCESS;
_application_unref0 (app);