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

/*
 * Copyright 2019 elementary, Inc. (https://elementary.io)
 * Copyright 2012-2014 Victor Martinez <victoreduardm@gmail.com>
 * SPDX-License-Identifier: LGPL-3.0-or-later
 */
/**
     * = WORKING INTERNALS =
     *
     * In order to offer a transparent Item-based API, and avoid the need of providing methods
     * to deal with items directly on the SourceList widget, it was decided to follow a monitor-like
     * implementation, where the source list permanently monitors its root item and any other
     * child item added to it. The task of monitoring the properties of the items has been
     * divided among different objects, as shown below:
     *
     * Monitored by: Object::method that receives the signals indicating the property change.
     * Applied by: Object::method that actually updates the tree to reflect the property changes
     *             (directly or indirectly, as in the case of the tree data model).
     *
     * ---------------------------------------------------------------------------------------------
     *   PROPERTY        |  MONITORED BY                     |  APPLIED BY
     * ---------------------------------------------------------------------------------------------
     * + Item            |                                   |
     *   - parent        | Not monitored                     | N/A
     *   - name          | DataModel::on_item_prop_changed   | Tree::name_cell_data_func
     *   - editable      | DataModel::on_item_prop_changed   | Queried when needed (See Tree::start_editing_item)
     *   - visible       | DataModel::on_item_prop_changed   | DataModel::filter_visible_func
     *   - icon          | DataModel::on_item_prop_changed   | Tree::icon_cell_data_func
     *   - activatable   | Same as @icon                     | Same as @icon
     * + ExpandableItem  |                                   |
     *   - collapsible   | DataModel::on_item_prop_changed   | Tree::update_expansion
     *                   |                                   | Tree::expander_cell_data_func
     *   - expanded      | Same as @collapsible              | Same as @collapsible
     * ---------------------------------------------------------------------------------------------
     * * Only automatic properties are monitored. ExpandableItem's additions/removals are handled by
     *   DataModel::add_item() and DataModel::remove_item()
     *
     * Other features:
     * - Sorting: this happens on the tree-model level (DataModel).
     */

#include "codecore.h"
#include <glib.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <glib-object.h>
#include <float.h>
#include <math.h>
#include <pango/pango.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <gee.h>
#include <gobject/gvaluecollector.h>
#include <cairo-gobject.h>

#define CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_ITEM_PARENT_NEEDS_UPDATE "item-parent-needs-update"
#define CODE_WIDGETS_SOURCE_LIST_CELL_RENDERER_ICON_ICON_SIZE GTK_ICON_SIZE_MENU
#define CODE_WIDGETS_SOURCE_LIST_TREE_DEFAULT_STYLESHEET "\n" \
"            .sidebar.badge {\n" \
"                border-radius: 10px;\n" \
"                border-width: 0;\n" \
"                padding: 1px 2px 1px 2px;\n" \
"                font-weight: bold;\n" \
"            }\n" \
"        "
#define CODE_WIDGETS_SOURCE_LIST_TREE_STYLE_PROP_LEVEL_INDENTATION "level-indentation"
#define CODE_WIDGETS_SOURCE_LIST_TREE_STYLE_PROP_LEFT_PADDING "left-padding"
#define CODE_WIDGETS_SOURCE_LIST_TREE_STYLE_PROP_EXPANDER_SPACING "expander-spacing"
#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

enum  {
	CODE_WIDGETS_SOURCE_LIST_SORTABLE_USER_MOVED_ITEM_SIGNAL,
	CODE_WIDGETS_SOURCE_LIST_SORTABLE_NUM_SIGNALS
};
static guint code_widgets_source_list_sortable_signals[CODE_WIDGETS_SOURCE_LIST_SORTABLE_NUM_SIGNALS] = {0};

#define CODE_WIDGETS_SOURCE_LIST_TYPE_TREE (code_widgets_source_list_tree_get_type ())
#define CODE_WIDGETS_SOURCE_LIST_TREE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CODE_WIDGETS_SOURCE_LIST_TYPE_TREE, CodeWidgetsSourceListTree))
#define CODE_WIDGETS_SOURCE_LIST_TREE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CODE_WIDGETS_SOURCE_LIST_TYPE_TREE, CodeWidgetsSourceListTreeClass))
#define CODE_WIDGETS_SOURCE_LIST_IS_TREE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CODE_WIDGETS_SOURCE_LIST_TYPE_TREE))
#define CODE_WIDGETS_SOURCE_LIST_IS_TREE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CODE_WIDGETS_SOURCE_LIST_TYPE_TREE))
#define CODE_WIDGETS_SOURCE_LIST_TREE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CODE_WIDGETS_SOURCE_LIST_TYPE_TREE, CodeWidgetsSourceListTreeClass))

typedef struct _CodeWidgetsSourceListTree CodeWidgetsSourceListTree;
typedef struct _CodeWidgetsSourceListTreeClass CodeWidgetsSourceListTreeClass;

#define CODE_WIDGETS_SOURCE_LIST_TYPE_DATA_MODEL (code_widgets_source_list_data_model_get_type ())
#define CODE_WIDGETS_SOURCE_LIST_DATA_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CODE_WIDGETS_SOURCE_LIST_TYPE_DATA_MODEL, CodeWidgetsSourceListDataModel))
#define CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CODE_WIDGETS_SOURCE_LIST_TYPE_DATA_MODEL, CodeWidgetsSourceListDataModelClass))
#define CODE_WIDGETS_SOURCE_LIST_IS_DATA_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CODE_WIDGETS_SOURCE_LIST_TYPE_DATA_MODEL))
#define CODE_WIDGETS_SOURCE_LIST_IS_DATA_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CODE_WIDGETS_SOURCE_LIST_TYPE_DATA_MODEL))
#define CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CODE_WIDGETS_SOURCE_LIST_TYPE_DATA_MODEL, CodeWidgetsSourceListDataModelClass))

typedef struct _CodeWidgetsSourceListDataModel CodeWidgetsSourceListDataModel;
typedef struct _CodeWidgetsSourceListDataModelClass CodeWidgetsSourceListDataModelClass;
enum  {
	CODE_WIDGETS_SOURCE_LIST_0_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_ROOT_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_SELECTED_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_ELLIPSIZE_MODE_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_EDITING_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_ACTIVATE_ON_SINGLE_CLICK_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_NUM_PROPERTIES
};
static GParamSpec* code_widgets_source_list_properties[CODE_WIDGETS_SOURCE_LIST_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)))
#define __vala_GtkTreeIter_free0(var) ((var == NULL) ? NULL : (var = (_vala_GtkTreeIter_free (var), NULL)))
enum  {
	CODE_WIDGETS_SOURCE_LIST_ITEM_0_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_ITEM_PARENT_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_ITEM_NAME_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_ITEM_TOOLTIP_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_ITEM_MARKUP_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_ITEM_BADGE_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_ITEM_EDITABLE_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_ITEM_VISIBLE_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_ITEM_SELECTABLE_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_ITEM_ICON_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_ITEM_ACTIVATABLE_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_ITEM_ACTIVATABLE_TOOLTIP_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_ITEM_NUM_PROPERTIES
};
static GParamSpec* code_widgets_source_list_item_properties[CODE_WIDGETS_SOURCE_LIST_ITEM_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	CODE_WIDGETS_SOURCE_LIST_ITEM_EDITED_SIGNAL,
	CODE_WIDGETS_SOURCE_LIST_ITEM_ACTION_ACTIVATED_SIGNAL,
	CODE_WIDGETS_SOURCE_LIST_ITEM_ACTIVATED_SIGNAL,
	CODE_WIDGETS_SOURCE_LIST_ITEM_NUM_SIGNALS
};
static guint code_widgets_source_list_item_signals[CODE_WIDGETS_SOURCE_LIST_ITEM_NUM_SIGNALS] = {0};
enum  {
	CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_0_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_COLLAPSIBLE_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_EXPANDED_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_N_CHILDREN_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_CHILDREN_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_NUM_PROPERTIES
};
static GParamSpec* code_widgets_source_list_expandable_item_properties[CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_NUM_PROPERTIES];
enum  {
	CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_CHILD_ADDED_SIGNAL,
	CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_CHILD_REMOVED_SIGNAL,
	CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_TOGGLED_SIGNAL,
	CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_NUM_SIGNALS
};
static guint code_widgets_source_list_expandable_item_signals[CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_NUM_SIGNALS] = {0};
typedef struct _CodeWidgetsSourceListDataModelPrivate CodeWidgetsSourceListDataModelPrivate;

#define CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_NODE_WRAPPER (code_widgets_source_list_data_model_node_wrapper_get_type ())
#define CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_NODE_WRAPPER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_NODE_WRAPPER, CodeWidgetsSourceListDataModelNodeWrapper))
#define CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_NODE_WRAPPER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_NODE_WRAPPER, CodeWidgetsSourceListDataModelNodeWrapperClass))
#define CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_IS_NODE_WRAPPER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_NODE_WRAPPER))
#define CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_IS_NODE_WRAPPER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_NODE_WRAPPER))
#define CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_NODE_WRAPPER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_NODE_WRAPPER, CodeWidgetsSourceListDataModelNodeWrapperClass))

typedef struct _CodeWidgetsSourceListDataModelNodeWrapper CodeWidgetsSourceListDataModelNodeWrapper;
typedef struct _CodeWidgetsSourceListDataModelNodeWrapperClass CodeWidgetsSourceListDataModelNodeWrapperClass;

#define CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_ITEM_MONITOR (code_widgets_source_list_data_model_item_monitor_get_type ())
#define CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_ITEM_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_ITEM_MONITOR, CodeWidgetsSourceListDataModelItemMonitor))
#define CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_ITEM_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_ITEM_MONITOR, CodeWidgetsSourceListDataModelItemMonitorClass))
#define CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_IS_ITEM_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_ITEM_MONITOR))
#define CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_IS_ITEM_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_ITEM_MONITOR))
#define CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_ITEM_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_ITEM_MONITOR, CodeWidgetsSourceListDataModelItemMonitorClass))

typedef struct _CodeWidgetsSourceListDataModelItemMonitor CodeWidgetsSourceListDataModelItemMonitor;
typedef struct _CodeWidgetsSourceListDataModelItemMonitorClass CodeWidgetsSourceListDataModelItemMonitorClass;
enum  {
	CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_0_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_ROOT_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_NUM_PROPERTIES
};
static GParamSpec* code_widgets_source_list_data_model_properties[CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_NUM_PROPERTIES];
typedef enum  {
	CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_COLUMN_ITEM,
	CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_COLUMN_N_COLUMNS
} CodeWidgetsSourceListDataModelColumn;

#define CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_COLUMN (code_widgets_source_list_data_model_column_get_type ())
#define _code_widgets_source_list_data_model_node_wrapper_unref0(var) ((var == NULL) ? NULL : (var = (code_widgets_source_list_data_model_node_wrapper_unref (var), NULL)))
#define _code_widgets_source_list_data_model_item_monitor_unref0(var) ((var == NULL) ? NULL : (var = (code_widgets_source_list_data_model_item_monitor_unref (var), NULL)))
typedef struct _Block57Data Block57Data;
typedef struct _CodeWidgetsSourceListDataModelNodeWrapperPrivate CodeWidgetsSourceListDataModelNodeWrapperPrivate;
#define __vala_GtkTreeRowReference_free0(var) ((var == NULL) ? NULL : (var = (_vala_GtkTreeRowReference_free (var), NULL)))
typedef struct _CodeWidgetsSourceListDataModelParamSpecNodeWrapper CodeWidgetsSourceListDataModelParamSpecNodeWrapper;
typedef struct _CodeWidgetsSourceListDataModelItemMonitorPrivate CodeWidgetsSourceListDataModelItemMonitorPrivate;
typedef struct _CodeWidgetsSourceListDataModelParamSpecItemMonitor CodeWidgetsSourceListDataModelParamSpecItemMonitor;
enum  {
	CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_ITEM_MONITOR_CHANGED_SIGNAL,
	CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_ITEM_MONITOR_NUM_SIGNALS
};
static guint code_widgets_source_list_data_model_item_monitor_signals[CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_ITEM_MONITOR_NUM_SIGNALS] = {0};
enum  {
	CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_ITEM_UPDATED_SIGNAL,
	CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_NUM_SIGNALS
};
static guint code_widgets_source_list_data_model_signals[CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_NUM_SIGNALS] = {0};

#define CODE_WIDGETS_SOURCE_LIST_TYPE_CELL_RENDERER_ICON (code_widgets_source_list_cell_renderer_icon_get_type ())
#define CODE_WIDGETS_SOURCE_LIST_CELL_RENDERER_ICON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CODE_WIDGETS_SOURCE_LIST_TYPE_CELL_RENDERER_ICON, CodeWidgetsSourceListCellRendererIcon))
#define CODE_WIDGETS_SOURCE_LIST_CELL_RENDERER_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CODE_WIDGETS_SOURCE_LIST_TYPE_CELL_RENDERER_ICON, CodeWidgetsSourceListCellRendererIconClass))
#define CODE_WIDGETS_SOURCE_LIST_IS_CELL_RENDERER_ICON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CODE_WIDGETS_SOURCE_LIST_TYPE_CELL_RENDERER_ICON))
#define CODE_WIDGETS_SOURCE_LIST_IS_CELL_RENDERER_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CODE_WIDGETS_SOURCE_LIST_TYPE_CELL_RENDERER_ICON))
#define CODE_WIDGETS_SOURCE_LIST_CELL_RENDERER_ICON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CODE_WIDGETS_SOURCE_LIST_TYPE_CELL_RENDERER_ICON, CodeWidgetsSourceListCellRendererIconClass))

typedef struct _CodeWidgetsSourceListCellRendererIcon CodeWidgetsSourceListCellRendererIcon;
typedef struct _CodeWidgetsSourceListCellRendererIconClass CodeWidgetsSourceListCellRendererIconClass;
typedef struct _CodeWidgetsSourceListCellRendererIconPrivate CodeWidgetsSourceListCellRendererIconPrivate;
enum  {
	CODE_WIDGETS_SOURCE_LIST_CELL_RENDERER_ICON_0_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_CELL_RENDERER_ICON_NUM_PROPERTIES
};
static GParamSpec* code_widgets_source_list_cell_renderer_icon_properties[CODE_WIDGETS_SOURCE_LIST_CELL_RENDERER_ICON_NUM_PROPERTIES];
enum  {
	CODE_WIDGETS_SOURCE_LIST_CELL_RENDERER_ICON_ACTIVATED_SIGNAL,
	CODE_WIDGETS_SOURCE_LIST_CELL_RENDERER_ICON_NUM_SIGNALS
};
static guint code_widgets_source_list_cell_renderer_icon_signals[CODE_WIDGETS_SOURCE_LIST_CELL_RENDERER_ICON_NUM_SIGNALS] = {0};

#define CODE_WIDGETS_SOURCE_LIST_TYPE_CELL_RENDERER_SPACER (code_widgets_source_list_cell_renderer_spacer_get_type ())
#define CODE_WIDGETS_SOURCE_LIST_CELL_RENDERER_SPACER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CODE_WIDGETS_SOURCE_LIST_TYPE_CELL_RENDERER_SPACER, CodeWidgetsSourceListCellRendererSpacer))
#define CODE_WIDGETS_SOURCE_LIST_CELL_RENDERER_SPACER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CODE_WIDGETS_SOURCE_LIST_TYPE_CELL_RENDERER_SPACER, CodeWidgetsSourceListCellRendererSpacerClass))
#define CODE_WIDGETS_SOURCE_LIST_IS_CELL_RENDERER_SPACER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CODE_WIDGETS_SOURCE_LIST_TYPE_CELL_RENDERER_SPACER))
#define CODE_WIDGETS_SOURCE_LIST_IS_CELL_RENDERER_SPACER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CODE_WIDGETS_SOURCE_LIST_TYPE_CELL_RENDERER_SPACER))
#define CODE_WIDGETS_SOURCE_LIST_CELL_RENDERER_SPACER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CODE_WIDGETS_SOURCE_LIST_TYPE_CELL_RENDERER_SPACER, CodeWidgetsSourceListCellRendererSpacerClass))

typedef struct _CodeWidgetsSourceListCellRendererSpacer CodeWidgetsSourceListCellRendererSpacer;
typedef struct _CodeWidgetsSourceListCellRendererSpacerClass CodeWidgetsSourceListCellRendererSpacerClass;
typedef struct _CodeWidgetsSourceListCellRendererSpacerPrivate CodeWidgetsSourceListCellRendererSpacerPrivate;
enum  {
	CODE_WIDGETS_SOURCE_LIST_CELL_RENDERER_SPACER_0_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_CELL_RENDERER_SPACER_LEVEL_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_CELL_RENDERER_SPACER_NUM_PROPERTIES
};
static GParamSpec* code_widgets_source_list_cell_renderer_spacer_properties[CODE_WIDGETS_SOURCE_LIST_CELL_RENDERER_SPACER_NUM_PROPERTIES];
typedef struct _CodeWidgetsSourceListTreePrivate CodeWidgetsSourceListTreePrivate;
enum  {
	CODE_WIDGETS_SOURCE_LIST_TREE_0_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_TREE_DATA_MODEL_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_TREE_SELECTED_ITEM_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_TREE_EDITING_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_TREE_ELLIPSIZE_MODE_PROPERTY,
	CODE_WIDGETS_SOURCE_LIST_TREE_NUM_PROPERTIES
};
static GParamSpec* code_widgets_source_list_tree_properties[CODE_WIDGETS_SOURCE_LIST_TREE_NUM_PROPERTIES];
typedef enum  {
	CODE_WIDGETS_SOURCE_LIST_TREE_COLUMN_ITEM,
	CODE_WIDGETS_SOURCE_LIST_TREE_COLUMN_N_COLS
} CodeWidgetsSourceListTreeColumn;

#define CODE_WIDGETS_SOURCE_LIST_TREE_TYPE_COLUMN (code_widgets_source_list_tree_column_get_type ())
#define _gtk_target_list_unref0(var) ((var == NULL) ? NULL : (var = (gtk_target_list_unref (var), NULL)))
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_param_spec_unref0(var) ((var == NULL) ? NULL : (var = (g_param_spec_unref (var), NULL)))
enum  {
	CODE_WIDGETS_SOURCE_LIST_TREE_ITEM_SELECTED_SIGNAL,
	CODE_WIDGETS_SOURCE_LIST_TREE_NUM_SIGNALS
};
static guint code_widgets_source_list_tree_signals[CODE_WIDGETS_SOURCE_LIST_TREE_NUM_SIGNALS] = {0};
enum  {
	CODE_WIDGETS_SOURCE_LIST_ITEM_SELECTED_SIGNAL,
	CODE_WIDGETS_SOURCE_LIST_NUM_SIGNALS
};
static guint code_widgets_source_list_signals[CODE_WIDGETS_SOURCE_LIST_NUM_SIGNALS] = {0};
#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 _CodeWidgetsSourceListPrivate {
	CodeWidgetsSourceListTree* tree;
	CodeWidgetsSourceListDataModel* data_model;
};

struct _CodeWidgetsSourceListItemPrivate {
	CodeWidgetsSourceListExpandableItem* _parent;
	gchar* _name;
	gchar* _tooltip;
	gchar* _markup;
	gchar* _badge;
	gboolean _editable;
	gboolean _visible;
	gboolean _selectable;
	GIcon* _icon;
	GIcon* _activatable;
	gchar* _activatable_tooltip;
};

struct _CodeWidgetsSourceListExpandableItemPrivate {
	gboolean _collapsible;
	gboolean _expanded;
	GeeCollection* children_list;
};

struct _CodeWidgetsSourceListDataModel {
	GtkTreeModelFilter parent_instance;
	CodeWidgetsSourceListDataModelPrivate * priv;
};

struct _CodeWidgetsSourceListDataModelClass {
	GtkTreeModelFilterClass parent_class;
};

struct _CodeWidgetsSourceListDataModelPrivate {
	CodeWidgetsSourceListExpandableItem* _root;
	GeeHashMap* items;
	GeeHashMap* monitors;
	GtkTreeStore* child_tree;
	CodeWidgetsSourceListVisibleFunc filter_func;
	gpointer filter_func_target;
};

struct _Block57Data {
	int _ref_count_;
	CodeWidgetsSourceListDataModel* self;
	CodeWidgetsSourceListExpandableItem* parent;
};

struct _CodeWidgetsSourceListDataModelNodeWrapper {
	GTypeInstance parent_instance;
	volatile int ref_count;
	CodeWidgetsSourceListDataModelNodeWrapperPrivate * priv;
};

struct _CodeWidgetsSourceListDataModelNodeWrapperClass {
	GTypeClass parent_class;
	void (*finalize) (CodeWidgetsSourceListDataModelNodeWrapper *self);
};

struct _CodeWidgetsSourceListDataModelNodeWrapperPrivate {
	GtkTreeRowReference* row_reference;
};

struct _CodeWidgetsSourceListDataModelParamSpecNodeWrapper {
	GParamSpec parent_instance;
};

struct _CodeWidgetsSourceListDataModelItemMonitor {
	GTypeInstance parent_instance;
	volatile int ref_count;
	CodeWidgetsSourceListDataModelItemMonitorPrivate * priv;
};

struct _CodeWidgetsSourceListDataModelItemMonitorClass {
	GTypeClass parent_class;
	void (*finalize) (CodeWidgetsSourceListDataModelItemMonitor *self);
};

struct _CodeWidgetsSourceListDataModelItemMonitorPrivate {
	CodeWidgetsSourceListItem* item;
};

struct _CodeWidgetsSourceListDataModelParamSpecItemMonitor {
	GParamSpec parent_instance;
};

struct _CodeWidgetsSourceListCellRendererIcon {
	GtkCellRendererPixbuf parent_instance;
	CodeWidgetsSourceListCellRendererIconPrivate * priv;
};

struct _CodeWidgetsSourceListCellRendererIconClass {
	GtkCellRendererPixbufClass parent_class;
};

struct _CodeWidgetsSourceListCellRendererSpacer {
	GtkCellRenderer parent_instance;
	CodeWidgetsSourceListCellRendererSpacerPrivate * priv;
};

struct _CodeWidgetsSourceListCellRendererSpacerClass {
	GtkCellRendererClass parent_class;
};

struct _CodeWidgetsSourceListCellRendererSpacerPrivate {
	gint _level;
};

struct _CodeWidgetsSourceListTree {
	GtkTreeView parent_instance;
	CodeWidgetsSourceListTreePrivate * priv;
};

struct _CodeWidgetsSourceListTreeClass {
	GtkTreeViewClass parent_class;
};

struct _CodeWidgetsSourceListTreePrivate {
	CodeWidgetsSourceListDataModel* _data_model;
	CodeWidgetsSourceListItem* selected;
	CodeWidgetsSourceListItem* edited;
	GtkEntry* editable_entry;
	GtkCellRendererText* text_cell;
	GtkEventControllerKey* key_controller;
	CodeWidgetsSourceListCellRendererIcon* icon_cell;
	CodeWidgetsSourceListCellRendererIcon* activatable_cell;
	CodeWidgetsCellRendererBadge* badge_cell;
	CodeWidgetsCellRendererExpander* primary_expander_cell;
	CodeWidgetsCellRendererExpander* secondary_expander_cell;
	GeeHashMap* spacer_cells;
	gboolean unselectable_item_clicked;
};

static gint CodeWidgetsSourceList_private_offset;
static gpointer code_widgets_source_list_parent_class = NULL;
static gint CodeWidgetsSourceListItem_private_offset;
static gpointer code_widgets_source_list_item_parent_class = NULL;
static gint CodeWidgetsSourceListExpandableItem_private_offset;
static gpointer code_widgets_source_list_expandable_item_parent_class = NULL;
static gint CodeWidgetsSourceListDataModel_private_offset;
static gpointer code_widgets_source_list_data_model_parent_class = NULL;
static gint CodeWidgetsSourceListDataModelNodeWrapper_private_offset;
static gpointer code_widgets_source_list_data_model_node_wrapper_parent_class = NULL;
static gint CodeWidgetsSourceListDataModelItemMonitor_private_offset;
static gpointer code_widgets_source_list_data_model_item_monitor_parent_class = NULL;
static GtkTreeDragSourceIface * code_widgets_source_list_data_model_gtk_tree_drag_source_parent_iface = NULL;
static GtkTreeDragDestIface * code_widgets_source_list_data_model_gtk_tree_drag_dest_parent_iface = NULL;
static gpointer code_widgets_source_list_cell_renderer_icon_parent_class = NULL;
static gint CodeWidgetsSourceListCellRendererSpacer_private_offset;
static gpointer code_widgets_source_list_cell_renderer_spacer_parent_class = NULL;
static gint CodeWidgetsSourceListTree_private_offset;
static gpointer code_widgets_source_list_tree_parent_class = NULL;

static GType code_widgets_source_list_sortable_get_type_once (void);
static GType code_widgets_source_list_drag_source_get_type_once (void);
static GType code_widgets_source_list_drag_dest_get_type_once (void);
static GType code_widgets_source_list_tree_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static GType code_widgets_source_list_data_model_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static CodeWidgetsSourceListDataModel* code_widgets_source_list_data_model_new (void);
static CodeWidgetsSourceListDataModel* code_widgets_source_list_data_model_construct (GType object_type);
static gboolean code_widgets_source_list_data_model_has_item (CodeWidgetsSourceListDataModel* self,
                                                       CodeWidgetsSourceListItem* item);
static void code_widgets_source_list_data_model_set_filter_func (CodeWidgetsSourceListDataModel* self,
                                                          CodeWidgetsSourceListVisibleFunc visible_func,
                                                          gpointer visible_func_target);
static GtkTreePath* code_widgets_source_list_data_model_get_item_path (CodeWidgetsSourceListDataModel* self,
                                                                CodeWidgetsSourceListItem* item);
static void _vala_GtkTreePath_free (GtkTreePath* self);
static gboolean code_widgets_source_list_tree_start_editing_item (CodeWidgetsSourceListTree* self,
                                                           CodeWidgetsSourceListItem* item);
static void code_widgets_source_list_tree_stop_editing (CodeWidgetsSourceListTree* self);
static void code_widgets_source_list_tree_configure_drag_source (CodeWidgetsSourceListTree* self,
                                                          GtkTargetEntry* src_entries,
                                                          gint src_entries_length1);
static void code_widgets_source_list_tree_configure_drag_dest (CodeWidgetsSourceListTree* self,
                                                        GtkTargetEntry* dest_entries,
                                                        gint dest_entries_length1,
                                                        GdkDragAction actions);
static gboolean code_widgets_source_list_tree_scroll_to_item (CodeWidgetsSourceListTree* self,
                                                       CodeWidgetsSourceListItem* item,
                                                       gboolean use_align,
                                                       gfloat row_align);
static GtkTreeIter* code_widgets_source_list_data_model_get_item_iter (CodeWidgetsSourceListDataModel* self,
                                                                CodeWidgetsSourceListItem* item);
static CodeWidgetsSourceListItem* code_widgets_source_list_data_model_get_item (CodeWidgetsSourceListDataModel* self,
                                                                         GtkTreeIter* iter);
static void _vala_GtkTreeIter_free (GtkTreeIter* self);
static CodeWidgetsSourceListItem* code_widgets_source_list_get_nth_child (CodeWidgetsSourceList* self,
                                                                   CodeWidgetsSourceListExpandableItem* parent,
                                                                   gint index);
static CodeWidgetsSourceListExpandableItem* code_widgets_source_list_data_model_get_root (CodeWidgetsSourceListDataModel* self);
static void code_widgets_source_list_data_model_set_root (CodeWidgetsSourceListDataModel* self,
                                                   CodeWidgetsSourceListExpandableItem* value);
static CodeWidgetsSourceListItem* code_widgets_source_list_tree_get_selected_item (CodeWidgetsSourceListTree* self);
static void code_widgets_source_list_tree_set_selected_item (CodeWidgetsSourceListTree* self,
                                                      CodeWidgetsSourceListItem* value);
static PangoEllipsizeMode code_widgets_source_list_tree_get_ellipsize_mode (CodeWidgetsSourceListTree* self);
static void code_widgets_source_list_tree_set_ellipsize_mode (CodeWidgetsSourceListTree* self,
                                                       PangoEllipsizeMode value);
static gboolean code_widgets_source_list_tree_get_editing (CodeWidgetsSourceListTree* self);
static void code_widgets_source_list_real_item_selected (CodeWidgetsSourceList* self,
                                                  CodeWidgetsSourceListItem* item);
static GMenu* code_widgets_source_list_item_real_get_context_menu (CodeWidgetsSourceListItem* self);
VALA_EXTERN void code_widgets_source_list_item_set_parent (CodeWidgetsSourceListItem* self,
                                               CodeWidgetsSourceListExpandableItem* value);
static void code_widgets_source_list_item_real_edited (CodeWidgetsSourceListItem* self,
                                                const gchar* new_name);
static void code_widgets_source_list_item_real_action_activated (CodeWidgetsSourceListItem* self);
static void code_widgets_source_list_item_real_activated (CodeWidgetsSourceListItem* self);
static void code_widgets_source_list_item_finalize (GObject * obj);
static GType code_widgets_source_list_item_get_type_once (void);
static void _vala_code_widgets_source_list_item_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec);
static void _vala_code_widgets_source_list_item_set_property (GObject * object,
                                                       guint property_id,
                                                       const GValue * value,
                                                       GParamSpec * pspec);
static void code_widgets_source_list_expandable_item_set_expansion (CodeWidgetsSourceListExpandableItem* item,
                                                             gboolean inclusive,
                                                             gboolean recursive,
                                                             gboolean expanded);
static void code_widgets_source_list_expandable_item_real_toggled (CodeWidgetsSourceListExpandableItem* self);
static GObject * code_widgets_source_list_expandable_item_constructor (GType type,
                                                                guint n_construct_properties,
                                                                GObjectConstructParam * construct_properties);
static void code_widgets_source_list_expandable_item_finalize (GObject * obj);
static GType code_widgets_source_list_expandable_item_get_type_once (void);
static void _vala_code_widgets_source_list_expandable_item_get_property (GObject * object,
                                                                  guint property_id,
                                                                  GValue * value,
                                                                  GParamSpec * pspec);
static void _vala_code_widgets_source_list_expandable_item_set_property (GObject * object,
                                                                  guint property_id,
                                                                  const GValue * value,
                                                                  GParamSpec * pspec);
static gpointer code_widgets_source_list_data_model_node_wrapper_ref (gpointer instance);
static void code_widgets_source_list_data_model_node_wrapper_unref (gpointer instance);
static GParamSpec* code_widgets_source_list_data_model_param_spec_node_wrapper (const gchar* name,
                                                                         const gchar* nick,
                                                                         const gchar* blurb,
                                                                         GType object_type,
                                                                         GParamFlags flags) G_GNUC_UNUSED ;
static void code_widgets_source_list_data_model_value_set_node_wrapper (GValue* value,
                                                                 gpointer v_object) G_GNUC_UNUSED ;
static void code_widgets_source_list_data_model_value_take_node_wrapper (GValue* value,
                                                                  gpointer v_object) G_GNUC_UNUSED ;
static gpointer code_widgets_source_list_data_model_value_get_node_wrapper (const GValue* value) G_GNUC_UNUSED ;
static GType code_widgets_source_list_data_model_node_wrapper_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static gpointer code_widgets_source_list_data_model_item_monitor_ref (gpointer instance);
static void code_widgets_source_list_data_model_item_monitor_unref (gpointer instance);
static GParamSpec* code_widgets_source_list_data_model_param_spec_item_monitor (const gchar* name,
                                                                         const gchar* nick,
                                                                         const gchar* blurb,
                                                                         GType object_type,
                                                                         GParamFlags flags) G_GNUC_UNUSED ;
static void code_widgets_source_list_data_model_value_set_item_monitor (GValue* value,
                                                                 gpointer v_object) G_GNUC_UNUSED ;
static void code_widgets_source_list_data_model_value_take_item_monitor (GValue* value,
                                                                  gpointer v_object) G_GNUC_UNUSED ;
static gpointer code_widgets_source_list_data_model_value_get_item_monitor (const GValue* value) G_GNUC_UNUSED ;
static GType code_widgets_source_list_data_model_item_monitor_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static GType code_widgets_source_list_data_model_column_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static GType code_widgets_source_list_data_model_column_type (CodeWidgetsSourceListDataModelColumn self);
static void code_widgets_source_list_data_model_update_item (CodeWidgetsSourceListDataModel* self,
                                                      CodeWidgetsSourceListItem* item);
static GtkTreePath* code_widgets_source_list_data_model_node_wrapper_get_path (CodeWidgetsSourceListDataModelNodeWrapper* self);
static GtkTreeIter* code_widgets_source_list_data_model_node_wrapper_get_iter (CodeWidgetsSourceListDataModelNodeWrapper* self);
static void code_widgets_source_list_data_model_add_item (CodeWidgetsSourceListDataModel* self,
                                                   CodeWidgetsSourceListItem* item);
static GtkTreeIter* code_widgets_source_list_data_model_get_item_child_iter (CodeWidgetsSourceListDataModel* self,
                                                                      CodeWidgetsSourceListItem* item);
static GtkTreeIter* _vala_GtkTreeIter_copy (GtkTreeIter* self);
static CodeWidgetsSourceListDataModelNodeWrapper* code_widgets_source_list_data_model_node_wrapper_new (GtkTreeModel* model,
                                                                                                 GtkTreeIter* iter);
static CodeWidgetsSourceListDataModelNodeWrapper* code_widgets_source_list_data_model_node_wrapper_construct (GType object_type,
                                                                                                       GtkTreeModel* model,
                                                                                                       GtkTreeIter* iter);
static void code_widgets_source_list_data_model_add_property_monitor (CodeWidgetsSourceListDataModel* self,
                                                               CodeWidgetsSourceListItem* item);
static void code_widgets_source_list_data_model_push_parent_update (CodeWidgetsSourceListDataModel* self,
                                                             CodeWidgetsSourceListExpandableItem* parent);
static void code_widgets_source_list_data_model_add_children_monitor (CodeWidgetsSourceListDataModel* self,
                                                               CodeWidgetsSourceListExpandableItem* item);
static void code_widgets_source_list_data_model_remove_item (CodeWidgetsSourceListDataModel* self,
                                                      CodeWidgetsSourceListItem* item);
static void code_widgets_source_list_data_model_remove_property_monitor (CodeWidgetsSourceListDataModel* self,
                                                                  CodeWidgetsSourceListItem* item);
static void code_widgets_source_list_data_model_remove_children_monitor (CodeWidgetsSourceListDataModel* self,
                                                                  CodeWidgetsSourceListExpandableItem* item);
static CodeWidgetsSourceListDataModelItemMonitor* code_widgets_source_list_data_model_item_monitor_new (CodeWidgetsSourceListItem* item);
static CodeWidgetsSourceListDataModelItemMonitor* code_widgets_source_list_data_model_item_monitor_construct (GType object_type,
                                                                                                       CodeWidgetsSourceListItem* item);
static void code_widgets_source_list_data_model_on_item_prop_changed (CodeWidgetsSourceListDataModel* self,
                                                               CodeWidgetsSourceListItem* item,
                                                               const gchar* prop_name);
static void _code_widgets_source_list_data_model_on_item_prop_changed_code_widgets_source_list_data_model_item_monitor_changed (CodeWidgetsSourceListDataModelItemMonitor* _sender,
                                                                                                                         CodeWidgetsSourceListItem* _self_,
                                                                                                                         const gchar* prop_name,
                                                                                                                         gpointer self);
static void code_widgets_source_list_data_model_on_item_child_added (CodeWidgetsSourceListDataModel* self,
                                                              CodeWidgetsSourceListItem* item);
static void _code_widgets_source_list_data_model_on_item_child_added_code_widgets_source_list_expandable_item_child_added (CodeWidgetsSourceListExpandableItem* _sender,
                                                                                                                    CodeWidgetsSourceListItem* item,
                                                                                                                    gpointer self);
static void code_widgets_source_list_data_model_on_item_child_removed (CodeWidgetsSourceListDataModel* self,
                                                                CodeWidgetsSourceListItem* item);
static void _code_widgets_source_list_data_model_on_item_child_removed_code_widgets_source_list_expandable_item_child_removed (CodeWidgetsSourceListExpandableItem* _sender,
                                                                                                                        CodeWidgetsSourceListItem* item,
                                                                                                                        gpointer self);
static Block57Data* block57_data_ref (Block57Data* _data57_);
static void block57_data_unref (void * _userdata_);
static gboolean ___lambda4_ (Block57Data* _data57_);
static gboolean ____lambda4__gsource_func (gpointer self);
static CodeWidgetsSourceListItem* code_widgets_source_list_data_model_get_item_from_path (CodeWidgetsSourceListDataModel* self,
                                                                                   GtkTreePath* path);
static GtkTreePath* code_widgets_source_list_data_model_get_item_child_path (CodeWidgetsSourceListDataModel* self,
                                                                      CodeWidgetsSourceListItem* item);
static gboolean code_widgets_source_list_data_model_is_category (CodeWidgetsSourceListDataModel* self,
                                                          CodeWidgetsSourceListItem* item,
                                                          GtkTreeIter* iter,
                                                          GtkTreePath* path);
static gboolean code_widgets_source_list_data_model_is_iter_at_root_level (CodeWidgetsSourceListDataModel* self,
                                                                    GtkTreeIter* iter);
static gboolean code_widgets_source_list_data_model_is_path_at_root_level (CodeWidgetsSourceListDataModel* self,
                                                                    GtkTreePath* path);
static void code_widgets_source_list_data_model_resort (CodeWidgetsSourceListDataModel* self);
static gint code_widgets_source_list_data_model_child_model_sort_func (CodeWidgetsSourceListDataModel* self,
                                                                GtkTreeModel* model,
                                                                GtkTreeIter* a,
                                                                GtkTreeIter* b);
static gboolean code_widgets_source_list_data_model_filter_visible_func (CodeWidgetsSourceListDataModel* self,
                                                                  GtkTreeModel* child_model,
                                                                  GtkTreeIter* iter);
static gboolean code_widgets_source_list_data_model_real_drag_data_received (GtkTreeDragDest* base,
                                                                      GtkTreePath* dest,
                                                                      GtkSelectionData* selection_data);
static gboolean code_widgets_source_list_data_model_child_tree_drag_data_received (CodeWidgetsSourceListDataModel* self,
                                                                            GtkTreePath* dest,
                                                                            GtkTreePath* src_path);
static GtkTreePath* _vala_GtkTreePath_copy (GtkTreePath* self);
static void code_widgets_source_list_data_model_recursive_node_copy (CodeWidgetsSourceListDataModel* self,
                                                              GtkTreeIter* src_iter,
                                                              GtkTreeIter* dest_iter);
static void code_widgets_source_list_data_model_move_item (CodeWidgetsSourceListDataModel* self,
                                                    GtkTreeIter* src_iter,
                                                    GtkTreeIter* dest_iter);
static gboolean code_widgets_source_list_data_model_real_row_drop_possible (GtkTreeDragDest* base,
                                                                     GtkTreePath* dest,
                                                                     GtkSelectionData* selection_data);
static gint* _vala_array_dup1 (gint* self,
                        gssize length);
static gint* _vala_array_dup2 (gint* self,
                        gssize length);
static gboolean code_widgets_source_list_data_model_real_drag_data_get (GtkTreeDragSource* base,
                                                                 GtkTreePath* path,
                                                                 GtkSelectionData* selection_data);
static gboolean code_widgets_source_list_data_model_real_row_draggable (GtkTreeDragSource* base,
                                                                 GtkTreePath* path);
static void _vala_GtkTreeRowReference_free (GtkTreeRowReference* self);
static gboolean code_widgets_source_list_data_model_node_wrapper_get_valid (CodeWidgetsSourceListDataModelNodeWrapper* self);
static void code_widgets_source_list_data_model_node_wrapper_finalize (CodeWidgetsSourceListDataModelNodeWrapper * obj);
static GType code_widgets_source_list_data_model_node_wrapper_get_type_once (void);
static void code_widgets_source_list_data_model_item_monitor_on_notify (CodeWidgetsSourceListDataModelItemMonitor* self,
                                                                 GParamSpec* prop);
static void _code_widgets_source_list_data_model_item_monitor_on_notify_g_object_notify (GObject* _sender,
                                                                                  GParamSpec* pspec,
                                                                                  gpointer self);
static void g_cclosure_user_marshal_VOID__OBJECT_STRING (GClosure * closure,
                                                  GValue * return_value,
                                                  guint n_param_values,
                                                  const GValue * param_values,
                                                  gpointer invocation_hint,
                                                  gpointer marshal_data);
static void code_widgets_source_list_data_model_item_monitor_finalize (CodeWidgetsSourceListDataModelItemMonitor * obj);
static GType code_widgets_source_list_data_model_item_monitor_get_type_once (void);
static GObject * code_widgets_source_list_data_model_constructor (GType type,
                                                           guint n_construct_properties,
                                                           GObjectConstructParam * construct_properties);
static gint _code_widgets_source_list_data_model_child_model_sort_func_gtk_tree_iter_compare_func (GtkTreeModel* model,
                                                                                            GtkTreeIter* a,
                                                                                            GtkTreeIter* b,
                                                                                            gpointer self);
static gboolean _code_widgets_source_list_data_model_filter_visible_func_gtk_tree_model_filter_visible_func (GtkTreeModel* model,
                                                                                                      GtkTreeIter* iter,
                                                                                                      gpointer self);
static void code_widgets_source_list_data_model_finalize (GObject * obj);
static GType code_widgets_source_list_data_model_get_type_once (void);
static void _vala_code_widgets_source_list_data_model_get_property (GObject * object,
                                                             guint property_id,
                                                             GValue * value,
                                                             GParamSpec * pspec);
static void _vala_code_widgets_source_list_data_model_set_property (GObject * object,
                                                             guint property_id,
                                                             const GValue * value,
                                                             GParamSpec * pspec);
static GType code_widgets_source_list_cell_renderer_icon_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static CodeWidgetsSourceListCellRendererIcon* code_widgets_source_list_cell_renderer_icon_new (void);
static CodeWidgetsSourceListCellRendererIcon* code_widgets_source_list_cell_renderer_icon_construct (GType object_type);
static gboolean code_widgets_source_list_cell_renderer_icon_real_activate (GtkCellRenderer* base,
                                                                    GdkEvent* event,
                                                                    GtkWidget* widget,
                                                                    const gchar* path,
                                                                    GdkRectangle* background_area,
                                                                    GdkRectangle* cell_area,
                                                                    GtkCellRendererState flags);
static GObject * code_widgets_source_list_cell_renderer_icon_constructor (GType type,
                                                                   guint n_construct_properties,
                                                                   GObjectConstructParam * construct_properties);
static GType code_widgets_source_list_cell_renderer_icon_get_type_once (void);
static GType code_widgets_source_list_cell_renderer_spacer_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static GtkSizeRequestMode code_widgets_source_list_cell_renderer_spacer_real_get_request_mode (GtkCellRenderer* base);
static void code_widgets_source_list_cell_renderer_spacer_real_get_preferred_width (GtkCellRenderer* base,
                                                                             GtkWidget* widget,
                                                                             gint* min_size,
                                                                             gint* natural_size);
static void code_widgets_source_list_cell_renderer_spacer_real_get_preferred_height_for_width (GtkCellRenderer* base,
                                                                                        GtkWidget* widget,
                                                                                        gint width,
                                                                                        gint* min_height,
                                                                                        gint* natural_height);
static void code_widgets_source_list_cell_renderer_spacer_real_render (GtkCellRenderer* base,
                                                                cairo_t* context,
                                                                GtkWidget* widget,
                                                                GdkRectangle* bg_area,
                                                                GdkRectangle* cell_area,
                                                                GtkCellRendererState flags);
static CodeWidgetsSourceListCellRendererSpacer* code_widgets_source_list_cell_renderer_spacer_new (void);
static CodeWidgetsSourceListCellRendererSpacer* code_widgets_source_list_cell_renderer_spacer_construct (GType object_type);
static gint code_widgets_source_list_cell_renderer_spacer_get_level (CodeWidgetsSourceListCellRendererSpacer* self);
static void code_widgets_source_list_cell_renderer_spacer_set_level (CodeWidgetsSourceListCellRendererSpacer* self,
                                                              gint value);
static void code_widgets_source_list_cell_renderer_spacer_finalize (GObject * obj);
static GType code_widgets_source_list_cell_renderer_spacer_get_type_once (void);
static void _vala_code_widgets_source_list_cell_renderer_spacer_get_property (GObject * object,
                                                                       guint property_id,
                                                                       GValue * value,
                                                                       GParamSpec * pspec);
static void _vala_code_widgets_source_list_cell_renderer_spacer_set_property (GObject * object,
                                                                       guint property_id,
                                                                       const GValue * value,
                                                                       GParamSpec * pspec);
static void code_widgets_source_list_tree_disable_item_property_monitor (CodeWidgetsSourceListTree* self);
static GType code_widgets_source_list_tree_column_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static CodeWidgetsSourceListTree* code_widgets_source_list_tree_new (CodeWidgetsSourceListDataModel* data_model);
static CodeWidgetsSourceListTree* code_widgets_source_list_tree_construct (GType object_type,
                                                                    CodeWidgetsSourceListDataModel* data_model);
static gboolean code_widgets_source_list_tree_real_drag_motion (GtkWidget* base,
                                                         GdkDragContext* context,
                                                         gint x,
                                                         gint y,
                                                         guint time);
static CodeWidgetsSourceListDataModel* code_widgets_source_list_tree_get_data_model (CodeWidgetsSourceListTree* self);
static void code_widgets_source_list_tree_real_drag_data_received (GtkWidget* base,
                                                            GdkDragContext* context,
                                                            gint x,
                                                            gint y,
                                                            GtkSelectionData* selection_data,
                                                            guint info,
                                                            guint time);
static GtkTargetEntry* code_widgets_source_list_tree_append_row_target_entry (GtkTargetEntry* orig,
                                                                       gint orig_length1,
                                                                       gint* result_length1);
static gboolean code_widgets_source_list_tree_on_query_tooltip (CodeWidgetsSourceListTree* self,
                                                         gint x,
                                                         gint y,
                                                         gboolean keyboard_tooltip,
                                                         GtkTooltip* tooltip);
static gboolean code_widgets_source_list_tree_over_cell (CodeWidgetsSourceListTree* self,
                                                  GtkTreeViewColumn* col,
                                                  GtkTreePath* path,
                                                  GtkCellRenderer* cell,
                                                  gint x);
static void _vala_array_add4 (GtkTargetEntry* * array,
                       gint* length,
                       gint* size,
                       const GtkTargetEntry* value);
static void _vala_array_add5 (GtkTargetEntry* * array,
                       gint* length,
                       gint* size,
                       const GtkTargetEntry* value);
static void code_widgets_source_list_tree_enable_item_property_monitor (CodeWidgetsSourceListTree* self);
static void code_widgets_source_list_tree_on_model_item_updated (CodeWidgetsSourceListTree* self,
                                                          CodeWidgetsSourceListItem* item);
static void _code_widgets_source_list_tree_on_model_item_updated_code_widgets_source_list_data_model_item_updated (CodeWidgetsSourceListDataModel* _sender,
                                                                                                            CodeWidgetsSourceListItem* item,
                                                                                                            gpointer self);
static void code_widgets_source_list_tree_update_expansion (CodeWidgetsSourceListTree* self,
                                                     CodeWidgetsSourceListExpandableItem* expandable_item);
static void code_widgets_source_list_tree_add_spacer_cell_for_level (CodeWidgetsSourceListTree* self,
                                                              gint level,
                                                              gboolean check_previous);
static void code_widgets_source_list_tree_spacer_cell_data_func (GtkCellLayout* layout,
                                                          GtkCellRenderer* renderer,
                                                          GtkTreeModel* model,
                                                          GtkTreeIter* iter);
static void _code_widgets_source_list_tree_spacer_cell_data_func_gtk_cell_layout_data_func (GtkCellLayout* cell_layout,
                                                                                     GtkCellRenderer* cell,
                                                                                     GtkTreeModel* tree_model,
                                                                                     GtkTreeIter* iter,
                                                                                     gpointer self);
static gboolean code_widgets_source_list_tree_select_func (CodeWidgetsSourceListTree* self,
                                                    GtkTreeSelection* selection,
                                                    GtkTreeModel* model,
                                                    GtkTreePath* path,
                                                    gboolean path_currently_selected);
static GtkTreePath* code_widgets_source_list_tree_get_selected_path (CodeWidgetsSourceListTree* self);
static void __vala_GtkTreePath_free0_ (gpointer var);
static inline void _g_list_free___vala_GtkTreePath_free0_ (GList* self);
static void code_widgets_source_list_tree_set_selected (CodeWidgetsSourceListTree* self,
                                                 CodeWidgetsSourceListItem* item,
                                                 gboolean scroll_to_item);
static void code_widgets_source_list_tree_real_cursor_changed (GtkTreeView* base);
static void code_widgets_source_list_tree_on_editing_started (CodeWidgetsSourceListTree* self,
                                                       GtkCellEditable* editable,
                                                       const gchar* path);
static void code_widgets_source_list_tree_on_editing_done (CodeWidgetsSourceListTree* self);
static void _code_widgets_source_list_tree_on_editing_done_gtk_cell_editable_editing_done (GtkCellEditable* _sender,
                                                                                    gpointer self);
static void code_widgets_source_list_tree_on_editing_canceled (CodeWidgetsSourceListTree* self);
static void code_widgets_source_list_tree_on_activatable_activated (CodeWidgetsSourceListTree* self,
                                                             const gchar* item_path_str);
static CodeWidgetsSourceListItem* code_widgets_source_list_tree_get_item_from_path_string (CodeWidgetsSourceListTree* self,
                                                                                    const gchar* item_path_str);
static gboolean code_widgets_source_list_tree_toggle_expansion (CodeWidgetsSourceListTree* self,
                                                         CodeWidgetsSourceListExpandableItem* item);
static void code_widgets_source_list_tree_real_row_expanded (GtkTreeView* base,
                                                      GtkTreeIter* iter,
                                                      GtkTreePath* path);
static void code_widgets_source_list_tree_real_row_collapsed (GtkTreeView* base,
                                                       GtkTreeIter* iter,
                                                       GtkTreePath* path);
static void code_widgets_source_list_tree_real_row_activated (GtkTreeView* base,
                                                       GtkTreePath* path,
                                                       GtkTreeViewColumn* column);
static void code_widgets_source_list_tree_on_key_released (CodeWidgetsSourceListTree* self,
                                                    guint keyval,
                                                    guint keycode,
                                                    GdkModifierType state);
static gboolean code_widgets_source_list_tree_real_button_release_event (GtkWidget* base,
                                                                  GdkEventButton* event);
static gboolean code_widgets_source_list_tree_real_button_press_event (GtkWidget* base,
                                                                GdkEventButton* event);
static gboolean code_widgets_source_list_tree_popup_context_menu (CodeWidgetsSourceListTree* self,
                                                           CodeWidgetsSourceListItem* item,
                                                           GdkEventButton* event);
static gboolean code_widgets_source_list_tree_over_primary_expander (CodeWidgetsSourceListTree* self,
                                                              GtkTreeViewColumn* col,
                                                              GtkTreePath* path,
                                                              gint x);
static void code_widgets_source_list_tree_expander_cell_data_func (CodeWidgetsSourceListTree* self,
                                                            GtkCellLayout* layout,
                                                            GtkCellRenderer* renderer,
                                                            GtkTreeModel* model,
                                                            GtkTreeIter* iter);
static gint code_widgets_source_list_tree_get_cell_width (CodeWidgetsSourceListTree* self,
                                                   GtkCellRenderer* cell_renderer);
static gboolean code_widgets_source_list_tree_real_popup_menu (GtkWidget* base);
static CodeWidgetsSourceListItem* code_widgets_source_list_tree_get_item_from_model (GtkTreeModel* model,
                                                                              GtkTreeIter* iter);
static void code_widgets_source_list_tree_name_cell_data_func (CodeWidgetsSourceListTree* self,
                                                        GtkCellLayout* layout,
                                                        GtkCellRenderer* renderer,
                                                        GtkTreeModel* model,
                                                        GtkTreeIter* iter);
static void code_widgets_source_list_tree_badge_cell_data_func (CodeWidgetsSourceListTree* self,
                                                         GtkCellLayout* layout,
                                                         GtkCellRenderer* renderer,
                                                         GtkTreeModel* model,
                                                         GtkTreeIter* iter);
static void code_widgets_source_list_tree_icon_cell_data_func (CodeWidgetsSourceListTree* self,
                                                        GtkCellLayout* layout,
                                                        GtkCellRenderer* renderer,
                                                        GtkTreeModel* model,
                                                        GtkTreeIter* iter);
static void code_widgets_source_list_tree_set_data_model (CodeWidgetsSourceListTree* self,
                                                   CodeWidgetsSourceListDataModel* value);
static GObject * code_widgets_source_list_tree_constructor (GType type,
                                                     guint n_construct_properties,
                                                     GObjectConstructParam * construct_properties);
static void _code_widgets_source_list_tree_expander_cell_data_func_gtk_cell_layout_data_func (GtkCellLayout* cell_layout,
                                                                                       GtkCellRenderer* cell,
                                                                                       GtkTreeModel* tree_model,
                                                                                       GtkTreeIter* iter,
                                                                                       gpointer self);
static void _code_widgets_source_list_tree_on_activatable_activated_code_widgets_source_list_cell_renderer_icon_activated (CodeWidgetsSourceListCellRendererIcon* _sender,
                                                                                                                    const gchar* path,
                                                                                                                    gpointer self);
static void _code_widgets_source_list_tree_icon_cell_data_func_gtk_cell_layout_data_func (GtkCellLayout* cell_layout,
                                                                                   GtkCellRenderer* cell,
                                                                                   GtkTreeModel* tree_model,
                                                                                   GtkTreeIter* iter,
                                                                                   gpointer self);
static void _code_widgets_source_list_tree_badge_cell_data_func_gtk_cell_layout_data_func (GtkCellLayout* cell_layout,
                                                                                    GtkCellRenderer* cell,
                                                                                    GtkTreeModel* tree_model,
                                                                                    GtkTreeIter* iter,
                                                                                    gpointer self);
static void _code_widgets_source_list_tree_on_editing_started_gtk_cell_renderer_editing_started (GtkCellRenderer* _sender,
                                                                                          GtkCellEditable* editable,
                                                                                          const gchar* path,
                                                                                          gpointer self);
static void _code_widgets_source_list_tree_on_editing_canceled_gtk_cell_renderer_editing_canceled (GtkCellRenderer* _sender,
                                                                                            gpointer self);
static void _code_widgets_source_list_tree_name_cell_data_func_gtk_cell_layout_data_func (GtkCellLayout* cell_layout,
                                                                                   GtkCellRenderer* cell,
                                                                                   GtkTreeModel* tree_model,
                                                                                   GtkTreeIter* iter,
                                                                                   gpointer self);
static gboolean _code_widgets_source_list_tree_select_func_gtk_tree_selection_func (GtkTreeSelection* selection,
                                                                             GtkTreeModel* model,
                                                                             GtkTreePath* path,
                                                                             gboolean path_currently_selected,
                                                                             gpointer self);
static gboolean _code_widgets_source_list_tree_on_query_tooltip_gtk_widget_query_tooltip (GtkWidget* _sender,
                                                                                   gint x,
                                                                                   gint y,
                                                                                   gboolean keyboard_tooltip,
                                                                                   GtkTooltip* tooltip,
                                                                                   gpointer self);
static void _code_widgets_source_list_tree_on_key_released_gtk_event_controller_key_key_released (GtkEventControllerKey* _sender,
                                                                                           guint keyval,
                                                                                           guint keycode,
                                                                                           GdkModifierType state,
                                                                                           gpointer self);
static void code_widgets_source_list_tree_finalize (GObject * obj);
static GType code_widgets_source_list_tree_get_type_once (void);
static void _vala_code_widgets_source_list_tree_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec);
static void _vala_code_widgets_source_list_tree_set_property (GObject * object,
                                                       guint property_id,
                                                       const GValue * value,
                                                       GParamSpec * pspec);
static GObject * code_widgets_source_list_constructor (GType type,
                                                guint n_construct_properties,
                                                GObjectConstructParam * construct_properties);
static void _code_widgets_source_list___lambda5_ (CodeWidgetsSourceList* self,
                                           CodeWidgetsSourceListItem* item);
static void __code_widgets_source_list___lambda5__code_widgets_source_list_tree_item_selected (CodeWidgetsSourceListTree* _sender,
                                                                                        CodeWidgetsSourceListItem* item,
                                                                                        gpointer self);
static void code_widgets_source_list_finalize (GObject * obj);
static GType code_widgets_source_list_get_type_once (void);
static void _vala_code_widgets_source_list_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec);
static void _vala_code_widgets_source_list_set_property (GObject * object,
                                                  guint property_id,
                                                  const GValue * value,
                                                  GParamSpec * pspec);

/**
     * Whether this item will allow users to re-arrange its children via DnD.
     *
     * This feature can co-exist with a sort algorithm (implemented
     * by {@link Code.Widgets.SourceListSortable.compare}), but
     * the actual order of the items in the list will always
     * honor that method. The sort function has to be compatible with
     * the kind of DnD reordering the item wants to allow, since the user can
     * only reorder those items for which //compare// returns 0.
     *
     * @return Whether the item's children can be re-arranged by users.
     * @since 0.3
     */
gboolean
code_widgets_source_list_sortable_allow_dnd_sorting (CodeWidgetsSourceListSortable* self)
{
	CodeWidgetsSourceListSortableIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = CODE_WIDGETS_SOURCE_LIST_SORTABLE_GET_INTERFACE (self);
	if (_iface_->allow_dnd_sorting) {
		return _iface_->allow_dnd_sorting (self);
	}
	return FALSE;
}

/**
     * Should return a negative integer, zero, or a positive integer if ''a''
     * sorts //before// ''b'', ''a'' sorts //with// ''b'', or ''a'' sorts
     * //after// ''b'' respectively. If two items compare as equal, their
     * order in the sorted source list is undefined.
     *
     * In order to ensure that the source list behaves as expected, this
     * method must define a partial order on the source list tree; i.e. it
     * must be reflexive, antisymmetric and transitive. Not complying with
     * those requirements could make the program fall into an infinite loop
     * and freeze the user interface.
     *
     * Should return //0// to allow any pair of items to be sortable via DnD.
     *
     * @param a First item.
     * @param b Second item.
     * @return A //negative// integer if //a// sorts before //b//,
     *         //zero// if //a// equals //b//, or a //positive//
     *         integer if //a// sorts after //b//.
     * @since 0.3
     */
gint
code_widgets_source_list_sortable_compare (CodeWidgetsSourceListSortable* self,
                                           CodeWidgetsSourceListItem* a,
                                           CodeWidgetsSourceListItem* b)
{
	CodeWidgetsSourceListSortableIface* _iface_;
	g_return_val_if_fail (self != NULL, -1);
	_iface_ = CODE_WIDGETS_SOURCE_LIST_SORTABLE_GET_INTERFACE (self);
	if (_iface_->compare) {
		return _iface_->compare (self, a, b);
	}
	return -1;
}

static void
code_widgets_source_list_sortable_default_init (CodeWidgetsSourceListSortableIface * iface,
                                                gpointer iface_data)
{
	/**
	     * Emitted after a user has re-ordered an item via DnD.
	     *
	     * @param moved The item that was moved to a different position by the user.
	     * @since 0.3
	     */
	code_widgets_source_list_sortable_signals[CODE_WIDGETS_SOURCE_LIST_SORTABLE_USER_MOVED_ITEM_SIGNAL] = g_signal_new ("user-moved-item", CODE_WIDGETS_TYPE_SOURCE_LIST_SORTABLE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM);
}

/**
 * An interface for sorting items.
 *
 * @since 0.3
 */
 G_GNUC_NO_INLINE static GType
code_widgets_source_list_sortable_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (CodeWidgetsSourceListSortableIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) code_widgets_source_list_sortable_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType code_widgets_source_list_sortable_type_id;
	code_widgets_source_list_sortable_type_id = g_type_register_static (G_TYPE_INTERFACE, "CodeWidgetsSourceListSortable", &g_define_type_info, G_TYPE_FLAG_NONE);
	g_type_interface_add_prerequisite (code_widgets_source_list_sortable_type_id, CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM);
	return code_widgets_source_list_sortable_type_id;
}

GType
code_widgets_source_list_sortable_get_type (void)
{
	static gsize code_widgets_source_list_sortable_type_id__once = 0;
	if (g_once_init_enter (&code_widgets_source_list_sortable_type_id__once)) {
		GType code_widgets_source_list_sortable_type_id;
		code_widgets_source_list_sortable_type_id = code_widgets_source_list_sortable_get_type_once ();
		g_once_init_leave (&code_widgets_source_list_sortable_type_id__once, code_widgets_source_list_sortable_type_id);
	}
	return code_widgets_source_list_sortable_type_id__once;
}

/**
     * Determines whether this item can be dragged outside the source list widget.
     *
     * Even if this method returns //false//, the item could still be dragged around
     * within the source list if its parent allows DnD reordering. This only happens
     * when the parent implements {@link Code.Widgets.SourceListSortable}.
     *
     * @return //true// if the item can be dragged; //false// otherwise.
     * @since 0.3
     * @see Code.Widgets.SourceListSortable
     */
gboolean
code_widgets_source_list_drag_source_draggable (CodeWidgetsSourceListDragSource* self)
{
	CodeWidgetsSourceListDragSourceIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = CODE_WIDGETS_SOURCE_LIST_DRAG_SOURCE_GET_INTERFACE (self);
	if (_iface_->draggable) {
		return _iface_->draggable (self);
	}
	return FALSE;
}

/**
     * This method is called when the drop site requests the data which is dragged.
     *
     * It is the responsibility of this method to fill //selection_data// with the
     * data in the format which is indicated by {@link Gtk.SelectionData.get_target}.
     *
     * @param selection_data {@link Gtk.SelectionData} containing source data.
     * @since 0.3
     * @see Gtk.SelectionData.set
     * @see Gtk.SelectionData.set_uris
     * @see Gtk.SelectionData.set_text
     */
void
code_widgets_source_list_drag_source_prepare_selection_data (CodeWidgetsSourceListDragSource* self,
                                                             GtkSelectionData* selection_data)
{
	CodeWidgetsSourceListDragSourceIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = CODE_WIDGETS_SOURCE_LIST_DRAG_SOURCE_GET_INTERFACE (self);
	if (_iface_->prepare_selection_data) {
		_iface_->prepare_selection_data (self, selection_data);
	}
}

static void
code_widgets_source_list_drag_source_default_init (CodeWidgetsSourceListDragSourceIface * iface,
                                                   gpointer iface_data)
{
}

/**
 * An interface for dragging items out of the source list widget.
 *
 * @since 0.3
 */
 G_GNUC_NO_INLINE static GType
code_widgets_source_list_drag_source_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (CodeWidgetsSourceListDragSourceIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) code_widgets_source_list_drag_source_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType code_widgets_source_list_drag_source_type_id;
	code_widgets_source_list_drag_source_type_id = g_type_register_static (G_TYPE_INTERFACE, "CodeWidgetsSourceListDragSource", &g_define_type_info, G_TYPE_FLAG_NONE);
	g_type_interface_add_prerequisite (code_widgets_source_list_drag_source_type_id, CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM);
	return code_widgets_source_list_drag_source_type_id;
}

GType
code_widgets_source_list_drag_source_get_type (void)
{
	static gsize code_widgets_source_list_drag_source_type_id__once = 0;
	if (g_once_init_enter (&code_widgets_source_list_drag_source_type_id__once)) {
		GType code_widgets_source_list_drag_source_type_id;
		code_widgets_source_list_drag_source_type_id = code_widgets_source_list_drag_source_get_type_once ();
		g_once_init_leave (&code_widgets_source_list_drag_source_type_id__once, code_widgets_source_list_drag_source_type_id);
	}
	return code_widgets_source_list_drag_source_type_id__once;
}

/**
     * Determines whether //data// can be dropped into this item.
     *
     * @param context The drag context.
     * @param data {@link Gtk.SelectionData} containing source data.
     * @return //true// if the drop is possible; //false// otherwise.
     * @since 0.3
     */
gboolean
code_widgets_source_list_drag_dest_data_drop_possible (CodeWidgetsSourceListDragDest* self,
                                                       GdkDragContext* context,
                                                       GtkSelectionData* data)
{
	CodeWidgetsSourceListDragDestIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = CODE_WIDGETS_SOURCE_LIST_DRAG_DEST_GET_INTERFACE (self);
	if (_iface_->data_drop_possible) {
		return _iface_->data_drop_possible (self, context, data);
	}
	return FALSE;
}

/**
     * If a data drop is deemed possible, then this method is called
     * when the data is actually dropped into this item. Any actions
     * consequence of the data received should be handled here.
     *
     * @param context The drag context.
     * @param data {@link Gtk.SelectionData} containing source data.
     * @return The action taken, or //0// to indicate that the dropped data was not accepted.
     * @since 0.3
     */
GdkDragAction
code_widgets_source_list_drag_dest_data_received (CodeWidgetsSourceListDragDest* self,
                                                  GdkDragContext* context,
                                                  GtkSelectionData* data)
{
	CodeWidgetsSourceListDragDestIface* _iface_;
	g_return_val_if_fail (self != NULL, 0U);
	_iface_ = CODE_WIDGETS_SOURCE_LIST_DRAG_DEST_GET_INTERFACE (self);
	if (_iface_->data_received) {
		return _iface_->data_received (self, context, data);
	}
	return 0U;
}

static void
code_widgets_source_list_drag_dest_default_init (CodeWidgetsSourceListDragDestIface * iface,
                                                 gpointer iface_data)
{
}

/**
 * An interface for receiving data from other widgets via drag-and-drop.
 *
 * @since 0.3
 */
 G_GNUC_NO_INLINE static GType
code_widgets_source_list_drag_dest_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (CodeWidgetsSourceListDragDestIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) code_widgets_source_list_drag_dest_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType code_widgets_source_list_drag_dest_type_id;
	code_widgets_source_list_drag_dest_type_id = g_type_register_static (G_TYPE_INTERFACE, "CodeWidgetsSourceListDragDest", &g_define_type_info, G_TYPE_FLAG_NONE);
	g_type_interface_add_prerequisite (code_widgets_source_list_drag_dest_type_id, CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM);
	return code_widgets_source_list_drag_dest_type_id;
}

GType
code_widgets_source_list_drag_dest_get_type (void)
{
	static gsize code_widgets_source_list_drag_dest_type_id__once = 0;
	if (g_once_init_enter (&code_widgets_source_list_drag_dest_type_id__once)) {
		GType code_widgets_source_list_drag_dest_type_id;
		code_widgets_source_list_drag_dest_type_id = code_widgets_source_list_drag_dest_get_type_once ();
		g_once_init_leave (&code_widgets_source_list_drag_dest_type_id__once, code_widgets_source_list_drag_dest_type_id);
	}
	return code_widgets_source_list_drag_dest_type_id__once;
}

static inline gpointer
code_widgets_source_list_get_instance_private (CodeWidgetsSourceList* self)
{
	return G_STRUCT_MEMBER_P (self, CodeWidgetsSourceList_private_offset);
}

/**
     * Creates a new {@link Code.Widgets.SourceList}.
     *
     * @return A new {@link Code.Widgets.SourceList}.
     * @since 0.2
     */
CodeWidgetsSourceList*
code_widgets_source_list_construct (GType object_type,
                                    CodeWidgetsSourceListExpandableItem* root)
{
	CodeWidgetsSourceList * self = NULL;
	g_return_val_if_fail (root != NULL, NULL);
	self = (CodeWidgetsSourceList*) g_object_new (object_type, NULL);
	code_widgets_source_list_set_root (self, root);
	return self;
}

CodeWidgetsSourceList*
code_widgets_source_list_new (CodeWidgetsSourceListExpandableItem* root)
{
	return code_widgets_source_list_construct (CODE_WIDGETS_TYPE_SOURCE_LIST, root);
}

/**
     * Checks whether //item// is part of the source list.
     *
     * @param item The item to query.
     * @return //true// if the item belongs to the source list; //false// otherwise.
     * @since 0.2
     */
gboolean
code_widgets_source_list_has_item (CodeWidgetsSourceList* self,
                                   CodeWidgetsSourceListItem* item)
{
	CodeWidgetsSourceListDataModel* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (item != NULL, FALSE);
	_tmp0_ = self->priv->data_model;
	result = code_widgets_source_list_data_model_has_item (_tmp0_, item);
	return result;
}

/**
     * Sets the method used for filtering out items.
     *
     * @param visible_func The method to use for filtering items.
     * @param refilter Whether to call {@link Code.Widgets.SourceList.refilter} using the new function.
     * @see Code.Widgets.SourceList.VisibleFunc
     * @see Code.Widgets.SourceList.refilter
     * @since 0.2
     */
void
code_widgets_source_list_set_filter_func (CodeWidgetsSourceList* self,
                                          CodeWidgetsSourceListVisibleFunc visible_func,
                                          gpointer visible_func_target,
                                          gboolean refilter)
{
	CodeWidgetsSourceListDataModel* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->data_model;
	code_widgets_source_list_data_model_set_filter_func (_tmp0_, visible_func, visible_func_target);
	if (refilter) {
		code_widgets_source_list_refilter (self);
	}
}

/**
     * Applies the filter method set by {@link Code.Widgets.SourceList.set_filter_func}
     * to all the items that are part of the current tree.
     *
     * @see Code.Widgets.SourceList.VisibleFunc
     * @see Code.Widgets.SourceList.set_filter_func
     * @since 0.2
     */
void
code_widgets_source_list_refilter (CodeWidgetsSourceList* self)
{
	CodeWidgetsSourceListDataModel* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->data_model;
	gtk_tree_model_filter_refilter ((GtkTreeModelFilter*) _tmp0_);
}

/**
     * Queries the actual expansion state of //item//.
     *
     * @see Code.Widgets.SourceList.ExpandableItem.expanded
     * @return Whether //item// is expanded or not.
     * @since 0.2
     */
static void
_vala_GtkTreePath_free (GtkTreePath* self)
{
	g_boxed_free (gtk_tree_path_get_type (), self);
}

gboolean
code_widgets_source_list_is_item_expanded (CodeWidgetsSourceList* self,
                                           CodeWidgetsSourceListItem* item)
{
	GtkTreePath* path = NULL;
	CodeWidgetsSourceListDataModel* _tmp0_;
	GtkTreePath* _tmp1_;
	gboolean _tmp2_ = FALSE;
	GtkTreePath* _tmp3_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (item != NULL, FALSE);
	_vala_return_val_if_fail (code_widgets_source_list_has_item (self, item), "has_item (item)", FALSE);
	_tmp0_ = self->priv->data_model;
	_tmp1_ = code_widgets_source_list_data_model_get_item_path (_tmp0_, item);
	path = _tmp1_;
	_tmp3_ = path;
	if (_tmp3_ != NULL) {
		CodeWidgetsSourceListTree* _tmp4_;
		GtkTreePath* _tmp5_;
		_tmp4_ = self->priv->tree;
		_tmp5_ = path;
		_tmp2_ = gtk_tree_view_row_expanded ((GtkTreeView*) _tmp4_, _tmp5_);
	} else {
		_tmp2_ = FALSE;
	}
	result = _tmp2_;
	__vala_GtkTreePath_free0 (path);
	return result;
}

/**
     * If //item// is editable, this activates the editor; otherwise, it does nothing.
     * If an item was already being edited, this will fail.
     *
     * @param item Item to edit.
     * @see Code.Widgets.SourceList.Item.editable
     * @see Code.Widgets.SourceList.editing
     * @see Code.Widgets.SourceList.stop_editing
     * @return true if the editing started successfully; false otherwise.
     * @since 0.2
     */
gboolean
code_widgets_source_list_start_editing_item (CodeWidgetsSourceList* self,
                                             CodeWidgetsSourceListItem* item)
{
	CodeWidgetsSourceListTree* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (item != NULL, FALSE);
	_vala_return_val_if_fail (code_widgets_source_list_has_item (self, item), "has_item (item)", FALSE);
	_tmp0_ = self->priv->tree;
	result = code_widgets_source_list_tree_start_editing_item (_tmp0_, item);
	return result;
}

/**
     * Cancels any editing operation going on.
     *
     * @see Code.Widgets.SourceList.editing
     * @see Code.Widgets.SourceList.start_editing_item
     * @since 0.2
     */
void
code_widgets_source_list_stop_editing (CodeWidgetsSourceList* self)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = code_widgets_source_list_get_editing (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		CodeWidgetsSourceListTree* _tmp2_;
		_tmp2_ = self->priv->tree;
		code_widgets_source_list_tree_stop_editing (_tmp2_);
	}
}

/**
     * Turns Source List into a //drag source//.
     *
     * This enables items that implement {@link Code.Widgets.SourceListDragSource}
     * to be dragged outside the Source List and drop data into external widgets.
     *
     * @param src_entries an array of {@link Gtk.TargetEntry}s indicating the targets
     * that the drag will support.
     * @see Code.Widgets.SourceListDragSource
     * @see Code.Widgets.SourceList.disable_drag_source
     * @since 0.3
     */
void
code_widgets_source_list_enable_drag_source (CodeWidgetsSourceList* self,
                                             GtkTargetEntry* src_entries,
                                             gint src_entries_length1)
{
	CodeWidgetsSourceListTree* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->tree;
	code_widgets_source_list_tree_configure_drag_source (_tmp0_, src_entries, (gint) src_entries_length1);
}

/**
     * Undoes the effect of {@link Code.Widgets.SourceList.enable_drag_source}
     *
     * @see Code.Widgets.SourceList.enable_drag_source
     * @since 0.3
     */
void
code_widgets_source_list_disable_drag_source (CodeWidgetsSourceList* self)
{
	CodeWidgetsSourceListTree* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->tree;
	code_widgets_source_list_tree_configure_drag_source (_tmp0_, NULL, (gint) 0);
}

/**
     * Turns Source List into a //drop destination//.
     *
     * This enables items that implement {@link Code.Widgets.SourceListDragDest}
     * to receive data from external widgets via drag-and-drop.
     *
     * @param dest_entries an array of {@link Gtk.TargetEntry}s indicating the drop
     * types that Source List items will accept.
     * @param actions a bitmask of possible actions for a drop onto Source List items.
     * @see Code.Widgets.SourceListDragDest
     * @see Code.Widgets.SourceList.disable_drag_dest
     * @since 0.3
     */
void
code_widgets_source_list_enable_drag_dest (CodeWidgetsSourceList* self,
                                           GtkTargetEntry* dest_entries,
                                           gint dest_entries_length1,
                                           GdkDragAction actions)
{
	CodeWidgetsSourceListTree* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->tree;
	code_widgets_source_list_tree_configure_drag_dest (_tmp0_, dest_entries, (gint) dest_entries_length1, actions);
}

/**
     * Undoes the effect of {@link Code.Widgets.SourceList.enable_drag_dest}
     *
     * @see Code.Widgets.SourceList.enable_drag_dest
     * @since 0.3
     */
void
code_widgets_source_list_disable_drag_dest (CodeWidgetsSourceList* self)
{
	CodeWidgetsSourceListTree* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->tree;
	code_widgets_source_list_tree_configure_drag_dest (_tmp0_, NULL, (gint) 0, 0);
}

/**
     * Scrolls the source list tree to make //item// visible.
     *
     * {@link Code.Widgets.SourceList.ExpandableItem.expand_with_parents} is called
     * for the item's parent if //expand_parents// is //true//, to make sure it's not
     * hidden behind a collapsed row.
     *
     * If use_align is //false//, then the row_align argument is ignored, and the tree
     * does the minimum amount of work to scroll the item onto the screen. This means that
     * the item will be scrolled to the edge closest to its current position. If the item
     * is currently visible on the screen, nothing is done.
     *
     * @param item Item to scroll to.
     * @param expand_parents Whether to recursively expand item's parent in case they are collapsed.
     * @param use_align Whether to use the //row_align// argument.
     * @param row_align The vertical alignment of //item//. 0.0 means top, 0.5 center, and 1.0 bottom.
     * @return //true// if successful; //false// otherwise.
     * @since 0.2
     */
gboolean
code_widgets_source_list_scroll_to_item (CodeWidgetsSourceList* self,
                                         CodeWidgetsSourceListItem* item,
                                         gboolean expand_parents,
                                         gboolean use_align,
                                         gfloat row_align)
{
	gboolean _tmp0_ = FALSE;
	CodeWidgetsSourceListTree* _tmp5_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (item != NULL, FALSE);
	_vala_return_val_if_fail (code_widgets_source_list_has_item (self, item), "has_item (item)", FALSE);
	if (expand_parents) {
		CodeWidgetsSourceListExpandableItem* _tmp1_;
		CodeWidgetsSourceListExpandableItem* _tmp2_;
		_tmp1_ = code_widgets_source_list_item_get_parent (item);
		_tmp2_ = _tmp1_;
		_tmp0_ = _tmp2_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		CodeWidgetsSourceListExpandableItem* _tmp3_;
		CodeWidgetsSourceListExpandableItem* _tmp4_;
		_tmp3_ = code_widgets_source_list_item_get_parent (item);
		_tmp4_ = _tmp3_;
		code_widgets_source_list_expandable_item_expand_with_parents (_tmp4_);
	}
	_tmp5_ = self->priv->tree;
	result = code_widgets_source_list_tree_scroll_to_item (_tmp5_, item, use_align, row_align);
	return result;
}

/**
     * Gets the previous item with respect to //reference//.
     *
     * @param reference Item to use as reference.
     * @return The item that appears before //reference//, or //null// if there's none.
     * @since 0.2
     */
static void
_vala_GtkTreeIter_free (GtkTreeIter* self)
{
	g_boxed_free (gtk_tree_iter_get_type (), self);
}

CodeWidgetsSourceListItem*
code_widgets_source_list_get_previous_item (CodeWidgetsSourceList* self,
                                            CodeWidgetsSourceListItem* reference)
{
	GtkTreeIter* iter = NULL;
	CodeWidgetsSourceListDataModel* _tmp0_;
	GtkTreeIter* _tmp1_;
	GtkTreeIter* _tmp2_;
	CodeWidgetsSourceListItem* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (reference != NULL, NULL);
	_vala_return_val_if_fail (code_widgets_source_list_has_item (self, reference), "has_item (reference)", NULL);
	_tmp0_ = self->priv->data_model;
	_tmp1_ = code_widgets_source_list_data_model_get_item_iter (_tmp0_, reference);
	iter = _tmp1_;
	_tmp2_ = iter;
	if (_tmp2_ != NULL) {
		GtkTreeIter new_iter = {0};
		GtkTreeIter* _tmp3_;
		CodeWidgetsSourceListDataModel* _tmp4_;
		gboolean _tmp5_;
		_tmp3_ = iter;
		new_iter = *_tmp3_;
		_tmp4_ = self->priv->data_model;
		_tmp5_ = gtk_tree_model_iter_previous ((GtkTreeModel*) _tmp4_, &new_iter);
		if (_tmp5_) {
			CodeWidgetsSourceListDataModel* _tmp6_;
			GtkTreeIter _tmp7_;
			CodeWidgetsSourceListItem* _tmp8_;
			_tmp6_ = self->priv->data_model;
			_tmp7_ = new_iter;
			_tmp8_ = code_widgets_source_list_data_model_get_item (_tmp6_, &_tmp7_);
			result = _tmp8_;
			__vala_GtkTreeIter_free0 (iter);
			return result;
		}
	}
	result = NULL;
	__vala_GtkTreeIter_free0 (iter);
	return result;
}

/**
     * Gets the next item with respect to //reference//.
     *
     * @param reference Item to use as reference.
     * @return The item that appears after //reference//, or //null// if there's none.
     * @since 0.2
     */
CodeWidgetsSourceListItem*
code_widgets_source_list_get_next_item (CodeWidgetsSourceList* self,
                                        CodeWidgetsSourceListItem* reference)
{
	GtkTreeIter* iter = NULL;
	CodeWidgetsSourceListDataModel* _tmp0_;
	GtkTreeIter* _tmp1_;
	GtkTreeIter* _tmp2_;
	CodeWidgetsSourceListItem* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (reference != NULL, NULL);
	_vala_return_val_if_fail (code_widgets_source_list_has_item (self, reference), "has_item (reference)", NULL);
	_tmp0_ = self->priv->data_model;
	_tmp1_ = code_widgets_source_list_data_model_get_item_iter (_tmp0_, reference);
	iter = _tmp1_;
	_tmp2_ = iter;
	if (_tmp2_ != NULL) {
		GtkTreeIter new_iter = {0};
		GtkTreeIter* _tmp3_;
		CodeWidgetsSourceListDataModel* _tmp4_;
		gboolean _tmp5_;
		_tmp3_ = iter;
		new_iter = *_tmp3_;
		_tmp4_ = self->priv->data_model;
		_tmp5_ = gtk_tree_model_iter_next ((GtkTreeModel*) _tmp4_, &new_iter);
		if (_tmp5_) {
			CodeWidgetsSourceListDataModel* _tmp6_;
			GtkTreeIter _tmp7_;
			CodeWidgetsSourceListItem* _tmp8_;
			_tmp6_ = self->priv->data_model;
			_tmp7_ = new_iter;
			_tmp8_ = code_widgets_source_list_data_model_get_item (_tmp6_, &_tmp7_);
			result = _tmp8_;
			__vala_GtkTreeIter_free0 (iter);
			return result;
		}
	}
	result = NULL;
	__vala_GtkTreeIter_free0 (iter);
	return result;
}

/**
     * Gets the first visible child of an expandable item.
     *
     * @param parent Parent of the child to look up.
     * @return The first visible child of //parent//, or null if it was not found.
     * @since 0.2
     */
CodeWidgetsSourceListItem*
code_widgets_source_list_get_first_child (CodeWidgetsSourceList* self,
                                          CodeWidgetsSourceListExpandableItem* parent)
{
	CodeWidgetsSourceListItem* _tmp0_;
	CodeWidgetsSourceListItem* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (parent != NULL, NULL);
	_tmp0_ = code_widgets_source_list_get_nth_child (self, parent, 0);
	result = _tmp0_;
	return result;
}

/**
     * Gets the last visible child of an expandable item.
     *
     * @param parent Parent of the child to look up.
     * @return The last visible child of //parent//, or null if it was not found.
     * @since 0.2
     */
CodeWidgetsSourceListItem*
code_widgets_source_list_get_last_child (CodeWidgetsSourceList* self,
                                         CodeWidgetsSourceListExpandableItem* parent)
{
	CodeWidgetsSourceListItem* _tmp0_;
	CodeWidgetsSourceListItem* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (parent != NULL, NULL);
	_tmp0_ = code_widgets_source_list_get_nth_child (self, parent, ((gint) code_widgets_source_list_get_n_visible_children (self, parent)) - 1);
	result = _tmp0_;
	return result;
}

/**
     * Gets the number of visible children of an expandable item.
     *
     * @param parent Item to query.
     * @return Number of visible children of //parent//.
     * @since 0.2
     */
guint
code_widgets_source_list_get_n_visible_children (CodeWidgetsSourceList* self,
                                                 CodeWidgetsSourceListExpandableItem* parent)
{
	GtkTreeIter* parent_iter = NULL;
	CodeWidgetsSourceListDataModel* _tmp0_;
	GtkTreeIter* _tmp1_;
	CodeWidgetsSourceListDataModel* _tmp2_;
	guint result;
	g_return_val_if_fail (self != NULL, 0U);
	g_return_val_if_fail (parent != NULL, 0U);
	_tmp0_ = self->priv->data_model;
	_tmp1_ = code_widgets_source_list_data_model_get_item_iter (_tmp0_, (CodeWidgetsSourceListItem*) parent);
	parent_iter = _tmp1_;
	_tmp2_ = self->priv->data_model;
	result = (guint) gtk_tree_model_iter_n_children ((GtkTreeModel*) _tmp2_, parent_iter);
	__vala_GtkTreeIter_free0 (parent_iter);
	return result;
}

static CodeWidgetsSourceListItem*
code_widgets_source_list_get_nth_child (CodeWidgetsSourceList* self,
                                        CodeWidgetsSourceListExpandableItem* parent,
                                        gint index)
{
	GtkTreeIter* parent_iter = NULL;
	CodeWidgetsSourceListDataModel* _tmp0_;
	GtkTreeIter* _tmp1_;
	GtkTreeIter child_iter = {0};
	CodeWidgetsSourceListDataModel* _tmp2_;
	GtkTreeIter* _tmp3_;
	GtkTreeIter _tmp4_ = {0};
	gboolean _tmp5_;
	CodeWidgetsSourceListItem* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (parent != NULL, NULL);
	if (index < 0) {
		result = NULL;
		return result;
	}
	_tmp0_ = self->priv->data_model;
	_tmp1_ = code_widgets_source_list_data_model_get_item_iter (_tmp0_, (CodeWidgetsSourceListItem*) parent);
	parent_iter = _tmp1_;
	_tmp2_ = self->priv->data_model;
	_tmp3_ = parent_iter;
	_tmp5_ = gtk_tree_model_iter_nth_child ((GtkTreeModel*) _tmp2_, &_tmp4_, _tmp3_, index);
	child_iter = _tmp4_;
	if (_tmp5_) {
		CodeWidgetsSourceListDataModel* _tmp6_;
		GtkTreeIter _tmp7_;
		CodeWidgetsSourceListItem* _tmp8_;
		_tmp6_ = self->priv->data_model;
		_tmp7_ = child_iter;
		_tmp8_ = code_widgets_source_list_data_model_get_item (_tmp6_, &_tmp7_);
		result = _tmp8_;
		__vala_GtkTreeIter_free0 (parent_iter);
		return result;
	}
	result = NULL;
	__vala_GtkTreeIter_free0 (parent_iter);
	return result;
}

void
code_widgets_source_list_grab_focus (CodeWidgetsSourceList* self)
{
	CodeWidgetsSourceListTree* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->tree;
	gtk_widget_grab_focus ((GtkWidget*) _tmp0_);
}

CodeWidgetsSourceListExpandableItem*
code_widgets_source_list_get_root (CodeWidgetsSourceList* self)
{
	CodeWidgetsSourceListExpandableItem* result;
	CodeWidgetsSourceListDataModel* _tmp0_;
	CodeWidgetsSourceListExpandableItem* _tmp1_;
	CodeWidgetsSourceListExpandableItem* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->data_model;
	_tmp1_ = code_widgets_source_list_data_model_get_root (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
code_widgets_source_list_set_root (CodeWidgetsSourceList* self,
                                   CodeWidgetsSourceListExpandableItem* value)
{
	CodeWidgetsSourceListDataModel* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->data_model;
	code_widgets_source_list_data_model_set_root (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, code_widgets_source_list_properties[CODE_WIDGETS_SOURCE_LIST_ROOT_PROPERTY]);
}

CodeWidgetsSourceListItem*
code_widgets_source_list_get_selected (CodeWidgetsSourceList* self)
{
	CodeWidgetsSourceListItem* result;
	CodeWidgetsSourceListTree* _tmp0_;
	CodeWidgetsSourceListItem* _tmp1_;
	CodeWidgetsSourceListItem* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->tree;
	_tmp1_ = code_widgets_source_list_tree_get_selected_item (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
code_widgets_source_list_set_selected (CodeWidgetsSourceList* self,
                                       CodeWidgetsSourceListItem* value)
{
	gboolean _tmp0_ = FALSE;
	CodeWidgetsSourceListTree* _tmp5_;
	g_return_if_fail (self != NULL);
	if (value != NULL) {
		CodeWidgetsSourceListExpandableItem* _tmp1_;
		CodeWidgetsSourceListExpandableItem* _tmp2_;
		_tmp1_ = code_widgets_source_list_item_get_parent (value);
		_tmp2_ = _tmp1_;
		_tmp0_ = _tmp2_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		CodeWidgetsSourceListExpandableItem* _tmp3_;
		CodeWidgetsSourceListExpandableItem* _tmp4_;
		_tmp3_ = code_widgets_source_list_item_get_parent (value);
		_tmp4_ = _tmp3_;
		code_widgets_source_list_expandable_item_expand_with_parents (_tmp4_);
	}
	_tmp5_ = self->priv->tree;
	code_widgets_source_list_tree_set_selected_item (_tmp5_, value);
	g_object_notify_by_pspec ((GObject *) self, code_widgets_source_list_properties[CODE_WIDGETS_SOURCE_LIST_SELECTED_PROPERTY]);
}

PangoEllipsizeMode
code_widgets_source_list_get_ellipsize_mode (CodeWidgetsSourceList* self)
{
	PangoEllipsizeMode result;
	CodeWidgetsSourceListTree* _tmp0_;
	PangoEllipsizeMode _tmp1_;
	PangoEllipsizeMode _tmp2_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->tree;
	_tmp1_ = code_widgets_source_list_tree_get_ellipsize_mode (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
code_widgets_source_list_set_ellipsize_mode (CodeWidgetsSourceList* self,
                                             PangoEllipsizeMode value)
{
	CodeWidgetsSourceListTree* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->tree;
	code_widgets_source_list_tree_set_ellipsize_mode (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, code_widgets_source_list_properties[CODE_WIDGETS_SOURCE_LIST_ELLIPSIZE_MODE_PROPERTY]);
}

gboolean
code_widgets_source_list_get_editing (CodeWidgetsSourceList* self)
{
	gboolean result;
	CodeWidgetsSourceListTree* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->tree;
	_tmp1_ = code_widgets_source_list_tree_get_editing (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
code_widgets_source_list_set_activate_on_single_click (CodeWidgetsSourceList* self,
                                                       gboolean value)
{
	CodeWidgetsSourceListTree* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->tree;
	gtk_tree_view_set_activate_on_single_click ((GtkTreeView*) _tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, code_widgets_source_list_properties[CODE_WIDGETS_SOURCE_LIST_ACTIVATE_ON_SINGLE_CLICK_PROPERTY]);
}

static void
code_widgets_source_list_real_item_selected (CodeWidgetsSourceList* self,
                                             CodeWidgetsSourceListItem* item)
{
}

static inline gpointer
code_widgets_source_list_item_get_instance_private (CodeWidgetsSourceListItem* self)
{
	return G_STRUCT_MEMBER_P (self, CodeWidgetsSourceListItem_private_offset);
}

/**
         * Creates a new {@link Code.Widgets.SourceList.Item}.
         *
         * @param name Name of the item.
         * @return (transfer full) A new {@link Code.Widgets.SourceList.Item}.
         * @since 0.2
         */
CodeWidgetsSourceListItem*
code_widgets_source_list_item_construct (GType object_type,
                                         const gchar* name)
{
	CodeWidgetsSourceListItem * self = NULL;
	g_return_val_if_fail (name != NULL, NULL);
	self = (CodeWidgetsSourceListItem*) g_object_new (object_type, NULL);
	code_widgets_source_list_item_set_name (self, name);
	return self;
}

CodeWidgetsSourceListItem*
code_widgets_source_list_item_new (const gchar* name)
{
	return code_widgets_source_list_item_construct (CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM, name);
}

/**
         * Invoked when the item is secondary-clicked or when the usual menu keys are pressed.
         *
         * Note that since Granite 5.0, right clicking on an item no longer selects/activates it, so
         * any context menu items should be actioned on the item instance rather than the selected item
         * in the SourceList
         *
         * @return A {@link GLib.Menu} or //null// if nothing should be displayed.
         * @since 0.2
         */
static GMenu*
code_widgets_source_list_item_real_get_context_menu (CodeWidgetsSourceListItem* self)
{
	GMenu* result;
	result = NULL;
	return result;
}

GMenu*
code_widgets_source_list_item_get_context_menu (CodeWidgetsSourceListItem* self)
{
	CodeWidgetsSourceListItemClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = CODE_WIDGETS_SOURCE_LIST_ITEM_GET_CLASS (self);
	if (_klass_->get_context_menu) {
		return _klass_->get_context_menu (self);
	}
	return NULL;
}

CodeWidgetsSourceListExpandableItem*
code_widgets_source_list_item_get_parent (CodeWidgetsSourceListItem* self)
{
	CodeWidgetsSourceListExpandableItem* result;
	CodeWidgetsSourceListExpandableItem* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_parent;
	result = _tmp0_;
	return result;
}

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

void
code_widgets_source_list_item_set_parent (CodeWidgetsSourceListItem* self,
                                          CodeWidgetsSourceListExpandableItem* value)
{
	CodeWidgetsSourceListExpandableItem* old_value;
	g_return_if_fail (self != NULL);
	old_value = code_widgets_source_list_item_get_parent (self);
	if (old_value != value) {
		CodeWidgetsSourceListExpandableItem* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_parent);
		self->priv->_parent = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, code_widgets_source_list_item_properties[CODE_WIDGETS_SOURCE_LIST_ITEM_PARENT_PROPERTY]);
	}
}

const gchar*
code_widgets_source_list_item_get_name (CodeWidgetsSourceListItem* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_name;
	result = _tmp0_;
	return result;
}

void
code_widgets_source_list_item_set_name (CodeWidgetsSourceListItem* self,
                                        const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = code_widgets_source_list_item_get_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_name);
		self->priv->_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, code_widgets_source_list_item_properties[CODE_WIDGETS_SOURCE_LIST_ITEM_NAME_PROPERTY]);
	}
}

const gchar*
code_widgets_source_list_item_get_tooltip (CodeWidgetsSourceListItem* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_tooltip;
	result = _tmp0_;
	return result;
}

void
code_widgets_source_list_item_set_tooltip (CodeWidgetsSourceListItem* self,
                                           const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = code_widgets_source_list_item_get_tooltip (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_tooltip);
		self->priv->_tooltip = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, code_widgets_source_list_item_properties[CODE_WIDGETS_SOURCE_LIST_ITEM_TOOLTIP_PROPERTY]);
	}
}

const gchar*
code_widgets_source_list_item_get_markup (CodeWidgetsSourceListItem* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_markup;
	result = _tmp0_;
	return result;
}

void
code_widgets_source_list_item_set_markup (CodeWidgetsSourceListItem* self,
                                          const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = code_widgets_source_list_item_get_markup (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_markup);
		self->priv->_markup = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, code_widgets_source_list_item_properties[CODE_WIDGETS_SOURCE_LIST_ITEM_MARKUP_PROPERTY]);
	}
}

const gchar*
code_widgets_source_list_item_get_badge (CodeWidgetsSourceListItem* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_badge;
	result = _tmp0_;
	return result;
}

void
code_widgets_source_list_item_set_badge (CodeWidgetsSourceListItem* self,
                                         const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = code_widgets_source_list_item_get_badge (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_badge);
		self->priv->_badge = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, code_widgets_source_list_item_properties[CODE_WIDGETS_SOURCE_LIST_ITEM_BADGE_PROPERTY]);
	}
}

gboolean
code_widgets_source_list_item_get_editable (CodeWidgetsSourceListItem* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_editable;
	return result;
}

void
code_widgets_source_list_item_set_editable (CodeWidgetsSourceListItem* self,
                                            gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = code_widgets_source_list_item_get_editable (self);
	if (old_value != value) {
		self->priv->_editable = value;
		g_object_notify_by_pspec ((GObject *) self, code_widgets_source_list_item_properties[CODE_WIDGETS_SOURCE_LIST_ITEM_EDITABLE_PROPERTY]);
	}
}

gboolean
code_widgets_source_list_item_get_visible (CodeWidgetsSourceListItem* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_visible;
	return result;
}

void
code_widgets_source_list_item_set_visible (CodeWidgetsSourceListItem* self,
                                           gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = code_widgets_source_list_item_get_visible (self);
	if (old_value != value) {
		self->priv->_visible = value;
		g_object_notify_by_pspec ((GObject *) self, code_widgets_source_list_item_properties[CODE_WIDGETS_SOURCE_LIST_ITEM_VISIBLE_PROPERTY]);
	}
}

gboolean
code_widgets_source_list_item_get_selectable (CodeWidgetsSourceListItem* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_selectable;
	return result;
}

void
code_widgets_source_list_item_set_selectable (CodeWidgetsSourceListItem* self,
                                              gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = code_widgets_source_list_item_get_selectable (self);
	if (old_value != value) {
		self->priv->_selectable = value;
		g_object_notify_by_pspec ((GObject *) self, code_widgets_source_list_item_properties[CODE_WIDGETS_SOURCE_LIST_ITEM_SELECTABLE_PROPERTY]);
	}
}

GIcon*
code_widgets_source_list_item_get_icon (CodeWidgetsSourceListItem* self)
{
	GIcon* result;
	GIcon* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_icon;
	result = _tmp0_;
	return result;
}

void
code_widgets_source_list_item_set_icon (CodeWidgetsSourceListItem* self,
                                        GIcon* value)
{
	GIcon* old_value;
	g_return_if_fail (self != NULL);
	old_value = code_widgets_source_list_item_get_icon (self);
	if (old_value != value) {
		GIcon* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_icon);
		self->priv->_icon = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, code_widgets_source_list_item_properties[CODE_WIDGETS_SOURCE_LIST_ITEM_ICON_PROPERTY]);
	}
}

GIcon*
code_widgets_source_list_item_get_activatable (CodeWidgetsSourceListItem* self)
{
	GIcon* result;
	GIcon* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_activatable;
	result = _tmp0_;
	return result;
}

void
code_widgets_source_list_item_set_activatable (CodeWidgetsSourceListItem* self,
                                               GIcon* value)
{
	GIcon* old_value;
	g_return_if_fail (self != NULL);
	old_value = code_widgets_source_list_item_get_activatable (self);
	if (old_value != value) {
		GIcon* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_activatable);
		self->priv->_activatable = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, code_widgets_source_list_item_properties[CODE_WIDGETS_SOURCE_LIST_ITEM_ACTIVATABLE_PROPERTY]);
	}
}

const gchar*
code_widgets_source_list_item_get_activatable_tooltip (CodeWidgetsSourceListItem* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_activatable_tooltip;
	result = _tmp0_;
	return result;
}

void
code_widgets_source_list_item_set_activatable_tooltip (CodeWidgetsSourceListItem* self,
                                                       const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = code_widgets_source_list_item_get_activatable_tooltip (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_activatable_tooltip);
		self->priv->_activatable_tooltip = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, code_widgets_source_list_item_properties[CODE_WIDGETS_SOURCE_LIST_ITEM_ACTIVATABLE_TOOLTIP_PROPERTY]);
	}
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

static void
code_widgets_source_list_item_real_edited (CodeWidgetsSourceListItem* self,
                                           const gchar* new_name)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	g_return_if_fail (new_name != NULL);
	_tmp1_ = self->priv->_editable;
	if (_tmp1_) {
		gchar* _tmp2_;
		gchar* _tmp3_;
		_tmp2_ = string_strip (new_name);
		_tmp3_ = _tmp2_;
		_tmp0_ = g_strcmp0 (_tmp3_, "") != 0;
		_g_free0 (_tmp3_);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		code_widgets_source_list_item_set_name (self, new_name);
	}
}

static void
code_widgets_source_list_item_real_action_activated (CodeWidgetsSourceListItem* self)
{
}

static void
code_widgets_source_list_item_real_activated (CodeWidgetsSourceListItem* self)
{
}

static void
code_widgets_source_list_item_class_init (CodeWidgetsSourceListItemClass * klass,
                                          gpointer klass_data)
{
	code_widgets_source_list_item_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &CodeWidgetsSourceListItem_private_offset);
	((CodeWidgetsSourceListItemClass *) klass)->get_context_menu = (GMenu* (*) (CodeWidgetsSourceListItem*)) code_widgets_source_list_item_real_get_context_menu;
	((CodeWidgetsSourceListItemClass *) klass)->edited = code_widgets_source_list_item_real_edited;
	((CodeWidgetsSourceListItemClass *) klass)->action_activated = code_widgets_source_list_item_real_action_activated;
	((CodeWidgetsSourceListItemClass *) klass)->activated = code_widgets_source_list_item_real_activated;
	G_OBJECT_CLASS (klass)->get_property = _vala_code_widgets_source_list_item_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_code_widgets_source_list_item_set_property;
	G_OBJECT_CLASS (klass)->finalize = code_widgets_source_list_item_finalize;
	/**
	         * Parent {@link Code.Widgets.SourceList.ExpandableItem} of the item.
	         * ''Must not'' be modified.
	         *
	         * @since 0.2
	         */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_SOURCE_LIST_ITEM_PARENT_PROPERTY, code_widgets_source_list_item_properties[CODE_WIDGETS_SOURCE_LIST_ITEM_PARENT_PROPERTY] = g_param_spec_object ("parent", "parent", "parent", CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	         * The item's name. Primary and most important information.
	         *
	         * @since 0.2
	         */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_SOURCE_LIST_ITEM_NAME_PROPERTY, code_widgets_source_list_item_properties[CODE_WIDGETS_SOURCE_LIST_ITEM_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	         * The item's tooltip. If set to null (default), the tooltip for the item will be the
	         * contents of the {@link Code.Widgets.SourceList.Item.name} property.
	         *
	         * @since 5.3
	         */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_SOURCE_LIST_ITEM_TOOLTIP_PROPERTY, code_widgets_source_list_item_properties[CODE_WIDGETS_SOURCE_LIST_ITEM_TOOLTIP_PROPERTY] = g_param_spec_string ("tooltip", "tooltip", "tooltip", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	         * Markup to be used instead of {@link Code.Widgets.SourceList.ExpandableItem.name}
	         * This would mean that &, <, etc have to be escaped in the text, but basic formatting
	         * can be done on the item with HTML style tags.
	         *
	         * Note: Only the {@link Code.Widgets.SourceList.ExpandableItem.name} property
	         * is modified for editable items. So this property will be need to updated and
	         * reformatted with editable items.
	         *
	         * @since 5.0
	         */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_SOURCE_LIST_ITEM_MARKUP_PROPERTY, code_widgets_source_list_item_properties[CODE_WIDGETS_SOURCE_LIST_ITEM_MARKUP_PROPERTY] = g_param_spec_string ("markup", "markup", "markup", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	         * A badge shown next to the item's name.
	         *
	         * It can be used for displaying the number of unread messages in the "Inbox" item,
	         * for instance.
	         *
	         * @since 0.2
	         */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_SOURCE_LIST_ITEM_BADGE_PROPERTY, code_widgets_source_list_item_properties[CODE_WIDGETS_SOURCE_LIST_ITEM_BADGE_PROPERTY] = g_param_spec_string ("badge", "badge", "badge", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	         * Whether the item's name can be edited from within the source list.
	         *
	         * When this property is set to //true//, users can edit the item by pressing
	         * the F2 key, or by double-clicking its name.
	         *
	         * ''This property only works for selectable items''.
	         *
	         * @see Code.Widgets.SourceList.Item.selectable
	         * @see Code.Widgets.SourceList.start_editing_item
	         * @since 0.2
	         */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_SOURCE_LIST_ITEM_EDITABLE_PROPERTY, code_widgets_source_list_item_properties[CODE_WIDGETS_SOURCE_LIST_ITEM_EDITABLE_PROPERTY] = g_param_spec_boolean ("editable", "editable", "editable", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	         * Whether the item should appear in the source list's tree or not.
	         *
	         * @since 0.2
	         */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_SOURCE_LIST_ITEM_VISIBLE_PROPERTY, code_widgets_source_list_item_properties[CODE_WIDGETS_SOURCE_LIST_ITEM_VISIBLE_PROPERTY] = g_param_spec_boolean ("visible", "visible", "visible", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	         * Whether the item can be selected or not.
	         *
	         * Setting this property to true doesn't guarantee that the item will actually be
	         * selectable, since there are other external factors to take into account, like the
	         * item's {@link Code.Widgets.SourceList.Item.visible} property; whether the item is
	         * a category; the parent item is collapsed, etc.
	         *
	         * @see Code.Widgets.SourceList.Item.visible
	         * @since 0.2
	         */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_SOURCE_LIST_ITEM_SELECTABLE_PROPERTY, code_widgets_source_list_item_properties[CODE_WIDGETS_SOURCE_LIST_ITEM_SELECTABLE_PROPERTY] = g_param_spec_boolean ("selectable", "selectable", "selectable", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	         * Primary icon.
	         *
	         * This property should be used to give the user an idea of what the item represents
	         * (i.e. content type.)
	         *
	         * @since 0.2
	         */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_SOURCE_LIST_ITEM_ICON_PROPERTY, code_widgets_source_list_item_properties[CODE_WIDGETS_SOURCE_LIST_ITEM_ICON_PROPERTY] = g_param_spec_object ("icon", "icon", "icon", g_icon_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	         * An activatable icon that works like a button.
	         *
	         * It can be used for e.g. showing an //"eject"// icon on a device's item.
	         *
	         * @see Code.Widgets.SourceList.Item.action_activated
	         * @since 0.2
	         */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_SOURCE_LIST_ITEM_ACTIVATABLE_PROPERTY, code_widgets_source_list_item_properties[CODE_WIDGETS_SOURCE_LIST_ITEM_ACTIVATABLE_PROPERTY] = g_param_spec_object ("activatable", "activatable", "activatable", g_icon_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	         * The tooltip for the activatable icon.
	         *
	         * @since 5.0
	         */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_SOURCE_LIST_ITEM_ACTIVATABLE_TOOLTIP_PROPERTY, code_widgets_source_list_item_properties[CODE_WIDGETS_SOURCE_LIST_ITEM_ACTIVATABLE_TOOLTIP_PROPERTY] = g_param_spec_string ("activatable-tooltip", "activatable-tooltip", "activatable-tooltip", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	         * Emitted when the user has finished editing the item's name.
	         *
	         * By default, if the name doesn't consist of white space, it is automatically assigned
	         * to the {@link Code.Widgets.SourceList.Item.name} property. The default behavior can
	         * be changed by overriding this signal.
	         * @param new_name The item's new name (result of editing.)
	         * @since 0.2
	         */
	code_widgets_source_list_item_signals[CODE_WIDGETS_SOURCE_LIST_ITEM_EDITED_SIGNAL] = g_signal_new ("edited", CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (CodeWidgetsSourceListItemClass, edited), NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
	/**
	         * The {@link Code.Widgets.SourceList.Item.activatable} icon was activated.
	         *
	         * @see Code.Widgets.SourceList.Item.activatable
	         * @since 0.2
	         */
	code_widgets_source_list_item_signals[CODE_WIDGETS_SOURCE_LIST_ITEM_ACTION_ACTIVATED_SIGNAL] = g_signal_new ("action-activated", CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (CodeWidgetsSourceListItemClass, action_activated), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	/**
	         * Emitted when the item is double-clicked or when it is selected and one of the keys:
	         * Space, Shift+Space, Return or Enter is pressed. This signal is //also// for
	         * editable items.
	         *
	         * @since 0.2
	         */
	code_widgets_source_list_item_signals[CODE_WIDGETS_SOURCE_LIST_ITEM_ACTIVATED_SIGNAL] = g_signal_new ("activated", CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (CodeWidgetsSourceListItemClass, activated), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
code_widgets_source_list_item_instance_init (CodeWidgetsSourceListItem * self,
                                             gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	self->priv = code_widgets_source_list_item_get_instance_private (self);
	_tmp0_ = g_strdup ("");
	self->priv->_name = _tmp0_;
	self->priv->_tooltip = NULL;
	self->priv->_markup = NULL;
	_tmp1_ = g_strdup ("");
	self->priv->_badge = _tmp1_;
	self->priv->_editable = FALSE;
	self->priv->_visible = TRUE;
	self->priv->_selectable = TRUE;
	_tmp2_ = g_strdup ("");
	self->priv->_activatable_tooltip = _tmp2_;
}

static void
code_widgets_source_list_item_finalize (GObject * obj)
{
	CodeWidgetsSourceListItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM, CodeWidgetsSourceListItem);
	_g_object_unref0 (self->priv->_parent);
	_g_free0 (self->priv->_name);
	_g_free0 (self->priv->_tooltip);
	_g_free0 (self->priv->_markup);
	_g_free0 (self->priv->_badge);
	_g_object_unref0 (self->priv->_icon);
	_g_object_unref0 (self->priv->_activatable);
	_g_free0 (self->priv->_activatable_tooltip);
	G_OBJECT_CLASS (code_widgets_source_list_item_parent_class)->finalize (obj);
}

/**
     * A source list entry.
     *
     * Any change made to any of its properties will be ''automatically'' reflected
     * by the {@link Code.Widgets.SourceList} widget.
     *
     * @since 0.2
     */
 G_GNUC_NO_INLINE static GType
code_widgets_source_list_item_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (CodeWidgetsSourceListItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) code_widgets_source_list_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CodeWidgetsSourceListItem), 0, (GInstanceInitFunc) code_widgets_source_list_item_instance_init, NULL };
	GType code_widgets_source_list_item_type_id;
	code_widgets_source_list_item_type_id = g_type_register_static (G_TYPE_OBJECT, "CodeWidgetsSourceListItem", &g_define_type_info, G_TYPE_FLAG_NONE);
	CodeWidgetsSourceListItem_private_offset = g_type_add_instance_private (code_widgets_source_list_item_type_id, sizeof (CodeWidgetsSourceListItemPrivate));
	return code_widgets_source_list_item_type_id;
}

GType
code_widgets_source_list_item_get_type (void)
{
	static gsize code_widgets_source_list_item_type_id__once = 0;
	if (g_once_init_enter (&code_widgets_source_list_item_type_id__once)) {
		GType code_widgets_source_list_item_type_id;
		code_widgets_source_list_item_type_id = code_widgets_source_list_item_get_type_once ();
		g_once_init_leave (&code_widgets_source_list_item_type_id__once, code_widgets_source_list_item_type_id);
	}
	return code_widgets_source_list_item_type_id__once;
}

static void
_vala_code_widgets_source_list_item_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec)
{
	CodeWidgetsSourceListItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM, CodeWidgetsSourceListItem);
	switch (property_id) {
		case CODE_WIDGETS_SOURCE_LIST_ITEM_PARENT_PROPERTY:
		g_value_set_object (value, code_widgets_source_list_item_get_parent (self));
		break;
		case CODE_WIDGETS_SOURCE_LIST_ITEM_NAME_PROPERTY:
		g_value_set_string (value, code_widgets_source_list_item_get_name (self));
		break;
		case CODE_WIDGETS_SOURCE_LIST_ITEM_TOOLTIP_PROPERTY:
		g_value_set_string (value, code_widgets_source_list_item_get_tooltip (self));
		break;
		case CODE_WIDGETS_SOURCE_LIST_ITEM_MARKUP_PROPERTY:
		g_value_set_string (value, code_widgets_source_list_item_get_markup (self));
		break;
		case CODE_WIDGETS_SOURCE_LIST_ITEM_BADGE_PROPERTY:
		g_value_set_string (value, code_widgets_source_list_item_get_badge (self));
		break;
		case CODE_WIDGETS_SOURCE_LIST_ITEM_EDITABLE_PROPERTY:
		g_value_set_boolean (value, code_widgets_source_list_item_get_editable (self));
		break;
		case CODE_WIDGETS_SOURCE_LIST_ITEM_VISIBLE_PROPERTY:
		g_value_set_boolean (value, code_widgets_source_list_item_get_visible (self));
		break;
		case CODE_WIDGETS_SOURCE_LIST_ITEM_SELECTABLE_PROPERTY:
		g_value_set_boolean (value, code_widgets_source_list_item_get_selectable (self));
		break;
		case CODE_WIDGETS_SOURCE_LIST_ITEM_ICON_PROPERTY:
		g_value_set_object (value, code_widgets_source_list_item_get_icon (self));
		break;
		case CODE_WIDGETS_SOURCE_LIST_ITEM_ACTIVATABLE_PROPERTY:
		g_value_set_object (value, code_widgets_source_list_item_get_activatable (self));
		break;
		case CODE_WIDGETS_SOURCE_LIST_ITEM_ACTIVATABLE_TOOLTIP_PROPERTY:
		g_value_set_string (value, code_widgets_source_list_item_get_activatable_tooltip (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_code_widgets_source_list_item_set_property (GObject * object,
                                                  guint property_id,
                                                  const GValue * value,
                                                  GParamSpec * pspec)
{
	CodeWidgetsSourceListItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM, CodeWidgetsSourceListItem);
	switch (property_id) {
		case CODE_WIDGETS_SOURCE_LIST_ITEM_PARENT_PROPERTY:
		code_widgets_source_list_item_set_parent (self, g_value_get_object (value));
		break;
		case CODE_WIDGETS_SOURCE_LIST_ITEM_NAME_PROPERTY:
		code_widgets_source_list_item_set_name (self, g_value_get_string (value));
		break;
		case CODE_WIDGETS_SOURCE_LIST_ITEM_TOOLTIP_PROPERTY:
		code_widgets_source_list_item_set_tooltip (self, g_value_get_string (value));
		break;
		case CODE_WIDGETS_SOURCE_LIST_ITEM_MARKUP_PROPERTY:
		code_widgets_source_list_item_set_markup (self, g_value_get_string (value));
		break;
		case CODE_WIDGETS_SOURCE_LIST_ITEM_BADGE_PROPERTY:
		code_widgets_source_list_item_set_badge (self, g_value_get_string (value));
		break;
		case CODE_WIDGETS_SOURCE_LIST_ITEM_EDITABLE_PROPERTY:
		code_widgets_source_list_item_set_editable (self, g_value_get_boolean (value));
		break;
		case CODE_WIDGETS_SOURCE_LIST_ITEM_VISIBLE_PROPERTY:
		code_widgets_source_list_item_set_visible (self, g_value_get_boolean (value));
		break;
		case CODE_WIDGETS_SOURCE_LIST_ITEM_SELECTABLE_PROPERTY:
		code_widgets_source_list_item_set_selectable (self, g_value_get_boolean (value));
		break;
		case CODE_WIDGETS_SOURCE_LIST_ITEM_ICON_PROPERTY:
		code_widgets_source_list_item_set_icon (self, g_value_get_object (value));
		break;
		case CODE_WIDGETS_SOURCE_LIST_ITEM_ACTIVATABLE_PROPERTY:
		code_widgets_source_list_item_set_activatable (self, g_value_get_object (value));
		break;
		case CODE_WIDGETS_SOURCE_LIST_ITEM_ACTIVATABLE_TOOLTIP_PROPERTY:
		code_widgets_source_list_item_set_activatable_tooltip (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
code_widgets_source_list_expandable_item_get_instance_private (CodeWidgetsSourceListExpandableItem* self)
{
	return G_STRUCT_MEMBER_P (self, CodeWidgetsSourceListExpandableItem_private_offset);
}

/**
         * Creates a new {@link Code.Widgets.SourceList.ExpandableItem}
         *
         * @param name Title of the item.
         * @return (transfer full) A new {@link Code.Widgets.SourceList.ExpandableItem}.
         * @since 0.2
         */
CodeWidgetsSourceListExpandableItem*
code_widgets_source_list_expandable_item_construct (GType object_type,
                                                    const gchar* name)
{
	CodeWidgetsSourceListExpandableItem * self = NULL;
	g_return_val_if_fail (name != NULL, NULL);
	self = (CodeWidgetsSourceListExpandableItem*) code_widgets_source_list_item_construct (object_type, name);
	return self;
}

CodeWidgetsSourceListExpandableItem*
code_widgets_source_list_expandable_item_new (const gchar* name)
{
	return code_widgets_source_list_expandable_item_construct (CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM, name);
}

/**
         * Checks whether the item contains the specified child.
         *
         * This method only considers the item's immediate children.
         *
         * @param item Item to search.
         * @return Whether the item was found or not.
         * @since 0.2
         */
gboolean
code_widgets_source_list_expandable_item_contains (CodeWidgetsSourceListExpandableItem* self,
                                                   CodeWidgetsSourceListItem* item)
{
	GeeCollection* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (item != NULL, FALSE);
	_tmp0_ = self->priv->children_list;
	result = gee_collection_contains (_tmp0_, item);
	return result;
}

/**
         * Adds an item.
         *
         * {@link Code.Widgets.SourceList.ExpandableItem.child_added} is fired after the item is added.
         *
         * While adding a child item, //the item it's being added to will set itself as the parent//.
         * Please note that items are required to have their //parent// property set to //null// before
         * being added, so make sure the item is removed from its previous parent before attempting
         * to add it to another item. For instance:
         * {{{
         * if (item.parent != null)
         *     item.parent.remove (item); // this will set item's parent to null
         * new_parent.add (item);
         * }}}
         *
         * @param item The item to add. Its parent __must__ be //null//.
         * @see Code.Widgets.SourceList.ExpandableItem.child_added
         * @see Code.Widgets.SourceList.ExpandableItem.remove
         * @since 0.2
         */
void
code_widgets_source_list_expandable_item_add (CodeWidgetsSourceListExpandableItem* self,
                                              CodeWidgetsSourceListItem* item)
{
	CodeWidgetsSourceListExpandableItem* _tmp0_;
	CodeWidgetsSourceListExpandableItem* _tmp1_;
	GeeCollection* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	_tmp0_ = code_widgets_source_list_item_get_parent (item);
	_tmp1_ = _tmp0_;
	_vala_return_if_fail (_tmp1_ == NULL, "item.parent == null");
	code_widgets_source_list_item_set_parent (item, self);
	_tmp2_ = self->priv->children_list;
	gee_collection_add (_tmp2_, item);
	g_signal_emit (self, code_widgets_source_list_expandable_item_signals[CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_CHILD_ADDED_SIGNAL], 0, item);
}

/**
         * Removes an item.
         *
         * The {@link Code.Widgets.SourceList.ExpandableItem.child_removed} signal is fired
         * //after removing the item//. Finally (i.e. after all the handlers have been invoked),
         * the item's {@link Code.Widgets.SourceList.Item.parent} property is set to //null//.
         * This has the advantage of letting signal handlers know the parent from which //item//
         * is being removed.
         *
         * @param item The item to remove. This will fail if item has a different parent.
         * @see Code.Widgets.SourceList.ExpandableItem.child_removed
         * @see Code.Widgets.SourceList.ExpandableItem.clear
         * @since 0.2
         */
void
code_widgets_source_list_expandable_item_remove (CodeWidgetsSourceListExpandableItem* self,
                                                 CodeWidgetsSourceListItem* item)
{
	CodeWidgetsSourceListExpandableItem* _tmp0_;
	CodeWidgetsSourceListExpandableItem* _tmp1_;
	GeeCollection* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	_tmp0_ = code_widgets_source_list_item_get_parent (item);
	_tmp1_ = _tmp0_;
	_vala_return_if_fail (_tmp1_ == self, "item.parent == this");
	_tmp2_ = self->priv->children_list;
	gee_collection_remove (_tmp2_, item);
	g_signal_emit (self, code_widgets_source_list_expandable_item_signals[CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_CHILD_REMOVED_SIGNAL], 0, item);
	code_widgets_source_list_item_set_parent (item, NULL);
}

/**
         * Removes all the items contained by the item. It works similarly to
         * {@link Code.Widgets.SourceList.ExpandableItem.remove}.
         *
         * @see Code.Widgets.SourceList.ExpandableItem.remove
         * @see Code.Widgets.SourceList.ExpandableItem.child_removed
         * @since 0.2
         */
void
code_widgets_source_list_expandable_item_clear (CodeWidgetsSourceListExpandableItem* self)
{
	g_return_if_fail (self != NULL);
	{
		GeeIterator* _item_it = NULL;
		GeeCollection* _tmp0_;
		GeeCollection* _tmp1_;
		GeeCollection* _tmp2_;
		GeeIterator* _tmp3_;
		GeeIterator* _tmp4_;
		_tmp0_ = code_widgets_source_list_expandable_item_get_children (self);
		_tmp1_ = _tmp0_;
		_tmp2_ = _tmp1_;
		_tmp3_ = gee_iterable_iterator ((GeeIterable*) _tmp2_);
		_tmp4_ = _tmp3_;
		_g_object_unref0 (_tmp2_);
		_item_it = _tmp4_;
		while (TRUE) {
			GeeIterator* _tmp5_;
			CodeWidgetsSourceListItem* item = NULL;
			GeeIterator* _tmp6_;
			gpointer _tmp7_;
			CodeWidgetsSourceListItem* _tmp8_;
			_tmp5_ = _item_it;
			if (!gee_iterator_next (_tmp5_)) {
				break;
			}
			_tmp6_ = _item_it;
			_tmp7_ = gee_iterator_get (_tmp6_);
			item = (CodeWidgetsSourceListItem*) _tmp7_;
			_tmp8_ = item;
			code_widgets_source_list_expandable_item_remove (self, _tmp8_);
			_g_object_unref0 (item);
		}
		_g_object_unref0 (_item_it);
	}
}

/**
         * Expands the item and/or its children.
         *
         * @param inclusive Whether to also expand this item (true), or only its children (false).
         * @param recursive Whether to recursively expand all the children (true), or only
         * immediate children (false).
         * @see Code.Widgets.SourceList.ExpandableItem.expanded
         * @since 0.2
         */
void
code_widgets_source_list_expandable_item_expand_all (CodeWidgetsSourceListExpandableItem* self,
                                                     gboolean inclusive,
                                                     gboolean recursive)
{
	g_return_if_fail (self != NULL);
	code_widgets_source_list_expandable_item_set_expansion (self, inclusive, recursive, TRUE);
}

/**
         * Collapses the item and/or its children.
         *
         * @param inclusive Whether to also collapse this item (true), or only its children (false).
         * @param recursive Whether to recursively collapse all the children (true), or only
         * immediate children (false).
         * @see Code.Widgets.SourceList.ExpandableItem.expanded
         * @since 0.2
         */
void
code_widgets_source_list_expandable_item_collapse_all (CodeWidgetsSourceListExpandableItem* self,
                                                       gboolean inclusive,
                                                       gboolean recursive)
{
	g_return_if_fail (self != NULL);
	code_widgets_source_list_expandable_item_set_expansion (self, inclusive, recursive, FALSE);
}

static void
code_widgets_source_list_expandable_item_set_expansion (CodeWidgetsSourceListExpandableItem* item,
                                                        gboolean inclusive,
                                                        gboolean recursive,
                                                        gboolean expanded)
{
	g_return_if_fail (item != NULL);
	if (inclusive) {
		code_widgets_source_list_expandable_item_set_expanded (item, expanded);
	}
	{
		GeeIterator* _child_item_it = NULL;
		GeeCollection* _tmp0_;
		GeeCollection* _tmp1_;
		GeeCollection* _tmp2_;
		GeeIterator* _tmp3_;
		GeeIterator* _tmp4_;
		_tmp0_ = code_widgets_source_list_expandable_item_get_children (item);
		_tmp1_ = _tmp0_;
		_tmp2_ = _tmp1_;
		_tmp3_ = gee_iterable_iterator ((GeeIterable*) _tmp2_);
		_tmp4_ = _tmp3_;
		_g_object_unref0 (_tmp2_);
		_child_item_it = _tmp4_;
		while (TRUE) {
			GeeIterator* _tmp5_;
			CodeWidgetsSourceListItem* child_item = NULL;
			GeeIterator* _tmp6_;
			gpointer _tmp7_;
			CodeWidgetsSourceListExpandableItem* child_expandable_item = NULL;
			CodeWidgetsSourceListItem* _tmp8_;
			CodeWidgetsSourceListExpandableItem* _tmp9_;
			CodeWidgetsSourceListExpandableItem* _tmp10_;
			_tmp5_ = _child_item_it;
			if (!gee_iterator_next (_tmp5_)) {
				break;
			}
			_tmp6_ = _child_item_it;
			_tmp7_ = gee_iterator_get (_tmp6_);
			child_item = (CodeWidgetsSourceListItem*) _tmp7_;
			_tmp8_ = child_item;
			_tmp9_ = _g_object_ref0 (CODE_WIDGETS_SOURCE_LIST_IS_EXPANDABLE_ITEM (_tmp8_) ? ((CodeWidgetsSourceListExpandableItem*) _tmp8_) : NULL);
			child_expandable_item = _tmp9_;
			_tmp10_ = child_expandable_item;
			if (_tmp10_ != NULL) {
				if (recursive) {
					CodeWidgetsSourceListExpandableItem* _tmp11_;
					_tmp11_ = child_expandable_item;
					code_widgets_source_list_expandable_item_set_expansion (_tmp11_, TRUE, TRUE, expanded);
				} else {
					CodeWidgetsSourceListExpandableItem* _tmp12_;
					_tmp12_ = child_expandable_item;
					code_widgets_source_list_expandable_item_set_expanded (_tmp12_, expanded);
				}
			}
			_g_object_unref0 (child_expandable_item);
			_g_object_unref0 (child_item);
		}
		_g_object_unref0 (_child_item_it);
	}
}

/**
         * Recursively expands the item along with its parent(s).
         *
         * @see Code.Widgets.SourceList.ExpandableItem.expanded
         * @since 0.2
         */
void
code_widgets_source_list_expandable_item_expand_with_parents (CodeWidgetsSourceListExpandableItem* self)
{
	CodeWidgetsSourceListExpandableItem* _tmp0_;
	CodeWidgetsSourceListExpandableItem* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = code_widgets_source_list_item_get_parent ((CodeWidgetsSourceListItem*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		CodeWidgetsSourceListExpandableItem* _tmp2_;
		CodeWidgetsSourceListExpandableItem* _tmp3_;
		_tmp2_ = code_widgets_source_list_item_get_parent ((CodeWidgetsSourceListItem*) self);
		_tmp3_ = _tmp2_;
		code_widgets_source_list_expandable_item_expand_with_parents (_tmp3_);
	}
	code_widgets_source_list_expandable_item_set_expanded (self, TRUE);
}

/**
         * Recursively collapses the item along with its parent(s).
         *
         * @see Code.Widgets.SourceList.ExpandableItem.expanded
         * @since 0.2
         */
void
code_widgets_source_list_expandable_item_collapse_with_parents (CodeWidgetsSourceListExpandableItem* self)
{
	CodeWidgetsSourceListExpandableItem* _tmp0_;
	CodeWidgetsSourceListExpandableItem* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = code_widgets_source_list_item_get_parent ((CodeWidgetsSourceListItem*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		CodeWidgetsSourceListExpandableItem* _tmp2_;
		CodeWidgetsSourceListExpandableItem* _tmp3_;
		_tmp2_ = code_widgets_source_list_item_get_parent ((CodeWidgetsSourceListItem*) self);
		_tmp3_ = _tmp2_;
		code_widgets_source_list_expandable_item_collapse_with_parents (_tmp3_);
	}
	code_widgets_source_list_expandable_item_set_expanded (self, FALSE);
}

gboolean
code_widgets_source_list_expandable_item_get_collapsible (CodeWidgetsSourceListExpandableItem* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_collapsible;
	return result;
}

void
code_widgets_source_list_expandable_item_set_collapsible (CodeWidgetsSourceListExpandableItem* self,
                                                          gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = code_widgets_source_list_expandable_item_get_collapsible (self);
	if (old_value != value) {
		self->priv->_collapsible = value;
		g_object_notify_by_pspec ((GObject *) self, code_widgets_source_list_expandable_item_properties[CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_COLLAPSIBLE_PROPERTY]);
	}
}

gboolean
code_widgets_source_list_expandable_item_get_expanded (CodeWidgetsSourceListExpandableItem* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	if (self->priv->_expanded) {
		_tmp0_ = TRUE;
	} else {
		gboolean _tmp1_;
		_tmp1_ = self->priv->_collapsible;
		_tmp0_ = !_tmp1_;
	}
	result = _tmp0_;
	return result;
}

void
code_widgets_source_list_expandable_item_set_expanded (CodeWidgetsSourceListExpandableItem* self,
                                                       gboolean value)
{
	g_return_if_fail (self != NULL);
	if (value != self->priv->_expanded) {
		self->priv->_expanded = value;
		g_signal_emit (self, code_widgets_source_list_expandable_item_signals[CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_TOGGLED_SIGNAL], 0);
	}
	g_object_notify_by_pspec ((GObject *) self, code_widgets_source_list_expandable_item_properties[CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_EXPANDED_PROPERTY]);
}

guint
code_widgets_source_list_expandable_item_get_n_children (CodeWidgetsSourceListExpandableItem* self)
{
	guint result;
	GeeCollection* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	g_return_val_if_fail (self != NULL, 0U);
	_tmp0_ = self->priv->children_list;
	_tmp1_ = gee_collection_get_size (_tmp0_);
	_tmp2_ = _tmp1_;
	result = (guint) _tmp2_;
	return result;
}

GeeCollection*
code_widgets_source_list_expandable_item_get_children (CodeWidgetsSourceListExpandableItem* self)
{
	GeeCollection* result;
	GeeArrayList* children_list_copy = NULL;
	GeeArrayList* _tmp0_;
	GeeCollection* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = gee_array_list_new (CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	children_list_copy = _tmp0_;
	_tmp1_ = self->priv->children_list;
	gee_array_list_add_all (children_list_copy, _tmp1_);
	result = (GeeCollection*) children_list_copy;
	return result;
}

static void
code_widgets_source_list_expandable_item_real_toggled (CodeWidgetsSourceListExpandableItem* self)
{
}

static GObject *
code_widgets_source_list_expandable_item_constructor (GType type,
                                                      guint n_construct_properties,
                                                      GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	CodeWidgetsSourceListExpandableItem * self;
	parent_class = G_OBJECT_CLASS (code_widgets_source_list_expandable_item_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM, CodeWidgetsSourceListExpandableItem);
	code_widgets_source_list_item_set_editable ((CodeWidgetsSourceListItem*) self, FALSE);
	return obj;
}

static void
code_widgets_source_list_expandable_item_class_init (CodeWidgetsSourceListExpandableItemClass * klass,
                                                     gpointer klass_data)
{
	code_widgets_source_list_expandable_item_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &CodeWidgetsSourceListExpandableItem_private_offset);
	((CodeWidgetsSourceListExpandableItemClass *) klass)->toggled = code_widgets_source_list_expandable_item_real_toggled;
	G_OBJECT_CLASS (klass)->get_property = _vala_code_widgets_source_list_expandable_item_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_code_widgets_source_list_expandable_item_set_property;
	G_OBJECT_CLASS (klass)->constructor = code_widgets_source_list_expandable_item_constructor;
	G_OBJECT_CLASS (klass)->finalize = code_widgets_source_list_expandable_item_finalize;
	/**
	         * Whether the item is collapsible or not.
	         *
	         * When set to //false//, the item is //always// expanded and the expander is
	         * not shown. Please note that this will also affect the value returned by the
	         * {@link Code.Widgets.SourceList.ExpandableItem.expanded} property.
	         *
	         * @see Code.Widgets.SourceList.ExpandableItem.expanded
	         * @since 0.2
	         */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_COLLAPSIBLE_PROPERTY, code_widgets_source_list_expandable_item_properties[CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_COLLAPSIBLE_PROPERTY] = g_param_spec_boolean ("collapsible", "collapsible", "collapsible", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_EXPANDED_PROPERTY, code_widgets_source_list_expandable_item_properties[CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_EXPANDED_PROPERTY] = g_param_spec_boolean ("expanded", "expanded", "expanded", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	         * Number of children contained by the item.
	         *
	         * @since 0.2
	         */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_N_CHILDREN_PROPERTY, code_widgets_source_list_expandable_item_properties[CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_N_CHILDREN_PROPERTY] = g_param_spec_uint ("n-children", "n-children", "n-children", 0, G_MAXUINT, 0U, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/**
	         * The item's children.
	         *
	         * This returns a newly-created list containing the children.
	         * It's safe to iterate it while removing items with
	         * {@link Code.Widgets.SourceList.ExpandableItem.remove}
	         *
	         * @since 0.2
	         */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_CHILDREN_PROPERTY, code_widgets_source_list_expandable_item_properties[CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_CHILDREN_PROPERTY] = g_param_spec_object ("children", "children", "children", GEE_TYPE_COLLECTION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/**
	         * Emitted when an item is added.
	         *
	         * @param item Item added.
	         * @see Code.Widgets.SourceList.ExpandableItem.add
	         * @since 0.2
	         */
	code_widgets_source_list_expandable_item_signals[CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_CHILD_ADDED_SIGNAL] = g_signal_new ("child-added", CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM);
	/**
	         * Emitted when an item is removed.
	         *
	         * @param item Item removed.
	         * @see Code.Widgets.SourceList.ExpandableItem.remove
	         * @since 0.2
	         */
	code_widgets_source_list_expandable_item_signals[CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_CHILD_REMOVED_SIGNAL] = g_signal_new ("child-removed", CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM);
	/**
	         * Emitted when the item is expanded or collapsed.
	         *
	         * @since 0.2
	         */
	code_widgets_source_list_expandable_item_signals[CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_TOGGLED_SIGNAL] = g_signal_new ("toggled", CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (CodeWidgetsSourceListExpandableItemClass, toggled), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
code_widgets_source_list_expandable_item_instance_init (CodeWidgetsSourceListExpandableItem * self,
                                                        gpointer klass)
{
	GeeArrayList* _tmp0_;
	self->priv = code_widgets_source_list_expandable_item_get_instance_private (self);
	self->priv->_collapsible = TRUE;
	self->priv->_expanded = FALSE;
	_tmp0_ = gee_array_list_new (CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->priv->children_list = (GeeCollection*) _tmp0_;
}

static void
code_widgets_source_list_expandable_item_finalize (GObject * obj)
{
	CodeWidgetsSourceListExpandableItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM, CodeWidgetsSourceListExpandableItem);
	_g_object_unref0 (self->priv->children_list);
	G_OBJECT_CLASS (code_widgets_source_list_expandable_item_parent_class)->finalize (obj);
}

/**
     * An item that can contain more items.
     *
     * It supports all the properties inherited from {@link Code.Widgets.SourceList.Item},
     * and behaves like a normal item, except when it is located at the root level; in that case,
     * the following properties are ignored by the widget:
     *
     * * {@link Code.Widgets.SourceList.Item.selectable}
     * * {@link Code.Widgets.SourceList.Item.editable}
     * * {@link Code.Widgets.SourceList.Item.icon}
     * * {@link Code.Widgets.SourceList.Item.activatable}
     * * {@link Code.Widgets.SourceList.Item.badge}
     *
     * Root-level expandable items (i.e. Main Categories) are ''not'' displayed when they contain
     * zero visible children.
     *
     * @since 0.2
     */
 G_GNUC_NO_INLINE static GType
code_widgets_source_list_expandable_item_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (CodeWidgetsSourceListExpandableItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) code_widgets_source_list_expandable_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CodeWidgetsSourceListExpandableItem), 0, (GInstanceInitFunc) code_widgets_source_list_expandable_item_instance_init, NULL };
	GType code_widgets_source_list_expandable_item_type_id;
	code_widgets_source_list_expandable_item_type_id = g_type_register_static (CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM, "CodeWidgetsSourceListExpandableItem", &g_define_type_info, G_TYPE_FLAG_NONE);
	CodeWidgetsSourceListExpandableItem_private_offset = g_type_add_instance_private (code_widgets_source_list_expandable_item_type_id, sizeof (CodeWidgetsSourceListExpandableItemPrivate));
	return code_widgets_source_list_expandable_item_type_id;
}

GType
code_widgets_source_list_expandable_item_get_type (void)
{
	static gsize code_widgets_source_list_expandable_item_type_id__once = 0;
	if (g_once_init_enter (&code_widgets_source_list_expandable_item_type_id__once)) {
		GType code_widgets_source_list_expandable_item_type_id;
		code_widgets_source_list_expandable_item_type_id = code_widgets_source_list_expandable_item_get_type_once ();
		g_once_init_leave (&code_widgets_source_list_expandable_item_type_id__once, code_widgets_source_list_expandable_item_type_id);
	}
	return code_widgets_source_list_expandable_item_type_id__once;
}

static void
_vala_code_widgets_source_list_expandable_item_get_property (GObject * object,
                                                             guint property_id,
                                                             GValue * value,
                                                             GParamSpec * pspec)
{
	CodeWidgetsSourceListExpandableItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM, CodeWidgetsSourceListExpandableItem);
	switch (property_id) {
		case CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_COLLAPSIBLE_PROPERTY:
		g_value_set_boolean (value, code_widgets_source_list_expandable_item_get_collapsible (self));
		break;
		case CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_EXPANDED_PROPERTY:
		g_value_set_boolean (value, code_widgets_source_list_expandable_item_get_expanded (self));
		break;
		case CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_N_CHILDREN_PROPERTY:
		g_value_set_uint (value, code_widgets_source_list_expandable_item_get_n_children (self));
		break;
		case CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_CHILDREN_PROPERTY:
		g_value_take_object (value, code_widgets_source_list_expandable_item_get_children (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_code_widgets_source_list_expandable_item_set_property (GObject * object,
                                                             guint property_id,
                                                             const GValue * value,
                                                             GParamSpec * pspec)
{
	CodeWidgetsSourceListExpandableItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM, CodeWidgetsSourceListExpandableItem);
	switch (property_id) {
		case CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_COLLAPSIBLE_PROPERTY:
		code_widgets_source_list_expandable_item_set_collapsible (self, g_value_get_boolean (value));
		break;
		case CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_EXPANDED_PROPERTY:
		code_widgets_source_list_expandable_item_set_expanded (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
code_widgets_source_list_data_model_get_instance_private (CodeWidgetsSourceListDataModel* self)
{
	return G_STRUCT_MEMBER_P (self, CodeWidgetsSourceListDataModel_private_offset);
}

static GType
code_widgets_source_list_data_model_column_type (CodeWidgetsSourceListDataModelColumn self)
{
	GType result;
	switch (self) {
		case CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_COLUMN_ITEM:
		{
			result = CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM;
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}

 G_GNUC_NO_INLINE static GType
code_widgets_source_list_data_model_column_get_type_once (void)
{
	static const GEnumValue values[] = {{CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_COLUMN_ITEM, "CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_COLUMN_ITEM", "item"}, {CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_COLUMN_N_COLUMNS, "CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_COLUMN_N_COLUMNS", "n-columns"}, {0, NULL, NULL}};
	GType code_widgets_source_list_data_model_column_type_id;
	code_widgets_source_list_data_model_column_type_id = g_enum_register_static ("CodeWidgetsSourceListDataModelColumn", values);
	return code_widgets_source_list_data_model_column_type_id;
}

static GType
code_widgets_source_list_data_model_column_get_type (void)
{
	static gsize code_widgets_source_list_data_model_column_type_id__once = 0;
	if (g_once_init_enter (&code_widgets_source_list_data_model_column_type_id__once)) {
		GType code_widgets_source_list_data_model_column_type_id;
		code_widgets_source_list_data_model_column_type_id = code_widgets_source_list_data_model_column_get_type_once ();
		g_once_init_leave (&code_widgets_source_list_data_model_column_type_id__once, code_widgets_source_list_data_model_column_type_id);
	}
	return code_widgets_source_list_data_model_column_type_id__once;
}

static CodeWidgetsSourceListDataModel*
code_widgets_source_list_data_model_construct (GType object_type)
{
	CodeWidgetsSourceListDataModel * self = NULL;
	self = (CodeWidgetsSourceListDataModel*) g_object_new (object_type, NULL);
	return self;
}

static CodeWidgetsSourceListDataModel*
code_widgets_source_list_data_model_new (void)
{
	return code_widgets_source_list_data_model_construct (CODE_WIDGETS_SOURCE_LIST_TYPE_DATA_MODEL);
}

static gboolean
code_widgets_source_list_data_model_has_item (CodeWidgetsSourceListDataModel* self,
                                              CodeWidgetsSourceListItem* item)
{
	GeeHashMap* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (item != NULL, FALSE);
	_tmp0_ = self->priv->items;
	result = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, item);
	return result;
}

static void
code_widgets_source_list_data_model_update_item (CodeWidgetsSourceListDataModel* self,
                                                 CodeWidgetsSourceListItem* item)
{
	CodeWidgetsSourceListExpandableItem* _tmp0_;
	CodeWidgetsSourceListExpandableItem* _tmp1_;
	CodeWidgetsSourceListDataModelNodeWrapper* node_reference = NULL;
	GeeHashMap* _tmp2_;
	gpointer _tmp3_;
	CodeWidgetsSourceListDataModelNodeWrapper* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	if (!code_widgets_source_list_data_model_has_item (self, item)) {
		return;
	}
	_tmp0_ = code_widgets_source_list_data_model_get_root (self);
	_tmp1_ = _tmp0_;
	_vala_assert (_tmp1_ != NULL, "root != null");
	_tmp2_ = self->priv->items;
	_tmp3_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp2_, item);
	node_reference = (CodeWidgetsSourceListDataModelNodeWrapper*) _tmp3_;
	_tmp4_ = node_reference;
	if (_tmp4_ != NULL) {
		GtkTreePath* path = NULL;
		CodeWidgetsSourceListDataModelNodeWrapper* _tmp5_;
		GtkTreePath* _tmp6_;
		GtkTreePath* _tmp7_;
		GtkTreeIter* iter = NULL;
		CodeWidgetsSourceListDataModelNodeWrapper* _tmp8_;
		GtkTreeIter* _tmp9_;
		GtkTreeIter* _tmp10_;
		gboolean _tmp11_ = FALSE;
		GtkTreePath* _tmp12_;
		_tmp5_ = node_reference;
		_tmp6_ = code_widgets_source_list_data_model_node_wrapper_get_path (_tmp5_);
		_tmp7_ = _tmp6_;
		path = _tmp7_;
		_tmp8_ = node_reference;
		_tmp9_ = code_widgets_source_list_data_model_node_wrapper_get_iter (_tmp8_);
		_tmp10_ = _tmp9_;
		iter = _tmp10_;
		_tmp12_ = path;
		if (_tmp12_ != NULL) {
			GtkTreeIter* _tmp13_;
			_tmp13_ = iter;
			_tmp11_ = _tmp13_ != NULL;
		} else {
			_tmp11_ = FALSE;
		}
		if (_tmp11_) {
			GtkTreeStore* _tmp14_;
			GtkTreePath* _tmp15_;
			GtkTreeIter* _tmp16_;
			GtkTreeIter _tmp17_;
			_tmp14_ = self->priv->child_tree;
			_tmp15_ = path;
			_tmp16_ = iter;
			_tmp17_ = *_tmp16_;
			gtk_tree_model_row_changed ((GtkTreeModel*) _tmp14_, _tmp15_, &_tmp17_);
			g_signal_emit (self, code_widgets_source_list_data_model_signals[CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_ITEM_UPDATED_SIGNAL], 0, item);
		}
		__vala_GtkTreeIter_free0 (iter);
		__vala_GtkTreePath_free0 (path);
	}
	_code_widgets_source_list_data_model_node_wrapper_unref0 (node_reference);
}

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 void
code_widgets_source_list_data_model_add_item (CodeWidgetsSourceListDataModel* self,
                                              CodeWidgetsSourceListItem* item)
{
	CodeWidgetsSourceListExpandableItem* _tmp0_;
	CodeWidgetsSourceListExpandableItem* _tmp1_;
	GtkTreeIter* parent_child_iter = NULL;
	GtkTreeIter* child_iter = NULL;
	CodeWidgetsSourceListExpandableItem* parent = NULL;
	CodeWidgetsSourceListExpandableItem* _tmp2_;
	CodeWidgetsSourceListExpandableItem* _tmp3_;
	CodeWidgetsSourceListExpandableItem* _tmp4_;
	gboolean _tmp5_ = FALSE;
	CodeWidgetsSourceListExpandableItem* _tmp6_;
	GtkTreeStore* _tmp15_;
	GtkTreeIter* _tmp16_;
	GtkTreeIter _tmp17_ = {0};
	GtkTreeIter _tmp18_;
	GtkTreeIter* _tmp19_;
	GtkTreeStore* _tmp20_;
	GtkTreeIter* _tmp21_;
	GtkTreeIter _tmp22_;
	GeeHashMap* _tmp23_;
	GtkTreeStore* _tmp24_;
	GtkTreeIter* _tmp25_;
	GtkTreeIter _tmp26_;
	CodeWidgetsSourceListDataModelNodeWrapper* _tmp27_;
	CodeWidgetsSourceListDataModelNodeWrapper* _tmp28_;
	CodeWidgetsSourceListExpandableItem* _tmp29_;
	CodeWidgetsSourceListExpandableItem* expandable = NULL;
	CodeWidgetsSourceListExpandableItem* _tmp30_;
	CodeWidgetsSourceListExpandableItem* _tmp31_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	_vala_return_if_fail (!code_widgets_source_list_data_model_has_item (self, item), "!has_item (item)");
	_tmp0_ = code_widgets_source_list_data_model_get_root (self);
	_tmp1_ = _tmp0_;
	_vala_assert (_tmp1_ != NULL, "root != null");
	parent_child_iter = NULL;
	_tmp2_ = code_widgets_source_list_item_get_parent (item);
	_tmp3_ = _tmp2_;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	parent = _tmp4_;
	_tmp6_ = parent;
	if (_tmp6_ != NULL) {
		CodeWidgetsSourceListExpandableItem* _tmp7_;
		CodeWidgetsSourceListExpandableItem* _tmp8_;
		CodeWidgetsSourceListExpandableItem* _tmp9_;
		_tmp7_ = parent;
		_tmp8_ = code_widgets_source_list_data_model_get_root (self);
		_tmp9_ = _tmp8_;
		_tmp5_ = _tmp7_ != _tmp9_;
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		CodeWidgetsSourceListExpandableItem* _tmp10_;
		CodeWidgetsSourceListExpandableItem* _tmp12_;
		GtkTreeIter* _tmp13_;
		GtkTreeIter* _tmp14_;
		_tmp10_ = parent;
		if (!code_widgets_source_list_data_model_has_item (self, (CodeWidgetsSourceListItem*) _tmp10_)) {
			CodeWidgetsSourceListExpandableItem* _tmp11_;
			_tmp11_ = parent;
			code_widgets_source_list_data_model_add_item (self, (CodeWidgetsSourceListItem*) _tmp11_);
		}
		_tmp12_ = parent;
		_tmp13_ = code_widgets_source_list_data_model_get_item_child_iter (self, (CodeWidgetsSourceListItem*) _tmp12_);
		__vala_GtkTreeIter_free0 (parent_child_iter);
		parent_child_iter = _tmp13_;
		_tmp14_ = parent_child_iter;
		_vala_assert (_tmp14_ != NULL, "parent_child_iter != null");
	}
	_tmp15_ = self->priv->child_tree;
	_tmp16_ = parent_child_iter;
	gtk_tree_store_append (_tmp15_, &_tmp17_, _tmp16_);
	__vala_GtkTreeIter_free0 (child_iter);
	_tmp18_ = _tmp17_;
	_tmp19_ = __vala_GtkTreeIter_copy0 (&_tmp18_);
	child_iter = _tmp19_;
	_tmp20_ = self->priv->child_tree;
	_tmp21_ = child_iter;
	_tmp22_ = *_tmp21_;
	gtk_tree_store_set (_tmp20_, &_tmp22_, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_COLUMN_ITEM, item, -1, -1);
	_tmp23_ = self->priv->items;
	_tmp24_ = self->priv->child_tree;
	_tmp25_ = child_iter;
	_tmp26_ = *_tmp25_;
	_tmp27_ = code_widgets_source_list_data_model_node_wrapper_new ((GtkTreeModel*) _tmp24_, &_tmp26_);
	_tmp28_ = _tmp27_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp23_, item, _tmp28_);
	_code_widgets_source_list_data_model_node_wrapper_unref0 (_tmp28_);
	g_signal_emit (self, code_widgets_source_list_data_model_signals[CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_ITEM_UPDATED_SIGNAL], 0, item);
	code_widgets_source_list_data_model_add_property_monitor (self, item);
	_tmp29_ = parent;
	code_widgets_source_list_data_model_push_parent_update (self, _tmp29_);
	_tmp30_ = _g_object_ref0 (CODE_WIDGETS_SOURCE_LIST_IS_EXPANDABLE_ITEM (item) ? ((CodeWidgetsSourceListExpandableItem*) item) : NULL);
	expandable = _tmp30_;
	_tmp31_ = expandable;
	if (_tmp31_ != NULL) {
		CodeWidgetsSourceListExpandableItem* _tmp42_;
		{
			GeeIterator* _child_item_it = NULL;
			CodeWidgetsSourceListExpandableItem* _tmp32_;
			GeeCollection* _tmp33_;
			GeeCollection* _tmp34_;
			GeeCollection* _tmp35_;
			GeeIterator* _tmp36_;
			GeeIterator* _tmp37_;
			_tmp32_ = expandable;
			_tmp33_ = code_widgets_source_list_expandable_item_get_children (_tmp32_);
			_tmp34_ = _tmp33_;
			_tmp35_ = _tmp34_;
			_tmp36_ = gee_iterable_iterator ((GeeIterable*) _tmp35_);
			_tmp37_ = _tmp36_;
			_g_object_unref0 (_tmp35_);
			_child_item_it = _tmp37_;
			while (TRUE) {
				GeeIterator* _tmp38_;
				CodeWidgetsSourceListItem* child_item = NULL;
				GeeIterator* _tmp39_;
				gpointer _tmp40_;
				CodeWidgetsSourceListItem* _tmp41_;
				_tmp38_ = _child_item_it;
				if (!gee_iterator_next (_tmp38_)) {
					break;
				}
				_tmp39_ = _child_item_it;
				_tmp40_ = gee_iterator_get (_tmp39_);
				child_item = (CodeWidgetsSourceListItem*) _tmp40_;
				_tmp41_ = child_item;
				code_widgets_source_list_data_model_add_item (self, _tmp41_);
				_g_object_unref0 (child_item);
			}
			_g_object_unref0 (_child_item_it);
		}
		_tmp42_ = expandable;
		code_widgets_source_list_data_model_add_children_monitor (self, _tmp42_);
	}
	_g_object_unref0 (expandable);
	_g_object_unref0 (parent);
	__vala_GtkTreeIter_free0 (child_iter);
	__vala_GtkTreeIter_free0 (parent_child_iter);
}

static void
code_widgets_source_list_data_model_remove_item (CodeWidgetsSourceListDataModel* self,
                                                 CodeWidgetsSourceListItem* item)
{
	CodeWidgetsSourceListExpandableItem* _tmp0_;
	CodeWidgetsSourceListExpandableItem* _tmp1_;
	GtkTreeIter* child_iter = NULL;
	GtkTreeIter* _tmp2_;
	GeeHashMap* _tmp3_;
	GtkTreeIter* _tmp4_;
	CodeWidgetsSourceListExpandableItem* _tmp6_;
	CodeWidgetsSourceListExpandableItem* _tmp7_;
	CodeWidgetsSourceListExpandableItem* expandable = NULL;
	CodeWidgetsSourceListExpandableItem* _tmp8_;
	CodeWidgetsSourceListExpandableItem* _tmp9_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	_vala_return_if_fail (code_widgets_source_list_data_model_has_item (self, item), "has_item (item)");
	_tmp0_ = code_widgets_source_list_data_model_get_root (self);
	_tmp1_ = _tmp0_;
	_vala_assert (_tmp1_ != NULL, "root != null");
	code_widgets_source_list_data_model_remove_property_monitor (self, item);
	_tmp2_ = code_widgets_source_list_data_model_get_item_child_iter (self, item);
	child_iter = _tmp2_;
	_tmp3_ = self->priv->items;
	gee_abstract_map_unset ((GeeAbstractMap*) _tmp3_, item, NULL);
	_tmp4_ = child_iter;
	if (_tmp4_ != NULL) {
		GtkTreeStore* _tmp5_;
		_tmp5_ = self->priv->child_tree;
		gtk_tree_store_remove (_tmp5_, child_iter);
	}
	_tmp6_ = code_widgets_source_list_item_get_parent (item);
	_tmp7_ = _tmp6_;
	code_widgets_source_list_data_model_push_parent_update (self, _tmp7_);
	_tmp8_ = _g_object_ref0 (CODE_WIDGETS_SOURCE_LIST_IS_EXPANDABLE_ITEM (item) ? ((CodeWidgetsSourceListExpandableItem*) item) : NULL);
	expandable = _tmp8_;
	_tmp9_ = expandable;
	if (_tmp9_ != NULL) {
		CodeWidgetsSourceListExpandableItem* _tmp10_;
		_tmp10_ = expandable;
		code_widgets_source_list_data_model_remove_children_monitor (self, _tmp10_);
		{
			GeeIterator* _child_item_it = NULL;
			CodeWidgetsSourceListExpandableItem* _tmp11_;
			GeeCollection* _tmp12_;
			GeeCollection* _tmp13_;
			GeeCollection* _tmp14_;
			GeeIterator* _tmp15_;
			GeeIterator* _tmp16_;
			_tmp11_ = expandable;
			_tmp12_ = code_widgets_source_list_expandable_item_get_children (_tmp11_);
			_tmp13_ = _tmp12_;
			_tmp14_ = _tmp13_;
			_tmp15_ = gee_iterable_iterator ((GeeIterable*) _tmp14_);
			_tmp16_ = _tmp15_;
			_g_object_unref0 (_tmp14_);
			_child_item_it = _tmp16_;
			while (TRUE) {
				GeeIterator* _tmp17_;
				CodeWidgetsSourceListItem* child_item = NULL;
				GeeIterator* _tmp18_;
				gpointer _tmp19_;
				CodeWidgetsSourceListItem* _tmp20_;
				_tmp17_ = _child_item_it;
				if (!gee_iterator_next (_tmp17_)) {
					break;
				}
				_tmp18_ = _child_item_it;
				_tmp19_ = gee_iterator_get (_tmp18_);
				child_item = (CodeWidgetsSourceListItem*) _tmp19_;
				_tmp20_ = child_item;
				code_widgets_source_list_data_model_remove_item (self, _tmp20_);
				_g_object_unref0 (child_item);
			}
			_g_object_unref0 (_child_item_it);
		}
	}
	_g_object_unref0 (expandable);
	__vala_GtkTreeIter_free0 (child_iter);
}

static void
_code_widgets_source_list_data_model_on_item_prop_changed_code_widgets_source_list_data_model_item_monitor_changed (CodeWidgetsSourceListDataModelItemMonitor* _sender,
                                                                                                                    CodeWidgetsSourceListItem* _self_,
                                                                                                                    const gchar* prop_name,
                                                                                                                    gpointer self)
{
	code_widgets_source_list_data_model_on_item_prop_changed ((CodeWidgetsSourceListDataModel*) self, _self_, prop_name);
}

static void
code_widgets_source_list_data_model_add_property_monitor (CodeWidgetsSourceListDataModel* self,
                                                          CodeWidgetsSourceListItem* item)
{
	CodeWidgetsSourceListDataModelItemMonitor* wrapper = NULL;
	CodeWidgetsSourceListDataModelItemMonitor* _tmp0_;
	GeeHashMap* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	_tmp0_ = code_widgets_source_list_data_model_item_monitor_new (item);
	wrapper = _tmp0_;
	_tmp1_ = self->priv->monitors;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp1_, item, wrapper);
	g_signal_connect_object (wrapper, "changed", (GCallback) _code_widgets_source_list_data_model_on_item_prop_changed_code_widgets_source_list_data_model_item_monitor_changed, self, 0);
	_code_widgets_source_list_data_model_item_monitor_unref0 (wrapper);
}

static void
code_widgets_source_list_data_model_remove_property_monitor (CodeWidgetsSourceListDataModel* self,
                                                             CodeWidgetsSourceListItem* item)
{
	CodeWidgetsSourceListDataModelItemMonitor* wrapper = NULL;
	GeeHashMap* _tmp0_;
	gpointer _tmp1_;
	CodeWidgetsSourceListDataModelItemMonitor* _tmp2_;
	GeeHashMap* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	_tmp0_ = self->priv->monitors;
	_tmp1_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, item);
	wrapper = (CodeWidgetsSourceListDataModelItemMonitor*) _tmp1_;
	_tmp2_ = wrapper;
	if (_tmp2_ != NULL) {
		CodeWidgetsSourceListDataModelItemMonitor* _tmp3_;
		guint _tmp4_;
		_tmp3_ = wrapper;
		g_signal_parse_name ("changed", CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_ITEM_MONITOR, &_tmp4_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_tmp3_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp4_, 0, NULL, (GCallback) _code_widgets_source_list_data_model_on_item_prop_changed_code_widgets_source_list_data_model_item_monitor_changed, self);
	}
	_tmp5_ = self->priv->monitors;
	gee_abstract_map_unset ((GeeAbstractMap*) _tmp5_, item, NULL);
	_code_widgets_source_list_data_model_item_monitor_unref0 (wrapper);
}

static void
_code_widgets_source_list_data_model_on_item_child_added_code_widgets_source_list_expandable_item_child_added (CodeWidgetsSourceListExpandableItem* _sender,
                                                                                                               CodeWidgetsSourceListItem* item,
                                                                                                               gpointer self)
{
	code_widgets_source_list_data_model_on_item_child_added ((CodeWidgetsSourceListDataModel*) self, item);
}

static void
_code_widgets_source_list_data_model_on_item_child_removed_code_widgets_source_list_expandable_item_child_removed (CodeWidgetsSourceListExpandableItem* _sender,
                                                                                                                   CodeWidgetsSourceListItem* item,
                                                                                                                   gpointer self)
{
	code_widgets_source_list_data_model_on_item_child_removed ((CodeWidgetsSourceListDataModel*) self, item);
}

static void
code_widgets_source_list_data_model_add_children_monitor (CodeWidgetsSourceListDataModel* self,
                                                          CodeWidgetsSourceListExpandableItem* item)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	g_signal_connect_object (item, "child-added", (GCallback) _code_widgets_source_list_data_model_on_item_child_added_code_widgets_source_list_expandable_item_child_added, self, G_CONNECT_AFTER);
	g_signal_connect_object (item, "child-removed", (GCallback) _code_widgets_source_list_data_model_on_item_child_removed_code_widgets_source_list_expandable_item_child_removed, self, G_CONNECT_AFTER);
}

static void
code_widgets_source_list_data_model_remove_children_monitor (CodeWidgetsSourceListDataModel* self,
                                                             CodeWidgetsSourceListExpandableItem* item)
{
	guint _tmp0_;
	guint _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	g_signal_parse_name ("child-added", CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM, &_tmp0_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (item, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp0_, 0, NULL, (GCallback) _code_widgets_source_list_data_model_on_item_child_added_code_widgets_source_list_expandable_item_child_added, self);
	g_signal_parse_name ("child-removed", CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM, &_tmp1_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (item, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _code_widgets_source_list_data_model_on_item_child_removed_code_widgets_source_list_expandable_item_child_removed, self);
}

static void
code_widgets_source_list_data_model_on_item_child_added (CodeWidgetsSourceListDataModel* self,
                                                         CodeWidgetsSourceListItem* item)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	code_widgets_source_list_data_model_add_item (self, item);
}

static void
code_widgets_source_list_data_model_on_item_child_removed (CodeWidgetsSourceListDataModel* self,
                                                           CodeWidgetsSourceListItem* item)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	code_widgets_source_list_data_model_remove_item (self, item);
}

static void
code_widgets_source_list_data_model_on_item_prop_changed (CodeWidgetsSourceListDataModel* self,
                                                          CodeWidgetsSourceListItem* item,
                                                          const gchar* prop_name)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	g_return_if_fail (prop_name != NULL);
	if (g_strcmp0 (prop_name, "parent") != 0) {
		code_widgets_source_list_data_model_update_item (self, item);
	}
}

/**
         * Pushes a call to update_item() if //parent// is not //null//.
         *
         * This is needed because the visibility of categories depends on their n_children property,
         * and also because item expansion should be updated after adding or removing items.
         * If many updates are pushed, and the item has still not been updated, only one is processed.
         * This guarantees efficiency as updating a category item could trigger expensive actions.
         */
static Block57Data*
block57_data_ref (Block57Data* _data57_)
{
	g_atomic_int_inc (&_data57_->_ref_count_);
	return _data57_;
}

static void
block57_data_unref (void * _userdata_)
{
	Block57Data* _data57_;
	_data57_ = (Block57Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data57_->_ref_count_)) {
		CodeWidgetsSourceListDataModel* self;
		self = _data57_->self;
		_g_object_unref0 (_data57_->parent);
		_g_object_unref0 (self);
		g_slice_free (Block57Data, _data57_);
	}
}

static gboolean
___lambda4_ (Block57Data* _data57_)
{
	CodeWidgetsSourceListDataModel* self;
	gboolean result;
	self = _data57_->self;
	if (_data57_->parent != NULL) {
		code_widgets_source_list_data_model_update_item (self, (CodeWidgetsSourceListItem*) _data57_->parent);
		g_object_set_data_full ((GObject*) _data57_->parent, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_ITEM_PARENT_NEEDS_UPDATE, (gpointer) ((gintptr) FALSE), NULL);
	}
	result = FALSE;
	return result;
}

static gboolean
____lambda4__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda4_ (self);
	return result;
}

static void
code_widgets_source_list_data_model_push_parent_update (CodeWidgetsSourceListDataModel* self,
                                                        CodeWidgetsSourceListExpandableItem* parent)
{
	Block57Data* _data57_;
	CodeWidgetsSourceListExpandableItem* _tmp0_;
	gboolean needs_update = FALSE;
	gconstpointer _tmp1_;
	GtkTreePath* path = NULL;
	GtkTreePath* _tmp2_;
	GtkTreePath* _tmp3_;
	g_return_if_fail (self != NULL);
	_data57_ = g_slice_new0 (Block57Data);
	_data57_->_ref_count_ = 1;
	_data57_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (parent);
	_g_object_unref0 (_data57_->parent);
	_data57_->parent = _tmp0_;
	if (_data57_->parent == NULL) {
		block57_data_unref (_data57_);
		_data57_ = NULL;
		return;
	}
	_tmp1_ = g_object_get_data ((GObject*) _data57_->parent, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_ITEM_PARENT_NEEDS_UPDATE);
	needs_update = (gboolean) ((gintptr) _tmp1_);
	if (needs_update) {
		block57_data_unref (_data57_);
		_data57_ = NULL;
		return;
	}
	_tmp2_ = code_widgets_source_list_data_model_get_item_path (self, (CodeWidgetsSourceListItem*) _data57_->parent);
	path = _tmp2_;
	_tmp3_ = path;
	if (_tmp3_ != NULL) {
		g_object_set_data_full ((GObject*) _data57_->parent, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_ITEM_PARENT_NEEDS_UPDATE, (gpointer) ((gintptr) TRUE), NULL);
		g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ____lambda4__gsource_func, block57_data_ref (_data57_), block57_data_unref);
	}
	__vala_GtkTreePath_free0 (path);
	block57_data_unref (_data57_);
	_data57_ = NULL;
}

/**
         * Returns the Item pointed by iter, or null if the iter doesn't refer to a valid item.
         */
static CodeWidgetsSourceListItem*
code_widgets_source_list_data_model_get_item (CodeWidgetsSourceListDataModel* self,
                                              GtkTreeIter* iter)
{
	CodeWidgetsSourceListItem* item = NULL;
	GtkTreeIter _tmp0_;
	CodeWidgetsSourceListItem* _tmp1_ = NULL;
	CodeWidgetsSourceListItem* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (iter != NULL, NULL);
	_tmp0_ = *iter;
	gtk_tree_model_get ((GtkTreeModel*) self, &_tmp0_, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_COLUMN_ITEM, &_tmp1_, -1, -1);
	_g_object_unref0 (item);
	item = _tmp1_;
	result = item;
	return result;
}

/**
         * Returns the Item pointed by path, or null if the path doesn't refer to a valid item.
         */
static CodeWidgetsSourceListItem*
code_widgets_source_list_data_model_get_item_from_path (CodeWidgetsSourceListDataModel* self,
                                                        GtkTreePath* path)
{
	GtkTreeIter iter = {0};
	GtkTreeIter _tmp0_ = {0};
	gboolean _tmp1_;
	CodeWidgetsSourceListItem* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (path != NULL, NULL);
	_tmp1_ = gtk_tree_model_get_iter ((GtkTreeModel*) self, &_tmp0_, path);
	iter = _tmp0_;
	if (_tmp1_) {
		GtkTreeIter _tmp2_;
		CodeWidgetsSourceListItem* _tmp3_;
		_tmp2_ = iter;
		_tmp3_ = code_widgets_source_list_data_model_get_item (self, &_tmp2_);
		result = _tmp3_;
		return result;
	}
	result = NULL;
	return result;
}

/**
         * Returns a newly-created path pointing to the item, or null in case a valid path
         * is not found.
         */
static GtkTreePath*
code_widgets_source_list_data_model_get_item_path (CodeWidgetsSourceListDataModel* self,
                                                   CodeWidgetsSourceListItem* item)
{
	GtkTreePath* path = NULL;
	GtkTreePath* child_path = NULL;
	GtkTreePath* _tmp0_;
	GtkTreePath* _tmp1_;
	GtkTreePath* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (item != NULL, NULL);
	path = NULL;
	_tmp0_ = code_widgets_source_list_data_model_get_item_child_path (self, item);
	child_path = _tmp0_;
	_tmp1_ = child_path;
	if (_tmp1_ != NULL) {
		GtkTreePath* _tmp2_;
		GtkTreePath* _tmp3_;
		_tmp2_ = child_path;
		_tmp3_ = gtk_tree_model_filter_convert_child_path_to_path ((GtkTreeModelFilter*) self, _tmp2_);
		__vala_GtkTreePath_free0 (path);
		path = _tmp3_;
	}
	result = path;
	__vala_GtkTreePath_free0 (child_path);
	return result;
}

/**
         * Returns a newly-created iterator pointing to the item, or null in case a valid iter
         * was not found.
         */
static GtkTreeIter*
code_widgets_source_list_data_model_get_item_iter (CodeWidgetsSourceListDataModel* self,
                                                   CodeWidgetsSourceListItem* item)
{
	GtkTreeIter* child_iter = NULL;
	GtkTreeIter* _tmp0_;
	GtkTreeIter* _tmp1_;
	GtkTreeIter* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (item != NULL, NULL);
	_tmp0_ = code_widgets_source_list_data_model_get_item_child_iter (self, item);
	child_iter = _tmp0_;
	_tmp1_ = child_iter;
	if (_tmp1_ != NULL) {
		GtkTreeIter iter = {0};
		GtkTreeIter* _tmp2_;
		GtkTreeIter _tmp3_ = {0};
		GtkTreeIter _tmp4_;
		gboolean _tmp5_;
		_tmp2_ = child_iter;
		_tmp4_ = *_tmp2_;
		_tmp5_ = gtk_tree_model_filter_convert_child_iter_to_iter ((GtkTreeModelFilter*) self, &_tmp3_, &_tmp4_);
		iter = _tmp3_;
		if (_tmp5_) {
			GtkTreeIter* _tmp6_;
			_tmp6_ = __vala_GtkTreeIter_copy0 (&iter);
			result = _tmp6_;
			__vala_GtkTreeIter_free0 (child_iter);
			return result;
		}
	}
	result = NULL;
	__vala_GtkTreeIter_free0 (child_iter);
	return result;
}

/**
         * External "extra" filter method.
         */
static void
code_widgets_source_list_data_model_set_filter_func (CodeWidgetsSourceListDataModel* self,
                                                     CodeWidgetsSourceListVisibleFunc visible_func,
                                                     gpointer visible_func_target)
{
	g_return_if_fail (self != NULL);
	self->priv->filter_func = visible_func;
	self->priv->filter_func_target = visible_func_target;
}

/**
         * Checks whether an item is a category (i.e. a root-level expandable item).
         * The caller must pass an iter or path pointing to the item, but not both
         * (one of them must be null.)
         *
         * TODO: instead of checking the position of the iter or path, we should simply
         * check whether the item's parent is the root item and whether the item is
         * expandable. We don't do so right now because vala still allows client code
         * to access the Item.parent property, even though its setter is defined as internal.
         */
static gboolean
code_widgets_source_list_data_model_is_category (CodeWidgetsSourceListDataModel* self,
                                                 CodeWidgetsSourceListItem* item,
                                                 GtkTreeIter* iter,
                                                 GtkTreePath* path)
{
	gboolean is_category = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (item != NULL, FALSE);
	is_category = FALSE;
	if (CODE_WIDGETS_SOURCE_LIST_IS_EXPANDABLE_ITEM (item)) {
		if (iter != NULL) {
			GtkTreeIter _tmp0_;
			_vala_assert (path == NULL, "path == null");
			_tmp0_ = *iter;
			is_category = code_widgets_source_list_data_model_is_iter_at_root_level (self, &_tmp0_);
		} else {
			_vala_assert (iter == NULL, "iter == null");
			is_category = code_widgets_source_list_data_model_is_path_at_root_level (self, path);
		}
	}
	result = is_category;
	return result;
}

static gboolean
code_widgets_source_list_data_model_is_iter_at_root_level (CodeWidgetsSourceListDataModel* self,
                                                           GtkTreeIter* iter)
{
	GtkTreeIter _tmp0_;
	GtkTreePath* _tmp1_;
	GtkTreePath* _tmp2_;
	gboolean _tmp3_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (iter != NULL, FALSE);
	_tmp0_ = *iter;
	_tmp1_ = gtk_tree_model_get_path ((GtkTreeModel*) self, &_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = code_widgets_source_list_data_model_is_path_at_root_level (self, _tmp2_);
	__vala_GtkTreePath_free0 (_tmp2_);
	result = _tmp3_;
	return result;
}

static gboolean
code_widgets_source_list_data_model_is_path_at_root_level (CodeWidgetsSourceListDataModel* self,
                                                           GtkTreePath* path)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (path != NULL, FALSE);
	result = gtk_tree_path_get_depth (path) == 1;
	return result;
}

static void
code_widgets_source_list_data_model_resort (CodeWidgetsSourceListDataModel* self)
{
	GtkTreeStore* _tmp0_;
	GtkTreeStore* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->child_tree;
	gtk_tree_sortable_set_sort_column_id ((GtkTreeSortable*) _tmp0_, GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID, GTK_SORT_ASCENDING);
	_tmp1_ = self->priv->child_tree;
	gtk_tree_sortable_set_sort_column_id ((GtkTreeSortable*) _tmp1_, GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, GTK_SORT_ASCENDING);
}

static gint
code_widgets_source_list_data_model_child_model_sort_func (CodeWidgetsSourceListDataModel* self,
                                                           GtkTreeModel* model,
                                                           GtkTreeIter* a,
                                                           GtkTreeIter* b)
{
	gint order = 0;
	CodeWidgetsSourceListItem* item_a = NULL;
	CodeWidgetsSourceListItem* item_b = NULL;
	GtkTreeStore* _tmp0_;
	GtkTreeIter _tmp1_;
	CodeWidgetsSourceListItem* _tmp2_ = NULL;
	GtkTreeStore* _tmp3_;
	GtkTreeIter _tmp4_;
	CodeWidgetsSourceListItem* _tmp5_ = NULL;
	CodeWidgetsSourceListItem* _tmp6_;
	CodeWidgetsSourceListExpandableItem* _tmp7_;
	CodeWidgetsSourceListExpandableItem* _tmp8_;
	CodeWidgetsSourceListItem* _tmp9_;
	CodeWidgetsSourceListExpandableItem* _tmp10_;
	CodeWidgetsSourceListExpandableItem* _tmp11_;
	CodeWidgetsSourceListSortable* parent = NULL;
	CodeWidgetsSourceListItem* _tmp12_;
	CodeWidgetsSourceListExpandableItem* _tmp13_;
	CodeWidgetsSourceListExpandableItem* _tmp14_;
	CodeWidgetsSourceListSortable* _tmp15_;
	CodeWidgetsSourceListSortable* _tmp16_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (model != NULL, -1);
	g_return_val_if_fail (a != NULL, -1);
	g_return_val_if_fail (b != NULL, -1);
	order = 0;
	_tmp0_ = self->priv->child_tree;
	_tmp1_ = *a;
	gtk_tree_model_get ((GtkTreeModel*) _tmp0_, &_tmp1_, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_COLUMN_ITEM, &_tmp2_, -1, -1);
	_g_object_unref0 (item_a);
	item_a = _tmp2_;
	_tmp3_ = self->priv->child_tree;
	_tmp4_ = *b;
	gtk_tree_model_get ((GtkTreeModel*) _tmp3_, &_tmp4_, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_COLUMN_ITEM, &_tmp5_, -1, -1);
	_g_object_unref0 (item_b);
	item_b = _tmp5_;
	_tmp6_ = item_a;
	_tmp7_ = code_widgets_source_list_item_get_parent (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = item_b;
	_tmp10_ = code_widgets_source_list_item_get_parent (_tmp9_);
	_tmp11_ = _tmp10_;
	_vala_assert (_tmp8_ == _tmp11_, "item_a.parent == item_b.parent");
	_tmp12_ = item_a;
	_tmp13_ = code_widgets_source_list_item_get_parent (_tmp12_);
	_tmp14_ = _tmp13_;
	_tmp15_ = _g_object_ref0 (CODE_WIDGETS_IS_SOURCE_LIST_SORTABLE (_tmp14_) ? ((CodeWidgetsSourceListSortable*) _tmp14_) : NULL);
	parent = _tmp15_;
	_tmp16_ = parent;
	if (_tmp16_ != NULL) {
		CodeWidgetsSourceListSortable* _tmp17_;
		CodeWidgetsSourceListItem* _tmp18_;
		CodeWidgetsSourceListItem* _tmp19_;
		_tmp17_ = parent;
		_tmp18_ = item_a;
		_tmp19_ = item_b;
		order = code_widgets_source_list_sortable_compare (_tmp17_, _tmp18_, _tmp19_);
	}
	result = order;
	_g_object_unref0 (parent);
	_g_object_unref0 (item_b);
	_g_object_unref0 (item_a);
	return result;
}

static GtkTreeIter*
code_widgets_source_list_data_model_get_item_child_iter (CodeWidgetsSourceListDataModel* self,
                                                         CodeWidgetsSourceListItem* item)
{
	GtkTreeIter* child_iter = NULL;
	CodeWidgetsSourceListDataModelNodeWrapper* child_node_wrapper = NULL;
	GeeHashMap* _tmp0_;
	gpointer _tmp1_;
	CodeWidgetsSourceListDataModelNodeWrapper* _tmp2_;
	GtkTreeIter* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (item != NULL, NULL);
	child_iter = NULL;
	_tmp0_ = self->priv->items;
	_tmp1_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, item);
	child_node_wrapper = (CodeWidgetsSourceListDataModelNodeWrapper*) _tmp1_;
	_tmp2_ = child_node_wrapper;
	if (_tmp2_ != NULL) {
		CodeWidgetsSourceListDataModelNodeWrapper* _tmp3_;
		GtkTreeIter* _tmp4_;
		GtkTreeIter* _tmp5_;
		_tmp3_ = child_node_wrapper;
		_tmp4_ = code_widgets_source_list_data_model_node_wrapper_get_iter (_tmp3_);
		_tmp5_ = _tmp4_;
		__vala_GtkTreeIter_free0 (child_iter);
		child_iter = _tmp5_;
	}
	result = child_iter;
	_code_widgets_source_list_data_model_node_wrapper_unref0 (child_node_wrapper);
	return result;
}

static GtkTreePath*
code_widgets_source_list_data_model_get_item_child_path (CodeWidgetsSourceListDataModel* self,
                                                         CodeWidgetsSourceListItem* item)
{
	GtkTreePath* child_path = NULL;
	CodeWidgetsSourceListDataModelNodeWrapper* child_node_wrapper = NULL;
	GeeHashMap* _tmp0_;
	gpointer _tmp1_;
	CodeWidgetsSourceListDataModelNodeWrapper* _tmp2_;
	GtkTreePath* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (item != NULL, NULL);
	child_path = NULL;
	_tmp0_ = self->priv->items;
	_tmp1_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, item);
	child_node_wrapper = (CodeWidgetsSourceListDataModelNodeWrapper*) _tmp1_;
	_tmp2_ = child_node_wrapper;
	if (_tmp2_ != NULL) {
		CodeWidgetsSourceListDataModelNodeWrapper* _tmp3_;
		GtkTreePath* _tmp4_;
		GtkTreePath* _tmp5_;
		_tmp3_ = child_node_wrapper;
		_tmp4_ = code_widgets_source_list_data_model_node_wrapper_get_path (_tmp3_);
		_tmp5_ = _tmp4_;
		__vala_GtkTreePath_free0 (child_path);
		child_path = _tmp5_;
	}
	result = child_path;
	_code_widgets_source_list_data_model_node_wrapper_unref0 (child_node_wrapper);
	return result;
}

/**
         * Filters the child-tree items based on their "visible" property.
         */
static gboolean
code_widgets_source_list_data_model_filter_visible_func (CodeWidgetsSourceListDataModel* self,
                                                         GtkTreeModel* child_model,
                                                         GtkTreeIter* iter)
{
	gboolean item_visible = FALSE;
	CodeWidgetsSourceListItem* item = NULL;
	GtkTreeStore* _tmp0_;
	GtkTreeIter _tmp1_;
	CodeWidgetsSourceListItem* _tmp2_ = NULL;
	CodeWidgetsSourceListItem* _tmp3_;
	CodeWidgetsSourceListVisibleFunc _tmp27_;
	gpointer _tmp27__target;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (child_model != NULL, FALSE);
	g_return_val_if_fail (iter != NULL, FALSE);
	item_visible = FALSE;
	_tmp0_ = self->priv->child_tree;
	_tmp1_ = *iter;
	gtk_tree_model_get ((GtkTreeModel*) _tmp0_, &_tmp1_, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_COLUMN_ITEM, &_tmp2_, -1, -1);
	_g_object_unref0 (item);
	item = _tmp2_;
	_tmp3_ = item;
	if (_tmp3_ != NULL) {
		CodeWidgetsSourceListItem* _tmp4_;
		gboolean _tmp5_;
		gboolean _tmp6_;
		CodeWidgetsSourceListExpandableItem* expandable = NULL;
		CodeWidgetsSourceListItem* _tmp7_;
		CodeWidgetsSourceListExpandableItem* _tmp8_;
		gboolean _tmp9_ = FALSE;
		CodeWidgetsSourceListExpandableItem* _tmp10_;
		_tmp4_ = item;
		_tmp5_ = code_widgets_source_list_item_get_visible (_tmp4_);
		_tmp6_ = _tmp5_;
		item_visible = _tmp6_;
		_tmp7_ = item;
		_tmp8_ = _g_object_ref0 (CODE_WIDGETS_SOURCE_LIST_IS_EXPANDABLE_ITEM (_tmp7_) ? ((CodeWidgetsSourceListExpandableItem*) _tmp7_) : NULL);
		expandable = _tmp8_;
		_tmp10_ = expandable;
		if (_tmp10_ != NULL) {
			GtkTreeStore* _tmp11_;
			GtkTreeIter _tmp12_;
			_tmp11_ = self->priv->child_tree;
			_tmp12_ = *iter;
			_tmp9_ = gtk_tree_store_iter_depth (_tmp11_, &_tmp12_) == 0;
		} else {
			_tmp9_ = FALSE;
		}
		if (_tmp9_) {
			guint n_visible_children = 0U;
			gboolean _tmp26_ = FALSE;
			n_visible_children = (guint) 0;
			{
				GeeIterator* _child_item_it = NULL;
				CodeWidgetsSourceListExpandableItem* _tmp13_;
				GeeCollection* _tmp14_;
				GeeCollection* _tmp15_;
				GeeCollection* _tmp16_;
				GeeIterator* _tmp17_;
				GeeIterator* _tmp18_;
				_tmp13_ = expandable;
				_tmp14_ = code_widgets_source_list_expandable_item_get_children (_tmp13_);
				_tmp15_ = _tmp14_;
				_tmp16_ = _tmp15_;
				_tmp17_ = gee_iterable_iterator ((GeeIterable*) _tmp16_);
				_tmp18_ = _tmp17_;
				_g_object_unref0 (_tmp16_);
				_child_item_it = _tmp18_;
				while (TRUE) {
					GeeIterator* _tmp19_;
					CodeWidgetsSourceListItem* child_item = NULL;
					GeeIterator* _tmp20_;
					gpointer _tmp21_;
					CodeWidgetsSourceListItem* _tmp22_;
					gboolean _tmp23_;
					gboolean _tmp24_;
					_tmp19_ = _child_item_it;
					if (!gee_iterator_next (_tmp19_)) {
						break;
					}
					_tmp20_ = _child_item_it;
					_tmp21_ = gee_iterator_get (_tmp20_);
					child_item = (CodeWidgetsSourceListItem*) _tmp21_;
					_tmp22_ = child_item;
					_tmp23_ = code_widgets_source_list_item_get_visible (_tmp22_);
					_tmp24_ = _tmp23_;
					if (_tmp24_) {
						guint _tmp25_;
						_tmp25_ = n_visible_children;
						n_visible_children = _tmp25_ + 1;
					}
					_g_object_unref0 (child_item);
				}
				_g_object_unref0 (_child_item_it);
			}
			if (item_visible) {
				_tmp26_ = n_visible_children > ((guint) 0);
			} else {
				_tmp26_ = FALSE;
			}
			item_visible = _tmp26_;
		}
		_g_object_unref0 (expandable);
	}
	_tmp27_ = self->priv->filter_func;
	_tmp27__target = self->priv->filter_func_target;
	if (_tmp27_ != NULL) {
		gboolean _tmp28_ = FALSE;
		if (item_visible) {
			CodeWidgetsSourceListVisibleFunc _tmp29_;
			gpointer _tmp29__target;
			CodeWidgetsSourceListItem* _tmp30_;
			_tmp29_ = self->priv->filter_func;
			_tmp29__target = self->priv->filter_func_target;
			_tmp30_ = item;
			_tmp28_ = _tmp29_ (_tmp30_, _tmp29__target);
		} else {
			_tmp28_ = FALSE;
		}
		item_visible = _tmp28_;
	}
	result = item_visible;
	_g_object_unref0 (item);
	return result;
}

/**
         * TreeDragDest implementation
         */
static gboolean
code_widgets_source_list_data_model_real_drag_data_received (GtkTreeDragDest* base,
                                                             GtkTreePath* dest,
                                                             GtkSelectionData* selection_data)
{
	CodeWidgetsSourceListDataModel * self;
	GtkTreeModel* model = NULL;
	GtkTreePath* src_path = NULL;
	gboolean _tmp0_ = FALSE;
	GtkTreeModel* _tmp1_ = NULL;
	GtkTreePath* _tmp2_ = NULL;
	gboolean _tmp3_;
	GtkTreeModel* _tmp4_;
	gboolean result;
	self = (CodeWidgetsSourceListDataModel*) base;
	g_return_val_if_fail (dest != NULL, FALSE);
	g_return_val_if_fail (selection_data != NULL, FALSE);
	_tmp3_ = gtk_tree_get_row_drag_data (selection_data, &_tmp1_, &_tmp2_);
	_g_object_unref0 (model);
	_tmp4_ = _g_object_ref0 (_tmp1_);
	model = _tmp4_;
	__vala_GtkTreePath_free0 (src_path);
	src_path = _tmp2_;
	if (_tmp3_) {
		GtkTreeModel* _tmp5_;
		GtkTreeStore* _tmp6_;
		_tmp5_ = model;
		_tmp6_ = self->priv->child_tree;
		_tmp0_ = _tmp5_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_tree_model_get_type (), GtkTreeModel);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GtkTreePath* child_dest = NULL;
		GtkTreePath* _tmp7_;
		GtkTreePath* _tmp8_;
		_tmp7_ = gtk_tree_model_filter_convert_path_to_child_path ((GtkTreeModelFilter*) self, dest);
		child_dest = _tmp7_;
		_tmp8_ = child_dest;
		if (_tmp8_ != NULL) {
			GtkTreePath* _tmp9_;
			GtkTreePath* _tmp10_;
			_tmp9_ = child_dest;
			_tmp10_ = src_path;
			if (code_widgets_source_list_data_model_child_tree_drag_data_received (self, _tmp9_, _tmp10_)) {
				result = TRUE;
				__vala_GtkTreePath_free0 (child_dest);
				__vala_GtkTreePath_free0 (src_path);
				_g_object_unref0 (model);
				return result;
			}
		}
		__vala_GtkTreePath_free0 (child_dest);
	}
	result = FALSE;
	__vala_GtkTreePath_free0 (src_path);
	_g_object_unref0 (model);
	return result;
}

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
code_widgets_source_list_data_model_child_tree_drag_data_received (CodeWidgetsSourceListDataModel* self,
                                                                   GtkTreePath* dest,
                                                                   GtkTreePath* src_path)
{
	gboolean retval = FALSE;
	GtkTreeIter src_iter = {0};
	GtkTreeIter dest_iter = {0};
	GtkTreeStore* _tmp0_;
	GtkTreeIter _tmp1_ = {0};
	gboolean _tmp2_;
	GtkTreePath* prev = NULL;
	GtkTreePath* _tmp3_;
	GtkTreePath* _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (dest != NULL, FALSE);
	g_return_val_if_fail (src_path != NULL, FALSE);
	retval = FALSE;
	_tmp0_ = self->priv->child_tree;
	_tmp2_ = gtk_tree_model_get_iter ((GtkTreeModel*) _tmp0_, &_tmp1_, src_path);
	src_iter = _tmp1_;
	if (!_tmp2_) {
		result = FALSE;
		return result;
	}
	_tmp3_ = __vala_GtkTreePath_copy0 (dest);
	prev = _tmp3_;
	_tmp4_ = prev;
	if (!gtk_tree_path_prev (_tmp4_)) {
		GtkTreePath* parent = NULL;
		GtkTreePath* _tmp5_;
		GtkTreeIter* dest_parent = NULL;
		gboolean _tmp6_ = FALSE;
		GtkTreePath* _tmp7_;
		GtkTreeStore* _tmp14_;
		GtkTreeIter* _tmp15_;
		GtkTreeIter _tmp16_ = {0};
		_tmp5_ = __vala_GtkTreePath_copy0 (dest);
		parent = _tmp5_;
		dest_parent = NULL;
		_tmp7_ = parent;
		if (gtk_tree_path_up (_tmp7_)) {
			GtkTreePath* _tmp8_;
			_tmp8_ = parent;
			_tmp6_ = gtk_tree_path_get_depth (_tmp8_) > 0;
		} else {
			_tmp6_ = FALSE;
		}
		if (_tmp6_) {
			GtkTreeStore* _tmp9_;
			GtkTreePath* _tmp10_;
			GtkTreeIter _tmp11_ = {0};
			GtkTreeIter _tmp12_;
			GtkTreeIter* _tmp13_;
			_tmp9_ = self->priv->child_tree;
			_tmp10_ = parent;
			gtk_tree_model_get_iter ((GtkTreeModel*) _tmp9_, &_tmp11_, _tmp10_);
			__vala_GtkTreeIter_free0 (dest_parent);
			_tmp12_ = _tmp11_;
			_tmp13_ = __vala_GtkTreeIter_copy0 (&_tmp12_);
			dest_parent = _tmp13_;
		}
		_tmp14_ = self->priv->child_tree;
		_tmp15_ = dest_parent;
		gtk_tree_store_prepend (_tmp14_, &_tmp16_, _tmp15_);
		dest_iter = _tmp16_;
		retval = TRUE;
		__vala_GtkTreeIter_free0 (dest_parent);
		__vala_GtkTreePath_free0 (parent);
	} else {
		GtkTreeStore* _tmp17_;
		GtkTreePath* _tmp18_;
		GtkTreeIter _tmp19_ = {0};
		gboolean _tmp20_;
		_tmp17_ = self->priv->child_tree;
		_tmp18_ = prev;
		_tmp20_ = gtk_tree_model_get_iter ((GtkTreeModel*) _tmp17_, &_tmp19_, _tmp18_);
		dest_iter = _tmp19_;
		if (_tmp20_) {
			GtkTreeIter tmp_iter = {0};
			GtkTreeIter _tmp21_;
			GtkTreeStore* _tmp22_;
			GtkTreeIter _tmp23_;
			GtkTreeIter _tmp24_ = {0};
			_tmp21_ = dest_iter;
			tmp_iter = _tmp21_;
			_tmp22_ = self->priv->child_tree;
			_tmp23_ = tmp_iter;
			gtk_tree_store_insert_after (_tmp22_, &_tmp24_, NULL, &_tmp23_);
			dest_iter = _tmp24_;
			retval = TRUE;
		}
	}
	if (retval) {
		GtkTreeIter _tmp25_;
		GtkTreeIter _tmp26_;
		CodeWidgetsSourceListItem* item = NULL;
		GtkTreeStore* _tmp27_;
		GtkTreeIter _tmp28_;
		CodeWidgetsSourceListItem* _tmp29_ = NULL;
		CodeWidgetsSourceListItem* _tmp30_;
		CodeWidgetsSourceListItem* _tmp31_;
		CodeWidgetsSourceListSortable* parent = NULL;
		CodeWidgetsSourceListItem* _tmp32_;
		CodeWidgetsSourceListExpandableItem* _tmp33_;
		CodeWidgetsSourceListExpandableItem* _tmp34_;
		CodeWidgetsSourceListSortable* _tmp35_;
		CodeWidgetsSourceListSortable* _tmp36_;
		CodeWidgetsSourceListSortable* _tmp37_;
		CodeWidgetsSourceListItem* _tmp38_;
		_tmp25_ = src_iter;
		_tmp26_ = dest_iter;
		code_widgets_source_list_data_model_recursive_node_copy (self, &_tmp25_, &_tmp26_);
		_tmp27_ = self->priv->child_tree;
		_tmp28_ = src_iter;
		gtk_tree_model_get ((GtkTreeModel*) _tmp27_, &_tmp28_, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_COLUMN_ITEM, &_tmp29_, -1, -1);
		_g_object_unref0 (item);
		item = _tmp29_;
		_tmp30_ = item;
		g_return_val_if_fail (_tmp30_ != NULL, retval);
		_tmp31_ = item;
		code_widgets_source_list_data_model_update_item (self, _tmp31_);
		_tmp32_ = item;
		_tmp33_ = code_widgets_source_list_item_get_parent (_tmp32_);
		_tmp34_ = _tmp33_;
		_tmp35_ = _g_object_ref0 (CODE_WIDGETS_IS_SOURCE_LIST_SORTABLE (_tmp34_) ? ((CodeWidgetsSourceListSortable*) _tmp34_) : NULL);
		parent = _tmp35_;
		_tmp36_ = parent;
		g_return_val_if_fail (_tmp36_ != NULL, retval);
		_tmp37_ = parent;
		_tmp38_ = item;
		g_signal_emit (_tmp37_, code_widgets_source_list_sortable_signals[CODE_WIDGETS_SOURCE_LIST_SORTABLE_USER_MOVED_ITEM_SIGNAL], 0, _tmp38_);
		_g_object_unref0 (parent);
		_g_object_unref0 (item);
	}
	result = retval;
	__vala_GtkTreePath_free0 (prev);
	return result;
}

static void
code_widgets_source_list_data_model_recursive_node_copy (CodeWidgetsSourceListDataModel* self,
                                                         GtkTreeIter* src_iter,
                                                         GtkTreeIter* dest_iter)
{
	GtkTreeIter _tmp0_;
	GtkTreeIter _tmp1_;
	GtkTreeIter child = {0};
	GtkTreeStore* _tmp2_;
	GtkTreeIter _tmp3_;
	GtkTreeIter _tmp4_ = {0};
	gboolean _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (src_iter != NULL);
	g_return_if_fail (dest_iter != NULL);
	_tmp0_ = *src_iter;
	_tmp1_ = *dest_iter;
	code_widgets_source_list_data_model_move_item (self, &_tmp0_, &_tmp1_);
	_tmp2_ = self->priv->child_tree;
	_tmp3_ = *src_iter;
	_tmp5_ = gtk_tree_model_iter_children ((GtkTreeModel*) _tmp2_, &_tmp4_, &_tmp3_);
	child = _tmp4_;
	if (_tmp5_) {
		{
			gboolean _tmp6_ = FALSE;
			_tmp6_ = TRUE;
			while (TRUE) {
				GtkTreeIter copy = {0};
				GtkTreeStore* _tmp9_;
				GtkTreeIter _tmp10_;
				GtkTreeIter _tmp11_ = {0};
				GtkTreeIter _tmp12_;
				GtkTreeIter _tmp13_;
				if (!_tmp6_) {
					GtkTreeStore* _tmp7_;
					gboolean _tmp8_;
					_tmp7_ = self->priv->child_tree;
					_tmp8_ = gtk_tree_model_iter_next ((GtkTreeModel*) _tmp7_, &child);
					if (!_tmp8_) {
						break;
					}
				}
				_tmp6_ = FALSE;
				_tmp9_ = self->priv->child_tree;
				_tmp10_ = *dest_iter;
				gtk_tree_store_append (_tmp9_, &_tmp11_, &_tmp10_);
				copy = _tmp11_;
				_tmp12_ = child;
				_tmp13_ = copy;
				code_widgets_source_list_data_model_recursive_node_copy (self, &_tmp12_, &_tmp13_);
			}
		}
	}
}

static void
code_widgets_source_list_data_model_move_item (CodeWidgetsSourceListDataModel* self,
                                               GtkTreeIter* src_iter,
                                               GtkTreeIter* dest_iter)
{
	CodeWidgetsSourceListItem* item = NULL;
	GtkTreeStore* _tmp0_;
	GtkTreeIter _tmp1_;
	CodeWidgetsSourceListItem* _tmp2_ = NULL;
	GtkTreeStore* _tmp3_;
	GtkTreeIter _tmp4_;
	GeeHashMap* _tmp5_;
	GtkTreeStore* _tmp6_;
	GtkTreeIter _tmp7_;
	CodeWidgetsSourceListDataModelNodeWrapper* _tmp8_;
	CodeWidgetsSourceListDataModelNodeWrapper* _tmp9_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (src_iter != NULL);
	g_return_if_fail (dest_iter != NULL);
	_tmp0_ = self->priv->child_tree;
	_tmp1_ = *src_iter;
	gtk_tree_model_get ((GtkTreeModel*) _tmp0_, &_tmp1_, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_COLUMN_ITEM, &_tmp2_, -1, -1);
	_g_object_unref0 (item);
	item = _tmp2_;
	g_return_if_fail (item != NULL);
	_tmp3_ = self->priv->child_tree;
	_tmp4_ = *dest_iter;
	gtk_tree_store_set (_tmp3_, &_tmp4_, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_COLUMN_ITEM, item, -1, -1);
	_tmp5_ = self->priv->items;
	_tmp6_ = self->priv->child_tree;
	_tmp7_ = *dest_iter;
	_tmp8_ = code_widgets_source_list_data_model_node_wrapper_new ((GtkTreeModel*) _tmp6_, &_tmp7_);
	_tmp9_ = _tmp8_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp5_, item, _tmp9_);
	_code_widgets_source_list_data_model_node_wrapper_unref0 (_tmp9_);
	_g_object_unref0 (item);
}

static gint*
_vala_array_dup1 (gint* self,
                  gssize length)
{
	if (length > 0) {
		return g_memdup2 (self, length * sizeof (gint));
	}
	return NULL;
}

static gint*
_vala_array_dup2 (gint* self,
                  gssize length)
{
	if (length > 0) {
		return g_memdup2 (self, length * sizeof (gint));
	}
	return NULL;
}

static gboolean
code_widgets_source_list_data_model_real_row_drop_possible (GtkTreeDragDest* base,
                                                            GtkTreePath* dest,
                                                            GtkSelectionData* selection_data)
{
	CodeWidgetsSourceListDataModel * self;
	GtkTreeModel* model = NULL;
	GtkTreePath* src_path = NULL;
	gboolean _tmp0_ = FALSE;
	GtkTreeModel* _tmp1_ = NULL;
	GtkTreePath* _tmp2_ = NULL;
	gboolean _tmp3_;
	GtkTreeModel* _tmp4_;
	GtkTreePath* child_dest = NULL;
	GtkTreePath* _tmp7_;
	gboolean _tmp8_ = FALSE;
	GtkTreePath* _tmp9_;
	gint src_depth = 0;
	GtkTreePath* _tmp12_;
	gint dest_depth = 0;
	GtkTreePath* _tmp13_;
	CodeWidgetsSourceListItem* parent = NULL;
	CodeWidgetsSourceListSortable* sortable = NULL;
	CodeWidgetsSourceListItem* _tmp35_;
	CodeWidgetsSourceListSortable* _tmp36_;
	gboolean _tmp37_ = FALSE;
	CodeWidgetsSourceListSortable* _tmp38_;
	CodeWidgetsSourceListItem* dest_item = NULL;
	CodeWidgetsSourceListItem* _tmp40_;
	CodeWidgetsSourceListItem* _tmp41_;
	CodeWidgetsSourceListItem* source_item = NULL;
	GtkTreePath* filter_src_path = NULL;
	GtkTreePath* _tmp42_;
	GtkTreePath* _tmp43_;
	GtkTreePath* _tmp44_;
	CodeWidgetsSourceListItem* _tmp47_;
	CodeWidgetsSourceListSortable* _tmp48_;
	CodeWidgetsSourceListItem* _tmp49_;
	CodeWidgetsSourceListItem* _tmp50_;
	gboolean result;
	self = (CodeWidgetsSourceListDataModel*) base;
	g_return_val_if_fail (dest != NULL, FALSE);
	g_return_val_if_fail (selection_data != NULL, FALSE);
	_tmp3_ = gtk_tree_get_row_drag_data (selection_data, &_tmp1_, &_tmp2_);
	_g_object_unref0 (model);
	_tmp4_ = _g_object_ref0 (_tmp1_);
	model = _tmp4_;
	__vala_GtkTreePath_free0 (src_path);
	src_path = _tmp2_;
	if (!_tmp3_) {
		_tmp0_ = TRUE;
	} else {
		GtkTreeModel* _tmp5_;
		GtkTreeStore* _tmp6_;
		_tmp5_ = model;
		_tmp6_ = self->priv->child_tree;
		_tmp0_ = _tmp5_ != G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_tree_model_get_type (), GtkTreeModel);
	}
	if (_tmp0_) {
		result = FALSE;
		__vala_GtkTreePath_free0 (src_path);
		_g_object_unref0 (model);
		return result;
	}
	_tmp7_ = gtk_tree_model_filter_convert_path_to_child_path ((GtkTreeModelFilter*) self, dest);
	child_dest = _tmp7_;
	_tmp9_ = child_dest;
	if (_tmp9_ == NULL) {
		_tmp8_ = TRUE;
	} else {
		GtkTreePath* _tmp10_;
		GtkTreePath* _tmp11_;
		_tmp10_ = src_path;
		_tmp11_ = child_dest;
		_tmp8_ = gtk_tree_path_compare (_tmp10_, _tmp11_) == 0;
	}
	if (_tmp8_) {
		result = FALSE;
		__vala_GtkTreePath_free0 (child_dest);
		__vala_GtkTreePath_free0 (src_path);
		_g_object_unref0 (model);
		return result;
	}
	_tmp12_ = src_path;
	src_depth = gtk_tree_path_get_depth (_tmp12_);
	_tmp13_ = child_dest;
	dest_depth = gtk_tree_path_get_depth (_tmp13_);
	if (src_depth != dest_depth) {
		result = FALSE;
		__vala_GtkTreePath_free0 (child_dest);
		__vala_GtkTreePath_free0 (src_path);
		_g_object_unref0 (model);
		return result;
	}
	if (src_depth < 1) {
		result = FALSE;
		__vala_GtkTreePath_free0 (child_dest);
		__vala_GtkTreePath_free0 (src_path);
		_g_object_unref0 (model);
		return result;
	}
	parent = NULL;
	if (src_depth == 1) {
		CodeWidgetsSourceListExpandableItem* _tmp14_;
		CodeWidgetsSourceListExpandableItem* _tmp15_;
		CodeWidgetsSourceListItem* _tmp16_;
		_tmp14_ = code_widgets_source_list_data_model_get_root (self);
		_tmp15_ = _tmp14_;
		_tmp16_ = _g_object_ref0 ((CodeWidgetsSourceListItem*) _tmp15_);
		_g_object_unref0 (parent);
		parent = _tmp16_;
	} else {
		gint* src_indices = NULL;
		GtkTreePath* _tmp17_;
		gint _tmp18_ = 0;
		gint* _tmp19_;
		gint* _tmp20_;
		gint _tmp20__length1;
		gint src_indices_length1;
		gint _src_indices_size_;
		gint* dest_indices = NULL;
		GtkTreePath* _tmp21_;
		gint _tmp22_ = 0;
		gint* _tmp23_;
		gint* _tmp24_;
		gint _tmp24__length1;
		gint dest_indices_length1;
		gint _dest_indices_size_;
		gint src_parent_index = 0;
		gint* _tmp25_;
		gint _tmp25__length1;
		gint _tmp26_;
		gint dest_parent_index = 0;
		gint* _tmp27_;
		gint _tmp27__length1;
		gint _tmp28_;
		GtkTreePath* dest_parent = NULL;
		GtkTreePath* _tmp29_;
		gboolean _tmp30_ = FALSE;
		GtkTreePath* _tmp31_;
		GtkTreePath* _tmp33_;
		CodeWidgetsSourceListItem* _tmp34_;
		_vala_assert (dest_depth > 1, "dest_depth > 1");
		_tmp17_ = src_path;
		_tmp19_ = gtk_tree_path_get_indices_with_depth (_tmp17_, &_tmp18_);
		_tmp20_ = (_tmp19_ != NULL) ? _vala_array_dup1 (_tmp19_, _tmp18_) : _tmp19_;
		_tmp20__length1 = _tmp18_;
		src_indices = _tmp20_;
		src_indices_length1 = _tmp20__length1;
		_src_indices_size_ = src_indices_length1;
		_tmp21_ = child_dest;
		_tmp23_ = gtk_tree_path_get_indices_with_depth (_tmp21_, &_tmp22_);
		_tmp24_ = (_tmp23_ != NULL) ? _vala_array_dup2 (_tmp23_, _tmp22_) : _tmp23_;
		_tmp24__length1 = _tmp22_;
		dest_indices = _tmp24_;
		dest_indices_length1 = _tmp24__length1;
		_dest_indices_size_ = dest_indices_length1;
		_tmp25_ = src_indices;
		_tmp25__length1 = src_indices_length1;
		_tmp26_ = _tmp25_[src_depth - 2];
		src_parent_index = _tmp26_;
		_tmp27_ = dest_indices;
		_tmp27__length1 = dest_indices_length1;
		_tmp28_ = _tmp27_[dest_depth - 2];
		dest_parent_index = _tmp28_;
		if (src_parent_index != dest_parent_index) {
			result = FALSE;
			dest_indices = (g_free (dest_indices), NULL);
			src_indices = (g_free (src_indices), NULL);
			_g_object_unref0 (parent);
			__vala_GtkTreePath_free0 (child_dest);
			__vala_GtkTreePath_free0 (src_path);
			_g_object_unref0 (model);
			return result;
		}
		_tmp29_ = __vala_GtkTreePath_copy0 (dest);
		dest_parent = _tmp29_;
		_tmp31_ = dest_parent;
		if (!gtk_tree_path_up (_tmp31_)) {
			_tmp30_ = TRUE;
		} else {
			GtkTreePath* _tmp32_;
			_tmp32_ = dest_parent;
			_tmp30_ = gtk_tree_path_get_depth (_tmp32_) < 1;
		}
		if (_tmp30_) {
			result = FALSE;
			__vala_GtkTreePath_free0 (dest_parent);
			dest_indices = (g_free (dest_indices), NULL);
			src_indices = (g_free (src_indices), NULL);
			_g_object_unref0 (parent);
			__vala_GtkTreePath_free0 (child_dest);
			__vala_GtkTreePath_free0 (src_path);
			_g_object_unref0 (model);
			return result;
		}
		_tmp33_ = dest_parent;
		_tmp34_ = code_widgets_source_list_data_model_get_item_from_path (self, _tmp33_);
		_g_object_unref0 (parent);
		parent = _tmp34_;
		__vala_GtkTreePath_free0 (dest_parent);
		dest_indices = (g_free (dest_indices), NULL);
		src_indices = (g_free (src_indices), NULL);
	}
	_tmp35_ = parent;
	_tmp36_ = _g_object_ref0 (CODE_WIDGETS_IS_SOURCE_LIST_SORTABLE (_tmp35_) ? ((CodeWidgetsSourceListSortable*) _tmp35_) : NULL);
	sortable = _tmp36_;
	_tmp38_ = sortable;
	if (_tmp38_ == NULL) {
		_tmp37_ = TRUE;
	} else {
		CodeWidgetsSourceListSortable* _tmp39_;
		_tmp39_ = sortable;
		_tmp37_ = !code_widgets_source_list_sortable_allow_dnd_sorting (_tmp39_);
	}
	if (_tmp37_) {
		result = FALSE;
		_g_object_unref0 (sortable);
		_g_object_unref0 (parent);
		__vala_GtkTreePath_free0 (child_dest);
		__vala_GtkTreePath_free0 (src_path);
		_g_object_unref0 (model);
		return result;
	}
	_tmp40_ = code_widgets_source_list_data_model_get_item_from_path (self, dest);
	dest_item = _tmp40_;
	_tmp41_ = dest_item;
	if (_tmp41_ == NULL) {
		result = TRUE;
		_g_object_unref0 (dest_item);
		_g_object_unref0 (sortable);
		_g_object_unref0 (parent);
		__vala_GtkTreePath_free0 (child_dest);
		__vala_GtkTreePath_free0 (src_path);
		_g_object_unref0 (model);
		return result;
	}
	source_item = NULL;
	_tmp42_ = src_path;
	_tmp43_ = gtk_tree_model_filter_convert_child_path_to_path ((GtkTreeModelFilter*) self, _tmp42_);
	filter_src_path = _tmp43_;
	_tmp44_ = filter_src_path;
	if (_tmp44_ != NULL) {
		GtkTreePath* _tmp45_;
		CodeWidgetsSourceListItem* _tmp46_;
		_tmp45_ = filter_src_path;
		_tmp46_ = code_widgets_source_list_data_model_get_item_from_path (self, _tmp45_);
		_g_object_unref0 (source_item);
		source_item = _tmp46_;
	}
	_tmp47_ = source_item;
	if (_tmp47_ == NULL) {
		result = FALSE;
		__vala_GtkTreePath_free0 (filter_src_path);
		_g_object_unref0 (source_item);
		_g_object_unref0 (dest_item);
		_g_object_unref0 (sortable);
		_g_object_unref0 (parent);
		__vala_GtkTreePath_free0 (child_dest);
		__vala_GtkTreePath_free0 (src_path);
		_g_object_unref0 (model);
		return result;
	}
	_tmp48_ = sortable;
	_tmp49_ = dest_item;
	_tmp50_ = source_item;
	if (code_widgets_source_list_sortable_compare (_tmp48_, _tmp49_, _tmp50_) >= 0) {
		CodeWidgetsSourceListItem* dest_item_prev = NULL;
		CodeWidgetsSourceListItem* _tmp51_;
		gboolean _tmp52_ = FALSE;
		gboolean _tmp53_ = FALSE;
		CodeWidgetsSourceListItem* _tmp54_;
		if (!gtk_tree_path_prev (dest)) {
			result = TRUE;
			__vala_GtkTreePath_free0 (filter_src_path);
			_g_object_unref0 (source_item);
			_g_object_unref0 (dest_item);
			_g_object_unref0 (sortable);
			_g_object_unref0 (parent);
			__vala_GtkTreePath_free0 (child_dest);
			__vala_GtkTreePath_free0 (src_path);
			_g_object_unref0 (model);
			return result;
		}
		_tmp51_ = code_widgets_source_list_data_model_get_item_from_path (self, dest);
		dest_item_prev = _tmp51_;
		_tmp54_ = dest_item_prev;
		if (_tmp54_ != NULL) {
			CodeWidgetsSourceListItem* _tmp55_;
			CodeWidgetsSourceListItem* _tmp56_;
			_tmp55_ = dest_item_prev;
			_tmp56_ = source_item;
			_tmp53_ = _tmp55_ != _tmp56_;
		} else {
			_tmp53_ = FALSE;
		}
		if (_tmp53_) {
			CodeWidgetsSourceListSortable* _tmp57_;
			CodeWidgetsSourceListItem* _tmp58_;
			CodeWidgetsSourceListItem* _tmp59_;
			_tmp57_ = sortable;
			_tmp58_ = dest_item_prev;
			_tmp59_ = source_item;
			_tmp52_ = code_widgets_source_list_sortable_compare (_tmp57_, _tmp58_, _tmp59_) <= 0;
		} else {
			_tmp52_ = FALSE;
		}
		result = _tmp52_;
		_g_object_unref0 (dest_item_prev);
		__vala_GtkTreePath_free0 (filter_src_path);
		_g_object_unref0 (source_item);
		_g_object_unref0 (dest_item);
		_g_object_unref0 (sortable);
		_g_object_unref0 (parent);
		__vala_GtkTreePath_free0 (child_dest);
		__vala_GtkTreePath_free0 (src_path);
		_g_object_unref0 (model);
		return result;
	}
	result = FALSE;
	__vala_GtkTreePath_free0 (filter_src_path);
	_g_object_unref0 (source_item);
	_g_object_unref0 (dest_item);
	_g_object_unref0 (sortable);
	_g_object_unref0 (parent);
	__vala_GtkTreePath_free0 (child_dest);
	__vala_GtkTreePath_free0 (src_path);
	_g_object_unref0 (model);
	return result;
}

/**
         * Override default implementation of TreeDragSource
         *
         * drag_data_delete is not overriden because the default implementation
         * does exactly what we need.
         */
static gboolean
code_widgets_source_list_data_model_real_drag_data_get (GtkTreeDragSource* base,
                                                        GtkTreePath* path,
                                                        GtkSelectionData* selection_data)
{
	CodeWidgetsSourceListDataModel * self;
	CodeWidgetsSourceListDragSource* drag_source_item = NULL;
	CodeWidgetsSourceListItem* _tmp0_;
	CodeWidgetsSourceListDragSource* _tmp1_;
	gboolean _tmp2_ = FALSE;
	CodeWidgetsSourceListDragSource* _tmp3_;
	gboolean result;
	self = (CodeWidgetsSourceListDataModel*) base;
	g_return_val_if_fail (path != NULL, FALSE);
	g_return_val_if_fail (selection_data != NULL, FALSE);
	if (gtk_selection_data_get_target (selection_data) == gdk_atom_intern_static_string ("GTK_TREE_MODEL_ROW")) {
		result = code_widgets_source_list_data_model_gtk_tree_drag_source_parent_iface->drag_data_get ((GtkTreeDragSource*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_tree_model_filter_get_type (), GtkTreeModelFilter), path, selection_data);
		return result;
	}
	_tmp0_ = code_widgets_source_list_data_model_get_item_from_path (self, path);
	_tmp1_ = CODE_WIDGETS_IS_SOURCE_LIST_DRAG_SOURCE (_tmp0_) ? ((CodeWidgetsSourceListDragSource*) _tmp0_) : NULL;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (_tmp0_);
	}
	drag_source_item = _tmp1_;
	_tmp3_ = drag_source_item;
	if (_tmp3_ != NULL) {
		CodeWidgetsSourceListDragSource* _tmp4_;
		_tmp4_ = drag_source_item;
		_tmp2_ = code_widgets_source_list_drag_source_draggable (_tmp4_);
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		CodeWidgetsSourceListDragSource* _tmp5_;
		_tmp5_ = drag_source_item;
		code_widgets_source_list_drag_source_prepare_selection_data (_tmp5_, selection_data);
		result = TRUE;
		_g_object_unref0 (drag_source_item);
		return result;
	}
	result = FALSE;
	_g_object_unref0 (drag_source_item);
	return result;
}

static gboolean
code_widgets_source_list_data_model_real_row_draggable (GtkTreeDragSource* base,
                                                        GtkTreePath* path)
{
	CodeWidgetsSourceListDataModel * self;
	CodeWidgetsSourceListItem* item = NULL;
	CodeWidgetsSourceListItem* _tmp0_;
	CodeWidgetsSourceListItem* _tmp1_;
	gboolean result;
	self = (CodeWidgetsSourceListDataModel*) base;
	g_return_val_if_fail (path != NULL, FALSE);
	if (!code_widgets_source_list_data_model_gtk_tree_drag_source_parent_iface->row_draggable ((GtkTreeDragSource*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_tree_model_filter_get_type (), GtkTreeModelFilter), path)) {
		result = FALSE;
		return result;
	}
	_tmp0_ = code_widgets_source_list_data_model_get_item_from_path (self, path);
	item = _tmp0_;
	_tmp1_ = item;
	if (_tmp1_ != NULL) {
		CodeWidgetsSourceListSortable* sortable_item = NULL;
		CodeWidgetsSourceListItem* _tmp2_;
		CodeWidgetsSourceListExpandableItem* _tmp3_;
		CodeWidgetsSourceListExpandableItem* _tmp4_;
		CodeWidgetsSourceListSortable* _tmp5_;
		gboolean _tmp6_ = FALSE;
		CodeWidgetsSourceListSortable* _tmp7_;
		CodeWidgetsSourceListDragSource* drag_source_item = NULL;
		CodeWidgetsSourceListItem* _tmp9_;
		CodeWidgetsSourceListDragSource* _tmp10_;
		gboolean _tmp11_ = FALSE;
		CodeWidgetsSourceListDragSource* _tmp12_;
		_tmp2_ = item;
		_tmp3_ = code_widgets_source_list_item_get_parent (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = _g_object_ref0 (CODE_WIDGETS_IS_SOURCE_LIST_SORTABLE (_tmp4_) ? ((CodeWidgetsSourceListSortable*) _tmp4_) : NULL);
		sortable_item = _tmp5_;
		_tmp7_ = sortable_item;
		if (_tmp7_ != NULL) {
			CodeWidgetsSourceListSortable* _tmp8_;
			_tmp8_ = sortable_item;
			_tmp6_ = code_widgets_source_list_sortable_allow_dnd_sorting (_tmp8_);
		} else {
			_tmp6_ = FALSE;
		}
		if (_tmp6_) {
			result = TRUE;
			_g_object_unref0 (sortable_item);
			_g_object_unref0 (item);
			return result;
		}
		_tmp9_ = item;
		_tmp10_ = _g_object_ref0 (CODE_WIDGETS_IS_SOURCE_LIST_DRAG_SOURCE (_tmp9_) ? ((CodeWidgetsSourceListDragSource*) _tmp9_) : NULL);
		drag_source_item = _tmp10_;
		_tmp12_ = drag_source_item;
		if (_tmp12_ != NULL) {
			CodeWidgetsSourceListDragSource* _tmp13_;
			_tmp13_ = drag_source_item;
			_tmp11_ = code_widgets_source_list_drag_source_draggable (_tmp13_);
		} else {
			_tmp11_ = FALSE;
		}
		if (_tmp11_) {
			result = TRUE;
			_g_object_unref0 (drag_source_item);
			_g_object_unref0 (sortable_item);
			_g_object_unref0 (item);
			return result;
		}
		_g_object_unref0 (drag_source_item);
		_g_object_unref0 (sortable_item);
	}
	result = FALSE;
	_g_object_unref0 (item);
	return result;
}

static CodeWidgetsSourceListExpandableItem*
code_widgets_source_list_data_model_get_root (CodeWidgetsSourceListDataModel* self)
{
	CodeWidgetsSourceListExpandableItem* result;
	CodeWidgetsSourceListExpandableItem* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_root;
	result = _tmp0_;
	return result;
}

static void
code_widgets_source_list_data_model_set_root (CodeWidgetsSourceListDataModel* self,
                                              CodeWidgetsSourceListExpandableItem* value)
{
	CodeWidgetsSourceListExpandableItem* _tmp0_;
	CodeWidgetsSourceListExpandableItem* _tmp12_;
	CodeWidgetsSourceListExpandableItem* _tmp13_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_root;
	if (_tmp0_ != NULL) {
		CodeWidgetsSourceListExpandableItem* _tmp1_;
		_tmp1_ = self->priv->_root;
		code_widgets_source_list_data_model_remove_children_monitor (self, _tmp1_);
		{
			GeeIterator* _item_it = NULL;
			CodeWidgetsSourceListExpandableItem* _tmp2_;
			GeeCollection* _tmp3_;
			GeeCollection* _tmp4_;
			GeeCollection* _tmp5_;
			GeeIterator* _tmp6_;
			GeeIterator* _tmp7_;
			_tmp2_ = self->priv->_root;
			_tmp3_ = code_widgets_source_list_expandable_item_get_children (_tmp2_);
			_tmp4_ = _tmp3_;
			_tmp5_ = _tmp4_;
			_tmp6_ = gee_iterable_iterator ((GeeIterable*) _tmp5_);
			_tmp7_ = _tmp6_;
			_g_object_unref0 (_tmp5_);
			_item_it = _tmp7_;
			while (TRUE) {
				GeeIterator* _tmp8_;
				CodeWidgetsSourceListItem* item = NULL;
				GeeIterator* _tmp9_;
				gpointer _tmp10_;
				CodeWidgetsSourceListItem* _tmp11_;
				_tmp8_ = _item_it;
				if (!gee_iterator_next (_tmp8_)) {
					break;
				}
				_tmp9_ = _item_it;
				_tmp10_ = gee_iterator_get (_tmp9_);
				item = (CodeWidgetsSourceListItem*) _tmp10_;
				_tmp11_ = item;
				code_widgets_source_list_data_model_remove_item (self, _tmp11_);
				_g_object_unref0 (item);
			}
			_g_object_unref0 (_item_it);
		}
	}
	_tmp12_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_root);
	self->priv->_root = _tmp12_;
	_tmp13_ = self->priv->_root;
	code_widgets_source_list_data_model_add_children_monitor (self, _tmp13_);
	{
		GeeIterator* _item_it = NULL;
		CodeWidgetsSourceListExpandableItem* _tmp14_;
		GeeCollection* _tmp15_;
		GeeCollection* _tmp16_;
		GeeCollection* _tmp17_;
		GeeIterator* _tmp18_;
		GeeIterator* _tmp19_;
		_tmp14_ = self->priv->_root;
		_tmp15_ = code_widgets_source_list_expandable_item_get_children (_tmp14_);
		_tmp16_ = _tmp15_;
		_tmp17_ = _tmp16_;
		_tmp18_ = gee_iterable_iterator ((GeeIterable*) _tmp17_);
		_tmp19_ = _tmp18_;
		_g_object_unref0 (_tmp17_);
		_item_it = _tmp19_;
		while (TRUE) {
			GeeIterator* _tmp20_;
			CodeWidgetsSourceListItem* item = NULL;
			GeeIterator* _tmp21_;
			gpointer _tmp22_;
			CodeWidgetsSourceListItem* _tmp23_;
			_tmp20_ = _item_it;
			if (!gee_iterator_next (_tmp20_)) {
				break;
			}
			_tmp21_ = _item_it;
			_tmp22_ = gee_iterator_get (_tmp21_);
			item = (CodeWidgetsSourceListItem*) _tmp22_;
			_tmp23_ = item;
			code_widgets_source_list_data_model_add_item (self, _tmp23_);
			_g_object_unref0 (item);
		}
		_g_object_unref0 (_item_it);
	}
	g_object_notify_by_pspec ((GObject *) self, code_widgets_source_list_data_model_properties[CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_ROOT_PROPERTY]);
}

static inline gpointer
code_widgets_source_list_data_model_node_wrapper_get_instance_private (CodeWidgetsSourceListDataModelNodeWrapper* self)
{
	return G_STRUCT_MEMBER_P (self, CodeWidgetsSourceListDataModelNodeWrapper_private_offset);
}

static void
_vala_GtkTreeRowReference_free (GtkTreeRowReference* self)
{
	g_boxed_free (gtk_tree_row_reference_get_type (), self);
}

static CodeWidgetsSourceListDataModelNodeWrapper*
code_widgets_source_list_data_model_node_wrapper_construct (GType object_type,
                                                            GtkTreeModel* model,
                                                            GtkTreeIter* iter)
{
	CodeWidgetsSourceListDataModelNodeWrapper* self = NULL;
	GtkTreeIter _tmp0_;
	GtkTreePath* _tmp1_;
	GtkTreePath* _tmp2_;
	GtkTreeRowReference* _tmp3_;
	g_return_val_if_fail (model != NULL, NULL);
	g_return_val_if_fail (iter != NULL, NULL);
	self = (CodeWidgetsSourceListDataModelNodeWrapper*) g_type_create_instance (object_type);
	_tmp0_ = *iter;
	_tmp1_ = gtk_tree_model_get_path (model, &_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = gtk_tree_row_reference_new (model, _tmp2_);
	__vala_GtkTreeRowReference_free0 (self->priv->row_reference);
	self->priv->row_reference = _tmp3_;
	__vala_GtkTreePath_free0 (_tmp2_);
	return self;
}

static CodeWidgetsSourceListDataModelNodeWrapper*
code_widgets_source_list_data_model_node_wrapper_new (GtkTreeModel* model,
                                                      GtkTreeIter* iter)
{
	return code_widgets_source_list_data_model_node_wrapper_construct (CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_NODE_WRAPPER, model, iter);
}

static GtkTreeIter*
code_widgets_source_list_data_model_node_wrapper_get_iter (CodeWidgetsSourceListDataModelNodeWrapper* self)
{
	GtkTreeIter* result;
	GtkTreeIter* rv = NULL;
	gboolean _tmp0_;
	gboolean _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	rv = NULL;
	_tmp0_ = code_widgets_source_list_data_model_node_wrapper_get_valid (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		GtkTreePath* _path = NULL;
		GtkTreePath* _tmp2_;
		GtkTreePath* _tmp3_;
		GtkTreePath* _tmp4_;
		_tmp2_ = code_widgets_source_list_data_model_node_wrapper_get_path (self);
		_tmp3_ = _tmp2_;
		_path = _tmp3_;
		_tmp4_ = _path;
		if (_tmp4_ != NULL) {
			GtkTreeIter _iter = {0};
			GtkTreeRowReference* _tmp5_;
			GtkTreeModel* _tmp6_;
			GtkTreePath* _tmp7_;
			GtkTreeIter _tmp8_ = {0};
			gboolean _tmp9_;
			_tmp5_ = self->priv->row_reference;
			_tmp6_ = gtk_tree_row_reference_get_model (_tmp5_);
			_tmp7_ = _path;
			_tmp9_ = gtk_tree_model_get_iter (_tmp6_, &_tmp8_, _tmp7_);
			_iter = _tmp8_;
			if (_tmp9_) {
				GtkTreeIter _tmp10_;
				GtkTreeIter* _tmp11_;
				_tmp10_ = _iter;
				_tmp11_ = __vala_GtkTreeIter_copy0 (&_tmp10_);
				__vala_GtkTreeIter_free0 (rv);
				rv = _tmp11_;
			}
		}
		__vala_GtkTreePath_free0 (_path);
	}
	result = rv;
	return result;
}

static GtkTreePath*
code_widgets_source_list_data_model_node_wrapper_get_path (CodeWidgetsSourceListDataModelNodeWrapper* self)
{
	GtkTreePath* result;
	GtkTreePath* _tmp0_ = NULL;
	gboolean _tmp1_;
	gboolean _tmp2_;
	GtkTreePath* _tmp5_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = code_widgets_source_list_data_model_node_wrapper_get_valid (self);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		GtkTreeRowReference* _tmp3_;
		GtkTreePath* _tmp4_;
		_tmp3_ = self->priv->row_reference;
		_tmp4_ = gtk_tree_row_reference_get_path (_tmp3_);
		__vala_GtkTreePath_free0 (_tmp0_);
		_tmp0_ = _tmp4_;
	} else {
		__vala_GtkTreePath_free0 (_tmp0_);
		_tmp0_ = NULL;
	}
	_tmp5_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp5_;
	__vala_GtkTreePath_free0 (_tmp0_);
	return result;
}

static gboolean
code_widgets_source_list_data_model_node_wrapper_get_valid (CodeWidgetsSourceListDataModelNodeWrapper* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	GtkTreeRowReference* _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = self->priv->row_reference;
	if (_tmp1_ != NULL) {
		GtkTreeRowReference* _tmp2_;
		_tmp2_ = self->priv->row_reference;
		_tmp0_ = gtk_tree_row_reference_valid (_tmp2_);
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static void
code_widgets_source_list_data_model_value_node_wrapper_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
code_widgets_source_list_data_model_value_node_wrapper_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		code_widgets_source_list_data_model_node_wrapper_unref (value->data[0].v_pointer);
	}
}

static void
code_widgets_source_list_data_model_value_node_wrapper_copy_value (const GValue* src_value,
                                                                   GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = code_widgets_source_list_data_model_node_wrapper_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
code_widgets_source_list_data_model_value_node_wrapper_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
code_widgets_source_list_data_model_value_node_wrapper_collect_value (GValue* value,
                                                                      guint n_collect_values,
                                                                      GTypeCValue* collect_values,
                                                                      guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		CodeWidgetsSourceListDataModelNodeWrapper * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = code_widgets_source_list_data_model_node_wrapper_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
code_widgets_source_list_data_model_value_node_wrapper_lcopy_value (const GValue* value,
                                                                    guint n_collect_values,
                                                                    GTypeCValue* collect_values,
                                                                    guint collect_flags)
{
	CodeWidgetsSourceListDataModelNodeWrapper ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = code_widgets_source_list_data_model_node_wrapper_ref (value->data[0].v_pointer);
	}
	return NULL;
}

static GParamSpec*
code_widgets_source_list_data_model_param_spec_node_wrapper (const gchar* name,
                                                             const gchar* nick,
                                                             const gchar* blurb,
                                                             GType object_type,
                                                             GParamFlags flags)
{
	CodeWidgetsSourceListDataModelParamSpecNodeWrapper* spec;
	g_return_val_if_fail (g_type_is_a (object_type, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_NODE_WRAPPER), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

static gpointer
code_widgets_source_list_data_model_value_get_node_wrapper (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_NODE_WRAPPER), NULL);
	return value->data[0].v_pointer;
}

static void
code_widgets_source_list_data_model_value_set_node_wrapper (GValue* value,
                                                            gpointer v_object)
{
	CodeWidgetsSourceListDataModelNodeWrapper * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_NODE_WRAPPER));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_NODE_WRAPPER));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		code_widgets_source_list_data_model_node_wrapper_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		code_widgets_source_list_data_model_node_wrapper_unref (old);
	}
}

static void
code_widgets_source_list_data_model_value_take_node_wrapper (GValue* value,
                                                             gpointer v_object)
{
	CodeWidgetsSourceListDataModelNodeWrapper * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_NODE_WRAPPER));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_NODE_WRAPPER));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		code_widgets_source_list_data_model_node_wrapper_unref (old);
	}
}

static void
code_widgets_source_list_data_model_node_wrapper_class_init (CodeWidgetsSourceListDataModelNodeWrapperClass * klass,
                                                             gpointer klass_data)
{
	code_widgets_source_list_data_model_node_wrapper_parent_class = g_type_class_peek_parent (klass);
	((CodeWidgetsSourceListDataModelNodeWrapperClass *) klass)->finalize = code_widgets_source_list_data_model_node_wrapper_finalize;
	g_type_class_adjust_private_offset (klass, &CodeWidgetsSourceListDataModelNodeWrapper_private_offset);
}

static void
code_widgets_source_list_data_model_node_wrapper_instance_init (CodeWidgetsSourceListDataModelNodeWrapper * self,
                                                                gpointer klass)
{
	self->priv = code_widgets_source_list_data_model_node_wrapper_get_instance_private (self);
	self->ref_count = 1;
}

static void
code_widgets_source_list_data_model_node_wrapper_finalize (CodeWidgetsSourceListDataModelNodeWrapper * obj)
{
	CodeWidgetsSourceListDataModelNodeWrapper * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_NODE_WRAPPER, CodeWidgetsSourceListDataModelNodeWrapper);
	g_signal_handlers_destroy (self);
	__vala_GtkTreeRowReference_free0 (self->priv->row_reference);
}

/**
         * An object that references a particular row in a model. This class is a wrapper built around
         * Gtk.TreeRowReference, and exists with the purpose of ensuring we never use invalid tree paths
         * or iters in the model, since most of these errors provoke failures due to GTK+ assertions
         * or, even worse, unexpected behavior.
         */
 G_GNUC_NO_INLINE static GType
code_widgets_source_list_data_model_node_wrapper_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { code_widgets_source_list_data_model_value_node_wrapper_init, code_widgets_source_list_data_model_value_node_wrapper_free_value, code_widgets_source_list_data_model_value_node_wrapper_copy_value, code_widgets_source_list_data_model_value_node_wrapper_peek_pointer, "p", code_widgets_source_list_data_model_value_node_wrapper_collect_value, "p", code_widgets_source_list_data_model_value_node_wrapper_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (CodeWidgetsSourceListDataModelNodeWrapperClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) code_widgets_source_list_data_model_node_wrapper_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CodeWidgetsSourceListDataModelNodeWrapper), 0, (GInstanceInitFunc) code_widgets_source_list_data_model_node_wrapper_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 code_widgets_source_list_data_model_node_wrapper_type_id;
	code_widgets_source_list_data_model_node_wrapper_type_id = g_type_register_fundamental (g_type_fundamental_next (), "CodeWidgetsSourceListDataModelNodeWrapper", &g_define_type_info, &g_define_type_fundamental_info, G_TYPE_FLAG_NONE);
	CodeWidgetsSourceListDataModelNodeWrapper_private_offset = g_type_add_instance_private (code_widgets_source_list_data_model_node_wrapper_type_id, sizeof (CodeWidgetsSourceListDataModelNodeWrapperPrivate));
	return code_widgets_source_list_data_model_node_wrapper_type_id;
}

static GType
code_widgets_source_list_data_model_node_wrapper_get_type (void)
{
	static gsize code_widgets_source_list_data_model_node_wrapper_type_id__once = 0;
	if (g_once_init_enter (&code_widgets_source_list_data_model_node_wrapper_type_id__once)) {
		GType code_widgets_source_list_data_model_node_wrapper_type_id;
		code_widgets_source_list_data_model_node_wrapper_type_id = code_widgets_source_list_data_model_node_wrapper_get_type_once ();
		g_once_init_leave (&code_widgets_source_list_data_model_node_wrapper_type_id__once, code_widgets_source_list_data_model_node_wrapper_type_id);
	}
	return code_widgets_source_list_data_model_node_wrapper_type_id__once;
}

static gpointer
code_widgets_source_list_data_model_node_wrapper_ref (gpointer instance)
{
	CodeWidgetsSourceListDataModelNodeWrapper * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

static void
code_widgets_source_list_data_model_node_wrapper_unref (gpointer instance)
{
	CodeWidgetsSourceListDataModelNodeWrapper * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_NODE_WRAPPER_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static inline gpointer
code_widgets_source_list_data_model_item_monitor_get_instance_private (CodeWidgetsSourceListDataModelItemMonitor* self)
{
	return G_STRUCT_MEMBER_P (self, CodeWidgetsSourceListDataModelItemMonitor_private_offset);
}

static void
_code_widgets_source_list_data_model_item_monitor_on_notify_g_object_notify (GObject* _sender,
                                                                             GParamSpec* pspec,
                                                                             gpointer self)
{
	code_widgets_source_list_data_model_item_monitor_on_notify ((CodeWidgetsSourceListDataModelItemMonitor*) self, pspec);
}

static CodeWidgetsSourceListDataModelItemMonitor*
code_widgets_source_list_data_model_item_monitor_construct (GType object_type,
                                                            CodeWidgetsSourceListItem* item)
{
	CodeWidgetsSourceListDataModelItemMonitor* self = NULL;
	CodeWidgetsSourceListItem* _tmp0_;
	g_return_val_if_fail (item != NULL, NULL);
	self = (CodeWidgetsSourceListDataModelItemMonitor*) g_type_create_instance (object_type);
	_tmp0_ = _g_object_ref0 (item);
	_g_object_unref0 (self->priv->item);
	self->priv->item = _tmp0_;
	g_signal_connect_after ((GObject*) item, "notify", (GCallback) _code_widgets_source_list_data_model_item_monitor_on_notify_g_object_notify, self);
	return self;
}

static CodeWidgetsSourceListDataModelItemMonitor*
code_widgets_source_list_data_model_item_monitor_new (CodeWidgetsSourceListItem* item)
{
	return code_widgets_source_list_data_model_item_monitor_construct (CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_ITEM_MONITOR, item);
}

static void
code_widgets_source_list_data_model_item_monitor_on_notify (CodeWidgetsSourceListDataModelItemMonitor* self,
                                                            GParamSpec* prop)
{
	CodeWidgetsSourceListItem* _tmp0_;
	const gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (prop != NULL);
	_tmp0_ = self->priv->item;
	_tmp1_ = prop->name;
	g_signal_emit (self, code_widgets_source_list_data_model_item_monitor_signals[CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_ITEM_MONITOR_CHANGED_SIGNAL], 0, _tmp0_, _tmp1_);
}

static void
g_cclosure_user_marshal_VOID__OBJECT_STRING (GClosure * closure,
                                             GValue * return_value,
                                             guint n_param_values,
                                             const GValue * param_values,
                                             gpointer invocation_hint,
                                             gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__OBJECT_STRING) (gpointer data1, gpointer arg_1, const char* arg_2, gpointer data2);
	register GMarshalFunc_VOID__OBJECT_STRING callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__OBJECT_STRING) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_object (param_values + 1), g_value_get_string (param_values + 2), data2);
}

static void
code_widgets_source_list_data_model_value_item_monitor_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
code_widgets_source_list_data_model_value_item_monitor_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		code_widgets_source_list_data_model_item_monitor_unref (value->data[0].v_pointer);
	}
}

static void
code_widgets_source_list_data_model_value_item_monitor_copy_value (const GValue* src_value,
                                                                   GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = code_widgets_source_list_data_model_item_monitor_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
code_widgets_source_list_data_model_value_item_monitor_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
code_widgets_source_list_data_model_value_item_monitor_collect_value (GValue* value,
                                                                      guint n_collect_values,
                                                                      GTypeCValue* collect_values,
                                                                      guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		CodeWidgetsSourceListDataModelItemMonitor * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = code_widgets_source_list_data_model_item_monitor_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
code_widgets_source_list_data_model_value_item_monitor_lcopy_value (const GValue* value,
                                                                    guint n_collect_values,
                                                                    GTypeCValue* collect_values,
                                                                    guint collect_flags)
{
	CodeWidgetsSourceListDataModelItemMonitor ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = code_widgets_source_list_data_model_item_monitor_ref (value->data[0].v_pointer);
	}
	return NULL;
}

static GParamSpec*
code_widgets_source_list_data_model_param_spec_item_monitor (const gchar* name,
                                                             const gchar* nick,
                                                             const gchar* blurb,
                                                             GType object_type,
                                                             GParamFlags flags)
{
	CodeWidgetsSourceListDataModelParamSpecItemMonitor* spec;
	g_return_val_if_fail (g_type_is_a (object_type, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_ITEM_MONITOR), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

static gpointer
code_widgets_source_list_data_model_value_get_item_monitor (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_ITEM_MONITOR), NULL);
	return value->data[0].v_pointer;
}

static void
code_widgets_source_list_data_model_value_set_item_monitor (GValue* value,
                                                            gpointer v_object)
{
	CodeWidgetsSourceListDataModelItemMonitor * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_ITEM_MONITOR));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_ITEM_MONITOR));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		code_widgets_source_list_data_model_item_monitor_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		code_widgets_source_list_data_model_item_monitor_unref (old);
	}
}

static void
code_widgets_source_list_data_model_value_take_item_monitor (GValue* value,
                                                             gpointer v_object)
{
	CodeWidgetsSourceListDataModelItemMonitor * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_ITEM_MONITOR));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_ITEM_MONITOR));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		code_widgets_source_list_data_model_item_monitor_unref (old);
	}
}

static void
code_widgets_source_list_data_model_item_monitor_class_init (CodeWidgetsSourceListDataModelItemMonitorClass * klass,
                                                             gpointer klass_data)
{
	code_widgets_source_list_data_model_item_monitor_parent_class = g_type_class_peek_parent (klass);
	((CodeWidgetsSourceListDataModelItemMonitorClass *) klass)->finalize = code_widgets_source_list_data_model_item_monitor_finalize;
	g_type_class_adjust_private_offset (klass, &CodeWidgetsSourceListDataModelItemMonitor_private_offset);
	code_widgets_source_list_data_model_item_monitor_signals[CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_ITEM_MONITOR_CHANGED_SIGNAL] = g_signal_new ("changed", CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_ITEM_MONITOR, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_STRING, G_TYPE_NONE, 2, CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM, G_TYPE_STRING);
}

static void
code_widgets_source_list_data_model_item_monitor_instance_init (CodeWidgetsSourceListDataModelItemMonitor * self,
                                                                gpointer klass)
{
	self->priv = code_widgets_source_list_data_model_item_monitor_get_instance_private (self);
	self->ref_count = 1;
}

static void
code_widgets_source_list_data_model_item_monitor_finalize (CodeWidgetsSourceListDataModelItemMonitor * obj)
{
	CodeWidgetsSourceListDataModelItemMonitor * self;
	CodeWidgetsSourceListItem* _tmp0_;
	guint _tmp1_;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_ITEM_MONITOR, CodeWidgetsSourceListDataModelItemMonitor);
	g_signal_handlers_destroy (self);
	_tmp0_ = self->priv->item;
	g_signal_parse_name ("notify", G_TYPE_OBJECT, &_tmp1_, NULL, FALSE);
	g_signal_handlers_disconnect_matched ((GObject*) _tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _code_widgets_source_list_data_model_item_monitor_on_notify_g_object_notify, self);
	_g_object_unref0 (self->priv->item);
}

/**
         * Helper object used to monitor item property changes.
         */
 G_GNUC_NO_INLINE static GType
code_widgets_source_list_data_model_item_monitor_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { code_widgets_source_list_data_model_value_item_monitor_init, code_widgets_source_list_data_model_value_item_monitor_free_value, code_widgets_source_list_data_model_value_item_monitor_copy_value, code_widgets_source_list_data_model_value_item_monitor_peek_pointer, "p", code_widgets_source_list_data_model_value_item_monitor_collect_value, "p", code_widgets_source_list_data_model_value_item_monitor_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (CodeWidgetsSourceListDataModelItemMonitorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) code_widgets_source_list_data_model_item_monitor_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CodeWidgetsSourceListDataModelItemMonitor), 0, (GInstanceInitFunc) code_widgets_source_list_data_model_item_monitor_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 code_widgets_source_list_data_model_item_monitor_type_id;
	code_widgets_source_list_data_model_item_monitor_type_id = g_type_register_fundamental (g_type_fundamental_next (), "CodeWidgetsSourceListDataModelItemMonitor", &g_define_type_info, &g_define_type_fundamental_info, G_TYPE_FLAG_NONE);
	CodeWidgetsSourceListDataModelItemMonitor_private_offset = g_type_add_instance_private (code_widgets_source_list_data_model_item_monitor_type_id, sizeof (CodeWidgetsSourceListDataModelItemMonitorPrivate));
	return code_widgets_source_list_data_model_item_monitor_type_id;
}

static GType
code_widgets_source_list_data_model_item_monitor_get_type (void)
{
	static gsize code_widgets_source_list_data_model_item_monitor_type_id__once = 0;
	if (g_once_init_enter (&code_widgets_source_list_data_model_item_monitor_type_id__once)) {
		GType code_widgets_source_list_data_model_item_monitor_type_id;
		code_widgets_source_list_data_model_item_monitor_type_id = code_widgets_source_list_data_model_item_monitor_get_type_once ();
		g_once_init_leave (&code_widgets_source_list_data_model_item_monitor_type_id__once, code_widgets_source_list_data_model_item_monitor_type_id);
	}
	return code_widgets_source_list_data_model_item_monitor_type_id__once;
}

static gpointer
code_widgets_source_list_data_model_item_monitor_ref (gpointer instance)
{
	CodeWidgetsSourceListDataModelItemMonitor * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

static void
code_widgets_source_list_data_model_item_monitor_unref (gpointer instance)
{
	CodeWidgetsSourceListDataModelItemMonitor * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_ITEM_MONITOR_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static gint
_code_widgets_source_list_data_model_child_model_sort_func_gtk_tree_iter_compare_func (GtkTreeModel* model,
                                                                                       GtkTreeIter* a,
                                                                                       GtkTreeIter* b,
                                                                                       gpointer self)
{
	gint result;
	result = code_widgets_source_list_data_model_child_model_sort_func ((CodeWidgetsSourceListDataModel*) self, model, a, b);
	return result;
}

static gboolean
_code_widgets_source_list_data_model_filter_visible_func_gtk_tree_model_filter_visible_func (GtkTreeModel* model,
                                                                                             GtkTreeIter* iter,
                                                                                             gpointer self)
{
	gboolean result;
	result = code_widgets_source_list_data_model_filter_visible_func ((CodeWidgetsSourceListDataModel*) self, model, iter);
	return result;
}

static GObject *
code_widgets_source_list_data_model_constructor (GType type,
                                                 guint n_construct_properties,
                                                 GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	CodeWidgetsSourceListDataModel * self;
	GtkTreeStore* _tmp0_;
	GtkTreeStore* _tmp1_;
	GtkTreeStore* _tmp2_;
	parent_class = G_OBJECT_CLASS (code_widgets_source_list_data_model_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CODE_WIDGETS_SOURCE_LIST_TYPE_DATA_MODEL, CodeWidgetsSourceListDataModel);
	_tmp0_ = gtk_tree_store_new ((gint) CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_COLUMN_N_COLUMNS, code_widgets_source_list_data_model_column_type (CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_COLUMN_ITEM));
	_g_object_unref0 (self->priv->child_tree);
	self->priv->child_tree = _tmp0_;
	_tmp1_ = self->priv->child_tree;
	g_object_set ((GtkTreeModelFilter*) self, "child-model", (GtkTreeModel*) _tmp1_, NULL);
	g_object_set ((GtkTreeModelFilter*) self, "virtual-root", NULL, NULL);
	_tmp2_ = self->priv->child_tree;
	gtk_tree_sortable_set_default_sort_func ((GtkTreeSortable*) _tmp2_, _code_widgets_source_list_data_model_child_model_sort_func_gtk_tree_iter_compare_func, g_object_ref (self), g_object_unref);
	code_widgets_source_list_data_model_resort (self);
	gtk_tree_model_filter_set_visible_func ((GtkTreeModelFilter*) self, _code_widgets_source_list_data_model_filter_visible_func_gtk_tree_model_filter_visible_func, g_object_ref (self), g_object_unref);
	return obj;
}

static void
code_widgets_source_list_data_model_class_init (CodeWidgetsSourceListDataModelClass * klass,
                                                gpointer klass_data)
{
	code_widgets_source_list_data_model_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &CodeWidgetsSourceListDataModel_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_code_widgets_source_list_data_model_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_code_widgets_source_list_data_model_set_property;
	G_OBJECT_CLASS (klass)->constructor = code_widgets_source_list_data_model_constructor;
	G_OBJECT_CLASS (klass)->finalize = code_widgets_source_list_data_model_finalize;
	/**
	         * Root item.
	         *
	         * This item is not actually part of the model. It's only used as a proxy
	         * for adding and removing items.
	         */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_ROOT_PROPERTY, code_widgets_source_list_data_model_properties[CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_ROOT_PROPERTY] = g_param_spec_object ("root", "root", "root", CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	code_widgets_source_list_data_model_signals[CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_ITEM_UPDATED_SIGNAL] = g_signal_new ("item-updated", CODE_WIDGETS_SOURCE_LIST_TYPE_DATA_MODEL, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM);
}

static void
code_widgets_source_list_data_model_gtk_tree_drag_source_interface_init (GtkTreeDragSourceIface * iface,
                                                                         gpointer iface_data)
{
	code_widgets_source_list_data_model_gtk_tree_drag_source_parent_iface = g_type_interface_peek_parent (iface);
	iface->drag_data_get = (gboolean (*) (GtkTreeDragSource*, GtkTreePath*, GtkSelectionData*)) code_widgets_source_list_data_model_real_drag_data_get;
	iface->row_draggable = (gboolean (*) (GtkTreeDragSource*, GtkTreePath*)) code_widgets_source_list_data_model_real_row_draggable;
}

static void
code_widgets_source_list_data_model_gtk_tree_drag_dest_interface_init (GtkTreeDragDestIface * iface,
                                                                       gpointer iface_data)
{
	code_widgets_source_list_data_model_gtk_tree_drag_dest_parent_iface = g_type_interface_peek_parent (iface);
	iface->drag_data_received = (gboolean (*) (GtkTreeDragDest*, GtkTreePath*, GtkSelectionData*)) code_widgets_source_list_data_model_real_drag_data_received;
	iface->row_drop_possible = (gboolean (*) (GtkTreeDragDest*, GtkTreePath*, GtkSelectionData*)) code_widgets_source_list_data_model_real_row_drop_possible;
}

static void
code_widgets_source_list_data_model_instance_init (CodeWidgetsSourceListDataModel * self,
                                                   gpointer klass)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	self->priv = code_widgets_source_list_data_model_get_instance_private (self);
	_tmp0_ = gee_hash_map_new (CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_NODE_WRAPPER, (GBoxedCopyFunc) code_widgets_source_list_data_model_node_wrapper_ref, (GDestroyNotify) code_widgets_source_list_data_model_node_wrapper_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->items = _tmp0_;
	_tmp1_ = gee_hash_map_new (CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_TYPE_ITEM_MONITOR, (GBoxedCopyFunc) code_widgets_source_list_data_model_item_monitor_ref, (GDestroyNotify) code_widgets_source_list_data_model_item_monitor_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->monitors = _tmp1_;
}

static void
code_widgets_source_list_data_model_finalize (GObject * obj)
{
	CodeWidgetsSourceListDataModel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CODE_WIDGETS_SOURCE_LIST_TYPE_DATA_MODEL, CodeWidgetsSourceListDataModel);
	_g_object_unref0 (self->priv->_root);
	_g_object_unref0 (self->priv->items);
	_g_object_unref0 (self->priv->monitors);
	_g_object_unref0 (self->priv->child_tree);
	G_OBJECT_CLASS (code_widgets_source_list_data_model_parent_class)->finalize (obj);
}

/**
     * The model backing the SourceList tree.
     *
     * It monitors item property changes, and handles children additions and removals. It also controls
     * the visibility of the items based on their "visible" property, and on their number of children,
     * if they happen to be categories. Its main purpose is to provide an easy and practical interface
     * for sorting, adding, removing and updating items, eliminating the need of repeatedly dealing with
     * the Gtk.TreeModel API directly.
     */
 G_GNUC_NO_INLINE static GType
code_widgets_source_list_data_model_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (CodeWidgetsSourceListDataModelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) code_widgets_source_list_data_model_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CodeWidgetsSourceListDataModel), 0, (GInstanceInitFunc) code_widgets_source_list_data_model_instance_init, NULL };
	static const GInterfaceInfo gtk_tree_drag_source_info = { (GInterfaceInitFunc) code_widgets_source_list_data_model_gtk_tree_drag_source_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo gtk_tree_drag_dest_info = { (GInterfaceInitFunc) code_widgets_source_list_data_model_gtk_tree_drag_dest_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType code_widgets_source_list_data_model_type_id;
	code_widgets_source_list_data_model_type_id = g_type_register_static (gtk_tree_model_filter_get_type (), "CodeWidgetsSourceListDataModel", &g_define_type_info, G_TYPE_FLAG_NONE);
	g_type_add_interface_static (code_widgets_source_list_data_model_type_id, gtk_tree_drag_source_get_type (), &gtk_tree_drag_source_info);
	g_type_add_interface_static (code_widgets_source_list_data_model_type_id, gtk_tree_drag_dest_get_type (), &gtk_tree_drag_dest_info);
	CodeWidgetsSourceListDataModel_private_offset = g_type_add_instance_private (code_widgets_source_list_data_model_type_id, sizeof (CodeWidgetsSourceListDataModelPrivate));
	return code_widgets_source_list_data_model_type_id;
}

static GType
code_widgets_source_list_data_model_get_type (void)
{
	static gsize code_widgets_source_list_data_model_type_id__once = 0;
	if (g_once_init_enter (&code_widgets_source_list_data_model_type_id__once)) {
		GType code_widgets_source_list_data_model_type_id;
		code_widgets_source_list_data_model_type_id = code_widgets_source_list_data_model_get_type_once ();
		g_once_init_leave (&code_widgets_source_list_data_model_type_id__once, code_widgets_source_list_data_model_type_id);
	}
	return code_widgets_source_list_data_model_type_id__once;
}

static void
_vala_code_widgets_source_list_data_model_get_property (GObject * object,
                                                        guint property_id,
                                                        GValue * value,
                                                        GParamSpec * pspec)
{
	CodeWidgetsSourceListDataModel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CODE_WIDGETS_SOURCE_LIST_TYPE_DATA_MODEL, CodeWidgetsSourceListDataModel);
	switch (property_id) {
		case CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_ROOT_PROPERTY:
		g_value_set_object (value, code_widgets_source_list_data_model_get_root (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_code_widgets_source_list_data_model_set_property (GObject * object,
                                                        guint property_id,
                                                        const GValue * value,
                                                        GParamSpec * pspec)
{
	CodeWidgetsSourceListDataModel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CODE_WIDGETS_SOURCE_LIST_TYPE_DATA_MODEL, CodeWidgetsSourceListDataModel);
	switch (property_id) {
		case CODE_WIDGETS_SOURCE_LIST_DATA_MODEL_ROOT_PROPERTY:
		code_widgets_source_list_data_model_set_root (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static CodeWidgetsSourceListCellRendererIcon*
code_widgets_source_list_cell_renderer_icon_construct (GType object_type)
{
	CodeWidgetsSourceListCellRendererIcon * self = NULL;
	self = (CodeWidgetsSourceListCellRendererIcon*) g_object_new (object_type, NULL);
	return self;
}

static CodeWidgetsSourceListCellRendererIcon*
code_widgets_source_list_cell_renderer_icon_new (void)
{
	return code_widgets_source_list_cell_renderer_icon_construct (CODE_WIDGETS_SOURCE_LIST_TYPE_CELL_RENDERER_ICON);
}

static gboolean
code_widgets_source_list_cell_renderer_icon_real_activate (GtkCellRenderer* base,
                                                           GdkEvent* event,
                                                           GtkWidget* widget,
                                                           const gchar* path,
                                                           GdkRectangle* background_area,
                                                           GdkRectangle* cell_area,
                                                           GtkCellRendererState flags)
{
	CodeWidgetsSourceListCellRendererIcon * self;
	gboolean result;
	self = (CodeWidgetsSourceListCellRendererIcon*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	g_return_val_if_fail (widget != NULL, FALSE);
	g_return_val_if_fail (path != NULL, FALSE);
	g_return_val_if_fail (background_area != NULL, FALSE);
	g_return_val_if_fail (cell_area != NULL, FALSE);
	g_signal_emit (self, code_widgets_source_list_cell_renderer_icon_signals[CODE_WIDGETS_SOURCE_LIST_CELL_RENDERER_ICON_ACTIVATED_SIGNAL], 0, path);
	result = TRUE;
	return result;
}

static GObject *
code_widgets_source_list_cell_renderer_icon_constructor (GType type,
                                                         guint n_construct_properties,
                                                         GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	CodeWidgetsSourceListCellRendererIcon * self;
	parent_class = G_OBJECT_CLASS (code_widgets_source_list_cell_renderer_icon_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CODE_WIDGETS_SOURCE_LIST_TYPE_CELL_RENDERER_ICON, CodeWidgetsSourceListCellRendererIcon);
	g_object_set ((GtkCellRenderer*) self, "mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE, NULL);
	g_object_set ((GtkCellRendererPixbuf*) self, "stock-size", (guint) CODE_WIDGETS_SOURCE_LIST_CELL_RENDERER_ICON_ICON_SIZE, NULL);
	return obj;
}

static void
code_widgets_source_list_cell_renderer_icon_class_init (CodeWidgetsSourceListCellRendererIconClass * klass,
                                                        gpointer klass_data)
{
	code_widgets_source_list_cell_renderer_icon_parent_class = g_type_class_peek_parent (klass);
	((GtkCellRendererClass *) klass)->activate = (gboolean (*) (GtkCellRenderer*, GdkEvent*, GtkWidget*, const gchar*, GdkRectangle*, GdkRectangle*, GtkCellRendererState)) code_widgets_source_list_cell_renderer_icon_real_activate;
	G_OBJECT_CLASS (klass)->constructor = code_widgets_source_list_cell_renderer_icon_constructor;
	code_widgets_source_list_cell_renderer_icon_signals[CODE_WIDGETS_SOURCE_LIST_CELL_RENDERER_ICON_ACTIVATED_SIGNAL] = g_signal_new ("activated", CODE_WIDGETS_SOURCE_LIST_TYPE_CELL_RENDERER_ICON, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
}

static void
code_widgets_source_list_cell_renderer_icon_instance_init (CodeWidgetsSourceListCellRendererIcon * self,
                                                           gpointer klass)
{
}

/**
     * Class responsible for rendering Item.icon and Item.activatable. It also
     * notifies about clicks through the activated() signal.
     */
 G_GNUC_NO_INLINE static GType
code_widgets_source_list_cell_renderer_icon_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (CodeWidgetsSourceListCellRendererIconClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) code_widgets_source_list_cell_renderer_icon_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CodeWidgetsSourceListCellRendererIcon), 0, (GInstanceInitFunc) code_widgets_source_list_cell_renderer_icon_instance_init, NULL };
	GType code_widgets_source_list_cell_renderer_icon_type_id;
	code_widgets_source_list_cell_renderer_icon_type_id = g_type_register_static (gtk_cell_renderer_pixbuf_get_type (), "CodeWidgetsSourceListCellRendererIcon", &g_define_type_info, G_TYPE_FLAG_NONE);
	return code_widgets_source_list_cell_renderer_icon_type_id;
}

static GType
code_widgets_source_list_cell_renderer_icon_get_type (void)
{
	static gsize code_widgets_source_list_cell_renderer_icon_type_id__once = 0;
	if (g_once_init_enter (&code_widgets_source_list_cell_renderer_icon_type_id__once)) {
		GType code_widgets_source_list_cell_renderer_icon_type_id;
		code_widgets_source_list_cell_renderer_icon_type_id = code_widgets_source_list_cell_renderer_icon_get_type_once ();
		g_once_init_leave (&code_widgets_source_list_cell_renderer_icon_type_id__once, code_widgets_source_list_cell_renderer_icon_type_id);
	}
	return code_widgets_source_list_cell_renderer_icon_type_id__once;
}

static inline gpointer
code_widgets_source_list_cell_renderer_spacer_get_instance_private (CodeWidgetsSourceListCellRendererSpacer* self)
{
	return G_STRUCT_MEMBER_P (self, CodeWidgetsSourceListCellRendererSpacer_private_offset);
}

static GtkSizeRequestMode
code_widgets_source_list_cell_renderer_spacer_real_get_request_mode (GtkCellRenderer* base)
{
	CodeWidgetsSourceListCellRendererSpacer * self;
	GtkSizeRequestMode result;
	self = (CodeWidgetsSourceListCellRendererSpacer*) base;
	result = GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH;
	return result;
}

static void
code_widgets_source_list_cell_renderer_spacer_real_get_preferred_width (GtkCellRenderer* base,
                                                                        GtkWidget* widget,
                                                                        gint* min_size,
                                                                        gint* natural_size)
{
	CodeWidgetsSourceListCellRendererSpacer * self;
	gint _vala_min_size = 0;
	gint _vala_natural_size = 0;
	guint _tmp0_;
	guint _tmp1_;
	self = (CodeWidgetsSourceListCellRendererSpacer*) base;
	g_return_if_fail (widget != NULL);
	g_object_get ((GtkCellRenderer*) self, "xpad", &_tmp0_, NULL);
	_tmp1_ = _tmp0_;
	_vala_natural_size = 2 * ((gint) _tmp1_);
	_vala_min_size = _vala_natural_size;
	if (min_size) {
		*min_size = _vala_min_size;
	}
	if (natural_size) {
		*natural_size = _vala_natural_size;
	}
}

static void
code_widgets_source_list_cell_renderer_spacer_real_get_preferred_height_for_width (GtkCellRenderer* base,
                                                                                   GtkWidget* widget,
                                                                                   gint width,
                                                                                   gint* min_height,
                                                                                   gint* natural_height)
{
	CodeWidgetsSourceListCellRendererSpacer * self;
	gint _vala_min_height = 0;
	gint _vala_natural_height = 0;
	guint _tmp0_;
	guint _tmp1_;
	self = (CodeWidgetsSourceListCellRendererSpacer*) base;
	g_return_if_fail (widget != NULL);
	g_object_get ((GtkCellRenderer*) self, "ypad", &_tmp0_, NULL);
	_tmp1_ = _tmp0_;
	_vala_natural_height = 2 * ((gint) _tmp1_);
	_vala_min_height = _vala_natural_height;
	if (min_height) {
		*min_height = _vala_min_height;
	}
	if (natural_height) {
		*natural_height = _vala_natural_height;
	}
}

static void
code_widgets_source_list_cell_renderer_spacer_real_render (GtkCellRenderer* base,
                                                           cairo_t* context,
                                                           GtkWidget* widget,
                                                           GdkRectangle* bg_area,
                                                           GdkRectangle* cell_area,
                                                           GtkCellRendererState flags)
{
	CodeWidgetsSourceListCellRendererSpacer * self;
	self = (CodeWidgetsSourceListCellRendererSpacer*) base;
	g_return_if_fail (context != NULL);
	g_return_if_fail (widget != NULL);
	g_return_if_fail (bg_area != NULL);
	g_return_if_fail (cell_area != NULL);
}

static CodeWidgetsSourceListCellRendererSpacer*
code_widgets_source_list_cell_renderer_spacer_construct (GType object_type)
{
	CodeWidgetsSourceListCellRendererSpacer * self = NULL;
	self = (CodeWidgetsSourceListCellRendererSpacer*) g_object_new (object_type, NULL);
	return self;
}

static CodeWidgetsSourceListCellRendererSpacer*
code_widgets_source_list_cell_renderer_spacer_new (void)
{
	return code_widgets_source_list_cell_renderer_spacer_construct (CODE_WIDGETS_SOURCE_LIST_TYPE_CELL_RENDERER_SPACER);
}

static gint
code_widgets_source_list_cell_renderer_spacer_get_level (CodeWidgetsSourceListCellRendererSpacer* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_level;
	return result;
}

static void
code_widgets_source_list_cell_renderer_spacer_set_level (CodeWidgetsSourceListCellRendererSpacer* self,
                                                         gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = code_widgets_source_list_cell_renderer_spacer_get_level (self);
	if (old_value != value) {
		self->priv->_level = value;
		g_object_notify_by_pspec ((GObject *) self, code_widgets_source_list_cell_renderer_spacer_properties[CODE_WIDGETS_SOURCE_LIST_CELL_RENDERER_SPACER_LEVEL_PROPERTY]);
	}
}

static void
code_widgets_source_list_cell_renderer_spacer_class_init (CodeWidgetsSourceListCellRendererSpacerClass * klass,
                                                          gpointer klass_data)
{
	code_widgets_source_list_cell_renderer_spacer_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &CodeWidgetsSourceListCellRendererSpacer_private_offset);
	((GtkCellRendererClass *) klass)->get_request_mode = (GtkSizeRequestMode (*) (GtkCellRenderer*)) code_widgets_source_list_cell_renderer_spacer_real_get_request_mode;
	((GtkCellRendererClass *) klass)->get_preferred_width = (void (*) (GtkCellRenderer*, GtkWidget*, gint*, gint*)) code_widgets_source_list_cell_renderer_spacer_real_get_preferred_width;
	((GtkCellRendererClass *) klass)->get_preferred_height_for_width = (void (*) (GtkCellRenderer*, GtkWidget*, gint, gint*, gint*)) code_widgets_source_list_cell_renderer_spacer_real_get_preferred_height_for_width;
	((GtkCellRendererClass *) klass)->render = (void (*) (GtkCellRenderer*, cairo_t*, GtkWidget*, GdkRectangle*, GdkRectangle*, GtkCellRendererState)) code_widgets_source_list_cell_renderer_spacer_real_render;
	G_OBJECT_CLASS (klass)->get_property = _vala_code_widgets_source_list_cell_renderer_spacer_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_code_widgets_source_list_cell_renderer_spacer_set_property;
	G_OBJECT_CLASS (klass)->finalize = code_widgets_source_list_cell_renderer_spacer_finalize;
	/**
	         * Indentation level represented by this cell renderer
	         */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_SOURCE_LIST_CELL_RENDERER_SPACER_LEVEL_PROPERTY, code_widgets_source_list_cell_renderer_spacer_properties[CODE_WIDGETS_SOURCE_LIST_CELL_RENDERER_SPACER_LEVEL_PROPERTY] = g_param_spec_int ("level", "level", "level", G_MININT, G_MAXINT, -1, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
code_widgets_source_list_cell_renderer_spacer_instance_init (CodeWidgetsSourceListCellRendererSpacer * self,
                                                             gpointer klass)
{
	self->priv = code_widgets_source_list_cell_renderer_spacer_get_instance_private (self);
	self->priv->_level = -1;
}

static void
code_widgets_source_list_cell_renderer_spacer_finalize (GObject * obj)
{
	CodeWidgetsSourceListCellRendererSpacer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CODE_WIDGETS_SOURCE_LIST_TYPE_CELL_RENDERER_SPACER, CodeWidgetsSourceListCellRendererSpacer);
	G_OBJECT_CLASS (code_widgets_source_list_cell_renderer_spacer_parent_class)->finalize (obj);
}

/**
     * A cell renderer that only adds space.
     */
 G_GNUC_NO_INLINE static GType
code_widgets_source_list_cell_renderer_spacer_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (CodeWidgetsSourceListCellRendererSpacerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) code_widgets_source_list_cell_renderer_spacer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CodeWidgetsSourceListCellRendererSpacer), 0, (GInstanceInitFunc) code_widgets_source_list_cell_renderer_spacer_instance_init, NULL };
	GType code_widgets_source_list_cell_renderer_spacer_type_id;
	code_widgets_source_list_cell_renderer_spacer_type_id = g_type_register_static (gtk_cell_renderer_get_type (), "CodeWidgetsSourceListCellRendererSpacer", &g_define_type_info, G_TYPE_FLAG_NONE);
	CodeWidgetsSourceListCellRendererSpacer_private_offset = g_type_add_instance_private (code_widgets_source_list_cell_renderer_spacer_type_id, sizeof (CodeWidgetsSourceListCellRendererSpacerPrivate));
	return code_widgets_source_list_cell_renderer_spacer_type_id;
}

static GType
code_widgets_source_list_cell_renderer_spacer_get_type (void)
{
	static gsize code_widgets_source_list_cell_renderer_spacer_type_id__once = 0;
	if (g_once_init_enter (&code_widgets_source_list_cell_renderer_spacer_type_id__once)) {
		GType code_widgets_source_list_cell_renderer_spacer_type_id;
		code_widgets_source_list_cell_renderer_spacer_type_id = code_widgets_source_list_cell_renderer_spacer_get_type_once ();
		g_once_init_leave (&code_widgets_source_list_cell_renderer_spacer_type_id__once, code_widgets_source_list_cell_renderer_spacer_type_id);
	}
	return code_widgets_source_list_cell_renderer_spacer_type_id__once;
}

static void
_vala_code_widgets_source_list_cell_renderer_spacer_get_property (GObject * object,
                                                                  guint property_id,
                                                                  GValue * value,
                                                                  GParamSpec * pspec)
{
	CodeWidgetsSourceListCellRendererSpacer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CODE_WIDGETS_SOURCE_LIST_TYPE_CELL_RENDERER_SPACER, CodeWidgetsSourceListCellRendererSpacer);
	switch (property_id) {
		case CODE_WIDGETS_SOURCE_LIST_CELL_RENDERER_SPACER_LEVEL_PROPERTY:
		g_value_set_int (value, code_widgets_source_list_cell_renderer_spacer_get_level (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_code_widgets_source_list_cell_renderer_spacer_set_property (GObject * object,
                                                                  guint property_id,
                                                                  const GValue * value,
                                                                  GParamSpec * pspec)
{
	CodeWidgetsSourceListCellRendererSpacer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CODE_WIDGETS_SOURCE_LIST_TYPE_CELL_RENDERER_SPACER, CodeWidgetsSourceListCellRendererSpacer);
	switch (property_id) {
		case CODE_WIDGETS_SOURCE_LIST_CELL_RENDERER_SPACER_LEVEL_PROPERTY:
		code_widgets_source_list_cell_renderer_spacer_set_level (self, g_value_get_int (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
code_widgets_source_list_tree_get_instance_private (CodeWidgetsSourceListTree* self)
{
	return G_STRUCT_MEMBER_P (self, CodeWidgetsSourceListTree_private_offset);
}

 G_GNUC_NO_INLINE static GType
code_widgets_source_list_tree_column_get_type_once (void)
{
	static const GEnumValue values[] = {{CODE_WIDGETS_SOURCE_LIST_TREE_COLUMN_ITEM, "CODE_WIDGETS_SOURCE_LIST_TREE_COLUMN_ITEM", "item"}, {CODE_WIDGETS_SOURCE_LIST_TREE_COLUMN_N_COLS, "CODE_WIDGETS_SOURCE_LIST_TREE_COLUMN_N_COLS", "n-cols"}, {0, NULL, NULL}};
	GType code_widgets_source_list_tree_column_type_id;
	code_widgets_source_list_tree_column_type_id = g_enum_register_static ("CodeWidgetsSourceListTreeColumn", values);
	return code_widgets_source_list_tree_column_type_id;
}

static GType
code_widgets_source_list_tree_column_get_type (void)
{
	static gsize code_widgets_source_list_tree_column_type_id__once = 0;
	if (g_once_init_enter (&code_widgets_source_list_tree_column_type_id__once)) {
		GType code_widgets_source_list_tree_column_type_id;
		code_widgets_source_list_tree_column_type_id = code_widgets_source_list_tree_column_get_type_once ();
		g_once_init_leave (&code_widgets_source_list_tree_column_type_id__once, code_widgets_source_list_tree_column_type_id);
	}
	return code_widgets_source_list_tree_column_type_id__once;
}

static CodeWidgetsSourceListTree*
code_widgets_source_list_tree_construct (GType object_type,
                                         CodeWidgetsSourceListDataModel* data_model)
{
	CodeWidgetsSourceListTree * self = NULL;
	g_return_val_if_fail (data_model != NULL, NULL);
	self = (CodeWidgetsSourceListTree*) g_object_new (object_type, "data-model", data_model, NULL);
	return self;
}

static CodeWidgetsSourceListTree*
code_widgets_source_list_tree_new (CodeWidgetsSourceListDataModel* data_model)
{
	return code_widgets_source_list_tree_construct (CODE_WIDGETS_SOURCE_LIST_TYPE_TREE, data_model);
}

static gpointer
_gtk_target_list_ref0 (gpointer self)
{
	return self ? gtk_target_list_ref (self) : NULL;
}

static gboolean
code_widgets_source_list_tree_real_drag_motion (GtkWidget* base,
                                                GdkDragContext* context,
                                                gint x,
                                                gint y,
                                                guint time)
{
	CodeWidgetsSourceListTree * self;
	GtkTreePath* suggested_path = NULL;
	GtkTreePath* current_path = NULL;
	GtkTreeViewDropPosition suggested_pos = 0;
	GtkTreeViewDropPosition current_pos = 0;
	GtkTreePath* _tmp0_ = NULL;
	GtkTreeViewDropPosition _tmp1_ = 0;
	gboolean _tmp2_;
	gboolean result;
	self = (CodeWidgetsSourceListTree*) base;
	g_return_val_if_fail (context != NULL, FALSE);
	if (!GTK_WIDGET_CLASS (code_widgets_source_list_tree_parent_class)->drag_motion ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_tree_view_get_type (), GtkTreeView), context, x, y, time)) {
		result = FALSE;
		return result;
	}
	_tmp2_ = gtk_tree_view_get_dest_row_at_pos ((GtkTreeView*) self, x, y, &_tmp0_, &_tmp1_);
	__vala_GtkTreePath_free0 (suggested_path);
	suggested_path = _tmp0_;
	suggested_pos = _tmp1_;
	if (_tmp2_) {
		GtkTreePath* _tmp3_ = NULL;
		GtkTreeViewDropPosition _tmp4_ = 0;
		gboolean _tmp5_ = FALSE;
		GtkTreePath* _tmp6_;
		gtk_tree_view_get_drag_dest_row ((GtkTreeView*) self, &_tmp3_, &_tmp4_);
		__vala_GtkTreePath_free0 (current_path);
		current_path = _tmp3_;
		current_pos = _tmp4_;
		_tmp6_ = current_path;
		if (_tmp6_ != NULL) {
			GtkTreePath* _tmp7_;
			GtkTreePath* _tmp8_;
			_tmp7_ = suggested_path;
			_tmp8_ = current_path;
			_tmp5_ = gtk_tree_path_compare (_tmp7_, _tmp8_) == 0;
		} else {
			_tmp5_ = FALSE;
		}
		if (_tmp5_) {
			GtkWidget* source_widget = NULL;
			GtkWidget* _tmp9_;
			GtkWidget* _tmp10_;
			gboolean dragging_treemodel_row = FALSE;
			GtkWidget* _tmp11_;
			_tmp9_ = gtk_drag_get_source_widget (context);
			_tmp10_ = _g_object_ref0 (_tmp9_);
			source_widget = _tmp10_;
			_tmp11_ = source_widget;
			dragging_treemodel_row = _tmp11_ == G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget);
			if (dragging_treemodel_row) {
				if (current_pos != GTK_TREE_VIEW_DROP_BEFORE) {
					if (current_pos == GTK_TREE_VIEW_DROP_INTO_OR_BEFORE) {
						GtkTreePath* _tmp12_;
						_tmp12_ = current_path;
						gtk_tree_view_set_drag_dest_row ((GtkTreeView*) self, _tmp12_, GTK_TREE_VIEW_DROP_BEFORE);
					} else {
						gtk_tree_view_set_drag_dest_row ((GtkTreeView*) self, NULL, GTK_TREE_VIEW_DROP_AFTER);
					}
				}
			} else {
				CodeWidgetsSourceListDragDest* dest = NULL;
				CodeWidgetsSourceListDataModel* _tmp15_;
				GtkTreePath* _tmp16_;
				CodeWidgetsSourceListItem* _tmp17_;
				CodeWidgetsSourceListDragDest* _tmp18_;
				CodeWidgetsSourceListDragDest* _tmp19_;
				if (current_pos == GTK_TREE_VIEW_DROP_BEFORE) {
					GtkTreePath* _tmp13_;
					_tmp13_ = current_path;
					gtk_tree_view_set_drag_dest_row ((GtkTreeView*) self, _tmp13_, GTK_TREE_VIEW_DROP_INTO_OR_BEFORE);
				} else {
					if (current_pos == GTK_TREE_VIEW_DROP_AFTER) {
						GtkTreePath* _tmp14_;
						_tmp14_ = current_path;
						gtk_tree_view_set_drag_dest_row ((GtkTreeView*) self, _tmp14_, GTK_TREE_VIEW_DROP_INTO_OR_AFTER);
					}
				}
				_tmp15_ = self->priv->_data_model;
				_tmp16_ = current_path;
				_tmp17_ = code_widgets_source_list_data_model_get_item_from_path (_tmp15_, _tmp16_);
				_tmp18_ = CODE_WIDGETS_IS_SOURCE_LIST_DRAG_DEST (_tmp17_) ? ((CodeWidgetsSourceListDragDest*) _tmp17_) : NULL;
				if (_tmp18_ == NULL) {
					_g_object_unref0 (_tmp17_);
				}
				dest = _tmp18_;
				_tmp19_ = dest;
				if (_tmp19_ != NULL) {
					GtkTargetList* target_list = NULL;
					GtkTargetList* _tmp20_;
					GtkTargetList* _tmp21_;
					GdkAtom target = (GdkAtom) 0U;
					GtkTargetList* _tmp22_;
					_tmp20_ = gtk_drag_dest_get_target_list ((GtkWidget*) self);
					_tmp21_ = _gtk_target_list_ref0 (_tmp20_);
					target_list = _tmp21_;
					_tmp22_ = target_list;
					target = gtk_drag_dest_find_target ((GtkWidget*) self, context, _tmp22_);
					g_object_set_data_full ((GObject*) context, "suggested-dnd-action", (gpointer) ((gintptr) gdk_drag_context_get_suggested_action (context)), NULL);
					gtk_drag_get_data ((GtkWidget*) self, context, target, (guint32) time);
					_gtk_target_list_unref0 (target_list);
				} else {
					gtk_tree_view_set_drag_dest_row ((GtkTreeView*) self, NULL, GTK_TREE_VIEW_DROP_BEFORE);
				}
				_g_object_unref0 (dest);
			}
			_g_object_unref0 (source_widget);
		}
	} else {
		gtk_tree_view_set_drag_dest_row ((GtkTreeView*) self, NULL, GTK_TREE_VIEW_DROP_AFTER);
		result = FALSE;
		__vala_GtkTreePath_free0 (current_path);
		__vala_GtkTreePath_free0 (suggested_path);
		return result;
	}
	result = TRUE;
	__vala_GtkTreePath_free0 (current_path);
	__vala_GtkTreePath_free0 (suggested_path);
	return result;
}

static void
code_widgets_source_list_tree_real_drag_data_received (GtkWidget* base,
                                                       GdkDragContext* context,
                                                       gint x,
                                                       gint y,
                                                       GtkSelectionData* selection_data,
                                                       guint info,
                                                       guint time)
{
	CodeWidgetsSourceListTree * self;
	GtkTargetList* target_list = NULL;
	GtkTargetList* _tmp0_;
	GtkTargetList* _tmp1_;
	GdkAtom target = (GdkAtom) 0U;
	GtkTargetList* _tmp2_;
	GtkTreePath* path = NULL;
	GtkTreeViewDropPosition pos = 0;
	gconstpointer _tmp3_;
	self = (CodeWidgetsSourceListTree*) base;
	g_return_if_fail (context != NULL);
	g_return_if_fail (selection_data != NULL);
	_tmp0_ = gtk_drag_dest_get_target_list ((GtkWidget*) self);
	_tmp1_ = _gtk_target_list_ref0 (_tmp0_);
	target_list = _tmp1_;
	_tmp2_ = target_list;
	target = gtk_drag_dest_find_target ((GtkWidget*) self, context, _tmp2_);
	if (target == gdk_atom_intern_static_string ("GTK_TREE_MODEL_ROW")) {
		GTK_WIDGET_CLASS (code_widgets_source_list_tree_parent_class)->drag_data_received ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_tree_view_get_type (), GtkTreeView), context, x, y, selection_data, info, time);
		_gtk_target_list_unref0 (target_list);
		return;
	}
	_tmp3_ = g_object_get_data ((GObject*) context, "suggested-dnd-action");
	if (((gint) ((gintptr) _tmp3_)) != 0) {
		GtkTreePath* _tmp4_ = NULL;
		GtkTreeViewDropPosition _tmp5_ = 0;
		GtkTreePath* _tmp6_;
		g_object_set_data_full ((GObject*) context, "suggested-dnd-action", (gpointer) ((gintptr) 0), NULL);
		gtk_tree_view_get_drag_dest_row ((GtkTreeView*) self, &_tmp4_, &_tmp5_);
		__vala_GtkTreePath_free0 (path);
		path = _tmp4_;
		pos = _tmp5_;
		_tmp6_ = path;
		if (_tmp6_ != NULL) {
			CodeWidgetsSourceListDragDest* dest = NULL;
			CodeWidgetsSourceListDataModel* _tmp7_;
			GtkTreePath* _tmp8_;
			CodeWidgetsSourceListItem* _tmp9_;
			CodeWidgetsSourceListDragDest* _tmp10_;
			gboolean _tmp11_ = FALSE;
			CodeWidgetsSourceListDragDest* _tmp12_;
			_tmp7_ = self->priv->_data_model;
			_tmp8_ = path;
			_tmp9_ = code_widgets_source_list_data_model_get_item_from_path (_tmp7_, _tmp8_);
			_tmp10_ = CODE_WIDGETS_IS_SOURCE_LIST_DRAG_DEST (_tmp9_) ? ((CodeWidgetsSourceListDragDest*) _tmp9_) : NULL;
			if (_tmp10_ == NULL) {
				_g_object_unref0 (_tmp9_);
			}
			dest = _tmp10_;
			_tmp12_ = dest;
			if (_tmp12_ == NULL) {
				_tmp11_ = TRUE;
			} else {
				CodeWidgetsSourceListDragDest* _tmp13_;
				_tmp13_ = dest;
				_tmp11_ = !code_widgets_source_list_drag_dest_data_drop_possible (_tmp13_, context, selection_data);
			}
			if (_tmp11_) {
				gtk_tree_view_set_drag_dest_row ((GtkTreeView*) self, NULL, GTK_TREE_VIEW_DROP_BEFORE);
				gdk_drag_status (context, 0, (guint32) time);
				_g_object_unref0 (dest);
				__vala_GtkTreePath_free0 (path);
				_gtk_target_list_unref0 (target_list);
				return;
			}
			_g_object_unref0 (dest);
		}
		gdk_drag_status (context, gdk_drag_context_get_suggested_action (context), (guint32) time);
	} else {
		GtkTreePath* _tmp14_ = NULL;
		GtkTreeViewDropPosition _tmp15_ = 0;
		gboolean _tmp16_;
		_tmp16_ = gtk_tree_view_get_dest_row_at_pos ((GtkTreeView*) self, x, y, &_tmp14_, &_tmp15_);
		__vala_GtkTreePath_free0 (path);
		path = _tmp14_;
		pos = _tmp15_;
		if (_tmp16_) {
			CodeWidgetsSourceListDragDest* drag_dest = NULL;
			CodeWidgetsSourceListDataModel* _tmp17_;
			GtkTreePath* _tmp18_;
			CodeWidgetsSourceListItem* _tmp19_;
			CodeWidgetsSourceListDragDest* _tmp20_;
			CodeWidgetsSourceListDragDest* _tmp21_;
			_tmp17_ = self->priv->_data_model;
			_tmp18_ = path;
			_tmp19_ = code_widgets_source_list_data_model_get_item_from_path (_tmp17_, _tmp18_);
			_tmp20_ = CODE_WIDGETS_IS_SOURCE_LIST_DRAG_DEST (_tmp19_) ? ((CodeWidgetsSourceListDragDest*) _tmp19_) : NULL;
			if (_tmp20_ == NULL) {
				_g_object_unref0 (_tmp19_);
			}
			drag_dest = _tmp20_;
			_tmp21_ = drag_dest;
			if (_tmp21_ != NULL) {
				GdkDragAction action = 0U;
				CodeWidgetsSourceListDragDest* _tmp22_;
				_tmp22_ = drag_dest;
				action = code_widgets_source_list_drag_dest_data_received (_tmp22_, context, selection_data);
				gtk_drag_finish (context, action != 0, action == GDK_ACTION_MOVE, (guint32) time);
				_g_object_unref0 (drag_dest);
				__vala_GtkTreePath_free0 (path);
				_gtk_target_list_unref0 (target_list);
				return;
			}
			_g_object_unref0 (drag_dest);
		}
		gtk_drag_finish (context, FALSE, FALSE, (guint32) time);
	}
	__vala_GtkTreePath_free0 (path);
	_gtk_target_list_unref0 (target_list);
}

static void
code_widgets_source_list_tree_configure_drag_source (CodeWidgetsSourceListTree* self,
                                                     GtkTargetEntry* src_entries,
                                                     gint src_entries_length1)
{
	GtkTargetEntry* entries = NULL;
	gint _tmp0_ = 0;
	GtkTargetEntry* _tmp1_;
	gint entries_length1;
	gint _entries_size_;
	g_return_if_fail (self != NULL);
	_tmp1_ = code_widgets_source_list_tree_append_row_target_entry (src_entries, (gint) src_entries_length1, &_tmp0_);
	entries = _tmp1_;
	entries_length1 = _tmp0_;
	_entries_size_ = entries_length1;
	gtk_tree_view_unset_rows_drag_source ((GtkTreeView*) self);
	gtk_tree_view_enable_model_drag_source ((GtkTreeView*) self, GDK_BUTTON1_MASK, entries, (gint) entries_length1, GDK_ACTION_MOVE);
	entries = (g_free (entries), NULL);
}

static void
code_widgets_source_list_tree_configure_drag_dest (CodeWidgetsSourceListTree* self,
                                                   GtkTargetEntry* dest_entries,
                                                   gint dest_entries_length1,
                                                   GdkDragAction actions)
{
	GtkTargetEntry* entries = NULL;
	gint _tmp0_ = 0;
	GtkTargetEntry* _tmp1_;
	gint entries_length1;
	gint _entries_size_;
	g_return_if_fail (self != NULL);
	_tmp1_ = code_widgets_source_list_tree_append_row_target_entry (dest_entries, (gint) dest_entries_length1, &_tmp0_);
	entries = _tmp1_;
	entries_length1 = _tmp0_;
	_entries_size_ = entries_length1;
	gtk_tree_view_unset_rows_drag_dest ((GtkTreeView*) self);
	gtk_tree_view_enable_model_drag_dest ((GtkTreeView*) self, entries, (gint) entries_length1, GDK_ACTION_MOVE | actions);
	entries = (g_free (entries), NULL);
}

static gboolean
code_widgets_source_list_tree_on_query_tooltip (CodeWidgetsSourceListTree* self,
                                                gint x,
                                                gint y,
                                                gboolean keyboard_tooltip,
                                                GtkTooltip* tooltip)
{
	GtkTreePath* path = NULL;
	GtkTreeViewColumn* column = NULL;
	GtkTreeViewColumn* _tmp0_;
	GtkTreeViewColumn* _tmp1_;
	GtkTreePath* _tmp2_ = NULL;
	GtkTreePath* _tmp3_;
	CodeWidgetsSourceListItem* item = NULL;
	CodeWidgetsSourceListDataModel* _tmp4_;
	GtkTreePath* _tmp5_;
	CodeWidgetsSourceListItem* _tmp6_;
	CodeWidgetsSourceListItem* _tmp7_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (tooltip != NULL, FALSE);
	_tmp0_ = gtk_tree_view_get_column ((GtkTreeView*) self, (gint) CODE_WIDGETS_SOURCE_LIST_TREE_COLUMN_ITEM);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	column = _tmp1_;
	gtk_tree_view_get_tooltip_context ((GtkTreeView*) self, &x, &y, keyboard_tooltip, NULL, &_tmp2_, NULL);
	__vala_GtkTreePath_free0 (path);
	path = _tmp2_;
	_tmp3_ = path;
	if (_tmp3_ == NULL) {
		result = FALSE;
		_g_object_unref0 (column);
		__vala_GtkTreePath_free0 (path);
		return result;
	}
	_tmp4_ = self->priv->_data_model;
	_tmp5_ = path;
	_tmp6_ = code_widgets_source_list_data_model_get_item_from_path (_tmp4_, _tmp5_);
	item = _tmp6_;
	_tmp7_ = item;
	if (_tmp7_ != NULL) {
		gboolean should_show = FALSE;
		GdkRectangle start_cell_area = {0};
		GtkTreePath* _tmp8_;
		GtkTreeViewColumn* _tmp9_;
		GdkRectangle _tmp10_ = {0};
		GtkTreePath* _tmp11_;
		CodeWidgetsSourceListItem* _tmp12_;
		const gchar* _tmp13_;
		const gchar* _tmp14_;
		gboolean _tmp27_ = FALSE;
		GtkTreeViewColumn* _tmp28_;
		GtkTreePath* _tmp29_;
		GtkCellRendererText* _tmp30_;
		GdkRectangle _tmp31_;
		should_show = FALSE;
		_tmp8_ = path;
		_tmp9_ = column;
		gtk_tree_view_get_cell_area ((GtkTreeView*) self, _tmp8_, _tmp9_, &_tmp10_);
		start_cell_area = _tmp10_;
		_tmp11_ = path;
		gtk_tree_view_set_tooltip_row ((GtkTreeView*) self, tooltip, _tmp11_);
		_tmp12_ = item;
		_tmp13_ = code_widgets_source_list_item_get_tooltip (_tmp12_);
		_tmp14_ = _tmp13_;
		if (_tmp14_ == NULL) {
			CodeWidgetsSourceListItem* _tmp15_;
			const gchar* _tmp16_;
			const gchar* _tmp17_;
			_tmp15_ = item;
			_tmp16_ = code_widgets_source_list_item_get_name (_tmp15_);
			_tmp17_ = _tmp16_;
			if (g_strcmp0 (_tmp17_, "") != 0) {
				CodeWidgetsSourceListItem* _tmp18_;
				const gchar* _tmp19_;
				const gchar* _tmp20_;
				_tmp18_ = item;
				_tmp19_ = code_widgets_source_list_item_get_name (_tmp18_);
				_tmp20_ = _tmp19_;
				gtk_tooltip_set_markup (tooltip, _tmp20_);
				should_show = TRUE;
			}
		} else {
			CodeWidgetsSourceListItem* _tmp21_;
			const gchar* _tmp22_;
			const gchar* _tmp23_;
			_tmp21_ = item;
			_tmp22_ = code_widgets_source_list_item_get_tooltip (_tmp21_);
			_tmp23_ = _tmp22_;
			if (g_strcmp0 (_tmp23_, "") != 0) {
				CodeWidgetsSourceListItem* _tmp24_;
				const gchar* _tmp25_;
				const gchar* _tmp26_;
				_tmp24_ = item;
				_tmp25_ = code_widgets_source_list_item_get_tooltip (_tmp24_);
				_tmp26_ = _tmp25_;
				gtk_tooltip_set_markup (tooltip, _tmp26_);
				should_show = TRUE;
			}
		}
		if (keyboard_tooltip) {
			result = should_show;
			_g_object_unref0 (item);
			_g_object_unref0 (column);
			__vala_GtkTreePath_free0 (path);
			return result;
		}
		_tmp28_ = column;
		_tmp29_ = path;
		_tmp30_ = self->priv->text_cell;
		_tmp31_ = start_cell_area;
		if (code_widgets_source_list_tree_over_cell (self, _tmp28_, _tmp29_, (GtkCellRenderer*) _tmp30_, x - _tmp31_.x)) {
			_tmp27_ = TRUE;
		} else {
			GtkTreeViewColumn* _tmp32_;
			GtkTreePath* _tmp33_;
			CodeWidgetsSourceListCellRendererIcon* _tmp34_;
			GdkRectangle _tmp35_;
			_tmp32_ = column;
			_tmp33_ = path;
			_tmp34_ = self->priv->icon_cell;
			_tmp35_ = start_cell_area;
			_tmp27_ = code_widgets_source_list_tree_over_cell (self, _tmp32_, _tmp33_, (GtkCellRenderer*) _tmp34_, x - _tmp35_.x);
		}
		if (_tmp27_) {
			result = should_show;
			_g_object_unref0 (item);
			_g_object_unref0 (column);
			__vala_GtkTreePath_free0 (path);
			return result;
		} else {
			GtkTreeViewColumn* _tmp36_;
			GtkTreePath* _tmp37_;
			CodeWidgetsSourceListCellRendererIcon* _tmp38_;
			GdkRectangle _tmp39_;
			_tmp36_ = column;
			_tmp37_ = path;
			_tmp38_ = self->priv->activatable_cell;
			_tmp39_ = start_cell_area;
			if (code_widgets_source_list_tree_over_cell (self, _tmp36_, _tmp37_, (GtkCellRenderer*) _tmp38_, x - _tmp39_.x)) {
				CodeWidgetsSourceListItem* _tmp40_;
				const gchar* _tmp41_;
				const gchar* _tmp42_;
				_tmp40_ = item;
				_tmp41_ = code_widgets_source_list_item_get_activatable_tooltip (_tmp40_);
				_tmp42_ = _tmp41_;
				if (g_strcmp0 (_tmp42_, "") == 0) {
					result = FALSE;
					_g_object_unref0 (item);
					_g_object_unref0 (column);
					__vala_GtkTreePath_free0 (path);
					return result;
				} else {
					CodeWidgetsSourceListItem* _tmp43_;
					const gchar* _tmp44_;
					const gchar* _tmp45_;
					_tmp43_ = item;
					_tmp44_ = code_widgets_source_list_item_get_activatable_tooltip (_tmp43_);
					_tmp45_ = _tmp44_;
					gtk_tooltip_set_markup (tooltip, _tmp45_);
					result = TRUE;
					_g_object_unref0 (item);
					_g_object_unref0 (column);
					__vala_GtkTreePath_free0 (path);
					return result;
				}
			}
		}
	}
	result = FALSE;
	_g_object_unref0 (item);
	_g_object_unref0 (column);
	__vala_GtkTreePath_free0 (path);
	return result;
}

static void
_vala_array_add4 (GtkTargetEntry* * array,
                  gint* length,
                  gint* size,
                  const GtkTargetEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkTargetEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add5 (GtkTargetEntry* * array,
                  gint* length,
                  gint* size,
                  const GtkTargetEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkTargetEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static GtkTargetEntry*
code_widgets_source_list_tree_append_row_target_entry (GtkTargetEntry* orig,
                                                       gint orig_length1,
                                                       gint* result_length1)
{
	static const GtkTargetEntry row_target_entry = {"GTK_TREE_MODEL_ROW", (guint) GTK_TARGET_SAME_WIDGET, (guint) 0};
	GtkTargetEntry* entries = NULL;
	GtkTargetEntry* _tmp0_;
	gint entries_length1;
	gint _entries_size_;
	GtkTargetEntry* _tmp2_;
	gint _tmp2__length1;
	GtkTargetEntry* result;
	_tmp0_ = g_new0 (GtkTargetEntry, 0);
	entries = _tmp0_;
	entries_length1 = 0;
	_entries_size_ = entries_length1;
	_vala_array_add4 (&entries, &entries_length1, &_entries_size_, &row_target_entry);
	if (orig != NULL) {
		{
			GtkTargetEntry* target_entry_collection = NULL;
			gint target_entry_collection_length1 = 0;
			gint _target_entry_collection_size_ = 0;
			gint target_entry_it = 0;
			target_entry_collection = orig;
			target_entry_collection_length1 = orig_length1;
			for (target_entry_it = 0; target_entry_it < target_entry_collection_length1; target_entry_it = target_entry_it + 1) {
				GtkTargetEntry target_entry = {0};
				target_entry = target_entry_collection[target_entry_it];
				{
					GtkTargetEntry _tmp1_;
					_tmp1_ = target_entry;
					_vala_array_add5 (&entries, &entries_length1, &_entries_size_, &_tmp1_);
				}
			}
		}
	}
	_tmp2_ = entries;
	_tmp2__length1 = entries_length1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	return result;
}

static void
_code_widgets_source_list_tree_on_model_item_updated_code_widgets_source_list_data_model_item_updated (CodeWidgetsSourceListDataModel* _sender,
                                                                                                       CodeWidgetsSourceListItem* item,
                                                                                                       gpointer self)
{
	code_widgets_source_list_tree_on_model_item_updated ((CodeWidgetsSourceListTree*) self, item);
}

static void
code_widgets_source_list_tree_enable_item_property_monitor (CodeWidgetsSourceListTree* self)
{
	CodeWidgetsSourceListDataModel* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_data_model;
	g_signal_connect_object (_tmp0_, "item-updated", (GCallback) _code_widgets_source_list_tree_on_model_item_updated_code_widgets_source_list_data_model_item_updated, self, G_CONNECT_AFTER);
}

static void
code_widgets_source_list_tree_disable_item_property_monitor (CodeWidgetsSourceListTree* self)
{
	CodeWidgetsSourceListDataModel* _tmp0_;
	guint _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_data_model;
	g_signal_parse_name ("item-updated", CODE_WIDGETS_SOURCE_LIST_TYPE_DATA_MODEL, &_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) _code_widgets_source_list_tree_on_model_item_updated_code_widgets_source_list_data_model_item_updated, self);
}

static void
code_widgets_source_list_tree_on_model_item_updated (CodeWidgetsSourceListTree* self,
                                                     CodeWidgetsSourceListItem* item)
{
	CodeWidgetsSourceListExpandableItem* expandable_item = NULL;
	CodeWidgetsSourceListExpandableItem* _tmp0_;
	CodeWidgetsSourceListExpandableItem* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	_tmp0_ = _g_object_ref0 (CODE_WIDGETS_SOURCE_LIST_IS_EXPANDABLE_ITEM (item) ? ((CodeWidgetsSourceListExpandableItem*) item) : NULL);
	expandable_item = _tmp0_;
	_tmp1_ = expandable_item;
	if (_tmp1_ != NULL) {
		CodeWidgetsSourceListExpandableItem* _tmp2_;
		_tmp2_ = expandable_item;
		code_widgets_source_list_tree_update_expansion (self, _tmp2_);
	}
	_g_object_unref0 (expandable_item);
}

static void
_code_widgets_source_list_tree_spacer_cell_data_func_gtk_cell_layout_data_func (GtkCellLayout* cell_layout,
                                                                                GtkCellRenderer* cell,
                                                                                GtkTreeModel* tree_model,
                                                                                GtkTreeIter* iter,
                                                                                gpointer self)
{
	code_widgets_source_list_tree_spacer_cell_data_func (cell_layout, cell, tree_model, iter);
}

static void
code_widgets_source_list_tree_add_spacer_cell_for_level (CodeWidgetsSourceListTree* self,
                                                         gint level,
                                                         gboolean check_previous)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp2_;
	g_return_if_fail (self != NULL);
	_vala_return_if_fail (level > 0, "level > 0");
	_tmp0_ = self->priv->spacer_cells;
	if (_tmp0_ == NULL) {
		GeeHashMap* _tmp1_;
		_tmp1_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, CODE_WIDGETS_SOURCE_LIST_TYPE_CELL_RENDERER_SPACER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
		_g_object_unref0 (self->priv->spacer_cells);
		self->priv->spacer_cells = _tmp1_;
	}
	_tmp2_ = self->priv->spacer_cells;
	if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp2_, (gpointer) ((gintptr) level))) {
		CodeWidgetsSourceListCellRendererSpacer* spacer_cell = NULL;
		CodeWidgetsSourceListCellRendererSpacer* _tmp3_;
		CodeWidgetsSourceListCellRendererSpacer* _tmp4_;
		GeeHashMap* _tmp5_;
		CodeWidgetsSourceListCellRendererSpacer* _tmp6_;
		guint cell_xpadding = 0U;
		CodeWidgetsSourceListCellRendererSpacer* _tmp9_;
		GtkTreeViewColumn* item_column = NULL;
		GtkTreeViewColumn* _tmp10_;
		GtkTreeViewColumn* _tmp11_;
		GtkTreeViewColumn* _tmp12_;
		CodeWidgetsSourceListCellRendererSpacer* _tmp13_;
		GtkTreeViewColumn* _tmp14_;
		CodeWidgetsSourceListCellRendererSpacer* _tmp15_;
		_tmp3_ = code_widgets_source_list_cell_renderer_spacer_new ();
		g_object_ref_sink (_tmp3_);
		spacer_cell = _tmp3_;
		_tmp4_ = spacer_cell;
		code_widgets_source_list_cell_renderer_spacer_set_level (_tmp4_, level);
		_tmp5_ = self->priv->spacer_cells;
		_tmp6_ = spacer_cell;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp5_, (gpointer) ((gintptr) level), _tmp6_);
		switch (level) {
			case 1:
			{
				gint left_padding = 0;
				gint _tmp7_ = 0;
				gtk_widget_style_get ((GtkWidget*) self, CODE_WIDGETS_SOURCE_LIST_TREE_STYLE_PROP_LEFT_PADDING, &_tmp7_, NULL);
				left_padding = _tmp7_;
				cell_xpadding = (guint) (left_padding / 2);
				break;
			}
			case 2:
			{
				cell_xpadding = (guint) 0;
				break;
			}
			default:
			{
				gint level_indentation = 0;
				gint _tmp8_ = 0;
				gtk_widget_style_get ((GtkWidget*) self, CODE_WIDGETS_SOURCE_LIST_TREE_STYLE_PROP_LEVEL_INDENTATION, &_tmp8_, NULL);
				level_indentation = _tmp8_;
				cell_xpadding = (guint) (level_indentation / 2);
				break;
			}
		}
		_tmp9_ = spacer_cell;
		g_object_set ((GtkCellRenderer*) _tmp9_, "xpad", cell_xpadding, NULL);
		_tmp10_ = gtk_tree_view_get_column ((GtkTreeView*) self, (gint) CODE_WIDGETS_SOURCE_LIST_TREE_COLUMN_ITEM);
		_tmp11_ = _g_object_ref0 (_tmp10_);
		item_column = _tmp11_;
		_tmp12_ = item_column;
		_tmp13_ = spacer_cell;
		gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp12_, (GtkCellRenderer*) _tmp13_, FALSE);
		_tmp14_ = item_column;
		_tmp15_ = spacer_cell;
		gtk_cell_layout_set_cell_data_func ((GtkCellLayout*) _tmp14_, (GtkCellRenderer*) _tmp15_, _code_widgets_source_list_tree_spacer_cell_data_func_gtk_cell_layout_data_func, NULL, NULL);
		if (check_previous) {
			{
				gint i = 0;
				i = level - 1;
				{
					gboolean _tmp16_ = FALSE;
					_tmp16_ = TRUE;
					while (TRUE) {
						if (!_tmp16_) {
							gint _tmp17_;
							_tmp17_ = i;
							i = _tmp17_ - 1;
						}
						_tmp16_ = FALSE;
						if (!(i > 0)) {
							break;
						}
						code_widgets_source_list_tree_add_spacer_cell_for_level (self, i, FALSE);
					}
				}
			}
		}
		_g_object_unref0 (item_column);
		_g_object_unref0 (spacer_cell);
	}
}

/**
         * Evaluates whether the item at the specified path can be selected or not.
         */
static gboolean
code_widgets_source_list_tree_select_func (CodeWidgetsSourceListTree* self,
                                           GtkTreeSelection* selection,
                                           GtkTreeModel* model,
                                           GtkTreePath* path,
                                           gboolean path_currently_selected)
{
	gboolean selectable = FALSE;
	CodeWidgetsSourceListItem* item = NULL;
	CodeWidgetsSourceListDataModel* _tmp0_;
	CodeWidgetsSourceListItem* _tmp1_;
	CodeWidgetsSourceListItem* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (selection != NULL, FALSE);
	g_return_val_if_fail (model != NULL, FALSE);
	g_return_val_if_fail (path != NULL, FALSE);
	selectable = FALSE;
	_tmp0_ = self->priv->_data_model;
	_tmp1_ = code_widgets_source_list_data_model_get_item_from_path (_tmp0_, path);
	item = _tmp1_;
	_tmp2_ = item;
	if (_tmp2_ != NULL) {
		CodeWidgetsSourceListDataModel* _tmp3_;
		CodeWidgetsSourceListItem* _tmp4_;
		_tmp3_ = self->priv->_data_model;
		_tmp4_ = item;
		if (!code_widgets_source_list_data_model_is_category (_tmp3_, _tmp4_, NULL, path)) {
			CodeWidgetsSourceListItem* _tmp5_;
			gboolean _tmp6_;
			gboolean _tmp7_;
			_tmp5_ = item;
			_tmp6_ = code_widgets_source_list_item_get_selectable (_tmp5_);
			_tmp7_ = _tmp6_;
			selectable = _tmp7_;
		}
	}
	result = selectable;
	_g_object_unref0 (item);
	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_);
}

static GtkTreePath*
code_widgets_source_list_tree_get_selected_path (CodeWidgetsSourceListTree* self)
{
	GtkTreePath* selected_path = NULL;
	GtkTreeSelection* selection = NULL;
	GtkTreeSelection* _tmp0_;
	GtkTreeSelection* _tmp1_;
	GtkTreeSelection* _tmp2_;
	GtkTreePath* result;
	g_return_val_if_fail (self != NULL, NULL);
	selected_path = NULL;
	_tmp0_ = gtk_tree_view_get_selection ((GtkTreeView*) self);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	selection = _tmp1_;
	_tmp2_ = selection;
	if (_tmp2_ != NULL) {
		GtkTreeModel* model = NULL;
		GList* selected_rows = NULL;
		GtkTreeSelection* _tmp3_;
		GtkTreeModel* _tmp4_ = NULL;
		GList* _tmp5_;
		GtkTreeModel* _tmp6_;
		GList* _tmp7_;
		_tmp3_ = selection;
		_tmp5_ = gtk_tree_selection_get_selected_rows (_tmp3_, &_tmp4_);
		_g_object_unref0 (model);
		_tmp6_ = _g_object_ref0 (_tmp4_);
		model = _tmp6_;
		selected_rows = _tmp5_;
		_tmp7_ = selected_rows;
		if (g_list_length (_tmp7_) == ((guint) 1)) {
			GList* _tmp8_;
			gconstpointer _tmp9_;
			GtkTreePath* _tmp10_;
			_tmp8_ = selected_rows;
			_tmp9_ = g_list_nth_data (_tmp8_, (guint) 0);
			_tmp10_ = __vala_GtkTreePath_copy0 ((GtkTreePath*) _tmp9_);
			__vala_GtkTreePath_free0 (selected_path);
			selected_path = _tmp10_;
		}
		(selected_rows == NULL) ? NULL : (selected_rows = (_g_list_free___vala_GtkTreePath_free0_ (selected_rows), NULL));
		_g_object_unref0 (model);
	}
	result = selected_path;
	_g_object_unref0 (selection);
	return result;
}

static void
code_widgets_source_list_tree_set_selected (CodeWidgetsSourceListTree* self,
                                            CodeWidgetsSourceListItem* item,
                                            gboolean scroll_to_item)
{
	g_return_if_fail (self != NULL);
	if (item == NULL) {
		GtkTreeSelection* selection = NULL;
		GtkTreeSelection* _tmp0_;
		GtkTreeSelection* _tmp1_;
		GtkTreeSelection* _tmp2_;
		_tmp0_ = gtk_tree_view_get_selection ((GtkTreeView*) self);
		_tmp1_ = _g_object_ref0 (_tmp0_);
		selection = _tmp1_;
		_tmp2_ = selection;
		if (_tmp2_ != NULL) {
			GtkTreeSelection* _tmp3_;
			_tmp3_ = selection;
			gtk_tree_selection_unselect_all (_tmp3_);
		}
		_g_object_unref0 (self->priv->selected);
		self->priv->selected = NULL;
		g_signal_emit (self, code_widgets_source_list_tree_signals[CODE_WIDGETS_SOURCE_LIST_TREE_ITEM_SELECTED_SIGNAL], 0, NULL);
		_g_object_unref0 (selection);
	} else {
		gboolean _tmp4_;
		gboolean _tmp5_;
		_tmp4_ = code_widgets_source_list_item_get_selectable (item);
		_tmp5_ = _tmp4_;
		if (_tmp5_) {
			GtkTreePath* to_select = NULL;
			CodeWidgetsSourceListDataModel* _tmp6_;
			GtkTreePath* _tmp7_;
			GtkTreePath* _tmp8_;
			if (scroll_to_item) {
				code_widgets_source_list_tree_scroll_to_item (self, item, FALSE, (gfloat) 0);
			}
			_tmp6_ = self->priv->_data_model;
			_tmp7_ = code_widgets_source_list_data_model_get_item_path (_tmp6_, item);
			to_select = _tmp7_;
			_tmp8_ = to_select;
			if (_tmp8_ != NULL) {
				GtkTreePath* _tmp9_;
				GtkTreeViewColumn* _tmp10_;
				GtkCellRendererText* _tmp11_;
				_tmp9_ = to_select;
				_tmp10_ = gtk_tree_view_get_column ((GtkTreeView*) self, (gint) CODE_WIDGETS_SOURCE_LIST_TREE_COLUMN_ITEM);
				_tmp11_ = self->priv->text_cell;
				gtk_tree_view_set_cursor_on_cell ((GtkTreeView*) self, _tmp9_, _tmp10_, (GtkCellRenderer*) _tmp11_, FALSE);
			}
			__vala_GtkTreePath_free0 (to_select);
		}
	}
}

static void
code_widgets_source_list_tree_real_cursor_changed (GtkTreeView* base)
{
	CodeWidgetsSourceListTree * self;
	GtkTreePath* path = NULL;
	GtkTreePath* _tmp0_;
	CodeWidgetsSourceListItem* _tmp1_ = NULL;
	GtkTreePath* _tmp2_;
	CodeWidgetsSourceListItem* new_item = NULL;
	CodeWidgetsSourceListItem* _tmp6_;
	gboolean _tmp7_ = FALSE;
	CodeWidgetsSourceListItem* _tmp8_;
	self = (CodeWidgetsSourceListTree*) base;
	_tmp0_ = code_widgets_source_list_tree_get_selected_path (self);
	path = _tmp0_;
	_tmp2_ = path;
	if (_tmp2_ != NULL) {
		CodeWidgetsSourceListDataModel* _tmp3_;
		GtkTreePath* _tmp4_;
		CodeWidgetsSourceListItem* _tmp5_;
		_tmp3_ = self->priv->_data_model;
		_tmp4_ = path;
		_tmp5_ = code_widgets_source_list_data_model_get_item_from_path (_tmp3_, _tmp4_);
		_g_object_unref0 (_tmp1_);
		_tmp1_ = _tmp5_;
	} else {
		_g_object_unref0 (_tmp1_);
		_tmp1_ = NULL;
	}
	_tmp6_ = _tmp1_;
	_tmp1_ = NULL;
	new_item = _tmp6_;
	_tmp8_ = new_item;
	if (_tmp8_ != NULL) {
		CodeWidgetsSourceListItem* _tmp9_;
		CodeWidgetsSourceListItem* _tmp10_;
		_tmp9_ = new_item;
		_tmp10_ = self->priv->selected;
		_tmp7_ = _tmp9_ != _tmp10_;
	} else {
		_tmp7_ = FALSE;
	}
	if (_tmp7_) {
		CodeWidgetsSourceListItem* _tmp11_;
		CodeWidgetsSourceListItem* _tmp12_;
		CodeWidgetsSourceListItem* _tmp13_;
		_tmp11_ = new_item;
		_tmp12_ = _g_object_ref0 (_tmp11_);
		_g_object_unref0 (self->priv->selected);
		self->priv->selected = _tmp12_;
		_tmp13_ = new_item;
		g_signal_emit (self, code_widgets_source_list_tree_signals[CODE_WIDGETS_SOURCE_LIST_TREE_ITEM_SELECTED_SIGNAL], 0, _tmp13_);
	}
	_g_object_unref0 (new_item);
	_g_object_unref0 (_tmp1_);
	__vala_GtkTreePath_free0 (path);
}

static gboolean
code_widgets_source_list_tree_scroll_to_item (CodeWidgetsSourceListTree* self,
                                              CodeWidgetsSourceListItem* item,
                                              gboolean use_align,
                                              gfloat row_align)
{
	gboolean scrolled = FALSE;
	GtkTreePath* path = NULL;
	CodeWidgetsSourceListDataModel* _tmp0_;
	GtkTreePath* _tmp1_;
	GtkTreePath* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (item != NULL, FALSE);
	scrolled = FALSE;
	_tmp0_ = self->priv->_data_model;
	_tmp1_ = code_widgets_source_list_data_model_get_item_path (_tmp0_, item);
	path = _tmp1_;
	_tmp2_ = path;
	if (_tmp2_ != NULL) {
		GtkTreePath* _tmp3_;
		_tmp3_ = path;
		gtk_tree_view_scroll_to_cell ((GtkTreeView*) self, _tmp3_, NULL, use_align, row_align, (gfloat) 0);
		scrolled = TRUE;
	}
	result = scrolled;
	__vala_GtkTreePath_free0 (path);
	return result;
}

static gboolean
code_widgets_source_list_tree_start_editing_item (CodeWidgetsSourceListTree* self,
                                                  CodeWidgetsSourceListItem* item)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_;
	gboolean _tmp6_;
	GtkTreePath* path = NULL;
	CodeWidgetsSourceListDataModel* _tmp8_;
	GtkTreePath* _tmp9_;
	GtkTreePath* _tmp10_;
	gboolean _tmp17_;
	gboolean _tmp18_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (item != NULL, FALSE);
	_tmp0_ = code_widgets_source_list_item_get_editable (item);
	_tmp1_ = _tmp0_;
	_vala_return_val_if_fail (_tmp1_, "item.editable", FALSE);
	_tmp2_ = code_widgets_source_list_item_get_selectable (item);
	_tmp3_ = _tmp2_;
	_vala_return_val_if_fail (_tmp3_, "item.selectable", FALSE);
	_tmp5_ = code_widgets_source_list_tree_get_editing (self);
	_tmp6_ = _tmp5_;
	if (_tmp6_) {
		CodeWidgetsSourceListItem* _tmp7_;
		_tmp7_ = self->priv->edited;
		_tmp4_ = item == _tmp7_;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		result = FALSE;
		return result;
	}
	_tmp8_ = self->priv->_data_model;
	_tmp9_ = code_widgets_source_list_data_model_get_item_path (_tmp8_, item);
	path = _tmp9_;
	_tmp10_ = path;
	if (_tmp10_ != NULL) {
		GtkCellRendererText* _tmp11_;
		GtkTreePath* _tmp12_;
		GtkTreeViewColumn* _tmp13_;
		GtkCellRendererText* _tmp14_;
		self->priv->edited = item;
		_tmp11_ = self->priv->text_cell;
		g_object_set (_tmp11_, "editable", TRUE, NULL);
		_tmp12_ = path;
		_tmp13_ = gtk_tree_view_get_column ((GtkTreeView*) self, (gint) CODE_WIDGETS_SOURCE_LIST_TREE_COLUMN_ITEM);
		_tmp14_ = self->priv->text_cell;
		gtk_tree_view_set_cursor_on_cell ((GtkTreeView*) self, _tmp12_, _tmp13_, (GtkCellRenderer*) _tmp14_, TRUE);
	} else {
		const gchar* _tmp15_;
		const gchar* _tmp16_;
		_tmp15_ = code_widgets_source_list_item_get_name (item);
		_tmp16_ = _tmp15_;
		g_warning ("SourceList.vala:2121: Could not edit \"%s\": path not found", _tmp16_);
	}
	_tmp17_ = code_widgets_source_list_tree_get_editing (self);
	_tmp18_ = _tmp17_;
	result = _tmp18_;
	__vala_GtkTreePath_free0 (path);
	return result;
}

static void
code_widgets_source_list_tree_stop_editing (CodeWidgetsSourceListTree* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp1_ = code_widgets_source_list_tree_get_editing (self);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		CodeWidgetsSourceListItem* _tmp3_;
		_tmp3_ = self->priv->edited;
		_tmp0_ = _tmp3_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GtkTreePath* path = NULL;
		CodeWidgetsSourceListDataModel* _tmp4_;
		CodeWidgetsSourceListItem* _tmp5_;
		GtkTreePath* _tmp6_;
		GtkTreePath* _tmp7_;
		_tmp4_ = self->priv->_data_model;
		_tmp5_ = self->priv->edited;
		_tmp6_ = code_widgets_source_list_data_model_get_item_path (_tmp4_, _tmp5_);
		path = _tmp6_;
		_tmp7_ = path;
		if (_tmp7_ != NULL) {
			GtkTreePath* _tmp8_;
			GtkTreeViewColumn* _tmp9_;
			GtkCellRendererText* _tmp10_;
			_tmp8_ = path;
			_tmp9_ = gtk_tree_view_get_column ((GtkTreeView*) self, (gint) CODE_WIDGETS_SOURCE_LIST_TREE_COLUMN_ITEM);
			_tmp10_ = self->priv->text_cell;
			gtk_tree_view_set_cursor_on_cell ((GtkTreeView*) self, _tmp8_, _tmp9_, (GtkCellRenderer*) _tmp10_, FALSE);
		}
		__vala_GtkTreePath_free0 (path);
	}
}

static void
_code_widgets_source_list_tree_on_editing_done_gtk_cell_editable_editing_done (GtkCellEditable* _sender,
                                                                               gpointer self)
{
	code_widgets_source_list_tree_on_editing_done ((CodeWidgetsSourceListTree*) self);
}

static void
code_widgets_source_list_tree_on_editing_started (CodeWidgetsSourceListTree* self,
                                                  GtkCellEditable* editable,
                                                  const gchar* path)
{
	GtkEntry* _tmp0_;
	GtkEntry* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (editable != NULL);
	g_return_if_fail (path != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (editable, gtk_entry_get_type ()) ? ((GtkEntry*) editable) : NULL);
	_g_object_unref0 (self->priv->editable_entry);
	self->priv->editable_entry = _tmp0_;
	_tmp1_ = self->priv->editable_entry;
	if (_tmp1_ != NULL) {
		GtkEntry* _tmp2_;
		GtkEntry* _tmp3_;
		_tmp2_ = self->priv->editable_entry;
		g_signal_connect_object ((GtkCellEditable*) _tmp2_, "editing-done", (GCallback) _code_widgets_source_list_tree_on_editing_done_gtk_cell_editable_editing_done, self, 0);
		_tmp3_ = self->priv->editable_entry;
		g_object_set (_tmp3_, "editable", TRUE, NULL);
	}
}

static void
code_widgets_source_list_tree_on_editing_canceled (CodeWidgetsSourceListTree* self)
{
	GtkEntry* _tmp0_;
	GtkCellRendererText* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->editable_entry;
	if (_tmp0_ != NULL) {
		GtkEntry* _tmp1_;
		GtkEntry* _tmp2_;
		guint _tmp3_;
		_tmp1_ = self->priv->editable_entry;
		g_object_set (_tmp1_, "editable", FALSE, NULL);
		_tmp2_ = self->priv->editable_entry;
		g_signal_parse_name ("editing-done", gtk_cell_editable_get_type (), &_tmp3_, NULL, FALSE);
		g_signal_handlers_disconnect_matched ((GtkCellEditable*) _tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _code_widgets_source_list_tree_on_editing_done_gtk_cell_editable_editing_done, self);
	}
	_tmp4_ = self->priv->text_cell;
	g_object_set (_tmp4_, "editable", FALSE, NULL);
	self->priv->edited = NULL;
}

static void
code_widgets_source_list_tree_on_editing_done (CodeWidgetsSourceListTree* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	CodeWidgetsSourceListItem* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp2_ = self->priv->edited;
	if (_tmp2_ != NULL) {
		CodeWidgetsSourceListItem* _tmp3_;
		gboolean _tmp4_;
		gboolean _tmp5_;
		_tmp3_ = self->priv->edited;
		_tmp4_ = code_widgets_source_list_item_get_editable (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp1_ = _tmp5_;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		GtkEntry* _tmp6_;
		_tmp6_ = self->priv->editable_entry;
		_tmp0_ = _tmp6_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		CodeWidgetsSourceListItem* _tmp7_;
		GtkEntry* _tmp8_;
		const gchar* _tmp9_;
		_tmp7_ = self->priv->edited;
		_tmp8_ = self->priv->editable_entry;
		_tmp9_ = gtk_entry_get_text (_tmp8_);
		g_signal_emit (_tmp7_, code_widgets_source_list_item_signals[CODE_WIDGETS_SOURCE_LIST_ITEM_EDITED_SIGNAL], 0, _tmp9_);
	}
	code_widgets_source_list_tree_on_editing_canceled (self);
}

static void
code_widgets_source_list_tree_on_activatable_activated (CodeWidgetsSourceListTree* self,
                                                        const gchar* item_path_str)
{
	CodeWidgetsSourceListItem* item = NULL;
	CodeWidgetsSourceListItem* _tmp0_;
	CodeWidgetsSourceListItem* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item_path_str != NULL);
	_tmp0_ = code_widgets_source_list_tree_get_item_from_path_string (self, item_path_str);
	item = _tmp0_;
	_tmp1_ = item;
	if (_tmp1_ != NULL) {
		CodeWidgetsSourceListItem* _tmp2_;
		_tmp2_ = item;
		g_signal_emit (_tmp2_, code_widgets_source_list_item_signals[CODE_WIDGETS_SOURCE_LIST_ITEM_ACTION_ACTIVATED_SIGNAL], 0);
	}
	_g_object_unref0 (item);
}

static CodeWidgetsSourceListItem*
code_widgets_source_list_tree_get_item_from_path_string (CodeWidgetsSourceListTree* self,
                                                         const gchar* item_path_str)
{
	GtkTreePath* item_path = NULL;
	GtkTreePath* _tmp0_;
	CodeWidgetsSourceListDataModel* _tmp1_;
	CodeWidgetsSourceListItem* _tmp2_;
	CodeWidgetsSourceListItem* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (item_path_str != NULL, NULL);
	_tmp0_ = gtk_tree_path_new_from_string (item_path_str);
	item_path = _tmp0_;
	_tmp1_ = self->priv->_data_model;
	_tmp2_ = code_widgets_source_list_data_model_get_item_from_path (_tmp1_, item_path);
	result = _tmp2_;
	__vala_GtkTreePath_free0 (item_path);
	return result;
}

static gboolean
code_widgets_source_list_tree_toggle_expansion (CodeWidgetsSourceListTree* self,
                                                CodeWidgetsSourceListExpandableItem* item)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (item != NULL, FALSE);
	_tmp0_ = code_widgets_source_list_expandable_item_get_collapsible (item);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		gboolean _tmp2_;
		gboolean _tmp3_;
		_tmp2_ = code_widgets_source_list_expandable_item_get_expanded (item);
		_tmp3_ = _tmp2_;
		code_widgets_source_list_expandable_item_set_expanded (item, !_tmp3_);
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}

/**
         * Updates the tree to reflect the ''expanded'' property of expandable_item.
         */
static void
code_widgets_source_list_tree_update_expansion (CodeWidgetsSourceListTree* self,
                                                CodeWidgetsSourceListExpandableItem* expandable_item)
{
	GtkTreePath* path = NULL;
	CodeWidgetsSourceListDataModel* _tmp0_;
	GtkTreePath* _tmp1_;
	GtkTreePath* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (expandable_item != NULL);
	_tmp0_ = self->priv->_data_model;
	_tmp1_ = code_widgets_source_list_data_model_get_item_path (_tmp0_, (CodeWidgetsSourceListItem*) expandable_item);
	path = _tmp1_;
	_tmp2_ = path;
	if (_tmp2_ != NULL) {
		GtkTreePath* _tmp3_;
		gboolean _tmp4_;
		gboolean _tmp5_;
		_tmp3_ = path;
		code_widgets_source_list_tree_add_spacer_cell_for_level (self, gtk_tree_path_get_depth (_tmp3_) + 1, TRUE);
		_tmp4_ = code_widgets_source_list_expandable_item_get_expanded (expandable_item);
		_tmp5_ = _tmp4_;
		if (_tmp5_) {
			GtkTreePath* _tmp6_;
			gboolean _tmp7_ = FALSE;
			CodeWidgetsSourceListItem* _tmp8_;
			_tmp6_ = path;
			gtk_tree_view_expand_row ((GtkTreeView*) self, _tmp6_, FALSE);
			_tmp8_ = self->priv->selected;
			if (_tmp8_ != NULL) {
				CodeWidgetsSourceListItem* _tmp9_;
				CodeWidgetsSourceListExpandableItem* _tmp10_;
				CodeWidgetsSourceListExpandableItem* _tmp11_;
				_tmp9_ = self->priv->selected;
				_tmp10_ = code_widgets_source_list_item_get_parent (_tmp9_);
				_tmp11_ = _tmp10_;
				_tmp7_ = _tmp11_ == expandable_item;
			} else {
				_tmp7_ = FALSE;
			}
			if (_tmp7_) {
				CodeWidgetsSourceListItem* _tmp12_;
				_tmp12_ = self->priv->selected;
				code_widgets_source_list_tree_set_selected (self, _tmp12_, TRUE);
			}
			{
				GeeIterator* _child_item_it = NULL;
				GeeCollection* _tmp13_;
				GeeCollection* _tmp14_;
				GeeCollection* _tmp15_;
				GeeIterator* _tmp16_;
				GeeIterator* _tmp17_;
				_tmp13_ = code_widgets_source_list_expandable_item_get_children (expandable_item);
				_tmp14_ = _tmp13_;
				_tmp15_ = _tmp14_;
				_tmp16_ = gee_iterable_iterator ((GeeIterable*) _tmp15_);
				_tmp17_ = _tmp16_;
				_g_object_unref0 (_tmp15_);
				_child_item_it = _tmp17_;
				while (TRUE) {
					GeeIterator* _tmp18_;
					CodeWidgetsSourceListItem* child_item = NULL;
					GeeIterator* _tmp19_;
					gpointer _tmp20_;
					CodeWidgetsSourceListExpandableItem* child_expandable_item = NULL;
					CodeWidgetsSourceListItem* _tmp21_;
					CodeWidgetsSourceListExpandableItem* _tmp22_;
					CodeWidgetsSourceListExpandableItem* _tmp23_;
					_tmp18_ = _child_item_it;
					if (!gee_iterator_next (_tmp18_)) {
						break;
					}
					_tmp19_ = _child_item_it;
					_tmp20_ = gee_iterator_get (_tmp19_);
					child_item = (CodeWidgetsSourceListItem*) _tmp20_;
					_tmp21_ = child_item;
					_tmp22_ = _g_object_ref0 (CODE_WIDGETS_SOURCE_LIST_IS_EXPANDABLE_ITEM (_tmp21_) ? ((CodeWidgetsSourceListExpandableItem*) _tmp21_) : NULL);
					child_expandable_item = _tmp22_;
					_tmp23_ = child_expandable_item;
					if (_tmp23_ != NULL) {
						CodeWidgetsSourceListExpandableItem* _tmp24_;
						_tmp24_ = child_expandable_item;
						code_widgets_source_list_tree_update_expansion (self, _tmp24_);
					}
					_g_object_unref0 (child_expandable_item);
					_g_object_unref0 (child_item);
				}
				_g_object_unref0 (_child_item_it);
			}
		} else {
			GtkTreePath* _tmp25_;
			_tmp25_ = path;
			gtk_tree_view_collapse_row ((GtkTreeView*) self, _tmp25_);
		}
	}
	__vala_GtkTreePath_free0 (path);
}

static void
code_widgets_source_list_tree_real_row_expanded (GtkTreeView* base,
                                                 GtkTreeIter* iter,
                                                 GtkTreePath* path)
{
	CodeWidgetsSourceListTree * self;
	CodeWidgetsSourceListExpandableItem* item = NULL;
	CodeWidgetsSourceListDataModel* _tmp0_;
	GtkTreeIter _tmp1_;
	CodeWidgetsSourceListItem* _tmp2_;
	CodeWidgetsSourceListExpandableItem* _tmp3_;
	self = (CodeWidgetsSourceListTree*) base;
	g_return_if_fail (iter != NULL);
	g_return_if_fail (path != NULL);
	_tmp0_ = self->priv->_data_model;
	_tmp1_ = *iter;
	_tmp2_ = code_widgets_source_list_data_model_get_item (_tmp0_, &_tmp1_);
	_tmp3_ = CODE_WIDGETS_SOURCE_LIST_IS_EXPANDABLE_ITEM (_tmp2_) ? ((CodeWidgetsSourceListExpandableItem*) _tmp2_) : NULL;
	if (_tmp3_ == NULL) {
		_g_object_unref0 (_tmp2_);
	}
	item = _tmp3_;
	g_return_if_fail (item != NULL);
	code_widgets_source_list_tree_disable_item_property_monitor (self);
	code_widgets_source_list_expandable_item_set_expanded (item, TRUE);
	code_widgets_source_list_tree_enable_item_property_monitor (self);
	_g_object_unref0 (item);
}

static void
code_widgets_source_list_tree_real_row_collapsed (GtkTreeView* base,
                                                  GtkTreeIter* iter,
                                                  GtkTreePath* path)
{
	CodeWidgetsSourceListTree * self;
	CodeWidgetsSourceListExpandableItem* item = NULL;
	CodeWidgetsSourceListDataModel* _tmp0_;
	GtkTreeIter _tmp1_;
	CodeWidgetsSourceListItem* _tmp2_;
	CodeWidgetsSourceListExpandableItem* _tmp3_;
	self = (CodeWidgetsSourceListTree*) base;
	g_return_if_fail (iter != NULL);
	g_return_if_fail (path != NULL);
	_tmp0_ = self->priv->_data_model;
	_tmp1_ = *iter;
	_tmp2_ = code_widgets_source_list_data_model_get_item (_tmp0_, &_tmp1_);
	_tmp3_ = CODE_WIDGETS_SOURCE_LIST_IS_EXPANDABLE_ITEM (_tmp2_) ? ((CodeWidgetsSourceListExpandableItem*) _tmp2_) : NULL;
	if (_tmp3_ == NULL) {
		_g_object_unref0 (_tmp2_);
	}
	item = _tmp3_;
	g_return_if_fail (item != NULL);
	code_widgets_source_list_tree_disable_item_property_monitor (self);
	code_widgets_source_list_expandable_item_set_expanded (item, FALSE);
	code_widgets_source_list_tree_enable_item_property_monitor (self);
	_g_object_unref0 (item);
}

static void
code_widgets_source_list_tree_real_row_activated (GtkTreeView* base,
                                                  GtkTreePath* path,
                                                  GtkTreeViewColumn* column)
{
	CodeWidgetsSourceListTree * self;
	GtkTreeViewColumn* _tmp0_;
	self = (CodeWidgetsSourceListTree*) base;
	g_return_if_fail (path != NULL);
	g_return_if_fail (column != NULL);
	_tmp0_ = gtk_tree_view_get_column ((GtkTreeView*) self, (gint) CODE_WIDGETS_SOURCE_LIST_TREE_COLUMN_ITEM);
	if (column == _tmp0_) {
		CodeWidgetsSourceListItem* item = NULL;
		CodeWidgetsSourceListDataModel* _tmp1_;
		CodeWidgetsSourceListItem* _tmp2_;
		CodeWidgetsSourceListItem* _tmp3_;
		_tmp1_ = self->priv->_data_model;
		_tmp2_ = code_widgets_source_list_data_model_get_item_from_path (_tmp1_, path);
		item = _tmp2_;
		_tmp3_ = item;
		if (_tmp3_ != NULL) {
			CodeWidgetsSourceListItem* _tmp4_;
			_tmp4_ = item;
			g_signal_emit (_tmp4_, code_widgets_source_list_item_signals[CODE_WIDGETS_SOURCE_LIST_ITEM_ACTIVATED_SIGNAL], 0);
		}
		_g_object_unref0 (item);
	}
}

static void
code_widgets_source_list_tree_on_key_released (CodeWidgetsSourceListTree* self,
                                               guint keyval,
                                               guint keycode,
                                               GdkModifierType state)
{
	CodeWidgetsSourceListItem* _tmp0_;
	CodeWidgetsSourceListItem* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = code_widgets_source_list_tree_get_selected_item (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == NULL) {
		return;
	}
	switch (keyval) {
		case GDK_KEY_F2:
		{
			GdkModifierType modifiers = 0U;
			gboolean _tmp2_ = FALSE;
			modifiers = gtk_accelerator_get_default_mod_mask ();
			if ((state & modifiers) == 0) {
				CodeWidgetsSourceListItem* _tmp3_;
				CodeWidgetsSourceListItem* _tmp4_;
				gboolean _tmp5_;
				gboolean _tmp6_;
				_tmp3_ = code_widgets_source_list_tree_get_selected_item (self);
				_tmp4_ = _tmp3_;
				_tmp5_ = code_widgets_source_list_item_get_editable (_tmp4_);
				_tmp6_ = _tmp5_;
				_tmp2_ = _tmp6_;
			} else {
				_tmp2_ = FALSE;
			}
			if (_tmp2_) {
				CodeWidgetsSourceListItem* _tmp7_;
				CodeWidgetsSourceListItem* _tmp8_;
				_tmp7_ = code_widgets_source_list_tree_get_selected_item (self);
				_tmp8_ = _tmp7_;
				code_widgets_source_list_tree_start_editing_item (self, _tmp8_);
			}
			break;
		}
		default:
		break;
	}
}

static gboolean
code_widgets_source_list_tree_real_button_release_event (GtkWidget* base,
                                                         GdkEventButton* event)
{
	CodeWidgetsSourceListTree * self;
	gboolean _tmp0_ = FALSE;
	gboolean result;
	self = (CodeWidgetsSourceListTree*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	if (self->priv->unselectable_item_clicked) {
		GdkWindow* _tmp1_;
		GdkWindow* _tmp2_;
		_tmp1_ = event->window;
		_tmp2_ = gtk_tree_view_get_bin_window ((GtkTreeView*) self);
		_tmp0_ = _tmp1_ == _tmp2_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GtkTreePath* path = NULL;
		GtkTreeViewColumn* column = NULL;
		gint x = 0;
		gint y = 0;
		gint cell_x = 0;
		gint cell_y = 0;
		GtkTreePath* _tmp3_ = NULL;
		GtkTreeViewColumn* _tmp4_ = NULL;
		gint _tmp5_ = 0;
		gint _tmp6_ = 0;
		gboolean _tmp7_;
		GtkTreeViewColumn* _tmp8_;
		self->priv->unselectable_item_clicked = FALSE;
		x = (gint) event->x;
		y = (gint) event->y;
		_tmp7_ = gtk_tree_view_get_path_at_pos ((GtkTreeView*) self, x, y, &_tmp3_, &_tmp4_, &_tmp5_, &_tmp6_);
		__vala_GtkTreePath_free0 (path);
		path = _tmp3_;
		_g_object_unref0 (column);
		_tmp8_ = _g_object_ref0 (_tmp4_);
		column = _tmp8_;
		cell_x = _tmp5_;
		cell_y = _tmp6_;
		if (_tmp7_) {
			CodeWidgetsSourceListExpandableItem* item = NULL;
			CodeWidgetsSourceListDataModel* _tmp9_;
			GtkTreePath* _tmp10_;
			CodeWidgetsSourceListItem* _tmp11_;
			CodeWidgetsSourceListExpandableItem* _tmp12_;
			CodeWidgetsSourceListExpandableItem* _tmp13_;
			_tmp9_ = self->priv->_data_model;
			_tmp10_ = path;
			_tmp11_ = code_widgets_source_list_data_model_get_item_from_path (_tmp9_, _tmp10_);
			_tmp12_ = CODE_WIDGETS_SOURCE_LIST_IS_EXPANDABLE_ITEM (_tmp11_) ? ((CodeWidgetsSourceListExpandableItem*) _tmp11_) : NULL;
			if (_tmp12_ == NULL) {
				_g_object_unref0 (_tmp11_);
			}
			item = _tmp12_;
			_tmp13_ = item;
			if (_tmp13_ != NULL) {
				gboolean _tmp14_ = FALSE;
				CodeWidgetsSourceListExpandableItem* _tmp15_;
				gboolean _tmp16_;
				gboolean _tmp17_;
				_tmp15_ = item;
				_tmp16_ = code_widgets_source_list_item_get_selectable ((CodeWidgetsSourceListItem*) _tmp15_);
				_tmp17_ = _tmp16_;
				if (!_tmp17_) {
					_tmp14_ = TRUE;
				} else {
					CodeWidgetsSourceListDataModel* _tmp18_;
					CodeWidgetsSourceListExpandableItem* _tmp19_;
					GtkTreePath* _tmp20_;
					_tmp18_ = self->priv->_data_model;
					_tmp19_ = item;
					_tmp20_ = path;
					_tmp14_ = code_widgets_source_list_data_model_is_category (_tmp18_, (CodeWidgetsSourceListItem*) _tmp19_, NULL, _tmp20_);
				}
				if (_tmp14_) {
					CodeWidgetsSourceListExpandableItem* _tmp21_;
					_tmp21_ = item;
					code_widgets_source_list_tree_toggle_expansion (self, _tmp21_);
				}
			}
			_g_object_unref0 (item);
		}
		_g_object_unref0 (column);
		__vala_GtkTreePath_free0 (path);
	}
	result = GTK_WIDGET_CLASS (code_widgets_source_list_tree_parent_class)->button_release_event ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_tree_view_get_type (), GtkTreeView), event);
	return result;
}

static gboolean
code_widgets_source_list_tree_real_button_press_event (GtkWidget* base,
                                                       GdkEventButton* event)
{
	CodeWidgetsSourceListTree * self;
	GdkWindow* _tmp0_;
	GdkWindow* _tmp1_;
	GtkTreePath* path = NULL;
	GtkTreeViewColumn* column = NULL;
	gint x = 0;
	gint y = 0;
	gint cell_x = 0;
	gint cell_y = 0;
	GtkTreePath* _tmp2_ = NULL;
	GtkTreeViewColumn* _tmp3_ = NULL;
	gint _tmp4_ = 0;
	gint _tmp5_ = 0;
	gboolean _tmp6_;
	GtkTreeViewColumn* _tmp7_;
	gboolean result;
	self = (CodeWidgetsSourceListTree*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = event->window;
	_tmp1_ = gtk_tree_view_get_bin_window ((GtkTreeView*) self);
	if (_tmp0_ != _tmp1_) {
		result = GTK_WIDGET_CLASS (code_widgets_source_list_tree_parent_class)->button_press_event ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_tree_view_get_type (), GtkTreeView), event);
		return result;
	}
	x = (gint) event->x;
	y = (gint) event->y;
	_tmp6_ = gtk_tree_view_get_path_at_pos ((GtkTreeView*) self, x, y, &_tmp2_, &_tmp3_, &_tmp4_, &_tmp5_);
	__vala_GtkTreePath_free0 (path);
	path = _tmp2_;
	_g_object_unref0 (column);
	_tmp7_ = _g_object_ref0 (_tmp3_);
	column = _tmp7_;
	cell_x = _tmp4_;
	cell_y = _tmp5_;
	if (_tmp6_) {
		CodeWidgetsSourceListItem* item = NULL;
		CodeWidgetsSourceListDataModel* _tmp8_;
		GtkTreePath* _tmp9_;
		CodeWidgetsSourceListItem* _tmp10_;
		GdkRectangle start_cell_area = {0};
		GtkTreePath* _tmp11_;
		GtkTreeViewColumn* _tmp12_;
		GdkRectangle _tmp13_ = {0};
		GdkRectangle _tmp14_;
		gboolean _tmp15_ = FALSE;
		CodeWidgetsSourceListItem* _tmp16_;
		_tmp8_ = self->priv->_data_model;
		_tmp9_ = path;
		_tmp10_ = code_widgets_source_list_data_model_get_item_from_path (_tmp8_, _tmp9_);
		item = _tmp10_;
		_tmp11_ = path;
		_tmp12_ = gtk_tree_view_get_column ((GtkTreeView*) self, 0);
		gtk_tree_view_get_cell_area ((GtkTreeView*) self, _tmp11_, _tmp12_, &_tmp13_);
		start_cell_area = _tmp13_;
		_tmp14_ = start_cell_area;
		cell_x -= _tmp14_.x;
		_tmp16_ = item;
		if (_tmp16_ != NULL) {
			GtkTreeViewColumn* _tmp17_;
			GtkTreeViewColumn* _tmp18_;
			_tmp17_ = column;
			_tmp18_ = gtk_tree_view_get_column ((GtkTreeView*) self, (gint) CODE_WIDGETS_SOURCE_LIST_TREE_COLUMN_ITEM);
			_tmp15_ = _tmp17_ == _tmp18_;
		} else {
			_tmp15_ = FALSE;
		}
		if (_tmp15_) {
			code_widgets_source_list_tree_stop_editing (self);
			if (event->button == ((guint) GDK_BUTTON_SECONDARY)) {
				CodeWidgetsSourceListItem* _tmp19_;
				_tmp19_ = item;
				code_widgets_source_list_tree_popup_context_menu (self, _tmp19_, event);
				result = TRUE;
				_g_object_unref0 (item);
				_g_object_unref0 (column);
				__vala_GtkTreePath_free0 (path);
				return result;
			} else {
				if (event->button == ((guint) GDK_BUTTON_PRIMARY)) {
					gboolean is_expandable = FALSE;
					CodeWidgetsSourceListItem* _tmp20_;
					gboolean _tmp21_ = FALSE;
					gboolean is_category = FALSE;
					_tmp20_ = item;
					is_expandable = CODE_WIDGETS_SOURCE_LIST_IS_EXPANDABLE_ITEM (_tmp20_);
					if (is_expandable) {
						CodeWidgetsSourceListDataModel* _tmp22_;
						CodeWidgetsSourceListItem* _tmp23_;
						GtkTreePath* _tmp24_;
						_tmp22_ = self->priv->_data_model;
						_tmp23_ = item;
						_tmp24_ = path;
						_tmp21_ = code_widgets_source_list_data_model_is_category (_tmp22_, _tmp23_, NULL, _tmp24_);
					} else {
						_tmp21_ = FALSE;
					}
					is_category = _tmp21_;
					if (event->type == GDK_BUTTON_PRESS) {
						if (is_expandable) {
							gboolean _tmp25_ = FALSE;
							gboolean _tmp33_ = FALSE;
							gboolean _tmp34_ = FALSE;
							if (is_category) {
								_tmp25_ = TRUE;
							} else {
								gboolean _tmp26_ = FALSE;
								CodeWidgetsSourceListItem* _tmp27_;
								gboolean _tmp28_;
								gboolean _tmp29_;
								_tmp27_ = item;
								_tmp28_ = code_widgets_source_list_item_get_selectable (_tmp27_);
								_tmp29_ = _tmp28_;
								if (!_tmp29_) {
									GtkTreeViewColumn* _tmp30_;
									GtkTreePath* _tmp31_;
									CodeWidgetsSourceListCellRendererIcon* _tmp32_;
									_tmp30_ = column;
									_tmp31_ = path;
									_tmp32_ = self->priv->activatable_cell;
									_tmp26_ = !code_widgets_source_list_tree_over_cell (self, _tmp30_, _tmp31_, (GtkCellRenderer*) _tmp32_, cell_x);
								} else {
									_tmp26_ = FALSE;
								}
								_tmp25_ = _tmp26_;
							}
							self->priv->unselectable_item_clicked = _tmp25_;
							if (!self->priv->unselectable_item_clicked) {
								GtkTreeViewColumn* _tmp35_;
								GtkTreePath* _tmp36_;
								_tmp35_ = column;
								_tmp36_ = path;
								_tmp34_ = code_widgets_source_list_tree_over_primary_expander (self, _tmp35_, _tmp36_, cell_x);
							} else {
								_tmp34_ = FALSE;
							}
							if (_tmp34_) {
								CodeWidgetsSourceListItem* _tmp37_;
								_tmp37_ = item;
								_tmp33_ = code_widgets_source_list_tree_toggle_expansion (self, CODE_WIDGETS_SOURCE_LIST_IS_EXPANDABLE_ITEM (_tmp37_) ? ((CodeWidgetsSourceListExpandableItem*) _tmp37_) : NULL);
							} else {
								_tmp33_ = FALSE;
							}
							if (_tmp33_) {
								result = TRUE;
								_g_object_unref0 (item);
								_g_object_unref0 (column);
								__vala_GtkTreePath_free0 (path);
								return result;
							}
						}
					} else {
						gboolean _tmp38_ = FALSE;
						gboolean _tmp39_ = FALSE;
						gboolean _tmp40_ = FALSE;
						gboolean _tmp41_ = FALSE;
						gboolean _tmp42_ = FALSE;
						if (event->type == GDK_2BUTTON_PRESS) {
							_tmp42_ = !is_category;
						} else {
							_tmp42_ = FALSE;
						}
						if (_tmp42_) {
							CodeWidgetsSourceListItem* _tmp43_;
							gboolean _tmp44_;
							gboolean _tmp45_;
							_tmp43_ = item;
							_tmp44_ = code_widgets_source_list_item_get_editable (_tmp43_);
							_tmp45_ = _tmp44_;
							_tmp41_ = _tmp45_;
						} else {
							_tmp41_ = FALSE;
						}
						if (_tmp41_) {
							CodeWidgetsSourceListItem* _tmp46_;
							gboolean _tmp47_;
							gboolean _tmp48_;
							_tmp46_ = item;
							_tmp47_ = code_widgets_source_list_item_get_selectable (_tmp46_);
							_tmp48_ = _tmp47_;
							_tmp40_ = _tmp48_;
						} else {
							_tmp40_ = FALSE;
						}
						if (_tmp40_) {
							GtkTreeViewColumn* _tmp49_;
							GtkTreePath* _tmp50_;
							GtkCellRendererText* _tmp51_;
							_tmp49_ = column;
							_tmp50_ = path;
							_tmp51_ = self->priv->text_cell;
							_tmp39_ = code_widgets_source_list_tree_over_cell (self, _tmp49_, _tmp50_, (GtkCellRenderer*) _tmp51_, cell_x);
						} else {
							_tmp39_ = FALSE;
						}
						if (_tmp39_) {
							CodeWidgetsSourceListItem* _tmp52_;
							_tmp52_ = item;
							_tmp38_ = code_widgets_source_list_tree_start_editing_item (self, _tmp52_);
						} else {
							_tmp38_ = FALSE;
						}
						if (_tmp38_) {
							result = TRUE;
							_g_object_unref0 (item);
							_g_object_unref0 (column);
							__vala_GtkTreePath_free0 (path);
							return result;
						}
					}
				}
			}
		}
		_g_object_unref0 (item);
	}
	result = GTK_WIDGET_CLASS (code_widgets_source_list_tree_parent_class)->button_press_event ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_tree_view_get_type (), GtkTreeView), event);
	_g_object_unref0 (column);
	__vala_GtkTreePath_free0 (path);
	return result;
}

static gboolean
code_widgets_source_list_tree_over_primary_expander (CodeWidgetsSourceListTree* self,
                                                     GtkTreeViewColumn* col,
                                                     GtkTreePath* path,
                                                     gint x)
{
	GtkTreeIter iter = {0};
	GtkTreeModel* _tmp0_;
	GtkTreeModel* _tmp1_;
	GtkTreeIter _tmp2_ = {0};
	gboolean _tmp3_;
	CodeWidgetsCellRendererExpander* _tmp4_;
	GtkTreeModel* _tmp5_;
	GtkTreeModel* _tmp6_;
	GtkTreeIter _tmp7_;
	CodeWidgetsCellRendererExpander* _tmp8_;
	gboolean _tmp9_;
	gboolean _tmp10_;
	GtkTreeModel* _tmp11_;
	GtkTreeModel* _tmp12_;
	GtkTreeIter _tmp13_;
	gint indentation_level = 0;
	CodeWidgetsSourceListCellRendererSpacer* last_spacer_cell = NULL;
	GeeHashMap* _tmp14_;
	gpointer _tmp15_;
	CodeWidgetsSourceListCellRendererSpacer* _tmp16_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (col != NULL, FALSE);
	g_return_val_if_fail (path != NULL, FALSE);
	_tmp0_ = gtk_tree_view_get_model ((GtkTreeView*) self);
	_tmp1_ = _tmp0_;
	_tmp3_ = gtk_tree_model_get_iter (_tmp1_, &_tmp2_, path);
	iter = _tmp2_;
	if (!_tmp3_) {
		result = FALSE;
		return result;
	}
	_tmp4_ = self->priv->primary_expander_cell;
	_tmp5_ = gtk_tree_view_get_model ((GtkTreeView*) self);
	_tmp6_ = _tmp5_;
	_tmp7_ = iter;
	code_widgets_source_list_tree_expander_cell_data_func (self, (GtkCellLayout*) col, (GtkCellRenderer*) _tmp4_, _tmp6_, &_tmp7_);
	_tmp8_ = self->priv->primary_expander_cell;
	_tmp9_ = gtk_cell_renderer_get_visible ((GtkCellRenderer*) _tmp8_);
	_tmp10_ = _tmp9_;
	if (!_tmp10_) {
		result = FALSE;
		return result;
	}
	_tmp11_ = gtk_tree_view_get_model ((GtkTreeView*) self);
	_tmp12_ = _tmp11_;
	_tmp13_ = iter;
	if (gtk_tree_model_iter_n_children (_tmp12_, &_tmp13_) < 1) {
		result = FALSE;
		return result;
	}
	indentation_level = gtk_tree_path_get_depth (path);
	_tmp14_ = self->priv->spacer_cells;
	_tmp15_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp14_, (gpointer) ((gintptr) indentation_level));
	last_spacer_cell = (CodeWidgetsSourceListCellRendererSpacer*) _tmp15_;
	_tmp16_ = last_spacer_cell;
	if (_tmp16_ != NULL) {
		gint cell_x = 0;
		gint cell_width = 0;
		CodeWidgetsSourceListCellRendererSpacer* _tmp17_;
		gint _tmp18_ = 0;
		gint _tmp19_ = 0;
		gboolean _tmp20_;
		_tmp17_ = last_spacer_cell;
		_tmp20_ = gtk_tree_view_column_cell_get_position (col, (GtkCellRenderer*) _tmp17_, &_tmp18_, &_tmp19_);
		cell_x = _tmp18_;
		cell_width = _tmp19_;
		if (_tmp20_) {
			gint expander_width = 0;
			CodeWidgetsCellRendererExpander* _tmp21_;
			GtkTextDirection dir = 0;
			gboolean _tmp23_ = FALSE;
			_tmp21_ = self->priv->primary_expander_cell;
			expander_width = code_widgets_source_list_tree_get_cell_width (self, (GtkCellRenderer*) _tmp21_) + 1;
			dir = gtk_widget_get_direction ((GtkWidget*) self);
			if (dir == GTK_TEXT_DIR_NONE) {
				dir = gtk_widget_get_default_direction ();
			}
			if (dir == GTK_TEXT_DIR_LTR) {
				gint indentation_offset = 0;
				gboolean _tmp22_ = FALSE;
				indentation_offset = cell_x + cell_width;
				if (x >= indentation_offset) {
					_tmp22_ = x <= (indentation_offset + expander_width);
				} else {
					_tmp22_ = FALSE;
				}
				result = _tmp22_;
				_g_object_unref0 (last_spacer_cell);
				return result;
			}
			if (x <= cell_x) {
				_tmp23_ = x >= (cell_x - expander_width);
			} else {
				_tmp23_ = FALSE;
			}
			result = _tmp23_;
			_g_object_unref0 (last_spacer_cell);
			return result;
		}
	}
	result = FALSE;
	_g_object_unref0 (last_spacer_cell);
	return result;
}

static gboolean
code_widgets_source_list_tree_over_cell (CodeWidgetsSourceListTree* self,
                                         GtkTreeViewColumn* col,
                                         GtkTreePath* path,
                                         GtkCellRenderer* cell,
                                         gint x)
{
	gint cell_x = 0;
	gint cell_width = 0;
	gboolean found = FALSE;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	gboolean _tmp2_;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (col != NULL, FALSE);
	g_return_val_if_fail (path != NULL, FALSE);
	g_return_val_if_fail (cell != NULL, FALSE);
	_tmp2_ = gtk_tree_view_column_cell_get_position (col, cell, &_tmp0_, &_tmp1_);
	cell_x = _tmp0_;
	cell_width = _tmp1_;
	found = _tmp2_;
	if (found) {
		_tmp4_ = x > cell_x;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		_tmp3_ = x < (cell_x + cell_width);
	} else {
		_tmp3_ = FALSE;
	}
	result = _tmp3_;
	return result;
}

static gint
code_widgets_source_list_tree_get_cell_width (CodeWidgetsSourceListTree* self,
                                              GtkCellRenderer* cell_renderer)
{
	GtkRequisition min_req = {0};
	GtkRequisition _tmp0_ = {0};
	GtkRequisition _tmp1_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (cell_renderer != NULL, -1);
	gtk_cell_renderer_get_preferred_size (cell_renderer, (GtkWidget*) self, &_tmp0_, NULL);
	min_req = _tmp0_;
	_tmp1_ = min_req;
	result = _tmp1_.width;
	return result;
}

static gboolean
code_widgets_source_list_tree_real_popup_menu (GtkWidget* base)
{
	CodeWidgetsSourceListTree * self;
	gboolean result;
	self = (CodeWidgetsSourceListTree*) base;
	result = code_widgets_source_list_tree_popup_context_menu (self, NULL, NULL);
	return result;
}

static gboolean
code_widgets_source_list_tree_popup_context_menu (CodeWidgetsSourceListTree* self,
                                                  CodeWidgetsSourceListItem* item,
                                                  GdkEventButton* event)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (item == NULL) {
		CodeWidgetsSourceListItem* _tmp0_;
		CodeWidgetsSourceListItem* _tmp1_;
		_tmp0_ = code_widgets_source_list_tree_get_selected_item (self);
		_tmp1_ = _tmp0_;
		item = _tmp1_;
	}
	if (item != NULL) {
		GMenu* menu = NULL;
		GMenu* _tmp2_;
		GMenu* _tmp3_;
		_tmp2_ = code_widgets_source_list_item_get_context_menu (item);
		menu = _tmp2_;
		_tmp3_ = menu;
		if (_tmp3_ != NULL) {
			GtkMenu* gtk_menu = NULL;
			GMenu* _tmp4_;
			GtkWidget* _tmp5_;
			GtkMenu* _tmp6_ = NULL;
			GtkMenu* _tmp7_;
			_tmp4_ = menu;
			_tmp5_ = _g_object_ref0 ((GtkWidget*) self);
			_tmp6_ = (GtkMenu*) gtk_menu_new_from_model ((GMenuModel*) _tmp4_);
			g_object_set (_tmp6_, "attach-widget", _tmp5_, NULL);
			_g_object_unref0 (_tmp5_);
			g_object_ref_sink (_tmp6_);
			gtk_menu = _tmp6_;
			_tmp7_ = gtk_menu;
			gtk_menu_popup_at_pointer (_tmp7_, (GdkEvent*) event);
			if (event == NULL) {
				GtkMenu* _tmp8_;
				_tmp8_ = gtk_menu;
				gtk_menu_shell_select_first ((GtkMenuShell*) _tmp8_, FALSE);
			}
			result = TRUE;
			_g_object_unref0 (gtk_menu);
			_g_object_unref0 (menu);
			return result;
		}
		_g_object_unref0 (menu);
	}
	result = FALSE;
	return result;
}

static CodeWidgetsSourceListItem*
code_widgets_source_list_tree_get_item_from_model (GtkTreeModel* model,
                                                   GtkTreeIter* iter)
{
	CodeWidgetsSourceListDataModel* data_model = NULL;
	CodeWidgetsSourceListDataModel* _tmp0_;
	GtkTreeIter _tmp1_;
	CodeWidgetsSourceListItem* _tmp2_;
	CodeWidgetsSourceListItem* result;
	g_return_val_if_fail (model != NULL, NULL);
	g_return_val_if_fail (iter != NULL, NULL);
	_tmp0_ = _g_object_ref0 (CODE_WIDGETS_SOURCE_LIST_IS_DATA_MODEL (model) ? ((CodeWidgetsSourceListDataModel*) model) : NULL);
	data_model = _tmp0_;
	_vala_assert (data_model != NULL, "data_model != null");
	_tmp1_ = *iter;
	_tmp2_ = code_widgets_source_list_data_model_get_item (data_model, &_tmp1_);
	result = _tmp2_;
	_g_object_unref0 (data_model);
	return result;
}

static void
code_widgets_source_list_tree_spacer_cell_data_func (GtkCellLayout* layout,
                                                     GtkCellRenderer* renderer,
                                                     GtkTreeModel* model,
                                                     GtkTreeIter* iter)
{
	CodeWidgetsSourceListCellRendererSpacer* spacer = NULL;
	CodeWidgetsSourceListCellRendererSpacer* _tmp0_;
	CodeWidgetsSourceListCellRendererSpacer* _tmp1_;
	CodeWidgetsSourceListCellRendererSpacer* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	GtkTreePath* path = NULL;
	GtkTreeIter _tmp5_;
	GtkTreePath* _tmp6_;
	gint level = 0;
	GtkTreePath* _tmp7_;
	CodeWidgetsSourceListCellRendererSpacer* _tmp9_;
	gint _tmp10_;
	gint _tmp11_;
	g_return_if_fail (layout != NULL);
	g_return_if_fail (renderer != NULL);
	g_return_if_fail (model != NULL);
	g_return_if_fail (iter != NULL);
	_tmp0_ = _g_object_ref0 (CODE_WIDGETS_SOURCE_LIST_IS_CELL_RENDERER_SPACER (renderer) ? ((CodeWidgetsSourceListCellRendererSpacer*) renderer) : NULL);
	spacer = _tmp0_;
	_tmp1_ = spacer;
	_vala_assert (_tmp1_ != NULL, "spacer != null");
	_tmp2_ = spacer;
	_tmp3_ = code_widgets_source_list_cell_renderer_spacer_get_level (_tmp2_);
	_tmp4_ = _tmp3_;
	_vala_assert (_tmp4_ > 0, "spacer.level > 0");
	_tmp5_ = *iter;
	_tmp6_ = gtk_tree_model_get_path (model, &_tmp5_);
	path = _tmp6_;
	level = -1;
	_tmp7_ = path;
	if (_tmp7_ != NULL) {
		GtkTreePath* _tmp8_;
		_tmp8_ = path;
		level = gtk_tree_path_get_depth (_tmp8_);
	}
	_tmp9_ = spacer;
	_tmp10_ = code_widgets_source_list_cell_renderer_spacer_get_level (_tmp9_);
	_tmp11_ = _tmp10_;
	gtk_cell_renderer_set_visible (renderer, _tmp11_ <= level);
	__vala_GtkTreePath_free0 (path);
	_g_object_unref0 (spacer);
}

static void
code_widgets_source_list_tree_name_cell_data_func (CodeWidgetsSourceListTree* self,
                                                   GtkCellLayout* layout,
                                                   GtkCellRenderer* renderer,
                                                   GtkTreeModel* model,
                                                   GtkTreeIter* iter)
{
	GtkCellRendererText* text_renderer = NULL;
	GtkCellRendererText* _tmp0_;
	GtkCellRendererText* _tmp1_;
	GString* text = NULL;
	GString* _tmp2_;
	PangoWeight weight = 0;
	gboolean use_markup = FALSE;
	CodeWidgetsSourceListItem* item = NULL;
	GtkTreeIter _tmp3_;
	CodeWidgetsSourceListItem* _tmp4_;
	CodeWidgetsSourceListItem* _tmp5_;
	GtkCellRendererText* _tmp20_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (layout != NULL);
	g_return_if_fail (renderer != NULL);
	g_return_if_fail (model != NULL);
	g_return_if_fail (iter != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (renderer, gtk_cell_renderer_text_get_type ()) ? ((GtkCellRendererText*) renderer) : NULL);
	text_renderer = _tmp0_;
	_tmp1_ = text_renderer;
	_vala_assert (_tmp1_ != NULL, "text_renderer != null");
	_tmp2_ = g_string_new ("");
	text = _tmp2_;
	weight = PANGO_WEIGHT_NORMAL;
	use_markup = FALSE;
	_tmp3_ = *iter;
	_tmp4_ = code_widgets_source_list_tree_get_item_from_model (model, &_tmp3_);
	item = _tmp4_;
	_tmp5_ = item;
	if (_tmp5_ != NULL) {
		CodeWidgetsSourceListItem* _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		CodeWidgetsSourceListDataModel* _tmp17_;
		CodeWidgetsSourceListItem* _tmp18_;
		GtkTreeIter _tmp19_;
		_tmp6_ = item;
		_tmp7_ = code_widgets_source_list_item_get_markup (_tmp6_);
		_tmp8_ = _tmp7_;
		if (_tmp8_ != NULL) {
			GString* _tmp9_;
			CodeWidgetsSourceListItem* _tmp10_;
			const gchar* _tmp11_;
			const gchar* _tmp12_;
			_tmp9_ = text;
			_tmp10_ = item;
			_tmp11_ = code_widgets_source_list_item_get_markup (_tmp10_);
			_tmp12_ = _tmp11_;
			g_string_append (_tmp9_, _tmp12_);
			use_markup = TRUE;
		} else {
			GString* _tmp13_;
			CodeWidgetsSourceListItem* _tmp14_;
			const gchar* _tmp15_;
			const gchar* _tmp16_;
			_tmp13_ = text;
			_tmp14_ = item;
			_tmp15_ = code_widgets_source_list_item_get_name (_tmp14_);
			_tmp16_ = _tmp15_;
			g_string_append (_tmp13_, _tmp16_);
		}
		_tmp17_ = self->priv->_data_model;
		_tmp18_ = item;
		_tmp19_ = *iter;
		if (code_widgets_source_list_data_model_is_category (_tmp17_, _tmp18_, &_tmp19_, NULL)) {
			weight = PANGO_WEIGHT_BOLD;
		}
	}
	_tmp20_ = text_renderer;
	g_object_set (_tmp20_, "weight", (gint) weight, NULL);
	if (use_markup) {
		GtkCellRendererText* _tmp21_;
		GString* _tmp22_;
		const gchar* _tmp23_;
		_tmp21_ = text_renderer;
		_tmp22_ = text;
		_tmp23_ = _tmp22_->str;
		g_object_set (_tmp21_, "markup", _tmp23_, NULL);
	} else {
		GtkCellRendererText* _tmp24_;
		GString* _tmp25_;
		const gchar* _tmp26_;
		_tmp24_ = text_renderer;
		_tmp25_ = text;
		_tmp26_ = _tmp25_->str;
		g_object_set (_tmp24_, "text", _tmp26_, NULL);
	}
	_g_object_unref0 (item);
	_g_string_free0 (text);
	_g_object_unref0 (text_renderer);
}

static void
code_widgets_source_list_tree_badge_cell_data_func (CodeWidgetsSourceListTree* self,
                                                    GtkCellLayout* layout,
                                                    GtkCellRenderer* renderer,
                                                    GtkTreeModel* model,
                                                    GtkTreeIter* iter)
{
	CodeWidgetsCellRendererBadge* badge_renderer = NULL;
	CodeWidgetsCellRendererBadge* _tmp0_;
	CodeWidgetsCellRendererBadge* _tmp1_;
	gchar* text = NULL;
	gchar* _tmp2_;
	gboolean visible = FALSE;
	CodeWidgetsSourceListItem* item = NULL;
	GtkTreeIter _tmp3_;
	CodeWidgetsSourceListItem* _tmp4_;
	CodeWidgetsSourceListItem* _tmp5_;
	CodeWidgetsCellRendererBadge* _tmp23_;
	CodeWidgetsCellRendererBadge* _tmp24_;
	const gchar* _tmp25_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (layout != NULL);
	g_return_if_fail (renderer != NULL);
	g_return_if_fail (model != NULL);
	g_return_if_fail (iter != NULL);
	_tmp0_ = _g_object_ref0 (CODE_WIDGETS_IS_CELL_RENDERER_BADGE (renderer) ? ((CodeWidgetsCellRendererBadge*) renderer) : NULL);
	badge_renderer = _tmp0_;
	_tmp1_ = badge_renderer;
	_vala_assert (_tmp1_ != NULL, "badge_renderer != null");
	_tmp2_ = g_strdup ("");
	text = _tmp2_;
	visible = FALSE;
	_tmp3_ = *iter;
	_tmp4_ = code_widgets_source_list_tree_get_item_from_model (model, &_tmp3_);
	item = _tmp4_;
	_tmp5_ = item;
	if (_tmp5_ != NULL) {
		gboolean _tmp6_ = FALSE;
		gboolean _tmp7_ = FALSE;
		CodeWidgetsSourceListDataModel* _tmp8_;
		CodeWidgetsSourceListItem* _tmp9_;
		GtkTreeIter _tmp10_;
		_tmp8_ = self->priv->_data_model;
		_tmp9_ = item;
		_tmp10_ = *iter;
		if (!code_widgets_source_list_data_model_is_category (_tmp8_, _tmp9_, &_tmp10_, NULL)) {
			CodeWidgetsSourceListItem* _tmp11_;
			const gchar* _tmp12_;
			const gchar* _tmp13_;
			_tmp11_ = item;
			_tmp12_ = code_widgets_source_list_item_get_badge (_tmp11_);
			_tmp13_ = _tmp12_;
			_tmp7_ = _tmp13_ != NULL;
		} else {
			_tmp7_ = FALSE;
		}
		if (_tmp7_) {
			CodeWidgetsSourceListItem* _tmp14_;
			const gchar* _tmp15_;
			const gchar* _tmp16_;
			gchar* _tmp17_;
			gchar* _tmp18_;
			_tmp14_ = item;
			_tmp15_ = code_widgets_source_list_item_get_badge (_tmp14_);
			_tmp16_ = _tmp15_;
			_tmp17_ = string_strip (_tmp16_);
			_tmp18_ = _tmp17_;
			_tmp6_ = g_strcmp0 (_tmp18_, "") != 0;
			_g_free0 (_tmp18_);
		} else {
			_tmp6_ = FALSE;
		}
		visible = _tmp6_;
		if (visible) {
			CodeWidgetsSourceListItem* _tmp19_;
			const gchar* _tmp20_;
			const gchar* _tmp21_;
			gchar* _tmp22_;
			_tmp19_ = item;
			_tmp20_ = code_widgets_source_list_item_get_badge (_tmp19_);
			_tmp21_ = _tmp20_;
			_tmp22_ = g_strdup (_tmp21_);
			_g_free0 (text);
			text = _tmp22_;
		}
	}
	_tmp23_ = badge_renderer;
	gtk_cell_renderer_set_visible ((GtkCellRenderer*) _tmp23_, visible);
	_tmp24_ = badge_renderer;
	_tmp25_ = text;
	code_widgets_cell_renderer_badge_set_text (_tmp24_, _tmp25_);
	_g_object_unref0 (item);
	_g_free0 (text);
	_g_object_unref0 (badge_renderer);
}

static void
code_widgets_source_list_tree_icon_cell_data_func (CodeWidgetsSourceListTree* self,
                                                   GtkCellLayout* layout,
                                                   GtkCellRenderer* renderer,
                                                   GtkTreeModel* model,
                                                   GtkTreeIter* iter)
{
	CodeWidgetsSourceListCellRendererIcon* icon_renderer = NULL;
	CodeWidgetsSourceListCellRendererIcon* _tmp0_;
	CodeWidgetsSourceListCellRendererIcon* _tmp1_;
	gboolean visible = FALSE;
	GIcon* icon = NULL;
	CodeWidgetsSourceListItem* item = NULL;
	GtkTreeIter _tmp2_;
	CodeWidgetsSourceListItem* _tmp3_;
	CodeWidgetsSourceListItem* _tmp4_;
	gboolean _tmp20_ = FALSE;
	CodeWidgetsSourceListCellRendererIcon* _tmp22_;
	GIcon* _tmp23_ = NULL;
	CodeWidgetsSourceListCellRendererIcon* _tmp25_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (layout != NULL);
	g_return_if_fail (renderer != NULL);
	g_return_if_fail (model != NULL);
	g_return_if_fail (iter != NULL);
	_tmp0_ = _g_object_ref0 (CODE_WIDGETS_SOURCE_LIST_IS_CELL_RENDERER_ICON (renderer) ? ((CodeWidgetsSourceListCellRendererIcon*) renderer) : NULL);
	icon_renderer = _tmp0_;
	_tmp1_ = icon_renderer;
	_vala_assert (_tmp1_ != NULL, "icon_renderer != null");
	visible = FALSE;
	icon = NULL;
	_tmp2_ = *iter;
	_tmp3_ = code_widgets_source_list_tree_get_item_from_model (model, &_tmp2_);
	item = _tmp3_;
	_tmp4_ = item;
	if (_tmp4_ != NULL) {
		CodeWidgetsSourceListDataModel* _tmp5_;
		CodeWidgetsSourceListItem* _tmp6_;
		GtkTreeIter _tmp7_;
		_tmp5_ = self->priv->_data_model;
		_tmp6_ = item;
		_tmp7_ = *iter;
		visible = !code_widgets_source_list_data_model_is_category (_tmp5_, _tmp6_, &_tmp7_, NULL);
		if (visible) {
			CodeWidgetsSourceListCellRendererIcon* _tmp8_;
			CodeWidgetsSourceListCellRendererIcon* _tmp9_;
			_tmp8_ = icon_renderer;
			_tmp9_ = self->priv->icon_cell;
			if (_tmp8_ == _tmp9_) {
				CodeWidgetsSourceListItem* _tmp10_;
				GIcon* _tmp11_;
				GIcon* _tmp12_;
				GIcon* _tmp13_;
				_tmp10_ = item;
				_tmp11_ = code_widgets_source_list_item_get_icon (_tmp10_);
				_tmp12_ = _tmp11_;
				_tmp13_ = _g_object_ref0 (_tmp12_);
				_g_object_unref0 (icon);
				icon = _tmp13_;
			} else {
				CodeWidgetsSourceListCellRendererIcon* _tmp14_;
				CodeWidgetsSourceListCellRendererIcon* _tmp15_;
				_tmp14_ = icon_renderer;
				_tmp15_ = self->priv->activatable_cell;
				if (_tmp14_ == _tmp15_) {
					CodeWidgetsSourceListItem* _tmp16_;
					GIcon* _tmp17_;
					GIcon* _tmp18_;
					GIcon* _tmp19_;
					_tmp16_ = item;
					_tmp17_ = code_widgets_source_list_item_get_activatable (_tmp16_);
					_tmp18_ = _tmp17_;
					_tmp19_ = _g_object_ref0 (_tmp18_);
					_g_object_unref0 (icon);
					icon = _tmp19_;
				} else {
					g_assert_not_reached ();
				}
			}
		}
	}
	if (visible) {
		GIcon* _tmp21_;
		_tmp21_ = icon;
		_tmp20_ = _tmp21_ != NULL;
	} else {
		_tmp20_ = FALSE;
	}
	visible = _tmp20_;
	_tmp22_ = icon_renderer;
	gtk_cell_renderer_set_visible ((GtkCellRenderer*) _tmp22_, visible);
	if (visible) {
		GIcon* _tmp24_;
		_tmp24_ = icon;
		_tmp23_ = _tmp24_;
	} else {
		_tmp23_ = NULL;
	}
	_tmp25_ = icon_renderer;
	g_object_set ((GtkCellRendererPixbuf*) _tmp25_, "gicon", _tmp23_, NULL);
	_g_object_unref0 (item);
	_g_object_unref0 (icon);
	_g_object_unref0 (icon_renderer);
}

/**
         * Controls expander visibility.
         */
static void
code_widgets_source_list_tree_expander_cell_data_func (CodeWidgetsSourceListTree* self,
                                                       GtkCellLayout* layout,
                                                       GtkCellRenderer* renderer,
                                                       GtkTreeModel* model,
                                                       GtkTreeIter* iter)
{
	CodeWidgetsSourceListItem* item = NULL;
	GtkTreeIter _tmp0_;
	CodeWidgetsSourceListItem* _tmp1_;
	CodeWidgetsSourceListItem* _tmp2_;
	CodeWidgetsCellRendererExpander* _tmp12_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (layout != NULL);
	g_return_if_fail (renderer != NULL);
	g_return_if_fail (model != NULL);
	g_return_if_fail (iter != NULL);
	_tmp0_ = *iter;
	_tmp1_ = code_widgets_source_list_tree_get_item_from_model (model, &_tmp0_);
	item = _tmp1_;
	_tmp2_ = item;
	if (_tmp2_ != NULL) {
		CodeWidgetsSourceListExpandableItem* expandable_item = NULL;
		CodeWidgetsSourceListItem* _tmp3_;
		CodeWidgetsSourceListExpandableItem* _tmp4_;
		CodeWidgetsSourceListExpandableItem* _tmp5_;
		_tmp3_ = item;
		_tmp4_ = _g_object_ref0 (CODE_WIDGETS_SOURCE_LIST_IS_EXPANDABLE_ITEM (_tmp3_) ? ((CodeWidgetsSourceListExpandableItem*) _tmp3_) : NULL);
		expandable_item = _tmp4_;
		_tmp5_ = expandable_item;
		if (_tmp5_ != NULL) {
			gboolean _tmp6_ = FALSE;
			gboolean _tmp7_;
			gboolean _tmp8_;
			g_object_get (renderer, "is-expander", &_tmp7_, NULL);
			_tmp8_ = _tmp7_;
			if (_tmp8_) {
				CodeWidgetsSourceListExpandableItem* _tmp9_;
				gboolean _tmp10_;
				gboolean _tmp11_;
				_tmp9_ = expandable_item;
				_tmp10_ = code_widgets_source_list_expandable_item_get_collapsible (_tmp9_);
				_tmp11_ = _tmp10_;
				_tmp6_ = _tmp11_;
			} else {
				_tmp6_ = FALSE;
			}
			g_object_set (renderer, "is-expander", _tmp6_, NULL);
		}
		_g_object_unref0 (expandable_item);
	}
	_tmp12_ = self->priv->primary_expander_cell;
	if (renderer == G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_cell_renderer_get_type (), GtkCellRenderer)) {
		CodeWidgetsSourceListDataModel* _tmp13_;
		GtkTreeIter _tmp14_;
		_tmp13_ = self->priv->_data_model;
		_tmp14_ = *iter;
		gtk_cell_renderer_set_visible (renderer, !code_widgets_source_list_data_model_is_iter_at_root_level (_tmp13_, &_tmp14_));
	} else {
		CodeWidgetsCellRendererExpander* _tmp15_;
		_tmp15_ = self->priv->secondary_expander_cell;
		if (renderer == G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_cell_renderer_get_type (), GtkCellRenderer)) {
			CodeWidgetsSourceListDataModel* _tmp16_;
			CodeWidgetsSourceListItem* _tmp17_;
			GtkTreeIter _tmp18_;
			_tmp16_ = self->priv->_data_model;
			_tmp17_ = item;
			_tmp18_ = *iter;
			gtk_cell_renderer_set_visible (renderer, code_widgets_source_list_data_model_is_category (_tmp16_, _tmp17_, &_tmp18_, NULL));
		} else {
			g_assert_not_reached ();
		}
	}
	_g_object_unref0 (item);
}

static CodeWidgetsSourceListDataModel*
code_widgets_source_list_tree_get_data_model (CodeWidgetsSourceListTree* self)
{
	CodeWidgetsSourceListDataModel* result;
	CodeWidgetsSourceListDataModel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_data_model;
	result = _tmp0_;
	return result;
}

static void
code_widgets_source_list_tree_set_data_model (CodeWidgetsSourceListTree* self,
                                              CodeWidgetsSourceListDataModel* value)
{
	CodeWidgetsSourceListDataModel* old_value;
	g_return_if_fail (self != NULL);
	old_value = code_widgets_source_list_tree_get_data_model (self);
	if (old_value != value) {
		CodeWidgetsSourceListDataModel* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_data_model);
		self->priv->_data_model = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, code_widgets_source_list_tree_properties[CODE_WIDGETS_SOURCE_LIST_TREE_DATA_MODEL_PROPERTY]);
	}
}

static CodeWidgetsSourceListItem*
code_widgets_source_list_tree_get_selected_item (CodeWidgetsSourceListTree* self)
{
	CodeWidgetsSourceListItem* result;
	CodeWidgetsSourceListItem* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->selected;
	result = _tmp0_;
	return result;
}

static void
code_widgets_source_list_tree_set_selected_item (CodeWidgetsSourceListTree* self,
                                                 CodeWidgetsSourceListItem* value)
{
	g_return_if_fail (self != NULL);
	code_widgets_source_list_tree_set_selected (self, value, TRUE);
	g_object_notify_by_pspec ((GObject *) self, code_widgets_source_list_tree_properties[CODE_WIDGETS_SOURCE_LIST_TREE_SELECTED_ITEM_PROPERTY]);
}

static gboolean
code_widgets_source_list_tree_get_editing (CodeWidgetsSourceListTree* self)
{
	gboolean result;
	GtkCellRendererText* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->text_cell;
	g_object_get ((GtkCellRenderer*) _tmp0_, "editing", &_tmp1_, NULL);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

static PangoEllipsizeMode
code_widgets_source_list_tree_get_ellipsize_mode (CodeWidgetsSourceListTree* self)
{
	PangoEllipsizeMode result;
	GtkCellRendererText* _tmp0_;
	PangoEllipsizeMode _tmp1_;
	PangoEllipsizeMode _tmp2_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->text_cell;
	g_object_get (_tmp0_, "ellipsize", &_tmp1_, NULL);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

static void
code_widgets_source_list_tree_set_ellipsize_mode (CodeWidgetsSourceListTree* self,
                                                  PangoEllipsizeMode value)
{
	GtkCellRendererText* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->text_cell;
	g_object_set (_tmp0_, "ellipsize", value, NULL);
	g_object_notify_by_pspec ((GObject *) self, code_widgets_source_list_tree_properties[CODE_WIDGETS_SOURCE_LIST_TREE_ELLIPSIZE_MODE_PROPERTY]);
}

static void
_code_widgets_source_list_tree_expander_cell_data_func_gtk_cell_layout_data_func (GtkCellLayout* cell_layout,
                                                                                  GtkCellRenderer* cell,
                                                                                  GtkTreeModel* tree_model,
                                                                                  GtkTreeIter* iter,
                                                                                  gpointer self)
{
	code_widgets_source_list_tree_expander_cell_data_func ((CodeWidgetsSourceListTree*) self, cell_layout, cell, tree_model, iter);
}

static void
_code_widgets_source_list_tree_on_activatable_activated_code_widgets_source_list_cell_renderer_icon_activated (CodeWidgetsSourceListCellRendererIcon* _sender,
                                                                                                               const gchar* path,
                                                                                                               gpointer self)
{
	code_widgets_source_list_tree_on_activatable_activated ((CodeWidgetsSourceListTree*) self, path);
}

static void
_code_widgets_source_list_tree_icon_cell_data_func_gtk_cell_layout_data_func (GtkCellLayout* cell_layout,
                                                                              GtkCellRenderer* cell,
                                                                              GtkTreeModel* tree_model,
                                                                              GtkTreeIter* iter,
                                                                              gpointer self)
{
	code_widgets_source_list_tree_icon_cell_data_func ((CodeWidgetsSourceListTree*) self, cell_layout, cell, tree_model, iter);
}

static void
_code_widgets_source_list_tree_badge_cell_data_func_gtk_cell_layout_data_func (GtkCellLayout* cell_layout,
                                                                               GtkCellRenderer* cell,
                                                                               GtkTreeModel* tree_model,
                                                                               GtkTreeIter* iter,
                                                                               gpointer self)
{
	code_widgets_source_list_tree_badge_cell_data_func ((CodeWidgetsSourceListTree*) self, cell_layout, cell, tree_model, iter);
}

static void
_code_widgets_source_list_tree_on_editing_started_gtk_cell_renderer_editing_started (GtkCellRenderer* _sender,
                                                                                     GtkCellEditable* editable,
                                                                                     const gchar* path,
                                                                                     gpointer self)
{
	code_widgets_source_list_tree_on_editing_started ((CodeWidgetsSourceListTree*) self, editable, path);
}

static void
_code_widgets_source_list_tree_on_editing_canceled_gtk_cell_renderer_editing_canceled (GtkCellRenderer* _sender,
                                                                                       gpointer self)
{
	code_widgets_source_list_tree_on_editing_canceled ((CodeWidgetsSourceListTree*) self);
}

static void
_code_widgets_source_list_tree_name_cell_data_func_gtk_cell_layout_data_func (GtkCellLayout* cell_layout,
                                                                              GtkCellRenderer* cell,
                                                                              GtkTreeModel* tree_model,
                                                                              GtkTreeIter* iter,
                                                                              gpointer self)
{
	code_widgets_source_list_tree_name_cell_data_func ((CodeWidgetsSourceListTree*) self, cell_layout, cell, tree_model, iter);
}

static gboolean
_code_widgets_source_list_tree_select_func_gtk_tree_selection_func (GtkTreeSelection* selection,
                                                                    GtkTreeModel* model,
                                                                    GtkTreePath* path,
                                                                    gboolean path_currently_selected,
                                                                    gpointer self)
{
	gboolean result;
	result = code_widgets_source_list_tree_select_func ((CodeWidgetsSourceListTree*) self, selection, model, path, path_currently_selected);
	return result;
}

static gboolean
_code_widgets_source_list_tree_on_query_tooltip_gtk_widget_query_tooltip (GtkWidget* _sender,
                                                                          gint x,
                                                                          gint y,
                                                                          gboolean keyboard_tooltip,
                                                                          GtkTooltip* tooltip,
                                                                          gpointer self)
{
	gboolean result;
	result = code_widgets_source_list_tree_on_query_tooltip ((CodeWidgetsSourceListTree*) self, x, y, keyboard_tooltip, tooltip);
	return result;
}

static void
_code_widgets_source_list_tree_on_key_released_gtk_event_controller_key_key_released (GtkEventControllerKey* _sender,
                                                                                      guint keyval,
                                                                                      guint keycode,
                                                                                      GdkModifierType state,
                                                                                      gpointer self)
{
	code_widgets_source_list_tree_on_key_released ((CodeWidgetsSourceListTree*) self, keyval, keycode, state);
}

static GObject *
code_widgets_source_list_tree_constructor (GType type,
                                           guint n_construct_properties,
                                           GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	CodeWidgetsSourceListTree * self;
	GtkStyleContext* style_context = NULL;
	GtkStyleContext* _tmp0_;
	GtkStyleContext* _tmp1_;
	GtkStyleContext* _tmp2_;
	GtkCssProvider* css_provider = NULL;
	GtkCssProvider* _tmp3_;
	CodeWidgetsSourceListDataModel* _tmp9_;
	GtkTreeViewColumn* item_column = NULL;
	GtkTreeViewColumn* _tmp10_;
	GtkTreeViewColumn* _tmp11_;
	GtkTreeViewColumn* _tmp12_;
	CodeWidgetsCellRendererExpander* _tmp13_;
	CodeWidgetsCellRendererExpander* _tmp14_;
	CodeWidgetsCellRendererExpander* _tmp15_;
	GtkTreeViewColumn* _tmp16_;
	CodeWidgetsCellRendererExpander* _tmp17_;
	GtkTreeViewColumn* _tmp18_;
	CodeWidgetsCellRendererExpander* _tmp19_;
	CodeWidgetsSourceListCellRendererIcon* _tmp20_;
	CodeWidgetsSourceListCellRendererIcon* _tmp21_;
	CodeWidgetsSourceListCellRendererIcon* _tmp22_;
	GtkTreeViewColumn* _tmp23_;
	CodeWidgetsSourceListCellRendererIcon* _tmp24_;
	GtkTreeViewColumn* _tmp25_;
	CodeWidgetsSourceListCellRendererIcon* _tmp26_;
	CodeWidgetsCellRendererBadge* _tmp27_;
	CodeWidgetsCellRendererBadge* _tmp28_;
	CodeWidgetsCellRendererBadge* _tmp29_;
	GtkTreeViewColumn* _tmp30_;
	CodeWidgetsCellRendererBadge* _tmp31_;
	GtkTreeViewColumn* _tmp32_;
	CodeWidgetsCellRendererBadge* _tmp33_;
	GtkCellRendererText* _tmp34_;
	GtkCellRendererText* _tmp35_;
	GtkCellRendererText* _tmp36_;
	GtkCellRendererText* _tmp37_;
	GtkCellRendererText* _tmp38_;
	GtkCellRendererText* _tmp39_;
	GtkCellRendererText* _tmp40_;
	GtkTreeViewColumn* _tmp41_;
	GtkCellRendererText* _tmp42_;
	GtkTreeViewColumn* _tmp43_;
	GtkCellRendererText* _tmp44_;
	CodeWidgetsSourceListCellRendererIcon* _tmp45_;
	CodeWidgetsSourceListCellRendererIcon* _tmp46_;
	GtkTreeViewColumn* _tmp47_;
	CodeWidgetsSourceListCellRendererIcon* _tmp48_;
	GtkTreeViewColumn* _tmp49_;
	CodeWidgetsSourceListCellRendererIcon* _tmp50_;
	CodeWidgetsCellRendererExpander* _tmp51_;
	gint expander_spacing = 0;
	gint _tmp52_ = 0;
	CodeWidgetsCellRendererExpander* _tmp53_;
	GtkTreeViewColumn* _tmp54_;
	CodeWidgetsCellRendererExpander* _tmp55_;
	GtkTreeViewColumn* _tmp56_;
	CodeWidgetsCellRendererExpander* _tmp57_;
	GtkTreeSelection* selection = NULL;
	GtkTreeSelection* _tmp58_;
	GtkTreeSelection* _tmp59_;
	GtkTreeSelection* _tmp60_;
	GtkTreeSelection* _tmp61_;
	GtkEventControllerKey* _tmp62_;
	GtkEventControllerKey* _tmp63_;
	GError* _inner_error0_ = NULL;
	parent_class = G_OBJECT_CLASS (code_widgets_source_list_tree_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CODE_WIDGETS_SOURCE_LIST_TYPE_TREE, CodeWidgetsSourceListTree);
	_tmp0_ = gtk_widget_get_style_context ((GtkWidget*) self);
	style_context = _tmp0_;
	_tmp1_ = style_context;
	gtk_style_context_add_class (_tmp1_, GTK_STYLE_CLASS_SIDEBAR);
	_tmp2_ = style_context;
	gtk_style_context_add_class (_tmp2_, "source-list");
	_tmp3_ = gtk_css_provider_new ();
	css_provider = _tmp3_;
	{
		GtkCssProvider* _tmp4_;
		GtkStyleContext* _tmp5_;
		GtkCssProvider* _tmp6_;
		_tmp4_ = css_provider;
		gtk_css_provider_load_from_data (_tmp4_, CODE_WIDGETS_SOURCE_LIST_TREE_DEFAULT_STYLESHEET, (gssize) -1, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp5_ = style_context;
		_tmp6_ = css_provider;
		gtk_style_context_add_provider (_tmp5_, (GtkStyleProvider*) _tmp6_, (guint) GTK_STYLE_PROVIDER_PRIORITY_FALLBACK);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp7_;
		const gchar* _tmp8_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp7_ = e;
		_tmp8_ = _tmp7_->message;
		g_warning ("SourceList.vala:1642: Could not create CSS Provider: %s\n" \
"Stylesheet:\n" \
"%s", _tmp8_, CODE_WIDGETS_SOURCE_LIST_TREE_DEFAULT_STYLESHEET);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (css_provider);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
	}
	_tmp9_ = self->priv->_data_model;
	gtk_tree_view_set_model ((GtkTreeView*) self, (GtkTreeModel*) _tmp9_);
	gtk_widget_set_valign ((GtkWidget*) self, GTK_ALIGN_FILL);
	gtk_widget_set_halign ((GtkWidget*) self, GTK_ALIGN_FILL);
	g_object_set ((GtkWidget*) self, "expand", TRUE, NULL);
	gtk_tree_view_set_enable_search ((GtkTreeView*) self, FALSE);
	gtk_tree_view_set_headers_visible ((GtkTreeView*) self, FALSE);
	g_object_set ((GtkTreeView*) self, "enable-grid-lines", GTK_TREE_VIEW_GRID_LINES_NONE, NULL);
	gtk_tree_view_set_expander_column ((GtkTreeView*) self, NULL);
	gtk_tree_view_set_show_expanders ((GtkTreeView*) self, FALSE);
	_tmp10_ = gtk_tree_view_column_new ();
	g_object_ref_sink (_tmp10_);
	item_column = _tmp10_;
	_tmp11_ = item_column;
	gtk_tree_view_column_set_expand (_tmp11_, TRUE);
	_tmp12_ = item_column;
	gtk_tree_view_insert_column ((GtkTreeView*) self, _tmp12_, (gint) CODE_WIDGETS_SOURCE_LIST_TREE_COLUMN_ITEM);
	_tmp13_ = code_widgets_cell_renderer_expander_new ();
	g_object_ref_sink (_tmp13_);
	_g_object_unref0 (self->priv->secondary_expander_cell);
	self->priv->secondary_expander_cell = _tmp13_;
	_tmp14_ = self->priv->secondary_expander_cell;
	code_widgets_cell_renderer_expander_set_is_category_expander (_tmp14_, TRUE);
	_tmp15_ = self->priv->secondary_expander_cell;
	g_object_set ((GtkCellRenderer*) _tmp15_, "xpad", (guint) 10, NULL);
	_tmp16_ = item_column;
	_tmp17_ = self->priv->secondary_expander_cell;
	gtk_cell_layout_pack_end ((GtkCellLayout*) _tmp16_, (GtkCellRenderer*) _tmp17_, FALSE);
	_tmp18_ = item_column;
	_tmp19_ = self->priv->secondary_expander_cell;
	gtk_cell_layout_set_cell_data_func ((GtkCellLayout*) _tmp18_, (GtkCellRenderer*) _tmp19_, _code_widgets_source_list_tree_expander_cell_data_func_gtk_cell_layout_data_func, g_object_ref (self), g_object_unref);
	_tmp20_ = code_widgets_source_list_cell_renderer_icon_new ();
	g_object_ref_sink (_tmp20_);
	_g_object_unref0 (self->priv->activatable_cell);
	self->priv->activatable_cell = _tmp20_;
	_tmp21_ = self->priv->activatable_cell;
	g_object_set ((GtkCellRenderer*) _tmp21_, "xpad", (guint) 6, NULL);
	_tmp22_ = self->priv->activatable_cell;
	g_signal_connect_object (_tmp22_, "activated", (GCallback) _code_widgets_source_list_tree_on_activatable_activated_code_widgets_source_list_cell_renderer_icon_activated, self, 0);
	_tmp23_ = item_column;
	_tmp24_ = self->priv->activatable_cell;
	gtk_cell_layout_pack_end ((GtkCellLayout*) _tmp23_, (GtkCellRenderer*) _tmp24_, FALSE);
	_tmp25_ = item_column;
	_tmp26_ = self->priv->activatable_cell;
	gtk_cell_layout_set_cell_data_func ((GtkCellLayout*) _tmp25_, (GtkCellRenderer*) _tmp26_, _code_widgets_source_list_tree_icon_cell_data_func_gtk_cell_layout_data_func, g_object_ref (self), g_object_unref);
	_tmp27_ = code_widgets_cell_renderer_badge_new ();
	g_object_ref_sink (_tmp27_);
	_g_object_unref0 (self->priv->badge_cell);
	self->priv->badge_cell = _tmp27_;
	_tmp28_ = self->priv->badge_cell;
	g_object_set ((GtkCellRenderer*) _tmp28_, "xpad", (guint) 1, NULL);
	_tmp29_ = self->priv->badge_cell;
	g_object_set ((GtkCellRenderer*) _tmp29_, "xalign", (gfloat) 1, NULL);
	_tmp30_ = item_column;
	_tmp31_ = self->priv->badge_cell;
	gtk_cell_layout_pack_end ((GtkCellLayout*) _tmp30_, (GtkCellRenderer*) _tmp31_, FALSE);
	_tmp32_ = item_column;
	_tmp33_ = self->priv->badge_cell;
	gtk_cell_layout_set_cell_data_func ((GtkCellLayout*) _tmp32_, (GtkCellRenderer*) _tmp33_, _code_widgets_source_list_tree_badge_cell_data_func_gtk_cell_layout_data_func, g_object_ref (self), g_object_unref);
	_tmp34_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	g_object_ref_sink (_tmp34_);
	_g_object_unref0 (self->priv->text_cell);
	self->priv->text_cell = _tmp34_;
	_tmp35_ = self->priv->text_cell;
	g_object_set (_tmp35_, "editable-set", TRUE, NULL);
	_tmp36_ = self->priv->text_cell;
	g_object_set (_tmp36_, "editable", FALSE, NULL);
	_tmp37_ = self->priv->text_cell;
	g_signal_connect_object ((GtkCellRenderer*) _tmp37_, "editing-started", (GCallback) _code_widgets_source_list_tree_on_editing_started_gtk_cell_renderer_editing_started, self, 0);
	_tmp38_ = self->priv->text_cell;
	g_signal_connect_object ((GtkCellRenderer*) _tmp38_, "editing-canceled", (GCallback) _code_widgets_source_list_tree_on_editing_canceled_gtk_cell_renderer_editing_canceled, self, 0);
	_tmp39_ = self->priv->text_cell;
	g_object_set (_tmp39_, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
	_tmp40_ = self->priv->text_cell;
	g_object_set ((GtkCellRenderer*) _tmp40_, "xalign", (gfloat) 0, NULL);
	_tmp41_ = item_column;
	_tmp42_ = self->priv->text_cell;
	gtk_cell_layout_pack_end ((GtkCellLayout*) _tmp41_, (GtkCellRenderer*) _tmp42_, TRUE);
	_tmp43_ = item_column;
	_tmp44_ = self->priv->text_cell;
	gtk_cell_layout_set_cell_data_func ((GtkCellLayout*) _tmp43_, (GtkCellRenderer*) _tmp44_, _code_widgets_source_list_tree_name_cell_data_func_gtk_cell_layout_data_func, g_object_ref (self), g_object_unref);
	_tmp45_ = code_widgets_source_list_cell_renderer_icon_new ();
	g_object_ref_sink (_tmp45_);
	_g_object_unref0 (self->priv->icon_cell);
	self->priv->icon_cell = _tmp45_;
	_tmp46_ = self->priv->icon_cell;
	g_object_set ((GtkCellRenderer*) _tmp46_, "xpad", (guint) 2, NULL);
	_tmp47_ = item_column;
	_tmp48_ = self->priv->icon_cell;
	gtk_cell_layout_pack_end ((GtkCellLayout*) _tmp47_, (GtkCellRenderer*) _tmp48_, FALSE);
	_tmp49_ = item_column;
	_tmp50_ = self->priv->icon_cell;
	gtk_cell_layout_set_cell_data_func ((GtkCellLayout*) _tmp49_, (GtkCellRenderer*) _tmp50_, _code_widgets_source_list_tree_icon_cell_data_func_gtk_cell_layout_data_func, g_object_ref (self), g_object_unref);
	_tmp51_ = code_widgets_cell_renderer_expander_new ();
	g_object_ref_sink (_tmp51_);
	_g_object_unref0 (self->priv->primary_expander_cell);
	self->priv->primary_expander_cell = _tmp51_;
	gtk_widget_style_get ((GtkWidget*) self, CODE_WIDGETS_SOURCE_LIST_TREE_STYLE_PROP_EXPANDER_SPACING, &_tmp52_, NULL);
	expander_spacing = _tmp52_;
	_tmp53_ = self->priv->primary_expander_cell;
	g_object_set ((GtkCellRenderer*) _tmp53_, "xpad", (guint) (expander_spacing / 2), NULL);
	_tmp54_ = item_column;
	_tmp55_ = self->priv->primary_expander_cell;
	gtk_cell_layout_pack_end ((GtkCellLayout*) _tmp54_, (GtkCellRenderer*) _tmp55_, FALSE);
	_tmp56_ = item_column;
	_tmp57_ = self->priv->primary_expander_cell;
	gtk_cell_layout_set_cell_data_func ((GtkCellLayout*) _tmp56_, (GtkCellRenderer*) _tmp57_, _code_widgets_source_list_tree_expander_cell_data_func_gtk_cell_layout_data_func, g_object_ref (self), g_object_unref);
	_tmp58_ = gtk_tree_view_get_selection ((GtkTreeView*) self);
	_tmp59_ = _g_object_ref0 (_tmp58_);
	selection = _tmp59_;
	_tmp60_ = selection;
	gtk_tree_selection_set_mode (_tmp60_, GTK_SELECTION_BROWSE);
	_tmp61_ = selection;
	gtk_tree_selection_set_select_function (_tmp61_, _code_widgets_source_list_tree_select_func_gtk_tree_selection_func, g_object_ref (self), g_object_unref);
	code_widgets_source_list_tree_enable_item_property_monitor (self);
	code_widgets_source_list_tree_add_spacer_cell_for_level (self, 1, TRUE);
	code_widgets_source_list_tree_configure_drag_source (self, NULL, (gint) 0);
	code_widgets_source_list_tree_configure_drag_dest (self, NULL, (gint) 0, 0);
	g_signal_connect_object ((GtkWidget*) self, "query-tooltip", (GCallback) _code_widgets_source_list_tree_on_query_tooltip_gtk_widget_query_tooltip, self, G_CONNECT_AFTER);
	gtk_widget_set_has_tooltip ((GtkWidget*) self, TRUE);
	_tmp62_ = (GtkEventControllerKey*) gtk_event_controller_key_new ((GtkWidget*) self);
	_g_object_unref0 (self->priv->key_controller);
	self->priv->key_controller = _tmp62_;
	_tmp63_ = self->priv->key_controller;
	g_signal_connect_object (_tmp63_, "key-released", (GCallback) _code_widgets_source_list_tree_on_key_released_gtk_event_controller_key_key_released, self, 0);
	_g_object_unref0 (selection);
	_g_object_unref0 (item_column);
	_g_object_unref0 (css_provider);
	return obj;
}

static void
code_widgets_source_list_tree_class_init (CodeWidgetsSourceListTreeClass * klass,
                                          gpointer klass_data)
{
	GParamSpecInt* _tmp0_;
	GParamSpecInt* _tmp1_;
	GParamSpecInt* _tmp2_;
	GParamSpecInt* _tmp3_;
	GParamSpecInt* _tmp4_;
	GParamSpecInt* _tmp5_;
	code_widgets_source_list_tree_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &CodeWidgetsSourceListTree_private_offset);
	((GtkWidgetClass *) klass)->drag_motion = (gboolean (*) (GtkWidget*, GdkDragContext*, gint, gint, guint)) code_widgets_source_list_tree_real_drag_motion;
	((GtkWidgetClass *) klass)->drag_data_received = (void (*) (GtkWidget*, GdkDragContext*, gint, gint, GtkSelectionData*, guint, guint)) code_widgets_source_list_tree_real_drag_data_received;
	((GtkTreeViewClass *) klass)->cursor_changed = (void (*) (GtkTreeView*)) code_widgets_source_list_tree_real_cursor_changed;
	((GtkTreeViewClass *) klass)->row_expanded = (void (*) (GtkTreeView*, GtkTreeIter*, GtkTreePath*)) code_widgets_source_list_tree_real_row_expanded;
	((GtkTreeViewClass *) klass)->row_collapsed = (void (*) (GtkTreeView*, GtkTreeIter*, GtkTreePath*)) code_widgets_source_list_tree_real_row_collapsed;
	((GtkTreeViewClass *) klass)->row_activated = (void (*) (GtkTreeView*, GtkTreePath*, GtkTreeViewColumn*)) code_widgets_source_list_tree_real_row_activated;
	((GtkWidgetClass *) klass)->button_release_event = (gboolean (*) (GtkWidget*, GdkEventButton*)) code_widgets_source_list_tree_real_button_release_event;
	((GtkWidgetClass *) klass)->button_press_event = (gboolean (*) (GtkWidget*, GdkEventButton*)) code_widgets_source_list_tree_real_button_press_event;
	((GtkWidgetClass *) klass)->popup_menu = (gboolean (*) (GtkWidget*)) code_widgets_source_list_tree_real_popup_menu;
	G_OBJECT_CLASS (klass)->get_property = _vala_code_widgets_source_list_tree_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_code_widgets_source_list_tree_set_property;
	G_OBJECT_CLASS (klass)->constructor = code_widgets_source_list_tree_constructor;
	G_OBJECT_CLASS (klass)->finalize = code_widgets_source_list_tree_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_SOURCE_LIST_TREE_DATA_MODEL_PROPERTY, code_widgets_source_list_tree_properties[CODE_WIDGETS_SOURCE_LIST_TREE_DATA_MODEL_PROPERTY] = g_param_spec_object ("data-model", "data-model", "data-model", CODE_WIDGETS_SOURCE_LIST_TYPE_DATA_MODEL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_SOURCE_LIST_TREE_SELECTED_ITEM_PROPERTY, code_widgets_source_list_tree_properties[CODE_WIDGETS_SOURCE_LIST_TREE_SELECTED_ITEM_PROPERTY] = g_param_spec_object ("selected-item", "selected-item", "selected-item", CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_SOURCE_LIST_TREE_EDITING_PROPERTY, code_widgets_source_list_tree_properties[CODE_WIDGETS_SOURCE_LIST_TREE_EDITING_PROPERTY] = g_param_spec_boolean ("editing", "editing", "editing", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_SOURCE_LIST_TREE_ELLIPSIZE_MODE_PROPERTY, code_widgets_source_list_tree_properties[CODE_WIDGETS_SOURCE_LIST_TREE_ELLIPSIZE_MODE_PROPERTY] = g_param_spec_enum ("ellipsize-mode", "ellipsize-mode", "ellipsize-mode", pango_ellipsize_mode_get_type (), 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	code_widgets_source_list_tree_signals[CODE_WIDGETS_SOURCE_LIST_TREE_ITEM_SELECTED_SIGNAL] = g_signal_new ("item-selected", CODE_WIDGETS_SOURCE_LIST_TYPE_TREE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM);
	_tmp0_ = (GParamSpecInt*) g_param_spec_int (CODE_WIDGETS_SOURCE_LIST_TREE_STYLE_PROP_LEVEL_INDENTATION, "Level Indentation", "Space to add at the beginning of every indentation level. Must be an e" \
"ven number.", 1, 50, 6, G_PARAM_READABLE);
	_tmp1_ = _tmp0_;
	gtk_widget_class_install_style_property (GTK_WIDGET_CLASS (klass), (GParamSpec*) _tmp1_);
	_g_param_spec_unref0 (_tmp1_);
	_tmp2_ = (GParamSpecInt*) g_param_spec_int (CODE_WIDGETS_SOURCE_LIST_TREE_STYLE_PROP_LEFT_PADDING, "Left Padding", "Padding added to the left side of the tree. Must be an even number.", 1, 50, 4, G_PARAM_READABLE);
	_tmp3_ = _tmp2_;
	gtk_widget_class_install_style_property (GTK_WIDGET_CLASS (klass), (GParamSpec*) _tmp3_);
	_g_param_spec_unref0 (_tmp3_);
	_tmp4_ = (GParamSpecInt*) g_param_spec_int (CODE_WIDGETS_SOURCE_LIST_TREE_STYLE_PROP_EXPANDER_SPACING, "Expander Spacing", "Space added between an item and its expander. Must be an even number.", 1, 50, 4, G_PARAM_READABLE);
	_tmp5_ = _tmp4_;
	gtk_widget_class_install_style_property (GTK_WIDGET_CLASS (klass), (GParamSpec*) _tmp5_);
	_g_param_spec_unref0 (_tmp5_);
}

static void
code_widgets_source_list_tree_instance_init (CodeWidgetsSourceListTree * self,
                                             gpointer klass)
{
	self->priv = code_widgets_source_list_tree_get_instance_private (self);
	self->priv->unselectable_item_clicked = FALSE;
}

static void
code_widgets_source_list_tree_finalize (GObject * obj)
{
	CodeWidgetsSourceListTree * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CODE_WIDGETS_SOURCE_LIST_TYPE_TREE, CodeWidgetsSourceListTree);
	code_widgets_source_list_tree_disable_item_property_monitor (self);
	_g_object_unref0 (self->priv->_data_model);
	_g_object_unref0 (self->priv->selected);
	_g_object_unref0 (self->priv->editable_entry);
	_g_object_unref0 (self->priv->text_cell);
	_g_object_unref0 (self->priv->key_controller);
	_g_object_unref0 (self->priv->icon_cell);
	_g_object_unref0 (self->priv->activatable_cell);
	_g_object_unref0 (self->priv->badge_cell);
	_g_object_unref0 (self->priv->primary_expander_cell);
	_g_object_unref0 (self->priv->secondary_expander_cell);
	_g_object_unref0 (self->priv->spacer_cells);
	G_OBJECT_CLASS (code_widgets_source_list_tree_parent_class)->finalize (obj);
}

/**
     * The tree that actually displays the items.
     *
     * All the user interaction happens here.
     */
 G_GNUC_NO_INLINE static GType
code_widgets_source_list_tree_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (CodeWidgetsSourceListTreeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) code_widgets_source_list_tree_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CodeWidgetsSourceListTree), 0, (GInstanceInitFunc) code_widgets_source_list_tree_instance_init, NULL };
	GType code_widgets_source_list_tree_type_id;
	code_widgets_source_list_tree_type_id = g_type_register_static (gtk_tree_view_get_type (), "CodeWidgetsSourceListTree", &g_define_type_info, G_TYPE_FLAG_NONE);
	CodeWidgetsSourceListTree_private_offset = g_type_add_instance_private (code_widgets_source_list_tree_type_id, sizeof (CodeWidgetsSourceListTreePrivate));
	return code_widgets_source_list_tree_type_id;
}

static GType
code_widgets_source_list_tree_get_type (void)
{
	static gsize code_widgets_source_list_tree_type_id__once = 0;
	if (g_once_init_enter (&code_widgets_source_list_tree_type_id__once)) {
		GType code_widgets_source_list_tree_type_id;
		code_widgets_source_list_tree_type_id = code_widgets_source_list_tree_get_type_once ();
		g_once_init_leave (&code_widgets_source_list_tree_type_id__once, code_widgets_source_list_tree_type_id);
	}
	return code_widgets_source_list_tree_type_id__once;
}

static void
_vala_code_widgets_source_list_tree_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec)
{
	CodeWidgetsSourceListTree * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CODE_WIDGETS_SOURCE_LIST_TYPE_TREE, CodeWidgetsSourceListTree);
	switch (property_id) {
		case CODE_WIDGETS_SOURCE_LIST_TREE_DATA_MODEL_PROPERTY:
		g_value_set_object (value, code_widgets_source_list_tree_get_data_model (self));
		break;
		case CODE_WIDGETS_SOURCE_LIST_TREE_SELECTED_ITEM_PROPERTY:
		g_value_set_object (value, code_widgets_source_list_tree_get_selected_item (self));
		break;
		case CODE_WIDGETS_SOURCE_LIST_TREE_EDITING_PROPERTY:
		g_value_set_boolean (value, code_widgets_source_list_tree_get_editing (self));
		break;
		case CODE_WIDGETS_SOURCE_LIST_TREE_ELLIPSIZE_MODE_PROPERTY:
		g_value_set_enum (value, code_widgets_source_list_tree_get_ellipsize_mode (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_code_widgets_source_list_tree_set_property (GObject * object,
                                                  guint property_id,
                                                  const GValue * value,
                                                  GParamSpec * pspec)
{
	CodeWidgetsSourceListTree * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CODE_WIDGETS_SOURCE_LIST_TYPE_TREE, CodeWidgetsSourceListTree);
	switch (property_id) {
		case CODE_WIDGETS_SOURCE_LIST_TREE_DATA_MODEL_PROPERTY:
		code_widgets_source_list_tree_set_data_model (self, g_value_get_object (value));
		break;
		case CODE_WIDGETS_SOURCE_LIST_TREE_SELECTED_ITEM_PROPERTY:
		code_widgets_source_list_tree_set_selected_item (self, g_value_get_object (value));
		break;
		case CODE_WIDGETS_SOURCE_LIST_TREE_ELLIPSIZE_MODE_PROPERTY:
		code_widgets_source_list_tree_set_ellipsize_mode (self, g_value_get_enum (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_code_widgets_source_list___lambda5_ (CodeWidgetsSourceList* self,
                                      CodeWidgetsSourceListItem* item)
{
	g_signal_emit (self, code_widgets_source_list_signals[CODE_WIDGETS_SOURCE_LIST_ITEM_SELECTED_SIGNAL], 0, item);
}

static void
__code_widgets_source_list___lambda5__code_widgets_source_list_tree_item_selected (CodeWidgetsSourceListTree* _sender,
                                                                                   CodeWidgetsSourceListItem* item,
                                                                                   gpointer self)
{
	_code_widgets_source_list___lambda5_ ((CodeWidgetsSourceList*) self, item);
}

static GObject *
code_widgets_source_list_constructor (GType type,
                                      guint n_construct_properties,
                                      GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	CodeWidgetsSourceList * self;
	CodeWidgetsSourceListDataModel* _tmp0_;
	CodeWidgetsSourceListTree* _tmp1_;
	CodeWidgetsSourceListTree* _tmp2_;
	CodeWidgetsSourceListTree* _tmp3_;
	parent_class = G_OBJECT_CLASS (code_widgets_source_list_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CODE_WIDGETS_TYPE_SOURCE_LIST, CodeWidgetsSourceList);
	_tmp0_ = self->priv->data_model;
	_tmp1_ = code_widgets_source_list_tree_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->tree);
	self->priv->tree = _tmp1_;
	gtk_scrolled_window_set_policy ((GtkScrolledWindow*) self, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
	_tmp2_ = self->priv->tree;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp2_);
	gtk_widget_show_all ((GtkWidget*) self);
	_tmp3_ = self->priv->tree;
	g_signal_connect_object (_tmp3_, "item-selected", (GCallback) __code_widgets_source_list___lambda5__code_widgets_source_list_tree_item_selected, self, 0);
	return obj;
}

static void
code_widgets_source_list_class_init (CodeWidgetsSourceListClass * klass,
                                     gpointer klass_data)
{
	code_widgets_source_list_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &CodeWidgetsSourceList_private_offset);
	((CodeWidgetsSourceListClass *) klass)->item_selected = code_widgets_source_list_real_item_selected;
	G_OBJECT_CLASS (klass)->get_property = _vala_code_widgets_source_list_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_code_widgets_source_list_set_property;
	G_OBJECT_CLASS (klass)->constructor = code_widgets_source_list_constructor;
	G_OBJECT_CLASS (klass)->finalize = code_widgets_source_list_finalize;
	/**
	     * Root-level expandable item.
	     *
	     * This item contains the first-level source list items. It //only serves as an item container//.
	     * It is used to add and remove items to/from the widget.
	     *
	     * Internally, it allows the source list to connect to its {@link Code.Widgets.SourceList.ExpandableItem.child_added}
	     * and {@link Code.Widgets.SourceList.ExpandableItem.child_removed} signals in order to monitor
	     * new children additions/removals.
	     *
	     * @since 0.2
	     */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_SOURCE_LIST_ROOT_PROPERTY, code_widgets_source_list_properties[CODE_WIDGETS_SOURCE_LIST_ROOT_PROPERTY] = g_param_spec_object ("root", "root", "root", CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	     * The current selected item.
	     *
	     * Setting it to //null// un-selects the previously selected item, if there was any.
	     * {@link Code.Widgets.SourceList.ExpandableItem.expand_with_parents} is called on the
	     * item's parent to make sure it's possible to select it.
	     *
	     * @since 0.2
	     */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_SOURCE_LIST_SELECTED_PROPERTY, code_widgets_source_list_properties[CODE_WIDGETS_SOURCE_LIST_SELECTED_PROPERTY] = g_param_spec_object ("selected", "selected", "selected", CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	     * Text ellipsize mode.
	     *
	     * @since 0.2
	     */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_SOURCE_LIST_ELLIPSIZE_MODE_PROPERTY, code_widgets_source_list_properties[CODE_WIDGETS_SOURCE_LIST_ELLIPSIZE_MODE_PROPERTY] = g_param_spec_enum ("ellipsize-mode", "ellipsize-mode", "ellipsize-mode", pango_ellipsize_mode_get_type (), 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	     * Whether an item is being edited.
	     *
	     * @see Code.Widgets.SourceList.start_editing_item
	     * @since 0.2
	     */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_SOURCE_LIST_EDITING_PROPERTY, code_widgets_source_list_properties[CODE_WIDGETS_SOURCE_LIST_EDITING_PROPERTY] = g_param_spec_boolean ("editing", "editing", "editing", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_WIDGETS_SOURCE_LIST_ACTIVATE_ON_SINGLE_CLICK_PROPERTY, code_widgets_source_list_properties[CODE_WIDGETS_SOURCE_LIST_ACTIVATE_ON_SINGLE_CLICK_PROPERTY] = g_param_spec_boolean ("activate-on-single-click", "activate-on-single-click", "activate-on-single-click", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	/**
	     * Emitted when the source list selection changes.
	     *
	     * @param item Selected item; //null// if nothing is selected.
	     * @since 0.2
	     */
	code_widgets_source_list_signals[CODE_WIDGETS_SOURCE_LIST_ITEM_SELECTED_SIGNAL] = g_signal_new ("item-selected", CODE_WIDGETS_TYPE_SOURCE_LIST, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (CodeWidgetsSourceListClass, item_selected), NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM);
}

static void
code_widgets_source_list_instance_init (CodeWidgetsSourceList * self,
                                        gpointer klass)
{
	CodeWidgetsSourceListDataModel* _tmp0_;
	self->priv = code_widgets_source_list_get_instance_private (self);
	_tmp0_ = code_widgets_source_list_data_model_new ();
	self->priv->data_model = _tmp0_;
}

static void
code_widgets_source_list_finalize (GObject * obj)
{
	CodeWidgetsSourceList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CODE_WIDGETS_TYPE_SOURCE_LIST, CodeWidgetsSourceList);
	_g_object_unref0 (self->priv->tree);
	_g_object_unref0 (self->priv->data_model);
	G_OBJECT_CLASS (code_widgets_source_list_parent_class)->finalize (obj);
}

/**
 * A widget that can display a list of items organized in categories.
 *
 * The source list widget consists of a collection of items, some of which are also expandable (and
 * thus can contain more items). All the items displayed in the source list are children of the widget's
 * root item. The API is meant to be used as follows:
 *
 * 1. Create the items you want to display in the source list, setting the appropriate values for their
 * properties. The desired hierarchy is achieved by creating expandable items and adding items to them.
 * These will be displayed as descendants in the widget's tree structure. The expandable items that are
 * not nested inside any other item are considered to be at root level, and should be added to
 * the widget's root item.<<BR>>
 *
 * Expandable items located at the root level are treated as categories, and only support text.
 *
 * ''Example''<<BR>>
 * The final tree will have the following structure:
 * {{{
 * Libraries
 *   Music
 * Stores
 *   My Store
 *      Music
 *      Podcasts
 * Devices
 *   Player 1
 *   Player 2
 * }}}
 *
 * {{{
 * var library_category = new Code.Widgets.SourceList.ExpandableItem ("Libraries");
 * var store_category = new Code.Widgets.SourceList.ExpandableItem ("Stores");
 * var device_category = new Code.Widgets.SourceList.ExpandableItem ("Devices");
 *
 * var music_item = new Code.Widgets.SourceList.Item ("Music");
 *
 * // "Libraries" will be the parent category of "Music"
 * library_category.add (music_item);
 *
 * // We plan to add sub-items to the store, so let's use an expandable item
 * var my_store_item = new Code.Widgets.SourceList.ExpandableItem ("My Store");
 * store_category.add (my_store_item);
 *
 * var my_store_podcast_item = new Code.Widgets.SourceList.Item ("Podcasts");
 * var my_store_music_item = new Code.Widgets.SourceList.Item ("Music");
 *
 * my_store_item.add (my_store_music_item);
 * my_store_item.add (my_store_podcast_item);
 *
 * var player1_item = new Code.Widgets.SourceList.Item ("Player 1");
 * var player2_item = new Code.Widgets.SourceList.Item ("Player 2");
 *
 * device_category.add (player1_item);
 * device_category.add (player2_item);
 * }}}
 *
 * 2. Create a source list widget.<<BR>>
 * {{{
 * var source_list = new Code.Widgets.SourceList ();
 * }}}
 *
 * 3. Add root-level items to the {@link Code.Widgets.SourceList.root} item.
 * This item only serves as a container, and all its properties are ignored by the widget.
 *
 * {{{
 * // This will add the main categories (including their children) to the source list. After
 * // having being added to be widget, any other item added to any of these items
 * // (or any other child item in a deeper level) will be automatically added too.
 * // There's no need to deal with the source list widget directly.
 *
 * var root = source_list.root;
 *
 * root.add (library_category);
 * root.add (store_category);
 * root.add (device_category);
 * }}}
 *
 * The steps mentioned above are enough for initializing the source list. Future changes to the items'
 * properties are ''automatically'' reflected by the widget.
 *
 * Final steps would involve connecting handlers to the source list events, being
 * {@link Code.Widgets.SourceList.item_selected} the most important, as it indicates that
 * the selection was modified.
 *
 * Pack the source list into the GUI using the {@link Gtk.Paned} widget.
 * This is usually done as follows:
 * {{{
 * var pane = new Gtk.Paned (Gtk.Orientation.HORIZONTAL);
 * pane.pack1 (source_list, false, false);
 * pane.pack2 (content_area, true, false);
 * }}}
 *
 * @since 0.2
 * @see Gtk.Paned
 */
 G_GNUC_NO_INLINE static GType
code_widgets_source_list_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (CodeWidgetsSourceListClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) code_widgets_source_list_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CodeWidgetsSourceList), 0, (GInstanceInitFunc) code_widgets_source_list_instance_init, NULL };
	GType code_widgets_source_list_type_id;
	code_widgets_source_list_type_id = g_type_register_static (gtk_scrolled_window_get_type (), "CodeWidgetsSourceList", &g_define_type_info, G_TYPE_FLAG_NONE);
	CodeWidgetsSourceList_private_offset = g_type_add_instance_private (code_widgets_source_list_type_id, sizeof (CodeWidgetsSourceListPrivate));
	return code_widgets_source_list_type_id;
}

GType
code_widgets_source_list_get_type (void)
{
	static gsize code_widgets_source_list_type_id__once = 0;
	if (g_once_init_enter (&code_widgets_source_list_type_id__once)) {
		GType code_widgets_source_list_type_id;
		code_widgets_source_list_type_id = code_widgets_source_list_get_type_once ();
		g_once_init_leave (&code_widgets_source_list_type_id__once, code_widgets_source_list_type_id);
	}
	return code_widgets_source_list_type_id__once;
}

static void
_vala_code_widgets_source_list_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec)
{
	CodeWidgetsSourceList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CODE_WIDGETS_TYPE_SOURCE_LIST, CodeWidgetsSourceList);
	switch (property_id) {
		case CODE_WIDGETS_SOURCE_LIST_ROOT_PROPERTY:
		g_value_set_object (value, code_widgets_source_list_get_root (self));
		break;
		case CODE_WIDGETS_SOURCE_LIST_SELECTED_PROPERTY:
		g_value_set_object (value, code_widgets_source_list_get_selected (self));
		break;
		case CODE_WIDGETS_SOURCE_LIST_ELLIPSIZE_MODE_PROPERTY:
		g_value_set_enum (value, code_widgets_source_list_get_ellipsize_mode (self));
		break;
		case CODE_WIDGETS_SOURCE_LIST_EDITING_PROPERTY:
		g_value_set_boolean (value, code_widgets_source_list_get_editing (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_code_widgets_source_list_set_property (GObject * object,
                                             guint property_id,
                                             const GValue * value,
                                             GParamSpec * pspec)
{
	CodeWidgetsSourceList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CODE_WIDGETS_TYPE_SOURCE_LIST, CodeWidgetsSourceList);
	switch (property_id) {
		case CODE_WIDGETS_SOURCE_LIST_ROOT_PROPERTY:
		code_widgets_source_list_set_root (self, g_value_get_object (value));
		break;
		case CODE_WIDGETS_SOURCE_LIST_SELECTED_PROPERTY:
		code_widgets_source_list_set_selected (self, g_value_get_object (value));
		break;
		case CODE_WIDGETS_SOURCE_LIST_ELLIPSIZE_MODE_PROPERTY:
		code_widgets_source_list_set_ellipsize_mode (self, g_value_get_enum (value));
		break;
		case CODE_WIDGETS_SOURCE_LIST_ACTIVATE_ON_SINGLE_CLICK_PROPERTY:
		code_widgets_source_list_set_activate_on_single_click (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

