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

/*
 * This file is part of budgie-desktop
 *
 * Copyright (C) 2015-2016 Ikey Doherty <ikey@solus-project.com>
 *
 * 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 2 of the License, or
 * (at your option) any later version.
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <gtk/gtk.h>
#include <float.h>
#include <math.h>
#include <BudgieToplevel.h>
#include <gdk/gdk.h>
#include <stdio.h>
#include <gdk/gdkx.h>
#include <cairo.h>
#include <gobject/gvaluecollector.h>


#define BUDGIE_TYPE_RAVEN_IFACE (budgie_raven_iface_get_type ())
#define BUDGIE_RAVEN_IFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUDGIE_TYPE_RAVEN_IFACE, BudgieRavenIface))
#define BUDGIE_RAVEN_IFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BUDGIE_TYPE_RAVEN_IFACE, BudgieRavenIfaceClass))
#define BUDGIE_IS_RAVEN_IFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUDGIE_TYPE_RAVEN_IFACE))
#define BUDGIE_IS_RAVEN_IFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BUDGIE_TYPE_RAVEN_IFACE))
#define BUDGIE_RAVEN_IFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BUDGIE_TYPE_RAVEN_IFACE, BudgieRavenIfaceClass))

typedef struct _BudgieRavenIface BudgieRavenIface;
typedef struct _BudgieRavenIfaceClass BudgieRavenIfaceClass;
typedef struct _BudgieRavenIfacePrivate BudgieRavenIfacePrivate;

#define BUDGIE_TYPE_RAVEN (budgie_raven_get_type ())
#define BUDGIE_RAVEN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUDGIE_TYPE_RAVEN, BudgieRaven))
#define BUDGIE_RAVEN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BUDGIE_TYPE_RAVEN, BudgieRavenClass))
#define BUDGIE_IS_RAVEN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUDGIE_TYPE_RAVEN))
#define BUDGIE_IS_RAVEN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BUDGIE_TYPE_RAVEN))
#define BUDGIE_RAVEN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BUDGIE_TYPE_RAVEN, BudgieRavenClass))

typedef struct _BudgieRaven BudgieRaven;
typedef struct _BudgieRavenClass BudgieRavenClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _BudgieParamSpecRavenIface BudgieParamSpecRavenIface;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _BudgieRavenPrivate BudgieRavenPrivate;

#define BUDGIE_TYPE_POWER_STRIP (budgie_power_strip_get_type ())
#define BUDGIE_POWER_STRIP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUDGIE_TYPE_POWER_STRIP, BudgiePowerStrip))
#define BUDGIE_POWER_STRIP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BUDGIE_TYPE_POWER_STRIP, BudgiePowerStripClass))
#define BUDGIE_IS_POWER_STRIP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUDGIE_TYPE_POWER_STRIP))
#define BUDGIE_IS_POWER_STRIP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BUDGIE_TYPE_POWER_STRIP))
#define BUDGIE_POWER_STRIP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BUDGIE_TYPE_POWER_STRIP, BudgiePowerStripClass))

typedef struct _BudgiePowerStrip BudgiePowerStrip;
typedef struct _BudgiePowerStripClass BudgiePowerStripClass;

#define BUDGIE_TYPE_MAIN_VIEW (budgie_main_view_get_type ())
#define BUDGIE_MAIN_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUDGIE_TYPE_MAIN_VIEW, BudgieMainView))
#define BUDGIE_MAIN_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BUDGIE_TYPE_MAIN_VIEW, BudgieMainViewClass))
#define BUDGIE_IS_MAIN_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUDGIE_TYPE_MAIN_VIEW))
#define BUDGIE_IS_MAIN_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BUDGIE_TYPE_MAIN_VIEW))
#define BUDGIE_MAIN_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BUDGIE_TYPE_MAIN_VIEW, BudgieMainViewClass))

typedef struct _BudgieMainView BudgieMainView;
typedef struct _BudgieMainViewClass BudgieMainViewClass;

#define BUDGIE_TYPE_SETTINGS_VIEW (budgie_settings_view_get_type ())
#define BUDGIE_SETTINGS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUDGIE_TYPE_SETTINGS_VIEW, BudgieSettingsView))
#define BUDGIE_SETTINGS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BUDGIE_TYPE_SETTINGS_VIEW, BudgieSettingsViewClass))
#define BUDGIE_IS_SETTINGS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUDGIE_TYPE_SETTINGS_VIEW))
#define BUDGIE_IS_SETTINGS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BUDGIE_TYPE_SETTINGS_VIEW))
#define BUDGIE_SETTINGS_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BUDGIE_TYPE_SETTINGS_VIEW, BudgieSettingsViewClass))

typedef struct _BudgieSettingsView BudgieSettingsView;
typedef struct _BudgieSettingsViewClass BudgieSettingsViewClass;
#define _budgie_raven_iface_unref0(var) ((var == NULL) ? NULL : (var = (budgie_raven_iface_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _cairo_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_destroy (var), NULL)))
#define _cairo_surface_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_surface_destroy (var), NULL)))

struct _BudgieRavenIface {
	GTypeInstance parent_instance;
	volatile int ref_count;
	BudgieRavenIfacePrivate * priv;
	guint notifications;
};

struct _BudgieRavenIfaceClass {
	GTypeClass parent_class;
	void (*finalize) (BudgieRavenIface *self);
};

struct _BudgieRavenIfacePrivate {
	BudgieRaven* parent;
};

struct _BudgieParamSpecRavenIface {
	GParamSpec parent_instance;
};

struct _BudgieRaven {
	GtkWindow parent_instance;
	BudgieRavenPrivate * priv;
};

struct _BudgieRavenClass {
	GtkWindowClass parent_class;
};

struct _BudgieRavenPrivate {
	gdouble intended_size;
	gint our_width;
	gint our_height;
	gint our_x;
	gint our_y;
	BudgieShadowBlock* shadow;
	BudgieRavenIface* iface;
	gboolean expanded;
	gboolean outside_win;
	GdkRectangle old_rect;
	gdouble scale;
	gint _required_size;
	BudgiePowerStrip* strip;
	BudgieToplevel* toplevel_top;
	BudgieToplevel* toplevel_bottom;
	BudgieMainView* main_view;
	BudgieSettingsView* settings_view;
	GtkStack* main_stack;
	guint n_count;
	BudgieDesktopManager* _manager;
};


static gpointer budgie_raven_iface_parent_class = NULL;
static gpointer budgie_raven_parent_class = NULL;
static BudgieRaven* budgie_raven__instance;
static BudgieRaven* budgie_raven__instance = NULL;

#define BUDGIE_RAVEN_DBUS_NAME "com.solus_project.budgie.Raven"
#define BUDGIE_RAVEN_DBUS_OBJECT_PATH "/com/solus_project/budgie/Raven"
gpointer budgie_raven_iface_ref (gpointer instance);
void budgie_raven_iface_unref (gpointer instance);
GParamSpec* budgie_param_spec_raven_iface (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void budgie_value_set_raven_iface (GValue* value, gpointer v_object);
void budgie_value_take_raven_iface (GValue* value, gpointer v_object);
gpointer budgie_value_get_raven_iface (const GValue* value);
GType budgie_raven_iface_get_type (void) G_GNUC_CONST;
guint budgie_raven_iface_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error);
GType budgie_raven_get_type (void) G_GNUC_CONST;
#define BUDGIE_RAVEN_IFACE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BUDGIE_TYPE_RAVEN_IFACE, BudgieRavenIfacePrivate))
enum  {
	BUDGIE_RAVEN_IFACE_DUMMY_PROPERTY
};
BudgieRavenIface* budgie_raven_iface_new (BudgieRaven* parent);
BudgieRavenIface* budgie_raven_iface_construct (GType object_type, BudgieRaven* parent);
gboolean budgie_raven_iface_GetExpanded (BudgieRavenIface* self);
gboolean budgie_raven_iface_get_is_expanded (BudgieRavenIface* self);
void budgie_raven_iface_SetExpanded (BudgieRavenIface* self, gboolean b);
void budgie_raven_iface_set_is_expanded (BudgieRavenIface* self, gboolean value);
void budgie_raven_iface_Toggle (BudgieRavenIface* self);
void budgie_raven_expose_main_view (BudgieRaven* self);
void budgie_raven_expose_notification (BudgieRaven* self);
void budgie_raven_iface_ToggleAppletView (BudgieRavenIface* self);
void budgie_raven_iface_ToggleNotificationsView (BudgieRavenIface* self);
void budgie_raven_iface_Dismiss (BudgieRavenIface* self);
guint budgie_raven_iface_GetNotificationCount (BudgieRavenIface* self);
gchar* budgie_raven_iface_get_version (BudgieRavenIface* self);
gboolean budgie_raven_get_expanded (BudgieRaven* self);
void budgie_raven_set_expanded (BudgieRaven* self, gboolean exp);
static void budgie_raven_iface_finalize (BudgieRavenIface* obj);
static void _dbus_budgie_raven_iface_GetExpanded (BudgieRavenIface* self, GVariant* _parameters_, GDBusMethodInvocation* invocation);
static void _dbus_budgie_raven_iface_SetExpanded (BudgieRavenIface* self, GVariant* _parameters_, GDBusMethodInvocation* invocation);
static void _dbus_budgie_raven_iface_Toggle (BudgieRavenIface* self, GVariant* _parameters_, GDBusMethodInvocation* invocation);
static void _dbus_budgie_raven_iface_ToggleAppletView (BudgieRavenIface* self, GVariant* _parameters_, GDBusMethodInvocation* invocation);
static void _dbus_budgie_raven_iface_ToggleNotificationsView (BudgieRavenIface* self, GVariant* _parameters_, GDBusMethodInvocation* invocation);
static void _dbus_budgie_raven_iface_Dismiss (BudgieRavenIface* self, GVariant* _parameters_, GDBusMethodInvocation* invocation);
static void _dbus_budgie_raven_iface_GetNotificationCount (BudgieRavenIface* self, GVariant* _parameters_, GDBusMethodInvocation* invocation);
static void _dbus_budgie_raven_iface_get_version (BudgieRavenIface* self, GVariant* _parameters_, GDBusMethodInvocation* invocation);
static void budgie_raven_iface_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data);
static GVariant* budgie_raven_iface_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data);
static GVariant* _dbus_budgie_raven_iface_get_is_expanded (BudgieRavenIface* self);
static gboolean budgie_raven_iface_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data);
static void _dbus_budgie_raven_iface_set_is_expanded (BudgieRavenIface* self, GVariant* _value);
static void _dbus_budgie_raven_iface_expansion_changed (GObject* _sender, gboolean expanded, gpointer* _data);
static void _dbus_budgie_raven_iface_notifications_changed (GObject* _sender, gpointer* _data);
static void _dbus_budgie_raven_iface_unread_notifications (GObject* _sender, gpointer* _data);
static void _dbus_budgie_raven_iface_read_notifications (GObject* _sender, gpointer* _data);
static void _budgie_raven_iface_unregister_object (gpointer user_data);
GType budgie_power_strip_get_type (void) G_GNUC_CONST;
GType budgie_main_view_get_type (void) G_GNUC_CONST;
GType budgie_settings_view_get_type (void) G_GNUC_CONST;
#define BUDGIE_RAVEN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BUDGIE_TYPE_RAVEN, BudgieRavenPrivate))
enum  {
	BUDGIE_RAVEN_DUMMY_PROPERTY,
	BUDGIE_RAVEN_REQUIRED_SIZE,
	BUDGIE_RAVEN_MANAGER,
	BUDGIE_RAVEN_NSCALE
};
void budgie_raven_ReadNotifications (BudgieRaven* self);
void budgie_raven_UnreadNotifications (BudgieRaven* self);
static void budgie_raven_on_bus_acquired (BudgieRaven* self, GDBusConnection* conn);
void budgie_main_view_set_clean (BudgieMainView* self);
void budgie_settings_view_set_clean (BudgieSettingsView* self);
void budgie_main_view_expose_notification (BudgieMainView* self);
BudgieRaven* budgie_raven_get_instance (void);
void budgie_raven_set_notification_count (BudgieRaven* self, guint count);
static gboolean budgie_raven_on_enter_notify (BudgieRaven* self);
static gboolean budgie_raven_on_focus_out (BudgieRaven* self);
static gboolean budgie_raven_on_leave_notify (BudgieRaven* self, GtkWidget* widget, GdkEventCrossing* evt);
static void budgie_raven_steal_focus (BudgieRaven* self);
BudgieRaven* budgie_raven_new (BudgieDesktopManager* manager);
BudgieRaven* budgie_raven_construct (GType object_type, BudgieDesktopManager* manager);
static void __lambda41_ (BudgieRaven* self);
void budgie_raven_update_geometry (BudgieRaven* self, GdkRectangle* rect, BudgieToplevel* top, BudgieToplevel* bottom);
static void ___lambda41__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static gboolean _budgie_raven_on_leave_notify_gtk_widget_leave_notify_event (GtkWidget* _sender, GdkEventCrossing* event, gpointer self);
static gboolean _budgie_raven_on_enter_notify_gtk_widget_enter_notify_event (GtkWidget* _sender, GdkEventCrossing* event, gpointer self);
static gboolean _budgie_raven_on_focus_out_gtk_widget_focus_out_event (GtkWidget* _sender, GdkEventFocus* event, gpointer self);
static gboolean __lambda42_ (BudgieRaven* self, GdkEventCrossing* e);
static gboolean ___lambda42__gtk_widget_enter_notify_event (GtkWidget* _sender, GdkEventCrossing* event, gpointer self);
BudgieMainView* budgie_main_view_new (void);
BudgieMainView* budgie_main_view_construct (GType object_type);
static void budgie_raven_on_view_switch (BudgieRaven* self, GtkWidget* widget);
static void _budgie_raven_on_view_switch_budgie_main_view_view_switch (BudgieMainView* _sender, gpointer self);
BudgieSettingsView* budgie_settings_view_new (BudgieDesktopManager* manager);
BudgieSettingsView* budgie_settings_view_construct (GType object_type, BudgieDesktopManager* manager);
static void _budgie_raven_on_view_switch_budgie_settings_view_view_switch (BudgieSettingsView* _sender, gpointer self);
BudgiePowerStrip* budgie_power_strip_new (BudgieRaven* raven);
BudgiePowerStrip* budgie_power_strip_construct (GType object_type, BudgieRaven* raven);
static void __lambda43_ (BudgieRaven* self);
static void ___lambda43__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void budgie_raven_real_size_allocate (GtkWidget* base, GtkAllocation* rect);
gint budgie_raven_get_required_size (BudgieRaven* self);
void budgie_raven_set_required_size (BudgieRaven* self, gint value);
void budgie_raven_setup_dbus (BudgieRaven* self);
static void _budgie_raven_on_bus_acquired_gbus_acquired_callback (GDBusConnection* connection, const gchar* name, gpointer self);
static void __lambda44_ (BudgieRaven* self);
static void ___lambda44__gbus_name_acquired_callback (GDBusConnection* connection, const gchar* name, gpointer self);
static void __lambda45_ (BudgieRaven* self);
static void ___lambda45__gbus_name_lost_callback (GDBusConnection* connection, const gchar* name, gpointer self);
static void budgie_raven_bind_panel_shadow (BudgieRaven* self, BudgieToplevel* toplevel);
static gboolean __lambda5_ (BudgieRaven* self, GBinding* b, GValue* v, GValue* v2);
static gboolean ___lambda5__gbinding_transform_func (GBinding* binding, GValue* source_value, GValue* target_value, gpointer self);
static void budgie_raven_unbind_panel_shadow (BudgieRaven* self, BudgieToplevel* top);
static void budgie_raven_real_get_preferred_height (GtkWidget* base, gint* m, gint* n);
static void budgie_raven_real_get_preferred_height_for_width (GtkWidget* base, gint w, gint* m, gint* n);
static gboolean budgie_raven_real_draw (GtkWidget* base, cairo_t* cr);
gdouble budgie_raven_get_nscale (BudgieRaven* self);
void budgie_raven_set_nscale (BudgieRaven* self, gdouble value);
static gdouble _budgie_sine_ease_in_out_budgie_tween_func (gdouble factor, gpointer self);
static void _vala_BudgiePropChange_array_free (BudgiePropChange* array, gint array_length);
static void __lambda6_ (BudgieRaven* self, BudgieAnimation* a);
static void ___lambda6__budgie_anim_completion_func (BudgieAnimation* src, gpointer self);
BudgieDesktopManager* budgie_raven_get_manager (BudgieRaven* self);
void budgie_raven_set_manager (BudgieRaven* self, BudgieDesktopManager* value);
static void budgie_raven_finalize (GObject* obj);
static void _vala_budgie_raven_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_budgie_raven_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);

static const GDBusArgInfo _budgie_raven_iface_dbus_arg_info_GetExpanded_result = {-1, "result", "b"};
static const GDBusArgInfo * const _budgie_raven_iface_dbus_arg_info_GetExpanded_in[] = {NULL};
static const GDBusArgInfo * const _budgie_raven_iface_dbus_arg_info_GetExpanded_out[] = {&_budgie_raven_iface_dbus_arg_info_GetExpanded_result, NULL};
static const GDBusMethodInfo _budgie_raven_iface_dbus_method_info_GetExpanded = {-1, "GetExpanded", (GDBusArgInfo **) (&_budgie_raven_iface_dbus_arg_info_GetExpanded_in), (GDBusArgInfo **) (&_budgie_raven_iface_dbus_arg_info_GetExpanded_out)};
static const GDBusArgInfo _budgie_raven_iface_dbus_arg_info_SetExpanded_b = {-1, "b", "b"};
static const GDBusArgInfo * const _budgie_raven_iface_dbus_arg_info_SetExpanded_in[] = {&_budgie_raven_iface_dbus_arg_info_SetExpanded_b, NULL};
static const GDBusArgInfo * const _budgie_raven_iface_dbus_arg_info_SetExpanded_out[] = {NULL};
static const GDBusMethodInfo _budgie_raven_iface_dbus_method_info_SetExpanded = {-1, "SetExpanded", (GDBusArgInfo **) (&_budgie_raven_iface_dbus_arg_info_SetExpanded_in), (GDBusArgInfo **) (&_budgie_raven_iface_dbus_arg_info_SetExpanded_out)};
static const GDBusArgInfo * const _budgie_raven_iface_dbus_arg_info_Toggle_in[] = {NULL};
static const GDBusArgInfo * const _budgie_raven_iface_dbus_arg_info_Toggle_out[] = {NULL};
static const GDBusMethodInfo _budgie_raven_iface_dbus_method_info_Toggle = {-1, "Toggle", (GDBusArgInfo **) (&_budgie_raven_iface_dbus_arg_info_Toggle_in), (GDBusArgInfo **) (&_budgie_raven_iface_dbus_arg_info_Toggle_out)};
static const GDBusArgInfo * const _budgie_raven_iface_dbus_arg_info_ToggleAppletView_in[] = {NULL};
static const GDBusArgInfo * const _budgie_raven_iface_dbus_arg_info_ToggleAppletView_out[] = {NULL};
static const GDBusMethodInfo _budgie_raven_iface_dbus_method_info_ToggleAppletView = {-1, "ToggleAppletView", (GDBusArgInfo **) (&_budgie_raven_iface_dbus_arg_info_ToggleAppletView_in), (GDBusArgInfo **) (&_budgie_raven_iface_dbus_arg_info_ToggleAppletView_out)};
static const GDBusArgInfo * const _budgie_raven_iface_dbus_arg_info_ToggleNotificationsView_in[] = {NULL};
static const GDBusArgInfo * const _budgie_raven_iface_dbus_arg_info_ToggleNotificationsView_out[] = {NULL};
static const GDBusMethodInfo _budgie_raven_iface_dbus_method_info_ToggleNotificationsView = {-1, "ToggleNotificationsView", (GDBusArgInfo **) (&_budgie_raven_iface_dbus_arg_info_ToggleNotificationsView_in), (GDBusArgInfo **) (&_budgie_raven_iface_dbus_arg_info_ToggleNotificationsView_out)};
static const GDBusArgInfo * const _budgie_raven_iface_dbus_arg_info_Dismiss_in[] = {NULL};
static const GDBusArgInfo * const _budgie_raven_iface_dbus_arg_info_Dismiss_out[] = {NULL};
static const GDBusMethodInfo _budgie_raven_iface_dbus_method_info_Dismiss = {-1, "Dismiss", (GDBusArgInfo **) (&_budgie_raven_iface_dbus_arg_info_Dismiss_in), (GDBusArgInfo **) (&_budgie_raven_iface_dbus_arg_info_Dismiss_out)};
static const GDBusArgInfo _budgie_raven_iface_dbus_arg_info_GetNotificationCount_result = {-1, "result", "u"};
static const GDBusArgInfo * const _budgie_raven_iface_dbus_arg_info_GetNotificationCount_in[] = {NULL};
static const GDBusArgInfo * const _budgie_raven_iface_dbus_arg_info_GetNotificationCount_out[] = {&_budgie_raven_iface_dbus_arg_info_GetNotificationCount_result, NULL};
static const GDBusMethodInfo _budgie_raven_iface_dbus_method_info_GetNotificationCount = {-1, "GetNotificationCount", (GDBusArgInfo **) (&_budgie_raven_iface_dbus_arg_info_GetNotificationCount_in), (GDBusArgInfo **) (&_budgie_raven_iface_dbus_arg_info_GetNotificationCount_out)};
static const GDBusArgInfo _budgie_raven_iface_dbus_arg_info_get_version_result = {-1, "result", "s"};
static const GDBusArgInfo * const _budgie_raven_iface_dbus_arg_info_get_version_in[] = {NULL};
static const GDBusArgInfo * const _budgie_raven_iface_dbus_arg_info_get_version_out[] = {&_budgie_raven_iface_dbus_arg_info_get_version_result, NULL};
static const GDBusMethodInfo _budgie_raven_iface_dbus_method_info_get_version = {-1, "GetVersion", (GDBusArgInfo **) (&_budgie_raven_iface_dbus_arg_info_get_version_in), (GDBusArgInfo **) (&_budgie_raven_iface_dbus_arg_info_get_version_out)};
static const GDBusMethodInfo * const _budgie_raven_iface_dbus_method_info[] = {&_budgie_raven_iface_dbus_method_info_GetExpanded, &_budgie_raven_iface_dbus_method_info_SetExpanded, &_budgie_raven_iface_dbus_method_info_Toggle, &_budgie_raven_iface_dbus_method_info_ToggleAppletView, &_budgie_raven_iface_dbus_method_info_ToggleNotificationsView, &_budgie_raven_iface_dbus_method_info_Dismiss, &_budgie_raven_iface_dbus_method_info_GetNotificationCount, &_budgie_raven_iface_dbus_method_info_get_version, NULL};
static const GDBusArgInfo _budgie_raven_iface_dbus_arg_info_expansion_changed_expanded = {-1, "expanded", "b"};
static const GDBusArgInfo * const _budgie_raven_iface_dbus_arg_info_expansion_changed[] = {&_budgie_raven_iface_dbus_arg_info_expansion_changed_expanded, NULL};
static const GDBusSignalInfo _budgie_raven_iface_dbus_signal_info_expansion_changed = {-1, "ExpansionChanged", (GDBusArgInfo **) (&_budgie_raven_iface_dbus_arg_info_expansion_changed)};
static const GDBusArgInfo * const _budgie_raven_iface_dbus_arg_info_notifications_changed[] = {NULL};
static const GDBusSignalInfo _budgie_raven_iface_dbus_signal_info_notifications_changed = {-1, "NotificationsChanged", (GDBusArgInfo **) (&_budgie_raven_iface_dbus_arg_info_notifications_changed)};
static const GDBusArgInfo * const _budgie_raven_iface_dbus_arg_info_unread_notifications[] = {NULL};
static const GDBusSignalInfo _budgie_raven_iface_dbus_signal_info_unread_notifications = {-1, "UnreadNotifications", (GDBusArgInfo **) (&_budgie_raven_iface_dbus_arg_info_unread_notifications)};
static const GDBusArgInfo * const _budgie_raven_iface_dbus_arg_info_read_notifications[] = {NULL};
static const GDBusSignalInfo _budgie_raven_iface_dbus_signal_info_read_notifications = {-1, "ReadNotifications", (GDBusArgInfo **) (&_budgie_raven_iface_dbus_arg_info_read_notifications)};
static const GDBusSignalInfo * const _budgie_raven_iface_dbus_signal_info[] = {&_budgie_raven_iface_dbus_signal_info_expansion_changed, &_budgie_raven_iface_dbus_signal_info_notifications_changed, &_budgie_raven_iface_dbus_signal_info_unread_notifications, &_budgie_raven_iface_dbus_signal_info_read_notifications, NULL};
static const GDBusPropertyInfo _budgie_raven_iface_dbus_property_info_is_expanded = {-1, "IsExpanded", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE};
static const GDBusPropertyInfo * const _budgie_raven_iface_dbus_property_info[] = {&_budgie_raven_iface_dbus_property_info_is_expanded, NULL};
static const GDBusInterfaceInfo _budgie_raven_iface_dbus_interface_info = {-1, "com.solus_project.budgie.Raven", (GDBusMethodInfo **) (&_budgie_raven_iface_dbus_method_info), (GDBusSignalInfo **) (&_budgie_raven_iface_dbus_signal_info), (GDBusPropertyInfo **) (&_budgie_raven_iface_dbus_property_info)};
static const GDBusInterfaceVTable _budgie_raven_iface_dbus_interface_vtable = {budgie_raven_iface_dbus_interface_method_call, budgie_raven_iface_dbus_interface_get_property, budgie_raven_iface_dbus_interface_set_property};

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


BudgieRavenIface* budgie_raven_iface_construct (GType object_type, BudgieRaven* parent) {
	BudgieRavenIface* self = NULL;
	BudgieRaven* _tmp0_ = NULL;
	BudgieRaven* _tmp1_ = NULL;
	self = (BudgieRavenIface*) g_type_create_instance (object_type);
	_tmp0_ = parent;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->parent);
	self->priv->parent = _tmp1_;
	return self;
}


BudgieRavenIface* budgie_raven_iface_new (BudgieRaven* parent) {
	return budgie_raven_iface_construct (BUDGIE_TYPE_RAVEN_IFACE, parent);
}


gboolean budgie_raven_iface_GetExpanded (BudgieRavenIface* self) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = budgie_raven_iface_get_is_expanded (self);
	_tmp1_ = _tmp0_;
	result = _tmp1_;
	return result;
}


void budgie_raven_iface_SetExpanded (BudgieRavenIface* self, gboolean b) {
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = b;
	budgie_raven_iface_set_is_expanded (self, _tmp0_);
}


void budgie_raven_iface_Toggle (BudgieRavenIface* self) {
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = budgie_raven_iface_get_is_expanded (self);
	_tmp1_ = _tmp0_;
	budgie_raven_iface_set_is_expanded (self, !_tmp1_);
	_tmp2_ = budgie_raven_iface_get_is_expanded (self);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		guint _tmp4_ = 0U;
		_tmp4_ = self->notifications;
		if (_tmp4_ == ((guint) 0)) {
			BudgieRaven* _tmp5_ = NULL;
			_tmp5_ = self->priv->parent;
			budgie_raven_expose_main_view (_tmp5_);
		} else {
			BudgieRaven* _tmp6_ = NULL;
			_tmp6_ = self->priv->parent;
			budgie_raven_expose_notification (_tmp6_);
			g_signal_emit_by_name (self, "read-notifications");
		}
	}
}


/**
     * Toggle Raven, opening only the "main" applet view
     */
void budgie_raven_iface_ToggleAppletView (BudgieRavenIface* self) {
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	BudgieRaven* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = budgie_raven_iface_get_is_expanded (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		gboolean _tmp2_ = FALSE;
		gboolean _tmp3_ = FALSE;
		_tmp2_ = budgie_raven_iface_get_is_expanded (self);
		_tmp3_ = _tmp2_;
		budgie_raven_iface_set_is_expanded (self, !_tmp3_);
		return;
	}
	_tmp4_ = self->priv->parent;
	budgie_raven_expose_main_view (_tmp4_);
	_tmp5_ = budgie_raven_iface_get_is_expanded (self);
	_tmp6_ = _tmp5_;
	budgie_raven_iface_set_is_expanded (self, !_tmp6_);
}


/**
     * Toggle Raven, opening only the "main" applet view
     */
void budgie_raven_iface_ToggleNotificationsView (BudgieRavenIface* self) {
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	BudgieRaven* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = budgie_raven_iface_get_is_expanded (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		gboolean _tmp2_ = FALSE;
		gboolean _tmp3_ = FALSE;
		_tmp2_ = budgie_raven_iface_get_is_expanded (self);
		_tmp3_ = _tmp2_;
		budgie_raven_iface_set_is_expanded (self, !_tmp3_);
		return;
	}
	_tmp4_ = self->priv->parent;
	budgie_raven_expose_notification (_tmp4_);
	_tmp5_ = budgie_raven_iface_get_is_expanded (self);
	_tmp6_ = _tmp5_;
	budgie_raven_iface_set_is_expanded (self, !_tmp6_);
}


void budgie_raven_iface_Dismiss (BudgieRavenIface* self) {
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = budgie_raven_iface_get_is_expanded (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		gboolean _tmp2_ = FALSE;
		gboolean _tmp3_ = FALSE;
		_tmp2_ = budgie_raven_iface_get_is_expanded (self);
		_tmp3_ = _tmp2_;
		budgie_raven_iface_set_is_expanded (self, !_tmp3_);
	}
}


guint budgie_raven_iface_GetNotificationCount (BudgieRavenIface* self) {
	guint result = 0U;
	guint _tmp0_ = 0U;
	g_return_val_if_fail (self != NULL, 0U);
	_tmp0_ = self->notifications;
	result = _tmp0_;
	return result;
}


gchar* budgie_raven_iface_get_version (BudgieRavenIface* self) {
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup ("1");
	result = _tmp0_;
	return result;
}


gboolean budgie_raven_iface_get_is_expanded (BudgieRavenIface* self) {
	gboolean result;
	BudgieRaven* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->parent;
	_tmp1_ = budgie_raven_get_expanded (_tmp0_);
	result = _tmp1_;
	return result;
}


void budgie_raven_iface_set_is_expanded (BudgieRavenIface* self, gboolean value) {
	BudgieRaven* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->parent;
	_tmp1_ = value;
	budgie_raven_set_expanded (_tmp0_, _tmp1_);
}


static void budgie_value_raven_iface_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void budgie_value_raven_iface_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		budgie_raven_iface_unref (value->data[0].v_pointer);
	}
}


static void budgie_value_raven_iface_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = budgie_raven_iface_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer budgie_value_raven_iface_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* budgie_value_raven_iface_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		BudgieRavenIface* object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = budgie_raven_iface_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* budgie_value_raven_iface_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	BudgieRavenIface** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = budgie_raven_iface_ref (value->data[0].v_pointer);
	}
	return NULL;
}


GParamSpec* budgie_param_spec_raven_iface (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	BudgieParamSpecRavenIface* spec;
	g_return_val_if_fail (g_type_is_a (object_type, BUDGIE_TYPE_RAVEN_IFACE), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


gpointer budgie_value_get_raven_iface (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, BUDGIE_TYPE_RAVEN_IFACE), NULL);
	return value->data[0].v_pointer;
}


void budgie_value_set_raven_iface (GValue* value, gpointer v_object) {
	BudgieRavenIface* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, BUDGIE_TYPE_RAVEN_IFACE));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, BUDGIE_TYPE_RAVEN_IFACE));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		budgie_raven_iface_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		budgie_raven_iface_unref (old);
	}
}


void budgie_value_take_raven_iface (GValue* value, gpointer v_object) {
	BudgieRavenIface* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, BUDGIE_TYPE_RAVEN_IFACE));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, BUDGIE_TYPE_RAVEN_IFACE));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		budgie_raven_iface_unref (old);
	}
}


static void budgie_raven_iface_class_init (BudgieRavenIfaceClass * klass) {
	budgie_raven_iface_parent_class = g_type_class_peek_parent (klass);
	((BudgieRavenIfaceClass *) klass)->finalize = budgie_raven_iface_finalize;
	g_type_class_add_private (klass, sizeof (BudgieRavenIfacePrivate));
	g_signal_new ("expansion_changed", BUDGIE_TYPE_RAVEN_IFACE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
	g_signal_new ("notifications_changed", BUDGIE_TYPE_RAVEN_IFACE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	g_signal_new ("unread_notifications", BUDGIE_TYPE_RAVEN_IFACE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	g_signal_new ("read_notifications", BUDGIE_TYPE_RAVEN_IFACE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}


static void budgie_raven_iface_instance_init (BudgieRavenIface * self) {
	self->priv = BUDGIE_RAVEN_IFACE_GET_PRIVATE (self);
	self->priv->parent = NULL;
	self->notifications = (guint) 0;
	self->ref_count = 1;
}


static void budgie_raven_iface_finalize (BudgieRavenIface* obj) {
	BudgieRavenIface * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BUDGIE_TYPE_RAVEN_IFACE, BudgieRavenIface);
	g_signal_handlers_destroy (self);
	_g_object_unref0 (self->priv->parent);
}


GType budgie_raven_iface_get_type (void) {
	static volatile gsize budgie_raven_iface_type_id__volatile = 0;
	if (g_once_init_enter (&budgie_raven_iface_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { budgie_value_raven_iface_init, budgie_value_raven_iface_free_value, budgie_value_raven_iface_copy_value, budgie_value_raven_iface_peek_pointer, "p", budgie_value_raven_iface_collect_value, "p", budgie_value_raven_iface_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (BudgieRavenIfaceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) budgie_raven_iface_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BudgieRavenIface), 0, (GInstanceInitFunc) budgie_raven_iface_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType budgie_raven_iface_type_id;
		budgie_raven_iface_type_id = g_type_register_fundamental (g_type_fundamental_next (), "BudgieRavenIface", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_type_set_qdata (budgie_raven_iface_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) budgie_raven_iface_register_object);
		g_once_init_leave (&budgie_raven_iface_type_id__volatile, budgie_raven_iface_type_id);
	}
	return budgie_raven_iface_type_id__volatile;
}


gpointer budgie_raven_iface_ref (gpointer instance) {
	BudgieRavenIface* self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


void budgie_raven_iface_unref (gpointer instance) {
	BudgieRavenIface* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		BUDGIE_RAVEN_IFACE_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


static void _dbus_budgie_raven_iface_GetExpanded (BudgieRavenIface* self, GVariant* _parameters_, GDBusMethodInvocation* invocation) {
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gboolean result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	result = budgie_raven_iface_GetExpanded (self);
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_boolean (result));
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void _dbus_budgie_raven_iface_SetExpanded (BudgieRavenIface* self, GVariant* _parameters_, GDBusMethodInvocation* invocation) {
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gboolean b = FALSE;
	GVariant* _tmp0_;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp0_ = g_variant_iter_next_value (&_arguments_iter);
	b = g_variant_get_boolean (_tmp0_);
	g_variant_unref (_tmp0_);
	budgie_raven_iface_SetExpanded (self, b);
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void _dbus_budgie_raven_iface_Toggle (BudgieRavenIface* self, GVariant* _parameters_, GDBusMethodInvocation* invocation) {
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	budgie_raven_iface_Toggle (self);
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void _dbus_budgie_raven_iface_ToggleAppletView (BudgieRavenIface* self, GVariant* _parameters_, GDBusMethodInvocation* invocation) {
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	budgie_raven_iface_ToggleAppletView (self);
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void _dbus_budgie_raven_iface_ToggleNotificationsView (BudgieRavenIface* self, GVariant* _parameters_, GDBusMethodInvocation* invocation) {
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	budgie_raven_iface_ToggleNotificationsView (self);
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void _dbus_budgie_raven_iface_Dismiss (BudgieRavenIface* self, GVariant* _parameters_, GDBusMethodInvocation* invocation) {
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	budgie_raven_iface_Dismiss (self);
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void _dbus_budgie_raven_iface_GetNotificationCount (BudgieRavenIface* self, GVariant* _parameters_, GDBusMethodInvocation* invocation) {
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	guint result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	result = budgie_raven_iface_GetNotificationCount (self);
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_uint32 (result));
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void _dbus_budgie_raven_iface_get_version (BudgieRavenIface* self, GVariant* _parameters_, GDBusMethodInvocation* invocation) {
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gchar* result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	result = budgie_raven_iface_get_version (self);
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_string (result));
	_g_free0 (result);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void budgie_raven_iface_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data) {
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (method_name, "GetExpanded") == 0) {
		_dbus_budgie_raven_iface_GetExpanded (object, parameters, invocation);
	} else if (strcmp (method_name, "SetExpanded") == 0) {
		_dbus_budgie_raven_iface_SetExpanded (object, parameters, invocation);
	} else if (strcmp (method_name, "Toggle") == 0) {
		_dbus_budgie_raven_iface_Toggle (object, parameters, invocation);
	} else if (strcmp (method_name, "ToggleAppletView") == 0) {
		_dbus_budgie_raven_iface_ToggleAppletView (object, parameters, invocation);
	} else if (strcmp (method_name, "ToggleNotificationsView") == 0) {
		_dbus_budgie_raven_iface_ToggleNotificationsView (object, parameters, invocation);
	} else if (strcmp (method_name, "Dismiss") == 0) {
		_dbus_budgie_raven_iface_Dismiss (object, parameters, invocation);
	} else if (strcmp (method_name, "GetNotificationCount") == 0) {
		_dbus_budgie_raven_iface_GetNotificationCount (object, parameters, invocation);
	} else if (strcmp (method_name, "GetVersion") == 0) {
		_dbus_budgie_raven_iface_get_version (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}


static GVariant* _dbus_budgie_raven_iface_get_is_expanded (BudgieRavenIface* self) {
	gboolean result;
	GVariant* _reply;
	result = budgie_raven_iface_get_is_expanded (self);
	_reply = g_variant_new_boolean (result);
	return _reply;
}


static GVariant* budgie_raven_iface_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data) {
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (property_name, "IsExpanded") == 0) {
		return _dbus_budgie_raven_iface_get_is_expanded (object);
	}
	return NULL;
}


static void _dbus_budgie_raven_iface_set_is_expanded (BudgieRavenIface* self, GVariant* _value) {
	gboolean value = FALSE;
	value = g_variant_get_boolean (_value);
	budgie_raven_iface_set_is_expanded (self, value);
}


static gboolean budgie_raven_iface_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data) {
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (property_name, "IsExpanded") == 0) {
		_dbus_budgie_raven_iface_set_is_expanded (object, value);
		return TRUE;
	}
	return FALSE;
}


static void _dbus_budgie_raven_iface_expansion_changed (GObject* _sender, gboolean expanded, gpointer* _data) {
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (expanded));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "com.solus_project.budgie.Raven", "ExpansionChanged", _arguments, NULL);
}


static void _dbus_budgie_raven_iface_notifications_changed (GObject* _sender, gpointer* _data) {
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "com.solus_project.budgie.Raven", "NotificationsChanged", _arguments, NULL);
}


static void _dbus_budgie_raven_iface_unread_notifications (GObject* _sender, gpointer* _data) {
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "com.solus_project.budgie.Raven", "UnreadNotifications", _arguments, NULL);
}


static void _dbus_budgie_raven_iface_read_notifications (GObject* _sender, gpointer* _data) {
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "com.solus_project.budgie.Raven", "ReadNotifications", _arguments, NULL);
}


guint budgie_raven_iface_register_object (gpointer object, GDBusConnection* connection, const gchar* path, GError** error) {
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = budgie_raven_iface_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_budgie_raven_iface_dbus_interface_info), &_budgie_raven_iface_dbus_interface_vtable, data, _budgie_raven_iface_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "expansion-changed", (GCallback) _dbus_budgie_raven_iface_expansion_changed, data);
	g_signal_connect (object, "notifications-changed", (GCallback) _dbus_budgie_raven_iface_notifications_changed, data);
	g_signal_connect (object, "unread-notifications", (GCallback) _dbus_budgie_raven_iface_unread_notifications, data);
	g_signal_connect (object, "read-notifications", (GCallback) _dbus_budgie_raven_iface_read_notifications, data);
	return result;
}


static void _budgie_raven_iface_unregister_object (gpointer user_data) {
	gpointer* data;
	data = user_data;
	g_signal_handlers_disconnect_by_func (data[0], _dbus_budgie_raven_iface_expansion_changed, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_budgie_raven_iface_notifications_changed, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_budgie_raven_iface_unread_notifications, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_budgie_raven_iface_read_notifications, data);
	budgie_raven_iface_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}


void budgie_raven_ReadNotifications (BudgieRaven* self) {
	BudgieRavenIface* _tmp0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->iface;
	if (_tmp0_ != NULL) {
		BudgieRavenIface* _tmp1_ = NULL;
		_tmp1_ = self->priv->iface;
		g_signal_emit_by_name (_tmp1_, "read-notifications");
	}
}


void budgie_raven_UnreadNotifications (BudgieRaven* self) {
	BudgieRavenIface* _tmp0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->iface;
	if (_tmp0_ != NULL) {
		BudgieRavenIface* _tmp1_ = NULL;
		_tmp1_ = self->priv->iface;
		g_signal_emit_by_name (_tmp1_, "unread-notifications");
	}
}


static void budgie_raven_on_bus_acquired (BudgieRaven* self, GDBusConnection* conn) {
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (conn != NULL);
	{
		BudgieRavenIface* _tmp0_ = NULL;
		GDBusConnection* _tmp1_ = NULL;
		BudgieRavenIface* _tmp2_ = NULL;
		_tmp0_ = budgie_raven_iface_new (self);
		_budgie_raven_iface_unref0 (self->priv->iface);
		self->priv->iface = _tmp0_;
		_tmp1_ = conn;
		_tmp2_ = self->priv->iface;
		budgie_raven_iface_register_object (_tmp2_, _tmp1_, BUDGIE_RAVEN_DBUS_OBJECT_PATH, &_inner_error_);
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		FILE* _tmp3_ = NULL;
		const gchar* _tmp4_ = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp3_ = stderr;
		_tmp4_ = e->message;
		fprintf (_tmp3_, "Error registering Raven: %s\n", _tmp4_);
		exit (1);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


void budgie_raven_expose_main_view (BudgieRaven* self) {
	GtkStack* _tmp0_ = NULL;
	BudgieMainView* _tmp1_ = NULL;
	BudgieSettingsView* _tmp2_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->main_stack;
	gtk_stack_set_visible_child_name (_tmp0_, "main");
	_tmp1_ = self->priv->main_view;
	budgie_main_view_set_clean (_tmp1_);
	_tmp2_ = self->priv->settings_view;
	budgie_settings_view_set_clean (_tmp2_);
}


void budgie_raven_expose_notification (BudgieRaven* self) {
	GtkStack* _tmp0_ = NULL;
	BudgieMainView* _tmp1_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->main_stack;
	gtk_stack_set_visible_child_name (_tmp0_, "main");
	_tmp1_ = self->priv->main_view;
	budgie_main_view_expose_notification (_tmp1_);
}


BudgieRaven* budgie_raven_get_instance (void) {
	BudgieRaven* result = NULL;
	BudgieRaven* _tmp0_ = NULL;
	_tmp0_ = budgie_raven__instance;
	result = _tmp0_;
	return result;
}


void budgie_raven_set_notification_count (BudgieRaven* self, guint count) {
	guint _tmp0_ = 0U;
	guint _tmp1_ = 0U;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->n_count;
	_tmp1_ = count;
	if (_tmp0_ != _tmp1_) {
		guint _tmp2_ = 0U;
		BudgieRavenIface* _tmp3_ = NULL;
		guint _tmp4_ = 0U;
		BudgieRavenIface* _tmp5_ = NULL;
		_tmp2_ = count;
		self->priv->n_count = _tmp2_;
		_tmp3_ = self->priv->iface;
		_tmp4_ = count;
		_tmp3_->notifications = _tmp4_;
		_tmp5_ = self->priv->iface;
		g_signal_emit_by_name (_tmp5_, "notifications-changed");
	}
}


static gboolean budgie_raven_on_enter_notify (BudgieRaven* self) {
	gboolean result = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	self->priv->outside_win = FALSE;
	result = GDK_EVENT_PROPAGATE;
	return result;
}


static gboolean budgie_raven_on_focus_out (BudgieRaven* self) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = self->priv->outside_win;
	if (_tmp1_) {
		gboolean _tmp2_ = FALSE;
		_tmp2_ = self->priv->expanded;
		_tmp0_ = _tmp2_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		budgie_raven_set_expanded (self, FALSE);
	}
	result = GDK_EVENT_PROPAGATE;
	return result;
}


static gboolean budgie_raven_on_leave_notify (BudgieRaven* self, GtkWidget* widget, GdkEventCrossing* evt) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	GdkEventCrossing* _tmp3_ = NULL;
	gdouble _tmp4_ = 0.0;
	gint _tmp5_ = 0;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp3_ = evt;
	_tmp4_ = _tmp3_->x_root;
	_tmp5_ = self->priv->our_x;
	if (_tmp4_ < ((gdouble) _tmp5_)) {
		_tmp2_ = TRUE;
	} else {
		GdkEventCrossing* _tmp6_ = NULL;
		gdouble _tmp7_ = 0.0;
		gint _tmp8_ = 0;
		gint _tmp9_ = 0;
		_tmp6_ = evt;
		_tmp7_ = _tmp6_->x_root;
		_tmp8_ = self->priv->our_x;
		_tmp9_ = self->priv->our_width;
		_tmp2_ = _tmp7_ > ((gdouble) (_tmp8_ + _tmp9_));
	}
	if (_tmp2_) {
		_tmp1_ = TRUE;
	} else {
		GdkEventCrossing* _tmp10_ = NULL;
		gdouble _tmp11_ = 0.0;
		gint _tmp12_ = 0;
		_tmp10_ = evt;
		_tmp11_ = _tmp10_->y_root;
		_tmp12_ = self->priv->our_y;
		_tmp1_ = _tmp11_ < ((gdouble) _tmp12_);
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		GdkEventCrossing* _tmp13_ = NULL;
		gdouble _tmp14_ = 0.0;
		gint _tmp15_ = 0;
		gint _tmp16_ = 0;
		_tmp13_ = evt;
		_tmp14_ = _tmp13_->y_root;
		_tmp15_ = self->priv->our_y;
		_tmp16_ = self->priv->our_height;
		_tmp0_ = _tmp14_ > ((gdouble) (_tmp15_ + _tmp16_));
	}
	if (_tmp0_) {
		self->priv->outside_win = TRUE;
	} else {
		self->priv->outside_win = FALSE;
	}
	result = GDK_EVENT_PROPAGATE;
	return result;
}


static void budgie_raven_steal_focus (BudgieRaven* self) {
	GdkWindow* window = NULL;
	GdkWindow* _tmp0_ = NULL;
	GdkWindow* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_widget_get_window ((GtkWidget*) self);
	window = _tmp0_;
	_tmp1_ = window;
	if (_tmp1_ == NULL) {
		return;
	}
	g_object_get ((GtkWindow*) self, "has-toplevel-focus", &_tmp2_, NULL);
	_tmp3_ = _tmp2_;
	if (!_tmp3_) {
		GdkDisplay* display = NULL;
		GdkScreen* _tmp4_ = NULL;
		GdkScreen* _tmp5_ = NULL;
		GdkDisplay* _tmp6_ = NULL;
		GdkDisplay* _tmp7_ = NULL;
		GdkDisplay* _tmp8_ = NULL;
		_tmp4_ = gtk_window_get_screen ((GtkWindow*) self);
		_tmp5_ = _tmp4_;
		_tmp6_ = gdk_screen_get_display (_tmp5_);
		_tmp7_ = _g_object_ref0 (_tmp6_);
		display = _tmp7_;
		_tmp8_ = display;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, GDK_TYPE_X11_DISPLAY)) {
			GdkWindow* _tmp9_ = NULL;
			GdkDisplay* _tmp10_ = NULL;
			guint32 _tmp11_ = 0U;
			_tmp9_ = window;
			_tmp10_ = display;
			_tmp11_ = gdk_x11_display_get_user_time (_tmp10_);
			gdk_window_focus (_tmp9_, _tmp11_);
		} else {
			GdkWindow* _tmp12_ = NULL;
			guint32 _tmp13_ = 0U;
			_tmp12_ = window;
			_tmp13_ = gtk_get_current_event_time ();
			gdk_window_focus (_tmp12_, _tmp13_);
		}
		_g_object_unref0 (display);
	}
}


static void __lambda41_ (BudgieRaven* self) {
	GdkRectangle _tmp0_ = {0};
	BudgieToplevel* _tmp1_ = NULL;
	BudgieToplevel* _tmp2_ = NULL;
	_tmp0_ = self->priv->old_rect;
	_tmp1_ = self->priv->toplevel_top;
	_tmp2_ = self->priv->toplevel_bottom;
	budgie_raven_update_geometry (self, &_tmp0_, _tmp1_, _tmp2_);
	gtk_widget_queue_resize ((GtkWidget*) self);
}


static void ___lambda41__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda41_ ((BudgieRaven*) self);
}


static gboolean _budgie_raven_on_leave_notify_gtk_widget_leave_notify_event (GtkWidget* _sender, GdkEventCrossing* event, gpointer self) {
	gboolean result;
	result = budgie_raven_on_leave_notify ((BudgieRaven*) self, _sender, event);
	return result;
}


static gboolean _budgie_raven_on_enter_notify_gtk_widget_enter_notify_event (GtkWidget* _sender, GdkEventCrossing* event, gpointer self) {
	gboolean result;
	result = budgie_raven_on_enter_notify ((BudgieRaven*) self);
	return result;
}


static gboolean _budgie_raven_on_focus_out_gtk_widget_focus_out_event (GtkWidget* _sender, GdkEventFocus* event, gpointer self) {
	gboolean result;
	result = budgie_raven_on_focus_out ((BudgieRaven*) self);
	return result;
}


static gboolean __lambda42_ (BudgieRaven* self, GdkEventCrossing* e) {
	gboolean result = FALSE;
	g_return_val_if_fail (e != NULL, FALSE);
	budgie_raven_steal_focus (self);
	result = GDK_EVENT_PROPAGATE;
	return result;
}


static gboolean ___lambda42__gtk_widget_enter_notify_event (GtkWidget* _sender, GdkEventCrossing* event, gpointer self) {
	gboolean result;
	result = __lambda42_ ((BudgieRaven*) self, event);
	return result;
}


static void _budgie_raven_on_view_switch_budgie_main_view_view_switch (BudgieMainView* _sender, gpointer self) {
	budgie_raven_on_view_switch ((BudgieRaven*) self, _sender);
}


static void _budgie_raven_on_view_switch_budgie_settings_view_view_switch (BudgieSettingsView* _sender, gpointer self) {
	budgie_raven_on_view_switch ((BudgieRaven*) self, _sender);
}


static void __lambda43_ (BudgieRaven* self) {
	gboolean _tmp0_ = FALSE;
	_tmp0_ = gtk_widget_get_visible ((GtkWidget*) self);
	if (!_tmp0_) {
		BudgieToplevel* _tmp1_ = NULL;
		BudgieToplevel* _tmp3_ = NULL;
		_tmp1_ = self->priv->toplevel_top;
		if (_tmp1_ != NULL) {
			BudgieToplevel* _tmp2_ = NULL;
			_tmp2_ = self->priv->toplevel_top;
			budgie_toplevel_reset_shadow (_tmp2_);
		}
		_tmp3_ = self->priv->toplevel_bottom;
		if (_tmp3_ != NULL) {
			BudgieToplevel* _tmp4_ = NULL;
			_tmp4_ = self->priv->toplevel_bottom;
			budgie_toplevel_reset_shadow (_tmp4_);
		}
	}
}


static void ___lambda43__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda43_ ((BudgieRaven*) self);
}


BudgieRaven* budgie_raven_construct (GType object_type, BudgieDesktopManager* manager) {
	BudgieRaven * self = NULL;
	BudgieDesktopManager* _tmp0_ = NULL;
	GtkStyleContext* _tmp1_ = NULL;
	BudgieRaven* _tmp2_ = NULL;
	GdkVisual* vis = NULL;
	GdkScreen* _tmp3_ = NULL;
	GdkScreen* _tmp4_ = NULL;
	GdkVisual* _tmp5_ = NULL;
	GdkVisual* _tmp6_ = NULL;
	GdkVisual* _tmp7_ = NULL;
	GtkBox* layout = NULL;
	GtkBox* _tmp9_ = NULL;
	GtkBox* _tmp10_ = NULL;
	BudgieShadowBlock* _tmp11_ = NULL;
	GtkBox* _tmp12_ = NULL;
	BudgieShadowBlock* _tmp13_ = NULL;
	GtkStyleContext* _tmp14_ = NULL;
	gchar* _tmp15_ = NULL;
	gchar* _tmp16_ = NULL;
	GtkFrame* frame = NULL;
	GtkFrame* _tmp17_ = NULL;
	GtkFrame* _tmp18_ = NULL;
	GtkStyleContext* _tmp19_ = NULL;
	GtkBox* _tmp20_ = NULL;
	GtkFrame* _tmp21_ = NULL;
	GtkBox* main_box = NULL;
	GtkBox* _tmp22_ = NULL;
	GtkBox* _tmp23_ = NULL;
	GtkStyleContext* _tmp24_ = NULL;
	GtkFrame* _tmp25_ = NULL;
	GtkBox* _tmp26_ = NULL;
	GtkStack* _tmp27_ = NULL;
	GtkStack* _tmp28_ = NULL;
	GtkBox* _tmp29_ = NULL;
	GtkStack* _tmp30_ = NULL;
	BudgieMainView* _tmp31_ = NULL;
	BudgieMainView* _tmp32_ = NULL;
	GtkStack* _tmp33_ = NULL;
	BudgieMainView* _tmp34_ = NULL;
	BudgieDesktopManager* _tmp35_ = NULL;
	BudgieSettingsView* _tmp36_ = NULL;
	BudgieSettingsView* _tmp37_ = NULL;
	GtkStack* _tmp38_ = NULL;
	BudgieSettingsView* _tmp39_ = NULL;
	BudgiePowerStrip* _tmp40_ = NULL;
	GtkBox* _tmp41_ = NULL;
	BudgiePowerStrip* _tmp42_ = NULL;
	gboolean _tmp43_ = FALSE;
	GtkWidget* _tmp44_ = NULL;
	_tmp0_ = manager;
	self = (BudgieRaven*) g_object_new (object_type, "type-hint", GDK_WINDOW_TYPE_HINT_DOCK, "manager", _tmp0_, NULL);
	_tmp1_ = gtk_widget_get_style_context ((GtkWidget*) self);
	gtk_style_context_add_class (_tmp1_, "budgie-container");
	_tmp2_ = _g_object_ref0 (self);
	_g_object_unref0 (budgie_raven__instance);
	budgie_raven__instance = _tmp2_;
	_tmp3_ = gtk_window_get_screen ((GtkWindow*) self);
	_tmp4_ = _tmp3_;
	_tmp5_ = gdk_screen_get_rgba_visual (_tmp4_);
	_tmp6_ = _g_object_ref0 (_tmp5_);
	vis = _tmp6_;
	_tmp7_ = vis;
	if (_tmp7_ == NULL) {
		g_warning ("raven.vala:264: No RGBA functionality");
	} else {
		GdkVisual* _tmp8_ = NULL;
		_tmp8_ = vis;
		gtk_widget_set_visual ((GtkWidget*) self, _tmp8_);
	}
	g_signal_connect_object ((GObject*) self, "notify::scale-factor", (GCallback) ___lambda41__g_object_notify, self, 0);
	g_signal_connect_object ((GtkWidget*) self, "leave-notify-event", (GCallback) _budgie_raven_on_leave_notify_gtk_widget_leave_notify_event, self, 0);
	g_signal_connect_object ((GtkWidget*) self, "enter-notify-event", (GCallback) _budgie_raven_on_enter_notify_gtk_widget_enter_notify_event, self, 0);
	g_signal_connect_object ((GtkWidget*) self, "focus-out-event", (GCallback) _budgie_raven_on_focus_out_gtk_widget_focus_out_event, self, 0);
	_tmp9_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp9_);
	layout = _tmp9_;
	_tmp10_ = layout;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp10_);
	g_signal_connect_object ((GtkWidget*) self, "enter-notify-event", (GCallback) ___lambda42__gtk_widget_enter_notify_event, self, 0);
	_tmp11_ = budgie_shadow_block_new (BUDGIE_PANEL_POSITION_RIGHT);
	g_object_ref_sink (_tmp11_);
	_g_object_unref0 (self->priv->shadow);
	self->priv->shadow = _tmp11_;
	_tmp12_ = layout;
	_tmp13_ = self->priv->shadow;
	gtk_box_pack_start (_tmp12_, (GtkWidget*) _tmp13_, FALSE, FALSE, (guint) 0);
	_tmp14_ = gtk_widget_get_style_context ((GtkWidget*) self);
	_tmp15_ = budgie_position_class_name (BUDGIE_PANEL_POSITION_RIGHT);
	_tmp16_ = _tmp15_;
	gtk_style_context_add_class (_tmp14_, _tmp16_);
	_g_free0 (_tmp16_);
	_tmp17_ = (GtkFrame*) gtk_frame_new (NULL);
	g_object_ref_sink (_tmp17_);
	frame = _tmp17_;
	_tmp18_ = frame;
	_tmp19_ = gtk_widget_get_style_context ((GtkWidget*) _tmp18_);
	gtk_style_context_add_class (_tmp19_, "raven-frame");
	_tmp20_ = layout;
	_tmp21_ = frame;
	gtk_box_pack_start (_tmp20_, (GtkWidget*) _tmp21_, TRUE, TRUE, (guint) 0);
	_tmp22_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp22_);
	main_box = _tmp22_;
	_tmp23_ = main_box;
	_tmp24_ = gtk_widget_get_style_context ((GtkWidget*) _tmp23_);
	gtk_style_context_add_class (_tmp24_, "raven");
	_tmp25_ = frame;
	_tmp26_ = main_box;
	gtk_container_add ((GtkContainer*) _tmp25_, (GtkWidget*) _tmp26_);
	_tmp27_ = (GtkStack*) gtk_stack_new ();
	g_object_ref_sink (_tmp27_);
	_g_object_unref0 (self->priv->main_stack);
	self->priv->main_stack = _tmp27_;
	_tmp28_ = self->priv->main_stack;
	gtk_stack_set_transition_type (_tmp28_, GTK_STACK_TRANSITION_TYPE_CROSSFADE);
	_tmp29_ = main_box;
	_tmp30_ = self->priv->main_stack;
	gtk_box_pack_start (_tmp29_, (GtkWidget*) _tmp30_, TRUE, TRUE, (guint) 0);
	_tmp31_ = budgie_main_view_new ();
	g_object_ref_sink (_tmp31_);
	_g_object_unref0 (self->priv->main_view);
	self->priv->main_view = _tmp31_;
	_tmp32_ = self->priv->main_view;
	g_signal_connect_object (_tmp32_, "view-switch", (GCallback) _budgie_raven_on_view_switch_budgie_main_view_view_switch, self, 0);
	_tmp33_ = self->priv->main_stack;
	_tmp34_ = self->priv->main_view;
	gtk_stack_add_named (_tmp33_, (GtkWidget*) _tmp34_, "main");
	_tmp35_ = manager;
	_tmp36_ = budgie_settings_view_new (_tmp35_);
	g_object_ref_sink (_tmp36_);
	_g_object_unref0 (self->priv->settings_view);
	self->priv->settings_view = _tmp36_;
	_tmp37_ = self->priv->settings_view;
	g_signal_connect_object (_tmp37_, "view-switch", (GCallback) _budgie_raven_on_view_switch_budgie_settings_view_view_switch, self, 0);
	_tmp38_ = self->priv->main_stack;
	_tmp39_ = self->priv->settings_view;
	gtk_stack_add_named (_tmp38_, (GtkWidget*) _tmp39_, "settings");
	_tmp40_ = budgie_power_strip_new (self);
	g_object_ref_sink (_tmp40_);
	_g_object_unref0 (self->priv->strip);
	self->priv->strip = _tmp40_;
	_tmp41_ = main_box;
	_tmp42_ = self->priv->strip;
	gtk_box_pack_end (_tmp41_, (GtkWidget*) _tmp42_, FALSE, FALSE, (guint) 0);
	gtk_window_set_resizable ((GtkWindow*) self, FALSE);
	gtk_window_set_skip_taskbar_hint ((GtkWindow*) self, TRUE);
	gtk_window_set_skip_pager_hint ((GtkWindow*) self, TRUE);
	gtk_window_set_keep_above ((GtkWindow*) self, TRUE);
	gtk_window_set_decorated ((GtkWindow*) self, FALSE);
	gtk_widget_set_size_request ((GtkWidget*) self, -1, -1);
	_tmp43_ = gtk_widget_get_realized ((GtkWidget*) self);
	if (!_tmp43_) {
		gtk_widget_realize ((GtkWidget*) self);
	}
	g_signal_connect_object ((GObject*) self, "notify::visible", (GCallback) ___lambda43__g_object_notify, self, 0);
	_tmp44_ = gtk_bin_get_child ((GtkBin*) self);
	gtk_widget_show_all (_tmp44_);
	_g_object_unref0 (main_box);
	_g_object_unref0 (frame);
	_g_object_unref0 (layout);
	_g_object_unref0 (vis);
	return self;
}


BudgieRaven* budgie_raven_new (BudgieDesktopManager* manager) {
	return budgie_raven_construct (BUDGIE_TYPE_RAVEN, manager);
}


static void budgie_raven_on_view_switch (BudgieRaven* self, GtkWidget* widget) {
	gchar* name = NULL;
	gchar* _tmp0_ = NULL;
	GtkWidget* _tmp1_ = NULL;
	BudgieMainView* _tmp2_ = NULL;
	GtkStack* _tmp5_ = NULL;
	const gchar* _tmp6_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup ("");
	name = _tmp0_;
	_tmp1_ = widget;
	_tmp2_ = self->priv->main_view;
	if (_tmp1_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget)) {
		gchar* _tmp3_ = NULL;
		_tmp3_ = g_strdup ("settings");
		_g_free0 (name);
		name = _tmp3_;
	} else {
		gchar* _tmp4_ = NULL;
		_tmp4_ = g_strdup ("main");
		_g_free0 (name);
		name = _tmp4_;
	}
	_tmp5_ = self->priv->main_stack;
	_tmp6_ = name;
	gtk_stack_set_visible_child_name (_tmp5_, _tmp6_);
	_g_free0 (name);
}


static void budgie_raven_real_size_allocate (GtkWidget* base, GtkAllocation* rect) {
	BudgieRaven * self;
	gint w = 0;
	GtkAllocation _tmp0_ = {0};
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	self = (BudgieRaven*) base;
	g_return_if_fail (rect != NULL);
	w = 0;
	_tmp0_ = *rect;
	GTK_WIDGET_CLASS (budgie_raven_parent_class)->size_allocate ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), &_tmp0_);
	_tmp1_ = gtk_widget_get_allocated_width ((GtkWidget*) self);
	w = _tmp1_;
	_tmp2_ = w;
	_tmp3_ = self->priv->_required_size;
	if (_tmp2_ != _tmp3_) {
		gint _tmp4_ = 0;
		GdkRectangle _tmp5_ = {0};
		BudgieToplevel* _tmp6_ = NULL;
		BudgieToplevel* _tmp7_ = NULL;
		_tmp4_ = w;
		budgie_raven_set_required_size (self, _tmp4_);
		_tmp5_ = self->priv->old_rect;
		_tmp6_ = self->priv->toplevel_top;
		_tmp7_ = self->priv->toplevel_bottom;
		budgie_raven_update_geometry (self, &_tmp5_, _tmp6_, _tmp7_);
	}
}


static void _budgie_raven_on_bus_acquired_gbus_acquired_callback (GDBusConnection* connection, const gchar* name, gpointer self) {
	budgie_raven_on_bus_acquired ((BudgieRaven*) self, connection);
}


static void __lambda44_ (BudgieRaven* self) {
}


static void ___lambda44__gbus_name_acquired_callback (GDBusConnection* connection, const gchar* name, gpointer self) {
	__lambda44_ ((BudgieRaven*) self);
}


static void __lambda45_ (BudgieRaven* self) {
	g_warning ("raven.vala:373: Raven could not take dbus!");
}


static void ___lambda45__gbus_name_lost_callback (GDBusConnection* connection, const gchar* name, gpointer self) {
	__lambda45_ ((BudgieRaven*) self);
}


void budgie_raven_setup_dbus (BudgieRaven* self) {
	g_return_if_fail (self != NULL);
	g_bus_own_name_with_closures (G_BUS_TYPE_SESSION, BUDGIE_RAVEN_DBUS_NAME, G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT | G_BUS_NAME_OWNER_FLAGS_REPLACE, (GClosure*) ((_budgie_raven_on_bus_acquired_gbus_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _budgie_raven_on_bus_acquired_gbus_acquired_callback, g_object_ref (self), g_object_unref)), (GClosure*) ((___lambda44__gbus_name_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda44__gbus_name_acquired_callback, g_object_ref (self), g_object_unref)), (GClosure*) ((___lambda45__gbus_name_lost_callback == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda45__gbus_name_lost_callback, g_object_ref (self), g_object_unref)));
}


static gboolean __lambda5_ (BudgieRaven* self, GBinding* b, GValue* v, GValue* v2) {
	gboolean result = FALSE;
	gint d = 0;
	gint _tmp0_ = 0;
	GValue _tmp1_ = {0};
	GValue _tmp2_ = {0};
	g_return_val_if_fail (b != NULL, FALSE);
	g_return_val_if_fail (v != NULL, FALSE);
	g_return_val_if_fail (v2 != NULL, FALSE);
	_tmp0_ = g_value_get_int (v);
	d = _tmp0_ - 5;
	g_value_init (&_tmp1_, G_TYPE_INT);
	G_IS_VALUE (v2) ? (g_value_unset (v2), NULL) : NULL;
	*v2 = _tmp1_;
	_tmp2_ = *v2;
	g_value_set_int (v2, d);
	result = TRUE;
	return result;
}


static gboolean ___lambda5__gbinding_transform_func (GBinding* binding, GValue* source_value, GValue* target_value, gpointer self) {
	gboolean result;
	result = __lambda5_ ((BudgieRaven*) self, binding, source_value, target_value);
	return result;
}


static void budgie_raven_bind_panel_shadow (BudgieRaven* self, BudgieToplevel* toplevel) {
	GBinding* b = NULL;
	BudgieToplevel* _tmp0_ = NULL;
	GBinding* _tmp1_ = NULL;
	BudgieToplevel* _tmp2_ = NULL;
	GBinding* _tmp3_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = toplevel;
	_tmp1_ = g_object_bind_property_with_closures ((GObject*) self, "required-size", (GObject*) _tmp0_, "shadow-width", G_BINDING_DEFAULT, (GClosure*) ((___lambda5__gbinding_transform_func == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda5__gbinding_transform_func, g_object_ref (self), g_object_unref)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, NULL)));
	b = _tmp1_;
	_tmp2_ = toplevel;
	_tmp3_ = _g_object_ref0 (b);
	g_object_set_data_full ((GObject*) _tmp2_, "_binding_shadow", _tmp3_, g_object_unref);
}


static void budgie_raven_unbind_panel_shadow (BudgieRaven* self, BudgieToplevel* top) {
	BudgieToplevel* _tmp0_ = NULL;
	GBinding* b = NULL;
	BudgieToplevel* _tmp1_ = NULL;
	gconstpointer _tmp2_ = NULL;
	GBinding* _tmp3_ = NULL;
	BudgieToplevel* _tmp6_ = NULL;
	BudgieToplevel* _tmp7_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = top;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = top;
	_tmp2_ = g_object_get_data ((GObject*) _tmp1_, "_binding_shadow");
	b = (GBinding*) _tmp2_;
	_tmp3_ = b;
	if (_tmp3_ != NULL) {
		GBinding* _tmp4_ = NULL;
		GBinding* _tmp5_ = NULL;
		_tmp4_ = b;
		_tmp5_ = _g_object_ref0 (_tmp4_);
		g_binding_unbind (_tmp5_);
	}
	_tmp6_ = self->priv->toplevel_top;
	_tmp7_ = top;
	if (_tmp6_ == _tmp7_) {
		self->priv->toplevel_top = NULL;
	} else {
		BudgieToplevel* _tmp8_ = NULL;
		BudgieToplevel* _tmp9_ = NULL;
		_tmp8_ = self->priv->toplevel_bottom;
		_tmp9_ = top;
		if (_tmp8_ == _tmp9_) {
			self->priv->toplevel_bottom = NULL;
		}
	}
}


/**
     * Update our geometry based on other panels in the neighbourhood, and the screen we
     * need to be on */
void budgie_raven_update_geometry (BudgieRaven* self, GdkRectangle* rect, BudgieToplevel* top, BudgieToplevel* bottom) {
	gint width = 0;
	gint _tmp0_ = 0;
	gint x = 0;
	GdkRectangle _tmp1_ = {0};
	gint _tmp2_ = 0;
	GdkRectangle _tmp3_ = {0};
	gint _tmp4_ = 0;
	gint _tmp5_ = 0;
	gint y = 0;
	GdkRectangle _tmp6_ = {0};
	gint _tmp7_ = 0;
	gint height = 0;
	GdkRectangle _tmp8_ = {0};
	gint _tmp9_ = 0;
	GdkRectangle _tmp10_ = {0};
	BudgieToplevel* _tmp11_ = NULL;
	BudgieToplevel* _tmp12_ = NULL;
	BudgieToplevel* _tmp14_ = NULL;
	BudgieToplevel* _tmp15_ = NULL;
	BudgieToplevel* _tmp17_ = NULL;
	BudgieToplevel* _tmp32_ = NULL;
	gint _tmp45_ = 0;
	gint _tmp46_ = 0;
	gint _tmp47_ = 0;
	gint _tmp48_ = 0;
	gint _tmp49_ = 0;
	gint _tmp50_ = 0;
	gboolean _tmp51_ = FALSE;
	g_return_if_fail (self != NULL);
	g_return_if_fail (rect != NULL);
	_tmp0_ = self->priv->_required_size;
	width = _tmp0_;
	_tmp1_ = *rect;
	_tmp2_ = _tmp1_.x;
	_tmp3_ = *rect;
	_tmp4_ = _tmp3_.width;
	_tmp5_ = width;
	x = (_tmp2_ + _tmp4_) - _tmp5_;
	_tmp6_ = *rect;
	_tmp7_ = _tmp6_.y;
	y = _tmp7_;
	_tmp8_ = *rect;
	_tmp9_ = _tmp8_.height;
	height = _tmp9_;
	_tmp10_ = *rect;
	self->priv->old_rect = _tmp10_;
	_tmp11_ = top;
	_tmp12_ = self->priv->toplevel_top;
	if (_tmp11_ != _tmp12_) {
		BudgieToplevel* _tmp13_ = NULL;
		_tmp13_ = self->priv->toplevel_top;
		budgie_raven_unbind_panel_shadow (self, _tmp13_);
	}
	_tmp14_ = bottom;
	_tmp15_ = self->priv->toplevel_bottom;
	if (_tmp14_ != _tmp15_) {
		BudgieToplevel* _tmp16_ = NULL;
		_tmp16_ = self->priv->toplevel_bottom;
		budgie_raven_unbind_panel_shadow (self, _tmp16_);
	}
	_tmp17_ = top;
	if (_tmp17_ != NULL) {
		gint size = 0;
		BudgieToplevel* _tmp18_ = NULL;
		gint _tmp19_ = 0;
		gint _tmp20_ = 0;
		BudgieToplevel* _tmp21_ = NULL;
		gint _tmp22_ = 0;
		gint _tmp23_ = 0;
		gint _tmp24_ = 0;
		gint _tmp25_ = 0;
		gint _tmp26_ = 0;
		gint _tmp27_ = 0;
		BudgieToplevel* _tmp28_ = NULL;
		BudgieToplevel* _tmp29_ = NULL;
		_tmp18_ = top;
		_tmp19_ = budgie_toplevel_get_intended_size (_tmp18_);
		_tmp20_ = _tmp19_;
		_tmp21_ = top;
		_tmp22_ = budgie_toplevel_get_shadow_depth (_tmp21_);
		_tmp23_ = _tmp22_;
		size = _tmp20_ - _tmp23_;
		_tmp24_ = height;
		_tmp25_ = size;
		height = _tmp24_ - _tmp25_;
		_tmp26_ = y;
		_tmp27_ = size;
		y = _tmp26_ + _tmp27_;
		_tmp28_ = self->priv->toplevel_top;
		_tmp29_ = top;
		if (_tmp28_ != _tmp29_) {
			BudgieToplevel* _tmp30_ = NULL;
			BudgieToplevel* _tmp31_ = NULL;
			_tmp30_ = top;
			self->priv->toplevel_top = _tmp30_;
			_tmp31_ = top;
			budgie_raven_bind_panel_shadow (self, _tmp31_);
		}
	}
	_tmp32_ = bottom;
	if (_tmp32_ != NULL) {
		gint _tmp33_ = 0;
		BudgieToplevel* _tmp34_ = NULL;
		gint _tmp35_ = 0;
		gint _tmp36_ = 0;
		gint _tmp37_ = 0;
		BudgieToplevel* _tmp38_ = NULL;
		gint _tmp39_ = 0;
		gint _tmp40_ = 0;
		BudgieToplevel* _tmp41_ = NULL;
		BudgieToplevel* _tmp42_ = NULL;
		_tmp33_ = height;
		_tmp34_ = bottom;
		_tmp35_ = budgie_toplevel_get_intended_size (_tmp34_);
		_tmp36_ = _tmp35_;
		height = _tmp33_ - _tmp36_;
		_tmp37_ = height;
		_tmp38_ = bottom;
		_tmp39_ = budgie_toplevel_get_shadow_depth (_tmp38_);
		_tmp40_ = _tmp39_;
		height = _tmp37_ + _tmp40_;
		_tmp41_ = self->priv->toplevel_bottom;
		_tmp42_ = bottom;
		if (_tmp41_ != _tmp42_) {
			BudgieToplevel* _tmp43_ = NULL;
			BudgieToplevel* _tmp44_ = NULL;
			_tmp43_ = bottom;
			self->priv->toplevel_bottom = _tmp43_;
			_tmp44_ = bottom;
			budgie_raven_bind_panel_shadow (self, _tmp44_);
		}
	}
	_tmp45_ = x;
	_tmp46_ = y;
	gtk_window_move ((GtkWindow*) self, _tmp45_, _tmp46_);
	_tmp47_ = height;
	self->priv->our_height = _tmp47_;
	_tmp48_ = width;
	self->priv->our_width = _tmp48_;
	_tmp49_ = x;
	self->priv->our_x = _tmp49_;
	_tmp50_ = y;
	self->priv->our_y = _tmp50_;
	_tmp51_ = gtk_widget_get_visible ((GtkWidget*) self);
	if (!_tmp51_) {
		gtk_widget_queue_resize ((GtkWidget*) self);
	}
}


static void budgie_raven_real_get_preferred_height (GtkWidget* base, gint* m, gint* n) {
	BudgieRaven * self;
	gint _vala_m = 0;
	gint _vala_n = 0;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	self = (BudgieRaven*) base;
	_tmp0_ = self->priv->our_height;
	_vala_m = _tmp0_;
	_tmp1_ = self->priv->our_height;
	_vala_n = _tmp1_;
	if (m) {
		*m = _vala_m;
	}
	if (n) {
		*n = _vala_n;
	}
}


static void budgie_raven_real_get_preferred_height_for_width (GtkWidget* base, gint w, gint* m, gint* n) {
	BudgieRaven * self;
	gint _vala_m = 0;
	gint _vala_n = 0;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	self = (BudgieRaven*) base;
	_tmp0_ = self->priv->our_height;
	_vala_m = _tmp0_;
	_tmp1_ = self->priv->our_height;
	_vala_n = _tmp1_;
	if (m) {
		*m = _vala_m;
	}
	if (n) {
		*n = _vala_n;
	}
}


static gboolean budgie_raven_real_draw (GtkWidget* base, cairo_t* cr) {
	BudgieRaven * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gdouble _tmp1_ = 0.0;
	gdouble _tmp2_ = 0.0;
	GtkAllocation alloc = {0};
	GtkAllocation _tmp7_ = {0};
	cairo_surface_t* buffer = NULL;
	GtkAllocation _tmp8_ = {0};
	gint _tmp9_ = 0;
	GtkAllocation _tmp10_ = {0};
	gint _tmp11_ = 0;
	cairo_surface_t* _tmp12_ = NULL;
	cairo_t* cr2 = NULL;
	cairo_surface_t* _tmp13_ = NULL;
	cairo_t* _tmp14_ = NULL;
	GtkWidget* _tmp15_ = NULL;
	cairo_t* _tmp16_ = NULL;
	gdouble width = 0.0;
	GtkAllocation _tmp17_ = {0};
	gint _tmp18_ = 0;
	gdouble _tmp19_ = 0.0;
	gdouble _tmp20_ = 0.0;
	cairo_t* _tmp21_ = NULL;
	cairo_surface_t* _tmp22_ = NULL;
	GtkAllocation _tmp23_ = {0};
	gint _tmp24_ = 0;
	gdouble _tmp25_ = 0.0;
	cairo_t* _tmp26_ = NULL;
	self = (BudgieRaven*) base;
	g_return_val_if_fail (cr != NULL, FALSE);
	_tmp1_ = budgie_raven_get_nscale (self);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == 0.0) {
		_tmp0_ = TRUE;
	} else {
		gdouble _tmp3_ = 0.0;
		gdouble _tmp4_ = 0.0;
		_tmp3_ = budgie_raven_get_nscale (self);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_ == 1.0;
	}
	if (_tmp0_) {
		cairo_t* _tmp5_ = NULL;
		gboolean _tmp6_ = FALSE;
		_tmp5_ = cr;
		_tmp6_ = GTK_WIDGET_CLASS (budgie_raven_parent_class)->draw ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), _tmp5_);
		result = _tmp6_;
		return result;
	}
	gtk_widget_get_allocation ((GtkWidget*) self, &_tmp7_);
	alloc = _tmp7_;
	_tmp8_ = alloc;
	_tmp9_ = _tmp8_.width;
	_tmp10_ = alloc;
	_tmp11_ = _tmp10_.height;
	_tmp12_ = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, _tmp9_, _tmp11_);
	buffer = _tmp12_;
	_tmp13_ = buffer;
	_tmp14_ = cairo_create (_tmp13_);
	cr2 = _tmp14_;
	_tmp15_ = gtk_bin_get_child ((GtkBin*) self);
	_tmp16_ = cr2;
	gtk_container_propagate_draw ((GtkContainer*) self, _tmp15_, _tmp16_);
	_tmp17_ = alloc;
	_tmp18_ = _tmp17_.width;
	_tmp19_ = budgie_raven_get_nscale (self);
	_tmp20_ = _tmp19_;
	width = _tmp18_ * _tmp20_;
	_tmp21_ = cr;
	_tmp22_ = buffer;
	_tmp23_ = alloc;
	_tmp24_ = _tmp23_.width;
	_tmp25_ = width;
	cairo_set_source_surface (_tmp21_, _tmp22_, _tmp24_ - _tmp25_, (gdouble) 0);
	_tmp26_ = cr;
	cairo_paint (_tmp26_);
	result = GDK_EVENT_STOP;
	_cairo_destroy0 (cr2);
	_cairo_surface_destroy0 (buffer);
	return result;
}


/**
     * Slide Raven in or out of view
     */
static gdouble _budgie_sine_ease_in_out_budgie_tween_func (gdouble factor, gpointer self) {
	gdouble result;
	result = budgie_sine_ease_in_out (factor);
	return result;
}


static void _vala_BudgiePropChange_array_free (BudgiePropChange* array, gint array_length) {
	if (array != NULL) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			budgie_prop_change_destroy (&array[i]);
		}
	}
	g_free (array);
}


static void __lambda6_ (BudgieRaven* self, BudgieAnimation* a) {
	BudgieAnimation* _tmp0_ = NULL;
	GtkWidget* _tmp1_ = NULL;
	gdouble _tmp2_ = 0.0;
	gdouble _tmp3_ = 0.0;
	_tmp0_ = a;
	_tmp1_ = _tmp0_->widget;
	_tmp2_ = budgie_raven_get_nscale (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, BUDGIE_TYPE_RAVEN) ? ((BudgieRaven*) _tmp1_) : NULL);
	_tmp3_ = _tmp2_;
	if (_tmp3_ == 0.0) {
		BudgieAnimation* _tmp4_ = NULL;
		GtkWidget* _tmp5_ = NULL;
		_tmp4_ = a;
		_tmp5_ = _tmp4_->widget;
		gtk_widget_hide (_tmp5_);
	} else {
		BudgieAnimation* _tmp6_ = NULL;
		GtkWidget* _tmp7_ = NULL;
		BudgieAnimation* _tmp8_ = NULL;
		GtkWidget* _tmp9_ = NULL;
		_tmp6_ = a;
		_tmp7_ = _tmp6_->widget;
		gtk_window_present (G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, gtk_window_get_type ()) ? ((GtkWindow*) _tmp7_) : NULL);
		_tmp8_ = a;
		_tmp9_ = _tmp8_->widget;
		gtk_widget_grab_focus ((GtkWidget*) (G_TYPE_CHECK_INSTANCE_TYPE (_tmp9_, gtk_window_get_type ()) ? ((GtkWindow*) _tmp9_) : NULL));
		budgie_raven_steal_focus (self);
	}
}


static void ___lambda6__budgie_anim_completion_func (BudgieAnimation* src, gpointer self) {
	__lambda6_ ((BudgieRaven*) self, src);
}


void budgie_raven_set_expanded (BudgieRaven* self, gboolean exp) {
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gdouble old_op = 0.0;
	gdouble new_op = 0.0;
	gboolean _tmp2_ = FALSE;
	gdouble _tmp6_ = 0.0;
	gboolean _tmp7_ = FALSE;
	gboolean _tmp8_ = FALSE;
	BudgieRavenIface* _tmp9_ = NULL;
	gboolean _tmp10_ = FALSE;
	BudgieAnimation* anim = NULL;
	BudgieAnimation* _tmp11_ = NULL;
	BudgieAnimation* _tmp12_ = NULL;
	BudgieAnimation* _tmp13_ = NULL;
	BudgieAnimation* _tmp14_ = NULL;
	BudgieAnimation* _tmp15_ = NULL;
	gchar* _tmp16_ = NULL;
	gdouble _tmp17_ = 0.0;
	GValue _tmp18_ = {0};
	gdouble _tmp19_ = 0.0;
	GValue _tmp20_ = {0};
	BudgiePropChange _tmp21_ = {0};
	BudgiePropChange* _tmp22_ = NULL;
	BudgieAnimation* _tmp23_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = exp;
	_tmp1_ = self->priv->expanded;
	if (_tmp0_ == _tmp1_) {
		return;
	}
	_tmp2_ = exp;
	if (_tmp2_) {
		GdkRectangle _tmp3_ = {0};
		BudgieToplevel* _tmp4_ = NULL;
		BudgieToplevel* _tmp5_ = NULL;
		_tmp3_ = self->priv->old_rect;
		_tmp4_ = self->priv->toplevel_top;
		_tmp5_ = self->priv->toplevel_bottom;
		budgie_raven_update_geometry (self, &_tmp3_, _tmp4_, _tmp5_);
		old_op = 0.0;
		new_op = 1.0;
	} else {
		old_op = 1.0;
		new_op = 0.0;
	}
	_tmp6_ = old_op;
	budgie_raven_set_nscale (self, _tmp6_);
	_tmp7_ = exp;
	if (_tmp7_) {
		self->priv->outside_win = TRUE;
		gtk_widget_show_all ((GtkWidget*) self);
	}
	_tmp8_ = exp;
	self->priv->expanded = _tmp8_;
	_tmp9_ = self->priv->iface;
	_tmp10_ = self->priv->expanded;
	g_signal_emit_by_name (_tmp9_, "expansion-changed", _tmp10_);
	_tmp11_ = budgie_animation_new ();
	anim = _tmp11_;
	_tmp12_ = anim;
	_tmp12_->widget = (GtkWidget*) self;
	_tmp13_ = anim;
	_tmp13_->length = 170 * BUDGIE_MSECOND;
	_tmp14_ = anim;
	_tmp14_->tween = _budgie_sine_ease_in_out_budgie_tween_func;
	_tmp14_->tween_target = NULL;
	_tmp15_ = anim;
	_tmp16_ = g_strdup ("nscale");
	_tmp17_ = old_op;
	g_value_init (&_tmp18_, G_TYPE_DOUBLE);
	g_value_set_double (&_tmp18_, _tmp17_);
	_tmp19_ = new_op;
	g_value_init (&_tmp20_, G_TYPE_DOUBLE);
	g_value_set_double (&_tmp20_, _tmp19_);
	memset (&_tmp21_, 0, sizeof (BudgiePropChange));
	_g_free0 (_tmp21_.property);
	_tmp21_.property = _tmp16_;
	G_IS_VALUE (&_tmp21_.old) ? (g_value_unset (&_tmp21_.old), NULL) : NULL;
	_tmp21_.old = _tmp18_;
	G_IS_VALUE (&_tmp21_.new) ? (g_value_unset (&_tmp21_.new), NULL) : NULL;
	_tmp21_.new = _tmp20_;
	_tmp22_ = g_new0 (BudgiePropChange, 1);
	_tmp22_[0] = _tmp21_;
	_tmp15_->changes = (_vala_BudgiePropChange_array_free (_tmp15_->changes, _tmp15_->changes_length1), NULL);
	_tmp15_->changes = _tmp22_;
	_tmp15_->changes_length1 = 1;
	_tmp23_ = anim;
	budgie_animation_start (_tmp23_, ___lambda6__budgie_anim_completion_func, self);
	_g_object_unref0 (anim);
}


gboolean budgie_raven_get_expanded (BudgieRaven* self) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->expanded;
	result = _tmp0_;
	return result;
}


gint budgie_raven_get_required_size (BudgieRaven* self) {
	gint result;
	gint _tmp0_ = 0;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->_required_size;
	result = _tmp0_;
	return result;
}


void budgie_raven_set_required_size (BudgieRaven* self, gint value) {
	gint _tmp0_ = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_required_size = _tmp0_;
	g_object_notify ((GObject *) self, "required-size");
}


BudgieDesktopManager* budgie_raven_get_manager (BudgieRaven* self) {
	BudgieDesktopManager* result;
	BudgieDesktopManager* _tmp0_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_manager;
	result = _tmp0_;
	return result;
}


void budgie_raven_set_manager (BudgieRaven* self, BudgieDesktopManager* value) {
	BudgieDesktopManager* _tmp0_ = NULL;
	BudgieDesktopManager* _tmp1_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->_manager);
	self->priv->_manager = _tmp1_;
	g_object_notify ((GObject *) self, "manager");
}


gdouble budgie_raven_get_nscale (BudgieRaven* self) {
	gdouble result;
	gdouble _tmp0_ = 0.0;
	g_return_val_if_fail (self != NULL, 0.0);
	_tmp0_ = self->priv->scale;
	result = _tmp0_;
	return result;
}


void budgie_raven_set_nscale (BudgieRaven* self, gdouble value) {
	gdouble _tmp0_ = 0.0;
	gboolean _tmp1_ = FALSE;
	gdouble _tmp2_ = 0.0;
	gdouble _tmp3_ = 0.0;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->scale = _tmp0_;
	_tmp2_ = budgie_raven_get_nscale (self);
	_tmp3_ = _tmp2_;
	if (_tmp3_ > 0.0) {
		gdouble _tmp4_ = 0.0;
		gdouble _tmp5_ = 0.0;
		_tmp4_ = budgie_raven_get_nscale (self);
		_tmp5_ = _tmp4_;
		_tmp1_ = _tmp5_ < 1.0;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		gint _tmp6_ = 0;
		gdouble _tmp7_ = 0.0;
		gdouble _tmp8_ = 0.0;
		_tmp6_ = gtk_widget_get_allocated_width ((GtkWidget*) self);
		_tmp7_ = budgie_raven_get_nscale (self);
		_tmp8_ = _tmp7_;
		budgie_raven_set_required_size (self, (gint) (_tmp6_ * _tmp8_));
	} else {
		gint _tmp9_ = 0;
		_tmp9_ = gtk_widget_get_allocated_width ((GtkWidget*) self);
		budgie_raven_set_required_size (self, _tmp9_);
	}
	gtk_widget_queue_draw ((GtkWidget*) self);
	g_object_notify ((GObject *) self, "nscale");
}


static void budgie_raven_class_init (BudgieRavenClass * klass) {
	budgie_raven_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (BudgieRavenPrivate));
	((GtkWidgetClass *) klass)->size_allocate = budgie_raven_real_size_allocate;
	((GtkWidgetClass *) klass)->get_preferred_height = budgie_raven_real_get_preferred_height;
	((GtkWidgetClass *) klass)->get_preferred_height_for_width = budgie_raven_real_get_preferred_height_for_width;
	((GtkWidgetClass *) klass)->draw = budgie_raven_real_draw;
	G_OBJECT_CLASS (klass)->get_property = _vala_budgie_raven_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_budgie_raven_set_property;
	G_OBJECT_CLASS (klass)->finalize = budgie_raven_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BUDGIE_RAVEN_REQUIRED_SIZE, g_param_spec_int ("required-size", "required-size", "required-size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BUDGIE_RAVEN_MANAGER, g_param_spec_object ("manager", "manager", "manager", BUDGIE_TYPE_DESKTOP_MANAGER, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BUDGIE_RAVEN_NSCALE, g_param_spec_double ("nscale", "nscale", "nscale", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
}


static void budgie_raven_instance_init (BudgieRaven * self) {
	self->priv = BUDGIE_RAVEN_GET_PRIVATE (self);
	self->priv->intended_size = 0.15;
	self->priv->our_width = 0;
	self->priv->our_height = 0;
	self->priv->our_x = 0;
	self->priv->our_y = 0;
	self->priv->iface = NULL;
	self->priv->expanded = FALSE;
	self->priv->outside_win = FALSE;
	self->priv->scale = 0.0;
	self->priv->strip = NULL;
	self->priv->toplevel_top = NULL;
	self->priv->toplevel_bottom = NULL;
	self->priv->main_view = NULL;
	self->priv->settings_view = NULL;
	self->priv->n_count = (guint) 0;
}


static void budgie_raven_finalize (GObject* obj) {
	BudgieRaven * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BUDGIE_TYPE_RAVEN, BudgieRaven);
	_g_object_unref0 (self->priv->shadow);
	_budgie_raven_iface_unref0 (self->priv->iface);
	_g_object_unref0 (self->priv->strip);
	_g_object_unref0 (self->priv->main_view);
	_g_object_unref0 (self->priv->settings_view);
	_g_object_unref0 (self->priv->main_stack);
	_g_object_unref0 (self->priv->_manager);
	G_OBJECT_CLASS (budgie_raven_parent_class)->finalize (obj);
}


GType budgie_raven_get_type (void) {
	static volatile gsize budgie_raven_type_id__volatile = 0;
	if (g_once_init_enter (&budgie_raven_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BudgieRavenClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) budgie_raven_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BudgieRaven), 0, (GInstanceInitFunc) budgie_raven_instance_init, NULL };
		GType budgie_raven_type_id;
		budgie_raven_type_id = g_type_register_static (gtk_window_get_type (), "BudgieRaven", &g_define_type_info, 0);
		g_once_init_leave (&budgie_raven_type_id__volatile, budgie_raven_type_id);
	}
	return budgie_raven_type_id__volatile;
}


static void _vala_budgie_raven_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	BudgieRaven * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BUDGIE_TYPE_RAVEN, BudgieRaven);
	switch (property_id) {
		case BUDGIE_RAVEN_REQUIRED_SIZE:
		g_value_set_int (value, budgie_raven_get_required_size (self));
		break;
		case BUDGIE_RAVEN_MANAGER:
		g_value_set_object (value, budgie_raven_get_manager (self));
		break;
		case BUDGIE_RAVEN_NSCALE:
		g_value_set_double (value, budgie_raven_get_nscale (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_budgie_raven_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	BudgieRaven * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BUDGIE_TYPE_RAVEN, BudgieRaven);
	switch (property_id) {
		case BUDGIE_RAVEN_REQUIRED_SIZE:
		budgie_raven_set_required_size (self, g_value_get_int (value));
		break;
		case BUDGIE_RAVEN_MANAGER:
		budgie_raven_set_manager (self, g_value_get_object (value));
		break;
		case BUDGIE_RAVEN_NSCALE:
		budgie_raven_set_nscale (self, g_value_get_double (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



