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

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

#include "slingshot.h"
#include <gtk/gtk.h>
#include <glib-object.h>
#include <gdk/gdk.h>
#include <glib.h>
#include <gio/gio.h>
#include <float.h>
#include <math.h>
#include <plugin.h>
#include <stdlib.h>
#include <string.h>
#include <granite.h>
#include <gee.h>
#include <glib/gi18n-lib.h>

#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

#define APP_MENU_TYPE_POWER_STRIP (app_menu_power_strip_get_type ())
#define APP_MENU_POWER_STRIP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), APP_MENU_TYPE_POWER_STRIP, AppMenuPowerStrip))
#define APP_MENU_POWER_STRIP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), APP_MENU_TYPE_POWER_STRIP, AppMenuPowerStripClass))
#define APP_MENU_IS_POWER_STRIP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), APP_MENU_TYPE_POWER_STRIP))
#define APP_MENU_IS_POWER_STRIP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), APP_MENU_TYPE_POWER_STRIP))
#define APP_MENU_POWER_STRIP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), APP_MENU_TYPE_POWER_STRIP, AppMenuPowerStripClass))

typedef struct _AppMenuPowerStrip AppMenuPowerStrip;
typedef struct _AppMenuPowerStripClass AppMenuPowerStripClass;
typedef enum  {
	SLINGSHOT_SLINGSHOT_VIEW_MODALITY_NORMAL_VIEW = 0,
	SLINGSHOT_SLINGSHOT_VIEW_MODALITY_CATEGORY_VIEW = 1,
	SLINGSHOT_SLINGSHOT_VIEW_MODALITY_SEARCH_VIEW
} SlingshotSlingshotViewModality;

#define SLINGSHOT_SLINGSHOT_VIEW_TYPE_MODALITY (slingshot_slingshot_view_modality_get_type ())
enum  {
	SLINGSHOT_SLINGSHOT_VIEW_0_PROPERTY,
	SLINGSHOT_SLINGSHOT_VIEW_NUM_PROPERTIES
};
static GParamSpec* slingshot_slingshot_view_properties[SLINGSHOT_SLINGSHOT_VIEW_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 _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
typedef struct _Block1Data Block1Data;
typedef struct _SlingshotSlingshotViewSearchData SlingshotSlingshotViewSearchData;
enum  {
	SLINGSHOT_SLINGSHOT_VIEW_CLOSE_INDICATOR_SIGNAL,
	SLINGSHOT_SLINGSHOT_VIEW_NUM_SIGNALS
};
static guint slingshot_slingshot_view_signals[SLINGSHOT_SLINGSHOT_VIEW_NUM_SIGNALS] = {0};

struct _SlingshotSlingshotViewPrivate {
	AppMenuPowerStrip* powerstrip;
	SlingshotBackendSynapseSearch* synapse;
	GdkScreen* screen;
	GtkRevealer* view_selector_revealer;
	SlingshotSlingshotViewModality modality;
	SlingshotWidgetsGrid* grid_view;
	GtkGrid* container;
	GtkGrid* top;
	SlingshotWidgetsSearchView* search_view;
	SlingshotWidgetsCategoryView* category_view;
	SlingshotWidgetsFavoritesSidebar* favorites_sidebar;
	GtkSeparator* favorites_separator;
	GtkOverlay* content_overlay;
	GtkGrid* content_grid;
	GtkBox* ctx_menu_widget;
};

struct _Block1Data {
	int _ref_count_;
	SlingshotSlingshotView* self;
	GeeList* matches;
	gchar* text;
	gpointer _async_data_;
};

struct _SlingshotSlingshotViewSearchData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	SlingshotSlingshotView* self;
	gchar* text;
	SynapseSearchMatch* search_match;
	SynapseMatch* target;
	Block1Data* _data1_;
	gchar* stripped;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	SlingshotBackendSynapseSearch* _tmp2_;
	GeeList* _tmp3_;
	SlingshotBackendSynapseSearch* _tmp4_;
	GeeList* _tmp5_;
};

static gint SlingshotSlingshotView_private_offset;
static gpointer slingshot_slingshot_view_parent_class = NULL;
static GSettings* slingshot_slingshot_view__settings;
static GSettings* slingshot_slingshot_view__settings = NULL;
static GType slingshot_slingshot_view_type_id = 0;

GType app_menu_power_strip_register_type (GTypeModule * module);
VALA_EXTERN GType app_menu_power_strip_get_type (void) G_GNUC_CONST ;
static GType slingshot_slingshot_view_modality_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static void slingshot_slingshot_view_dismiss_ctx_menu (SlingshotSlingshotView* self);
static gboolean slingshot_slingshot_view_on_overlay_background_click (SlingshotSlingshotView* self,
                                                               GdkEventButton* ev);
static void slingshot_slingshot_view_update_favorites_visibility (SlingshotSlingshotView* self);
static GSettings* slingshot_slingshot_view_get_settings (void);
static void slingshot_slingshot_view_search_entry_activated (SlingshotSlingshotView* self);
static void slingshot_slingshot_view_set_modality (SlingshotSlingshotView* self,
                                            SlingshotSlingshotViewModality new_modality);
static void slingshot_slingshot_view_search_data_free (gpointer _data);
static void slingshot_slingshot_view_search (SlingshotSlingshotView* self,
                                      const gchar* text,
                                      SynapseSearchMatch* search_match,
                                      SynapseMatch* target,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_);
static void slingshot_slingshot_view_search_finish (SlingshotSlingshotView* self,
                                             GAsyncResult* _res_);
static gboolean slingshot_slingshot_view_search_co (SlingshotSlingshotViewSearchData* _data_);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static gboolean ___lambda97_ (SlingshotSlingshotView* self);
static gboolean ____lambda97__gsource_func (gpointer self);
static void slingshot_slingshot_view_search_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_);
static gboolean __lambda98_ (Block1Data* _data1_);
static gboolean ___lambda98__gsource_func (gpointer self);
static void slingshot_slingshot_view_set_settings (GSettings* value);
static GObject * slingshot_slingshot_view_constructor (GType type,
                                                guint n_construct_properties,
                                                GObjectConstructParam * construct_properties);
VALA_EXTERN AppMenuPowerStrip* app_menu_power_strip_new (GtkOrientation direction);
VALA_EXTERN AppMenuPowerStrip* app_menu_power_strip_construct (GType object_type,
                                                   GtkOrientation direction);
static void _slingshot_slingshot_view___lambda99_ (SlingshotSlingshotView* self);
static void __slingshot_slingshot_view___lambda99__slingshot_widgets_favorites_sidebar_app_launched (SlingshotWidgetsFavoritesSidebar* _sender,
                                                                                              gpointer self);
static gboolean _slingshot_slingshot_view_on_overlay_background_click_gtk_widget_button_press_event (GtkWidget* _sender,
                                                                                              GdkEventButton* event,
                                                                                              gpointer self);
static void _slingshot_slingshot_view___lambda100_ (SlingshotSlingshotView* self,
                                             GtkWidget* menu_widget,
                                             gint y_center);
static void __slingshot_slingshot_view___lambda100__slingshot_widgets_favorites_sidebar_show_context_menu (SlingshotWidgetsFavoritesSidebar* _sender,
                                                                                                    GtkWidget* menu_widget,
                                                                                                    gint y_center,
                                                                                                    gpointer self);
static void _slingshot_slingshot_view___lambda101_ (SlingshotSlingshotView* self);
static void __slingshot_slingshot_view___lambda101__slingshot_widgets_favorites_sidebar_hide_context_menu (SlingshotWidgetsFavoritesSidebar* _sender,
                                                                                                    gpointer self);
static gboolean _slingshot_slingshot_view_on_event_box_key_press_gtk_widget_key_press_event (GtkWidget* _sender,
                                                                                      GdkEventKey* event,
                                                                                      gpointer self);
static gboolean _slingshot_slingshot_view_on_search_view_key_press_gtk_widget_key_press_event (GtkWidget* _sender,
                                                                                        GdkEventKey* event,
                                                                                        gpointer self);
static gboolean _slingshot_slingshot_view___lambda102_ (SlingshotSlingshotView* self);
static gboolean __slingshot_slingshot_view___lambda102__gtk_widget_focus_in_event (GtkWidget* _sender,
                                                                            GdkEventFocus* event,
                                                                            gpointer self);
static void _slingshot_slingshot_view___lambda103_ (SlingshotSlingshotView* self);
static void __slingshot_slingshot_view___lambda103__gtk_search_entry_search_changed (GtkSearchEntry* _sender,
                                                                              gpointer self);
static void _slingshot_slingshot_view_search_entry_activated_gtk_entry_activate (GtkEntry* _sender,
                                                                          gpointer self);
static void _slingshot_slingshot_view___lambda104_ (SlingshotSlingshotView* self);
static void __slingshot_slingshot_view___lambda104__slingshot_widgets_category_view_search_focus_request (SlingshotWidgetsCategoryView* _sender,
                                                                                                   gpointer self);
static void _slingshot_slingshot_view___lambda105_ (SlingshotSlingshotView* self);
static void __slingshot_slingshot_view___lambda105__slingshot_widgets_grid_app_launched (SlingshotWidgetsGrid* _sender,
                                                                                  gpointer self);
static void _slingshot_slingshot_view___lambda106_ (SlingshotSlingshotView* self);
static void __slingshot_slingshot_view___lambda106__slingshot_widgets_search_view_app_launched (SlingshotWidgetsSearchView* _sender,
                                                                                         gpointer self);
static void _slingshot_slingshot_view___lambda107_ (SlingshotSlingshotView* self);
static void __slingshot_slingshot_view___lambda107__granite_widgets_mode_button_mode_changed (GraniteWidgetsModeButton* _sender,
                                                                                       GtkWidget* widget,
                                                                                       gpointer self);
static void _slingshot_slingshot_view___lambda108_ (SlingshotSlingshotView* self);
static void __slingshot_slingshot_view___lambda108__slingshot_backend_app_system_changed (SlingshotBackendAppSystem* _sender,
                                                                                   gpointer self);
static void _slingshot_slingshot_view___lambda109_ (SlingshotSlingshotView* self);
static void __slingshot_slingshot_view___lambda109__g_settings_changed (GSettings* _sender,
                                                                 const gchar* key,
                                                                 gpointer self);
static void _slingshot_slingshot_view___lambda110_ (SlingshotSlingshotView* self);
static void __slingshot_slingshot_view___lambda110__g_settings_changed (GSettings* _sender,
                                                                 const gchar* key,
                                                                 gpointer self);
static void _slingshot_slingshot_view___lambda111_ (SlingshotSlingshotView* self);
static void __slingshot_slingshot_view___lambda111__g_settings_changed (GSettings* _sender,
                                                                 const gchar* key,
                                                                 gpointer self);
static void _slingshot_slingshot_view___lambda112_ (SlingshotSlingshotView* self);
static void __slingshot_slingshot_view___lambda112__app_menu_power_strip_invoke_action (AppMenuPowerStrip* _sender,
                                                                                 gpointer self);
static void _slingshot_slingshot_view___lambda113_ (SlingshotSlingshotView* self);
static void __slingshot_slingshot_view___lambda113__g_settings_changed (GSettings* _sender,
                                                                 const gchar* key,
                                                                 gpointer self);
static void slingshot_slingshot_view_finalize (GObject * obj);
static void _vala_slingshot_slingshot_view_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec);
static void _vala_slingshot_slingshot_view_set_property (GObject * object,
                                                  guint property_id,
                                                  const GValue * value,
                                                  GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
slingshot_slingshot_view_get_instance_private (SlingshotSlingshotView* self)
{
	return G_STRUCT_MEMBER_P (self, SlingshotSlingshotView_private_offset);
}

static GType
slingshot_slingshot_view_modality_get_type_once (void)
{
	static const GEnumValue values[] = {{SLINGSHOT_SLINGSHOT_VIEW_MODALITY_NORMAL_VIEW, "SLINGSHOT_SLINGSHOT_VIEW_MODALITY_NORMAL_VIEW", "normal-view"}, {SLINGSHOT_SLINGSHOT_VIEW_MODALITY_CATEGORY_VIEW, "SLINGSHOT_SLINGSHOT_VIEW_MODALITY_CATEGORY_VIEW", "category-view"}, {SLINGSHOT_SLINGSHOT_VIEW_MODALITY_SEARCH_VIEW, "SLINGSHOT_SLINGSHOT_VIEW_MODALITY_SEARCH_VIEW", "search-view"}, {0, NULL, NULL}};
	GType slingshot_slingshot_view_modality_type_id;
	slingshot_slingshot_view_modality_type_id = g_enum_register_static ("SlingshotSlingshotViewModality", values);
	return slingshot_slingshot_view_modality_type_id;
}

static GType
slingshot_slingshot_view_modality_get_type (void)
{
	static volatile gsize slingshot_slingshot_view_modality_type_id__once = 0;
	if (g_once_init_enter (&slingshot_slingshot_view_modality_type_id__once)) {
		GType slingshot_slingshot_view_modality_type_id;
		slingshot_slingshot_view_modality_type_id = slingshot_slingshot_view_modality_get_type_once ();
		g_once_init_leave (&slingshot_slingshot_view_modality_type_id__once, slingshot_slingshot_view_modality_type_id);
	}
	return slingshot_slingshot_view_modality_type_id__once;
}

static void
slingshot_slingshot_view_dismiss_ctx_menu (SlingshotSlingshotView* self)
{
	GtkBox* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->ctx_menu_widget;
	if (_tmp0_ != NULL) {
		GtkOverlay* _tmp1_;
		GtkBox* _tmp2_;
		_tmp1_ = self->priv->content_overlay;
		_tmp2_ = self->priv->ctx_menu_widget;
		gtk_container_remove ((GtkContainer*) _tmp1_, (GtkWidget*) _tmp2_);
		_g_object_unref0 (self->priv->ctx_menu_widget);
		self->priv->ctx_menu_widget = NULL;
	}
}

static gboolean
slingshot_slingshot_view_on_overlay_background_click (SlingshotSlingshotView* self,
                                                      GdkEventButton* ev)
{
	GtkBox* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (ev != NULL, FALSE);
	_tmp0_ = self->priv->ctx_menu_widget;
	if (_tmp0_ != NULL) {
		gint mx = 0;
		gint my = 0;
		gint mw = 0;
		gint mh = 0;
		GtkBox* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		GtkBox* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		GtkBox* _tmp7_;
		GtkBox* _tmp8_;
		gboolean _tmp9_ = FALSE;
		gboolean _tmp10_ = FALSE;
		gboolean _tmp11_ = FALSE;
		_tmp1_ = self->priv->ctx_menu_widget;
		_tmp2_ = gtk_widget_get_margin_start ((GtkWidget*) _tmp1_);
		_tmp3_ = _tmp2_;
		mx = _tmp3_;
		_tmp4_ = self->priv->ctx_menu_widget;
		_tmp5_ = gtk_widget_get_margin_top ((GtkWidget*) _tmp4_);
		_tmp6_ = _tmp5_;
		my = _tmp6_;
		_tmp7_ = self->priv->ctx_menu_widget;
		mw = gtk_widget_get_allocated_width ((GtkWidget*) _tmp7_);
		_tmp8_ = self->priv->ctx_menu_widget;
		mh = gtk_widget_get_allocated_height ((GtkWidget*) _tmp8_);
		if (ev->x < ((gdouble) mx)) {
			_tmp11_ = TRUE;
		} else {
			_tmp11_ = ev->x > ((gdouble) (mx + mw));
		}
		if (_tmp11_) {
			_tmp10_ = TRUE;
		} else {
			_tmp10_ = ev->y < ((gdouble) my);
		}
		if (_tmp10_) {
			_tmp9_ = TRUE;
		} else {
			_tmp9_ = ev->y > ((gdouble) (my + mh));
		}
		if (_tmp9_) {
			SlingshotWidgetsFavoritesSidebar* _tmp12_;
			_tmp12_ = self->priv->favorites_sidebar;
			slingshot_widgets_favorites_sidebar_close_context_menu (_tmp12_);
			slingshot_slingshot_view_dismiss_ctx_menu (self);
			result = GDK_EVENT_STOP;
			return result;
		}
	}
	result = GDK_EVENT_PROPAGATE;
	return result;
}

void
slingshot_slingshot_view_panel_position_changed (SlingshotSlingshotView* self,
                                                 BudgiePanelPosition position)
{
	GtkGrid* _tmp16_;
	g_return_if_fail (self != NULL);
	if (position == BUDGIE_PANEL_POSITION_BOTTOM) {
		GtkGrid* _tmp0_;
		GtkGrid* _tmp1_;
		GtkGrid* _tmp2_;
		GtkGrid* _tmp3_;
		GtkGrid* _tmp4_;
		GtkGrid* _tmp5_;
		GtkGrid* _tmp6_;
		GtkOverlay* _tmp7_;
		_tmp0_ = self->priv->container;
		gtk_widget_set_margin_bottom ((GtkWidget*) _tmp0_, 12);
		_tmp1_ = self->priv->container;
		gtk_widget_set_margin_top ((GtkWidget*) _tmp1_, 0);
		_tmp2_ = self->priv->container;
		gtk_grid_remove_row (_tmp2_, 1);
		_tmp3_ = self->priv->container;
		gtk_grid_remove_row (_tmp3_, 0);
		_tmp4_ = self->priv->container;
		_tmp5_ = self->priv->top;
		gtk_grid_attach (_tmp4_, (GtkWidget*) _tmp5_, 0, 1, 1, 1);
		_tmp6_ = self->priv->container;
		_tmp7_ = self->priv->content_overlay;
		gtk_grid_attach (_tmp6_, (GtkWidget*) _tmp7_, 0, 0, 1, 1);
	} else {
		GtkGrid* _tmp8_;
		GtkGrid* _tmp9_;
		GtkGrid* _tmp10_;
		GtkGrid* _tmp11_;
		GtkGrid* _tmp12_;
		GtkGrid* _tmp13_;
		GtkGrid* _tmp14_;
		GtkOverlay* _tmp15_;
		_tmp8_ = self->priv->container;
		gtk_widget_set_margin_bottom ((GtkWidget*) _tmp8_, 0);
		_tmp9_ = self->priv->container;
		gtk_widget_set_margin_top ((GtkWidget*) _tmp9_, 12);
		_tmp10_ = self->priv->container;
		gtk_grid_remove_row (_tmp10_, 1);
		_tmp11_ = self->priv->container;
		gtk_grid_remove_row (_tmp11_, 0);
		_tmp12_ = self->priv->container;
		_tmp13_ = self->priv->top;
		gtk_grid_attach (_tmp12_, (GtkWidget*) _tmp13_, 0, 0, 1, 1);
		_tmp14_ = self->priv->container;
		_tmp15_ = self->priv->content_overlay;
		gtk_grid_attach (_tmp14_, (GtkWidget*) _tmp15_, 0, 1, 1, 1);
	}
	_tmp16_ = self->priv->content_grid;
	gtk_widget_show_all ((GtkWidget*) _tmp16_);
}

static void
slingshot_slingshot_view_update_favorites_visibility (SlingshotSlingshotView* self)
{
	gboolean show_favorites = FALSE;
	GSettings* _tmp0_;
	GSettings* _tmp1_;
	SlingshotWidgetsFavoritesSidebar* _tmp2_;
	GtkSeparator* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = slingshot_slingshot_view_get_settings ();
	_tmp1_ = _tmp0_;
	show_favorites = g_settings_get_boolean (_tmp1_, "enable-favorites");
	_tmp2_ = self->priv->favorites_sidebar;
	if (_tmp2_ != NULL) {
		SlingshotWidgetsFavoritesSidebar* _tmp3_;
		_tmp3_ = self->priv->favorites_sidebar;
		gtk_widget_set_visible ((GtkWidget*) _tmp3_, show_favorites);
	}
	_tmp4_ = self->priv->favorites_separator;
	if (_tmp4_ != NULL) {
		GtkSeparator* _tmp5_;
		_tmp5_ = self->priv->favorites_separator;
		gtk_widget_set_visible ((GtkWidget*) _tmp5_, show_favorites);
	}
}

static void
slingshot_slingshot_view_search_entry_activated (SlingshotSlingshotView* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->modality == SLINGSHOT_SLINGSHOT_VIEW_MODALITY_SEARCH_VIEW) {
		SlingshotWidgetsSearchView* _tmp0_;
		_tmp0_ = self->priv->search_view;
		slingshot_widgets_search_view_activate_selection (_tmp0_);
	}
}

static gchar*
string_replace (const gchar* self,
                const gchar* old,
                const gchar* replacement)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	if ((*((gchar*) self)) == '\0') {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = (*((gchar*) old)) == '\0';
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_strcmp0 (old, replacement) == 0;
	}
	if (_tmp0_) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup (self);
		result = _tmp2_;
		return result;
	}
	{
		GRegex* regex = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GRegex* _tmp5_;
		GRegex* _tmp6_;
		gchar* _tmp7_ = NULL;
		GRegex* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp3_ = g_regex_escape_string (old, -1);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_regex_new (_tmp4_, 0, 0, &_inner_error0_);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp4_);
		regex = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected 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;
		}
		_tmp8_ = regex;
		_tmp9_ = g_regex_replace_literal (_tmp8_, self, (gssize) -1, 0, replacement, 0, &_inner_error0_);
		_tmp7_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_regex_unref0 (regex);
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected 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;
		}
		_tmp10_ = _tmp7_;
		_tmp7_ = NULL;
		result = _tmp10_;
		_g_free0 (_tmp7_);
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally0;
	__catch0_g_regex_error:
	{
		g_clear_error (&_inner_error0_);
		g_assert_not_reached ();
	}
	__finally0:
	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;
}

gboolean
slingshot_slingshot_view_on_search_view_key_press (SlingshotSlingshotView* self,
                                                   GdkEventKey* event)
{
	gchar* key = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	GQuark _tmp5_ = 0U;
	static GQuark _tmp4_label0 = 0;
	static GQuark _tmp4_label1 = 0;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = gdk_keyval_name (event->keyval);
	_tmp1_ = string_replace (_tmp0_, "KP_", "");
	key = _tmp1_;
	_tmp2_ = key;
	_tmp3_ = _tmp2_;
	_tmp5_ = (NULL == _tmp3_) ? 0 : g_quark_from_string (_tmp3_);
	if (_tmp5_ == ((0 != _tmp4_label0) ? _tmp4_label0 : (_tmp4_label0 = g_quark_from_static_string ("Down")))) {
		switch (0) {
			default:
			{
				GtkSearchEntry* _tmp6_;
				_tmp6_ = self->search_entry;
				g_signal_emit_by_name ((GtkWidget*) _tmp6_, "move-focus", GTK_DIR_TAB_FORWARD);
				result = GDK_EVENT_STOP;
				_g_free0 (key);
				return result;
			}
		}
	} else if (_tmp5_ == ((0 != _tmp4_label1) ? _tmp4_label1 : (_tmp4_label1 = g_quark_from_static_string ("Escape")))) {
		switch (0) {
			default:
			{
				GtkBox* _tmp7_;
				GtkSearchEntry* _tmp9_;
				const gchar* _tmp10_;
				const gchar* _tmp11_;
				gint _tmp12_;
				gint _tmp13_;
				_tmp7_ = self->priv->ctx_menu_widget;
				if (_tmp7_ != NULL) {
					SlingshotWidgetsFavoritesSidebar* _tmp8_;
					_tmp8_ = self->priv->favorites_sidebar;
					slingshot_widgets_favorites_sidebar_close_context_menu (_tmp8_);
					slingshot_slingshot_view_dismiss_ctx_menu (self);
					result = GDK_EVENT_STOP;
					_g_free0 (key);
					return result;
				}
				_tmp9_ = self->search_entry;
				_tmp10_ = gtk_entry_get_text ((GtkEntry*) _tmp9_);
				_tmp11_ = _tmp10_;
				_tmp12_ = strlen (_tmp11_);
				_tmp13_ = _tmp12_;
				if (_tmp13_ > 0) {
					GtkSearchEntry* _tmp14_;
					_tmp14_ = self->search_entry;
					gtk_entry_set_text ((GtkEntry*) _tmp14_, "");
				} else {
					g_signal_emit (self, slingshot_slingshot_view_signals[SLINGSHOT_SLINGSHOT_VIEW_CLOSE_INDICATOR_SIGNAL], 0);
				}
				result = GDK_EVENT_STOP;
				_g_free0 (key);
				return result;
			}
		}
	}
	result = GDK_EVENT_PROPAGATE;
	_g_free0 (key);
	return result;
}

gboolean
slingshot_slingshot_view_on_event_box_key_press (SlingshotSlingshotView* self,
                                                 GdkEventKey* event)
{
	gchar* key = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gboolean _tmp2_ = FALSE;
	const gchar* _tmp3_;
	const gchar* _tmp21_;
	const gchar* _tmp22_;
	GQuark _tmp24_ = 0U;
	static GQuark _tmp23_label0 = 0;
	static GQuark _tmp23_label1 = 0;
	static GQuark _tmp23_label2 = 0;
	static GQuark _tmp23_label3 = 0;
	static GQuark _tmp23_label4 = 0;
	static GQuark _tmp23_label5 = 0;
	static GQuark _tmp23_label6 = 0;
	static GQuark _tmp23_label7 = 0;
	static GQuark _tmp23_label8 = 0;
	static GQuark _tmp23_label9 = 0;
	static GQuark _tmp23_label10 = 0;
	static GQuark _tmp23_label11 = 0;
	static GQuark _tmp23_label12 = 0;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = gdk_keyval_name (event->keyval);
	_tmp1_ = string_replace (_tmp0_, "KP_", "");
	key = _tmp1_;
	_tmp3_ = key;
	if (g_strcmp0 (_tmp3_, "Escape") == 0) {
		GtkBox* _tmp4_;
		_tmp4_ = self->priv->ctx_menu_widget;
		_tmp2_ = _tmp4_ != NULL;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		SlingshotWidgetsFavoritesSidebar* _tmp5_;
		_tmp5_ = self->priv->favorites_sidebar;
		slingshot_widgets_favorites_sidebar_close_context_menu (_tmp5_);
		slingshot_slingshot_view_dismiss_ctx_menu (self);
		result = GDK_EVENT_STOP;
		_g_free0 (key);
		return result;
	}
	if ((event->state & GDK_CONTROL_MASK) != 0) {
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		GQuark _tmp9_ = 0U;
		static GQuark _tmp8_label0 = 0;
		static GQuark _tmp8_label1 = 0;
		_tmp6_ = key;
		_tmp7_ = _tmp6_;
		_tmp9_ = (NULL == _tmp7_) ? 0 : g_quark_from_string (_tmp7_);
		if (_tmp9_ == ((0 != _tmp8_label0) ? _tmp8_label0 : (_tmp8_label0 = g_quark_from_static_string ("1")))) {
			switch (0) {
				default:
				{
					GraniteWidgetsModeButton* _tmp10_;
					_tmp10_ = self->view_selector;
					granite_widgets_mode_button_set_selected (_tmp10_, 0);
					result = GDK_EVENT_STOP;
					_g_free0 (key);
					return result;
				}
			}
		} else if (_tmp9_ == ((0 != _tmp8_label1) ? _tmp8_label1 : (_tmp8_label1 = g_quark_from_static_string ("2")))) {
			switch (0) {
				default:
				{
					GraniteWidgetsModeButton* _tmp11_;
					_tmp11_ = self->view_selector;
					granite_widgets_mode_button_set_selected (_tmp11_, 1);
					result = GDK_EVENT_STOP;
					_g_free0 (key);
					return result;
				}
			}
		}
	}
	if ((event->state & GDK_MOD1_MASK) != 0) {
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		GQuark _tmp15_ = 0U;
		static GQuark _tmp14_label0 = 0;
		static GQuark _tmp14_label1 = 0;
		static GQuark _tmp14_label2 = 0;
		static GQuark _tmp14_label3 = 0;
		static GQuark _tmp14_label4 = 0;
		static GQuark _tmp14_label5 = 0;
		static GQuark _tmp14_label6 = 0;
		static GQuark _tmp14_label7 = 0;
		static GQuark _tmp14_label8 = 0;
		static GQuark _tmp14_label9 = 0;
		static GQuark _tmp14_label10 = 0;
		_tmp12_ = key;
		_tmp13_ = _tmp12_;
		_tmp15_ = (NULL == _tmp13_) ? 0 : g_quark_from_string (_tmp13_);
		if (_tmp15_ == ((0 != _tmp14_label0) ? _tmp14_label0 : (_tmp14_label0 = g_quark_from_static_string ("F4")))) {
			switch (0) {
				default:
				{
					g_signal_emit (self, slingshot_slingshot_view_signals[SLINGSHOT_SLINGSHOT_VIEW_CLOSE_INDICATOR_SIGNAL], 0);
					result = GDK_EVENT_STOP;
					_g_free0 (key);
					return result;
				}
			}
		} else if ((((((((((_tmp15_ == ((0 != _tmp14_label1) ? _tmp14_label1 : (_tmp14_label1 = g_quark_from_static_string ("0")))) || (_tmp15_ == ((0 != _tmp14_label2) ? _tmp14_label2 : (_tmp14_label2 = g_quark_from_static_string ("1"))))) || (_tmp15_ == ((0 != _tmp14_label3) ? _tmp14_label3 : (_tmp14_label3 = g_quark_from_static_string ("2"))))) || (_tmp15_ == ((0 != _tmp14_label4) ? _tmp14_label4 : (_tmp14_label4 = g_quark_from_static_string ("3"))))) || (_tmp15_ == ((0 != _tmp14_label5) ? _tmp14_label5 : (_tmp14_label5 = g_quark_from_static_string ("4"))))) || (_tmp15_ == ((0 != _tmp14_label6) ? _tmp14_label6 : (_tmp14_label6 = g_quark_from_static_string ("5"))))) || (_tmp15_ == ((0 != _tmp14_label7) ? _tmp14_label7 : (_tmp14_label7 = g_quark_from_static_string ("6"))))) || (_tmp15_ == ((0 != _tmp14_label8) ? _tmp14_label8 : (_tmp14_label8 = g_quark_from_static_string ("7"))))) || (_tmp15_ == ((0 != _tmp14_label9) ? _tmp14_label9 : (_tmp14_label9 = g_quark_from_static_string ("8"))))) || (_tmp15_ == ((0 != _tmp14_label10) ? _tmp14_label10 : (_tmp14_label10 = g_quark_from_static_string ("9"))))) {
			switch (0) {
				default:
				{
					GtkSearchEntry* _tmp20_;
					if (self->priv->modality == SLINGSHOT_SLINGSHOT_VIEW_MODALITY_NORMAL_VIEW) {
						gint page = 0;
						const gchar* _tmp16_;
						gboolean _tmp17_ = FALSE;
						_tmp16_ = key;
						page = atoi (_tmp16_);
						if (page < 0) {
							_tmp17_ = TRUE;
						} else {
							_tmp17_ = page == 9;
						}
						if (_tmp17_) {
							SlingshotWidgetsGrid* _tmp18_;
							_tmp18_ = self->priv->grid_view;
							slingshot_widgets_grid_go_to_last (_tmp18_);
						} else {
							SlingshotWidgetsGrid* _tmp19_;
							_tmp19_ = self->priv->grid_view;
							slingshot_widgets_grid_go_to_number (_tmp19_, page);
						}
					}
					_tmp20_ = self->search_entry;
					gtk_widget_grab_focus ((GtkWidget*) _tmp20_);
					result = GDK_EVENT_STOP;
					_g_free0 (key);
					return result;
				}
			}
		}
	}
	_tmp21_ = key;
	_tmp22_ = _tmp21_;
	_tmp24_ = (NULL == _tmp22_) ? 0 : g_quark_from_string (_tmp22_);
	if (((((((((_tmp24_ == ((0 != _tmp23_label0) ? _tmp23_label0 : (_tmp23_label0 = g_quark_from_static_string ("Down")))) || (_tmp24_ == ((0 != _tmp23_label1) ? _tmp23_label1 : (_tmp23_label1 = g_quark_from_static_string ("Enter"))))) || (_tmp24_ == ((0 != _tmp23_label2) ? _tmp23_label2 : (_tmp23_label2 = g_quark_from_static_string ("Home"))))) || (_tmp24_ == ((0 != _tmp23_label3) ? _tmp23_label3 : (_tmp23_label3 = g_quark_from_static_string ("KP_Enter"))))) || (_tmp24_ == ((0 != _tmp23_label4) ? _tmp23_label4 : (_tmp23_label4 = g_quark_from_static_string ("Left"))))) || (_tmp24_ == ((0 != _tmp23_label5) ? _tmp23_label5 : (_tmp23_label5 = g_quark_from_static_string ("Return"))))) || (_tmp24_ == ((0 != _tmp23_label6) ? _tmp23_label6 : (_tmp23_label6 = g_quark_from_static_string ("Right"))))) || (_tmp24_ == ((0 != _tmp23_label7) ? _tmp23_label7 : (_tmp23_label7 = g_quark_from_static_string ("Tab"))))) || (_tmp24_ == ((0 != _tmp23_label8) ? _tmp23_label8 : (_tmp23_label8 = g_quark_from_static_string ("Up"))))) {
		switch (0) {
			default:
			{
				result = GDK_EVENT_PROPAGATE;
				_g_free0 (key);
				return result;
			}
		}
	} else if (_tmp24_ == ((0 != _tmp23_label9) ? _tmp23_label9 : (_tmp23_label9 = g_quark_from_static_string ("Page_Up")))) {
		switch (0) {
			default:
			{
				if (self->priv->modality == SLINGSHOT_SLINGSHOT_VIEW_MODALITY_NORMAL_VIEW) {
					SlingshotWidgetsGrid* _tmp25_;
					_tmp25_ = self->priv->grid_view;
					slingshot_widgets_grid_go_to_previous (_tmp25_);
				} else {
					if (self->priv->modality == SLINGSHOT_SLINGSHOT_VIEW_MODALITY_CATEGORY_VIEW) {
						SlingshotWidgetsCategoryView* _tmp26_;
						_tmp26_ = self->priv->category_view;
						slingshot_widgets_category_view_page_up (_tmp26_);
					}
				}
				break;
			}
		}
	} else if (_tmp24_ == ((0 != _tmp23_label10) ? _tmp23_label10 : (_tmp23_label10 = g_quark_from_static_string ("Page_Down")))) {
		switch (0) {
			default:
			{
				if (self->priv->modality == SLINGSHOT_SLINGSHOT_VIEW_MODALITY_NORMAL_VIEW) {
					SlingshotWidgetsGrid* _tmp27_;
					_tmp27_ = self->priv->grid_view;
					slingshot_widgets_grid_go_to_next (_tmp27_);
				} else {
					if (self->priv->modality == SLINGSHOT_SLINGSHOT_VIEW_MODALITY_CATEGORY_VIEW) {
						SlingshotWidgetsCategoryView* _tmp28_;
						_tmp28_ = self->priv->category_view;
						slingshot_widgets_category_view_page_down (_tmp28_);
					}
				}
				break;
			}
		}
	} else if (_tmp24_ == ((0 != _tmp23_label11) ? _tmp23_label11 : (_tmp23_label11 = g_quark_from_static_string ("BackSpace")))) {
		switch (0) {
			default:
			{
				GtkSearchEntry* _tmp29_;
				gboolean _tmp30_;
				gboolean _tmp31_;
				_tmp29_ = self->search_entry;
				g_object_get ((GtkWidget*) _tmp29_, "has-focus", &_tmp30_, NULL);
				_tmp31_ = _tmp30_;
				if (!_tmp31_) {
					GtkSearchEntry* _tmp32_;
					GtkSearchEntry* _tmp33_;
					_tmp32_ = self->search_entry;
					gtk_widget_grab_focus ((GtkWidget*) _tmp32_);
					_tmp33_ = self->search_entry;
					g_signal_emit_by_name ((GtkEntry*) _tmp33_, "move-cursor", GTK_MOVEMENT_BUFFER_ENDS, 0, FALSE);
				}
				result = GDK_EVENT_PROPAGATE;
				_g_free0 (key);
				return result;
			}
		}
	} else if (_tmp24_ == ((0 != _tmp23_label12) ? _tmp23_label12 : (_tmp23_label12 = g_quark_from_static_string ("End")))) {
		switch (0) {
			default:
			{
				if (self->priv->modality == SLINGSHOT_SLINGSHOT_VIEW_MODALITY_NORMAL_VIEW) {
					SlingshotWidgetsGrid* _tmp34_;
					_tmp34_ = self->priv->grid_view;
					slingshot_widgets_grid_go_to_last (_tmp34_);
				}
				result = GDK_EVENT_PROPAGATE;
				_g_free0 (key);
				return result;
			}
		}
	} else {
		switch (0) {
			default:
			{
				gboolean _tmp35_ = FALSE;
				GtkSearchEntry* _tmp36_;
				gboolean _tmp37_;
				gboolean _tmp38_;
				_tmp36_ = self->search_entry;
				g_object_get ((GtkWidget*) _tmp36_, "has-focus", &_tmp37_, NULL);
				_tmp38_ = _tmp37_;
				if (!_tmp38_) {
					_tmp35_ = event->is_modifier != ((guint) 1);
				} else {
					_tmp35_ = FALSE;
				}
				if (_tmp35_) {
					GtkSearchEntry* _tmp39_;
					GtkSearchEntry* _tmp40_;
					_tmp39_ = self->search_entry;
					gtk_widget_grab_focus ((GtkWidget*) _tmp39_);
					_tmp40_ = self->search_entry;
					g_signal_emit_by_name ((GtkEntry*) _tmp40_, "move-cursor", GTK_MOVEMENT_BUFFER_ENDS, 0, FALSE);
				}
				result = GDK_EVENT_PROPAGATE;
				_g_free0 (key);
				return result;
			}
		}
	}
	result = GDK_EVENT_STOP;
	_g_free0 (key);
	return result;
}

void
slingshot_slingshot_view_show_slingshot (SlingshotSlingshotView* self)
{
	GtkSearchEntry* _tmp0_;
	GtkSearchEntry* _tmp1_;
	GtkRevealer* _tmp2_;
	GtkStack* _tmp3_;
	GraniteWidgetsModeButton* _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	GtkRevealer* _tmp7_;
	AppMenuPowerStrip* _tmp8_;
	GSettings* _tmp9_;
	GSettings* _tmp10_;
	GtkStack* _tmp11_;
	gboolean _tmp12_ = FALSE;
	SlingshotWidgetsFavoritesSidebar* _tmp13_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->search_entry;
	gtk_entry_set_text ((GtkEntry*) _tmp0_, "");
	_tmp1_ = self->search_entry;
	gtk_widget_grab_focus ((GtkWidget*) _tmp1_);
	_tmp2_ = self->priv->view_selector_revealer;
	gtk_revealer_set_transition_type (_tmp2_, GTK_REVEALER_TRANSITION_TYPE_NONE);
	_tmp3_ = self->stack;
	gtk_stack_set_transition_type (_tmp3_, GTK_STACK_TRANSITION_TYPE_NONE);
	_tmp4_ = self->view_selector;
	_tmp5_ = granite_widgets_mode_button_get_selected (_tmp4_);
	_tmp6_ = _tmp5_;
	slingshot_slingshot_view_set_modality (self, (SlingshotSlingshotViewModality) _tmp6_);
	_tmp7_ = self->priv->view_selector_revealer;
	gtk_revealer_set_transition_type (_tmp7_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT);
	_tmp8_ = self->priv->powerstrip;
	_tmp9_ = slingshot_slingshot_view_get_settings ();
	_tmp10_ = _tmp9_;
	gtk_widget_set_visible ((GtkWidget*) _tmp8_, g_settings_get_boolean (_tmp10_, "enable-powerstrip"));
	_tmp11_ = self->stack;
	gtk_stack_set_transition_type (_tmp11_, GTK_STACK_TRANSITION_TYPE_CROSSFADE);
	_tmp13_ = self->priv->favorites_sidebar;
	if (_tmp13_ != NULL) {
		GSettings* _tmp14_;
		GSettings* _tmp15_;
		_tmp14_ = slingshot_slingshot_view_get_settings ();
		_tmp15_ = _tmp14_;
		_tmp12_ = g_settings_get_boolean (_tmp15_, "enable-favorites");
	} else {
		_tmp12_ = FALSE;
	}
	if (_tmp12_) {
		SlingshotWidgetsFavoritesSidebar* _tmp16_;
		_tmp16_ = self->priv->favorites_sidebar;
		slingshot_widgets_favorites_sidebar_validate_and_populate (_tmp16_);
	}
}

static void
slingshot_slingshot_view_set_modality (SlingshotSlingshotView* self,
                                       SlingshotSlingshotViewModality new_modality)
{
	g_return_if_fail (self != NULL);
	self->priv->modality = new_modality;
	switch (self->priv->modality) {
		case SLINGSHOT_SLINGSHOT_VIEW_MODALITY_NORMAL_VIEW:
		{
			GSettings* _tmp0_;
			GSettings* _tmp1_;
			GtkRevealer* _tmp4_;
			GtkStack* _tmp5_;
			GtkSearchEntry* _tmp6_;
			_tmp0_ = slingshot_slingshot_view_get_settings ();
			_tmp1_ = _tmp0_;
			if (g_settings_get_boolean (_tmp1_, "use-category")) {
				GSettings* _tmp2_;
				GSettings* _tmp3_;
				_tmp2_ = slingshot_slingshot_view_get_settings ();
				_tmp3_ = _tmp2_;
				g_settings_set_boolean (_tmp3_, "use-category", FALSE);
			}
			_tmp4_ = self->priv->view_selector_revealer;
			gtk_revealer_set_reveal_child (_tmp4_, TRUE);
			_tmp5_ = self->stack;
			gtk_stack_set_visible_child_name (_tmp5_, "normal");
			_tmp6_ = self->search_entry;
			gtk_widget_grab_focus ((GtkWidget*) _tmp6_);
			break;
		}
		case SLINGSHOT_SLINGSHOT_VIEW_MODALITY_CATEGORY_VIEW:
		{
			GSettings* _tmp7_;
			GSettings* _tmp8_;
			GtkRevealer* _tmp11_;
			GtkStack* _tmp12_;
			GtkSearchEntry* _tmp13_;
			_tmp7_ = slingshot_slingshot_view_get_settings ();
			_tmp8_ = _tmp7_;
			if (!g_settings_get_boolean (_tmp8_, "use-category")) {
				GSettings* _tmp9_;
				GSettings* _tmp10_;
				_tmp9_ = slingshot_slingshot_view_get_settings ();
				_tmp10_ = _tmp9_;
				g_settings_set_boolean (_tmp10_, "use-category", TRUE);
			}
			_tmp11_ = self->priv->view_selector_revealer;
			gtk_revealer_set_reveal_child (_tmp11_, TRUE);
			_tmp12_ = self->stack;
			gtk_stack_set_visible_child_name (_tmp12_, "category");
			_tmp13_ = self->search_entry;
			gtk_widget_grab_focus ((GtkWidget*) _tmp13_);
			break;
		}
		case SLINGSHOT_SLINGSHOT_VIEW_MODALITY_SEARCH_VIEW:
		{
			GtkRevealer* _tmp14_;
			GtkStack* _tmp15_;
			_tmp14_ = self->priv->view_selector_revealer;
			gtk_revealer_set_reveal_child (_tmp14_, FALSE);
			_tmp15_ = self->stack;
			gtk_stack_set_visible_child_name (_tmp15_, "search");
			break;
		}
		default:
		break;
	}
}

static void
slingshot_slingshot_view_search_data_free (gpointer _data)
{
	SlingshotSlingshotViewSearchData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->search_match);
	_g_object_unref0 (_data_->target);
	_g_object_unref0 (_data_->self);
	g_slice_free (SlingshotSlingshotViewSearchData, _data_);
}

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

static void
slingshot_slingshot_view_search (SlingshotSlingshotView* self,
                                 const gchar* text,
                                 SynapseSearchMatch* search_match,
                                 SynapseMatch* target,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_)
{
	SlingshotSlingshotViewSearchData* _data_;
	SlingshotSlingshotView* _tmp0_;
	gchar* _tmp1_;
	SynapseSearchMatch* _tmp2_;
	SynapseMatch* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (text != NULL);
	_data_ = g_slice_new0 (SlingshotSlingshotViewSearchData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, slingshot_slingshot_view_search_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (text);
	_g_free0 (_data_->text);
	_data_->text = _tmp1_;
	_tmp2_ = _g_object_ref0 (search_match);
	_g_object_unref0 (_data_->search_match);
	_data_->search_match = _tmp2_;
	_tmp3_ = _g_object_ref0 (target);
	_g_object_unref0 (_data_->target);
	_data_->target = _tmp3_;
	slingshot_slingshot_view_search_co (_data_);
}

static void
slingshot_slingshot_view_search_finish (SlingshotSlingshotView* self,
                                        GAsyncResult* _res_)
{
	SlingshotSlingshotViewSearchData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block1Data*
block1_data_ref (Block1Data* _data1_)
{
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}

static void
block1_data_unref (void * _userdata_)
{
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		SlingshotSlingshotView* self;
		self = _data1_->self;
		_g_object_unref0 (_data1_->matches);
		_g_free0 (_data1_->text);
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

static gboolean
___lambda97_ (SlingshotSlingshotView* self)
{
	GtkSearchEntry* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gboolean _tmp5_;
	gboolean result;
	_tmp0_ = self->search_entry;
	_tmp1_ = gtk_entry_get_text ((GtkEntry*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = string_strip (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_strcmp0 (_tmp4_, "") == 0;
	_g_free0 (_tmp4_);
	if (_tmp5_) {
		GraniteWidgetsModeButton* _tmp6_;
		gint _tmp7_;
		gint _tmp8_;
		_tmp6_ = self->view_selector;
		_tmp7_ = granite_widgets_mode_button_get_selected (_tmp6_);
		_tmp8_ = _tmp7_;
		slingshot_slingshot_view_set_modality (self, (SlingshotSlingshotViewModality) _tmp8_);
	}
	result = FALSE;
	return result;
}

static gboolean
____lambda97__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda97_ ((SlingshotSlingshotView*) self);
	return result;
}

static void
slingshot_slingshot_view_search_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_)
{
	SlingshotSlingshotViewSearchData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	slingshot_slingshot_view_search_co (_data_);
}

static gboolean
__lambda98_ (Block1Data* _data1_)
{
	SlingshotSlingshotView* self;
	SlingshotWidgetsSearchView* _tmp0_;
	GeeList* _tmp1_;
	gboolean result;
	self = _data1_->self;
	_tmp0_ = self->priv->search_view;
	_tmp1_ = _data1_->matches;
	slingshot_widgets_search_view_set_results (_tmp0_, _tmp1_, _data1_->text);
	result = FALSE;
	return result;
}

static gboolean
___lambda98__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda98_ (self);
	return result;
}

static gboolean
slingshot_slingshot_view_search_co (SlingshotSlingshotViewSearchData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data1_ = g_slice_new0 (Block1Data);
	_data_->_data1_->_ref_count_ = 1;
	_data_->_data1_->self = g_object_ref (_data_->self);
	_g_free0 (_data_->_data1_->text);
	_data_->_data1_->text = _data_->text;
	_data_->_data1_->_async_data_ = _data_;
	_data_->_tmp0_ = string_strip (_data_->_data1_->text);
	_data_->stripped = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->stripped;
	if (g_strcmp0 (_data_->_tmp1_, "") == 0) {
		g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ____lambda97__gsource_func, g_object_ref (_data_->self), g_object_unref);
		_g_free0 (_data_->stripped);
		block1_data_unref (_data_->_data1_);
		_data_->_data1_ = NULL;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->self->priv->modality != SLINGSHOT_SLINGSHOT_VIEW_MODALITY_SEARCH_VIEW) {
		slingshot_slingshot_view_set_modality (_data_->self, SLINGSHOT_SLINGSHOT_VIEW_MODALITY_SEARCH_VIEW);
	}
	if (_data_->search_match != NULL) {
		synapse_search_match_set_search_source (_data_->search_match, _data_->target);
		_data_->_tmp2_ = _data_->self->priv->synapse;
		_data_->_state_ = 1;
		slingshot_backend_synapse_search_search (_data_->_tmp2_, _data_->_data1_->text, (SynapseSearchProvider*) _data_->search_match, slingshot_slingshot_view_search_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp3_ = slingshot_backend_synapse_search_search_finish (_data_->_tmp2_, _data_->_res_);
		_g_object_unref0 (_data_->_data1_->matches);
		_data_->_data1_->matches = _data_->_tmp3_;
	} else {
		_data_->_tmp4_ = _data_->self->priv->synapse;
		_data_->_state_ = 2;
		slingshot_backend_synapse_search_search (_data_->_tmp4_, _data_->_data1_->text, NULL, slingshot_slingshot_view_search_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp5_ = slingshot_backend_synapse_search_search_finish (_data_->_tmp4_, _data_->_res_);
		_g_object_unref0 (_data_->_data1_->matches);
		_data_->_data1_->matches = _data_->_tmp5_;
	}
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda98__gsource_func, block1_data_ref (_data_->_data1_), block1_data_unref);
	_g_free0 (_data_->stripped);
	block1_data_unref (_data_->_data1_);
	_data_->_data1_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

SlingshotSlingshotView*
slingshot_slingshot_view_construct (GType object_type)
{
	SlingshotSlingshotView * self = NULL;
	self = (SlingshotSlingshotView*) g_object_new (object_type, NULL);
	return self;
}

SlingshotSlingshotView*
slingshot_slingshot_view_new (void)
{
	return slingshot_slingshot_view_construct (SLINGSHOT_TYPE_SLINGSHOT_VIEW);
}

static GSettings*
slingshot_slingshot_view_get_settings (void)
{
	GSettings* result;
	GSettings* _tmp0_;
	_tmp0_ = slingshot_slingshot_view__settings;
	result = _tmp0_;
	return result;
}

static void
slingshot_slingshot_view_set_settings (GSettings* value)
{
	GSettings* _tmp0_;
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (slingshot_slingshot_view__settings);
	slingshot_slingshot_view__settings = _tmp0_;
}

static void
_slingshot_slingshot_view___lambda99_ (SlingshotSlingshotView* self)
{
	g_signal_emit (self, slingshot_slingshot_view_signals[SLINGSHOT_SLINGSHOT_VIEW_CLOSE_INDICATOR_SIGNAL], 0);
}

static void
__slingshot_slingshot_view___lambda99__slingshot_widgets_favorites_sidebar_app_launched (SlingshotWidgetsFavoritesSidebar* _sender,
                                                                                         gpointer self)
{
	_slingshot_slingshot_view___lambda99_ ((SlingshotSlingshotView*) self);
}

static gboolean
_slingshot_slingshot_view_on_overlay_background_click_gtk_widget_button_press_event (GtkWidget* _sender,
                                                                                     GdkEventButton* event,
                                                                                     gpointer self)
{
	gboolean result;
	result = slingshot_slingshot_view_on_overlay_background_click ((SlingshotSlingshotView*) self, event);
	return result;
}

static void
_slingshot_slingshot_view___lambda100_ (SlingshotSlingshotView* self,
                                        GtkWidget* menu_widget,
                                        gint y_center)
{
	GtkBox* _tmp0_;
	GtkBox* _tmp1_;
	GtkBox* _tmp2_;
	GtkBox* _tmp3_;
	GtkBox* _tmp4_;
	GtkOverlay* _tmp5_;
	GtkBox* _tmp6_;
	GtkOverlay* _tmp7_;
	g_return_if_fail (menu_widget != NULL);
	slingshot_slingshot_view_dismiss_ctx_menu (self);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (menu_widget, gtk_box_get_type ()) ? ((GtkBox*) menu_widget) : NULL);
	_g_object_unref0 (self->priv->ctx_menu_widget);
	self->priv->ctx_menu_widget = _tmp0_;
	_tmp1_ = self->priv->ctx_menu_widget;
	gtk_widget_set_halign ((GtkWidget*) _tmp1_, GTK_ALIGN_START);
	_tmp2_ = self->priv->ctx_menu_widget;
	gtk_widget_set_valign ((GtkWidget*) _tmp2_, GTK_ALIGN_START);
	_tmp3_ = self->priv->ctx_menu_widget;
	gtk_widget_set_margin_start ((GtkWidget*) _tmp3_, 70);
	_tmp4_ = self->priv->ctx_menu_widget;
	gtk_widget_set_margin_top ((GtkWidget*) _tmp4_, MAX (0, y_center - 20));
	_tmp5_ = self->priv->content_overlay;
	_tmp6_ = self->priv->ctx_menu_widget;
	gtk_overlay_add_overlay (_tmp5_, (GtkWidget*) _tmp6_);
	_tmp7_ = self->priv->content_overlay;
	gtk_widget_show_all ((GtkWidget*) _tmp7_);
}

static void
__slingshot_slingshot_view___lambda100__slingshot_widgets_favorites_sidebar_show_context_menu (SlingshotWidgetsFavoritesSidebar* _sender,
                                                                                               GtkWidget* menu_widget,
                                                                                               gint y_center,
                                                                                               gpointer self)
{
	_slingshot_slingshot_view___lambda100_ ((SlingshotSlingshotView*) self, menu_widget, y_center);
}

static void
_slingshot_slingshot_view___lambda101_ (SlingshotSlingshotView* self)
{
	slingshot_slingshot_view_dismiss_ctx_menu (self);
}

static void
__slingshot_slingshot_view___lambda101__slingshot_widgets_favorites_sidebar_hide_context_menu (SlingshotWidgetsFavoritesSidebar* _sender,
                                                                                               gpointer self)
{
	_slingshot_slingshot_view___lambda101_ ((SlingshotSlingshotView*) self);
}

static gboolean
_slingshot_slingshot_view_on_event_box_key_press_gtk_widget_key_press_event (GtkWidget* _sender,
                                                                             GdkEventKey* event,
                                                                             gpointer self)
{
	gboolean result;
	result = slingshot_slingshot_view_on_event_box_key_press ((SlingshotSlingshotView*) self, event);
	return result;
}

static gboolean
_slingshot_slingshot_view_on_search_view_key_press_gtk_widget_key_press_event (GtkWidget* _sender,
                                                                               GdkEventKey* event,
                                                                               gpointer self)
{
	gboolean result;
	result = slingshot_slingshot_view_on_search_view_key_press ((SlingshotSlingshotView*) self, event);
	return result;
}

static gboolean
_slingshot_slingshot_view___lambda102_ (SlingshotSlingshotView* self)
{
	GtkSearchEntry* _tmp0_;
	gboolean result;
	_tmp0_ = self->search_entry;
	gtk_widget_grab_focus ((GtkWidget*) _tmp0_);
	result = GDK_EVENT_PROPAGATE;
	return result;
}

static gboolean
__slingshot_slingshot_view___lambda102__gtk_widget_focus_in_event (GtkWidget* _sender,
                                                                   GdkEventFocus* event,
                                                                   gpointer self)
{
	gboolean result;
	result = _slingshot_slingshot_view___lambda102_ ((SlingshotSlingshotView*) self);
	return result;
}

static void
_slingshot_slingshot_view___lambda103_ (SlingshotSlingshotView* self)
{
	GtkSearchEntry* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	if (self->priv->modality != SLINGSHOT_SLINGSHOT_VIEW_MODALITY_SEARCH_VIEW) {
		slingshot_slingshot_view_set_modality (self, SLINGSHOT_SLINGSHOT_VIEW_MODALITY_SEARCH_VIEW);
	}
	_tmp0_ = self->search_entry;
	_tmp1_ = gtk_entry_get_text ((GtkEntry*) _tmp0_);
	_tmp2_ = _tmp1_;
	slingshot_slingshot_view_search (self, _tmp2_, NULL, NULL, NULL, NULL);
}

static void
__slingshot_slingshot_view___lambda103__gtk_search_entry_search_changed (GtkSearchEntry* _sender,
                                                                         gpointer self)
{
	_slingshot_slingshot_view___lambda103_ ((SlingshotSlingshotView*) self);
}

static void
_slingshot_slingshot_view_search_entry_activated_gtk_entry_activate (GtkEntry* _sender,
                                                                     gpointer self)
{
	slingshot_slingshot_view_search_entry_activated ((SlingshotSlingshotView*) self);
}

static void
_slingshot_slingshot_view___lambda104_ (SlingshotSlingshotView* self)
{
	GtkSearchEntry* _tmp0_;
	_tmp0_ = self->search_entry;
	gtk_widget_grab_focus ((GtkWidget*) _tmp0_);
}

static void
__slingshot_slingshot_view___lambda104__slingshot_widgets_category_view_search_focus_request (SlingshotWidgetsCategoryView* _sender,
                                                                                              gpointer self)
{
	_slingshot_slingshot_view___lambda104_ ((SlingshotSlingshotView*) self);
}

static void
_slingshot_slingshot_view___lambda105_ (SlingshotSlingshotView* self)
{
	g_signal_emit (self, slingshot_slingshot_view_signals[SLINGSHOT_SLINGSHOT_VIEW_CLOSE_INDICATOR_SIGNAL], 0);
}

static void
__slingshot_slingshot_view___lambda105__slingshot_widgets_grid_app_launched (SlingshotWidgetsGrid* _sender,
                                                                             gpointer self)
{
	_slingshot_slingshot_view___lambda105_ ((SlingshotSlingshotView*) self);
}

static void
_slingshot_slingshot_view___lambda106_ (SlingshotSlingshotView* self)
{
	g_signal_emit (self, slingshot_slingshot_view_signals[SLINGSHOT_SLINGSHOT_VIEW_CLOSE_INDICATOR_SIGNAL], 0);
}

static void
__slingshot_slingshot_view___lambda106__slingshot_widgets_search_view_app_launched (SlingshotWidgetsSearchView* _sender,
                                                                                    gpointer self)
{
	_slingshot_slingshot_view___lambda106_ ((SlingshotSlingshotView*) self);
}

static void
_slingshot_slingshot_view___lambda107_ (SlingshotSlingshotView* self)
{
	GraniteWidgetsModeButton* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	_tmp0_ = self->view_selector;
	_tmp1_ = granite_widgets_mode_button_get_selected (_tmp0_);
	_tmp2_ = _tmp1_;
	slingshot_slingshot_view_set_modality (self, (SlingshotSlingshotViewModality) _tmp2_);
}

static void
__slingshot_slingshot_view___lambda107__granite_widgets_mode_button_mode_changed (GraniteWidgetsModeButton* _sender,
                                                                                  GtkWidget* widget,
                                                                                  gpointer self)
{
	_slingshot_slingshot_view___lambda107_ ((SlingshotSlingshotView*) self);
}

static void
_slingshot_slingshot_view___lambda108_ (SlingshotSlingshotView* self)
{
	SlingshotWidgetsGrid* _tmp0_;
	SlingshotBackendAppSystem* _tmp1_;
	SlingshotWidgetsCategoryView* _tmp2_;
	_tmp0_ = self->priv->grid_view;
	_tmp1_ = self->app_system;
	slingshot_widgets_grid_populate (_tmp0_, _tmp1_);
	_tmp2_ = self->priv->category_view;
	slingshot_widgets_category_view_setup_sidebar (_tmp2_);
}

static void
__slingshot_slingshot_view___lambda108__slingshot_backend_app_system_changed (SlingshotBackendAppSystem* _sender,
                                                                              gpointer self)
{
	_slingshot_slingshot_view___lambda108_ ((SlingshotSlingshotView*) self);
}

static void
_slingshot_slingshot_view___lambda109_ (SlingshotSlingshotView* self)
{
	SlingshotWidgetsGrid* _tmp0_;
	SlingshotBackendAppSystem* _tmp1_;
	_tmp0_ = self->priv->grid_view;
	_tmp1_ = self->app_system;
	slingshot_widgets_grid_populate (_tmp0_, _tmp1_);
}

static void
__slingshot_slingshot_view___lambda109__g_settings_changed (GSettings* _sender,
                                                            const gchar* key,
                                                            gpointer self)
{
	_slingshot_slingshot_view___lambda109_ ((SlingshotSlingshotView*) self);
}

static void
_slingshot_slingshot_view___lambda110_ (SlingshotSlingshotView* self)
{
	SlingshotWidgetsGrid* _tmp0_;
	SlingshotBackendAppSystem* _tmp1_;
	_tmp0_ = self->priv->grid_view;
	_tmp1_ = self->app_system;
	slingshot_widgets_grid_populate (_tmp0_, _tmp1_);
}

static void
__slingshot_slingshot_view___lambda110__g_settings_changed (GSettings* _sender,
                                                            const gchar* key,
                                                            gpointer self)
{
	_slingshot_slingshot_view___lambda110_ ((SlingshotSlingshotView*) self);
}

static void
_slingshot_slingshot_view___lambda111_ (SlingshotSlingshotView* self)
{
	SlingshotWidgetsGrid* _tmp0_;
	SlingshotBackendAppSystem* _tmp1_;
	SlingshotWidgetsCategoryView* _tmp2_;
	_tmp0_ = self->priv->grid_view;
	_tmp1_ = self->app_system;
	slingshot_widgets_grid_populate (_tmp0_, _tmp1_);
	_tmp2_ = self->priv->category_view;
	slingshot_widgets_category_view_setup_sidebar (_tmp2_);
}

static void
__slingshot_slingshot_view___lambda111__g_settings_changed (GSettings* _sender,
                                                            const gchar* key,
                                                            gpointer self)
{
	_slingshot_slingshot_view___lambda111_ ((SlingshotSlingshotView*) self);
}

static void
_slingshot_slingshot_view___lambda112_ (SlingshotSlingshotView* self)
{
	g_signal_emit (self, slingshot_slingshot_view_signals[SLINGSHOT_SLINGSHOT_VIEW_CLOSE_INDICATOR_SIGNAL], 0);
}

static void
__slingshot_slingshot_view___lambda112__app_menu_power_strip_invoke_action (AppMenuPowerStrip* _sender,
                                                                            gpointer self)
{
	_slingshot_slingshot_view___lambda112_ ((SlingshotSlingshotView*) self);
}

static void
_slingshot_slingshot_view___lambda113_ (SlingshotSlingshotView* self)
{
	slingshot_slingshot_view_update_favorites_visibility (self);
}

static void
__slingshot_slingshot_view___lambda113__g_settings_changed (GSettings* _sender,
                                                            const gchar* key,
                                                            gpointer self)
{
	_slingshot_slingshot_view___lambda113_ ((SlingshotSlingshotView*) self);
}

static GObject *
slingshot_slingshot_view_constructor (GType type,
                                      guint n_construct_properties,
                                      GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SlingshotSlingshotView * self;
	SlingshotBackendAppSystem* _tmp0_;
	SlingshotBackendSynapseSearch* _tmp1_;
	GdkScreen* _tmp2_;
	GdkScreen* _tmp3_;
	GtkImage* grid_image = NULL;
	GtkImage* _tmp4_;
	GtkImage* _tmp5_;
	gchar* _tmp6_;
	gchar** _tmp7_;
	gchar** _tmp8_;
	gint _tmp8__length1;
	gchar* _tmp9_;
	gchar* _tmp10_;
	GtkImage* category_image = NULL;
	GtkImage* _tmp11_;
	GtkImage* _tmp12_;
	gchar* _tmp13_;
	gchar** _tmp14_;
	gchar** _tmp15_;
	gint _tmp15__length1;
	gchar* _tmp16_;
	gchar* _tmp17_;
	GraniteWidgetsModeButton* _tmp18_;
	GraniteWidgetsModeButton* _tmp19_;
	GraniteWidgetsModeButton* _tmp20_;
	GtkImage* _tmp21_;
	GraniteWidgetsModeButton* _tmp22_;
	GtkImage* _tmp23_;
	GtkRevealer* _tmp24_;
	GtkRevealer* _tmp25_;
	GtkRevealer* _tmp26_;
	GraniteWidgetsModeButton* _tmp27_;
	GtkSearchEntry* _tmp28_;
	GtkSearchEntry* _tmp29_;
	GtkSearchEntry* _tmp30_;
	GtkSearchEntry* _tmp31_;
	gchar* _tmp32_;
	gchar** _tmp33_;
	gchar** _tmp34_;
	gint _tmp34__length1;
	gchar* _tmp35_;
	gchar* _tmp36_;
	AppMenuPowerStrip* _tmp37_;
	GtkGrid* _tmp38_;
	GtkGrid* _tmp39_;
	GtkGrid* _tmp40_;
	GtkGrid* _tmp41_;
	GtkRevealer* _tmp42_;
	GtkGrid* _tmp43_;
	GtkSearchEntry* _tmp44_;
	GtkGrid* _tmp45_;
	AppMenuPowerStrip* _tmp46_;
	SlingshotWidgetsGrid* _tmp47_;
	SlingshotWidgetsCategoryView* _tmp48_;
	SlingshotWidgetsSearchView* _tmp49_;
	GtkStack* _tmp50_ = NULL;
	GtkStack* _tmp51_;
	SlingshotWidgetsGrid* _tmp52_;
	GtkStack* _tmp53_;
	SlingshotWidgetsCategoryView* _tmp54_;
	GtkStack* _tmp55_;
	SlingshotWidgetsSearchView* _tmp56_;
	SlingshotWidgetsFavoritesSidebar* _tmp57_;
	SlingshotWidgetsFavoritesSidebar* _tmp58_;
	SlingshotBackendAppSystem* _tmp59_;
	SlingshotWidgetsFavoritesSidebar* _tmp60_;
	SlingshotWidgetsFavoritesSidebar* _tmp61_;
	GtkSeparator* _tmp62_;
	GtkSeparator* _tmp63_;
	GtkGrid* _tmp64_;
	GtkGrid* _tmp65_;
	SlingshotWidgetsFavoritesSidebar* _tmp66_;
	GtkGrid* _tmp67_;
	GtkSeparator* _tmp68_;
	GtkGrid* _tmp69_;
	GtkStack* _tmp70_;
	GtkOverlay* _tmp71_;
	GtkOverlay* _tmp72_;
	GtkGrid* _tmp73_;
	GtkOverlay* _tmp74_;
	GtkOverlay* _tmp75_;
	GtkGrid* _tmp76_;
	GtkGrid* _tmp77_;
	GtkGrid* _tmp78_;
	GtkGrid* _tmp79_;
	GtkGrid* _tmp80_;
	GtkGrid* _tmp81_;
	GtkOverlay* _tmp82_;
	SlingshotWidgetsGrid* _tmp83_;
	SlingshotBackendAppSystem* _tmp84_;
	GtkEventBox* event_box = NULL;
	GtkEventBox* _tmp85_;
	GtkEventBox* _tmp86_;
	GtkGrid* _tmp87_;
	GtkEventBox* _tmp88_;
	SlingshotWidgetsFavoritesSidebar* _tmp89_;
	SlingshotWidgetsFavoritesSidebar* _tmp90_;
	GtkEventBox* _tmp91_;
	GtkSearchEntry* _tmp92_;
	GSettings* _tmp93_;
	GSettings* _tmp94_;
	GtkSearchEntry* _tmp97_;
	GtkSearchEntry* _tmp98_;
	GtkSearchEntry* _tmp99_;
	SlingshotWidgetsCategoryView* _tmp100_;
	SlingshotWidgetsGrid* _tmp101_;
	SlingshotWidgetsSearchView* _tmp102_;
	GraniteWidgetsModeButton* _tmp103_;
	SlingshotBackendAppSystem* _tmp104_;
	GSettings* _tmp105_;
	GSettings* _tmp106_;
	GSettings* _tmp107_;
	GSettings* _tmp108_;
	GSettings* _tmp109_;
	GSettings* _tmp110_;
	AppMenuPowerStrip* _tmp111_;
	AppMenuPowerStrip* _tmp112_;
	GSettings* _tmp113_;
	GSettings* _tmp114_;
	GSettings* _tmp115_;
	GSettings* _tmp116_;
	GtkGrid* _tmp117_;
	parent_class = G_OBJECT_CLASS (slingshot_slingshot_view_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SLINGSHOT_TYPE_SLINGSHOT_VIEW, SlingshotSlingshotView);
	_tmp0_ = slingshot_backend_app_system_new ();
	_g_object_unref0 (self->app_system);
	self->app_system = _tmp0_;
	_tmp1_ = slingshot_backend_synapse_search_new ();
	_g_object_unref0 (self->priv->synapse);
	self->priv->synapse = _tmp1_;
	_tmp2_ = gtk_widget_get_screen ((GtkWidget*) self);
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_g_object_unref0 (self->priv->screen);
	self->priv->screen = _tmp3_;
	_tmp4_ = (GtkImage*) gtk_image_new_from_icon_name ("view-grid-symbolic", (GtkIconSize) GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp4_);
	grid_image = _tmp4_;
	_tmp5_ = grid_image;
	_tmp6_ = g_strdup ("<Ctrl>1");
	_tmp7_ = g_new0 (gchar*, 1 + 1);
	_tmp7_[0] = _tmp6_;
	_tmp8_ = _tmp7_;
	_tmp8__length1 = 1;
	_tmp9_ = granite_markup_accel_tooltip (_tmp8_, (gint) 1, _ ("View as Grid"));
	_tmp10_ = _tmp9_;
	gtk_widget_set_tooltip_markup ((GtkWidget*) _tmp5_, _tmp10_);
	_g_free0 (_tmp10_);
	_tmp8_ = (_vala_array_free (_tmp8_, _tmp8__length1, (GDestroyNotify) g_free), NULL);
	_tmp11_ = (GtkImage*) gtk_image_new_from_icon_name ("view-filter-symbolic", (GtkIconSize) GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp11_);
	category_image = _tmp11_;
	_tmp12_ = category_image;
	_tmp13_ = g_strdup ("<Ctrl>2");
	_tmp14_ = g_new0 (gchar*, 1 + 1);
	_tmp14_[0] = _tmp13_;
	_tmp15_ = _tmp14_;
	_tmp15__length1 = 1;
	_tmp16_ = granite_markup_accel_tooltip (_tmp15_, (gint) 1, _ ("View by Category"));
	_tmp17_ = _tmp16_;
	gtk_widget_set_tooltip_markup ((GtkWidget*) _tmp12_, _tmp17_);
	_g_free0 (_tmp17_);
	_tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) g_free), NULL);
	_tmp18_ = granite_widgets_mode_button_new ();
	g_object_ref_sink (_tmp18_);
	_g_object_unref0 (self->view_selector);
	self->view_selector = _tmp18_;
	_tmp19_ = self->view_selector;
	gtk_widget_set_margin_end ((GtkWidget*) _tmp19_, 12);
	_tmp20_ = self->view_selector;
	_tmp21_ = grid_image;
	granite_widgets_mode_button_append (_tmp20_, (GtkWidget*) _tmp21_);
	_tmp22_ = self->view_selector;
	_tmp23_ = category_image;
	granite_widgets_mode_button_append (_tmp22_, (GtkWidget*) _tmp23_);
	_tmp24_ = (GtkRevealer*) gtk_revealer_new ();
	g_object_ref_sink (_tmp24_);
	_g_object_unref0 (self->priv->view_selector_revealer);
	self->priv->view_selector_revealer = _tmp24_;
	_tmp25_ = self->priv->view_selector_revealer;
	gtk_revealer_set_transition_type (_tmp25_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT);
	_tmp26_ = self->priv->view_selector_revealer;
	_tmp27_ = self->view_selector;
	gtk_container_add ((GtkContainer*) _tmp26_, (GtkWidget*) _tmp27_);
	_tmp28_ = (GtkSearchEntry*) gtk_search_entry_new ();
	g_object_ref_sink (_tmp28_);
	_g_object_unref0 (self->search_entry);
	self->search_entry = _tmp28_;
	_tmp29_ = self->search_entry;
	gtk_entry_set_placeholder_text ((GtkEntry*) _tmp29_, _ ("Search Apps"));
	_tmp30_ = self->search_entry;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp30_, TRUE);
	_tmp31_ = self->search_entry;
	_tmp32_ = g_strdup ("<Ctrl>BackSpace");
	_tmp33_ = g_new0 (gchar*, 1 + 1);
	_tmp33_[0] = _tmp32_;
	_tmp34_ = _tmp33_;
	_tmp34__length1 = 1;
	_tmp35_ = granite_markup_accel_tooltip (_tmp34_, (gint) 1, _ ("Clear all"));
	_tmp36_ = _tmp35_;
	g_object_set ((GtkEntry*) _tmp31_, "secondary-icon-tooltip-markup", _tmp36_, NULL);
	_g_free0 (_tmp36_);
	_tmp34_ = (_vala_array_free (_tmp34_, _tmp34__length1, (GDestroyNotify) g_free), NULL);
	_tmp37_ = app_menu_power_strip_new (GTK_ORIENTATION_HORIZONTAL);
	g_object_ref_sink (_tmp37_);
	_g_object_unref0 (self->priv->powerstrip);
	self->priv->powerstrip = _tmp37_;
	_tmp38_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp38_);
	_g_object_unref0 (self->priv->top);
	self->priv->top = _tmp38_;
	_tmp39_ = self->priv->top;
	gtk_widget_set_margin_start ((GtkWidget*) _tmp39_, 12);
	_tmp40_ = self->priv->top;
	gtk_widget_set_margin_end ((GtkWidget*) _tmp40_, 12);
	_tmp41_ = self->priv->top;
	_tmp42_ = self->priv->view_selector_revealer;
	gtk_container_add ((GtkContainer*) _tmp41_, (GtkWidget*) _tmp42_);
	_tmp43_ = self->priv->top;
	_tmp44_ = self->search_entry;
	gtk_container_add ((GtkContainer*) _tmp43_, (GtkWidget*) _tmp44_);
	_tmp45_ = self->priv->top;
	_tmp46_ = self->priv->powerstrip;
	gtk_container_add ((GtkContainer*) _tmp45_, (GtkWidget*) _tmp46_);
	_tmp47_ = slingshot_widgets_grid_new ();
	g_object_ref_sink (_tmp47_);
	_g_object_unref0 (self->priv->grid_view);
	self->priv->grid_view = _tmp47_;
	_tmp48_ = slingshot_widgets_category_view_new (self);
	g_object_ref_sink (_tmp48_);
	_g_object_unref0 (self->priv->category_view);
	self->priv->category_view = _tmp48_;
	_tmp49_ = slingshot_widgets_search_view_new ();
	g_object_ref_sink (_tmp49_);
	_g_object_unref0 (self->priv->search_view);
	self->priv->search_view = _tmp49_;
	_tmp50_ = (GtkStack*) gtk_stack_new ();
	gtk_stack_set_transition_type (_tmp50_, GTK_STACK_TRANSITION_TYPE_CROSSFADE);
	g_object_ref_sink (_tmp50_);
	_g_object_unref0 (self->stack);
	self->stack = _tmp50_;
	_tmp51_ = self->stack;
	_tmp52_ = self->priv->grid_view;
	gtk_stack_add_named (_tmp51_, (GtkWidget*) _tmp52_, "normal");
	_tmp53_ = self->stack;
	_tmp54_ = self->priv->category_view;
	gtk_stack_add_named (_tmp53_, (GtkWidget*) _tmp54_, "category");
	_tmp55_ = self->stack;
	_tmp56_ = self->priv->search_view;
	gtk_stack_add_named (_tmp55_, (GtkWidget*) _tmp56_, "search");
	_tmp57_ = slingshot_widgets_favorites_sidebar_new ();
	g_object_ref_sink (_tmp57_);
	_g_object_unref0 (self->priv->favorites_sidebar);
	self->priv->favorites_sidebar = _tmp57_;
	_tmp58_ = self->priv->favorites_sidebar;
	_tmp59_ = self->app_system;
	slingshot_widgets_favorites_sidebar_set_app_system (_tmp58_, _tmp59_);
	_tmp60_ = self->priv->favorites_sidebar;
	g_signal_connect_object (_tmp60_, "app-launched", (GCallback) __slingshot_slingshot_view___lambda99__slingshot_widgets_favorites_sidebar_app_launched, self, 0);
	_tmp61_ = self->priv->favorites_sidebar;
	gtk_widget_set_no_show_all ((GtkWidget*) _tmp61_, TRUE);
	_tmp62_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_VERTICAL);
	g_object_ref_sink (_tmp62_);
	_g_object_unref0 (self->priv->favorites_separator);
	self->priv->favorites_separator = _tmp62_;
	_tmp63_ = self->priv->favorites_separator;
	gtk_widget_set_no_show_all ((GtkWidget*) _tmp63_, TRUE);
	_tmp64_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp64_);
	_g_object_unref0 (self->priv->content_grid);
	self->priv->content_grid = _tmp64_;
	_tmp65_ = self->priv->content_grid;
	_tmp66_ = self->priv->favorites_sidebar;
	gtk_grid_attach (_tmp65_, (GtkWidget*) _tmp66_, 0, 0, 1, 1);
	_tmp67_ = self->priv->content_grid;
	_tmp68_ = self->priv->favorites_separator;
	gtk_grid_attach (_tmp67_, (GtkWidget*) _tmp68_, 1, 0, 1, 1);
	_tmp69_ = self->priv->content_grid;
	_tmp70_ = self->stack;
	gtk_grid_attach (_tmp69_, (GtkWidget*) _tmp70_, 2, 0, 1, 1);
	_tmp71_ = (GtkOverlay*) gtk_overlay_new ();
	g_object_ref_sink (_tmp71_);
	_g_object_unref0 (self->priv->content_overlay);
	self->priv->content_overlay = _tmp71_;
	_tmp72_ = self->priv->content_overlay;
	_tmp73_ = self->priv->content_grid;
	gtk_container_add ((GtkContainer*) _tmp72_, (GtkWidget*) _tmp73_);
	_tmp74_ = self->priv->content_overlay;
	gtk_widget_add_events ((GtkWidget*) _tmp74_, (gint) GDK_BUTTON_PRESS_MASK);
	_tmp75_ = self->priv->content_overlay;
	g_signal_connect_object ((GtkWidget*) _tmp75_, "button-press-event", (GCallback) _slingshot_slingshot_view_on_overlay_background_click_gtk_widget_button_press_event, self, 0);
	_tmp76_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp76_);
	_g_object_unref0 (self->priv->container);
	self->priv->container = _tmp76_;
	_tmp77_ = self->priv->container;
	gtk_grid_set_row_spacing (_tmp77_, 12);
	_tmp78_ = self->priv->container;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp78_, 12);
	_tmp79_ = self->priv->container;
	_tmp80_ = self->priv->top;
	gtk_grid_attach (_tmp79_, (GtkWidget*) _tmp80_, 0, 1, 1, 1);
	_tmp81_ = self->priv->container;
	_tmp82_ = self->priv->content_overlay;
	gtk_grid_attach (_tmp81_, (GtkWidget*) _tmp82_, 0, 0, 1, 1);
	_tmp83_ = self->priv->grid_view;
	_tmp84_ = self->app_system;
	slingshot_widgets_grid_populate (_tmp83_, _tmp84_);
	_tmp85_ = (GtkEventBox*) gtk_event_box_new ();
	g_object_ref_sink (_tmp85_);
	event_box = _tmp85_;
	_tmp86_ = event_box;
	_tmp87_ = self->priv->container;
	gtk_container_add ((GtkContainer*) _tmp86_, (GtkWidget*) _tmp87_);
	_tmp88_ = event_box;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp88_);
	_tmp89_ = self->priv->favorites_sidebar;
	g_signal_connect_object (_tmp89_, "show-context-menu", (GCallback) __slingshot_slingshot_view___lambda100__slingshot_widgets_favorites_sidebar_show_context_menu, self, 0);
	_tmp90_ = self->priv->favorites_sidebar;
	g_signal_connect_object (_tmp90_, "hide-context-menu", (GCallback) __slingshot_slingshot_view___lambda101__slingshot_widgets_favorites_sidebar_hide_context_menu, self, 0);
	_tmp91_ = event_box;
	g_signal_connect_object ((GtkWidget*) _tmp91_, "key-press-event", (GCallback) _slingshot_slingshot_view_on_event_box_key_press_gtk_widget_key_press_event, self, 0);
	_tmp92_ = self->search_entry;
	g_signal_connect_object ((GtkWidget*) _tmp92_, "key-press-event", (GCallback) _slingshot_slingshot_view_on_search_view_key_press_gtk_widget_key_press_event, self, 0);
	_tmp93_ = slingshot_slingshot_view_get_settings ();
	_tmp94_ = _tmp93_;
	if (g_settings_get_boolean (_tmp94_, "use-category")) {
		GraniteWidgetsModeButton* _tmp95_;
		_tmp95_ = self->view_selector;
		granite_widgets_mode_button_set_selected (_tmp95_, 1);
		slingshot_slingshot_view_set_modality (self, SLINGSHOT_SLINGSHOT_VIEW_MODALITY_CATEGORY_VIEW);
	} else {
		GraniteWidgetsModeButton* _tmp96_;
		_tmp96_ = self->view_selector;
		granite_widgets_mode_button_set_selected (_tmp96_, 0);
		slingshot_slingshot_view_set_modality (self, SLINGSHOT_SLINGSHOT_VIEW_MODALITY_NORMAL_VIEW);
	}
	g_signal_connect_object ((GtkWidget*) self, "focus-in-event", (GCallback) __slingshot_slingshot_view___lambda102__gtk_widget_focus_in_event, self, 0);
	_tmp97_ = self->search_entry;
	g_signal_connect_object (_tmp97_, "search-changed", (GCallback) __slingshot_slingshot_view___lambda103__gtk_search_entry_search_changed, self, 0);
	_tmp98_ = self->search_entry;
	gtk_widget_grab_focus ((GtkWidget*) _tmp98_);
	_tmp99_ = self->search_entry;
	g_signal_connect_object ((GtkEntry*) _tmp99_, "activate", (GCallback) _slingshot_slingshot_view_search_entry_activated_gtk_entry_activate, self, 0);
	_tmp100_ = self->priv->category_view;
	g_signal_connect_object (_tmp100_, "search-focus-request", (GCallback) __slingshot_slingshot_view___lambda104__slingshot_widgets_category_view_search_focus_request, self, 0);
	_tmp101_ = self->priv->grid_view;
	g_signal_connect_object (_tmp101_, "app-launched", (GCallback) __slingshot_slingshot_view___lambda105__slingshot_widgets_grid_app_launched, self, 0);
	_tmp102_ = self->priv->search_view;
	g_signal_connect_object (_tmp102_, "app-launched", (GCallback) __slingshot_slingshot_view___lambda106__slingshot_widgets_search_view_app_launched, self, 0);
	_tmp103_ = self->view_selector;
	g_signal_connect_object (_tmp103_, "mode-changed", (GCallback) __slingshot_slingshot_view___lambda107__granite_widgets_mode_button_mode_changed, self, 0);
	_tmp104_ = self->app_system;
	g_signal_connect_object (_tmp104_, "changed", (GCallback) __slingshot_slingshot_view___lambda108__slingshot_backend_app_system_changed, self, 0);
	_tmp105_ = slingshot_slingshot_view_get_settings ();
	_tmp106_ = _tmp105_;
	g_signal_connect_object (_tmp106_, "changed::rows", (GCallback) __slingshot_slingshot_view___lambda109__g_settings_changed, self, G_CONNECT_AFTER);
	_tmp107_ = slingshot_slingshot_view_get_settings ();
	_tmp108_ = _tmp107_;
	g_signal_connect_object (_tmp108_, "changed::columns", (GCallback) __slingshot_slingshot_view___lambda110__g_settings_changed, self, G_CONNECT_AFTER);
	_tmp109_ = slingshot_slingshot_view_get_settings ();
	_tmp110_ = _tmp109_;
	g_signal_connect_object (_tmp110_, "changed::show-terminal-apps", (GCallback) __slingshot_slingshot_view___lambda111__g_settings_changed, self, G_CONNECT_AFTER);
	_tmp111_ = self->priv->powerstrip;
	g_signal_connect_object (_tmp111_, "invoke-action", (GCallback) __slingshot_slingshot_view___lambda112__app_menu_power_strip_invoke_action, self, 0);
	_tmp112_ = self->priv->powerstrip;
	_tmp113_ = slingshot_slingshot_view_get_settings ();
	_tmp114_ = _tmp113_;
	gtk_widget_set_visible ((GtkWidget*) _tmp112_, g_settings_get_boolean (_tmp114_, "enable-powerstrip"));
	slingshot_slingshot_view_update_favorites_visibility (self);
	_tmp115_ = slingshot_slingshot_view_get_settings ();
	_tmp116_ = _tmp115_;
	g_signal_connect_object (_tmp116_, "changed::enable-favorites", (GCallback) __slingshot_slingshot_view___lambda113__g_settings_changed, self, 0);
	_tmp117_ = self->priv->content_grid;
	gtk_widget_show_all ((GtkWidget*) _tmp117_);
	_g_object_unref0 (event_box);
	_g_object_unref0 (category_image);
	_g_object_unref0 (grid_image);
	return obj;
}

static void
slingshot_slingshot_view_class_init (SlingshotSlingshotViewClass * klass,
                                     gpointer klass_data)
{
	GSettings* _tmp0_;
	GSettings* _tmp1_;
	slingshot_slingshot_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SlingshotSlingshotView_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_slingshot_slingshot_view_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_slingshot_slingshot_view_set_property;
	G_OBJECT_CLASS (klass)->constructor = slingshot_slingshot_view_constructor;
	G_OBJECT_CLASS (klass)->finalize = slingshot_slingshot_view_finalize;
	slingshot_slingshot_view_signals[SLINGSHOT_SLINGSHOT_VIEW_CLOSE_INDICATOR_SIGNAL] = g_signal_new ("close-indicator", SLINGSHOT_TYPE_SLINGSHOT_VIEW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	_tmp0_ = g_settings_new ("org.ubuntubudgie.plugins.budgie-appmenu");
	_tmp1_ = _tmp0_;
	slingshot_slingshot_view_set_settings (_tmp1_);
	_g_object_unref0 (_tmp1_);
}

static void
slingshot_slingshot_view_instance_init (SlingshotSlingshotView * self,
                                        gpointer klass)
{
	self->priv = slingshot_slingshot_view_get_instance_private (self);
	self->priv->favorites_sidebar = NULL;
	self->priv->favorites_separator = NULL;
	self->priv->ctx_menu_widget = NULL;
}

static void
slingshot_slingshot_view_finalize (GObject * obj)
{
	SlingshotSlingshotView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SLINGSHOT_TYPE_SLINGSHOT_VIEW, SlingshotSlingshotView);
	_g_object_unref0 (self->app_system);
	_g_object_unref0 (self->search_entry);
	_g_object_unref0 (self->priv->powerstrip);
	_g_object_unref0 (self->stack);
	_g_object_unref0 (self->view_selector);
	_g_object_unref0 (self->priv->synapse);
	_g_object_unref0 (self->priv->screen);
	_g_object_unref0 (self->priv->view_selector_revealer);
	_g_object_unref0 (self->priv->grid_view);
	_g_object_unref0 (self->priv->container);
	_g_object_unref0 (self->priv->top);
	_g_object_unref0 (self->priv->search_view);
	_g_object_unref0 (self->priv->category_view);
	_g_object_unref0 (self->priv->favorites_sidebar);
	_g_object_unref0 (self->priv->favorites_separator);
	_g_object_unref0 (self->priv->content_overlay);
	_g_object_unref0 (self->priv->content_grid);
	_g_object_unref0 (self->priv->ctx_menu_widget);
	G_OBJECT_CLASS (slingshot_slingshot_view_parent_class)->finalize (obj);
}

GType
slingshot_slingshot_view_get_type (void)
{
	return slingshot_slingshot_view_type_id;
}

GType
slingshot_slingshot_view_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (SlingshotSlingshotViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) slingshot_slingshot_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SlingshotSlingshotView), 0, (GInstanceInitFunc) slingshot_slingshot_view_instance_init, NULL };
	slingshot_slingshot_view_type_id = g_type_module_register_type (module, gtk_grid_get_type (), "SlingshotSlingshotView", &g_define_type_info, 0);
	SlingshotSlingshotView_private_offset = sizeof (SlingshotSlingshotViewPrivate);
	return slingshot_slingshot_view_type_id;
}

static void
_vala_slingshot_slingshot_view_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec)
{
	SlingshotSlingshotView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SLINGSHOT_TYPE_SLINGSHOT_VIEW, SlingshotSlingshotView);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_slingshot_slingshot_view_set_property (GObject * object,
                                             guint property_id,
                                             const GValue * value,
                                             GParamSpec * pspec)
{
	SlingshotSlingshotView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SLINGSHOT_TYPE_SLINGSHOT_VIEW, SlingshotSlingshotView);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

