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

/*///////////////////////////////////////////////////////////////////////*/
/* Copyright 2011-2021 Simon Schneegans*/
/**/
/* Permission is hereby granted, free of charge, to any person obtaining*/
/* a copy of this software and associated documentation files (the*/
/* "Software"), to deal in the Software without restriction, including*/
/* without limitation the rights to use, copy, modify, merge, publish,*/
/* distribute, sublicense, and/or sell copies of the Software, and to*/
/* permit persons to whom the Software is furnished to do so, subject to*/
/* the following conditions:*/
/* */
/* The above copyright notice and this permission notice shall be*/
/* included in all copies or substantial portions of the Software.*/
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,*/
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF*/
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY*/
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,*/
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE*/
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/
/*///////////////////////////////////////////////////////////////////////*/

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <cairo-gobject.h>
#include <gdk/gdk.h>
#include <gee.h>
#include <glib/gi18n-lib.h>
#include <float.h>
#include <math.h>
#include <gdk-pixbuf/gdk-pixbuf.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
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define GNOME_PIE_TYPE_PIE_PREVIEW (gnome_pie_pie_preview_get_type ())
#define GNOME_PIE_PIE_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_PIE_PREVIEW, GnomePiePiePreview))
#define GNOME_PIE_PIE_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_PIE_PREVIEW, GnomePiePiePreviewClass))
#define GNOME_PIE_IS_PIE_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_PIE_PREVIEW))
#define GNOME_PIE_IS_PIE_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_PIE_PREVIEW))
#define GNOME_PIE_PIE_PREVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_PIE_PREVIEW, GnomePiePiePreviewClass))

typedef struct _GnomePiePiePreview GnomePiePiePreview;
typedef struct _GnomePiePiePreviewClass GnomePiePiePreviewClass;
typedef struct _GnomePiePiePreviewPrivate GnomePiePiePreviewPrivate;

#define GNOME_PIE_TYPE_PIE_PREVIEW_RENDERER (gnome_pie_pie_preview_renderer_get_type ())
#define GNOME_PIE_PIE_PREVIEW_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_PIE_PREVIEW_RENDERER, GnomePiePiePreviewRenderer))
#define GNOME_PIE_PIE_PREVIEW_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_PIE_PREVIEW_RENDERER, GnomePiePiePreviewRendererClass))
#define GNOME_PIE_IS_PIE_PREVIEW_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_PIE_PREVIEW_RENDERER))
#define GNOME_PIE_IS_PIE_PREVIEW_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_PIE_PREVIEW_RENDERER))
#define GNOME_PIE_PIE_PREVIEW_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_PIE_PREVIEW_RENDERER, GnomePiePiePreviewRendererClass))

typedef struct _GnomePiePiePreviewRenderer GnomePiePiePreviewRenderer;
typedef struct _GnomePiePiePreviewRendererClass GnomePiePiePreviewRendererClass;

#define GNOME_PIE_TYPE_NEW_SLICE_WINDOW (gnome_pie_new_slice_window_get_type ())
#define GNOME_PIE_NEW_SLICE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_NEW_SLICE_WINDOW, GnomePieNewSliceWindow))
#define GNOME_PIE_NEW_SLICE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_NEW_SLICE_WINDOW, GnomePieNewSliceWindowClass))
#define GNOME_PIE_IS_NEW_SLICE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_NEW_SLICE_WINDOW))
#define GNOME_PIE_IS_NEW_SLICE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_NEW_SLICE_WINDOW))
#define GNOME_PIE_NEW_SLICE_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_NEW_SLICE_WINDOW, GnomePieNewSliceWindowClass))

typedef struct _GnomePieNewSliceWindow GnomePieNewSliceWindow;
typedef struct _GnomePieNewSliceWindowClass GnomePieNewSliceWindowClass;
enum  {
	GNOME_PIE_PIE_PREVIEW_0_PROPERTY,
	GNOME_PIE_PIE_PREVIEW_NUM_PROPERTIES
};
static GParamSpec* gnome_pie_pie_preview_properties[GNOME_PIE_PIE_PREVIEW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_timer_destroy0(var) ((var == NULL) ? NULL : (var = (g_timer_destroy (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define GNOME_PIE_TYPE_ACTION_GROUP (gnome_pie_action_group_get_type ())
#define GNOME_PIE_ACTION_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_ACTION_GROUP, GnomePieActionGroup))
#define GNOME_PIE_ACTION_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_ACTION_GROUP, GnomePieActionGroupClass))
#define GNOME_PIE_IS_ACTION_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_ACTION_GROUP))
#define GNOME_PIE_IS_ACTION_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_ACTION_GROUP))
#define GNOME_PIE_ACTION_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_ACTION_GROUP, GnomePieActionGroupClass))

typedef struct _GnomePieActionGroup GnomePieActionGroup;
typedef struct _GnomePieActionGroupClass GnomePieActionGroupClass;

#define GNOME_PIE_TYPE_PIE (gnome_pie_pie_get_type ())
#define GNOME_PIE_PIE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_PIE, GnomePiePie))
#define GNOME_PIE_PIE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_PIE, GnomePiePieClass))
#define GNOME_PIE_IS_PIE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_PIE))
#define GNOME_PIE_IS_PIE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_PIE))
#define GNOME_PIE_PIE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_PIE, GnomePiePieClass))

typedef struct _GnomePiePie GnomePiePie;
typedef struct _GnomePiePieClass GnomePiePieClass;
typedef struct _Block9Data Block9Data;

#define GNOME_PIE_TYPE_CONFIG (gnome_pie_config_get_type ())
#define GNOME_PIE_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_CONFIG, GnomePieConfig))
#define GNOME_PIE_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_CONFIG, GnomePieConfigClass))
#define GNOME_PIE_IS_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_CONFIG))
#define GNOME_PIE_IS_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_CONFIG))
#define GNOME_PIE_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_CONFIG, GnomePieConfigClass))

typedef struct _GnomePieConfig GnomePieConfig;
typedef struct _GnomePieConfigClass GnomePieConfigClass;

#define GNOME_PIE_TYPE_IMAGE (gnome_pie_image_get_type ())
#define GNOME_PIE_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_IMAGE, GnomePieImage))
#define GNOME_PIE_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_IMAGE, GnomePieImageClass))
#define GNOME_PIE_IS_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_IMAGE))
#define GNOME_PIE_IS_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_IMAGE))
#define GNOME_PIE_IMAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_IMAGE, GnomePieImageClass))

typedef struct _GnomePieImage GnomePieImage;
typedef struct _GnomePieImageClass GnomePieImageClass;

#define GNOME_PIE_TYPE_ICON (gnome_pie_icon_get_type ())
#define GNOME_PIE_ICON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_ICON, GnomePieIcon))
#define GNOME_PIE_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_ICON, GnomePieIconClass))
#define GNOME_PIE_IS_ICON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_ICON))
#define GNOME_PIE_IS_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_ICON))
#define GNOME_PIE_ICON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_ICON, GnomePieIconClass))

typedef struct _GnomePieIcon GnomePieIcon;
typedef struct _GnomePieIconClass GnomePieIconClass;
typedef struct _Block10Data Block10Data;
typedef struct _Block11Data Block11Data;
typedef struct _GnomePiePiePreviewRendererPrivate GnomePiePiePreviewRendererPrivate;

#define GNOME_PIE_TYPE_PIE_PREVIEW_SLICE_RENDERER (gnome_pie_pie_preview_slice_renderer_get_type ())
#define GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_PIE_PREVIEW_SLICE_RENDERER, GnomePiePiePreviewSliceRenderer))
#define GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_PIE_PREVIEW_SLICE_RENDERER, GnomePiePiePreviewSliceRendererClass))
#define GNOME_PIE_IS_PIE_PREVIEW_SLICE_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_PIE_PREVIEW_SLICE_RENDERER))
#define GNOME_PIE_IS_PIE_PREVIEW_SLICE_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_PIE_PREVIEW_SLICE_RENDERER))
#define GNOME_PIE_PIE_PREVIEW_SLICE_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_PIE_PREVIEW_SLICE_RENDERER, GnomePiePiePreviewSliceRendererClass))

typedef struct _GnomePiePiePreviewSliceRenderer GnomePiePiePreviewSliceRenderer;
typedef struct _GnomePiePiePreviewSliceRendererClass GnomePiePiePreviewSliceRendererClass;

#define GNOME_PIE_TYPE_ACTION (gnome_pie_action_get_type ())
#define GNOME_PIE_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_PIE_TYPE_ACTION, GnomePieAction))
#define GNOME_PIE_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_PIE_TYPE_ACTION, GnomePieActionClass))
#define GNOME_PIE_IS_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_PIE_TYPE_ACTION))
#define GNOME_PIE_IS_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_PIE_TYPE_ACTION))
#define GNOME_PIE_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_PIE_TYPE_ACTION, GnomePieActionClass))

typedef struct _GnomePieAction GnomePieAction;
typedef struct _GnomePieActionClass GnomePieActionClass;
enum  {
	GNOME_PIE_PIE_PREVIEW_ON_LAST_SLICE_REMOVED_SIGNAL,
	GNOME_PIE_PIE_PREVIEW_ON_FIRST_SLICE_ADDED_SIGNAL,
	GNOME_PIE_PIE_PREVIEW_NUM_SIGNALS
};
static guint gnome_pie_pie_preview_signals[GNOME_PIE_PIE_PREVIEW_NUM_SIGNALS] = {0};

struct _GnomePiePiePreview {
	GtkDrawingArea parent_instance;
	GnomePiePiePreviewPrivate * priv;
};

struct _GnomePiePiePreviewClass {
	GtkDrawingAreaClass parent_class;
};

struct _GnomePiePiePreviewPrivate {
	GnomePiePiePreviewRenderer* renderer;
	GnomePieNewSliceWindow* new_slice_window;
	GTimer* timer;
	gboolean drag_enabled;
	gchar* current_id;
	gint drag_start_index;
	gchar* drag_start_id;
};

struct _Block9Data {
	int _ref_count_;
	GnomePiePiePreview* self;
	gint pos;
};

struct _Block10Data {
	int _ref_count_;
	GnomePiePiePreview* self;
	GdkDragContext* context;
};

struct _Block11Data {
	int _ref_count_;
	Block10Data * _data10_;
	gint target_index;
};

struct _GnomePiePiePreviewRenderer {
	GObject parent_instance;
	GnomePiePiePreviewRendererPrivate * priv;
	GeeArrayList* slices;
	GtkDrawingArea* parent;
};

struct _GnomePiePiePreviewRendererClass {
	GObjectClass parent_class;
};

static gint GnomePiePiePreview_private_offset;
static gpointer gnome_pie_pie_preview_parent_class = NULL;

VALA_EXTERN GType gnome_pie_pie_preview_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePiePiePreview, g_object_unref)
VALA_EXTERN GType gnome_pie_pie_preview_renderer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePiePiePreviewRenderer, g_object_unref)
VALA_EXTERN GType gnome_pie_new_slice_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieNewSliceWindow, g_object_unref)
VALA_EXTERN GnomePiePiePreview* gnome_pie_pie_preview_new (void);
VALA_EXTERN GnomePiePiePreview* gnome_pie_pie_preview_construct (GType object_type);
VALA_EXTERN GnomePiePiePreviewRenderer* gnome_pie_pie_preview_renderer_new (GtkDrawingArea* parent);
VALA_EXTERN GnomePiePiePreviewRenderer* gnome_pie_pie_preview_renderer_construct (GType object_type,
                                                                      GtkDrawingArea* parent);
static gboolean gnome_pie_pie_preview_on_draw (GnomePiePiePreview* self,
                                        cairo_t* ctx);
static gboolean _gnome_pie_pie_preview_on_draw_gtk_widget_draw (GtkWidget* _sender,
                                                         cairo_t* cr,
                                                         gpointer self);
static void gnome_pie_pie_preview_enable_drag_source (GnomePiePiePreview* self);
static void gnome_pie_pie_preview_on_start_drag (GnomePiePiePreview* self,
                                          GdkDragContext* ctx);
static void _gnome_pie_pie_preview_on_start_drag_gtk_widget_drag_begin (GtkWidget* _sender,
                                                                 GdkDragContext* context,
                                                                 gpointer self);
static void gnome_pie_pie_preview_on_end_drag (GnomePiePiePreview* self,
                                        GdkDragContext* context);
static void _gnome_pie_pie_preview_on_end_drag_gtk_widget_drag_end (GtkWidget* _sender,
                                                             GdkDragContext* context,
                                                             gpointer self);
static void gnome_pie_pie_preview_on_dnd_received (GnomePiePiePreview* self,
                                            GdkDragContext* context,
                                            gint x,
                                            gint y,
                                            GtkSelectionData* selection_data,
                                            guint info,
                                            guint time_);
static void _gnome_pie_pie_preview_on_dnd_received_gtk_widget_drag_data_received (GtkWidget* _sender,
                                                                           GdkDragContext* context,
                                                                           gint x,
                                                                           gint y,
                                                                           GtkSelectionData* selection_data,
                                                                           guint info,
                                                                           guint time_,
                                                                           gpointer self);
static gboolean gnome_pie_pie_preview_on_drag_move (GnomePiePiePreview* self,
                                             GdkDragContext* ctx,
                                             gint x,
                                             gint y,
                                             guint time);
static gboolean _gnome_pie_pie_preview_on_drag_move_gtk_widget_drag_motion (GtkWidget* _sender,
                                                                     GdkDragContext* context,
                                                                     gint x,
                                                                     gint y,
                                                                     guint time_,
                                                                     gpointer self);
VALA_EXTERN gboolean gnome_pie_pie_preview_on_mouse_leave (GnomePiePiePreview* self,
                                               GdkEventCrossing* event);
static gboolean _gnome_pie_pie_preview_on_mouse_leave_gtk_widget_leave_notify_event (GtkWidget* _sender,
                                                                              GdkEventCrossing* event,
                                                                              gpointer self);
VALA_EXTERN gboolean gnome_pie_pie_preview_on_mouse_enter (GnomePiePiePreview* self,
                                               GdkEventCrossing* event);
static gboolean _gnome_pie_pie_preview_on_mouse_enter_gtk_widget_enter_notify_event (GtkWidget* _sender,
                                                                              GdkEventCrossing* event,
                                                                              gpointer self);
static gboolean gnome_pie_pie_preview_on_mouse_move (GnomePiePiePreview* self,
                                              GdkEventMotion* event);
static gboolean _gnome_pie_pie_preview_on_mouse_move_gtk_widget_motion_notify_event (GtkWidget* _sender,
                                                                              GdkEventMotion* event,
                                                                              gpointer self);
static gboolean gnome_pie_pie_preview_on_button_release (GnomePiePiePreview* self);
static gboolean _gnome_pie_pie_preview_on_button_release_gtk_widget_button_release_event (GtkWidget* _sender,
                                                                                   GdkEventButton* event,
                                                                                   gpointer self);
static gboolean gnome_pie_pie_preview_on_button_press (GnomePiePiePreview* self);
static gboolean _gnome_pie_pie_preview_on_button_press_gtk_widget_button_press_event (GtkWidget* _sender,
                                                                               GdkEventButton* event,
                                                                               gpointer self);
VALA_EXTERN GnomePieNewSliceWindow* gnome_pie_new_slice_window_new (void);
VALA_EXTERN GnomePieNewSliceWindow* gnome_pie_new_slice_window_construct (GType object_type);
VALA_EXTERN GType gnome_pie_action_group_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieActionGroup, g_object_unref)
static void __lambda61_ (GnomePiePiePreview* self,
                  GnomePieActionGroup* new_action,
                  gboolean as_new_slice,
                  gint at_position);
VALA_EXTERN GType gnome_pie_pie_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePiePie, g_object_unref)
VALA_EXTERN GeeHashMap* gnome_pie_pie_manager_get_all_pies (void);
VALA_EXTERN gboolean gnome_pie_action_group_has_quickaction (GnomePieActionGroup* self);
VALA_EXTERN void gnome_pie_pie_preview_renderer_disable_quickactions (GnomePiePiePreviewRenderer* self);
VALA_EXTERN void gnome_pie_pie_add_group (GnomePiePie* self,
                              GnomePieActionGroup* group,
                              gint at_position);
VALA_EXTERN void gnome_pie_pie_preview_renderer_add_group (GnomePiePiePreviewRenderer* self,
                                               GnomePieActionGroup* group,
                                               gint at_position);
VALA_EXTERN gint gnome_pie_pie_preview_renderer_slice_count (GnomePiePiePreviewRenderer* self);
VALA_EXTERN void gnome_pie_pie_update_group (GnomePiePie* self,
                                 GnomePieActionGroup* group,
                                 gint index);
VALA_EXTERN void gnome_pie_pie_preview_renderer_update_group (GnomePiePiePreviewRenderer* self,
                                                  GnomePieActionGroup* group,
                                                  gint index);
static void ___lambda61__gnome_pie_new_slice_window_on_select (GnomePieNewSliceWindow* _sender,
                                                        GnomePieActionGroup* action,
                                                        gboolean as_new_slice,
                                                        gint at_position,
                                                        gpointer self);
static void __lambda62_ (GnomePiePiePreview* self,
                  gint pos);
VALA_EXTERN void gnome_pie_new_slice_window_reload (GnomePieNewSliceWindow* self);
VALA_EXTERN void gnome_pie_new_slice_window_set_parent (GnomePieNewSliceWindow* self,
                                            GtkWindow* parent);
VALA_EXTERN void gnome_pie_new_slice_window_show (GnomePieNewSliceWindow* self);
VALA_EXTERN void gnome_pie_new_slice_window_set_action (GnomePieNewSliceWindow* self,
                                            GnomePieActionGroup* group,
                                            gint position);
VALA_EXTERN GeeArrayList* gnome_pie_pie_get_action_groups (GnomePiePie* self);
static void ___lambda62__gnome_pie_pie_preview_renderer_on_edit_slice (GnomePiePiePreviewRenderer* _sender,
                                                                gint position,
                                                                gpointer self);
static void __lambda63_ (GnomePiePiePreview* self,
                  gint pos);
VALA_EXTERN void gnome_pie_new_slice_window_set_default (GnomePieNewSliceWindow* self,
                                             const gchar* pie_id,
                                             gint position);
static void ___lambda63__gnome_pie_pie_preview_renderer_on_add_slice (GnomePiePiePreviewRenderer* _sender,
                                                               gint position,
                                                               gpointer self);
static void __lambda64_ (GnomePiePiePreview* self,
                  gint pos);
static Block9Data* block9_data_ref (Block9Data* _data9_);
static void block9_data_unref (void * _userdata_);
static void __lambda65_ (Block9Data* _data9_,
                  gint response);
VALA_EXTERN void gnome_pie_pie_remove_group (GnomePiePie* self,
                                 gint index);
VALA_EXTERN void gnome_pie_pie_preview_renderer_remove_group (GnomePiePiePreviewRenderer* self,
                                                  gint index);
static void ___lambda65__gtk_dialog_response (GtkDialog* _sender,
                                       gint response_id,
                                       gpointer self);
static void ___lambda64__gnome_pie_pie_preview_renderer_on_remove_slice (GnomePiePiePreviewRenderer* _sender,
                                                                  gint position,
                                                                  gpointer self);
VALA_EXTERN void gnome_pie_pie_preview_set_pie (GnomePiePiePreview* self,
                                    const gchar* id);
VALA_EXTERN void gnome_pie_pie_preview_renderer_load_pie (GnomePiePiePreviewRenderer* self,
                                              GnomePiePie* pie);
VALA_EXTERN void gnome_pie_pie_preview_renderer_hide_group (GnomePiePiePreviewRenderer* self,
                                                gint index);
VALA_EXTERN void gnome_pie_pie_preview_draw_loop (GnomePiePiePreview* self);
VALA_EXTERN GType gnome_pie_config_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieConfig, g_object_unref)
VALA_EXTERN GnomePieConfig* gnome_pie_config_get_global (void);
VALA_EXTERN gdouble gnome_pie_config_get_refresh_rate (GnomePieConfig* self);
static gboolean __lambda66_ (GnomePiePiePreview* self);
static gboolean ___lambda66__gsource_func (gpointer self);
VALA_EXTERN void gnome_pie_pie_preview_renderer_draw (GnomePiePiePreviewRenderer* self,
                                          gdouble frame_time,
                                          cairo_t* ctx);
VALA_EXTERN void gnome_pie_pie_preview_renderer_on_mouse_leave (GnomePiePiePreviewRenderer* self);
VALA_EXTERN void gnome_pie_pie_preview_renderer_on_mouse_enter (GnomePiePiePreviewRenderer* self);
VALA_EXTERN void gnome_pie_pie_preview_renderer_set_dnd_mode (GnomePiePiePreviewRenderer* self,
                                                  gboolean dnd);
VALA_EXTERN void gnome_pie_pie_preview_renderer_on_mouse_move (GnomePiePiePreviewRenderer* self,
                                                   gdouble x,
                                                   gdouble y);
VALA_EXTERN gint gnome_pie_pie_preview_renderer_get_active_slice (GnomePiePiePreviewRenderer* self);
static void gnome_pie_pie_preview_disable_drag_source (GnomePiePiePreview* self);
VALA_EXTERN void gnome_pie_pie_preview_renderer_on_button_press (GnomePiePiePreviewRenderer* self);
VALA_EXTERN gboolean gnome_pie_pie_preview_renderer_get_drag_n_drop_mode (GnomePiePiePreviewRenderer* self);
VALA_EXTERN void gnome_pie_pie_preview_renderer_on_button_release (GnomePiePiePreviewRenderer* self);
VALA_EXTERN GType gnome_pie_image_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieImage, g_object_unref)
VALA_EXTERN GType gnome_pie_icon_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieIcon, g_object_unref)
VALA_EXTERN GnomePieIcon* gnome_pie_pie_preview_renderer_get_active_icon (GnomePiePiePreviewRenderer* self);
VALA_EXTERN GdkPixbuf* gnome_pie_image_to_pixbuf (GnomePieImage* self);
VALA_EXTERN gint gnome_pie_icon_size (GnomePieIcon* self);
static Block10Data* block10_data_ref (Block10Data* _data10_);
static void block10_data_unref (void * _userdata_);
static Block11Data* block11_data_ref (Block11Data* _data11_);
static void block11_data_unref (void * _userdata_);
static void ___lambda60_ (Block11Data* _data11_,
                   GdkAtom target);
VALA_EXTERN void gnome_pie_pie_move_group (GnomePiePie* self,
                               gint from,
                               gint to);
VALA_EXTERN void gnome_pie_pie_preview_renderer_show_hidden_group_at (GnomePiePiePreviewRenderer* self,
                                                          gint index);
VALA_EXTERN GType gnome_pie_pie_preview_slice_renderer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePiePiePreviewSliceRenderer, g_object_unref)
static void ____lambda60__gfunc (gconstpointer data,
                          gpointer self);
VALA_EXTERN GType gnome_pie_action_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GnomePieAction, g_object_unref)
VALA_EXTERN void gnome_pie_pie_add_action (GnomePiePie* self,
                               GnomePieAction* action,
                               gint at_position);
VALA_EXTERN GnomePieAction* gnome_pie_action_registry_new_for_uri (const gchar* uri,
                                                       const gchar* name);
static void gnome_pie_pie_preview_finalize (GObject * obj);
static GType gnome_pie_pie_preview_get_type_once (void);
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 gssize _vala_array_length (gpointer array);

static inline gpointer
gnome_pie_pie_preview_get_instance_private (GnomePiePiePreview* self)
{
	return G_STRUCT_MEMBER_P (self, GnomePiePiePreview_private_offset);
}

static gboolean
_gnome_pie_pie_preview_on_draw_gtk_widget_draw (GtkWidget* _sender,
                                                cairo_t* cr,
                                                gpointer self)
{
	gboolean result;
	result = gnome_pie_pie_preview_on_draw ((GnomePiePiePreview*) self, cr);
	return result;
}

static void
_gnome_pie_pie_preview_on_start_drag_gtk_widget_drag_begin (GtkWidget* _sender,
                                                            GdkDragContext* context,
                                                            gpointer self)
{
	gnome_pie_pie_preview_on_start_drag ((GnomePiePiePreview*) self, context);
}

static void
_gnome_pie_pie_preview_on_end_drag_gtk_widget_drag_end (GtkWidget* _sender,
                                                        GdkDragContext* context,
                                                        gpointer self)
{
	gnome_pie_pie_preview_on_end_drag ((GnomePiePiePreview*) self, context);
}

static void
_gnome_pie_pie_preview_on_dnd_received_gtk_widget_drag_data_received (GtkWidget* _sender,
                                                                      GdkDragContext* context,
                                                                      gint x,
                                                                      gint y,
                                                                      GtkSelectionData* selection_data,
                                                                      guint info,
                                                                      guint time_,
                                                                      gpointer self)
{
	gnome_pie_pie_preview_on_dnd_received ((GnomePiePiePreview*) self, context, x, y, selection_data, info, time_);
}

static gboolean
_gnome_pie_pie_preview_on_drag_move_gtk_widget_drag_motion (GtkWidget* _sender,
                                                            GdkDragContext* context,
                                                            gint x,
                                                            gint y,
                                                            guint time_,
                                                            gpointer self)
{
	gboolean result;
	result = gnome_pie_pie_preview_on_drag_move ((GnomePiePiePreview*) self, context, x, y, time_);
	return result;
}

static gboolean
_gnome_pie_pie_preview_on_mouse_leave_gtk_widget_leave_notify_event (GtkWidget* _sender,
                                                                     GdkEventCrossing* event,
                                                                     gpointer self)
{
	gboolean result;
	result = gnome_pie_pie_preview_on_mouse_leave ((GnomePiePiePreview*) self, event);
	return result;
}

static gboolean
_gnome_pie_pie_preview_on_mouse_enter_gtk_widget_enter_notify_event (GtkWidget* _sender,
                                                                     GdkEventCrossing* event,
                                                                     gpointer self)
{
	gboolean result;
	result = gnome_pie_pie_preview_on_mouse_enter ((GnomePiePiePreview*) self, event);
	return result;
}

static gboolean
_gnome_pie_pie_preview_on_mouse_move_gtk_widget_motion_notify_event (GtkWidget* _sender,
                                                                     GdkEventMotion* event,
                                                                     gpointer self)
{
	gboolean result;
	result = gnome_pie_pie_preview_on_mouse_move ((GnomePiePiePreview*) self, event);
	return result;
}

static gboolean
_gnome_pie_pie_preview_on_button_release_gtk_widget_button_release_event (GtkWidget* _sender,
                                                                          GdkEventButton* event,
                                                                          gpointer self)
{
	gboolean result;
	result = gnome_pie_pie_preview_on_button_release ((GnomePiePiePreview*) self);
	return result;
}

static gboolean
_gnome_pie_pie_preview_on_button_press_gtk_widget_button_press_event (GtkWidget* _sender,
                                                                      GdkEventButton* event,
                                                                      gpointer self)
{
	gboolean result;
	result = gnome_pie_pie_preview_on_button_press ((GnomePiePiePreview*) self);
	return result;
}

static void
__lambda61_ (GnomePiePiePreview* self,
             GnomePieActionGroup* new_action,
             gboolean as_new_slice,
             gint at_position)
{
	GnomePiePie* pie = NULL;
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	const gchar* _tmp2_;
	gpointer _tmp3_;
	g_return_if_fail (new_action != NULL);
	_tmp0_ = gnome_pie_pie_manager_get_all_pies ();
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->current_id;
	_tmp3_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp1_, _tmp2_);
	pie = (GnomePiePie*) _tmp3_;
	if (gnome_pie_action_group_has_quickaction (new_action)) {
		GnomePiePiePreviewRenderer* _tmp4_;
		_tmp4_ = self->priv->renderer;
		gnome_pie_pie_preview_renderer_disable_quickactions (_tmp4_);
	}
	if (as_new_slice) {
		GnomePiePie* _tmp5_;
		GnomePiePiePreviewRenderer* _tmp6_;
		GnomePiePiePreviewRenderer* _tmp7_;
		_tmp5_ = pie;
		gnome_pie_pie_add_group (_tmp5_, new_action, at_position + 1);
		_tmp6_ = self->priv->renderer;
		gnome_pie_pie_preview_renderer_add_group (_tmp6_, new_action, at_position + 1);
		_tmp7_ = self->priv->renderer;
		if (gnome_pie_pie_preview_renderer_slice_count (_tmp7_) == 1) {
			g_signal_emit (self, gnome_pie_pie_preview_signals[GNOME_PIE_PIE_PREVIEW_ON_FIRST_SLICE_ADDED_SIGNAL], 0);
		}
	} else {
		GnomePiePie* _tmp8_;
		GnomePiePiePreviewRenderer* _tmp9_;
		_tmp8_ = pie;
		gnome_pie_pie_update_group (_tmp8_, new_action, at_position);
		_tmp9_ = self->priv->renderer;
		gnome_pie_pie_preview_renderer_update_group (_tmp9_, new_action, at_position);
	}
	_g_object_unref0 (pie);
}

static void
___lambda61__gnome_pie_new_slice_window_on_select (GnomePieNewSliceWindow* _sender,
                                                   GnomePieActionGroup* action,
                                                   gboolean as_new_slice,
                                                   gint at_position,
                                                   gpointer self)
{
	__lambda61_ ((GnomePiePiePreview*) self, action, as_new_slice, at_position);
}

static void
__lambda62_ (GnomePiePiePreview* self,
             gint pos)
{
	GnomePieNewSliceWindow* _tmp0_;
	GnomePieNewSliceWindow* _tmp1_;
	GtkWidget* _tmp2_;
	GnomePieNewSliceWindow* _tmp3_;
	GnomePiePie* pie = NULL;
	GeeHashMap* _tmp4_;
	GeeHashMap* _tmp5_;
	const gchar* _tmp6_;
	gpointer _tmp7_;
	GnomePieNewSliceWindow* _tmp8_;
	GeeArrayList* _tmp9_;
	GeeArrayList* _tmp10_;
	gpointer _tmp11_;
	GnomePieActionGroup* _tmp12_;
	_tmp0_ = self->priv->new_slice_window;
	gnome_pie_new_slice_window_reload (_tmp0_);
	_tmp1_ = self->priv->new_slice_window;
	_tmp2_ = gtk_widget_get_toplevel ((GtkWidget*) self);
	gnome_pie_new_slice_window_set_parent (_tmp1_, G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, gtk_window_get_type ()) ? ((GtkWindow*) _tmp2_) : NULL);
	_tmp3_ = self->priv->new_slice_window;
	gnome_pie_new_slice_window_show (_tmp3_);
	_tmp4_ = gnome_pie_pie_manager_get_all_pies ();
	_tmp5_ = _tmp4_;
	_tmp6_ = self->priv->current_id;
	_tmp7_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp5_, _tmp6_);
	pie = (GnomePiePie*) _tmp7_;
	_tmp8_ = self->priv->new_slice_window;
	_tmp9_ = gnome_pie_pie_get_action_groups (pie);
	_tmp10_ = _tmp9_;
	_tmp11_ = gee_abstract_list_get ((GeeAbstractList*) _tmp10_, pos);
	_tmp12_ = (GnomePieActionGroup*) _tmp11_;
	gnome_pie_new_slice_window_set_action (_tmp8_, _tmp12_, pos);
	_g_object_unref0 (_tmp12_);
	_g_object_unref0 (pie);
}

static void
___lambda62__gnome_pie_pie_preview_renderer_on_edit_slice (GnomePiePiePreviewRenderer* _sender,
                                                           gint position,
                                                           gpointer self)
{
	__lambda62_ ((GnomePiePiePreview*) self, position);
}

static void
__lambda63_ (GnomePiePiePreview* self,
             gint pos)
{
	GnomePieNewSliceWindow* _tmp0_;
	GnomePieNewSliceWindow* _tmp1_;
	GtkWidget* _tmp2_;
	GnomePieNewSliceWindow* _tmp3_;
	GnomePieNewSliceWindow* _tmp4_;
	const gchar* _tmp5_;
	_tmp0_ = self->priv->new_slice_window;
	gnome_pie_new_slice_window_reload (_tmp0_);
	_tmp1_ = self->priv->new_slice_window;
	_tmp2_ = gtk_widget_get_toplevel ((GtkWidget*) self);
	gnome_pie_new_slice_window_set_parent (_tmp1_, G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, gtk_window_get_type ()) ? ((GtkWindow*) _tmp2_) : NULL);
	_tmp3_ = self->priv->new_slice_window;
	gnome_pie_new_slice_window_show (_tmp3_);
	_tmp4_ = self->priv->new_slice_window;
	_tmp5_ = self->priv->current_id;
	gnome_pie_new_slice_window_set_default (_tmp4_, _tmp5_, pos);
}

static void
___lambda63__gnome_pie_pie_preview_renderer_on_add_slice (GnomePiePiePreviewRenderer* _sender,
                                                          gint position,
                                                          gpointer self)
{
	__lambda63_ ((GnomePiePiePreview*) self, position);
}

static Block9Data*
block9_data_ref (Block9Data* _data9_)
{
	g_atomic_int_inc (&_data9_->_ref_count_);
	return _data9_;
}

static void
block9_data_unref (void * _userdata_)
{
	Block9Data* _data9_;
	_data9_ = (Block9Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data9_->_ref_count_)) {
		GnomePiePiePreview* self;
		self = _data9_->self;
		_g_object_unref0 (self);
		g_slice_free (Block9Data, _data9_);
	}
}

static void
__lambda65_ (Block9Data* _data9_,
             gint response)
{
	GnomePiePiePreview* self;
	self = _data9_->self;
	if (response == ((gint) GTK_RESPONSE_YES)) {
		GnomePiePie* pie = NULL;
		GeeHashMap* _tmp0_;
		GeeHashMap* _tmp1_;
		const gchar* _tmp2_;
		gpointer _tmp3_;
		GnomePiePie* _tmp4_;
		GnomePiePiePreviewRenderer* _tmp5_;
		GnomePiePiePreviewRenderer* _tmp6_;
		_tmp0_ = gnome_pie_pie_manager_get_all_pies ();
		_tmp1_ = _tmp0_;
		_tmp2_ = self->priv->current_id;
		_tmp3_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp1_, _tmp2_);
		pie = (GnomePiePie*) _tmp3_;
		_tmp4_ = pie;
		gnome_pie_pie_remove_group (_tmp4_, _data9_->pos);
		_tmp5_ = self->priv->renderer;
		gnome_pie_pie_preview_renderer_remove_group (_tmp5_, _data9_->pos);
		_tmp6_ = self->priv->renderer;
		if (gnome_pie_pie_preview_renderer_slice_count (_tmp6_) == 0) {
			g_signal_emit (self, gnome_pie_pie_preview_signals[GNOME_PIE_PIE_PREVIEW_ON_LAST_SLICE_REMOVED_SIGNAL], 0);
		}
		_g_object_unref0 (pie);
	}
}

static void
___lambda65__gtk_dialog_response (GtkDialog* _sender,
                                  gint response_id,
                                  gpointer self)
{
	__lambda65_ (self, response_id);
}

static void
__lambda64_ (GnomePiePiePreview* self,
             gint pos)
{
	Block9Data* _data9_;
	GtkMessageDialog* dialog = NULL;
	GtkWidget* _tmp0_;
	GtkMessageDialog* _tmp1_;
	_data9_ = g_slice_new0 (Block9Data);
	_data9_->_ref_count_ = 1;
	_data9_->self = g_object_ref (self);
	_data9_->pos = pos;
	_tmp0_ = gtk_widget_get_toplevel ((GtkWidget*) self);
	_tmp1_ = (GtkMessageDialog*) gtk_message_dialog_new (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, gtk_window_get_type ()) ? ((GtkWindow*) _tmp0_) : NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, "%s", _ ("Do you really want to delete this Slice?"));
	g_object_ref_sink (_tmp1_);
	dialog = _tmp1_;
	g_signal_connect_data ((GtkDialog*) dialog, "response", (GCallback) ___lambda65__gtk_dialog_response, block9_data_ref (_data9_), (GClosureNotify) block9_data_unref, 0);
	gtk_dialog_run ((GtkDialog*) dialog);
	gtk_widget_destroy ((GtkWidget*) dialog);
	_g_object_unref0 (dialog);
	block9_data_unref (_data9_);
	_data9_ = NULL;
}

static void
___lambda64__gnome_pie_pie_preview_renderer_on_remove_slice (GnomePiePiePreviewRenderer* _sender,
                                                             gint position,
                                                             gpointer self)
{
	__lambda64_ ((GnomePiePiePreview*) self, position);
}

GnomePiePiePreview*
gnome_pie_pie_preview_construct (GType object_type)
{
	GnomePiePiePreview * self = NULL;
	GnomePiePiePreviewRenderer* _tmp0_;
	GTimer* _tmp1_;
	GtkTargetEntry uri_dest = {0};
	GtkTargetEntry _tmp2_ = {0};
	GtkTargetEntry text_dest = {0};
	GtkTargetEntry _tmp3_ = {0};
	GtkTargetEntry slice_dest = {0};
	GtkTargetEntry _tmp4_ = {0};
	GtkTargetEntry* destinations = NULL;
	GtkTargetEntry _tmp5_;
	GtkTargetEntry _tmp6_;
	GtkTargetEntry _tmp7_;
	GtkTargetEntry* _tmp8_;
	gint destinations_length1;
	gint _destinations_size_;
	GnomePieNewSliceWindow* _tmp9_;
	GnomePieNewSliceWindow* _tmp10_;
	GnomePiePiePreviewRenderer* _tmp11_;
	GnomePiePiePreviewRenderer* _tmp12_;
	GnomePiePiePreviewRenderer* _tmp13_;
	self = (GnomePiePiePreview*) g_object_new (object_type, NULL);
	_tmp0_ = gnome_pie_pie_preview_renderer_new ((GtkDrawingArea*) self);
	_g_object_unref0 (self->priv->renderer);
	self->priv->renderer = _tmp0_;
	g_signal_connect_object ((GtkWidget*) self, "draw", (GCallback) _gnome_pie_pie_preview_on_draw_gtk_widget_draw, self, 0);
	_tmp1_ = g_timer_new ();
	_g_timer_destroy0 (self->priv->timer);
	self->priv->timer = _tmp1_;
	gtk_widget_set_events ((GtkWidget*) self, (gint) ((GDK_POINTER_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK) | GDK_ENTER_NOTIFY_MASK));
	gnome_pie_pie_preview_enable_drag_source (self);
	_tmp2_.target = "text/uri-list";
	_tmp2_.flags = (guint) 0;
	_tmp2_.info = (guint) 0;
	uri_dest = _tmp2_;
	_tmp3_.target = "text/plain";
	_tmp3_.flags = (guint) 0;
	_tmp3_.info = (guint) 0;
	text_dest = _tmp3_;
	_tmp4_.target = "text/plain";
	_tmp4_.flags = (guint) GTK_TARGET_SAME_WIDGET;
	_tmp4_.info = (guint) 0;
	slice_dest = _tmp4_;
	_tmp5_ = uri_dest;
	_tmp6_ = text_dest;
	_tmp7_ = slice_dest;
	_tmp8_ = g_new0 (GtkTargetEntry, 3);
	_tmp8_[0] = _tmp5_;
	_tmp8_[1] = _tmp6_;
	_tmp8_[2] = _tmp7_;
	destinations = _tmp8_;
	destinations_length1 = 3;
	_destinations_size_ = destinations_length1;
	gtk_drag_dest_set ((GtkWidget*) self, GTK_DEST_DEFAULT_ALL, destinations, (gint) destinations_length1, (GDK_ACTION_COPY | GDK_ACTION_MOVE) | GDK_ACTION_LINK);
	g_signal_connect_object ((GtkWidget*) self, "drag-begin", (GCallback) _gnome_pie_pie_preview_on_start_drag_gtk_widget_drag_begin, self, 0);
	g_signal_connect_object ((GtkWidget*) self, "drag-end", (GCallback) _gnome_pie_pie_preview_on_end_drag_gtk_widget_drag_end, self, 0);
	g_signal_connect_object ((GtkWidget*) self, "drag-data-received", (GCallback) _gnome_pie_pie_preview_on_dnd_received_gtk_widget_drag_data_received, self, 0);
	g_signal_connect_object ((GtkWidget*) self, "drag-motion", (GCallback) _gnome_pie_pie_preview_on_drag_move_gtk_widget_drag_motion, self, 0);
	g_signal_connect_object ((GtkWidget*) self, "leave-notify-event", (GCallback) _gnome_pie_pie_preview_on_mouse_leave_gtk_widget_leave_notify_event, self, 0);
	g_signal_connect_object ((GtkWidget*) self, "enter-notify-event", (GCallback) _gnome_pie_pie_preview_on_mouse_enter_gtk_widget_enter_notify_event, self, 0);
	g_signal_connect_object ((GtkWidget*) self, "motion-notify-event", (GCallback) _gnome_pie_pie_preview_on_mouse_move_gtk_widget_motion_notify_event, self, G_CONNECT_AFTER);
	g_signal_connect_object ((GtkWidget*) self, "button-release-event", (GCallback) _gnome_pie_pie_preview_on_button_release_gtk_widget_button_release_event, self, G_CONNECT_AFTER);
	g_signal_connect_object ((GtkWidget*) self, "button-press-event", (GCallback) _gnome_pie_pie_preview_on_button_press_gtk_widget_button_press_event, self, G_CONNECT_AFTER);
	_tmp9_ = gnome_pie_new_slice_window_new ();
	_g_object_unref0 (self->priv->new_slice_window);
	self->priv->new_slice_window = _tmp9_;
	_tmp10_ = self->priv->new_slice_window;
	g_signal_connect_object (_tmp10_, "on-select", (GCallback) ___lambda61__gnome_pie_new_slice_window_on_select, self, 0);
	_tmp11_ = self->priv->renderer;
	g_signal_connect_object (_tmp11_, "on-edit-slice", (GCallback) ___lambda62__gnome_pie_pie_preview_renderer_on_edit_slice, self, 0);
	_tmp12_ = self->priv->renderer;
	g_signal_connect_object (_tmp12_, "on-add-slice", (GCallback) ___lambda63__gnome_pie_pie_preview_renderer_on_add_slice, self, 0);
	_tmp13_ = self->priv->renderer;
	g_signal_connect_object (_tmp13_, "on-remove-slice", (GCallback) ___lambda64__gnome_pie_pie_preview_renderer_on_remove_slice, self, 0);
	destinations = (g_free (destinations), NULL);
	return self;
}

GnomePiePiePreview*
gnome_pie_pie_preview_new (void)
{
	return gnome_pie_pie_preview_construct (GNOME_PIE_TYPE_PIE_PREVIEW);
}

void
gnome_pie_pie_preview_set_pie (GnomePiePiePreview* self,
                               const gchar* id)
{
	gchar* _tmp0_;
	GnomePiePiePreviewRenderer* _tmp1_;
	GeeHashMap* _tmp2_;
	GeeHashMap* _tmp3_;
	gpointer _tmp4_;
	GnomePiePie* _tmp5_;
	const gchar* _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (id != NULL);
	_tmp0_ = g_strdup (id);
	_g_free0 (self->priv->current_id);
	self->priv->current_id = _tmp0_;
	_tmp1_ = self->priv->renderer;
	_tmp2_ = gnome_pie_pie_manager_get_all_pies ();
	_tmp3_ = _tmp2_;
	_tmp4_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp3_, id);
	_tmp5_ = (GnomePiePie*) _tmp4_;
	gnome_pie_pie_preview_renderer_load_pie (_tmp1_, _tmp5_);
	_g_object_unref0 (_tmp5_);
	_tmp6_ = self->priv->drag_start_id;
	if (g_strcmp0 (id, _tmp6_) == 0) {
		GnomePiePiePreviewRenderer* _tmp7_;
		_tmp7_ = self->priv->renderer;
		gnome_pie_pie_preview_renderer_hide_group (_tmp7_, self->priv->drag_start_index);
	}
}

static gboolean
__lambda66_ (GnomePiePiePreview* self)
{
	GtkWidget* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean result;
	gtk_widget_queue_draw ((GtkWidget*) self);
	_tmp0_ = gtk_widget_get_toplevel ((GtkWidget*) self);
	_tmp1_ = gtk_widget_get_visible (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

static gboolean
___lambda66__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda66_ ((GnomePiePiePreview*) self);
	return result;
}

void
gnome_pie_pie_preview_draw_loop (GnomePiePiePreview* self)
{
	GTimer* _tmp0_;
	GnomePieConfig* _tmp1_;
	GnomePieConfig* _tmp2_;
	gdouble _tmp3_;
	gdouble _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->timer;
	g_timer_start (_tmp0_);
	gtk_widget_queue_draw ((GtkWidget*) self);
	_tmp1_ = gnome_pie_config_get_global ();
	_tmp2_ = _tmp1_;
	_tmp3_ = gnome_pie_config_get_refresh_rate (_tmp2_);
	_tmp4_ = _tmp3_;
	g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) (1000.0 / _tmp4_), ___lambda66__gsource_func, g_object_ref (self), g_object_unref);
}

static gboolean
gnome_pie_pie_preview_on_draw (GnomePiePiePreview* self,
                               cairo_t* ctx)
{
	gdouble frame_time = 0.0;
	GTimer* _tmp0_;
	GTimer* _tmp1_;
	GtkAllocation allocation = {0};
	GtkAllocation _tmp2_ = {0};
	GtkAllocation _tmp3_;
	GtkAllocation _tmp4_;
	GnomePiePiePreviewRenderer* _tmp5_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (ctx != NULL, FALSE);
	_tmp0_ = self->priv->timer;
	frame_time = g_timer_elapsed (_tmp0_, NULL);
	_tmp1_ = self->priv->timer;
	g_timer_reset (_tmp1_);
	gtk_widget_get_allocation ((GtkWidget*) self, &_tmp2_);
	allocation = _tmp2_;
	_tmp3_ = allocation;
	_tmp4_ = allocation;
	cairo_translate (ctx, (gdouble) ((gint) (_tmp3_.width * 0.5)), (gdouble) ((gint) (_tmp4_.height * 0.5)));
	_tmp5_ = self->priv->renderer;
	gnome_pie_pie_preview_renderer_draw (_tmp5_, frame_time, ctx);
	result = TRUE;
	return result;
}

gboolean
gnome_pie_pie_preview_on_mouse_leave (GnomePiePiePreview* self,
                                      GdkEventCrossing* event)
{
	GnomePiePiePreviewRenderer* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = self->priv->renderer;
	gnome_pie_pie_preview_renderer_on_mouse_leave (_tmp0_);
	result = TRUE;
	return result;
}

gboolean
gnome_pie_pie_preview_on_mouse_enter (GnomePiePiePreview* self,
                                      GdkEventCrossing* event)
{
	GnomePiePiePreviewRenderer* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = self->priv->renderer;
	gnome_pie_pie_preview_renderer_on_mouse_enter (_tmp0_);
	result = TRUE;
	return result;
}

static gboolean
gnome_pie_pie_preview_on_mouse_move (GnomePiePiePreview* self,
                                     GdkEventMotion* event)
{
	GnomePiePiePreviewRenderer* _tmp0_;
	GtkAllocation allocation = {0};
	GtkAllocation _tmp1_ = {0};
	GnomePiePiePreviewRenderer* _tmp2_;
	GtkAllocation _tmp3_;
	GtkAllocation _tmp4_;
	GnomePiePiePreviewRenderer* _tmp5_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = self->priv->renderer;
	gnome_pie_pie_preview_renderer_set_dnd_mode (_tmp0_, FALSE);
	gtk_widget_get_allocation ((GtkWidget*) self, &_tmp1_);
	allocation = _tmp1_;
	_tmp2_ = self->priv->renderer;
	_tmp3_ = allocation;
	_tmp4_ = allocation;
	gnome_pie_pie_preview_renderer_on_mouse_move (_tmp2_, event->x - (_tmp3_.width * 0.5), event->y - (_tmp4_.height * 0.5));
	_tmp5_ = self->priv->renderer;
	if (gnome_pie_pie_preview_renderer_get_active_slice (_tmp5_) < 0) {
		gnome_pie_pie_preview_disable_drag_source (self);
	} else {
		gnome_pie_pie_preview_enable_drag_source (self);
	}
	result = TRUE;
	return result;
}

static gboolean
gnome_pie_pie_preview_on_button_press (GnomePiePiePreview* self)
{
	GnomePiePiePreviewRenderer* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->renderer;
	gnome_pie_pie_preview_renderer_on_button_press (_tmp0_);
	result = TRUE;
	return result;
}

static gboolean
gnome_pie_pie_preview_on_button_release (GnomePiePiePreview* self)
{
	GnomePiePiePreviewRenderer* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->renderer;
	_tmp1_ = gnome_pie_pie_preview_renderer_get_drag_n_drop_mode (_tmp0_);
	_tmp2_ = _tmp1_;
	if (!_tmp2_) {
		GnomePiePiePreviewRenderer* _tmp3_;
		_tmp3_ = self->priv->renderer;
		gnome_pie_pie_preview_renderer_on_button_release (_tmp3_);
	}
	result = TRUE;
	return result;
}

static gboolean
gnome_pie_pie_preview_on_drag_move (GnomePiePiePreview* self,
                                    GdkDragContext* ctx,
                                    gint x,
                                    gint y,
                                    guint time)
{
	GnomePiePiePreviewRenderer* _tmp0_;
	GtkAllocation allocation = {0};
	GtkAllocation _tmp1_ = {0};
	GnomePiePiePreviewRenderer* _tmp2_;
	GtkAllocation _tmp3_;
	GtkAllocation _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (ctx != NULL, FALSE);
	_tmp0_ = self->priv->renderer;
	gnome_pie_pie_preview_renderer_set_dnd_mode (_tmp0_, TRUE);
	gtk_widget_get_allocation ((GtkWidget*) self, &_tmp1_);
	allocation = _tmp1_;
	_tmp2_ = self->priv->renderer;
	_tmp3_ = allocation;
	_tmp4_ = allocation;
	gnome_pie_pie_preview_renderer_on_mouse_move (_tmp2_, x - (_tmp3_.width * 0.5), y - (_tmp4_.height * 0.5));
	result = TRUE;
	return result;
}

static void
gnome_pie_pie_preview_on_start_drag (GnomePiePiePreview* self,
                                     GdkDragContext* ctx)
{
	GnomePiePiePreviewRenderer* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	GnomePieIcon* icon = NULL;
	GnomePiePiePreviewRenderer* _tmp3_;
	GnomePieIcon* _tmp4_;
	GdkPixbuf* pixbuf = NULL;
	GdkPixbuf* _tmp5_;
	GnomePiePiePreviewRenderer* _tmp6_;
	GnomePiePiePreviewRenderer* _tmp7_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (ctx != NULL);
	_tmp0_ = self->priv->renderer;
	self->priv->drag_start_index = gnome_pie_pie_preview_renderer_get_active_slice (_tmp0_);
	_tmp1_ = self->priv->current_id;
	_tmp2_ = g_strdup (_tmp1_);
	_g_free0 (self->priv->drag_start_id);
	self->priv->drag_start_id = _tmp2_;
	_tmp3_ = self->priv->renderer;
	_tmp4_ = gnome_pie_pie_preview_renderer_get_active_icon (_tmp3_);
	icon = _tmp4_;
	_tmp5_ = gnome_pie_image_to_pixbuf ((GnomePieImage*) icon);
	pixbuf = _tmp5_;
	_tmp6_ = self->priv->renderer;
	gnome_pie_pie_preview_renderer_hide_group (_tmp6_, self->priv->drag_start_index);
	gtk_drag_set_icon_pixbuf (ctx, pixbuf, gnome_pie_icon_size (icon) / 2, gnome_pie_icon_size (icon) / 2);
	_tmp7_ = self->priv->renderer;
	gnome_pie_pie_preview_renderer_set_dnd_mode (_tmp7_, TRUE);
	_g_object_unref0 (pixbuf);
	_g_object_unref0 (icon);
}

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

static Block10Data*
block10_data_ref (Block10Data* _data10_)
{
	g_atomic_int_inc (&_data10_->_ref_count_);
	return _data10_;
}

static void
block10_data_unref (void * _userdata_)
{
	Block10Data* _data10_;
	_data10_ = (Block10Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data10_->_ref_count_)) {
		GnomePiePiePreview* self;
		self = _data10_->self;
		_g_object_unref0 (_data10_->context);
		_g_object_unref0 (self);
		g_slice_free (Block10Data, _data10_);
	}
}

static Block11Data*
block11_data_ref (Block11Data* _data11_)
{
	g_atomic_int_inc (&_data11_->_ref_count_);
	return _data11_;
}

static void
block11_data_unref (void * _userdata_)
{
	Block11Data* _data11_;
	_data11_ = (Block11Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data11_->_ref_count_)) {
		GnomePiePiePreview* self;
		self = _data11_->_data10_->self;
		block10_data_unref (_data11_->_data10_);
		_data11_->_data10_ = NULL;
		g_slice_free (Block11Data, _data11_);
	}
}

static void
___lambda60_ (Block11Data* _data11_,
              GdkAtom target)
{
	Block10Data* _data10_;
	GnomePiePiePreview* self;
	GdkAtom target_type = (GdkAtom) 0U;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gboolean _tmp2_;
	_data10_ = _data11_->_data10_;
	self = _data10_->self;
	target_type = (GdkAtom) target;
	_tmp0_ = gdk_atom_name (target_type);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strcmp0 (_tmp1_, "text/plain") == 0;
	_g_free0 (_tmp1_);
	if (_tmp2_) {
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		_tmp3_ = self->priv->current_id;
		_tmp4_ = self->priv->drag_start_id;
		if (g_strcmp0 (_tmp3_, _tmp4_) == 0) {
			GnomePiePie* pie = NULL;
			GeeHashMap* _tmp5_;
			GeeHashMap* _tmp6_;
			const gchar* _tmp7_;
			gpointer _tmp8_;
			GnomePiePie* _tmp9_;
			GnomePiePiePreviewRenderer* _tmp10_;
			_tmp5_ = gnome_pie_pie_manager_get_all_pies ();
			_tmp6_ = _tmp5_;
			_tmp7_ = self->priv->current_id;
			_tmp8_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp6_, _tmp7_);
			pie = (GnomePiePie*) _tmp8_;
			_tmp9_ = pie;
			gnome_pie_pie_move_group (_tmp9_, self->priv->drag_start_index, _data11_->target_index);
			_tmp10_ = self->priv->renderer;
			gnome_pie_pie_preview_renderer_show_hidden_group_at (_tmp10_, _data11_->target_index);
			_g_object_unref0 (pie);
		} else {
			GnomePiePie* src_pie = NULL;
			GeeHashMap* _tmp11_;
			GeeHashMap* _tmp12_;
			const gchar* _tmp13_;
			gpointer _tmp14_;
			GnomePiePie* dst_pie = NULL;
			GeeHashMap* _tmp15_;
			GeeHashMap* _tmp16_;
			const gchar* _tmp17_;
			gpointer _tmp18_;
			GnomePiePie* _tmp19_;
			GnomePiePie* _tmp20_;
			GeeArrayList* _tmp21_;
			GeeArrayList* _tmp22_;
			gpointer _tmp23_;
			GnomePieActionGroup* _tmp24_;
			GnomePiePiePreviewRenderer* _tmp25_;
			GnomePiePie* _tmp26_;
			GeeArrayList* _tmp27_;
			GeeArrayList* _tmp28_;
			gpointer _tmp29_;
			GnomePieActionGroup* _tmp30_;
			GnomePiePiePreviewRenderer* _tmp31_;
			GeeArrayList* _tmp32_;
			gint _tmp33_;
			gint _tmp34_;
			_tmp11_ = gnome_pie_pie_manager_get_all_pies ();
			_tmp12_ = _tmp11_;
			_tmp13_ = self->priv->drag_start_id;
			_tmp14_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp12_, _tmp13_);
			src_pie = (GnomePiePie*) _tmp14_;
			_tmp15_ = gnome_pie_pie_manager_get_all_pies ();
			_tmp16_ = _tmp15_;
			_tmp17_ = self->priv->current_id;
			_tmp18_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp16_, _tmp17_);
			dst_pie = (GnomePiePie*) _tmp18_;
			_tmp19_ = dst_pie;
			_tmp20_ = src_pie;
			_tmp21_ = gnome_pie_pie_get_action_groups (_tmp20_);
			_tmp22_ = _tmp21_;
			_tmp23_ = gee_abstract_list_get ((GeeAbstractList*) _tmp22_, self->priv->drag_start_index);
			_tmp24_ = (GnomePieActionGroup*) _tmp23_;
			gnome_pie_pie_add_group (_tmp19_, _tmp24_, _data11_->target_index);
			_g_object_unref0 (_tmp24_);
			_tmp25_ = self->priv->renderer;
			_tmp26_ = dst_pie;
			_tmp27_ = gnome_pie_pie_get_action_groups (_tmp26_);
			_tmp28_ = _tmp27_;
			_tmp29_ = gee_abstract_list_get ((GeeAbstractList*) _tmp28_, _data11_->target_index);
			_tmp30_ = (GnomePieActionGroup*) _tmp29_;
			gnome_pie_pie_preview_renderer_add_group (_tmp25_, _tmp30_, _data11_->target_index);
			_g_object_unref0 (_tmp30_);
			_tmp31_ = self->priv->renderer;
			_tmp32_ = _tmp31_->slices;
			_tmp33_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp32_);
			_tmp34_ = _tmp33_;
			if (_tmp34_ == 1) {
				g_signal_emit (self, gnome_pie_pie_preview_signals[GNOME_PIE_PIE_PREVIEW_ON_FIRST_SLICE_ADDED_SIGNAL], 0);
			}
			if ((gdk_drag_context_get_actions (_data10_->context) & GDK_ACTION_COPY) == 0) {
				GnomePiePie* _tmp35_;
				_tmp35_ = src_pie;
				gnome_pie_pie_remove_group (_tmp35_, self->priv->drag_start_index);
			}
			_g_object_unref0 (dst_pie);
			_g_object_unref0 (src_pie);
		}
	}
}

static void
____lambda60__gfunc (gconstpointer data,
                     gpointer self)
{
	___lambda60_ (self, (GdkAtom) ((guintptr) data));
}

static void
gnome_pie_pie_preview_on_end_drag (GnomePiePiePreview* self,
                                   GdkDragContext* context)
{
	Block10Data* _data10_;
	GdkDragContext* _tmp0_;
	GList* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (context != NULL);
	_data10_ = g_slice_new0 (Block10Data);
	_data10_->_ref_count_ = 1;
	_data10_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (context);
	_g_object_unref0 (_data10_->context);
	_data10_->context = _tmp0_;
	_tmp1_ = gdk_drag_context_list_targets (_data10_->context);
	if (_tmp1_ != NULL) {
		Block11Data* _data11_;
		GnomePiePiePreviewRenderer* _tmp2_;
		GnomePiePiePreviewRenderer* _tmp3_;
		GList* _tmp4_;
		gchar* _tmp5_;
		_data11_ = g_slice_new0 (Block11Data);
		_data11_->_ref_count_ = 1;
		_data11_->_data10_ = block10_data_ref (_data10_);
		_tmp2_ = self->priv->renderer;
		_data11_->target_index = gnome_pie_pie_preview_renderer_get_active_slice (_tmp2_);
		_tmp3_ = self->priv->renderer;
		gnome_pie_pie_preview_renderer_set_dnd_mode (_tmp3_, FALSE);
		_tmp4_ = gdk_drag_context_list_targets (_data10_->context);
		g_list_foreach (_tmp4_, ____lambda60__gfunc, _data11_);
		self->priv->drag_start_index = -1;
		_tmp5_ = g_strdup ("");
		_g_free0 (self->priv->drag_start_id);
		self->priv->drag_start_id = _tmp5_;
		block11_data_unref (_data11_);
		_data11_ = NULL;
	}
	block10_data_unref (_data10_);
	_data10_ = NULL;
}

static void
gnome_pie_pie_preview_on_dnd_received (GnomePiePiePreview* self,
                                       GdkDragContext* context,
                                       gint x,
                                       gint y,
                                       GtkSelectionData* selection_data,
                                       guint info,
                                       guint time_)
{
	GnomePiePie* pie = NULL;
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	const gchar* _tmp2_;
	gpointer _tmp3_;
	gint position = 0;
	GnomePiePiePreviewRenderer* _tmp4_;
	GnomePiePiePreviewRenderer* _tmp5_;
	gchar* text = NULL;
	gchar* _tmp6_;
	gboolean _tmp7_ = FALSE;
	const gchar* _tmp8_;
	gchar** _tmp26_;
	gchar** _tmp27_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (context != NULL);
	g_return_if_fail (selection_data != NULL);
	_tmp0_ = gnome_pie_pie_manager_get_all_pies ();
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->current_id;
	_tmp3_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp1_, _tmp2_);
	pie = (GnomePiePie*) _tmp3_;
	_tmp4_ = self->priv->renderer;
	position = gnome_pie_pie_preview_renderer_get_active_slice (_tmp4_);
	_tmp5_ = self->priv->renderer;
	gnome_pie_pie_preview_renderer_set_dnd_mode (_tmp5_, FALSE);
	_tmp6_ = gtk_selection_data_get_text (selection_data);
	text = _tmp6_;
	_tmp8_ = text;
	if (_tmp8_ != NULL) {
		const gchar* _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		_tmp9_ = text;
		_tmp10_ = g_uri_parse_scheme (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp7_ = _tmp11_ != NULL;
		_g_free0 (_tmp11_);
	} else {
		_tmp7_ = FALSE;
	}
	if (_tmp7_) {
		GnomePiePie* _tmp12_;
		const gchar* _tmp13_;
		GnomePieAction* _tmp14_;
		GnomePieAction* _tmp15_;
		GnomePiePiePreviewRenderer* _tmp16_;
		GnomePiePie* _tmp17_;
		GeeArrayList* _tmp18_;
		GeeArrayList* _tmp19_;
		gpointer _tmp20_;
		GnomePieActionGroup* _tmp21_;
		GnomePiePiePreviewRenderer* _tmp22_;
		GeeArrayList* _tmp23_;
		gint _tmp24_;
		gint _tmp25_;
		_tmp12_ = pie;
		_tmp13_ = text;
		_tmp14_ = gnome_pie_action_registry_new_for_uri (_tmp13_, NULL);
		_tmp15_ = _tmp14_;
		gnome_pie_pie_add_action (_tmp12_, _tmp15_, position);
		_g_object_unref0 (_tmp15_);
		_tmp16_ = self->priv->renderer;
		_tmp17_ = pie;
		_tmp18_ = gnome_pie_pie_get_action_groups (_tmp17_);
		_tmp19_ = _tmp18_;
		_tmp20_ = gee_abstract_list_get ((GeeAbstractList*) _tmp19_, position);
		_tmp21_ = (GnomePieActionGroup*) _tmp20_;
		gnome_pie_pie_preview_renderer_add_group (_tmp16_, _tmp21_, position);
		_g_object_unref0 (_tmp21_);
		_tmp22_ = self->priv->renderer;
		_tmp23_ = _tmp22_->slices;
		_tmp24_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp23_);
		_tmp25_ = _tmp24_;
		if (_tmp25_ == 1) {
			g_signal_emit (self, gnome_pie_pie_preview_signals[GNOME_PIE_PIE_PREVIEW_ON_FIRST_SLICE_ADDED_SIGNAL], 0);
		}
	}
	_tmp27_ = _tmp26_ = gtk_selection_data_get_uris (selection_data);
	{
		gchar** uri_collection = NULL;
		gint uri_collection_length1 = 0;
		gint _uri_collection_size_ = 0;
		gint uri_it = 0;
		uri_collection = _tmp27_;
		uri_collection_length1 = _vala_array_length (_tmp26_);
		for (uri_it = 0; uri_it < uri_collection_length1; uri_it = uri_it + 1) {
			gchar* _tmp28_;
			gchar* uri = NULL;
			_tmp28_ = g_strdup (uri_collection[uri_it]);
			uri = _tmp28_;
			{
				GnomePiePie* _tmp29_;
				const gchar* _tmp30_;
				GnomePieAction* _tmp31_;
				GnomePieAction* _tmp32_;
				GnomePiePiePreviewRenderer* _tmp33_;
				GnomePiePie* _tmp34_;
				GeeArrayList* _tmp35_;
				GeeArrayList* _tmp36_;
				gpointer _tmp37_;
				GnomePieActionGroup* _tmp38_;
				GnomePiePiePreviewRenderer* _tmp39_;
				GeeArrayList* _tmp40_;
				gint _tmp41_;
				gint _tmp42_;
				_tmp29_ = pie;
				_tmp30_ = uri;
				_tmp31_ = gnome_pie_action_registry_new_for_uri (_tmp30_, NULL);
				_tmp32_ = _tmp31_;
				gnome_pie_pie_add_action (_tmp29_, _tmp32_, position);
				_g_object_unref0 (_tmp32_);
				_tmp33_ = self->priv->renderer;
				_tmp34_ = pie;
				_tmp35_ = gnome_pie_pie_get_action_groups (_tmp34_);
				_tmp36_ = _tmp35_;
				_tmp37_ = gee_abstract_list_get ((GeeAbstractList*) _tmp36_, position);
				_tmp38_ = (GnomePieActionGroup*) _tmp37_;
				gnome_pie_pie_preview_renderer_add_group (_tmp33_, _tmp38_, position);
				_g_object_unref0 (_tmp38_);
				_tmp39_ = self->priv->renderer;
				_tmp40_ = _tmp39_->slices;
				_tmp41_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp40_);
				_tmp42_ = _tmp41_;
				if (_tmp42_ == 1) {
					g_signal_emit (self, gnome_pie_pie_preview_signals[GNOME_PIE_PIE_PREVIEW_ON_FIRST_SLICE_ADDED_SIGNAL], 0);
				}
				_g_free0 (uri);
			}
		}
		uri_collection = (_vala_array_free (uri_collection, uri_collection_length1, (GDestroyNotify) g_free), NULL);
	}
	_g_free0 (text);
	_g_object_unref0 (pie);
}

static void
gnome_pie_pie_preview_enable_drag_source (GnomePiePiePreview* self)
{
	g_return_if_fail (self != NULL);
	if (!self->priv->drag_enabled) {
		GtkTargetEntry slice_source = {0};
		GtkTargetEntry _tmp0_ = {0};
		GtkTargetEntry* sources = NULL;
		GtkTargetEntry _tmp1_;
		GtkTargetEntry* _tmp2_;
		gint sources_length1;
		gint _sources_size_;
		GtkTargetEntry* _tmp3_;
		gint _tmp3__length1;
		self->priv->drag_enabled = TRUE;
		_tmp0_.target = "text/plain";
		_tmp0_.flags = (guint) (GTK_TARGET_SAME_WIDGET | GTK_TARGET_SAME_APP);
		_tmp0_.info = (guint) 0;
		slice_source = _tmp0_;
		_tmp1_ = slice_source;
		_tmp2_ = g_new0 (GtkTargetEntry, 1);
		_tmp2_[0] = _tmp1_;
		sources = _tmp2_;
		sources_length1 = 1;
		_sources_size_ = sources_length1;
		_tmp3_ = sources;
		_tmp3__length1 = sources_length1;
		gtk_drag_source_set ((GtkWidget*) self, GDK_BUTTON1_MASK, _tmp3_, (gint) _tmp3__length1, GDK_ACTION_MOVE | GDK_ACTION_COPY);
		sources = (g_free (sources), NULL);
	}
}

static void
gnome_pie_pie_preview_disable_drag_source (GnomePiePiePreview* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->drag_enabled) {
		self->priv->drag_enabled = FALSE;
		gtk_drag_source_unset ((GtkWidget*) self);
	}
}

static void
gnome_pie_pie_preview_class_init (GnomePiePiePreviewClass * klass,
                                  gpointer klass_data)
{
	gnome_pie_pie_preview_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GnomePiePiePreview_private_offset);
	G_OBJECT_CLASS (klass)->finalize = gnome_pie_pie_preview_finalize;
	gnome_pie_pie_preview_signals[GNOME_PIE_PIE_PREVIEW_ON_LAST_SLICE_REMOVED_SIGNAL] = g_signal_new ("on-last-slice-removed", GNOME_PIE_TYPE_PIE_PREVIEW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gnome_pie_pie_preview_signals[GNOME_PIE_PIE_PREVIEW_ON_FIRST_SLICE_ADDED_SIGNAL] = g_signal_new ("on-first-slice-added", GNOME_PIE_TYPE_PIE_PREVIEW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
gnome_pie_pie_preview_instance_init (GnomePiePiePreview * self,
                                     gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	self->priv = gnome_pie_pie_preview_get_instance_private (self);
	self->priv->renderer = NULL;
	self->priv->new_slice_window = NULL;
	self->priv->drag_enabled = FALSE;
	_tmp0_ = g_strdup ("");
	self->priv->current_id = _tmp0_;
	self->priv->drag_start_index = -1;
	_tmp1_ = g_strdup ("");
	self->priv->drag_start_id = _tmp1_;
}

static void
gnome_pie_pie_preview_finalize (GObject * obj)
{
	GnomePiePiePreview * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GNOME_PIE_TYPE_PIE_PREVIEW, GnomePiePiePreview);
	_g_object_unref0 (self->priv->renderer);
	_g_object_unref0 (self->priv->new_slice_window);
	_g_timer_destroy0 (self->priv->timer);
	_g_free0 (self->priv->current_id);
	_g_free0 (self->priv->drag_start_id);
	G_OBJECT_CLASS (gnome_pie_pie_preview_parent_class)->finalize (obj);
}

static GType
gnome_pie_pie_preview_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GnomePiePiePreviewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gnome_pie_pie_preview_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GnomePiePiePreview), 0, (GInstanceInitFunc) gnome_pie_pie_preview_instance_init, NULL };
	GType gnome_pie_pie_preview_type_id;
	gnome_pie_pie_preview_type_id = g_type_register_static (gtk_drawing_area_get_type (), "GnomePiePiePreview", &g_define_type_info, 0);
	GnomePiePiePreview_private_offset = g_type_add_instance_private (gnome_pie_pie_preview_type_id, sizeof (GnomePiePiePreviewPrivate));
	return gnome_pie_pie_preview_type_id;
}

GType
gnome_pie_pie_preview_get_type (void)
{
	static volatile gsize gnome_pie_pie_preview_type_id__once = 0;
	if (g_once_init_enter (&gnome_pie_pie_preview_type_id__once)) {
		GType gnome_pie_pie_preview_type_id;
		gnome_pie_pie_preview_type_id = gnome_pie_pie_preview_get_type_once ();
		g_once_init_leave (&gnome_pie_pie_preview_type_id__once, gnome_pie_pie_preview_type_id);
	}
	return gnome_pie_pie_preview_type_id__once;
}

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

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

