/* IconView.c generated by valac 0.56.19, the Vala compiler
 * generated from IconView.vala, do not modify */

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <gdk/gdk.h>
#include <float.h>
#include <math.h>
#include <gio/gio.h>
#include "pantheon-files-core.h"
#include <stdlib.h>
#include <string.h>
#include <pango/pango.h>
#include <cairo-gobject.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define FILES_TYPE_ABSTRACT_DIRECTORY_VIEW (files_abstract_directory_view_get_type ())
#define FILES_ABSTRACT_DIRECTORY_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FILES_TYPE_ABSTRACT_DIRECTORY_VIEW, FilesAbstractDirectoryView))
#define FILES_ABSTRACT_DIRECTORY_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FILES_TYPE_ABSTRACT_DIRECTORY_VIEW, FilesAbstractDirectoryViewClass))
#define FILES_IS_ABSTRACT_DIRECTORY_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FILES_TYPE_ABSTRACT_DIRECTORY_VIEW))
#define FILES_IS_ABSTRACT_DIRECTORY_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FILES_TYPE_ABSTRACT_DIRECTORY_VIEW))
#define FILES_ABSTRACT_DIRECTORY_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FILES_TYPE_ABSTRACT_DIRECTORY_VIEW, FilesAbstractDirectoryViewClass))

typedef struct _FilesAbstractDirectoryView FilesAbstractDirectoryView;
typedef struct _FilesAbstractDirectoryViewClass FilesAbstractDirectoryViewClass;
typedef struct _FilesAbstractDirectoryViewPrivate FilesAbstractDirectoryViewPrivate;

#define FILES_VIEW_TYPE_SLOT (files_view_slot_get_type ())
#define FILES_VIEW_SLOT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FILES_VIEW_TYPE_SLOT, FilesViewSlot))
#define FILES_VIEW_SLOT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FILES_VIEW_TYPE_SLOT, FilesViewSlotClass))
#define FILES_VIEW_IS_SLOT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FILES_VIEW_TYPE_SLOT))
#define FILES_VIEW_IS_SLOT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FILES_VIEW_TYPE_SLOT))
#define FILES_VIEW_SLOT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FILES_VIEW_TYPE_SLOT, FilesViewSlotClass))

typedef struct _FilesViewSlot FilesViewSlot;
typedef struct _FilesViewSlotClass FilesViewSlotClass;

#define FILES_TYPE_ICON_VIEW (files_icon_view_get_type ())
#define FILES_ICON_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FILES_TYPE_ICON_VIEW, FilesIconView))
#define FILES_ICON_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FILES_TYPE_ICON_VIEW, FilesIconViewClass))
#define FILES_IS_ICON_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FILES_TYPE_ICON_VIEW))
#define FILES_IS_ICON_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FILES_TYPE_ICON_VIEW))
#define FILES_ICON_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FILES_TYPE_ICON_VIEW, FilesIconViewClass))

typedef struct _FilesIconView FilesIconView;
typedef struct _FilesIconViewClass FilesIconViewClass;
typedef struct _FilesIconViewPrivate FilesIconViewPrivate;
enum  {
	FILES_ICON_VIEW_0_PROPERTY,
	FILES_ICON_VIEW_NUM_PROPERTIES
};
static GParamSpec* files_icon_view_properties[FILES_ICON_VIEW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define __vala_GtkTreePath_free0(var) ((var == NULL) ? NULL : (var = (_vala_GtkTreePath_free (var), NULL)))
typedef enum  {
	FILES_ABSTRACT_DIRECTORY_VIEW_CLICK_ZONE_EXPANDER,
	FILES_ABSTRACT_DIRECTORY_VIEW_CLICK_ZONE_HELPER,
	FILES_ABSTRACT_DIRECTORY_VIEW_CLICK_ZONE_ICON,
	FILES_ABSTRACT_DIRECTORY_VIEW_CLICK_ZONE_NAME,
	FILES_ABSTRACT_DIRECTORY_VIEW_CLICK_ZONE_BLANK_PATH,
	FILES_ABSTRACT_DIRECTORY_VIEW_CLICK_ZONE_BLANK_NO_PATH,
	FILES_ABSTRACT_DIRECTORY_VIEW_CLICK_ZONE_INVALID
} FilesAbstractDirectoryViewClickZone;

#define FILES_ABSTRACT_DIRECTORY_VIEW_TYPE_CLICK_ZONE (files_abstract_directory_view_click_zone_get_type ())
#define _g_free0(var) (var = (g_free (var), NULL))
#define __vala_GtkTreeIter_free0(var) ((var == NULL) ? NULL : (var = (_vala_GtkTreeIter_free (var), NULL)))

struct _FilesAbstractDirectoryView {
	GtkBin parent_instance;
	FilesAbstractDirectoryViewPrivate * priv;
	FilesZoomLevel minimum_zoom;
	FilesZoomLevel maximum_zoom;
	GList* source_drag_file_list;
	GdkAtom current_target_type;
	gboolean dnd_disabled;
	FilesTextRenderer* name_renderer;
	gchar* original_name;
	gchar* proposed_name;
	gboolean right_margin_unselects_all;
	gboolean on_directory;
	gboolean one_or_less;
	gboolean should_activate;
	gboolean should_deselect;
	gboolean should_thumbnail;
	gboolean should_select;
	GtkTreePath* click_path;
	guint click_zone;
	guint previous_click_zone;
	GList* selected_files;
	gboolean is_writable;
	gboolean is_loading;
	gboolean helpers_shown;
	GtkScrolledWindow* scrolled_window;
	FilesListModel* model;
	FilesIconRenderer* icon_renderer;
	FilesViewSlot* slot;
	GtkRecentManager* recent;
	GtkEventControllerKey* key_controller;
	GtkGestureMultiPress* button_controller;
	GtkEventControllerScroll* scroll_controller;
	GtkEventControllerMotion* motion_controller;
};

struct _FilesAbstractDirectoryViewClass {
	GtkBinClass parent_class;
	void (*on_row_deleted) (FilesAbstractDirectoryView* self, GtkTreePath* path);
	gboolean (*on_view_key_press_event) (FilesAbstractDirectoryView* self, guint original_keyval, guint keycode, GdkModifierType state);
	void (*on_scroll_event) (FilesAbstractDirectoryView* self, gdouble dx, gdouble dy);
	gboolean (*handle_primary_button_click) (FilesAbstractDirectoryView* self, guint n_press, GdkModifierType mods, GtkTreePath* path);
	void (*on_view_button_press_event) (FilesAbstractDirectoryView* self, gint n_press, gdouble x, gdouble y);
	void (*on_view_button_release_event) (FilesAbstractDirectoryView* self, gint n_press, gdouble x, gdouble y);
	void (*change_zoom_level) (FilesAbstractDirectoryView* self);
	gboolean (*expand_collapse) (FilesAbstractDirectoryView* self, GtkTreePath* path);
	gboolean (*handle_default_button_click) (FilesAbstractDirectoryView* self);
	gboolean (*get_next_visible_iter) (FilesAbstractDirectoryView* self, GtkTreeIter* iter, gboolean recurse);
	void (*cancel) (FilesAbstractDirectoryView* self);
	void (*highlight_path) (FilesAbstractDirectoryView* self, GtkTreePath* path);
	GtkTreePath* (*up) (FilesAbstractDirectoryView* self, GtkTreePath* path);
	GtkTreePath* (*down) (FilesAbstractDirectoryView* self, GtkTreePath* path);
	GSettings* (*get_view_settings) (FilesAbstractDirectoryView* self);
	void (*set_up_zoom_level) (FilesAbstractDirectoryView* self);
	gboolean (*view_has_focus) (FilesAbstractDirectoryView* self);
	void (*scroll_to_cell) (FilesAbstractDirectoryView* self, GtkTreePath* path, gboolean scroll_to_top);
	GList* (*get_selected_paths) (FilesAbstractDirectoryView* self);
	GtkTreePath* (*get_path_at_pos) (FilesAbstractDirectoryView* self, gint x, gint win);
	GtkTreePath* (*get_path_at_cursor) (FilesAbstractDirectoryView* self);
	void (*tree_select_all) (FilesAbstractDirectoryView* self);
	void (*tree_unselect_all) (FilesAbstractDirectoryView* self);
	void (*tree_unselect_others) (FilesAbstractDirectoryView* self);
	void (*select_path) (FilesAbstractDirectoryView* self, GtkTreePath* path, gboolean cursor_follows);
	void (*unselect_path) (FilesAbstractDirectoryView* self, GtkTreePath* path);
	gboolean (*path_is_selected) (FilesAbstractDirectoryView* self, GtkTreePath* path);
	gboolean (*get_visible_range) (FilesAbstractDirectoryView* self, GtkTreePath** start_path, GtkTreePath** end_path);
	void (*set_cursor) (FilesAbstractDirectoryView* self, GtkTreePath* path, gboolean start_editing, gboolean select, gboolean scroll_to_top);
	gboolean (*move_cursor) (FilesAbstractDirectoryView* self, guint keyval, gboolean only_shift_pressed, gboolean control_pressed);
	gboolean (*will_handle_button_press) (FilesAbstractDirectoryView* self, gboolean no_mods, gboolean only_control_pressed, gboolean only_shift_pressed);
	gboolean (*handle_multi_select) (FilesAbstractDirectoryView* self, GtkTreePath* path);
	GtkWidget* (*create_view) (FilesAbstractDirectoryView* self);
	guint (*get_event_position_info) (FilesAbstractDirectoryView* self, gdouble x, gdouble y, GtkTreePath** path, gboolean rubberband);
	void (*scroll_to_path) (FilesAbstractDirectoryView* self, GtkTreePath* path, gboolean scroll_to_top);
	void (*set_cursor_on_cell) (FilesAbstractDirectoryView* self, GtkTreePath* path, GtkCellRenderer* renderer, gboolean start_editing, gboolean scroll_to_top);
	void (*freeze_tree) (FilesAbstractDirectoryView* self);
	void (*thaw_tree) (FilesAbstractDirectoryView* self);
	void (*freeze_child_notify) (FilesAbstractDirectoryView* self);
	void (*thaw_child_notify) (FilesAbstractDirectoryView* self);
	void (*connect_tree_signals) (FilesAbstractDirectoryView* self);
	void (*disconnect_tree_signals) (FilesAbstractDirectoryView* self);
};

struct _FilesIconView {
	FilesAbstractDirectoryView parent_instance;
	FilesIconViewPrivate * priv;
	GtkIconView* tree;
	gboolean previous_selection_was_linear;
	GtkTreePath* previous_linear_selection_path;
	gint previous_linear_selection_direction;
	gboolean linear_select_required;
	GtkTreePath* most_recently_selected;
};

struct _FilesIconViewClass {
	FilesAbstractDirectoryViewClass parent_class;
};

static gpointer files_icon_view_parent_class = NULL;
VALA_EXTERN GSettings* files_icon_view_settings;

VALA_EXTERN GType files_abstract_directory_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FilesAbstractDirectoryView, g_object_unref)
VALA_EXTERN GType files_view_slot_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FilesViewSlot, g_object_unref)
VALA_EXTERN GType files_icon_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FilesIconView, g_object_unref)
VALA_EXTERN void files_abstract_directory_view_connect_tree_signals (FilesAbstractDirectoryView* self);
VALA_EXTERN void files_abstract_directory_view_disconnect_tree_signals (FilesAbstractDirectoryView* self);
VALA_EXTERN GtkWidget* files_abstract_directory_view_create_view (FilesAbstractDirectoryView* self);
VALA_EXTERN GSettings* files_abstract_directory_view_get_view_settings (FilesAbstractDirectoryView* self);
VALA_EXTERN void files_abstract_directory_view_change_zoom_level (FilesAbstractDirectoryView* self);
VALA_EXTERN GList* files_abstract_directory_view_get_selected_paths (FilesAbstractDirectoryView* self);
VALA_EXTERN void files_abstract_directory_view_highlight_path (FilesAbstractDirectoryView* self,
                                                   GtkTreePath* path);
VALA_EXTERN GtkTreePath* files_abstract_directory_view_get_path_at_pos (FilesAbstractDirectoryView* self,
                                                            gint x,
                                                            gint win);
VALA_EXTERN void files_abstract_directory_view_tree_select_all (FilesAbstractDirectoryView* self);
VALA_EXTERN void files_abstract_directory_view_tree_unselect_all (FilesAbstractDirectoryView* self);
VALA_EXTERN void files_abstract_directory_view_tree_unselect_others (FilesAbstractDirectoryView* self);
VALA_EXTERN void files_abstract_directory_view_select_path (FilesAbstractDirectoryView* self,
                                                GtkTreePath* path,
                                                gboolean cursor_follows);
VALA_EXTERN void files_abstract_directory_view_unselect_path (FilesAbstractDirectoryView* self,
                                                  GtkTreePath* path);
VALA_EXTERN gboolean files_abstract_directory_view_path_is_selected (FilesAbstractDirectoryView* self,
                                                         GtkTreePath* path);
VALA_EXTERN gboolean files_abstract_directory_view_get_visible_range (FilesAbstractDirectoryView* self,
                                                          GtkTreePath** start_path,
                                                          GtkTreePath** end_path);
VALA_EXTERN guint files_abstract_directory_view_get_event_position_info (FilesAbstractDirectoryView* self,
                                                             gdouble x,
                                                             gdouble y,
                                                             GtkTreePath** path,
                                                             gboolean rubberband);
VALA_EXTERN void files_abstract_directory_view_scroll_to_path (FilesAbstractDirectoryView* self,
                                                   GtkTreePath* path,
                                                   gboolean scroll_to_top);
VALA_EXTERN void files_abstract_directory_view_set_cursor_on_cell (FilesAbstractDirectoryView* self,
                                                       GtkTreePath* path,
                                                       GtkCellRenderer* renderer,
                                                       gboolean start_editing,
                                                       gboolean scroll_to_top);
VALA_EXTERN gboolean files_abstract_directory_view_will_handle_button_press (FilesAbstractDirectoryView* self,
                                                                 gboolean no_mods,
                                                                 gboolean only_control_pressed,
                                                                 gboolean only_shift_pressed);
VALA_EXTERN gboolean files_abstract_directory_view_handle_multi_select (FilesAbstractDirectoryView* self,
                                                            GtkTreePath* path);
VALA_EXTERN gboolean files_abstract_directory_view_move_cursor (FilesAbstractDirectoryView* self,
                                                    guint keyval,
                                                    gboolean only_shift_pressed,
                                                    gboolean control_pressed);
VALA_EXTERN void files_abstract_directory_view_set_cursor (FilesAbstractDirectoryView* self,
                                               GtkTreePath* path,
                                               gboolean start_editing,
                                               gboolean select,
                                               gboolean scroll_to_top);
VALA_EXTERN GtkTreePath* files_abstract_directory_view_get_path_at_cursor (FilesAbstractDirectoryView* self);
VALA_EXTERN void files_abstract_directory_view_freeze_tree (FilesAbstractDirectoryView* self);
VALA_EXTERN void files_abstract_directory_view_thaw_tree (FilesAbstractDirectoryView* self);
VALA_EXTERN void files_abstract_directory_view_freeze_child_notify (FilesAbstractDirectoryView* self);
VALA_EXTERN void files_abstract_directory_view_thaw_child_notify (FilesAbstractDirectoryView* self);
VALA_EXTERN GtkTreePath* files_abstract_directory_view_up (FilesAbstractDirectoryView* self,
                                               GtkTreePath* path);
VALA_EXTERN GtkTreePath* files_abstract_directory_view_down (FilesAbstractDirectoryView* self,
                                                 GtkTreePath* path);
static void _vala_GtkTreePath_free (GtkTreePath* self);
VALA_EXTERN FilesIconView* files_icon_view_new (FilesViewSlot* _slot);
VALA_EXTERN FilesIconView* files_icon_view_construct (GType object_type,
                                          FilesViewSlot* _slot);
VALA_EXTERN FilesAbstractDirectoryView* files_abstract_directory_view_construct (GType object_type,
                                                                     FilesViewSlot* _slot);
static void files_icon_view_real_connect_tree_signals (FilesAbstractDirectoryView* base);
VALA_EXTERN void files_abstract_directory_view_on_view_selection_changed (FilesAbstractDirectoryView* self);
static void _files_abstract_directory_view_on_view_selection_changed_gtk_icon_view_selection_changed (GtkIconView* _sender,
                                                                                               gpointer self);
static void files_icon_view_real_disconnect_tree_signals (FilesAbstractDirectoryView* base);
static GtkWidget* files_icon_view_real_create_view (FilesAbstractDirectoryView* base);
VALA_EXTERN void files_abstract_directory_view_set_up_name_renderer (FilesAbstractDirectoryView* self);
static void __lambda114_ (FilesIconView* self,
                   GtkWidget* w);
static void ___lambda114__gtk_widget_realize (GtkWidget* _sender,
                                       gpointer self);
static GSettings* files_icon_view_real_get_view_settings (FilesAbstractDirectoryView* base);
static void files_icon_view_real_change_zoom_level (FilesAbstractDirectoryView* base);
VALA_EXTERN gint files_abstract_directory_view_get_icon_size (FilesAbstractDirectoryView* self);
VALA_EXTERN FilesZoomLevel files_abstract_directory_view_get_zoom_level (FilesAbstractDirectoryView* self);
static GList* files_icon_view_real_get_selected_paths (FilesAbstractDirectoryView* base);
static void files_icon_view_real_highlight_path (FilesAbstractDirectoryView* base,
                                          GtkTreePath* path);
static GtkTreePath* files_icon_view_real_get_path_at_pos (FilesAbstractDirectoryView* base,
                                                   gint win_x,
                                                   gint win_y);
static void files_icon_view_real_tree_select_all (FilesAbstractDirectoryView* base);
static void files_icon_view_real_tree_unselect_all (FilesAbstractDirectoryView* base);
static void files_icon_view_real_tree_unselect_others (FilesAbstractDirectoryView* base);
static void files_icon_view_real_select_path (FilesAbstractDirectoryView* base,
                                       GtkTreePath* path,
                                       gboolean cursor_follows);
static void files_icon_view_real_unselect_path (FilesAbstractDirectoryView* base,
                                         GtkTreePath* path);
static gboolean files_icon_view_real_path_is_selected (FilesAbstractDirectoryView* base,
                                                GtkTreePath* path);
static gboolean files_icon_view_real_get_visible_range (FilesAbstractDirectoryView* base,
                                                 GtkTreePath** start_path,
                                                 GtkTreePath** end_path);
static guint files_icon_view_real_get_event_position_info (FilesAbstractDirectoryView* base,
                                                    gdouble wx,
                                                    gdouble wy,
                                                    GtkTreePath** path,
                                                    gboolean rubberband);
VALA_EXTERN GType files_abstract_directory_view_click_zone_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gboolean files_abstract_directory_view_is_on_icon (FilesAbstractDirectoryView* self,
                                                   gint x,
                                                   gint y,
                                                   gboolean* on_helper);
static void files_icon_view_real_scroll_to_path (FilesAbstractDirectoryView* base,
                                          GtkTreePath* path,
                                          gboolean scroll_to_top);
static void files_icon_view_real_set_cursor_on_cell (FilesAbstractDirectoryView* base,
                                              GtkTreePath* path,
                                              GtkCellRenderer* renderer,
                                              gboolean start_editing,
                                              gboolean scroll_to_top);
VALA_EXTERN void files_abstract_directory_view_scroll_to_cell (FilesAbstractDirectoryView* self,
                                                   GtkTreePath* path,
                                                   gboolean scroll_to_top);
static gboolean files_icon_view_real_will_handle_button_press (FilesAbstractDirectoryView* base,
                                                        gboolean no_mods,
                                                        gboolean only_control_pressed,
                                                        gboolean only_shift_pressed);
static gboolean files_icon_view_real_handle_multi_select (FilesAbstractDirectoryView* base,
                                                   GtkTreePath* path);
VALA_EXTERN void files_icon_view_linear_select_path (FilesIconView* self,
                                         GtkTreePath* path);
static gboolean files_icon_view_real_move_cursor (FilesAbstractDirectoryView* base,
                                           guint keyval,
                                           gboolean only_shift_pressed,
                                           gboolean control_pressed);
static void _vala_GtkTreeIter_free (GtkTreeIter* self);
static GtkTreeIter* _vala_GtkTreeIter_copy (GtkTreeIter* self);
static GtkTreePath* _vala_GtkTreePath_copy (GtkTreePath* self);
VALA_EXTERN void files_abstract_directory_view_unselect_all (FilesAbstractDirectoryView* self);
static void files_icon_view_real_set_cursor (FilesAbstractDirectoryView* base,
                                      GtkTreePath* path,
                                      gboolean start_editing,
                                      gboolean select,
                                      gboolean scroll_to_top);
static GtkTreePath* files_icon_view_real_get_path_at_cursor (FilesAbstractDirectoryView* base);
static void files_icon_view_real_freeze_tree (FilesAbstractDirectoryView* base);
VALA_EXTERN void files_abstract_directory_view_set_tree_frozen (FilesAbstractDirectoryView* self,
                                                    gboolean value);
static void files_icon_view_real_thaw_tree (FilesAbstractDirectoryView* base);
VALA_EXTERN gboolean files_abstract_directory_view_get_tree_frozen (FilesAbstractDirectoryView* self);
static void files_icon_view_real_freeze_child_notify (FilesAbstractDirectoryView* base);
static void files_icon_view_real_thaw_child_notify (FilesAbstractDirectoryView* base);
static gint _gtk_tree_path_compare_gcompare_func (gconstpointer a,
                                           gconstpointer b);
static void files_icon_view_get_first_and_last_selected (FilesIconView* self,
                                                  GtkTreePath** first,
                                                  GtkTreePath** last);
static void __vala_GtkTreePath_free0_ (gpointer var);
static inline void _g_list_free___vala_GtkTreePath_free0_ (GList* self);
static GtkTreePath* files_icon_view_real_up (FilesAbstractDirectoryView* base,
                                      GtkTreePath* path);
static gint files_icon_view_get_n_cols (FilesIconView* self);
static GtkTreePath* files_icon_view_real_down (FilesAbstractDirectoryView* base,
                                        GtkTreePath* path);
static void files_icon_view_finalize (GObject * obj);
static GType files_icon_view_get_type_once (void);

static void
_vala_GtkTreePath_free (GtkTreePath* self)
{
	g_boxed_free (gtk_tree_path_get_type (), self);
}

FilesIconView*
files_icon_view_construct (GType object_type,
                           FilesViewSlot* _slot)
{
	FilesIconView * self = NULL;
	g_return_val_if_fail (_slot != NULL, NULL);
	self = (FilesIconView*) files_abstract_directory_view_construct (object_type, _slot);
	return self;
}

FilesIconView*
files_icon_view_new (FilesViewSlot* _slot)
{
	return files_icon_view_construct (FILES_TYPE_ICON_VIEW, _slot);
}

static void
_files_abstract_directory_view_on_view_selection_changed_gtk_icon_view_selection_changed (GtkIconView* _sender,
                                                                                          gpointer self)
{
	files_abstract_directory_view_on_view_selection_changed ((FilesAbstractDirectoryView*) self);
}

static void
files_icon_view_real_connect_tree_signals (FilesAbstractDirectoryView* base)
{
	FilesIconView * self;
	GtkIconView* _tmp0_;
	self = (FilesIconView*) base;
	_tmp0_ = self->tree;
	g_signal_connect_object (_tmp0_, "selection-changed", (GCallback) _files_abstract_directory_view_on_view_selection_changed_gtk_icon_view_selection_changed, (FilesAbstractDirectoryView*) self, 0);
}

static void
files_icon_view_real_disconnect_tree_signals (FilesAbstractDirectoryView* base)
{
	FilesIconView * self;
	GtkIconView* _tmp0_;
	guint _tmp1_;
	self = (FilesIconView*) base;
	_tmp0_ = self->tree;
	g_signal_parse_name ("selection-changed", gtk_icon_view_get_type (), &_tmp1_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _files_abstract_directory_view_on_view_selection_changed_gtk_icon_view_selection_changed, (FilesAbstractDirectoryView*) self);
}

static void
__lambda114_ (FilesIconView* self,
              GtkWidget* w)
{
	GtkIconView* _tmp0_;
	g_return_if_fail (w != NULL);
	_tmp0_ = self->tree;
	gtk_widget_grab_focus ((GtkWidget*) _tmp0_);
}

static void
___lambda114__gtk_widget_realize (GtkWidget* _sender,
                                  gpointer self)
{
	__lambda114_ ((FilesIconView*) self, _sender);
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static GtkWidget*
files_icon_view_real_create_view (FilesAbstractDirectoryView* base)
{
	FilesIconView * self;
	FilesListModel* _tmp0_;
	GtkIconView* _tmp1_ = NULL;
	FilesIconRenderer* _tmp2_ = NULL;
	GtkIconView* _tmp3_;
	FilesIconRenderer* _tmp4_;
	GtkIconView* _tmp5_;
	FilesIconRenderer* _tmp6_;
	FilesTextRenderer* _tmp7_ = NULL;
	GtkIconView* _tmp8_;
	FilesTextRenderer* _tmp9_;
	GtkIconView* _tmp10_;
	FilesTextRenderer* _tmp11_;
	GtkIconView* _tmp12_;
	FilesTextRenderer* _tmp13_;
	GtkIconView* _tmp14_;
	FilesTextRenderer* _tmp15_;
	GtkIconView* _tmp16_;
	GtkIconView* _tmp17_;
	GtkWidget* _tmp18_;
	GtkWidget* result;
	self = (FilesIconView*) base;
	_tmp0_ = ((FilesAbstractDirectoryView*) self)->model;
	_tmp1_ = (GtkIconView*) gtk_icon_view_new_with_model ((GtkTreeModel*) _tmp0_);
	gtk_icon_view_set_selection_mode (_tmp1_, GTK_SELECTION_MULTIPLE);
	gtk_icon_view_set_columns (_tmp1_, -1);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->tree);
	self->tree = _tmp1_;
	_tmp2_ = files_icon_renderer_new ();
	files_icon_renderer_set_show_emblems (_tmp2_, TRUE);
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (((FilesAbstractDirectoryView*) self)->icon_renderer);
	((FilesAbstractDirectoryView*) self)->icon_renderer = _tmp2_;
	_tmp3_ = self->tree;
	_tmp4_ = ((FilesAbstractDirectoryView*) self)->icon_renderer;
	gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp3_, (GtkCellRenderer*) _tmp4_, FALSE);
	_tmp5_ = self->tree;
	_tmp6_ = ((FilesAbstractDirectoryView*) self)->icon_renderer;
	gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp5_, (GtkCellRenderer*) _tmp6_, "file", (gint) FILES_LIST_MODEL_COLUMN_ID_FILE_COLUMN);
	_tmp7_ = files_text_renderer_new (FILES_VIEW_MODE_ICON);
	g_object_set ((GtkCellRendererText*) _tmp7_, "wrap-mode", PANGO_WRAP_WORD_CHAR, NULL);
	g_object_set ((GtkCellRenderer*) _tmp7_, "xalign", 0.5f, NULL);
	g_object_set ((GtkCellRenderer*) _tmp7_, "yalign", 0.0f, NULL);
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (((FilesAbstractDirectoryView*) self)->name_renderer);
	((FilesAbstractDirectoryView*) self)->name_renderer = _tmp7_;
	files_abstract_directory_view_set_up_name_renderer ((FilesAbstractDirectoryView*) self);
	_tmp8_ = self->tree;
	_tmp9_ = ((FilesAbstractDirectoryView*) self)->name_renderer;
	gtk_cell_layout_pack_end ((GtkCellLayout*) _tmp8_, (GtkCellRenderer*) _tmp9_, FALSE);
	_tmp10_ = self->tree;
	_tmp11_ = ((FilesAbstractDirectoryView*) self)->name_renderer;
	gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp10_, (GtkCellRenderer*) _tmp11_, "text", (gint) FILES_LIST_MODEL_COLUMN_ID_FILENAME);
	_tmp12_ = self->tree;
	_tmp13_ = ((FilesAbstractDirectoryView*) self)->name_renderer;
	gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp12_, (GtkCellRenderer*) _tmp13_, "file", (gint) FILES_LIST_MODEL_COLUMN_ID_FILE_COLUMN);
	_tmp14_ = self->tree;
	_tmp15_ = ((FilesAbstractDirectoryView*) self)->name_renderer;
	gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp14_, (GtkCellRenderer*) _tmp15_, "background", (gint) FILES_LIST_MODEL_COLUMN_ID_COLOR);
	files_abstract_directory_view_connect_tree_signals ((FilesAbstractDirectoryView*) self);
	_tmp16_ = self->tree;
	g_signal_connect_object ((GtkWidget*) _tmp16_, "realize", (GCallback) ___lambda114__gtk_widget_realize, self, 0);
	_tmp17_ = self->tree;
	_tmp18_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp17_, gtk_widget_get_type ()) ? ((GtkWidget*) _tmp17_) : NULL);
	result = _tmp18_;
	return result;
}

static GSettings*
files_icon_view_real_get_view_settings (FilesAbstractDirectoryView* base)
{
	FilesIconView * self;
	GSettings* _tmp0_;
	GSettings* _tmp1_;
	GSettings* result;
	self = (FilesIconView*) base;
	_tmp0_ = files_icon_view_settings;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
files_icon_view_real_change_zoom_level (FilesAbstractDirectoryView* base)
{
	FilesIconView * self;
	GtkIconView* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	FilesZoomLevel _tmp3_;
	FilesZoomLevel _tmp4_;
	GtkIconView* _tmp5_;
	GtkIconView* _tmp6_;
	gint _tmp7_;
	gint _tmp8_;
	GtkIconView* _tmp9_;
	gint _tmp10_;
	gint _tmp11_;
	FilesZoomLevel _tmp12_;
	FilesZoomLevel _tmp13_;
	FilesTextRenderer* _tmp14_;
	GtkIconView* _tmp15_;
	gint _tmp16_;
	gint _tmp17_;
	self = (FilesIconView*) base;
	_tmp0_ = self->tree;
	_tmp1_ = files_abstract_directory_view_get_icon_size ((FilesAbstractDirectoryView*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = files_abstract_directory_view_get_zoom_level ((FilesAbstractDirectoryView*) self);
	_tmp4_ = _tmp3_;
	gtk_icon_view_set_column_spacing (_tmp0_, (gint) (_tmp2_ * (0.4 - (_tmp4_ * 0.03))));
	_tmp5_ = self->tree;
	_tmp6_ = self->tree;
	_tmp7_ = gtk_icon_view_get_column_spacing (_tmp6_);
	_tmp8_ = _tmp7_;
	gtk_icon_view_set_row_spacing (_tmp5_, _tmp8_);
	_tmp9_ = self->tree;
	_tmp10_ = files_abstract_directory_view_get_icon_size ((FilesAbstractDirectoryView*) self);
	_tmp11_ = _tmp10_;
	_tmp12_ = files_abstract_directory_view_get_zoom_level ((FilesAbstractDirectoryView*) self);
	_tmp13_ = _tmp12_;
	gtk_icon_view_set_item_width (_tmp9_, (gint) (_tmp11_ * (2.5 - (_tmp13_ * 0.2))));
	_tmp14_ = ((FilesAbstractDirectoryView*) self)->name_renderer;
	_tmp15_ = self->tree;
	_tmp16_ = gtk_icon_view_get_item_width (_tmp15_);
	_tmp17_ = _tmp16_;
	files_text_renderer_set_item_width (_tmp14_, _tmp17_);
	FILES_ABSTRACT_DIRECTORY_VIEW_CLASS (files_icon_view_parent_class)->change_zoom_level (G_TYPE_CHECK_INSTANCE_CAST (self, FILES_TYPE_ABSTRACT_DIRECTORY_VIEW, FilesAbstractDirectoryView));
}

static GList*
files_icon_view_real_get_selected_paths (FilesAbstractDirectoryView* base)
{
	FilesIconView * self;
	GtkIconView* _tmp0_;
	GList* _tmp1_;
	GList* result;
	self = (FilesIconView*) base;
	_tmp0_ = self->tree;
	_tmp1_ = gtk_icon_view_get_selected_items (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
files_icon_view_real_highlight_path (FilesAbstractDirectoryView* base,
                                     GtkTreePath* path)
{
	FilesIconView * self;
	GtkIconView* _tmp0_;
	self = (FilesIconView*) base;
	_tmp0_ = self->tree;
	gtk_icon_view_set_drag_dest_item (_tmp0_, path, GTK_ICON_VIEW_DROP_INTO);
}

static GtkTreePath*
files_icon_view_real_get_path_at_pos (FilesAbstractDirectoryView* base,
                                      gint win_x,
                                      gint win_y)
{
	FilesIconView * self;
	GtkIconView* _tmp0_;
	GtkScrolledWindow* _tmp1_;
	GtkAdjustment* _tmp2_;
	GtkTreePath* _tmp3_;
	GtkTreePath* result;
	self = (FilesIconView*) base;
	_tmp0_ = self->tree;
	_tmp1_ = ((FilesAbstractDirectoryView*) self)->scrolled_window;
	_tmp2_ = gtk_scrolled_window_get_vadjustment (_tmp1_);
	_tmp3_ = gtk_icon_view_get_path_at_pos (_tmp0_, win_x, win_y + ((gint) gtk_adjustment_get_value (_tmp2_)));
	result = _tmp3_;
	return result;
}

static void
files_icon_view_real_tree_select_all (FilesAbstractDirectoryView* base)
{
	FilesIconView * self;
	GtkIconView* _tmp0_;
	self = (FilesIconView*) base;
	_tmp0_ = self->tree;
	gtk_icon_view_select_all (_tmp0_);
}

static void
files_icon_view_real_tree_unselect_all (FilesAbstractDirectoryView* base)
{
	FilesIconView * self;
	GtkIconView* _tmp0_;
	self = (FilesIconView*) base;
	_tmp0_ = self->tree;
	gtk_icon_view_unselect_all (_tmp0_);
	__vala_GtkTreePath_free0 (self->previous_linear_selection_path);
	self->previous_linear_selection_path = NULL;
	self->previous_linear_selection_direction = 0;
}

static void
files_icon_view_real_tree_unselect_others (FilesAbstractDirectoryView* base)
{
	FilesIconView * self;
	GtkTreePath* path = NULL;
	GtkIconView* _tmp0_;
	GtkTreePath* _tmp1_ = NULL;
	GtkIconView* _tmp2_;
	GtkTreePath* _tmp3_;
	self = (FilesIconView*) base;
	path = NULL;
	_tmp0_ = self->tree;
	gtk_icon_view_get_cursor (_tmp0_, &_tmp1_, NULL);
	__vala_GtkTreePath_free0 (path);
	path = _tmp1_;
	_tmp2_ = self->tree;
	gtk_icon_view_unselect_all (_tmp2_);
	_tmp3_ = path;
	files_abstract_directory_view_select_path ((FilesAbstractDirectoryView*) self, _tmp3_, TRUE);
	__vala_GtkTreePath_free0 (path);
}

static void
files_icon_view_real_select_path (FilesAbstractDirectoryView* base,
                                  GtkTreePath* path,
                                  gboolean cursor_follows)
{
	FilesIconView * self;
	self = (FilesIconView*) base;
	if (path != NULL) {
		GtkIconView* _tmp0_;
		GtkTreePath* _tmp1_;
		_tmp0_ = self->tree;
		gtk_icon_view_select_path (_tmp0_, path);
		_tmp1_ = gtk_tree_path_copy (path);
		__vala_GtkTreePath_free0 (self->most_recently_selected);
		self->most_recently_selected = _tmp1_;
		if (cursor_follows) {
			GtkIconView* _tmp2_;
			_tmp2_ = self->tree;
			gtk_icon_view_set_cursor (_tmp2_, path, NULL, FALSE);
		}
	}
}

static void
files_icon_view_real_unselect_path (FilesAbstractDirectoryView* base,
                                    GtkTreePath* path)
{
	FilesIconView * self;
	self = (FilesIconView*) base;
	if (path != NULL) {
		GtkIconView* _tmp0_;
		_tmp0_ = self->tree;
		gtk_icon_view_unselect_path (_tmp0_, path);
		__vala_GtkTreePath_free0 (self->most_recently_selected);
		self->most_recently_selected = NULL;
	}
}

static gboolean
files_icon_view_real_path_is_selected (FilesAbstractDirectoryView* base,
                                       GtkTreePath* path)
{
	FilesIconView * self;
	gboolean result;
	self = (FilesIconView*) base;
	if (path != NULL) {
		GtkIconView* _tmp0_;
		_tmp0_ = self->tree;
		result = gtk_icon_view_path_is_selected (_tmp0_, path);
		return result;
	} else {
		result = FALSE;
		return result;
	}
}

static gboolean
files_icon_view_real_get_visible_range (FilesAbstractDirectoryView* base,
                                        GtkTreePath** start_path,
                                        GtkTreePath** end_path)
{
	FilesIconView * self;
	GtkTreePath* _vala_start_path = NULL;
	GtkTreePath* _vala_end_path = NULL;
	GtkIconView* _tmp0_;
	GtkTreePath* _tmp1_ = NULL;
	GtkTreePath* _tmp2_ = NULL;
	gboolean _tmp3_;
	gboolean result;
	self = (FilesIconView*) base;
	__vala_GtkTreePath_free0 (_vala_start_path);
	_vala_start_path = NULL;
	__vala_GtkTreePath_free0 (_vala_end_path);
	_vala_end_path = NULL;
	_tmp0_ = self->tree;
	_tmp3_ = gtk_icon_view_get_visible_range (_tmp0_, &_tmp1_, &_tmp2_);
	__vala_GtkTreePath_free0 (_vala_start_path);
	_vala_start_path = _tmp1_;
	__vala_GtkTreePath_free0 (_vala_end_path);
	_vala_end_path = _tmp2_;
	result = _tmp3_;
	if (start_path) {
		*start_path = _vala_start_path;
	} else {
		__vala_GtkTreePath_free0 (_vala_start_path);
	}
	if (end_path) {
		*end_path = _vala_end_path;
	} else {
		__vala_GtkTreePath_free0 (_vala_end_path);
	}
	return result;
}

static guint
files_icon_view_real_get_event_position_info (FilesAbstractDirectoryView* base,
                                              gdouble wx,
                                              gdouble wy,
                                              GtkTreePath** path,
                                              gboolean rubberband)
{
	FilesIconView * self;
	GtkTreePath* _vala_path = NULL;
	GtkCellRenderer* cell_renderer = NULL;
	guint zone = 0U;
	gint x = 0;
	gint y = 0;
	GtkIconView* _tmp0_;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	GtkIconView* _tmp3_;
	GtkTreePath* _tmp4_ = NULL;
	GtkCellRenderer* _tmp5_ = NULL;
	GtkCellRenderer* _tmp6_;
	FilesAbstractDirectoryViewClickZone _tmp7_ = 0;
	GtkTreePath* _tmp8_;
	GtkCellRenderer* _tmp9_;
	guint result;
	self = (FilesIconView*) base;
	__vala_GtkTreePath_free0 (_vala_path);
	_vala_path = NULL;
	x = 0;
	y = 0;
	_tmp0_ = self->tree;
	gtk_icon_view_convert_widget_to_bin_window_coords (_tmp0_, (gint) wx, (gint) wy, &_tmp1_, &_tmp2_);
	x = _tmp1_;
	y = _tmp2_;
	_tmp3_ = self->tree;
	gtk_icon_view_get_item_at_pos (_tmp3_, x, y, &_tmp4_, &_tmp5_);
	__vala_GtkTreePath_free0 (_vala_path);
	_vala_path = _tmp4_;
	_g_object_unref0 (cell_renderer);
	_tmp6_ = _g_object_ref0 (_tmp5_);
	cell_renderer = _tmp6_;
	_tmp8_ = _vala_path;
	if (_tmp8_ != NULL) {
		_tmp7_ = FILES_ABSTRACT_DIRECTORY_VIEW_CLICK_ZONE_BLANK_PATH;
	} else {
		_tmp7_ = FILES_ABSTRACT_DIRECTORY_VIEW_CLICK_ZONE_BLANK_NO_PATH;
	}
	zone = (guint) _tmp7_;
	_tmp9_ = cell_renderer;
	if (_tmp9_ != NULL) {
		GdkRectangle rect = {0};
		GdkRectangle area = {0};
		GtkIconView* _tmp10_;
		GtkTreePath* _tmp11_;
		GtkCellRenderer* _tmp12_;
		GdkRectangle _tmp13_ = {0};
		GtkCellRenderer* _tmp14_;
		GtkIconView* _tmp15_;
		GdkRectangle _tmp16_;
		GdkRectangle _tmp17_ = {0};
		GtkCellRenderer* _tmp18_;
		_tmp10_ = self->tree;
		_tmp11_ = _vala_path;
		_tmp12_ = cell_renderer;
		gtk_icon_view_get_cell_rect (_tmp10_, _tmp11_, _tmp12_, &_tmp13_);
		rect = _tmp13_;
		_tmp14_ = cell_renderer;
		_tmp15_ = self->tree;
		_tmp16_ = rect;
		gtk_cell_renderer_get_aligned_area (_tmp14_, (GtkWidget*) _tmp15_, GTK_CELL_RENDERER_PRELIT, &_tmp16_, &_tmp17_);
		area = _tmp17_;
		_tmp18_ = cell_renderer;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp18_, FILES_TYPE_TEXT_RENDERER)) {
			FilesTextRenderer* text_renderer = NULL;
			GtkCellRenderer* _tmp19_;
			FilesTextRenderer* _tmp20_;
			GtkScrolledWindow* _tmp21_;
			GtkAdjustment* _tmp22_;
			gdouble _tmp23_;
			gdouble _tmp24_;
			GtkTreeIter iter = {0};
			FilesListModel* _tmp25_;
			GtkTreePath* _tmp26_;
			GtkTreeIter _tmp27_ = {0};
			gchar* text = NULL;
			FilesListModel* _tmp28_;
			GtkTreeIter _tmp29_;
			gchar* _tmp30_ = NULL;
			FilesTextRenderer* _tmp31_;
			const gchar* _tmp32_;
			GdkRectangle _tmp33_;
			gboolean _tmp34_ = FALSE;
			gboolean _tmp35_ = FALSE;
			gboolean _tmp36_ = FALSE;
			GdkRectangle _tmp37_;
			gboolean is_on_blank = FALSE;
			guint _tmp44_ = 0U;
			_tmp19_ = cell_renderer;
			_tmp20_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, FILES_TYPE_TEXT_RENDERER, FilesTextRenderer));
			text_renderer = _tmp20_;
			_tmp21_ = ((FilesAbstractDirectoryView*) self)->scrolled_window;
			_tmp22_ = gtk_scrolled_window_get_vadjustment (_tmp21_);
			_tmp23_ = gtk_adjustment_get_value (_tmp22_);
			_tmp24_ = _tmp23_;
			y -= (gint) _tmp24_;
			_tmp25_ = ((FilesAbstractDirectoryView*) self)->model;
			_tmp26_ = _vala_path;
			gtk_tree_model_get_iter ((GtkTreeModel*) _tmp25_, &_tmp27_, _tmp26_);
			iter = _tmp27_;
			text = NULL;
			_tmp28_ = ((FilesAbstractDirectoryView*) self)->model;
			_tmp29_ = iter;
			gtk_tree_model_get ((GtkTreeModel*) _tmp28_, &_tmp29_, FILES_LIST_MODEL_COLUMN_ID_FILENAME, &_tmp30_, -1);
			_g_free0 (text);
			text = _tmp30_;
			_tmp31_ = text_renderer;
			_tmp32_ = text;
			_tmp33_ = area;
			files_text_renderer_set_up_layout (_tmp31_, _tmp32_, _tmp33_.width);
			_tmp37_ = rect;
			if (x < _tmp37_.x) {
				_tmp36_ = TRUE;
			} else {
				GdkRectangle _tmp38_;
				GdkRectangle _tmp39_;
				_tmp38_ = rect;
				_tmp39_ = rect;
				_tmp36_ = x >= (_tmp38_.x + _tmp39_.width);
			}
			if (_tmp36_) {
				_tmp35_ = TRUE;
			} else {
				GdkRectangle _tmp40_;
				_tmp40_ = rect;
				_tmp35_ = y < _tmp40_.y;
			}
			if (_tmp35_) {
				_tmp34_ = TRUE;
			} else {
				GdkRectangle _tmp41_;
				FilesTextRenderer* _tmp42_;
				FilesTextRenderer* _tmp43_;
				_tmp41_ = rect;
				_tmp42_ = text_renderer;
				_tmp43_ = text_renderer;
				_tmp34_ = y >= ((_tmp41_.y + _tmp42_->text_height) + _tmp43_->text_y_offset);
			}
			is_on_blank = _tmp34_;
			if (is_on_blank) {
				_tmp44_ = zone;
			} else {
				_tmp44_ = (guint) FILES_ABSTRACT_DIRECTORY_VIEW_CLICK_ZONE_NAME;
			}
			zone = _tmp44_;
			_g_free0 (text);
			_g_object_unref0 (text_renderer);
		} else {
			gboolean on_helper = FALSE;
			FilesFile* file = NULL;
			FilesListModel* _tmp45_;
			GtkTreePath* _tmp46_;
			FilesFile* _tmp47_;
			FilesFile* _tmp48_;
			on_helper = FALSE;
			_tmp45_ = ((FilesAbstractDirectoryView*) self)->model;
			_tmp46_ = _vala_path;
			_tmp47_ = files_list_model_file_for_path (_tmp45_, _tmp46_);
			file = _tmp47_;
			_tmp48_ = file;
			if (_tmp48_ != NULL) {
				gboolean on_icon = FALSE;
				gboolean _tmp49_;
				_tmp49_ = files_abstract_directory_view_is_on_icon ((FilesAbstractDirectoryView*) self, (gint) x, (gint) y, &on_helper);
				on_icon = _tmp49_;
				if (on_helper) {
					zone = (guint) FILES_ABSTRACT_DIRECTORY_VIEW_CLICK_ZONE_HELPER;
				} else {
					if (on_icon) {
						zone = (guint) FILES_ABSTRACT_DIRECTORY_VIEW_CLICK_ZONE_ICON;
					} else {
						if (rubberband) {
							zone = (guint) FILES_ABSTRACT_DIRECTORY_VIEW_CLICK_ZONE_BLANK_NO_PATH;
						}
					}
				}
			} else {
				zone = (guint) FILES_ABSTRACT_DIRECTORY_VIEW_CLICK_ZONE_INVALID;
			}
			_g_object_unref0 (file);
		}
	}
	result = zone;
	_g_object_unref0 (cell_renderer);
	if (path) {
		*path = _vala_path;
	} else {
		__vala_GtkTreePath_free0 (_vala_path);
	}
	return result;
}

static void
files_icon_view_real_scroll_to_path (FilesAbstractDirectoryView* base,
                                     GtkTreePath* path,
                                     gboolean scroll_to_top)
{
	FilesIconView * self;
	GtkIconView* _tmp0_;
	self = (FilesIconView*) base;
	g_return_if_fail (path != NULL);
	_tmp0_ = self->tree;
	gtk_icon_view_scroll_to_path (_tmp0_, path, scroll_to_top, 0.5f, 0.5f);
}

static void
files_icon_view_real_set_cursor_on_cell (FilesAbstractDirectoryView* base,
                                         GtkTreePath* path,
                                         GtkCellRenderer* renderer,
                                         gboolean start_editing,
                                         gboolean scroll_to_top)
{
	FilesIconView * self;
	GtkIconView* _tmp0_;
	self = (FilesIconView*) base;
	g_return_if_fail (path != NULL);
	g_return_if_fail (renderer != NULL);
	files_abstract_directory_view_scroll_to_cell ((FilesAbstractDirectoryView*) self, path, scroll_to_top);
	_tmp0_ = self->tree;
	gtk_icon_view_set_cursor (_tmp0_, path, renderer, start_editing);
}

static gboolean
files_icon_view_real_will_handle_button_press (FilesAbstractDirectoryView* base,
                                               gboolean no_mods,
                                               gboolean only_control_pressed,
                                               gboolean only_shift_pressed)
{
	FilesIconView * self;
	gboolean result;
	self = (FilesIconView*) base;
	self->linear_select_required = only_shift_pressed;
	if (self->linear_select_required) {
		result = TRUE;
		return result;
	} else {
		result = FILES_ABSTRACT_DIRECTORY_VIEW_CLASS (files_icon_view_parent_class)->will_handle_button_press (G_TYPE_CHECK_INSTANCE_CAST (self, FILES_TYPE_ABSTRACT_DIRECTORY_VIEW, FilesAbstractDirectoryView), no_mods, only_control_pressed, only_shift_pressed);
		return result;
	}
}

static gboolean
files_icon_view_real_handle_multi_select (FilesAbstractDirectoryView* base,
                                          GtkTreePath* path)
{
	FilesIconView * self;
	gboolean _tmp0_ = FALSE;
	GList* _tmp1_;
	gboolean result;
	self = (FilesIconView*) base;
	g_return_val_if_fail (path != NULL, FALSE);
	_tmp1_ = ((FilesAbstractDirectoryView*) self)->selected_files;
	if (_tmp1_ != NULL) {
		GList* _tmp2_;
		GList* _tmp3_;
		_tmp2_ = ((FilesAbstractDirectoryView*) self)->selected_files;
		_tmp3_ = g_list_first (_tmp2_);
		_tmp0_ = _tmp3_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		files_icon_view_linear_select_path (self, path);
		result = TRUE;
		return result;
	} else {
		result = FALSE;
		return result;
	}
}

static void
_vala_GtkTreeIter_free (GtkTreeIter* self)
{
	g_boxed_free (gtk_tree_iter_get_type (), self);
}

static GtkTreeIter*
_vala_GtkTreeIter_copy (GtkTreeIter* self)
{
	return g_boxed_copy (gtk_tree_iter_get_type (), self);
}

static gpointer
__vala_GtkTreeIter_copy0 (gpointer self)
{
	return self ? _vala_GtkTreeIter_copy (self) : NULL;
}

static GtkTreePath*
_vala_GtkTreePath_copy (GtkTreePath* self)
{
	return g_boxed_copy (gtk_tree_path_get_type (), self);
}

static gpointer
__vala_GtkTreePath_copy0 (gpointer self)
{
	return self ? _vala_GtkTreePath_copy (self) : NULL;
}

static gboolean
files_icon_view_real_move_cursor (FilesAbstractDirectoryView* base,
                                  guint keyval,
                                  gboolean only_shift_pressed,
                                  gboolean control_pressed)
{
	FilesIconView * self;
	GtkTreePath* path = NULL;
	GtkTreePath* _tmp0_;
	GtkTreePath* _tmp1_;
	gboolean result;
	self = (FilesIconView*) base;
	_tmp0_ = files_abstract_directory_view_get_path_at_cursor ((FilesAbstractDirectoryView*) self);
	path = _tmp0_;
	_tmp1_ = path;
	if (_tmp1_ != NULL) {
		GtkTreeIter* iter = NULL;
		FilesListModel* _tmp8_;
		GtkTreePath* _tmp9_;
		GtkTreeIter _tmp10_ = {0};
		gboolean _tmp11_;
		GtkTreeIter _tmp12_;
		GtkTreeIter* _tmp13_;
		if (keyval == GDK_KEY_Right) {
			GtkTreePath* _tmp2_;
			_tmp2_ = path;
			gtk_tree_path_next (_tmp2_);
		} else {
			if (keyval == GDK_KEY_Left) {
				GtkTreePath* _tmp3_;
				_tmp3_ = path;
				gtk_tree_path_prev (_tmp3_);
			} else {
				if (keyval == GDK_KEY_Up) {
					GtkTreePath* _tmp4_;
					GtkTreePath* _tmp5_;
					_tmp4_ = path;
					_tmp5_ = files_abstract_directory_view_up ((FilesAbstractDirectoryView*) self, _tmp4_);
					__vala_GtkTreePath_free0 (path);
					path = _tmp5_;
				} else {
					if (keyval == GDK_KEY_Down) {
						GtkTreePath* _tmp6_;
						GtkTreePath* _tmp7_;
						_tmp6_ = path;
						_tmp7_ = files_abstract_directory_view_down ((FilesAbstractDirectoryView*) self, _tmp6_);
						__vala_GtkTreePath_free0 (path);
						path = _tmp7_;
					}
				}
			}
		}
		iter = NULL;
		_tmp8_ = ((FilesAbstractDirectoryView*) self)->model;
		_tmp9_ = path;
		_tmp11_ = gtk_tree_model_get_iter ((GtkTreeModel*) _tmp8_, &_tmp10_, _tmp9_);
		__vala_GtkTreeIter_free0 (iter);
		_tmp12_ = _tmp10_;
		_tmp13_ = __vala_GtkTreeIter_copy0 (&_tmp12_);
		iter = _tmp13_;
		if (_tmp11_) {
			gboolean _tmp14_ = FALSE;
			if (only_shift_pressed) {
				GList* _tmp15_;
				_tmp15_ = ((FilesAbstractDirectoryView*) self)->selected_files;
				_tmp14_ = _tmp15_ != NULL;
			} else {
				_tmp14_ = FALSE;
			}
			if (_tmp14_) {
				GtkTreePath* _tmp16_;
				_tmp16_ = path;
				files_icon_view_linear_select_path (self, _tmp16_);
			} else {
				if (control_pressed) {
					GtkTreePath* _tmp17_;
					GtkTreePath* _tmp18_;
					GtkTreePath* _tmp19_;
					_tmp17_ = path;
					files_abstract_directory_view_set_cursor ((FilesAbstractDirectoryView*) self, _tmp17_, FALSE, FALSE, FALSE);
					_tmp18_ = path;
					_tmp19_ = __vala_GtkTreePath_copy0 (_tmp18_);
					__vala_GtkTreePath_free0 (self->previous_linear_selection_path);
					self->previous_linear_selection_path = _tmp19_;
				} else {
					GtkTreePath* _tmp20_;
					GtkTreePath* _tmp21_;
					GtkTreePath* _tmp22_;
					files_abstract_directory_view_unselect_all ((FilesAbstractDirectoryView*) self);
					_tmp20_ = path;
					files_abstract_directory_view_set_cursor ((FilesAbstractDirectoryView*) self, _tmp20_, FALSE, TRUE, FALSE);
					_tmp21_ = path;
					_tmp22_ = __vala_GtkTreePath_copy0 (_tmp21_);
					__vala_GtkTreePath_free0 (self->previous_linear_selection_path);
					self->previous_linear_selection_path = _tmp22_;
				}
			}
		}
		__vala_GtkTreeIter_free0 (iter);
	} else {
		GtkTreePath* _tmp23_;
		GtkTreePath* _tmp24_;
		GtkTreePath* _tmp25_;
		GtkTreePath* _tmp26_;
		_tmp23_ = gtk_tree_path_new_from_indices (0, -1);
		__vala_GtkTreePath_free0 (path);
		path = _tmp23_;
		_tmp24_ = path;
		files_abstract_directory_view_set_cursor ((FilesAbstractDirectoryView*) self, _tmp24_, FALSE, !control_pressed, FALSE);
		_tmp25_ = path;
		_tmp26_ = __vala_GtkTreePath_copy0 (_tmp25_);
		__vala_GtkTreePath_free0 (self->previous_linear_selection_path);
		self->previous_linear_selection_path = _tmp26_;
	}
	result = TRUE;
	__vala_GtkTreePath_free0 (path);
	return result;
}

static void
files_icon_view_real_set_cursor (FilesAbstractDirectoryView* base,
                                 GtkTreePath* path,
                                 gboolean start_editing,
                                 gboolean select,
                                 gboolean scroll_to_top)
{
	FilesIconView * self;
	FilesTextRenderer* _tmp2_;
	self = (FilesIconView*) base;
	if (path == NULL) {
		return;
	}
	if (!select) {
		GtkIconView* _tmp0_;
		guint _tmp1_;
		_tmp0_ = self->tree;
		g_signal_parse_name ("selection-changed", gtk_icon_view_get_type (), &_tmp1_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _files_abstract_directory_view_on_view_selection_changed_gtk_icon_view_selection_changed, (FilesAbstractDirectoryView*) self);
	} else {
		files_abstract_directory_view_select_path ((FilesAbstractDirectoryView*) self, path, FALSE);
	}
	_tmp2_ = ((FilesAbstractDirectoryView*) self)->name_renderer;
	files_abstract_directory_view_set_cursor_on_cell ((FilesAbstractDirectoryView*) self, path, (GtkCellRenderer*) _tmp2_, start_editing, scroll_to_top);
	if (!select) {
		GtkIconView* _tmp3_;
		_tmp3_ = self->tree;
		g_signal_connect_object (_tmp3_, "selection-changed", (GCallback) _files_abstract_directory_view_on_view_selection_changed_gtk_icon_view_selection_changed, (FilesAbstractDirectoryView*) self, 0);
	}
}

static GtkTreePath*
files_icon_view_real_get_path_at_cursor (FilesAbstractDirectoryView* base)
{
	FilesIconView * self;
	GtkTreePath* path = NULL;
	GtkIconView* _tmp0_;
	GtkTreePath* _tmp1_ = NULL;
	GtkTreePath* result;
	self = (FilesIconView*) base;
	_tmp0_ = self->tree;
	gtk_icon_view_get_cursor (_tmp0_, &_tmp1_, NULL);
	__vala_GtkTreePath_free0 (path);
	path = _tmp1_;
	result = path;
	return result;
}

static void
files_icon_view_real_freeze_tree (FilesAbstractDirectoryView* base)
{
	FilesIconView * self;
	GtkIconView* _tmp0_;
	GtkIconView* _tmp1_;
	self = (FilesIconView*) base;
	files_abstract_directory_view_set_tree_frozen ((FilesAbstractDirectoryView*) self, TRUE);
	_tmp0_ = self->tree;
	gtk_widget_freeze_child_notify ((GtkWidget*) _tmp0_);
	_tmp1_ = self->tree;
	gtk_icon_view_set_model (_tmp1_, NULL);
}

static void
files_icon_view_real_thaw_tree (FilesAbstractDirectoryView* base)
{
	FilesIconView * self;
	gboolean _tmp0_;
	gboolean _tmp1_;
	self = (FilesIconView*) base;
	_tmp0_ = files_abstract_directory_view_get_tree_frozen ((FilesAbstractDirectoryView*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		GtkIconView* _tmp2_;
		FilesListModel* _tmp3_;
		GtkIconView* _tmp4_;
		_tmp2_ = self->tree;
		_tmp3_ = ((FilesAbstractDirectoryView*) self)->model;
		gtk_icon_view_set_model (_tmp2_, (GtkTreeModel*) _tmp3_);
		_tmp4_ = self->tree;
		gtk_widget_thaw_child_notify ((GtkWidget*) _tmp4_);
		files_abstract_directory_view_set_tree_frozen ((FilesAbstractDirectoryView*) self, FALSE);
	}
}

static void
files_icon_view_real_freeze_child_notify (FilesAbstractDirectoryView* base)
{
	FilesIconView * self;
	GtkIconView* _tmp0_;
	self = (FilesIconView*) base;
	_tmp0_ = self->tree;
	gtk_widget_freeze_child_notify ((GtkWidget*) _tmp0_);
}

static void
files_icon_view_real_thaw_child_notify (FilesAbstractDirectoryView* base)
{
	FilesIconView * self;
	gboolean _tmp0_;
	gboolean _tmp1_;
	self = (FilesIconView*) base;
	_tmp0_ = files_abstract_directory_view_get_tree_frozen ((FilesAbstractDirectoryView*) self);
	_tmp1_ = _tmp0_;
	if (!_tmp1_) {
		GtkIconView* _tmp2_;
		_tmp2_ = self->tree;
		gtk_widget_thaw_child_notify ((GtkWidget*) _tmp2_);
	}
}

static gint
_gtk_tree_path_compare_gcompare_func (gconstpointer a,
                                      gconstpointer b)
{
	gint result;
	result = gtk_tree_path_compare (a, (GtkTreePath*) b);
	return result;
}

static void
__vala_GtkTreePath_free0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (_vala_GtkTreePath_free (var), NULL));
}

static inline void
_g_list_free___vala_GtkTreePath_free0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) __vala_GtkTreePath_free0_);
}

void
files_icon_view_linear_select_path (FilesIconView* self,
                                    GtkTreePath* path)
{
	gboolean _tmp0_ = FALSE;
	GtkTreePath* _tmp1_;
	GList* selected_paths = NULL;
	GtkIconView* _tmp3_;
	GList* _tmp4_;
	GtkTreePath* first_selected = NULL;
	GtkTreePath* last_selected = NULL;
	GtkTreePath* _tmp5_ = NULL;
	GtkTreePath* _tmp6_ = NULL;
	GtkTreePath* _tmp7_;
	gboolean before_first = FALSE;
	GtkTreePath* _tmp8_;
	gboolean after_last = FALSE;
	GtkTreePath* _tmp9_;
	GtkTreePath* p = NULL;
	GtkTreePath* _tmp10_;
	GtkTreePath* p2 = NULL;
	GtkTreePath* end_path = NULL;
	GtkTreePath* _tmp74_ = NULL;
	GtkTreePath* _tmp75_ = NULL;
	GtkTreePath* _tmp76_;
	GtkTreePath* _tmp77_;
	GtkTreePath* _tmp79_;
	GtkIconView* _tmp80_;
	GtkIconView* _tmp81_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (path != NULL);
	if (path == NULL) {
		g_critical ("IconView.vala:343: Ignoring attempt to select null path in linear_sele" \
"ct_path");
		return;
	}
	_tmp1_ = self->previous_linear_selection_path;
	if (_tmp1_ != NULL) {
		GtkTreePath* _tmp2_;
		_tmp2_ = self->previous_linear_selection_path;
		_tmp0_ = gtk_tree_path_compare (path, _tmp2_) == 0;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		return;
	}
	_tmp3_ = self->tree;
	_tmp4_ = gtk_icon_view_get_selected_items (_tmp3_);
	selected_paths = _tmp4_;
	selected_paths = g_list_sort (selected_paths, _gtk_tree_path_compare_gcompare_func);
	files_icon_view_get_first_and_last_selected (self, &_tmp5_, &_tmp6_);
	__vala_GtkTreePath_free0 (first_selected);
	first_selected = _tmp5_;
	__vala_GtkTreePath_free0 (last_selected);
	last_selected = _tmp6_;
	_tmp7_ = first_selected;
	if (_tmp7_ == NULL) {
		g_warning ("IconView.vala:358: Linear select called with no initial selection");
		files_abstract_directory_view_select_path ((FilesAbstractDirectoryView*) self, path, TRUE);
		__vala_GtkTreePath_free0 (last_selected);
		__vala_GtkTreePath_free0 (first_selected);
		(selected_paths == NULL) ? NULL : (selected_paths = (_g_list_free___vala_GtkTreePath_free0_ (selected_paths), NULL));
		return;
	}
	_tmp8_ = first_selected;
	before_first = gtk_tree_path_compare (path, _tmp8_) <= 0;
	_tmp9_ = last_selected;
	after_last = gtk_tree_path_compare (path, _tmp9_) >= 0;
	_tmp10_ = gtk_tree_path_copy (path);
	p = _tmp10_;
	p2 = NULL;
	end_path = NULL;
	if (before_first) {
		GtkTreePath* _tmp11_;
		GtkTreePath* _tmp12_;
		_tmp11_ = last_selected;
		_tmp12_ = __vala_GtkTreePath_copy0 (_tmp11_);
		__vala_GtkTreePath_free0 (end_path);
		end_path = _tmp12_;
	} else {
		if (after_last) {
			GtkTreePath* _tmp13_;
			GtkTreePath* _tmp14_;
			_tmp13_ = first_selected;
			_tmp14_ = __vala_GtkTreePath_copy0 (_tmp13_);
			__vala_GtkTreePath_free0 (end_path);
			end_path = _tmp14_;
		} else {
			if (self->previous_linear_selection_direction != 0) {
				GtkTreePath* _tmp15_ = NULL;
				GtkTreePath* _tmp18_;
				if (self->previous_linear_selection_direction > 0) {
					GtkTreePath* _tmp16_;
					_tmp16_ = last_selected;
					_tmp15_ = _tmp16_;
				} else {
					GtkTreePath* _tmp17_;
					_tmp17_ = first_selected;
					_tmp15_ = _tmp17_;
				}
				_tmp18_ = __vala_GtkTreePath_copy0 (_tmp15_);
				__vala_GtkTreePath_free0 (end_path);
				end_path = _tmp18_;
				before_first = self->previous_linear_selection_direction > 0;
				after_last = self->previous_linear_selection_direction < 0;
			} else {
				GtkTreePath* _tmp19_ = NULL;
				GtkTreePath* _tmp20_;
				GtkTreePath* _tmp23_;
				_tmp20_ = self->most_recently_selected;
				if (_tmp20_ != NULL) {
					GtkTreePath* _tmp21_;
					_tmp21_ = self->most_recently_selected;
					_tmp19_ = _tmp21_;
				} else {
					GtkTreePath* _tmp22_;
					_tmp22_ = first_selected;
					_tmp19_ = _tmp22_;
				}
				_tmp23_ = __vala_GtkTreePath_copy0 (_tmp19_);
				__vala_GtkTreePath_free0 (end_path);
				end_path = _tmp23_;
			}
		}
	}
	files_abstract_directory_view_unselect_all ((FilesAbstractDirectoryView*) self);
	if (before_first) {
		{
			gboolean _tmp24_ = FALSE;
			_tmp24_ = TRUE;
			while (TRUE) {
				GtkTreePath* _tmp30_;
				GtkTreePath* _tmp31_;
				GtkTreePath* _tmp32_;
				GtkTreePath* _tmp33_;
				if (!_tmp24_) {
					gboolean _tmp25_ = FALSE;
					GtkTreePath* _tmp26_;
					GtkTreePath* _tmp27_;
					_tmp26_ = p;
					_tmp27_ = p2;
					if (gtk_tree_path_compare (_tmp26_, _tmp27_) != 0) {
						GtkTreePath* _tmp28_;
						GtkTreePath* _tmp29_;
						_tmp28_ = p;
						_tmp29_ = end_path;
						_tmp25_ = gtk_tree_path_compare (_tmp28_, _tmp29_) <= 0;
					} else {
						_tmp25_ = FALSE;
					}
					if (!_tmp25_) {
						break;
					}
				}
				_tmp24_ = FALSE;
				_tmp30_ = p;
				_tmp31_ = gtk_tree_path_copy (_tmp30_);
				__vala_GtkTreePath_free0 (p2);
				p2 = _tmp31_;
				_tmp32_ = p;
				files_abstract_directory_view_select_path ((FilesAbstractDirectoryView*) self, _tmp32_, TRUE);
				_tmp33_ = p;
				gtk_tree_path_next (_tmp33_);
			}
		}
	} else {
		if (after_last) {
			{
				gboolean _tmp34_ = FALSE;
				_tmp34_ = TRUE;
				while (TRUE) {
					GtkTreePath* _tmp40_;
					GtkTreePath* _tmp41_;
					GtkTreePath* _tmp42_;
					GtkTreePath* _tmp43_;
					if (!_tmp34_) {
						gboolean _tmp35_ = FALSE;
						GtkTreePath* _tmp36_;
						GtkTreePath* _tmp37_;
						_tmp36_ = p;
						_tmp37_ = p2;
						if (gtk_tree_path_compare (_tmp36_, _tmp37_) != 0) {
							GtkTreePath* _tmp38_;
							GtkTreePath* _tmp39_;
							_tmp38_ = p;
							_tmp39_ = end_path;
							_tmp35_ = gtk_tree_path_compare (_tmp38_, _tmp39_) >= 0;
						} else {
							_tmp35_ = FALSE;
						}
						if (!_tmp35_) {
							break;
						}
					}
					_tmp34_ = FALSE;
					_tmp40_ = p;
					files_abstract_directory_view_select_path ((FilesAbstractDirectoryView*) self, _tmp40_, TRUE);
					_tmp41_ = p;
					_tmp42_ = gtk_tree_path_copy (_tmp41_);
					__vala_GtkTreePath_free0 (p2);
					p2 = _tmp42_;
					_tmp43_ = p;
					gtk_tree_path_prev (_tmp43_);
				}
			}
		} else {
			gboolean after = FALSE;
			GtkTreePath* _tmp44_;
			GtkTreePath* _tmp45_;
			GtkTreePath* _tmp46_;
			GtkTreePath* _tmp47_;
			GtkTreePath* _tmp48_;
			GtkTreePath* _tmp49_;
			GtkTreePath* _tmp60_;
			GtkTreePath* _tmp61_;
			GtkTreePath* _tmp62_;
			GtkTreePath* _tmp63_;
			_tmp44_ = p;
			_tmp45_ = end_path;
			after = gtk_tree_path_compare (_tmp44_, _tmp45_) >= 0;
			_tmp46_ = p;
			files_abstract_directory_view_select_path ((FilesAbstractDirectoryView*) self, _tmp46_, TRUE);
			_tmp47_ = p;
			_tmp48_ = gtk_tree_path_copy (_tmp47_);
			__vala_GtkTreePath_free0 (p2);
			p2 = _tmp48_;
			_tmp49_ = p;
			gtk_tree_path_prev (_tmp49_);
			while (TRUE) {
				gboolean _tmp50_ = FALSE;
				GtkTreePath* _tmp51_;
				GtkTreePath* _tmp52_;
				GtkTreePath* _tmp57_;
				GtkTreePath* _tmp58_;
				GtkTreePath* _tmp59_;
				_tmp51_ = p;
				_tmp52_ = p2;
				if (gtk_tree_path_compare (_tmp51_, _tmp52_) != 0) {
					GtkTreePath* _tmp53_;
					GtkTreePath* _tmp54_;
					_tmp53_ = p;
					_tmp54_ = first_selected;
					_tmp50_ = gtk_tree_path_compare (_tmp53_, _tmp54_) >= 0;
				} else {
					_tmp50_ = FALSE;
				}
				if (!_tmp50_) {
					break;
				}
				if (after) {
					GtkTreePath* _tmp55_;
					_tmp55_ = p;
					files_abstract_directory_view_select_path ((FilesAbstractDirectoryView*) self, _tmp55_, TRUE);
				} else {
					GtkTreePath* _tmp56_;
					_tmp56_ = p;
					files_abstract_directory_view_unselect_path ((FilesAbstractDirectoryView*) self, _tmp56_);
				}
				_tmp57_ = p;
				_tmp58_ = gtk_tree_path_copy (_tmp57_);
				__vala_GtkTreePath_free0 (p2);
				p2 = _tmp58_;
				_tmp59_ = p;
				gtk_tree_path_prev (_tmp59_);
			}
			_tmp60_ = gtk_tree_path_copy (path);
			__vala_GtkTreePath_free0 (p);
			p = _tmp60_;
			_tmp61_ = p;
			_tmp62_ = gtk_tree_path_copy (_tmp61_);
			__vala_GtkTreePath_free0 (p2);
			p2 = _tmp62_;
			_tmp63_ = p;
			gtk_tree_path_next (_tmp63_);
			while (TRUE) {
				gboolean _tmp64_ = FALSE;
				GtkTreePath* _tmp65_;
				GtkTreePath* _tmp66_;
				GtkTreePath* _tmp71_;
				GtkTreePath* _tmp72_;
				GtkTreePath* _tmp73_;
				_tmp65_ = p;
				_tmp66_ = p2;
				if (gtk_tree_path_compare (_tmp65_, _tmp66_) != 0) {
					GtkTreePath* _tmp67_;
					GtkTreePath* _tmp68_;
					_tmp67_ = p;
					_tmp68_ = last_selected;
					_tmp64_ = gtk_tree_path_compare (_tmp67_, _tmp68_) <= 0;
				} else {
					_tmp64_ = FALSE;
				}
				if (!_tmp64_) {
					break;
				}
				if (after) {
					GtkTreePath* _tmp69_;
					_tmp69_ = p;
					files_abstract_directory_view_unselect_path ((FilesAbstractDirectoryView*) self, _tmp69_);
				} else {
					GtkTreePath* _tmp70_;
					_tmp70_ = p;
					files_abstract_directory_view_select_path ((FilesAbstractDirectoryView*) self, _tmp70_, TRUE);
				}
				_tmp71_ = p;
				_tmp72_ = gtk_tree_path_copy (_tmp71_);
				__vala_GtkTreePath_free0 (p2);
				p2 = _tmp72_;
				_tmp73_ = p;
				gtk_tree_path_next (_tmp73_);
			}
		}
	}
	self->previous_selection_was_linear = TRUE;
	files_icon_view_get_first_and_last_selected (self, &_tmp74_, &_tmp75_);
	__vala_GtkTreePath_free0 (first_selected);
	first_selected = _tmp74_;
	__vala_GtkTreePath_free0 (last_selected);
	last_selected = _tmp75_;
	_tmp76_ = first_selected;
	if (_tmp76_ == NULL) {
		g_critical ("IconView.vala:431: Linear select unselected all");
		__vala_GtkTreePath_free0 (end_path);
		__vala_GtkTreePath_free0 (p2);
		__vala_GtkTreePath_free0 (p);
		__vala_GtkTreePath_free0 (last_selected);
		__vala_GtkTreePath_free0 (first_selected);
		(selected_paths == NULL) ? NULL : (selected_paths = (_g_list_free___vala_GtkTreePath_free0_ (selected_paths), NULL));
		return;
	}
	_tmp77_ = last_selected;
	if (gtk_tree_path_compare (path, _tmp77_) <= 0) {
		self->previous_linear_selection_direction = 1;
	} else {
		GtkTreePath* _tmp78_;
		_tmp78_ = first_selected;
		if (gtk_tree_path_compare (path, _tmp78_) >= 0) {
			self->previous_linear_selection_direction = -1;
		}
	}
	_tmp79_ = gtk_tree_path_copy (path);
	__vala_GtkTreePath_free0 (self->previous_linear_selection_path);
	self->previous_linear_selection_path = _tmp79_;
	_tmp80_ = self->tree;
	gtk_icon_view_set_cursor (_tmp80_, path, NULL, FALSE);
	_tmp81_ = self->tree;
	gtk_icon_view_scroll_to_path (_tmp81_, path, FALSE, 0.5f, 0.5f);
	__vala_GtkTreePath_free0 (end_path);
	__vala_GtkTreePath_free0 (p2);
	__vala_GtkTreePath_free0 (p);
	__vala_GtkTreePath_free0 (last_selected);
	__vala_GtkTreePath_free0 (first_selected);
	(selected_paths == NULL) ? NULL : (selected_paths = (_g_list_free___vala_GtkTreePath_free0_ (selected_paths), NULL));
}

static void
files_icon_view_get_first_and_last_selected (FilesIconView* self,
                                             GtkTreePath** first,
                                             GtkTreePath** last)
{
	GtkTreePath* _vala_first = NULL;
	GtkTreePath* _vala_last = NULL;
	GtkTreePath* _tmp0_;
	GtkTreePath* _tmp1_;
	GList* selected_paths = NULL;
	GtkIconView* _tmp2_;
	GList* _tmp3_;
	gboolean _tmp4_ = FALSE;
	GList* _tmp5_;
	GList* _tmp8_;
	GList* _tmp9_;
	gconstpointer _tmp10_;
	GtkTreePath* _tmp11_;
	GList* _tmp12_;
	GList* _tmp13_;
	gconstpointer _tmp14_;
	GtkTreePath* _tmp15_;
	g_return_if_fail (self != NULL);
	__vala_GtkTreePath_free0 (_vala_last);
	_vala_last = NULL;
	_tmp0_ = _vala_last;
	_tmp1_ = __vala_GtkTreePath_copy0 (_tmp0_);
	__vala_GtkTreePath_free0 (_vala_first);
	_vala_first = _tmp1_;
	_tmp2_ = self->tree;
	_tmp3_ = gtk_icon_view_get_selected_items (_tmp2_);
	selected_paths = _tmp3_;
	_tmp5_ = selected_paths;
	if (_tmp5_ == NULL) {
		_tmp4_ = TRUE;
	} else {
		GList* _tmp6_;
		GList* _tmp7_;
		_tmp6_ = selected_paths;
		_tmp7_ = g_list_first (_tmp6_);
		_tmp4_ = _tmp7_ == NULL;
	}
	if (_tmp4_) {
		(selected_paths == NULL) ? NULL : (selected_paths = (_g_list_free___vala_GtkTreePath_free0_ (selected_paths), NULL));
		if (first) {
			*first = _vala_first;
		} else {
			__vala_GtkTreePath_free0 (_vala_first);
		}
		if (last) {
			*last = _vala_last;
		} else {
			__vala_GtkTreePath_free0 (_vala_last);
		}
		return;
	}
	selected_paths = g_list_sort (selected_paths, _gtk_tree_path_compare_gcompare_func);
	_tmp8_ = selected_paths;
	_tmp9_ = g_list_first (_tmp8_);
	_tmp10_ = _tmp9_->data;
	_tmp11_ = __vala_GtkTreePath_copy0 ((GtkTreePath*) _tmp10_);
	__vala_GtkTreePath_free0 (_vala_first);
	_vala_first = _tmp11_;
	_tmp12_ = selected_paths;
	_tmp13_ = g_list_last (_tmp12_);
	_tmp14_ = _tmp13_->data;
	_tmp15_ = __vala_GtkTreePath_copy0 ((GtkTreePath*) _tmp14_);
	__vala_GtkTreePath_free0 (_vala_last);
	_vala_last = _tmp15_;
	(selected_paths == NULL) ? NULL : (selected_paths = (_g_list_free___vala_GtkTreePath_free0_ (selected_paths), NULL));
	if (first) {
		*first = _vala_first;
	} else {
		__vala_GtkTreePath_free0 (_vala_first);
	}
	if (last) {
		*last = _vala_last;
	} else {
		__vala_GtkTreePath_free0 (_vala_last);
	}
}

static GtkTreePath*
files_icon_view_real_up (FilesAbstractDirectoryView* base,
                         GtkTreePath* path)
{
	FilesIconView * self;
	gint item_row = 0;
	GtkIconView* _tmp0_;
	gint cols = 0;
	gint index = 0;
	gint _tmp2_ = 0;
	gint* _tmp3_;
	gint _tmp4_;
	GtkTreeIter* iter = NULL;
	GtkTreePath* new_path = NULL;
	GtkTreePath* _tmp5_;
	GtkIconView* _tmp6_;
	GtkTreeModel* _tmp7_;
	GtkTreeModel* _tmp8_;
	GtkTreePath* _tmp9_;
	GtkTreeIter _tmp10_ = {0};
	gboolean _tmp11_;
	GtkTreeIter _tmp12_;
	GtkTreeIter* _tmp13_;
	GtkTreePath* result;
	self = (FilesIconView*) base;
	g_return_val_if_fail (path != NULL, NULL);
	_tmp0_ = self->tree;
	item_row = gtk_icon_view_get_item_row (_tmp0_, path);
	if (item_row == 0) {
		GtkTreePath* _tmp1_;
		_tmp1_ = __vala_GtkTreePath_copy0 (path);
		result = _tmp1_;
		return result;
	}
	cols = files_icon_view_get_n_cols (self);
	_tmp3_ = gtk_tree_path_get_indices_with_depth (path, &_tmp2_);
	_tmp4_ = _tmp3_[0];
	index = _tmp4_;
	iter = NULL;
	_tmp5_ = gtk_tree_path_new_from_indices (index - cols, -1, -1);
	new_path = _tmp5_;
	_tmp6_ = self->tree;
	_tmp7_ = gtk_icon_view_get_model (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = new_path;
	_tmp11_ = gtk_tree_model_get_iter (_tmp8_, &_tmp10_, _tmp9_);
	__vala_GtkTreeIter_free0 (iter);
	_tmp12_ = _tmp10_;
	_tmp13_ = __vala_GtkTreeIter_copy0 (&_tmp12_);
	iter = _tmp13_;
	if (_tmp11_) {
		result = new_path;
		__vala_GtkTreeIter_free0 (iter);
		return result;
	} else {
		GtkTreePath* _tmp14_;
		_tmp14_ = __vala_GtkTreePath_copy0 (path);
		result = _tmp14_;
		__vala_GtkTreePath_free0 (new_path);
		__vala_GtkTreeIter_free0 (iter);
		return result;
	}
}

static GtkTreePath*
files_icon_view_real_down (FilesAbstractDirectoryView* base,
                           GtkTreePath* path)
{
	FilesIconView * self;
	gint cols = 0;
	gint index = 0;
	gint _tmp0_ = 0;
	gint* _tmp1_;
	gint _tmp2_;
	gint idx = 0;
	FilesListModel* _tmp3_;
	GtkTreeIter* iter = NULL;
	GtkTreePath* new_path = NULL;
	GtkTreePath* _tmp4_;
	GtkIconView* _tmp5_;
	GtkTreeModel* _tmp6_;
	GtkTreeModel* _tmp7_;
	GtkTreePath* _tmp8_;
	GtkTreeIter _tmp9_ = {0};
	gboolean _tmp10_;
	GtkTreeIter _tmp11_;
	GtkTreeIter* _tmp12_;
	GtkTreePath* result;
	self = (FilesIconView*) base;
	g_return_val_if_fail (path != NULL, NULL);
	cols = files_icon_view_get_n_cols (self);
	_tmp1_ = gtk_tree_path_get_indices_with_depth (path, &_tmp0_);
	_tmp2_ = _tmp1_[0];
	index = _tmp2_;
	_tmp3_ = ((FilesAbstractDirectoryView*) self)->model;
	idx = CLAMP (index + cols, 0, (gint) (files_list_model_get_length (_tmp3_) - 1));
	iter = NULL;
	_tmp4_ = gtk_tree_path_new_from_indices (idx, -1, -1);
	new_path = _tmp4_;
	_tmp5_ = self->tree;
	_tmp6_ = gtk_icon_view_get_model (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = new_path;
	_tmp10_ = gtk_tree_model_get_iter (_tmp7_, &_tmp9_, _tmp8_);
	__vala_GtkTreeIter_free0 (iter);
	_tmp11_ = _tmp9_;
	_tmp12_ = __vala_GtkTreeIter_copy0 (&_tmp11_);
	iter = _tmp12_;
	if (_tmp10_) {
		result = new_path;
		__vala_GtkTreeIter_free0 (iter);
		return result;
	} else {
		GtkTreePath* _tmp13_;
		_tmp13_ = __vala_GtkTreePath_copy0 (path);
		result = _tmp13_;
		__vala_GtkTreePath_free0 (new_path);
		__vala_GtkTreeIter_free0 (iter);
		return result;
	}
}

static gint
files_icon_view_get_n_cols (FilesIconView* self)
{
	GtkTreePath* path = NULL;
	GtkTreePath* _tmp0_;
	gint index = 0;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	_tmp0_ = gtk_tree_path_new_from_indices (0, -1, -1);
	path = _tmp0_;
	index = 0;
	while (TRUE) {
		GtkIconView* _tmp1_;
		GtkTreePath* _tmp2_;
		gint _tmp3_;
		GtkTreePath* _tmp4_;
		_tmp1_ = self->tree;
		_tmp2_ = path;
		if (!(gtk_icon_view_get_item_row (_tmp1_, _tmp2_) == 0)) {
			break;
		}
		_tmp3_ = index;
		index = _tmp3_ + 1;
		_tmp4_ = path;
		gtk_tree_path_next (_tmp4_);
	}
	result = index;
	__vala_GtkTreePath_free0 (path);
	return result;
}

static void
files_icon_view_class_init (FilesIconViewClass * klass,
                            gpointer klass_data)
{
	files_icon_view_parent_class = g_type_class_peek_parent (klass);
	((FilesAbstractDirectoryViewClass *) klass)->connect_tree_signals = (void (*) (FilesAbstractDirectoryView*)) files_icon_view_real_connect_tree_signals;
	((FilesAbstractDirectoryViewClass *) klass)->disconnect_tree_signals = (void (*) (FilesAbstractDirectoryView*)) files_icon_view_real_disconnect_tree_signals;
	((FilesAbstractDirectoryViewClass *) klass)->create_view = (GtkWidget* (*) (FilesAbstractDirectoryView*)) files_icon_view_real_create_view;
	((FilesAbstractDirectoryViewClass *) klass)->get_view_settings = (GSettings* (*) (FilesAbstractDirectoryView*)) files_icon_view_real_get_view_settings;
	((FilesAbstractDirectoryViewClass *) klass)->change_zoom_level = (void (*) (FilesAbstractDirectoryView*)) files_icon_view_real_change_zoom_level;
	((FilesAbstractDirectoryViewClass *) klass)->get_selected_paths = (GList* (*) (FilesAbstractDirectoryView*)) files_icon_view_real_get_selected_paths;
	((FilesAbstractDirectoryViewClass *) klass)->highlight_path = (void (*) (FilesAbstractDirectoryView*, GtkTreePath*)) files_icon_view_real_highlight_path;
	((FilesAbstractDirectoryViewClass *) klass)->get_path_at_pos = (GtkTreePath* (*) (FilesAbstractDirectoryView*, gint, gint)) files_icon_view_real_get_path_at_pos;
	((FilesAbstractDirectoryViewClass *) klass)->tree_select_all = (void (*) (FilesAbstractDirectoryView*)) files_icon_view_real_tree_select_all;
	((FilesAbstractDirectoryViewClass *) klass)->tree_unselect_all = (void (*) (FilesAbstractDirectoryView*)) files_icon_view_real_tree_unselect_all;
	((FilesAbstractDirectoryViewClass *) klass)->tree_unselect_others = (void (*) (FilesAbstractDirectoryView*)) files_icon_view_real_tree_unselect_others;
	((FilesAbstractDirectoryViewClass *) klass)->select_path = (void (*) (FilesAbstractDirectoryView*, GtkTreePath*, gboolean)) files_icon_view_real_select_path;
	((FilesAbstractDirectoryViewClass *) klass)->unselect_path = (void (*) (FilesAbstractDirectoryView*, GtkTreePath*)) files_icon_view_real_unselect_path;
	((FilesAbstractDirectoryViewClass *) klass)->path_is_selected = (gboolean (*) (FilesAbstractDirectoryView*, GtkTreePath*)) files_icon_view_real_path_is_selected;
	((FilesAbstractDirectoryViewClass *) klass)->get_visible_range = (gboolean (*) (FilesAbstractDirectoryView*, GtkTreePath**, GtkTreePath**)) files_icon_view_real_get_visible_range;
	((FilesAbstractDirectoryViewClass *) klass)->get_event_position_info = (guint (*) (FilesAbstractDirectoryView*, gdouble, gdouble, GtkTreePath**, gboolean)) files_icon_view_real_get_event_position_info;
	((FilesAbstractDirectoryViewClass *) klass)->scroll_to_path = (void (*) (FilesAbstractDirectoryView*, GtkTreePath*, gboolean)) files_icon_view_real_scroll_to_path;
	((FilesAbstractDirectoryViewClass *) klass)->set_cursor_on_cell = (void (*) (FilesAbstractDirectoryView*, GtkTreePath*, GtkCellRenderer*, gboolean, gboolean)) files_icon_view_real_set_cursor_on_cell;
	((FilesAbstractDirectoryViewClass *) klass)->will_handle_button_press = (gboolean (*) (FilesAbstractDirectoryView*, gboolean, gboolean, gboolean)) files_icon_view_real_will_handle_button_press;
	((FilesAbstractDirectoryViewClass *) klass)->handle_multi_select = (gboolean (*) (FilesAbstractDirectoryView*, GtkTreePath*)) files_icon_view_real_handle_multi_select;
	((FilesAbstractDirectoryViewClass *) klass)->move_cursor = (gboolean (*) (FilesAbstractDirectoryView*, guint, gboolean, gboolean)) files_icon_view_real_move_cursor;
	((FilesAbstractDirectoryViewClass *) klass)->set_cursor = (void (*) (FilesAbstractDirectoryView*, GtkTreePath*, gboolean, gboolean, gboolean)) files_icon_view_real_set_cursor;
	((FilesAbstractDirectoryViewClass *) klass)->get_path_at_cursor = (GtkTreePath* (*) (FilesAbstractDirectoryView*)) files_icon_view_real_get_path_at_cursor;
	((FilesAbstractDirectoryViewClass *) klass)->freeze_tree = (void (*) (FilesAbstractDirectoryView*)) files_icon_view_real_freeze_tree;
	((FilesAbstractDirectoryViewClass *) klass)->thaw_tree = (void (*) (FilesAbstractDirectoryView*)) files_icon_view_real_thaw_tree;
	((FilesAbstractDirectoryViewClass *) klass)->freeze_child_notify = (void (*) (FilesAbstractDirectoryView*)) files_icon_view_real_freeze_child_notify;
	((FilesAbstractDirectoryViewClass *) klass)->thaw_child_notify = (void (*) (FilesAbstractDirectoryView*)) files_icon_view_real_thaw_child_notify;
	((FilesAbstractDirectoryViewClass *) klass)->up = (GtkTreePath* (*) (FilesAbstractDirectoryView*, GtkTreePath*)) files_icon_view_real_up;
	((FilesAbstractDirectoryViewClass *) klass)->down = (GtkTreePath* (*) (FilesAbstractDirectoryView*, GtkTreePath*)) files_icon_view_real_down;
	G_OBJECT_CLASS (klass)->finalize = files_icon_view_finalize;
}

static void
files_icon_view_instance_init (FilesIconView * self,
                               gpointer klass)
{
	self->previous_selection_was_linear = FALSE;
	self->previous_linear_selection_path = NULL;
	self->previous_linear_selection_direction = 0;
	self->linear_select_required = FALSE;
	self->most_recently_selected = NULL;
}

static void
files_icon_view_finalize (GObject * obj)
{
	FilesIconView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FILES_TYPE_ICON_VIEW, FilesIconView);
	g_debug ("IconView.vala:33: Icon View destruct");
	_g_object_unref0 (self->tree);
	__vala_GtkTreePath_free0 (self->previous_linear_selection_path);
	__vala_GtkTreePath_free0 (self->most_recently_selected);
	G_OBJECT_CLASS (files_icon_view_parent_class)->finalize (obj);
}

/***
    Copyright (c) 2015-2020 elementary LLC <https://elementary.io>

    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU Lesser General Public License version 3, as published
    by the Free Software Foundation.

    This program is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranties of
    MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
    PURPOSE. See the GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program. If not, see <http://www.gnu.org/licenses/>.

    Authors : Jeremy Wootten <jeremywootten@gmail.com>
***/
 G_GNUC_NO_INLINE static GType
files_icon_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FilesIconViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) files_icon_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FilesIconView), 0, (GInstanceInitFunc) files_icon_view_instance_init, NULL };
	GType files_icon_view_type_id;
	files_icon_view_type_id = g_type_register_static (FILES_TYPE_ABSTRACT_DIRECTORY_VIEW, "FilesIconView", &g_define_type_info, 0);
	return files_icon_view_type_id;
}

GType
files_icon_view_get_type (void)
{
	static volatile gsize files_icon_view_type_id__once = 0;
	if (g_once_init_enter (&files_icon_view_type_id__once)) {
		GType files_icon_view_type_id;
		files_icon_view_type_id = files_icon_view_get_type_once ();
		g_once_init_leave (&files_icon_view_type_id__once, files_icon_view_type_id);
	}
	return files_icon_view_type_id__once;
}

