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

/*
 * Copyright 2019-2020 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 <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <gdk/gdk.h>
#include <float.h>
#include <math.h>
#include <gee.h>
#include <glib/gi18n-lib.h>
#include <gio/gdesktopappinfo.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 SLINGSHOT_WIDGETS_CATEGORY_VIEW_TYPE_NAV_LIST_BOX (slingshot_widgets_category_view_nav_list_box_get_type ())
#define SLINGSHOT_WIDGETS_CATEGORY_VIEW_NAV_LIST_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SLINGSHOT_WIDGETS_CATEGORY_VIEW_TYPE_NAV_LIST_BOX, SlingshotWidgetsCategoryViewNavListBox))
#define SLINGSHOT_WIDGETS_CATEGORY_VIEW_NAV_LIST_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SLINGSHOT_WIDGETS_CATEGORY_VIEW_TYPE_NAV_LIST_BOX, SlingshotWidgetsCategoryViewNavListBoxClass))
#define SLINGSHOT_WIDGETS_CATEGORY_VIEW_IS_NAV_LIST_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SLINGSHOT_WIDGETS_CATEGORY_VIEW_TYPE_NAV_LIST_BOX))
#define SLINGSHOT_WIDGETS_CATEGORY_VIEW_IS_NAV_LIST_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SLINGSHOT_WIDGETS_CATEGORY_VIEW_TYPE_NAV_LIST_BOX))
#define SLINGSHOT_WIDGETS_CATEGORY_VIEW_NAV_LIST_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SLINGSHOT_WIDGETS_CATEGORY_VIEW_TYPE_NAV_LIST_BOX, SlingshotWidgetsCategoryViewNavListBoxClass))

typedef struct _SlingshotWidgetsCategoryViewNavListBox SlingshotWidgetsCategoryViewNavListBox;
typedef struct _SlingshotWidgetsCategoryViewNavListBoxClass SlingshotWidgetsCategoryViewNavListBoxClass;
enum  {
	SLINGSHOT_WIDGETS_CATEGORY_VIEW_0_PROPERTY,
	SLINGSHOT_WIDGETS_CATEGORY_VIEW_VIEW_PROPERTY,
	SLINGSHOT_WIDGETS_CATEGORY_VIEW_NUM_PROPERTIES
};
static GParamSpec* slingshot_widgets_category_view_properties[SLINGSHOT_WIDGETS_CATEGORY_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_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))

#define SLINGSHOT_WIDGETS_CATEGORY_VIEW_TYPE_CATEGORY_ROW (slingshot_widgets_category_view_category_row_get_type ())
#define SLINGSHOT_WIDGETS_CATEGORY_VIEW_CATEGORY_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SLINGSHOT_WIDGETS_CATEGORY_VIEW_TYPE_CATEGORY_ROW, SlingshotWidgetsCategoryViewCategoryRow))
#define SLINGSHOT_WIDGETS_CATEGORY_VIEW_CATEGORY_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SLINGSHOT_WIDGETS_CATEGORY_VIEW_TYPE_CATEGORY_ROW, SlingshotWidgetsCategoryViewCategoryRowClass))
#define SLINGSHOT_WIDGETS_CATEGORY_VIEW_IS_CATEGORY_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SLINGSHOT_WIDGETS_CATEGORY_VIEW_TYPE_CATEGORY_ROW))
#define SLINGSHOT_WIDGETS_CATEGORY_VIEW_IS_CATEGORY_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SLINGSHOT_WIDGETS_CATEGORY_VIEW_TYPE_CATEGORY_ROW))
#define SLINGSHOT_WIDGETS_CATEGORY_VIEW_CATEGORY_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SLINGSHOT_WIDGETS_CATEGORY_VIEW_TYPE_CATEGORY_ROW, SlingshotWidgetsCategoryViewCategoryRowClass))

typedef struct _SlingshotWidgetsCategoryViewCategoryRow SlingshotWidgetsCategoryViewCategoryRow;
typedef struct _SlingshotWidgetsCategoryViewCategoryRowClass SlingshotWidgetsCategoryViewCategoryRowClass;
typedef struct _SlingshotWidgetsCategoryViewCategoryRowPrivate SlingshotWidgetsCategoryViewCategoryRowPrivate;
enum  {
	SLINGSHOT_WIDGETS_CATEGORY_VIEW_CATEGORY_ROW_0_PROPERTY,
	SLINGSHOT_WIDGETS_CATEGORY_VIEW_CATEGORY_ROW_CAT_NAME_PROPERTY,
	SLINGSHOT_WIDGETS_CATEGORY_VIEW_CATEGORY_ROW_CAT_MARGIN_PROPERTY,
	SLINGSHOT_WIDGETS_CATEGORY_VIEW_CATEGORY_ROW_TRANSLATED_NAME_PROPERTY,
	SLINGSHOT_WIDGETS_CATEGORY_VIEW_CATEGORY_ROW_NUM_PROPERTIES
};
static GParamSpec* slingshot_widgets_category_view_category_row_properties[SLINGSHOT_WIDGETS_CATEGORY_VIEW_CATEGORY_ROW_NUM_PROPERTIES];
typedef struct _SlingshotWidgetsCategoryViewNavListBoxPrivate SlingshotWidgetsCategoryViewNavListBoxPrivate;
enum  {
	SLINGSHOT_WIDGETS_CATEGORY_VIEW_NAV_LIST_BOX_0_PROPERTY,
	SLINGSHOT_WIDGETS_CATEGORY_VIEW_NAV_LIST_BOX_NUM_PROPERTIES
};
static GParamSpec* slingshot_widgets_category_view_nav_list_box_properties[SLINGSHOT_WIDGETS_CATEGORY_VIEW_NAV_LIST_BOX_NUM_PROPERTIES];
enum  {
	SLINGSHOT_WIDGETS_CATEGORY_VIEW_NAV_LIST_BOX_SEARCH_FOCUS_REQUEST_SIGNAL,
	SLINGSHOT_WIDGETS_CATEGORY_VIEW_NAV_LIST_BOX_NUM_SIGNALS
};
static guint slingshot_widgets_category_view_nav_list_box_signals[SLINGSHOT_WIDGETS_CATEGORY_VIEW_NAV_LIST_BOX_NUM_SIGNALS] = {0};
typedef struct _Block3Data Block3Data;
enum  {
	SLINGSHOT_WIDGETS_CATEGORY_VIEW_SEARCH_FOCUS_REQUEST_SIGNAL,
	SLINGSHOT_WIDGETS_CATEGORY_VIEW_NUM_SIGNALS
};
static guint slingshot_widgets_category_view_signals[SLINGSHOT_WIDGETS_CATEGORY_VIEW_NUM_SIGNALS] = {0};

struct _SlingshotWidgetsCategoryViewPrivate {
	SlingshotSlingshotView* _view;
	gboolean dragging;
	gchar* drag_uri;
	SlingshotWidgetsCategoryViewNavListBox* category_switcher;
	SlingshotWidgetsCategoryViewNavListBox* listbox;
	gboolean rollover_menus;
	SlingshotAppContextMenu* open_ctx_menu;
};

struct _SlingshotWidgetsCategoryViewCategoryRow {
	GtkListBoxRow parent_instance;
	SlingshotWidgetsCategoryViewCategoryRowPrivate * priv;
	GtkEventBox* eventbox;
};

struct _SlingshotWidgetsCategoryViewCategoryRowClass {
	GtkListBoxRowClass parent_class;
};

struct _SlingshotWidgetsCategoryViewCategoryRowPrivate {
	gchar* _cat_name;
	gint _cat_margin;
};

struct _SlingshotWidgetsCategoryViewNavListBox {
	GtkListBox parent_instance;
	SlingshotWidgetsCategoryViewNavListBoxPrivate * priv;
};

struct _SlingshotWidgetsCategoryViewNavListBoxClass {
	GtkListBoxClass parent_class;
};

struct _Block3Data {
	int _ref_count_;
	SlingshotWidgetsCategoryView* self;
	GtkListBoxRow* row;
};

static gint SlingshotWidgetsCategoryView_private_offset;
static gpointer slingshot_widgets_category_view_parent_class = NULL;
static GSettings* slingshot_widgets_category_view_settings;
static GSettings* slingshot_widgets_category_view_settings = NULL;
static gint SlingshotWidgetsCategoryViewCategoryRow_private_offset;
static gpointer slingshot_widgets_category_view_category_row_parent_class = NULL;
static GType slingshot_widgets_category_view_category_row_type_id = 0;
static gpointer slingshot_widgets_category_view_nav_list_box_parent_class = NULL;
static GType slingshot_widgets_category_view_nav_list_box_type_id = 0;
static GType slingshot_widgets_category_view_type_id = 0;

GType slingshot_widgets_category_view_nav_list_box_register_type (GTypeModule * module);
VALA_EXTERN GType slingshot_widgets_category_view_nav_list_box_get_type (void) G_GNUC_CONST ;
static gboolean slingshot_widgets_category_view_show_context_menu_for_event (SlingshotWidgetsCategoryView* self,
                                                                      GdkEvent* event);
static void __lambda64_ (SlingshotWidgetsCategoryView* self);
static void ___lambda64__slingshot_app_context_menu_app_launched (SlingshotAppContextMenu* _sender,
                                                           gpointer self);
static void slingshot_widgets_category_view_define_css_styles (SlingshotWidgetsCategoryView* self);
GType slingshot_widgets_category_view_category_row_register_type (GTypeModule * module);
VALA_EXTERN GType slingshot_widgets_category_view_category_row_get_type (void) G_GNUC_CONST ;
static gint slingshot_widgets_category_view_category_sort_func (SlingshotWidgetsCategoryViewCategoryRow* row1,
                                                         SlingshotWidgetsCategoryViewCategoryRow* row2);
static const gchar* slingshot_widgets_category_view_category_row_get_translated_name (SlingshotWidgetsCategoryViewCategoryRow* self);
static void slingshot_widgets_category_view_focus_select_first_row (SlingshotWidgetsCategoryView* self);
static gboolean slingshot_widgets_category_view_on_mouse_enter (SlingshotWidgetsCategoryView* self,
                                                         GtkWidget* source_widget,
                                                         GdkEventCrossing* e);
static void __lambda65_ (SlingshotWidgetsCategoryView* self,
                  GtkWidget* app_list_row);
static void ___lambda65__gtk_callback (GtkWidget* widget,
                                gpointer self);
static void _g_object_unref0_ (gpointer var);
static inline void _g_slist_free__g_object_unref0_ (GSList* self);
static SlingshotWidgetsCategoryViewCategoryRow* slingshot_widgets_category_view_category_row_new (const gchar* cat_name,
                                                                                           gint cat_margin);
static SlingshotWidgetsCategoryViewCategoryRow* slingshot_widgets_category_view_category_row_construct (GType object_type,
                                                                                                 const gchar* cat_name,
                                                                                                 gint cat_margin);
static gboolean _slingshot_widgets_category_view_on_mouse_enter_gtk_widget_enter_notify_event (GtkWidget* _sender,
                                                                                        GdkEventCrossing* event,
                                                                                        gpointer self);
static const gchar* slingshot_widgets_category_view_category_row_get_cat_name (SlingshotWidgetsCategoryViewCategoryRow* self);
static gboolean slingshot_widgets_category_view_filter_function (AppListRow* row,
                                                          SlingshotWidgetsCategoryView* self);
static gboolean slingshot_widgets_category_view_on_key_press (SlingshotWidgetsCategoryView* self,
                                                       GdkEventKey* event);
static void slingshot_widgets_category_view_category_row_set_cat_name (SlingshotWidgetsCategoryViewCategoryRow* self,
                                                                const gchar* value);
static gint slingshot_widgets_category_view_category_row_get_cat_margin (SlingshotWidgetsCategoryViewCategoryRow* self);
static void slingshot_widgets_category_view_category_row_set_cat_margin (SlingshotWidgetsCategoryViewCategoryRow* self,
                                                                  gint value);
static GObject * slingshot_widgets_category_view_category_row_constructor (GType type,
                                                                    guint n_construct_properties,
                                                                    GObjectConstructParam * construct_properties);
static void slingshot_widgets_category_view_category_row_finalize (GObject * obj);
static void _vala_slingshot_widgets_category_view_category_row_get_property (GObject * object,
                                                                      guint property_id,
                                                                      GValue * value,
                                                                      GParamSpec * pspec);
static void _vala_slingshot_widgets_category_view_category_row_set_property (GObject * object,
                                                                      guint property_id,
                                                                      const GValue * value,
                                                                      GParamSpec * pspec);
static void slingshot_widgets_category_view_nav_list_box_real_move_cursor (GtkListBox* base,
                                                                    GtkMovementStep step,
                                                                    gint count);
static SlingshotWidgetsCategoryViewNavListBox* slingshot_widgets_category_view_nav_list_box_new (void);
static SlingshotWidgetsCategoryViewNavListBox* slingshot_widgets_category_view_nav_list_box_construct (GType object_type);
static GObject * slingshot_widgets_category_view_constructor (GType type,
                                                       guint n_construct_properties,
                                                       GObjectConstructParam * construct_properties);
static void _slingshot_widgets_category_view___lambda66_ (SlingshotWidgetsCategoryView* self);
static void __slingshot_widgets_category_view___lambda66__gtk_list_box_row_selected (GtkListBox* _sender,
                                                                              GtkListBoxRow* row,
                                                                              gpointer self);
static void _slingshot_widgets_category_view___lambda67_ (SlingshotWidgetsCategoryView* self);
static void __slingshot_widgets_category_view___lambda67__slingshot_widgets_category_view_nav_list_box_search_focus_request (SlingshotWidgetsCategoryViewNavListBox* _sender,
                                                                                                                      gpointer self);
static void _slingshot_widgets_category_view___lambda68_ (SlingshotWidgetsCategoryView* self,
                                                   GtkListBoxRow* row);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static gboolean __lambda69_ (Block3Data* _data3_);
static gboolean ___lambda69__gsource_func (gpointer self);
static void __slingshot_widgets_category_view___lambda68__gtk_list_box_row_activated (GtkListBox* _sender,
                                                                               GtkListBoxRow* row,
                                                                               gpointer self);
static gboolean _slingshot_widgets_category_view___lambda70_ (SlingshotWidgetsCategoryView* self,
                                                       GdkEventButton* event);
static gboolean __slingshot_widgets_category_view___lambda70__gtk_widget_button_press_event (GtkWidget* _sender,
                                                                                      GdkEventButton* event,
                                                                                      gpointer self);
static gboolean _slingshot_widgets_category_view___lambda71_ (SlingshotWidgetsCategoryView* self,
                                                       GdkEventKey* event);
static gboolean __slingshot_widgets_category_view___lambda71__gtk_widget_key_press_event (GtkWidget* _sender,
                                                                                   GdkEventKey* event,
                                                                                   gpointer self);
static gboolean _slingshot_widgets_category_view_on_key_press_gtk_widget_key_press_event (GtkWidget* _sender,
                                                                                   GdkEventKey* event,
                                                                                   gpointer self);
static gboolean _slingshot_widgets_category_view___lambda72_ (SlingshotWidgetsCategoryView* self,
                                                       GdkEventMotion* event);
static gboolean __slingshot_widgets_category_view___lambda72__gtk_widget_motion_notify_event (GtkWidget* _sender,
                                                                                       GdkEventMotion* event,
                                                                                       gpointer self);
static void _slingshot_widgets_category_view___lambda73_ (SlingshotWidgetsCategoryView* self,
                                                   GdkDragContext* ctx);
static void __slingshot_widgets_category_view___lambda73__gtk_widget_drag_begin (GtkWidget* _sender,
                                                                          GdkDragContext* context,
                                                                          gpointer self);
static void _slingshot_widgets_category_view___lambda74_ (SlingshotWidgetsCategoryView* self);
static void __slingshot_widgets_category_view___lambda74__gtk_widget_drag_end (GtkWidget* _sender,
                                                                        GdkDragContext* context,
                                                                        gpointer self);
static void _slingshot_widgets_category_view___lambda75_ (SlingshotWidgetsCategoryView* self,
                                                   GdkDragContext* ctx,
                                                   GtkSelectionData* sel,
                                                   guint info,
                                                   guint time);
static void __slingshot_widgets_category_view___lambda75__gtk_widget_drag_data_get (GtkWidget* _sender,
                                                                             GdkDragContext* context,
                                                                             GtkSelectionData* selection_data,
                                                                             guint info,
                                                                             guint time_,
                                                                             gpointer self);
static void _slingshot_widgets_category_view___lambda76_ (SlingshotWidgetsCategoryView* self);
static void __slingshot_widgets_category_view___lambda76__slingshot_widgets_category_view_nav_list_box_search_focus_request (SlingshotWidgetsCategoryViewNavListBox* _sender,
                                                                                                                      gpointer self);
static void _slingshot_widgets_category_view___lambda77_ (SlingshotWidgetsCategoryView* self);
static void __slingshot_widgets_category_view___lambda77__g_settings_changed (GSettings* _sender,
                                                                       const gchar* key,
                                                                       gpointer self);
static void _slingshot_widgets_category_view___lambda78_ (SlingshotWidgetsCategoryView* self);
static void __slingshot_widgets_category_view___lambda78__g_settings_changed (GSettings* _sender,
                                                                       const gchar* key,
                                                                       gpointer self);
static void slingshot_widgets_category_view_finalize (GObject * obj);
static void _vala_slingshot_widgets_category_view_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec);
static void _vala_slingshot_widgets_category_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 const GtkTargetEntry SLINGSHOT_WIDGETS_CATEGORY_VIEW_DND = {"text/uri-list", (guint) 0, (guint) 0};

static inline gpointer
slingshot_widgets_category_view_get_instance_private (SlingshotWidgetsCategoryView* self)
{
	return G_STRUCT_MEMBER_P (self, SlingshotWidgetsCategoryView_private_offset);
}

SlingshotWidgetsCategoryView*
slingshot_widgets_category_view_construct (GType object_type,
                                           SlingshotSlingshotView* view)
{
	SlingshotWidgetsCategoryView * self = NULL;
	g_return_val_if_fail (view != NULL, NULL);
	self = (SlingshotWidgetsCategoryView*) g_object_new (object_type, "view", view, NULL);
	return self;
}

SlingshotWidgetsCategoryView*
slingshot_widgets_category_view_new (SlingshotSlingshotView* view)
{
	return slingshot_widgets_category_view_construct (SLINGSHOT_WIDGETS_TYPE_CATEGORY_VIEW, view);
}

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

static void
__lambda64_ (SlingshotWidgetsCategoryView* self)
{
	SlingshotSlingshotView* _tmp0_;
	_tmp0_ = self->priv->_view;
	g_signal_emit_by_name (_tmp0_, "close-indicator");
}

static void
___lambda64__slingshot_app_context_menu_app_launched (SlingshotAppContextMenu* _sender,
                                                      gpointer self)
{
	__lambda64_ ((SlingshotWidgetsCategoryView*) self);
}

static gboolean
slingshot_widgets_category_view_show_context_menu_for_event (SlingshotWidgetsCategoryView* self,
                                                             GdkEvent* event)
{
	AppListRow* selected_row = NULL;
	SlingshotWidgetsCategoryViewNavListBox* _tmp0_;
	GtkListBoxRow* _tmp1_;
	AppListRow* _tmp2_;
	AppListRow* _tmp3_;
	SlingshotAppContextMenu* _tmp4_;
	AppListRow* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	AppListRow* _tmp9_;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	AppListRow* _tmp12_;
	SlingshotAppContextMenu* _tmp13_;
	SlingshotAppContextMenu* _tmp14_;
	SlingshotAppContextMenu* _tmp15_;
	gboolean _tmp16_;
	gboolean _tmp17_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = self->priv->listbox;
	_tmp1_ = gtk_list_box_get_selected_row ((GtkListBox*) _tmp0_);
	_tmp2_ = _g_object_ref0 (IS_APP_LIST_ROW (_tmp1_) ? ((AppListRow*) _tmp1_) : NULL);
	selected_row = _tmp2_;
	_tmp3_ = selected_row;
	if (_tmp3_ == NULL) {
		result = GDK_EVENT_PROPAGATE;
		_g_object_unref0 (selected_row);
		return result;
	}
	_tmp4_ = self->priv->open_ctx_menu;
	if (_tmp4_ != NULL) {
		SlingshotAppContextMenu* _tmp5_;
		_tmp5_ = self->priv->open_ctx_menu;
		gtk_popover_popdown ((GtkPopover*) _tmp5_);
		_g_object_unref0 (self->priv->open_ctx_menu);
		self->priv->open_ctx_menu = NULL;
	}
	_tmp6_ = selected_row;
	_tmp7_ = app_list_row_get_app_id (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = selected_row;
	_tmp10_ = app_list_row_get_desktop_path (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = selected_row;
	_tmp13_ = slingshot_app_context_menu_new (_tmp8_, _tmp11_, (GtkWidget*) _tmp12_);
	g_object_ref_sink (_tmp13_);
	_g_object_unref0 (self->priv->open_ctx_menu);
	self->priv->open_ctx_menu = _tmp13_;
	_tmp14_ = self->priv->open_ctx_menu;
	g_signal_connect_object (_tmp14_, "app-launched", (GCallback) ___lambda64__slingshot_app_context_menu_app_launched, self, 0);
	_tmp15_ = self->priv->open_ctx_menu;
	_tmp16_ = slingshot_app_context_menu_get_has_items (_tmp15_);
	_tmp17_ = _tmp16_;
	if (!_tmp17_) {
		result = GDK_EVENT_PROPAGATE;
		_g_object_unref0 (selected_row);
		return result;
	}
	if (event->type == GDK_BUTTON_PRESS) {
		gdouble x = 0.0;
		gdouble y = 0.0;
		gdouble _tmp18_ = 0.0;
		gdouble _tmp19_ = 0.0;
		gint row_x = 0;
		gint row_y = 0;
		SlingshotWidgetsCategoryViewNavListBox* _tmp20_;
		AppListRow* _tmp21_;
		gint _tmp22_ = 0;
		gint _tmp23_ = 0;
		SlingshotAppContextMenu* _tmp24_;
		gdk_event_get_coords (event, &_tmp18_, &_tmp19_);
		x = _tmp18_;
		y = _tmp19_;
		_tmp20_ = self->priv->listbox;
		_tmp21_ = selected_row;
		gtk_widget_translate_coordinates ((GtkWidget*) _tmp20_, (GtkWidget*) _tmp21_, (gint) x, (gint) y, &_tmp22_, &_tmp23_);
		row_x = _tmp22_;
		row_y = _tmp23_;
		_tmp24_ = self->priv->open_ctx_menu;
		slingshot_app_context_menu_popup_at_pointer_coords (_tmp24_, (gdouble) row_x, (gdouble) row_y);
	} else {
		SlingshotAppContextMenu* _tmp25_;
		SlingshotAppContextMenu* _tmp26_;
		_tmp25_ = self->priv->open_ctx_menu;
		gtk_popover_set_position ((GtkPopover*) _tmp25_, GTK_POS_RIGHT);
		_tmp26_ = self->priv->open_ctx_menu;
		gtk_popover_popup ((GtkPopover*) _tmp26_);
	}
	result = GDK_EVENT_STOP;
	_g_object_unref0 (selected_row);
	return result;
}

static void
slingshot_widgets_category_view_define_css_styles (SlingshotWidgetsCategoryView* self)
{
	GString* css_builder = NULL;
	GString* _tmp0_;
	GdkScreen* screen = NULL;
	GdkScreen* _tmp4_;
	GdkScreen* _tmp5_;
	GtkCssProvider* css_provider = NULL;
	GtkCssProvider* _tmp6_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_string_new ("");
	css_builder = _tmp0_;
	{
		gint spacing = 0;
		spacing = -15;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				gint bottom = 0;
				gint top = 0;
				GString* _tmp3_;
				if (!_tmp1_) {
					gint _tmp2_;
					spacing = spacing + 1;
					_tmp2_ = spacing;
				}
				_tmp1_ = FALSE;
				if (!(spacing <= 15)) {
					break;
				}
				bottom = spacing / 2;
				top = spacing - bottom;
				_tmp3_ = css_builder;
				g_string_append_printf (_tmp3_, "\n" \
"                .budgie_application_menu_category_row_%d {\n" \
"                    margin: %dpx 3px %dpx 3px;\n" \
"                }\n" \
"                ", spacing, top, bottom);
			}
		}
	}
	_tmp4_ = gtk_widget_get_screen ((GtkWidget*) self);
	_tmp5_ = _g_object_ref0 (_tmp4_);
	screen = _tmp5_;
	_tmp6_ = gtk_css_provider_new ();
	css_provider = _tmp6_;
	{
		GString* _tmp7_;
		const gchar* _tmp8_;
		_tmp7_ = css_builder;
		_tmp8_ = _tmp7_->str;
		gtk_css_provider_load_from_data (css_provider, _tmp8_, (gssize) -1, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		gtk_style_context_add_provider_for_screen (screen, (GtkStyleProvider*) css_provider, (guint) GTK_STYLE_PROVIDER_PRIORITY_USER);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp9_;
		const gchar* _tmp10_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp9_ = e;
		_tmp10_ = _tmp9_->message;
		g_message ("CategoryView.vala:230: Could not load css %s", _tmp10_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (css_provider);
		_g_object_unref0 (screen);
		_g_string_free0 (css_builder);
		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;
	}
	_g_object_unref0 (css_provider);
	_g_object_unref0 (screen);
	_g_string_free0 (css_builder);
}

static gint
slingshot_widgets_category_view_category_sort_func (SlingshotWidgetsCategoryViewCategoryRow* row1,
                                                    SlingshotWidgetsCategoryViewCategoryRow* row2)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gint result;
	g_return_val_if_fail (row1 != NULL, -1);
	g_return_val_if_fail (row2 != NULL, -1);
	_tmp0_ = slingshot_widgets_category_view_category_row_get_translated_name (row1);
	_tmp1_ = _tmp0_;
	_tmp2_ = slingshot_widgets_category_view_category_row_get_translated_name (row2);
	_tmp3_ = _tmp2_;
	result = g_utf8_collate (_tmp1_, _tmp3_);
	return result;
}

void
slingshot_widgets_category_view_page_down (SlingshotWidgetsCategoryView* self)
{
	SlingshotWidgetsCategoryViewNavListBox* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->category_switcher;
	g_signal_emit_by_name ((GtkListBox*) _tmp0_, "move-cursor", GTK_MOVEMENT_DISPLAY_LINES, 1);
	slingshot_widgets_category_view_focus_select_first_row (self);
}

void
slingshot_widgets_category_view_page_up (SlingshotWidgetsCategoryView* self)
{
	SlingshotWidgetsCategoryViewNavListBox* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->category_switcher;
	g_signal_emit_by_name ((GtkListBox*) _tmp0_, "move-cursor", GTK_MOVEMENT_DISPLAY_LINES, -1);
	slingshot_widgets_category_view_focus_select_first_row (self);
}

static void
slingshot_widgets_category_view_focus_select_first_row (SlingshotWidgetsCategoryView* self)
{
	GtkListBoxRow* first_row = NULL;
	SlingshotWidgetsCategoryViewNavListBox* _tmp0_;
	GtkListBoxRow* _tmp1_;
	GtkListBoxRow* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->listbox;
	_tmp1_ = gtk_list_box_get_row_at_index ((GtkListBox*) _tmp0_, 0);
	first_row = _tmp1_;
	_tmp2_ = first_row;
	if (_tmp2_ != NULL) {
		GtkListBoxRow* _tmp3_;
		SlingshotWidgetsCategoryViewNavListBox* _tmp4_;
		GtkListBoxRow* _tmp5_;
		_tmp3_ = first_row;
		gtk_widget_grab_focus ((GtkWidget*) _tmp3_);
		_tmp4_ = self->priv->listbox;
		_tmp5_ = first_row;
		gtk_list_box_select_row ((GtkListBox*) _tmp4_, _tmp5_);
	}
}

static gboolean
slingshot_widgets_category_view_on_mouse_enter (SlingshotWidgetsCategoryView* self,
                                                GtkWidget* source_widget,
                                                GdkEventCrossing* e)
{
	GtkEventBox* b = NULL;
	GtkEventBox* _tmp0_;
	GtkEventBox* _tmp1_;
	SlingshotWidgetsCategoryViewNavListBox* _tmp2_;
	GtkEventBox* _tmp3_;
	GtkContainer* _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (source_widget != NULL, FALSE);
	g_return_val_if_fail (e != NULL, FALSE);
	if (!self->priv->rollover_menus) {
		result = GDK_EVENT_PROPAGATE;
		return result;
	}
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (source_widget, gtk_event_box_get_type ()) ? ((GtkEventBox*) source_widget) : NULL);
	b = _tmp0_;
	_tmp1_ = b;
	if (_tmp1_ == NULL) {
		result = GDK_EVENT_PROPAGATE;
		_g_object_unref0 (b);
		return result;
	}
	_tmp2_ = self->priv->category_switcher;
	_tmp3_ = b;
	_tmp4_ = gtk_widget_get_parent ((GtkWidget*) _tmp3_);
	gtk_list_box_select_row ((GtkListBox*) _tmp2_, (GtkListBoxRow*) (SLINGSHOT_WIDGETS_CATEGORY_VIEW_IS_CATEGORY_ROW (_tmp4_) ? ((SlingshotWidgetsCategoryViewCategoryRow*) _tmp4_) : NULL));
	result = GDK_EVENT_PROPAGATE;
	_g_object_unref0 (b);
	return result;
}

static void
__lambda65_ (SlingshotWidgetsCategoryView* self,
             GtkWidget* app_list_row)
{
	SlingshotWidgetsCategoryViewNavListBox* _tmp0_;
	g_return_if_fail (app_list_row != NULL);
	_tmp0_ = self->priv->listbox;
	gtk_container_remove ((GtkContainer*) _tmp0_, app_list_row);
}

static void
___lambda65__gtk_callback (GtkWidget* widget,
                           gpointer self)
{
	__lambda65_ ((SlingshotWidgetsCategoryView*) self, widget);
}

static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

static inline void
_g_slist_free__g_object_unref0_ (GSList* self)
{
	g_slist_free_full (self, (GDestroyNotify) _g_object_unref0_);
}

static gboolean
_slingshot_widgets_category_view_on_mouse_enter_gtk_widget_enter_notify_event (GtkWidget* _sender,
                                                                               GdkEventCrossing* event,
                                                                               gpointer self)
{
	gboolean result;
	result = slingshot_widgets_category_view_on_mouse_enter ((SlingshotWidgetsCategoryView*) self, _sender, event);
	return result;
}

void
slingshot_widgets_category_view_setup_sidebar (SlingshotWidgetsCategoryView* self)
{
	SlingshotWidgetsCategoryViewCategoryRow* old_selected = NULL;
	SlingshotWidgetsCategoryViewNavListBox* _tmp0_;
	GtkListBoxRow* _tmp1_;
	SlingshotWidgetsCategoryViewCategoryRow* _tmp2_;
	SlingshotWidgetsCategoryViewNavListBox* _tmp3_;
	GList* _tmp4_;
	SlingshotWidgetsCategoryViewNavListBox* _tmp7_;
	SlingshotSlingshotView* _tmp8_;
	SlingshotBackendAppSystem* _tmp9_;
	GSList* _tmp10_;
	SlingshotWidgetsCategoryViewNavListBox* _tmp20_;
	gint category_spacing = 0;
	GSettings* _tmp21_;
	GtkListBoxRow* new_selected = NULL;
	SlingshotWidgetsCategoryViewNavListBox* _tmp48_;
	GtkListBoxRow* _tmp49_ = NULL;
	GtkListBoxRow* _tmp50_;
	SlingshotWidgetsCategoryViewNavListBox* _tmp53_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->category_switcher;
	_tmp1_ = gtk_list_box_get_selected_row ((GtkListBox*) _tmp0_);
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, SLINGSHOT_WIDGETS_CATEGORY_VIEW_TYPE_CATEGORY_ROW, SlingshotWidgetsCategoryViewCategoryRow));
	old_selected = _tmp2_;
	_tmp3_ = self->priv->category_switcher;
	_tmp4_ = gtk_container_get_children ((GtkContainer*) _tmp3_);
	{
		GList* child_collection = NULL;
		GList* child_it = NULL;
		child_collection = _tmp4_;
		for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
			GtkWidget* child = NULL;
			child = (GtkWidget*) child_it->data;
			{
				GtkWidget* _tmp5_;
				GtkWidget* _tmp6_;
				_tmp5_ = child;
				gtk_widget_destroy (_tmp5_);
				_tmp6_ = child;
				g_signal_handlers_disconnect_by_func (_tmp6_, (void*) slingshot_widgets_category_view_on_mouse_enter, self);
			}
		}
		(child_collection == NULL) ? NULL : (child_collection = (g_list_free (child_collection), NULL));
	}
	_tmp7_ = self->priv->listbox;
	gtk_container_foreach ((GtkContainer*) _tmp7_, ___lambda65__gtk_callback, self);
	_tmp8_ = self->priv->_view;
	_tmp9_ = _tmp8_->app_system;
	_tmp10_ = slingshot_backend_app_system_get_apps_by_name (_tmp9_);
	{
		GSList* app_collection = NULL;
		GSList* app_it = NULL;
		app_collection = _tmp10_;
		for (app_it = app_collection; app_it != NULL; app_it = app_it->next) {
			SlingshotBackendApp* app = NULL;
			app = (SlingshotBackendApp*) app_it->data;
			{
				SlingshotWidgetsCategoryViewNavListBox* _tmp11_;
				SlingshotBackendApp* _tmp12_;
				const gchar* _tmp13_;
				const gchar* _tmp14_;
				SlingshotBackendApp* _tmp15_;
				const gchar* _tmp16_;
				const gchar* _tmp17_;
				AppListRow* _tmp18_;
				AppListRow* _tmp19_;
				_tmp11_ = self->priv->listbox;
				_tmp12_ = app;
				_tmp13_ = slingshot_backend_app_get_desktop_id (_tmp12_);
				_tmp14_ = _tmp13_;
				_tmp15_ = app;
				_tmp16_ = slingshot_backend_app_get_desktop_path (_tmp15_);
				_tmp17_ = _tmp16_;
				_tmp18_ = app_list_row_new (_tmp14_, _tmp17_);
				g_object_ref_sink (_tmp18_);
				_tmp19_ = _tmp18_;
				gtk_container_add ((GtkContainer*) _tmp11_, (GtkWidget*) _tmp19_);
				_g_object_unref0 (_tmp19_);
			}
		}
		(app_collection == NULL) ? NULL : (app_collection = (_g_slist_free__g_object_unref0_ (app_collection), NULL));
	}
	_tmp20_ = self->priv->listbox;
	gtk_widget_show_all ((GtkWidget*) _tmp20_);
	_tmp21_ = slingshot_widgets_category_view_settings;
	category_spacing = g_settings_get_int (_tmp21_, "category-spacing");
	new_selected = NULL;
	{
		GeeIterator* _cat_name_it = NULL;
		SlingshotSlingshotView* _tmp22_;
		SlingshotBackendAppSystem* _tmp23_;
		GeeHashMap* _tmp24_;
		GeeHashMap* _tmp25_;
		GeeSet* _tmp26_;
		GeeSet* _tmp27_;
		GeeSet* _tmp28_;
		GeeIterator* _tmp29_;
		GeeIterator* _tmp30_;
		_tmp22_ = self->priv->_view;
		_tmp23_ = _tmp22_->app_system;
		_tmp24_ = slingshot_backend_app_system_get_apps (_tmp23_);
		_tmp25_ = _tmp24_;
		_tmp26_ = gee_abstract_map_get_keys ((GeeAbstractMap*) _tmp25_);
		_tmp27_ = _tmp26_;
		_tmp28_ = _tmp27_;
		_tmp29_ = gee_iterable_iterator ((GeeIterable*) _tmp28_);
		_tmp30_ = _tmp29_;
		_g_object_unref0 (_tmp28_);
		_cat_name_it = _tmp30_;
		while (TRUE) {
			GeeIterator* _tmp31_;
			gchar* cat_name = NULL;
			GeeIterator* _tmp32_;
			gpointer _tmp33_;
			const gchar* _tmp34_;
			SlingshotWidgetsCategoryViewCategoryRow* row = NULL;
			const gchar* _tmp35_;
			SlingshotWidgetsCategoryViewCategoryRow* _tmp36_;
			SlingshotWidgetsCategoryViewCategoryRow* _tmp37_;
			GtkEventBox* _tmp38_;
			SlingshotWidgetsCategoryViewNavListBox* _tmp39_;
			SlingshotWidgetsCategoryViewCategoryRow* _tmp40_;
			gboolean _tmp41_ = FALSE;
			SlingshotWidgetsCategoryViewCategoryRow* _tmp42_;
			_tmp31_ = _cat_name_it;
			if (!gee_iterator_next (_tmp31_)) {
				break;
			}
			_tmp32_ = _cat_name_it;
			_tmp33_ = gee_iterator_get (_tmp32_);
			cat_name = (gchar*) _tmp33_;
			_tmp34_ = cat_name;
			if (g_strcmp0 (_tmp34_, "switchboard") == 0) {
				_g_free0 (cat_name);
				continue;
			}
			_tmp35_ = cat_name;
			_tmp36_ = slingshot_widgets_category_view_category_row_new (_tmp35_, category_spacing);
			g_object_ref_sink (_tmp36_);
			row = _tmp36_;
			_tmp37_ = row;
			_tmp38_ = _tmp37_->eventbox;
			g_signal_connect_object ((GtkWidget*) _tmp38_, "enter-notify-event", (GCallback) _slingshot_widgets_category_view_on_mouse_enter_gtk_widget_enter_notify_event, self, 0);
			_tmp39_ = self->priv->category_switcher;
			_tmp40_ = row;
			gtk_container_add ((GtkContainer*) _tmp39_, (GtkWidget*) _tmp40_);
			_tmp42_ = old_selected;
			if (_tmp42_ != NULL) {
				SlingshotWidgetsCategoryViewCategoryRow* _tmp43_;
				const gchar* _tmp44_;
				const gchar* _tmp45_;
				const gchar* _tmp46_;
				_tmp43_ = old_selected;
				_tmp44_ = slingshot_widgets_category_view_category_row_get_cat_name (_tmp43_);
				_tmp45_ = _tmp44_;
				_tmp46_ = cat_name;
				_tmp41_ = g_strcmp0 (_tmp45_, _tmp46_) == 0;
			} else {
				_tmp41_ = FALSE;
			}
			if (_tmp41_) {
				SlingshotWidgetsCategoryViewCategoryRow* _tmp47_;
				_tmp47_ = row;
				new_selected = (GtkListBoxRow*) _tmp47_;
			}
			_g_object_unref0 (row);
			_g_free0 (cat_name);
		}
		_g_object_unref0 (_cat_name_it);
	}
	_tmp48_ = self->priv->category_switcher;
	gtk_widget_show_all ((GtkWidget*) _tmp48_);
	_tmp50_ = new_selected;
	_tmp49_ = _tmp50_;
	if (_tmp49_ == NULL) {
		SlingshotWidgetsCategoryViewNavListBox* _tmp51_;
		GtkListBoxRow* _tmp52_;
		_tmp51_ = self->priv->category_switcher;
		_tmp52_ = gtk_list_box_get_row_at_index ((GtkListBox*) _tmp51_, 0);
		_tmp49_ = _tmp52_;
	}
	_tmp53_ = self->priv->category_switcher;
	gtk_list_box_select_row ((GtkListBox*) _tmp53_, _tmp49_);
	_g_object_unref0 (old_selected);
}

static gboolean
slingshot_widgets_category_view_filter_function (AppListRow* row,
                                                 SlingshotWidgetsCategoryView* self)
{
	SlingshotWidgetsCategoryViewCategoryRow* category_row = NULL;
	SlingshotWidgetsCategoryViewNavListBox* _tmp0_;
	GtkListBoxRow* _tmp1_;
	SlingshotWidgetsCategoryViewCategoryRow* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (row != NULL, FALSE);
	_tmp0_ = self->priv->category_switcher;
	_tmp1_ = gtk_list_box_get_selected_row ((GtkListBox*) _tmp0_);
	category_row = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, SLINGSHOT_WIDGETS_CATEGORY_VIEW_TYPE_CATEGORY_ROW, SlingshotWidgetsCategoryViewCategoryRow);
	_tmp2_ = category_row;
	if (_tmp2_ != NULL) {
		{
			GeeArrayList* _app_list = NULL;
			SlingshotSlingshotView* _tmp3_;
			SlingshotBackendAppSystem* _tmp4_;
			GeeHashMap* _tmp5_;
			GeeHashMap* _tmp6_;
			SlingshotWidgetsCategoryViewCategoryRow* _tmp7_;
			const gchar* _tmp8_;
			const gchar* _tmp9_;
			gpointer _tmp10_;
			gint _app_size = 0;
			GeeArrayList* _tmp11_;
			gint _tmp12_;
			gint _tmp13_;
			gint _app_index = 0;
			_tmp3_ = self->priv->_view;
			_tmp4_ = _tmp3_->app_system;
			_tmp5_ = slingshot_backend_app_system_get_apps (_tmp4_);
			_tmp6_ = _tmp5_;
			_tmp7_ = category_row;
			_tmp8_ = slingshot_widgets_category_view_category_row_get_cat_name (_tmp7_);
			_tmp9_ = _tmp8_;
			_tmp10_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp6_, _tmp9_);
			_app_list = (GeeArrayList*) _tmp10_;
			_tmp11_ = _app_list;
			_tmp12_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp11_);
			_tmp13_ = _tmp12_;
			_app_size = _tmp13_;
			_app_index = -1;
			while (TRUE) {
				gint _tmp14_;
				gint _tmp15_;
				SlingshotBackendApp* app = NULL;
				GeeArrayList* _tmp16_;
				gpointer _tmp17_;
				gboolean _tmp18_ = FALSE;
				const gchar* _tmp19_;
				const gchar* _tmp20_;
				SlingshotBackendApp* _tmp21_;
				const gchar* _tmp22_;
				const gchar* _tmp23_;
				_app_index = _app_index + 1;
				_tmp14_ = _app_index;
				_tmp15_ = _app_size;
				if (!(_tmp14_ < _tmp15_)) {
					break;
				}
				_tmp16_ = _app_list;
				_tmp17_ = gee_abstract_list_get ((GeeAbstractList*) _tmp16_, _app_index);
				app = (SlingshotBackendApp*) _tmp17_;
				_tmp19_ = app_list_row_get_app_id (row);
				_tmp20_ = _tmp19_;
				_tmp21_ = app;
				_tmp22_ = slingshot_backend_app_get_desktop_id (_tmp21_);
				_tmp23_ = _tmp22_;
				if (g_strcmp0 (_tmp20_, _tmp23_) == 0) {
					gboolean _tmp24_ = FALSE;
					SlingshotBackendApp* _tmp25_;
					gboolean _tmp26_;
					gboolean _tmp27_;
					_tmp25_ = app;
					_tmp26_ = slingshot_backend_app_get_terminal (_tmp25_);
					_tmp27_ = _tmp26_;
					if (_tmp27_) {
						GSettings* _tmp28_;
						_tmp28_ = slingshot_widgets_category_view_settings;
						_tmp24_ = !g_settings_get_boolean (_tmp28_, "show-terminal-apps");
					} else {
						_tmp24_ = FALSE;
					}
					_tmp18_ = !_tmp24_;
				} else {
					_tmp18_ = FALSE;
				}
				if (_tmp18_) {
					result = TRUE;
					_g_object_unref0 (app);
					_g_object_unref0 (_app_list);
					return result;
				}
				_g_object_unref0 (app);
			}
			_g_object_unref0 (_app_list);
		}
	}
	result = FALSE;
	return result;
}

static gboolean
slingshot_widgets_category_view_on_key_press (SlingshotWidgetsCategoryView* self,
                                              GdkEventKey* event)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	switch (event->keyval) {
		case GDK_KEY_Page_Up:
		case GDK_KEY_KP_Page_Up:
		{
			slingshot_widgets_category_view_page_up (self);
			result = GDK_EVENT_STOP;
			return result;
		}
		case GDK_KEY_Page_Down:
		case GDK_KEY_KP_Page_Down:
		{
			slingshot_widgets_category_view_page_down (self);
			result = GDK_EVENT_STOP;
			return result;
		}
		case GDK_KEY_Home:
		{
			SlingshotWidgetsCategoryViewNavListBox* _tmp0_;
			_tmp0_ = self->priv->category_switcher;
			g_signal_emit_by_name ((GtkListBox*) _tmp0_, "move-cursor", GTK_MOVEMENT_PAGES, -1);
			slingshot_widgets_category_view_focus_select_first_row (self);
			result = GDK_EVENT_STOP;
			return result;
		}
		case GDK_KEY_End:
		{
			SlingshotWidgetsCategoryViewNavListBox* _tmp1_;
			_tmp1_ = self->priv->category_switcher;
			g_signal_emit_by_name ((GtkListBox*) _tmp1_, "move-cursor", GTK_MOVEMENT_PAGES, 1);
			slingshot_widgets_category_view_focus_select_first_row (self);
			result = GDK_EVENT_STOP;
			return result;
		}
		case GDK_KEY_KP_Up:
		case GDK_KEY_Up:
		{
			if (event->state == GDK_SHIFT_MASK) {
				slingshot_widgets_category_view_page_up (self);
				result = GDK_EVENT_STOP;
				return result;
			}
			break;
		}
		case GDK_KEY_KP_Down:
		case GDK_KEY_Down:
		{
			if (event->state == GDK_SHIFT_MASK) {
				slingshot_widgets_category_view_page_down (self);
				result = GDK_EVENT_STOP;
				return result;
			}
			break;
		}
		default:
		break;
	}
	result = GDK_EVENT_PROPAGATE;
	return result;
}

SlingshotSlingshotView*
slingshot_widgets_category_view_get_view (SlingshotWidgetsCategoryView* self)
{
	SlingshotSlingshotView* result;
	SlingshotSlingshotView* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_view;
	result = _tmp0_;
	return result;
}

static void
slingshot_widgets_category_view_set_view (SlingshotWidgetsCategoryView* self,
                                          SlingshotSlingshotView* value)
{
	SlingshotSlingshotView* old_value;
	g_return_if_fail (self != NULL);
	old_value = slingshot_widgets_category_view_get_view (self);
	if (old_value != value) {
		SlingshotSlingshotView* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_view);
		self->priv->_view = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, slingshot_widgets_category_view_properties[SLINGSHOT_WIDGETS_CATEGORY_VIEW_VIEW_PROPERTY]);
	}
}

static inline gpointer
slingshot_widgets_category_view_category_row_get_instance_private (SlingshotWidgetsCategoryViewCategoryRow* self)
{
	return G_STRUCT_MEMBER_P (self, SlingshotWidgetsCategoryViewCategoryRow_private_offset);
}

static SlingshotWidgetsCategoryViewCategoryRow*
slingshot_widgets_category_view_category_row_construct (GType object_type,
                                                        const gchar* cat_name,
                                                        gint cat_margin)
{
	SlingshotWidgetsCategoryViewCategoryRow * self = NULL;
	g_return_val_if_fail (cat_name != NULL, NULL);
	self = (SlingshotWidgetsCategoryViewCategoryRow*) g_object_new (object_type, "cat-name", cat_name, "cat-margin", cat_margin, NULL);
	return self;
}

static SlingshotWidgetsCategoryViewCategoryRow*
slingshot_widgets_category_view_category_row_new (const gchar* cat_name,
                                                  gint cat_margin)
{
	return slingshot_widgets_category_view_category_row_construct (SLINGSHOT_WIDGETS_CATEGORY_VIEW_TYPE_CATEGORY_ROW, cat_name, cat_margin);
}

static const gchar*
slingshot_widgets_category_view_category_row_get_cat_name (SlingshotWidgetsCategoryViewCategoryRow* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_cat_name;
	result = _tmp0_;
	return result;
}

static void
slingshot_widgets_category_view_category_row_set_cat_name (SlingshotWidgetsCategoryViewCategoryRow* self,
                                                           const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = slingshot_widgets_category_view_category_row_get_cat_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_cat_name);
		self->priv->_cat_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, slingshot_widgets_category_view_category_row_properties[SLINGSHOT_WIDGETS_CATEGORY_VIEW_CATEGORY_ROW_CAT_NAME_PROPERTY]);
	}
}

static gint
slingshot_widgets_category_view_category_row_get_cat_margin (SlingshotWidgetsCategoryViewCategoryRow* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_cat_margin;
	return result;
}

static void
slingshot_widgets_category_view_category_row_set_cat_margin (SlingshotWidgetsCategoryViewCategoryRow* self,
                                                             gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = slingshot_widgets_category_view_category_row_get_cat_margin (self);
	if (old_value != value) {
		self->priv->_cat_margin = value;
		g_object_notify_by_pspec ((GObject *) self, slingshot_widgets_category_view_category_row_properties[SLINGSHOT_WIDGETS_CATEGORY_VIEW_CATEGORY_ROW_CAT_MARGIN_PROPERTY]);
	}
}

static const gchar*
slingshot_widgets_category_view_category_row_get_translated_name (SlingshotWidgetsCategoryViewCategoryRow* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_cat_name;
	result = g_dgettext ("gnome-menus-3.0", _tmp0_);
	return result;
}

static GObject *
slingshot_widgets_category_view_category_row_constructor (GType type,
                                                          guint n_construct_properties,
                                                          GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SlingshotWidgetsCategoryViewCategoryRow * self;
	GtkLabel* label = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GtkLabel* _tmp2_;
	GtkLabel* _tmp3_;
	GtkLabel* _tmp4_;
	GtkLabel* _tmp5_;
	GtkStyleContext* _tmp6_;
	gint _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	GtkEventBox* _tmp10_;
	GtkEventBox* _tmp11_;
	GtkLabel* _tmp12_;
	GtkEventBox* _tmp13_;
	GtkEventBox* _tmp14_;
	parent_class = G_OBJECT_CLASS (slingshot_widgets_category_view_category_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SLINGSHOT_WIDGETS_CATEGORY_VIEW_TYPE_CATEGORY_ROW, SlingshotWidgetsCategoryViewCategoryRow);
	_tmp0_ = slingshot_widgets_category_view_category_row_get_translated_name (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = (GtkLabel*) gtk_label_new (_tmp1_);
	g_object_ref_sink (_tmp2_);
	label = _tmp2_;
	_tmp3_ = label;
	gtk_widget_set_halign ((GtkWidget*) _tmp3_, GTK_ALIGN_START);
	_tmp4_ = label;
	g_object_set ((GtkWidget*) _tmp4_, "margin", 0, NULL);
	_tmp5_ = label;
	_tmp6_ = gtk_widget_get_style_context ((GtkWidget*) _tmp5_);
	_tmp7_ = self->priv->_cat_margin;
	_tmp8_ = g_strdup_printf ("budgie_application_menu_category_row_%d", _tmp7_);
	_tmp9_ = _tmp8_;
	gtk_style_context_add_class (_tmp6_, _tmp9_);
	_g_free0 (_tmp9_);
	_tmp10_ = (GtkEventBox*) gtk_event_box_new ();
	g_object_ref_sink (_tmp10_);
	_g_object_unref0 (self->eventbox);
	self->eventbox = _tmp10_;
	_tmp11_ = self->eventbox;
	_tmp12_ = label;
	gtk_container_add ((GtkContainer*) _tmp11_, (GtkWidget*) _tmp12_);
	_tmp13_ = self->eventbox;
	gtk_widget_add_events ((GtkWidget*) _tmp13_, (gint) (GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK));
	_tmp14_ = self->eventbox;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp14_);
	_g_object_unref0 (label);
	return obj;
}

static void
slingshot_widgets_category_view_category_row_class_init (SlingshotWidgetsCategoryViewCategoryRowClass * klass,
                                                         gpointer klass_data)
{
	slingshot_widgets_category_view_category_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SlingshotWidgetsCategoryViewCategoryRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_slingshot_widgets_category_view_category_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_slingshot_widgets_category_view_category_row_set_property;
	G_OBJECT_CLASS (klass)->constructor = slingshot_widgets_category_view_category_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = slingshot_widgets_category_view_category_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SLINGSHOT_WIDGETS_CATEGORY_VIEW_CATEGORY_ROW_CAT_NAME_PROPERTY, slingshot_widgets_category_view_category_row_properties[SLINGSHOT_WIDGETS_CATEGORY_VIEW_CATEGORY_ROW_CAT_NAME_PROPERTY] = g_param_spec_string ("cat-name", "cat-name", "cat-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SLINGSHOT_WIDGETS_CATEGORY_VIEW_CATEGORY_ROW_CAT_MARGIN_PROPERTY, slingshot_widgets_category_view_category_row_properties[SLINGSHOT_WIDGETS_CATEGORY_VIEW_CATEGORY_ROW_CAT_MARGIN_PROPERTY] = g_param_spec_int ("cat-margin", "cat-margin", "cat-margin", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SLINGSHOT_WIDGETS_CATEGORY_VIEW_CATEGORY_ROW_TRANSLATED_NAME_PROPERTY, slingshot_widgets_category_view_category_row_properties[SLINGSHOT_WIDGETS_CATEGORY_VIEW_CATEGORY_ROW_TRANSLATED_NAME_PROPERTY] = g_param_spec_string ("translated-name", "translated-name", "translated-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
slingshot_widgets_category_view_category_row_instance_init (SlingshotWidgetsCategoryViewCategoryRow * self,
                                                            gpointer klass)
{
	self->priv = slingshot_widgets_category_view_category_row_get_instance_private (self);
}

static void
slingshot_widgets_category_view_category_row_finalize (GObject * obj)
{
	SlingshotWidgetsCategoryViewCategoryRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SLINGSHOT_WIDGETS_CATEGORY_VIEW_TYPE_CATEGORY_ROW, SlingshotWidgetsCategoryViewCategoryRow);
	_g_free0 (self->priv->_cat_name);
	_g_object_unref0 (self->eventbox);
	G_OBJECT_CLASS (slingshot_widgets_category_view_category_row_parent_class)->finalize (obj);
}

GType
slingshot_widgets_category_view_category_row_get_type (void)
{
	return slingshot_widgets_category_view_category_row_type_id;
}

GType
slingshot_widgets_category_view_category_row_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (SlingshotWidgetsCategoryViewCategoryRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) slingshot_widgets_category_view_category_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SlingshotWidgetsCategoryViewCategoryRow), 0, (GInstanceInitFunc) slingshot_widgets_category_view_category_row_instance_init, NULL };
	slingshot_widgets_category_view_category_row_type_id = g_type_module_register_type (module, gtk_list_box_row_get_type (), "SlingshotWidgetsCategoryViewCategoryRow", &g_define_type_info, 0);
	SlingshotWidgetsCategoryViewCategoryRow_private_offset = sizeof (SlingshotWidgetsCategoryViewCategoryRowPrivate);
	return slingshot_widgets_category_view_category_row_type_id;
}

static void
_vala_slingshot_widgets_category_view_category_row_get_property (GObject * object,
                                                                 guint property_id,
                                                                 GValue * value,
                                                                 GParamSpec * pspec)
{
	SlingshotWidgetsCategoryViewCategoryRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SLINGSHOT_WIDGETS_CATEGORY_VIEW_TYPE_CATEGORY_ROW, SlingshotWidgetsCategoryViewCategoryRow);
	switch (property_id) {
		case SLINGSHOT_WIDGETS_CATEGORY_VIEW_CATEGORY_ROW_CAT_NAME_PROPERTY:
		g_value_set_string (value, slingshot_widgets_category_view_category_row_get_cat_name (self));
		break;
		case SLINGSHOT_WIDGETS_CATEGORY_VIEW_CATEGORY_ROW_CAT_MARGIN_PROPERTY:
		g_value_set_int (value, slingshot_widgets_category_view_category_row_get_cat_margin (self));
		break;
		case SLINGSHOT_WIDGETS_CATEGORY_VIEW_CATEGORY_ROW_TRANSLATED_NAME_PROPERTY:
		g_value_set_string (value, slingshot_widgets_category_view_category_row_get_translated_name (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_slingshot_widgets_category_view_category_row_set_property (GObject * object,
                                                                 guint property_id,
                                                                 const GValue * value,
                                                                 GParamSpec * pspec)
{
	SlingshotWidgetsCategoryViewCategoryRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SLINGSHOT_WIDGETS_CATEGORY_VIEW_TYPE_CATEGORY_ROW, SlingshotWidgetsCategoryViewCategoryRow);
	switch (property_id) {
		case SLINGSHOT_WIDGETS_CATEGORY_VIEW_CATEGORY_ROW_CAT_NAME_PROPERTY:
		slingshot_widgets_category_view_category_row_set_cat_name (self, g_value_get_string (value));
		break;
		case SLINGSHOT_WIDGETS_CATEGORY_VIEW_CATEGORY_ROW_CAT_MARGIN_PROPERTY:
		slingshot_widgets_category_view_category_row_set_cat_margin (self, g_value_get_int (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
slingshot_widgets_category_view_nav_list_box_real_move_cursor (GtkListBox* base,
                                                               GtkMovementStep step,
                                                               gint count)
{
	SlingshotWidgetsCategoryViewNavListBox * self;
	GtkListBoxRow* selected = NULL;
	GtkListBoxRow* _tmp0_;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	GtkListBoxRow* _tmp4_;
	self = (SlingshotWidgetsCategoryViewNavListBox*) base;
	_tmp0_ = gtk_list_box_get_selected_row ((GtkListBox*) self);
	selected = _tmp0_;
	_tmp4_ = selected;
	if (_tmp4_ != NULL) {
		GtkListBoxRow* _tmp5_;
		GtkListBoxRow* _tmp6_;
		_tmp5_ = selected;
		_tmp6_ = gtk_list_box_get_row_at_index ((GtkListBox*) self, 0);
		_tmp3_ = _tmp5_ == _tmp6_;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		_tmp2_ = step == GTK_MOVEMENT_DISPLAY_LINES;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		_tmp1_ = count == -1;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		g_signal_emit (self, slingshot_widgets_category_view_nav_list_box_signals[SLINGSHOT_WIDGETS_CATEGORY_VIEW_NAV_LIST_BOX_SEARCH_FOCUS_REQUEST_SIGNAL], 0);
	} else {
		GTK_LIST_BOX_CLASS (slingshot_widgets_category_view_nav_list_box_parent_class)->move_cursor (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_list_box_get_type (), GtkListBox), step, count);
	}
}

static SlingshotWidgetsCategoryViewNavListBox*
slingshot_widgets_category_view_nav_list_box_construct (GType object_type)
{
	SlingshotWidgetsCategoryViewNavListBox * self = NULL;
	self = (SlingshotWidgetsCategoryViewNavListBox*) g_object_new (object_type, NULL);
	return self;
}

static SlingshotWidgetsCategoryViewNavListBox*
slingshot_widgets_category_view_nav_list_box_new (void)
{
	return slingshot_widgets_category_view_nav_list_box_construct (SLINGSHOT_WIDGETS_CATEGORY_VIEW_TYPE_NAV_LIST_BOX);
}

static void
slingshot_widgets_category_view_nav_list_box_class_init (SlingshotWidgetsCategoryViewNavListBoxClass * klass,
                                                         gpointer klass_data)
{
	slingshot_widgets_category_view_nav_list_box_parent_class = g_type_class_peek_parent (klass);
	((GtkListBoxClass *) klass)->move_cursor = (void (*) (GtkListBox*, GtkMovementStep, gint)) slingshot_widgets_category_view_nav_list_box_real_move_cursor;
	slingshot_widgets_category_view_nav_list_box_signals[SLINGSHOT_WIDGETS_CATEGORY_VIEW_NAV_LIST_BOX_SEARCH_FOCUS_REQUEST_SIGNAL] = g_signal_new ("search-focus-request", SLINGSHOT_WIDGETS_CATEGORY_VIEW_TYPE_NAV_LIST_BOX, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
slingshot_widgets_category_view_nav_list_box_instance_init (SlingshotWidgetsCategoryViewNavListBox * self,
                                                            gpointer klass)
{
}

GType
slingshot_widgets_category_view_nav_list_box_get_type (void)
{
	return slingshot_widgets_category_view_nav_list_box_type_id;
}

GType
slingshot_widgets_category_view_nav_list_box_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (SlingshotWidgetsCategoryViewNavListBoxClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) slingshot_widgets_category_view_nav_list_box_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SlingshotWidgetsCategoryViewNavListBox), 0, (GInstanceInitFunc) slingshot_widgets_category_view_nav_list_box_instance_init, NULL };
	slingshot_widgets_category_view_nav_list_box_type_id = g_type_module_register_type (module, gtk_list_box_get_type (), "SlingshotWidgetsCategoryViewNavListBox", &g_define_type_info, 0);
	return slingshot_widgets_category_view_nav_list_box_type_id;
}

static void
_slingshot_widgets_category_view___lambda66_ (SlingshotWidgetsCategoryView* self)
{
	SlingshotWidgetsCategoryViewNavListBox* _tmp0_;
	_tmp0_ = self->priv->listbox;
	gtk_list_box_invalidate_filter ((GtkListBox*) _tmp0_);
}

static void
__slingshot_widgets_category_view___lambda66__gtk_list_box_row_selected (GtkListBox* _sender,
                                                                         GtkListBoxRow* row,
                                                                         gpointer self)
{
	_slingshot_widgets_category_view___lambda66_ ((SlingshotWidgetsCategoryView*) self);
}

static void
_slingshot_widgets_category_view___lambda67_ (SlingshotWidgetsCategoryView* self)
{
	g_signal_emit (self, slingshot_widgets_category_view_signals[SLINGSHOT_WIDGETS_CATEGORY_VIEW_SEARCH_FOCUS_REQUEST_SIGNAL], 0);
}

static void
__slingshot_widgets_category_view___lambda67__slingshot_widgets_category_view_nav_list_box_search_focus_request (SlingshotWidgetsCategoryViewNavListBox* _sender,
                                                                                                                 gpointer self)
{
	_slingshot_widgets_category_view___lambda67_ ((SlingshotWidgetsCategoryView*) self);
}

static Block3Data*
block3_data_ref (Block3Data* _data3_)
{
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}

static void
block3_data_unref (void * _userdata_)
{
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		SlingshotWidgetsCategoryView* self;
		self = _data3_->self;
		_g_object_unref0 (_data3_->row);
		_g_object_unref0 (self);
		g_slice_free (Block3Data, _data3_);
	}
}

static gboolean
__lambda69_ (Block3Data* _data3_)
{
	SlingshotWidgetsCategoryView* self;
	gboolean result;
	self = _data3_->self;
	if (!self->priv->dragging) {
		SlingshotSlingshotView* _tmp0_;
		app_list_row_launch (G_TYPE_CHECK_INSTANCE_CAST (_data3_->row, TYPE_APP_LIST_ROW, AppListRow));
		_tmp0_ = self->priv->_view;
		g_signal_emit_by_name (_tmp0_, "close-indicator");
	}
	result = FALSE;
	return result;
}

static gboolean
___lambda69__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda69_ (self);
	return result;
}

static void
_slingshot_widgets_category_view___lambda68_ (SlingshotWidgetsCategoryView* self,
                                              GtkListBoxRow* row)
{
	Block3Data* _data3_;
	GtkListBoxRow* _tmp0_;
	g_return_if_fail (row != NULL);
	_data3_ = g_slice_new0 (Block3Data);
	_data3_->_ref_count_ = 1;
	_data3_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (row);
	_g_object_unref0 (_data3_->row);
	_data3_->row = _tmp0_;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda69__gsource_func, block3_data_ref (_data3_), block3_data_unref);
	block3_data_unref (_data3_);
	_data3_ = NULL;
}

static void
__slingshot_widgets_category_view___lambda68__gtk_list_box_row_activated (GtkListBox* _sender,
                                                                          GtkListBoxRow* row,
                                                                          gpointer self)
{
	_slingshot_widgets_category_view___lambda68_ ((SlingshotWidgetsCategoryView*) self, row);
}

static gboolean
_slingshot_widgets_category_view___lambda70_ (SlingshotWidgetsCategoryView* self,
                                              GdkEventButton* event)
{
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	if (event->button == ((guint) GDK_BUTTON_SECONDARY)) {
		result = slingshot_widgets_category_view_show_context_menu_for_event (self, (GdkEvent*) event);
		return result;
	}
	result = GDK_EVENT_PROPAGATE;
	return result;
}

static gboolean
__slingshot_widgets_category_view___lambda70__gtk_widget_button_press_event (GtkWidget* _sender,
                                                                             GdkEventButton* event,
                                                                             gpointer self)
{
	gboolean result;
	result = _slingshot_widgets_category_view___lambda70_ ((SlingshotWidgetsCategoryView*) self, event);
	return result;
}

static gboolean
_slingshot_widgets_category_view___lambda71_ (SlingshotWidgetsCategoryView* self,
                                              GdkEventKey* event)
{
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	if (event->keyval == GDK_KEY_Menu) {
		result = slingshot_widgets_category_view_show_context_menu_for_event (self, (GdkEvent*) event);
		return result;
	}
	result = GDK_EVENT_PROPAGATE;
	return result;
}

static gboolean
__slingshot_widgets_category_view___lambda71__gtk_widget_key_press_event (GtkWidget* _sender,
                                                                          GdkEventKey* event,
                                                                          gpointer self)
{
	gboolean result;
	result = _slingshot_widgets_category_view___lambda71_ ((SlingshotWidgetsCategoryView*) self, event);
	return result;
}

static gboolean
_slingshot_widgets_category_view_on_key_press_gtk_widget_key_press_event (GtkWidget* _sender,
                                                                          GdkEventKey* event,
                                                                          gpointer self)
{
	gboolean result;
	result = slingshot_widgets_category_view_on_key_press ((SlingshotWidgetsCategoryView*) self, event);
	return result;
}

static gboolean
_slingshot_widgets_category_view___lambda72_ (SlingshotWidgetsCategoryView* self,
                                              GdkEventMotion* event)
{
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	if (!self->priv->dragging) {
		SlingshotWidgetsCategoryViewNavListBox* _tmp0_;
		SlingshotWidgetsCategoryViewNavListBox* _tmp1_;
		GtkListBoxRow* _tmp2_;
		_tmp0_ = self->priv->listbox;
		_tmp1_ = self->priv->listbox;
		_tmp2_ = gtk_list_box_get_row_at_y ((GtkListBox*) _tmp1_, (gint) event->y);
		gtk_list_box_select_row ((GtkListBox*) _tmp0_, _tmp2_);
	}
	result = GDK_EVENT_PROPAGATE;
	return result;
}

static gboolean
__slingshot_widgets_category_view___lambda72__gtk_widget_motion_notify_event (GtkWidget* _sender,
                                                                              GdkEventMotion* event,
                                                                              gpointer self)
{
	gboolean result;
	result = _slingshot_widgets_category_view___lambda72_ ((SlingshotWidgetsCategoryView*) self, event);
	return result;
}

static void
_slingshot_widgets_category_view___lambda73_ (SlingshotWidgetsCategoryView* self,
                                              GdkDragContext* ctx)
{
	GtkListBoxRow* selected_row = NULL;
	SlingshotWidgetsCategoryViewNavListBox* _tmp0_;
	GtkListBoxRow* _tmp1_;
	GtkListBoxRow* _tmp2_;
	g_return_if_fail (ctx != NULL);
	_tmp0_ = self->priv->listbox;
	_tmp1_ = gtk_list_box_get_selected_row ((GtkListBox*) _tmp0_);
	selected_row = _tmp1_;
	_tmp2_ = selected_row;
	if (_tmp2_ != NULL) {
		AppListRow* drag_item = NULL;
		GtkListBoxRow* _tmp3_;
		AppListRow* _tmp4_;
		AppListRow* _tmp5_;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		gchar* _tmp8_;
		const gchar* _tmp9_;
		self->priv->dragging = TRUE;
		_tmp3_ = selected_row;
		_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_APP_LIST_ROW, AppListRow));
		drag_item = _tmp4_;
		_tmp5_ = drag_item;
		_tmp6_ = app_list_row_get_desktop_path (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = g_strconcat ("file://", _tmp7_, NULL);
		_g_free0 (self->priv->drag_uri);
		self->priv->drag_uri = _tmp8_;
		_tmp9_ = self->priv->drag_uri;
		if (_tmp9_ != NULL) {
			AppListRow* _tmp10_;
			GDesktopAppInfo* _tmp11_;
			GDesktopAppInfo* _tmp12_;
			GIcon* _tmp13_;
			_tmp10_ = drag_item;
			_tmp11_ = app_list_row_get_app_info (_tmp10_);
			_tmp12_ = _tmp11_;
			_tmp13_ = g_app_info_get_icon ((GAppInfo*) _tmp12_);
			gtk_drag_set_icon_gicon (ctx, _tmp13_, 16, 16);
		}
		_g_object_unref0 (drag_item);
	}
}

static void
__slingshot_widgets_category_view___lambda73__gtk_widget_drag_begin (GtkWidget* _sender,
                                                                     GdkDragContext* context,
                                                                     gpointer self)
{
	_slingshot_widgets_category_view___lambda73_ ((SlingshotWidgetsCategoryView*) self, context);
}

static void
_slingshot_widgets_category_view___lambda74_ (SlingshotWidgetsCategoryView* self)
{
	const gchar* _tmp0_;
	_tmp0_ = self->priv->drag_uri;
	if (_tmp0_ != NULL) {
		SlingshotSlingshotView* _tmp1_;
		_tmp1_ = self->priv->_view;
		g_signal_emit_by_name (_tmp1_, "close-indicator");
	}
	self->priv->dragging = FALSE;
	_g_free0 (self->priv->drag_uri);
	self->priv->drag_uri = NULL;
}

static void
__slingshot_widgets_category_view___lambda74__gtk_widget_drag_end (GtkWidget* _sender,
                                                                   GdkDragContext* context,
                                                                   gpointer self)
{
	_slingshot_widgets_category_view___lambda74_ ((SlingshotWidgetsCategoryView*) self);
}

static void
_slingshot_widgets_category_view___lambda75_ (SlingshotWidgetsCategoryView* self,
                                              GdkDragContext* ctx,
                                              GtkSelectionData* sel,
                                              guint info,
                                              guint time)
{
	const gchar* _tmp0_;
	g_return_if_fail (ctx != NULL);
	g_return_if_fail (sel != NULL);
	_tmp0_ = self->priv->drag_uri;
	if (_tmp0_ != NULL) {
		const gchar* _tmp1_;
		gchar* _tmp2_;
		gchar** _tmp3_;
		gchar** _tmp4_;
		gint _tmp4__length1;
		_tmp1_ = self->priv->drag_uri;
		_tmp2_ = g_strdup (_tmp1_);
		_tmp3_ = g_new0 (gchar*, 1 + 1);
		_tmp3_[0] = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp4__length1 = 1;
		gtk_selection_data_set_uris (sel, _tmp4_);
		_tmp4_ = (_vala_array_free (_tmp4_, _tmp4__length1, (GDestroyNotify) g_free), NULL);
	}
}

static void
__slingshot_widgets_category_view___lambda75__gtk_widget_drag_data_get (GtkWidget* _sender,
                                                                        GdkDragContext* context,
                                                                        GtkSelectionData* selection_data,
                                                                        guint info,
                                                                        guint time_,
                                                                        gpointer self)
{
	_slingshot_widgets_category_view___lambda75_ ((SlingshotWidgetsCategoryView*) self, context, selection_data, info, time_);
}

static void
_slingshot_widgets_category_view___lambda76_ (SlingshotWidgetsCategoryView* self)
{
	g_signal_emit (self, slingshot_widgets_category_view_signals[SLINGSHOT_WIDGETS_CATEGORY_VIEW_SEARCH_FOCUS_REQUEST_SIGNAL], 0);
}

static void
__slingshot_widgets_category_view___lambda76__slingshot_widgets_category_view_nav_list_box_search_focus_request (SlingshotWidgetsCategoryViewNavListBox* _sender,
                                                                                                                 gpointer self)
{
	_slingshot_widgets_category_view___lambda76_ ((SlingshotWidgetsCategoryView*) self);
}

static void
_slingshot_widgets_category_view___lambda77_ (SlingshotWidgetsCategoryView* self)
{
	GSettings* _tmp0_;
	_tmp0_ = slingshot_widgets_category_view_settings;
	self->priv->rollover_menus = g_settings_get_boolean (_tmp0_, "rollover-menu");
}

static void
__slingshot_widgets_category_view___lambda77__g_settings_changed (GSettings* _sender,
                                                                  const gchar* key,
                                                                  gpointer self)
{
	_slingshot_widgets_category_view___lambda77_ ((SlingshotWidgetsCategoryView*) self);
}

static void
_slingshot_widgets_category_view___lambda78_ (SlingshotWidgetsCategoryView* self)
{
	slingshot_widgets_category_view_setup_sidebar (self);
}

static void
__slingshot_widgets_category_view___lambda78__g_settings_changed (GSettings* _sender,
                                                                  const gchar* key,
                                                                  gpointer self)
{
	_slingshot_widgets_category_view___lambda78_ ((SlingshotWidgetsCategoryView*) self);
}

static GObject *
slingshot_widgets_category_view_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SlingshotWidgetsCategoryView * self;
	SlingshotWidgetsCategoryViewNavListBox* _tmp0_;
	SlingshotWidgetsCategoryViewNavListBox* _tmp1_;
	SlingshotWidgetsCategoryViewNavListBox* _tmp2_;
	SlingshotWidgetsCategoryViewNavListBox* _tmp3_;
	GtkScrolledWindow* scrolled_category = NULL;
	GtkScrolledWindow* _tmp4_;
	GtkScrolledWindow* _tmp5_;
	GtkStyleContext* _tmp6_;
	GtkScrolledWindow* _tmp7_;
	GtkScrolledWindow* _tmp8_;
	SlingshotWidgetsCategoryViewNavListBox* _tmp9_;
	GtkSeparator* separator = NULL;
	GtkSeparator* _tmp10_;
	SlingshotWidgetsCategoryViewNavListBox* _tmp11_;
	SlingshotWidgetsCategoryViewNavListBox* _tmp12_;
	SlingshotWidgetsCategoryViewNavListBox* _tmp13_;
	SlingshotWidgetsCategoryViewNavListBox* _tmp14_;
	GtkScrolledWindow* listbox_scrolled = NULL;
	GtkScrolledWindow* _tmp15_;
	GtkScrolledWindow* _tmp16_;
	GtkScrolledWindow* _tmp17_;
	SlingshotWidgetsCategoryViewNavListBox* _tmp18_;
	GtkGrid* container = NULL;
	GtkGrid* _tmp19_;
	GtkGrid* _tmp20_;
	GtkGrid* _tmp21_;
	GtkScrolledWindow* _tmp22_;
	GtkGrid* _tmp23_;
	GtkSeparator* _tmp24_;
	GtkGrid* _tmp25_;
	GtkScrolledWindow* _tmp26_;
	GtkGrid* _tmp27_;
	SlingshotWidgetsCategoryViewNavListBox* _tmp28_;
	SlingshotWidgetsCategoryViewNavListBox* _tmp29_;
	SlingshotWidgetsCategoryViewNavListBox* _tmp30_;
	SlingshotWidgetsCategoryViewNavListBox* _tmp31_;
	SlingshotWidgetsCategoryViewNavListBox* _tmp32_;
	SlingshotWidgetsCategoryViewNavListBox* _tmp33_;
	SlingshotWidgetsCategoryViewNavListBox* _tmp34_;
	SlingshotWidgetsCategoryViewNavListBox* _tmp35_;
	GtkTargetEntry* _tmp36_;
	GtkTargetEntry* _tmp37_;
	gint _tmp37__length1;
	SlingshotWidgetsCategoryViewNavListBox* _tmp38_;
	SlingshotWidgetsCategoryViewNavListBox* _tmp39_;
	SlingshotWidgetsCategoryViewNavListBox* _tmp40_;
	SlingshotWidgetsCategoryViewNavListBox* _tmp41_;
	SlingshotWidgetsCategoryViewNavListBox* _tmp42_;
	GSettings* _tmp43_;
	GSettings* _tmp44_;
	GSettings* _tmp45_;
	parent_class = G_OBJECT_CLASS (slingshot_widgets_category_view_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SLINGSHOT_WIDGETS_TYPE_CATEGORY_VIEW, SlingshotWidgetsCategoryView);
	gtk_event_box_set_visible_window ((GtkEventBox*) self, FALSE);
	gtk_widget_set_hexpand ((GtkWidget*) self, TRUE);
	slingshot_widgets_category_view_define_css_styles (self);
	_tmp0_ = slingshot_widgets_category_view_nav_list_box_new ();
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->category_switcher);
	self->priv->category_switcher = _tmp0_;
	_tmp1_ = self->priv->category_switcher;
	gtk_list_box_set_selection_mode ((GtkListBox*) _tmp1_, GTK_SELECTION_BROWSE);
	_tmp2_ = self->priv->category_switcher;
	gtk_list_box_set_sort_func ((GtkListBox*) _tmp2_, (GtkListBoxSortFunc) slingshot_widgets_category_view_category_sort_func, NULL, NULL);
	_tmp3_ = self->priv->category_switcher;
	g_object_set ((GtkWidget*) _tmp3_, "width-request", 120, NULL);
	_tmp4_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
	g_object_ref_sink (_tmp4_);
	scrolled_category = _tmp4_;
	_tmp5_ = scrolled_category;
	_tmp6_ = gtk_widget_get_style_context ((GtkWidget*) _tmp5_);
	gtk_style_context_add_class (_tmp6_, GTK_STYLE_CLASS_SIDEBAR);
	_tmp7_ = scrolled_category;
	gtk_scrolled_window_set_policy (_tmp7_, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
	_tmp8_ = scrolled_category;
	_tmp9_ = self->priv->category_switcher;
	gtk_container_add ((GtkContainer*) _tmp8_, (GtkWidget*) _tmp9_);
	_tmp10_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_VERTICAL);
	g_object_ref_sink (_tmp10_);
	separator = _tmp10_;
	_tmp11_ = slingshot_widgets_category_view_nav_list_box_new ();
	g_object_ref_sink (_tmp11_);
	_g_object_unref0 (self->priv->listbox);
	self->priv->listbox = _tmp11_;
	_tmp12_ = self->priv->listbox;
	g_object_set ((GtkWidget*) _tmp12_, "expand", TRUE, NULL);
	_tmp13_ = self->priv->listbox;
	gtk_list_box_set_selection_mode ((GtkListBox*) _tmp13_, GTK_SELECTION_BROWSE);
	_tmp14_ = self->priv->listbox;
	gtk_list_box_set_filter_func ((GtkListBox*) _tmp14_, (GtkListBoxFilterFunc) slingshot_widgets_category_view_filter_function, g_object_ref (self), g_object_unref);
	_tmp15_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
	g_object_ref_sink (_tmp15_);
	listbox_scrolled = _tmp15_;
	_tmp16_ = listbox_scrolled;
	g_object_set (_tmp16_, "hscrollbar-policy", GTK_POLICY_NEVER, NULL);
	_tmp17_ = listbox_scrolled;
	_tmp18_ = self->priv->listbox;
	gtk_container_add ((GtkContainer*) _tmp17_, (GtkWidget*) _tmp18_);
	_tmp19_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp19_);
	container = _tmp19_;
	_tmp20_ = container;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp20_, TRUE);
	_tmp21_ = container;
	_tmp22_ = scrolled_category;
	gtk_container_add ((GtkContainer*) _tmp21_, (GtkWidget*) _tmp22_);
	_tmp23_ = container;
	_tmp24_ = separator;
	gtk_container_add ((GtkContainer*) _tmp23_, (GtkWidget*) _tmp24_);
	_tmp25_ = container;
	_tmp26_ = listbox_scrolled;
	gtk_container_add ((GtkContainer*) _tmp25_, (GtkWidget*) _tmp26_);
	_tmp27_ = container;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp27_);
	_tmp28_ = self->priv->category_switcher;
	g_signal_connect_object ((GtkListBox*) _tmp28_, "row-selected", (GCallback) __slingshot_widgets_category_view___lambda66__gtk_list_box_row_selected, self, 0);
	_tmp29_ = self->priv->category_switcher;
	g_signal_connect_object (_tmp29_, "search-focus-request", (GCallback) __slingshot_widgets_category_view___lambda67__slingshot_widgets_category_view_nav_list_box_search_focus_request, self, 0);
	_tmp30_ = self->priv->listbox;
	g_signal_connect_object ((GtkListBox*) _tmp30_, "row-activated", (GCallback) __slingshot_widgets_category_view___lambda68__gtk_list_box_row_activated, self, 0);
	_tmp31_ = self->priv->listbox;
	g_signal_connect_object ((GtkWidget*) _tmp31_, "button-press-event", (GCallback) __slingshot_widgets_category_view___lambda70__gtk_widget_button_press_event, self, 0);
	_tmp32_ = self->priv->listbox;
	g_signal_connect_object ((GtkWidget*) _tmp32_, "key-press-event", (GCallback) __slingshot_widgets_category_view___lambda71__gtk_widget_key_press_event, self, 0);
	_tmp33_ = self->priv->listbox;
	g_signal_connect_object ((GtkWidget*) _tmp33_, "key-press-event", (GCallback) _slingshot_widgets_category_view_on_key_press_gtk_widget_key_press_event, self, 0);
	_tmp34_ = self->priv->category_switcher;
	g_signal_connect_object ((GtkWidget*) _tmp34_, "key-press-event", (GCallback) _slingshot_widgets_category_view_on_key_press_gtk_widget_key_press_event, self, 0);
	_tmp35_ = self->priv->listbox;
	_tmp36_ = g_new0 (GtkTargetEntry, 1);
	_tmp36_[0] = SLINGSHOT_WIDGETS_CATEGORY_VIEW_DND;
	_tmp37_ = _tmp36_;
	_tmp37__length1 = 1;
	gtk_drag_source_set ((GtkWidget*) _tmp35_, GDK_BUTTON1_MASK, _tmp37_, (gint) 1, GDK_ACTION_COPY);
	_tmp37_ = (g_free (_tmp37_), NULL);
	_tmp38_ = self->priv->listbox;
	g_signal_connect_object ((GtkWidget*) _tmp38_, "motion-notify-event", (GCallback) __slingshot_widgets_category_view___lambda72__gtk_widget_motion_notify_event, self, 0);
	_tmp39_ = self->priv->listbox;
	g_signal_connect_object ((GtkWidget*) _tmp39_, "drag-begin", (GCallback) __slingshot_widgets_category_view___lambda73__gtk_widget_drag_begin, self, 0);
	_tmp40_ = self->priv->listbox;
	g_signal_connect_object ((GtkWidget*) _tmp40_, "drag-end", (GCallback) __slingshot_widgets_category_view___lambda74__gtk_widget_drag_end, self, 0);
	_tmp41_ = self->priv->listbox;
	g_signal_connect_object ((GtkWidget*) _tmp41_, "drag-data-get", (GCallback) __slingshot_widgets_category_view___lambda75__gtk_widget_drag_data_get, self, 0);
	_tmp42_ = self->priv->listbox;
	g_signal_connect_object (_tmp42_, "search-focus-request", (GCallback) __slingshot_widgets_category_view___lambda76__slingshot_widgets_category_view_nav_list_box_search_focus_request, self, 0);
	slingshot_widgets_category_view_setup_sidebar (self);
	_tmp43_ = slingshot_widgets_category_view_settings;
	self->priv->rollover_menus = g_settings_get_boolean (_tmp43_, "rollover-menu");
	_tmp44_ = slingshot_widgets_category_view_settings;
	g_signal_connect_object (_tmp44_, "changed::rollover-menu", (GCallback) __slingshot_widgets_category_view___lambda77__g_settings_changed, self, G_CONNECT_AFTER);
	_tmp45_ = slingshot_widgets_category_view_settings;
	g_signal_connect_object (_tmp45_, "changed::category-spacing", (GCallback) __slingshot_widgets_category_view___lambda78__g_settings_changed, self, 0);
	_g_object_unref0 (container);
	_g_object_unref0 (listbox_scrolled);
	_g_object_unref0 (separator);
	_g_object_unref0 (scrolled_category);
	return obj;
}

static void
slingshot_widgets_category_view_class_init (SlingshotWidgetsCategoryViewClass * klass,
                                            gpointer klass_data)
{
	GSettings* _tmp0_;
	slingshot_widgets_category_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SlingshotWidgetsCategoryView_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_slingshot_widgets_category_view_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_slingshot_widgets_category_view_set_property;
	G_OBJECT_CLASS (klass)->constructor = slingshot_widgets_category_view_constructor;
	G_OBJECT_CLASS (klass)->finalize = slingshot_widgets_category_view_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SLINGSHOT_WIDGETS_CATEGORY_VIEW_VIEW_PROPERTY, slingshot_widgets_category_view_properties[SLINGSHOT_WIDGETS_CATEGORY_VIEW_VIEW_PROPERTY] = g_param_spec_object ("view", "view", "view", SLINGSHOT_TYPE_SLINGSHOT_VIEW, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	slingshot_widgets_category_view_signals[SLINGSHOT_WIDGETS_CATEGORY_VIEW_SEARCH_FOCUS_REQUEST_SIGNAL] = g_signal_new ("search-focus-request", SLINGSHOT_WIDGETS_TYPE_CATEGORY_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");
	_g_object_unref0 (slingshot_widgets_category_view_settings);
	slingshot_widgets_category_view_settings = _tmp0_;
}

static void
slingshot_widgets_category_view_instance_init (SlingshotWidgetsCategoryView * self,
                                               gpointer klass)
{
	self->priv = slingshot_widgets_category_view_get_instance_private (self);
	self->priv->dragging = FALSE;
	self->priv->drag_uri = NULL;
	self->priv->rollover_menus = FALSE;
	self->priv->open_ctx_menu = NULL;
}

static void
slingshot_widgets_category_view_finalize (GObject * obj)
{
	SlingshotWidgetsCategoryView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SLINGSHOT_WIDGETS_TYPE_CATEGORY_VIEW, SlingshotWidgetsCategoryView);
	_g_object_unref0 (self->priv->_view);
	_g_free0 (self->priv->drag_uri);
	_g_object_unref0 (self->priv->category_switcher);
	_g_object_unref0 (self->priv->listbox);
	_g_object_unref0 (self->priv->open_ctx_menu);
	G_OBJECT_CLASS (slingshot_widgets_category_view_parent_class)->finalize (obj);
}

GType
slingshot_widgets_category_view_get_type (void)
{
	return slingshot_widgets_category_view_type_id;
}

GType
slingshot_widgets_category_view_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (SlingshotWidgetsCategoryViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) slingshot_widgets_category_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SlingshotWidgetsCategoryView), 0, (GInstanceInitFunc) slingshot_widgets_category_view_instance_init, NULL };
	slingshot_widgets_category_view_type_id = g_type_module_register_type (module, gtk_event_box_get_type (), "SlingshotWidgetsCategoryView", &g_define_type_info, 0);
	SlingshotWidgetsCategoryView_private_offset = sizeof (SlingshotWidgetsCategoryViewPrivate);
	return slingshot_widgets_category_view_type_id;
}

static void
_vala_slingshot_widgets_category_view_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec)
{
	SlingshotWidgetsCategoryView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SLINGSHOT_WIDGETS_TYPE_CATEGORY_VIEW, SlingshotWidgetsCategoryView);
	switch (property_id) {
		case SLINGSHOT_WIDGETS_CATEGORY_VIEW_VIEW_PROPERTY:
		g_value_set_object (value, slingshot_widgets_category_view_get_view (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_slingshot_widgets_category_view_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec)
{
	SlingshotWidgetsCategoryView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SLINGSHOT_WIDGETS_TYPE_CATEGORY_VIEW, SlingshotWidgetsCategoryView);
	switch (property_id) {
		case SLINGSHOT_WIDGETS_CATEGORY_VIEW_VIEW_PROPERTY:
		slingshot_widgets_category_view_set_view (self, g_value_get_object (value));
		break;
		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);
}

