/* searchbar.c generated by valac 0.37.1.4-3591e, 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 <gdk/gdk.h>
#include <stdlib.h>
#include <string.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 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;
enum  {
	BOXES_SEARCHBAR_DUMMY_PROPERTY,
	BOXES_SEARCHBAR_ENABLE_KEY_HANDLER,
	BOXES_SEARCHBAR_TEXT,
	BOXES_SEARCHBAR_LAST_PROPERTY
};
static GParamSpec* boxes_searchbar_properties[BOXES_SEARCHBAR_LAST_PROPERTY];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define BOXES_TYPE_ICOLLECTION_VIEW (boxes_icollection_view_get_type ())
#define BOXES_ICOLLECTION_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_ICOLLECTION_VIEW, BoxesICollectionView))
#define BOXES_IS_ICOLLECTION_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_ICOLLECTION_VIEW))
#define BOXES_ICOLLECTION_VIEW_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), BOXES_TYPE_ICOLLECTION_VIEW, BoxesICollectionViewIface))

typedef struct _BoxesICollectionView BoxesICollectionView;
typedef struct _BoxesICollectionViewIface BoxesICollectionViewIface;

#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_SELECTION_CRITERIA (boxes_selection_criteria_get_type ())

#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_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 ())

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

struct _BoxesSearchbarClass {
	GtkSearchBarClass parent_class;
};

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

typedef enum  {
	BOXES_SELECTION_CRITERIA_ALL,
	BOXES_SELECTION_CRITERIA_NONE,
	BOXES_SELECTION_CRITERIA_RUNNING
} BoxesSelectionCriteria;

struct _BoxesICollectionViewIface {
	GTypeInterface parent_iface;
	void (*add_item) (BoxesICollectionView* self, BoxesCollectionItem* item);
	void (*remove_item) (BoxesICollectionView* self, BoxesCollectionItem* item);
	GList* (*get_selected_items) (BoxesICollectionView* self);
	void (*activate_first_item) (BoxesICollectionView* self);
	void (*select_by_criteria) (BoxesICollectionView* self, BoxesSelectionCriteria criteria);
	BoxesCollectionFilter* (*get_filter) (BoxesICollectionView* self);
	void (*set_filter) (BoxesICollectionView* self, BoxesCollectionFilter* value);
};

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);
};


static gpointer boxes_searchbar_parent_class = NULL;

GType boxes_searchbar_get_type (void) G_GNUC_CONST;
GType boxes_app_window_get_type (void) G_GNUC_CONST;
#define BOXES_SEARCHBAR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_SEARCHBAR, BoxesSearchbarPrivate))
void boxes_searchbar_setup_ui (BoxesSearchbar* self, BoxesAppWindow* window);
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);
static void boxes_searchbar_on_search_changed (BoxesSearchbar* self);
void boxes_app_window_filter (BoxesAppWindow* self, const gchar* text);
const gchar* boxes_searchbar_get_text (BoxesSearchbar* 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);
GType boxes_collection_item_get_type (void) G_GNUC_CONST;
GType boxes_selection_criteria_get_type (void) G_GNUC_CONST;
GType boxes_collection_filter_get_type (void) G_GNUC_CONST;
GType boxes_icollection_view_get_type (void) G_GNUC_CONST;
BoxesICollectionView* boxes_app_window_get_view (BoxesAppWindow* self);
void boxes_icollection_view_activate_first_item (BoxesICollectionView* 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);
GType boxes_ui_state_get_type (void) G_GNUC_CONST;
GType boxes_ui_get_type (void) G_GNUC_CONST;
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);
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 gpointer _g_object_ref0 (gpointer self) {
#line 25 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	return self ? g_object_ref (self) : NULL;
#line 172 "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 27 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	return result;
#line 181 "searchbar.c"
}


void boxes_searchbar_setup_ui (BoxesSearchbar* self, BoxesAppWindow* window) {
	BoxesAppWindow* _tmp0_;
	BoxesAppWindow* _tmp1_;
	BoxesAppWindow* _tmp2_;
	gulong _tmp3_;
#line 24 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	g_return_if_fail (self != NULL);
#line 24 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	g_return_if_fail (window != NULL);
#line 25 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	_tmp0_ = window;
#line 25 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 25 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	_g_object_unref0 (self->priv->window);
#line 25 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	self->priv->window = _tmp1_;
#line 27 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	_tmp2_ = window;
#line 27 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	_tmp3_ = g_signal_connect_object ((GtkWidget*) _tmp2_, "key-press-event", (GCallback) _boxes_searchbar_on_app_key_pressed_gtk_widget_key_press_event, self, 0);
#line 27 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	self->priv->key_handler_id = _tmp3_;
#line 208 "searchbar.c"
}


static void boxes_searchbar_on_search_changed (BoxesSearchbar* self) {
	BoxesAppWindow* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
#line 31 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	g_return_if_fail (self != NULL);
#line 32 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	_tmp0_ = self->priv->window;
#line 32 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	_tmp1_ = boxes_searchbar_get_text (self);
#line 32 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	_tmp2_ = _tmp1_;
#line 32 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	boxes_app_window_filter (_tmp0_, _tmp2_);
#line 226 "searchbar.c"
}


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


static void boxes_searchbar_on_search_activated (BoxesSearchbar* self) {
	BoxesAppWindow* _tmp0_;
	BoxesICollectionView* _tmp1_;
	BoxesICollectionView* _tmp2_;
#line 36 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	g_return_if_fail (self != NULL);
#line 37 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	_tmp0_ = self->priv->window;
#line 37 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	_tmp1_ = boxes_app_window_get_view (_tmp0_);
#line 37 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	_tmp2_ = _tmp1_;
#line 37 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	boxes_icollection_view_activate_first_item (_tmp2_);
#line 251 "searchbar.c"
}


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


static void boxes_searchbar_on_search_mode_notify (BoxesSearchbar* self) {
	gboolean _tmp0_;
	gboolean _tmp1_;
#line 41 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	g_return_if_fail (self != NULL);
#line 42 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	g_object_get ((GtkSearchBar*) self, "search-mode-enabled", &_tmp0_, NULL);
#line 42 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	_tmp1_ = _tmp0_;
#line 42 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	if (!_tmp1_) {
#line 43 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
		boxes_searchbar_set_text (self, "");
#line 275 "searchbar.c"
	}
}


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


static gboolean boxes_searchbar_on_app_key_pressed (BoxesSearchbar* self, GtkWidget* widget, GdkEventKey* event) {
	gboolean result = FALSE;
	BoxesAppWindow* _tmp0_;
	BoxesUIState _tmp1_;
	BoxesUIState _tmp2_;
	GdkEventKey* _tmp3_;
	gboolean _tmp4_;
#line 51 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 51 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	g_return_val_if_fail (widget != NULL, FALSE);
#line 51 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	g_return_val_if_fail (event != NULL, FALSE);
#line 52 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	_tmp0_ = self->priv->window;
#line 52 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	_tmp1_ = boxes_ui_get_ui_state ((BoxesUI*) _tmp0_);
#line 52 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	_tmp2_ = _tmp1_;
#line 52 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	if (_tmp2_ != BOXES_UI_STATE_COLLECTION) {
#line 53 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
		result = FALSE;
#line 53 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
		return result;
#line 312 "searchbar.c"
	}
#line 55 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	_tmp3_ = event;
#line 55 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	_tmp4_ = gtk_search_bar_handle_event ((GtkSearchBar*) self, (GdkEvent*) _tmp3_);
#line 55 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	result = _tmp4_;
#line 55 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	return result;
#line 322 "searchbar.c"
}


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


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


void boxes_searchbar_set_enable_key_handler (BoxesSearchbar* self, gboolean value) {
	gboolean _tmp0_;
#line 6 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	g_return_if_fail (self != NULL);
#line 7 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	_tmp0_ = value;
#line 7 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	if (_tmp0_) {
#line 351 "searchbar.c"
		BoxesAppWindow* _tmp1_;
		gulong _tmp2_;
#line 8 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
		_tmp1_ = self->priv->window;
#line 8 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
		_tmp2_ = self->priv->key_handler_id;
#line 8 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
		g_signal_handler_unblock (_tmp1_, _tmp2_);
#line 360 "searchbar.c"
	} else {
		BoxesAppWindow* _tmp3_;
		gulong _tmp4_;
#line 10 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
		_tmp3_ = self->priv->window;
#line 10 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
		_tmp4_ = self->priv->key_handler_id;
#line 10 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
		g_signal_handler_block (_tmp3_, _tmp4_);
#line 370 "searchbar.c"
	}
#line 6 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	g_object_notify_by_pspec ((GObject *) self, boxes_searchbar_properties[BOXES_SEARCHBAR_ENABLE_KEY_HANDLER]);
#line 374 "searchbar.c"
}


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


void boxes_searchbar_set_text (BoxesSearchbar* self, const gchar* value) {
	GtkSearchEntry* _tmp0_;
	const gchar* _tmp1_;
#line 48 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	g_return_if_fail (self != NULL);
#line 48 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	_tmp0_ = self->priv->entry;
#line 48 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	_tmp1_ = value;
#line 48 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	gtk_entry_set_text ((GtkEntry*) _tmp0_, _tmp1_);
#line 48 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	g_object_notify_by_pspec ((GObject *) self, boxes_searchbar_properties[BOXES_SEARCHBAR_TEXT]);
#line 412 "searchbar.c"
}


static GObject * boxes_searchbar_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	BoxesSearchbar * self;
#line 20 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	parent_class = G_OBJECT_CLASS (boxes_searchbar_parent_class);
#line 20 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
#line 20 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_SEARCHBAR, BoxesSearchbar);
#line 21 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	g_object_set ((GtkSearchBar*) self, "search-mode-enabled", FALSE, NULL);
#line 20 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	return obj;
#line 430 "searchbar.c"
}


static void boxes_searchbar_class_init (BoxesSearchbarClass * klass) {
	gint BoxesSearchbar_private_offset;
#line 4 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	boxes_searchbar_parent_class = g_type_class_peek_parent (klass);
#line 4 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	g_type_class_add_private (klass, sizeof (BoxesSearchbarPrivate));
#line 4 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_boxes_searchbar_get_property;
#line 4 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	G_OBJECT_CLASS (klass)->set_property = _vala_boxes_searchbar_set_property;
#line 4 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	G_OBJECT_CLASS (klass)->constructor = boxes_searchbar_constructor;
#line 4 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	G_OBJECT_CLASS (klass)->finalize = boxes_searchbar_finalize;
#line 4 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_SEARCHBAR_ENABLE_KEY_HANDLER, boxes_searchbar_properties[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/fborges/checkout/gnome-boxes/src/searchbar.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_SEARCHBAR_TEXT, boxes_searchbar_properties[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/fborges/checkout/gnome-boxes/src/searchbar.vala"
	BoxesSearchbar_private_offset = g_type_class_get_instance_private_offset (klass);
#line 4 "/home/fborges/checkout/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/fborges/checkout/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/fborges/checkout/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/fborges/checkout/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/fborges/checkout/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 464 "searchbar.c"
}


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


static void boxes_searchbar_finalize (GObject * obj) {
	BoxesSearchbar * self;
#line 4 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_SEARCHBAR, BoxesSearchbar);
#line 14 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	_g_object_unref0 (self->priv->entry);
#line 16 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	_g_object_unref0 (self->priv->window);
#line 4 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
	G_OBJECT_CLASS (boxes_searchbar_parent_class)->finalize (obj);
#line 487 "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_search_bar_get_type (), "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/fborges/checkout/gnome-boxes/src/searchbar.vala"
	switch (property_id) {
#line 4 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
		case BOXES_SEARCHBAR_TEXT:
#line 4 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
		g_value_set_string (value, boxes_searchbar_get_text (self));
#line 4 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
		break;
#line 514 "searchbar.c"
		default:
#line 4 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 4 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
		break;
#line 520 "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/fborges/checkout/gnome-boxes/src/searchbar.vala"
	switch (property_id) {
#line 4 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
		case BOXES_SEARCHBAR_ENABLE_KEY_HANDLER:
#line 4 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
		boxes_searchbar_set_enable_key_handler (self, g_value_get_boolean (value));
#line 4 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
		break;
#line 4 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
		case BOXES_SEARCHBAR_TEXT:
#line 4 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
		boxes_searchbar_set_text (self, g_value_get_string (value));
#line 4 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
		break;
#line 542 "searchbar.c"
		default:
#line 4 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 4 "/home/fborges/checkout/gnome-boxes/src/searchbar.vala"
		break;
#line 548 "searchbar.c"
	}
}



