diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-08-20 15:11:08 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-08-20 15:11:08 +0200 |
commit | cb612a12b952e349b96d427645aaeb55d15f509a (patch) | |
tree | f29298f41d2a7ea2a976616243aca64c2c2547ce /src/util | |
parent | e7be93745e4a2ff3aa255227bef7b9d3b733aafa (diff) | |
parent | 143bfc9f801c84428074312d661f8e08803df83b (diff) |
Merge tag 'upstream/0.23.5'
Upstream version 0.23.5
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/KeyValueMap.c | 1180 | ||||
-rw-r--r-- | src/util/Util.c | 31 | ||||
-rw-r--r-- | src/util/file.c | 1937 | ||||
-rw-r--r-- | src/util/image.c | 2701 | ||||
-rw-r--r-- | src/util/misc.c | 3137 | ||||
-rw-r--r-- | src/util/mk/util.mk | 34 | ||||
-rw-r--r-- | src/util/string.c | 2016 | ||||
-rw-r--r-- | src/util/system.c | 168 | ||||
-rw-r--r-- | src/util/ui.c | 405 |
9 files changed, 11575 insertions, 34 deletions
diff --git a/src/util/KeyValueMap.c b/src/util/KeyValueMap.c new file mode 100644 index 0000000..003f0ca --- /dev/null +++ b/src/util/KeyValueMap.c @@ -0,0 +1,1180 @@ +/* KeyValueMap.c generated by valac 0.32.1, the Vala compiler + * generated from KeyValueMap.vala, do not modify */ + +/* Copyright 2016 Software Freedom Conservancy Inc. + * + * This software is licensed under the GNU Lesser General Public License + * (version 2.1 or later). See the COPYING file in this distribution. + */ + +#include <glib.h> +#include <glib-object.h> +#include <stdlib.h> +#include <string.h> +#include <gee.h> +#include <float.h> +#include <math.h> +#include <gdk/gdk.h> +#include <stdio.h> +#include <gobject/gvaluecollector.h> + + +#define TYPE_KEY_VALUE_MAP (key_value_map_get_type ()) +#define KEY_VALUE_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_KEY_VALUE_MAP, KeyValueMap)) +#define KEY_VALUE_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_KEY_VALUE_MAP, KeyValueMapClass)) +#define IS_KEY_VALUE_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_KEY_VALUE_MAP)) +#define IS_KEY_VALUE_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_KEY_VALUE_MAP)) +#define KEY_VALUE_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_KEY_VALUE_MAP, KeyValueMapClass)) + +typedef struct _KeyValueMap KeyValueMap; +typedef struct _KeyValueMapClass KeyValueMapClass; +typedef struct _KeyValueMapPrivate KeyValueMapPrivate; +#define _g_free0(var) (var = (g_free (var), NULL)) +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +#define _key_value_map_unref0(var) ((var == NULL) ? NULL : (var = (key_value_map_unref (var), NULL))) +typedef struct _ParamSpecKeyValueMap ParamSpecKeyValueMap; +#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); +#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; } +#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; } +#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); + +struct _KeyValueMap { + GTypeInstance parent_instance; + volatile int ref_count; + KeyValueMapPrivate * priv; +}; + +struct _KeyValueMapClass { + GTypeClass parent_class; + void (*finalize) (KeyValueMap *self); +}; + +struct _KeyValueMapPrivate { + gchar* group; + GeeHashMap* map; +}; + +struct _ParamSpecKeyValueMap { + GParamSpec parent_instance; +}; + + +static gpointer key_value_map_parent_class = NULL; + +gpointer key_value_map_ref (gpointer instance); +void key_value_map_unref (gpointer instance); +GParamSpec* param_spec_key_value_map (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void value_set_key_value_map (GValue* value, gpointer v_object); +void value_take_key_value_map (GValue* value, gpointer v_object); +gpointer value_get_key_value_map (const GValue* value); +GType key_value_map_get_type (void) G_GNUC_CONST; +#define KEY_VALUE_MAP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_KEY_VALUE_MAP, KeyValueMapPrivate)) +enum { + KEY_VALUE_MAP_DUMMY_PROPERTY +}; +KeyValueMap* key_value_map_new (const gchar* group); +KeyValueMap* key_value_map_construct (GType object_type, const gchar* group); +KeyValueMap* key_value_map_copy (KeyValueMap* self); +gchar* key_value_map_get_group (KeyValueMap* self); +GeeSet* key_value_map_get_keys (KeyValueMap* self); +gboolean key_value_map_has_key (KeyValueMap* self, const gchar* key); +void key_value_map_set_string (KeyValueMap* self, const gchar* key, const gchar* value); +void key_value_map_set_int (KeyValueMap* self, const gchar* key, gint value); +void key_value_map_set_double (KeyValueMap* self, const gchar* key, gdouble value); +void key_value_map_set_float (KeyValueMap* self, const gchar* key, gfloat value); +void key_value_map_set_bool (KeyValueMap* self, const gchar* key, gboolean value); +gchar* key_value_map_get_string (KeyValueMap* self, const gchar* key, const gchar* def); +gint key_value_map_get_int (KeyValueMap* self, const gchar* key, gint def); +gdouble key_value_map_get_double (KeyValueMap* self, const gchar* key, gdouble def); +gfloat key_value_map_get_float (KeyValueMap* self, const gchar* key, gfloat def); +gboolean key_value_map_get_bool (KeyValueMap* self, const gchar* key, gboolean def); +void key_value_map_get_point (KeyValueMap* self, const gchar* key, GdkPoint* def, GdkPoint* result); +void key_value_map_set_point (KeyValueMap* self, const gchar* key, GdkPoint* point); +static void key_value_map_finalize (KeyValueMap* obj); + + +KeyValueMap* key_value_map_construct (GType object_type, const gchar* group) { + KeyValueMap* self = NULL; + const gchar* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; +#line 11 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_val_if_fail (group != NULL, NULL); +#line 11 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + self = (KeyValueMap*) g_type_create_instance (object_type); +#line 12 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp0_ = group; +#line 12 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp1_ = g_strdup (_tmp0_); +#line 12 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _g_free0 (self->priv->group); +#line 12 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + self->priv->group = _tmp1_; +#line 11 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + return self; +#line 115 "KeyValueMap.c" +} + + +KeyValueMap* key_value_map_new (const gchar* group) { +#line 11 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + return key_value_map_construct (TYPE_KEY_VALUE_MAP, group); +#line 122 "KeyValueMap.c" +} + + +KeyValueMap* key_value_map_copy (KeyValueMap* self) { + KeyValueMap* result = NULL; + KeyValueMap* clone = NULL; + const gchar* _tmp0_ = NULL; + KeyValueMap* _tmp1_ = NULL; +#line 15 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_val_if_fail (IS_KEY_VALUE_MAP (self), NULL); +#line 16 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp0_ = self->priv->group; +#line 16 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp1_ = key_value_map_new (_tmp0_); +#line 16 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + clone = _tmp1_; +#line 139 "KeyValueMap.c" + { + GeeIterator* _key_it = NULL; + GeeHashMap* _tmp2_ = NULL; + GeeSet* _tmp3_ = NULL; + GeeSet* _tmp4_ = NULL; + GeeSet* _tmp5_ = NULL; + GeeIterator* _tmp6_ = NULL; + GeeIterator* _tmp7_ = NULL; +#line 17 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp2_ = self->priv->map; +#line 17 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp3_ = gee_abstract_map_get_keys (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_MAP, GeeMap)); +#line 17 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp4_ = _tmp3_; +#line 17 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp5_ = _tmp4_; +#line 17 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp6_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GEE_TYPE_ITERABLE, GeeIterable)); +#line 17 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp7_ = _tmp6_; +#line 17 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _g_object_unref0 (_tmp5_); +#line 17 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _key_it = _tmp7_; +#line 17 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + while (TRUE) { +#line 166 "KeyValueMap.c" + GeeIterator* _tmp8_ = NULL; + gboolean _tmp9_ = FALSE; + gchar* key = NULL; + GeeIterator* _tmp10_ = NULL; + gpointer _tmp11_ = NULL; + KeyValueMap* _tmp12_ = NULL; + GeeHashMap* _tmp13_ = NULL; + const gchar* _tmp14_ = NULL; + GeeHashMap* _tmp15_ = NULL; + const gchar* _tmp16_ = NULL; + gpointer _tmp17_ = NULL; + gchar* _tmp18_ = NULL; +#line 17 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp8_ = _key_it; +#line 17 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp9_ = gee_iterator_next (_tmp8_); +#line 17 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + if (!_tmp9_) { +#line 17 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + break; +#line 187 "KeyValueMap.c" + } +#line 17 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp10_ = _key_it; +#line 17 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp11_ = gee_iterator_get (_tmp10_); +#line 17 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + key = (gchar*) _tmp11_; +#line 18 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp12_ = clone; +#line 18 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp13_ = _tmp12_->priv->map; +#line 18 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp14_ = key; +#line 18 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp15_ = self->priv->map; +#line 18 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp16_ = key; +#line 18 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp17_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp16_); +#line 18 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp18_ = (gchar*) _tmp17_; +#line 18 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp14_, _tmp18_); +#line 18 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _g_free0 (_tmp18_); +#line 17 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _g_free0 (key); +#line 215 "KeyValueMap.c" + } +#line 17 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _g_object_unref0 (_key_it); +#line 219 "KeyValueMap.c" + } +#line 20 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + result = clone; +#line 20 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + return result; +#line 225 "KeyValueMap.c" +} + + +gchar* key_value_map_get_group (KeyValueMap* self) { + gchar* result = NULL; + const gchar* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; +#line 23 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_val_if_fail (IS_KEY_VALUE_MAP (self), NULL); +#line 24 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp0_ = self->priv->group; +#line 24 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp1_ = g_strdup (_tmp0_); +#line 24 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + result = _tmp1_; +#line 24 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + return result; +#line 243 "KeyValueMap.c" +} + + +GeeSet* key_value_map_get_keys (KeyValueMap* self) { + GeeSet* result = NULL; + GeeHashMap* _tmp0_ = NULL; + GeeSet* _tmp1_ = NULL; + GeeSet* _tmp2_ = NULL; +#line 27 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_val_if_fail (IS_KEY_VALUE_MAP (self), NULL); +#line 28 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp0_ = self->priv->map; +#line 28 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp1_ = gee_abstract_map_get_keys (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_MAP, GeeMap)); +#line 28 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp2_ = _tmp1_; +#line 28 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + result = _tmp2_; +#line 28 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + return result; +#line 264 "KeyValueMap.c" +} + + +gboolean key_value_map_has_key (KeyValueMap* self, const gchar* key) { + gboolean result = FALSE; + GeeHashMap* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + gboolean _tmp2_ = FALSE; +#line 31 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_val_if_fail (IS_KEY_VALUE_MAP (self), FALSE); +#line 31 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_val_if_fail (key != NULL, FALSE); +#line 32 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp0_ = self->priv->map; +#line 32 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp1_ = key; +#line 32 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp2_ = gee_abstract_map_has_key (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp1_); +#line 32 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + result = _tmp2_; +#line 32 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + return result; +#line 287 "KeyValueMap.c" +} + + +void key_value_map_set_string (KeyValueMap* self, const gchar* key, const gchar* value) { + const gchar* _tmp0_ = NULL; + GeeHashMap* _tmp1_ = NULL; + const gchar* _tmp2_ = NULL; + const gchar* _tmp3_ = NULL; +#line 35 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_if_fail (IS_KEY_VALUE_MAP (self)); +#line 35 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_if_fail (key != NULL); +#line 35 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_if_fail (value != NULL); +#line 36 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp0_ = key; +#line 36 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _vala_assert (_tmp0_ != NULL, "key != null"); +#line 38 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp1_ = self->priv->map; +#line 38 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp2_ = key; +#line 38 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp3_ = value; +#line 38 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp2_, _tmp3_); +#line 314 "KeyValueMap.c" +} + + +void key_value_map_set_int (KeyValueMap* self, const gchar* key, gint value) { + const gchar* _tmp0_ = NULL; + GeeHashMap* _tmp1_ = NULL; + const gchar* _tmp2_ = NULL; + gint _tmp3_ = 0; + gchar* _tmp4_ = NULL; + gchar* _tmp5_ = NULL; +#line 41 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_if_fail (IS_KEY_VALUE_MAP (self)); +#line 41 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_if_fail (key != NULL); +#line 42 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp0_ = key; +#line 42 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _vala_assert (_tmp0_ != NULL, "key != null"); +#line 44 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp1_ = self->priv->map; +#line 44 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp2_ = key; +#line 44 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp3_ = value; +#line 44 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp4_ = g_strdup_printf ("%i", _tmp3_); +#line 44 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp5_ = _tmp4_; +#line 44 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp2_, _tmp5_); +#line 44 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _g_free0 (_tmp5_); +#line 347 "KeyValueMap.c" +} + + +static gchar* double_to_string (gdouble self) { + gchar* result = NULL; + gchar* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; + gint _tmp1__length1 = 0; + const gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; + gchar* _tmp4_ = NULL; +#line 863 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp0_ = g_new0 (gchar, G_ASCII_DTOSTR_BUF_SIZE); +#line 863 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp1_ = _tmp0_; +#line 863 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp1__length1 = G_ASCII_DTOSTR_BUF_SIZE; +#line 863 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp2_ = g_ascii_dtostr (_tmp1_, G_ASCII_DTOSTR_BUF_SIZE, self); +#line 863 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp3_ = g_strdup (_tmp2_); +#line 863 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp4_ = _tmp3_; +#line 863 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp1_ = (g_free (_tmp1_), NULL); +#line 863 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + result = _tmp4_; +#line 863 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + return result; +#line 377 "KeyValueMap.c" +} + + +void key_value_map_set_double (KeyValueMap* self, const gchar* key, gdouble value) { + const gchar* _tmp0_ = NULL; + GeeHashMap* _tmp1_ = NULL; + const gchar* _tmp2_ = NULL; + gdouble _tmp3_ = 0.0; + gchar* _tmp4_ = NULL; + gchar* _tmp5_ = NULL; +#line 47 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_if_fail (IS_KEY_VALUE_MAP (self)); +#line 47 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_if_fail (key != NULL); +#line 48 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp0_ = key; +#line 48 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _vala_assert (_tmp0_ != NULL, "key != null"); +#line 50 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp1_ = self->priv->map; +#line 50 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp2_ = key; +#line 50 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp3_ = value; +#line 50 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp4_ = double_to_string (_tmp3_); +#line 50 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp5_ = _tmp4_; +#line 50 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp2_, _tmp5_); +#line 50 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _g_free0 (_tmp5_); +#line 410 "KeyValueMap.c" +} + + +void key_value_map_set_float (KeyValueMap* self, const gchar* key, gfloat value) { + const gchar* _tmp0_ = NULL; + GeeHashMap* _tmp1_ = NULL; + const gchar* _tmp2_ = NULL; + gfloat _tmp3_ = 0.0F; + gchar* _tmp4_ = NULL; + gchar* _tmp5_ = NULL; +#line 53 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_if_fail (IS_KEY_VALUE_MAP (self)); +#line 53 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_if_fail (key != NULL); +#line 54 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp0_ = key; +#line 54 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _vala_assert (_tmp0_ != NULL, "key != null"); +#line 56 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp1_ = self->priv->map; +#line 56 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp2_ = key; +#line 56 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp3_ = value; +#line 56 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp4_ = g_strdup_printf ("%g", _tmp3_); +#line 56 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp5_ = _tmp4_; +#line 56 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp2_, _tmp5_); +#line 56 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _g_free0 (_tmp5_); +#line 443 "KeyValueMap.c" +} + + +static gchar* bool_to_string (gboolean self) { + gchar* result = NULL; +#line 37 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + if (self) { +#line 451 "KeyValueMap.c" + gchar* _tmp0_ = NULL; +#line 38 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp0_ = g_strdup ("true"); +#line 38 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + result = _tmp0_; +#line 38 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + return result; +#line 459 "KeyValueMap.c" + } else { + gchar* _tmp1_ = NULL; +#line 40 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp1_ = g_strdup ("false"); +#line 40 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + result = _tmp1_; +#line 40 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + return result; +#line 468 "KeyValueMap.c" + } +} + + +void key_value_map_set_bool (KeyValueMap* self, const gchar* key, gboolean value) { + const gchar* _tmp0_ = NULL; + GeeHashMap* _tmp1_ = NULL; + const gchar* _tmp2_ = NULL; + gboolean _tmp3_ = FALSE; + gchar* _tmp4_ = NULL; + gchar* _tmp5_ = NULL; +#line 59 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_if_fail (IS_KEY_VALUE_MAP (self)); +#line 59 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_if_fail (key != NULL); +#line 60 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp0_ = key; +#line 60 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _vala_assert (_tmp0_ != NULL, "key != null"); +#line 62 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp1_ = self->priv->map; +#line 62 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp2_ = key; +#line 62 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp3_ = value; +#line 62 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp4_ = bool_to_string (_tmp3_); +#line 62 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp5_ = _tmp4_; +#line 62 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp2_, _tmp5_); +#line 62 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _g_free0 (_tmp5_); +#line 502 "KeyValueMap.c" +} + + +gchar* key_value_map_get_string (KeyValueMap* self, const gchar* key, const gchar* def) { + gchar* result = NULL; + gchar* value = NULL; + GeeHashMap* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + gpointer _tmp2_ = NULL; + const gchar* _tmp3_ = NULL; + const gchar* _tmp4_ = NULL; + gchar* _tmp7_ = NULL; +#line 65 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_val_if_fail (IS_KEY_VALUE_MAP (self), NULL); +#line 65 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_val_if_fail (key != NULL, NULL); +#line 66 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp0_ = self->priv->map; +#line 66 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp1_ = key; +#line 66 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp2_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp1_); +#line 66 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + value = (gchar*) _tmp2_; +#line 68 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp4_ = value; +#line 68 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + if (_tmp4_ != NULL) { +#line 531 "KeyValueMap.c" + const gchar* _tmp5_ = NULL; +#line 68 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp5_ = value; +#line 68 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp3_ = _tmp5_; +#line 537 "KeyValueMap.c" + } else { + const gchar* _tmp6_ = NULL; +#line 68 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp6_ = def; +#line 68 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp3_ = _tmp6_; +#line 544 "KeyValueMap.c" + } +#line 68 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp7_ = g_strdup (_tmp3_); +#line 68 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + result = _tmp7_; +#line 68 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _g_free0 (value); +#line 68 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + return result; +#line 554 "KeyValueMap.c" +} + + +gint key_value_map_get_int (KeyValueMap* self, const gchar* key, gint def) { + gint result = 0; + gchar* value = NULL; + GeeHashMap* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + gpointer _tmp2_ = NULL; + gint _tmp3_ = 0; + const gchar* _tmp4_ = NULL; +#line 71 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_val_if_fail (IS_KEY_VALUE_MAP (self), 0); +#line 71 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_val_if_fail (key != NULL, 0); +#line 72 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp0_ = self->priv->map; +#line 72 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp1_ = key; +#line 72 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp2_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp1_); +#line 72 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + value = (gchar*) _tmp2_; +#line 74 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp4_ = value; +#line 74 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + if (_tmp4_ != NULL) { +#line 582 "KeyValueMap.c" + const gchar* _tmp5_ = NULL; + gint _tmp6_ = 0; +#line 74 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp5_ = value; +#line 74 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp6_ = atoi (_tmp5_); +#line 74 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp3_ = _tmp6_; +#line 591 "KeyValueMap.c" + } else { + gint _tmp7_ = 0; +#line 74 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp7_ = def; +#line 74 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp3_ = _tmp7_; +#line 598 "KeyValueMap.c" + } +#line 74 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + result = _tmp3_; +#line 74 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _g_free0 (value); +#line 74 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + return result; +#line 606 "KeyValueMap.c" +} + + +static gdouble double_parse (const gchar* str) { + gdouble result = 0.0; + const gchar* _tmp0_ = NULL; + gdouble _tmp1_ = 0.0; +#line 869 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + g_return_val_if_fail (str != NULL, 0.0); +#line 870 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp0_ = str; +#line 870 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp1_ = g_ascii_strtod (_tmp0_, NULL); +#line 870 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + result = _tmp1_; +#line 870 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + return result; +#line 624 "KeyValueMap.c" +} + + +gdouble key_value_map_get_double (KeyValueMap* self, const gchar* key, gdouble def) { + gdouble result = 0.0; + gchar* value = NULL; + GeeHashMap* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + gpointer _tmp2_ = NULL; + gdouble _tmp3_ = 0.0; + const gchar* _tmp4_ = NULL; +#line 77 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_val_if_fail (IS_KEY_VALUE_MAP (self), 0.0); +#line 77 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_val_if_fail (key != NULL, 0.0); +#line 78 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp0_ = self->priv->map; +#line 78 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp1_ = key; +#line 78 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp2_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp1_); +#line 78 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + value = (gchar*) _tmp2_; +#line 80 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp4_ = value; +#line 80 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + if (_tmp4_ != NULL) { +#line 652 "KeyValueMap.c" + const gchar* _tmp5_ = NULL; + gdouble _tmp6_ = 0.0; +#line 80 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp5_ = value; +#line 80 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp6_ = double_parse (_tmp5_); +#line 80 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp3_ = _tmp6_; +#line 661 "KeyValueMap.c" + } else { + gdouble _tmp7_ = 0.0; +#line 80 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp7_ = def; +#line 80 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp3_ = _tmp7_; +#line 668 "KeyValueMap.c" + } +#line 80 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + result = _tmp3_; +#line 80 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _g_free0 (value); +#line 80 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + return result; +#line 676 "KeyValueMap.c" +} + + +gfloat key_value_map_get_float (KeyValueMap* self, const gchar* key, gfloat def) { + gfloat result = 0.0F; + gchar* value = NULL; + GeeHashMap* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + gpointer _tmp2_ = NULL; + gfloat _tmp3_ = 0.0F; + const gchar* _tmp4_ = NULL; +#line 83 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_val_if_fail (IS_KEY_VALUE_MAP (self), 0.0F); +#line 83 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_val_if_fail (key != NULL, 0.0F); +#line 84 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp0_ = self->priv->map; +#line 84 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp1_ = key; +#line 84 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp2_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp1_); +#line 84 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + value = (gchar*) _tmp2_; +#line 86 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp4_ = value; +#line 86 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + if (_tmp4_ != NULL) { +#line 704 "KeyValueMap.c" + const gchar* _tmp5_ = NULL; + gdouble _tmp6_ = 0.0; +#line 86 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp5_ = value; +#line 86 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp6_ = double_parse (_tmp5_); +#line 86 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp3_ = (gfloat) _tmp6_; +#line 713 "KeyValueMap.c" + } else { + gfloat _tmp7_ = 0.0F; +#line 86 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp7_ = def; +#line 86 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp3_ = _tmp7_; +#line 720 "KeyValueMap.c" + } +#line 86 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + result = _tmp3_; +#line 86 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _g_free0 (value); +#line 86 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + return result; +#line 728 "KeyValueMap.c" +} + + +static gboolean bool_parse (const gchar* str) { + gboolean result = FALSE; + const gchar* _tmp0_ = NULL; +#line 44 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + g_return_val_if_fail (str != NULL, FALSE); +#line 45 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp0_ = str; +#line 45 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + if (g_strcmp0 (_tmp0_, "true") == 0) { +#line 46 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + result = TRUE; +#line 46 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + return result; +#line 745 "KeyValueMap.c" + } else { +#line 48 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + result = FALSE; +#line 48 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + return result; +#line 751 "KeyValueMap.c" + } +} + + +gboolean key_value_map_get_bool (KeyValueMap* self, const gchar* key, gboolean def) { + gboolean result = FALSE; + gchar* value = NULL; + GeeHashMap* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + gpointer _tmp2_ = NULL; + gboolean _tmp3_ = FALSE; + const gchar* _tmp4_ = NULL; +#line 89 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_val_if_fail (IS_KEY_VALUE_MAP (self), FALSE); +#line 89 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_val_if_fail (key != NULL, FALSE); +#line 90 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp0_ = self->priv->map; +#line 90 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp1_ = key; +#line 90 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp2_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp1_); +#line 90 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + value = (gchar*) _tmp2_; +#line 92 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp4_ = value; +#line 92 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + if (_tmp4_ != NULL) { +#line 780 "KeyValueMap.c" + const gchar* _tmp5_ = NULL; + gboolean _tmp6_ = FALSE; +#line 92 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp5_ = value; +#line 92 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp6_ = bool_parse (_tmp5_); +#line 92 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp3_ = _tmp6_; +#line 789 "KeyValueMap.c" + } else { + gboolean _tmp7_ = FALSE; +#line 92 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp7_ = def; +#line 92 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp3_ = _tmp7_; +#line 796 "KeyValueMap.c" + } +#line 92 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + result = _tmp3_; +#line 92 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _g_free0 (value); +#line 92 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + return result; +#line 804 "KeyValueMap.c" +} + + +void key_value_map_get_point (KeyValueMap* self, const gchar* key, GdkPoint* def, GdkPoint* result) { + gchar* value = NULL; + GeeHashMap* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + gpointer _tmp2_ = NULL; + const gchar* _tmp3_ = NULL; +#line 100 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_if_fail (IS_KEY_VALUE_MAP (self)); +#line 100 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_if_fail (key != NULL); +#line 100 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_if_fail (def != NULL); +#line 101 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp0_ = self->priv->map; +#line 101 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp1_ = key; +#line 101 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp2_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp1_); +#line 101 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + value = (gchar*) _tmp2_; +#line 103 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp3_ = value; +#line 103 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + if (_tmp3_ == NULL) { +#line 832 "KeyValueMap.c" + GdkPoint _tmp4_ = {0}; +#line 104 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp4_ = *def; +#line 104 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + *result = _tmp4_; +#line 104 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _g_free0 (value); +#line 104 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + return; +#line 842 "KeyValueMap.c" + } else { + GdkPoint _result_ = {0}; + GdkPoint _tmp5_ = {0}; + const gchar* _tmp6_ = NULL; + gint _tmp7_ = 0; +#line 106 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp5_.x = 0; +#line 106 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _result_ = _tmp5_; +#line 107 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp6_ = value; +#line 107 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp7_ = sscanf (_tmp6_, "(%d, %d)", &_result_.x, &_result_.y); +#line 107 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + if (_tmp7_ == 2) { +#line 108 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + *result = _result_; +#line 108 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _g_free0 (value); +#line 108 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + return; +#line 864 "KeyValueMap.c" + } else { + GdkPoint _tmp8_ = {0}; +#line 110 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp8_ = *def; +#line 110 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + *result = _tmp8_; +#line 110 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _g_free0 (value); +#line 110 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + return; +#line 875 "KeyValueMap.c" + } + } +#line 100 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _g_free0 (value); +#line 880 "KeyValueMap.c" +} + + +void key_value_map_set_point (KeyValueMap* self, const gchar* key, GdkPoint* point) { + GeeHashMap* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + GdkPoint _tmp2_ = {0}; + gint _tmp3_ = 0; + GdkPoint _tmp4_ = {0}; + gint _tmp5_ = 0; + gchar* _tmp6_ = NULL; + gchar* _tmp7_ = NULL; +#line 114 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_if_fail (IS_KEY_VALUE_MAP (self)); +#line 114 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_if_fail (key != NULL); +#line 114 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_if_fail (point != NULL); +#line 115 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp0_ = self->priv->map; +#line 115 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp1_ = key; +#line 115 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp2_ = *point; +#line 115 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp3_ = _tmp2_.x; +#line 115 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp4_ = *point; +#line 115 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp5_ = _tmp4_.y; +#line 115 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp6_ = g_strdup_printf ("(%d, %d)", _tmp3_, _tmp5_); +#line 115 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp7_ = _tmp6_; +#line 115 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp1_, _tmp7_); +#line 115 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _g_free0 (_tmp7_); +#line 919 "KeyValueMap.c" +} + + +static void value_key_value_map_init (GValue* value) { +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + value->data[0].v_pointer = NULL; +#line 926 "KeyValueMap.c" +} + + +static void value_key_value_map_free_value (GValue* value) { +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + if (value->data[0].v_pointer) { +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + key_value_map_unref (value->data[0].v_pointer); +#line 935 "KeyValueMap.c" + } +} + + +static void value_key_value_map_copy_value (const GValue* src_value, GValue* dest_value) { +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + if (src_value->data[0].v_pointer) { +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + dest_value->data[0].v_pointer = key_value_map_ref (src_value->data[0].v_pointer); +#line 945 "KeyValueMap.c" + } else { +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + dest_value->data[0].v_pointer = NULL; +#line 949 "KeyValueMap.c" + } +} + + +static gpointer value_key_value_map_peek_pointer (const GValue* value) { +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + return value->data[0].v_pointer; +#line 957 "KeyValueMap.c" +} + + +static gchar* value_key_value_map_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + if (collect_values[0].v_pointer) { +#line 964 "KeyValueMap.c" + KeyValueMap* object; + object = collect_values[0].v_pointer; +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + if (object->parent_instance.g_class == NULL) { +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); +#line 971 "KeyValueMap.c" + } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) { +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); +#line 975 "KeyValueMap.c" + } +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + value->data[0].v_pointer = key_value_map_ref (object); +#line 979 "KeyValueMap.c" + } else { +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + value->data[0].v_pointer = NULL; +#line 983 "KeyValueMap.c" + } +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + return NULL; +#line 987 "KeyValueMap.c" +} + + +static gchar* value_key_value_map_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { + KeyValueMap** object_p; + object_p = collect_values[0].v_pointer; +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + if (!object_p) { +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value)); +#line 998 "KeyValueMap.c" + } +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + if (!value->data[0].v_pointer) { +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + *object_p = NULL; +#line 1004 "KeyValueMap.c" + } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) { +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + *object_p = value->data[0].v_pointer; +#line 1008 "KeyValueMap.c" + } else { +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + *object_p = key_value_map_ref (value->data[0].v_pointer); +#line 1012 "KeyValueMap.c" + } +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + return NULL; +#line 1016 "KeyValueMap.c" +} + + +GParamSpec* param_spec_key_value_map (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) { + ParamSpecKeyValueMap* spec; +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_val_if_fail (g_type_is_a (object_type, TYPE_KEY_VALUE_MAP), NULL); +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags); +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + G_PARAM_SPEC (spec)->value_type = object_type; +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + return G_PARAM_SPEC (spec); +#line 1030 "KeyValueMap.c" +} + + +gpointer value_get_key_value_map (const GValue* value) { +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_KEY_VALUE_MAP), NULL); +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + return value->data[0].v_pointer; +#line 1039 "KeyValueMap.c" +} + + +void value_set_key_value_map (GValue* value, gpointer v_object) { + KeyValueMap* old; +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_KEY_VALUE_MAP)); +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + old = value->data[0].v_pointer; +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + if (v_object) { +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_KEY_VALUE_MAP)); +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + value->data[0].v_pointer = v_object; +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + key_value_map_ref (value->data[0].v_pointer); +#line 1059 "KeyValueMap.c" + } else { +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + value->data[0].v_pointer = NULL; +#line 1063 "KeyValueMap.c" + } +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + if (old) { +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + key_value_map_unref (old); +#line 1069 "KeyValueMap.c" + } +} + + +void value_take_key_value_map (GValue* value, gpointer v_object) { + KeyValueMap* old; +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_KEY_VALUE_MAP)); +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + old = value->data[0].v_pointer; +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + if (v_object) { +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_KEY_VALUE_MAP)); +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + value->data[0].v_pointer = v_object; +#line 1088 "KeyValueMap.c" + } else { +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + value->data[0].v_pointer = NULL; +#line 1092 "KeyValueMap.c" + } +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + if (old) { +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + key_value_map_unref (old); +#line 1098 "KeyValueMap.c" + } +} + + +static void key_value_map_class_init (KeyValueMapClass * klass) { +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + key_value_map_parent_class = g_type_class_peek_parent (klass); +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + ((KeyValueMapClass *) klass)->finalize = key_value_map_finalize; +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_type_class_add_private (klass, sizeof (KeyValueMapPrivate)); +#line 1110 "KeyValueMap.c" +} + + +static void key_value_map_instance_init (KeyValueMap * self) { + GeeHashMap* _tmp0_ = NULL; +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + self->priv = KEY_VALUE_MAP_GET_PRIVATE (self); +#line 9 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +#line 9 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + self->priv->map = _tmp0_; +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + self->ref_count = 1; +#line 1124 "KeyValueMap.c" +} + + +static void key_value_map_finalize (KeyValueMap* obj) { + KeyValueMap * self; +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_KEY_VALUE_MAP, KeyValueMap); +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_signal_handlers_destroy (self); +#line 8 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _g_free0 (self->priv->group); +#line 9 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + _g_object_unref0 (self->priv->map); +#line 1138 "KeyValueMap.c" +} + + +GType key_value_map_get_type (void) { + static volatile gsize key_value_map_type_id__volatile = 0; + if (g_once_init_enter (&key_value_map_type_id__volatile)) { + static const GTypeValueTable g_define_type_value_table = { value_key_value_map_init, value_key_value_map_free_value, value_key_value_map_copy_value, value_key_value_map_peek_pointer, "p", value_key_value_map_collect_value, "p", value_key_value_map_lcopy_value }; + static const GTypeInfo g_define_type_info = { sizeof (KeyValueMapClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) key_value_map_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (KeyValueMap), 0, (GInstanceInitFunc) key_value_map_instance_init, &g_define_type_value_table }; + static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) }; + GType key_value_map_type_id; + key_value_map_type_id = g_type_register_fundamental (g_type_fundamental_next (), "KeyValueMap", &g_define_type_info, &g_define_type_fundamental_info, 0); + g_once_init_leave (&key_value_map_type_id__volatile, key_value_map_type_id); + } + return key_value_map_type_id__volatile; +} + + +gpointer key_value_map_ref (gpointer instance) { + KeyValueMap* self; + self = instance; +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_atomic_int_inc (&self->ref_count); +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + return instance; +#line 1163 "KeyValueMap.c" +} + + +void key_value_map_unref (gpointer instance) { + KeyValueMap* self; + self = instance; +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + if (g_atomic_int_dec_and_test (&self->ref_count)) { +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + KEY_VALUE_MAP_GET_CLASS (self)->finalize (self); +#line 7 "/home/jens/Source/shotwell/src/util/KeyValueMap.vala" + g_type_free_instance ((GTypeInstance *) self); +#line 1176 "KeyValueMap.c" + } +} + + + diff --git a/src/util/Util.c b/src/util/Util.c new file mode 100644 index 0000000..ec9f4ff --- /dev/null +++ b/src/util/Util.c @@ -0,0 +1,31 @@ +/* Util.c generated by valac 0.32.1, the Vala compiler + * generated from Util.vala, do not modify */ + +/* Copyright 2016 Software Freedom Conservancy Inc. + * + * This software is licensed under the GNU Lesser General Public License + * (version 2.1 or later). See the COPYING file in this distribution. + */ + +#include <glib.h> +#include <glib-object.h> +#include <stdlib.h> +#include <string.h> + + + + +#define UTIL_FILE_ATTRIBUTES "standard::*,time::*,id::file,id::filesystem,etag::value" +void util_init (GError** error); +void util_terminate (void); + + +void util_init (GError** error) { +} + + +void util_terminate (void) { +} + + + diff --git a/src/util/file.c b/src/util/file.c new file mode 100644 index 0000000..b219fd2 --- /dev/null +++ b/src/util/file.c @@ -0,0 +1,1937 @@ +/* file.c generated by valac 0.32.1, the Vala compiler + * generated from file.vala, do not modify */ + +/* Copyright 2016 Software Freedom Conservancy Inc. + * + * This software is licensed under the GNU Lesser General Public License + * (version 2.1 or later). See the COPYING file in this distribution. + */ +/* Returns true if the file is claimed, false if it exists, and throws an Error otherwise. The file*/ +/* will be created when the function exits and should be overwritten. Note that the file is not*/ +/* held open; claiming a file is merely based on its existence.*/ +/**/ +/* This function is thread-safe.*/ + +#include <glib.h> +#include <glib-object.h> +#include <gio/gio.h> +#include <stdlib.h> +#include <string.h> +#include <gee.h> +#include <time.h> + +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +#define _g_free0(var) (var = (g_free (var), NULL)) +#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) + +typedef gboolean (*ProgressMonitor) (guint64 current, guint64 total, gboolean do_event_loop, void* user_data); + + +gboolean claim_file (GFile* file, GError** error); +GFile* generate_unique_file (GFile* dir, const gchar* basename, gboolean* collision, GError** error); +void disassemble_filename (const gchar* basename, gchar** name, gchar** ext); +glong find_last_offset (const gchar* str, gchar c); +guint64 query_total_file_size (GFile* file_or_dir, GCancellable* cancellable, GError** error); +void delete_all_files (GFile* dir, GeeSet* exceptions, ProgressMonitor monitor, void* monitor_target, guint64 file_count, GCancellable* cancellable, GError** error); +time_t query_file_modified (GFile* file, GError** error); +gboolean query_is_directory (GFile* file); +gboolean query_is_directory_empty (GFile* dir, GError** error); +gchar* get_display_pathname (GFile* file); +gchar* strip_pretty_path (const gchar* path); +gchar* get_file_info_id (GFileInfo* info); +void skip_uint64 (GInputStream* input, guint64 skip_amount, GError** error); +guint64 count_files_in_directory (GFile* dir, GError** error); +gboolean file_equal (GFile* a, GFile* b); +guint file_hash (GFile* file); + + +static gpointer _g_error_copy0 (gpointer self) { +#line 23 "/home/jens/Source/shotwell/src/util/file.vala" + return self ? g_error_copy (self) : NULL; +#line 52 "file.c" +} + + +gboolean claim_file (GFile* file, GError** error) { + gboolean result = FALSE; + GError * _inner_error_ = NULL; +#line 12 "/home/jens/Source/shotwell/src/util/file.vala" + g_return_val_if_fail (G_IS_FILE (file), FALSE); +#line 61 "file.c" + { + GFile* _tmp0_ = NULL; + GFileOutputStream* _tmp1_ = NULL; + GFileOutputStream* _tmp2_ = NULL; +#line 14 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp0_ = file; +#line 14 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp1_ = g_file_create (_tmp0_, G_FILE_CREATE_NONE, NULL, &_inner_error_); +#line 14 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp2_ = _tmp1_; +#line 14 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (_tmp2_); +#line 14 "/home/jens/Source/shotwell/src/util/file.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 76 "file.c" + goto __catch0_g_error; + } +#line 17 "/home/jens/Source/shotwell/src/util/file.vala" + result = TRUE; +#line 17 "/home/jens/Source/shotwell/src/util/file.vala" + return result; +#line 83 "file.c" + } + goto __finally0; + __catch0_g_error: + { + GError* err = NULL; + GError* _tmp3_ = NULL; +#line 13 "/home/jens/Source/shotwell/src/util/file.vala" + err = _inner_error_; +#line 13 "/home/jens/Source/shotwell/src/util/file.vala" + _inner_error_ = NULL; +#line 20 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp3_ = err; +#line 20 "/home/jens/Source/shotwell/src/util/file.vala" + if (!g_error_matches (_tmp3_, G_IO_ERROR, G_IO_ERROR_EXISTS)) { +#line 98 "file.c" + GFile* _tmp4_ = NULL; + gchar* _tmp5_ = NULL; + gchar* _tmp6_ = NULL; + GError* _tmp7_ = NULL; + const gchar* _tmp8_ = NULL; + GError* _tmp9_ = NULL; + GError* _tmp10_ = NULL; +#line 21 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp4_ = file; +#line 21 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp5_ = g_file_get_path (_tmp4_); +#line 21 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp6_ = _tmp5_; +#line 21 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp7_ = err; +#line 21 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp8_ = _tmp7_->message; +#line 21 "/home/jens/Source/shotwell/src/util/file.vala" + g_warning ("file.vala:21: claim_file %s: %s", _tmp6_, _tmp8_); +#line 21 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (_tmp6_); +#line 23 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp9_ = err; +#line 23 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp10_ = _g_error_copy0 (_tmp9_); +#line 23 "/home/jens/Source/shotwell/src/util/file.vala" + _inner_error_ = _tmp10_; +#line 23 "/home/jens/Source/shotwell/src/util/file.vala" + _g_error_free0 (err); +#line 128 "file.c" + goto __finally0; + } +#line 26 "/home/jens/Source/shotwell/src/util/file.vala" + result = FALSE; +#line 26 "/home/jens/Source/shotwell/src/util/file.vala" + _g_error_free0 (err); +#line 26 "/home/jens/Source/shotwell/src/util/file.vala" + return result; +#line 137 "file.c" + } + __finally0: +#line 13 "/home/jens/Source/shotwell/src/util/file.vala" + g_propagate_error (error, _inner_error_); +#line 13 "/home/jens/Source/shotwell/src/util/file.vala" + return FALSE; +#line 144 "file.c" +} + + +GFile* generate_unique_file (GFile* dir, const gchar* basename, gboolean* collision, GError** error) { + gboolean _vala_collision = FALSE; + GFile* result = NULL; + GFile* file = NULL; + GFile* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + GFile* _tmp2_ = NULL; + gboolean _tmp3_ = FALSE; + GFile* _tmp4_ = NULL; + gboolean _tmp5_ = FALSE; + gchar* name = NULL; + gchar* ext = NULL; + const gchar* _tmp6_ = NULL; + gchar* _tmp7_ = NULL; + gchar* _tmp8_ = NULL; + GFile* _tmp28_ = NULL; + gchar* _tmp29_ = NULL; + gchar* _tmp30_ = NULL; + const gchar* _tmp31_ = NULL; + GError * _inner_error_ = NULL; +#line 36 "/home/jens/Source/shotwell/src/util/file.vala" + g_return_val_if_fail (G_IS_FILE (dir), NULL); +#line 36 "/home/jens/Source/shotwell/src/util/file.vala" + g_return_val_if_fail (basename != NULL, NULL); +#line 38 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp0_ = dir; +#line 38 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp1_ = basename; +#line 38 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp2_ = g_file_get_child (_tmp0_, _tmp1_); +#line 38 "/home/jens/Source/shotwell/src/util/file.vala" + file = _tmp2_; +#line 39 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp4_ = file; +#line 39 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp5_ = claim_file (_tmp4_, &_inner_error_); +#line 39 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp3_ = _tmp5_; +#line 39 "/home/jens/Source/shotwell/src/util/file.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 39 "/home/jens/Source/shotwell/src/util/file.vala" + g_propagate_error (error, _inner_error_); +#line 39 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (file); +#line 39 "/home/jens/Source/shotwell/src/util/file.vala" + return NULL; +#line 194 "file.c" + } +#line 39 "/home/jens/Source/shotwell/src/util/file.vala" + if (_tmp3_) { +#line 40 "/home/jens/Source/shotwell/src/util/file.vala" + _vala_collision = FALSE; +#line 42 "/home/jens/Source/shotwell/src/util/file.vala" + result = file; +#line 42 "/home/jens/Source/shotwell/src/util/file.vala" + if (collision) { +#line 42 "/home/jens/Source/shotwell/src/util/file.vala" + *collision = _vala_collision; +#line 206 "file.c" + } +#line 42 "/home/jens/Source/shotwell/src/util/file.vala" + return result; +#line 210 "file.c" + } +#line 46 "/home/jens/Source/shotwell/src/util/file.vala" + _vala_collision = TRUE; +#line 49 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp6_ = basename; +#line 49 "/home/jens/Source/shotwell/src/util/file.vala" + disassemble_filename (_tmp6_, &_tmp7_, &_tmp8_); +#line 49 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (name); +#line 49 "/home/jens/Source/shotwell/src/util/file.vala" + name = _tmp7_; +#line 49 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (ext); +#line 49 "/home/jens/Source/shotwell/src/util/file.vala" + ext = _tmp8_; +#line 226 "file.c" + { + gint ctr = 0; +#line 52 "/home/jens/Source/shotwell/src/util/file.vala" + ctr = 1; +#line 231 "file.c" + { + gboolean _tmp9_ = FALSE; +#line 52 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp9_ = TRUE; +#line 52 "/home/jens/Source/shotwell/src/util/file.vala" + while (TRUE) { +#line 238 "file.c" + gint _tmp11_ = 0; + gchar* _tmp12_ = NULL; + const gchar* _tmp13_ = NULL; + gchar* new_name = NULL; + gchar* _tmp21_ = NULL; + GFile* _tmp22_ = NULL; + const gchar* _tmp23_ = NULL; + GFile* _tmp24_ = NULL; + gboolean _tmp25_ = FALSE; + GFile* _tmp26_ = NULL; + gboolean _tmp27_ = FALSE; +#line 52 "/home/jens/Source/shotwell/src/util/file.vala" + if (!_tmp9_) { +#line 252 "file.c" + gint _tmp10_ = 0; +#line 52 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp10_ = ctr; +#line 52 "/home/jens/Source/shotwell/src/util/file.vala" + ctr = _tmp10_ + 1; +#line 258 "file.c" + } +#line 52 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp9_ = FALSE; +#line 52 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp11_ = ctr; +#line 52 "/home/jens/Source/shotwell/src/util/file.vala" + if (!(_tmp11_ < G_MAXINT)) { +#line 52 "/home/jens/Source/shotwell/src/util/file.vala" + break; +#line 268 "file.c" + } +#line 53 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp13_ = ext; +#line 53 "/home/jens/Source/shotwell/src/util/file.vala" + if (_tmp13_ != NULL) { +#line 274 "file.c" + const gchar* _tmp14_ = NULL; + gint _tmp15_ = 0; + const gchar* _tmp16_ = NULL; + gchar* _tmp17_ = NULL; +#line 53 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp14_ = name; +#line 53 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp15_ = ctr; +#line 53 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp16_ = ext; +#line 53 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp17_ = g_strdup_printf ("%s_%d.%s", _tmp14_, _tmp15_, _tmp16_); +#line 53 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (_tmp12_); +#line 53 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp12_ = _tmp17_; +#line 291 "file.c" + } else { + const gchar* _tmp18_ = NULL; + gint _tmp19_ = 0; + gchar* _tmp20_ = NULL; +#line 53 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp18_ = name; +#line 53 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp19_ = ctr; +#line 53 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp20_ = g_strdup_printf ("%s_%d", _tmp18_, _tmp19_); +#line 53 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (_tmp12_); +#line 53 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp12_ = _tmp20_; +#line 306 "file.c" + } +#line 53 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp21_ = g_strdup (_tmp12_); +#line 53 "/home/jens/Source/shotwell/src/util/file.vala" + new_name = _tmp21_; +#line 55 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp22_ = dir; +#line 55 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp23_ = new_name; +#line 55 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp24_ = g_file_get_child (_tmp22_, _tmp23_); +#line 55 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (file); +#line 55 "/home/jens/Source/shotwell/src/util/file.vala" + file = _tmp24_; +#line 56 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp26_ = file; +#line 56 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp27_ = claim_file (_tmp26_, &_inner_error_); +#line 56 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp25_ = _tmp27_; +#line 56 "/home/jens/Source/shotwell/src/util/file.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 56 "/home/jens/Source/shotwell/src/util/file.vala" + g_propagate_error (error, _inner_error_); +#line 56 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (new_name); +#line 56 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (_tmp12_); +#line 56 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (ext); +#line 56 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (name); +#line 56 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (file); +#line 56 "/home/jens/Source/shotwell/src/util/file.vala" + return NULL; +#line 344 "file.c" + } +#line 56 "/home/jens/Source/shotwell/src/util/file.vala" + if (_tmp25_) { +#line 57 "/home/jens/Source/shotwell/src/util/file.vala" + result = file; +#line 57 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (new_name); +#line 57 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (_tmp12_); +#line 57 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (ext); +#line 57 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (name); +#line 57 "/home/jens/Source/shotwell/src/util/file.vala" + if (collision) { +#line 57 "/home/jens/Source/shotwell/src/util/file.vala" + *collision = _vala_collision; +#line 362 "file.c" + } +#line 57 "/home/jens/Source/shotwell/src/util/file.vala" + return result; +#line 366 "file.c" + } +#line 52 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (new_name); +#line 52 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (_tmp12_); +#line 372 "file.c" + } + } + } +#line 60 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp28_ = dir; +#line 60 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp29_ = g_file_get_path (_tmp28_); +#line 60 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp30_ = _tmp29_; +#line 60 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp31_ = basename; +#line 60 "/home/jens/Source/shotwell/src/util/file.vala" + g_warning ("file.vala:60: generate_unique_filename %s for %s: unable to claim file", _tmp30_, _tmp31_); +#line 60 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (_tmp30_); +#line 62 "/home/jens/Source/shotwell/src/util/file.vala" + result = NULL; +#line 62 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (ext); +#line 62 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (name); +#line 62 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (file); +#line 62 "/home/jens/Source/shotwell/src/util/file.vala" + if (collision) { +#line 62 "/home/jens/Source/shotwell/src/util/file.vala" + *collision = _vala_collision; +#line 400 "file.c" + } +#line 62 "/home/jens/Source/shotwell/src/util/file.vala" + return result; +#line 404 "file.c" +} + + +static glong string_strnlen (gchar* str, glong maxlen) { + glong result = 0L; + gchar* end = NULL; + gchar* _tmp0_ = NULL; + glong _tmp1_ = 0L; + gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; +#line 1295 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp0_ = str; +#line 1295 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp1_ = maxlen; +#line 1295 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp2_ = memchr (_tmp0_, 0, (gsize) _tmp1_); +#line 1295 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + end = _tmp2_; +#line 1296 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp3_ = end; +#line 1296 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + if (_tmp3_ == NULL) { +#line 427 "file.c" + glong _tmp4_ = 0L; +#line 1297 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp4_ = maxlen; +#line 1297 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + result = _tmp4_; +#line 1297 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + return result; +#line 435 "file.c" + } else { + gchar* _tmp5_ = NULL; + gchar* _tmp6_ = NULL; +#line 1299 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp5_ = end; +#line 1299 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp6_ = str; +#line 1299 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + result = (glong) (_tmp5_ - _tmp6_); +#line 1299 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + return result; +#line 447 "file.c" + } +} + + +static gchar* string_substring (const gchar* self, glong offset, glong len) { + gchar* result = NULL; + glong string_length = 0L; + gboolean _tmp0_ = FALSE; + glong _tmp1_ = 0L; + glong _tmp8_ = 0L; + glong _tmp14_ = 0L; + glong _tmp17_ = 0L; + glong _tmp18_ = 0L; + glong _tmp19_ = 0L; + glong _tmp20_ = 0L; + glong _tmp21_ = 0L; + gchar* _tmp22_ = NULL; +#line 1306 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, NULL); +#line 1308 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp1_ = offset; +#line 1308 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + if (_tmp1_ >= ((glong) 0)) { +#line 471 "file.c" + glong _tmp2_ = 0L; +#line 1308 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp2_ = len; +#line 1308 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp0_ = _tmp2_ >= ((glong) 0); +#line 477 "file.c" + } else { +#line 1308 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp0_ = FALSE; +#line 481 "file.c" + } +#line 1308 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + if (_tmp0_) { +#line 485 "file.c" + glong _tmp3_ = 0L; + glong _tmp4_ = 0L; + glong _tmp5_ = 0L; +#line 1310 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp3_ = offset; +#line 1310 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp4_ = len; +#line 1310 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp5_ = string_strnlen ((gchar*) self, _tmp3_ + _tmp4_); +#line 1310 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + string_length = _tmp5_; +#line 497 "file.c" + } else { + gint _tmp6_ = 0; + gint _tmp7_ = 0; +#line 1312 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp6_ = strlen (self); +#line 1312 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp7_ = _tmp6_; +#line 1312 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + string_length = (glong) _tmp7_; +#line 507 "file.c" + } +#line 1315 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp8_ = offset; +#line 1315 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + if (_tmp8_ < ((glong) 0)) { +#line 513 "file.c" + glong _tmp9_ = 0L; + glong _tmp10_ = 0L; + glong _tmp11_ = 0L; +#line 1316 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp9_ = string_length; +#line 1316 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp10_ = offset; +#line 1316 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + offset = _tmp9_ + _tmp10_; +#line 1317 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp11_ = offset; +#line 1317 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + g_return_val_if_fail (_tmp11_ >= ((glong) 0), NULL); +#line 527 "file.c" + } else { + glong _tmp12_ = 0L; + glong _tmp13_ = 0L; +#line 1319 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp12_ = offset; +#line 1319 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp13_ = string_length; +#line 1319 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + g_return_val_if_fail (_tmp12_ <= _tmp13_, NULL); +#line 537 "file.c" + } +#line 1321 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp14_ = len; +#line 1321 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + if (_tmp14_ < ((glong) 0)) { +#line 543 "file.c" + glong _tmp15_ = 0L; + glong _tmp16_ = 0L; +#line 1322 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp15_ = string_length; +#line 1322 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp16_ = offset; +#line 1322 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + len = _tmp15_ - _tmp16_; +#line 552 "file.c" + } +#line 1324 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp17_ = offset; +#line 1324 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp18_ = len; +#line 1324 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp19_ = string_length; +#line 1324 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + g_return_val_if_fail ((_tmp17_ + _tmp18_) <= _tmp19_, NULL); +#line 1325 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp20_ = offset; +#line 1325 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp21_ = len; +#line 1325 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp22_ = g_strndup (((gchar*) self) + _tmp20_, (gsize) _tmp21_); +#line 1325 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + result = _tmp22_; +#line 1325 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + return result; +#line 572 "file.c" +} + + +void disassemble_filename (const gchar* basename, gchar** name, gchar** ext) { + gchar* _vala_name = NULL; + gchar* _vala_ext = NULL; + glong offset = 0L; + const gchar* _tmp0_ = NULL; + glong _tmp1_ = 0L; + glong _tmp2_ = 0L; +#line 65 "/home/jens/Source/shotwell/src/util/file.vala" + g_return_if_fail (basename != NULL); +#line 66 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp0_ = basename; +#line 66 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp1_ = find_last_offset (_tmp0_, '.'); +#line 66 "/home/jens/Source/shotwell/src/util/file.vala" + offset = _tmp1_; +#line 67 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp2_ = offset; +#line 67 "/home/jens/Source/shotwell/src/util/file.vala" + if (_tmp2_ <= ((glong) 0)) { +#line 595 "file.c" + const gchar* _tmp3_ = NULL; + gchar* _tmp4_ = NULL; +#line 68 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp3_ = basename; +#line 68 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp4_ = g_strdup (_tmp3_); +#line 68 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (_vala_name); +#line 68 "/home/jens/Source/shotwell/src/util/file.vala" + _vala_name = _tmp4_; +#line 69 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (_vala_ext); +#line 69 "/home/jens/Source/shotwell/src/util/file.vala" + _vala_ext = NULL; +#line 610 "file.c" + } else { + const gchar* _tmp5_ = NULL; + glong _tmp6_ = 0L; + gchar* _tmp7_ = NULL; + const gchar* _tmp8_ = NULL; + glong _tmp9_ = 0L; + gchar* _tmp10_ = NULL; +#line 71 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp5_ = basename; +#line 71 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp6_ = offset; +#line 71 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp7_ = string_substring (_tmp5_, (glong) 0, _tmp6_); +#line 71 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (_vala_name); +#line 71 "/home/jens/Source/shotwell/src/util/file.vala" + _vala_name = _tmp7_; +#line 72 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp8_ = basename; +#line 72 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp9_ = offset; +#line 72 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp10_ = string_substring (_tmp8_, _tmp9_ + 1, (glong) -1); +#line 72 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (_vala_ext); +#line 72 "/home/jens/Source/shotwell/src/util/file.vala" + _vala_ext = _tmp10_; +#line 638 "file.c" + } +#line 65 "/home/jens/Source/shotwell/src/util/file.vala" + if (name) { +#line 65 "/home/jens/Source/shotwell/src/util/file.vala" + *name = _vala_name; +#line 644 "file.c" + } else { +#line 65 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (_vala_name); +#line 648 "file.c" + } +#line 65 "/home/jens/Source/shotwell/src/util/file.vala" + if (ext) { +#line 65 "/home/jens/Source/shotwell/src/util/file.vala" + *ext = _vala_ext; +#line 654 "file.c" + } else { +#line 65 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (_vala_ext); +#line 658 "file.c" + } +} + + +guint64 query_total_file_size (GFile* file_or_dir, GCancellable* cancellable, GError** error) { + guint64 result = 0ULL; + GFileType type = 0; + GFile* _tmp0_ = NULL; + GFileType _tmp1_ = 0; + GFileType _tmp2_ = 0; + GFileEnumerator* enumerator = NULL; + guint64 total_bytes = 0ULL; + GFileInfo* info = NULL; + GError * _inner_error_ = NULL; +#line 77 "/home/jens/Source/shotwell/src/util/file.vala" + g_return_val_if_fail (G_IS_FILE (file_or_dir), 0ULL); +#line 77 "/home/jens/Source/shotwell/src/util/file.vala" + g_return_val_if_fail ((cancellable == NULL) || G_IS_CANCELLABLE (cancellable), 0ULL); +#line 78 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp0_ = file_or_dir; +#line 78 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp1_ = g_file_query_file_type (_tmp0_, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL); +#line 78 "/home/jens/Source/shotwell/src/util/file.vala" + type = _tmp1_; +#line 79 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp2_ = type; +#line 79 "/home/jens/Source/shotwell/src/util/file.vala" + if (_tmp2_ == G_FILE_TYPE_REGULAR) { +#line 687 "file.c" + GFileInfo* info = NULL; + GFileInfo* _tmp16_ = NULL; + gint64 _tmp17_ = 0LL; +#line 80 "/home/jens/Source/shotwell/src/util/file.vala" + info = NULL; +#line 693 "file.c" + { + GFileInfo* _tmp3_ = NULL; + GFile* _tmp4_ = NULL; + GCancellable* _tmp5_ = NULL; + GFileInfo* _tmp6_ = NULL; + GFileInfo* _tmp7_ = NULL; +#line 82 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp4_ = file_or_dir; +#line 82 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp5_ = cancellable; +#line 82 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp6_ = g_file_query_info (_tmp4_, G_FILE_ATTRIBUTE_STANDARD_SIZE, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, _tmp5_, &_inner_error_); +#line 82 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp3_ = _tmp6_; +#line 82 "/home/jens/Source/shotwell/src/util/file.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 710 "file.c" + goto __catch1_g_error; + } +#line 82 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp7_ = _tmp3_; +#line 82 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp3_ = NULL; +#line 82 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (info); +#line 82 "/home/jens/Source/shotwell/src/util/file.vala" + info = _tmp7_; +#line 81 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (_tmp3_); +#line 723 "file.c" + } + goto __finally1; + __catch1_g_error: + { + GError* err = NULL; + GError* _tmp8_ = NULL; + GFile* _tmp11_ = NULL; + gchar* _tmp12_ = NULL; + gchar* _tmp13_ = NULL; + GError* _tmp14_ = NULL; + const gchar* _tmp15_ = NULL; +#line 81 "/home/jens/Source/shotwell/src/util/file.vala" + err = _inner_error_; +#line 81 "/home/jens/Source/shotwell/src/util/file.vala" + _inner_error_ = NULL; +#line 85 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp8_ = err; +#line 85 "/home/jens/Source/shotwell/src/util/file.vala" + if (g_error_matches (_tmp8_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { +#line 743 "file.c" + GError* _tmp9_ = NULL; + GError* _tmp10_ = NULL; +#line 86 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp9_ = err; +#line 86 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp10_ = _g_error_copy0 (_tmp9_); +#line 86 "/home/jens/Source/shotwell/src/util/file.vala" + _inner_error_ = _tmp10_; +#line 86 "/home/jens/Source/shotwell/src/util/file.vala" + _g_error_free0 (err); +#line 754 "file.c" + goto __finally1; + } +#line 88 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp11_ = file_or_dir; +#line 88 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp12_ = g_file_get_path (_tmp11_); +#line 88 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp13_ = _tmp12_; +#line 88 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp14_ = err; +#line 88 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp15_ = _tmp14_->message; +#line 88 "/home/jens/Source/shotwell/src/util/file.vala" + g_debug ("file.vala:88: Unable to query filesize for %s: %s", _tmp13_, _tmp15_); +#line 88 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (_tmp13_); +#line 90 "/home/jens/Source/shotwell/src/util/file.vala" + result = (guint64) 0; +#line 90 "/home/jens/Source/shotwell/src/util/file.vala" + _g_error_free0 (err); +#line 90 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (info); +#line 90 "/home/jens/Source/shotwell/src/util/file.vala" + return result; +#line 779 "file.c" + } + __finally1: +#line 81 "/home/jens/Source/shotwell/src/util/file.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 81 "/home/jens/Source/shotwell/src/util/file.vala" + g_propagate_error (error, _inner_error_); +#line 81 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (info); +#line 81 "/home/jens/Source/shotwell/src/util/file.vala" + return 0ULL; +#line 790 "file.c" + } +#line 93 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp16_ = info; +#line 93 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp17_ = g_file_info_get_size (_tmp16_); +#line 93 "/home/jens/Source/shotwell/src/util/file.vala" + result = (guint64) _tmp17_; +#line 93 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (info); +#line 93 "/home/jens/Source/shotwell/src/util/file.vala" + return result; +#line 802 "file.c" + } else { + GFileType _tmp18_ = 0; +#line 94 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp18_ = type; +#line 94 "/home/jens/Source/shotwell/src/util/file.vala" + if (_tmp18_ != G_FILE_TYPE_DIRECTORY) { +#line 95 "/home/jens/Source/shotwell/src/util/file.vala" + result = (guint64) 0; +#line 95 "/home/jens/Source/shotwell/src/util/file.vala" + return result; +#line 813 "file.c" + } + } + { + GFileEnumerator* _tmp19_ = NULL; + GFile* _tmp20_ = NULL; + GCancellable* _tmp21_ = NULL; + GFileEnumerator* _tmp22_ = NULL; + GFileEnumerator* _tmp23_ = NULL; + GFileEnumerator* _tmp24_ = NULL; +#line 100 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp20_ = file_or_dir; +#line 100 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp21_ = cancellable; +#line 100 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp22_ = g_file_enumerate_children (_tmp20_, G_FILE_ATTRIBUTE_STANDARD_NAME, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, _tmp21_, &_inner_error_); +#line 100 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp19_ = _tmp22_; +#line 100 "/home/jens/Source/shotwell/src/util/file.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 833 "file.c" + goto __catch2_g_error; + } +#line 100 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp23_ = _tmp19_; +#line 100 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp19_ = NULL; +#line 100 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (enumerator); +#line 100 "/home/jens/Source/shotwell/src/util/file.vala" + enumerator = _tmp23_; +#line 102 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp24_ = enumerator; +#line 102 "/home/jens/Source/shotwell/src/util/file.vala" + if (_tmp24_ == NULL) { +#line 103 "/home/jens/Source/shotwell/src/util/file.vala" + result = (guint64) 0; +#line 103 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (_tmp19_); +#line 103 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (enumerator); +#line 103 "/home/jens/Source/shotwell/src/util/file.vala" + return result; +#line 856 "file.c" + } +#line 99 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (_tmp19_); +#line 860 "file.c" + } + goto __finally2; + __catch2_g_error: + { + GError* err = NULL; + gboolean _tmp25_ = FALSE; + GError* _tmp26_ = NULL; + GError* _tmp28_ = NULL; + GError* _tmp29_ = NULL; +#line 99 "/home/jens/Source/shotwell/src/util/file.vala" + err = _inner_error_; +#line 99 "/home/jens/Source/shotwell/src/util/file.vala" + _inner_error_ = NULL; +#line 106 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp26_ = err; +#line 106 "/home/jens/Source/shotwell/src/util/file.vala" + if (g_error_matches (_tmp26_, G_FILE_ERROR, G_FILE_ERROR_PERM)) { +#line 106 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp25_ = TRUE; +#line 880 "file.c" + } else { + GError* _tmp27_ = NULL; +#line 106 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp27_ = err; +#line 106 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp25_ = g_error_matches (_tmp27_, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED); +#line 887 "file.c" + } +#line 106 "/home/jens/Source/shotwell/src/util/file.vala" + if (_tmp25_) { +#line 107 "/home/jens/Source/shotwell/src/util/file.vala" + result = (guint64) 0; +#line 107 "/home/jens/Source/shotwell/src/util/file.vala" + _g_error_free0 (err); +#line 107 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (enumerator); +#line 107 "/home/jens/Source/shotwell/src/util/file.vala" + return result; +#line 899 "file.c" + } +#line 109 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp28_ = err; +#line 109 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp29_ = _g_error_copy0 (_tmp28_); +#line 109 "/home/jens/Source/shotwell/src/util/file.vala" + _inner_error_ = _tmp29_; +#line 109 "/home/jens/Source/shotwell/src/util/file.vala" + _g_error_free0 (err); +#line 909 "file.c" + goto __finally2; + } + __finally2: +#line 99 "/home/jens/Source/shotwell/src/util/file.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 99 "/home/jens/Source/shotwell/src/util/file.vala" + g_propagate_error (error, _inner_error_); +#line 99 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (enumerator); +#line 99 "/home/jens/Source/shotwell/src/util/file.vala" + return 0ULL; +#line 921 "file.c" + } +#line 112 "/home/jens/Source/shotwell/src/util/file.vala" + total_bytes = (guint64) 0; +#line 114 "/home/jens/Source/shotwell/src/util/file.vala" + info = NULL; +#line 115 "/home/jens/Source/shotwell/src/util/file.vala" + while (TRUE) { +#line 929 "file.c" + GFileInfo* _tmp30_ = NULL; + GFileEnumerator* _tmp31_ = NULL; + GCancellable* _tmp32_ = NULL; + GFileInfo* _tmp33_ = NULL; + GFileInfo* _tmp34_ = NULL; + GFileInfo* _tmp35_ = NULL; + guint64 _tmp36_ = 0ULL; + GFile* _tmp37_ = NULL; + GFileInfo* _tmp38_ = NULL; + const gchar* _tmp39_ = NULL; + GFile* _tmp40_ = NULL; + GFile* _tmp41_ = NULL; + GCancellable* _tmp42_ = NULL; + guint64 _tmp43_ = 0ULL; + guint64 _tmp44_ = 0ULL; + guint64 _tmp45_ = 0ULL; +#line 115 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp31_ = enumerator; +#line 115 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp32_ = cancellable; +#line 115 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp33_ = g_file_enumerator_next_file (_tmp31_, _tmp32_, &_inner_error_); +#line 115 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp30_ = _tmp33_; +#line 115 "/home/jens/Source/shotwell/src/util/file.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 115 "/home/jens/Source/shotwell/src/util/file.vala" + g_propagate_error (error, _inner_error_); +#line 115 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (info); +#line 115 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (enumerator); +#line 115 "/home/jens/Source/shotwell/src/util/file.vala" + return 0ULL; +#line 964 "file.c" + } +#line 115 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp34_ = _tmp30_; +#line 115 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp30_ = NULL; +#line 115 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (info); +#line 115 "/home/jens/Source/shotwell/src/util/file.vala" + info = _tmp34_; +#line 115 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp35_ = info; +#line 115 "/home/jens/Source/shotwell/src/util/file.vala" + if (!(_tmp35_ != NULL)) { +#line 115 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (_tmp30_); +#line 115 "/home/jens/Source/shotwell/src/util/file.vala" + break; +#line 982 "file.c" + } +#line 116 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp37_ = file_or_dir; +#line 116 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp38_ = info; +#line 116 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp39_ = g_file_info_get_name (_tmp38_); +#line 116 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp40_ = g_file_get_child (_tmp37_, _tmp39_); +#line 116 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp41_ = _tmp40_; +#line 116 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp42_ = cancellable; +#line 116 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp43_ = query_total_file_size (_tmp41_, _tmp42_, &_inner_error_); +#line 116 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp44_ = _tmp43_; +#line 116 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (_tmp41_); +#line 116 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp36_ = _tmp44_; +#line 116 "/home/jens/Source/shotwell/src/util/file.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 116 "/home/jens/Source/shotwell/src/util/file.vala" + g_propagate_error (error, _inner_error_); +#line 116 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (_tmp30_); +#line 116 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (info); +#line 116 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (enumerator); +#line 116 "/home/jens/Source/shotwell/src/util/file.vala" + return 0ULL; +#line 1016 "file.c" + } +#line 116 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp45_ = total_bytes; +#line 116 "/home/jens/Source/shotwell/src/util/file.vala" + total_bytes = _tmp45_ + _tmp36_; +#line 115 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (_tmp30_); +#line 1024 "file.c" + } +#line 118 "/home/jens/Source/shotwell/src/util/file.vala" + result = total_bytes; +#line 118 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (info); +#line 118 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (enumerator); +#line 118 "/home/jens/Source/shotwell/src/util/file.vala" + return result; +#line 1034 "file.c" +} + + +void delete_all_files (GFile* dir, GeeSet* exceptions, ProgressMonitor monitor, void* monitor_target, guint64 file_count, GCancellable* cancellable, GError** error) { + GFileType type = 0; + GFile* _tmp0_ = NULL; + GFileType _tmp1_ = 0; + GFileType _tmp2_ = 0; + GFileEnumerator* enumerator = NULL; + GFile* _tmp10_ = NULL; + GCancellable* _tmp11_ = NULL; + GFileEnumerator* _tmp12_ = NULL; + GFileInfo* info = NULL; + guint64 i = 0ULL; + GError * _inner_error_ = NULL; +#line 125 "/home/jens/Source/shotwell/src/util/file.vala" + g_return_if_fail (G_IS_FILE (dir)); +#line 125 "/home/jens/Source/shotwell/src/util/file.vala" + g_return_if_fail ((exceptions == NULL) || GEE_IS_SET (exceptions)); +#line 125 "/home/jens/Source/shotwell/src/util/file.vala" + g_return_if_fail ((cancellable == NULL) || G_IS_CANCELLABLE (cancellable)); +#line 127 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp0_ = dir; +#line 127 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp1_ = g_file_query_file_type (_tmp0_, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL); +#line 127 "/home/jens/Source/shotwell/src/util/file.vala" + type = _tmp1_; +#line 128 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp2_ = type; +#line 128 "/home/jens/Source/shotwell/src/util/file.vala" + if (_tmp2_ != G_FILE_TYPE_DIRECTORY) { +#line 1066 "file.c" + GFile* _tmp3_ = NULL; + gchar* _tmp4_ = NULL; + gchar* _tmp5_ = NULL; + gchar* _tmp6_ = NULL; + gchar* _tmp7_ = NULL; + GError* _tmp8_ = NULL; + GError* _tmp9_ = NULL; +#line 129 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp3_ = dir; +#line 129 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp4_ = g_file_get_path (_tmp3_); +#line 129 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp5_ = _tmp4_; +#line 129 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp6_ = g_strdup_printf ("%s is not a directory", _tmp5_); +#line 129 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp7_ = _tmp6_; +#line 129 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp8_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_NOT_DIRECTORY, _tmp7_); +#line 129 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp9_ = _tmp8_; +#line 129 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (_tmp7_); +#line 129 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (_tmp5_); +#line 129 "/home/jens/Source/shotwell/src/util/file.vala" + _inner_error_ = _tmp9_; +#line 129 "/home/jens/Source/shotwell/src/util/file.vala" + g_propagate_error (error, _inner_error_); +#line 129 "/home/jens/Source/shotwell/src/util/file.vala" + return; +#line 1098 "file.c" + } +#line 131 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp10_ = dir; +#line 131 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp11_ = cancellable; +#line 131 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp12_ = g_file_enumerate_children (_tmp10_, "standard::name,standard::type", G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, _tmp11_, &_inner_error_); +#line 131 "/home/jens/Source/shotwell/src/util/file.vala" + enumerator = _tmp12_; +#line 131 "/home/jens/Source/shotwell/src/util/file.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 131 "/home/jens/Source/shotwell/src/util/file.vala" + g_propagate_error (error, _inner_error_); +#line 131 "/home/jens/Source/shotwell/src/util/file.vala" + return; +#line 1114 "file.c" + } +#line 133 "/home/jens/Source/shotwell/src/util/file.vala" + info = NULL; +#line 134 "/home/jens/Source/shotwell/src/util/file.vala" + i = (guint64) 0; +#line 135 "/home/jens/Source/shotwell/src/util/file.vala" + while (TRUE) { +#line 1122 "file.c" + GFileInfo* _tmp13_ = NULL; + GFileEnumerator* _tmp14_ = NULL; + GCancellable* _tmp15_ = NULL; + GFileInfo* _tmp16_ = NULL; + GFileInfo* _tmp17_ = NULL; + GFileInfo* _tmp18_ = NULL; + GFileInfo* _tmp19_ = NULL; + GFileType _tmp20_ = 0; + gboolean _tmp21_ = FALSE; + GeeSet* _tmp22_ = NULL; + GFile* file = NULL; + GFile* _tmp27_ = NULL; + GFileInfo* _tmp28_ = NULL; + const gchar* _tmp29_ = NULL; + GFile* _tmp30_ = NULL; + gboolean _tmp38_ = FALSE; + ProgressMonitor _tmp39_ = NULL; + void* _tmp39__target = NULL; +#line 135 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp14_ = enumerator; +#line 135 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp15_ = cancellable; +#line 135 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp16_ = g_file_enumerator_next_file (_tmp14_, _tmp15_, &_inner_error_); +#line 135 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp13_ = _tmp16_; +#line 135 "/home/jens/Source/shotwell/src/util/file.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 135 "/home/jens/Source/shotwell/src/util/file.vala" + g_propagate_error (error, _inner_error_); +#line 135 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (info); +#line 135 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (enumerator); +#line 135 "/home/jens/Source/shotwell/src/util/file.vala" + return; +#line 1159 "file.c" + } +#line 135 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp17_ = _tmp13_; +#line 135 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp13_ = NULL; +#line 135 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (info); +#line 135 "/home/jens/Source/shotwell/src/util/file.vala" + info = _tmp17_; +#line 135 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp18_ = info; +#line 135 "/home/jens/Source/shotwell/src/util/file.vala" + if (!(_tmp18_ != NULL)) { +#line 135 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (_tmp13_); +#line 135 "/home/jens/Source/shotwell/src/util/file.vala" + break; +#line 1177 "file.c" + } +#line 136 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp19_ = info; +#line 136 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp20_ = g_file_info_get_file_type (_tmp19_); +#line 136 "/home/jens/Source/shotwell/src/util/file.vala" + if (_tmp20_ != G_FILE_TYPE_REGULAR) { +#line 137 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (_tmp13_); +#line 137 "/home/jens/Source/shotwell/src/util/file.vala" + continue; +#line 1189 "file.c" + } +#line 139 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp22_ = exceptions; +#line 139 "/home/jens/Source/shotwell/src/util/file.vala" + if (_tmp22_ != NULL) { +#line 1195 "file.c" + GeeSet* _tmp23_ = NULL; + GFileInfo* _tmp24_ = NULL; + const gchar* _tmp25_ = NULL; + gboolean _tmp26_ = FALSE; +#line 139 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp23_ = exceptions; +#line 139 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp24_ = info; +#line 139 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp25_ = g_file_info_get_name (_tmp24_); +#line 139 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp26_ = gee_collection_contains (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, GEE_TYPE_COLLECTION, GeeCollection), _tmp25_); +#line 139 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp21_ = _tmp26_; +#line 1210 "file.c" + } else { +#line 139 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp21_ = FALSE; +#line 1214 "file.c" + } +#line 139 "/home/jens/Source/shotwell/src/util/file.vala" + if (_tmp21_) { +#line 140 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (_tmp13_); +#line 140 "/home/jens/Source/shotwell/src/util/file.vala" + continue; +#line 1222 "file.c" + } +#line 142 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp27_ = dir; +#line 142 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp28_ = info; +#line 142 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp29_ = g_file_info_get_name (_tmp28_); +#line 142 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp30_ = g_file_get_child (_tmp27_, _tmp29_); +#line 142 "/home/jens/Source/shotwell/src/util/file.vala" + file = _tmp30_; +#line 1234 "file.c" + { + GFile* _tmp31_ = NULL; + GCancellable* _tmp32_ = NULL; +#line 144 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp31_ = file; +#line 144 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp32_ = cancellable; +#line 144 "/home/jens/Source/shotwell/src/util/file.vala" + g_file_delete (_tmp31_, _tmp32_, &_inner_error_); +#line 144 "/home/jens/Source/shotwell/src/util/file.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 1246 "file.c" + goto __catch3_g_error; + } + } + goto __finally3; + __catch3_g_error: + { + GError* err = NULL; + GFile* _tmp33_ = NULL; + gchar* _tmp34_ = NULL; + gchar* _tmp35_ = NULL; + GError* _tmp36_ = NULL; + const gchar* _tmp37_ = NULL; +#line 143 "/home/jens/Source/shotwell/src/util/file.vala" + err = _inner_error_; +#line 143 "/home/jens/Source/shotwell/src/util/file.vala" + _inner_error_ = NULL; +#line 146 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp33_ = file; +#line 146 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp34_ = g_file_get_path (_tmp33_); +#line 146 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp35_ = _tmp34_; +#line 146 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp36_ = err; +#line 146 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp37_ = _tmp36_->message; +#line 146 "/home/jens/Source/shotwell/src/util/file.vala" + g_warning ("file.vala:146: Unable to delete file %s: %s", _tmp35_, _tmp37_); +#line 146 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (_tmp35_); +#line 143 "/home/jens/Source/shotwell/src/util/file.vala" + _g_error_free0 (err); +#line 1279 "file.c" + } + __finally3: +#line 143 "/home/jens/Source/shotwell/src/util/file.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 143 "/home/jens/Source/shotwell/src/util/file.vala" + g_propagate_error (error, _inner_error_); +#line 143 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (file); +#line 143 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (_tmp13_); +#line 143 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (info); +#line 143 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (enumerator); +#line 143 "/home/jens/Source/shotwell/src/util/file.vala" + return; +#line 1296 "file.c" + } +#line 149 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp39_ = monitor; +#line 149 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp39__target = monitor_target; +#line 149 "/home/jens/Source/shotwell/src/util/file.vala" + if (_tmp39_ != NULL) { +#line 1304 "file.c" + guint64 _tmp40_ = 0ULL; +#line 149 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp40_ = file_count; +#line 149 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp38_ = _tmp40_ > ((guint64) 0); +#line 1310 "file.c" + } else { +#line 149 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp38_ = FALSE; +#line 1314 "file.c" + } +#line 149 "/home/jens/Source/shotwell/src/util/file.vala" + if (_tmp38_) { +#line 1318 "file.c" + ProgressMonitor _tmp41_ = NULL; + void* _tmp41__target = NULL; + guint64 _tmp42_ = 0ULL; + guint64 _tmp43_ = 0ULL; + guint64 _tmp44_ = 0ULL; +#line 150 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp41_ = monitor; +#line 150 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp41__target = monitor_target; +#line 150 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp42_ = file_count; +#line 150 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp43_ = i; +#line 150 "/home/jens/Source/shotwell/src/util/file.vala" + i = _tmp43_ + 1; +#line 150 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp44_ = i; +#line 150 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp41_ (_tmp42_, _tmp44_, TRUE, _tmp41__target); +#line 1338 "file.c" + } +#line 135 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (file); +#line 135 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (_tmp13_); +#line 1344 "file.c" + } +#line 125 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (info); +#line 125 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (enumerator); +#line 1350 "file.c" +} + + +time_t query_file_modified (GFile* file, GError** error) { + time_t result = 0; + GFileInfo* info = NULL; + GFile* _tmp0_ = NULL; + GFileInfo* _tmp1_ = NULL; + GTimeVal _tmp2_ = {0}; + glong _tmp3_ = 0L; + GError * _inner_error_ = NULL; +#line 154 "/home/jens/Source/shotwell/src/util/file.vala" + g_return_val_if_fail (G_IS_FILE (file), 0); +#line 155 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp0_ = file; +#line 155 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp1_ = g_file_query_info (_tmp0_, G_FILE_ATTRIBUTE_TIME_MODIFIED, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL, &_inner_error_); +#line 155 "/home/jens/Source/shotwell/src/util/file.vala" + info = _tmp1_; +#line 155 "/home/jens/Source/shotwell/src/util/file.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 155 "/home/jens/Source/shotwell/src/util/file.vala" + g_propagate_error (error, _inner_error_); +#line 155 "/home/jens/Source/shotwell/src/util/file.vala" + return 0; +#line 1376 "file.c" + } +#line 158 "/home/jens/Source/shotwell/src/util/file.vala" + g_file_info_get_modification_time (info, &_tmp2_); +#line 158 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp3_ = _tmp2_.tv_sec; +#line 158 "/home/jens/Source/shotwell/src/util/file.vala" + result = (time_t) _tmp3_; +#line 158 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (info); +#line 158 "/home/jens/Source/shotwell/src/util/file.vala" + return result; +#line 1388 "file.c" +} + + +gboolean query_is_directory (GFile* file) { + gboolean result = FALSE; + GFile* _tmp0_ = NULL; + GFileType _tmp1_ = 0; +#line 161 "/home/jens/Source/shotwell/src/util/file.vala" + g_return_val_if_fail (G_IS_FILE (file), FALSE); +#line 162 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp0_ = file; +#line 162 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp1_ = g_file_query_file_type (_tmp0_, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL); +#line 162 "/home/jens/Source/shotwell/src/util/file.vala" + result = _tmp1_ == G_FILE_TYPE_DIRECTORY; +#line 162 "/home/jens/Source/shotwell/src/util/file.vala" + return result; +#line 1406 "file.c" +} + + +gboolean query_is_directory_empty (GFile* dir, GError** error) { + gboolean result = FALSE; + GFile* _tmp0_ = NULL; + GFileType _tmp1_ = 0; + GFileEnumerator* enumerator = NULL; + GFile* _tmp2_ = NULL; + GFileEnumerator* _tmp3_ = NULL; + GFileEnumerator* _tmp4_ = NULL; + GFileInfo* _tmp5_ = NULL; + GFileEnumerator* _tmp6_ = NULL; + GFileInfo* _tmp7_ = NULL; + GFileInfo* _tmp8_ = NULL; + GFileInfo* _tmp9_ = NULL; + gboolean _tmp10_ = FALSE; + GError * _inner_error_ = NULL; +#line 165 "/home/jens/Source/shotwell/src/util/file.vala" + g_return_val_if_fail (G_IS_FILE (dir), FALSE); +#line 166 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp0_ = dir; +#line 166 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp1_ = g_file_query_file_type (_tmp0_, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL); +#line 166 "/home/jens/Source/shotwell/src/util/file.vala" + if (_tmp1_ != G_FILE_TYPE_DIRECTORY) { +#line 167 "/home/jens/Source/shotwell/src/util/file.vala" + result = FALSE; +#line 167 "/home/jens/Source/shotwell/src/util/file.vala" + return result; +#line 1437 "file.c" + } +#line 169 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp2_ = dir; +#line 169 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp3_ = g_file_enumerate_children (_tmp2_, "standard::name", G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL, &_inner_error_); +#line 169 "/home/jens/Source/shotwell/src/util/file.vala" + enumerator = _tmp3_; +#line 169 "/home/jens/Source/shotwell/src/util/file.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 169 "/home/jens/Source/shotwell/src/util/file.vala" + g_propagate_error (error, _inner_error_); +#line 169 "/home/jens/Source/shotwell/src/util/file.vala" + return FALSE; +#line 1451 "file.c" + } +#line 171 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp4_ = enumerator; +#line 171 "/home/jens/Source/shotwell/src/util/file.vala" + if (_tmp4_ == NULL) { +#line 172 "/home/jens/Source/shotwell/src/util/file.vala" + result = FALSE; +#line 172 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (enumerator); +#line 172 "/home/jens/Source/shotwell/src/util/file.vala" + return result; +#line 1463 "file.c" + } +#line 174 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp6_ = enumerator; +#line 174 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp7_ = g_file_enumerator_next_file (_tmp6_, NULL, &_inner_error_); +#line 174 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp5_ = _tmp7_; +#line 174 "/home/jens/Source/shotwell/src/util/file.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 174 "/home/jens/Source/shotwell/src/util/file.vala" + g_propagate_error (error, _inner_error_); +#line 174 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (enumerator); +#line 174 "/home/jens/Source/shotwell/src/util/file.vala" + return FALSE; +#line 1479 "file.c" + } +#line 174 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp8_ = _tmp5_; +#line 174 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp5_ = NULL; +#line 174 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp9_ = _tmp8_; +#line 174 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp10_ = _tmp9_ == NULL; +#line 174 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (_tmp9_); +#line 174 "/home/jens/Source/shotwell/src/util/file.vala" + result = _tmp10_; +#line 174 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (_tmp5_); +#line 174 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (enumerator); +#line 174 "/home/jens/Source/shotwell/src/util/file.vala" + return result; +#line 1499 "file.c" +} + + +gchar* get_display_pathname (GFile* file) { + gchar* result = NULL; + gchar* path = NULL; + GFile* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; + gchar* home = NULL; + const gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; + const gchar* _tmp4_ = NULL; + const gchar* _tmp5_ = NULL; + const gchar* _tmp7_ = NULL; + const gchar* _tmp8_ = NULL; + gboolean _tmp9_ = FALSE; +#line 177 "/home/jens/Source/shotwell/src/util/file.vala" + g_return_val_if_fail (G_IS_FILE (file), NULL); +#line 179 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp0_ = file; +#line 179 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp1_ = g_file_get_parse_name (_tmp0_); +#line 179 "/home/jens/Source/shotwell/src/util/file.vala" + path = _tmp1_; +#line 180 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp2_ = g_get_home_dir (); +#line 180 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp3_ = g_strdup (_tmp2_); +#line 180 "/home/jens/Source/shotwell/src/util/file.vala" + home = _tmp3_; +#line 182 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp4_ = path; +#line 182 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp5_ = home; +#line 182 "/home/jens/Source/shotwell/src/util/file.vala" + if (g_strcmp0 (_tmp4_, _tmp5_) == 0) { +#line 1536 "file.c" + gchar* _tmp6_ = NULL; +#line 183 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp6_ = g_strdup ("~"); +#line 183 "/home/jens/Source/shotwell/src/util/file.vala" + result = _tmp6_; +#line 183 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (home); +#line 183 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (path); +#line 183 "/home/jens/Source/shotwell/src/util/file.vala" + return result; +#line 1548 "file.c" + } +#line 185 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp7_ = path; +#line 185 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp8_ = home; +#line 185 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp9_ = g_str_has_prefix (_tmp7_, _tmp8_); +#line 185 "/home/jens/Source/shotwell/src/util/file.vala" + if (_tmp9_) { +#line 1558 "file.c" + const gchar* _tmp10_ = NULL; + const gchar* _tmp11_ = NULL; + gint _tmp12_ = 0; + gint _tmp13_ = 0; + gchar* _tmp14_ = NULL; + gchar* _tmp15_ = NULL; + gchar* _tmp16_ = NULL; + gchar* _tmp17_ = NULL; +#line 186 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp10_ = path; +#line 186 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp11_ = home; +#line 186 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp12_ = strlen (_tmp11_); +#line 186 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp13_ = _tmp12_; +#line 186 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp14_ = string_substring (_tmp10_, (glong) _tmp13_, (glong) -1); +#line 186 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp15_ = _tmp14_; +#line 186 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp16_ = g_strdup_printf ("~%s", _tmp15_); +#line 186 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp17_ = _tmp16_; +#line 186 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (_tmp15_); +#line 186 "/home/jens/Source/shotwell/src/util/file.vala" + result = _tmp17_; +#line 186 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (home); +#line 186 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (path); +#line 186 "/home/jens/Source/shotwell/src/util/file.vala" + return result; +#line 1593 "file.c" + } +#line 188 "/home/jens/Source/shotwell/src/util/file.vala" + result = path; +#line 188 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (home); +#line 188 "/home/jens/Source/shotwell/src/util/file.vala" + return result; +#line 1601 "file.c" +} + + +gchar* strip_pretty_path (const gchar* path) { + gchar* result = NULL; + const gchar* _tmp0_ = NULL; + gboolean _tmp1_ = FALSE; + const gchar* _tmp4_ = NULL; + const gchar* _tmp5_ = NULL; + gchar* _tmp6_ = NULL; + gchar* _tmp7_ = NULL; + gchar* _tmp8_ = NULL; + gchar* _tmp9_ = NULL; +#line 191 "/home/jens/Source/shotwell/src/util/file.vala" + g_return_val_if_fail (path != NULL, NULL); +#line 192 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp0_ = path; +#line 192 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp1_ = g_str_has_prefix (_tmp0_, "~"); +#line 192 "/home/jens/Source/shotwell/src/util/file.vala" + if (!_tmp1_) { +#line 1623 "file.c" + const gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; +#line 193 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp2_ = path; +#line 193 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp3_ = g_strdup (_tmp2_); +#line 193 "/home/jens/Source/shotwell/src/util/file.vala" + result = _tmp3_; +#line 193 "/home/jens/Source/shotwell/src/util/file.vala" + return result; +#line 1634 "file.c" + } +#line 195 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp4_ = g_get_home_dir (); +#line 195 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp5_ = path; +#line 195 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp6_ = string_substring (_tmp5_, (glong) 1, (glong) -1); +#line 195 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp7_ = _tmp6_; +#line 195 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp8_ = g_strconcat (_tmp4_, _tmp7_, NULL); +#line 195 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp9_ = _tmp8_; +#line 195 "/home/jens/Source/shotwell/src/util/file.vala" + _g_free0 (_tmp7_); +#line 195 "/home/jens/Source/shotwell/src/util/file.vala" + result = _tmp9_; +#line 195 "/home/jens/Source/shotwell/src/util/file.vala" + return result; +#line 1654 "file.c" +} + + +gchar* get_file_info_id (GFileInfo* info) { + gchar* result = NULL; + GFileInfo* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + gchar* _tmp2_ = NULL; +#line 198 "/home/jens/Source/shotwell/src/util/file.vala" + g_return_val_if_fail (G_IS_FILE_INFO (info), NULL); +#line 199 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp0_ = info; +#line 199 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp1_ = g_file_info_get_attribute_string (_tmp0_, G_FILE_ATTRIBUTE_ID_FILE); +#line 199 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp2_ = g_strdup (_tmp1_); +#line 199 "/home/jens/Source/shotwell/src/util/file.vala" + result = _tmp2_; +#line 199 "/home/jens/Source/shotwell/src/util/file.vala" + return result; +#line 1675 "file.c" +} + + +void skip_uint64 (GInputStream* input, guint64 skip_amount, GError** error) { + GError * _inner_error_ = NULL; +#line 203 "/home/jens/Source/shotwell/src/util/file.vala" + g_return_if_fail (G_IS_INPUT_STREAM (input)); +#line 204 "/home/jens/Source/shotwell/src/util/file.vala" + while (TRUE) { +#line 1685 "file.c" + guint64 _tmp0_ = 0ULL; + guint64 _tmp1_ = 0ULL; +#line 204 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp0_ = skip_amount; +#line 204 "/home/jens/Source/shotwell/src/util/file.vala" + if (!(_tmp0_ > ((guint64) 0))) { +#line 204 "/home/jens/Source/shotwell/src/util/file.vala" + break; +#line 1694 "file.c" + } +#line 206 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp1_ = skip_amount; +#line 206 "/home/jens/Source/shotwell/src/util/file.vala" + if (_tmp1_ >= ((guint64) G_MAXSSIZE)) { +#line 1700 "file.c" + GInputStream* _tmp2_ = NULL; + guint64 _tmp3_ = 0ULL; +#line 207 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp2_ = input; +#line 207 "/home/jens/Source/shotwell/src/util/file.vala" + g_input_stream_skip (_tmp2_, (gsize) G_MAXSSIZE, NULL, &_inner_error_); +#line 207 "/home/jens/Source/shotwell/src/util/file.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 207 "/home/jens/Source/shotwell/src/util/file.vala" + g_propagate_error (error, _inner_error_); +#line 207 "/home/jens/Source/shotwell/src/util/file.vala" + return; +#line 1713 "file.c" + } +#line 208 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp3_ = skip_amount; +#line 208 "/home/jens/Source/shotwell/src/util/file.vala" + skip_amount = _tmp3_ - G_MAXSSIZE; +#line 1719 "file.c" + } else { + GInputStream* _tmp4_ = NULL; + guint64 _tmp5_ = 0ULL; +#line 210 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp4_ = input; +#line 210 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp5_ = skip_amount; +#line 210 "/home/jens/Source/shotwell/src/util/file.vala" + g_input_stream_skip (_tmp4_, (gsize) _tmp5_, NULL, &_inner_error_); +#line 210 "/home/jens/Source/shotwell/src/util/file.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 210 "/home/jens/Source/shotwell/src/util/file.vala" + g_propagate_error (error, _inner_error_); +#line 210 "/home/jens/Source/shotwell/src/util/file.vala" + return; +#line 1735 "file.c" + } +#line 211 "/home/jens/Source/shotwell/src/util/file.vala" + skip_amount = (guint64) 0; +#line 1739 "file.c" + } + } +} + + +guint64 count_files_in_directory (GFile* dir, GError** error) { + guint64 result = 0ULL; + GFile* _tmp0_ = NULL; + gboolean _tmp1_ = FALSE; + guint64 count = 0ULL; + GFileEnumerator* enumerator = NULL; + GFile* _tmp2_ = NULL; + GFileEnumerator* _tmp3_ = NULL; + GFileInfo* info = NULL; + GError * _inner_error_ = NULL; +#line 217 "/home/jens/Source/shotwell/src/util/file.vala" + g_return_val_if_fail (G_IS_FILE (dir), 0ULL); +#line 218 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp0_ = dir; +#line 218 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp1_ = query_is_directory (_tmp0_); +#line 218 "/home/jens/Source/shotwell/src/util/file.vala" + if (!_tmp1_) { +#line 219 "/home/jens/Source/shotwell/src/util/file.vala" + result = (guint64) 0; +#line 219 "/home/jens/Source/shotwell/src/util/file.vala" + return result; +#line 1767 "file.c" + } +#line 221 "/home/jens/Source/shotwell/src/util/file.vala" + count = (guint64) 0; +#line 222 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp2_ = dir; +#line 222 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp3_ = g_file_enumerate_children (_tmp2_, "standard::*", G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL, &_inner_error_); +#line 222 "/home/jens/Source/shotwell/src/util/file.vala" + enumerator = _tmp3_; +#line 222 "/home/jens/Source/shotwell/src/util/file.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 222 "/home/jens/Source/shotwell/src/util/file.vala" + g_propagate_error (error, _inner_error_); +#line 222 "/home/jens/Source/shotwell/src/util/file.vala" + return 0ULL; +#line 1783 "file.c" + } +#line 225 "/home/jens/Source/shotwell/src/util/file.vala" + info = NULL; +#line 226 "/home/jens/Source/shotwell/src/util/file.vala" + while (TRUE) { +#line 1789 "file.c" + GFileInfo* _tmp4_ = NULL; + GFileEnumerator* _tmp5_ = NULL; + GFileInfo* _tmp6_ = NULL; + GFileInfo* _tmp7_ = NULL; + GFileInfo* _tmp8_ = NULL; + guint64 _tmp9_ = 0ULL; +#line 226 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp5_ = enumerator; +#line 226 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp6_ = g_file_enumerator_next_file (_tmp5_, NULL, &_inner_error_); +#line 226 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp4_ = _tmp6_; +#line 226 "/home/jens/Source/shotwell/src/util/file.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 226 "/home/jens/Source/shotwell/src/util/file.vala" + g_propagate_error (error, _inner_error_); +#line 226 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (info); +#line 226 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (enumerator); +#line 226 "/home/jens/Source/shotwell/src/util/file.vala" + return 0ULL; +#line 1812 "file.c" + } +#line 226 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp7_ = _tmp4_; +#line 226 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp4_ = NULL; +#line 226 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (info); +#line 226 "/home/jens/Source/shotwell/src/util/file.vala" + info = _tmp7_; +#line 226 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp8_ = info; +#line 226 "/home/jens/Source/shotwell/src/util/file.vala" + if (!(_tmp8_ != NULL)) { +#line 226 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (_tmp4_); +#line 226 "/home/jens/Source/shotwell/src/util/file.vala" + break; +#line 1830 "file.c" + } +#line 227 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp9_ = count; +#line 227 "/home/jens/Source/shotwell/src/util/file.vala" + count = _tmp9_ + 1; +#line 226 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (_tmp4_); +#line 1838 "file.c" + } +#line 229 "/home/jens/Source/shotwell/src/util/file.vala" + result = count; +#line 229 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (info); +#line 229 "/home/jens/Source/shotwell/src/util/file.vala" + _g_object_unref0 (enumerator); +#line 229 "/home/jens/Source/shotwell/src/util/file.vala" + return result; +#line 1848 "file.c" +} + + +gboolean file_equal (GFile* a, GFile* b) { + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; + gboolean _tmp1_ = FALSE; + GFile* _tmp2_ = NULL; +#line 233 "/home/jens/Source/shotwell/src/util/file.vala" + g_return_val_if_fail ((a == NULL) || G_IS_FILE (a), FALSE); +#line 233 "/home/jens/Source/shotwell/src/util/file.vala" + g_return_val_if_fail ((b == NULL) || G_IS_FILE (b), FALSE); +#line 234 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp2_ = a; +#line 234 "/home/jens/Source/shotwell/src/util/file.vala" + if (_tmp2_ != NULL) { +#line 1865 "file.c" + GFile* _tmp3_ = NULL; +#line 234 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp3_ = b; +#line 234 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp1_ = _tmp3_ != NULL; +#line 1871 "file.c" + } else { +#line 234 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp1_ = FALSE; +#line 1875 "file.c" + } +#line 234 "/home/jens/Source/shotwell/src/util/file.vala" + if (_tmp1_) { +#line 1879 "file.c" + GFile* _tmp4_ = NULL; + GFile* _tmp5_ = NULL; + gboolean _tmp6_ = FALSE; +#line 234 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp4_ = a; +#line 234 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp5_ = b; +#line 234 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp6_ = g_file_equal (_tmp4_, _tmp5_); +#line 234 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp0_ = _tmp6_; +#line 1891 "file.c" + } else { +#line 234 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp0_ = FALSE; +#line 1895 "file.c" + } +#line 234 "/home/jens/Source/shotwell/src/util/file.vala" + result = _tmp0_; +#line 234 "/home/jens/Source/shotwell/src/util/file.vala" + return result; +#line 1901 "file.c" +} + + +guint file_hash (GFile* file) { + guint result = 0U; + guint _tmp0_ = 0U; + GFile* _tmp1_ = NULL; +#line 238 "/home/jens/Source/shotwell/src/util/file.vala" + g_return_val_if_fail ((file == NULL) || G_IS_FILE (file), 0U); +#line 239 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp1_ = file; +#line 239 "/home/jens/Source/shotwell/src/util/file.vala" + if (_tmp1_ != NULL) { +#line 1915 "file.c" + GFile* _tmp2_ = NULL; + guint _tmp3_ = 0U; +#line 239 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp2_ = file; +#line 239 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp3_ = g_file_hash (_tmp2_); +#line 239 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp0_ = _tmp3_; +#line 1924 "file.c" + } else { +#line 239 "/home/jens/Source/shotwell/src/util/file.vala" + _tmp0_ = (guint) 0; +#line 1928 "file.c" + } +#line 239 "/home/jens/Source/shotwell/src/util/file.vala" + result = _tmp0_; +#line 239 "/home/jens/Source/shotwell/src/util/file.vala" + return result; +#line 1934 "file.c" +} + + + diff --git a/src/util/image.c b/src/util/image.c new file mode 100644 index 0000000..2b415a8 --- /dev/null +++ b/src/util/image.c @@ -0,0 +1,2701 @@ +/* image.c generated by valac 0.32.1, the Vala compiler + * generated from image.vala, do not modify */ + +/* Copyright 2016 Software Freedom Conservancy Inc. + * + * This software is licensed under the GNU LGPL (version 2.1 or later). + * See the COPYING file in this distribution. + */ +/* XPM */ + +#include <glib.h> +#include <glib-object.h> +#include <stdlib.h> +#include <string.h> +#include <gdk/gdk.h> +#include <cairo.h> +#include <gdk-pixbuf/gdk-pixbuf.h> +#include <gtk/gtk.h> +#include <float.h> +#include <math.h> +#include <gio/gio.h> + +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) + +#define TYPE_DIMENSIONS (dimensions_get_type ()) +typedef struct _Dimensions Dimensions; + +#define TYPE_PIXEL_TRANSFORMER (pixel_transformer_get_type ()) +#define PIXEL_TRANSFORMER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PIXEL_TRANSFORMER, PixelTransformer)) +#define PIXEL_TRANSFORMER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PIXEL_TRANSFORMER, PixelTransformerClass)) +#define IS_PIXEL_TRANSFORMER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PIXEL_TRANSFORMER)) +#define IS_PIXEL_TRANSFORMER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PIXEL_TRANSFORMER)) +#define PIXEL_TRANSFORMER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PIXEL_TRANSFORMER, PixelTransformerClass)) + +typedef struct _PixelTransformer PixelTransformer; +typedef struct _PixelTransformerClass PixelTransformerClass; + +#define TYPE_PIXEL_TRANSFORMATION (pixel_transformation_get_type ()) +#define PIXEL_TRANSFORMATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PIXEL_TRANSFORMATION, PixelTransformation)) +#define PIXEL_TRANSFORMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PIXEL_TRANSFORMATION, PixelTransformationClass)) +#define IS_PIXEL_TRANSFORMATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PIXEL_TRANSFORMATION)) +#define IS_PIXEL_TRANSFORMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PIXEL_TRANSFORMATION)) +#define PIXEL_TRANSFORMATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PIXEL_TRANSFORMATION, PixelTransformationClass)) + +typedef struct _PixelTransformation PixelTransformation; +typedef struct _PixelTransformationClass PixelTransformationClass; + +#define TYPE_RGB_TRANSFORMATION (rgb_transformation_get_type ()) +#define RGB_TRANSFORMATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_RGB_TRANSFORMATION, RGBTransformation)) +#define RGB_TRANSFORMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_RGB_TRANSFORMATION, RGBTransformationClass)) +#define IS_RGB_TRANSFORMATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_RGB_TRANSFORMATION)) +#define IS_RGB_TRANSFORMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_RGB_TRANSFORMATION)) +#define RGB_TRANSFORMATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_RGB_TRANSFORMATION, RGBTransformationClass)) + +typedef struct _RGBTransformation RGBTransformation; +typedef struct _RGBTransformationClass RGBTransformationClass; + +#define TYPE_SATURATION_TRANSFORMATION (saturation_transformation_get_type ()) +#define SATURATION_TRANSFORMATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SATURATION_TRANSFORMATION, SaturationTransformation)) +#define SATURATION_TRANSFORMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SATURATION_TRANSFORMATION, SaturationTransformationClass)) +#define IS_SATURATION_TRANSFORMATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SATURATION_TRANSFORMATION)) +#define IS_SATURATION_TRANSFORMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SATURATION_TRANSFORMATION)) +#define SATURATION_TRANSFORMATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SATURATION_TRANSFORMATION, SaturationTransformationClass)) + +typedef struct _SaturationTransformation SaturationTransformation; +typedef struct _SaturationTransformationClass SaturationTransformationClass; +#define _pixel_transformation_unref0(var) ((var == NULL) ? NULL : (var = (pixel_transformation_unref (var), NULL))) +#define _pixel_transformer_unref0(var) ((var == NULL) ? NULL : (var = (pixel_transformer_unref (var), NULL))) +#define _cairo_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_destroy (var), NULL))) +#define _cairo_surface_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_surface_destroy (var), NULL))) + +#define TYPE_BOX (box_get_type ()) +typedef struct _Box Box; +#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); +#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; } +#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; } +#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); + +struct _Dimensions { + gint width; + gint height; +}; + +struct _Box { + gint left; + gint top; + gint right; + gint bottom; +}; + + + +gboolean is_color_parsable (const gchar* spec); +void parse_color (const gchar* spec, GdkRGBA* result); +void fetch_color (const gchar* spec, GdkRGBA* result); +void set_source_color_from_string (cairo_t* ctx, const gchar* spec); +#define MIN_SCALED_WIDTH 10 +#define MIN_SCALED_HEIGHT 10 +GdkPixbuf* get_placeholder_pixbuf (void); +GdkPixbuf* scale_pixbuf (GdkPixbuf* pixbuf, gint scale, GdkInterpType interp, gboolean scale_up); +GType dimensions_get_type (void) G_GNUC_CONST; +Dimensions* dimensions_dup (const Dimensions* self); +void dimensions_free (Dimensions* self); +void dimensions_for_pixbuf (GdkPixbuf* pixbuf, Dimensions* result); +void dimensions_get_scaled (Dimensions *self, gint scale, gboolean scale_up, Dimensions* result); +void dimensions_with_min (Dimensions *self, gint min_width, gint min_height, Dimensions* result); +GdkPixbuf* resize_pixbuf (GdkPixbuf* pixbuf, Dimensions* resized, GdkInterpType interp); +#define DEGREE (G_PI / 180.0) +void draw_rounded_corners_filled (cairo_t* ctx, Dimensions* dim, GdkPoint* origin, gdouble radius_proportion); +void context_rounded_corners (cairo_t* cx, Dimensions* dim, GdkPoint* origin, gdouble radius_proportion); +gint dimensions_minor_axis (Dimensions *self); +guchar shift_color_byte (gint b, gint shift); +void shift_colors (GdkPixbuf* pixbuf, gint red, gint green, gint blue, gint alpha); +void dim_pixbuf (GdkPixbuf* pixbuf); +gpointer pixel_transformer_ref (gpointer instance); +void pixel_transformer_unref (gpointer instance); +GParamSpec* param_spec_pixel_transformer (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void value_set_pixel_transformer (GValue* value, gpointer v_object); +void value_take_pixel_transformer (GValue* value, gpointer v_object); +gpointer value_get_pixel_transformer (const GValue* value); +GType pixel_transformer_get_type (void) G_GNUC_CONST; +PixelTransformer* pixel_transformer_new (void); +PixelTransformer* pixel_transformer_construct (GType object_type); +gpointer pixel_transformation_ref (gpointer instance); +void pixel_transformation_unref (gpointer instance); +GParamSpec* param_spec_pixel_transformation (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void value_set_pixel_transformation (GValue* value, gpointer v_object); +void value_take_pixel_transformation (GValue* value, gpointer v_object); +gpointer value_get_pixel_transformation (const GValue* value); +GType pixel_transformation_get_type (void) G_GNUC_CONST; +GType rgb_transformation_get_type (void) G_GNUC_CONST; +GType saturation_transformation_get_type (void) G_GNUC_CONST; +#define SATURATION_TRANSFORMATION_MIN_PARAMETER (-16.0f) +SaturationTransformation* saturation_transformation_new (gfloat client_parameter); +SaturationTransformation* saturation_transformation_construct (GType object_type, gfloat client_parameter); +void pixel_transformer_attach_transformation (PixelTransformer* self, PixelTransformation* trans); +void pixel_transformer_transform_pixbuf (PixelTransformer* self, GdkPixbuf* pixbuf, GCancellable* cancellable); +gboolean coord_in_rectangle (gint x, gint y, GdkRectangle* rect); +gboolean rectangles_equal (GdkRectangle* a, GdkRectangle* b); +gchar* rectangle_to_string (GdkRectangle* rect); +void clamp_rectangle (GdkRectangle* original, Dimensions* max, GdkRectangle* result); +void scale_point (GdkPoint* p, gdouble factor, GdkPoint* result); +void add_points (GdkPoint* p1, GdkPoint* p2, GdkPoint* result); +void subtract_points (GdkPoint* p1, GdkPoint* p2, GdkPoint* result); +void fix_cairo_pixbuf (GdkPixbuf* pixbuf); +void compute_arb_rotated_size (gdouble src_width, gdouble src_height, gdouble angle, gdouble* dest_width, gdouble* dest_height); +gdouble degrees_to_radians (gdouble theta); +GdkPixbuf* rotate_arb (GdkPixbuf* source_pixbuf, gdouble angle); +void rotate_point_arb (GdkPoint* source_point, gint img_w, gint img_h, gdouble angle, gboolean invert, GdkPoint* result); +void derotate_point_arb (GdkPoint* source_point, gint img_w, gint img_h, gdouble angle, GdkPoint* result); +GType box_get_type (void) G_GNUC_CONST; +Box* box_dup (const Box* self); +void box_free (Box* self); +void clamp_inside_rotated_image (Box* src, gint img_w, gint img_h, gdouble angle_deg, gboolean preserve_geom, Box* result); +void box_get_offset (Box *self, gint xofs, gint yofs, Box* result); +void box_init (Box *self, gint left, gint top, gint right, gint bottom); + +const gchar* fallback_image_missing[103] = {"48 48 54 1 ", " c #6A6D67", ". c #6C6E69", "X c #72746F", "o c #747672", "O c #777974", "+ c #797B77", "@ c #7C7E7A", "# c #7F817C", "$ c #81837F", "% c #848682", "& c #878984", "* c #888A86", "= c #8C8D8A", "- c #8F908C", "; c #90928E", ": c #949591", "> c #969894", ", c #999B96", "< c #9C9E9A", "1 c #9FA09C", "2 c #A1A39E", "3 c #A4A6A2", "4 c #A6A9A4", "5 c #A9ABA6", "6 c #ACADA9", "7 c #AEB1AB", "8 c #B1B2AF", "9 c #B3B4B1", "0 c #B6B9B3", "q c #B9BCB6", "w c #BDBEBA", "e c #BEC2BB", "r c #C1C4BE", "t c #C5C5C2", "y c #C6C9C3", "u c #C9CCC6", "i c #CCCDCB", "p c #CED2CA", "a c #D2D6CE", "s c #D5D5D3", "d c #D7D8D5", "f c #D9D9D6", "g c #DCDCDA", "h c #DFE0DD", "j c #E0E0DE", "k c #E4E4E2", "l c #E7E8E5", "z c #E9E9E7", "x c #EDEDEC", "c c #EFF0EE", "v c #F1F1EF", "b c #F2F2F1", "n c #FFFFFF", "m c None", "mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", "mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", "mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", "mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", "mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", "mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", "mmaaaaaaaaaasaisaaaaaaaaaaaaaaaaaaapppiipuuuuumm", "mannnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnym", "manbbbbbbbbbvbbvvvvxvvvbvvvvvvvvccccccxxvxvxxnym", "manbt89898888988888888888999999999999999999txnrm", "manb6======================-;;=;;;;;;;;;;=:7znrm", "manv6&%%**%*%%%%*%%****=======;==;;;;=;=;==7znem", "manv4%%%%$%%%%%%%%%%%=****=======;==-======6znwm", "manx3%%#$$$$##%#$%%%*%**==========-=--=====6znqm", "manx1$@%#$@$###%%%%=****=*===--;;----====*=5lnqm", "manx<@@@@@@@@##%$%%%%****========-==-======5kn0m", "manz<@@@+@+@@@#$%%%%%=%=%===;=:=--------=-*4kn8m", "manz>O+O+O+@@@#$$%%%%========;;=--------=*=3kn9m", "mpnl:OOOOO+@@$##%%%%%=%=====;=;;--;-----===3kn8m", "munl;OooOOO@@@#$%%%%%======;;;;;:;;;;;---==1hn7m", "munl;oXoOO+@###$%%=%=======;::;::::;;---&#+-gn7m", "mynk*XXooOO+$$#$%%%%=%===;;:;:::::;:-$#XooX-fn5m", "mynk*XXOOO@@$$$$%%=%====;::::>::;*#OXXXXXXX*dn5m", "mrnk*oOO@@@#$$$$%=====::::>>>=%@OXOooXXXooo&dn3m", "mrnj*++@$$$$**$===-;;::>>:=@Ooo@XOOoo#o#OOO=fn3m", "menj*@#$$$$$**===;;:::=%@@@@@@O@#O#Oo#o#++@;gn2m", "menj*$$$$&**===;:;=*#@@@@@@@@@@@#######o##%>gn2m", "menh*$$%**===;=*%###########%@@@###$####$%=,gn1m", "m0nj=%***=**&$$$%$$$%$$%$$$$%$$$$$$$$$$%*;:2hn<m", "m0nj****&&&$$&&$%%%%%%%%%%%%%%%%$$*$%%%*;>13gn,m", "m0ng****&&&&&&&&&&&&*%*%*%%*%******%**-:,136kz;m", "m0nh***$&&&&&&&&&&&&%**********%*$***;:,1358r7*m", "m8ng*&&&&&&&&&*$&*&&&&$=$=$=&&&&&&**=:,<11>$65mm", "m7ng*&&&&&&&&&**&&&&&&**=$-$&&&&&&*-:,1..&1wi:mm", "m7ng&&&&&&&&=$*$&&&&&***$$$$&&&***=>,1<onxsi6*mm", "m6nf*&&&&&*&$***&&&&*$*$--$-&&&%*=;,13,:ztw9%mmm", "m5nf*%&&&&&&=$=$%*&&**%*$$&&&&**=>,225;5srw%mmmm", "m4nf3*&&**&&$-$-*******%$;&&*&*->,2365+ui7$mmmmm", "m3nsfffdddsddaffssssdassgaaaassddfgjg4wu;ommmmmm", "m3nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnvq3<$.mmmmmmm", "mm2211111,<,,,,,,>>>>:::;::;----=====@mmmmmmmmmm", "mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", "mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", "mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", "mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", "mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", "mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", "mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm"}; + +gboolean is_color_parsable (const gchar* spec) { + gboolean result = FALSE; + GdkColor color = {0}; + const gchar* _tmp0_ = NULL; + GdkColor _tmp1_ = {0}; + gboolean _tmp2_ = FALSE; +#line 117 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_val_if_fail (spec != NULL, FALSE); +#line 119 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_ = spec; +#line 119 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = gdk_color_parse (_tmp0_, &_tmp1_); +#line 119 "/home/jens/Source/shotwell/src/util/image.vala" + color = _tmp1_; +#line 119 "/home/jens/Source/shotwell/src/util/image.vala" + result = _tmp2_; +#line 119 "/home/jens/Source/shotwell/src/util/image.vala" + return result; +#line 180 "image.c" +} + + +void parse_color (const gchar* spec, GdkRGBA* result) { + const gchar* _tmp0_ = NULL; + GdkRGBA _tmp1_ = {0}; +#line 122 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_if_fail (spec != NULL); +#line 123 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_ = spec; +#line 123 "/home/jens/Source/shotwell/src/util/image.vala" + fetch_color (_tmp0_, &_tmp1_); +#line 123 "/home/jens/Source/shotwell/src/util/image.vala" + *result = _tmp1_; +#line 123 "/home/jens/Source/shotwell/src/util/image.vala" + return; +#line 197 "image.c" +} + + +void fetch_color (const gchar* spec, GdkRGBA* result) { + GdkRGBA rgba = {0}; + const gchar* _tmp0_ = NULL; + gboolean _tmp1_ = FALSE; +#line 126 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_if_fail (spec != NULL); +#line 127 "/home/jens/Source/shotwell/src/util/image.vala" + memset (&rgba, 0, sizeof (GdkRGBA)); +#line 128 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_ = spec; +#line 128 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp1_ = gdk_rgba_parse (&rgba, _tmp0_); +#line 128 "/home/jens/Source/shotwell/src/util/image.vala" + if (!_tmp1_) { +#line 215 "image.c" + const gchar* _tmp2_ = NULL; +#line 129 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = spec; +#line 129 "/home/jens/Source/shotwell/src/util/image.vala" + g_error ("image.vala:129: Can't parse color %s", _tmp2_); +#line 221 "image.c" + } +#line 131 "/home/jens/Source/shotwell/src/util/image.vala" + *result = rgba; +#line 131 "/home/jens/Source/shotwell/src/util/image.vala" + return; +#line 227 "image.c" +} + + +void set_source_color_from_string (cairo_t* ctx, const gchar* spec) { + GdkRGBA rgba = {0}; + const gchar* _tmp0_ = NULL; + GdkRGBA _tmp1_ = {0}; + cairo_t* _tmp2_ = NULL; + GdkRGBA _tmp3_ = {0}; + gdouble _tmp4_ = 0.0; + GdkRGBA _tmp5_ = {0}; + gdouble _tmp6_ = 0.0; + GdkRGBA _tmp7_ = {0}; + gdouble _tmp8_ = 0.0; + GdkRGBA _tmp9_ = {0}; + gdouble _tmp10_ = 0.0; +#line 134 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_if_fail (ctx != NULL); +#line 134 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_if_fail (spec != NULL); +#line 135 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_ = spec; +#line 135 "/home/jens/Source/shotwell/src/util/image.vala" + fetch_color (_tmp0_, &_tmp1_); +#line 135 "/home/jens/Source/shotwell/src/util/image.vala" + rgba = _tmp1_; +#line 136 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = ctx; +#line 136 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp3_ = rgba; +#line 136 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp4_ = _tmp3_.red; +#line 136 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp5_ = rgba; +#line 136 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp6_ = _tmp5_.green; +#line 136 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp7_ = rgba; +#line 136 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp8_ = _tmp7_.blue; +#line 136 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp9_ = rgba; +#line 136 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp10_ = _tmp9_.alpha; +#line 136 "/home/jens/Source/shotwell/src/util/image.vala" + cairo_set_source_rgba (_tmp2_, _tmp4_, _tmp6_, _tmp8_, _tmp10_); +#line 274 "image.c" +} + + +static gpointer _g_object_ref0 (gpointer self) { +#line 147 "/home/jens/Source/shotwell/src/util/image.vala" + return self ? g_object_ref (self) : NULL; +#line 281 "image.c" +} + + +GdkPixbuf* get_placeholder_pixbuf (void) { + GdkPixbuf* result = NULL; + GdkPixbuf* pixbuf = NULL; + GError * _inner_error_ = NULL; +#line 144 "/home/jens/Source/shotwell/src/util/image.vala" + pixbuf = NULL; +#line 291 "image.c" + { + GtkIconTheme* icon_theme = NULL; + GtkIconTheme* _tmp0_ = NULL; + GtkIconTheme* _tmp1_ = NULL; + GdkPixbuf* _tmp2_ = NULL; + GdkPixbuf* _tmp3_ = NULL; + GdkPixbuf* _tmp4_ = NULL; +#line 147 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_ = gtk_icon_theme_get_default (); +#line 147 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp1_ = _g_object_ref0 (_tmp0_); +#line 147 "/home/jens/Source/shotwell/src/util/image.vala" + icon_theme = _tmp1_; +#line 148 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp3_ = gtk_icon_theme_load_icon (icon_theme, "image-missing", (gint) GTK_ICON_SIZE_DIALOG, 0, &_inner_error_); +#line 148 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = _tmp3_; +#line 148 "/home/jens/Source/shotwell/src/util/image.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 148 "/home/jens/Source/shotwell/src/util/image.vala" + _g_object_unref0 (icon_theme); +#line 313 "image.c" + goto __catch4_g_error; + } +#line 148 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp4_ = _tmp2_; +#line 148 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = NULL; +#line 148 "/home/jens/Source/shotwell/src/util/image.vala" + _g_object_unref0 (pixbuf); +#line 148 "/home/jens/Source/shotwell/src/util/image.vala" + pixbuf = _tmp4_; +#line 146 "/home/jens/Source/shotwell/src/util/image.vala" + _g_object_unref0 (_tmp2_); +#line 146 "/home/jens/Source/shotwell/src/util/image.vala" + _g_object_unref0 (icon_theme); +#line 328 "image.c" + } + goto __finally4; + __catch4_g_error: + { + GError* _error_ = NULL; + GdkPixbuf* _tmp5_ = NULL; + GError* _tmp6_ = NULL; + const gchar* _tmp7_ = NULL; +#line 146 "/home/jens/Source/shotwell/src/util/image.vala" + _error_ = _inner_error_; +#line 146 "/home/jens/Source/shotwell/src/util/image.vala" + _inner_error_ = NULL; +#line 151 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp5_ = gdk_pixbuf_new_from_xpm_data (fallback_image_missing); +#line 151 "/home/jens/Source/shotwell/src/util/image.vala" + _g_object_unref0 (pixbuf); +#line 151 "/home/jens/Source/shotwell/src/util/image.vala" + pixbuf = _tmp5_; +#line 152 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp6_ = _error_; +#line 152 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp7_ = _tmp6_->message; +#line 152 "/home/jens/Source/shotwell/src/util/image.vala" + g_warning ("image.vala:152: Could not load icon from theme: %s", _tmp7_); +#line 146 "/home/jens/Source/shotwell/src/util/image.vala" + _g_error_free0 (_error_); +#line 355 "image.c" + } + __finally4: +#line 146 "/home/jens/Source/shotwell/src/util/image.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 146 "/home/jens/Source/shotwell/src/util/image.vala" + _g_object_unref0 (pixbuf); +#line 146 "/home/jens/Source/shotwell/src/util/image.vala" + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); +#line 146 "/home/jens/Source/shotwell/src/util/image.vala" + g_clear_error (&_inner_error_); +#line 146 "/home/jens/Source/shotwell/src/util/image.vala" + return NULL; +#line 368 "image.c" + } +#line 155 "/home/jens/Source/shotwell/src/util/image.vala" + result = pixbuf; +#line 155 "/home/jens/Source/shotwell/src/util/image.vala" + return result; +#line 374 "image.c" +} + + +GdkPixbuf* scale_pixbuf (GdkPixbuf* pixbuf, gint scale, GdkInterpType interp, gboolean scale_up) { + GdkPixbuf* result = NULL; + Dimensions original = {0}; + GdkPixbuf* _tmp0_ = NULL; + Dimensions _tmp1_ = {0}; + Dimensions scaled = {0}; + gint _tmp2_ = 0; + gboolean _tmp3_ = FALSE; + Dimensions _tmp4_ = {0}; + gboolean _tmp5_ = FALSE; + Dimensions _tmp6_ = {0}; + gint _tmp7_ = 0; + Dimensions _tmp8_ = {0}; + gint _tmp9_ = 0; + Dimensions _tmp16_ = {0}; + GdkPixbuf* _tmp17_ = NULL; + Dimensions _tmp18_ = {0}; + gint _tmp19_ = 0; + Dimensions _tmp20_ = {0}; + gint _tmp21_ = 0; + GdkInterpType _tmp22_ = 0; + GdkPixbuf* _tmp23_ = NULL; +#line 158 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL); +#line 159 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_ = pixbuf; +#line 159 "/home/jens/Source/shotwell/src/util/image.vala" + dimensions_for_pixbuf (_tmp0_, &_tmp1_); +#line 159 "/home/jens/Source/shotwell/src/util/image.vala" + original = _tmp1_; +#line 160 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = scale; +#line 160 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp3_ = scale_up; +#line 160 "/home/jens/Source/shotwell/src/util/image.vala" + dimensions_get_scaled (&original, _tmp2_, _tmp3_, &_tmp4_); +#line 160 "/home/jens/Source/shotwell/src/util/image.vala" + scaled = _tmp4_; +#line 161 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp6_ = original; +#line 161 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp7_ = _tmp6_.width; +#line 161 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp8_ = scaled; +#line 161 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp9_ = _tmp8_.width; +#line 161 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp7_ == _tmp9_) { +#line 426 "image.c" + Dimensions _tmp10_ = {0}; + gint _tmp11_ = 0; + Dimensions _tmp12_ = {0}; + gint _tmp13_ = 0; +#line 161 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp10_ = original; +#line 161 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp11_ = _tmp10_.height; +#line 161 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp12_ = scaled; +#line 161 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp13_ = _tmp12_.height; +#line 161 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp5_ = _tmp11_ == _tmp13_; +#line 441 "image.c" + } else { +#line 161 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp5_ = FALSE; +#line 445 "image.c" + } +#line 161 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp5_) { +#line 449 "image.c" + GdkPixbuf* _tmp14_ = NULL; + GdkPixbuf* _tmp15_ = NULL; +#line 162 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp14_ = pixbuf; +#line 162 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp15_ = _g_object_ref0 (_tmp14_); +#line 162 "/home/jens/Source/shotwell/src/util/image.vala" + result = _tmp15_; +#line 162 "/home/jens/Source/shotwell/src/util/image.vala" + return result; +#line 460 "image.c" + } +#line 165 "/home/jens/Source/shotwell/src/util/image.vala" + dimensions_with_min (&scaled, MIN_SCALED_WIDTH, MIN_SCALED_HEIGHT, &_tmp16_); +#line 165 "/home/jens/Source/shotwell/src/util/image.vala" + scaled = _tmp16_; +#line 167 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp17_ = pixbuf; +#line 167 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp18_ = scaled; +#line 167 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp19_ = _tmp18_.width; +#line 167 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp20_ = scaled; +#line 167 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp21_ = _tmp20_.height; +#line 167 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp22_ = interp; +#line 167 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp23_ = gdk_pixbuf_scale_simple (_tmp17_, _tmp19_, _tmp21_, _tmp22_); +#line 167 "/home/jens/Source/shotwell/src/util/image.vala" + result = _tmp23_; +#line 167 "/home/jens/Source/shotwell/src/util/image.vala" + return result; +#line 484 "image.c" +} + + +GdkPixbuf* resize_pixbuf (GdkPixbuf* pixbuf, Dimensions* resized, GdkInterpType interp) { + GdkPixbuf* result = NULL; + Dimensions original = {0}; + GdkPixbuf* _tmp0_ = NULL; + Dimensions _tmp1_ = {0}; + gboolean _tmp2_ = FALSE; + Dimensions _tmp3_ = {0}; + gint _tmp4_ = 0; + Dimensions _tmp5_ = {0}; + gint _tmp6_ = 0; + Dimensions _tmp13_ = {0}; + GdkPixbuf* _tmp14_ = NULL; + Dimensions _tmp15_ = {0}; + gint _tmp16_ = 0; + Dimensions _tmp17_ = {0}; + gint _tmp18_ = 0; + GdkInterpType _tmp19_ = 0; + GdkPixbuf* _tmp20_ = NULL; +#line 170 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL); +#line 170 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_val_if_fail (resized != NULL, NULL); +#line 171 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_ = pixbuf; +#line 171 "/home/jens/Source/shotwell/src/util/image.vala" + dimensions_for_pixbuf (_tmp0_, &_tmp1_); +#line 171 "/home/jens/Source/shotwell/src/util/image.vala" + original = _tmp1_; +#line 172 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp3_ = original; +#line 172 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp4_ = _tmp3_.width; +#line 172 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp5_ = *resized; +#line 172 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp6_ = _tmp5_.width; +#line 172 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp4_ == _tmp6_) { +#line 526 "image.c" + Dimensions _tmp7_ = {0}; + gint _tmp8_ = 0; + Dimensions _tmp9_ = {0}; + gint _tmp10_ = 0; +#line 172 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp7_ = original; +#line 172 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp8_ = _tmp7_.height; +#line 172 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp9_ = *resized; +#line 172 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp10_ = _tmp9_.height; +#line 172 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = _tmp8_ == _tmp10_; +#line 541 "image.c" + } else { +#line 172 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = FALSE; +#line 545 "image.c" + } +#line 172 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp2_) { +#line 549 "image.c" + GdkPixbuf* _tmp11_ = NULL; + GdkPixbuf* _tmp12_ = NULL; +#line 173 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp11_ = pixbuf; +#line 173 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp12_ = _g_object_ref0 (_tmp11_); +#line 173 "/home/jens/Source/shotwell/src/util/image.vala" + result = _tmp12_; +#line 173 "/home/jens/Source/shotwell/src/util/image.vala" + return result; +#line 560 "image.c" + } +#line 176 "/home/jens/Source/shotwell/src/util/image.vala" + dimensions_with_min (resized, MIN_SCALED_WIDTH, MIN_SCALED_HEIGHT, &_tmp13_); +#line 176 "/home/jens/Source/shotwell/src/util/image.vala" + *resized = _tmp13_; +#line 178 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp14_ = pixbuf; +#line 178 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp15_ = *resized; +#line 178 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp16_ = _tmp15_.width; +#line 178 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp17_ = *resized; +#line 178 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp18_ = _tmp17_.height; +#line 178 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp19_ = interp; +#line 178 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp20_ = gdk_pixbuf_scale_simple (_tmp14_, _tmp16_, _tmp18_, _tmp19_); +#line 178 "/home/jens/Source/shotwell/src/util/image.vala" + result = _tmp20_; +#line 178 "/home/jens/Source/shotwell/src/util/image.vala" + return result; +#line 584 "image.c" +} + + +void draw_rounded_corners_filled (cairo_t* ctx, Dimensions* dim, GdkPoint* origin, gdouble radius_proportion) { + cairo_t* _tmp0_ = NULL; + Dimensions _tmp1_ = {0}; + GdkPoint _tmp2_ = {0}; + gdouble _tmp3_ = 0.0; + cairo_t* _tmp4_ = NULL; +#line 183 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_if_fail (ctx != NULL); +#line 183 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_if_fail (dim != NULL); +#line 183 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_if_fail (origin != NULL); +#line 185 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_ = ctx; +#line 185 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp1_ = *dim; +#line 185 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = *origin; +#line 185 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp3_ = radius_proportion; +#line 185 "/home/jens/Source/shotwell/src/util/image.vala" + context_rounded_corners (_tmp0_, &_tmp1_, &_tmp2_, _tmp3_); +#line 186 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp4_ = ctx; +#line 186 "/home/jens/Source/shotwell/src/util/image.vala" + cairo_paint (_tmp4_); +#line 614 "image.c" +} + + +void context_rounded_corners (cairo_t* cx, Dimensions* dim, GdkPoint* origin, gdouble radius_proportion) { + gdouble _tmp0_ = 0.0; + gdouble _tmp1_ = 0.0; + gdouble left = 0.0; + GdkPoint _tmp2_ = {0}; + gint _tmp3_ = 0; + gdouble top = 0.0; + GdkPoint _tmp4_ = {0}; + gint _tmp5_ = 0; + gdouble right = 0.0; + GdkPoint _tmp6_ = {0}; + gint _tmp7_ = 0; + Dimensions _tmp8_ = {0}; + gint _tmp9_ = 0; + gdouble bottom = 0.0; + GdkPoint _tmp10_ = {0}; + gint _tmp11_ = 0; + Dimensions _tmp12_ = {0}; + gint _tmp13_ = 0; + gdouble radius = 0.0; + gint _tmp14_ = 0; + gdouble _tmp15_ = 0.0; + cairo_t* _tmp16_ = NULL; + cairo_t* _tmp17_ = NULL; + cairo_t* _tmp18_ = NULL; + cairo_t* _tmp19_ = NULL; + cairo_t* _tmp20_ = NULL; + cairo_t* _tmp21_ = NULL; +#line 189 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_if_fail (cx != NULL); +#line 189 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_if_fail (dim != NULL); +#line 189 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_if_fail (origin != NULL); +#line 192 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_ = radius_proportion; +#line 192 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp1_ = CLAMP (_tmp0_, 2.0, 100.0); +#line 192 "/home/jens/Source/shotwell/src/util/image.vala" + radius_proportion = _tmp1_; +#line 194 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = *origin; +#line 194 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp3_ = _tmp2_.x; +#line 194 "/home/jens/Source/shotwell/src/util/image.vala" + left = (gdouble) _tmp3_; +#line 195 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp4_ = *origin; +#line 195 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp5_ = _tmp4_.y; +#line 195 "/home/jens/Source/shotwell/src/util/image.vala" + top = (gdouble) _tmp5_; +#line 196 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp6_ = *origin; +#line 196 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp7_ = _tmp6_.x; +#line 196 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp8_ = *dim; +#line 196 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp9_ = _tmp8_.width; +#line 196 "/home/jens/Source/shotwell/src/util/image.vala" + right = (gdouble) (_tmp7_ + _tmp9_); +#line 197 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp10_ = *origin; +#line 197 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp11_ = _tmp10_.y; +#line 197 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp12_ = *dim; +#line 197 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp13_ = _tmp12_.height; +#line 197 "/home/jens/Source/shotwell/src/util/image.vala" + bottom = (gdouble) (_tmp11_ + _tmp13_); +#line 200 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp14_ = dimensions_minor_axis (dim); +#line 200 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp15_ = radius_proportion; +#line 200 "/home/jens/Source/shotwell/src/util/image.vala" + radius = ((gdouble) _tmp14_) / _tmp15_; +#line 204 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp16_ = cx; +#line 204 "/home/jens/Source/shotwell/src/util/image.vala" + cairo_move_to (_tmp16_, left, top); +#line 205 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp17_ = cx; +#line 205 "/home/jens/Source/shotwell/src/util/image.vala" + cairo_arc (_tmp17_, right - radius, top + radius, radius, -90 * DEGREE, 0 * DEGREE); +#line 206 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp18_ = cx; +#line 206 "/home/jens/Source/shotwell/src/util/image.vala" + cairo_arc (_tmp18_, right - radius, bottom - radius, radius, 0 * DEGREE, 90 * DEGREE); +#line 207 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp19_ = cx; +#line 207 "/home/jens/Source/shotwell/src/util/image.vala" + cairo_arc (_tmp19_, left + radius, bottom - radius, radius, 90 * DEGREE, 180 * DEGREE); +#line 208 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp20_ = cx; +#line 208 "/home/jens/Source/shotwell/src/util/image.vala" + cairo_arc (_tmp20_, left + radius, top + radius, radius, 180 * DEGREE, 270 * DEGREE); +#line 209 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp21_ = cx; +#line 209 "/home/jens/Source/shotwell/src/util/image.vala" + cairo_clip (_tmp21_); +#line 720 "image.c" +} + + +inline guchar shift_color_byte (gint b, gint shift) { + guchar result = '\0'; + gint _tmp0_ = 0; + gint _tmp1_ = 0; + gint _tmp2_ = 0; +#line 213 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_ = b; +#line 213 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp1_ = shift; +#line 213 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = CLAMP (_tmp0_ + _tmp1_, 0, 255); +#line 213 "/home/jens/Source/shotwell/src/util/image.vala" + result = (guchar) _tmp2_; +#line 213 "/home/jens/Source/shotwell/src/util/image.vala" + return result; +#line 739 "image.c" +} + + +void shift_colors (GdkPixbuf* pixbuf, gint red, gint green, gint blue, gint alpha) { + gboolean _tmp0_ = FALSE; + gint _tmp1_ = 0; + gboolean _tmp3_ = FALSE; + gint _tmp4_ = 0; + gboolean _tmp6_ = FALSE; + gint _tmp7_ = 0; + gboolean _tmp9_ = FALSE; + gint _tmp10_ = 0; + gint width = 0; + GdkPixbuf* _tmp12_ = NULL; + gint _tmp13_ = 0; + gint height = 0; + GdkPixbuf* _tmp14_ = NULL; + gint _tmp15_ = 0; + gint rowstride = 0; + GdkPixbuf* _tmp16_ = NULL; + gint _tmp17_ = 0; + gint channels = 0; + GdkPixbuf* _tmp18_ = NULL; + gint _tmp19_ = 0; + guchar* pixels = NULL; + GdkPixbuf* _tmp20_ = NULL; + guint8* _tmp21_ = NULL; + gint _tmp22_ = 0; + GdkPixbuf* _tmp23_ = NULL; + GdkColorspace _tmp24_ = 0; + GdkPixbuf* _tmp25_ = NULL; + gint _tmp26_ = 0; +#line 216 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_if_fail (GDK_IS_PIXBUF (pixbuf)); +#line 217 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp1_ = red; +#line 217 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp1_ >= -255) { +#line 778 "image.c" + gint _tmp2_ = 0; +#line 217 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = red; +#line 217 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_ = _tmp2_ <= 255; +#line 784 "image.c" + } else { +#line 217 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_ = FALSE; +#line 788 "image.c" + } +#line 217 "/home/jens/Source/shotwell/src/util/image.vala" + _vala_assert (_tmp0_, "red >= -255 && red <= 255"); +#line 218 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp4_ = green; +#line 218 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp4_ >= -255) { +#line 796 "image.c" + gint _tmp5_ = 0; +#line 218 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp5_ = green; +#line 218 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp3_ = _tmp5_ <= 255; +#line 802 "image.c" + } else { +#line 218 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp3_ = FALSE; +#line 806 "image.c" + } +#line 218 "/home/jens/Source/shotwell/src/util/image.vala" + _vala_assert (_tmp3_, "green >= -255 && green <= 255"); +#line 219 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp7_ = blue; +#line 219 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp7_ >= -255) { +#line 814 "image.c" + gint _tmp8_ = 0; +#line 219 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp8_ = blue; +#line 219 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp6_ = _tmp8_ <= 255; +#line 820 "image.c" + } else { +#line 219 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp6_ = FALSE; +#line 824 "image.c" + } +#line 219 "/home/jens/Source/shotwell/src/util/image.vala" + _vala_assert (_tmp6_, "blue >= -255 && blue <= 255"); +#line 220 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp10_ = alpha; +#line 220 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp10_ >= -255) { +#line 832 "image.c" + gint _tmp11_ = 0; +#line 220 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp11_ = alpha; +#line 220 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp9_ = _tmp11_ <= 255; +#line 838 "image.c" + } else { +#line 220 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp9_ = FALSE; +#line 842 "image.c" + } +#line 220 "/home/jens/Source/shotwell/src/util/image.vala" + _vala_assert (_tmp9_, "alpha >= -255 && alpha <= 255"); +#line 222 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp12_ = pixbuf; +#line 222 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp13_ = gdk_pixbuf_get_width (_tmp12_); +#line 222 "/home/jens/Source/shotwell/src/util/image.vala" + width = _tmp13_; +#line 223 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp14_ = pixbuf; +#line 223 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp15_ = gdk_pixbuf_get_height (_tmp14_); +#line 223 "/home/jens/Source/shotwell/src/util/image.vala" + height = _tmp15_; +#line 224 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp16_ = pixbuf; +#line 224 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp17_ = gdk_pixbuf_get_rowstride (_tmp16_); +#line 224 "/home/jens/Source/shotwell/src/util/image.vala" + rowstride = _tmp17_; +#line 225 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp18_ = pixbuf; +#line 225 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp19_ = gdk_pixbuf_get_n_channels (_tmp18_); +#line 225 "/home/jens/Source/shotwell/src/util/image.vala" + channels = _tmp19_; +#line 226 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp20_ = pixbuf; +#line 226 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp21_ = gdk_pixbuf_get_pixels (_tmp20_); +#line 226 "/home/jens/Source/shotwell/src/util/image.vala" + pixels = _tmp21_; +#line 228 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp22_ = channels; +#line 228 "/home/jens/Source/shotwell/src/util/image.vala" + _vala_assert (_tmp22_ >= 3, "channels >= 3"); +#line 229 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp23_ = pixbuf; +#line 229 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp24_ = gdk_pixbuf_get_colorspace (_tmp23_); +#line 229 "/home/jens/Source/shotwell/src/util/image.vala" + _vala_assert (_tmp24_ == GDK_COLORSPACE_RGB, "pixbuf.get_colorspace() == Gdk.Colorspace.RGB"); +#line 230 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp25_ = pixbuf; +#line 230 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp26_ = gdk_pixbuf_get_bits_per_sample (_tmp25_); +#line 230 "/home/jens/Source/shotwell/src/util/image.vala" + _vala_assert (_tmp26_ == 8, "pixbuf.get_bits_per_sample() == 8"); +#line 892 "image.c" + { + gint y = 0; +#line 232 "/home/jens/Source/shotwell/src/util/image.vala" + y = 0; +#line 897 "image.c" + { + gboolean _tmp27_ = FALSE; +#line 232 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp27_ = TRUE; +#line 232 "/home/jens/Source/shotwell/src/util/image.vala" + while (TRUE) { +#line 904 "image.c" + gint _tmp29_ = 0; + gint _tmp30_ = 0; + gint y_offset = 0; + gint _tmp31_ = 0; + gint _tmp32_ = 0; +#line 232 "/home/jens/Source/shotwell/src/util/image.vala" + if (!_tmp27_) { +#line 912 "image.c" + gint _tmp28_ = 0; +#line 232 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp28_ = y; +#line 232 "/home/jens/Source/shotwell/src/util/image.vala" + y = _tmp28_ + 1; +#line 918 "image.c" + } +#line 232 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp27_ = FALSE; +#line 232 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp29_ = y; +#line 232 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp30_ = height; +#line 232 "/home/jens/Source/shotwell/src/util/image.vala" + if (!(_tmp29_ < _tmp30_)) { +#line 232 "/home/jens/Source/shotwell/src/util/image.vala" + break; +#line 930 "image.c" + } +#line 233 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp31_ = y; +#line 233 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp32_ = rowstride; +#line 233 "/home/jens/Source/shotwell/src/util/image.vala" + y_offset = _tmp31_ * _tmp32_; +#line 938 "image.c" + { + gint x = 0; +#line 235 "/home/jens/Source/shotwell/src/util/image.vala" + x = 0; +#line 943 "image.c" + { + gboolean _tmp33_ = FALSE; +#line 235 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp33_ = TRUE; +#line 235 "/home/jens/Source/shotwell/src/util/image.vala" + while (TRUE) { +#line 950 "image.c" + gint _tmp35_ = 0; + gint _tmp36_ = 0; + gint offset = 0; + gint _tmp37_ = 0; + gint _tmp38_ = 0; + gint _tmp39_ = 0; + gint _tmp40_ = 0; + gint _tmp49_ = 0; + gint _tmp58_ = 0; + gboolean _tmp67_ = FALSE; + gint _tmp68_ = 0; +#line 235 "/home/jens/Source/shotwell/src/util/image.vala" + if (!_tmp33_) { +#line 964 "image.c" + gint _tmp34_ = 0; +#line 235 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp34_ = x; +#line 235 "/home/jens/Source/shotwell/src/util/image.vala" + x = _tmp34_ + 1; +#line 970 "image.c" + } +#line 235 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp33_ = FALSE; +#line 235 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp35_ = x; +#line 235 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp36_ = width; +#line 235 "/home/jens/Source/shotwell/src/util/image.vala" + if (!(_tmp35_ < _tmp36_)) { +#line 235 "/home/jens/Source/shotwell/src/util/image.vala" + break; +#line 982 "image.c" + } +#line 236 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp37_ = y_offset; +#line 236 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp38_ = x; +#line 236 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp39_ = channels; +#line 236 "/home/jens/Source/shotwell/src/util/image.vala" + offset = _tmp37_ + (_tmp38_ * _tmp39_); +#line 238 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp40_ = red; +#line 238 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp40_ != 0) { +#line 996 "image.c" + guchar* _tmp41_ = NULL; + gint _tmp42_ = 0; + guchar* _tmp43_ = NULL; + gint _tmp44_ = 0; + guchar _tmp45_ = '\0'; + gint _tmp46_ = 0; + guchar _tmp47_ = '\0'; + guchar _tmp48_ = '\0'; +#line 239 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp41_ = pixels; +#line 239 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp42_ = offset; +#line 239 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp43_ = pixels; +#line 239 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp44_ = offset; +#line 239 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp45_ = _tmp43_[_tmp44_]; +#line 239 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp46_ = red; +#line 239 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp47_ = shift_color_byte ((gint) _tmp45_, _tmp46_); +#line 239 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp41_[_tmp42_] = _tmp47_; +#line 239 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp48_ = _tmp41_[_tmp42_]; +#line 1023 "image.c" + } +#line 241 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp49_ = green; +#line 241 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp49_ != 0) { +#line 1029 "image.c" + guchar* _tmp50_ = NULL; + gint _tmp51_ = 0; + guchar* _tmp52_ = NULL; + gint _tmp53_ = 0; + guchar _tmp54_ = '\0'; + gint _tmp55_ = 0; + guchar _tmp56_ = '\0'; + guchar _tmp57_ = '\0'; +#line 242 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp50_ = pixels; +#line 242 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp51_ = offset; +#line 242 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp52_ = pixels; +#line 242 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp53_ = offset; +#line 242 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp54_ = _tmp52_[_tmp53_ + 1]; +#line 242 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp55_ = green; +#line 242 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp56_ = shift_color_byte ((gint) _tmp54_, _tmp55_); +#line 242 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp50_[_tmp51_ + 1] = _tmp56_; +#line 242 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp57_ = _tmp50_[_tmp51_ + 1]; +#line 1056 "image.c" + } +#line 244 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp58_ = blue; +#line 244 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp58_ != 0) { +#line 1062 "image.c" + guchar* _tmp59_ = NULL; + gint _tmp60_ = 0; + guchar* _tmp61_ = NULL; + gint _tmp62_ = 0; + guchar _tmp63_ = '\0'; + gint _tmp64_ = 0; + guchar _tmp65_ = '\0'; + guchar _tmp66_ = '\0'; +#line 245 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp59_ = pixels; +#line 245 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp60_ = offset; +#line 245 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp61_ = pixels; +#line 245 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp62_ = offset; +#line 245 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp63_ = _tmp61_[_tmp62_ + 2]; +#line 245 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp64_ = blue; +#line 245 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp65_ = shift_color_byte ((gint) _tmp63_, _tmp64_); +#line 245 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp59_[_tmp60_ + 2] = _tmp65_; +#line 245 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp66_ = _tmp59_[_tmp60_ + 2]; +#line 1089 "image.c" + } +#line 247 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp68_ = alpha; +#line 247 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp68_ != 0) { +#line 1095 "image.c" + gint _tmp69_ = 0; +#line 247 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp69_ = channels; +#line 247 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp67_ = _tmp69_ >= 4; +#line 1101 "image.c" + } else { +#line 247 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp67_ = FALSE; +#line 1105 "image.c" + } +#line 247 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp67_) { +#line 1109 "image.c" + guchar* _tmp70_ = NULL; + gint _tmp71_ = 0; + guchar* _tmp72_ = NULL; + gint _tmp73_ = 0; + guchar _tmp74_ = '\0'; + gint _tmp75_ = 0; + guchar _tmp76_ = '\0'; + guchar _tmp77_ = '\0'; +#line 248 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp70_ = pixels; +#line 248 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp71_ = offset; +#line 248 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp72_ = pixels; +#line 248 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp73_ = offset; +#line 248 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp74_ = _tmp72_[_tmp73_ + 3]; +#line 248 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp75_ = alpha; +#line 248 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp76_ = shift_color_byte ((gint) _tmp74_, _tmp75_); +#line 248 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp70_[_tmp71_ + 3] = _tmp76_; +#line 248 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp77_ = _tmp70_[_tmp71_ + 3]; +#line 1136 "image.c" + } + } + } + } + } + } + } +} + + +void dim_pixbuf (GdkPixbuf* pixbuf) { + PixelTransformer* transformer = NULL; + PixelTransformer* _tmp0_ = NULL; + SaturationTransformation* sat = NULL; + SaturationTransformation* _tmp1_ = NULL; + GdkPixbuf* _tmp2_ = NULL; + GdkPixbuf* _tmp3_ = NULL; +#line 253 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_if_fail (GDK_IS_PIXBUF (pixbuf)); +#line 254 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_ = pixel_transformer_new (); +#line 254 "/home/jens/Source/shotwell/src/util/image.vala" + transformer = _tmp0_; +#line 255 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp1_ = saturation_transformation_new (SATURATION_TRANSFORMATION_MIN_PARAMETER); +#line 255 "/home/jens/Source/shotwell/src/util/image.vala" + sat = _tmp1_; +#line 256 "/home/jens/Source/shotwell/src/util/image.vala" + pixel_transformer_attach_transformation (transformer, G_TYPE_CHECK_INSTANCE_CAST (sat, TYPE_PIXEL_TRANSFORMATION, PixelTransformation)); +#line 257 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = pixbuf; +#line 257 "/home/jens/Source/shotwell/src/util/image.vala" + pixel_transformer_transform_pixbuf (transformer, _tmp2_, NULL); +#line 258 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp3_ = pixbuf; +#line 258 "/home/jens/Source/shotwell/src/util/image.vala" + shift_colors (_tmp3_, 0, 0, 0, -100); +#line 253 "/home/jens/Source/shotwell/src/util/image.vala" + _pixel_transformation_unref0 (sat); +#line 253 "/home/jens/Source/shotwell/src/util/image.vala" + _pixel_transformer_unref0 (transformer); +#line 1178 "image.c" +} + + +gboolean coord_in_rectangle (gint x, gint y, GdkRectangle* rect) { + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; + gboolean _tmp1_ = FALSE; + gboolean _tmp2_ = FALSE; + gint _tmp3_ = 0; + GdkRectangle _tmp4_ = {0}; + gint _tmp5_ = 0; +#line 261 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_val_if_fail (rect != NULL, FALSE); +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp3_ = x; +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp4_ = *rect; +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp5_ = _tmp4_.x; +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp3_ >= _tmp5_) { +#line 1200 "image.c" + gint _tmp6_ = 0; + GdkRectangle _tmp7_ = {0}; + gint _tmp8_ = 0; + GdkRectangle _tmp9_ = {0}; + gint _tmp10_ = 0; +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp6_ = x; +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp7_ = *rect; +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp8_ = _tmp7_.x; +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp9_ = *rect; +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp10_ = _tmp9_.width; +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = _tmp6_ < (_tmp8_ + _tmp10_); +#line 1218 "image.c" + } else { +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = FALSE; +#line 1222 "image.c" + } +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp2_) { +#line 1226 "image.c" + gint _tmp11_ = 0; + GdkRectangle _tmp12_ = {0}; + gint _tmp13_ = 0; +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp11_ = y; +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp12_ = *rect; +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp13_ = _tmp12_.y; +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp1_ = _tmp11_ >= _tmp13_; +#line 1238 "image.c" + } else { +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp1_ = FALSE; +#line 1242 "image.c" + } +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp1_) { +#line 1246 "image.c" + gint _tmp14_ = 0; + GdkRectangle _tmp15_ = {0}; + gint _tmp16_ = 0; + GdkRectangle _tmp17_ = {0}; + gint _tmp18_ = 0; +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp14_ = y; +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp15_ = *rect; +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp16_ = _tmp15_.y; +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp17_ = *rect; +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp18_ = _tmp17_.height; +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_ = _tmp14_ <= (_tmp16_ + _tmp18_); +#line 1264 "image.c" + } else { +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_ = FALSE; +#line 1268 "image.c" + } +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + result = _tmp0_; +#line 262 "/home/jens/Source/shotwell/src/util/image.vala" + return result; +#line 1274 "image.c" +} + + +gboolean rectangles_equal (GdkRectangle* a, GdkRectangle* b) { + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; + gboolean _tmp1_ = FALSE; + gboolean _tmp2_ = FALSE; + GdkRectangle _tmp3_ = {0}; + gint _tmp4_ = 0; + GdkRectangle _tmp5_ = {0}; + gint _tmp6_ = 0; +#line 265 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_val_if_fail (a != NULL, FALSE); +#line 265 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_val_if_fail (b != NULL, FALSE); +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp3_ = *a; +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp4_ = _tmp3_.x; +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp5_ = *b; +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp6_ = _tmp5_.x; +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp4_ == _tmp6_) { +#line 1301 "image.c" + GdkRectangle _tmp7_ = {0}; + gint _tmp8_ = 0; + GdkRectangle _tmp9_ = {0}; + gint _tmp10_ = 0; +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp7_ = *a; +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp8_ = _tmp7_.y; +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp9_ = *b; +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp10_ = _tmp9_.y; +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = _tmp8_ == _tmp10_; +#line 1316 "image.c" + } else { +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = FALSE; +#line 1320 "image.c" + } +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp2_) { +#line 1324 "image.c" + GdkRectangle _tmp11_ = {0}; + gint _tmp12_ = 0; + GdkRectangle _tmp13_ = {0}; + gint _tmp14_ = 0; +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp11_ = *a; +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp12_ = _tmp11_.width; +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp13_ = *b; +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp14_ = _tmp13_.width; +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp1_ = _tmp12_ == _tmp14_; +#line 1339 "image.c" + } else { +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp1_ = FALSE; +#line 1343 "image.c" + } +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp1_) { +#line 1347 "image.c" + GdkRectangle _tmp15_ = {0}; + gint _tmp16_ = 0; + GdkRectangle _tmp17_ = {0}; + gint _tmp18_ = 0; +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp15_ = *a; +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp16_ = _tmp15_.height; +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp17_ = *b; +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp18_ = _tmp17_.height; +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_ = _tmp16_ == _tmp18_; +#line 1362 "image.c" + } else { +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_ = FALSE; +#line 1366 "image.c" + } +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + result = _tmp0_; +#line 266 "/home/jens/Source/shotwell/src/util/image.vala" + return result; +#line 1372 "image.c" +} + + +gchar* rectangle_to_string (GdkRectangle* rect) { + gchar* result = NULL; + GdkRectangle _tmp0_ = {0}; + gint _tmp1_ = 0; + GdkRectangle _tmp2_ = {0}; + gint _tmp3_ = 0; + GdkRectangle _tmp4_ = {0}; + gint _tmp5_ = 0; + GdkRectangle _tmp6_ = {0}; + gint _tmp7_ = 0; + gchar* _tmp8_ = NULL; +#line 269 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_val_if_fail (rect != NULL, NULL); +#line 270 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_ = *rect; +#line 270 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp1_ = _tmp0_.x; +#line 270 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = *rect; +#line 270 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp3_ = _tmp2_.y; +#line 270 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp4_ = *rect; +#line 270 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp5_ = _tmp4_.width; +#line 270 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp6_ = *rect; +#line 270 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp7_ = _tmp6_.height; +#line 270 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp8_ = g_strdup_printf ("%d,%d %dx%d", _tmp1_, _tmp3_, _tmp5_, _tmp7_); +#line 270 "/home/jens/Source/shotwell/src/util/image.vala" + result = _tmp8_; +#line 270 "/home/jens/Source/shotwell/src/util/image.vala" + return result; +#line 1411 "image.c" +} + + +void clamp_rectangle (GdkRectangle* original, Dimensions* max, GdkRectangle* result) { + GdkRectangle rect = {0}; + GdkRectangle _tmp0_ = {0}; + gint _tmp1_ = 0; + Dimensions _tmp2_ = {0}; + gint _tmp3_ = 0; + gint _tmp4_ = 0; + GdkRectangle _tmp5_ = {0}; + gint _tmp6_ = 0; + Dimensions _tmp7_ = {0}; + gint _tmp8_ = 0; + gint _tmp9_ = 0; + GdkRectangle _tmp10_ = {0}; + gint _tmp11_ = 0; + Dimensions _tmp12_ = {0}; + gint _tmp13_ = 0; + gint _tmp14_ = 0; + GdkRectangle _tmp15_ = {0}; + gint _tmp16_ = 0; + Dimensions _tmp17_ = {0}; + gint _tmp18_ = 0; + gint _tmp19_ = 0; +#line 273 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_if_fail (original != NULL); +#line 273 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_if_fail (max != NULL); +#line 274 "/home/jens/Source/shotwell/src/util/image.vala" + memset (&rect, 0, sizeof (GdkRectangle)); +#line 275 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_ = *original; +#line 275 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp1_ = _tmp0_.x; +#line 275 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = *max; +#line 275 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp3_ = _tmp2_.width; +#line 275 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp4_ = CLAMP (_tmp1_, 0, _tmp3_); +#line 275 "/home/jens/Source/shotwell/src/util/image.vala" + rect.x = _tmp4_; +#line 276 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp5_ = *original; +#line 276 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp6_ = _tmp5_.y; +#line 276 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp7_ = *max; +#line 276 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp8_ = _tmp7_.height; +#line 276 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp9_ = CLAMP (_tmp6_, 0, _tmp8_); +#line 276 "/home/jens/Source/shotwell/src/util/image.vala" + rect.y = _tmp9_; +#line 277 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp10_ = *original; +#line 277 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp11_ = _tmp10_.width; +#line 277 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp12_ = *max; +#line 277 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp13_ = _tmp12_.width; +#line 277 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp14_ = CLAMP (_tmp11_, 0, _tmp13_); +#line 277 "/home/jens/Source/shotwell/src/util/image.vala" + rect.width = _tmp14_; +#line 278 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp15_ = *original; +#line 278 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp16_ = _tmp15_.height; +#line 278 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp17_ = *max; +#line 278 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp18_ = _tmp17_.height; +#line 278 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp19_ = CLAMP (_tmp16_, 0, _tmp18_); +#line 278 "/home/jens/Source/shotwell/src/util/image.vala" + rect.height = _tmp19_; +#line 280 "/home/jens/Source/shotwell/src/util/image.vala" + *result = rect; +#line 280 "/home/jens/Source/shotwell/src/util/image.vala" + return; +#line 1495 "image.c" +} + + +void scale_point (GdkPoint* p, gdouble factor, GdkPoint* result) { + GdkPoint _result_ = {0}; + GdkPoint _tmp0_ = {0}; + gdouble _tmp1_ = 0.0; + GdkPoint _tmp2_ = {0}; + gint _tmp3_ = 0; + gdouble _tmp4_ = 0.0; + GdkPoint _tmp5_ = {0}; + gint _tmp6_ = 0; +#line 283 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_if_fail (p != NULL); +#line 284 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_.x = 0; +#line 284 "/home/jens/Source/shotwell/src/util/image.vala" + _result_ = _tmp0_; +#line 285 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp1_ = factor; +#line 285 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = *p; +#line 285 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp3_ = _tmp2_.x; +#line 285 "/home/jens/Source/shotwell/src/util/image.vala" + _result_.x = (gint) ((_tmp1_ * _tmp3_) + 0.5); +#line 286 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp4_ = factor; +#line 286 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp5_ = *p; +#line 286 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp6_ = _tmp5_.y; +#line 286 "/home/jens/Source/shotwell/src/util/image.vala" + _result_.y = (gint) ((_tmp4_ * _tmp6_) + 0.5); +#line 288 "/home/jens/Source/shotwell/src/util/image.vala" + *result = _result_; +#line 288 "/home/jens/Source/shotwell/src/util/image.vala" + return; +#line 1534 "image.c" +} + + +void add_points (GdkPoint* p1, GdkPoint* p2, GdkPoint* result) { + GdkPoint _result_ = {0}; + GdkPoint _tmp0_ = {0}; + GdkPoint _tmp1_ = {0}; + gint _tmp2_ = 0; + GdkPoint _tmp3_ = {0}; + gint _tmp4_ = 0; + GdkPoint _tmp5_ = {0}; + gint _tmp6_ = 0; + GdkPoint _tmp7_ = {0}; + gint _tmp8_ = 0; +#line 291 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_if_fail (p1 != NULL); +#line 291 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_if_fail (p2 != NULL); +#line 292 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_.x = 0; +#line 292 "/home/jens/Source/shotwell/src/util/image.vala" + _result_ = _tmp0_; +#line 293 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp1_ = *p1; +#line 293 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = _tmp1_.x; +#line 293 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp3_ = *p2; +#line 293 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp4_ = _tmp3_.x; +#line 293 "/home/jens/Source/shotwell/src/util/image.vala" + _result_.x = _tmp2_ + _tmp4_; +#line 294 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp5_ = *p1; +#line 294 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp6_ = _tmp5_.y; +#line 294 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp7_ = *p2; +#line 294 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp8_ = _tmp7_.y; +#line 294 "/home/jens/Source/shotwell/src/util/image.vala" + _result_.y = _tmp6_ + _tmp8_; +#line 296 "/home/jens/Source/shotwell/src/util/image.vala" + *result = _result_; +#line 296 "/home/jens/Source/shotwell/src/util/image.vala" + return; +#line 1581 "image.c" +} + + +void subtract_points (GdkPoint* p1, GdkPoint* p2, GdkPoint* result) { + GdkPoint _result_ = {0}; + GdkPoint _tmp0_ = {0}; + GdkPoint _tmp1_ = {0}; + gint _tmp2_ = 0; + GdkPoint _tmp3_ = {0}; + gint _tmp4_ = 0; + GdkPoint _tmp5_ = {0}; + gint _tmp6_ = 0; + GdkPoint _tmp7_ = {0}; + gint _tmp8_ = 0; +#line 299 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_if_fail (p1 != NULL); +#line 299 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_if_fail (p2 != NULL); +#line 300 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_.x = 0; +#line 300 "/home/jens/Source/shotwell/src/util/image.vala" + _result_ = _tmp0_; +#line 301 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp1_ = *p1; +#line 301 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = _tmp1_.x; +#line 301 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp3_ = *p2; +#line 301 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp4_ = _tmp3_.x; +#line 301 "/home/jens/Source/shotwell/src/util/image.vala" + _result_.x = _tmp2_ - _tmp4_; +#line 302 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp5_ = *p1; +#line 302 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp6_ = _tmp5_.y; +#line 302 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp7_ = *p2; +#line 302 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp8_ = _tmp7_.y; +#line 302 "/home/jens/Source/shotwell/src/util/image.vala" + _result_.y = _tmp6_ - _tmp8_; +#line 304 "/home/jens/Source/shotwell/src/util/image.vala" + *result = _result_; +#line 304 "/home/jens/Source/shotwell/src/util/image.vala" + return; +#line 1628 "image.c" +} + + +void fix_cairo_pixbuf (GdkPixbuf* pixbuf) { + guchar* gdk_pixels = NULL; + GdkPixbuf* _tmp0_ = NULL; + void* _tmp1_ = NULL; + void* _tmp2_ = NULL; +#line 308 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_if_fail (GDK_IS_PIXBUF (pixbuf)); +#line 309 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_ = pixbuf; +#line 309 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp1_ = gdk_pixbuf_get_pixels (_tmp0_); +#line 309 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = _tmp1_; +#line 309 "/home/jens/Source/shotwell/src/util/image.vala" + gdk_pixels = _tmp2_; +#line 1647 "image.c" + { + gint j = 0; +#line 310 "/home/jens/Source/shotwell/src/util/image.vala" + j = 0; +#line 1652 "image.c" + { + gboolean _tmp3_ = FALSE; +#line 310 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp3_ = TRUE; +#line 310 "/home/jens/Source/shotwell/src/util/image.vala" + while (TRUE) { +#line 1659 "image.c" + gint _tmp5_ = 0; + GdkPixbuf* _tmp6_ = NULL; + gint _tmp7_ = 0; + gint _tmp8_ = 0; + guchar* p = NULL; + guchar* _tmp9_ = NULL; + guchar* end = NULL; + guchar* _tmp10_ = NULL; + GdkPixbuf* _tmp11_ = NULL; + gint _tmp12_ = 0; + gint _tmp13_ = 0; + guchar* _tmp26_ = NULL; + GdkPixbuf* _tmp27_ = NULL; + gint _tmp28_ = 0; + gint _tmp29_ = 0; +#line 310 "/home/jens/Source/shotwell/src/util/image.vala" + if (!_tmp3_) { +#line 1677 "image.c" + gint _tmp4_ = 0; +#line 310 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp4_ = j; +#line 310 "/home/jens/Source/shotwell/src/util/image.vala" + j = _tmp4_ + 1; +#line 1683 "image.c" + } +#line 310 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp3_ = FALSE; +#line 310 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp5_ = j; +#line 310 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp6_ = pixbuf; +#line 310 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp7_ = gdk_pixbuf_get_height (_tmp6_); +#line 310 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp8_ = _tmp7_; +#line 310 "/home/jens/Source/shotwell/src/util/image.vala" + if (!(_tmp5_ < _tmp8_)) { +#line 310 "/home/jens/Source/shotwell/src/util/image.vala" + break; +#line 1699 "image.c" + } +#line 311 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp9_ = gdk_pixels; +#line 311 "/home/jens/Source/shotwell/src/util/image.vala" + p = _tmp9_; +#line 312 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp10_ = p; +#line 312 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp11_ = pixbuf; +#line 312 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp12_ = gdk_pixbuf_get_width (_tmp11_); +#line 312 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp13_ = _tmp12_; +#line 312 "/home/jens/Source/shotwell/src/util/image.vala" + end = _tmp10_ + (4 * _tmp13_); +#line 314 "/home/jens/Source/shotwell/src/util/image.vala" + while (TRUE) { +#line 1717 "image.c" + guchar* _tmp14_ = NULL; + guchar* _tmp15_ = NULL; + guchar tmp = '\0'; + guchar* _tmp16_ = NULL; + guchar _tmp17_ = '\0'; + guchar* _tmp18_ = NULL; + guchar* _tmp19_ = NULL; + guchar _tmp20_ = '\0'; + guchar _tmp21_ = '\0'; + guchar* _tmp22_ = NULL; + guchar _tmp23_ = '\0'; + guchar _tmp24_ = '\0'; + guchar* _tmp25_ = NULL; +#line 314 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp14_ = p; +#line 314 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp15_ = end; +#line 314 "/home/jens/Source/shotwell/src/util/image.vala" + if (!(_tmp14_ < _tmp15_)) { +#line 314 "/home/jens/Source/shotwell/src/util/image.vala" + break; +#line 1739 "image.c" + } +#line 315 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp16_ = p; +#line 315 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp17_ = _tmp16_[0]; +#line 315 "/home/jens/Source/shotwell/src/util/image.vala" + tmp = _tmp17_; +#line 317 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp18_ = p; +#line 317 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp19_ = p; +#line 317 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp20_ = _tmp19_[2]; +#line 317 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp18_[0] = _tmp20_; +#line 317 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp21_ = _tmp18_[0]; +#line 318 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp22_ = p; +#line 318 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp23_ = tmp; +#line 318 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp22_[2] = _tmp23_; +#line 318 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp24_ = _tmp22_[2]; +#line 325 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp25_ = p; +#line 325 "/home/jens/Source/shotwell/src/util/image.vala" + p = _tmp25_ + 4; +#line 1769 "image.c" + } +#line 328 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp26_ = gdk_pixels; +#line 328 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp27_ = pixbuf; +#line 328 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp28_ = gdk_pixbuf_get_rowstride (_tmp27_); +#line 328 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp29_ = _tmp28_; +#line 328 "/home/jens/Source/shotwell/src/util/image.vala" + gdk_pixels = _tmp26_ + _tmp29_; +#line 1781 "image.c" + } + } + } +} + + +/** + * Finds the size of the smallest axially-aligned rectangle that could contain + * a rectangle src_width by src_height, rotated by angle. + * + * @param src_width The width of the incoming rectangle. + * @param src_height The height of the incoming rectangle. + * @param angle The amount to rotate by, given in degrees. + * @param dest_width The width of the computed rectangle. + * @param dest_height The height of the computed rectangle. + */ +void compute_arb_rotated_size (gdouble src_width, gdouble src_height, gdouble angle, gdouble* dest_width, gdouble* dest_height) { + gdouble _vala_dest_width = 0.0; + gdouble _vala_dest_height = 0.0; + gdouble _tmp0_ = 0.0; + gdouble _tmp1_ = 0.0; + gdouble _tmp2_ = 0.0; + gdouble _tmp3_ = 0.0; + gdouble _tmp4_ = 0.0; + gdouble _tmp5_ = 0.0; + gdouble _tmp6_ = 0.0; + gdouble _tmp7_ = 0.0; + gdouble _tmp8_ = 0.0; + gdouble _tmp9_ = 0.0; + gdouble _tmp10_ = 0.0; + gdouble _tmp11_ = 0.0; + gdouble _tmp12_ = 0.0; + gdouble _tmp13_ = 0.0; + gdouble _tmp14_ = 0.0; + gdouble _tmp15_ = 0.0; +#line 345 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_ = angle; +#line 345 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp1_ = degrees_to_radians (_tmp0_); +#line 345 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = fabs (_tmp1_); +#line 345 "/home/jens/Source/shotwell/src/util/image.vala" + angle = _tmp2_; +#line 346 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp3_ = angle; +#line 346 "/home/jens/Source/shotwell/src/util/image.vala" + _vala_assert (_tmp3_ <= G_PI_2, "angle <= Math.PI_2"); +#line 347 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp4_ = src_width; +#line 347 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp5_ = angle; +#line 347 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp6_ = cos (_tmp5_); +#line 347 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp7_ = src_height; +#line 347 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp8_ = angle; +#line 347 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp9_ = sin (_tmp8_); +#line 347 "/home/jens/Source/shotwell/src/util/image.vala" + _vala_dest_width = (_tmp4_ * _tmp6_) + (_tmp7_ * _tmp9_); +#line 348 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp10_ = src_height; +#line 348 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp11_ = angle; +#line 348 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp12_ = cos (_tmp11_); +#line 348 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp13_ = src_width; +#line 348 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp14_ = angle; +#line 348 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp15_ = sin (_tmp14_); +#line 348 "/home/jens/Source/shotwell/src/util/image.vala" + _vala_dest_height = (_tmp10_ * _tmp12_) + (_tmp13_ * _tmp15_); +#line 342 "/home/jens/Source/shotwell/src/util/image.vala" + if (dest_width) { +#line 342 "/home/jens/Source/shotwell/src/util/image.vala" + *dest_width = _vala_dest_width; +#line 1861 "image.c" + } +#line 342 "/home/jens/Source/shotwell/src/util/image.vala" + if (dest_height) { +#line 342 "/home/jens/Source/shotwell/src/util/image.vala" + *dest_height = _vala_dest_height; +#line 1867 "image.c" + } +} + + +/** + * @brief Rotates a pixbuf to an arbitrary angle, given in degrees, and returns the rotated pixbuf. + * + * @param source_pixbuf The source image that needs to be angled. + * @param angle The angle the source image should be rotated by. + */ +GdkPixbuf* rotate_arb (GdkPixbuf* source_pixbuf, gdouble angle) { + GdkPixbuf* result = NULL; + gdouble _tmp0_ = 0.0; + gdouble x_tmp = 0.0; + gdouble y_tmp = 0.0; + GdkPixbuf* _tmp3_ = NULL; + gint _tmp4_ = 0; + gint _tmp5_ = 0; + GdkPixbuf* _tmp6_ = NULL; + gint _tmp7_ = 0; + gint _tmp8_ = 0; + gdouble _tmp9_ = 0.0; + gdouble _tmp10_ = 0.0; + gdouble _tmp11_ = 0.0; + GdkPixbuf* dest_pixbuf = NULL; + gdouble _tmp12_ = 0.0; + gdouble _tmp13_ = 0.0; + gdouble _tmp14_ = 0.0; + gdouble _tmp15_ = 0.0; + GdkPixbuf* _tmp16_ = NULL; + cairo_format_t _tmp17_ = 0; + GdkPixbuf* _tmp18_ = NULL; + gboolean _tmp19_ = FALSE; + gboolean _tmp20_ = FALSE; + cairo_surface_t* surface = NULL; + GdkPixbuf* _tmp21_ = NULL; + void* _tmp22_ = NULL; + void* _tmp23_ = NULL; + GdkPixbuf* _tmp24_ = NULL; + gint _tmp25_ = 0; + gint _tmp26_ = 0; + GdkPixbuf* _tmp27_ = NULL; + gint _tmp28_ = 0; + gint _tmp29_ = 0; + GdkPixbuf* _tmp30_ = NULL; + gint _tmp31_ = 0; + gint _tmp32_ = 0; + cairo_surface_t* _tmp33_ = NULL; + cairo_t* context = NULL; + cairo_surface_t* _tmp34_ = NULL; + cairo_t* _tmp35_ = NULL; + cairo_t* _tmp36_ = NULL; + cairo_t* _tmp37_ = NULL; + GdkPixbuf* _tmp38_ = NULL; + gint _tmp39_ = 0; + gint _tmp40_ = 0; + GdkPixbuf* _tmp41_ = NULL; + gint _tmp42_ = 0; + gint _tmp43_ = 0; + cairo_t* _tmp44_ = NULL; + cairo_t* _tmp45_ = NULL; + GdkPixbuf* _tmp46_ = NULL; + gint _tmp47_ = 0; + gint _tmp48_ = 0; + GdkPixbuf* _tmp49_ = NULL; + gint _tmp50_ = 0; + gint _tmp51_ = 0; + cairo_t* _tmp52_ = NULL; + gdouble _tmp53_ = 0.0; + gdouble _tmp54_ = 0.0; + cairo_t* _tmp55_ = NULL; + GdkPixbuf* _tmp56_ = NULL; + gint _tmp57_ = 0; + gint _tmp58_ = 0; + GdkPixbuf* _tmp59_ = NULL; + gint _tmp60_ = 0; + gint _tmp61_ = 0; + cairo_t* _tmp62_ = NULL; + GdkPixbuf* _tmp63_ = NULL; + cairo_t* _tmp64_ = NULL; + cairo_pattern_t* _tmp65_ = NULL; + cairo_t* _tmp66_ = NULL; + GdkPixbuf* _tmp67_ = NULL; +#line 357 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_val_if_fail (GDK_IS_PIXBUF (source_pixbuf), NULL); +#line 361 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_ = angle; +#line 361 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp0_ == 0.0) { +#line 1957 "image.c" + GdkPixbuf* _tmp1_ = NULL; + GdkPixbuf* _tmp2_ = NULL; +#line 362 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp1_ = source_pixbuf; +#line 362 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = _g_object_ref0 (_tmp1_); +#line 362 "/home/jens/Source/shotwell/src/util/image.vala" + result = _tmp2_; +#line 362 "/home/jens/Source/shotwell/src/util/image.vala" + return result; +#line 1968 "image.c" + } +#line 369 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp3_ = source_pixbuf; +#line 369 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp4_ = gdk_pixbuf_get_width (_tmp3_); +#line 369 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp5_ = _tmp4_; +#line 369 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp6_ = source_pixbuf; +#line 369 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp7_ = gdk_pixbuf_get_height (_tmp6_); +#line 369 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp8_ = _tmp7_; +#line 369 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp9_ = angle; +#line 369 "/home/jens/Source/shotwell/src/util/image.vala" + compute_arb_rotated_size ((gdouble) _tmp5_, (gdouble) _tmp8_, _tmp9_, &_tmp10_, &_tmp11_); +#line 369 "/home/jens/Source/shotwell/src/util/image.vala" + x_tmp = _tmp10_; +#line 369 "/home/jens/Source/shotwell/src/util/image.vala" + y_tmp = _tmp11_; +#line 372 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp12_ = x_tmp; +#line 372 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp13_ = round (_tmp12_); +#line 372 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp14_ = y_tmp; +#line 372 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp15_ = round (_tmp14_); +#line 372 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp16_ = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, (gint) _tmp13_, (gint) _tmp15_); +#line 372 "/home/jens/Source/shotwell/src/util/image.vala" + dest_pixbuf = _tmp16_; +#line 377 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp18_ = source_pixbuf; +#line 377 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp19_ = gdk_pixbuf_get_has_alpha (_tmp18_); +#line 377 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp20_ = _tmp19_; +#line 377 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp20_) { +#line 377 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp17_ = CAIRO_FORMAT_ARGB32; +#line 2012 "image.c" + } else { +#line 377 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp17_ = CAIRO_FORMAT_RGB24; +#line 2016 "image.c" + } +#line 375 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp21_ = dest_pixbuf; +#line 375 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp22_ = gdk_pixbuf_get_pixels (_tmp21_); +#line 375 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp23_ = _tmp22_; +#line 375 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp24_ = dest_pixbuf; +#line 375 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp25_ = gdk_pixbuf_get_width (_tmp24_); +#line 375 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp26_ = _tmp25_; +#line 375 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp27_ = dest_pixbuf; +#line 375 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp28_ = gdk_pixbuf_get_height (_tmp27_); +#line 375 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp29_ = _tmp28_; +#line 375 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp30_ = dest_pixbuf; +#line 375 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp31_ = gdk_pixbuf_get_rowstride (_tmp30_); +#line 375 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp32_ = _tmp31_; +#line 375 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp33_ = cairo_image_surface_create_for_data ((guchar*) _tmp23_, _tmp17_, _tmp26_, _tmp29_, _tmp32_); +#line 375 "/home/jens/Source/shotwell/src/util/image.vala" + surface = _tmp33_; +#line 380 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp34_ = surface; +#line 380 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp35_ = cairo_create (_tmp34_); +#line 380 "/home/jens/Source/shotwell/src/util/image.vala" + context = _tmp35_; +#line 382 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp36_ = context; +#line 382 "/home/jens/Source/shotwell/src/util/image.vala" + cairo_set_source_rgb (_tmp36_, (gdouble) 0, (gdouble) 0, (gdouble) 0); +#line 383 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp37_ = context; +#line 383 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp38_ = dest_pixbuf; +#line 383 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp39_ = gdk_pixbuf_get_width (_tmp38_); +#line 383 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp40_ = _tmp39_; +#line 383 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp41_ = dest_pixbuf; +#line 383 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp42_ = gdk_pixbuf_get_height (_tmp41_); +#line 383 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp43_ = _tmp42_; +#line 383 "/home/jens/Source/shotwell/src/util/image.vala" + cairo_rectangle (_tmp37_, (gdouble) 0, (gdouble) 0, (gdouble) _tmp40_, (gdouble) _tmp43_); +#line 384 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp44_ = context; +#line 384 "/home/jens/Source/shotwell/src/util/image.vala" + cairo_fill (_tmp44_); +#line 386 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp45_ = context; +#line 386 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp46_ = dest_pixbuf; +#line 386 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp47_ = gdk_pixbuf_get_width (_tmp46_); +#line 386 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp48_ = _tmp47_; +#line 386 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp49_ = dest_pixbuf; +#line 386 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp50_ = gdk_pixbuf_get_height (_tmp49_); +#line 386 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp51_ = _tmp50_; +#line 386 "/home/jens/Source/shotwell/src/util/image.vala" + cairo_translate (_tmp45_, (gdouble) (_tmp48_ / 2), (gdouble) (_tmp51_ / 2)); +#line 387 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp52_ = context; +#line 387 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp53_ = angle; +#line 387 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp54_ = degrees_to_radians (_tmp53_); +#line 387 "/home/jens/Source/shotwell/src/util/image.vala" + cairo_rotate (_tmp52_, _tmp54_); +#line 388 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp55_ = context; +#line 388 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp56_ = source_pixbuf; +#line 388 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp57_ = gdk_pixbuf_get_width (_tmp56_); +#line 388 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp58_ = _tmp57_; +#line 388 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp59_ = source_pixbuf; +#line 388 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp60_ = gdk_pixbuf_get_height (_tmp59_); +#line 388 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp61_ = _tmp60_; +#line 388 "/home/jens/Source/shotwell/src/util/image.vala" + cairo_translate (_tmp55_, (gdouble) ((-_tmp58_) / 2), (gdouble) ((-_tmp61_) / 2)); +#line 390 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp62_ = context; +#line 390 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp63_ = source_pixbuf; +#line 390 "/home/jens/Source/shotwell/src/util/image.vala" + gdk_cairo_set_source_pixbuf (_tmp62_, _tmp63_, (gdouble) 0, (gdouble) 0); +#line 391 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp64_ = context; +#line 391 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp65_ = cairo_get_source (_tmp64_); +#line 391 "/home/jens/Source/shotwell/src/util/image.vala" + cairo_pattern_set_filter (_tmp65_, CAIRO_FILTER_BEST); +#line 392 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp66_ = context; +#line 392 "/home/jens/Source/shotwell/src/util/image.vala" + cairo_paint (_tmp66_); +#line 396 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp67_ = dest_pixbuf; +#line 396 "/home/jens/Source/shotwell/src/util/image.vala" + fix_cairo_pixbuf (_tmp67_); +#line 398 "/home/jens/Source/shotwell/src/util/image.vala" + result = dest_pixbuf; +#line 398 "/home/jens/Source/shotwell/src/util/image.vala" + _cairo_destroy0 (context); +#line 398 "/home/jens/Source/shotwell/src/util/image.vala" + _cairo_surface_destroy0 (surface); +#line 398 "/home/jens/Source/shotwell/src/util/image.vala" + return result; +#line 2144 "image.c" +} + + +/** + * @brief Rotates a point around the upper left corner of an image to an arbitrary angle, + * given in degrees, and returns the rotated point, translated such that it, along with its attendant + * image, are in positive x, positive y. + * + * @note May be subject to slight inaccuracy as Gdk points' coordinates may only be in whole pixels, + * so the fractional component is lost. + * + * @param source_point The point to be rotated and scaled. + * @param img_w The width of the source image (unrotated). + * @param img_h The height of the source image (unrotated). + * @param angle The angle the source image is to be rotated by to straighten it. + */ +void rotate_point_arb (GdkPoint* source_point, gint img_w, gint img_h, gdouble angle, gboolean invert, GdkPoint* result) { + gdouble _tmp0_ = 0.0; + gdouble dest_width = 0.0; + gdouble dest_height = 0.0; + gint _tmp2_ = 0; + gint _tmp3_ = 0; + gdouble _tmp4_ = 0.0; + gdouble _tmp5_ = 0.0; + gdouble _tmp6_ = 0.0; + cairo_matrix_t matrix = {0}; + gdouble _tmp7_ = 0.0; + gdouble _tmp8_ = 0.0; + gdouble _tmp9_ = 0.0; + gdouble _tmp10_ = 0.0; + gint _tmp11_ = 0; + gint _tmp12_ = 0; + gboolean _tmp13_ = FALSE; + gdouble dest_x = 0.0; + GdkPoint _tmp15_ = {0}; + gint _tmp16_ = 0; + gdouble dest_y = 0.0; + GdkPoint _tmp17_ = {0}; + gint _tmp18_ = 0; + gdouble _tmp19_ = 0.0; + gdouble _tmp20_ = 0.0; + GdkPoint _tmp21_ = {0}; +#line 414 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_if_fail (source_point != NULL); +#line 417 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_ = angle; +#line 417 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp0_ == 0.0) { +#line 2193 "image.c" + GdkPoint _tmp1_ = {0}; +#line 419 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp1_ = *source_point; +#line 419 "/home/jens/Source/shotwell/src/util/image.vala" + *result = _tmp1_; +#line 419 "/home/jens/Source/shotwell/src/util/image.vala" + return; +#line 2201 "image.c" + } +#line 424 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = img_w; +#line 424 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp3_ = img_h; +#line 424 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp4_ = angle; +#line 424 "/home/jens/Source/shotwell/src/util/image.vala" + compute_arb_rotated_size ((gdouble) _tmp2_, (gdouble) _tmp3_, _tmp4_, &_tmp5_, &_tmp6_); +#line 424 "/home/jens/Source/shotwell/src/util/image.vala" + dest_width = _tmp5_; +#line 424 "/home/jens/Source/shotwell/src/util/image.vala" + dest_height = _tmp6_; +#line 426 "/home/jens/Source/shotwell/src/util/image.vala" + cairo_matrix_init_identity (&matrix); +#line 427 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp7_ = dest_width; +#line 427 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp8_ = dest_height; +#line 427 "/home/jens/Source/shotwell/src/util/image.vala" + cairo_matrix_translate (&matrix, _tmp7_ / 2, _tmp8_ / 2); +#line 428 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp9_ = angle; +#line 428 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp10_ = degrees_to_radians (_tmp9_); +#line 428 "/home/jens/Source/shotwell/src/util/image.vala" + cairo_matrix_rotate (&matrix, _tmp10_); +#line 429 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp11_ = img_w; +#line 429 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp12_ = img_h; +#line 429 "/home/jens/Source/shotwell/src/util/image.vala" + cairo_matrix_translate (&matrix, (gdouble) ((-_tmp11_) / 2), (gdouble) ((-_tmp12_) / 2)); +#line 430 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp13_ = invert; +#line 430 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp13_) { +#line 2239 "image.c" + cairo_status_t _tmp14_ = 0; +#line 431 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp14_ = cairo_matrix_invert (&matrix); +#line 431 "/home/jens/Source/shotwell/src/util/image.vala" + _vala_assert (_tmp14_ == CAIRO_STATUS_SUCCESS, "matrix.invert() == Cairo.Status.SUCCESS"); +#line 2245 "image.c" + } +#line 433 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp15_ = *source_point; +#line 433 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp16_ = _tmp15_.x; +#line 433 "/home/jens/Source/shotwell/src/util/image.vala" + dest_x = (gdouble) _tmp16_; +#line 434 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp17_ = *source_point; +#line 434 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp18_ = _tmp17_.y; +#line 434 "/home/jens/Source/shotwell/src/util/image.vala" + dest_y = (gdouble) _tmp18_; +#line 435 "/home/jens/Source/shotwell/src/util/image.vala" + cairo_matrix_transform_point (&matrix, &dest_x, &dest_y); +#line 437 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp19_ = dest_x; +#line 437 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp20_ = dest_y; +#line 437 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp21_.x = (gint) _tmp19_; +#line 437 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp21_.y = (gint) _tmp20_; +#line 437 "/home/jens/Source/shotwell/src/util/image.vala" + *result = _tmp21_; +#line 437 "/home/jens/Source/shotwell/src/util/image.vala" + return; +#line 2273 "image.c" +} + + +/** + * @brief <u>De</u>rotates a point around the upper left corner of an image from an arbitrary angle, + * given in degrees, and returns the de-rotated point, taking into account any translation necessary + * to make sure all of the rotated image stays in positive x, positive y. + * + * @note May be subject to slight inaccuracy as Gdk points' coordinates may only be in whole pixels, + * so the fractional component is lost. + * + * @param source_point The point to be de-rotated. + * @param img_w The width of the source image (unrotated). + * @param img_h The height of the source image (unrotated). + * @param angle The angle the source image is to be rotated by to straighten it. + */ +void derotate_point_arb (GdkPoint* source_point, gint img_w, gint img_h, gdouble angle, GdkPoint* result) { + GdkPoint _tmp0_ = {0}; + gint _tmp1_ = 0; + gint _tmp2_ = 0; + gdouble _tmp3_ = 0.0; + GdkPoint _tmp4_ = {0}; +#line 453 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_if_fail (source_point != NULL); +#line 454 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_ = *source_point; +#line 454 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp1_ = img_w; +#line 454 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = img_h; +#line 454 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp3_ = angle; +#line 454 "/home/jens/Source/shotwell/src/util/image.vala" + rotate_point_arb (&_tmp0_, _tmp1_, _tmp2_, _tmp3_, TRUE, &_tmp4_); +#line 454 "/home/jens/Source/shotwell/src/util/image.vala" + *result = _tmp4_; +#line 454 "/home/jens/Source/shotwell/src/util/image.vala" + return; +#line 2312 "image.c" +} + + +void clamp_inside_rotated_image (Box* src, gint img_w, gint img_h, gdouble angle_deg, gboolean preserve_geom, Box* result) { + GdkPoint top_left = {0}; + Box _tmp0_ = {0}; + gint _tmp1_ = 0; + Box _tmp2_ = {0}; + gint _tmp3_ = 0; + GdkPoint _tmp4_ = {0}; + gint _tmp5_ = 0; + gint _tmp6_ = 0; + gdouble _tmp7_ = 0.0; + GdkPoint _tmp8_ = {0}; + GdkPoint top_right = {0}; + Box _tmp9_ = {0}; + gint _tmp10_ = 0; + Box _tmp11_ = {0}; + gint _tmp12_ = 0; + GdkPoint _tmp13_ = {0}; + gint _tmp14_ = 0; + gint _tmp15_ = 0; + gdouble _tmp16_ = 0.0; + GdkPoint _tmp17_ = {0}; + GdkPoint bottom_left = {0}; + Box _tmp18_ = {0}; + gint _tmp19_ = 0; + Box _tmp20_ = {0}; + gint _tmp21_ = 0; + GdkPoint _tmp22_ = {0}; + gint _tmp23_ = 0; + gint _tmp24_ = 0; + gdouble _tmp25_ = 0.0; + GdkPoint _tmp26_ = {0}; + GdkPoint bottom_right = {0}; + Box _tmp27_ = {0}; + gint _tmp28_ = 0; + Box _tmp29_ = {0}; + gint _tmp30_ = 0; + GdkPoint _tmp31_ = {0}; + gint _tmp32_ = 0; + gint _tmp33_ = 0; + gdouble _tmp34_ = 0.0; + GdkPoint _tmp35_ = {0}; + gdouble angle = 0.0; + gdouble _tmp36_ = 0.0; + gdouble _tmp37_ = 0.0; + gint top_offset = 0; + gint bottom_offset = 0; + gint left_offset = 0; + gint right_offset = 0; + gint top = 0; + GdkPoint _tmp38_ = {0}; + gint _tmp39_ = 0; + GdkPoint _tmp40_ = {0}; + gint _tmp41_ = 0; + gint _tmp42_ = 0; + gint _tmp43_ = 0; + gint bottom = 0; + GdkPoint _tmp47_ = {0}; + gint _tmp48_ = 0; + GdkPoint _tmp49_ = {0}; + gint _tmp50_ = 0; + gint _tmp51_ = 0; + gint _tmp52_ = 0; + gint _tmp53_ = 0; + gint left = 0; + GdkPoint _tmp58_ = {0}; + gint _tmp59_ = 0; + GdkPoint _tmp60_ = {0}; + gint _tmp61_ = 0; + gint _tmp62_ = 0; + gint _tmp63_ = 0; + gint right = 0; + GdkPoint _tmp67_ = {0}; + gint _tmp68_ = 0; + GdkPoint _tmp69_ = {0}; + gint _tmp70_ = 0; + gint _tmp71_ = 0; + gint _tmp72_ = 0; + gint _tmp73_ = 0; + Box _tmp78_ = {0}; + gboolean _tmp79_ = FALSE; +#line 459 "/home/jens/Source/shotwell/src/util/image.vala" + g_return_if_fail (src != NULL); +#line 462 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp0_ = *src; +#line 462 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp1_ = _tmp0_.left; +#line 462 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp2_ = *src; +#line 462 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp3_ = _tmp2_.top; +#line 462 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp4_.x = _tmp1_; +#line 462 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp4_.y = _tmp3_; +#line 462 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp5_ = img_w; +#line 462 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp6_ = img_h; +#line 462 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp7_ = angle_deg; +#line 462 "/home/jens/Source/shotwell/src/util/image.vala" + derotate_point_arb (&_tmp4_, _tmp5_, _tmp6_, _tmp7_, &_tmp8_); +#line 462 "/home/jens/Source/shotwell/src/util/image.vala" + top_left = _tmp8_; +#line 463 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp9_ = *src; +#line 463 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp10_ = _tmp9_.right; +#line 463 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp11_ = *src; +#line 463 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp12_ = _tmp11_.top; +#line 463 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp13_.x = _tmp10_; +#line 463 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp13_.y = _tmp12_; +#line 463 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp14_ = img_w; +#line 463 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp15_ = img_h; +#line 463 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp16_ = angle_deg; +#line 463 "/home/jens/Source/shotwell/src/util/image.vala" + derotate_point_arb (&_tmp13_, _tmp14_, _tmp15_, _tmp16_, &_tmp17_); +#line 463 "/home/jens/Source/shotwell/src/util/image.vala" + top_right = _tmp17_; +#line 464 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp18_ = *src; +#line 464 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp19_ = _tmp18_.left; +#line 464 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp20_ = *src; +#line 464 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp21_ = _tmp20_.bottom; +#line 464 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp22_.x = _tmp19_; +#line 464 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp22_.y = _tmp21_; +#line 464 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp23_ = img_w; +#line 464 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp24_ = img_h; +#line 464 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp25_ = angle_deg; +#line 464 "/home/jens/Source/shotwell/src/util/image.vala" + derotate_point_arb (&_tmp22_, _tmp23_, _tmp24_, _tmp25_, &_tmp26_); +#line 464 "/home/jens/Source/shotwell/src/util/image.vala" + bottom_left = _tmp26_; +#line 465 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp27_ = *src; +#line 465 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp28_ = _tmp27_.right; +#line 465 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp29_ = *src; +#line 465 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp30_ = _tmp29_.bottom; +#line 465 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp31_.x = _tmp28_; +#line 465 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp31_.y = _tmp30_; +#line 465 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp32_ = img_w; +#line 465 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp33_ = img_h; +#line 465 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp34_ = angle_deg; +#line 465 "/home/jens/Source/shotwell/src/util/image.vala" + derotate_point_arb (&_tmp31_, _tmp32_, _tmp33_, _tmp34_, &_tmp35_); +#line 465 "/home/jens/Source/shotwell/src/util/image.vala" + bottom_right = _tmp35_; +#line 467 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp36_ = angle_deg; +#line 467 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp37_ = degrees_to_radians (_tmp36_); +#line 467 "/home/jens/Source/shotwell/src/util/image.vala" + angle = _tmp37_; +#line 468 "/home/jens/Source/shotwell/src/util/image.vala" + top_offset = 0; +#line 468 "/home/jens/Source/shotwell/src/util/image.vala" + bottom_offset = 0; +#line 468 "/home/jens/Source/shotwell/src/util/image.vala" + left_offset = 0; +#line 468 "/home/jens/Source/shotwell/src/util/image.vala" + right_offset = 0; +#line 470 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp38_ = top_left; +#line 470 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp39_ = _tmp38_.y; +#line 470 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp40_ = top_right; +#line 470 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp41_ = _tmp40_.y; +#line 470 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp42_ = MIN (_tmp39_, _tmp41_); +#line 470 "/home/jens/Source/shotwell/src/util/image.vala" + top = _tmp42_; +#line 471 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp43_ = top; +#line 471 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp43_ < 0) { +#line 2516 "image.c" + gint _tmp44_ = 0; + gdouble _tmp45_ = 0.0; + gdouble _tmp46_ = 0.0; +#line 472 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp44_ = top; +#line 472 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp45_ = angle; +#line 472 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp46_ = cos (_tmp45_); +#line 472 "/home/jens/Source/shotwell/src/util/image.vala" + top_offset = (gint) ((0 - _tmp44_) * _tmp46_); +#line 2528 "image.c" + } +#line 474 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp47_ = bottom_left; +#line 474 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp48_ = _tmp47_.y; +#line 474 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp49_ = bottom_right; +#line 474 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp50_ = _tmp49_.y; +#line 474 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp51_ = MAX (_tmp48_, _tmp50_); +#line 474 "/home/jens/Source/shotwell/src/util/image.vala" + bottom = _tmp51_; +#line 475 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp52_ = bottom; +#line 475 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp53_ = img_h; +#line 475 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp52_ > _tmp53_) { +#line 2548 "image.c" + gint _tmp54_ = 0; + gint _tmp55_ = 0; + gdouble _tmp56_ = 0.0; + gdouble _tmp57_ = 0.0; +#line 476 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp54_ = img_h; +#line 476 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp55_ = bottom; +#line 476 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp56_ = angle; +#line 476 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp57_ = cos (_tmp56_); +#line 476 "/home/jens/Source/shotwell/src/util/image.vala" + bottom_offset = (gint) ((_tmp54_ - _tmp55_) * _tmp57_); +#line 2563 "image.c" + } +#line 478 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp58_ = top_left; +#line 478 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp59_ = _tmp58_.x; +#line 478 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp60_ = bottom_left; +#line 478 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp61_ = _tmp60_.x; +#line 478 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp62_ = MIN (_tmp59_, _tmp61_); +#line 478 "/home/jens/Source/shotwell/src/util/image.vala" + left = _tmp62_; +#line 479 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp63_ = left; +#line 479 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp63_ < 0) { +#line 2581 "image.c" + gint _tmp64_ = 0; + gdouble _tmp65_ = 0.0; + gdouble _tmp66_ = 0.0; +#line 480 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp64_ = left; +#line 480 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp65_ = angle; +#line 480 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp66_ = cos (_tmp65_); +#line 480 "/home/jens/Source/shotwell/src/util/image.vala" + left_offset = (gint) ((0 - _tmp64_) * _tmp66_); +#line 2593 "image.c" + } +#line 482 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp67_ = top_right; +#line 482 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp68_ = _tmp67_.x; +#line 482 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp69_ = bottom_right; +#line 482 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp70_ = _tmp69_.x; +#line 482 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp71_ = MAX (_tmp68_, _tmp70_); +#line 482 "/home/jens/Source/shotwell/src/util/image.vala" + right = _tmp71_; +#line 483 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp72_ = right; +#line 483 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp73_ = img_w; +#line 483 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp72_ > _tmp73_) { +#line 2613 "image.c" + gint _tmp74_ = 0; + gint _tmp75_ = 0; + gdouble _tmp76_ = 0.0; + gdouble _tmp77_ = 0.0; +#line 484 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp74_ = img_w; +#line 484 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp75_ = right; +#line 484 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp76_ = angle; +#line 484 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp77_ = cos (_tmp76_); +#line 484 "/home/jens/Source/shotwell/src/util/image.vala" + right_offset = (gint) ((_tmp74_ - _tmp75_) * _tmp77_); +#line 2628 "image.c" + } +#line 486 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp79_ = preserve_geom; +#line 486 "/home/jens/Source/shotwell/src/util/image.vala" + if (_tmp79_) { +#line 2634 "image.c" + gint _tmp80_ = 0; + gint _tmp81_ = 0; + gint _tmp82_ = 0; + gint _tmp83_ = 0; + Box _tmp84_ = {0}; +#line 486 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp80_ = left_offset; +#line 486 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp81_ = right_offset; +#line 486 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp82_ = top_offset; +#line 486 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp83_ = bottom_offset; +#line 486 "/home/jens/Source/shotwell/src/util/image.vala" + box_get_offset (src, _tmp80_ + _tmp81_, _tmp82_ + _tmp83_, &_tmp84_); +#line 486 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp78_ = _tmp84_; +#line 2652 "image.c" + } else { + Box _tmp85_ = {0}; + gint _tmp86_ = 0; + gint _tmp87_ = 0; + Box _tmp88_ = {0}; + gint _tmp89_ = 0; + gint _tmp90_ = 0; + Box _tmp91_ = {0}; + gint _tmp92_ = 0; + gint _tmp93_ = 0; + Box _tmp94_ = {0}; + gint _tmp95_ = 0; + gint _tmp96_ = 0; +#line 487 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp85_ = *src; +#line 487 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp86_ = _tmp85_.left; +#line 487 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp87_ = left_offset; +#line 487 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp88_ = *src; +#line 487 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp89_ = _tmp88_.top; +#line 487 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp90_ = top_offset; +#line 487 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp91_ = *src; +#line 487 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp92_ = _tmp91_.right; +#line 487 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp93_ = right_offset; +#line 487 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp94_ = *src; +#line 487 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp95_ = _tmp94_.bottom; +#line 487 "/home/jens/Source/shotwell/src/util/image.vala" + _tmp96_ = bottom_offset; +#line 487 "/home/jens/Source/shotwell/src/util/image.vala" + box_init (&_tmp78_, _tmp86_ + _tmp87_, _tmp89_ + _tmp90_, _tmp92_ + _tmp93_, _tmp95_ + _tmp96_); +#line 2692 "image.c" + } +#line 486 "/home/jens/Source/shotwell/src/util/image.vala" + *result = _tmp78_; +#line 486 "/home/jens/Source/shotwell/src/util/image.vala" + return; +#line 2698 "image.c" +} + + + diff --git a/src/util/misc.c b/src/util/misc.c new file mode 100644 index 0000000..b8101f1 --- /dev/null +++ b/src/util/misc.c @@ -0,0 +1,3137 @@ +/* misc.c generated by valac 0.32.1, the Vala compiler + * generated from misc.vala, do not modify */ + +/* Copyright 2016 Software Freedom Conservancy Inc. + * + * This software is licensed under the GNU LGPL (version 2.1 or later). + * See the COPYING file in this distribution. + */ + +#include <glib.h> +#include <glib-object.h> +#include <time.h> +#include <stdlib.h> +#include <string.h> +#include <gio/gio.h> +#include <gee.h> +#include <gdk/gdk.h> +#include <float.h> +#include <math.h> +#include <gobject/gvaluecollector.h> + +#define _g_checksum_free0(var) ((var == NULL) ? NULL : (var = (g_checksum_free (var), NULL))) +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +#define _g_free0(var) (var = (g_free (var), NULL)) +#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) + +#define TYPE_DATA_OBJECT (data_object_get_type ()) +#define DATA_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_OBJECT, DataObject)) +#define DATA_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_OBJECT, DataObjectClass)) +#define IS_DATA_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_OBJECT)) +#define IS_DATA_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_OBJECT)) +#define DATA_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_OBJECT, DataObjectClass)) + +typedef struct _DataObject DataObject; +typedef struct _DataObjectClass DataObjectClass; + +#define TYPE_DATA_SOURCE (data_source_get_type ()) +#define DATA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_SOURCE, DataSource)) +#define DATA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_SOURCE, DataSourceClass)) +#define IS_DATA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_SOURCE)) +#define IS_DATA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_SOURCE)) +#define DATA_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_SOURCE, DataSourceClass)) + +typedef struct _DataSource DataSource; +typedef struct _DataSourceClass DataSourceClass; + +#define TYPE_THUMBNAIL_SOURCE (thumbnail_source_get_type ()) +#define THUMBNAIL_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_THUMBNAIL_SOURCE, ThumbnailSource)) +#define THUMBNAIL_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_THUMBNAIL_SOURCE, ThumbnailSourceClass)) +#define IS_THUMBNAIL_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_THUMBNAIL_SOURCE)) +#define IS_THUMBNAIL_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_THUMBNAIL_SOURCE)) +#define THUMBNAIL_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_THUMBNAIL_SOURCE, ThumbnailSourceClass)) + +typedef struct _ThumbnailSource ThumbnailSource; +typedef struct _ThumbnailSourceClass ThumbnailSourceClass; + +#define TYPE_MEDIA_SOURCE (media_source_get_type ()) +#define MEDIA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEDIA_SOURCE, MediaSource)) +#define MEDIA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEDIA_SOURCE, MediaSourceClass)) +#define IS_MEDIA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEDIA_SOURCE)) +#define IS_MEDIA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MEDIA_SOURCE)) +#define MEDIA_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MEDIA_SOURCE, MediaSourceClass)) + +typedef struct _MediaSource MediaSource; +typedef struct _MediaSourceClass MediaSourceClass; + +#define TYPE_PHOTO_SOURCE (photo_source_get_type ()) +#define PHOTO_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_SOURCE, PhotoSource)) +#define PHOTO_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_SOURCE, PhotoSourceClass)) +#define IS_PHOTO_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_SOURCE)) +#define IS_PHOTO_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_SOURCE)) +#define PHOTO_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_SOURCE, PhotoSourceClass)) + +typedef struct _PhotoSource PhotoSource; +typedef struct _PhotoSourceClass PhotoSourceClass; + +#define TYPE_PHOTO (photo_get_type ()) +#define PHOTO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO, Photo)) +#define PHOTO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO, PhotoClass)) +#define IS_PHOTO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO)) +#define IS_PHOTO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO)) +#define PHOTO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO, PhotoClass)) + +typedef struct _Photo Photo; +typedef struct _PhotoClass PhotoClass; + +#define TYPE_PHOTO_ID (photo_id_get_type ()) +typedef struct _PhotoID PhotoID; + +#define TYPE_MEDIA_COLLECTION_REGISTRY (media_collection_registry_get_type ()) +#define MEDIA_COLLECTION_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEDIA_COLLECTION_REGISTRY, MediaCollectionRegistry)) +#define MEDIA_COLLECTION_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEDIA_COLLECTION_REGISTRY, MediaCollectionRegistryClass)) +#define IS_MEDIA_COLLECTION_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEDIA_COLLECTION_REGISTRY)) +#define IS_MEDIA_COLLECTION_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MEDIA_COLLECTION_REGISTRY)) +#define MEDIA_COLLECTION_REGISTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MEDIA_COLLECTION_REGISTRY, MediaCollectionRegistryClass)) + +typedef struct _MediaCollectionRegistry MediaCollectionRegistry; +typedef struct _MediaCollectionRegistryClass MediaCollectionRegistryClass; +#define _media_collection_registry_unref0(var) ((var == NULL) ? NULL : (var = (media_collection_registry_unref (var), NULL))) + +#define TYPE_ONE_SHOT_SCHEDULER (one_shot_scheduler_get_type ()) +#define ONE_SHOT_SCHEDULER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ONE_SHOT_SCHEDULER, OneShotScheduler)) +#define ONE_SHOT_SCHEDULER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ONE_SHOT_SCHEDULER, OneShotSchedulerClass)) +#define IS_ONE_SHOT_SCHEDULER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ONE_SHOT_SCHEDULER)) +#define IS_ONE_SHOT_SCHEDULER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ONE_SHOT_SCHEDULER)) +#define ONE_SHOT_SCHEDULER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ONE_SHOT_SCHEDULER, OneShotSchedulerClass)) + +typedef struct _OneShotScheduler OneShotScheduler; +typedef struct _OneShotSchedulerClass OneShotSchedulerClass; +typedef struct _OneShotSchedulerPrivate OneShotSchedulerPrivate; +typedef struct _ParamSpecOneShotScheduler ParamSpecOneShotScheduler; + +#define TYPE_OP_TIMER (op_timer_get_type ()) +#define OP_TIMER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_OP_TIMER, OpTimer)) +#define OP_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_OP_TIMER, OpTimerClass)) +#define IS_OP_TIMER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_OP_TIMER)) +#define IS_OP_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_OP_TIMER)) +#define OP_TIMER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_OP_TIMER, OpTimerClass)) + +typedef struct _OpTimer OpTimer; +typedef struct _OpTimerClass OpTimerClass; +typedef struct _OpTimerPrivate OpTimerPrivate; +#define _g_timer_destroy0(var) ((var == NULL) ? NULL : (var = (g_timer_destroy (var), NULL))) +typedef struct _ParamSpecOpTimer ParamSpecOpTimer; +#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); +#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; } +#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; } +#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); + +typedef gboolean (*ValueEqualFunc) (GValue* a, GValue* b, void* user_data); +struct _PhotoID { + gint64 id; +}; + +typedef void (*OneShotCallback) (void* user_data); +struct _OneShotScheduler { + GTypeInstance parent_instance; + volatile int ref_count; + OneShotSchedulerPrivate * priv; +}; + +struct _OneShotSchedulerClass { + GTypeClass parent_class; + void (*finalize) (OneShotScheduler *self); +}; + +struct _OneShotSchedulerPrivate { + gchar* name; + OneShotCallback callback; + gpointer callback_target; + guint scheduled; +}; + +struct _ParamSpecOneShotScheduler { + GParamSpec parent_instance; +}; + +struct _OpTimer { + GTypeInstance parent_instance; + volatile int ref_count; + OpTimerPrivate * priv; +}; + +struct _OpTimerClass { + GTypeClass parent_class; + void (*finalize) (OpTimer *self); +}; + +struct _OpTimerPrivate { + gchar* name; + GTimer* timer; + glong count; + gdouble elapsed; + gdouble shortest; + gdouble longest; +}; + +struct _ParamSpecOpTimer { + GParamSpec parent_instance; +}; + + +static gpointer one_shot_scheduler_parent_class = NULL; +static gpointer op_timer_parent_class = NULL; + +guint int64_hash (gint64* n); +gboolean int64_equal (gint64* a, gint64* b); +gint int64_compare (gint64* a, gint64* b); +gint uint64_compare (guint64* a, guint64* b); +gboolean bool_value_equals (GValue* a, GValue* b); +gboolean int_value_equals (GValue* a, GValue* b); +gulong timeval_to_ms (GTimeVal* time_val); +gulong now_ms (void); +gulong now_sec (void); +time_t now_time_t (void); +gchar* md5_binary (guint8* buffer, gsize length); +gchar* md5_file (GFile* file, GError** error); +gboolean equal_sets (GeeSet* a, GeeSet* b); +GeeSet* intersection_of_sets (GeeSet* a, GeeSet* b, GeeSet* excluded); +GType data_object_get_type (void) G_GNUC_CONST; +GType data_source_get_type (void) G_GNUC_CONST; +GType thumbnail_source_get_type (void) G_GNUC_CONST; +GType media_source_get_type (void) G_GNUC_CONST; +GType photo_source_get_type (void) G_GNUC_CONST; +GType photo_get_type (void) G_GNUC_CONST; +guchar* serialize_photo_ids (GeeCollection* photos, int* result_length1); +GType photo_id_get_type (void) G_GNUC_CONST; +PhotoID* photo_id_dup (const PhotoID* self); +void photo_id_free (PhotoID* self); +void photo_get_photo_id (Photo* self, PhotoID* result); +GeeList* unserialize_photo_ids (guchar* serialized, gint size); +void photo_id_init (PhotoID *self, gint64 id); +guchar* serialize_media_sources (GeeCollection* media, int* result_length1); +gchar* data_source_get_source_id (DataSource* self); +GeeList* unserialize_media_sources (guchar* serialized, gint size); +gpointer media_collection_registry_ref (gpointer instance); +void media_collection_registry_unref (gpointer instance); +GParamSpec* param_spec_media_collection_registry (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void value_set_media_collection_registry (GValue* value, gpointer v_object); +void value_take_media_collection_registry (GValue* value, gpointer v_object); +gpointer value_get_media_collection_registry (const GValue* value); +GType media_collection_registry_get_type (void) G_GNUC_CONST; +MediaCollectionRegistry* media_collection_registry_get_instance (void); +MediaSource* media_collection_registry_fetch_media (MediaCollectionRegistry* self, const gchar* source_id); +gchar* format_local_datespan (struct tm* from_date, struct tm* to_date); +gchar* resources_get_start_multiday_span_format_string (void); +gchar* resources_get_end_multiday_span_format_string (void); +gchar* resources_get_start_multimonth_span_format_string (void); +gchar* resources_get_end_multimonth_span_format_string (void); +gchar* resources_get_long_date_format_string (void); +gchar* string_strip_leading_zeroes (const gchar* str); +gchar* format_local_date (struct tm* date); +gpointer one_shot_scheduler_ref (gpointer instance); +void one_shot_scheduler_unref (gpointer instance); +GParamSpec* param_spec_one_shot_scheduler (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void value_set_one_shot_scheduler (GValue* value, gpointer v_object); +void value_take_one_shot_scheduler (GValue* value, gpointer v_object); +gpointer value_get_one_shot_scheduler (const GValue* value); +GType one_shot_scheduler_get_type (void) G_GNUC_CONST; +#define ONE_SHOT_SCHEDULER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_ONE_SHOT_SCHEDULER, OneShotSchedulerPrivate)) +enum { + ONE_SHOT_SCHEDULER_DUMMY_PROPERTY +}; +void one_shot_scheduler_cancel (OneShotScheduler* self); +OneShotScheduler* one_shot_scheduler_new (const gchar* name, OneShotCallback callback, void* callback_target); +OneShotScheduler* one_shot_scheduler_construct (GType object_type, const gchar* name, OneShotCallback callback, void* callback_target); +gboolean one_shot_scheduler_is_scheduled (OneShotScheduler* self); +void one_shot_scheduler_at_idle (OneShotScheduler* self); +void one_shot_scheduler_at_priority_idle (OneShotScheduler* self, gint priority); +static gboolean one_shot_scheduler_callback_wrapper (OneShotScheduler* self); +static gboolean _one_shot_scheduler_callback_wrapper_gsource_func (gpointer self); +void one_shot_scheduler_after_timeout (OneShotScheduler* self, guint msec, gboolean reschedule); +void one_shot_scheduler_priority_after_timeout (OneShotScheduler* self, gint priority, guint msec, gboolean reschedule); +static void one_shot_scheduler_finalize (OneShotScheduler* obj); +gpointer op_timer_ref (gpointer instance); +void op_timer_unref (gpointer instance); +GParamSpec* param_spec_op_timer (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); +void value_set_op_timer (GValue* value, gpointer v_object); +void value_take_op_timer (GValue* value, gpointer v_object); +gpointer value_get_op_timer (const GValue* value); +GType op_timer_get_type (void) G_GNUC_CONST; +#define OP_TIMER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_OP_TIMER, OpTimerPrivate)) +enum { + OP_TIMER_DUMMY_PROPERTY +}; +OpTimer* op_timer_new (const gchar* name); +OpTimer* op_timer_construct (GType object_type, const gchar* name); +void op_timer_start (OpTimer* self); +void op_timer_stop (OpTimer* self); +gchar* op_timer_to_string (OpTimer* self); +static void op_timer_finalize (OpTimer* obj); +void suppress_warnings (const gchar* log_domain, GLogLevelFlags log_levels, const gchar* message); +gboolean is_twentyfour_hr_time_system (void); +gboolean is_string_empty (const gchar* s); + + +guint int64_hash (gint64* n) { + guint result = 0U; + guint8* u8 = NULL; + gint64* _tmp0_ = NULL; + guint hash = 0U; +#line 9 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = n; +#line 9 "/home/jens/Source/shotwell/src/util/misc.vala" + u8 = (guint8*) _tmp0_; +#line 10 "/home/jens/Source/shotwell/src/util/misc.vala" + hash = (guint) 0; +#line 289 "misc.c" + { + gint ctr = 0; +#line 11 "/home/jens/Source/shotwell/src/util/misc.vala" + ctr = 0; +#line 294 "misc.c" + { + gboolean _tmp1_ = FALSE; +#line 11 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = TRUE; +#line 11 "/home/jens/Source/shotwell/src/util/misc.vala" + while (TRUE) { +#line 301 "misc.c" + gint _tmp3_ = 0; + guint _tmp4_ = 0U; + guint _tmp5_ = 0U; + guint8* _tmp6_ = NULL; +#line 11 "/home/jens/Source/shotwell/src/util/misc.vala" + if (!_tmp1_) { +#line 308 "misc.c" + gint _tmp2_ = 0; +#line 11 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp2_ = ctr; +#line 11 "/home/jens/Source/shotwell/src/util/misc.vala" + ctr = _tmp2_ + 1; +#line 314 "misc.c" + } +#line 11 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = FALSE; +#line 11 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp3_ = ctr; +#line 11 "/home/jens/Source/shotwell/src/util/misc.vala" + if (!(((gulong) _tmp3_) < (sizeof (gint64) / sizeof (guint8)))) { +#line 11 "/home/jens/Source/shotwell/src/util/misc.vala" + break; +#line 324 "misc.c" + } +#line 12 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp4_ = hash; +#line 12 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp5_ = hash; +#line 12 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp6_ = u8; +#line 12 "/home/jens/Source/shotwell/src/util/misc.vala" + u8 = _tmp6_ + 1; +#line 12 "/home/jens/Source/shotwell/src/util/misc.vala" + hash = ((_tmp4_ << 4) ^ (_tmp5_ >> 28)) ^ (*_tmp6_); +#line 336 "misc.c" + } + } + } +#line 15 "/home/jens/Source/shotwell/src/util/misc.vala" + result = hash; +#line 15 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 344 "misc.c" +} + + +gboolean int64_equal (gint64* a, gint64* b) { + gboolean result = FALSE; + gint64* bia = NULL; + gint64* _tmp0_ = NULL; + gint64* bib = NULL; + gint64* _tmp1_ = NULL; +#line 19 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = a; +#line 19 "/home/jens/Source/shotwell/src/util/misc.vala" + bia = (gint64*) _tmp0_; +#line 20 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = b; +#line 20 "/home/jens/Source/shotwell/src/util/misc.vala" + bib = (gint64*) _tmp1_; +#line 22 "/home/jens/Source/shotwell/src/util/misc.vala" + result = (*bia) == (*bib); +#line 22 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 366 "misc.c" +} + + +gint int64_compare (gint64* a, gint64* b) { + gint result = 0; + gint64 diff = 0LL; + gint64* _tmp0_ = NULL; + gint64* _tmp1_ = NULL; + gint64 _tmp2_ = 0LL; +#line 26 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = a; +#line 26 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = b; +#line 26 "/home/jens/Source/shotwell/src/util/misc.vala" + diff = (*((gint64*) _tmp0_)) - (*((gint64*) _tmp1_)); +#line 27 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp2_ = diff; +#line 27 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp2_ < ((gint64) 0)) { +#line 28 "/home/jens/Source/shotwell/src/util/misc.vala" + result = -1; +#line 28 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 390 "misc.c" + } else { + gint64 _tmp3_ = 0LL; +#line 29 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp3_ = diff; +#line 29 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp3_ > ((gint64) 0)) { +#line 30 "/home/jens/Source/shotwell/src/util/misc.vala" + result = 1; +#line 30 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 401 "misc.c" + } else { +#line 32 "/home/jens/Source/shotwell/src/util/misc.vala" + result = 0; +#line 32 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 407 "misc.c" + } + } +} + + +gint uint64_compare (guint64* a, guint64* b) { + gint result = 0; + guint64 a64 = 0ULL; + guint64* _tmp0_ = NULL; + guint64 b64 = 0ULL; + guint64* _tmp1_ = NULL; + guint64 _tmp2_ = 0ULL; + guint64 _tmp3_ = 0ULL; +#line 36 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = a; +#line 36 "/home/jens/Source/shotwell/src/util/misc.vala" + a64 = *((guint64*) _tmp0_); +#line 37 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = b; +#line 37 "/home/jens/Source/shotwell/src/util/misc.vala" + b64 = *((guint64*) _tmp1_); +#line 39 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp2_ = a64; +#line 39 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp3_ = b64; +#line 39 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp2_ < _tmp3_) { +#line 40 "/home/jens/Source/shotwell/src/util/misc.vala" + result = -1; +#line 40 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 439 "misc.c" + } else { + guint64 _tmp4_ = 0ULL; + guint64 _tmp5_ = 0ULL; +#line 41 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp4_ = a64; +#line 41 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp5_ = b64; +#line 41 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp4_ > _tmp5_) { +#line 42 "/home/jens/Source/shotwell/src/util/misc.vala" + result = 1; +#line 42 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 453 "misc.c" + } else { +#line 44 "/home/jens/Source/shotwell/src/util/misc.vala" + result = 0; +#line 44 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 459 "misc.c" + } + } +} + + +gboolean bool_value_equals (GValue* a, GValue* b) { + gboolean result = FALSE; + GValue _tmp0_ = {0}; + GValue _tmp1_ = {0}; +#line 49 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_val_if_fail (a != NULL, FALSE); +#line 49 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_val_if_fail (b != NULL, FALSE); +#line 50 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = *a; +#line 50 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = *b; +#line 50 "/home/jens/Source/shotwell/src/util/misc.vala" + result = g_value_get_boolean (&_tmp0_) == g_value_get_boolean (&_tmp1_); +#line 50 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 481 "misc.c" +} + + +gboolean int_value_equals (GValue* a, GValue* b) { + gboolean result = FALSE; + GValue _tmp0_ = {0}; + GValue _tmp1_ = {0}; +#line 53 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_val_if_fail (a != NULL, FALSE); +#line 53 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_val_if_fail (b != NULL, FALSE); +#line 54 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = *a; +#line 54 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = *b; +#line 54 "/home/jens/Source/shotwell/src/util/misc.vala" + result = g_value_get_int (&_tmp0_) == g_value_get_int (&_tmp1_); +#line 54 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 501 "misc.c" +} + + +gulong timeval_to_ms (GTimeVal* time_val) { + gulong result = 0UL; + GTimeVal _tmp0_ = {0}; + glong _tmp1_ = 0L; + GTimeVal _tmp2_ = {0}; + glong _tmp3_ = 0L; +#line 57 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_val_if_fail (time_val != NULL, 0UL); +#line 58 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = *time_val; +#line 58 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = _tmp0_.tv_sec; +#line 58 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp2_ = *time_val; +#line 58 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp3_ = _tmp2_.tv_usec; +#line 58 "/home/jens/Source/shotwell/src/util/misc.vala" + result = (((gulong) _tmp1_) * 1000) + (((gulong) _tmp3_) / 1000); +#line 58 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 525 "misc.c" +} + + +gulong now_ms (void) { + gulong result = 0UL; + GTimeVal _tmp0_ = {0}; + gulong _tmp1_ = 0UL; +#line 62 "/home/jens/Source/shotwell/src/util/misc.vala" + g_get_current_time (&_tmp0_); +#line 62 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = timeval_to_ms (&_tmp0_); +#line 62 "/home/jens/Source/shotwell/src/util/misc.vala" + result = _tmp1_; +#line 62 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 541 "misc.c" +} + + +gulong now_sec (void) { + gulong result = 0UL; + GTimeVal time_val = {0}; + GTimeVal _tmp0_ = {0}; + glong _tmp1_ = 0L; +#line 66 "/home/jens/Source/shotwell/src/util/misc.vala" + g_get_current_time (&time_val); +#line 68 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = time_val; +#line 68 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = _tmp0_.tv_sec; +#line 68 "/home/jens/Source/shotwell/src/util/misc.vala" + result = (gulong) _tmp1_; +#line 68 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 560 "misc.c" +} + + +inline time_t now_time_t (void) { + time_t result = 0; + gulong _tmp0_ = 0UL; +#line 72 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = now_sec (); +#line 72 "/home/jens/Source/shotwell/src/util/misc.vala" + result = (time_t) _tmp0_; +#line 72 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 573 "misc.c" +} + + +gchar* md5_binary (guint8* buffer, gsize length) { + gchar* result = NULL; + gsize _tmp0_ = 0UL; + GChecksum* md5 = NULL; + GChecksum* _tmp1_ = NULL; + guint8* _tmp2_ = NULL; + gsize _tmp3_ = 0UL; + const gchar* _tmp4_ = NULL; + gchar* _tmp5_ = NULL; +#line 76 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = length; +#line 76 "/home/jens/Source/shotwell/src/util/misc.vala" + _vala_assert (_tmp0_ != ((gsize) 0), "length != 0"); +#line 78 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = g_checksum_new (G_CHECKSUM_MD5); +#line 78 "/home/jens/Source/shotwell/src/util/misc.vala" + md5 = _tmp1_; +#line 79 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp2_ = buffer; +#line 79 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp3_ = length; +#line 79 "/home/jens/Source/shotwell/src/util/misc.vala" + g_checksum_update (md5, (guchar*) _tmp2_, _tmp3_); +#line 81 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp4_ = g_checksum_get_string (md5); +#line 81 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp5_ = g_strdup (_tmp4_); +#line 81 "/home/jens/Source/shotwell/src/util/misc.vala" + result = _tmp5_; +#line 81 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_checksum_free0 (md5); +#line 81 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 610 "misc.c" +} + + +gchar* md5_file (GFile* file, GError** error) { + gchar* result = NULL; + GChecksum* md5 = NULL; + GChecksum* _tmp0_ = NULL; + guint8* buffer = NULL; + guint8* _tmp1_ = NULL; + gint buffer_length1 = 0; + gint _buffer_size_ = 0; + GFileInputStream* fins = NULL; + GFile* _tmp2_ = NULL; + GFileInputStream* _tmp3_ = NULL; + GChecksum* _tmp18_ = NULL; + const gchar* _tmp19_ = NULL; + gchar* _tmp20_ = NULL; + GError * _inner_error_ = NULL; +#line 84 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_val_if_fail (G_IS_FILE (file), NULL); +#line 85 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = g_checksum_new (G_CHECKSUM_MD5); +#line 85 "/home/jens/Source/shotwell/src/util/misc.vala" + md5 = _tmp0_; +#line 86 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = g_new0 (guint8, 64 * 1024); +#line 86 "/home/jens/Source/shotwell/src/util/misc.vala" + buffer = _tmp1_; +#line 86 "/home/jens/Source/shotwell/src/util/misc.vala" + buffer_length1 = 64 * 1024; +#line 86 "/home/jens/Source/shotwell/src/util/misc.vala" + _buffer_size_ = buffer_length1; +#line 88 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp2_ = file; +#line 88 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp3_ = g_file_read (_tmp2_, NULL, &_inner_error_); +#line 88 "/home/jens/Source/shotwell/src/util/misc.vala" + fins = _tmp3_; +#line 88 "/home/jens/Source/shotwell/src/util/misc.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 88 "/home/jens/Source/shotwell/src/util/misc.vala" + g_propagate_error (error, _inner_error_); +#line 88 "/home/jens/Source/shotwell/src/util/misc.vala" + buffer = (g_free (buffer), NULL); +#line 88 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_checksum_free0 (md5); +#line 88 "/home/jens/Source/shotwell/src/util/misc.vala" + return NULL; +#line 659 "misc.c" + } + { + gboolean _tmp4_ = FALSE; +#line 89 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp4_ = TRUE; +#line 89 "/home/jens/Source/shotwell/src/util/misc.vala" + while (TRUE) { +#line 667 "misc.c" + gsize bytes_read = 0UL; + GFileInputStream* _tmp5_ = NULL; + guint8* _tmp6_ = NULL; + gint _tmp6__length1 = 0; + gssize _tmp7_ = 0L; + gsize _tmp8_ = 0UL; + GChecksum* _tmp9_ = NULL; + guint8* _tmp10_ = NULL; + gint _tmp10__length1 = 0; + gsize _tmp11_ = 0UL; +#line 89 "/home/jens/Source/shotwell/src/util/misc.vala" + if (!_tmp4_) { +#line 680 "misc.c" + } +#line 89 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp4_ = FALSE; +#line 90 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp5_ = fins; +#line 90 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp6_ = buffer; +#line 90 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp6__length1 = buffer_length1; +#line 90 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp7_ = g_input_stream_read (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, G_TYPE_INPUT_STREAM, GInputStream), _tmp6_, (gsize) _tmp6__length1, NULL, &_inner_error_); +#line 90 "/home/jens/Source/shotwell/src/util/misc.vala" + bytes_read = (gsize) _tmp7_; +#line 90 "/home/jens/Source/shotwell/src/util/misc.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 90 "/home/jens/Source/shotwell/src/util/misc.vala" + g_propagate_error (error, _inner_error_); +#line 90 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_object_unref0 (fins); +#line 90 "/home/jens/Source/shotwell/src/util/misc.vala" + buffer = (g_free (buffer), NULL); +#line 90 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_checksum_free0 (md5); +#line 90 "/home/jens/Source/shotwell/src/util/misc.vala" + return NULL; +#line 706 "misc.c" + } +#line 91 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp8_ = bytes_read; +#line 91 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp8_ <= ((gsize) 0)) { +#line 92 "/home/jens/Source/shotwell/src/util/misc.vala" + break; +#line 714 "misc.c" + } +#line 94 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp9_ = md5; +#line 94 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp10_ = buffer; +#line 94 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp10__length1 = buffer_length1; +#line 94 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp11_ = bytes_read; +#line 94 "/home/jens/Source/shotwell/src/util/misc.vala" + g_checksum_update (_tmp9_, (guchar*) _tmp10_, _tmp11_); +#line 726 "misc.c" + } + } + { + GFileInputStream* _tmp12_ = NULL; +#line 98 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp12_ = fins; +#line 98 "/home/jens/Source/shotwell/src/util/misc.vala" + g_input_stream_close (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, G_TYPE_INPUT_STREAM, GInputStream), NULL, &_inner_error_); +#line 98 "/home/jens/Source/shotwell/src/util/misc.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 737 "misc.c" + goto __catch5_g_error; + } + } + goto __finally5; + __catch5_g_error: + { + GError* err = NULL; + GFile* _tmp13_ = NULL; + gchar* _tmp14_ = NULL; + gchar* _tmp15_ = NULL; + GError* _tmp16_ = NULL; + const gchar* _tmp17_ = NULL; +#line 97 "/home/jens/Source/shotwell/src/util/misc.vala" + err = _inner_error_; +#line 97 "/home/jens/Source/shotwell/src/util/misc.vala" + _inner_error_ = NULL; +#line 100 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp13_ = file; +#line 100 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp14_ = g_file_get_path (_tmp13_); +#line 100 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp15_ = _tmp14_; +#line 100 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp16_ = err; +#line 100 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp17_ = _tmp16_->message; +#line 100 "/home/jens/Source/shotwell/src/util/misc.vala" + g_warning ("misc.vala:100: Unable to close MD5 input stream for %s: %s", _tmp15_, _tmp17_); +#line 100 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_free0 (_tmp15_); +#line 97 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_error_free0 (err); +#line 770 "misc.c" + } + __finally5: +#line 97 "/home/jens/Source/shotwell/src/util/misc.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 97 "/home/jens/Source/shotwell/src/util/misc.vala" + g_propagate_error (error, _inner_error_); +#line 97 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_object_unref0 (fins); +#line 97 "/home/jens/Source/shotwell/src/util/misc.vala" + buffer = (g_free (buffer), NULL); +#line 97 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_checksum_free0 (md5); +#line 97 "/home/jens/Source/shotwell/src/util/misc.vala" + return NULL; +#line 785 "misc.c" + } +#line 103 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp18_ = md5; +#line 103 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp19_ = g_checksum_get_string (_tmp18_); +#line 103 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp20_ = g_strdup (_tmp19_); +#line 103 "/home/jens/Source/shotwell/src/util/misc.vala" + result = _tmp20_; +#line 103 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_object_unref0 (fins); +#line 103 "/home/jens/Source/shotwell/src/util/misc.vala" + buffer = (g_free (buffer), NULL); +#line 103 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_checksum_free0 (md5); +#line 103 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 803 "misc.c" +} + + +gboolean equal_sets (GeeSet* a, GeeSet* b) { + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; + gboolean _tmp1_ = FALSE; + GeeSet* _tmp2_ = NULL; + gboolean _tmp7_ = FALSE; + GeeSet* _tmp8_ = NULL; + gboolean _tmp14_ = FALSE; + gboolean _tmp15_ = FALSE; + GeeSet* _tmp16_ = NULL; + gboolean _tmp21_ = FALSE; + GeeSet* _tmp22_ = NULL; + GeeSet* _tmp24_ = NULL; + gint _tmp25_ = 0; + gint _tmp26_ = 0; + GeeSet* _tmp27_ = NULL; + gint _tmp28_ = 0; + gint _tmp29_ = 0; +#line 107 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_val_if_fail ((a == NULL) || GEE_IS_SET (a), FALSE); +#line 107 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_val_if_fail ((b == NULL) || GEE_IS_SET (b), FALSE); +#line 108 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp2_ = a; +#line 108 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp2_ != NULL) { +#line 833 "misc.c" + GeeSet* _tmp3_ = NULL; + gint _tmp4_ = 0; + gint _tmp5_ = 0; +#line 108 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp3_ = a; +#line 108 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp4_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_COLLECTION, GeeCollection)); +#line 108 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp5_ = _tmp4_; +#line 108 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = _tmp5_ == 0; +#line 845 "misc.c" + } else { +#line 108 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = FALSE; +#line 849 "misc.c" + } +#line 108 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp1_) { +#line 853 "misc.c" + GeeSet* _tmp6_ = NULL; +#line 108 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp6_ = b; +#line 108 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = _tmp6_ == NULL; +#line 859 "misc.c" + } else { +#line 108 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = FALSE; +#line 863 "misc.c" + } +#line 108 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp0_) { +#line 109 "/home/jens/Source/shotwell/src/util/misc.vala" + result = TRUE; +#line 109 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 871 "misc.c" + } +#line 111 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp8_ = a; +#line 111 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp8_ == NULL) { +#line 877 "misc.c" + gboolean _tmp9_ = FALSE; + GeeSet* _tmp10_ = NULL; +#line 111 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp10_ = b; +#line 111 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp10_ != NULL) { +#line 884 "misc.c" + GeeSet* _tmp11_ = NULL; + gint _tmp12_ = 0; + gint _tmp13_ = 0; +#line 111 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp11_ = b; +#line 111 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp12_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, GEE_TYPE_COLLECTION, GeeCollection)); +#line 111 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp13_ = _tmp12_; +#line 111 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp9_ = _tmp13_ == 0; +#line 896 "misc.c" + } else { +#line 111 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp9_ = FALSE; +#line 900 "misc.c" + } +#line 111 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp7_ = _tmp9_; +#line 904 "misc.c" + } else { +#line 111 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp7_ = FALSE; +#line 908 "misc.c" + } +#line 111 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp7_) { +#line 112 "/home/jens/Source/shotwell/src/util/misc.vala" + result = TRUE; +#line 112 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 916 "misc.c" + } +#line 114 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp16_ = a; +#line 114 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp16_ == NULL) { +#line 922 "misc.c" + GeeSet* _tmp17_ = NULL; +#line 114 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp17_ = b; +#line 114 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp15_ = _tmp17_ != NULL; +#line 928 "misc.c" + } else { +#line 114 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp15_ = FALSE; +#line 932 "misc.c" + } +#line 114 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp15_) { +#line 114 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp14_ = TRUE; +#line 938 "misc.c" + } else { + gboolean _tmp18_ = FALSE; + GeeSet* _tmp19_ = NULL; +#line 114 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp19_ = a; +#line 114 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp19_ != NULL) { +#line 946 "misc.c" + GeeSet* _tmp20_ = NULL; +#line 114 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp20_ = b; +#line 114 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp18_ = _tmp20_ == NULL; +#line 952 "misc.c" + } else { +#line 114 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp18_ = FALSE; +#line 956 "misc.c" + } +#line 114 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp14_ = _tmp18_; +#line 960 "misc.c" + } +#line 114 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp14_) { +#line 115 "/home/jens/Source/shotwell/src/util/misc.vala" + result = FALSE; +#line 115 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 968 "misc.c" + } +#line 117 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp22_ = a; +#line 117 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp22_ == NULL) { +#line 974 "misc.c" + GeeSet* _tmp23_ = NULL; +#line 117 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp23_ = b; +#line 117 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp21_ = _tmp23_ == NULL; +#line 980 "misc.c" + } else { +#line 117 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp21_ = FALSE; +#line 984 "misc.c" + } +#line 117 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp21_) { +#line 118 "/home/jens/Source/shotwell/src/util/misc.vala" + result = TRUE; +#line 118 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 992 "misc.c" + } +#line 120 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp24_ = a; +#line 120 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp25_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, GEE_TYPE_COLLECTION, GeeCollection)); +#line 120 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp26_ = _tmp25_; +#line 120 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp27_ = b; +#line 120 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp28_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, GEE_TYPE_COLLECTION, GeeCollection)); +#line 120 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp29_ = _tmp28_; +#line 120 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp26_ != _tmp29_) { +#line 121 "/home/jens/Source/shotwell/src/util/misc.vala" + result = FALSE; +#line 121 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 1012 "misc.c" + } + { + GeeIterator* _element_it = NULL; + GeeSet* _tmp30_ = NULL; + GeeIterator* _tmp31_ = NULL; +#line 125 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp30_ = a; +#line 125 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp31_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, GEE_TYPE_ITERABLE, GeeIterable)); +#line 125 "/home/jens/Source/shotwell/src/util/misc.vala" + _element_it = _tmp31_; +#line 125 "/home/jens/Source/shotwell/src/util/misc.vala" + while (TRUE) { +#line 1026 "misc.c" + GeeIterator* _tmp32_ = NULL; + gboolean _tmp33_ = FALSE; + gchar* element = NULL; + GeeIterator* _tmp34_ = NULL; + gpointer _tmp35_ = NULL; + GeeSet* _tmp36_ = NULL; + const gchar* _tmp37_ = NULL; + gboolean _tmp38_ = FALSE; +#line 125 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp32_ = _element_it; +#line 125 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp33_ = gee_iterator_next (_tmp32_); +#line 125 "/home/jens/Source/shotwell/src/util/misc.vala" + if (!_tmp33_) { +#line 125 "/home/jens/Source/shotwell/src/util/misc.vala" + break; +#line 1043 "misc.c" + } +#line 125 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp34_ = _element_it; +#line 125 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp35_ = gee_iterator_get (_tmp34_); +#line 125 "/home/jens/Source/shotwell/src/util/misc.vala" + element = (gchar*) _tmp35_; +#line 126 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp36_ = b; +#line 126 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp37_ = element; +#line 126 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp38_ = gee_collection_contains (G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, GEE_TYPE_COLLECTION, GeeCollection), _tmp37_); +#line 126 "/home/jens/Source/shotwell/src/util/misc.vala" + if (!_tmp38_) { +#line 127 "/home/jens/Source/shotwell/src/util/misc.vala" + result = FALSE; +#line 127 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_free0 (element); +#line 127 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_object_unref0 (_element_it); +#line 127 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 1067 "misc.c" + } +#line 125 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_free0 (element); +#line 1071 "misc.c" + } +#line 125 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_object_unref0 (_element_it); +#line 1075 "misc.c" + } +#line 130 "/home/jens/Source/shotwell/src/util/misc.vala" + result = TRUE; +#line 130 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 1081 "misc.c" +} + + +static gpointer _g_object_ref0 (gpointer self) { +#line 166 "/home/jens/Source/shotwell/src/util/misc.vala" + return self ? g_object_ref (self) : NULL; +#line 1088 "misc.c" +} + + +GeeSet* intersection_of_sets (GeeSet* a, GeeSet* b, GeeSet* excluded) { + GeeSet* result = NULL; + gboolean _tmp0_ = FALSE; + GeeSet* _tmp1_ = NULL; + gboolean _tmp6_ = FALSE; + GeeSet* _tmp7_ = NULL; + GeeSet* intersection = NULL; + GeeHashSet* _tmp12_ = NULL; + GeeSet* _tmp41_ = NULL; + GeeSet* _tmp42_ = NULL; + gint _tmp43_ = 0; + gint _tmp44_ = 0; + GeeSet* _tmp46_ = NULL; +#line 134 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_val_if_fail ((a == NULL) || GEE_IS_SET (a), NULL); +#line 134 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_val_if_fail ((b == NULL) || GEE_IS_SET (b), NULL); +#line 134 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_val_if_fail ((excluded == NULL) || GEE_IS_SET (excluded), NULL); +#line 136 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = a; +#line 136 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp1_ != NULL) { +#line 1115 "misc.c" + GeeSet* _tmp2_ = NULL; +#line 136 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp2_ = b; +#line 136 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = _tmp2_ == NULL; +#line 1121 "misc.c" + } else { +#line 136 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = FALSE; +#line 1125 "misc.c" + } +#line 136 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp0_) { +#line 1129 "misc.c" + GeeSet* _tmp3_ = NULL; +#line 137 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp3_ = excluded; +#line 137 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp3_ != NULL) { +#line 1135 "misc.c" + GeeSet* _tmp4_ = NULL; + GeeSet* _tmp5_ = NULL; +#line 138 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp4_ = excluded; +#line 138 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp5_ = a; +#line 138 "/home/jens/Source/shotwell/src/util/misc.vala" + gee_collection_add_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_COLLECTION, GeeCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GEE_TYPE_COLLECTION, GeeCollection)); +#line 1144 "misc.c" + } +#line 140 "/home/jens/Source/shotwell/src/util/misc.vala" + result = NULL; +#line 140 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 1150 "misc.c" + } +#line 143 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp7_ = a; +#line 143 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp7_ == NULL) { +#line 1156 "misc.c" + GeeSet* _tmp8_ = NULL; +#line 143 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp8_ = b; +#line 143 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp6_ = _tmp8_ != NULL; +#line 1162 "misc.c" + } else { +#line 143 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp6_ = FALSE; +#line 1166 "misc.c" + } +#line 143 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp6_) { +#line 1170 "misc.c" + GeeSet* _tmp9_ = NULL; +#line 144 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp9_ = excluded; +#line 144 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp9_ != NULL) { +#line 1176 "misc.c" + GeeSet* _tmp10_ = NULL; + GeeSet* _tmp11_ = NULL; +#line 145 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp10_ = excluded; +#line 145 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp11_ = b; +#line 145 "/home/jens/Source/shotwell/src/util/misc.vala" + gee_collection_add_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, GEE_TYPE_COLLECTION, GeeCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, GEE_TYPE_COLLECTION, GeeCollection)); +#line 1185 "misc.c" + } +#line 147 "/home/jens/Source/shotwell/src/util/misc.vala" + result = NULL; +#line 147 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 1191 "misc.c" + } +#line 150 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp12_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL); +#line 150 "/home/jens/Source/shotwell/src/util/misc.vala" + intersection = G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, GEE_TYPE_SET, GeeSet); +#line 1197 "misc.c" + { + GeeIterator* _element_it = NULL; + GeeSet* _tmp13_ = NULL; + GeeIterator* _tmp14_ = NULL; +#line 152 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp13_ = a; +#line 152 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp14_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, GEE_TYPE_ITERABLE, GeeIterable)); +#line 152 "/home/jens/Source/shotwell/src/util/misc.vala" + _element_it = _tmp14_; +#line 152 "/home/jens/Source/shotwell/src/util/misc.vala" + while (TRUE) { +#line 1210 "misc.c" + GeeIterator* _tmp15_ = NULL; + gboolean _tmp16_ = FALSE; + gchar* element = NULL; + GeeIterator* _tmp17_ = NULL; + gpointer _tmp18_ = NULL; + GeeSet* _tmp19_ = NULL; + const gchar* _tmp20_ = NULL; + gboolean _tmp21_ = FALSE; +#line 152 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp15_ = _element_it; +#line 152 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp16_ = gee_iterator_next (_tmp15_); +#line 152 "/home/jens/Source/shotwell/src/util/misc.vala" + if (!_tmp16_) { +#line 152 "/home/jens/Source/shotwell/src/util/misc.vala" + break; +#line 1227 "misc.c" + } +#line 152 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp17_ = _element_it; +#line 152 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp18_ = gee_iterator_get (_tmp17_); +#line 152 "/home/jens/Source/shotwell/src/util/misc.vala" + element = (gchar*) _tmp18_; +#line 153 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp19_ = b; +#line 153 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp20_ = element; +#line 153 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp21_ = gee_collection_contains (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, GEE_TYPE_COLLECTION, GeeCollection), _tmp20_); +#line 153 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp21_) { +#line 1243 "misc.c" + GeeSet* _tmp22_ = NULL; + const gchar* _tmp23_ = NULL; +#line 154 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp22_ = intersection; +#line 154 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp23_ = element; +#line 154 "/home/jens/Source/shotwell/src/util/misc.vala" + gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, GEE_TYPE_COLLECTION, GeeCollection), _tmp23_); +#line 1252 "misc.c" + } else { + GeeSet* _tmp24_ = NULL; +#line 155 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp24_ = excluded; +#line 155 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp24_ != NULL) { +#line 1259 "misc.c" + GeeSet* _tmp25_ = NULL; + const gchar* _tmp26_ = NULL; +#line 156 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp25_ = excluded; +#line 156 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp26_ = element; +#line 156 "/home/jens/Source/shotwell/src/util/misc.vala" + gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, GEE_TYPE_COLLECTION, GeeCollection), _tmp26_); +#line 1268 "misc.c" + } + } +#line 152 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_free0 (element); +#line 1273 "misc.c" + } +#line 152 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_object_unref0 (_element_it); +#line 1277 "misc.c" + } + { + GeeIterator* _element_it = NULL; + GeeSet* _tmp27_ = NULL; + GeeIterator* _tmp28_ = NULL; +#line 159 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp27_ = b; +#line 159 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp28_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, GEE_TYPE_ITERABLE, GeeIterable)); +#line 159 "/home/jens/Source/shotwell/src/util/misc.vala" + _element_it = _tmp28_; +#line 159 "/home/jens/Source/shotwell/src/util/misc.vala" + while (TRUE) { +#line 1291 "misc.c" + GeeIterator* _tmp29_ = NULL; + gboolean _tmp30_ = FALSE; + gchar* element = NULL; + GeeIterator* _tmp31_ = NULL; + gpointer _tmp32_ = NULL; + GeeSet* _tmp33_ = NULL; + const gchar* _tmp34_ = NULL; + gboolean _tmp35_ = FALSE; +#line 159 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp29_ = _element_it; +#line 159 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp30_ = gee_iterator_next (_tmp29_); +#line 159 "/home/jens/Source/shotwell/src/util/misc.vala" + if (!_tmp30_) { +#line 159 "/home/jens/Source/shotwell/src/util/misc.vala" + break; +#line 1308 "misc.c" + } +#line 159 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp31_ = _element_it; +#line 159 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp32_ = gee_iterator_get (_tmp31_); +#line 159 "/home/jens/Source/shotwell/src/util/misc.vala" + element = (gchar*) _tmp32_; +#line 160 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp33_ = a; +#line 160 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp34_ = element; +#line 160 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp35_ = gee_collection_contains (G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, GEE_TYPE_COLLECTION, GeeCollection), _tmp34_); +#line 160 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp35_) { +#line 1324 "misc.c" + GeeSet* _tmp36_ = NULL; + const gchar* _tmp37_ = NULL; +#line 161 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp36_ = intersection; +#line 161 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp37_ = element; +#line 161 "/home/jens/Source/shotwell/src/util/misc.vala" + gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, GEE_TYPE_COLLECTION, GeeCollection), _tmp37_); +#line 1333 "misc.c" + } else { + GeeSet* _tmp38_ = NULL; +#line 162 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp38_ = excluded; +#line 162 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp38_ != NULL) { +#line 1340 "misc.c" + GeeSet* _tmp39_ = NULL; + const gchar* _tmp40_ = NULL; +#line 163 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp39_ = excluded; +#line 163 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp40_ = element; +#line 163 "/home/jens/Source/shotwell/src/util/misc.vala" + gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp39_, GEE_TYPE_COLLECTION, GeeCollection), _tmp40_); +#line 1349 "misc.c" + } + } +#line 159 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_free0 (element); +#line 1354 "misc.c" + } +#line 159 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_object_unref0 (_element_it); +#line 1358 "misc.c" + } +#line 166 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp42_ = intersection; +#line 166 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp43_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp42_, GEE_TYPE_COLLECTION, GeeCollection)); +#line 166 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp44_ = _tmp43_; +#line 166 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp44_ > 0) { +#line 1368 "misc.c" + GeeSet* _tmp45_ = NULL; +#line 166 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp45_ = intersection; +#line 166 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp41_ = _tmp45_; +#line 1374 "misc.c" + } else { +#line 166 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp41_ = NULL; +#line 1378 "misc.c" + } +#line 166 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp46_ = _g_object_ref0 (_tmp41_); +#line 166 "/home/jens/Source/shotwell/src/util/misc.vala" + result = _tmp46_; +#line 166 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_object_unref0 (intersection); +#line 166 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 1388 "misc.c" +} + + +guchar* serialize_photo_ids (GeeCollection* photos, int* result_length1) { + guchar* result = NULL; + gint64* ids = NULL; + GeeCollection* _tmp0_ = NULL; + gint _tmp1_ = 0; + gint _tmp2_ = 0; + gint64* _tmp3_ = NULL; + gint ids_length1 = 0; + gint _ids_size_ = 0; + gint ctr = 0; + gsize bytes = 0UL; + GeeCollection* _tmp16_ = NULL; + gint _tmp17_ = 0; + gint _tmp18_ = 0; + guchar* serialized = NULL; + guchar* _tmp19_ = NULL; + gint serialized_length1 = 0; + gint _serialized_size_ = 0; + gint64* _tmp20_ = NULL; + gint _tmp20__length1 = 0; + guchar* _tmp21_ = NULL; + gint _tmp21__length1 = 0; +#line 169 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_val_if_fail (GEE_IS_COLLECTION (photos), NULL); +#line 170 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = photos; +#line 170 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = gee_collection_get_size (_tmp0_); +#line 170 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp2_ = _tmp1_; +#line 170 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp3_ = g_new0 (gint64, _tmp2_); +#line 170 "/home/jens/Source/shotwell/src/util/misc.vala" + ids = _tmp3_; +#line 170 "/home/jens/Source/shotwell/src/util/misc.vala" + ids_length1 = _tmp2_; +#line 170 "/home/jens/Source/shotwell/src/util/misc.vala" + _ids_size_ = ids_length1; +#line 171 "/home/jens/Source/shotwell/src/util/misc.vala" + ctr = 0; +#line 1432 "misc.c" + { + GeeIterator* _photo_it = NULL; + GeeCollection* _tmp4_ = NULL; + GeeIterator* _tmp5_ = NULL; +#line 172 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp4_ = photos; +#line 172 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp5_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_ITERABLE, GeeIterable)); +#line 172 "/home/jens/Source/shotwell/src/util/misc.vala" + _photo_it = _tmp5_; +#line 172 "/home/jens/Source/shotwell/src/util/misc.vala" + while (TRUE) { +#line 1445 "misc.c" + GeeIterator* _tmp6_ = NULL; + gboolean _tmp7_ = FALSE; + Photo* photo = NULL; + GeeIterator* _tmp8_ = NULL; + gpointer _tmp9_ = NULL; + gint64* _tmp10_ = NULL; + gint _tmp10__length1 = 0; + gint _tmp11_ = 0; + Photo* _tmp12_ = NULL; + PhotoID _tmp13_ = {0}; + gint64 _tmp14_ = 0LL; + gint64 _tmp15_ = 0LL; +#line 172 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp6_ = _photo_it; +#line 172 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp7_ = gee_iterator_next (_tmp6_); +#line 172 "/home/jens/Source/shotwell/src/util/misc.vala" + if (!_tmp7_) { +#line 172 "/home/jens/Source/shotwell/src/util/misc.vala" + break; +#line 1466 "misc.c" + } +#line 172 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp8_ = _photo_it; +#line 172 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp9_ = gee_iterator_get (_tmp8_); +#line 172 "/home/jens/Source/shotwell/src/util/misc.vala" + photo = (Photo*) _tmp9_; +#line 173 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp10_ = ids; +#line 173 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp10__length1 = ids_length1; +#line 173 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp11_ = ctr; +#line 173 "/home/jens/Source/shotwell/src/util/misc.vala" + ctr = _tmp11_ + 1; +#line 173 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp12_ = photo; +#line 173 "/home/jens/Source/shotwell/src/util/misc.vala" + photo_get_photo_id (_tmp12_, &_tmp13_); +#line 173 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp14_ = _tmp13_.id; +#line 173 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp10_[_tmp11_] = _tmp14_; +#line 173 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp15_ = _tmp10_[_tmp11_]; +#line 172 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_object_unref0 (photo); +#line 1494 "misc.c" + } +#line 172 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_object_unref0 (_photo_it); +#line 1498 "misc.c" + } +#line 175 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp16_ = photos; +#line 175 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp17_ = gee_collection_get_size (_tmp16_); +#line 175 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp18_ = _tmp17_; +#line 175 "/home/jens/Source/shotwell/src/util/misc.vala" + bytes = (gsize) (_tmp18_ * sizeof (gint64)); +#line 176 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp19_ = g_new0 (guchar, bytes); +#line 176 "/home/jens/Source/shotwell/src/util/misc.vala" + serialized = _tmp19_; +#line 176 "/home/jens/Source/shotwell/src/util/misc.vala" + serialized_length1 = bytes; +#line 176 "/home/jens/Source/shotwell/src/util/misc.vala" + _serialized_size_ = serialized_length1; +#line 177 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp20_ = ids; +#line 177 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp20__length1 = ids_length1; +#line 177 "/home/jens/Source/shotwell/src/util/misc.vala" + memcpy (serialized, _tmp20_, bytes); +#line 179 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp21_ = serialized; +#line 179 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp21__length1 = serialized_length1; +#line 179 "/home/jens/Source/shotwell/src/util/misc.vala" + if (result_length1) { +#line 179 "/home/jens/Source/shotwell/src/util/misc.vala" + *result_length1 = _tmp21__length1; +#line 1530 "misc.c" + } +#line 179 "/home/jens/Source/shotwell/src/util/misc.vala" + result = _tmp21_; +#line 179 "/home/jens/Source/shotwell/src/util/misc.vala" + ids = (g_free (ids), NULL); +#line 179 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 1538 "misc.c" +} + + +GeeList* unserialize_photo_ids (guchar* serialized, gint size) { + GeeList* result = NULL; + gsize count = 0UL; + gint _tmp0_ = 0; + gboolean _tmp1_ = FALSE; + gsize _tmp2_ = 0UL; + gint64* ids = NULL; + gsize _tmp4_ = 0UL; + gint64* _tmp5_ = NULL; + gint ids_length1 = 0; + gint _ids_size_ = 0; + gint64* _tmp6_ = NULL; + gint _tmp6__length1 = 0; + guchar* _tmp7_ = NULL; + gint _tmp8_ = 0; + GeeArrayList* list = NULL; + GeeArrayList* _tmp9_ = NULL; + gint64* _tmp10_ = NULL; + gint _tmp10__length1 = 0; +#line 183 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = size; +#line 183 "/home/jens/Source/shotwell/src/util/misc.vala" + count = (gsize) (_tmp0_ / sizeof (gint64)); +#line 184 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp2_ = count; +#line 184 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp2_ <= ((gsize) 0)) { +#line 184 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = TRUE; +#line 1571 "misc.c" + } else { + guchar* _tmp3_ = NULL; +#line 184 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp3_ = serialized; +#line 184 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = _tmp3_ == NULL; +#line 1578 "misc.c" + } +#line 184 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp1_) { +#line 185 "/home/jens/Source/shotwell/src/util/misc.vala" + result = NULL; +#line 185 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 1586 "misc.c" + } +#line 187 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp4_ = count; +#line 187 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp5_ = g_new0 (gint64, _tmp4_); +#line 187 "/home/jens/Source/shotwell/src/util/misc.vala" + ids = _tmp5_; +#line 187 "/home/jens/Source/shotwell/src/util/misc.vala" + ids_length1 = _tmp4_; +#line 187 "/home/jens/Source/shotwell/src/util/misc.vala" + _ids_size_ = ids_length1; +#line 188 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp6_ = ids; +#line 188 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp6__length1 = ids_length1; +#line 188 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp7_ = serialized; +#line 188 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp8_ = size; +#line 188 "/home/jens/Source/shotwell/src/util/misc.vala" + memcpy (_tmp6_, _tmp7_, (gsize) _tmp8_); +#line 190 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp9_ = gee_array_list_new (TYPE_PHOTO_ID, (GBoxedCopyFunc) photo_id_dup, photo_id_free, NULL, NULL, NULL); +#line 190 "/home/jens/Source/shotwell/src/util/misc.vala" + list = _tmp9_; +#line 191 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp10_ = ids; +#line 191 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp10__length1 = ids_length1; +#line 1616 "misc.c" + { + gint64* id_collection = NULL; + gint id_collection_length1 = 0; + gint _id_collection_size_ = 0; + gint id_it = 0; +#line 191 "/home/jens/Source/shotwell/src/util/misc.vala" + id_collection = _tmp10_; +#line 191 "/home/jens/Source/shotwell/src/util/misc.vala" + id_collection_length1 = _tmp10__length1; +#line 191 "/home/jens/Source/shotwell/src/util/misc.vala" + for (id_it = 0; id_it < _tmp10__length1; id_it = id_it + 1) { +#line 1628 "misc.c" + gint64 id = 0LL; +#line 191 "/home/jens/Source/shotwell/src/util/misc.vala" + id = id_collection[id_it]; +#line 1632 "misc.c" + { + GeeArrayList* _tmp11_ = NULL; + gint64 _tmp12_ = 0LL; + PhotoID _tmp13_ = {0}; +#line 192 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp11_ = list; +#line 192 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp12_ = id; +#line 192 "/home/jens/Source/shotwell/src/util/misc.vala" + photo_id_init (&_tmp13_, _tmp12_); +#line 192 "/home/jens/Source/shotwell/src/util/misc.vala" + gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), &_tmp13_); +#line 1645 "misc.c" + } + } + } +#line 194 "/home/jens/Source/shotwell/src/util/misc.vala" + result = G_TYPE_CHECK_INSTANCE_CAST (list, GEE_TYPE_LIST, GeeList); +#line 194 "/home/jens/Source/shotwell/src/util/misc.vala" + ids = (g_free (ids), NULL); +#line 194 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 1655 "misc.c" +} + + +guchar* serialize_media_sources (GeeCollection* media, int* result_length1) { + guchar* result = NULL; + GdkAtom* atoms = NULL; + GeeCollection* _tmp0_ = NULL; + gint _tmp1_ = 0; + gint _tmp2_ = 0; + GdkAtom* _tmp3_ = NULL; + gint atoms_length1 = 0; + gint _atoms_size_ = 0; + gint ctr = 0; + gsize bytes = 0UL; + GeeCollection* _tmp17_ = NULL; + gint _tmp18_ = 0; + gint _tmp19_ = 0; + guchar* serialized = NULL; + guchar* _tmp20_ = NULL; + gint serialized_length1 = 0; + gint _serialized_size_ = 0; + GdkAtom* _tmp21_ = NULL; + gint _tmp21__length1 = 0; + guchar* _tmp22_ = NULL; + gint _tmp22__length1 = 0; +#line 197 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_val_if_fail (GEE_IS_COLLECTION (media), NULL); +#line 198 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = media; +#line 198 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = gee_collection_get_size (_tmp0_); +#line 198 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp2_ = _tmp1_; +#line 198 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp3_ = g_new0 (GdkAtom, _tmp2_); +#line 198 "/home/jens/Source/shotwell/src/util/misc.vala" + atoms = _tmp3_; +#line 198 "/home/jens/Source/shotwell/src/util/misc.vala" + atoms_length1 = _tmp2_; +#line 198 "/home/jens/Source/shotwell/src/util/misc.vala" + _atoms_size_ = atoms_length1; +#line 199 "/home/jens/Source/shotwell/src/util/misc.vala" + ctr = 0; +#line 1699 "misc.c" + { + GeeIterator* _current_media_it = NULL; + GeeCollection* _tmp4_ = NULL; + GeeIterator* _tmp5_ = NULL; +#line 200 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp4_ = media; +#line 200 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp5_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_ITERABLE, GeeIterable)); +#line 200 "/home/jens/Source/shotwell/src/util/misc.vala" + _current_media_it = _tmp5_; +#line 200 "/home/jens/Source/shotwell/src/util/misc.vala" + while (TRUE) { +#line 1712 "misc.c" + GeeIterator* _tmp6_ = NULL; + gboolean _tmp7_ = FALSE; + MediaSource* current_media = NULL; + GeeIterator* _tmp8_ = NULL; + gpointer _tmp9_ = NULL; + GdkAtom* _tmp10_ = NULL; + gint _tmp10__length1 = 0; + gint _tmp11_ = 0; + MediaSource* _tmp12_ = NULL; + gchar* _tmp13_ = NULL; + gchar* _tmp14_ = NULL; + GdkAtom _tmp15_ = 0U; + GdkAtom _tmp16_ = 0U; +#line 200 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp6_ = _current_media_it; +#line 200 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp7_ = gee_iterator_next (_tmp6_); +#line 200 "/home/jens/Source/shotwell/src/util/misc.vala" + if (!_tmp7_) { +#line 200 "/home/jens/Source/shotwell/src/util/misc.vala" + break; +#line 1734 "misc.c" + } +#line 200 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp8_ = _current_media_it; +#line 200 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp9_ = gee_iterator_get (_tmp8_); +#line 200 "/home/jens/Source/shotwell/src/util/misc.vala" + current_media = (MediaSource*) _tmp9_; +#line 201 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp10_ = atoms; +#line 201 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp10__length1 = atoms_length1; +#line 201 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp11_ = ctr; +#line 201 "/home/jens/Source/shotwell/src/util/misc.vala" + ctr = _tmp11_ + 1; +#line 201 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp12_ = current_media; +#line 201 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp13_ = data_source_get_source_id (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, TYPE_DATA_SOURCE, DataSource)); +#line 201 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp14_ = _tmp13_; +#line 201 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp15_ = gdk_atom_intern (_tmp14_, FALSE); +#line 201 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp10_[_tmp11_] = _tmp15_; +#line 201 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp16_ = _tmp10_[_tmp11_]; +#line 201 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_free0 (_tmp14_); +#line 200 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_object_unref0 (current_media); +#line 1766 "misc.c" + } +#line 200 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_object_unref0 (_current_media_it); +#line 1770 "misc.c" + } +#line 203 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp17_ = media; +#line 203 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp18_ = gee_collection_get_size (_tmp17_); +#line 203 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp19_ = _tmp18_; +#line 203 "/home/jens/Source/shotwell/src/util/misc.vala" + bytes = (gsize) (_tmp19_ * sizeof (GdkAtom)); +#line 204 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp20_ = g_new0 (guchar, bytes); +#line 204 "/home/jens/Source/shotwell/src/util/misc.vala" + serialized = _tmp20_; +#line 204 "/home/jens/Source/shotwell/src/util/misc.vala" + serialized_length1 = bytes; +#line 204 "/home/jens/Source/shotwell/src/util/misc.vala" + _serialized_size_ = serialized_length1; +#line 205 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp21_ = atoms; +#line 205 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp21__length1 = atoms_length1; +#line 205 "/home/jens/Source/shotwell/src/util/misc.vala" + memcpy (serialized, _tmp21_, bytes); +#line 207 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp22_ = serialized; +#line 207 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp22__length1 = serialized_length1; +#line 207 "/home/jens/Source/shotwell/src/util/misc.vala" + if (result_length1) { +#line 207 "/home/jens/Source/shotwell/src/util/misc.vala" + *result_length1 = _tmp22__length1; +#line 1802 "misc.c" + } +#line 207 "/home/jens/Source/shotwell/src/util/misc.vala" + result = _tmp22_; +#line 207 "/home/jens/Source/shotwell/src/util/misc.vala" + atoms = (g_free (atoms), NULL); +#line 207 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 1810 "misc.c" +} + + +GeeList* unserialize_media_sources (guchar* serialized, gint size) { + GeeList* result = NULL; + gsize count = 0UL; + gint _tmp0_ = 0; + gboolean _tmp1_ = FALSE; + gsize _tmp2_ = 0UL; + GdkAtom* atoms = NULL; + gsize _tmp4_ = 0UL; + GdkAtom* _tmp5_ = NULL; + gint atoms_length1 = 0; + gint _atoms_size_ = 0; + GdkAtom* _tmp6_ = NULL; + gint _tmp6__length1 = 0; + guchar* _tmp7_ = NULL; + gint _tmp8_ = 0; + GeeArrayList* list = NULL; + GeeArrayList* _tmp9_ = NULL; + GdkAtom* _tmp10_ = NULL; + gint _tmp10__length1 = 0; +#line 211 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = size; +#line 211 "/home/jens/Source/shotwell/src/util/misc.vala" + count = (gsize) (_tmp0_ / sizeof (GdkAtom)); +#line 212 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp2_ = count; +#line 212 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp2_ <= ((gsize) 0)) { +#line 212 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = TRUE; +#line 1843 "misc.c" + } else { + guchar* _tmp3_ = NULL; +#line 212 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp3_ = serialized; +#line 212 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = _tmp3_ == NULL; +#line 1850 "misc.c" + } +#line 212 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp1_) { +#line 213 "/home/jens/Source/shotwell/src/util/misc.vala" + result = NULL; +#line 213 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 1858 "misc.c" + } +#line 215 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp4_ = count; +#line 215 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp5_ = g_new0 (GdkAtom, _tmp4_); +#line 215 "/home/jens/Source/shotwell/src/util/misc.vala" + atoms = _tmp5_; +#line 215 "/home/jens/Source/shotwell/src/util/misc.vala" + atoms_length1 = _tmp4_; +#line 215 "/home/jens/Source/shotwell/src/util/misc.vala" + _atoms_size_ = atoms_length1; +#line 216 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp6_ = atoms; +#line 216 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp6__length1 = atoms_length1; +#line 216 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp7_ = serialized; +#line 216 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp8_ = size; +#line 216 "/home/jens/Source/shotwell/src/util/misc.vala" + memcpy (_tmp6_, _tmp7_, (gsize) _tmp8_); +#line 218 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp9_ = gee_array_list_new (TYPE_MEDIA_SOURCE, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL); +#line 218 "/home/jens/Source/shotwell/src/util/misc.vala" + list = _tmp9_; +#line 219 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp10_ = atoms; +#line 219 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp10__length1 = atoms_length1; +#line 1888 "misc.c" + { + GdkAtom* current_atom_collection = NULL; + gint current_atom_collection_length1 = 0; + gint _current_atom_collection_size_ = 0; + gint current_atom_it = 0; +#line 219 "/home/jens/Source/shotwell/src/util/misc.vala" + current_atom_collection = _tmp10_; +#line 219 "/home/jens/Source/shotwell/src/util/misc.vala" + current_atom_collection_length1 = _tmp10__length1; +#line 219 "/home/jens/Source/shotwell/src/util/misc.vala" + for (current_atom_it = 0; current_atom_it < _tmp10__length1; current_atom_it = current_atom_it + 1) { +#line 1900 "misc.c" + GdkAtom current_atom = 0U; +#line 219 "/home/jens/Source/shotwell/src/util/misc.vala" + current_atom = current_atom_collection[current_atom_it]; +#line 1904 "misc.c" + { + MediaSource* media = NULL; + MediaCollectionRegistry* _tmp11_ = NULL; + MediaCollectionRegistry* _tmp12_ = NULL; + GdkAtom _tmp13_ = 0U; + gchar* _tmp14_ = NULL; + gchar* _tmp15_ = NULL; + MediaSource* _tmp16_ = NULL; + MediaSource* _tmp17_ = NULL; + MediaSource* _tmp18_ = NULL; + GeeArrayList* _tmp19_ = NULL; + MediaSource* _tmp20_ = NULL; +#line 220 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp11_ = media_collection_registry_get_instance (); +#line 220 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp12_ = _tmp11_; +#line 220 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp13_ = current_atom; +#line 220 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp14_ = gdk_atom_name (_tmp13_); +#line 220 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp15_ = _tmp14_; +#line 220 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp16_ = media_collection_registry_fetch_media (_tmp12_, _tmp15_); +#line 220 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp17_ = _tmp16_; +#line 220 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_free0 (_tmp15_); +#line 220 "/home/jens/Source/shotwell/src/util/misc.vala" + _media_collection_registry_unref0 (_tmp12_); +#line 220 "/home/jens/Source/shotwell/src/util/misc.vala" + media = _tmp17_; +#line 221 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp18_ = media; +#line 221 "/home/jens/Source/shotwell/src/util/misc.vala" + _vala_assert (_tmp18_ != NULL, "media != null"); +#line 222 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp19_ = list; +#line 222 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp20_ = media; +#line 222 "/home/jens/Source/shotwell/src/util/misc.vala" + gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp20_); +#line 219 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_object_unref0 (media); +#line 1949 "misc.c" + } + } + } +#line 225 "/home/jens/Source/shotwell/src/util/misc.vala" + result = G_TYPE_CHECK_INSTANCE_CAST (list, GEE_TYPE_LIST, GeeList); +#line 225 "/home/jens/Source/shotwell/src/util/misc.vala" + atoms = (g_free (atoms), NULL); +#line 225 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 1959 "misc.c" +} + + +static gchar* g_time_format (struct tm *self, const gchar* format) { + gchar* result = NULL; + gchar* buffer = NULL; + gchar* _tmp0_ = NULL; + gint buffer_length1 = 0; + gint _buffer_size_ = 0; + gchar* _tmp1_ = NULL; + gint _tmp1__length1 = 0; + const gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; + gint _tmp3__length1 = 0; + gchar* _tmp4_ = NULL; +#line 2709 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + g_return_val_if_fail (format != NULL, NULL); +#line 2710 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp0_ = g_new0 (gchar, 64); +#line 2710 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + buffer = _tmp0_; +#line 2710 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + buffer_length1 = 64; +#line 2710 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _buffer_size_ = buffer_length1; +#line 2711 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp1_ = buffer; +#line 2711 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp1__length1 = buffer_length1; +#line 2711 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp2_ = format; +#line 2711 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + strftime (_tmp1_, _tmp1__length1, _tmp2_, &(*self)); +#line 2712 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp3_ = buffer; +#line 2712 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp3__length1 = buffer_length1; +#line 2712 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp4_ = g_strdup ((const gchar*) _tmp3_); +#line 2712 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + result = _tmp4_; +#line 2712 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + buffer = (g_free (buffer), NULL); +#line 2712 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + return result; +#line 2005 "misc.c" +} + + +gchar* format_local_datespan (struct tm* from_date, struct tm* to_date) { + gchar* result = NULL; + gchar* from_format = NULL; + gchar* to_format = NULL; + struct tm _tmp0_ = {0}; + gint _tmp1_ = 0; + struct tm _tmp2_ = {0}; + gint _tmp3_ = 0; + const gchar* _tmp19_ = NULL; + gchar* _tmp20_ = NULL; + gchar* _tmp21_ = NULL; + const gchar* _tmp22_ = NULL; + gchar* _tmp23_ = NULL; + gchar* _tmp24_ = NULL; + gchar* _tmp25_ = NULL; + gchar* _tmp26_ = NULL; + gchar* _tmp27_ = NULL; + gchar* _tmp28_ = NULL; +#line 228 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_val_if_fail (from_date != NULL, NULL); +#line 228 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_val_if_fail (to_date != NULL, NULL); +#line 233 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = *from_date; +#line 233 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = _tmp0_.tm_year; +#line 233 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp2_ = *to_date; +#line 233 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp3_ = _tmp2_.tm_year; +#line 233 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp1_ == _tmp3_) { +#line 2041 "misc.c" + gboolean _tmp4_ = FALSE; + struct tm _tmp5_ = {0}; + gint _tmp6_ = 0; + struct tm _tmp7_ = {0}; + gint _tmp8_ = 0; +#line 235 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp5_ = *from_date; +#line 235 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp6_ = _tmp5_.tm_mon; +#line 235 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp7_ = *to_date; +#line 235 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp8_ = _tmp7_.tm_mon; +#line 235 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp6_ == _tmp8_) { +#line 2057 "misc.c" + struct tm _tmp9_ = {0}; + gint _tmp10_ = 0; + struct tm _tmp11_ = {0}; + gint _tmp12_ = 0; +#line 235 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp9_ = *from_date; +#line 235 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp10_ = _tmp9_.tm_mday; +#line 235 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp11_ = *to_date; +#line 235 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp12_ = _tmp11_.tm_mday; +#line 235 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp4_ = _tmp10_ == (_tmp12_ - 1); +#line 2072 "misc.c" + } else { +#line 235 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp4_ = FALSE; +#line 2076 "misc.c" + } +#line 235 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp4_) { +#line 2080 "misc.c" + gchar* _tmp13_ = NULL; + gchar* _tmp14_ = NULL; +#line 237 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp13_ = resources_get_start_multiday_span_format_string (); +#line 237 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_free0 (from_format); +#line 237 "/home/jens/Source/shotwell/src/util/misc.vala" + from_format = _tmp13_; +#line 238 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp14_ = resources_get_end_multiday_span_format_string (); +#line 238 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_free0 (to_format); +#line 238 "/home/jens/Source/shotwell/src/util/misc.vala" + to_format = _tmp14_; +#line 2095 "misc.c" + } else { + gchar* _tmp15_ = NULL; + gchar* _tmp16_ = NULL; +#line 242 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp15_ = resources_get_start_multimonth_span_format_string (); +#line 242 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_free0 (from_format); +#line 242 "/home/jens/Source/shotwell/src/util/misc.vala" + from_format = _tmp15_; +#line 243 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp16_ = resources_get_end_multimonth_span_format_string (); +#line 243 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_free0 (to_format); +#line 243 "/home/jens/Source/shotwell/src/util/misc.vala" + to_format = _tmp16_; +#line 2111 "misc.c" + } + } else { + gchar* _tmp17_ = NULL; + gchar* _tmp18_ = NULL; +#line 248 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp17_ = resources_get_long_date_format_string (); +#line 248 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_free0 (from_format); +#line 248 "/home/jens/Source/shotwell/src/util/misc.vala" + from_format = _tmp17_; +#line 249 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp18_ = resources_get_long_date_format_string (); +#line 249 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_free0 (to_format); +#line 249 "/home/jens/Source/shotwell/src/util/misc.vala" + to_format = _tmp18_; +#line 2128 "misc.c" + } +#line 252 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp19_ = from_format; +#line 252 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp20_ = g_time_format (from_date, _tmp19_); +#line 252 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp21_ = _tmp20_; +#line 252 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp22_ = to_format; +#line 252 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp23_ = g_time_format (to_date, _tmp22_); +#line 252 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp24_ = _tmp23_; +#line 252 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp25_ = g_strdup_printf ("%s - %s", _tmp21_, _tmp24_); +#line 252 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp26_ = _tmp25_; +#line 252 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp27_ = string_strip_leading_zeroes (_tmp26_); +#line 252 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp28_ = _tmp27_; +#line 252 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_free0 (_tmp26_); +#line 252 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_free0 (_tmp24_); +#line 252 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_free0 (_tmp21_); +#line 252 "/home/jens/Source/shotwell/src/util/misc.vala" + result = _tmp28_; +#line 252 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_free0 (to_format); +#line 252 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_free0 (from_format); +#line 252 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 2164 "misc.c" +} + + +gchar* format_local_date (struct tm* date) { + gchar* result = NULL; + gchar* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; + gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; + gchar* _tmp4_ = NULL; + gchar* _tmp5_ = NULL; +#line 256 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_val_if_fail (date != NULL, NULL); +#line 257 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = resources_get_long_date_format_string (); +#line 257 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = _tmp0_; +#line 257 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp2_ = g_time_format (date, _tmp1_); +#line 257 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp3_ = _tmp2_; +#line 257 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp4_ = string_strip_leading_zeroes (_tmp3_); +#line 257 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp5_ = _tmp4_; +#line 257 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_free0 (_tmp3_); +#line 257 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_free0 (_tmp1_); +#line 257 "/home/jens/Source/shotwell/src/util/misc.vala" + result = _tmp5_; +#line 257 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 2198 "misc.c" +} + + +OneShotScheduler* one_shot_scheduler_construct (GType object_type, const gchar* name, OneShotCallback callback, void* callback_target) { + OneShotScheduler* self = NULL; + const gchar* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; + OneShotCallback _tmp2_ = NULL; + void* _tmp2__target = NULL; +#line 267 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_val_if_fail (name != NULL, NULL); +#line 267 "/home/jens/Source/shotwell/src/util/misc.vala" + self = (OneShotScheduler*) g_type_create_instance (object_type); +#line 268 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = name; +#line 268 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = g_strdup (_tmp0_); +#line 268 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_free0 (self->priv->name); +#line 268 "/home/jens/Source/shotwell/src/util/misc.vala" + self->priv->name = _tmp1_; +#line 269 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp2_ = callback; +#line 269 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp2__target = callback_target; +#line 269 "/home/jens/Source/shotwell/src/util/misc.vala" + self->priv->callback = _tmp2_; +#line 269 "/home/jens/Source/shotwell/src/util/misc.vala" + self->priv->callback_target = _tmp2__target; +#line 267 "/home/jens/Source/shotwell/src/util/misc.vala" + return self; +#line 2230 "misc.c" +} + + +OneShotScheduler* one_shot_scheduler_new (const gchar* name, OneShotCallback callback, void* callback_target) { +#line 267 "/home/jens/Source/shotwell/src/util/misc.vala" + return one_shot_scheduler_construct (TYPE_ONE_SHOT_SCHEDULER, name, callback, callback_target); +#line 2237 "misc.c" +} + + +gboolean one_shot_scheduler_is_scheduled (OneShotScheduler* self) { + gboolean result = FALSE; + guint _tmp0_ = 0U; +#line 280 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_val_if_fail (IS_ONE_SHOT_SCHEDULER (self), FALSE); +#line 281 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = self->priv->scheduled; +#line 281 "/home/jens/Source/shotwell/src/util/misc.vala" + result = _tmp0_ != ((guint) 0); +#line 281 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 2252 "misc.c" +} + + +void one_shot_scheduler_at_idle (OneShotScheduler* self) { +#line 284 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_if_fail (IS_ONE_SHOT_SCHEDULER (self)); +#line 285 "/home/jens/Source/shotwell/src/util/misc.vala" + one_shot_scheduler_at_priority_idle (self, G_PRIORITY_DEFAULT_IDLE); +#line 2261 "misc.c" +} + + +static gboolean _one_shot_scheduler_callback_wrapper_gsource_func (gpointer self) { + gboolean result; + result = one_shot_scheduler_callback_wrapper ((OneShotScheduler*) self); +#line 290 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 2270 "misc.c" +} + + +void one_shot_scheduler_at_priority_idle (OneShotScheduler* self, gint priority) { + guint _tmp0_ = 0U; +#line 288 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_if_fail (IS_ONE_SHOT_SCHEDULER (self)); +#line 289 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = self->priv->scheduled; +#line 289 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp0_ == ((guint) 0)) { +#line 2282 "misc.c" + gint _tmp1_ = 0; + guint _tmp2_ = 0U; +#line 290 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = priority; +#line 290 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp2_ = g_idle_add_full (_tmp1_, _one_shot_scheduler_callback_wrapper_gsource_func, one_shot_scheduler_ref (self), one_shot_scheduler_unref); +#line 290 "/home/jens/Source/shotwell/src/util/misc.vala" + self->priv->scheduled = _tmp2_; +#line 2291 "misc.c" + } +} + + +void one_shot_scheduler_after_timeout (OneShotScheduler* self, guint msec, gboolean reschedule) { + guint _tmp0_ = 0U; + gboolean _tmp1_ = FALSE; +#line 293 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_if_fail (IS_ONE_SHOT_SCHEDULER (self)); +#line 294 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = msec; +#line 294 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = reschedule; +#line 294 "/home/jens/Source/shotwell/src/util/misc.vala" + one_shot_scheduler_priority_after_timeout (self, G_PRIORITY_DEFAULT, _tmp0_, _tmp1_); +#line 2307 "misc.c" +} + + +void one_shot_scheduler_priority_after_timeout (OneShotScheduler* self, gint priority, guint msec, gboolean reschedule) { + gboolean _tmp0_ = FALSE; + guint _tmp1_ = 0U; + guint _tmp3_ = 0U; + gint _tmp5_ = 0; + guint _tmp6_ = 0U; + guint _tmp7_ = 0U; +#line 297 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_if_fail (IS_ONE_SHOT_SCHEDULER (self)); +#line 298 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = self->priv->scheduled; +#line 298 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp1_ != ((guint) 0)) { +#line 2324 "misc.c" + gboolean _tmp2_ = FALSE; +#line 298 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp2_ = reschedule; +#line 298 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = !_tmp2_; +#line 2330 "misc.c" + } else { +#line 298 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = FALSE; +#line 2334 "misc.c" + } +#line 298 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp0_) { +#line 299 "/home/jens/Source/shotwell/src/util/misc.vala" + return; +#line 2340 "misc.c" + } +#line 301 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp3_ = self->priv->scheduled; +#line 301 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp3_ != ((guint) 0)) { +#line 2346 "misc.c" + guint _tmp4_ = 0U; +#line 302 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp4_ = self->priv->scheduled; +#line 302 "/home/jens/Source/shotwell/src/util/misc.vala" + g_source_remove (_tmp4_); +#line 2352 "misc.c" + } +#line 304 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp5_ = priority; +#line 304 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp6_ = msec; +#line 304 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp7_ = g_timeout_add_full (_tmp5_, _tmp6_, _one_shot_scheduler_callback_wrapper_gsource_func, one_shot_scheduler_ref (self), one_shot_scheduler_unref); +#line 304 "/home/jens/Source/shotwell/src/util/misc.vala" + self->priv->scheduled = _tmp7_; +#line 2362 "misc.c" +} + + +void one_shot_scheduler_cancel (OneShotScheduler* self) { + guint _tmp0_ = 0U; + guint _tmp1_ = 0U; +#line 307 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_if_fail (IS_ONE_SHOT_SCHEDULER (self)); +#line 308 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = self->priv->scheduled; +#line 308 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp0_ == ((guint) 0)) { +#line 309 "/home/jens/Source/shotwell/src/util/misc.vala" + return; +#line 2377 "misc.c" + } +#line 311 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = self->priv->scheduled; +#line 311 "/home/jens/Source/shotwell/src/util/misc.vala" + g_source_remove (_tmp1_); +#line 312 "/home/jens/Source/shotwell/src/util/misc.vala" + self->priv->scheduled = (guint) 0; +#line 2385 "misc.c" +} + + +static gboolean one_shot_scheduler_callback_wrapper (OneShotScheduler* self) { + gboolean result = FALSE; + OneShotCallback _tmp0_ = NULL; + void* _tmp0__target = NULL; +#line 315 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_val_if_fail (IS_ONE_SHOT_SCHEDULER (self), FALSE); +#line 316 "/home/jens/Source/shotwell/src/util/misc.vala" + self->priv->scheduled = (guint) 0; +#line 317 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = self->priv->callback; +#line 317 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0__target = self->priv->callback_target; +#line 317 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ (_tmp0__target); +#line 319 "/home/jens/Source/shotwell/src/util/misc.vala" + result = FALSE; +#line 319 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 2407 "misc.c" +} + + +static void value_one_shot_scheduler_init (GValue* value) { +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + value->data[0].v_pointer = NULL; +#line 2414 "misc.c" +} + + +static void value_one_shot_scheduler_free_value (GValue* value) { +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + if (value->data[0].v_pointer) { +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + one_shot_scheduler_unref (value->data[0].v_pointer); +#line 2423 "misc.c" + } +} + + +static void value_one_shot_scheduler_copy_value (const GValue* src_value, GValue* dest_value) { +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + if (src_value->data[0].v_pointer) { +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + dest_value->data[0].v_pointer = one_shot_scheduler_ref (src_value->data[0].v_pointer); +#line 2433 "misc.c" + } else { +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + dest_value->data[0].v_pointer = NULL; +#line 2437 "misc.c" + } +} + + +static gpointer value_one_shot_scheduler_peek_pointer (const GValue* value) { +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + return value->data[0].v_pointer; +#line 2445 "misc.c" +} + + +static gchar* value_one_shot_scheduler_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + if (collect_values[0].v_pointer) { +#line 2452 "misc.c" + OneShotScheduler* object; + object = collect_values[0].v_pointer; +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + if (object->parent_instance.g_class == NULL) { +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); +#line 2459 "misc.c" + } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) { +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); +#line 2463 "misc.c" + } +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + value->data[0].v_pointer = one_shot_scheduler_ref (object); +#line 2467 "misc.c" + } else { +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + value->data[0].v_pointer = NULL; +#line 2471 "misc.c" + } +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + return NULL; +#line 2475 "misc.c" +} + + +static gchar* value_one_shot_scheduler_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { + OneShotScheduler** object_p; + object_p = collect_values[0].v_pointer; +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + if (!object_p) { +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value)); +#line 2486 "misc.c" + } +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + if (!value->data[0].v_pointer) { +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + *object_p = NULL; +#line 2492 "misc.c" + } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) { +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + *object_p = value->data[0].v_pointer; +#line 2496 "misc.c" + } else { +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + *object_p = one_shot_scheduler_ref (value->data[0].v_pointer); +#line 2500 "misc.c" + } +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + return NULL; +#line 2504 "misc.c" +} + + +GParamSpec* param_spec_one_shot_scheduler (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) { + ParamSpecOneShotScheduler* spec; +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_val_if_fail (g_type_is_a (object_type, TYPE_ONE_SHOT_SCHEDULER), NULL); +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags); +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + G_PARAM_SPEC (spec)->value_type = object_type; +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + return G_PARAM_SPEC (spec); +#line 2518 "misc.c" +} + + +gpointer value_get_one_shot_scheduler (const GValue* value) { +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_ONE_SHOT_SCHEDULER), NULL); +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + return value->data[0].v_pointer; +#line 2527 "misc.c" +} + + +void value_set_one_shot_scheduler (GValue* value, gpointer v_object) { + OneShotScheduler* old; +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_ONE_SHOT_SCHEDULER)); +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + old = value->data[0].v_pointer; +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + if (v_object) { +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_ONE_SHOT_SCHEDULER)); +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + value->data[0].v_pointer = v_object; +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + one_shot_scheduler_ref (value->data[0].v_pointer); +#line 2547 "misc.c" + } else { +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + value->data[0].v_pointer = NULL; +#line 2551 "misc.c" + } +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + if (old) { +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + one_shot_scheduler_unref (old); +#line 2557 "misc.c" + } +} + + +void value_take_one_shot_scheduler (GValue* value, gpointer v_object) { + OneShotScheduler* old; +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_ONE_SHOT_SCHEDULER)); +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + old = value->data[0].v_pointer; +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + if (v_object) { +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_ONE_SHOT_SCHEDULER)); +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + value->data[0].v_pointer = v_object; +#line 2576 "misc.c" + } else { +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + value->data[0].v_pointer = NULL; +#line 2580 "misc.c" + } +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + if (old) { +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + one_shot_scheduler_unref (old); +#line 2586 "misc.c" + } +} + + +static void one_shot_scheduler_class_init (OneShotSchedulerClass * klass) { +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + one_shot_scheduler_parent_class = g_type_class_peek_parent (klass); +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + ((OneShotSchedulerClass *) klass)->finalize = one_shot_scheduler_finalize; +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + g_type_class_add_private (klass, sizeof (OneShotSchedulerPrivate)); +#line 2598 "misc.c" +} + + +static void one_shot_scheduler_instance_init (OneShotScheduler * self) { +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + self->priv = ONE_SHOT_SCHEDULER_GET_PRIVATE (self); +#line 265 "/home/jens/Source/shotwell/src/util/misc.vala" + self->priv->scheduled = (guint) 0; +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + self->ref_count = 1; +#line 2609 "misc.c" +} + + +static void one_shot_scheduler_finalize (OneShotScheduler* obj) { + OneShotScheduler * self; +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_ONE_SHOT_SCHEDULER, OneShotScheduler); +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + g_signal_handlers_destroy (self); +#line 277 "/home/jens/Source/shotwell/src/util/misc.vala" + one_shot_scheduler_cancel (self); +#line 263 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_free0 (self->priv->name); +#line 2623 "misc.c" +} + + +GType one_shot_scheduler_get_type (void) { + static volatile gsize one_shot_scheduler_type_id__volatile = 0; + if (g_once_init_enter (&one_shot_scheduler_type_id__volatile)) { + static const GTypeValueTable g_define_type_value_table = { value_one_shot_scheduler_init, value_one_shot_scheduler_free_value, value_one_shot_scheduler_copy_value, value_one_shot_scheduler_peek_pointer, "p", value_one_shot_scheduler_collect_value, "p", value_one_shot_scheduler_lcopy_value }; + static const GTypeInfo g_define_type_info = { sizeof (OneShotSchedulerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) one_shot_scheduler_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (OneShotScheduler), 0, (GInstanceInitFunc) one_shot_scheduler_instance_init, &g_define_type_value_table }; + static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) }; + GType one_shot_scheduler_type_id; + one_shot_scheduler_type_id = g_type_register_fundamental (g_type_fundamental_next (), "OneShotScheduler", &g_define_type_info, &g_define_type_fundamental_info, 0); + g_once_init_leave (&one_shot_scheduler_type_id__volatile, one_shot_scheduler_type_id); + } + return one_shot_scheduler_type_id__volatile; +} + + +gpointer one_shot_scheduler_ref (gpointer instance) { + OneShotScheduler* self; + self = instance; +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + g_atomic_int_inc (&self->ref_count); +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + return instance; +#line 2648 "misc.c" +} + + +void one_shot_scheduler_unref (gpointer instance) { + OneShotScheduler* self; + self = instance; +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + if (g_atomic_int_dec_and_test (&self->ref_count)) { +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + ONE_SHOT_SCHEDULER_GET_CLASS (self)->finalize (self); +#line 262 "/home/jens/Source/shotwell/src/util/misc.vala" + g_type_free_instance ((GTypeInstance *) self); +#line 2661 "misc.c" + } +} + + +OpTimer* op_timer_construct (GType object_type, const gchar* name) { + OpTimer* self = NULL; + const gchar* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; +#line 331 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_val_if_fail (name != NULL, NULL); +#line 331 "/home/jens/Source/shotwell/src/util/misc.vala" + self = (OpTimer*) g_type_create_instance (object_type); +#line 332 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = name; +#line 332 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = g_strdup (_tmp0_); +#line 332 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_free0 (self->priv->name); +#line 332 "/home/jens/Source/shotwell/src/util/misc.vala" + self->priv->name = _tmp1_; +#line 331 "/home/jens/Source/shotwell/src/util/misc.vala" + return self; +#line 2684 "misc.c" +} + + +OpTimer* op_timer_new (const gchar* name) { +#line 331 "/home/jens/Source/shotwell/src/util/misc.vala" + return op_timer_construct (TYPE_OP_TIMER, name); +#line 2691 "misc.c" +} + + +void op_timer_start (OpTimer* self) { + GTimer* _tmp0_ = NULL; +#line 335 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_if_fail (IS_OP_TIMER (self)); +#line 336 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = self->priv->timer; +#line 336 "/home/jens/Source/shotwell/src/util/misc.vala" + g_timer_start (_tmp0_); +#line 2703 "misc.c" +} + + +void op_timer_stop (OpTimer* self) { + gdouble time = 0.0; + GTimer* _tmp0_ = NULL; + gdouble _tmp1_ = 0.0; + gdouble _tmp2_ = 0.0; + gdouble _tmp3_ = 0.0; + gdouble _tmp4_ = 0.0; + gdouble _tmp5_ = 0.0; + gdouble _tmp7_ = 0.0; + gdouble _tmp8_ = 0.0; + glong _tmp10_ = 0L; +#line 339 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_if_fail (IS_OP_TIMER (self)); +#line 340 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = self->priv->timer; +#line 340 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = g_timer_elapsed (_tmp0_, NULL); +#line 340 "/home/jens/Source/shotwell/src/util/misc.vala" + time = _tmp1_; +#line 342 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp2_ = self->priv->elapsed; +#line 342 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp3_ = time; +#line 342 "/home/jens/Source/shotwell/src/util/misc.vala" + self->priv->elapsed = _tmp2_ + _tmp3_; +#line 344 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp4_ = time; +#line 344 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp5_ = self->priv->shortest; +#line 344 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp4_ < _tmp5_) { +#line 2738 "misc.c" + gdouble _tmp6_ = 0.0; +#line 345 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp6_ = time; +#line 345 "/home/jens/Source/shotwell/src/util/misc.vala" + self->priv->shortest = _tmp6_; +#line 2744 "misc.c" + } +#line 347 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp7_ = time; +#line 347 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp8_ = self->priv->longest; +#line 347 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp7_ > _tmp8_) { +#line 2752 "misc.c" + gdouble _tmp9_ = 0.0; +#line 348 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp9_ = time; +#line 348 "/home/jens/Source/shotwell/src/util/misc.vala" + self->priv->longest = _tmp9_; +#line 2758 "misc.c" + } +#line 350 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp10_ = self->priv->count; +#line 350 "/home/jens/Source/shotwell/src/util/misc.vala" + self->priv->count = _tmp10_ + 1; +#line 2764 "misc.c" +} + + +gchar* op_timer_to_string (OpTimer* self) { + gchar* result = NULL; + glong _tmp0_ = 0L; +#line 353 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_val_if_fail (IS_OP_TIMER (self), NULL); +#line 354 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = self->priv->count; +#line 354 "/home/jens/Source/shotwell/src/util/misc.vala" + if (_tmp0_ > ((glong) 0)) { +#line 2777 "misc.c" + const gchar* _tmp1_ = NULL; + glong _tmp2_ = 0L; + gdouble _tmp3_ = 0.0; + gdouble _tmp4_ = 0.0; + gdouble _tmp5_ = 0.0; + glong _tmp6_ = 0L; + gdouble _tmp7_ = 0.0; + gchar* _tmp8_ = NULL; +#line 355 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = self->priv->name; +#line 355 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp2_ = self->priv->count; +#line 355 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp3_ = self->priv->elapsed; +#line 355 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp4_ = self->priv->shortest; +#line 355 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp5_ = self->priv->elapsed; +#line 355 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp6_ = self->priv->count; +#line 355 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp7_ = self->priv->longest; +#line 355 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp8_ = g_strdup_printf ("%s: count=%ld elapsed=%.03lfs min/avg/max=%.03lf/%.03lf/%.03lf", _tmp1_, _tmp2_, _tmp3_, _tmp4_, _tmp5_ / ((gdouble) _tmp6_), _tmp7_); +#line 355 "/home/jens/Source/shotwell/src/util/misc.vala" + result = _tmp8_; +#line 355 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 2806 "misc.c" + } else { + const gchar* _tmp9_ = NULL; + gchar* _tmp10_ = NULL; +#line 358 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp9_ = self->priv->name; +#line 358 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp10_ = g_strdup_printf ("%s: no operations", _tmp9_); +#line 358 "/home/jens/Source/shotwell/src/util/misc.vala" + result = _tmp10_; +#line 358 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 2818 "misc.c" + } +} + + +static void value_op_timer_init (GValue* value) { +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + value->data[0].v_pointer = NULL; +#line 2826 "misc.c" +} + + +static void value_op_timer_free_value (GValue* value) { +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + if (value->data[0].v_pointer) { +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + op_timer_unref (value->data[0].v_pointer); +#line 2835 "misc.c" + } +} + + +static void value_op_timer_copy_value (const GValue* src_value, GValue* dest_value) { +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + if (src_value->data[0].v_pointer) { +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + dest_value->data[0].v_pointer = op_timer_ref (src_value->data[0].v_pointer); +#line 2845 "misc.c" + } else { +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + dest_value->data[0].v_pointer = NULL; +#line 2849 "misc.c" + } +} + + +static gpointer value_op_timer_peek_pointer (const GValue* value) { +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + return value->data[0].v_pointer; +#line 2857 "misc.c" +} + + +static gchar* value_op_timer_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + if (collect_values[0].v_pointer) { +#line 2864 "misc.c" + OpTimer* object; + object = collect_values[0].v_pointer; +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + if (object->parent_instance.g_class == NULL) { +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); +#line 2871 "misc.c" + } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) { +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); +#line 2875 "misc.c" + } +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + value->data[0].v_pointer = op_timer_ref (object); +#line 2879 "misc.c" + } else { +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + value->data[0].v_pointer = NULL; +#line 2883 "misc.c" + } +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + return NULL; +#line 2887 "misc.c" +} + + +static gchar* value_op_timer_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { + OpTimer** object_p; + object_p = collect_values[0].v_pointer; +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + if (!object_p) { +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value)); +#line 2898 "misc.c" + } +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + if (!value->data[0].v_pointer) { +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + *object_p = NULL; +#line 2904 "misc.c" + } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) { +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + *object_p = value->data[0].v_pointer; +#line 2908 "misc.c" + } else { +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + *object_p = op_timer_ref (value->data[0].v_pointer); +#line 2912 "misc.c" + } +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + return NULL; +#line 2916 "misc.c" +} + + +GParamSpec* param_spec_op_timer (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) { + ParamSpecOpTimer* spec; +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_val_if_fail (g_type_is_a (object_type, TYPE_OP_TIMER), NULL); +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags); +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + G_PARAM_SPEC (spec)->value_type = object_type; +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + return G_PARAM_SPEC (spec); +#line 2930 "misc.c" +} + + +gpointer value_get_op_timer (const GValue* value) { +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_OP_TIMER), NULL); +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + return value->data[0].v_pointer; +#line 2939 "misc.c" +} + + +void value_set_op_timer (GValue* value, gpointer v_object) { + OpTimer* old; +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_OP_TIMER)); +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + old = value->data[0].v_pointer; +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + if (v_object) { +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_OP_TIMER)); +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + value->data[0].v_pointer = v_object; +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + op_timer_ref (value->data[0].v_pointer); +#line 2959 "misc.c" + } else { +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + value->data[0].v_pointer = NULL; +#line 2963 "misc.c" + } +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + if (old) { +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + op_timer_unref (old); +#line 2969 "misc.c" + } +} + + +void value_take_op_timer (GValue* value, gpointer v_object) { + OpTimer* old; +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_OP_TIMER)); +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + old = value->data[0].v_pointer; +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + if (v_object) { +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_OP_TIMER)); +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + value->data[0].v_pointer = v_object; +#line 2988 "misc.c" + } else { +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + value->data[0].v_pointer = NULL; +#line 2992 "misc.c" + } +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + if (old) { +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + op_timer_unref (old); +#line 2998 "misc.c" + } +} + + +static void op_timer_class_init (OpTimerClass * klass) { +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + op_timer_parent_class = g_type_class_peek_parent (klass); +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + ((OpTimerClass *) klass)->finalize = op_timer_finalize; +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + g_type_class_add_private (klass, sizeof (OpTimerPrivate)); +#line 3010 "misc.c" +} + + +static void op_timer_instance_init (OpTimer * self) { + GTimer* _tmp0_ = NULL; +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + self->priv = OP_TIMER_GET_PRIVATE (self); +#line 325 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp0_ = g_timer_new (); +#line 325 "/home/jens/Source/shotwell/src/util/misc.vala" + self->priv->timer = _tmp0_; +#line 326 "/home/jens/Source/shotwell/src/util/misc.vala" + self->priv->count = (glong) 0; +#line 327 "/home/jens/Source/shotwell/src/util/misc.vala" + self->priv->elapsed = (gdouble) 0; +#line 328 "/home/jens/Source/shotwell/src/util/misc.vala" + self->priv->shortest = DBL_MAX; +#line 329 "/home/jens/Source/shotwell/src/util/misc.vala" + self->priv->longest = DBL_MIN; +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + self->ref_count = 1; +#line 3032 "misc.c" +} + + +static void op_timer_finalize (OpTimer* obj) { + OpTimer * self; +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_OP_TIMER, OpTimer); +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + g_signal_handlers_destroy (self); +#line 324 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_free0 (self->priv->name); +#line 325 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_timer_destroy0 (self->priv->timer); +#line 3046 "misc.c" +} + + +GType op_timer_get_type (void) { + static volatile gsize op_timer_type_id__volatile = 0; + if (g_once_init_enter (&op_timer_type_id__volatile)) { + static const GTypeValueTable g_define_type_value_table = { value_op_timer_init, value_op_timer_free_value, value_op_timer_copy_value, value_op_timer_peek_pointer, "p", value_op_timer_collect_value, "p", value_op_timer_lcopy_value }; + static const GTypeInfo g_define_type_info = { sizeof (OpTimerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) op_timer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (OpTimer), 0, (GInstanceInitFunc) op_timer_instance_init, &g_define_type_value_table }; + static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) }; + GType op_timer_type_id; + op_timer_type_id = g_type_register_fundamental (g_type_fundamental_next (), "OpTimer", &g_define_type_info, &g_define_type_fundamental_info, 0); + g_once_init_leave (&op_timer_type_id__volatile, op_timer_type_id); + } + return op_timer_type_id__volatile; +} + + +gpointer op_timer_ref (gpointer instance) { + OpTimer* self; + self = instance; +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + g_atomic_int_inc (&self->ref_count); +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + return instance; +#line 3071 "misc.c" +} + + +void op_timer_unref (gpointer instance) { + OpTimer* self; + self = instance; +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + if (g_atomic_int_dec_and_test (&self->ref_count)) { +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + OP_TIMER_GET_CLASS (self)->finalize (self); +#line 323 "/home/jens/Source/shotwell/src/util/misc.vala" + g_type_free_instance ((GTypeInstance *) self); +#line 3084 "misc.c" + } +} + + +void suppress_warnings (const gchar* log_domain, GLogLevelFlags log_levels, const gchar* message) { +#line 369 "/home/jens/Source/shotwell/src/util/misc.vala" + g_return_if_fail (message != NULL); +#line 3092 "misc.c" +} + + +static void g_time_local (time_t time, struct tm* result) { + struct tm _result_ = {0}; + struct tm _tmp0_ = {0}; +#line 2701 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + localtime_r (&time, &_tmp0_); +#line 2701 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _result_ = _tmp0_; +#line 2702 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + *result = _result_; +#line 2702 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + return; +#line 3107 "misc.c" +} + + +gboolean is_twentyfour_hr_time_system (void) { + gboolean result = FALSE; + struct tm _tmp0_ = {0}; + gchar* _tmp1_ = NULL; + gchar* _tmp2_ = NULL; + gboolean _tmp3_ = FALSE; + gboolean _tmp4_ = FALSE; +#line 375 "/home/jens/Source/shotwell/src/util/misc.vala" + g_time_local ((time_t) 0, &_tmp0_); +#line 375 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp1_ = g_time_format (&_tmp0_, "%p"); +#line 375 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp2_ = _tmp1_; +#line 375 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp3_ = is_string_empty (_tmp2_); +#line 375 "/home/jens/Source/shotwell/src/util/misc.vala" + _tmp4_ = _tmp3_; +#line 375 "/home/jens/Source/shotwell/src/util/misc.vala" + _g_free0 (_tmp2_); +#line 375 "/home/jens/Source/shotwell/src/util/misc.vala" + result = _tmp4_; +#line 375 "/home/jens/Source/shotwell/src/util/misc.vala" + return result; +#line 3134 "misc.c" +} + + + diff --git a/src/util/mk/util.mk b/src/util/mk/util.mk deleted file mode 100644 index 86a8bd5..0000000 --- a/src/util/mk/util.mk +++ /dev/null @@ -1,34 +0,0 @@ - -# UNIT_NAME is the Vala namespace. A file named UNIT_NAME.vala must be in this directory with -# a init() and terminate() function declared in the namespace. -UNIT_NAME := Util - -# UNIT_DIR should match the subdirectory the files are located in. Generally UNIT_NAME in all -# lowercase. The name of this file should be UNIT_DIR.mk. -UNIT_DIR := util - -# All Vala files in the unit should be listed here with no subdirectory prefix. -# -# NOTE: Do *not* include the unit's master file, i.e. UNIT_NAME.vala. -UNIT_FILES := \ - file.vala \ - image.vala \ - misc.vala \ - string.vala \ - system.vala \ - KeyValueMap.vala \ - ui.vala - -# Any unit this unit relies upon (and should be initialized before it's initialized) should -# be listed here using its Vala namespace. -# -# NOTE: All units are assumed to rely upon the unit-unit. Do not include that here. -UNIT_USES := - -# List any additional files that are used in the build process as a part of this unit that should -# be packaged in the tarball. File names should be relative to the unit's home directory. -UNIT_RC := - -# unitize.mk must be called at the end of each UNIT_DIR.mk file. -include unitize.mk - diff --git a/src/util/string.c b/src/util/string.c new file mode 100644 index 0000000..4cfeedd --- /dev/null +++ b/src/util/string.c @@ -0,0 +1,2016 @@ +/* string.c generated by valac 0.32.1, the Vala compiler + * generated from string.vala, do not modify */ + +/* Copyright 2016 Software Freedom Conservancy Inc. + * + * This software is licensed under the GNU Lesser General Public License + * (version 2.1 or later). See the COPYING file in this distribution. + */ + +#include <glib.h> +#include <glib-object.h> +#include <stdlib.h> +#include <string.h> + +#define _g_free0(var) (var = (g_free (var), NULL)) +#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL))) + +#define TYPE_PREPARE_INPUT_TEXT_OPTIONS (prepare_input_text_options_get_type ()) + +typedef enum { + PREPARE_INPUT_TEXT_OPTIONS_EMPTY_IS_NULL = 1 << 0, + PREPARE_INPUT_TEXT_OPTIONS_VALIDATE = 1 << 1, + PREPARE_INPUT_TEXT_OPTIONS_INVALID_IS_NULL = 1 << 2, + PREPARE_INPUT_TEXT_OPTIONS_STRIP = 1 << 3, + PREPARE_INPUT_TEXT_OPTIONS_STRIP_CRLF = 1 << 4, + PREPARE_INPUT_TEXT_OPTIONS_NORMALIZE = 1 << 5, + PREPARE_INPUT_TEXT_OPTIONS_DEFAULT = ((((PREPARE_INPUT_TEXT_OPTIONS_EMPTY_IS_NULL | PREPARE_INPUT_TEXT_OPTIONS_VALIDATE) | PREPARE_INPUT_TEXT_OPTIONS_INVALID_IS_NULL) | PREPARE_INPUT_TEXT_OPTIONS_STRIP_CRLF) | PREPARE_INPUT_TEXT_OPTIONS_STRIP) | PREPARE_INPUT_TEXT_OPTIONS_NORMALIZE +} PrepareInputTextOptions; + + + +gint64 g_ascii_strtoll (const gchar* str, gchar** endptr, guint num_base); +#define DEFAULT_USER_TEXT_INPUT_LENGTH 1024 +gboolean is_string_empty (const gchar* s); +gint utf8_cs_compare (void* a, void* b); +gint utf8_ci_compare (void* a, void* b); +gchar* uchar_array_to_string (guchar* data, int data_length1, gint length); +guchar* string_to_uchar_array (const gchar* str, int* result_length1); +static void _vala_array_add1 (guchar** array, int* length, int* size, guchar value); +gchar* guarded_markup_escape_text (const gchar* plain); +glong find_last_offset (const gchar* str, gchar c); +gboolean is_in_ci_array (const gchar* str, gchar** strings, int strings_length1); +GType prepare_input_text_options_get_type (void) G_GNUC_CONST; +gchar* prepare_input_text (const gchar* text, PrepareInputTextOptions options, gint dest_length); +gint64 parse_int64 (const gchar* str, gint num_base); +gboolean string_contains_char (const gchar* haystack, gunichar needle); +gboolean string_contains_str (const gchar* haystack, const gchar* needle); +gchar* string_sliced_at (const gchar* str, gint index); +gchar* string_sliced_at_first_str (const gchar* haystack, const gchar* needle, gint start_index); +gchar* string_sliced_at_last_str (const gchar* haystack, const gchar* needle, gint start_index); +gchar* string_sliced_at_first_char (const gchar* haystack, gunichar ch, gint start_index); +gchar* string_sliced_at_last_char (const gchar* haystack, gunichar ch, gint start_index); +gchar* string_strip_leading_zeroes (const gchar* str); +gchar* string_remove_diacritics (const gchar* istring); +gchar* string_to_hex_string (const gchar* str); +guint string_collated_hash (void* ptr); +guint string_precollated_hash (void* ptr); +gint string_collated_compare (void* a, void* b); +gint string_precollated_compare (const gchar* astr, const gchar* akey, const gchar* bstr, const gchar* bkey); +gboolean string_collated_equals (void* a, void* b); +gboolean string_precollated_equals (const gchar* astr, const gchar* akey, const gchar* bstr, const gchar* bkey); + + +static gchar string_get (const gchar* self, glong index) { + gchar result = '\0'; + glong _tmp0_ = 0L; + gchar _tmp1_ = '\0'; +#line 1086 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, '\0'); +#line 1087 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp0_ = index; +#line 1087 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp1_ = ((gchar*) self)[_tmp0_]; +#line 1087 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + result = _tmp1_; +#line 1087 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + return result; +#line 79 "string.c" +} + + +inline gboolean is_string_empty (const gchar* s) { + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; + const gchar* _tmp1_ = NULL; +#line 12 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = s; +#line 12 "/home/jens/Source/shotwell/src/util/string.vala" + if (_tmp1_ == NULL) { +#line 12 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = TRUE; +#line 93 "string.c" + } else { + const gchar* _tmp2_ = NULL; + gchar _tmp3_ = '\0'; +#line 12 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = s; +#line 12 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp3_ = string_get (_tmp2_, (glong) 0); +#line 12 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = _tmp3_ == '\0'; +#line 103 "string.c" + } +#line 12 "/home/jens/Source/shotwell/src/util/string.vala" + result = _tmp0_; +#line 12 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 109 "string.c" +} + + +gint utf8_cs_compare (void* a, void* b) { + gint result = 0; + void* _tmp0_ = NULL; + void* _tmp1_ = NULL; + gint _tmp2_ = 0; +#line 17 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = a; +#line 17 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = b; +#line 17 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = g_utf8_collate ((const gchar*) _tmp0_, (const gchar*) _tmp1_); +#line 17 "/home/jens/Source/shotwell/src/util/string.vala" + result = _tmp2_; +#line 17 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 128 "string.c" +} + + +gint utf8_ci_compare (void* a, void* b) { + gint result = 0; + void* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; + gchar* _tmp2_ = NULL; + void* _tmp3_ = NULL; + gchar* _tmp4_ = NULL; + gchar* _tmp5_ = NULL; + gint _tmp6_ = 0; + gint _tmp7_ = 0; +#line 22 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = a; +#line 22 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = g_utf8_strdown ((const gchar*) _tmp0_, (gssize) -1); +#line 22 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = _tmp1_; +#line 22 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp3_ = b; +#line 22 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp4_ = g_utf8_strdown ((const gchar*) _tmp3_, (gssize) -1); +#line 22 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp5_ = _tmp4_; +#line 22 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp6_ = g_utf8_collate (_tmp2_, _tmp5_); +#line 22 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp7_ = _tmp6_; +#line 22 "/home/jens/Source/shotwell/src/util/string.vala" + _g_free0 (_tmp5_); +#line 22 "/home/jens/Source/shotwell/src/util/string.vala" + _g_free0 (_tmp2_); +#line 22 "/home/jens/Source/shotwell/src/util/string.vala" + result = _tmp7_; +#line 22 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 166 "string.c" +} + + +gchar* uchar_array_to_string (guchar* data, int data_length1, gint length) { + gchar* result = NULL; + gint _tmp0_ = 0; + GString* builder = NULL; + GString* _tmp2_ = NULL; + GString* _tmp14_ = NULL; + const gchar* _tmp15_ = NULL; + gchar* _tmp16_ = NULL; +#line 27 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = length; +#line 27 "/home/jens/Source/shotwell/src/util/string.vala" + if (_tmp0_ < 0) { +#line 182 "string.c" + guchar* _tmp1_ = NULL; + gint _tmp1__length1 = 0; +#line 28 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = data; +#line 28 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1__length1 = data_length1; +#line 28 "/home/jens/Source/shotwell/src/util/string.vala" + length = _tmp1__length1; +#line 191 "string.c" + } +#line 30 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = g_string_new (""); +#line 30 "/home/jens/Source/shotwell/src/util/string.vala" + builder = _tmp2_; +#line 197 "string.c" + { + gint ctr = 0; +#line 31 "/home/jens/Source/shotwell/src/util/string.vala" + ctr = 0; +#line 202 "string.c" + { + gboolean _tmp3_ = FALSE; +#line 31 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp3_ = TRUE; +#line 31 "/home/jens/Source/shotwell/src/util/string.vala" + while (TRUE) { +#line 209 "string.c" + gint _tmp5_ = 0; + gint _tmp6_ = 0; + guchar* _tmp7_ = NULL; + gint _tmp7__length1 = 0; + gint _tmp8_ = 0; + guchar _tmp9_ = '\0'; +#line 31 "/home/jens/Source/shotwell/src/util/string.vala" + if (!_tmp3_) { +#line 218 "string.c" + gint _tmp4_ = 0; +#line 31 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp4_ = ctr; +#line 31 "/home/jens/Source/shotwell/src/util/string.vala" + ctr = _tmp4_ + 1; +#line 224 "string.c" + } +#line 31 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp3_ = FALSE; +#line 31 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp5_ = ctr; +#line 31 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp6_ = length; +#line 31 "/home/jens/Source/shotwell/src/util/string.vala" + if (!(_tmp5_ < _tmp6_)) { +#line 31 "/home/jens/Source/shotwell/src/util/string.vala" + break; +#line 236 "string.c" + } +#line 32 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp7_ = data; +#line 32 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp7__length1 = data_length1; +#line 32 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp8_ = ctr; +#line 32 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp9_ = _tmp7_[_tmp8_]; +#line 32 "/home/jens/Source/shotwell/src/util/string.vala" + if (_tmp9_ != ((guchar) '\0')) { +#line 248 "string.c" + GString* _tmp10_ = NULL; + guchar* _tmp11_ = NULL; + gint _tmp11__length1 = 0; + gint _tmp12_ = 0; + guchar _tmp13_ = '\0'; +#line 33 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp10_ = builder; +#line 33 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp11_ = data; +#line 33 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp11__length1 = data_length1; +#line 33 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp12_ = ctr; +#line 33 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp13_ = _tmp11_[_tmp12_]; +#line 33 "/home/jens/Source/shotwell/src/util/string.vala" + g_string_append_c (_tmp10_, (gchar) _tmp13_); +#line 266 "string.c" + } else { +#line 35 "/home/jens/Source/shotwell/src/util/string.vala" + break; +#line 270 "string.c" + } + } + } + } +#line 38 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp14_ = builder; +#line 38 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp15_ = _tmp14_->str; +#line 38 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp16_ = g_strdup (_tmp15_); +#line 38 "/home/jens/Source/shotwell/src/util/string.vala" + result = _tmp16_; +#line 38 "/home/jens/Source/shotwell/src/util/string.vala" + _g_string_free0 (builder); +#line 38 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 287 "string.c" +} + + +static void _vala_array_add1 (guchar** array, int* length, int* size, guchar value) { +#line 45 "/home/jens/Source/shotwell/src/util/string.vala" + if ((*length) == (*size)) { +#line 45 "/home/jens/Source/shotwell/src/util/string.vala" + *size = (*size) ? (2 * (*size)) : 4; +#line 45 "/home/jens/Source/shotwell/src/util/string.vala" + *array = g_renew (guchar, *array, *size); +#line 298 "string.c" + } +#line 45 "/home/jens/Source/shotwell/src/util/string.vala" + (*array)[(*length)++] = value; +#line 302 "string.c" +} + + +guchar* string_to_uchar_array (const gchar* str, int* result_length1) { + guchar* result = NULL; + guchar* data = NULL; + guchar* _tmp0_ = NULL; + gint data_length1 = 0; + gint _data_size_ = 0; + guchar* _tmp11_ = NULL; + gint _tmp11__length1 = 0; +#line 42 "/home/jens/Source/shotwell/src/util/string.vala" + g_return_val_if_fail (str != NULL, NULL); +#line 43 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = g_new0 (guchar, 0); +#line 43 "/home/jens/Source/shotwell/src/util/string.vala" + data = _tmp0_; +#line 43 "/home/jens/Source/shotwell/src/util/string.vala" + data_length1 = 0; +#line 43 "/home/jens/Source/shotwell/src/util/string.vala" + _data_size_ = data_length1; +#line 324 "string.c" + { + gint ctr = 0; +#line 44 "/home/jens/Source/shotwell/src/util/string.vala" + ctr = 0; +#line 329 "string.c" + { + gboolean _tmp1_ = FALSE; +#line 44 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = TRUE; +#line 44 "/home/jens/Source/shotwell/src/util/string.vala" + while (TRUE) { +#line 336 "string.c" + gint _tmp3_ = 0; + const gchar* _tmp4_ = NULL; + gint _tmp5_ = 0; + gint _tmp6_ = 0; + guchar* _tmp7_ = NULL; + gint _tmp7__length1 = 0; + const gchar* _tmp8_ = NULL; + gint _tmp9_ = 0; + gchar _tmp10_ = '\0'; +#line 44 "/home/jens/Source/shotwell/src/util/string.vala" + if (!_tmp1_) { +#line 348 "string.c" + gint _tmp2_ = 0; +#line 44 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = ctr; +#line 44 "/home/jens/Source/shotwell/src/util/string.vala" + ctr = _tmp2_ + 1; +#line 354 "string.c" + } +#line 44 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = FALSE; +#line 44 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp3_ = ctr; +#line 44 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp4_ = str; +#line 44 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp5_ = strlen (_tmp4_); +#line 44 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp6_ = _tmp5_; +#line 44 "/home/jens/Source/shotwell/src/util/string.vala" + if (!(_tmp3_ < _tmp6_)) { +#line 44 "/home/jens/Source/shotwell/src/util/string.vala" + break; +#line 370 "string.c" + } +#line 45 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp7_ = data; +#line 45 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp7__length1 = data_length1; +#line 45 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp8_ = str; +#line 45 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp9_ = ctr; +#line 45 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp10_ = string_get (_tmp8_, (glong) _tmp9_); +#line 45 "/home/jens/Source/shotwell/src/util/string.vala" + _vala_array_add1 (&data, &data_length1, &_data_size_, (guchar) _tmp10_); +#line 384 "string.c" + } + } + } +#line 47 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp11_ = data; +#line 47 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp11__length1 = data_length1; +#line 47 "/home/jens/Source/shotwell/src/util/string.vala" + if (result_length1) { +#line 47 "/home/jens/Source/shotwell/src/util/string.vala" + *result_length1 = _tmp11__length1; +#line 396 "string.c" + } +#line 47 "/home/jens/Source/shotwell/src/util/string.vala" + result = _tmp11_; +#line 47 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 402 "string.c" +} + + +inline gchar* guarded_markup_escape_text (const gchar* plain) { + gchar* result = NULL; + gchar* _tmp0_ = NULL; + gboolean _tmp1_ = FALSE; + const gchar* _tmp2_ = NULL; + gboolean _tmp3_ = FALSE; +#line 58 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = plain; +#line 58 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp3_ = is_string_empty (_tmp2_); +#line 58 "/home/jens/Source/shotwell/src/util/string.vala" + if (!_tmp3_) { +#line 418 "string.c" + const gchar* _tmp4_ = NULL; + gboolean _tmp5_ = FALSE; +#line 58 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp4_ = plain; +#line 58 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp5_ = g_utf8_validate (_tmp4_, (gssize) -1, NULL); +#line 58 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = _tmp5_; +#line 427 "string.c" + } else { +#line 58 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = FALSE; +#line 431 "string.c" + } +#line 58 "/home/jens/Source/shotwell/src/util/string.vala" + if (_tmp1_) { +#line 435 "string.c" + const gchar* _tmp6_ = NULL; + gchar* _tmp7_ = NULL; +#line 58 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp6_ = plain; +#line 58 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp7_ = g_markup_escape_text (_tmp6_, (gssize) -1); +#line 58 "/home/jens/Source/shotwell/src/util/string.vala" + _g_free0 (_tmp0_); +#line 58 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = _tmp7_; +#line 446 "string.c" + } else { + gchar* _tmp8_ = NULL; +#line 58 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp8_ = g_strdup (""); +#line 58 "/home/jens/Source/shotwell/src/util/string.vala" + _g_free0 (_tmp0_); +#line 58 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = _tmp8_; +#line 455 "string.c" + } +#line 58 "/home/jens/Source/shotwell/src/util/string.vala" + result = _tmp0_; +#line 58 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 461 "string.c" +} + + +glong find_last_offset (const gchar* str, gchar c) { + glong result = 0L; + glong offset = 0L; + const gchar* _tmp0_ = NULL; + gint _tmp1_ = 0; + gint _tmp2_ = 0; +#line 61 "/home/jens/Source/shotwell/src/util/string.vala" + g_return_val_if_fail (str != NULL, 0L); +#line 62 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = str; +#line 62 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = strlen (_tmp0_); +#line 62 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = _tmp1_; +#line 62 "/home/jens/Source/shotwell/src/util/string.vala" + offset = (glong) _tmp2_; +#line 63 "/home/jens/Source/shotwell/src/util/string.vala" + while (TRUE) { +#line 483 "string.c" + glong _tmp3_ = 0L; + glong _tmp4_ = 0L; + const gchar* _tmp5_ = NULL; + glong _tmp6_ = 0L; + gchar _tmp7_ = '\0'; + gchar _tmp8_ = '\0'; +#line 63 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp3_ = offset; +#line 63 "/home/jens/Source/shotwell/src/util/string.vala" + offset = _tmp3_ - 1; +#line 63 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp4_ = offset; +#line 63 "/home/jens/Source/shotwell/src/util/string.vala" + if (!(_tmp4_ >= ((glong) 0))) { +#line 63 "/home/jens/Source/shotwell/src/util/string.vala" + break; +#line 500 "string.c" + } +#line 64 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp5_ = str; +#line 64 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp6_ = offset; +#line 64 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp7_ = string_get (_tmp5_, _tmp6_); +#line 64 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp8_ = c; +#line 64 "/home/jens/Source/shotwell/src/util/string.vala" + if (_tmp7_ == _tmp8_) { +#line 65 "/home/jens/Source/shotwell/src/util/string.vala" + result = offset; +#line 65 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 516 "string.c" + } + } +#line 68 "/home/jens/Source/shotwell/src/util/string.vala" + result = (glong) -1; +#line 68 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 523 "string.c" +} + + +gboolean is_in_ci_array (const gchar* str, gchar** strings, int strings_length1) { + gboolean result = FALSE; + gchar* strdown = NULL; + const gchar* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; + gchar** _tmp2_ = NULL; + gint _tmp2__length1 = 0; +#line 73 "/home/jens/Source/shotwell/src/util/string.vala" + g_return_val_if_fail (str != NULL, FALSE); +#line 74 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = str; +#line 74 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = g_utf8_strdown (_tmp0_, (gssize) -1); +#line 74 "/home/jens/Source/shotwell/src/util/string.vala" + strdown = _tmp1_; +#line 75 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = strings; +#line 75 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2__length1 = strings_length1; +#line 546 "string.c" + { + gchar** str_element_collection = NULL; + gint str_element_collection_length1 = 0; + gint _str_element_collection_size_ = 0; + gint str_element_it = 0; +#line 75 "/home/jens/Source/shotwell/src/util/string.vala" + str_element_collection = _tmp2_; +#line 75 "/home/jens/Source/shotwell/src/util/string.vala" + str_element_collection_length1 = _tmp2__length1; +#line 75 "/home/jens/Source/shotwell/src/util/string.vala" + for (str_element_it = 0; str_element_it < _tmp2__length1; str_element_it = str_element_it + 1) { +#line 558 "string.c" + gchar* _tmp3_ = NULL; + gchar* str_element = NULL; +#line 75 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp3_ = g_strdup (str_element_collection[str_element_it]); +#line 75 "/home/jens/Source/shotwell/src/util/string.vala" + str_element = _tmp3_; +#line 565 "string.c" + { + const gchar* _tmp4_ = NULL; + const gchar* _tmp5_ = NULL; +#line 76 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp4_ = strdown; +#line 76 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp5_ = str_element; +#line 76 "/home/jens/Source/shotwell/src/util/string.vala" + if (g_strcmp0 (_tmp4_, _tmp5_) == 0) { +#line 77 "/home/jens/Source/shotwell/src/util/string.vala" + result = TRUE; +#line 77 "/home/jens/Source/shotwell/src/util/string.vala" + _g_free0 (str_element); +#line 77 "/home/jens/Source/shotwell/src/util/string.vala" + _g_free0 (strdown); +#line 77 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 583 "string.c" + } +#line 75 "/home/jens/Source/shotwell/src/util/string.vala" + _g_free0 (str_element); +#line 587 "string.c" + } + } + } +#line 80 "/home/jens/Source/shotwell/src/util/string.vala" + result = FALSE; +#line 80 "/home/jens/Source/shotwell/src/util/string.vala" + _g_free0 (strdown); +#line 80 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 597 "string.c" +} + + +GType prepare_input_text_options_get_type (void) { + static volatile gsize prepare_input_text_options_type_id__volatile = 0; + if (g_once_init_enter (&prepare_input_text_options_type_id__volatile)) { + static const GFlagsValue values[] = {{PREPARE_INPUT_TEXT_OPTIONS_EMPTY_IS_NULL, "PREPARE_INPUT_TEXT_OPTIONS_EMPTY_IS_NULL", "empty-is-null"}, {PREPARE_INPUT_TEXT_OPTIONS_VALIDATE, "PREPARE_INPUT_TEXT_OPTIONS_VALIDATE", "validate"}, {PREPARE_INPUT_TEXT_OPTIONS_INVALID_IS_NULL, "PREPARE_INPUT_TEXT_OPTIONS_INVALID_IS_NULL", "invalid-is-null"}, {PREPARE_INPUT_TEXT_OPTIONS_STRIP, "PREPARE_INPUT_TEXT_OPTIONS_STRIP", "strip"}, {PREPARE_INPUT_TEXT_OPTIONS_STRIP_CRLF, "PREPARE_INPUT_TEXT_OPTIONS_STRIP_CRLF", "strip-crlf"}, {PREPARE_INPUT_TEXT_OPTIONS_NORMALIZE, "PREPARE_INPUT_TEXT_OPTIONS_NORMALIZE", "normalize"}, {PREPARE_INPUT_TEXT_OPTIONS_DEFAULT, "PREPARE_INPUT_TEXT_OPTIONS_DEFAULT", "default"}, {0, NULL, NULL}}; + GType prepare_input_text_options_type_id; + prepare_input_text_options_type_id = g_flags_register_static ("PrepareInputTextOptions", values); + g_once_init_leave (&prepare_input_text_options_type_id__volatile, prepare_input_text_options_type_id); + } + return prepare_input_text_options_type_id__volatile; +} + + +static gchar* string_strip (const gchar* self) { + gchar* result = NULL; + gchar* _result_ = NULL; + gchar* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; +#line 1207 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, NULL); +#line 1208 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp0_ = g_strdup (self); +#line 1208 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _result_ = _tmp0_; +#line 1209 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp1_ = _result_; +#line 1209 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + g_strstrip (_tmp1_); +#line 1210 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + result = _result_; +#line 1210 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + return result; +#line 632 "string.c" +} + + +static gchar* string_delimit (const gchar* self, const gchar* delimiters, gchar new_delimiter) { + gchar* result = NULL; + gchar* _result_ = NULL; + gchar* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + const gchar* _tmp2_ = NULL; + gchar _tmp3_ = '\0'; +#line 1215 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, NULL); +#line 1215 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + g_return_val_if_fail (delimiters != NULL, NULL); +#line 1216 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp0_ = g_strdup (self); +#line 1216 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _result_ = _tmp0_; +#line 1217 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp1_ = _result_; +#line 1217 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp2_ = delimiters; +#line 1217 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp3_ = new_delimiter; +#line 1217 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + g_strdelimit (_tmp1_, _tmp2_, _tmp3_); +#line 1218 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + result = _result_; +#line 1218 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + return result; +#line 663 "string.c" +} + + +gchar* prepare_input_text (const gchar* text, PrepareInputTextOptions options, gint dest_length) { + gchar* result = NULL; + const gchar* _tmp0_ = NULL; + gboolean _tmp1_ = FALSE; + PrepareInputTextOptions _tmp2_ = 0; + gchar* prepped = NULL; + const gchar* _tmp8_ = NULL; + gchar* _tmp9_ = NULL; + PrepareInputTextOptions _tmp10_ = 0; + PrepareInputTextOptions _tmp13_ = 0; + PrepareInputTextOptions _tmp16_ = 0; + gboolean _tmp19_ = FALSE; + PrepareInputTextOptions _tmp20_ = 0; + gint _tmp23_ = 0; +#line 95 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = text; +#line 95 "/home/jens/Source/shotwell/src/util/string.vala" + if (_tmp0_ == NULL) { +#line 96 "/home/jens/Source/shotwell/src/util/string.vala" + result = NULL; +#line 96 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 689 "string.c" + } +#line 98 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = options; +#line 98 "/home/jens/Source/shotwell/src/util/string.vala" + if ((_tmp2_ & PREPARE_INPUT_TEXT_OPTIONS_VALIDATE) != 0) { +#line 695 "string.c" + const gchar* _tmp3_ = NULL; + gboolean _tmp4_ = FALSE; +#line 98 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp3_ = text; +#line 98 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp4_ = g_utf8_validate (_tmp3_, (gssize) -1, NULL); +#line 98 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = !_tmp4_; +#line 704 "string.c" + } else { +#line 98 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = FALSE; +#line 708 "string.c" + } +#line 98 "/home/jens/Source/shotwell/src/util/string.vala" + if (_tmp1_) { +#line 712 "string.c" + const gchar* _tmp5_ = NULL; + PrepareInputTextOptions _tmp6_ = 0; + gchar* _tmp7_ = NULL; +#line 99 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp6_ = options; +#line 99 "/home/jens/Source/shotwell/src/util/string.vala" + if ((_tmp6_ & PREPARE_INPUT_TEXT_OPTIONS_INVALID_IS_NULL) != 0) { +#line 99 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp5_ = NULL; +#line 722 "string.c" + } else { +#line 99 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp5_ = ""; +#line 726 "string.c" + } +#line 99 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp7_ = g_strdup (_tmp5_); +#line 99 "/home/jens/Source/shotwell/src/util/string.vala" + result = _tmp7_; +#line 99 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 734 "string.c" + } +#line 101 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp8_ = text; +#line 101 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp9_ = g_strdup (_tmp8_); +#line 101 "/home/jens/Source/shotwell/src/util/string.vala" + prepped = _tmp9_; +#line 107 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp10_ = options; +#line 107 "/home/jens/Source/shotwell/src/util/string.vala" + if ((_tmp10_ & PREPARE_INPUT_TEXT_OPTIONS_NORMALIZE) != 0) { +#line 746 "string.c" + const gchar* _tmp11_ = NULL; + gchar* _tmp12_ = NULL; +#line 108 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp11_ = prepped; +#line 108 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp12_ = g_utf8_normalize (_tmp11_, (gssize) -1, G_NORMALIZE_NFC); +#line 108 "/home/jens/Source/shotwell/src/util/string.vala" + _g_free0 (prepped); +#line 108 "/home/jens/Source/shotwell/src/util/string.vala" + prepped = _tmp12_; +#line 757 "string.c" + } +#line 110 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp13_ = options; +#line 110 "/home/jens/Source/shotwell/src/util/string.vala" + if ((_tmp13_ & PREPARE_INPUT_TEXT_OPTIONS_STRIP) != 0) { +#line 763 "string.c" + const gchar* _tmp14_ = NULL; + gchar* _tmp15_ = NULL; +#line 111 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp14_ = prepped; +#line 111 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp15_ = string_strip (_tmp14_); +#line 111 "/home/jens/Source/shotwell/src/util/string.vala" + _g_free0 (prepped); +#line 111 "/home/jens/Source/shotwell/src/util/string.vala" + prepped = _tmp15_; +#line 774 "string.c" + } +#line 115 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp16_ = options; +#line 115 "/home/jens/Source/shotwell/src/util/string.vala" + if ((_tmp16_ & PREPARE_INPUT_TEXT_OPTIONS_STRIP_CRLF) != 0) { +#line 780 "string.c" + const gchar* _tmp17_ = NULL; + gchar* _tmp18_ = NULL; +#line 116 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp17_ = prepped; +#line 116 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp18_ = string_delimit (_tmp17_, "\n\r", ' '); +#line 116 "/home/jens/Source/shotwell/src/util/string.vala" + _g_free0 (prepped); +#line 116 "/home/jens/Source/shotwell/src/util/string.vala" + prepped = _tmp18_; +#line 791 "string.c" + } +#line 118 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp20_ = options; +#line 118 "/home/jens/Source/shotwell/src/util/string.vala" + if ((_tmp20_ & PREPARE_INPUT_TEXT_OPTIONS_EMPTY_IS_NULL) != 0) { +#line 797 "string.c" + const gchar* _tmp21_ = NULL; + gboolean _tmp22_ = FALSE; +#line 118 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp21_ = prepped; +#line 118 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp22_ = is_string_empty (_tmp21_); +#line 118 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp19_ = _tmp22_; +#line 806 "string.c" + } else { +#line 118 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp19_ = FALSE; +#line 810 "string.c" + } +#line 118 "/home/jens/Source/shotwell/src/util/string.vala" + if (_tmp19_) { +#line 119 "/home/jens/Source/shotwell/src/util/string.vala" + result = NULL; +#line 119 "/home/jens/Source/shotwell/src/util/string.vala" + _g_free0 (prepped); +#line 119 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 820 "string.c" + } +#line 124 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp23_ = dest_length; +#line 124 "/home/jens/Source/shotwell/src/util/string.vala" + if (_tmp23_ >= 0) { +#line 826 "string.c" + GString* sb = NULL; + const gchar* _tmp24_ = NULL; + GString* _tmp25_ = NULL; + GString* _tmp26_ = NULL; + gint _tmp27_ = 0; + GString* _tmp28_ = NULL; + const gchar* _tmp29_ = NULL; + gchar* _tmp30_ = NULL; +#line 125 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp24_ = prepped; +#line 125 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp25_ = g_string_new (_tmp24_); +#line 125 "/home/jens/Source/shotwell/src/util/string.vala" + sb = _tmp25_; +#line 126 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp26_ = sb; +#line 126 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp27_ = dest_length; +#line 126 "/home/jens/Source/shotwell/src/util/string.vala" + g_string_truncate (_tmp26_, (gsize) _tmp27_); +#line 127 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp28_ = sb; +#line 127 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp29_ = _tmp28_->str; +#line 127 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp30_ = g_strdup (_tmp29_); +#line 127 "/home/jens/Source/shotwell/src/util/string.vala" + result = _tmp30_; +#line 127 "/home/jens/Source/shotwell/src/util/string.vala" + _g_string_free0 (sb); +#line 127 "/home/jens/Source/shotwell/src/util/string.vala" + _g_free0 (prepped); +#line 127 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 861 "string.c" + } +#line 131 "/home/jens/Source/shotwell/src/util/string.vala" + result = prepped; +#line 131 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 867 "string.c" +} + + +gint64 parse_int64 (const gchar* str, gint num_base) { + gint64 result = 0LL; + const gchar* _tmp0_ = NULL; + gint _tmp1_ = 0; + gint64 _tmp2_ = 0LL; +#line 134 "/home/jens/Source/shotwell/src/util/string.vala" + g_return_val_if_fail (str != NULL, 0LL); +#line 135 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = str; +#line 135 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = num_base; +#line 135 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = g_ascii_strtoll (_tmp0_, NULL, (guint) _tmp1_); +#line 135 "/home/jens/Source/shotwell/src/util/string.vala" + result = _tmp2_; +#line 135 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 888 "string.c" +} + + +static gint string_index_of_char (const gchar* self, gunichar c, gint start_index) { + gint result = 0; + gchar* _result_ = NULL; + gint _tmp0_ = 0; + gunichar _tmp1_ = 0U; + gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; +#line 1007 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, 0); +#line 1008 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp0_ = start_index; +#line 1008 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp1_ = c; +#line 1008 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp2_ = g_utf8_strchr (((gchar*) self) + _tmp0_, (gssize) -1, _tmp1_); +#line 1008 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _result_ = _tmp2_; +#line 1010 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp3_ = _result_; +#line 1010 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + if (_tmp3_ != NULL) { +#line 913 "string.c" + gchar* _tmp4_ = NULL; +#line 1011 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp4_ = _result_; +#line 1011 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + result = (gint) (_tmp4_ - ((gchar*) self)); +#line 1011 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + return result; +#line 921 "string.c" + } else { +#line 1013 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + result = -1; +#line 1013 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + return result; +#line 927 "string.c" + } +} + + +inline gboolean string_contains_char (const gchar* haystack, gunichar needle) { + gboolean result = FALSE; + const gchar* _tmp0_ = NULL; + gunichar _tmp1_ = 0U; + gint _tmp2_ = 0; +#line 140 "/home/jens/Source/shotwell/src/util/string.vala" + g_return_val_if_fail (haystack != NULL, FALSE); +#line 141 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = haystack; +#line 141 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = needle; +#line 141 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = string_index_of_char (_tmp0_, _tmp1_, 0); +#line 141 "/home/jens/Source/shotwell/src/util/string.vala" + result = _tmp2_ >= 0; +#line 141 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 949 "string.c" +} + + +static gint string_index_of (const gchar* self, const gchar* needle, gint start_index) { + gint result = 0; + gchar* _result_ = NULL; + gint _tmp0_ = 0; + const gchar* _tmp1_ = NULL; + gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; +#line 987 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, 0); +#line 987 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + g_return_val_if_fail (needle != NULL, 0); +#line 988 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp0_ = start_index; +#line 988 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp1_ = needle; +#line 988 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp2_ = strstr (((gchar*) self) + _tmp0_, (gchar*) _tmp1_); +#line 988 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _result_ = _tmp2_; +#line 990 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp3_ = _result_; +#line 990 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + if (_tmp3_ != NULL) { +#line 976 "string.c" + gchar* _tmp4_ = NULL; +#line 991 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp4_ = _result_; +#line 991 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + result = (gint) (_tmp4_ - ((gchar*) self)); +#line 991 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + return result; +#line 984 "string.c" + } else { +#line 993 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + result = -1; +#line 993 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + return result; +#line 990 "string.c" + } +} + + +inline gboolean string_contains_str (const gchar* haystack, const gchar* needle) { + gboolean result = FALSE; + const gchar* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + gint _tmp2_ = 0; +#line 144 "/home/jens/Source/shotwell/src/util/string.vala" + g_return_val_if_fail (haystack != NULL, FALSE); +#line 144 "/home/jens/Source/shotwell/src/util/string.vala" + g_return_val_if_fail (needle != NULL, FALSE); +#line 145 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = haystack; +#line 145 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = needle; +#line 145 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = string_index_of (_tmp0_, _tmp1_, 0); +#line 145 "/home/jens/Source/shotwell/src/util/string.vala" + result = _tmp2_ >= 0; +#line 145 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 1014 "string.c" +} + + +static gchar* string_slice (const gchar* self, glong start, glong end) { + gchar* result = NULL; + glong string_length = 0L; + gint _tmp0_ = 0; + gint _tmp1_ = 0; + glong _tmp2_ = 0L; + glong _tmp5_ = 0L; + gboolean _tmp8_ = FALSE; + glong _tmp9_ = 0L; + gboolean _tmp12_ = FALSE; + glong _tmp13_ = 0L; + glong _tmp16_ = 0L; + glong _tmp17_ = 0L; + glong _tmp18_ = 0L; + glong _tmp19_ = 0L; + glong _tmp20_ = 0L; + gchar* _tmp21_ = NULL; +#line 1328 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, NULL); +#line 1329 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp0_ = strlen (self); +#line 1329 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp1_ = _tmp0_; +#line 1329 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + string_length = (glong) _tmp1_; +#line 1330 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp2_ = start; +#line 1330 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + if (_tmp2_ < ((glong) 0)) { +#line 1047 "string.c" + glong _tmp3_ = 0L; + glong _tmp4_ = 0L; +#line 1331 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp3_ = string_length; +#line 1331 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp4_ = start; +#line 1331 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + start = _tmp3_ + _tmp4_; +#line 1056 "string.c" + } +#line 1333 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp5_ = end; +#line 1333 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + if (_tmp5_ < ((glong) 0)) { +#line 1062 "string.c" + glong _tmp6_ = 0L; + glong _tmp7_ = 0L; +#line 1334 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp6_ = string_length; +#line 1334 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp7_ = end; +#line 1334 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + end = _tmp6_ + _tmp7_; +#line 1071 "string.c" + } +#line 1336 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp9_ = start; +#line 1336 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + if (_tmp9_ >= ((glong) 0)) { +#line 1077 "string.c" + glong _tmp10_ = 0L; + glong _tmp11_ = 0L; +#line 1336 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp10_ = start; +#line 1336 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp11_ = string_length; +#line 1336 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp8_ = _tmp10_ <= _tmp11_; +#line 1086 "string.c" + } else { +#line 1336 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp8_ = FALSE; +#line 1090 "string.c" + } +#line 1336 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + g_return_val_if_fail (_tmp8_, NULL); +#line 1337 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp13_ = end; +#line 1337 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + if (_tmp13_ >= ((glong) 0)) { +#line 1098 "string.c" + glong _tmp14_ = 0L; + glong _tmp15_ = 0L; +#line 1337 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp14_ = end; +#line 1337 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp15_ = string_length; +#line 1337 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp12_ = _tmp14_ <= _tmp15_; +#line 1107 "string.c" + } else { +#line 1337 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp12_ = FALSE; +#line 1111 "string.c" + } +#line 1337 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + g_return_val_if_fail (_tmp12_, NULL); +#line 1338 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp16_ = start; +#line 1338 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp17_ = end; +#line 1338 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + g_return_val_if_fail (_tmp16_ <= _tmp17_, NULL); +#line 1339 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp18_ = start; +#line 1339 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp19_ = end; +#line 1339 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp20_ = start; +#line 1339 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp21_ = g_strndup (((gchar*) self) + _tmp18_, (gsize) (_tmp19_ - _tmp20_)); +#line 1339 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + result = _tmp21_; +#line 1339 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + return result; +#line 1133 "string.c" +} + + +inline gchar* string_sliced_at (const gchar* str, gint index) { + gchar* result = NULL; + gchar* _tmp0_ = NULL; + gint _tmp1_ = 0; +#line 148 "/home/jens/Source/shotwell/src/util/string.vala" + g_return_val_if_fail (str != NULL, NULL); +#line 149 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = index; +#line 149 "/home/jens/Source/shotwell/src/util/string.vala" + if (_tmp1_ >= 0) { +#line 1147 "string.c" + const gchar* _tmp2_ = NULL; + gint _tmp3_ = 0; + const gchar* _tmp4_ = NULL; + gint _tmp5_ = 0; + gint _tmp6_ = 0; + gchar* _tmp7_ = NULL; +#line 149 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = str; +#line 149 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp3_ = index; +#line 149 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp4_ = str; +#line 149 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp5_ = strlen (_tmp4_); +#line 149 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp6_ = _tmp5_; +#line 149 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp7_ = string_slice (_tmp2_, (glong) _tmp3_, (glong) _tmp6_); +#line 149 "/home/jens/Source/shotwell/src/util/string.vala" + _g_free0 (_tmp0_); +#line 149 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = _tmp7_; +#line 1170 "string.c" + } else { +#line 149 "/home/jens/Source/shotwell/src/util/string.vala" + _g_free0 (_tmp0_); +#line 149 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = NULL; +#line 1176 "string.c" + } +#line 149 "/home/jens/Source/shotwell/src/util/string.vala" + result = _tmp0_; +#line 149 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 1182 "string.c" +} + + +inline gchar* string_sliced_at_first_str (const gchar* haystack, const gchar* needle, gint start_index) { + gchar* result = NULL; + const gchar* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + const gchar* _tmp2_ = NULL; + gint _tmp3_ = 0; + gint _tmp4_ = 0; + gchar* _tmp5_ = NULL; +#line 152 "/home/jens/Source/shotwell/src/util/string.vala" + g_return_val_if_fail (haystack != NULL, NULL); +#line 152 "/home/jens/Source/shotwell/src/util/string.vala" + g_return_val_if_fail (needle != NULL, NULL); +#line 153 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = haystack; +#line 153 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = haystack; +#line 153 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = needle; +#line 153 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp3_ = start_index; +#line 153 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp4_ = string_index_of (_tmp1_, _tmp2_, _tmp3_); +#line 153 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp5_ = string_sliced_at (_tmp0_, _tmp4_); +#line 153 "/home/jens/Source/shotwell/src/util/string.vala" + result = _tmp5_; +#line 153 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 1214 "string.c" +} + + +static gint string_last_index_of (const gchar* self, const gchar* needle, gint start_index) { + gint result = 0; + gchar* _result_ = NULL; + gint _tmp0_ = 0; + const gchar* _tmp1_ = NULL; + gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; +#line 997 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, 0); +#line 997 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + g_return_val_if_fail (needle != NULL, 0); +#line 998 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp0_ = start_index; +#line 998 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp1_ = needle; +#line 998 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp2_ = g_strrstr (((gchar*) self) + _tmp0_, (gchar*) _tmp1_); +#line 998 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _result_ = _tmp2_; +#line 1000 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp3_ = _result_; +#line 1000 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + if (_tmp3_ != NULL) { +#line 1241 "string.c" + gchar* _tmp4_ = NULL; +#line 1001 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp4_ = _result_; +#line 1001 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + result = (gint) (_tmp4_ - ((gchar*) self)); +#line 1001 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + return result; +#line 1249 "string.c" + } else { +#line 1003 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + result = -1; +#line 1003 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + return result; +#line 1255 "string.c" + } +} + + +inline gchar* string_sliced_at_last_str (const gchar* haystack, const gchar* needle, gint start_index) { + gchar* result = NULL; + const gchar* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + const gchar* _tmp2_ = NULL; + gint _tmp3_ = 0; + gint _tmp4_ = 0; + gchar* _tmp5_ = NULL; +#line 156 "/home/jens/Source/shotwell/src/util/string.vala" + g_return_val_if_fail (haystack != NULL, NULL); +#line 156 "/home/jens/Source/shotwell/src/util/string.vala" + g_return_val_if_fail (needle != NULL, NULL); +#line 157 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = haystack; +#line 157 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = haystack; +#line 157 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = needle; +#line 157 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp3_ = start_index; +#line 157 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp4_ = string_last_index_of (_tmp1_, _tmp2_, _tmp3_); +#line 157 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp5_ = string_sliced_at (_tmp0_, _tmp4_); +#line 157 "/home/jens/Source/shotwell/src/util/string.vala" + result = _tmp5_; +#line 157 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 1288 "string.c" +} + + +inline gchar* string_sliced_at_first_char (const gchar* haystack, gunichar ch, gint start_index) { + gchar* result = NULL; + const gchar* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + gunichar _tmp2_ = 0U; + gint _tmp3_ = 0; + gint _tmp4_ = 0; + gchar* _tmp5_ = NULL; +#line 160 "/home/jens/Source/shotwell/src/util/string.vala" + g_return_val_if_fail (haystack != NULL, NULL); +#line 161 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = haystack; +#line 161 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = haystack; +#line 161 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = ch; +#line 161 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp3_ = start_index; +#line 161 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp4_ = string_index_of_char (_tmp1_, _tmp2_, _tmp3_); +#line 161 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp5_ = string_sliced_at (_tmp0_, _tmp4_); +#line 161 "/home/jens/Source/shotwell/src/util/string.vala" + result = _tmp5_; +#line 161 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 1318 "string.c" +} + + +static gint string_last_index_of_char (const gchar* self, gunichar c, gint start_index) { + gint result = 0; + gchar* _result_ = NULL; + gint _tmp0_ = 0; + gunichar _tmp1_ = 0U; + gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; +#line 1017 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, 0); +#line 1018 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp0_ = start_index; +#line 1018 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp1_ = c; +#line 1018 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp2_ = g_utf8_strrchr (((gchar*) self) + _tmp0_, (gssize) -1, _tmp1_); +#line 1018 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _result_ = _tmp2_; +#line 1020 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp3_ = _result_; +#line 1020 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + if (_tmp3_ != NULL) { +#line 1343 "string.c" + gchar* _tmp4_ = NULL; +#line 1021 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp4_ = _result_; +#line 1021 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + result = (gint) (_tmp4_ - ((gchar*) self)); +#line 1021 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + return result; +#line 1351 "string.c" + } else { +#line 1023 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + result = -1; +#line 1023 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + return result; +#line 1357 "string.c" + } +} + + +inline gchar* string_sliced_at_last_char (const gchar* haystack, gunichar ch, gint start_index) { + gchar* result = NULL; + const gchar* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + gunichar _tmp2_ = 0U; + gint _tmp3_ = 0; + gint _tmp4_ = 0; + gchar* _tmp5_ = NULL; +#line 164 "/home/jens/Source/shotwell/src/util/string.vala" + g_return_val_if_fail (haystack != NULL, NULL); +#line 165 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = haystack; +#line 165 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = haystack; +#line 165 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = ch; +#line 165 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp3_ = start_index; +#line 165 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp4_ = string_last_index_of_char (_tmp1_, _tmp2_, _tmp3_); +#line 165 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp5_ = string_sliced_at (_tmp0_, _tmp4_); +#line 165 "/home/jens/Source/shotwell/src/util/string.vala" + result = _tmp5_; +#line 165 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 1388 "string.c" +} + + +static gunichar string_get_char (const gchar* self, glong index) { + gunichar result = 0U; + glong _tmp0_ = 0L; + gunichar _tmp1_ = 0U; +#line 1116 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, 0U); +#line 1117 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp0_ = index; +#line 1117 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp1_ = g_utf8_get_char (((gchar*) self) + _tmp0_); +#line 1117 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + result = _tmp1_; +#line 1117 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + return result; +#line 1406 "string.c" +} + + +gchar* string_strip_leading_zeroes (const gchar* str) { + gchar* result = NULL; + GString* stripped = NULL; + GString* _tmp0_ = NULL; + gboolean prev_is_space = FALSE; + GString* _tmp16_ = NULL; + const gchar* _tmp17_ = NULL; + gchar* _tmp18_ = NULL; +#line 169 "/home/jens/Source/shotwell/src/util/string.vala" + g_return_val_if_fail (str != NULL, NULL); +#line 170 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = g_string_new (""); +#line 170 "/home/jens/Source/shotwell/src/util/string.vala" + stripped = _tmp0_; +#line 171 "/home/jens/Source/shotwell/src/util/string.vala" + prev_is_space = TRUE; +#line 1426 "string.c" + { + const gchar* iter = NULL; + const gchar* _tmp1_ = NULL; +#line 172 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = str; +#line 172 "/home/jens/Source/shotwell/src/util/string.vala" + iter = _tmp1_; +#line 1434 "string.c" + { + gboolean _tmp2_ = FALSE; +#line 172 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = TRUE; +#line 172 "/home/jens/Source/shotwell/src/util/string.vala" + while (TRUE) { +#line 1441 "string.c" + const gchar* _tmp5_ = NULL; + gunichar _tmp6_ = 0U; + gunichar ch = 0U; + const gchar* _tmp7_ = NULL; + gunichar _tmp8_ = 0U; + gboolean _tmp9_ = FALSE; + gboolean _tmp10_ = FALSE; +#line 172 "/home/jens/Source/shotwell/src/util/string.vala" + if (!_tmp2_) { +#line 1451 "string.c" + const gchar* _tmp3_ = NULL; + const gchar* _tmp4_ = NULL; +#line 172 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp3_ = iter; +#line 172 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp4_ = g_utf8_next_char (_tmp3_); +#line 172 "/home/jens/Source/shotwell/src/util/string.vala" + iter = _tmp4_; +#line 1460 "string.c" + } +#line 172 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = FALSE; +#line 172 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp5_ = iter; +#line 172 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp6_ = string_get_char (_tmp5_, (glong) 0); +#line 172 "/home/jens/Source/shotwell/src/util/string.vala" + if (!(_tmp6_ != ((gunichar) 0))) { +#line 172 "/home/jens/Source/shotwell/src/util/string.vala" + break; +#line 1472 "string.c" + } +#line 173 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp7_ = iter; +#line 173 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp8_ = string_get_char (_tmp7_, (glong) 0); +#line 173 "/home/jens/Source/shotwell/src/util/string.vala" + ch = _tmp8_; +#line 175 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp10_ = prev_is_space; +#line 175 "/home/jens/Source/shotwell/src/util/string.vala" + if (!_tmp10_) { +#line 175 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp9_ = TRUE; +#line 1486 "string.c" + } else { + gunichar _tmp11_ = 0U; +#line 175 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp11_ = ch; +#line 175 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp9_ = _tmp11_ != ((gunichar) '0'); +#line 1493 "string.c" + } +#line 175 "/home/jens/Source/shotwell/src/util/string.vala" + if (_tmp9_) { +#line 1497 "string.c" + GString* _tmp12_ = NULL; + gunichar _tmp13_ = 0U; + gunichar _tmp14_ = 0U; + gboolean _tmp15_ = FALSE; +#line 176 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp12_ = stripped; +#line 176 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp13_ = ch; +#line 176 "/home/jens/Source/shotwell/src/util/string.vala" + g_string_append_unichar (_tmp12_, _tmp13_); +#line 177 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp14_ = ch; +#line 177 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp15_ = g_unichar_isspace (_tmp14_); +#line 177 "/home/jens/Source/shotwell/src/util/string.vala" + prev_is_space = _tmp15_; +#line 1514 "string.c" + } + } + } + } +#line 181 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp16_ = stripped; +#line 181 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp17_ = _tmp16_->str; +#line 181 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp18_ = g_strdup (_tmp17_); +#line 181 "/home/jens/Source/shotwell/src/util/string.vala" + result = _tmp18_; +#line 181 "/home/jens/Source/shotwell/src/util/string.vala" + _g_string_free0 (stripped); +#line 181 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 1531 "string.c" +} + + +static gboolean string_get_next_char (const gchar* self, gint* index, gunichar* c) { + gunichar _vala_c = 0U; + gboolean result = FALSE; + gint _tmp0_ = 0; + gunichar _tmp1_ = 0U; + gunichar _tmp2_ = 0U; +#line 1105 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, FALSE); +#line 1106 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp0_ = *index; +#line 1106 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp1_ = g_utf8_get_char (((gchar*) self) + _tmp0_); +#line 1106 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _vala_c = _tmp1_; +#line 1107 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp2_ = _vala_c; +#line 1107 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + if (_tmp2_ != ((gunichar) 0)) { +#line 1553 "string.c" + gint _tmp3_ = 0; + gchar* _tmp4_ = NULL; +#line 1108 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp3_ = *index; +#line 1108 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + _tmp4_ = g_utf8_next_char (((gchar*) self) + _tmp3_); +#line 1108 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + *index = (gint) (_tmp4_ - ((gchar*) self)); +#line 1109 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + result = TRUE; +#line 1109 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + if (c) { +#line 1109 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + *c = _vala_c; +#line 1568 "string.c" + } +#line 1109 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + return result; +#line 1572 "string.c" + } else { +#line 1111 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + result = FALSE; +#line 1111 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + if (c) { +#line 1111 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + *c = _vala_c; +#line 1580 "string.c" + } +#line 1111 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + return result; +#line 1584 "string.c" + } +#line 1105 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + if (c) { +#line 1105 "/usr/share/vala-0.32/vapi/glib-2.0.vapi" + *c = _vala_c; +#line 1590 "string.c" + } +} + + +gchar* string_remove_diacritics (const gchar* istring) { + gchar* result = NULL; + GString* builder = NULL; + GString* _tmp0_ = NULL; + gunichar ch = 0U; + gint i = 0; + GString* _tmp11_ = NULL; + const gchar* _tmp12_ = NULL; + gchar* _tmp13_ = NULL; +#line 184 "/home/jens/Source/shotwell/src/util/string.vala" + g_return_val_if_fail (istring != NULL, NULL); +#line 185 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = g_string_new (""); +#line 185 "/home/jens/Source/shotwell/src/util/string.vala" + builder = _tmp0_; +#line 187 "/home/jens/Source/shotwell/src/util/string.vala" + i = 0; +#line 188 "/home/jens/Source/shotwell/src/util/string.vala" + while (TRUE) { +#line 1614 "string.c" + const gchar* _tmp1_ = NULL; + gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; + gunichar _tmp4_ = 0U; + gboolean _tmp5_ = FALSE; + gboolean _tmp6_ = FALSE; + gunichar _tmp7_ = 0U; + GUnicodeType _tmp8_ = 0; + GString* _tmp9_ = NULL; + gunichar _tmp10_ = 0U; +#line 188 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = istring; +#line 188 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = g_utf8_normalize (_tmp1_, (gssize) -1, G_NORMALIZE_DEFAULT); +#line 188 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp3_ = _tmp2_; +#line 188 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp5_ = string_get_next_char (_tmp3_, &i, &_tmp4_); +#line 188 "/home/jens/Source/shotwell/src/util/string.vala" + ch = _tmp4_; +#line 188 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp6_ = !_tmp5_; +#line 188 "/home/jens/Source/shotwell/src/util/string.vala" + _g_free0 (_tmp3_); +#line 188 "/home/jens/Source/shotwell/src/util/string.vala" + if (_tmp6_) { +#line 188 "/home/jens/Source/shotwell/src/util/string.vala" + break; +#line 1643 "string.c" + } +#line 189 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp7_ = ch; +#line 189 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp8_ = g_unichar_type (_tmp7_); +#line 189 "/home/jens/Source/shotwell/src/util/string.vala" + switch (_tmp8_) { +#line 189 "/home/jens/Source/shotwell/src/util/string.vala" + case G_UNICODE_CONTROL: +#line 189 "/home/jens/Source/shotwell/src/util/string.vala" + case G_UNICODE_FORMAT: +#line 189 "/home/jens/Source/shotwell/src/util/string.vala" + case G_UNICODE_UNASSIGNED: +#line 189 "/home/jens/Source/shotwell/src/util/string.vala" + case G_UNICODE_NON_SPACING_MARK: +#line 189 "/home/jens/Source/shotwell/src/util/string.vala" + case G_UNICODE_COMBINING_MARK: +#line 189 "/home/jens/Source/shotwell/src/util/string.vala" + case G_UNICODE_ENCLOSING_MARK: +#line 1663 "string.c" + { +#line 197 "/home/jens/Source/shotwell/src/util/string.vala" + continue; +#line 1667 "string.c" + } + default: +#line 189 "/home/jens/Source/shotwell/src/util/string.vala" + break; +#line 1672 "string.c" + } +#line 199 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp9_ = builder; +#line 199 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp10_ = ch; +#line 199 "/home/jens/Source/shotwell/src/util/string.vala" + g_string_append_unichar (_tmp9_, _tmp10_); +#line 1680 "string.c" + } +#line 201 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp11_ = builder; +#line 201 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp12_ = _tmp11_->str; +#line 201 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp13_ = g_strdup (_tmp12_); +#line 201 "/home/jens/Source/shotwell/src/util/string.vala" + result = _tmp13_; +#line 201 "/home/jens/Source/shotwell/src/util/string.vala" + _g_string_free0 (builder); +#line 201 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 1694 "string.c" +} + + +gchar* string_to_hex_string (const gchar* str) { + gchar* result = NULL; + GString* builder = NULL; + GString* _tmp0_ = NULL; + guint8* data = NULL; + const gchar* _tmp1_ = NULL; + GString* _tmp7_ = NULL; + const gchar* _tmp8_ = NULL; + gchar* _tmp9_ = NULL; +#line 204 "/home/jens/Source/shotwell/src/util/string.vala" + g_return_val_if_fail (str != NULL, NULL); +#line 205 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = g_string_new (""); +#line 205 "/home/jens/Source/shotwell/src/util/string.vala" + builder = _tmp0_; +#line 207 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = str; +#line 207 "/home/jens/Source/shotwell/src/util/string.vala" + data = (guint8*) _tmp1_; +#line 208 "/home/jens/Source/shotwell/src/util/string.vala" + while (TRUE) { +#line 1719 "string.c" + guint8* _tmp2_ = NULL; + const gchar* _tmp3_ = NULL; + guint8* _tmp4_ = NULL; + GString* _tmp5_ = NULL; + guint8* _tmp6_ = NULL; +#line 208 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = data; +#line 208 "/home/jens/Source/shotwell/src/util/string.vala" + if (!(((gint) (*_tmp2_)) != 0)) { +#line 208 "/home/jens/Source/shotwell/src/util/string.vala" + break; +#line 1731 "string.c" + } +#line 209 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp4_ = data; +#line 209 "/home/jens/Source/shotwell/src/util/string.vala" + if (((gint) (*_tmp4_)) != 0) { +#line 209 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp3_ = " "; +#line 1739 "string.c" + } else { +#line 209 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp3_ = ""; +#line 1743 "string.c" + } +#line 209 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp5_ = builder; +#line 209 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp6_ = data; +#line 209 "/home/jens/Source/shotwell/src/util/string.vala" + data = _tmp6_ + 1; +#line 209 "/home/jens/Source/shotwell/src/util/string.vala" + g_string_append_printf (_tmp5_, "%02Xh%s", (guint) (*_tmp6_), _tmp3_); +#line 1753 "string.c" + } +#line 211 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp7_ = builder; +#line 211 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp8_ = _tmp7_->str; +#line 211 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp9_ = g_strdup (_tmp8_); +#line 211 "/home/jens/Source/shotwell/src/util/string.vala" + result = _tmp9_; +#line 211 "/home/jens/Source/shotwell/src/util/string.vala" + _g_string_free0 (builder); +#line 211 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 1767 "string.c" +} + + +guint string_collated_hash (void* ptr) { + guint result = 0U; + gchar* str = NULL; + void* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; + GHashFunc _tmp2_ = NULL; + gchar* _tmp3_ = NULL; + gchar* _tmp4_ = NULL; + guint _tmp5_ = 0U; + guint _tmp6_ = 0U; +#line 231 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = ptr; +#line 231 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = g_strdup ((const gchar*) _tmp0_); +#line 231 "/home/jens/Source/shotwell/src/util/string.vala" + str = _tmp1_; +#line 233 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = g_str_hash; +#line 233 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp3_ = g_utf8_collate_key (str, (gssize) -1); +#line 233 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp4_ = _tmp3_; +#line 233 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp5_ = _tmp2_ (_tmp4_); +#line 233 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp6_ = _tmp5_; +#line 233 "/home/jens/Source/shotwell/src/util/string.vala" + _g_free0 (_tmp4_); +#line 233 "/home/jens/Source/shotwell/src/util/string.vala" + result = _tmp6_; +#line 233 "/home/jens/Source/shotwell/src/util/string.vala" + _g_free0 (str); +#line 233 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 1805 "string.c" +} + + +guint string_precollated_hash (void* ptr) { + guint result = 0U; + GHashFunc _tmp0_ = NULL; + void* _tmp1_ = NULL; + guint _tmp2_ = 0U; +#line 238 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = g_str_hash; +#line 238 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = ptr; +#line 238 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = _tmp0_ ((const gchar*) _tmp1_); +#line 238 "/home/jens/Source/shotwell/src/util/string.vala" + result = _tmp2_; +#line 238 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 1824 "string.c" +} + + +gint string_collated_compare (void* a, void* b) { + gint result = 0; + gchar* astr = NULL; + void* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; + gchar* bstr = NULL; + void* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; + gint _result_ = 0; + const gchar* _tmp4_ = NULL; + const gchar* _tmp5_ = NULL; + gint _tmp6_ = 0; + gint _tmp7_ = 0; + gint _tmp8_ = 0; +#line 243 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = a; +#line 243 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = g_strdup ((const gchar*) _tmp0_); +#line 243 "/home/jens/Source/shotwell/src/util/string.vala" + astr = _tmp1_; +#line 244 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = b; +#line 244 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp3_ = g_strdup ((const gchar*) _tmp2_); +#line 244 "/home/jens/Source/shotwell/src/util/string.vala" + bstr = _tmp3_; +#line 246 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp4_ = astr; +#line 246 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp5_ = bstr; +#line 246 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp6_ = g_utf8_collate (_tmp4_, _tmp5_); +#line 246 "/home/jens/Source/shotwell/src/util/string.vala" + _result_ = _tmp6_; +#line 248 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp8_ = _result_; +#line 248 "/home/jens/Source/shotwell/src/util/string.vala" + if (_tmp8_ != 0) { +#line 1866 "string.c" + gint _tmp9_ = 0; +#line 248 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp9_ = _result_; +#line 248 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp7_ = _tmp9_; +#line 1872 "string.c" + } else { + GCompareFunc _tmp10_ = NULL; + const gchar* _tmp11_ = NULL; + const gchar* _tmp12_ = NULL; + gint _tmp13_ = 0; +#line 248 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp10_ = g_strcmp0; +#line 248 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp11_ = astr; +#line 248 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp12_ = bstr; +#line 248 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp13_ = _tmp10_ (_tmp11_, _tmp12_); +#line 248 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp7_ = _tmp13_; +#line 1888 "string.c" + } +#line 248 "/home/jens/Source/shotwell/src/util/string.vala" + result = _tmp7_; +#line 248 "/home/jens/Source/shotwell/src/util/string.vala" + _g_free0 (bstr); +#line 248 "/home/jens/Source/shotwell/src/util/string.vala" + _g_free0 (astr); +#line 248 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 1898 "string.c" +} + + +gint string_precollated_compare (const gchar* astr, const gchar* akey, const gchar* bstr, const gchar* bkey) { + gint result = 0; + gint _result_ = 0; + GCompareFunc _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + const gchar* _tmp2_ = NULL; + gint _tmp3_ = 0; + gint _tmp4_ = 0; + gint _tmp5_ = 0; +#line 252 "/home/jens/Source/shotwell/src/util/string.vala" + g_return_val_if_fail (astr != NULL, 0); +#line 252 "/home/jens/Source/shotwell/src/util/string.vala" + g_return_val_if_fail (akey != NULL, 0); +#line 252 "/home/jens/Source/shotwell/src/util/string.vala" + g_return_val_if_fail (bstr != NULL, 0); +#line 252 "/home/jens/Source/shotwell/src/util/string.vala" + g_return_val_if_fail (bkey != NULL, 0); +#line 253 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = g_strcmp0; +#line 253 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = akey; +#line 253 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = bkey; +#line 253 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp3_ = _tmp0_ (_tmp1_, _tmp2_); +#line 253 "/home/jens/Source/shotwell/src/util/string.vala" + _result_ = _tmp3_; +#line 255 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp5_ = _result_; +#line 255 "/home/jens/Source/shotwell/src/util/string.vala" + if (_tmp5_ != 0) { +#line 1933 "string.c" + gint _tmp6_ = 0; +#line 255 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp6_ = _result_; +#line 255 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp4_ = _tmp6_; +#line 1939 "string.c" + } else { + GCompareFunc _tmp7_ = NULL; + const gchar* _tmp8_ = NULL; + const gchar* _tmp9_ = NULL; + gint _tmp10_ = 0; +#line 255 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp7_ = g_strcmp0; +#line 255 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp8_ = astr; +#line 255 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp9_ = bstr; +#line 255 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp10_ = _tmp7_ (_tmp8_, _tmp9_); +#line 255 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp4_ = _tmp10_; +#line 1955 "string.c" + } +#line 255 "/home/jens/Source/shotwell/src/util/string.vala" + result = _tmp4_; +#line 255 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 1961 "string.c" +} + + +gboolean string_collated_equals (void* a, void* b) { + gboolean result = FALSE; + void* _tmp0_ = NULL; + void* _tmp1_ = NULL; + gint _tmp2_ = 0; +#line 260 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = a; +#line 260 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = b; +#line 260 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = string_collated_compare (_tmp0_, _tmp1_); +#line 260 "/home/jens/Source/shotwell/src/util/string.vala" + result = _tmp2_ == 0; +#line 260 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 1980 "string.c" +} + + +gboolean string_precollated_equals (const gchar* astr, const gchar* akey, const gchar* bstr, const gchar* bkey) { + gboolean result = FALSE; + const gchar* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + const gchar* _tmp2_ = NULL; + const gchar* _tmp3_ = NULL; + gint _tmp4_ = 0; +#line 264 "/home/jens/Source/shotwell/src/util/string.vala" + g_return_val_if_fail (astr != NULL, FALSE); +#line 264 "/home/jens/Source/shotwell/src/util/string.vala" + g_return_val_if_fail (akey != NULL, FALSE); +#line 264 "/home/jens/Source/shotwell/src/util/string.vala" + g_return_val_if_fail (bstr != NULL, FALSE); +#line 264 "/home/jens/Source/shotwell/src/util/string.vala" + g_return_val_if_fail (bkey != NULL, FALSE); +#line 265 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp0_ = astr; +#line 265 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp1_ = akey; +#line 265 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp2_ = bstr; +#line 265 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp3_ = bkey; +#line 265 "/home/jens/Source/shotwell/src/util/string.vala" + _tmp4_ = string_precollated_compare (_tmp0_, _tmp1_, _tmp2_, _tmp3_); +#line 265 "/home/jens/Source/shotwell/src/util/string.vala" + result = _tmp4_ == 0; +#line 265 "/home/jens/Source/shotwell/src/util/string.vala" + return result; +#line 2013 "string.c" +} + + + diff --git a/src/util/system.c b/src/util/system.c new file mode 100644 index 0000000..cef9603 --- /dev/null +++ b/src/util/system.c @@ -0,0 +1,168 @@ +/* system.c generated by valac 0.32.1, the Vala compiler + * generated from system.vala, do not modify */ + +/* Copyright 2016 Software Freedom Conservancy Inc. + * + * This software is licensed under the GNU LGPL (version 2.1 or later). + * See the COPYING file in this distribution. + */ +/* Return the directory in which Shotwell is installed, or null if uninstalled.*/ + +#include <glib.h> +#include <glib-object.h> +#include <gio/gio.h> +#include <glib/gstdio.h> +#include <stdlib.h> +#include <string.h> +#include <gdk/gdk.h> +#include <gtk/gtk.h> + +#define _g_free0(var) (var = (g_free (var), NULL)) +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + + + +GFile* get_sys_install_dir (GFile* exec_dir); +#define RESOURCES_PREFIX _PREFIX +gchar* get_nautilus_install_location (void); +void sys_show_uri (GdkScreen* screen, const gchar* uri, GError** error); +void show_file_in_nautilus (const gchar* filename, GError** error); + + +GFile* get_sys_install_dir (GFile* exec_dir) { + GFile* result = NULL; + GFile* child = NULL; + GFile* _tmp0_ = NULL; + GFile* _tmp1_ = NULL; + GFile* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; + gchar* _tmp4_ = NULL; + gboolean _tmp5_ = FALSE; + gboolean _tmp6_ = FALSE; +#line 8 "/home/jens/Source/shotwell/src/util/system.vala" + g_return_val_if_fail (G_IS_FILE (exec_dir), NULL); +#line 10 "/home/jens/Source/shotwell/src/util/system.vala" + _tmp0_ = exec_dir; +#line 10 "/home/jens/Source/shotwell/src/util/system.vala" + _tmp1_ = g_file_get_child (_tmp0_, "ui"); +#line 10 "/home/jens/Source/shotwell/src/util/system.vala" + child = _tmp1_; +#line 12 "/home/jens/Source/shotwell/src/util/system.vala" + _tmp2_ = child; +#line 12 "/home/jens/Source/shotwell/src/util/system.vala" + _tmp3_ = g_file_get_path (_tmp2_); +#line 12 "/home/jens/Source/shotwell/src/util/system.vala" + _tmp4_ = _tmp3_; +#line 12 "/home/jens/Source/shotwell/src/util/system.vala" + _tmp5_ = g_file_test (_tmp4_, G_FILE_TEST_IS_DIR | G_FILE_TEST_EXISTS); +#line 12 "/home/jens/Source/shotwell/src/util/system.vala" + _tmp6_ = !_tmp5_; +#line 12 "/home/jens/Source/shotwell/src/util/system.vala" + _g_free0 (_tmp4_); +#line 12 "/home/jens/Source/shotwell/src/util/system.vala" + if (_tmp6_) { +#line 65 "system.c" + GFile* _tmp7_ = NULL; +#line 13 "/home/jens/Source/shotwell/src/util/system.vala" + _tmp7_ = g_file_new_for_path (RESOURCES_PREFIX); +#line 13 "/home/jens/Source/shotwell/src/util/system.vala" + result = _tmp7_; +#line 13 "/home/jens/Source/shotwell/src/util/system.vala" + _g_object_unref0 (child); +#line 13 "/home/jens/Source/shotwell/src/util/system.vala" + return result; +#line 75 "system.c" + } +#line 16 "/home/jens/Source/shotwell/src/util/system.vala" + result = NULL; +#line 16 "/home/jens/Source/shotwell/src/util/system.vala" + _g_object_unref0 (child); +#line 16 "/home/jens/Source/shotwell/src/util/system.vala" + return result; +#line 83 "system.c" +} + + +gchar* get_nautilus_install_location (void) { + gchar* result = NULL; + gchar* _tmp0_ = NULL; +#line 20 "/home/jens/Source/shotwell/src/util/system.vala" + _tmp0_ = g_find_program_in_path ("nautilus"); +#line 20 "/home/jens/Source/shotwell/src/util/system.vala" + result = _tmp0_; +#line 20 "/home/jens/Source/shotwell/src/util/system.vala" + return result; +#line 96 "system.c" +} + + +void sys_show_uri (GdkScreen* screen, const gchar* uri, GError** error) { + GdkScreen* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + GError * _inner_error_ = NULL; +#line 23 "/home/jens/Source/shotwell/src/util/system.vala" + g_return_if_fail (GDK_IS_SCREEN (screen)); +#line 23 "/home/jens/Source/shotwell/src/util/system.vala" + g_return_if_fail (uri != NULL); +#line 24 "/home/jens/Source/shotwell/src/util/system.vala" + _tmp0_ = screen; +#line 24 "/home/jens/Source/shotwell/src/util/system.vala" + _tmp1_ = uri; +#line 24 "/home/jens/Source/shotwell/src/util/system.vala" + gtk_show_uri (_tmp0_, _tmp1_, (guint32) GDK_CURRENT_TIME, &_inner_error_); +#line 24 "/home/jens/Source/shotwell/src/util/system.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 24 "/home/jens/Source/shotwell/src/util/system.vala" + g_propagate_error (error, _inner_error_); +#line 24 "/home/jens/Source/shotwell/src/util/system.vala" + return; +#line 120 "system.c" + } +} + + +void show_file_in_nautilus (const gchar* filename, GError** error) { + gchar* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; + gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; + const gchar* _tmp4_ = NULL; + gchar* _tmp5_ = NULL; + gchar* _tmp6_ = NULL; + GError * _inner_error_ = NULL; +#line 27 "/home/jens/Source/shotwell/src/util/system.vala" + g_return_if_fail (filename != NULL); +#line 28 "/home/jens/Source/shotwell/src/util/system.vala" + _tmp0_ = get_nautilus_install_location (); +#line 28 "/home/jens/Source/shotwell/src/util/system.vala" + _tmp1_ = _tmp0_; +#line 28 "/home/jens/Source/shotwell/src/util/system.vala" + _tmp2_ = g_strconcat (_tmp1_, " ", NULL); +#line 28 "/home/jens/Source/shotwell/src/util/system.vala" + _tmp3_ = _tmp2_; +#line 28 "/home/jens/Source/shotwell/src/util/system.vala" + _tmp4_ = filename; +#line 28 "/home/jens/Source/shotwell/src/util/system.vala" + _tmp5_ = g_strconcat (_tmp3_, _tmp4_, NULL); +#line 28 "/home/jens/Source/shotwell/src/util/system.vala" + _tmp6_ = _tmp5_; +#line 28 "/home/jens/Source/shotwell/src/util/system.vala" + g_spawn_command_line_async (_tmp6_, &_inner_error_); +#line 28 "/home/jens/Source/shotwell/src/util/system.vala" + _g_free0 (_tmp6_); +#line 28 "/home/jens/Source/shotwell/src/util/system.vala" + _g_free0 (_tmp3_); +#line 28 "/home/jens/Source/shotwell/src/util/system.vala" + _g_free0 (_tmp1_); +#line 28 "/home/jens/Source/shotwell/src/util/system.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 28 "/home/jens/Source/shotwell/src/util/system.vala" + g_propagate_error (error, _inner_error_); +#line 28 "/home/jens/Source/shotwell/src/util/system.vala" + return; +#line 164 "system.c" + } +} + + + diff --git a/src/util/ui.c b/src/util/ui.c new file mode 100644 index 0000000..44ba054 --- /dev/null +++ b/src/util/ui.c @@ -0,0 +1,405 @@ +/* ui.c generated by valac 0.32.1, the Vala compiler + * generated from ui.vala, do not modify */ + +/* Copyright 2016 Software Freedom Conservancy Inc. + * + * This software is licensed under the GNU Lesser General Public License + * (version 2.1 or later). See the COPYING file in this distribution. + */ + +#include <glib.h> +#include <glib-object.h> +#include "shotwell-plugin-dev-1.0.h" +#include <stdlib.h> +#include <string.h> +#include <gtk/gtk.h> +#include <gdk/gdk.h> + + +#define TYPE_ADJUSTMENT_RELATION (adjustment_relation_get_type ()) + +#define TYPE_COMPASS_POINT (compass_point_get_type ()) + +#define TYPE_DIRECTION (direction_get_type ()) +#define _g_free0(var) (var = (g_free (var), NULL)) +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL))) + +typedef enum { + ADJUSTMENT_RELATION_BELOW, + ADJUSTMENT_RELATION_IN_RANGE, + ADJUSTMENT_RELATION_ABOVE +} AdjustmentRelation; + +typedef enum { + COMPASS_POINT_NORTH, + COMPASS_POINT_SOUTH, + COMPASS_POINT_EAST, + COMPASS_POINT_WEST +} CompassPoint; + +typedef enum { + DIRECTION_FORWARD, + DIRECTION_BACKWARD +} Direction; + + + +GType adjustment_relation_get_type (void) G_GNUC_CONST; +GType compass_point_get_type (void) G_GNUC_CONST; +GType direction_get_type (void) G_GNUC_CONST; +SpitTransitionsDirection direction_to_transition_direction (Direction self); +const gchar* direction_to_string (Direction self); +void spin_event_loop (void); +AdjustmentRelation get_adjustment_relation (GtkAdjustment* adjustment, gint value); +void get_adjustment_page (GtkAdjustment* hadj, GtkAdjustment* vadj, GdkRectangle* result); +gboolean has_only_key_modifier (GdkModifierType field, GdkModifierType mask); +gchar* build_dummy_ui_string (GtkActionGroup** groups, int groups_length1); + + +GType adjustment_relation_get_type (void) { + static volatile gsize adjustment_relation_type_id__volatile = 0; + if (g_once_init_enter (&adjustment_relation_type_id__volatile)) { + static const GEnumValue values[] = {{ADJUSTMENT_RELATION_BELOW, "ADJUSTMENT_RELATION_BELOW", "below"}, {ADJUSTMENT_RELATION_IN_RANGE, "ADJUSTMENT_RELATION_IN_RANGE", "in-range"}, {ADJUSTMENT_RELATION_ABOVE, "ADJUSTMENT_RELATION_ABOVE", "above"}, {0, NULL, NULL}}; + GType adjustment_relation_type_id; + adjustment_relation_type_id = g_enum_register_static ("AdjustmentRelation", values); + g_once_init_leave (&adjustment_relation_type_id__volatile, adjustment_relation_type_id); + } + return adjustment_relation_type_id__volatile; +} + + +GType compass_point_get_type (void) { + static volatile gsize compass_point_type_id__volatile = 0; + if (g_once_init_enter (&compass_point_type_id__volatile)) { + static const GEnumValue values[] = {{COMPASS_POINT_NORTH, "COMPASS_POINT_NORTH", "north"}, {COMPASS_POINT_SOUTH, "COMPASS_POINT_SOUTH", "south"}, {COMPASS_POINT_EAST, "COMPASS_POINT_EAST", "east"}, {COMPASS_POINT_WEST, "COMPASS_POINT_WEST", "west"}, {0, NULL, NULL}}; + GType compass_point_type_id; + compass_point_type_id = g_enum_register_static ("CompassPoint", values); + g_once_init_leave (&compass_point_type_id__volatile, compass_point_type_id); + } + return compass_point_type_id__volatile; +} + + +SpitTransitionsDirection direction_to_transition_direction (Direction self) { + SpitTransitionsDirection result = 0; +#line 25 "/home/jens/Source/shotwell/src/util/ui.vala" + switch (self) { +#line 25 "/home/jens/Source/shotwell/src/util/ui.vala" + case DIRECTION_FORWARD: +#line 91 "ui.c" + { +#line 27 "/home/jens/Source/shotwell/src/util/ui.vala" + result = SPIT_TRANSITIONS_DIRECTION_FORWARD; +#line 27 "/home/jens/Source/shotwell/src/util/ui.vala" + return result; +#line 97 "ui.c" + } +#line 25 "/home/jens/Source/shotwell/src/util/ui.vala" + case DIRECTION_BACKWARD: +#line 101 "ui.c" + { +#line 30 "/home/jens/Source/shotwell/src/util/ui.vala" + result = SPIT_TRANSITIONS_DIRECTION_BACKWARD; +#line 30 "/home/jens/Source/shotwell/src/util/ui.vala" + return result; +#line 107 "ui.c" + } + default: + { + GEnumValue* _tmp0_; +#line 33 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp0_ = g_enum_get_value (g_type_class_ref (TYPE_DIRECTION), self); +#line 33 "/home/jens/Source/shotwell/src/util/ui.vala" + g_error ("ui.vala:33: Unknown Direction %s", (_tmp0_ != NULL) ? _tmp0_->value_name : NULL); +#line 116 "ui.c" + } + } +} + + +GType direction_get_type (void) { + static volatile gsize direction_type_id__volatile = 0; + if (g_once_init_enter (&direction_type_id__volatile)) { + static const GEnumValue values[] = {{DIRECTION_FORWARD, "DIRECTION_FORWARD", "forward"}, {DIRECTION_BACKWARD, "DIRECTION_BACKWARD", "backward"}, {0, NULL, NULL}}; + GType direction_type_id; + direction_type_id = g_enum_register_static ("Direction", values); + g_once_init_leave (&direction_type_id__volatile, direction_type_id); + } + return direction_type_id__volatile; +} + + +void spin_event_loop (void) { +#line 39 "/home/jens/Source/shotwell/src/util/ui.vala" + while (TRUE) { +#line 137 "ui.c" + gboolean _tmp0_ = FALSE; +#line 39 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp0_ = gtk_events_pending (); +#line 39 "/home/jens/Source/shotwell/src/util/ui.vala" + if (!_tmp0_) { +#line 39 "/home/jens/Source/shotwell/src/util/ui.vala" + break; +#line 145 "ui.c" + } +#line 40 "/home/jens/Source/shotwell/src/util/ui.vala" + gtk_main_iteration (); +#line 149 "ui.c" + } +} + + +AdjustmentRelation get_adjustment_relation (GtkAdjustment* adjustment, gint value) { + AdjustmentRelation result = 0; + gint _tmp0_ = 0; + GtkAdjustment* _tmp1_ = NULL; + gdouble _tmp2_ = 0.0; +#line 43 "/home/jens/Source/shotwell/src/util/ui.vala" + g_return_val_if_fail (GTK_IS_ADJUSTMENT (adjustment), 0); +#line 44 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp0_ = value; +#line 44 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp1_ = adjustment; +#line 44 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp2_ = gtk_adjustment_get_value (_tmp1_); +#line 44 "/home/jens/Source/shotwell/src/util/ui.vala" + if (_tmp0_ < ((gint) _tmp2_)) { +#line 45 "/home/jens/Source/shotwell/src/util/ui.vala" + result = ADJUSTMENT_RELATION_BELOW; +#line 45 "/home/jens/Source/shotwell/src/util/ui.vala" + return result; +#line 173 "ui.c" + } else { + gint _tmp3_ = 0; + GtkAdjustment* _tmp4_ = NULL; + gdouble _tmp5_ = 0.0; + GtkAdjustment* _tmp6_ = NULL; + gdouble _tmp7_ = 0.0; +#line 46 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp3_ = value; +#line 46 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp4_ = adjustment; +#line 46 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp5_ = gtk_adjustment_get_value (_tmp4_); +#line 46 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp6_ = adjustment; +#line 46 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp7_ = gtk_adjustment_get_page_size (_tmp6_); +#line 46 "/home/jens/Source/shotwell/src/util/ui.vala" + if (_tmp3_ > ((gint) (_tmp5_ + _tmp7_))) { +#line 47 "/home/jens/Source/shotwell/src/util/ui.vala" + result = ADJUSTMENT_RELATION_ABOVE; +#line 47 "/home/jens/Source/shotwell/src/util/ui.vala" + return result; +#line 196 "ui.c" + } else { +#line 49 "/home/jens/Source/shotwell/src/util/ui.vala" + result = ADJUSTMENT_RELATION_IN_RANGE; +#line 49 "/home/jens/Source/shotwell/src/util/ui.vala" + return result; +#line 202 "ui.c" + } + } +} + + +void get_adjustment_page (GtkAdjustment* hadj, GtkAdjustment* vadj, GdkRectangle* result) { + GdkRectangle rect = {0}; + GtkAdjustment* _tmp0_ = NULL; + gdouble _tmp1_ = 0.0; + GtkAdjustment* _tmp2_ = NULL; + gdouble _tmp3_ = 0.0; + GtkAdjustment* _tmp4_ = NULL; + gdouble _tmp5_ = 0.0; + GtkAdjustment* _tmp6_ = NULL; + gdouble _tmp7_ = 0.0; +#line 52 "/home/jens/Source/shotwell/src/util/ui.vala" + g_return_if_fail (GTK_IS_ADJUSTMENT (hadj)); +#line 52 "/home/jens/Source/shotwell/src/util/ui.vala" + g_return_if_fail (GTK_IS_ADJUSTMENT (vadj)); +#line 53 "/home/jens/Source/shotwell/src/util/ui.vala" + memset (&rect, 0, sizeof (GdkRectangle)); +#line 54 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp0_ = hadj; +#line 54 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp1_ = gtk_adjustment_get_value (_tmp0_); +#line 54 "/home/jens/Source/shotwell/src/util/ui.vala" + rect.x = (gint) _tmp1_; +#line 55 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp2_ = vadj; +#line 55 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp3_ = gtk_adjustment_get_value (_tmp2_); +#line 55 "/home/jens/Source/shotwell/src/util/ui.vala" + rect.y = (gint) _tmp3_; +#line 56 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp4_ = hadj; +#line 56 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp5_ = gtk_adjustment_get_page_size (_tmp4_); +#line 56 "/home/jens/Source/shotwell/src/util/ui.vala" + rect.width = (gint) _tmp5_; +#line 57 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp6_ = vadj; +#line 57 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp7_ = gtk_adjustment_get_page_size (_tmp6_); +#line 57 "/home/jens/Source/shotwell/src/util/ui.vala" + rect.height = (gint) _tmp7_; +#line 59 "/home/jens/Source/shotwell/src/util/ui.vala" + *result = rect; +#line 59 "/home/jens/Source/shotwell/src/util/ui.vala" + return; +#line 252 "ui.c" +} + + +gboolean has_only_key_modifier (GdkModifierType field, GdkModifierType mask) { + gboolean result = FALSE; + GdkModifierType _tmp0_ = 0; + GdkModifierType _tmp1_ = 0; +#line 77 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp0_ = field; +#line 77 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp1_ = mask; +#line 77 "/home/jens/Source/shotwell/src/util/ui.vala" + result = (_tmp0_ & ((((((((GDK_SHIFT_MASK | GDK_CONTROL_MASK) | GDK_MOD1_MASK) | GDK_MOD3_MASK) | GDK_MOD4_MASK) | GDK_MOD5_MASK) | GDK_SUPER_MASK) | GDK_HYPER_MASK) | GDK_META_MASK)) == _tmp1_; +#line 77 "/home/jens/Source/shotwell/src/util/ui.vala" + return result; +#line 268 "ui.c" +} + + +static gpointer _g_object_ref0 (gpointer self) { +#line 91 "/home/jens/Source/shotwell/src/util/ui.vala" + return self ? g_object_ref (self) : NULL; +#line 275 "ui.c" +} + + +gchar* build_dummy_ui_string (GtkActionGroup** groups, int groups_length1) { + gchar* result = NULL; + gchar* ui_string = NULL; + gchar* _tmp0_ = NULL; + GtkActionGroup** _tmp1_ = NULL; + gint _tmp1__length1 = 0; + const gchar* _tmp16_ = NULL; + gchar* _tmp17_ = NULL; +#line 90 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp0_ = g_strdup ("<ui>"); +#line 90 "/home/jens/Source/shotwell/src/util/ui.vala" + ui_string = _tmp0_; +#line 91 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp1_ = groups; +#line 91 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp1__length1 = groups_length1; +#line 295 "ui.c" + { + GtkActionGroup** group_collection = NULL; + gint group_collection_length1 = 0; + gint _group_collection_size_ = 0; + gint group_it = 0; +#line 91 "/home/jens/Source/shotwell/src/util/ui.vala" + group_collection = _tmp1_; +#line 91 "/home/jens/Source/shotwell/src/util/ui.vala" + group_collection_length1 = _tmp1__length1; +#line 91 "/home/jens/Source/shotwell/src/util/ui.vala" + for (group_it = 0; group_it < _tmp1__length1; group_it = group_it + 1) { +#line 307 "ui.c" + GtkActionGroup* _tmp2_ = NULL; + GtkActionGroup* group = NULL; +#line 91 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp2_ = _g_object_ref0 (group_collection[group_it]); +#line 91 "/home/jens/Source/shotwell/src/util/ui.vala" + group = _tmp2_; +#line 314 "ui.c" + { + GtkActionGroup* _tmp3_ = NULL; + GList* _tmp4_ = NULL; +#line 92 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp3_ = group; +#line 92 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp4_ = gtk_action_group_list_actions (_tmp3_); +#line 322 "ui.c" + { + GList* action_collection = NULL; + GList* action_it = NULL; +#line 92 "/home/jens/Source/shotwell/src/util/ui.vala" + action_collection = _tmp4_; +#line 92 "/home/jens/Source/shotwell/src/util/ui.vala" + for (action_it = action_collection; action_it != NULL; action_it = action_it->next) { +#line 330 "ui.c" + GtkAction* _tmp5_ = NULL; + GtkAction* action = NULL; +#line 92 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp5_ = _g_object_ref0 ((GtkAction*) action_it->data); +#line 92 "/home/jens/Source/shotwell/src/util/ui.vala" + action = _tmp5_; +#line 337 "ui.c" + { + const gchar* _tmp6_ = NULL; + GtkAction* _tmp7_ = NULL; + const gchar* _tmp8_ = NULL; + const gchar* _tmp9_ = NULL; + GtkAction* _tmp10_ = NULL; + const gchar* _tmp11_ = NULL; + const gchar* _tmp12_ = NULL; + gchar* _tmp13_ = NULL; + gchar* _tmp14_ = NULL; + gchar* _tmp15_ = NULL; +#line 93 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp6_ = ui_string; +#line 93 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp7_ = action; +#line 93 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp8_ = gtk_action_get_name (_tmp7_); +#line 93 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp9_ = _tmp8_; +#line 93 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp10_ = action; +#line 93 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp11_ = gtk_action_get_name (_tmp10_); +#line 93 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp12_ = _tmp11_; +#line 93 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp13_ = g_strdup_printf ("<accelerator name=\"%s\" action=\"%s\" />", _tmp9_, _tmp12_); +#line 93 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp14_ = _tmp13_; +#line 93 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp15_ = g_strconcat (_tmp6_, _tmp14_, NULL); +#line 93 "/home/jens/Source/shotwell/src/util/ui.vala" + _g_free0 (ui_string); +#line 93 "/home/jens/Source/shotwell/src/util/ui.vala" + ui_string = _tmp15_; +#line 93 "/home/jens/Source/shotwell/src/util/ui.vala" + _g_free0 (_tmp14_); +#line 92 "/home/jens/Source/shotwell/src/util/ui.vala" + _g_object_unref0 (action); +#line 377 "ui.c" + } + } +#line 92 "/home/jens/Source/shotwell/src/util/ui.vala" + _g_list_free0 (action_collection); +#line 382 "ui.c" + } +#line 91 "/home/jens/Source/shotwell/src/util/ui.vala" + _g_object_unref0 (group); +#line 386 "ui.c" + } + } + } +#line 95 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp16_ = ui_string; +#line 95 "/home/jens/Source/shotwell/src/util/ui.vala" + _tmp17_ = g_strconcat (_tmp16_, "</ui>", NULL); +#line 95 "/home/jens/Source/shotwell/src/util/ui.vala" + _g_free0 (ui_string); +#line 95 "/home/jens/Source/shotwell/src/util/ui.vala" + ui_string = _tmp17_; +#line 97 "/home/jens/Source/shotwell/src/util/ui.vala" + result = ui_string; +#line 97 "/home/jens/Source/shotwell/src/util/ui.vala" + return result; +#line 402 "ui.c" +} + + + |