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

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

#define G4_BLUR_MODE_ALWAYS ((guint) 1)
#define G4_CONTENT_WIDTH_MIN 340
#define G4_ACTION_BUTTON "button"
#define G4_ACTION_REMOVE "remove"
#define G4_ACTION_SAVE_LIST "save-list"
#define G4_ACTION_SEARCH "search"
#define G4_ACTION_SELECT "select"
#define G4_ACTION_TOGGLE_SEARCH "toggle-search"
#define G4_ACTION_APP "app."
#define G4_ACTION_SHOW_FILE "show-file"
#define G4_ACTION_PLAY_PAUSE "play-pause"
#define G4_THUMBNAILER_ICON_SIZE 48
#define G4_ACTION_RELOAD "reload"
#define G4_SEARCH_MODE_ANY ((guint) 0)
#define G4_BLUR_MODE_ART_ONLY ((guint) 2)
#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 G4_TYPE_WINDOW (g4_window_get_type ())
#define G4_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_WINDOW, G4Window))
#define G4_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_WINDOW, G4WindowClass))
#define G4_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_WINDOW))
#define G4_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_WINDOW))
#define G4_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_WINDOW, G4WindowClass))

typedef struct _G4Window G4Window;
typedef struct _G4WindowClass G4WindowClass;
typedef struct _G4WindowPrivate G4WindowPrivate;

#define G4_TYPE_LEAFLET (g4_leaflet_get_type ())
#define G4_LEAFLET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_LEAFLET, G4Leaflet))
#define G4_LEAFLET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_LEAFLET, G4LeafletClass))
#define G4_IS_LEAFLET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_LEAFLET))
#define G4_IS_LEAFLET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_LEAFLET))
#define G4_LEAFLET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_LEAFLET, G4LeafletClass))

typedef struct _G4Leaflet G4Leaflet;
typedef struct _G4LeafletClass G4LeafletClass;

#define G4_TYPE_PLAY_PANEL (g4_play_panel_get_type ())
#define G4_PLAY_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_PLAY_PANEL, G4PlayPanel))
#define G4_PLAY_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_PLAY_PANEL, G4PlayPanelClass))
#define G4_IS_PLAY_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_PLAY_PANEL))
#define G4_IS_PLAY_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_PLAY_PANEL))
#define G4_PLAY_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_PLAY_PANEL, G4PlayPanelClass))

typedef struct _G4PlayPanel G4PlayPanel;
typedef struct _G4PlayPanelClass G4PlayPanelClass;

#define G4_TYPE_STORE_PANEL (g4_store_panel_get_type ())
#define G4_STORE_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_STORE_PANEL, G4StorePanel))
#define G4_STORE_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_STORE_PANEL, G4StorePanelClass))
#define G4_IS_STORE_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_STORE_PANEL))
#define G4_IS_STORE_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_STORE_PANEL))
#define G4_STORE_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_STORE_PANEL, G4StorePanelClass))

typedef struct _G4StorePanel G4StorePanel;
typedef struct _G4StorePanelClass G4StorePanelClass;

#define G4_TYPE_BASE_PAINTABLE (g4_base_paintable_get_type ())
#define G4_BASE_PAINTABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_BASE_PAINTABLE, G4BasePaintable))
#define G4_BASE_PAINTABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_BASE_PAINTABLE, G4BasePaintableClass))
#define G4_IS_BASE_PAINTABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_BASE_PAINTABLE))
#define G4_IS_BASE_PAINTABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_BASE_PAINTABLE))
#define G4_BASE_PAINTABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_BASE_PAINTABLE, G4BasePaintableClass))

typedef struct _G4BasePaintable G4BasePaintable;
typedef struct _G4BasePaintableClass G4BasePaintableClass;

#define G4_TYPE_CROSS_FADE_PAINTABLE (g4_cross_fade_paintable_get_type ())
#define G4_CROSS_FADE_PAINTABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_CROSS_FADE_PAINTABLE, G4CrossFadePaintable))
#define G4_CROSS_FADE_PAINTABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_CROSS_FADE_PAINTABLE, G4CrossFadePaintableClass))
#define G4_IS_CROSS_FADE_PAINTABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_CROSS_FADE_PAINTABLE))
#define G4_IS_CROSS_FADE_PAINTABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_CROSS_FADE_PAINTABLE))
#define G4_CROSS_FADE_PAINTABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_CROSS_FADE_PAINTABLE, G4CrossFadePaintableClass))

typedef struct _G4CrossFadePaintable G4CrossFadePaintable;
typedef struct _G4CrossFadePaintableClass G4CrossFadePaintableClass;
enum  {
	G4_WINDOW_0_PROPERTY,
	G4_WINDOW_BLUR_MODE_PROPERTY,
	G4_WINDOW_FOCUSED_VISIBLE_PROPERTY,
	G4_WINDOW_FOCUSED_WIDGET_PROPERTY,
	G4_WINDOW_NUM_PROPERTIES
};
static GParamSpec* g4_window_properties[G4_WINDOW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define G4_TYPE_APPLICATION (g4_application_get_type ())
#define G4_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_APPLICATION, G4Application))
#define G4_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_APPLICATION, G4ApplicationClass))
#define G4_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_APPLICATION))
#define G4_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_APPLICATION))
#define G4_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_APPLICATION, G4ApplicationClass))

typedef struct _G4Application G4Application;
typedef struct _G4ApplicationClass G4ApplicationClass;
typedef void (*GSimpleActionActivateCallback) (GSimpleAction* action, GVariant* parameter, gpointer user_data);

#define G4_TYPE_MUSIC_LOADER (g4_music_loader_get_type ())
#define G4_MUSIC_LOADER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_MUSIC_LOADER, G4MusicLoader))
#define G4_MUSIC_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_MUSIC_LOADER, G4MusicLoaderClass))
#define G4_IS_MUSIC_LOADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_MUSIC_LOADER))
#define G4_IS_MUSIC_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_MUSIC_LOADER))
#define G4_MUSIC_LOADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_MUSIC_LOADER, G4MusicLoaderClass))

typedef struct _G4MusicLoader G4MusicLoader;
typedef struct _G4MusicLoaderClass G4MusicLoaderClass;

#define G4_TYPE_MUSIC (g4_music_get_type ())
#define G4_MUSIC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_MUSIC, G4Music))
#define G4_MUSIC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_MUSIC, G4MusicClass))
#define G4_IS_MUSIC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_MUSIC))
#define G4_IS_MUSIC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_MUSIC))
#define G4_MUSIC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_MUSIC, G4MusicClass))

typedef struct _G4Music G4Music;
typedef struct _G4MusicClass G4MusicClass;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
typedef void (*G4VoidFunc) (gpointer user_data);
#define _g_free0(var) ((var == NULL) ? NULL : (var = (g_free (var), NULL)))

#define G4_TYPE_GST_PLAYER (g4_gst_player_get_type ())
#define G4_GST_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_GST_PLAYER, G4GstPlayer))
#define G4_GST_PLAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_GST_PLAYER, G4GstPlayerClass))
#define G4_IS_GST_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_GST_PLAYER))
#define G4_IS_GST_PLAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_GST_PLAYER))
#define G4_GST_PLAYER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_GST_PLAYER, G4GstPlayerClass))

typedef struct _G4GstPlayer G4GstPlayer;
typedef struct _G4GstPlayerClass G4GstPlayerClass;
typedef struct _Block45Data Block45Data;

#define G4_TYPE_THUMBNAILER (g4_thumbnailer_get_type ())
#define G4_THUMBNAILER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_THUMBNAILER, G4Thumbnailer))
#define G4_THUMBNAILER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_THUMBNAILER, G4ThumbnailerClass))
#define G4_IS_THUMBNAILER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_THUMBNAILER))
#define G4_IS_THUMBNAILER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_THUMBNAILER))
#define G4_THUMBNAILER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_THUMBNAILER, G4ThumbnailerClass))

typedef struct _G4Thumbnailer G4Thumbnailer;
typedef struct _G4ThumbnailerClass G4ThumbnailerClass;
typedef struct _Block46Data Block46Data;

#define G4_TYPE_SIZE_WATCHER (g4_size_watcher_get_type ())
#define G4_SIZE_WATCHER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_SIZE_WATCHER, G4SizeWatcher))
#define G4_IS_SIZE_WATCHER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_SIZE_WATCHER))
#define G4_SIZE_WATCHER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G4_TYPE_SIZE_WATCHER, G4SizeWatcherIface))

typedef struct _G4SizeWatcher G4SizeWatcher;
typedef struct _G4SizeWatcherIface G4SizeWatcherIface;
typedef struct _G4StorePanelPrivate G4StorePanelPrivate;

#define G4_TYPE_ALBUM (g4_album_get_type ())
#define G4_ALBUM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_ALBUM, G4Album))
#define G4_ALBUM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_ALBUM, G4AlbumClass))
#define G4_IS_ALBUM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_ALBUM))
#define G4_IS_ALBUM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_ALBUM))
#define G4_ALBUM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_ALBUM, G4AlbumClass))

typedef struct _G4Album G4Album;
typedef struct _G4AlbumClass G4AlbumClass;

#define G4_TYPE_PLAYLIST (g4_playlist_get_type ())
#define G4_PLAYLIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_PLAYLIST, G4Playlist))
#define G4_PLAYLIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_PLAYLIST, G4PlaylistClass))
#define G4_IS_PLAYLIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_PLAYLIST))
#define G4_IS_PLAYLIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_PLAYLIST))
#define G4_PLAYLIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_PLAYLIST, G4PlaylistClass))

typedef struct _G4Playlist G4Playlist;
typedef struct _G4PlaylistClass G4PlaylistClass;

#define G4_TYPE_MUSIC_LIST (g4_music_list_get_type ())
#define G4_MUSIC_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_MUSIC_LIST, G4MusicList))
#define G4_MUSIC_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_MUSIC_LIST, G4MusicListClass))
#define G4_IS_MUSIC_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_MUSIC_LIST))
#define G4_IS_MUSIC_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_MUSIC_LIST))
#define G4_MUSIC_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_MUSIC_LIST, G4MusicListClass))

typedef struct _G4MusicList G4MusicList;
typedef struct _G4MusicListClass G4MusicListClass;

struct _G4Window {
	AdwApplicationWindow parent_instance;
	G4WindowPrivate * priv;
};

struct _G4WindowClass {
	AdwApplicationWindowClass parent_class;
};

struct _G4WindowPrivate {
	AdwToastOverlay* _toast;
	G4Leaflet* _leaflet;
	GtkProgressBar* _progress_bar;
	G4PlayPanel* _play_panel;
	G4StorePanel* _store_panel;
	gint _blur_size;
	guint _bkgnd_blur;
	G4CrossFadePaintable* _bkgnd_paintable;
	GdkPaintable* _cover_paintable;
	AdwAnimation* _fade_animation;
	gboolean _loading;
	guint _tick_handler;
};

struct _Block45Data {
	int _ref_count_;
	G4Window* self;
	G4CrossFadePaintable* cover;
};

struct _Block46Data {
	int _ref_count_;
	G4Window* self;
	G4Application* app;
};

struct _G4SizeWatcherIface {
	GTypeInterface parent_iface;
	void (*first_allocated) (G4SizeWatcher* self);
	void (*size_to_change) (G4SizeWatcher* self, gint width, gint height);
};

struct _G4StorePanel {
	GtkBox parent_instance;
	G4StorePanelPrivate * priv;
	GtkHeaderBar* header_bar;
	GtkLabel* indicator;
};

struct _G4StorePanelClass {
	GtkBoxClass parent_class;
};

static gint G4Window_private_offset;
static gpointer g4_window_parent_class = NULL;

VALA_EXTERN GType g4_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4Window, g_object_unref)
VALA_EXTERN GType g4_leaflet_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4Leaflet, g_object_unref)
VALA_EXTERN GType g4_play_panel_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4PlayPanel, g_object_unref)
VALA_EXTERN GType g4_store_panel_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4StorePanel, g_object_unref)
VALA_EXTERN GType g4_base_paintable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4BasePaintable, g_object_unref)
VALA_EXTERN GType g4_cross_fade_paintable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4CrossFadePaintable, g_object_unref)
VALA_EXTERN G4Leaflet* g4_leaflet_new (void);
VALA_EXTERN G4Leaflet* g4_leaflet_construct (GType object_type);
VALA_EXTERN G4CrossFadePaintable* g4_cross_fade_paintable_new (GdkPaintable* paintable);
VALA_EXTERN G4CrossFadePaintable* g4_cross_fade_paintable_construct (GType object_type,
                                                         GdkPaintable* paintable);
VALA_EXTERN GType g4_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4Application, g_object_unref)
VALA_EXTERN G4Window* g4_window_new (G4Application* app);
VALA_EXTERN G4Window* g4_window_construct (GType object_type,
                               G4Application* app);
VALA_EXTERN const gchar* g4_application_get_name (G4Application* self);
static gboolean g4_window_on_close_request (G4Window* self);
static gboolean _g4_window_on_close_request_gtk_window_close_request (GtkWindow* _sender,
                                                               gpointer self);
static void g4_window_button_command (G4Window* self,
                               GSimpleAction* action,
                               GVariant* parameter);
static void _g4_window_button_command_gsimple_action_activate_callback (GSimpleAction* action,
                                                                 GVariant* parameter,
                                                                 gpointer self);
static void g4_window_remove_from_list (G4Window* self,
                                 GSimpleAction* action,
                                 GVariant* parameter);
static void _g4_window_remove_from_list_gsimple_action_activate_callback (GSimpleAction* action,
                                                                   GVariant* parameter,
                                                                   gpointer self);
static void g4_window_save_list (G4Window* self);
static void _g4_window_save_list_gsimple_action_activate_callback (GSimpleAction* action,
                                                            GVariant* parameter,
                                                            gpointer self);
static void g4_window_search_by (G4Window* self,
                          GSimpleAction* action,
                          GVariant* parameter);
static void _g4_window_search_by_gsimple_action_activate_callback (GSimpleAction* action,
                                                            GVariant* parameter,
                                                            gpointer self);
static void g4_window_start_select (G4Window* self);
static void _g4_window_start_select_gsimple_action_activate_callback (GSimpleAction* action,
                                                               GVariant* parameter,
                                                               gpointer self);
static void g4_window_toggle_search (G4Window* self);
static void _g4_window_toggle_search_gsimple_action_activate_callback (GSimpleAction* action,
                                                                GVariant* parameter,
                                                                gpointer self);
static gboolean g4_window_on_overlay_child_position (G4Window* self,
                                              GtkWidget* widget,
                                              GdkRectangle* rect);
static gboolean _g4_window_on_overlay_child_position_gtk_overlay_get_child_position (GtkOverlay* _sender,
                                                                              GtkWidget* widget,
                                                                              GdkRectangle* allocation,
                                                                              gpointer self);
VALA_EXTERN GType g4_music_loader_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4MusicLoader, g_object_unref)
VALA_EXTERN G4MusicLoader* g4_application_get_loader (G4Application* self);
static void g4_window_on_loading_changed (G4Window* self,
                                   gboolean loading);
static void _g4_window_on_loading_changed_g4_music_loader_loading_changed (G4MusicLoader* _sender,
                                                                    gboolean loading,
                                                                    gpointer self);
static void _gtk_widget_queue_draw_g4_base_paintable_queue_draw (G4BasePaintable* _sender,
                                                          gpointer self);
VALA_EXTERN G4StorePanel* g4_store_panel_new (G4Application* app,
                                  G4Window* win,
                                  G4Leaflet* leaflet);
VALA_EXTERN G4StorePanel* g4_store_panel_construct (GType object_type,
                                        G4Application* app,
                                        G4Window* win,
                                        G4Leaflet* leaflet);
VALA_EXTERN G4PlayPanel* g4_play_panel_new (G4Application* app,
                                G4Window* win,
                                G4Leaflet* leaflet);
VALA_EXTERN G4PlayPanel* g4_play_panel_construct (GType object_type,
                                      G4Application* app,
                                      G4Window* win,
                                      G4Leaflet* leaflet);
VALA_EXTERN GType g4_music_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4Music, g_object_unref)
static void g4_window_on_cover_changed (G4Window* self,
                                 G4Music* music,
                                 G4CrossFadePaintable* cover);
static void _g4_window_on_cover_changed_g4_play_panel_cover_changed (G4PlayPanel* _sender,
                                                              G4Music* music,
                                                              G4CrossFadePaintable* cover,
                                                              gpointer self);
VALA_EXTERN void g4_leaflet_set_content (G4Leaflet* self,
                             GtkWidget* value);
VALA_EXTERN void g4_leaflet_set_sidebar (G4Leaflet* self,
                             GtkWidget* value);
static void g4_window_setup_drop_target (G4Window* self);
static void g4_window_setup_focus_controller (G4Window* self);
VALA_EXTERN GSettings* g4_application_get_settings (G4Application* self);
static void g4_window_real_snapshot (GtkWidget* base,
                              GtkSnapshot* snapshot);
VALA_EXTERN void g4_window_open_page (G4Window* self,
                          const gchar* uri,
                          gboolean play_now,
                          gboolean shuffle);
VALA_EXTERN gboolean g4_store_panel_open_page (G4StorePanel* self,
                                   const gchar* uri,
                                   gboolean play_now,
                                   gboolean shuffle);
VALA_EXTERN gboolean g4_leaflet_get_folded (G4Leaflet* self);
VALA_EXTERN void g4_leaflet_pop (G4Leaflet* self);
VALA_EXTERN gint g4_window_open_next_playable_page (G4Window* self);
VALA_EXTERN gint g4_store_panel_open_next_playable_page (G4StorePanel* self);
VALA_EXTERN void g4_window_open_playing_page (G4Window* self);
VALA_EXTERN void g4_store_panel_open_playing_page (G4StorePanel* self);
VALA_EXTERN void g4_window_show_toast (G4Window* self,
                           const gchar* message,
                           const gchar* uri);
VALA_EXTERN void g4_window_start_search (G4Window* self,
                             const gchar* text,
                             guint mode);
VALA_EXTERN void g4_store_panel_start_search (G4StorePanel* self,
                                  const gchar* text,
                                  guint mode);
static void g4_window_focus_to_play_later (G4Window* self,
                                    gint delay);
VALA_EXTERN guint g4_run_timeout_once (guint interval,
                           G4VoidFunc func,
                           gpointer func_target,
                           GDestroyNotify func_target_destroy_notify);
static void __lambda136_ (G4Window* self);
VALA_EXTERN GtkButton* g4_find_button_by_action_name (GtkWidget* widget,
                                          const gchar* action);
static gboolean* _bool_dup (gboolean* self);
static void ___lambda136__g4_void_func (gpointer self);
VALA_EXTERN GType g4_gst_player_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4GstPlayer, g_object_unref)
VALA_EXTERN G4GstPlayer* g4_application_get_player (G4Application* self);
VALA_EXTERN gboolean g4_gst_player_get_playing (G4GstPlayer* self);
VALA_EXTERN void g4_application_request_background (G4Application* self);
VALA_EXTERN gboolean g4_store_panel_save_if_modified (G4StorePanel* self,
                                          gboolean prompt,
                                          G4VoidFunc done,
                                          gpointer done_target);
static void _gtk_window_close_g4_void_func (gpointer self);
static Block45Data* block45_data_ref (Block45Data* _data45_);
static void block45_data_unref (void * _userdata_);
VALA_EXTERN GdkPaintable* g4_base_paintable_get_paintable (G4BasePaintable* self);
VALA_EXTERN GType g4_thumbnailer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4Thumbnailer, g_object_unref)
VALA_EXTERN G4Thumbnailer* g4_application_get_thumbnailer (G4Application* self);
VALA_EXTERN GdkPaintable* g4_thumbnailer_find (G4Thumbnailer* self,
                                   G4Music* music,
                                   gint size);
VALA_EXTERN GtkIconPaintable* g4_application_get_icon (G4Application* self);
VALA_EXTERN void g4_store_panel_set_mini_cover (G4StorePanel* self,
                                    GdkPaintable* cover);
static void g4_window_update_background (G4Window* self);
static void __lambda131_ (Block45Data* _data45_,
                   gdouble value);
VALA_EXTERN void g4_cross_fade_paintable_set_fade (G4CrossFadePaintable* self,
                                       gdouble value);
static void ___lambda131__adw_animation_target_func (gdouble value,
                                              gpointer self);
VALA_EXTERN gdouble g4_cross_fade_paintable_get_fade (G4CrossFadePaintable* self);
static void __lambda132_ (Block45Data* _data45_);
VALA_EXTERN void g4_cross_fade_paintable_set_previous (G4CrossFadePaintable* self,
                                           GdkPaintable* value);
static void ___lambda132__adw_animation_done (AdwAnimation* _sender,
                                       gpointer self);
static gboolean g4_window_on_file_dropped (G4Window* self,
                                    GValue* value,
                                    gdouble x,
                                    gdouble y);
static Block46Data* block46_data_ref (Block46Data* _data46_);
static void block46_data_unref (void * _userdata_);
VALA_EXTERN GFile** g4_get_dropped_files (GValue* value,
                              gint* result_length1);
VALA_EXTERN void g4_application_open_files_async (G4Application* self,
                                      GFile** files,
                                      gint files_length1,
                                      guint position,
                                      gboolean play_now,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_);
VALA_EXTERN gboolean g4_application_open_files_finish (G4Application* self,
                                           GAsyncResult* _res_);
VALA_EXTERN G4Music* g4_application_get_current_music (G4Application* self);
static void __lambda134_ (Block46Data* _data46_,
                   GObject* obj,
                   GAsyncResult* res);
static void ___lambda134__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static void ___lambda130_ (G4Window* self);
static void ____lambda130__g4_void_func (gpointer self);
static gboolean g4_window_on_loading_tick_callback (G4Window* self,
                                             GtkWidget* widget,
                                             GdkFrameClock* clock);
static gboolean _g4_window_on_loading_tick_callback_gtk_tick_callback (GtkWidget* widget,
                                                                GdkFrameClock* frame_clock,
                                                                gpointer self);
VALA_EXTERN gdouble g4_music_loader_get_loading_progress (G4MusicLoader* self);
VALA_EXTERN GType g4_size_watcher_get_type (void) G_GNUC_CONST ;
static gboolean __lambda133_ (G4Window* self,
                       GdkDrop* drop);
VALA_EXTERN GType g4_album_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4Album, g_object_unref)
VALA_EXTERN GType g4_playlist_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4Playlist, g_object_unref)
static gboolean ___lambda133__gtk_drop_target_accept (GtkDropTarget* _sender,
                                               GdkDrop* drop,
                                               gpointer self);
static gboolean _g4_window_on_file_dropped_gtk_drop_target_drop (GtkDropTarget* _sender,
                                                          GValue* value,
                                                          gdouble x,
                                                          gdouble y,
                                                          gpointer self);
static void __lambda135_ (G4Window* self);
VALA_EXTERN void g4_window_set_focused_visible (G4Window* self,
                                    gboolean value);
static void ___lambda135__gtk_event_controller_focus_enter (GtkEventControllerFocus* _sender,
                                                     gpointer self);
VALA_EXTERN GType g4_music_list_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4MusicList, g_object_unref)
VALA_EXTERN G4MusicList* g4_store_panel_get_current_list (G4StorePanel* self);
VALA_EXTERN void g4_music_list_button_command (G4MusicList* self,
                                   const gchar* name);
VALA_EXTERN G4Music* g4_music_loader_find_cache (G4MusicLoader* self,
                                     const gchar* uri);
VALA_EXTERN void g4_store_panel_remove_from_list (G4StorePanel* self,
                                      G4Music* music);
static const gchar** _vala_array_dup11 (const gchar** self,
                                 gssize length);
VALA_EXTERN void g4_parse_search_mode (gchar** text,
                           guint* mode);
VALA_EXTERN void g4_music_list_set_multi_selection (G4MusicList* self,
                                        gboolean value);
VALA_EXTERN gboolean g4_store_panel_toggle_search (G4StorePanel* self);
VALA_EXTERN GdkPaintable* g4_create_blur_paintable (GtkWidget* widget,
                                        GdkPaintable* paintable,
                                        gint size,
                                        gdouble blur,
                                        gdouble opacity);
VALA_EXTERN void g4_base_paintable_set_paintable (G4BasePaintable* self,
                                      GdkPaintable* value);
VALA_EXTERN G4Window* g4_window_get_default (void);
VALA_EXTERN guint g4_window_get_blur_mode (G4Window* self);
VALA_EXTERN void g4_window_set_blur_mode (G4Window* self,
                              guint value);
VALA_EXTERN gboolean g4_window_get_focused_visible (G4Window* self);
VALA_EXTERN GtkWidget* g4_window_get_focused_widget (G4Window* self);
VALA_EXTERN void g4_window_set_focused_widget (G4Window* self,
                                   GtkWidget* value);
static void g4_window_finalize (GObject * obj);
static GType g4_window_get_type_once (void);
static void _vala_g4_window_get_property (GObject * object,
                                   guint property_id,
                                   GValue * value,
                                   GParamSpec * pspec);
static void _vala_g4_window_set_property (GObject * object,
                                   guint property_id,
                                   const GValue * value,
                                   GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
g4_window_get_instance_private (G4Window* self)
{
	return G_STRUCT_MEMBER_P (self, G4Window_private_offset);
}

static gboolean
_g4_window_on_close_request_gtk_window_close_request (GtkWindow* _sender,
                                                      gpointer self)
{
	gboolean result;
	result = g4_window_on_close_request ((G4Window*) self);
	return result;
}

static void
_g4_window_button_command_gsimple_action_activate_callback (GSimpleAction* action,
                                                            GVariant* parameter,
                                                            gpointer self)
{
	g4_window_button_command ((G4Window*) self, action, parameter);
}

static void
_g4_window_remove_from_list_gsimple_action_activate_callback (GSimpleAction* action,
                                                              GVariant* parameter,
                                                              gpointer self)
{
	g4_window_remove_from_list ((G4Window*) self, action, parameter);
}

static void
_g4_window_save_list_gsimple_action_activate_callback (GSimpleAction* action,
                                                       GVariant* parameter,
                                                       gpointer self)
{
	g4_window_save_list ((G4Window*) self);
}

static void
_g4_window_search_by_gsimple_action_activate_callback (GSimpleAction* action,
                                                       GVariant* parameter,
                                                       gpointer self)
{
	g4_window_search_by ((G4Window*) self, action, parameter);
}

static void
_g4_window_start_select_gsimple_action_activate_callback (GSimpleAction* action,
                                                          GVariant* parameter,
                                                          gpointer self)
{
	g4_window_start_select ((G4Window*) self);
}

static void
_g4_window_toggle_search_gsimple_action_activate_callback (GSimpleAction* action,
                                                           GVariant* parameter,
                                                           gpointer self)
{
	g4_window_toggle_search ((G4Window*) self);
}

static gboolean
_g4_window_on_overlay_child_position_gtk_overlay_get_child_position (GtkOverlay* _sender,
                                                                     GtkWidget* widget,
                                                                     GdkRectangle* allocation,
                                                                     gpointer self)
{
	gboolean result;
	result = g4_window_on_overlay_child_position ((G4Window*) self, widget, allocation);
	return result;
}

static void
_g4_window_on_loading_changed_g4_music_loader_loading_changed (G4MusicLoader* _sender,
                                                               gboolean loading,
                                                               gpointer self)
{
	g4_window_on_loading_changed ((G4Window*) self, loading);
}

static void
_gtk_widget_queue_draw_g4_base_paintable_queue_draw (G4BasePaintable* _sender,
                                                     gpointer self)
{
	gtk_widget_queue_draw ((GtkWidget*) self);
}

static void
_g4_window_on_cover_changed_g4_play_panel_cover_changed (G4PlayPanel* _sender,
                                                         G4Music* music,
                                                         G4CrossFadePaintable* cover,
                                                         gpointer self)
{
	g4_window_on_cover_changed ((G4Window*) self, music, cover);
}

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

G4Window*
g4_window_construct (GType object_type,
                     G4Application* app)
{
	G4Window * self = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	GtkOverlay* overlay = NULL;
	GtkOverlay* _tmp4_;
	AdwToastOverlay* _tmp5_;
	AdwToastOverlay* _tmp6_;
	G4Leaflet* _tmp7_;
	GActionEntry* action_entries = NULL;
	GActionEntry _tmp8_ = {0};
	GActionEntry _tmp9_ = {0};
	GActionEntry _tmp10_ = {0};
	GActionEntry _tmp11_ = {0};
	GActionEntry _tmp12_ = {0};
	GActionEntry _tmp13_ = {0};
	GActionEntry* _tmp14_;
	gint action_entries_length1;
	gint _action_entries_size_;
	GtkProgressBar* _tmp15_;
	GtkProgressBar* _tmp16_;
	GtkProgressBar* _tmp17_;
	GtkProgressBar* _tmp18_;
	GtkProgressBar* _tmp19_;
	GtkProgressBar* _tmp20_;
	G4MusicLoader* _tmp21_;
	G4MusicLoader* _tmp22_;
	G4CrossFadePaintable* _tmp23_;
	G4Leaflet* _tmp24_;
	G4StorePanel* _tmp25_;
	G4Leaflet* _tmp26_;
	G4PlayPanel* _tmp27_;
	G4PlayPanel* _tmp28_;
	G4Leaflet* _tmp29_;
	G4PlayPanel* _tmp30_;
	G4Leaflet* _tmp31_;
	G4StorePanel* _tmp32_;
	GSettings* settings = NULL;
	GSettings* _tmp33_;
	GSettings* _tmp34_;
	GSettings* _tmp35_;
	G4Leaflet* _tmp36_;
	g_return_val_if_fail (app != NULL, NULL);
	self = (G4Window*) g_object_new (object_type, NULL);
	gtk_window_set_application ((GtkWindow*) self, (GtkApplication*) app);
	_tmp0_ = g_application_get_application_id ((GApplication*) app);
	_tmp1_ = _tmp0_;
	gtk_window_set_icon_name ((GtkWindow*) self, _tmp1_);
	_tmp2_ = g4_application_get_name (app);
	_tmp3_ = _tmp2_;
	gtk_window_set_title ((GtkWindow*) self, _tmp3_);
	g_object_set ((GtkWidget*) self, "width-request", G4_CONTENT_WIDTH_MIN, NULL);
	g_signal_connect_object ((GtkWindow*) self, "close-request", (GCallback) _g4_window_on_close_request_gtk_window_close_request, self, 0);
	_tmp4_ = (GtkOverlay*) gtk_overlay_new ();
	g_object_ref_sink (_tmp4_);
	overlay = _tmp4_;
	adw_application_window_set_content ((AdwApplicationWindow*) self, (GtkWidget*) overlay);
	_tmp5_ = self->priv->_toast;
	gtk_overlay_set_child (overlay, (GtkWidget*) _tmp5_);
	_tmp6_ = self->priv->_toast;
	_tmp7_ = self->priv->_leaflet;
	adw_toast_overlay_set_child (_tmp6_, (GtkWidget*) _tmp7_);
	memset (&_tmp8_, 0, sizeof (GActionEntry));
	_tmp8_.name = G4_ACTION_BUTTON;
	_tmp8_.activate = _g4_window_button_command_gsimple_action_activate_callback;
	_tmp8_.parameter_type = "s";
	memset (&_tmp9_, 0, sizeof (GActionEntry));
	_tmp9_.name = G4_ACTION_REMOVE;
	_tmp9_.activate = _g4_window_remove_from_list_gsimple_action_activate_callback;
	_tmp9_.parameter_type = "s";
	memset (&_tmp10_, 0, sizeof (GActionEntry));
	_tmp10_.name = G4_ACTION_SAVE_LIST;
	_tmp10_.activate = _g4_window_save_list_gsimple_action_activate_callback;
	memset (&_tmp11_, 0, sizeof (GActionEntry));
	_tmp11_.name = G4_ACTION_SEARCH;
	_tmp11_.activate = _g4_window_search_by_gsimple_action_activate_callback;
	_tmp11_.parameter_type = "as";
	memset (&_tmp12_, 0, sizeof (GActionEntry));
	_tmp12_.name = G4_ACTION_SELECT;
	_tmp12_.activate = _g4_window_start_select_gsimple_action_activate_callback;
	memset (&_tmp13_, 0, sizeof (GActionEntry));
	_tmp13_.name = G4_ACTION_TOGGLE_SEARCH;
	_tmp13_.activate = _g4_window_toggle_search_gsimple_action_activate_callback;
	_tmp14_ = g_new0 (GActionEntry, 6);
	_tmp14_[0] = _tmp8_;
	_tmp14_[1] = _tmp9_;
	_tmp14_[2] = _tmp10_;
	_tmp14_[3] = _tmp11_;
	_tmp14_[4] = _tmp12_;
	_tmp14_[5] = _tmp13_;
	action_entries = _tmp14_;
	action_entries_length1 = 6;
	_action_entries_size_ = action_entries_length1;
	g_action_map_add_action_entries ((GActionMap*) self, action_entries, (gint) action_entries_length1, self);
	_tmp15_ = self->priv->_progress_bar;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp15_, TRUE);
	_tmp16_ = self->priv->_progress_bar;
	gtk_progress_bar_set_pulse_step (_tmp16_, 0.02);
	_tmp17_ = self->priv->_progress_bar;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp17_, FALSE);
	_tmp18_ = self->priv->_progress_bar;
	gtk_widget_set_visible ((GtkWidget*) _tmp18_, FALSE);
	_tmp19_ = self->priv->_progress_bar;
	gtk_widget_add_css_class ((GtkWidget*) _tmp19_, "osd");
	_tmp20_ = self->priv->_progress_bar;
	gtk_overlay_add_overlay (overlay, (GtkWidget*) _tmp20_);
	g_signal_connect_object (overlay, "get-child-position", (GCallback) _g4_window_on_overlay_child_position_gtk_overlay_get_child_position, self, 0);
	_tmp21_ = g4_application_get_loader (app);
	_tmp22_ = _tmp21_;
	g_signal_connect_object (_tmp22_, "loading-changed", (GCallback) _g4_window_on_loading_changed_g4_music_loader_loading_changed, self, 0);
	_tmp23_ = self->priv->_bkgnd_paintable;
	g_signal_connect_object ((G4BasePaintable*) _tmp23_, "queue-draw", (GCallback) _gtk_widget_queue_draw_g4_base_paintable_queue_draw, (GtkWidget*) self, 0);
	_tmp24_ = self->priv->_leaflet;
	_tmp25_ = g4_store_panel_new (app, self, _tmp24_);
	g_object_ref_sink (_tmp25_);
	_g_object_unref0 (self->priv->_store_panel);
	self->priv->_store_panel = _tmp25_;
	_tmp26_ = self->priv->_leaflet;
	_tmp27_ = g4_play_panel_new (app, self, _tmp26_);
	g_object_ref_sink (_tmp27_);
	_g_object_unref0 (self->priv->_play_panel);
	self->priv->_play_panel = _tmp27_;
	_tmp28_ = self->priv->_play_panel;
	g_signal_connect_object (_tmp28_, "cover-changed", (GCallback) _g4_window_on_cover_changed_g4_play_panel_cover_changed, self, 0);
	_tmp29_ = self->priv->_leaflet;
	_tmp30_ = self->priv->_play_panel;
	g4_leaflet_set_content (_tmp29_, (GtkWidget*) _tmp30_);
	_tmp31_ = self->priv->_leaflet;
	_tmp32_ = self->priv->_store_panel;
	g4_leaflet_set_sidebar (_tmp31_, (GtkWidget*) _tmp32_);
	g4_window_setup_drop_target (self);
	g4_window_setup_focus_controller (self);
	_tmp33_ = g4_application_get_settings (app);
	_tmp34_ = _tmp33_;
	_tmp35_ = _g_object_ref0 (_tmp34_);
	settings = _tmp35_;
	_tmp36_ = self->priv->_leaflet;
	g_settings_bind (settings, "leaflet-mode", (GObject*) _tmp36_, "visible-mode", G_SETTINGS_BIND_DEFAULT);
	g_settings_bind (settings, "maximized", (GObject*) self, "maximized", G_SETTINGS_BIND_DEFAULT);
	g_settings_bind (settings, "width", (GObject*) self, "default-width", G_SETTINGS_BIND_DEFAULT);
	g_settings_bind (settings, "height", (GObject*) self, "default-height", G_SETTINGS_BIND_DEFAULT);
	g_settings_bind (settings, "blur-mode", (GObject*) self, "blur-mode", G_SETTINGS_BIND_DEFAULT);
	_g_object_unref0 (settings);
	action_entries = (g_free (action_entries), NULL);
	_g_object_unref0 (overlay);
	return self;
}

G4Window*
g4_window_new (G4Application* app)
{
	return g4_window_construct (G4_TYPE_WINDOW, app);
}

static void
g4_window_real_snapshot (GtkWidget* base,
                         GtkSnapshot* snapshot)
{
	G4Window * self;
	G4CrossFadePaintable* _tmp0_;
	self = (G4Window*) base;
	g_return_if_fail (snapshot != NULL);
	_tmp0_ = self->priv->_bkgnd_paintable;
	gdk_paintable_snapshot ((GdkPaintable*) _tmp0_, (GdkSnapshot*) snapshot, (gdouble) gtk_widget_get_width ((GtkWidget*) self), (gdouble) gtk_widget_get_height ((GtkWidget*) self));
	GTK_WIDGET_CLASS (g4_window_parent_class)->snapshot ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, adw_application_window_get_type (), AdwApplicationWindow), snapshot);
}

void
g4_window_open_page (G4Window* self,
                     const gchar* uri,
                     gboolean play_now,
                     gboolean shuffle)
{
	G4StorePanel* _tmp0_;
	G4Leaflet* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (uri != NULL);
	_tmp0_ = self->priv->_store_panel;
	g4_store_panel_open_page (_tmp0_, uri, play_now, shuffle);
	_tmp1_ = self->priv->_leaflet;
	_tmp2_ = g4_leaflet_get_folded (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		G4Leaflet* _tmp4_;
		_tmp4_ = self->priv->_leaflet;
		g4_leaflet_pop (_tmp4_);
	}
}

gint
g4_window_open_next_playable_page (G4Window* self)
{
	G4StorePanel* _tmp0_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	_tmp0_ = self->priv->_store_panel;
	result = g4_store_panel_open_next_playable_page (_tmp0_);
	return result;
}

void
g4_window_open_playing_page (G4Window* self)
{
	G4StorePanel* _tmp0_;
	G4Leaflet* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_store_panel;
	g4_store_panel_open_playing_page (_tmp0_);
	_tmp1_ = self->priv->_leaflet;
	_tmp2_ = g4_leaflet_get_folded (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		G4Leaflet* _tmp4_;
		_tmp4_ = self->priv->_leaflet;
		g4_leaflet_pop (_tmp4_);
	}
}

void
g4_window_show_toast (G4Window* self,
                      const gchar* message,
                      const gchar* uri)
{
	AdwToast* toast = NULL;
	AdwToast* _tmp0_;
	AdwToastOverlay* _tmp6_;
	AdwToast* _tmp7_;
	AdwToast* _tmp8_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (message != NULL);
	_tmp0_ = adw_toast_new (message);
	toast = _tmp0_;
	if (uri != NULL) {
		AdwToast* _tmp1_;
		AdwToast* _tmp2_;
		GVariant* _tmp3_;
		GVariant* _tmp4_;
		AdwToast* _tmp5_;
		_tmp1_ = toast;
		adw_toast_set_action_name (_tmp1_, G4_ACTION_APP G4_ACTION_SHOW_FILE);
		_tmp2_ = toast;
		_tmp3_ = g_variant_new_string ((const gchar*) uri);
		g_variant_ref_sink (_tmp3_);
		_tmp4_ = _tmp3_;
		g_object_set (_tmp2_, "action-target", _tmp4_, NULL);
		_g_variant_unref0 (_tmp4_);
		_tmp5_ = toast;
		adw_toast_set_button_label (_tmp5_, _ ("Show"));
	}
	_tmp6_ = self->priv->_toast;
	_tmp7_ = toast;
	_tmp8_ = _g_object_ref0 (_tmp7_);
	adw_toast_overlay_add_toast (_tmp6_, _tmp8_);
	_g_object_unref0 (toast);
}

void
g4_window_start_search (G4Window* self,
                        const gchar* text,
                        guint mode)
{
	G4StorePanel* _tmp0_;
	G4Leaflet* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (text != NULL);
	_tmp0_ = self->priv->_store_panel;
	g4_store_panel_start_search (_tmp0_, text, mode);
	_tmp1_ = self->priv->_leaflet;
	_tmp2_ = g4_leaflet_get_folded (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		G4Leaflet* _tmp4_;
		_tmp4_ = self->priv->_leaflet;
		g4_leaflet_pop (_tmp4_);
	}
}

static gboolean*
_bool_dup (gboolean* self)
{
	gboolean* dup;
	dup = g_new0 (gboolean, 1);
	memcpy (dup, self, sizeof (gboolean));
	return dup;
}

static gpointer
__bool_dup0 (gpointer self)
{
	return self ? _bool_dup (self) : NULL;
}

static void
__lambda136_ (G4Window* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_tmp1_ = gtk_window_get_focus_visible ((GtkWindow*) self);
	_tmp2_ = _tmp1_;
	if (!_tmp2_) {
		GtkWidget* _tmp3_;
		GtkWidget* _tmp4_;
		GtkWidget* _tmp5_;
		g_object_get ((GtkWindow*) self, "focus-widget", &_tmp3_, NULL);
		_tmp4_ = _tmp3_;
		_tmp5_ = _tmp4_;
		_tmp0_ = !G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, gtk_editable_get_type ());
		_g_object_unref0 (_tmp5_);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GtkButton* button = NULL;
		G4Leaflet* _tmp6_;
		GtkButton* _tmp7_;
		GtkButton* _tmp8_ = NULL;
		GtkButton* _tmp9_;
		gboolean* _tmp10_ = NULL;
		_tmp6_ = self->priv->_leaflet;
		_tmp7_ = g4_find_button_by_action_name ((GtkWidget*) _tmp6_, G4_ACTION_APP G4_ACTION_PLAY_PAUSE);
		button = _tmp7_;
		_tmp9_ = button;
		_tmp8_ = _tmp9_;
		_tmp10_ = NULL;
		if (_tmp8_ != NULL) {
			gboolean _tmp11_;
			gboolean* _tmp12_;
			_tmp11_ = gtk_widget_grab_focus ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_button_get_type (), GtkButton));
			_tmp12_ = __bool_dup0 (&_tmp11_);
			_g_free0 (_tmp10_);
			_tmp10_ = _tmp12_;
		}
		_g_free0 (_tmp10_);
		_g_object_unref0 (button);
	}
}

static void
___lambda136__g4_void_func (gpointer self)
{
	__lambda136_ ((G4Window*) self);
}

static void
g4_window_focus_to_play_later (G4Window* self,
                               gint delay)
{
	g_return_if_fail (self != NULL);
	g4_run_timeout_once ((guint) delay, ___lambda136__g4_void_func, g_object_ref (self), g_object_unref);
}

static void
_gtk_window_close_g4_void_func (gpointer self)
{
	gtk_window_close ((GtkWindow*) self);
}

static gboolean
g4_window_on_close_request (G4Window* self)
{
	G4Application* app = NULL;
	GtkApplication* _tmp0_;
	GtkApplication* _tmp1_;
	G4Application* _tmp2_;
	gboolean _tmp3_ = FALSE;
	G4Application* _tmp4_;
	G4GstPlayer* _tmp5_;
	G4GstPlayer* _tmp6_;
	gboolean _tmp7_;
	gboolean _tmp8_;
	G4StorePanel* _tmp13_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = gtk_window_get_application ((GtkWindow*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, G4_TYPE_APPLICATION, G4Application));
	app = _tmp2_;
	_tmp4_ = app;
	_tmp5_ = g4_application_get_player (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = g4_gst_player_get_playing (_tmp6_);
	_tmp8_ = _tmp7_;
	if (_tmp8_) {
		G4Application* _tmp9_;
		GSettings* _tmp10_;
		GSettings* _tmp11_;
		_tmp9_ = app;
		_tmp10_ = g4_application_get_settings (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp3_ = g_settings_get_boolean (_tmp11_, "play-background");
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		G4Application* _tmp12_;
		_tmp12_ = app;
		g4_application_request_background (_tmp12_);
		gtk_widget_set_visible ((GtkWidget*) self, FALSE);
		result = TRUE;
		_g_object_unref0 (app);
		return result;
	}
	_tmp13_ = self->priv->_store_panel;
	if (g4_store_panel_save_if_modified (_tmp13_, TRUE, _gtk_window_close_g4_void_func, (GtkWindow*) self)) {
		gtk_window_present ((GtkWindow*) self);
		result = TRUE;
		_g_object_unref0 (app);
		return result;
	}
	result = FALSE;
	_g_object_unref0 (app);
	return result;
}

static Block45Data*
block45_data_ref (Block45Data* _data45_)
{
	g_atomic_int_inc (&_data45_->_ref_count_);
	return _data45_;
}

static void
block45_data_unref (void * _userdata_)
{
	Block45Data* _data45_;
	_data45_ = (Block45Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data45_->_ref_count_)) {
		G4Window* self;
		self = _data45_->self;
		_g_object_unref0 (_data45_->cover);
		_g_object_unref0 (self);
		g_slice_free (Block45Data, _data45_);
	}
}

static void
__lambda131_ (Block45Data* _data45_,
              gdouble value)
{
	G4Window* self;
	G4CrossFadePaintable* _tmp0_;
	self = _data45_->self;
	_tmp0_ = self->priv->_bkgnd_paintable;
	g4_cross_fade_paintable_set_fade (_tmp0_, value);
	g4_cross_fade_paintable_set_fade (_data45_->cover, value);
}

static void
___lambda131__adw_animation_target_func (gdouble value,
                                         gpointer self)
{
	__lambda131_ (self, value);
}

static void
__lambda132_ (Block45Data* _data45_)
{
	G4Window* self;
	G4CrossFadePaintable* _tmp0_;
	self = _data45_->self;
	_tmp0_ = self->priv->_bkgnd_paintable;
	g4_cross_fade_paintable_set_previous (_tmp0_, NULL);
	g4_cross_fade_paintable_set_previous (_data45_->cover, NULL);
	_g_object_unref0 (self->priv->_fade_animation);
	self->priv->_fade_animation = NULL;
}

static void
___lambda132__adw_animation_done (AdwAnimation* _sender,
                                  gpointer self)
{
	__lambda132_ (self);
}

static void
g4_window_on_cover_changed (G4Window* self,
                            G4Music* music,
                            G4CrossFadePaintable* cover)
{
	Block45Data* _data45_;
	G4CrossFadePaintable* _tmp0_;
	GdkPaintable* paintable = NULL;
	GdkPaintable* _tmp1_;
	GdkPaintable* _tmp2_;
	GdkPaintable* _tmp3_;
	GdkPaintable* _tmp11_;
	GdkPaintable* _tmp12_;
	G4Application* app = NULL;
	GtkApplication* _tmp13_;
	GtkApplication* _tmp14_;
	G4Application* _tmp15_;
	GdkPaintable* _tmp16_ = NULL;
	GdkPaintable* mini_cover = NULL;
	GdkPaintable* _tmp29_;
	G4StorePanel* _tmp30_;
	GdkPaintable* _tmp31_;
	AdwCallbackAnimationTarget* target = NULL;
	AdwCallbackAnimationTarget* _tmp32_;
	AdwAnimation* _tmp33_ = NULL;
	AdwAnimation* _tmp34_;
	gdouble _tmp35_;
	gdouble _tmp36_;
	AdwCallbackAnimationTarget* _tmp37_;
	AdwAnimationTarget* _tmp38_;
	AdwTimedAnimation* _tmp39_;
	AdwAnimation* _tmp40_;
	AdwAnimation* _tmp41_ = NULL;
	AdwAnimation* _tmp42_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (cover != NULL);
	_data45_ = g_slice_new0 (Block45Data);
	_data45_->_ref_count_ = 1;
	_data45_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (cover);
	_g_object_unref0 (_data45_->cover);
	_data45_->cover = _tmp0_;
	_tmp1_ = g4_base_paintable_get_paintable ((G4BasePaintable*) _data45_->cover);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	paintable = _tmp3_;
	while (TRUE) {
		GdkPaintable* _tmp4_;
		G4BasePaintable* _tmp5_ = NULL;
		GdkPaintable* _tmp6_;
		GdkPaintable* _tmp7_ = NULL;
		GdkPaintable* _tmp10_;
		_tmp4_ = paintable;
		if (!G4_IS_BASE_PAINTABLE (_tmp4_)) {
			break;
		}
		_tmp6_ = paintable;
		_tmp5_ = G4_IS_BASE_PAINTABLE (_tmp6_) ? ((G4BasePaintable*) _tmp6_) : NULL;
		_tmp7_ = NULL;
		if (_tmp5_ != NULL) {
			GdkPaintable* _tmp8_;
			GdkPaintable* _tmp9_;
			_tmp8_ = g4_base_paintable_get_paintable (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, G4_TYPE_BASE_PAINTABLE, G4BasePaintable));
			_tmp9_ = _tmp8_;
			_tmp7_ = _tmp9_;
		}
		_tmp10_ = _g_object_ref0 (_tmp7_);
		_g_object_unref0 (paintable);
		paintable = _tmp10_;
	}
	_tmp11_ = paintable;
	_tmp12_ = _g_object_ref0 (_tmp11_);
	_g_object_unref0 (self->priv->_cover_paintable);
	self->priv->_cover_paintable = _tmp12_;
	_tmp13_ = gtk_window_get_application ((GtkWindow*) self);
	_tmp14_ = _tmp13_;
	_tmp15_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, G4_TYPE_APPLICATION, G4Application));
	app = _tmp15_;
	if (music != NULL) {
		GdkPaintable* _tmp17_ = NULL;
		G4Application* _tmp18_;
		G4Thumbnailer* _tmp19_;
		G4Thumbnailer* _tmp20_;
		GdkPaintable* _tmp21_;
		GdkPaintable* _tmp24_;
		_tmp18_ = app;
		_tmp19_ = g4_application_get_thumbnailer (_tmp18_);
		_tmp20_ = _tmp19_;
		_tmp21_ = g4_thumbnailer_find (_tmp20_, G_TYPE_CHECK_INSTANCE_CAST (music, G4_TYPE_MUSIC, G4Music), G4_THUMBNAILER_ICON_SIZE);
		_tmp17_ = _tmp21_;
		if (_tmp17_ == NULL) {
			GdkPaintable* _tmp22_;
			GdkPaintable* _tmp23_;
			_tmp22_ = self->priv->_cover_paintable;
			_tmp23_ = _g_object_ref0 (_tmp22_);
			_g_object_unref0 (_tmp17_);
			_tmp17_ = _tmp23_;
		}
		_tmp24_ = _tmp17_;
		_tmp17_ = NULL;
		_g_object_unref0 (_tmp16_);
		_tmp16_ = _tmp24_;
		_g_object_unref0 (_tmp17_);
	} else {
		G4Application* _tmp25_;
		GtkIconPaintable* _tmp26_;
		GtkIconPaintable* _tmp27_;
		GdkPaintable* _tmp28_;
		_tmp25_ = app;
		_tmp26_ = g4_application_get_icon (_tmp25_);
		_tmp27_ = _tmp26_;
		_tmp28_ = _g_object_ref0 ((GdkPaintable*) _tmp27_);
		_g_object_unref0 (_tmp16_);
		_tmp16_ = _tmp28_;
	}
	_tmp29_ = _tmp16_;
	_tmp16_ = NULL;
	mini_cover = _tmp29_;
	_tmp30_ = self->priv->_store_panel;
	_tmp31_ = mini_cover;
	g4_store_panel_set_mini_cover (_tmp30_, _tmp31_);
	g4_window_update_background (self);
	_tmp32_ = (AdwCallbackAnimationTarget*) adw_callback_animation_target_new (___lambda131__adw_animation_target_func, block45_data_ref (_data45_), block45_data_unref);
	target = _tmp32_;
	_tmp34_ = self->priv->_fade_animation;
	_tmp33_ = _tmp34_;
	if (_tmp33_ != NULL) {
		adw_animation_pause (G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, adw_animation_get_type (), AdwAnimation));
	}
	_tmp35_ = g4_cross_fade_paintable_get_fade (_data45_->cover);
	_tmp36_ = _tmp35_;
	_tmp37_ = target;
	_tmp38_ = _g_object_ref0 ((AdwAnimationTarget*) _tmp37_);
	_tmp39_ = (AdwTimedAnimation*) adw_timed_animation_new ((GtkWidget*) self, 1 - _tmp36_, (gdouble) 0, (guint) 800, _tmp38_);
	_g_object_unref0 (self->priv->_fade_animation);
	self->priv->_fade_animation = (AdwAnimation*) _tmp39_;
	_tmp40_ = self->priv->_fade_animation;
	g_signal_connect_data (G_TYPE_CHECK_INSTANCE_CAST (_tmp40_, adw_animation_get_type (), AdwAnimation), "done", (GCallback) ___lambda132__adw_animation_done, block45_data_ref (_data45_), (GClosureNotify) block45_data_unref, 0);
	_tmp42_ = self->priv->_fade_animation;
	_tmp41_ = _tmp42_;
	if (_tmp41_ != NULL) {
		adw_animation_play (G_TYPE_CHECK_INSTANCE_CAST (_tmp41_, adw_animation_get_type (), AdwAnimation));
	}
	_g_object_unref0 (target);
	_g_object_unref0 (mini_cover);
	_g_object_unref0 (_tmp16_);
	_g_object_unref0 (app);
	_g_object_unref0 (paintable);
	block45_data_unref (_data45_);
	_data45_ = NULL;
}

static Block46Data*
block46_data_ref (Block46Data* _data46_)
{
	g_atomic_int_inc (&_data46_->_ref_count_);
	return _data46_;
}

static void
block46_data_unref (void * _userdata_)
{
	Block46Data* _data46_;
	_data46_ = (Block46Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data46_->_ref_count_)) {
		G4Window* self;
		self = _data46_->self;
		_g_object_unref0 (_data46_->app);
		_g_object_unref0 (self);
		g_slice_free (Block46Data, _data46_);
	}
}

static void
__lambda134_ (Block46Data* _data46_,
              GObject* obj,
              GAsyncResult* res)
{
	G4Window* self;
	self = _data46_->self;
	g_return_if_fail (res != NULL);
	g4_application_open_files_finish (_data46_->app, res);
}

static void
___lambda134__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	__lambda134_ (self, source_object, res);
	block46_data_unref (self);
}

static gboolean
g4_window_on_file_dropped (G4Window* self,
                           GValue* value,
                           gdouble x,
                           gdouble y)
{
	Block46Data* _data46_;
	GFile** files = NULL;
	GValue _tmp0_;
	gint _tmp1_ = 0;
	GFile** _tmp2_;
	gint files_length1;
	gint _files_size_;
	GtkApplication* _tmp3_;
	GtkApplication* _tmp4_;
	G4Application* _tmp5_;
	G4Music* _tmp6_;
	G4Music* _tmp7_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (value != NULL, FALSE);
	_data46_ = g_slice_new0 (Block46Data);
	_data46_->_ref_count_ = 1;
	_data46_->self = g_object_ref (self);
	_tmp0_ = *value;
	_tmp2_ = g4_get_dropped_files (&_tmp0_, &_tmp1_);
	files = _tmp2_;
	files_length1 = _tmp1_;
	_files_size_ = files_length1;
	_tmp3_ = gtk_window_get_application ((GtkWindow*) self);
	_tmp4_ = _tmp3_;
	_tmp5_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, G4_TYPE_APPLICATION, G4Application));
	_data46_->app = _tmp5_;
	_tmp6_ = g4_application_get_current_music (_data46_->app);
	_tmp7_ = _tmp6_;
	g4_application_open_files_async (_data46_->app, files, (gint) files_length1, (guint) -1, _tmp7_ == NULL, ___lambda134__gasync_ready_callback, block46_data_ref (_data46_));
	result = TRUE;
	files = (_vala_array_free (files, files_length1, (GDestroyNotify) g_object_unref), NULL);
	block46_data_unref (_data46_);
	_data46_ = NULL;
	return result;
}

static void
___lambda130_ (G4Window* self)
{
	GtkProgressBar* _tmp0_;
	_tmp0_ = self->priv->_progress_bar;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, self->priv->_loading);
}

static void
____lambda130__g4_void_func (gpointer self)
{
	___lambda130_ ((G4Window*) self);
}

static gboolean
_g4_window_on_loading_tick_callback_gtk_tick_callback (GtkWidget* widget,
                                                       GdkFrameClock* frame_clock,
                                                       gpointer self)
{
	gboolean result;
	result = g4_window_on_loading_tick_callback ((G4Window*) self, widget, frame_clock);
	return result;
}

static void
g4_window_on_loading_changed (G4Window* self,
                              gboolean loading)
{
	GtkRoot* _tmp0_;
	GtkRoot* _tmp1_;
	gboolean _tmp3_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_widget_get_root ((GtkWidget*) self);
	_tmp1_ = _tmp0_;
	gtk_widget_action_set_enabled ((GtkWidget*) _tmp1_, G4_ACTION_APP G4_ACTION_RELOAD, !loading);
	self->priv->_loading = loading;
	if (loading) {
		g4_run_timeout_once ((guint) 100, ____lambda130__g4_void_func, g_object_ref (self), g_object_unref);
	} else {
		GtkProgressBar* _tmp2_;
		_tmp2_ = self->priv->_progress_bar;
		gtk_widget_set_visible ((GtkWidget*) _tmp2_, self->priv->_loading);
	}
	if (loading) {
		_tmp3_ = self->priv->_tick_handler == ((guint) 0);
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		self->priv->_tick_handler = gtk_widget_add_tick_callback ((GtkWidget*) self, _g4_window_on_loading_tick_callback_gtk_tick_callback, g_object_ref (self), g_object_unref);
	} else {
		gboolean _tmp4_ = FALSE;
		if (!loading) {
			_tmp4_ = self->priv->_tick_handler != ((guint) 0);
		} else {
			_tmp4_ = FALSE;
		}
		if (_tmp4_) {
			gtk_widget_remove_tick_callback ((GtkWidget*) self, self->priv->_tick_handler);
			self->priv->_tick_handler = (guint) 0;
		}
	}
}

static gboolean
g4_window_on_loading_tick_callback (G4Window* self,
                                    GtkWidget* widget,
                                    GdkFrameClock* clock)
{
	G4Application* app = NULL;
	GtkApplication* _tmp0_;
	GtkApplication* _tmp1_;
	G4Application* _tmp2_;
	gdouble fraction = 0.0;
	G4Application* _tmp3_;
	G4MusicLoader* _tmp4_;
	G4MusicLoader* _tmp5_;
	gdouble _tmp6_;
	gdouble _tmp7_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (widget != NULL, FALSE);
	g_return_val_if_fail (clock != NULL, FALSE);
	_tmp0_ = gtk_window_get_application ((GtkWindow*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, G4_TYPE_APPLICATION, G4Application));
	app = _tmp2_;
	_tmp3_ = app;
	_tmp4_ = g4_application_get_loader (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = g4_music_loader_get_loading_progress (_tmp5_);
	_tmp7_ = _tmp6_;
	fraction = _tmp7_;
	if (fraction > ((gdouble) 0)) {
		GtkProgressBar* _tmp8_;
		_tmp8_ = self->priv->_progress_bar;
		gtk_progress_bar_set_fraction (_tmp8_, fraction);
	} else {
		GtkProgressBar* _tmp9_;
		_tmp9_ = self->priv->_progress_bar;
		gtk_progress_bar_pulse (_tmp9_);
	}
	result = TRUE;
	_g_object_unref0 (app);
	return result;
}

static gboolean
g4_window_on_overlay_child_position (G4Window* self,
                                     GtkWidget* widget,
                                     GdkRectangle* rect)
{
	GdkRectangle _vala_rect = {0};
	GtkProgressBar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (widget != NULL, FALSE);
	memset (&_vala_rect, 0, sizeof (GdkRectangle));
	_vala_rect.height = 0;
	_vala_rect.width = _vala_rect.height;
	_vala_rect.y = _vala_rect.width;
	_vala_rect.x = _vala_rect.y;
	_tmp0_ = self->priv->_progress_bar;
	if (widget == G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_widget_get_type (), GtkWidget)) {
		G4StorePanel* _tmp1_;
		GtkHeaderBar* _tmp2_;
		G4StorePanel* _tmp3_;
		_tmp1_ = self->priv->_store_panel;
		_tmp2_ = _tmp1_->header_bar;
		_vala_rect.y = gtk_widget_get_height ((GtkWidget*) _tmp2_);
		_tmp3_ = self->priv->_store_panel;
		_vala_rect.width = gtk_widget_get_width ((GtkWidget*) _tmp3_);
	}
	result = TRUE;
	if (rect) {
		*rect = _vala_rect;
	}
	return result;
}

static gboolean
__lambda133_ (G4Window* self,
              GdkDrop* drop)
{
	gboolean _tmp0_ = FALSE;
	GdkContentFormats* _tmp1_;
	GdkContentFormats* _tmp2_;
	gboolean result;
	g_return_val_if_fail (drop != NULL, FALSE);
	_tmp1_ = gdk_drop_get_formats (drop);
	_tmp2_ = _tmp1_;
	if (gdk_content_formats_contain_gtype (_tmp2_, gdk_file_list_get_type ())) {
		GdkContentFormats* _tmp3_;
		GdkContentFormats* _tmp4_;
		_tmp3_ = gdk_drop_get_formats (drop);
		_tmp4_ = _tmp3_;
		_tmp0_ = !gdk_content_formats_contain_gtype (_tmp4_, G4_TYPE_PLAYLIST);
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static gboolean
___lambda133__gtk_drop_target_accept (GtkDropTarget* _sender,
                                      GdkDrop* drop,
                                      gpointer self)
{
	gboolean result;
	result = __lambda133_ ((G4Window*) self, drop);
	return result;
}

static gboolean
_g4_window_on_file_dropped_gtk_drop_target_drop (GtkDropTarget* _sender,
                                                 GValue* value,
                                                 gdouble x,
                                                 gdouble y,
                                                 gpointer self)
{
	gboolean result;
	result = g4_window_on_file_dropped ((G4Window*) self, value, x, y);
	return result;
}

static void
g4_window_setup_drop_target (G4Window* self)
{
	GtkDropTarget* target = NULL;
	GtkDropTarget* _tmp0_;
	GType* _tmp1_;
	GType* _tmp2_;
	gint _tmp2__length1;
	GtkWidget* _tmp3_;
	GtkWidget* _tmp4_;
	GtkEventController* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_drop_target_new (G_TYPE_INVALID, GDK_ACTION_COPY | GDK_ACTION_LINK);
	target = _tmp0_;
	_tmp1_ = g_new0 (GType, 2);
	_tmp1_[0] = G_TYPE_STRING;
	_tmp1_[1] = gdk_file_list_get_type ();
	_tmp2_ = _tmp1_;
	_tmp2__length1 = 2;
	gtk_drop_target_set_gtypes (target, _tmp2_, (gsize) 2);
	_tmp2_ = (g_free (_tmp2_), NULL);
	g_signal_connect_object (target, "accept", (GCallback) ___lambda133__gtk_drop_target_accept, self, 0);
	g_signal_connect_object (target, "drop", (GCallback) _g4_window_on_file_dropped_gtk_drop_target_drop, self, 0);
	_tmp3_ = adw_application_window_get_content ((AdwApplicationWindow*) self);
	_tmp4_ = _tmp3_;
	_tmp5_ = _g_object_ref0 ((GtkEventController*) target);
	gtk_widget_add_controller (_tmp4_, _tmp5_);
	_g_object_unref0 (target);
}

static void
__lambda135_ (G4Window* self)
{
	g4_window_set_focused_visible (self, FALSE);
}

static void
___lambda135__gtk_event_controller_focus_enter (GtkEventControllerFocus* _sender,
                                                gpointer self)
{
	__lambda135_ ((G4Window*) self);
}

static void
g4_window_setup_focus_controller (G4Window* self)
{
	GtkEventControllerFocus* controller = NULL;
	GtkEventControllerFocus* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	GtkEventController* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = (GtkEventControllerFocus*) gtk_event_controller_focus_new ();
	controller = _tmp0_;
	g_signal_connect_object (controller, "enter", (GCallback) ___lambda135__gtk_event_controller_focus_enter, self, 0);
	_tmp1_ = adw_application_window_get_content ((AdwApplicationWindow*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 ((GtkEventController*) controller);
	gtk_widget_add_controller (_tmp2_, _tmp3_);
	g_object_bind_property_with_closures ((GObject*) self, "focus_visible", (GObject*) self, "focused_visible", 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)));
	g_object_bind_property_with_closures ((GObject*) self, "focus_widget", (GObject*) self, "focused_widget", 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)));
	_g_object_unref0 (controller);
}

static void
g4_window_button_command (G4Window* self,
                          GSimpleAction* action,
                          GVariant* parameter)
{
	GVariant* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* name = NULL;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	_tmp0_ = parameter;
	_tmp1_ = NULL;
	if (_tmp0_ != NULL) {
		const gchar* _tmp2_;
		_tmp2_ = g_variant_get_string ((GVariant*) _tmp0_, NULL);
		_tmp1_ = _tmp2_;
	}
	_tmp3_ = g_strdup (_tmp1_);
	name = _tmp3_;
	_tmp4_ = name;
	if (_tmp4_ != NULL) {
		G4StorePanel* _tmp5_;
		G4MusicList* _tmp6_;
		G4MusicList* _tmp7_;
		const gchar* _tmp8_;
		_tmp5_ = self->priv->_store_panel;
		_tmp6_ = g4_store_panel_get_current_list (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = name;
		g4_music_list_button_command (_tmp7_, (const gchar*) _tmp8_);
	}
	_g_free0 (name);
}

static void
g4_window_remove_from_list (G4Window* self,
                            GSimpleAction* action,
                            GVariant* parameter)
{
	G4Application* app = NULL;
	GtkApplication* _tmp0_;
	GtkApplication* _tmp1_;
	G4Application* _tmp2_;
	GVariant* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	gchar* uri = NULL;
	gchar* _tmp6_;
	G4Music* _tmp7_ = NULL;
	const gchar* _tmp8_;
	G4Music* music = NULL;
	G4Music* _tmp14_;
	G4Music* _tmp15_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	_tmp0_ = gtk_window_get_application ((GtkWindow*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, G4_TYPE_APPLICATION, G4Application));
	app = _tmp2_;
	_tmp3_ = parameter;
	_tmp4_ = NULL;
	if (_tmp3_ != NULL) {
		const gchar* _tmp5_;
		_tmp5_ = g_variant_get_string ((GVariant*) _tmp3_, NULL);
		_tmp4_ = _tmp5_;
	}
	_tmp6_ = g_strdup (_tmp4_);
	uri = _tmp6_;
	_tmp8_ = uri;
	if (_tmp8_ != NULL) {
		G4Application* _tmp9_;
		G4MusicLoader* _tmp10_;
		G4MusicLoader* _tmp11_;
		const gchar* _tmp12_;
		G4Music* _tmp13_;
		_tmp9_ = app;
		_tmp10_ = g4_application_get_loader (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = uri;
		_tmp13_ = g4_music_loader_find_cache (_tmp11_, (const gchar*) _tmp12_);
		_g_object_unref0 (_tmp7_);
		_tmp7_ = _tmp13_;
	} else {
		_g_object_unref0 (_tmp7_);
		_tmp7_ = NULL;
	}
	_tmp14_ = _tmp7_;
	_tmp7_ = NULL;
	music = _tmp14_;
	_tmp15_ = music;
	if (_tmp15_ != NULL) {
		G4StorePanel* _tmp16_;
		G4Music* _tmp17_;
		_tmp16_ = self->priv->_store_panel;
		_tmp17_ = music;
		g4_store_panel_remove_from_list (_tmp16_, G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, G4_TYPE_MUSIC, G4Music));
	}
	_g_object_unref0 (music);
	_g_object_unref0 (_tmp7_);
	_g_free0 (uri);
	_g_object_unref0 (app);
}

static void
g4_window_save_list (G4Window* self)
{
	G4StorePanel* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_store_panel;
	g4_store_panel_save_if_modified (_tmp0_, FALSE, NULL, NULL);
}

static const gchar**
_vala_array_dup11 (const gchar** self,
                   gssize length)
{
	if (length > 0) {
		return _vala_memdup2 (self, length * sizeof (const gchar*));
	}
	return NULL;
}

static void
g4_window_search_by (G4Window* self,
                     GSimpleAction* action,
                     GVariant* parameter)
{
	GVariant* _tmp0_ = NULL;
	const gchar** _tmp1_ = NULL;
	gint _tmp1__length1;
	gint __tmp1__size_;
	const gchar** strv = NULL;
	const gchar** _tmp4_;
	gint _tmp4__length1;
	gint strv_length1;
	gint _strv_size_;
	gboolean _tmp5_ = FALSE;
	const gchar** _tmp6_;
	gint _tmp6__length1;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	_tmp0_ = parameter;
	_tmp1_ = NULL;
	_tmp1__length1 = 0;
	__tmp1__size_ = _tmp1__length1;
	if (_tmp0_ != NULL) {
		gsize _tmp2_ = 0;
		const gchar** _tmp3_;
		_tmp3_ = g_variant_get_strv ((GVariant*) _tmp0_, &_tmp2_);
		_tmp1_ = (g_free (_tmp1_), NULL);
		_tmp1_ = _tmp3_;
		_tmp1__length1 = _tmp2_;
		__tmp1__size_ = _tmp1__length1;
	}
	_tmp4_ = _tmp1_;
	_tmp4__length1 = _tmp1__length1;
	_tmp1_ = NULL;
	_tmp1__length1 = 0;
	strv = _tmp4_;
	strv_length1 = _tmp4__length1;
	_strv_size_ = strv_length1;
	_tmp6_ = strv;
	_tmp6__length1 = strv_length1;
	if (_tmp6_ != NULL) {
		const gchar** _tmp7_;
		gint _tmp7__length1;
		_tmp7_ = strv;
		_tmp7__length1 = strv_length1;
		_tmp5_ = ((_tmp7__length1 * sizeof (const gchar*)) / sizeof (const gchar*)) > 1;
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		const gchar** arr = NULL;
		const gchar** _tmp8_;
		gint _tmp8__length1;
		const gchar** _tmp9_;
		gint _tmp9__length1;
		gint arr_length1;
		gint _arr_size_;
		gchar* text = NULL;
		const gchar** _tmp10_;
		gint _tmp10__length1;
		const gchar* _tmp11_;
		gchar* _tmp12_;
		guint mode = 0U;
		const gchar** _tmp13_;
		gint _tmp13__length1;
		const gchar* _tmp14_;
		_tmp8_ = strv;
		_tmp8__length1 = strv_length1;
		_tmp9_ = _vala_array_dup11 ((const gchar**) _tmp8_, (_tmp8__length1 * sizeof (const gchar*)) / sizeof (const gchar*));
		_tmp9__length1 = (_tmp8__length1 * sizeof (const gchar*)) / sizeof (const gchar*);
		arr = _tmp9_;
		arr_length1 = _tmp9__length1;
		_arr_size_ = arr_length1;
		_tmp10_ = arr;
		_tmp10__length1 = arr_length1;
		_tmp11_ = _tmp10_[0];
		_tmp12_ = g_strconcat (_tmp11_, ":", NULL);
		text = _tmp12_;
		mode = G4_SEARCH_MODE_ANY;
		g4_parse_search_mode (&text, &mode);
		_tmp13_ = arr;
		_tmp13__length1 = arr_length1;
		_tmp14_ = _tmp13_[1];
		g4_window_start_search (self, _tmp14_, mode);
		_g_free0 (text);
		arr = (g_free (arr), NULL);
	}
	strv = (g_free (strv), NULL);
	_tmp1_ = (g_free (_tmp1_), NULL);
}

static void
g4_window_start_select (G4Window* self)
{
	G4StorePanel* _tmp0_;
	G4MusicList* _tmp1_;
	G4MusicList* _tmp2_;
	G4Leaflet* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_store_panel;
	_tmp1_ = g4_store_panel_get_current_list (_tmp0_);
	_tmp2_ = _tmp1_;
	g4_music_list_set_multi_selection (_tmp2_, TRUE);
	_tmp3_ = self->priv->_leaflet;
	_tmp4_ = g4_leaflet_get_folded (_tmp3_);
	_tmp5_ = _tmp4_;
	if (_tmp5_) {
		G4Leaflet* _tmp6_;
		_tmp6_ = self->priv->_leaflet;
		g4_leaflet_pop (_tmp6_);
	}
}

static void
g4_window_toggle_search (G4Window* self)
{
	gboolean _tmp0_ = FALSE;
	G4StorePanel* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_store_panel;
	if (g4_store_panel_toggle_search (_tmp1_)) {
		G4Leaflet* _tmp2_;
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp2_ = self->priv->_leaflet;
		_tmp3_ = g4_leaflet_get_folded (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		G4Leaflet* _tmp5_;
		_tmp5_ = self->priv->_leaflet;
		g4_leaflet_pop (_tmp5_);
	}
}

static void
g4_window_update_background (G4Window* self)
{
	GdkPaintable* paintable = NULL;
	GdkPaintable* _tmp0_;
	GdkPaintable* _tmp1_;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_cover_paintable;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	paintable = _tmp1_;
	if (self->priv->_bkgnd_blur == G4_BLUR_MODE_ALWAYS) {
		GdkPaintable* _tmp4_;
		_tmp4_ = paintable;
		_tmp3_ = _tmp4_ != NULL;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		_tmp2_ = TRUE;
	} else {
		gboolean _tmp5_ = FALSE;
		if (self->priv->_bkgnd_blur == G4_BLUR_MODE_ART_ONLY) {
			GdkPaintable* _tmp6_;
			_tmp6_ = paintable;
			_tmp5_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, gdk_texture_get_type ());
		} else {
			_tmp5_ = FALSE;
		}
		_tmp2_ = _tmp5_;
	}
	if (_tmp2_) {
		G4CrossFadePaintable* _tmp7_;
		GdkPaintable* _tmp8_;
		GdkPaintable* _tmp9_;
		GdkPaintable* _tmp10_;
		_tmp7_ = self->priv->_bkgnd_paintable;
		_tmp8_ = paintable;
		_tmp9_ = g4_create_blur_paintable ((GtkWidget*) self, G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gdk_paintable_get_type (), GdkPaintable), self->priv->_blur_size, self->priv->_blur_size * 0.2, 0.25);
		_tmp10_ = _tmp9_;
		g4_base_paintable_set_paintable ((G4BasePaintable*) _tmp7_, _tmp10_);
		_g_object_unref0 (_tmp10_);
	} else {
		G4CrossFadePaintable* _tmp11_;
		_tmp11_ = self->priv->_bkgnd_paintable;
		g4_base_paintable_set_paintable ((G4BasePaintable*) _tmp11_, NULL);
	}
	_g_object_unref0 (paintable);
}

G4Window*
g4_window_get_default (void)
{
	G4Application* _tmp0_ = NULL;
	GApplication* _tmp1_;
	GtkWindow* _tmp2_ = NULL;
	G4Window* _tmp5_;
	G4Window* result;
	_tmp1_ = g_application_get_default ();
	_tmp0_ = G4_IS_APPLICATION (_tmp1_) ? ((G4Application*) _tmp1_) : NULL;
	_tmp2_ = NULL;
	if (_tmp0_ != NULL) {
		GtkWindow* _tmp3_;
		GtkWindow* _tmp4_;
		_tmp3_ = gtk_application_get_active_window ((GtkApplication*) G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, G4_TYPE_APPLICATION, G4Application));
		_tmp4_ = _tmp3_;
		_tmp2_ = _tmp4_;
	}
	_tmp5_ = _g_object_ref0 (G4_IS_WINDOW (_tmp2_) ? ((G4Window*) _tmp2_) : NULL);
	result = _tmp5_;
	return result;
}

guint
g4_window_get_blur_mode (G4Window* self)
{
	guint result;
	g_return_val_if_fail (self != NULL, 0U);
	result = self->priv->_bkgnd_blur;
	return result;
}

void
g4_window_set_blur_mode (G4Window* self,
                         guint value)
{
	g_return_if_fail (self != NULL);
	self->priv->_bkgnd_blur = value;
	if (gtk_widget_get_height ((GtkWidget*) self) > 0) {
		g4_window_update_background (self);
	}
	g_object_notify_by_pspec ((GObject *) self, g4_window_properties[G4_WINDOW_BLUR_MODE_PROPERTY]);
}

gboolean
g4_window_get_focused_visible (G4Window* self)
{
	gboolean result;
	gboolean _tmp0_;
	gboolean _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = gtk_window_get_focus_visible ((GtkWindow*) self);
	_tmp1_ = _tmp0_;
	result = _tmp1_;
	return result;
}

void
g4_window_set_focused_visible (G4Window* self,
                               gboolean value)
{
	g_return_if_fail (self != NULL);
	if (!value) {
		g4_window_focus_to_play_later (self, 100);
	}
	g_object_notify_by_pspec ((GObject *) self, g4_window_properties[G4_WINDOW_FOCUSED_VISIBLE_PROPERTY]);
}

GtkWidget*
g4_window_get_focused_widget (G4Window* self)
{
	GtkWidget* result;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	g_object_get ((GtkWindow*) self, "focus-widget", &_tmp0_, NULL);
	_tmp1_ = _tmp0_;
	result = _tmp1_;
	return result;
}

void
g4_window_set_focused_widget (G4Window* self,
                              GtkWidget* value)
{
	g_return_if_fail (self != NULL);
	if (!G_TYPE_CHECK_INSTANCE_TYPE (value, gtk_editable_get_type ())) {
		g4_window_focus_to_play_later (self, 2000);
	}
	g_object_notify_by_pspec ((GObject *) self, g4_window_properties[G4_WINDOW_FOCUSED_WIDGET_PROPERTY]);
}

static void
g4_window_class_init (G4WindowClass * klass,
                      gpointer klass_data)
{
	g4_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &G4Window_private_offset);
	((GtkWidgetClass *) klass)->snapshot = (void (*) (GtkWidget*, GtkSnapshot*)) g4_window_real_snapshot;
	G_OBJECT_CLASS (klass)->get_property = _vala_g4_window_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_g4_window_set_property;
	G_OBJECT_CLASS (klass)->finalize = g4_window_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), G4_WINDOW_BLUR_MODE_PROPERTY, g4_window_properties[G4_WINDOW_BLUR_MODE_PROPERTY] = g_param_spec_uint ("blur-mode", "blur-mode", "blur-mode", 0, G_MAXUINT, 0U, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), G4_WINDOW_FOCUSED_VISIBLE_PROPERTY, g4_window_properties[G4_WINDOW_FOCUSED_VISIBLE_PROPERTY] = g_param_spec_boolean ("focused-visible", "focused-visible", "focused-visible", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), G4_WINDOW_FOCUSED_WIDGET_PROPERTY, g4_window_properties[G4_WINDOW_FOCUSED_WIDGET_PROPERTY] = g_param_spec_object ("focused-widget", "focused-widget", "focused-widget", gtk_widget_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
g4_window_instance_init (G4Window * self,
                         gpointer klass)
{
	AdwToastOverlay* _tmp0_;
	G4Leaflet* _tmp1_;
	GtkProgressBar* _tmp2_;
	G4CrossFadePaintable* _tmp3_;
	self->priv = g4_window_get_instance_private (self);
	_tmp0_ = (AdwToastOverlay*) adw_toast_overlay_new ();
	g_object_ref_sink (_tmp0_);
	self->priv->_toast = _tmp0_;
	_tmp1_ = g4_leaflet_new ();
	g_object_ref_sink (_tmp1_);
	self->priv->_leaflet = _tmp1_;
	_tmp2_ = (GtkProgressBar*) gtk_progress_bar_new ();
	g_object_ref_sink (_tmp2_);
	self->priv->_progress_bar = _tmp2_;
	self->priv->_blur_size = 512;
	self->priv->_bkgnd_blur = G4_BLUR_MODE_ALWAYS;
	_tmp3_ = g4_cross_fade_paintable_new (NULL);
	self->priv->_bkgnd_paintable = _tmp3_;
	self->priv->_cover_paintable = NULL;
	self->priv->_fade_animation = NULL;
	self->priv->_loading = FALSE;
	self->priv->_tick_handler = (guint) 0;
}

static void
g4_window_finalize (GObject * obj)
{
	G4Window * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, G4_TYPE_WINDOW, G4Window);
	_g_object_unref0 (self->priv->_toast);
	_g_object_unref0 (self->priv->_leaflet);
	_g_object_unref0 (self->priv->_progress_bar);
	_g_object_unref0 (self->priv->_play_panel);
	_g_object_unref0 (self->priv->_store_panel);
	_g_object_unref0 (self->priv->_bkgnd_paintable);
	_g_object_unref0 (self->priv->_cover_paintable);
	_g_object_unref0 (self->priv->_fade_animation);
	G_OBJECT_CLASS (g4_window_parent_class)->finalize (obj);
}

static GType
g4_window_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (G4WindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) g4_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (G4Window), 0, (GInstanceInitFunc) g4_window_instance_init, NULL };
	GType g4_window_type_id;
	g4_window_type_id = g_type_register_static (adw_application_window_get_type (), "G4Window", &g_define_type_info, 0);
	G4Window_private_offset = g_type_add_instance_private (g4_window_type_id, sizeof (G4WindowPrivate));
	return g4_window_type_id;
}

GType
g4_window_get_type (void)
{
	static volatile gsize g4_window_type_id__once = 0;
	if (g_once_init_enter (&g4_window_type_id__once)) {
		GType g4_window_type_id;
		g4_window_type_id = g4_window_get_type_once ();
		g_once_init_leave (&g4_window_type_id__once, g4_window_type_id);
	}
	return g4_window_type_id__once;
}

static void
_vala_g4_window_get_property (GObject * object,
                              guint property_id,
                              GValue * value,
                              GParamSpec * pspec)
{
	G4Window * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, G4_TYPE_WINDOW, G4Window);
	switch (property_id) {
		case G4_WINDOW_BLUR_MODE_PROPERTY:
		g_value_set_uint (value, g4_window_get_blur_mode (self));
		break;
		case G4_WINDOW_FOCUSED_VISIBLE_PROPERTY:
		g_value_set_boolean (value, g4_window_get_focused_visible (self));
		break;
		case G4_WINDOW_FOCUSED_WIDGET_PROPERTY:
		g_value_take_object (value, g4_window_get_focused_widget (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_g4_window_set_property (GObject * object,
                              guint property_id,
                              const GValue * value,
                              GParamSpec * pspec)
{
	G4Window * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, G4_TYPE_WINDOW, G4Window);
	switch (property_id) {
		case G4_WINDOW_BLUR_MODE_PROPERTY:
		g4_window_set_blur_mode (self, g_value_get_uint (value));
		break;
		case G4_WINDOW_FOCUSED_VISIBLE_PROPERTY:
		g4_window_set_focused_visible (self, g_value_get_boolean (value));
		break;
		case G4_WINDOW_FOCUSED_WIDGET_PROPERTY:
		g4_window_set_focused_widget (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

GtkButton*
g4_find_button_by_action_name (GtkWidget* widget,
                               const gchar* action)
{
	GtkButton* result;
	g_return_val_if_fail (widget != NULL, NULL);
	g_return_val_if_fail (action != NULL, NULL);
	{
		GtkWidget* child = NULL;
		GtkWidget* _tmp0_;
		GtkWidget* _tmp1_;
		_tmp0_ = gtk_widget_get_first_child (widget);
		_tmp1_ = _g_object_ref0 (_tmp0_);
		child = _tmp1_;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				GtkWidget* _tmp8_;
				GtkWidget* _tmp9_;
				if (!_tmp2_) {
					GtkWidget* _tmp3_ = NULL;
					GtkWidget* _tmp4_;
					GtkWidget* _tmp5_ = NULL;
					GtkWidget* _tmp7_;
					_tmp4_ = child;
					_tmp3_ = _tmp4_;
					_tmp5_ = NULL;
					if (_tmp3_ != NULL) {
						GtkWidget* _tmp6_;
						_tmp6_ = gtk_widget_get_next_sibling (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_widget_get_type (), GtkWidget));
						_tmp5_ = _tmp6_;
					}
					_tmp7_ = _g_object_ref0 (_tmp5_);
					_g_object_unref0 (child);
					child = _tmp7_;
				}
				_tmp2_ = FALSE;
				_tmp8_ = child;
				if (!(_tmp8_ != NULL)) {
					break;
				}
				_tmp9_ = child;
				if (!gtk_widget_is_drawable (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_widget_get_type (), GtkWidget))) {
					continue;
				} else {
					GtkWidget* _tmp10_;
					_tmp10_ = child;
					if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp10_, gtk_button_get_type ())) {
						GtkButton* button = NULL;
						GtkWidget* _tmp11_;
						GtkButton* _tmp12_;
						GtkButton* _tmp13_;
						const gchar* _tmp14_;
						const gchar* _tmp15_;
						_tmp11_ = child;
						_tmp12_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gtk_button_get_type (), GtkButton));
						button = _tmp12_;
						_tmp13_ = button;
						_tmp14_ = gtk_actionable_get_action_name ((GtkActionable*) _tmp13_);
						_tmp15_ = _tmp14_;
						if (g_strcmp0 (_tmp15_, action) == 0) {
							result = button;
							_g_object_unref0 (child);
							return result;
						}
						_g_object_unref0 (button);
					} else {
						GtkButton* button = NULL;
						GtkWidget* _tmp16_;
						GtkButton* _tmp17_;
						GtkButton* _tmp18_;
						_tmp16_ = child;
						_tmp17_ = g4_find_button_by_action_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, gtk_widget_get_type (), GtkWidget), action);
						button = _tmp17_;
						_tmp18_ = button;
						if (_tmp18_ != NULL) {
							result = button;
							_g_object_unref0 (child);
							return result;
						}
						_g_object_unref0 (button);
					}
				}
			}
		}
		_g_object_unref0 (child);
	}
	result = NULL;
	return result;
}

GFile**
g4_get_dropped_files (GValue* value,
                      gint* result_length1)
{
	GFile** files = NULL;
	GFile** _tmp0_;
	gint files_length1;
	gint _files_size_;
	GType type = G_TYPE_NONE;
	GFile** _tmp23_;
	gint _tmp23__length1;
	GFile** result;
	g_return_val_if_fail (value != NULL, NULL);
	_tmp0_ = g_new0 (GFile*, 0 + 1);
	files = _tmp0_;
	files_length1 = 0;
	_files_size_ = files_length1;
	type = G_VALUE_TYPE (value);
	if (type == G_TYPE_STRING) {
		gchar* text = NULL;
		const gchar* _tmp1_;
		gchar* _tmp2_;
		gchar** list = NULL;
		const gchar* _tmp3_;
		gchar** _tmp4_;
		gchar** _tmp5_;
		gint list_length1;
		gint _list_size_;
		gchar** _tmp6_;
		gint _tmp6__length1;
		GFile** _tmp7_;
		gint index = 0;
		gchar** _tmp8_;
		gint _tmp8__length1;
		_tmp1_ = g_value_get_string (value);
		_tmp2_ = g_strdup (_tmp1_);
		text = _tmp2_;
		_tmp3_ = text;
		_tmp5_ = _tmp4_ = g_strsplit_set (_tmp3_, "\n", 0);
		list = _tmp5_;
		list_length1 = _vala_array_length (_tmp4_);
		_list_size_ = list_length1;
		_tmp6_ = list;
		_tmp6__length1 = list_length1;
		_tmp7_ = g_new0 (GFile*, _tmp6__length1 + 1);
		files = (_vala_array_free (files, files_length1, (GDestroyNotify) g_object_unref), NULL);
		files = _tmp7_;
		files_length1 = _tmp6__length1;
		_files_size_ = files_length1;
		index = 0;
		_tmp8_ = list;
		_tmp8__length1 = list_length1;
		{
			gchar** path_collection = NULL;
			gint path_collection_length1 = 0;
			gint _path_collection_size_ = 0;
			gint path_it = 0;
			path_collection = _tmp8_;
			path_collection_length1 = _tmp8__length1;
			for (path_it = 0; path_it < path_collection_length1; path_it = path_it + 1) {
				gchar* _tmp9_;
				gchar* path = NULL;
				_tmp9_ = g_strdup (path_collection[path_it]);
				path = _tmp9_;
				{
					GFile** _tmp10_;
					gint _tmp10__length1;
					gint _tmp11_;
					const gchar* _tmp12_;
					GFile* _tmp13_;
					_tmp10_ = files;
					_tmp10__length1 = files_length1;
					_tmp11_ = index;
					index = _tmp11_ + 1;
					_tmp12_ = path;
					_tmp13_ = g_file_new_for_path (_tmp12_);
					_g_object_unref0 (_tmp10_[_tmp11_]);
					_tmp10_[_tmp11_] = _tmp13_;
					_g_free0 (path);
				}
			}
		}
		list = (_vala_array_free (list, list_length1, (GDestroyNotify) g_free), NULL);
		_g_free0 (text);
	} else {
		if (type == gdk_file_list_get_type ()) {
			GSList* list = NULL;
			GValue _tmp14_;
			GSList* _tmp15_;
			GSList* _tmp16_;
			GFile** _tmp17_;
			gint index = 0;
			GSList* _tmp18_;
			_tmp14_ = *value;
			_tmp15_ = gdk_file_list_get_files (g_value_get_boxed (&_tmp14_));
			list = _tmp15_;
			_tmp16_ = list;
			_tmp17_ = g_new0 (GFile*, g_slist_length (_tmp16_) + 1);
			files = (_vala_array_free (files, files_length1, (GDestroyNotify) g_object_unref), NULL);
			files = _tmp17_;
			files_length1 = g_slist_length (_tmp16_);
			_files_size_ = files_length1;
			index = 0;
			_tmp18_ = list;
			{
				GSList* file_collection = NULL;
				GSList* file_it = NULL;
				file_collection = _tmp18_;
				for (file_it = file_collection; file_it != NULL; file_it = file_it->next) {
					GFile* file = NULL;
					file = (GFile*) file_it->data;
					{
						GFile** _tmp19_;
						gint _tmp19__length1;
						gint _tmp20_;
						GFile* _tmp21_;
						GFile* _tmp22_;
						_tmp19_ = files;
						_tmp19__length1 = files_length1;
						_tmp20_ = index;
						index = _tmp20_ + 1;
						_tmp21_ = file;
						_tmp22_ = _g_object_ref0 (_tmp21_);
						_g_object_unref0 (_tmp19_[_tmp20_]);
						_tmp19_[_tmp20_] = _tmp22_;
					}
				}
			}
			(list == NULL) ? NULL : (list = (g_slist_free (list), NULL));
		}
	}
	_tmp23_ = files;
	_tmp23__length1 = files_length1;
	if (result_length1) {
		*result_length1 = _tmp23__length1;
	}
	result = _tmp23_;
	return result;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

