summaryrefslogtreecommitdiff
path: root/src/scanner.c
diff options
context:
space:
mode:
authorAlessio Treglia <alessio@debian.org>2013-05-13 08:57:50 +0100
committerAlessio Treglia <alessio@debian.org>2013-05-13 08:57:50 +0100
commit695f537db79b0921621b54998ae46f331fff9105 (patch)
treec848ed3ad33d66dd6d54172eff6075ab8a7ca87e /src/scanner.c
parentb99db4e5834bb8668c249bb7ce30af9a4d23527e (diff)
Imported Upstream version 3.6.1upstream/3.6.1
Diffstat (limited to 'src/scanner.c')
-rw-r--r--src/scanner.c66
1 files changed, 42 insertions, 24 deletions
diff --git a/src/scanner.c b/src/scanner.c
index 8319ee3..d564732 100644
--- a/src/scanner.c
+++ b/src/scanner.c
@@ -1,4 +1,4 @@
-/* scanner.c generated by valac 0.17.7, the Vala compiler
+/* scanner.c generated by valac 0.18.1, the Vala compiler
* generated from scanner.vala, do not modify */
/*
@@ -914,6 +914,9 @@ static void _scan_job_unref0_ (gpointer var);
static void _g_list_free__scan_job_unref0_ (GList* self);
static Scanner* scanner_new (void);
static Scanner* scanner_construct (GType object_type);
+static void _request_unref0_ (gpointer var);
+static void _notify_unref0_ (gpointer var);
+static void _credentials_unref0_ (gpointer var);
Scanner* scanner_get_instance (void);
static gboolean scanner_notify_idle_cb (Scanner* self);
static void scanner_notify (Scanner* self, Notify* notification);
@@ -3144,19 +3147,34 @@ static void _g_list_free__scan_job_unref0_ (GList* self) {
}
+static void _request_unref0_ (gpointer var) {
+ (var == NULL) ? NULL : (var = (request_unref (var), NULL));
+}
+
+
+static void _notify_unref0_ (gpointer var) {
+ (var == NULL) ? NULL : (var = (notify_unref (var), NULL));
+}
+
+
+static void _credentials_unref0_ (gpointer var) {
+ (var == NULL) ? NULL : (var = (credentials_unref (var), NULL));
+}
+
+
static Scanner* scanner_construct (GType object_type) {
Scanner* self = NULL;
GAsyncQueue* _tmp0_;
GAsyncQueue* _tmp1_;
GAsyncQueue* _tmp2_;
self = (Scanner*) g_type_create_instance (object_type);
- _tmp0_ = g_async_queue_new ();
+ _tmp0_ = g_async_queue_new_full (_request_unref0_);
_g_async_queue_unref0 (self->priv->request_queue);
self->priv->request_queue = _tmp0_;
- _tmp1_ = g_async_queue_new ();
+ _tmp1_ = g_async_queue_new_full (_notify_unref0_);
_g_async_queue_unref0 (self->priv->notify_queue);
self->priv->notify_queue = _tmp1_;
- _tmp2_ = g_async_queue_new ();
+ _tmp2_ = g_async_queue_new_full (_credentials_unref0_);
_g_async_queue_unref0 (self->priv->authorize_queue);
self->priv->authorize_queue = _tmp2_;
return self;
@@ -6001,7 +6019,7 @@ static void scanner_do_get_option (Scanner* self) {
_tmp64_ = adf_sources;
_tmp64__length1 = adf_sources_length1;
_tmp65_ = scanner_set_constrained_string_option (self, _tmp61_, _tmp62_, _tmp63_, _tmp64_, _tmp64__length1, NULL);
- if (!(!_tmp65_)) {
+ if (!_tmp65_) {
g_warning ("scanner.vala:894: Unable to set front ADF source, please file a bug");
}
}
@@ -6790,23 +6808,27 @@ static SANE_Option_Descriptor* scanner_get_option_by_name (Scanner* self, SANE_H
static void scanner_do_complete_document (Scanner* self) {
- GList* _tmp0_;
+ SANE_Handle _tmp0_;
GList* _tmp1_;
- NotifyDocumentDone* _tmp2_;
+ GList* _tmp2_;
NotifyDocumentDone* _tmp3_;
+ NotifyDocumentDone* _tmp4_;
g_return_if_fail (self != NULL);
- _tmp0_ = self->priv->job_queue;
- self->priv->job_queue = g_list_remove_link (self->priv->job_queue, _tmp0_);
- self->priv->state = SCAN_STATE_IDLE;
+ _tmp0_ = self->priv->handle;
+ sane_cancel (_tmp0_);
+ g_debug ("scanner.vala:1117: sane_cancel ()");
_tmp1_ = self->priv->job_queue;
- if (_tmp1_ != NULL) {
+ self->priv->job_queue = g_list_remove_link (self->priv->job_queue, _tmp1_);
+ self->priv->state = SCAN_STATE_IDLE;
+ _tmp2_ = self->priv->job_queue;
+ if (_tmp2_ != NULL) {
self->priv->state = SCAN_STATE_OPEN;
return;
}
- _tmp2_ = notify_document_done_new ();
- _tmp3_ = _tmp2_;
- scanner_notify (self, (Notify*) _tmp3_);
- _notify_unref0 (_tmp3_);
+ _tmp3_ = notify_document_done_new ();
+ _tmp4_ = _tmp3_;
+ scanner_notify (self, (Notify*) _tmp4_);
+ _notify_unref0 (_tmp4_);
scanner_set_scanning (self, FALSE);
}
@@ -6836,7 +6858,7 @@ static void scanner_do_start (Scanner* self) {
_tmp6_ = status;
_tmp7_ = sane_status_to_string (_tmp6_);
_tmp8_ = _tmp7_;
- g_debug ("scanner.vala:1141: sane_start (page=%d, pass=%d) -> %s", _tmp4_, _tmp5_, _tmp8_);
+ g_debug ("scanner.vala:1144: sane_start (page=%d, pass=%d) -> %s", _tmp4_, _tmp5_, _tmp8_);
_g_free0 (_tmp8_);
_tmp9_ = status;
if (_tmp9_ == SANE_STATUS_GOOD) {
@@ -6853,7 +6875,7 @@ static void scanner_do_start (Scanner* self) {
const gchar* _tmp14_ = NULL;
_tmp11_ = status;
_tmp12_ = sane_strstatus (_tmp11_);
- g_warning ("scanner.vala:1148: Unable to start device: %s", _tmp12_);
+ g_warning ("scanner.vala:1151: Unable to start device: %s", _tmp12_);
_tmp13_ = status;
_tmp14_ = _ ("Unable to start scan");
scanner_fail_scan (self, (gint) _tmp13_, _tmp14_);
@@ -6989,7 +7011,7 @@ static void scanner_do_get_parameters (Scanner* self) {
_tmp3_ = status;
_tmp4_ = sane_status_to_string (_tmp3_);
_tmp5_ = _tmp4_;
- g_debug ("scanner.vala:1158: sane_get_parameters () -> %s", _tmp5_);
+ g_debug ("scanner.vala:1161: sane_get_parameters () -> %s", _tmp5_);
_g_free0 (_tmp5_);
_tmp6_ = status;
if (_tmp6_ != SANE_STATUS_GOOD) {
@@ -6999,7 +7021,7 @@ static void scanner_do_get_parameters (Scanner* self) {
const gchar* _tmp10_ = NULL;
_tmp7_ = status;
_tmp8_ = sane_strstatus (_tmp7_);
- g_warning ("scanner.vala:1161: Unable to get device parameters: %s", _tmp8_);
+ g_warning ("scanner.vala:1164: Unable to get device parameters: %s", _tmp8_);
_tmp9_ = status;
_tmp10_ = _ ("Error communicating with scanner");
scanner_fail_scan (self, (gint) _tmp9_, _tmp10_);
@@ -7029,7 +7051,7 @@ static void scanner_do_get_parameters (Scanner* self) {
_tmp27_ = _tmp26_.lines;
_tmp28_ = self->priv->parameters;
_tmp29_ = _tmp28_.depth;
- g_debug ("scanner.vala:1170: Parameters: format=%s last_frame=%s bytes_per_line=" \
+ g_debug ("scanner.vala:1173: Parameters: format=%s last_frame=%s bytes_per_line=" \
"%d pixels_per_line=%d lines=%d depth=%d", _tmp20_, _tmp21_, _tmp23_, _tmp25_, _tmp27_, _tmp29_);
_g_free0 (_tmp20_);
_tmp30_ = scan_page_info_new ();
@@ -7156,7 +7178,6 @@ static void scanner_do_complete_page (Scanner* self) {
gboolean _tmp8_;
ScanJob* _tmp10_;
ScanType _tmp11_;
- SANE_Handle _tmp17_;
g_return_if_fail (self != NULL);
_tmp0_ = self->priv->job_queue;
_tmp1_ = _tmp0_->data;
@@ -7199,9 +7220,6 @@ static void scanner_do_complete_page (Scanner* self) {
_scan_job_unref0 (job);
return;
}
- _tmp17_ = self->priv->handle;
- sane_cancel (_tmp17_);
- g_debug ("scanner.vala:1230: sane_cancel ()");
scanner_do_complete_document (self);
_scan_job_unref0 (job);
}