/* searchbar.c generated by valac 0.23.3.6-62e8, the Vala compiler
 * generated from searchbar.vala, do not modify */

/* This file is part of GNOME Boxes. License: LGPLv2+*/

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <libgd/gd.h>
#include <gio/gio.h>
#include <gdk/gdk.h>


#define BOXES_TYPE_SEARCHBAR (boxes_searchbar_get_type ())
#define BOXES_SEARCHBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_SEARCHBAR, BoxesSearchbar))
#define BOXES_SEARCHBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_SEARCHBAR, BoxesSearchbarClass))
#define BOXES_IS_SEARCHBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_SEARCHBAR))
#define BOXES_IS_SEARCHBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_SEARCHBAR))
#define BOXES_SEARCHBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_SEARCHBAR, BoxesSearchbarClass))

typedef struct _BoxesSearchbar BoxesSearchbar;
typedef struct _BoxesSearchbarClass BoxesSearchbarClass;
typedef struct _BoxesSearchbarPrivate BoxesSearchbarPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define BOXES_TYPE_APP (boxes_app_get_type ())
#define BOXES_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_APP, BoxesApp))
#define BOXES_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_APP, BoxesAppClass))
#define BOXES_IS_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_APP))
#define BOXES_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_APP))
#define BOXES_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_APP, BoxesAppClass))

typedef struct _BoxesApp BoxesApp;
typedef struct _BoxesAppClass BoxesAppClass;

#define BOXES_TYPE_UI (boxes_ui_get_type ())
#define BOXES_UI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_UI, BoxesUI))
#define BOXES_IS_UI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_UI))
#define BOXES_UI_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), BOXES_TYPE_UI, BoxesUIIface))

typedef struct _BoxesUI BoxesUI;
typedef struct _BoxesUIIface BoxesUIIface;

#define BOXES_TYPE_UI_STATE (boxes_ui_state_get_type ())
typedef struct _BoxesAppPrivate BoxesAppPrivate;

#define BOXES_TYPE_COLLECTION_ITEM (boxes_collection_item_get_type ())
#define BOXES_COLLECTION_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItem))
#define BOXES_COLLECTION_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItemClass))
#define BOXES_IS_COLLECTION_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION_ITEM))
#define BOXES_IS_COLLECTION_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION_ITEM))
#define BOXES_COLLECTION_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItemClass))

typedef struct _BoxesCollectionItem BoxesCollectionItem;
typedef struct _BoxesCollectionItemClass BoxesCollectionItemClass;

#define BOXES_TYPE_COLLECTION (boxes_collection_get_type ())
#define BOXES_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION, BoxesCollection))
#define BOXES_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION, BoxesCollectionClass))
#define BOXES_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION))
#define BOXES_IS_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION))
#define BOXES_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION, BoxesCollectionClass))

typedef struct _BoxesCollection BoxesCollection;
typedef struct _BoxesCollectionClass BoxesCollectionClass;

#define BOXES_TYPE_COLLECTION_FILTER (boxes_collection_filter_get_type ())
#define BOXES_COLLECTION_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION_FILTER, BoxesCollectionFilter))
#define BOXES_COLLECTION_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION_FILTER, BoxesCollectionFilterClass))
#define BOXES_IS_COLLECTION_FILTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION_FILTER))
#define BOXES_IS_COLLECTION_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION_FILTER))
#define BOXES_COLLECTION_FILTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION_FILTER, BoxesCollectionFilterClass))

typedef struct _BoxesCollectionFilter BoxesCollectionFilter;
typedef struct _BoxesCollectionFilterClass BoxesCollectionFilterClass;

#define BOXES_TYPE_APP_WINDOW (boxes_app_window_get_type ())
#define BOXES_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_APP_WINDOW, BoxesAppWindow))
#define BOXES_APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_APP_WINDOW, BoxesAppWindowClass))
#define BOXES_IS_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_APP_WINDOW))
#define BOXES_IS_APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_APP_WINDOW))
#define BOXES_APP_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_APP_WINDOW, BoxesAppWindowClass))

typedef struct _BoxesAppWindow BoxesAppWindow;
typedef struct _BoxesAppWindowClass BoxesAppWindowClass;
typedef struct _BoxesAppWindowPrivate BoxesAppWindowPrivate;

#define BOXES_TYPE_TOPBAR (boxes_topbar_get_type ())
#define BOXES_TOPBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_TOPBAR, BoxesTopbar))
#define BOXES_TOPBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_TOPBAR, BoxesTopbarClass))
#define BOXES_IS_TOPBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_TOPBAR))
#define BOXES_IS_TOPBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_TOPBAR))
#define BOXES_TOPBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_TOPBAR, BoxesTopbarClass))

typedef struct _BoxesTopbar BoxesTopbar;
typedef struct _BoxesTopbarClass BoxesTopbarClass;

#define BOXES_TYPE_NOTIFICATIONBAR (boxes_notificationbar_get_type ())
#define BOXES_NOTIFICATIONBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_NOTIFICATIONBAR, BoxesNotificationbar))
#define BOXES_NOTIFICATIONBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_NOTIFICATIONBAR, BoxesNotificationbarClass))
#define BOXES_IS_NOTIFICATIONBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_NOTIFICATIONBAR))
#define BOXES_IS_NOTIFICATIONBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_NOTIFICATIONBAR))
#define BOXES_NOTIFICATIONBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_NOTIFICATIONBAR, BoxesNotificationbarClass))

typedef struct _BoxesNotificationbar BoxesNotificationbar;
typedef struct _BoxesNotificationbarClass BoxesNotificationbarClass;

#define BOXES_TYPE_SIDEBAR (boxes_sidebar_get_type ())
#define BOXES_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_SIDEBAR, BoxesSidebar))
#define BOXES_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_SIDEBAR, BoxesSidebarClass))
#define BOXES_IS_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_SIDEBAR))
#define BOXES_IS_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_SIDEBAR))
#define BOXES_SIDEBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_SIDEBAR, BoxesSidebarClass))

typedef struct _BoxesSidebar BoxesSidebar;
typedef struct _BoxesSidebarClass BoxesSidebarClass;

#define BOXES_TYPE_WIZARD (boxes_wizard_get_type ())
#define BOXES_WIZARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_WIZARD, BoxesWizard))
#define BOXES_WIZARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_WIZARD, BoxesWizardClass))
#define BOXES_IS_WIZARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_WIZARD))
#define BOXES_IS_WIZARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_WIZARD))
#define BOXES_WIZARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_WIZARD, BoxesWizardClass))

typedef struct _BoxesWizard BoxesWizard;
typedef struct _BoxesWizardClass BoxesWizardClass;

#define BOXES_TYPE_PROPERTIES (boxes_properties_get_type ())
#define BOXES_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_PROPERTIES, BoxesProperties))
#define BOXES_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_PROPERTIES, BoxesPropertiesClass))
#define BOXES_IS_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_PROPERTIES))
#define BOXES_IS_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_PROPERTIES))
#define BOXES_PROPERTIES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_PROPERTIES, BoxesPropertiesClass))

typedef struct _BoxesProperties BoxesProperties;
typedef struct _BoxesPropertiesClass BoxesPropertiesClass;

#define BOXES_TYPE_DISPLAY_PAGE (boxes_display_page_get_type ())
#define BOXES_DISPLAY_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_DISPLAY_PAGE, BoxesDisplayPage))
#define BOXES_DISPLAY_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_DISPLAY_PAGE, BoxesDisplayPageClass))
#define BOXES_IS_DISPLAY_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_DISPLAY_PAGE))
#define BOXES_IS_DISPLAY_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_DISPLAY_PAGE))
#define BOXES_DISPLAY_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_DISPLAY_PAGE, BoxesDisplayPageClass))

typedef struct _BoxesDisplayPage BoxesDisplayPage;
typedef struct _BoxesDisplayPageClass BoxesDisplayPageClass;

#define BOXES_TYPE_EMPTY_BOXES (boxes_empty_boxes_get_type ())
#define BOXES_EMPTY_BOXES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_EMPTY_BOXES, BoxesEmptyBoxes))
#define BOXES_EMPTY_BOXES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_EMPTY_BOXES, BoxesEmptyBoxesClass))
#define BOXES_IS_EMPTY_BOXES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_EMPTY_BOXES))
#define BOXES_IS_EMPTY_BOXES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_EMPTY_BOXES))
#define BOXES_EMPTY_BOXES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_EMPTY_BOXES, BoxesEmptyBoxesClass))

typedef struct _BoxesEmptyBoxes BoxesEmptyBoxes;
typedef struct _BoxesEmptyBoxesClass BoxesEmptyBoxesClass;

#define BOXES_TYPE_COLLECTION_VIEW (boxes_collection_view_get_type ())
#define BOXES_COLLECTION_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION_VIEW, BoxesCollectionView))
#define BOXES_COLLECTION_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION_VIEW, BoxesCollectionViewClass))
#define BOXES_IS_COLLECTION_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION_VIEW))
#define BOXES_IS_COLLECTION_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION_VIEW))
#define BOXES_COLLECTION_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION_VIEW, BoxesCollectionViewClass))

typedef struct _BoxesCollectionView BoxesCollectionView;
typedef struct _BoxesCollectionViewClass BoxesCollectionViewClass;

struct _BoxesSearchbar {
	GtkSearchBar parent_instance;
	BoxesSearchbarPrivate * priv;
};

struct _BoxesSearchbarClass {
	GtkSearchBarClass parent_class;
};

struct _BoxesSearchbarPrivate {
	GtkSearchEntry* entry;
	gulong key_handler_id;
};

typedef enum  {
	BOXES_UI_STATE_NONE,
	BOXES_UI_STATE_COLLECTION,
	BOXES_UI_STATE_CREDS,
	BOXES_UI_STATE_DISPLAY,
	BOXES_UI_STATE_WIZARD,
	BOXES_UI_STATE_PROPERTIES
} BoxesUIState;

struct _BoxesUIIface {
	GTypeInterface parent_iface;
	BoxesUIState (*get_previous_ui_state) (BoxesUI* self);
	void (*set_previous_ui_state) (BoxesUI* self, BoxesUIState value);
	BoxesUIState (*get_ui_state) (BoxesUI* self);
	void (*set_ui_state) (BoxesUI* self, BoxesUIState value);
};

struct _BoxesApp {
	GtkApplication parent_instance;
	BoxesAppPrivate * priv;
	BoxesCollectionItem* current_item;
	BoxesCollection* collection;
	BoxesCollectionFilter* filter;
};

struct _BoxesAppClass {
	GtkApplicationClass parent_class;
};

struct _BoxesAppWindow {
	GtkApplicationWindow parent_instance;
	BoxesAppWindowPrivate * priv;
	BoxesSearchbar* searchbar;
	BoxesTopbar* topbar;
	BoxesNotificationbar* notificationbar;
	BoxesSidebar* sidebar;
	BoxesWizard* wizard;
	BoxesProperties* properties;
	BoxesDisplayPage* display_page;
	BoxesEmptyBoxes* empty_boxes;
	GtkStack* below_bin;
	BoxesCollectionView* view;
	GSettings* settings;
};

struct _BoxesAppWindowClass {
	GtkApplicationWindowClass parent_class;
};

typedef void (*BoxesAppCallReadyFunc) (void* user_data);

static gpointer boxes_searchbar_parent_class = NULL;
extern BoxesApp* boxes_app_app;
extern BoxesAppWindow* boxes_app_window;

GType boxes_searchbar_get_type (void) G_GNUC_CONST;
#define BOXES_SEARCHBAR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_SEARCHBAR, BoxesSearchbarPrivate))
enum  {
	BOXES_SEARCHBAR_DUMMY_PROPERTY,
	BOXES_SEARCHBAR_ENABLE_KEY_HANDLER,
	BOXES_SEARCHBAR_TEXT
};
static void boxes_searchbar_on_search_changed (BoxesSearchbar* self);
GType boxes_app_get_type (void) G_GNUC_CONST;
GType boxes_ui_state_get_type (void) G_GNUC_CONST;
GType boxes_ui_get_type (void) G_GNUC_CONST;
GType boxes_collection_item_get_type (void) G_GNUC_CONST;
GType boxes_collection_get_type (void) G_GNUC_CONST;
GType boxes_collection_filter_get_type (void) G_GNUC_CONST;
const gchar* boxes_searchbar_get_text (BoxesSearchbar* self);
void boxes_collection_filter_set_text (BoxesCollectionFilter* self, const gchar* value);
GType boxes_app_window_get_type (void) G_GNUC_CONST;
GType boxes_topbar_get_type (void) G_GNUC_CONST;
GType boxes_notificationbar_get_type (void) G_GNUC_CONST;
GType boxes_sidebar_get_type (void) G_GNUC_CONST;
GType boxes_wizard_get_type (void) G_GNUC_CONST;
GType boxes_properties_get_type (void) G_GNUC_CONST;
GType boxes_display_page_get_type (void) G_GNUC_CONST;
GType boxes_empty_boxes_get_type (void) G_GNUC_CONST;
GType boxes_collection_view_get_type (void) G_GNUC_CONST;
void boxes_collection_view_refilter (BoxesCollectionView* self);
static void _boxes_searchbar_on_search_changed_gtk_search_entry_search_changed (GtkSearchEntry* _sender, gpointer self);
static void boxes_searchbar_on_search_activated (BoxesSearchbar* self);
void boxes_collection_view_activate_first_item (BoxesCollectionView* self);
static void _boxes_searchbar_on_search_activated_gtk_entry_activate (GtkEntry* _sender, gpointer self);
static void boxes_searchbar_on_search_mode_notify (BoxesSearchbar* self);
void boxes_searchbar_set_text (BoxesSearchbar* self, const gchar* value);
static void _boxes_searchbar_on_search_mode_notify_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void boxes_searchbar_on_app_ready (BoxesSearchbar* self);
static gboolean boxes_searchbar_on_app_key_pressed (BoxesSearchbar* self, GtkWidget* widget, GdkEventKey* event);
static gboolean _boxes_searchbar_on_app_key_pressed_gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self);
BoxesUIState boxes_ui_get_ui_state (BoxesUI* self);
BoxesSearchbar* boxes_searchbar_new (void);
BoxesSearchbar* boxes_searchbar_construct (GType object_type);
void boxes_searchbar_set_enable_key_handler (BoxesSearchbar* self, gboolean value);
static GObject * boxes_searchbar_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
void boxes_app_call_when_ready (BoxesApp* self, BoxesAppCallReadyFunc func, void* func_target, GDestroyNotify func_target_destroy_notify);
static void _boxes_searchbar_on_app_ready_boxes_app_call_ready_func (gpointer self);
static void boxes_searchbar_finalize (GObject* obj);
static void _vala_boxes_searchbar_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_boxes_searchbar_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


static void boxes_searchbar_on_search_changed (BoxesSearchbar* self) {
	BoxesApp* _tmp0_ = NULL;
	BoxesCollectionFilter* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	BoxesAppWindow* _tmp4_ = NULL;
	BoxesCollectionView* _tmp5_ = NULL;
#line 25 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	g_return_if_fail (self != NULL);
#line 26 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	_tmp0_ = boxes_app_app;
#line 26 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	_tmp1_ = _tmp0_->filter;
#line 26 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	_tmp2_ = boxes_searchbar_get_text (self);
#line 26 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	_tmp3_ = _tmp2_;
#line 26 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	boxes_collection_filter_set_text (_tmp1_, _tmp3_);
#line 27 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	_tmp4_ = boxes_app_window;
#line 27 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	_tmp5_ = _tmp4_->view;
#line 27 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	boxes_collection_view_refilter (_tmp5_);
#line 313 "searchbar.c"
}


static void _boxes_searchbar_on_search_changed_gtk_search_entry_search_changed (GtkSearchEntry* _sender, gpointer self) {
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	boxes_searchbar_on_search_changed ((BoxesSearchbar*) self);
#line 320 "searchbar.c"
}


static void boxes_searchbar_on_search_activated (BoxesSearchbar* self) {
	BoxesAppWindow* _tmp0_ = NULL;
	BoxesCollectionView* _tmp1_ = NULL;
#line 31 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	g_return_if_fail (self != NULL);
#line 32 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	_tmp0_ = boxes_app_window;
#line 32 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	_tmp1_ = _tmp0_->view;
#line 32 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	boxes_collection_view_activate_first_item (_tmp1_);
#line 335 "searchbar.c"
}


static void _boxes_searchbar_on_search_activated_gtk_entry_activate (GtkEntry* _sender, gpointer self) {
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	boxes_searchbar_on_search_activated ((BoxesSearchbar*) self);
#line 342 "searchbar.c"
}


static void boxes_searchbar_on_search_mode_notify (BoxesSearchbar* self) {
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
#line 36 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	g_return_if_fail (self != NULL);
#line 37 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	g_object_get ((GtkSearchBar*) self, "search-mode-enabled", &_tmp0_, NULL);
#line 37 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	_tmp1_ = _tmp0_;
#line 37 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	if (!_tmp1_) {
#line 38 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
		boxes_searchbar_set_text (self, "");
#line 359 "searchbar.c"
	}
}


static void _boxes_searchbar_on_search_mode_notify_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	boxes_searchbar_on_search_mode_notify ((BoxesSearchbar*) self);
#line 367 "searchbar.c"
}


static gboolean _boxes_searchbar_on_app_key_pressed_gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self) {
	gboolean result;
	result = boxes_searchbar_on_app_key_pressed ((BoxesSearchbar*) self, _sender, event);
#line 47 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	return result;
#line 376 "searchbar.c"
}


static void boxes_searchbar_on_app_ready (BoxesSearchbar* self) {
	BoxesAppWindow* _tmp0_ = NULL;
	gulong _tmp1_ = 0UL;
#line 46 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	g_return_if_fail (self != NULL);
#line 47 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	_tmp0_ = boxes_app_window;
#line 47 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	_tmp1_ = g_signal_connect_object ((GtkWidget*) _tmp0_, "key-press-event", (GCallback) _boxes_searchbar_on_app_key_pressed_gtk_widget_key_press_event, self, 0);
#line 47 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	self->priv->key_handler_id = _tmp1_;
#line 391 "searchbar.c"
}


static gboolean boxes_searchbar_on_app_key_pressed (BoxesSearchbar* self, GtkWidget* widget, GdkEventKey* event) {
	gboolean result = FALSE;
	BoxesApp* _tmp0_ = NULL;
	BoxesUIState _tmp1_ = 0;
	BoxesUIState _tmp2_ = 0;
	GdkEventKey* _tmp3_ = NULL;
	gboolean _tmp4_ = FALSE;
#line 50 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 50 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	g_return_val_if_fail (widget != NULL, FALSE);
#line 50 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	g_return_val_if_fail (event != NULL, FALSE);
#line 51 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	_tmp0_ = boxes_app_app;
#line 51 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	_tmp1_ = boxes_ui_get_ui_state ((BoxesUI*) _tmp0_);
#line 51 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	_tmp2_ = _tmp1_;
#line 51 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	if (_tmp2_ != BOXES_UI_STATE_COLLECTION) {
#line 52 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
		result = FALSE;
#line 52 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
		return result;
#line 420 "searchbar.c"
	}
#line 54 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	_tmp3_ = event;
#line 54 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	_tmp4_ = gtk_search_bar_handle_event ((GtkSearchBar*) self, (GdkEvent*) _tmp3_);
#line 54 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	result = _tmp4_;
#line 54 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	return result;
#line 430 "searchbar.c"
}


BoxesSearchbar* boxes_searchbar_construct (GType object_type) {
	BoxesSearchbar * self = NULL;
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	self = (BoxesSearchbar*) g_object_new (object_type, NULL);
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	return self;
#line 440 "searchbar.c"
}


BoxesSearchbar* boxes_searchbar_new (void) {
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	return boxes_searchbar_construct (BOXES_TYPE_SEARCHBAR);
#line 447 "searchbar.c"
}


void boxes_searchbar_set_enable_key_handler (BoxesSearchbar* self, gboolean value) {
	gboolean _tmp0_ = FALSE;
#line 6 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	g_return_if_fail (self != NULL);
#line 7 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	_tmp0_ = value;
#line 7 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	if (_tmp0_) {
#line 459 "searchbar.c"
		BoxesAppWindow* _tmp1_ = NULL;
		gulong _tmp2_ = 0UL;
#line 8 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
		_tmp1_ = boxes_app_window;
#line 8 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
		_tmp2_ = self->priv->key_handler_id;
#line 8 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
		g_signal_handler_unblock (_tmp1_, _tmp2_);
#line 468 "searchbar.c"
	} else {
		BoxesAppWindow* _tmp3_ = NULL;
		gulong _tmp4_ = 0UL;
#line 10 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
		_tmp3_ = boxes_app_window;
#line 10 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
		_tmp4_ = self->priv->key_handler_id;
#line 10 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
		g_signal_handler_block (_tmp3_, _tmp4_);
#line 478 "searchbar.c"
	}
#line 6 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	g_object_notify ((GObject *) self, "enable-key-handler");
#line 482 "searchbar.c"
}


const gchar* boxes_searchbar_get_text (BoxesSearchbar* self) {
	const gchar* result;
	GtkSearchEntry* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
#line 42 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 42 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	_tmp0_ = self->priv->entry;
#line 42 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	_tmp1_ = gtk_entry_get_text ((GtkEntry*) _tmp0_);
#line 42 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	_tmp2_ = _tmp1_;
#line 42 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	result = _tmp2_;
#line 42 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	return result;
#line 503 "searchbar.c"
}


void boxes_searchbar_set_text (BoxesSearchbar* self, const gchar* value) {
	GtkSearchEntry* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
#line 43 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	g_return_if_fail (self != NULL);
#line 43 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	_tmp0_ = self->priv->entry;
#line 43 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	_tmp1_ = value;
#line 43 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	gtk_entry_set_text ((GtkEntry*) _tmp0_, _tmp1_);
#line 43 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	g_object_notify ((GObject *) self, "text");
#line 520 "searchbar.c"
}


static void _boxes_searchbar_on_app_ready_boxes_app_call_ready_func (gpointer self) {
#line 21 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	boxes_searchbar_on_app_ready ((BoxesSearchbar*) self);
#line 527 "searchbar.c"
}


static GObject * boxes_searchbar_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	BoxesSearchbar * self;
	BoxesApp* _tmp0_ = NULL;
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	parent_class = G_OBJECT_CLASS (boxes_searchbar_parent_class);
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_SEARCHBAR, BoxesSearchbar);
#line 19 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	g_object_set ((GtkSearchBar*) self, "search-mode-enabled", FALSE, NULL);
#line 21 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	_tmp0_ = boxes_app_app;
#line 21 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	boxes_app_call_when_ready (_tmp0_, _boxes_searchbar_on_app_ready_boxes_app_call_ready_func, g_object_ref (self), g_object_unref);
#line 18 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	return obj;
#line 550 "searchbar.c"
}


static void boxes_searchbar_class_init (BoxesSearchbarClass * klass) {
	gint BoxesSearchbar_private_offset;
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	boxes_searchbar_parent_class = g_type_class_peek_parent (klass);
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	g_type_class_add_private (klass, sizeof (BoxesSearchbarPrivate));
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_boxes_searchbar_get_property;
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	G_OBJECT_CLASS (klass)->set_property = _vala_boxes_searchbar_set_property;
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	G_OBJECT_CLASS (klass)->constructor = boxes_searchbar_constructor;
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	G_OBJECT_CLASS (klass)->finalize = boxes_searchbar_finalize;
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_SEARCHBAR_ENABLE_KEY_HANDLER, g_param_spec_boolean ("enable-key-handler", "enable-key-handler", "enable-key-handler", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE));
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_SEARCHBAR_TEXT, g_param_spec_string ("text", "text", "text", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	BoxesSearchbar_private_offset = g_type_class_get_instance_private_offset (klass);
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Boxes/ui/searchbar.ui");
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "entry", FALSE, BoxesSearchbar_private_offset + G_STRUCT_OFFSET (BoxesSearchbarPrivate, entry));
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_search_changed", G_CALLBACK(_boxes_searchbar_on_search_changed_gtk_search_entry_search_changed));
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_search_activated", G_CALLBACK(_boxes_searchbar_on_search_activated_gtk_entry_activate));
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_search_mode_notify", G_CALLBACK(_boxes_searchbar_on_search_mode_notify_g_object_notify));
#line 584 "searchbar.c"
}


static void boxes_searchbar_instance_init (BoxesSearchbar * self) {
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	self->priv = BOXES_SEARCHBAR_GET_PRIVATE (self);
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	gtk_widget_init_template (GTK_WIDGET (self));
#line 593 "searchbar.c"
}


static void boxes_searchbar_finalize (GObject* obj) {
	BoxesSearchbar * self;
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_SEARCHBAR, BoxesSearchbar);
#line 14 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	_g_object_unref0 (self->priv->entry);
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	G_OBJECT_CLASS (boxes_searchbar_parent_class)->finalize (obj);
#line 605 "searchbar.c"
}


GType boxes_searchbar_get_type (void) {
	static volatile gsize boxes_searchbar_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_searchbar_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesSearchbarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_searchbar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesSearchbar), 0, (GInstanceInitFunc) boxes_searchbar_instance_init, NULL };
		GType boxes_searchbar_type_id;
		boxes_searchbar_type_id = g_type_register_static (GTK_TYPE_SEARCH_BAR, "BoxesSearchbar", &g_define_type_info, 0);
		g_once_init_leave (&boxes_searchbar_type_id__volatile, boxes_searchbar_type_id);
	}
	return boxes_searchbar_type_id__volatile;
}


static void _vala_boxes_searchbar_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	BoxesSearchbar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_SEARCHBAR, BoxesSearchbar);
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	switch (property_id) {
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
		case BOXES_SEARCHBAR_TEXT:
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
		g_value_set_string (value, boxes_searchbar_get_text (self));
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
		break;
#line 632 "searchbar.c"
		default:
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
		break;
#line 638 "searchbar.c"
	}
}


static void _vala_boxes_searchbar_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	BoxesSearchbar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_SEARCHBAR, BoxesSearchbar);
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
	switch (property_id) {
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
		case BOXES_SEARCHBAR_ENABLE_KEY_HANDLER:
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
		boxes_searchbar_set_enable_key_handler (self, g_value_get_boolean (value));
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
		break;
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
		case BOXES_SEARCHBAR_TEXT:
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
		boxes_searchbar_set_text (self, g_value_get_string (value));
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
		break;
#line 660 "searchbar.c"
		default:
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 4 "/home/zeenix/checkout/gnome/gnome-boxes/src/searchbar.vala"
		break;
#line 666 "searchbar.c"
	}
}



