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

#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gdk/gdk.h>
#include <glib/gi18n-lib.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#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 GRANITE_WIDGETS_SOURCE_LIST_PATCH_TYPE_ITEM (granite_widgets_source_list_patch_item_get_type ())
#define GRANITE_WIDGETS_SOURCE_LIST_PATCH_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GRANITE_WIDGETS_SOURCE_LIST_PATCH_TYPE_ITEM, GraniteWidgetsSourceListPatchItem))
#define GRANITE_WIDGETS_SOURCE_LIST_PATCH_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GRANITE_WIDGETS_SOURCE_LIST_PATCH_TYPE_ITEM, GraniteWidgetsSourceListPatchItemClass))
#define GRANITE_WIDGETS_SOURCE_LIST_PATCH_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GRANITE_WIDGETS_SOURCE_LIST_PATCH_TYPE_ITEM))
#define GRANITE_WIDGETS_SOURCE_LIST_PATCH_IS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GRANITE_WIDGETS_SOURCE_LIST_PATCH_TYPE_ITEM))
#define GRANITE_WIDGETS_SOURCE_LIST_PATCH_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GRANITE_WIDGETS_SOURCE_LIST_PATCH_TYPE_ITEM, GraniteWidgetsSourceListPatchItemClass))

typedef struct _GraniteWidgetsSourceListPatchItem GraniteWidgetsSourceListPatchItem;
typedef struct _GraniteWidgetsSourceListPatchItemClass GraniteWidgetsSourceListPatchItemClass;
typedef struct _GraniteWidgetsSourceListPatchItemPrivate GraniteWidgetsSourceListPatchItemPrivate;

#define GRANITE_WIDGETS_SOURCE_LIST_PATCH_TYPE_EXPANDABLE_ITEM (granite_widgets_source_list_patch_expandable_item_get_type ())
#define GRANITE_WIDGETS_SOURCE_LIST_PATCH_EXPANDABLE_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GRANITE_WIDGETS_SOURCE_LIST_PATCH_TYPE_EXPANDABLE_ITEM, GraniteWidgetsSourceListPatchExpandableItem))
#define GRANITE_WIDGETS_SOURCE_LIST_PATCH_EXPANDABLE_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GRANITE_WIDGETS_SOURCE_LIST_PATCH_TYPE_EXPANDABLE_ITEM, GraniteWidgetsSourceListPatchExpandableItemClass))
#define GRANITE_WIDGETS_SOURCE_LIST_PATCH_IS_EXPANDABLE_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GRANITE_WIDGETS_SOURCE_LIST_PATCH_TYPE_EXPANDABLE_ITEM))
#define GRANITE_WIDGETS_SOURCE_LIST_PATCH_IS_EXPANDABLE_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GRANITE_WIDGETS_SOURCE_LIST_PATCH_TYPE_EXPANDABLE_ITEM))
#define GRANITE_WIDGETS_SOURCE_LIST_PATCH_EXPANDABLE_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GRANITE_WIDGETS_SOURCE_LIST_PATCH_TYPE_EXPANDABLE_ITEM, GraniteWidgetsSourceListPatchExpandableItemClass))

typedef struct _GraniteWidgetsSourceListPatchExpandableItem GraniteWidgetsSourceListPatchExpandableItem;
typedef struct _GraniteWidgetsSourceListPatchExpandableItemClass GraniteWidgetsSourceListPatchExpandableItemClass;
typedef struct _GraniteWidgetsSourceListPatchExpandableItemPrivate GraniteWidgetsSourceListPatchExpandableItemPrivate;

#define ENOTES_TYPE_SIDEBAR_ITEM (enotes_sidebar_item_get_type ())
#define ENOTES_SIDEBAR_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ENOTES_TYPE_SIDEBAR_ITEM, ENotesSidebarItem))
#define ENOTES_SIDEBAR_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ENOTES_TYPE_SIDEBAR_ITEM, ENotesSidebarItemClass))
#define ENOTES_IS_SIDEBAR_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ENOTES_TYPE_SIDEBAR_ITEM))
#define ENOTES_IS_SIDEBAR_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ENOTES_TYPE_SIDEBAR_ITEM))
#define ENOTES_SIDEBAR_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ENOTES_TYPE_SIDEBAR_ITEM, ENotesSidebarItemClass))

typedef struct _ENotesSidebarItem ENotesSidebarItem;
typedef struct _ENotesSidebarItemClass ENotesSidebarItemClass;
typedef struct _ENotesSidebarItemPrivate ENotesSidebarItemPrivate;

#define ENOTES_TYPE_TRASH_ITEM (enotes_trash_item_get_type ())
#define ENOTES_TRASH_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ENOTES_TYPE_TRASH_ITEM, ENotesTrashItem))
#define ENOTES_TRASH_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ENOTES_TYPE_TRASH_ITEM, ENotesTrashItemClass))
#define ENOTES_IS_TRASH_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ENOTES_TYPE_TRASH_ITEM))
#define ENOTES_IS_TRASH_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ENOTES_TYPE_TRASH_ITEM))
#define ENOTES_TRASH_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ENOTES_TYPE_TRASH_ITEM, ENotesTrashItemClass))

typedef struct _ENotesTrashItem ENotesTrashItem;
typedef struct _ENotesTrashItemClass ENotesTrashItemClass;
typedef struct _ENotesTrashItemPrivate ENotesTrashItemPrivate;

#define ENOTES_TYPE_NOTEBOOK (enotes_notebook_get_type ())
#define ENOTES_NOTEBOOK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ENOTES_TYPE_NOTEBOOK, ENotesNotebook))
#define ENOTES_NOTEBOOK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ENOTES_TYPE_NOTEBOOK, ENotesNotebookClass))
#define ENOTES_IS_NOTEBOOK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ENOTES_TYPE_NOTEBOOK))
#define ENOTES_IS_NOTEBOOK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ENOTES_TYPE_NOTEBOOK))
#define ENOTES_NOTEBOOK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ENOTES_TYPE_NOTEBOOK, ENotesNotebookClass))

typedef struct _ENotesNotebook ENotesNotebook;
typedef struct _ENotesNotebookClass ENotesNotebookClass;

#define ENOTES_TYPE_PAGE (enotes_page_get_type ())
#define ENOTES_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ENOTES_TYPE_PAGE, ENotesPage))
#define ENOTES_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ENOTES_TYPE_PAGE, ENotesPageClass))
#define ENOTES_IS_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ENOTES_TYPE_PAGE))
#define ENOTES_IS_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ENOTES_TYPE_PAGE))
#define ENOTES_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ENOTES_TYPE_PAGE, ENotesPageClass))

typedef struct _ENotesPage ENotesPage;
typedef struct _ENotesPageClass ENotesPageClass;
enum  {
	ENOTES_TRASH_ITEM_0_PROPERTY,
	ENOTES_TRASH_ITEM_NUM_PROPERTIES
};
static GParamSpec* enotes_trash_item_properties[ENOTES_TRASH_ITEM_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _ENotesPagePrivate ENotesPagePrivate;
typedef struct _ENotesNotebookPrivate ENotesNotebookPrivate;

#define ENOTES_TYPE_TRASH (enotes_trash_get_type ())
#define ENOTES_TRASH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ENOTES_TYPE_TRASH, ENotesTrash))
#define ENOTES_TRASH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ENOTES_TYPE_TRASH, ENotesTrashClass))
#define ENOTES_IS_TRASH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ENOTES_TYPE_TRASH))
#define ENOTES_IS_TRASH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ENOTES_TYPE_TRASH))
#define ENOTES_TRASH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ENOTES_TYPE_TRASH, ENotesTrashClass))

typedef struct _ENotesTrash ENotesTrash;
typedef struct _ENotesTrashClass ENotesTrashClass;

#define ENOTES_TYPE_PAGES_LIST (enotes_pages_list_get_type ())
#define ENOTES_PAGES_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ENOTES_TYPE_PAGES_LIST, ENotesPagesList))
#define ENOTES_PAGES_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ENOTES_TYPE_PAGES_LIST, ENotesPagesListClass))
#define ENOTES_IS_PAGES_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ENOTES_TYPE_PAGES_LIST))
#define ENOTES_IS_PAGES_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ENOTES_TYPE_PAGES_LIST))
#define ENOTES_PAGES_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ENOTES_TYPE_PAGES_LIST, ENotesPagesListClass))

typedef struct _ENotesPagesList ENotesPagesList;
typedef struct _ENotesPagesListClass ENotesPagesListClass;

struct _GraniteWidgetsSourceListPatchItem {
	GObject parent_instance;
	GraniteWidgetsSourceListPatchItemPrivate * priv;
	gboolean use_pango_style;
	gboolean force_visible;
};

struct _GraniteWidgetsSourceListPatchItemClass {
	GObjectClass parent_class;
	GtkMenu* (*get_context_menu) (GraniteWidgetsSourceListPatchItem* self);
	void (*edited) (GraniteWidgetsSourceListPatchItem* self, const gchar* new_name);
	void (*action_activated) (GraniteWidgetsSourceListPatchItem* self);
	void (*activated) (GraniteWidgetsSourceListPatchItem* self);
};

struct _GraniteWidgetsSourceListPatchExpandableItem {
	GraniteWidgetsSourceListPatchItem parent_instance;
	GraniteWidgetsSourceListPatchExpandableItemPrivate * priv;
};

struct _GraniteWidgetsSourceListPatchExpandableItemClass {
	GraniteWidgetsSourceListPatchItemClass parent_class;
	void (*toggled) (GraniteWidgetsSourceListPatchExpandableItem* self);
};

struct _ENotesSidebarItem {
	GraniteWidgetsSourceListPatchExpandableItem parent_instance;
	ENotesSidebarItemPrivate * priv;
};

struct _ENotesSidebarItemClass {
	GraniteWidgetsSourceListPatchExpandableItemClass parent_class;
};

struct _ENotesTrashItem {
	ENotesSidebarItem parent_instance;
	ENotesTrashItemPrivate * priv;
	ENotesNotebook* parent_notebook;
	ENotesPage* trashed_page;
	ENotesNotebook* trashed_notebook;
};

struct _ENotesTrashItemClass {
	ENotesSidebarItemClass parent_class;
};

struct _ENotesTrashItemPrivate {
	GtkMenu* menu;
	GtkMenuItem* restore_item;
};

struct _ENotesPage {
	GObject parent_instance;
	ENotesPagePrivate * priv;
	gint64 id;
	gint64 notebook_id;
	gchar* name;
	gchar* data;
	gchar* subtitle;
	gchar* html_cache;
	gint64 creation_date;
	gint64 modification_date;
	gboolean new_page;
	gboolean cache_changed;
	gchar* full_path;
};

struct _ENotesPageClass {
	GObjectClass parent_class;
};

struct _ENotesNotebook {
	GObject parent_instance;
	ENotesNotebookPrivate * priv;
	gint64 id;
	gint64* parent_id;
	GdkRGBA rgb;
	gchar* name;
	gchar* css;
	gchar* stylesheet;
};

struct _ENotesNotebookClass {
	GObjectClass parent_class;
};

static gint ENotesTrashItem_private_offset;
static gpointer enotes_trash_item_parent_class = NULL;

VALA_EXTERN GType granite_widgets_source_list_patch_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GraniteWidgetsSourceListPatchItem, g_object_unref)
VALA_EXTERN GType granite_widgets_source_list_patch_expandable_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GraniteWidgetsSourceListPatchExpandableItem, g_object_unref)
VALA_EXTERN GType enotes_sidebar_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesSidebarItem, g_object_unref)
VALA_EXTERN GType enotes_trash_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesTrashItem, g_object_unref)
VALA_EXTERN GType enotes_notebook_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesNotebook, g_object_unref)
VALA_EXTERN GType enotes_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesPage, g_object_unref)
VALA_EXTERN GtkMenu* granite_widgets_source_list_patch_item_get_context_menu (GraniteWidgetsSourceListPatchItem* self);
VALA_EXTERN ENotesTrashItem* enotes_trash_item_new_page (ENotesPage* page);
VALA_EXTERN ENotesTrashItem* enotes_trash_item_construct_page (GType object_type,
                                                   ENotesPage* page);
VALA_EXTERN ENotesSidebarItem* enotes_sidebar_item_new (void);
VALA_EXTERN ENotesSidebarItem* enotes_sidebar_item_construct (GType object_type);
VALA_EXTERN void granite_widgets_source_list_patch_item_set_name (GraniteWidgetsSourceListPatchItem* self,
                                                      const gchar* value);
VALA_EXTERN ENotesTrashItem* enotes_trash_item_new_notebook (ENotesNotebook* notebook);
VALA_EXTERN ENotesTrashItem* enotes_trash_item_construct_notebook (GType object_type,
                                                       ENotesNotebook* notebook);
VALA_EXTERN void enotes_sidebar_item_set_color (ENotesSidebarItem* self,
                                    GdkRGBA* rgba);
static void enotes_trash_item_setup_menu (ENotesTrashItem* self);
static void __lambda74_ (ENotesTrashItem* self);
VALA_EXTERN GType enotes_trash_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesTrash, g_object_unref)
VALA_EXTERN ENotesTrash* enotes_trash_get_instance (void);
VALA_EXTERN void enotes_trash_restore_page (ENotesTrash* self,
                                ENotesPage* page);
VALA_EXTERN GType enotes_pages_list_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesPagesList, g_object_unref)
VALA_EXTERN ENotesPagesList* enotes_pages_list_get_instance (void);
VALA_EXTERN void enotes_pages_list_refresh (ENotesPagesList* self);
VALA_EXTERN void enotes_trash_restore_notebook (ENotesTrash* self,
                                    ENotesNotebook* notebook);
VALA_EXTERN void granite_widgets_source_list_patch_item_set_visible (GraniteWidgetsSourceListPatchItem* self,
                                                         gboolean value);
static void ___lambda74__gtk_menu_item_activate (GtkMenuItem* _sender,
                                          gpointer self);
static GtkMenu* enotes_trash_item_real_get_context_menu (GraniteWidgetsSourceListPatchItem* base);
VALA_EXTERN ENotesTrashItem* enotes_trash_item_new (void);
VALA_EXTERN ENotesTrashItem* enotes_trash_item_construct (GType object_type);
static GObject * enotes_trash_item_constructor (GType type,
                                         guint n_construct_properties,
                                         GObjectConstructParam * construct_properties);
VALA_EXTERN void granite_widgets_source_list_patch_item_set_selectable (GraniteWidgetsSourceListPatchItem* self,
                                                            gboolean value);
static void enotes_trash_item_finalize (GObject * obj);
static GType enotes_trash_item_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
enotes_trash_item_get_instance_private (ENotesTrashItem* self)
{
	return G_STRUCT_MEMBER_P (self, ENotesTrashItem_private_offset);
}

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

ENotesTrashItem*
enotes_trash_item_construct_page (GType object_type,
                                  ENotesPage* page)
{
	ENotesTrashItem * self = NULL;
	ENotesPage* _tmp0_;
	const gchar* _tmp1_;
	g_return_val_if_fail (page != NULL, NULL);
	self = (ENotesTrashItem*) enotes_sidebar_item_construct (object_type);
	_tmp0_ = _g_object_ref0 (page);
	_g_object_unref0 (self->trashed_page);
	self->trashed_page = _tmp0_;
	_tmp1_ = page->name;
	granite_widgets_source_list_patch_item_set_name ((GraniteWidgetsSourceListPatchItem*) self, _tmp1_);
	return self;
}

ENotesTrashItem*
enotes_trash_item_new_page (ENotesPage* page)
{
	return enotes_trash_item_construct_page (ENOTES_TYPE_TRASH_ITEM, page);
}

ENotesTrashItem*
enotes_trash_item_construct_notebook (GType object_type,
                                      ENotesNotebook* notebook)
{
	ENotesTrashItem * self = NULL;
	ENotesNotebook* _tmp0_;
	const gchar* _tmp1_;
	GdkRGBA _tmp2_;
	g_return_val_if_fail (notebook != NULL, NULL);
	self = (ENotesTrashItem*) enotes_sidebar_item_construct (object_type);
	_tmp0_ = _g_object_ref0 (notebook);
	_g_object_unref0 (self->trashed_notebook);
	self->trashed_notebook = _tmp0_;
	_tmp1_ = notebook->name;
	granite_widgets_source_list_patch_item_set_name ((GraniteWidgetsSourceListPatchItem*) self, _tmp1_);
	_tmp2_ = notebook->rgb;
	enotes_sidebar_item_set_color ((ENotesSidebarItem*) self, &_tmp2_);
	return self;
}

ENotesTrashItem*
enotes_trash_item_new_notebook (ENotesNotebook* notebook)
{
	return enotes_trash_item_construct_notebook (ENOTES_TYPE_TRASH_ITEM, notebook);
}

static void
__lambda74_ (ENotesTrashItem* self)
{
	ENotesPage* _tmp0_;
	_tmp0_ = self->trashed_page;
	if (_tmp0_ != NULL) {
		ENotesTrash* _tmp1_;
		ENotesTrash* _tmp2_;
		ENotesPage* _tmp3_;
		ENotesPagesList* _tmp4_;
		ENotesPagesList* _tmp5_;
		_tmp1_ = enotes_trash_get_instance ();
		_tmp2_ = _tmp1_;
		_tmp3_ = self->trashed_page;
		enotes_trash_restore_page (_tmp2_, _tmp3_);
		_g_object_unref0 (_tmp2_);
		_tmp4_ = enotes_pages_list_get_instance ();
		_tmp5_ = _tmp4_;
		enotes_pages_list_refresh (_tmp5_);
		_g_object_unref0 (_tmp5_);
	} else {
		ENotesNotebook* _tmp6_;
		_tmp6_ = self->trashed_notebook;
		if (_tmp6_ != NULL) {
			ENotesTrash* _tmp7_;
			ENotesTrash* _tmp8_;
			ENotesNotebook* _tmp9_;
			_tmp7_ = enotes_trash_get_instance ();
			_tmp8_ = _tmp7_;
			_tmp9_ = self->trashed_notebook;
			enotes_trash_restore_notebook (_tmp8_, _tmp9_);
			_g_object_unref0 (_tmp8_);
		}
	}
	granite_widgets_source_list_patch_item_set_visible ((GraniteWidgetsSourceListPatchItem*) self, FALSE);
}

static void
___lambda74__gtk_menu_item_activate (GtkMenuItem* _sender,
                                     gpointer self)
{
	__lambda74_ ((ENotesTrashItem*) self);
}

static void
enotes_trash_item_setup_menu (ENotesTrashItem* self)
{
	GtkMenu* _tmp0_;
	GtkMenuItem* _tmp1_;
	GtkMenuItem* _tmp2_;
	GtkMenu* _tmp3_;
	GtkMenuItem* _tmp4_;
	GtkMenu* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = (GtkMenu*) gtk_menu_new ();
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->menu);
	self->priv->menu = _tmp0_;
	_tmp1_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_ ("Restore"));
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->restore_item);
	self->priv->restore_item = _tmp1_;
	_tmp2_ = self->priv->restore_item;
	g_signal_connect_object (_tmp2_, "activate", (GCallback) ___lambda74__gtk_menu_item_activate, self, 0);
	_tmp3_ = self->priv->menu;
	_tmp4_ = self->priv->restore_item;
	gtk_container_add ((GtkContainer*) _tmp3_, (GtkWidget*) _tmp4_);
	_tmp5_ = self->priv->menu;
	gtk_widget_show_all ((GtkWidget*) _tmp5_);
}

static GtkMenu*
enotes_trash_item_real_get_context_menu (GraniteWidgetsSourceListPatchItem* base)
{
	ENotesTrashItem * self;
	GtkMenu* _tmp0_;
	GtkMenu* _tmp1_;
	GtkMenu* result;
	self = (ENotesTrashItem*) base;
	_tmp0_ = self->priv->menu;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

ENotesTrashItem*
enotes_trash_item_construct (GType object_type)
{
	ENotesTrashItem * self = NULL;
	self = (ENotesTrashItem*) enotes_sidebar_item_construct (object_type);
	return self;
}

ENotesTrashItem*
enotes_trash_item_new (void)
{
	return enotes_trash_item_construct (ENOTES_TYPE_TRASH_ITEM);
}

static GObject *
enotes_trash_item_constructor (GType type,
                               guint n_construct_properties,
                               GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ENotesTrashItem * self;
	parent_class = G_OBJECT_CLASS (enotes_trash_item_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ENOTES_TYPE_TRASH_ITEM, ENotesTrashItem);
	granite_widgets_source_list_patch_item_set_selectable ((GraniteWidgetsSourceListPatchItem*) self, FALSE);
	enotes_trash_item_setup_menu (self);
	return obj;
}

static void
enotes_trash_item_class_init (ENotesTrashItemClass * klass,
                              gpointer klass_data)
{
	enotes_trash_item_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ENotesTrashItem_private_offset);
	((GraniteWidgetsSourceListPatchItemClass *) klass)->get_context_menu = (GtkMenu* (*) (GraniteWidgetsSourceListPatchItem*)) enotes_trash_item_real_get_context_menu;
	G_OBJECT_CLASS (klass)->constructor = enotes_trash_item_constructor;
	G_OBJECT_CLASS (klass)->finalize = enotes_trash_item_finalize;
}

static void
enotes_trash_item_instance_init (ENotesTrashItem * self,
                                 gpointer klass)
{
	self->priv = enotes_trash_item_get_instance_private (self);
	self->parent_notebook = NULL;
	self->trashed_page = NULL;
	self->trashed_notebook = NULL;
}

static void
enotes_trash_item_finalize (GObject * obj)
{
	ENotesTrashItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ENOTES_TYPE_TRASH_ITEM, ENotesTrashItem);
	_g_object_unref0 (self->parent_notebook);
	_g_object_unref0 (self->trashed_page);
	_g_object_unref0 (self->trashed_notebook);
	_g_object_unref0 (self->priv->menu);
	_g_object_unref0 (self->priv->restore_item);
	G_OBJECT_CLASS (enotes_trash_item_parent_class)->finalize (obj);
}

static GType
enotes_trash_item_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ENotesTrashItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) enotes_trash_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ENotesTrashItem), 0, (GInstanceInitFunc) enotes_trash_item_instance_init, NULL };
	GType enotes_trash_item_type_id;
	enotes_trash_item_type_id = g_type_register_static (ENOTES_TYPE_SIDEBAR_ITEM, "ENotesTrashItem", &g_define_type_info, 0);
	ENotesTrashItem_private_offset = g_type_add_instance_private (enotes_trash_item_type_id, sizeof (ENotesTrashItemPrivate));
	return enotes_trash_item_type_id;
}

GType
enotes_trash_item_get_type (void)
{
	static volatile gsize enotes_trash_item_type_id__once = 0;
	if (g_once_init_enter (&enotes_trash_item_type_id__once)) {
		GType enotes_trash_item_type_id;
		enotes_trash_item_type_id = enotes_trash_item_get_type_once ();
		g_once_init_leave (&enotes_trash_item_type_id__once, enotes_trash_item_type_id);
	}
	return enotes_trash_item_type_id__once;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

