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

/*-
 * Copyright (c) 2021 elementary Inc. (https://elementary.io)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <gdk/gdk.h>
#include <pango/pango.h>

#define CODE_CHOOSE_PROJECT_BUTTON_NO_PROJECT_SELECTED N_ ("No Project Selected")
#define CODE_CHOOSE_PROJECT_BUTTON_PROJECT_TOOLTIP N_ ("Active Git Project: %s")
#define SCRATCH_MAIN_WINDOW_ACTION_GROUP "win"
#define SCRATCH_MAIN_WINDOW_ACTION_PREFIX SCRATCH_MAIN_WINDOW_ACTION_GROUP "."
#define SCRATCH_MAIN_WINDOW_ACTION_OPEN_PROJECT "action-open-project"
#define SCRATCH_MAIN_WINDOW_ACTION_CLONE_REPO "action-clone-repo"
#define SCRATCH_MAIN_WINDOW_ACTION_SET_ACTIVE_PROJECT "action-set-active-project"
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define CODE_TYPE_CHOOSE_PROJECT_BUTTON (code_choose_project_button_get_type ())
#define CODE_CHOOSE_PROJECT_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CODE_TYPE_CHOOSE_PROJECT_BUTTON, CodeChooseProjectButton))
#define CODE_CHOOSE_PROJECT_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CODE_TYPE_CHOOSE_PROJECT_BUTTON, CodeChooseProjectButtonClass))
#define CODE_IS_CHOOSE_PROJECT_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CODE_TYPE_CHOOSE_PROJECT_BUTTON))
#define CODE_IS_CHOOSE_PROJECT_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CODE_TYPE_CHOOSE_PROJECT_BUTTON))
#define CODE_CHOOSE_PROJECT_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CODE_TYPE_CHOOSE_PROJECT_BUTTON, CodeChooseProjectButtonClass))

typedef struct _CodeChooseProjectButton CodeChooseProjectButton;
typedef struct _CodeChooseProjectButtonClass CodeChooseProjectButtonClass;
typedef struct _CodeChooseProjectButtonPrivate CodeChooseProjectButtonPrivate;
enum  {
	CODE_CHOOSE_PROJECT_BUTTON_0_PROPERTY,
	CODE_CHOOSE_PROJECT_BUTTON_CLONING_IN_PROGRESS_PROPERTY,
	CODE_CHOOSE_PROJECT_BUTTON_TOPLEVEL_ACTION_GROUP_PROPERTY,
	CODE_CHOOSE_PROJECT_BUTTON_NUM_PROPERTIES
};
static GParamSpec* code_choose_project_button_properties[CODE_CHOOSE_PROJECT_BUTTON_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define SCRATCH_SERVICES_TYPE_GIT_MANAGER (scratch_services_git_manager_get_type ())
#define SCRATCH_SERVICES_GIT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SCRATCH_SERVICES_TYPE_GIT_MANAGER, ScratchServicesGitManager))
#define SCRATCH_SERVICES_GIT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SCRATCH_SERVICES_TYPE_GIT_MANAGER, ScratchServicesGitManagerClass))
#define SCRATCH_SERVICES_IS_GIT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCRATCH_SERVICES_TYPE_GIT_MANAGER))
#define SCRATCH_SERVICES_IS_GIT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SCRATCH_SERVICES_TYPE_GIT_MANAGER))
#define SCRATCH_SERVICES_GIT_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SCRATCH_SERVICES_TYPE_GIT_MANAGER, ScratchServicesGitManagerClass))

typedef struct _ScratchServicesGitManager ScratchServicesGitManager;
typedef struct _ScratchServicesGitManagerClass ScratchServicesGitManagerClass;
#define _g_free0(var) (var = (g_free (var), NULL))

#define CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM (code_widgets_source_list_item_get_type ())
#define CODE_WIDGETS_SOURCE_LIST_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM, CodeWidgetsSourceListItem))
#define CODE_WIDGETS_SOURCE_LIST_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM, CodeWidgetsSourceListItemClass))
#define CODE_WIDGETS_SOURCE_LIST_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM))
#define CODE_WIDGETS_SOURCE_LIST_IS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM))
#define CODE_WIDGETS_SOURCE_LIST_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CODE_WIDGETS_SOURCE_LIST_TYPE_ITEM, CodeWidgetsSourceListItemClass))

typedef struct _CodeWidgetsSourceListItem CodeWidgetsSourceListItem;
typedef struct _CodeWidgetsSourceListItemClass CodeWidgetsSourceListItemClass;

#define CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM (code_widgets_source_list_expandable_item_get_type ())
#define CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM, CodeWidgetsSourceListExpandableItem))
#define CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM, CodeWidgetsSourceListExpandableItemClass))
#define CODE_WIDGETS_SOURCE_LIST_IS_EXPANDABLE_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM))
#define CODE_WIDGETS_SOURCE_LIST_IS_EXPANDABLE_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM))
#define CODE_WIDGETS_SOURCE_LIST_EXPANDABLE_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM, CodeWidgetsSourceListExpandableItemClass))

typedef struct _CodeWidgetsSourceListExpandableItem CodeWidgetsSourceListExpandableItem;
typedef struct _CodeWidgetsSourceListExpandableItemClass CodeWidgetsSourceListExpandableItemClass;

#define SCRATCH_FOLDER_MANAGER_TYPE_ITEM (scratch_folder_manager_item_get_type ())
#define SCRATCH_FOLDER_MANAGER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SCRATCH_FOLDER_MANAGER_TYPE_ITEM, ScratchFolderManagerItem))
#define SCRATCH_FOLDER_MANAGER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SCRATCH_FOLDER_MANAGER_TYPE_ITEM, ScratchFolderManagerItemClass))
#define SCRATCH_FOLDER_MANAGER_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCRATCH_FOLDER_MANAGER_TYPE_ITEM))
#define SCRATCH_FOLDER_MANAGER_IS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SCRATCH_FOLDER_MANAGER_TYPE_ITEM))
#define SCRATCH_FOLDER_MANAGER_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SCRATCH_FOLDER_MANAGER_TYPE_ITEM, ScratchFolderManagerItemClass))

typedef struct _ScratchFolderManagerItem ScratchFolderManagerItem;
typedef struct _ScratchFolderManagerItemClass ScratchFolderManagerItemClass;

#define SCRATCH_FOLDER_MANAGER_TYPE_FOLDER_ITEM (scratch_folder_manager_folder_item_get_type ())
#define SCRATCH_FOLDER_MANAGER_FOLDER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SCRATCH_FOLDER_MANAGER_TYPE_FOLDER_ITEM, ScratchFolderManagerFolderItem))
#define SCRATCH_FOLDER_MANAGER_FOLDER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SCRATCH_FOLDER_MANAGER_TYPE_FOLDER_ITEM, ScratchFolderManagerFolderItemClass))
#define SCRATCH_FOLDER_MANAGER_IS_FOLDER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCRATCH_FOLDER_MANAGER_TYPE_FOLDER_ITEM))
#define SCRATCH_FOLDER_MANAGER_IS_FOLDER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SCRATCH_FOLDER_MANAGER_TYPE_FOLDER_ITEM))
#define SCRATCH_FOLDER_MANAGER_FOLDER_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SCRATCH_FOLDER_MANAGER_TYPE_FOLDER_ITEM, ScratchFolderManagerFolderItemClass))

typedef struct _ScratchFolderManagerFolderItem ScratchFolderManagerFolderItem;
typedef struct _ScratchFolderManagerFolderItemClass ScratchFolderManagerFolderItemClass;

#define SCRATCH_FOLDER_MANAGER_TYPE_PROJECT_FOLDER_ITEM (scratch_folder_manager_project_folder_item_get_type ())
#define SCRATCH_FOLDER_MANAGER_PROJECT_FOLDER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SCRATCH_FOLDER_MANAGER_TYPE_PROJECT_FOLDER_ITEM, ScratchFolderManagerProjectFolderItem))
#define SCRATCH_FOLDER_MANAGER_PROJECT_FOLDER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SCRATCH_FOLDER_MANAGER_TYPE_PROJECT_FOLDER_ITEM, ScratchFolderManagerProjectFolderItemClass))
#define SCRATCH_FOLDER_MANAGER_IS_PROJECT_FOLDER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCRATCH_FOLDER_MANAGER_TYPE_PROJECT_FOLDER_ITEM))
#define SCRATCH_FOLDER_MANAGER_IS_PROJECT_FOLDER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SCRATCH_FOLDER_MANAGER_TYPE_PROJECT_FOLDER_ITEM))
#define SCRATCH_FOLDER_MANAGER_PROJECT_FOLDER_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SCRATCH_FOLDER_MANAGER_TYPE_PROJECT_FOLDER_ITEM, ScratchFolderManagerProjectFolderItemClass))

typedef struct _ScratchFolderManagerProjectFolderItem ScratchFolderManagerProjectFolderItem;
typedef struct _ScratchFolderManagerProjectFolderItemClass ScratchFolderManagerProjectFolderItemClass;

#define SCRATCH_FOLDER_MANAGER_TYPE_FILE (scratch_folder_manager_file_get_type ())
#define SCRATCH_FOLDER_MANAGER_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SCRATCH_FOLDER_MANAGER_TYPE_FILE, ScratchFolderManagerFile))
#define SCRATCH_FOLDER_MANAGER_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SCRATCH_FOLDER_MANAGER_TYPE_FILE, ScratchFolderManagerFileClass))
#define SCRATCH_FOLDER_MANAGER_IS_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCRATCH_FOLDER_MANAGER_TYPE_FILE))
#define SCRATCH_FOLDER_MANAGER_IS_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SCRATCH_FOLDER_MANAGER_TYPE_FILE))
#define SCRATCH_FOLDER_MANAGER_FILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SCRATCH_FOLDER_MANAGER_TYPE_FILE, ScratchFolderManagerFileClass))

typedef struct _ScratchFolderManagerFile ScratchFolderManagerFile;
typedef struct _ScratchFolderManagerFileClass ScratchFolderManagerFileClass;

#define CODE_CHOOSE_PROJECT_BUTTON_TYPE_PROJECT_ROW (code_choose_project_button_project_row_get_type ())
#define CODE_CHOOSE_PROJECT_BUTTON_PROJECT_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CODE_CHOOSE_PROJECT_BUTTON_TYPE_PROJECT_ROW, CodeChooseProjectButtonProjectRow))
#define CODE_CHOOSE_PROJECT_BUTTON_PROJECT_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CODE_CHOOSE_PROJECT_BUTTON_TYPE_PROJECT_ROW, CodeChooseProjectButtonProjectRowClass))
#define CODE_CHOOSE_PROJECT_BUTTON_IS_PROJECT_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CODE_CHOOSE_PROJECT_BUTTON_TYPE_PROJECT_ROW))
#define CODE_CHOOSE_PROJECT_BUTTON_IS_PROJECT_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CODE_CHOOSE_PROJECT_BUTTON_TYPE_PROJECT_ROW))
#define CODE_CHOOSE_PROJECT_BUTTON_PROJECT_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CODE_CHOOSE_PROJECT_BUTTON_TYPE_PROJECT_ROW, CodeChooseProjectButtonProjectRowClass))

typedef struct _CodeChooseProjectButtonProjectRow CodeChooseProjectButtonProjectRow;
typedef struct _CodeChooseProjectButtonProjectRowClass CodeChooseProjectButtonProjectRowClass;
typedef struct _CodeChooseProjectButtonProjectRowPrivate CodeChooseProjectButtonProjectRowPrivate;
enum  {
	CODE_CHOOSE_PROJECT_BUTTON_PROJECT_ROW_0_PROPERTY,
	CODE_CHOOSE_PROJECT_BUTTON_PROJECT_ROW_ACTIVE_PROPERTY,
	CODE_CHOOSE_PROJECT_BUTTON_PROJECT_ROW_PROJECT_PATH_PROPERTY,
	CODE_CHOOSE_PROJECT_BUTTON_PROJECT_ROW_PROJECT_NAME_PROPERTY,
	CODE_CHOOSE_PROJECT_BUTTON_PROJECT_ROW_NUM_PROPERTIES
};
static GParamSpec* code_choose_project_button_project_row_properties[CODE_CHOOSE_PROJECT_BUTTON_PROJECT_ROW_NUM_PROPERTIES];
typedef struct _Block50Data Block50Data;

#define CODE_TYPE_POPOVER_MENU_ITEM (code_popover_menu_item_get_type ())
#define CODE_POPOVER_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CODE_TYPE_POPOVER_MENU_ITEM, CodePopoverMenuItem))
#define CODE_POPOVER_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CODE_TYPE_POPOVER_MENU_ITEM, CodePopoverMenuItemClass))
#define CODE_IS_POPOVER_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CODE_TYPE_POPOVER_MENU_ITEM))
#define CODE_IS_POPOVER_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CODE_TYPE_POPOVER_MENU_ITEM))
#define CODE_POPOVER_MENU_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CODE_TYPE_POPOVER_MENU_ITEM, CodePopoverMenuItemClass))

typedef struct _CodePopoverMenuItem CodePopoverMenuItem;
typedef struct _CodePopoverMenuItemClass CodePopoverMenuItemClass;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
enum  {
	CODE_CHOOSE_PROJECT_BUTTON_PROJECT_CHOSEN_SIGNAL,
	CODE_CHOOSE_PROJECT_BUTTON_NUM_SIGNALS
};
static guint code_choose_project_button_signals[CODE_CHOOSE_PROJECT_BUTTON_NUM_SIGNALS] = {0};

struct _CodeChooseProjectButton {
	GtkMenuButton parent_instance;
	CodeChooseProjectButtonPrivate * priv;
};

struct _CodeChooseProjectButtonClass {
	GtkMenuButtonClass parent_class;
};

struct _CodeChooseProjectButtonPrivate {
	gboolean _cloning_in_progress;
	GtkLabel* label_widget;
	GtkListBox* project_listbox;
	GActionGroup* _toplevel_action_group;
};

struct _CodeChooseProjectButtonProjectRow {
	GtkListBoxRow parent_instance;
	CodeChooseProjectButtonProjectRowPrivate * priv;
};

struct _CodeChooseProjectButtonProjectRowClass {
	GtkListBoxRowClass parent_class;
};

struct _CodeChooseProjectButtonProjectRowPrivate {
	GtkCheckButton* check_button;
	gchar* _project_path;
};

struct _Block50Data {
	int _ref_count_;
	CodeChooseProjectButton* self;
	GtkSearchEntry* project_filter;
};

static gint CodeChooseProjectButton_private_offset;
static gpointer code_choose_project_button_parent_class = NULL;
static gint CodeChooseProjectButtonProjectRow_private_offset;
static gpointer code_choose_project_button_project_row_parent_class = NULL;

VALA_EXTERN GType code_choose_project_button_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CodeChooseProjectButton, g_object_unref)
static void code_choose_project_button_update_button (CodeChooseProjectButton* self);
VALA_EXTERN GType scratch_services_git_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ScratchServicesGitManager, g_object_unref)
VALA_EXTERN ScratchServicesGitManager* scratch_services_git_manager_get_instance (void);
VALA_EXTERN const gchar* scratch_services_git_manager_get_active_project_path (ScratchServicesGitManager* self);
VALA_EXTERN gchar* scratch_utils_replace_home_with_tilde (const gchar* path);
VALA_EXTERN GType code_widgets_source_list_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CodeWidgetsSourceListItem, g_object_unref)
VALA_EXTERN GType code_widgets_source_list_expandable_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CodeWidgetsSourceListExpandableItem, g_object_unref)
VALA_EXTERN GType scratch_folder_manager_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ScratchFolderManagerItem, g_object_unref)
VALA_EXTERN GType scratch_folder_manager_folder_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ScratchFolderManagerFolderItem, g_object_unref)
VALA_EXTERN GType scratch_folder_manager_project_folder_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ScratchFolderManagerProjectFolderItem, g_object_unref)
static GtkWidget* code_choose_project_button_create_project_row (CodeChooseProjectButton* self,
                                                          ScratchFolderManagerProjectFolderItem* project_folder);
VALA_EXTERN GType scratch_folder_manager_file_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ScratchFolderManagerFile, g_object_unref)
VALA_EXTERN ScratchFolderManagerFile* scratch_folder_manager_item_get_file (ScratchFolderManagerItem* self);
VALA_EXTERN GFile* scratch_folder_manager_file_get_file (ScratchFolderManagerFile* self);
VALA_EXTERN GType code_choose_project_button_project_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CodeChooseProjectButtonProjectRow, g_object_unref)
VALA_EXTERN CodeChooseProjectButtonProjectRow* code_choose_project_button_project_row_new (const gchar* project_path);
VALA_EXTERN CodeChooseProjectButtonProjectRow* code_choose_project_button_project_row_construct (GType object_type,
                                                                                     const gchar* project_path);
VALA_EXTERN CodeChooseProjectButton* code_choose_project_button_new (void);
VALA_EXTERN CodeChooseProjectButton* code_choose_project_button_construct (GType object_type);
VALA_EXTERN gboolean code_choose_project_button_get_cloning_in_progress (CodeChooseProjectButton* self);
VALA_EXTERN void code_choose_project_button_set_cloning_in_progress (CodeChooseProjectButton* self,
                                                         gboolean value);
VALA_EXTERN GActionGroup* code_choose_project_button_get_toplevel_action_group (CodeChooseProjectButton* self);
static void code_choose_project_button_set_toplevel_action_group (CodeChooseProjectButton* self,
                                                           GActionGroup* value);
VALA_EXTERN gboolean code_choose_project_button_project_row_get_active (CodeChooseProjectButtonProjectRow* self);
VALA_EXTERN void code_choose_project_button_project_row_set_active (CodeChooseProjectButtonProjectRow* self,
                                                        gboolean value);
VALA_EXTERN const gchar* code_choose_project_button_project_row_get_project_path (CodeChooseProjectButtonProjectRow* self);
static void code_choose_project_button_project_row_set_project_path (CodeChooseProjectButtonProjectRow* self,
                                                              const gchar* value);
VALA_EXTERN const gchar* code_choose_project_button_project_row_get_project_name (CodeChooseProjectButtonProjectRow* self);
static GObject * code_choose_project_button_project_row_constructor (GType type,
                                                              guint n_construct_properties,
                                                              GObjectConstructParam * construct_properties);
static gboolean _code_choose_project_button_project_row___lambda159_ (CodeChooseProjectButtonProjectRow* self);
static gboolean __code_choose_project_button_project_row___lambda159__gtk_widget_button_release_event (GtkWidget* _sender,
                                                                                                GdkEventButton* event,
                                                                                                gpointer self);
static void code_choose_project_button_project_row_finalize (GObject * obj);
static GType code_choose_project_button_project_row_get_type_once (void);
static void _vala_code_choose_project_button_project_row_get_property (GObject * object,
                                                                guint property_id,
                                                                GValue * value,
                                                                GParamSpec * pspec);
static void _vala_code_choose_project_button_project_row_set_property (GObject * object,
                                                                guint property_id,
                                                                const GValue * value,
                                                                GParamSpec * pspec);
static GObject * code_choose_project_button_constructor (GType type,
                                                  guint n_construct_properties,
                                                  GObjectConstructParam * construct_properties);
static Block50Data* block50_data_ref (Block50Data* _data50_);
static void block50_data_unref (void * _userdata_);
static void _code_choose_project_button___lambda160_ (CodeChooseProjectButton* self);
static void __code_choose_project_button___lambda160__gtk_widget_realize (GtkWidget* _sender,
                                                                   gpointer self);
static gboolean _code_choose_project_button___lambda161_ (Block50Data* _data50_,
                                                   GtkListBoxRow* row);
static gboolean __code_choose_project_button___lambda161__gtk_list_box_filter_func (GtkListBoxRow* row,
                                                                             gpointer self);
static void _code_choose_project_button___lambda162_ (CodeChooseProjectButton* self);
static void __code_choose_project_button___lambda162__gtk_editable_changed (GtkEditable* _sender,
                                                                     gpointer self);
VALA_EXTERN GType code_popover_menu_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CodePopoverMenuItem, g_object_unref)
VALA_EXTERN CodePopoverMenuItem* code_popover_menu_item_new (const gchar* text);
VALA_EXTERN CodePopoverMenuItem* code_popover_menu_item_construct (GType object_type,
                                                       const gchar* text);
VALA_EXTERN void code_popover_menu_item_set_icon_name (CodePopoverMenuItem* self,
                                           const gchar* value);
VALA_EXTERN GListStore* scratch_services_git_manager_get_project_liststore (ScratchServicesGitManager* self);
static void _code_choose_project_button___lambda164_ (CodeChooseProjectButton* self,
                                               GListModel* src,
                                               guint pos,
                                               guint n_removed,
                                               guint n_added);
static void __code_choose_project_button___lambda164__g_list_model_items_changed (GListModel* _sender,
                                                                           guint position,
                                                                           guint removed,
                                                                           guint added,
                                                                           gpointer self);
static void _code_choose_project_button___lambda165_ (CodeChooseProjectButton* self,
                                               GtkWidget* row);
VALA_EXTERN void scratch_services_git_manager_set_active_project_path (ScratchServicesGitManager* self,
                                                           const gchar* value);
static void __code_choose_project_button___lambda165__gtk_container_remove (GtkContainer* _sender,
                                                                     GtkWidget* widget,
                                                                     gpointer self);
static void _code_choose_project_button___lambda166_ (CodeChooseProjectButton* self,
                                               GtkListBoxRow* row);
static void __code_choose_project_button___lambda166__gtk_list_box_row_activated (GtkListBox* _sender,
                                                                           GtkListBoxRow* row,
                                                                           gpointer self);
static void _code_choose_project_button___lambda167_ (CodeChooseProjectButton* self);
static void __code_choose_project_button___lambda167__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                          gpointer self);
static void _code_choose_project_button_update_button_g_object_notify (GObject* _sender,
                                                                GParamSpec* pspec,
                                                                gpointer self);
static void code_choose_project_button_finalize (GObject * obj);
static GType code_choose_project_button_get_type_once (void);
static void _vala_code_choose_project_button_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec);
static void _vala_code_choose_project_button_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec);

static inline gpointer
code_choose_project_button_get_instance_private (CodeChooseProjectButton* self)
{
	return G_STRUCT_MEMBER_P (self, CodeChooseProjectButton_private_offset);
}

static void
code_choose_project_button_update_button (CodeChooseProjectButton* self)
{
	const gchar* active_path = NULL;
	ScratchServicesGitManager* _tmp0_;
	ScratchServicesGitManager* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = scratch_services_git_manager_get_instance ();
	_tmp1_ = _tmp0_;
	_tmp2_ = scratch_services_git_manager_get_active_project_path (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _tmp3_;
	_g_object_unref0 (_tmp1_);
	active_path = _tmp4_;
	_tmp5_ = active_path;
	if (g_strcmp0 (_tmp5_, "") != 0) {
		GtkLabel* _tmp6_;
		const gchar* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		const gchar* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		gchar* _tmp13_;
		gchar* _tmp14_;
		_tmp6_ = self->priv->label_widget;
		_tmp7_ = active_path;
		_tmp8_ = g_path_get_basename (_tmp7_);
		_tmp9_ = _tmp8_;
		gtk_label_set_label (_tmp6_, _tmp9_);
		_g_free0 (_tmp9_);
		_tmp10_ = active_path;
		_tmp11_ = scratch_utils_replace_home_with_tilde (_tmp10_);
		_tmp12_ = _tmp11_;
		_tmp13_ = g_strdup_printf (_ (CODE_CHOOSE_PROJECT_BUTTON_PROJECT_TOOLTIP), _tmp12_);
		_tmp14_ = _tmp13_;
		gtk_widget_set_tooltip_text ((GtkWidget*) self, _tmp14_);
		_g_free0 (_tmp14_);
		_g_free0 (_tmp12_);
	} else {
		GtkLabel* _tmp15_;
		gchar* _tmp16_;
		gchar* _tmp17_;
		gchar* _tmp18_;
		gchar* _tmp19_;
		_tmp15_ = self->priv->label_widget;
		_tmp16_ = g_path_get_basename (_ (CODE_CHOOSE_PROJECT_BUTTON_NO_PROJECT_SELECTED));
		_tmp17_ = _tmp16_;
		gtk_label_set_label (_tmp15_, _tmp17_);
		_g_free0 (_tmp17_);
		_tmp18_ = g_strdup_printf (_ (CODE_CHOOSE_PROJECT_BUTTON_PROJECT_TOOLTIP), _ (CODE_CHOOSE_PROJECT_BUTTON_NO_PROJECT_SELECTED));
		_tmp19_ = _tmp18_;
		gtk_widget_set_tooltip_text ((GtkWidget*) self, _tmp19_);
		_g_free0 (_tmp19_);
	}
}

static GtkWidget*
code_choose_project_button_create_project_row (CodeChooseProjectButton* self,
                                               ScratchFolderManagerProjectFolderItem* project_folder)
{
	gchar* project_path = NULL;
	ScratchFolderManagerFile* _tmp0_;
	ScratchFolderManagerFile* _tmp1_;
	GFile* _tmp2_;
	GFile* _tmp3_;
	gchar* _tmp4_;
	CodeChooseProjectButtonProjectRow* project_row = NULL;
	CodeChooseProjectButtonProjectRow* _tmp5_;
	GtkWidget* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (project_folder != NULL, NULL);
	_tmp0_ = scratch_folder_manager_item_get_file ((ScratchFolderManagerItem*) project_folder);
	_tmp1_ = _tmp0_;
	_tmp2_ = scratch_folder_manager_file_get_file (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_file_get_path (_tmp3_);
	project_path = _tmp4_;
	_tmp5_ = code_choose_project_button_project_row_new (project_path);
	g_object_ref_sink (_tmp5_);
	project_row = _tmp5_;
	result = (GtkWidget*) project_row;
	_g_free0 (project_path);
	return result;
}

CodeChooseProjectButton*
code_choose_project_button_construct (GType object_type)
{
	CodeChooseProjectButton * self = NULL;
	self = (CodeChooseProjectButton*) g_object_new (object_type, NULL);
	return self;
}

CodeChooseProjectButton*
code_choose_project_button_new (void)
{
	return code_choose_project_button_construct (CODE_TYPE_CHOOSE_PROJECT_BUTTON);
}

gboolean
code_choose_project_button_get_cloning_in_progress (CodeChooseProjectButton* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_cloning_in_progress;
	return result;
}

void
code_choose_project_button_set_cloning_in_progress (CodeChooseProjectButton* self,
                                                    gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = code_choose_project_button_get_cloning_in_progress (self);
	if (old_value != value) {
		self->priv->_cloning_in_progress = value;
		g_object_notify_by_pspec ((GObject *) self, code_choose_project_button_properties[CODE_CHOOSE_PROJECT_BUTTON_CLONING_IN_PROGRESS_PROPERTY]);
	}
}

GActionGroup*
code_choose_project_button_get_toplevel_action_group (CodeChooseProjectButton* self)
{
	GActionGroup* result;
	GActionGroup* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_toplevel_action_group;
	result = _tmp0_;
	return result;
}

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

static void
code_choose_project_button_set_toplevel_action_group (CodeChooseProjectButton* self,
                                                      GActionGroup* value)
{
	GActionGroup* old_value;
	g_return_if_fail (self != NULL);
	old_value = code_choose_project_button_get_toplevel_action_group (self);
	if (old_value != value) {
		GActionGroup* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_toplevel_action_group);
		self->priv->_toplevel_action_group = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, code_choose_project_button_properties[CODE_CHOOSE_PROJECT_BUTTON_TOPLEVEL_ACTION_GROUP_PROPERTY]);
	}
}

static inline gpointer
code_choose_project_button_project_row_get_instance_private (CodeChooseProjectButtonProjectRow* self)
{
	return G_STRUCT_MEMBER_P (self, CodeChooseProjectButtonProjectRow_private_offset);
}

CodeChooseProjectButtonProjectRow*
code_choose_project_button_project_row_construct (GType object_type,
                                                  const gchar* project_path)
{
	CodeChooseProjectButtonProjectRow * self = NULL;
	g_return_val_if_fail (project_path != NULL, NULL);
	self = (CodeChooseProjectButtonProjectRow*) g_object_new (object_type, "project-path", project_path, NULL);
	return self;
}

CodeChooseProjectButtonProjectRow*
code_choose_project_button_project_row_new (const gchar* project_path)
{
	return code_choose_project_button_project_row_construct (CODE_CHOOSE_PROJECT_BUTTON_TYPE_PROJECT_ROW, project_path);
}

gboolean
code_choose_project_button_project_row_get_active (CodeChooseProjectButtonProjectRow* self)
{
	gboolean result;
	GtkCheckButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->check_button;
	_tmp1_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
code_choose_project_button_project_row_set_active (CodeChooseProjectButtonProjectRow* self,
                                                   gboolean value)
{
	GtkCheckButton* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->check_button;
	gtk_toggle_button_set_active ((GtkToggleButton*) _tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, code_choose_project_button_project_row_properties[CODE_CHOOSE_PROJECT_BUTTON_PROJECT_ROW_ACTIVE_PROPERTY]);
}

const gchar*
code_choose_project_button_project_row_get_project_path (CodeChooseProjectButtonProjectRow* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_project_path;
	result = _tmp0_;
	return result;
}

static void
code_choose_project_button_project_row_set_project_path (CodeChooseProjectButtonProjectRow* self,
                                                         const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = code_choose_project_button_project_row_get_project_path (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_project_path);
		self->priv->_project_path = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, code_choose_project_button_project_row_properties[CODE_CHOOSE_PROJECT_BUTTON_PROJECT_ROW_PROJECT_PATH_PROPERTY]);
	}
}

const gchar*
code_choose_project_button_project_row_get_project_name (CodeChooseProjectButtonProjectRow* self)
{
	const gchar* result;
	GtkCheckButton* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->check_button;
	_tmp1_ = gtk_button_get_label ((GtkButton*) _tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

static gboolean
_code_choose_project_button_project_row___lambda159_ (CodeChooseProjectButtonProjectRow* self)
{
	gboolean result;
	g_signal_emit_by_name ((GtkListBoxRow*) self, "activate");
	result = GDK_EVENT_PROPAGATE;
	return result;
}

static gboolean
__code_choose_project_button_project_row___lambda159__gtk_widget_button_release_event (GtkWidget* _sender,
                                                                                       GdkEventButton* event,
                                                                                       gpointer self)
{
	gboolean result;
	result = _code_choose_project_button_project_row___lambda159_ ((CodeChooseProjectButtonProjectRow*) self);
	return result;
}

static GObject *
code_choose_project_button_project_row_constructor (GType type,
                                                    guint n_construct_properties,
                                                    GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	CodeChooseProjectButtonProjectRow * self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	GtkCheckButton* _tmp3_;
	GtkCheckButton* _tmp4_;
	GtkCheckButton* _tmp5_;
	parent_class = G_OBJECT_CLASS (code_choose_project_button_project_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CODE_CHOOSE_PROJECT_BUTTON_TYPE_PROJECT_ROW, CodeChooseProjectButtonProjectRow);
	_tmp0_ = self->priv->_project_path;
	_tmp1_ = g_path_get_basename (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = (GtkCheckButton*) gtk_check_button_new_with_label (_tmp2_);
	g_object_ref_sink (_tmp3_);
	_g_object_unref0 (self->priv->check_button);
	self->priv->check_button = _tmp3_;
	_g_free0 (_tmp2_);
	_tmp4_ = self->priv->check_button;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp4_);
	_tmp5_ = self->priv->check_button;
	g_signal_connect_object ((GtkWidget*) _tmp5_, "button-release-event", (GCallback) __code_choose_project_button_project_row___lambda159__gtk_widget_button_release_event, self, 0);
	gtk_widget_show_all ((GtkWidget*) self);
	return obj;
}

static void
code_choose_project_button_project_row_base_init (CodeChooseProjectButtonProjectRowClass * klass)
{
	gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (klass), GTK_STYLE_CLASS_MENUITEM);
}

static void
code_choose_project_button_project_row_class_init (CodeChooseProjectButtonProjectRowClass * klass,
                                                   gpointer klass_data)
{
	code_choose_project_button_project_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &CodeChooseProjectButtonProjectRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_code_choose_project_button_project_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_code_choose_project_button_project_row_set_property;
	G_OBJECT_CLASS (klass)->constructor = code_choose_project_button_project_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = code_choose_project_button_project_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_CHOOSE_PROJECT_BUTTON_PROJECT_ROW_ACTIVE_PROPERTY, code_choose_project_button_project_row_properties[CODE_CHOOSE_PROJECT_BUTTON_PROJECT_ROW_ACTIVE_PROPERTY] = g_param_spec_boolean ("active", "active", "active", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_CHOOSE_PROJECT_BUTTON_PROJECT_ROW_PROJECT_PATH_PROPERTY, code_choose_project_button_project_row_properties[CODE_CHOOSE_PROJECT_BUTTON_PROJECT_ROW_PROJECT_PATH_PROPERTY] = g_param_spec_string ("project-path", "project-path", "project-path", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_CHOOSE_PROJECT_BUTTON_PROJECT_ROW_PROJECT_NAME_PROPERTY, code_choose_project_button_project_row_properties[CODE_CHOOSE_PROJECT_BUTTON_PROJECT_ROW_PROJECT_NAME_PROPERTY] = g_param_spec_string ("project-name", "project-name", "project-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
code_choose_project_button_project_row_instance_init (CodeChooseProjectButtonProjectRow * self,
                                                      gpointer klass)
{
	self->priv = code_choose_project_button_project_row_get_instance_private (self);
}

static void
code_choose_project_button_project_row_finalize (GObject * obj)
{
	CodeChooseProjectButtonProjectRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CODE_CHOOSE_PROJECT_BUTTON_TYPE_PROJECT_ROW, CodeChooseProjectButtonProjectRow);
	_g_object_unref0 (self->priv->check_button);
	_g_free0 (self->priv->_project_path);
	G_OBJECT_CLASS (code_choose_project_button_project_row_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
code_choose_project_button_project_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (CodeChooseProjectButtonProjectRowClass), (GBaseInitFunc) code_choose_project_button_project_row_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) code_choose_project_button_project_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CodeChooseProjectButtonProjectRow), 0, (GInstanceInitFunc) code_choose_project_button_project_row_instance_init, NULL };
	GType code_choose_project_button_project_row_type_id;
	code_choose_project_button_project_row_type_id = g_type_register_static (gtk_list_box_row_get_type (), "CodeChooseProjectButtonProjectRow", &g_define_type_info, G_TYPE_FLAG_NONE);
	CodeChooseProjectButtonProjectRow_private_offset = g_type_add_instance_private (code_choose_project_button_project_row_type_id, sizeof (CodeChooseProjectButtonProjectRowPrivate));
	return code_choose_project_button_project_row_type_id;
}

GType
code_choose_project_button_project_row_get_type (void)
{
	static gsize code_choose_project_button_project_row_type_id__once = 0;
	if (g_once_init_enter (&code_choose_project_button_project_row_type_id__once)) {
		GType code_choose_project_button_project_row_type_id;
		code_choose_project_button_project_row_type_id = code_choose_project_button_project_row_get_type_once ();
		g_once_init_leave (&code_choose_project_button_project_row_type_id__once, code_choose_project_button_project_row_type_id);
	}
	return code_choose_project_button_project_row_type_id__once;
}

static void
_vala_code_choose_project_button_project_row_get_property (GObject * object,
                                                           guint property_id,
                                                           GValue * value,
                                                           GParamSpec * pspec)
{
	CodeChooseProjectButtonProjectRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CODE_CHOOSE_PROJECT_BUTTON_TYPE_PROJECT_ROW, CodeChooseProjectButtonProjectRow);
	switch (property_id) {
		case CODE_CHOOSE_PROJECT_BUTTON_PROJECT_ROW_ACTIVE_PROPERTY:
		g_value_set_boolean (value, code_choose_project_button_project_row_get_active (self));
		break;
		case CODE_CHOOSE_PROJECT_BUTTON_PROJECT_ROW_PROJECT_PATH_PROPERTY:
		g_value_set_string (value, code_choose_project_button_project_row_get_project_path (self));
		break;
		case CODE_CHOOSE_PROJECT_BUTTON_PROJECT_ROW_PROJECT_NAME_PROPERTY:
		g_value_set_string (value, code_choose_project_button_project_row_get_project_name (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_code_choose_project_button_project_row_set_property (GObject * object,
                                                           guint property_id,
                                                           const GValue * value,
                                                           GParamSpec * pspec)
{
	CodeChooseProjectButtonProjectRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CODE_CHOOSE_PROJECT_BUTTON_TYPE_PROJECT_ROW, CodeChooseProjectButtonProjectRow);
	switch (property_id) {
		case CODE_CHOOSE_PROJECT_BUTTON_PROJECT_ROW_ACTIVE_PROPERTY:
		code_choose_project_button_project_row_set_active (self, g_value_get_boolean (value));
		break;
		case CODE_CHOOSE_PROJECT_BUTTON_PROJECT_ROW_PROJECT_PATH_PROPERTY:
		code_choose_project_button_project_row_set_project_path (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static Block50Data*
block50_data_ref (Block50Data* _data50_)
{
	g_atomic_int_inc (&_data50_->_ref_count_);
	return _data50_;
}

static void
block50_data_unref (void * _userdata_)
{
	Block50Data* _data50_;
	_data50_ = (Block50Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data50_->_ref_count_)) {
		CodeChooseProjectButton* self;
		self = _data50_->self;
		_g_object_unref0 (_data50_->project_filter);
		_g_object_unref0 (self);
		g_slice_free (Block50Data, _data50_);
	}
}

static void
_code_choose_project_button___lambda160_ (CodeChooseProjectButton* self)
{
	GActionGroup* _tmp0_;
	GActionGroup* _tmp1_;
	_tmp0_ = gtk_widget_get_action_group ((GtkWidget*) self, SCRATCH_MAIN_WINDOW_ACTION_GROUP);
	code_choose_project_button_set_toplevel_action_group (self, _tmp0_);
	_tmp1_ = self->priv->_toplevel_action_group;
	g_assert_nonnull (_tmp1_);
}

static void
__code_choose_project_button___lambda160__gtk_widget_realize (GtkWidget* _sender,
                                                              gpointer self)
{
	_code_choose_project_button___lambda160_ ((CodeChooseProjectButton*) self);
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

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 gboolean
_code_choose_project_button___lambda161_ (Block50Data* _data50_,
                                          GtkListBoxRow* row)
{
	CodeChooseProjectButton* self;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	GtkSearchEntry* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gboolean _tmp11_;
	gboolean result;
	self = _data50_->self;
	g_return_val_if_fail (row != NULL, FALSE);
	_tmp0_ = code_choose_project_button_project_row_get_project_name (G_TYPE_CHECK_INSTANCE_CAST (row, CODE_CHOOSE_PROJECT_BUTTON_TYPE_PROJECT_ROW, CodeChooseProjectButtonProjectRow));
	_tmp1_ = _tmp0_;
	_tmp2_ = g_utf8_strdown (_tmp1_, (gssize) -1);
	_tmp3_ = _tmp2_;
	_tmp4_ = _data50_->project_filter;
	_tmp5_ = gtk_entry_get_text ((GtkEntry*) _tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = g_utf8_strdown (_tmp6_, (gssize) -1);
	_tmp8_ = _tmp7_;
	_tmp9_ = string_strip (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = string_contains (_tmp3_, _tmp10_);
	_g_free0 (_tmp10_);
	_g_free0 (_tmp8_);
	_g_free0 (_tmp3_);
	result = _tmp11_;
	return result;
}

static gboolean
__code_choose_project_button___lambda161__gtk_list_box_filter_func (GtkListBoxRow* row,
                                                                    gpointer self)
{
	gboolean result;
	result = _code_choose_project_button___lambda161_ (self, row);
	return result;
}

static void
_code_choose_project_button___lambda162_ (CodeChooseProjectButton* self)
{
	GtkListBox* _tmp0_;
	_tmp0_ = self->priv->project_listbox;
	gtk_list_box_invalidate_filter (_tmp0_);
}

static void
__code_choose_project_button___lambda162__gtk_editable_changed (GtkEditable* _sender,
                                                                gpointer self)
{
	_code_choose_project_button___lambda162_ ((CodeChooseProjectButton*) self);
}

static void
_code_choose_project_button___lambda164_ (CodeChooseProjectButton* self,
                                          GListModel* src,
                                          guint pos,
                                          guint n_removed,
                                          guint n_added)
{
	GList* rows = NULL;
	GtkListBox* _tmp0_;
	GList* _tmp1_;
	g_return_if_fail (src != NULL);
	_tmp0_ = self->priv->project_listbox;
	_tmp1_ = gtk_container_get_children ((GtkContainer*) _tmp0_);
	rows = _tmp1_;
	{
		gint index = 0;
		index = (gint) pos;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				GtkWidget* row = NULL;
				GList* _tmp4_;
				gconstpointer _tmp5_;
				GtkWidget* _tmp6_;
				GtkWidget* _tmp7_;
				if (!_tmp2_) {
					gint _tmp3_;
					_tmp3_ = index;
					index = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				if (!(((guint) index) < (pos + n_removed))) {
					break;
				}
				_tmp4_ = rows;
				_tmp5_ = g_list_nth_data (_tmp4_, (guint) index);
				_tmp6_ = _g_object_ref0 ((GtkWidget*) _tmp5_);
				row = _tmp6_;
				_tmp7_ = row;
				gtk_widget_destroy (_tmp7_);
				_g_object_unref0 (row);
			}
		}
	}
	{
		gint index = 0;
		index = (gint) pos;
		{
			gboolean _tmp8_ = FALSE;
			_tmp8_ = TRUE;
			while (TRUE) {
				GObject* item = NULL;
				GObject* _tmp10_;
				GObject* _tmp11_;
				if (!_tmp8_) {
					gint _tmp9_;
					_tmp9_ = index;
					index = _tmp9_ + 1;
				}
				_tmp8_ = FALSE;
				if (!(((guint) index) < (pos + n_added))) {
					break;
				}
				_tmp10_ = g_list_model_get_object (src, (guint) index);
				item = _tmp10_;
				_tmp11_ = item;
				if (SCRATCH_FOLDER_MANAGER_IS_PROJECT_FOLDER_ITEM (_tmp11_)) {
					GtkWidget* row = NULL;
					GObject* _tmp12_;
					GtkWidget* _tmp13_;
					GtkListBox* _tmp14_;
					GtkWidget* _tmp15_;
					_tmp12_ = item;
					_tmp13_ = code_choose_project_button_create_project_row (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, SCRATCH_FOLDER_MANAGER_TYPE_PROJECT_FOLDER_ITEM, ScratchFolderManagerProjectFolderItem));
					row = _tmp13_;
					_tmp14_ = self->priv->project_listbox;
					_tmp15_ = row;
					gtk_list_box_insert (_tmp14_, _tmp15_, index);
					_g_object_unref0 (row);
				}
				_g_object_unref0 (item);
			}
		}
	}
	(rows == NULL) ? NULL : (rows = (g_list_free (rows), NULL));
}

static void
__code_choose_project_button___lambda164__g_list_model_items_changed (GListModel* _sender,
                                                                      guint position,
                                                                      guint removed,
                                                                      guint added,
                                                                      gpointer self)
{
	_code_choose_project_button___lambda164_ ((CodeChooseProjectButton*) self, _sender, position, removed, added);
}

static void
_code_choose_project_button___lambda165_ (CodeChooseProjectButton* self,
                                          GtkWidget* row)
{
	CodeChooseProjectButtonProjectRow* project_row = NULL;
	CodeChooseProjectButtonProjectRow* _tmp0_;
	gchar* current_project = NULL;
	ScratchServicesGitManager* _tmp1_;
	ScratchServicesGitManager* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	CodeChooseProjectButtonProjectRow* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	g_return_if_fail (row != NULL);
	_tmp0_ = _g_object_ref0 (CODE_CHOOSE_PROJECT_BUTTON_IS_PROJECT_ROW (row) ? ((CodeChooseProjectButtonProjectRow*) row) : NULL);
	project_row = _tmp0_;
	_tmp1_ = scratch_services_git_manager_get_instance ();
	_tmp2_ = _tmp1_;
	_tmp3_ = scratch_services_git_manager_get_active_project_path (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_strdup (_tmp4_);
	_tmp6_ = _tmp5_;
	_g_object_unref0 (_tmp2_);
	current_project = _tmp6_;
	_tmp7_ = project_row;
	_tmp8_ = code_choose_project_button_project_row_get_project_path (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = current_project;
	if (g_strcmp0 (_tmp9_, _tmp10_) == 0) {
		ScratchServicesGitManager* _tmp11_;
		ScratchServicesGitManager* _tmp12_;
		_tmp11_ = scratch_services_git_manager_get_instance ();
		_tmp12_ = _tmp11_;
		scratch_services_git_manager_set_active_project_path (_tmp12_, "");
		_g_object_unref0 (_tmp12_);
	}
	_g_free0 (current_project);
	_g_object_unref0 (project_row);
}

static void
__code_choose_project_button___lambda165__gtk_container_remove (GtkContainer* _sender,
                                                                GtkWidget* widget,
                                                                gpointer self)
{
	_code_choose_project_button___lambda165_ ((CodeChooseProjectButton*) self, widget);
}

static void
_code_choose_project_button___lambda166_ (CodeChooseProjectButton* self,
                                          GtkListBoxRow* row)
{
	CodeChooseProjectButtonProjectRow* project_entry = NULL;
	CodeChooseProjectButtonProjectRow* _tmp0_;
	GActionGroup* _tmp1_;
	CodeChooseProjectButtonProjectRow* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	GVariant* _tmp5_;
	GVariant* _tmp6_;
	g_return_if_fail (row != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (row, CODE_CHOOSE_PROJECT_BUTTON_TYPE_PROJECT_ROW, CodeChooseProjectButtonProjectRow));
	project_entry = _tmp0_;
	_tmp1_ = self->priv->_toplevel_action_group;
	_tmp2_ = project_entry;
	_tmp3_ = code_choose_project_button_project_row_get_project_path (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_variant_new_string (_tmp4_);
	g_variant_ref_sink (_tmp5_);
	_tmp6_ = _tmp5_;
	g_action_group_activate_action (_tmp1_, SCRATCH_MAIN_WINDOW_ACTION_SET_ACTIVE_PROJECT, _tmp6_);
	_g_variant_unref0 (_tmp6_);
	_g_object_unref0 (project_entry);
}

static void
__code_choose_project_button___lambda166__gtk_list_box_row_activated (GtkListBox* _sender,
                                                                      GtkListBoxRow* row,
                                                                      gpointer self)
{
	_code_choose_project_button___lambda166_ ((CodeChooseProjectButton*) self, row);
}

static void
_code_choose_project_button___lambda167_ (CodeChooseProjectButton* self)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	_tmp0_ = gtk_toggle_button_get_active ((GtkToggleButton*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		const gchar* active_path = NULL;
		ScratchServicesGitManager* _tmp2_;
		ScratchServicesGitManager* _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		GtkListBox* _tmp7_;
		GList* _tmp8_;
		_tmp2_ = scratch_services_git_manager_get_instance ();
		_tmp3_ = _tmp2_;
		_tmp4_ = scratch_services_git_manager_get_active_project_path (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp3_);
		active_path = _tmp6_;
		_tmp7_ = self->priv->project_listbox;
		_tmp8_ = gtk_container_get_children ((GtkContainer*) _tmp7_);
		{
			GList* child_collection = NULL;
			GList* child_it = NULL;
			child_collection = _tmp8_;
			for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
				GtkWidget* child = NULL;
				child = (GtkWidget*) child_it->data;
				{
					CodeChooseProjectButtonProjectRow* project_row = NULL;
					GtkWidget* _tmp9_;
					CodeChooseProjectButtonProjectRow* _tmp10_;
					CodeChooseProjectButtonProjectRow* _tmp11_;
					const gchar* _tmp12_;
					CodeChooseProjectButtonProjectRow* _tmp13_;
					const gchar* _tmp14_;
					const gchar* _tmp15_;
					_tmp9_ = child;
					_tmp10_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, CODE_CHOOSE_PROJECT_BUTTON_TYPE_PROJECT_ROW, CodeChooseProjectButtonProjectRow));
					project_row = _tmp10_;
					_tmp11_ = project_row;
					_tmp12_ = active_path;
					_tmp13_ = project_row;
					_tmp14_ = code_choose_project_button_project_row_get_project_path (_tmp13_);
					_tmp15_ = _tmp14_;
					code_choose_project_button_project_row_set_active (_tmp11_, g_strcmp0 (_tmp12_, _tmp15_) == 0);
					_g_object_unref0 (project_row);
				}
			}
			(child_collection == NULL) ? NULL : (child_collection = (g_list_free (child_collection), NULL));
		}
	}
}

static void
__code_choose_project_button___lambda167__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                     gpointer self)
{
	_code_choose_project_button___lambda167_ ((CodeChooseProjectButton*) self);
}

static void
_code_choose_project_button_update_button_g_object_notify (GObject* _sender,
                                                           GParamSpec* pspec,
                                                           gpointer self)
{
	code_choose_project_button_update_button ((CodeChooseProjectButton*) self);
}

static GObject *
code_choose_project_button_constructor (GType type,
                                        guint n_construct_properties,
                                        GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	CodeChooseProjectButton * self;
	Block50Data* _data50_;
	GtkImage* img = NULL;
	GThemedIcon* _tmp0_;
	GtkImage* _tmp1_ = NULL;
	GtkLabel* _tmp2_ = NULL;
	GtkSpinner* cloning_spinner = NULL;
	GtkSpinner* _tmp3_ = NULL;
	GtkSpinner* _tmp4_;
	GtkBox* box = NULL;
	GtkBox* _tmp5_ = NULL;
	GtkBox* _tmp6_;
	GtkImage* _tmp7_;
	GtkBox* _tmp8_;
	GtkLabel* _tmp9_;
	GtkBox* _tmp10_;
	GtkSpinner* _tmp11_;
	GtkBox* _tmp12_;
	GtkListBox* _tmp13_ = NULL;
	gchar* _tmp14_;
	GtkSearchEntry* _tmp15_ = NULL;
	GtkListBox* _tmp16_;
	GtkSearchEntry* _tmp17_;
	GtkScrolledWindow* project_scrolled = NULL;
	GtkScrolledWindow* _tmp18_ = NULL;
	GtkScrolledWindow* _tmp19_;
	GtkListBox* _tmp20_;
	CodePopoverMenuItem* add_folder_button = NULL;
	gchar* _tmp21_;
	gchar* _tmp22_;
	CodePopoverMenuItem* _tmp23_ = NULL;
	CodePopoverMenuItem* clone_button = NULL;
	gchar* _tmp24_;
	gchar* _tmp25_;
	CodePopoverMenuItem* _tmp26_ = NULL;
	GtkBox* popover_content = NULL;
	GtkBox* _tmp27_;
	GtkBox* _tmp28_;
	GtkSearchEntry* _tmp29_;
	GtkBox* _tmp30_;
	GtkScrolledWindow* _tmp31_;
	GtkBox* _tmp32_;
	GtkSeparator* _tmp33_;
	GtkSeparator* _tmp34_;
	GtkBox* _tmp35_;
	CodePopoverMenuItem* _tmp36_;
	GtkBox* _tmp37_;
	CodePopoverMenuItem* _tmp38_;
	GtkBox* _tmp39_;
	GtkPopover* project_popover = NULL;
	GtkPopover* _tmp40_ = NULL;
	GtkPopover* _tmp41_;
	GtkBox* _tmp42_;
	GtkPopover* _tmp43_;
	ScratchServicesGitManager* git_manager = NULL;
	ScratchServicesGitManager* _tmp44_;
	GListStore* src = NULL;
	ScratchServicesGitManager* _tmp45_;
	GListStore* _tmp46_;
	GListStore* _tmp47_;
	GListStore* _tmp48_;
	ScratchServicesGitManager* _tmp61_;
	GListStore* _tmp62_;
	GListStore* _tmp63_;
	GtkListBox* _tmp64_;
	GtkListBox* _tmp65_;
	ScratchServicesGitManager* _tmp66_;
	parent_class = G_OBJECT_CLASS (code_choose_project_button_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CODE_TYPE_CHOOSE_PROJECT_BUTTON, CodeChooseProjectButton);
	_data50_ = g_slice_new0 (Block50Data);
	_data50_->_ref_count_ = 1;
	_data50_->self = g_object_ref (self);
	g_signal_connect_object ((GtkWidget*) self, "realize", (GCallback) __code_choose_project_button___lambda160__gtk_widget_realize, self, 0);
	_tmp0_ = (GThemedIcon*) g_themed_icon_new ("git-symbolic");
	_tmp1_ = (GtkImage*) gtk_image_new ();
	g_object_set (_tmp1_, "gicon", (GIcon*) _tmp0_, NULL);
	_g_object_unref0 (_tmp0_);
	g_object_set (_tmp1_, "icon-size", (gint) GTK_ICON_SIZE_SMALL_TOOLBAR, NULL);
	g_object_ref_sink (_tmp1_);
	img = _tmp1_;
	_tmp2_ = (GtkLabel*) gtk_label_new (_ (CODE_CHOOSE_PROJECT_BUTTON_NO_PROJECT_SELECTED));
	gtk_label_set_ellipsize (_tmp2_, PANGO_ELLIPSIZE_MIDDLE);
	gtk_label_set_xalign (_tmp2_, 0.0f);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp2_, TRUE);
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->label_widget);
	self->priv->label_widget = _tmp2_;
	_tmp3_ = (GtkSpinner*) gtk_spinner_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp3_, GTK_ALIGN_END);
	g_object_ref_sink (_tmp3_);
	cloning_spinner = _tmp3_;
	_tmp4_ = cloning_spinner;
	g_object_bind_property_with_closures ((GObject*) self, "cloning-in-progress", (GObject*) _tmp4_, "active", G_BINDING_DEFAULT, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp5_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp5_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp5_, FALSE);
	g_object_ref_sink (_tmp5_);
	box = _tmp5_;
	_tmp6_ = box;
	_tmp7_ = img;
	gtk_container_add ((GtkContainer*) _tmp6_, (GtkWidget*) _tmp7_);
	_tmp8_ = box;
	_tmp9_ = self->priv->label_widget;
	gtk_container_add ((GtkContainer*) _tmp8_, (GtkWidget*) _tmp9_);
	_tmp10_ = box;
	_tmp11_ = cloning_spinner;
	gtk_container_add ((GtkContainer*) _tmp10_, (GtkWidget*) _tmp11_);
	_tmp12_ = box;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp12_);
	_tmp13_ = (GtkListBox*) gtk_list_box_new ();
	gtk_list_box_set_selection_mode (_tmp13_, GTK_SELECTION_SINGLE);
	g_object_ref_sink (_tmp13_);
	_g_object_unref0 (self->priv->project_listbox);
	self->priv->project_listbox = _tmp13_;
	_tmp14_ = g_strdup (_ ("Filter projects"));
	_tmp15_ = (GtkSearchEntry*) gtk_search_entry_new ();
	g_object_set ((GtkWidget*) _tmp15_, "margin", 12, NULL);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp15_, 6);
	gtk_entry_set_placeholder_text ((GtkEntry*) _tmp15_, _tmp14_);
	_g_free0 (_tmp14_);
	g_object_ref_sink (_tmp15_);
	_data50_->project_filter = _tmp15_;
	_tmp16_ = self->priv->project_listbox;
	gtk_list_box_set_filter_func (_tmp16_, __code_choose_project_button___lambda161__gtk_list_box_filter_func, block50_data_ref (_data50_), block50_data_unref);
	_tmp17_ = _data50_->project_filter;
	g_signal_connect_object ((GtkEditable*) _tmp17_, "changed", (GCallback) __code_choose_project_button___lambda162__gtk_editable_changed, self, 0);
	_tmp18_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
	g_object_set (_tmp18_, "hscrollbar-policy", GTK_POLICY_NEVER, NULL);
	g_object_set ((GtkWidget*) _tmp18_, "expand", TRUE, NULL);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp18_, 3);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp18_, 3);
	gtk_scrolled_window_set_max_content_height (_tmp18_, 350);
	gtk_scrolled_window_set_propagate_natural_height (_tmp18_, TRUE);
	g_object_ref_sink (_tmp18_);
	project_scrolled = _tmp18_;
	_tmp19_ = project_scrolled;
	_tmp20_ = self->priv->project_listbox;
	gtk_container_add ((GtkContainer*) _tmp19_, (GtkWidget*) _tmp20_);
	_tmp21_ = g_strdup (SCRATCH_MAIN_WINDOW_ACTION_PREFIX SCRATCH_MAIN_WINDOW_ACTION_OPEN_PROJECT);
	_tmp22_ = g_strdup ("folder-open-symbolic");
	_tmp23_ = code_popover_menu_item_new (_ ("Open Folder…"));
	gtk_actionable_set_action_name ((GtkActionable*) _tmp23_, _tmp21_);
	_g_free0 (_tmp21_);
	code_popover_menu_item_set_icon_name (_tmp23_, _tmp22_);
	_g_free0 (_tmp22_);
	g_object_ref_sink (_tmp23_);
	add_folder_button = _tmp23_;
	_tmp24_ = g_strdup (SCRATCH_MAIN_WINDOW_ACTION_PREFIX SCRATCH_MAIN_WINDOW_ACTION_CLONE_REPO);
	_tmp25_ = g_strdup ("git-symbolic");
	_tmp26_ = code_popover_menu_item_new (_ ("Clone Git Repository…"));
	gtk_actionable_set_action_name ((GtkActionable*) _tmp26_, _tmp24_);
	_g_free0 (_tmp24_);
	code_popover_menu_item_set_icon_name (_tmp26_, _tmp25_);
	_g_free0 (_tmp25_);
	g_object_ref_sink (_tmp26_);
	clone_button = _tmp26_;
	_tmp27_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp27_);
	popover_content = _tmp27_;
	_tmp28_ = popover_content;
	_tmp29_ = _data50_->project_filter;
	gtk_container_add ((GtkContainer*) _tmp28_, (GtkWidget*) _tmp29_);
	_tmp30_ = popover_content;
	_tmp31_ = project_scrolled;
	gtk_container_add ((GtkContainer*) _tmp30_, (GtkWidget*) _tmp31_);
	_tmp32_ = popover_content;
	_tmp33_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
	g_object_ref_sink (_tmp33_);
	_tmp34_ = _tmp33_;
	gtk_container_add ((GtkContainer*) _tmp32_, (GtkWidget*) _tmp34_);
	_g_object_unref0 (_tmp34_);
	_tmp35_ = popover_content;
	_tmp36_ = add_folder_button;
	gtk_container_add ((GtkContainer*) _tmp35_, (GtkWidget*) _tmp36_);
	_tmp37_ = popover_content;
	_tmp38_ = clone_button;
	gtk_container_add ((GtkContainer*) _tmp37_, (GtkWidget*) _tmp38_);
	_tmp39_ = popover_content;
	gtk_widget_show_all ((GtkWidget*) _tmp39_);
	_tmp40_ = (GtkPopover*) gtk_popover_new ((GtkWidget*) self);
	gtk_popover_set_position (_tmp40_, GTK_POS_BOTTOM);
	g_object_ref_sink (_tmp40_);
	project_popover = _tmp40_;
	_tmp41_ = project_popover;
	_tmp42_ = popover_content;
	gtk_container_add ((GtkContainer*) _tmp41_, (GtkWidget*) _tmp42_);
	_tmp43_ = project_popover;
	gtk_menu_button_set_popover ((GtkMenuButton*) self, _tmp43_);
	_tmp44_ = scratch_services_git_manager_get_instance ();
	git_manager = _tmp44_;
	_tmp45_ = git_manager;
	_tmp46_ = scratch_services_git_manager_get_project_liststore (_tmp45_);
	_tmp47_ = _tmp46_;
	_tmp48_ = _g_object_ref0 (_tmp47_);
	src = _tmp48_;
	{
		gint index = 0;
		index = 0;
		{
			gboolean _tmp49_ = FALSE;
			_tmp49_ = TRUE;
			while (TRUE) {
				GListStore* _tmp51_;
				guint _tmp52_;
				guint _tmp53_;
				GObject* item = NULL;
				GListStore* _tmp54_;
				GObject* _tmp55_;
				GObject* _tmp56_;
				if (!_tmp49_) {
					gint _tmp50_;
					_tmp50_ = index;
					index = _tmp50_ + 1;
				}
				_tmp49_ = FALSE;
				_tmp51_ = src;
				g_object_get (_tmp51_, "n-items", &_tmp52_, NULL);
				_tmp53_ = _tmp52_;
				if (!(((guint) index) < _tmp53_)) {
					break;
				}
				_tmp54_ = src;
				_tmp55_ = g_list_model_get_object ((GListModel*) _tmp54_, (guint) index);
				item = _tmp55_;
				_tmp56_ = item;
				if (SCRATCH_FOLDER_MANAGER_IS_PROJECT_FOLDER_ITEM (_tmp56_)) {
					GtkWidget* row = NULL;
					GObject* _tmp57_;
					GtkWidget* _tmp58_;
					GtkListBox* _tmp59_;
					GtkWidget* _tmp60_;
					_tmp57_ = item;
					_tmp58_ = code_choose_project_button_create_project_row (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp57_, SCRATCH_FOLDER_MANAGER_TYPE_PROJECT_FOLDER_ITEM, ScratchFolderManagerProjectFolderItem));
					row = _tmp58_;
					_tmp59_ = self->priv->project_listbox;
					_tmp60_ = row;
					gtk_list_box_insert (_tmp59_, _tmp60_, index);
					_g_object_unref0 (row);
				}
				_g_object_unref0 (item);
			}
		}
	}
	_tmp61_ = git_manager;
	_tmp62_ = scratch_services_git_manager_get_project_liststore (_tmp61_);
	_tmp63_ = _tmp62_;
	g_signal_connect_object ((GListModel*) _tmp63_, "items-changed", (GCallback) __code_choose_project_button___lambda164__g_list_model_items_changed, self, 0);
	_tmp64_ = self->priv->project_listbox;
	g_signal_connect_object ((GtkContainer*) _tmp64_, "remove", (GCallback) __code_choose_project_button___lambda165__gtk_container_remove, self, 0);
	_tmp65_ = self->priv->project_listbox;
	g_signal_connect_object (_tmp65_, "row-activated", (GCallback) __code_choose_project_button___lambda166__gtk_list_box_row_activated, self, 0);
	g_signal_connect_object ((GtkToggleButton*) self, "toggled", (GCallback) __code_choose_project_button___lambda167__gtk_toggle_button_toggled, self, 0);
	_tmp66_ = git_manager;
	g_signal_connect_object ((GObject*) _tmp66_, "notify::active-project-path", (GCallback) _code_choose_project_button_update_button_g_object_notify, self, 0);
	code_choose_project_button_update_button (self);
	_g_object_unref0 (src);
	_g_object_unref0 (git_manager);
	_g_object_unref0 (project_popover);
	_g_object_unref0 (popover_content);
	_g_object_unref0 (clone_button);
	_g_object_unref0 (add_folder_button);
	_g_object_unref0 (project_scrolled);
	_g_object_unref0 (box);
	_g_object_unref0 (cloning_spinner);
	_g_object_unref0 (img);
	block50_data_unref (_data50_);
	_data50_ = NULL;
	return obj;
}

static void
code_choose_project_button_class_init (CodeChooseProjectButtonClass * klass,
                                       gpointer klass_data)
{
	code_choose_project_button_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &CodeChooseProjectButton_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_code_choose_project_button_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_code_choose_project_button_set_property;
	G_OBJECT_CLASS (klass)->constructor = code_choose_project_button_constructor;
	G_OBJECT_CLASS (klass)->finalize = code_choose_project_button_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_CHOOSE_PROJECT_BUTTON_CLONING_IN_PROGRESS_PROPERTY, code_choose_project_button_properties[CODE_CHOOSE_PROJECT_BUTTON_CLONING_IN_PROGRESS_PROPERTY] = g_param_spec_boolean ("cloning-in-progress", "cloning-in-progress", "cloning-in-progress", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CODE_CHOOSE_PROJECT_BUTTON_TOPLEVEL_ACTION_GROUP_PROPERTY, code_choose_project_button_properties[CODE_CHOOSE_PROJECT_BUTTON_TOPLEVEL_ACTION_GROUP_PROPERTY] = g_param_spec_object ("toplevel-action-group", "toplevel-action-group", "toplevel-action-group", g_action_group_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	code_choose_project_button_signals[CODE_CHOOSE_PROJECT_BUTTON_PROJECT_CHOSEN_SIGNAL] = g_signal_new ("project-chosen", CODE_TYPE_CHOOSE_PROJECT_BUTTON, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
code_choose_project_button_instance_init (CodeChooseProjectButton * self,
                                          gpointer klass)
{
	self->priv = code_choose_project_button_get_instance_private (self);
}

static void
code_choose_project_button_finalize (GObject * obj)
{
	CodeChooseProjectButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CODE_TYPE_CHOOSE_PROJECT_BUTTON, CodeChooseProjectButton);
	_g_object_unref0 (self->priv->label_widget);
	_g_object_unref0 (self->priv->project_listbox);
	_g_object_unref0 (self->priv->_toplevel_action_group);
	G_OBJECT_CLASS (code_choose_project_button_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
code_choose_project_button_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (CodeChooseProjectButtonClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) code_choose_project_button_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CodeChooseProjectButton), 0, (GInstanceInitFunc) code_choose_project_button_instance_init, NULL };
	GType code_choose_project_button_type_id;
	code_choose_project_button_type_id = g_type_register_static (gtk_menu_button_get_type (), "CodeChooseProjectButton", &g_define_type_info, G_TYPE_FLAG_NONE);
	CodeChooseProjectButton_private_offset = g_type_add_instance_private (code_choose_project_button_type_id, sizeof (CodeChooseProjectButtonPrivate));
	return code_choose_project_button_type_id;
}

GType
code_choose_project_button_get_type (void)
{
	static gsize code_choose_project_button_type_id__once = 0;
	if (g_once_init_enter (&code_choose_project_button_type_id__once)) {
		GType code_choose_project_button_type_id;
		code_choose_project_button_type_id = code_choose_project_button_get_type_once ();
		g_once_init_leave (&code_choose_project_button_type_id__once, code_choose_project_button_type_id);
	}
	return code_choose_project_button_type_id__once;
}

static void
_vala_code_choose_project_button_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec)
{
	CodeChooseProjectButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CODE_TYPE_CHOOSE_PROJECT_BUTTON, CodeChooseProjectButton);
	switch (property_id) {
		case CODE_CHOOSE_PROJECT_BUTTON_CLONING_IN_PROGRESS_PROPERTY:
		g_value_set_boolean (value, code_choose_project_button_get_cloning_in_progress (self));
		break;
		case CODE_CHOOSE_PROJECT_BUTTON_TOPLEVEL_ACTION_GROUP_PROPERTY:
		g_value_set_object (value, code_choose_project_button_get_toplevel_action_group (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_code_choose_project_button_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec)
{
	CodeChooseProjectButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CODE_TYPE_CHOOSE_PROJECT_BUTTON, CodeChooseProjectButton);
	switch (property_id) {
		case CODE_CHOOSE_PROJECT_BUTTON_CLONING_IN_PROGRESS_PROPERTY:
		code_choose_project_button_set_cloning_in_progress (self, g_value_get_boolean (value));
		break;
		case CODE_CHOOSE_PROJECT_BUTTON_TOPLEVEL_ACTION_GROUP_PROPERTY:
		code_choose_project_button_set_toplevel_action_group (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

