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

/* window.vala
 *
 * Copyright (C) Red Hat, Inc
 *
 * 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/>.
 *
 * Author: Felipe Borges <felipeborges@gnome.org>
 *
 */

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

#define CONNECTIONS_WINDOW_configure_id_timeout ((guint) 100)
#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 CONNECTIONS_TYPE_WINDOW (connections_window_get_type ())
#define CONNECTIONS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONNECTIONS_TYPE_WINDOW, ConnectionsWindow))
#define CONNECTIONS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONNECTIONS_TYPE_WINDOW, ConnectionsWindowClass))
#define CONNECTIONS_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONNECTIONS_TYPE_WINDOW))
#define CONNECTIONS_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONNECTIONS_TYPE_WINDOW))
#define CONNECTIONS_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONNECTIONS_TYPE_WINDOW, ConnectionsWindowClass))

typedef struct _ConnectionsWindow ConnectionsWindow;
typedef struct _ConnectionsWindowClass ConnectionsWindowClass;
typedef struct _ConnectionsWindowPrivate ConnectionsWindowPrivate;

#define CONNECTIONS_TYPE_COLLECTION_VIEW (connections_collection_view_get_type ())
#define CONNECTIONS_COLLECTION_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONNECTIONS_TYPE_COLLECTION_VIEW, ConnectionsCollectionView))
#define CONNECTIONS_COLLECTION_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONNECTIONS_TYPE_COLLECTION_VIEW, ConnectionsCollectionViewClass))
#define CONNECTIONS_IS_COLLECTION_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONNECTIONS_TYPE_COLLECTION_VIEW))
#define CONNECTIONS_IS_COLLECTION_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONNECTIONS_TYPE_COLLECTION_VIEW))
#define CONNECTIONS_COLLECTION_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONNECTIONS_TYPE_COLLECTION_VIEW, ConnectionsCollectionViewClass))

typedef struct _ConnectionsCollectionView ConnectionsCollectionView;
typedef struct _ConnectionsCollectionViewClass ConnectionsCollectionViewClass;

#define CONNECTIONS_TYPE_NOTIFICATIONS_BAR (connections_notifications_bar_get_type ())
#define CONNECTIONS_NOTIFICATIONS_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONNECTIONS_TYPE_NOTIFICATIONS_BAR, ConnectionsNotificationsBar))
#define CONNECTIONS_NOTIFICATIONS_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONNECTIONS_TYPE_NOTIFICATIONS_BAR, ConnectionsNotificationsBarClass))
#define CONNECTIONS_IS_NOTIFICATIONS_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONNECTIONS_TYPE_NOTIFICATIONS_BAR))
#define CONNECTIONS_IS_NOTIFICATIONS_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONNECTIONS_TYPE_NOTIFICATIONS_BAR))
#define CONNECTIONS_NOTIFICATIONS_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONNECTIONS_TYPE_NOTIFICATIONS_BAR, ConnectionsNotificationsBarClass))

typedef struct _ConnectionsNotificationsBar ConnectionsNotificationsBar;
typedef struct _ConnectionsNotificationsBarClass ConnectionsNotificationsBarClass;

#define CONNECTIONS_TYPE_DIALOGS_WINDOW (connections_dialogs_window_get_type ())
#define CONNECTIONS_DIALOGS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONNECTIONS_TYPE_DIALOGS_WINDOW, ConnectionsDialogsWindow))
#define CONNECTIONS_DIALOGS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONNECTIONS_TYPE_DIALOGS_WINDOW, ConnectionsDialogsWindowClass))
#define CONNECTIONS_IS_DIALOGS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONNECTIONS_TYPE_DIALOGS_WINDOW))
#define CONNECTIONS_IS_DIALOGS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONNECTIONS_TYPE_DIALOGS_WINDOW))
#define CONNECTIONS_DIALOGS_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONNECTIONS_TYPE_DIALOGS_WINDOW, ConnectionsDialogsWindowClass))

typedef struct _ConnectionsDialogsWindow ConnectionsDialogsWindow;
typedef struct _ConnectionsDialogsWindowClass ConnectionsDialogsWindowClass;

#define CONNECTIONS_TYPE_TOPBAR (connections_topbar_get_type ())
#define CONNECTIONS_TOPBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONNECTIONS_TYPE_TOPBAR, ConnectionsTopbar))
#define CONNECTIONS_TOPBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONNECTIONS_TYPE_TOPBAR, ConnectionsTopbarClass))
#define CONNECTIONS_IS_TOPBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONNECTIONS_TYPE_TOPBAR))
#define CONNECTIONS_IS_TOPBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONNECTIONS_TYPE_TOPBAR))
#define CONNECTIONS_TOPBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONNECTIONS_TYPE_TOPBAR, ConnectionsTopbarClass))

typedef struct _ConnectionsTopbar ConnectionsTopbar;
typedef struct _ConnectionsTopbarClass ConnectionsTopbarClass;

#define CONNECTIONS_TYPE_DISPLAY_VIEW (connections_display_view_get_type ())
#define CONNECTIONS_DISPLAY_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONNECTIONS_TYPE_DISPLAY_VIEW, ConnectionsDisplayView))
#define CONNECTIONS_DISPLAY_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONNECTIONS_TYPE_DISPLAY_VIEW, ConnectionsDisplayViewClass))
#define CONNECTIONS_IS_DISPLAY_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONNECTIONS_TYPE_DISPLAY_VIEW))
#define CONNECTIONS_IS_DISPLAY_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONNECTIONS_TYPE_DISPLAY_VIEW))
#define CONNECTIONS_DISPLAY_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONNECTIONS_TYPE_DISPLAY_VIEW, ConnectionsDisplayViewClass))

typedef struct _ConnectionsDisplayView ConnectionsDisplayView;
typedef struct _ConnectionsDisplayViewClass ConnectionsDisplayViewClass;
enum  {
	CONNECTIONS_WINDOW_0_PROPERTY,
	CONNECTIONS_WINDOW_FULLSCREENED_PROPERTY,
	CONNECTIONS_WINDOW_NUM_PROPERTIES
};
static GParamSpec* connections_window_properties[CONNECTIONS_WINDOW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define CONNECTIONS_TYPE_APPLICATION (connections_application_get_type ())
#define CONNECTIONS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONNECTIONS_TYPE_APPLICATION, ConnectionsApplication))
#define CONNECTIONS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONNECTIONS_TYPE_APPLICATION, ConnectionsApplicationClass))
#define CONNECTIONS_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONNECTIONS_TYPE_APPLICATION))
#define CONNECTIONS_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONNECTIONS_TYPE_APPLICATION))
#define CONNECTIONS_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONNECTIONS_TYPE_APPLICATION, ConnectionsApplicationClass))

typedef struct _ConnectionsApplication ConnectionsApplication;
typedef struct _ConnectionsApplicationClass ConnectionsApplicationClass;
typedef struct _ConnectionsApplicationPrivate ConnectionsApplicationPrivate;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _ConnectionsTopbarPrivate ConnectionsTopbarPrivate;

#define CONNECTIONS_TYPE_ASSISTANT (connections_assistant_get_type ())
#define CONNECTIONS_ASSISTANT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONNECTIONS_TYPE_ASSISTANT, ConnectionsAssistant))
#define CONNECTIONS_ASSISTANT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONNECTIONS_TYPE_ASSISTANT, ConnectionsAssistantClass))
#define CONNECTIONS_IS_ASSISTANT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONNECTIONS_TYPE_ASSISTANT))
#define CONNECTIONS_IS_ASSISTANT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONNECTIONS_TYPE_ASSISTANT))
#define CONNECTIONS_ASSISTANT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONNECTIONS_TYPE_ASSISTANT, ConnectionsAssistantClass))

typedef struct _ConnectionsAssistant ConnectionsAssistant;
typedef struct _ConnectionsAssistantClass ConnectionsAssistantClass;
typedef struct _ConnectionsCollectionViewPrivate ConnectionsCollectionViewPrivate;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
typedef struct _Block7Data Block7Data;

#define CONNECTIONS_TYPE_CONNECTION (connections_connection_get_type ())
#define CONNECTIONS_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONNECTIONS_TYPE_CONNECTION, ConnectionsConnection))
#define CONNECTIONS_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONNECTIONS_TYPE_CONNECTION, ConnectionsConnectionClass))
#define CONNECTIONS_IS_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONNECTIONS_TYPE_CONNECTION))
#define CONNECTIONS_IS_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONNECTIONS_TYPE_CONNECTION))
#define CONNECTIONS_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONNECTIONS_TYPE_CONNECTION, ConnectionsConnectionClass))

typedef struct _ConnectionsConnection ConnectionsConnection;
typedef struct _ConnectionsConnectionClass ConnectionsConnectionClass;
typedef struct _ConnectionsConnectionPrivate ConnectionsConnectionPrivate;

#define CONNECTIONS_TYPE_VNC_CONNECTION (connections_vnc_connection_get_type ())
#define CONNECTIONS_VNC_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONNECTIONS_TYPE_VNC_CONNECTION, ConnectionsVncConnection))
#define CONNECTIONS_VNC_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONNECTIONS_TYPE_VNC_CONNECTION, ConnectionsVncConnectionClass))
#define CONNECTIONS_IS_VNC_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONNECTIONS_TYPE_VNC_CONNECTION))
#define CONNECTIONS_IS_VNC_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONNECTIONS_TYPE_VNC_CONNECTION))
#define CONNECTIONS_VNC_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONNECTIONS_TYPE_VNC_CONNECTION, ConnectionsVncConnectionClass))

typedef struct _ConnectionsVncConnection ConnectionsVncConnection;
typedef struct _ConnectionsVncConnectionClass ConnectionsVncConnectionClass;

#define CONNECTIONS_TYPE_PREFERENCES_WINDOW (connections_preferences_window_get_type ())
#define CONNECTIONS_PREFERENCES_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONNECTIONS_TYPE_PREFERENCES_WINDOW, ConnectionsPreferencesWindow))
#define CONNECTIONS_PREFERENCES_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONNECTIONS_TYPE_PREFERENCES_WINDOW, ConnectionsPreferencesWindowClass))
#define CONNECTIONS_IS_PREFERENCES_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONNECTIONS_TYPE_PREFERENCES_WINDOW))
#define CONNECTIONS_IS_PREFERENCES_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONNECTIONS_TYPE_PREFERENCES_WINDOW))
#define CONNECTIONS_PREFERENCES_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONNECTIONS_TYPE_PREFERENCES_WINDOW, ConnectionsPreferencesWindowClass))

typedef struct _ConnectionsPreferencesWindow ConnectionsPreferencesWindow;
typedef struct _ConnectionsPreferencesWindowClass ConnectionsPreferencesWindowClass;

#define CONNECTIONS_TYPE_VNC_PREFERENCES_WINDOW (connections_vnc_preferences_window_get_type ())
#define CONNECTIONS_VNC_PREFERENCES_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONNECTIONS_TYPE_VNC_PREFERENCES_WINDOW, ConnectionsVncPreferencesWindow))
#define CONNECTIONS_VNC_PREFERENCES_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONNECTIONS_TYPE_VNC_PREFERENCES_WINDOW, ConnectionsVncPreferencesWindowClass))
#define CONNECTIONS_IS_VNC_PREFERENCES_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONNECTIONS_TYPE_VNC_PREFERENCES_WINDOW))
#define CONNECTIONS_IS_VNC_PREFERENCES_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONNECTIONS_TYPE_VNC_PREFERENCES_WINDOW))
#define CONNECTIONS_VNC_PREFERENCES_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONNECTIONS_TYPE_VNC_PREFERENCES_WINDOW, ConnectionsVncPreferencesWindowClass))

typedef struct _ConnectionsVncPreferencesWindow ConnectionsVncPreferencesWindow;
typedef struct _ConnectionsVncPreferencesWindowClass ConnectionsVncPreferencesWindowClass;

#define CONNECTIONS_TYPE_RDP_CONNECTION (connections_rdp_connection_get_type ())
#define CONNECTIONS_RDP_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONNECTIONS_TYPE_RDP_CONNECTION, ConnectionsRdpConnection))
#define CONNECTIONS_RDP_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONNECTIONS_TYPE_RDP_CONNECTION, ConnectionsRdpConnectionClass))
#define CONNECTIONS_IS_RDP_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONNECTIONS_TYPE_RDP_CONNECTION))
#define CONNECTIONS_IS_RDP_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONNECTIONS_TYPE_RDP_CONNECTION))
#define CONNECTIONS_RDP_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONNECTIONS_TYPE_RDP_CONNECTION, ConnectionsRdpConnectionClass))

typedef struct _ConnectionsRdpConnection ConnectionsRdpConnection;
typedef struct _ConnectionsRdpConnectionClass ConnectionsRdpConnectionClass;

#define CONNECTIONS_TYPE_RDP_PREFERENCES_WINDOW (connections_rdp_preferences_window_get_type ())
#define CONNECTIONS_RDP_PREFERENCES_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONNECTIONS_TYPE_RDP_PREFERENCES_WINDOW, ConnectionsRdpPreferencesWindow))
#define CONNECTIONS_RDP_PREFERENCES_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONNECTIONS_TYPE_RDP_PREFERENCES_WINDOW, ConnectionsRdpPreferencesWindowClass))
#define CONNECTIONS_IS_RDP_PREFERENCES_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONNECTIONS_TYPE_RDP_PREFERENCES_WINDOW))
#define CONNECTIONS_IS_RDP_PREFERENCES_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONNECTIONS_TYPE_RDP_PREFERENCES_WINDOW))
#define CONNECTIONS_RDP_PREFERENCES_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONNECTIONS_TYPE_RDP_PREFERENCES_WINDOW, ConnectionsRdpPreferencesWindowClass))

typedef struct _ConnectionsRdpPreferencesWindow ConnectionsRdpPreferencesWindow;
typedef struct _ConnectionsRdpPreferencesWindowClass ConnectionsRdpPreferencesWindowClass;

#define CONNECTIONS_TYPE_SPICE_CONNECTION (connections_spice_connection_get_type ())
#define CONNECTIONS_SPICE_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONNECTIONS_TYPE_SPICE_CONNECTION, ConnectionsSpiceConnection))
#define CONNECTIONS_SPICE_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONNECTIONS_TYPE_SPICE_CONNECTION, ConnectionsSpiceConnectionClass))
#define CONNECTIONS_IS_SPICE_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONNECTIONS_TYPE_SPICE_CONNECTION))
#define CONNECTIONS_IS_SPICE_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONNECTIONS_TYPE_SPICE_CONNECTION))
#define CONNECTIONS_SPICE_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONNECTIONS_TYPE_SPICE_CONNECTION, ConnectionsSpiceConnectionClass))

typedef struct _ConnectionsSpiceConnection ConnectionsSpiceConnection;
typedef struct _ConnectionsSpiceConnectionClass ConnectionsSpiceConnectionClass;

#define CONNECTIONS_TYPE_SPICE_PREFERENCES_WINDOW (connections_spice_preferences_window_get_type ())
#define CONNECTIONS_SPICE_PREFERENCES_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONNECTIONS_TYPE_SPICE_PREFERENCES_WINDOW, ConnectionsSpicePreferencesWindow))
#define CONNECTIONS_SPICE_PREFERENCES_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONNECTIONS_TYPE_SPICE_PREFERENCES_WINDOW, ConnectionsSpicePreferencesWindowClass))
#define CONNECTIONS_IS_SPICE_PREFERENCES_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONNECTIONS_TYPE_SPICE_PREFERENCES_WINDOW))
#define CONNECTIONS_IS_SPICE_PREFERENCES_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONNECTIONS_TYPE_SPICE_PREFERENCES_WINDOW))
#define CONNECTIONS_SPICE_PREFERENCES_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONNECTIONS_TYPE_SPICE_PREFERENCES_WINDOW, ConnectionsSpicePreferencesWindowClass))

typedef struct _ConnectionsSpicePreferencesWindow ConnectionsSpicePreferencesWindow;
typedef struct _ConnectionsSpicePreferencesWindowClass ConnectionsSpicePreferencesWindowClass;

struct _ConnectionsWindow {
	GtkApplicationWindow parent_instance;
	ConnectionsWindowPrivate * priv;
	ConnectionsCollectionView* collection_view;
	ConnectionsNotificationsBar* notifications_bar;
	ConnectionsDialogsWindow* dialogs_window;
};

struct _ConnectionsWindowClass {
	GtkApplicationWindowClass parent_class;
};

struct _ConnectionsWindowPrivate {
	ConnectionsTopbar* topbar;
	GtkStack* stack;
	HdyStatusPage* empty_view;
	ConnectionsDisplayView* display_view;
	guint configure_id;
};

struct _ConnectionsApplication {
	GtkApplication parent_instance;
	ConnectionsApplicationPrivate * priv;
	GListStore* model;
	GSettings* settings;
};

struct _ConnectionsApplicationClass {
	GtkApplicationClass parent_class;
};

struct _ConnectionsTopbar {
	GtkStack parent_instance;
	ConnectionsTopbarPrivate * priv;
	GtkButton* search_button;
	ConnectionsAssistant* assistant;
};

struct _ConnectionsTopbarClass {
	GtkStackClass parent_class;
};

struct _ConnectionsCollectionView {
	GtkScrolledWindow parent_instance;
	ConnectionsCollectionViewPrivate * priv;
	GtkSearchBar* search_bar;
};

struct _ConnectionsCollectionViewClass {
	GtkScrolledWindowClass parent_class;
};

struct _Block7Data {
	int _ref_count_;
	ConnectionsWindow* self;
	GListModel* model;
};

struct _ConnectionsConnection {
	GObject parent_instance;
	ConnectionsConnectionPrivate * priv;
	gchar* uuid;
	gboolean connected;
	gboolean need_password;
	gboolean need_username;
	gboolean need_domain;
};

struct _ConnectionsConnectionClass {
	GObjectClass parent_class;
	void (*send_keys) (ConnectionsConnection* self, guint* keys, gint keys_length1);
	void (*connect_it) (ConnectionsConnection* self);
	void (*disconnect_it) (ConnectionsConnection* self);
	void (*dispose_display) (ConnectionsConnection* self);
	GtkWidget* (*get_widget) (ConnectionsConnection* self);
	void (*set_widget) (ConnectionsConnection* self, GtkWidget* value);
	gboolean (*get_scaling) (ConnectionsConnection* self);
	void (*set_scaling) (ConnectionsConnection* self, gboolean value);
	gint (*get_port) (ConnectionsConnection* self);
	void (*set_port) (ConnectionsConnection* self, gint value);
	GdkPixbuf* (*get_thumbnail) (ConnectionsConnection* self);
	void (*set_thumbnail) (ConnectionsConnection* self, GdkPixbuf* value);
};

static gint ConnectionsWindow_private_offset;
static gpointer connections_window_parent_class = NULL;
VALA_EXTERN ConnectionsApplication* connections_application_application;

VALA_EXTERN GType connections_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConnectionsWindow, g_object_unref)
VALA_EXTERN GType connections_collection_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConnectionsCollectionView, g_object_unref)
VALA_EXTERN GType connections_notifications_bar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConnectionsNotificationsBar, g_object_unref)
VALA_EXTERN GType connections_dialogs_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConnectionsDialogsWindow, g_object_unref)
VALA_EXTERN GType connections_topbar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConnectionsTopbar, g_object_unref)
VALA_EXTERN GType connections_display_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConnectionsDisplayView, g_object_unref)
VALA_EXTERN ConnectionsWindow* connections_window_new (GtkApplication* app);
VALA_EXTERN ConnectionsWindow* connections_window_construct (GType object_type,
                                                 GtkApplication* app);
VALA_EXTERN void connections_window_bind_model (ConnectionsWindow* self,
                                    GListModel* model);
VALA_EXTERN GType connections_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConnectionsApplication, g_object_unref)
VALA_EXTERN void connections_window_items_changed (ConnectionsWindow* self);
static void _connections_window_items_changed_g_list_model_items_changed (GListModel* _sender,
                                                                   guint position,
                                                                   guint removed,
                                                                   guint added,
                                                                   gpointer self);
VALA_EXTERN ConnectionsDialogsWindow* connections_dialogs_window_new (void);
VALA_EXTERN ConnectionsDialogsWindow* connections_dialogs_window_construct (GType object_type);
VALA_EXTERN GType connections_assistant_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConnectionsAssistant, g_object_unref)
static gint _variant_get1 (GVariant* value);
static gint _variant_get2 (GVariant* value);
static Block7Data* block7_data_ref (Block7Data* _data7_);
static void block7_data_unref (void * _userdata_);
VALA_EXTERN void connections_collection_view_bind_model (ConnectionsCollectionView* self,
                                             GListModel* model);
static void __lambda26_ (Block7Data* _data7_);
static void ___lambda26__g_list_model_items_changed (GListModel* _sender,
                                              guint position,
                                              guint removed,
                                              guint added,
                                              gpointer self);
VALA_EXTERN GType connections_connection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConnectionsConnection, g_object_unref)
VALA_EXTERN void connections_window_open_connection (ConnectionsWindow* self,
                                         ConnectionsConnection* connection);
VALA_EXTERN void connections_topbar_show_display_view (ConnectionsTopbar* self,
                                           ConnectionsConnection* connection);
VALA_EXTERN void connections_display_view_connect_to (ConnectionsDisplayView* self,
                                          ConnectionsConnection* connection);
VALA_EXTERN void connections_display_view_switch_to (ConnectionsDisplayView* self,
                                         ConnectionsConnection* connection);
VALA_EXTERN void connections_window_show_collection_view (ConnectionsWindow* self);
VALA_EXTERN void connections_topbar_show_collection_view (ConnectionsTopbar* self);
VALA_EXTERN void connections_topbar_set_title (ConnectionsTopbar* self,
                                   const gchar* title);
VALA_EXTERN void connections_window_show_preferences_window (ConnectionsWindow* self,
                                                 ConnectionsConnection* connection);
VALA_EXTERN GType connections_vnc_connection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConnectionsVncConnection, g_object_unref)
VALA_EXTERN ConnectionsVncPreferencesWindow* connections_vnc_preferences_window_new (ConnectionsConnection* connection);
VALA_EXTERN ConnectionsVncPreferencesWindow* connections_vnc_preferences_window_construct (GType object_type,
                                                                               ConnectionsConnection* connection);
VALA_EXTERN GType connections_preferences_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConnectionsPreferencesWindow, g_object_unref)
VALA_EXTERN GType connections_vnc_preferences_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConnectionsVncPreferencesWindow, g_object_unref)
VALA_EXTERN GType connections_rdp_connection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConnectionsRdpConnection, g_object_unref)
VALA_EXTERN ConnectionsRdpPreferencesWindow* connections_rdp_preferences_window_new (ConnectionsConnection* connection);
VALA_EXTERN ConnectionsRdpPreferencesWindow* connections_rdp_preferences_window_construct (GType object_type,
                                                                               ConnectionsConnection* connection);
VALA_EXTERN GType connections_rdp_preferences_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConnectionsRdpPreferencesWindow, g_object_unref)
VALA_EXTERN GType connections_spice_connection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConnectionsSpiceConnection, g_object_unref)
VALA_EXTERN ConnectionsSpicePreferencesWindow* connections_spice_preferences_window_new (ConnectionsConnection* connection);
VALA_EXTERN ConnectionsSpicePreferencesWindow* connections_spice_preferences_window_construct (GType object_type,
                                                                                   ConnectionsConnection* connection);
VALA_EXTERN GType connections_spice_preferences_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConnectionsSpicePreferencesWindow, g_object_unref)
VALA_EXTERN gchar* connections_connection_get_uri (ConnectionsConnection* self);
static gboolean connections_window_on_key_pressed (ConnectionsWindow* self,
                                            GtkWidget* widget,
                                            GdkEventKey* event);
VALA_EXTERN gboolean connections_window_get_fullscreened (ConnectionsWindow* self);
VALA_EXTERN void connections_window_set_fullscreened (ConnectionsWindow* self,
                                          gboolean value);
VALA_EXTERN void connections_application_quit_app (ConnectionsApplication* self);
static gboolean _connections_window_on_key_pressed_gtk_widget_key_press_event (GtkWidget* _sender,
                                                                        GdkEventKey* event,
                                                                        gpointer self);
static gboolean connections_window_on_delete_event (ConnectionsWindow* self);
VALA_EXTERN void connections_notifications_bar_dismiss (ConnectionsNotificationsBar* self);
static gboolean _connections_window_on_delete_event_gtk_widget_delete_event (GtkWidget* _sender,
                                                                      GdkEventAny* event,
                                                                      gpointer self);
static void connections_window_save_window_geometry (ConnectionsWindow* self);
static gboolean connections_window_on_configure_event (ConnectionsWindow* self);
static gboolean __lambda27_ (ConnectionsWindow* self);
static gboolean ___lambda27__gsource_func (gpointer self);
static gboolean _connections_window_on_configure_event_gtk_widget_configure_event (GtkWidget* _sender,
                                                                            GdkEventConfigure* event,
                                                                            gpointer self);
static void connections_window_finalize (GObject * obj);
static GType connections_window_get_type_once (void);
static void _vala_connections_window_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec);
static void _vala_connections_window_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec);

static inline gpointer
connections_window_get_instance_private (ConnectionsWindow* self)
{
	return G_STRUCT_MEMBER_P (self, ConnectionsWindow_private_offset);
}

static void
_connections_window_items_changed_g_list_model_items_changed (GListModel* _sender,
                                                              guint position,
                                                              guint removed,
                                                              guint added,
                                                              gpointer self)
{
	connections_window_items_changed ((ConnectionsWindow*) self);
}

static gint
_variant_get1 (GVariant* value)
{
	return g_variant_get_int32 (value);
}

static gint
_variant_get2 (GVariant* value)
{
	return g_variant_get_int32 (value);
}

ConnectionsWindow*
connections_window_construct (GType object_type,
                              GtkApplication* app)
{
	ConnectionsWindow * self = NULL;
	HdyStatusPage* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	GtkStack* _tmp5_;
	HdyStatusPage* _tmp6_;
	ConnectionsApplication* _tmp7_;
	GListStore* _tmp8_;
	ConnectionsApplication* _tmp9_;
	GListStore* _tmp10_;
	ConnectionsDialogsWindow* _tmp11_;
	ConnectionsDialogsWindow* _tmp12_;
	ConnectionsDialogsWindow* _tmp13_;
	ConnectionsTopbar* _tmp19_;
	GtkButton* _tmp20_;
	ConnectionsCollectionView* _tmp21_;
	GtkSearchBar* _tmp22_;
	const gchar* _tmp23_;
	const gchar* _tmp24_;
	GVariant* size = NULL;
	ConnectionsApplication* _tmp26_;
	GSettings* _tmp27_;
	GVariant* _tmp28_;
	GVariant* _tmp29_;
	GError* _inner_error0_ = NULL;
	g_return_val_if_fail (app != NULL, NULL);
	self = (ConnectionsWindow*) g_object_new (object_type, "application", app, NULL);
	_tmp0_ = self->priv->empty_view;
	_tmp1_ = g_application_get_application_id ((GApplication*) app);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup_printf ("%s-symbolic", _tmp2_);
	_tmp4_ = _tmp3_;
	hdy_status_page_set_icon_name (_tmp0_, _tmp4_);
	_g_free0 (_tmp4_);
	_tmp5_ = self->priv->stack;
	_tmp6_ = self->priv->empty_view;
	gtk_stack_set_visible_child (_tmp5_, (GtkWidget*) _tmp6_);
	_tmp7_ = connections_application_application;
	_tmp8_ = _tmp7_->model;
	connections_window_bind_model (self, (GListModel*) _tmp8_);
	_tmp9_ = connections_application_application;
	_tmp10_ = _tmp9_->model;
	g_signal_connect_object ((GListModel*) _tmp10_, "items-changed", (GCallback) _connections_window_items_changed_g_list_model_items_changed, self, 0);
	_tmp11_ = connections_dialogs_window_new ();
	g_object_ref_sink (_tmp11_);
	_g_object_unref0 (self->dialogs_window);
	self->dialogs_window = _tmp11_;
	_tmp12_ = self->dialogs_window;
	gtk_window_set_modal ((GtkWindow*) _tmp12_, TRUE);
	_tmp13_ = self->dialogs_window;
	gtk_window_set_transient_for ((GtkWindow*) _tmp13_, (GtkWindow*) self);
	{
		GtkCssProvider* style_provider = NULL;
		GtkCssProvider* _tmp14_;
		GFile* file = NULL;
		GFile* _tmp15_;
		GdkScreen* _tmp16_;
		_tmp14_ = gtk_css_provider_new ();
		style_provider = _tmp14_;
		_tmp15_ = g_file_new_for_uri ("resource:///org/gnome/Connections/ui/style.css");
		file = _tmp15_;
		gtk_css_provider_load_from_file (style_provider, file, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (file);
			_g_object_unref0 (style_provider);
			goto __catch0_g_error;
		}
		_tmp16_ = gdk_screen_get_default ();
		gtk_style_context_add_provider_for_screen (_tmp16_, (GtkStyleProvider*) style_provider, (guint) GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
		_g_object_unref0 (file);
		_g_object_unref0 (style_provider);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp17_;
		const gchar* _tmp18_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp17_ = _error_;
		_tmp18_ = _tmp17_->message;
		g_warning ("window.vala:78: Failed to load CSS: %s", _tmp18_);
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	_tmp19_ = self->priv->topbar;
	_tmp20_ = _tmp19_->search_button;
	_tmp21_ = self->collection_view;
	_tmp22_ = _tmp21_->search_bar;
	g_object_bind_property_with_closures ((GObject*) _tmp20_, "active", (GObject*) _tmp22_, "search_mode_enabled", G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp23_ = g_application_get_application_id ((GApplication*) app);
	_tmp24_ = _tmp23_;
	if (g_strcmp0 (_tmp24_, "org.gnome.Connections.Devel") == 0) {
		GtkStyleContext* _tmp25_;
		_tmp25_ = gtk_widget_get_style_context ((GtkWidget*) self);
		gtk_style_context_add_class (_tmp25_, "devel");
	}
	_tmp26_ = connections_application_application;
	_tmp27_ = _tmp26_->settings;
	_tmp28_ = g_settings_get_value (_tmp27_, "window-size");
	size = _tmp28_;
	_tmp29_ = size;
	if (g_variant_n_children (_tmp29_) == ((gsize) 2)) {
		GVariant* _tmp30_;
		GVariant* _tmp31_;
		GVariant* _tmp32_;
		gint _tmp33_;
		GVariant* _tmp34_;
		GVariant* _tmp35_;
		GVariant* _tmp36_;
		gint _tmp37_;
		_tmp30_ = size;
		_tmp31_ = g_variant_get_child_value (_tmp30_, (gsize) 0);
		_tmp32_ = _tmp31_;
		_tmp33_ = _variant_get1 (_tmp32_);
		_tmp34_ = size;
		_tmp35_ = g_variant_get_child_value (_tmp34_, (gsize) 1);
		_tmp36_ = _tmp35_;
		_tmp37_ = _variant_get2 (_tmp36_);
		gtk_window_set_default_size ((GtkWindow*) self, _tmp33_, _tmp37_);
		_g_variant_unref0 (_tmp36_);
		_g_variant_unref0 (_tmp32_);
	}
	_g_variant_unref0 (size);
	return self;
}

ConnectionsWindow*
connections_window_new (GtkApplication* app)
{
	return connections_window_construct (CONNECTIONS_TYPE_WINDOW, app);
}

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

static Block7Data*
block7_data_ref (Block7Data* _data7_)
{
	g_atomic_int_inc (&_data7_->_ref_count_);
	return _data7_;
}

static void
block7_data_unref (void * _userdata_)
{
	Block7Data* _data7_;
	_data7_ = (Block7Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
		ConnectionsWindow* self;
		self = _data7_->self;
		_g_object_unref0 (_data7_->model);
		_g_object_unref0 (self);
		g_slice_free (Block7Data, _data7_);
	}
}

static void
__lambda26_ (Block7Data* _data7_)
{
	ConnectionsWindow* self;
	ConnectionsTopbar* _tmp0_;
	GtkButton* _tmp1_;
	self = _data7_->self;
	_tmp0_ = self->priv->topbar;
	_tmp1_ = _tmp0_->search_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp1_, g_list_model_get_n_items (_data7_->model) > ((guint) 0));
}

static void
___lambda26__g_list_model_items_changed (GListModel* _sender,
                                         guint position,
                                         guint removed,
                                         guint added,
                                         gpointer self)
{
	__lambda26_ (self);
}

void
connections_window_bind_model (ConnectionsWindow* self,
                               GListModel* model)
{
	Block7Data* _data7_;
	GListModel* _tmp0_;
	ConnectionsCollectionView* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (model != NULL);
	_data7_ = g_slice_new0 (Block7Data);
	_data7_->_ref_count_ = 1;
	_data7_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (model);
	_g_object_unref0 (_data7_->model);
	_data7_->model = _tmp0_;
	_tmp1_ = self->collection_view;
	connections_collection_view_bind_model (_tmp1_, _data7_->model);
	g_signal_connect_data (_data7_->model, "items-changed", (GCallback) ___lambda26__g_list_model_items_changed, block7_data_ref (_data7_), (GClosureNotify) block7_data_unref, 0);
	block7_data_unref (_data7_);
	_data7_ = NULL;
}

void
connections_window_items_changed (ConnectionsWindow* self)
{
	ConnectionsApplication* _tmp0_;
	GListStore* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = connections_application_application;
	_tmp1_ = _tmp0_->model;
	if (g_list_model_get_n_items ((GListModel*) _tmp1_) > ((guint) 0)) {
		GtkStack* _tmp2_;
		ConnectionsCollectionView* _tmp3_;
		_tmp2_ = self->priv->stack;
		_tmp3_ = self->collection_view;
		gtk_stack_set_visible_child (_tmp2_, (GtkWidget*) _tmp3_);
	} else {
		GtkStack* _tmp4_;
		HdyStatusPage* _tmp5_;
		_tmp4_ = self->priv->stack;
		_tmp5_ = self->priv->empty_view;
		gtk_stack_set_visible_child (_tmp4_, (GtkWidget*) _tmp5_);
	}
}

void
connections_window_open_connection (ConnectionsWindow* self,
                                    ConnectionsConnection* connection)
{
	GtkStack* _tmp0_;
	ConnectionsDisplayView* _tmp1_;
	ConnectionsTopbar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (connection != NULL);
	_tmp0_ = self->priv->stack;
	_tmp1_ = self->priv->display_view;
	gtk_stack_set_visible_child (_tmp0_, (GtkWidget*) _tmp1_);
	_tmp2_ = self->priv->topbar;
	connections_topbar_show_display_view (_tmp2_, connection);
	if (!connection->connected) {
		ConnectionsDisplayView* _tmp3_;
		_tmp3_ = self->priv->display_view;
		connections_display_view_connect_to (_tmp3_, connection);
	} else {
		ConnectionsDisplayView* _tmp4_;
		_tmp4_ = self->priv->display_view;
		connections_display_view_switch_to (_tmp4_, connection);
	}
}

void
connections_window_show_collection_view (ConnectionsWindow* self)
{
	GtkStack* _tmp0_;
	ConnectionsCollectionView* _tmp1_;
	ConnectionsTopbar* _tmp2_;
	ConnectionsTopbar* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->stack;
	_tmp1_ = self->collection_view;
	gtk_stack_set_visible_child (_tmp0_, (GtkWidget*) _tmp1_);
	_tmp2_ = self->priv->topbar;
	connections_topbar_show_collection_view (_tmp2_);
	_tmp3_ = self->priv->topbar;
	connections_topbar_set_title (_tmp3_, _ ("Connections"));
}

void
connections_window_show_preferences_window (ConnectionsWindow* self,
                                            ConnectionsConnection* connection)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (connection != NULL);
	if (CONNECTIONS_IS_VNC_CONNECTION (connection)) {
		ConnectionsVncPreferencesWindow* _tmp0_;
		ConnectionsVncPreferencesWindow* _tmp1_;
		_tmp0_ = connections_vnc_preferences_window_new (connection);
		g_object_ref_sink (_tmp0_);
		_tmp1_ = _tmp0_;
		gtk_window_present ((GtkWindow*) _tmp1_);
		_g_object_unref0 (_tmp1_);
	} else {
		if (CONNECTIONS_IS_RDP_CONNECTION (connection)) {
			ConnectionsRdpPreferencesWindow* _tmp2_;
			ConnectionsRdpPreferencesWindow* _tmp3_;
			_tmp2_ = connections_rdp_preferences_window_new (connection);
			g_object_ref_sink (_tmp2_);
			_tmp3_ = _tmp2_;
			gtk_window_present ((GtkWindow*) _tmp3_);
			_g_object_unref0 (_tmp3_);
		} else {
			if (CONNECTIONS_IS_SPICE_CONNECTION (connection)) {
				ConnectionsSpicePreferencesWindow* _tmp4_;
				ConnectionsSpicePreferencesWindow* _tmp5_;
				_tmp4_ = connections_spice_preferences_window_new (connection);
				g_object_ref_sink (_tmp4_);
				_tmp5_ = _tmp4_;
				gtk_window_present ((GtkWindow*) _tmp5_);
				_g_object_unref0 (_tmp5_);
			} else {
				gchar* _tmp6_;
				gchar* _tmp7_;
				gchar* _tmp8_;
				_tmp6_ = connections_connection_get_uri (connection);
				_tmp7_ = _tmp6_;
				_tmp8_ = _tmp7_;
				g_debug ("window.vala:136: Failed to launch preferences window for %s", _tmp8_);
				_g_free0 (_tmp8_);
			}
		}
	}
}

static gboolean
connections_window_on_key_pressed (ConnectionsWindow* self,
                                   GtkWidget* widget,
                                   GdkEventKey* event)
{
	GdkModifierType default_modifiers = 0U;
	gboolean _tmp0_ = FALSE;
	GtkStack* _tmp15_;
	GtkWidget* _tmp16_;
	GtkWidget* _tmp17_;
	ConnectionsCollectionView* _tmp18_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (widget != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	default_modifiers = gtk_accelerator_get_default_mod_mask ();
	if (event->keyval == GDK_KEY_f) {
		_tmp0_ = (event->state & default_modifiers) == GDK_CONTROL_MASK;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		ConnectionsCollectionView* _tmp1_;
		GtkSearchBar* _tmp2_;
		ConnectionsCollectionView* _tmp3_;
		GtkSearchBar* _tmp4_;
		gboolean _tmp5_;
		gboolean _tmp6_;
		_tmp1_ = self->collection_view;
		_tmp2_ = _tmp1_->search_bar;
		_tmp3_ = self->collection_view;
		_tmp4_ = _tmp3_->search_bar;
		g_object_get (_tmp4_, "search-mode-enabled", &_tmp5_, NULL);
		_tmp6_ = _tmp5_;
		g_object_set (_tmp2_, "search-mode-enabled", !_tmp6_, NULL);
		result = TRUE;
		return result;
	} else {
		if (event->keyval == GDK_KEY_F11) {
			gboolean _tmp7_;
			gboolean _tmp8_;
			_tmp7_ = connections_window_get_fullscreened (self);
			_tmp8_ = _tmp7_;
			connections_window_set_fullscreened (self, !_tmp8_);
			result = TRUE;
			return result;
		} else {
			gboolean _tmp9_ = FALSE;
			if (event->keyval == GDK_KEY_q) {
				_tmp9_ = (event->state & default_modifiers) == GDK_CONTROL_MASK;
			} else {
				_tmp9_ = FALSE;
			}
			if (_tmp9_) {
				ConnectionsApplication* _tmp10_;
				_tmp10_ = connections_application_application;
				connections_application_quit_app (_tmp10_);
				result = TRUE;
				return result;
			} else {
				if (event->keyval == GDK_KEY_F1) {
					ConnectionsApplication* _tmp11_;
					_tmp11_ = connections_application_application;
					g_action_group_activate_action ((GActionGroup*) _tmp11_, "help", NULL);
					result = TRUE;
					return result;
				} else {
					gboolean _tmp12_ = FALSE;
					if (event->keyval == GDK_KEY_n) {
						_tmp12_ = (event->state & default_modifiers) == GDK_CONTROL_MASK;
					} else {
						_tmp12_ = FALSE;
					}
					if (_tmp12_) {
						ConnectionsTopbar* _tmp13_;
						ConnectionsAssistant* _tmp14_;
						_tmp13_ = self->priv->topbar;
						_tmp14_ = _tmp13_->assistant;
						gtk_popover_popdown ((GtkPopover*) _tmp14_);
						result = TRUE;
						return result;
					}
				}
			}
		}
	}
	_tmp15_ = self->priv->stack;
	_tmp16_ = gtk_stack_get_visible_child (_tmp15_);
	_tmp17_ = _tmp16_;
	_tmp18_ = self->collection_view;
	if (_tmp17_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, gtk_widget_get_type (), GtkWidget)) {
		ConnectionsCollectionView* _tmp19_;
		GtkSearchBar* _tmp20_;
		_tmp19_ = self->collection_view;
		_tmp20_ = _tmp19_->search_bar;
		result = gtk_search_bar_handle_event (_tmp20_, (GdkEvent*) event);
		return result;
	}
	result = FALSE;
	return result;
}

static gboolean
_connections_window_on_key_pressed_gtk_widget_key_press_event (GtkWidget* _sender,
                                                               GdkEventKey* event,
                                                               gpointer self)
{
	gboolean result;
	result = connections_window_on_key_pressed ((ConnectionsWindow*) self, _sender, event);
	return result;
}

static gboolean
connections_window_on_delete_event (ConnectionsWindow* self)
{
	ConnectionsNotificationsBar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->notifications_bar;
	connections_notifications_bar_dismiss (_tmp0_);
	result = FALSE;
	return result;
}

static gboolean
_connections_window_on_delete_event_gtk_widget_delete_event (GtkWidget* _sender,
                                                             GdkEventAny* event,
                                                             gpointer self)
{
	gboolean result;
	result = connections_window_on_delete_event ((ConnectionsWindow*) self);
	return result;
}

static void
connections_window_save_window_geometry (ConnectionsWindow* self)
{
	gint width = 0;
	gint height = 0;
	gboolean _tmp0_;
	gboolean _tmp1_;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	ConnectionsApplication* _tmp4_;
	GSettings* _tmp5_;
	g_return_if_fail (self != NULL);
	g_object_get ((GtkWindow*) self, "is-maximized", &_tmp0_, NULL);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		return;
	}
	gtk_window_get_size ((GtkWindow*) self, &_tmp2_, &_tmp3_);
	width = _tmp2_;
	height = _tmp3_;
	_tmp4_ = connections_application_application;
	_tmp5_ = _tmp4_->settings;
	g_settings_set (_tmp5_, "window-size", "(ii)", width, height);
}

static gboolean
__lambda27_ (ConnectionsWindow* self)
{
	gboolean result;
	self->priv->configure_id = (guint) 0;
	connections_window_save_window_geometry (self);
	result = FALSE;
	return result;
}

static gboolean
___lambda27__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda27_ ((ConnectionsWindow*) self);
	return result;
}

static gboolean
connections_window_on_configure_event (ConnectionsWindow* self)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = connections_window_get_fullscreened (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		result = FALSE;
		return result;
	}
	if (self->priv->configure_id != ((guint) 0)) {
		g_source_remove (self->priv->configure_id);
	}
	self->priv->configure_id = g_timeout_add_full (G_PRIORITY_DEFAULT, CONNECTIONS_WINDOW_configure_id_timeout, ___lambda27__gsource_func, g_object_ref (self), g_object_unref);
	result = FALSE;
	return result;
}

static gboolean
_connections_window_on_configure_event_gtk_widget_configure_event (GtkWidget* _sender,
                                                                   GdkEventConfigure* event,
                                                                   gpointer self)
{
	gboolean result;
	result = connections_window_on_configure_event ((ConnectionsWindow*) self);
	return result;
}

gboolean
connections_window_get_fullscreened (ConnectionsWindow* self)
{
	gboolean result;
	GdkWindow* _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = gtk_widget_get_window ((GtkWidget*) self);
	result = (gdk_window_get_state (_tmp0_) & GDK_WINDOW_STATE_FULLSCREEN) == GDK_WINDOW_STATE_FULLSCREEN;
	return result;
}

void
connections_window_set_fullscreened (ConnectionsWindow* self,
                                     gboolean value)
{
	g_return_if_fail (self != NULL);
	if (value) {
		gtk_window_fullscreen ((GtkWindow*) self);
	} else {
		gtk_window_unfullscreen ((GtkWindow*) self);
	}
	g_object_notify_by_pspec ((GObject *) self, connections_window_properties[CONNECTIONS_WINDOW_FULLSCREENED_PROPERTY]);
}

static void
connections_window_class_init (ConnectionsWindowClass * klass,
                               gpointer klass_data)
{
	connections_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ConnectionsWindow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_connections_window_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_connections_window_set_property;
	G_OBJECT_CLASS (klass)->finalize = connections_window_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONNECTIONS_WINDOW_FULLSCREENED_PROPERTY, connections_window_properties[CONNECTIONS_WINDOW_FULLSCREENED_PROPERTY] = g_param_spec_boolean ("fullscreened", "fullscreened", "fullscreened", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Connections/ui/window.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "topbar", FALSE, ConnectionsWindow_private_offset + G_STRUCT_OFFSET (ConnectionsWindowPrivate, topbar));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "stack", FALSE, ConnectionsWindow_private_offset + G_STRUCT_OFFSET (ConnectionsWindowPrivate, stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "empty_view", FALSE, ConnectionsWindow_private_offset + G_STRUCT_OFFSET (ConnectionsWindowPrivate, empty_view));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "collection_view", FALSE, G_STRUCT_OFFSET (ConnectionsWindow, collection_view));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "display_view", FALSE, ConnectionsWindow_private_offset + G_STRUCT_OFFSET (ConnectionsWindowPrivate, display_view));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "notifications_bar", FALSE, G_STRUCT_OFFSET (ConnectionsWindow, notifications_bar));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_key_pressed", G_CALLBACK(_connections_window_on_key_pressed_gtk_widget_key_press_event));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_delete_event", G_CALLBACK(_connections_window_on_delete_event_gtk_widget_delete_event));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_configure_event", G_CALLBACK(_connections_window_on_configure_event_gtk_widget_configure_event));
}

static void
connections_window_instance_init (ConnectionsWindow * self,
                                  gpointer klass)
{
	self->priv = connections_window_get_instance_private (self);
	g_type_ensure (CONNECTIONS_TYPE_TOPBAR);
	g_type_ensure (CONNECTIONS_TYPE_COLLECTION_VIEW);
	g_type_ensure (CONNECTIONS_TYPE_DISPLAY_VIEW);
	g_type_ensure (CONNECTIONS_TYPE_NOTIFICATIONS_BAR);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
connections_window_finalize (GObject * obj)
{
	ConnectionsWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONNECTIONS_TYPE_WINDOW, ConnectionsWindow);
	_g_object_unref0 (self->dialogs_window);
	G_OBJECT_CLASS (connections_window_parent_class)->finalize (obj);
}

static GType
connections_window_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ConnectionsWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) connections_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ConnectionsWindow), 0, (GInstanceInitFunc) connections_window_instance_init, NULL };
	GType connections_window_type_id;
	connections_window_type_id = g_type_register_static (gtk_application_window_get_type (), "ConnectionsWindow", &g_define_type_info, 0);
	ConnectionsWindow_private_offset = g_type_add_instance_private (connections_window_type_id, sizeof (ConnectionsWindowPrivate));
	return connections_window_type_id;
}

GType
connections_window_get_type (void)
{
	static volatile gsize connections_window_type_id__once = 0;
	if (g_once_init_enter (&connections_window_type_id__once)) {
		GType connections_window_type_id;
		connections_window_type_id = connections_window_get_type_once ();
		g_once_init_leave (&connections_window_type_id__once, connections_window_type_id);
	}
	return connections_window_type_id__once;
}

static void
_vala_connections_window_get_property (GObject * object,
                                       guint property_id,
                                       GValue * value,
                                       GParamSpec * pspec)
{
	ConnectionsWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONNECTIONS_TYPE_WINDOW, ConnectionsWindow);
	switch (property_id) {
		case CONNECTIONS_WINDOW_FULLSCREENED_PROPERTY:
		g_value_set_boolean (value, connections_window_get_fullscreened (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_connections_window_set_property (GObject * object,
                                       guint property_id,
                                       const GValue * value,
                                       GParamSpec * pspec)
{
	ConnectionsWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONNECTIONS_TYPE_WINDOW, ConnectionsWindow);
	switch (property_id) {
		case CONNECTIONS_WINDOW_FULLSCREENED_PROPERTY:
		connections_window_set_fullscreened (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

