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

/*
* Copyright (c) 2011-2016 Felipe Escoto (https://github.com/Philip-Scott/Notes-up)
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Authored by: Felipe Escoto <felescoto95@hotmail.com>
*/

#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gdk/gdk.h>
#include <sqlite3.h>
#include <gee.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 ENOTES_TYPE_BOOKMARK (enotes_bookmark_get_type ())
#define ENOTES_BOOKMARK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ENOTES_TYPE_BOOKMARK, ENotesBookmark))
#define ENOTES_BOOKMARK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ENOTES_TYPE_BOOKMARK, ENotesBookmarkClass))
#define ENOTES_IS_BOOKMARK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ENOTES_TYPE_BOOKMARK))
#define ENOTES_IS_BOOKMARK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ENOTES_TYPE_BOOKMARK))
#define ENOTES_BOOKMARK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ENOTES_TYPE_BOOKMARK, ENotesBookmarkClass))

typedef struct _ENotesBookmark ENotesBookmark;
typedef struct _ENotesBookmarkClass ENotesBookmarkClass;
typedef struct _ENotesBookmarkPrivate ENotesBookmarkPrivate;
enum  {
	ENOTES_BOOKMARK_0_PROPERTY,
	ENOTES_BOOKMARK_NUM_PROPERTIES
};
static GParamSpec* enotes_bookmark_properties[ENOTES_BOOKMARK_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

#define TYPE_DATABASE_TABLE (database_table_get_type ())
#define DATABASE_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATABASE_TABLE, DatabaseTable))
#define DATABASE_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATABASE_TABLE, DatabaseTableClass))
#define IS_DATABASE_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATABASE_TABLE))
#define IS_DATABASE_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATABASE_TABLE))
#define DATABASE_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATABASE_TABLE, DatabaseTableClass))

typedef struct _DatabaseTable DatabaseTable;
typedef struct _DatabaseTableClass DatabaseTableClass;
typedef struct _DatabaseTablePrivate DatabaseTablePrivate;

#define ENOTES_TYPE_BOOKMARK_TABLE (enotes_bookmark_table_get_type ())
#define ENOTES_BOOKMARK_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ENOTES_TYPE_BOOKMARK_TABLE, ENotesBookmarkTable))
#define ENOTES_BOOKMARK_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ENOTES_TYPE_BOOKMARK_TABLE, ENotesBookmarkTableClass))
#define ENOTES_IS_BOOKMARK_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ENOTES_TYPE_BOOKMARK_TABLE))
#define ENOTES_IS_BOOKMARK_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ENOTES_TYPE_BOOKMARK_TABLE))
#define ENOTES_BOOKMARK_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ENOTES_TYPE_BOOKMARK_TABLE, ENotesBookmarkTableClass))

typedef struct _ENotesBookmarkTable ENotesBookmarkTable;
typedef struct _ENotesBookmarkTableClass ENotesBookmarkTableClass;
typedef struct _ENotesBookmarkTablePrivate ENotesBookmarkTablePrivate;
#define _database_table_unref0(var) ((var == NULL) ? NULL : (var = (database_table_unref (var), NULL)))
#define _sqlite3_finalize0(var) ((var == NULL) ? NULL : (var = (sqlite3_finalize (var), NULL)))

#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;
typedef struct _ENotesPagePrivate ENotesPagePrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
enum  {
	ENOTES_BOOKMARK_TABLE_BOOKMARK_ADDED_SIGNAL,
	ENOTES_BOOKMARK_TABLE_BOOKMARK_REMOVED_SIGNAL,
	ENOTES_BOOKMARK_TABLE_NUM_SIGNALS
};
static guint enotes_bookmark_table_signals[ENOTES_BOOKMARK_TABLE_NUM_SIGNALS] = {0};

struct _ENotesBookmark {
	GObject parent_instance;
	ENotesBookmarkPrivate * priv;
	gint64 page_id;
	gchar* name;
	GdkRGBA color;
};

struct _ENotesBookmarkClass {
	GObjectClass parent_class;
};

struct _DatabaseTable {
	GTypeInstance parent_instance;
	volatile int ref_count;
	DatabaseTablePrivate * priv;
	gchar* table_name;
};

struct _DatabaseTableClass {
	GTypeClass parent_class;
	void (*finalize) (DatabaseTable *self);
};

struct _ENotesBookmarkTable {
	DatabaseTable parent_instance;
	ENotesBookmarkTablePrivate * priv;
};

struct _ENotesBookmarkTableClass {
	DatabaseTableClass parent_class;
};

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

static gpointer enotes_bookmark_parent_class = NULL;
static gpointer enotes_bookmark_table_parent_class = NULL;
static ENotesBookmarkTable* enotes_bookmark_table_instance;
static ENotesBookmarkTable* enotes_bookmark_table_instance = NULL;

VALA_EXTERN GType enotes_bookmark_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesBookmark, g_object_unref)
VALA_EXTERN ENotesBookmark* enotes_bookmark_new (void);
VALA_EXTERN ENotesBookmark* enotes_bookmark_construct (GType object_type);
static void enotes_bookmark_finalize (GObject * obj);
static GType enotes_bookmark_get_type_once (void);
VALA_EXTERN gpointer database_table_ref (gpointer instance);
VALA_EXTERN void database_table_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_database_table (const gchar* name,
                                       const gchar* nick,
                                       const gchar* blurb,
                                       GType object_type,
                                       GParamFlags flags);
VALA_EXTERN void value_set_database_table (GValue* value,
                               gpointer v_object);
VALA_EXTERN void value_take_database_table (GValue* value,
                                gpointer v_object);
VALA_EXTERN gpointer value_get_database_table (const GValue* value);
VALA_EXTERN GType database_table_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DatabaseTable, database_table_unref)
VALA_EXTERN GType enotes_bookmark_table_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesBookmarkTable, database_table_unref)
VALA_EXTERN ENotesBookmarkTable* enotes_bookmark_table_get_instance (void);
static ENotesBookmarkTable* enotes_bookmark_table_new (void);
static ENotesBookmarkTable* enotes_bookmark_table_construct (GType object_type);
VALA_EXTERN DatabaseTable* database_table_construct (GType object_type);
VALA_EXTERN sqlite3_stmt* database_table_create_stmt (const gchar* data);
VALA_EXTERN void database_table_fatal (const gchar* op,
                           gint res);
VALA_EXTERN void database_table_set_table_name (DatabaseTable* self,
                                    const gchar* table_name);
VALA_EXTERN GType enotes_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesPage, g_object_unref)
VALA_EXTERN void enotes_bookmark_table_add (ENotesBookmarkTable* self,
                                ENotesPage* page);
VALA_EXTERN void database_table_bind_int (sqlite3_stmt* stmt,
                              gint column,
                              gint64 data);
VALA_EXTERN void enotes_bookmark_table_remove (ENotesBookmarkTable* self,
                                   gint64 page_id);
VALA_EXTERN GeeArrayList* enotes_bookmark_table_get_bookmarks (ENotesBookmarkTable* self);
VALA_EXTERN void enotes_bookmark_table_rename (ENotesBookmarkTable* self,
                                   gint64 id,
                                   const gchar* text);
VALA_EXTERN void database_table_bind_text (sqlite3_stmt* stmt,
                               gint column,
                               const gchar* data);
VALA_EXTERN gboolean enotes_bookmark_table_is_bookmarked (ENotesBookmarkTable* self,
                                              ENotesPage* page);
VALA_EXTERN void enotes_bookmark_table_reset_instance (void);
static void g_cclosure_user_marshal_VOID__INT64 (GClosure * closure,
                                          GValue * return_value,
                                          guint n_param_values,
                                          const GValue * param_values,
                                          gpointer invocation_hint,
                                          gpointer marshal_data);
static void enotes_bookmark_table_finalize (DatabaseTable * obj);
static GType enotes_bookmark_table_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

ENotesBookmark*
enotes_bookmark_construct (GType object_type)
{
	ENotesBookmark * self = NULL;
	self = (ENotesBookmark*) g_object_new (object_type, NULL);
	return self;
}

ENotesBookmark*
enotes_bookmark_new (void)
{
	return enotes_bookmark_construct (ENOTES_TYPE_BOOKMARK);
}

static void
enotes_bookmark_class_init (ENotesBookmarkClass * klass,
                            gpointer klass_data)
{
	enotes_bookmark_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = enotes_bookmark_finalize;
}

static void
enotes_bookmark_instance_init (ENotesBookmark * self,
                               gpointer klass)
{
}

static void
enotes_bookmark_finalize (GObject * obj)
{
	ENotesBookmark * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ENOTES_TYPE_BOOKMARK, ENotesBookmark);
	_g_free0 (self->name);
	G_OBJECT_CLASS (enotes_bookmark_parent_class)->finalize (obj);
}

static GType
enotes_bookmark_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ENotesBookmarkClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) enotes_bookmark_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ENotesBookmark), 0, (GInstanceInitFunc) enotes_bookmark_instance_init, NULL };
	GType enotes_bookmark_type_id;
	enotes_bookmark_type_id = g_type_register_static (G_TYPE_OBJECT, "ENotesBookmark", &g_define_type_info, 0);
	return enotes_bookmark_type_id;
}

GType
enotes_bookmark_get_type (void)
{
	static volatile gsize enotes_bookmark_type_id__once = 0;
	if (g_once_init_enter (&enotes_bookmark_type_id__once)) {
		GType enotes_bookmark_type_id;
		enotes_bookmark_type_id = enotes_bookmark_get_type_once ();
		g_once_init_leave (&enotes_bookmark_type_id__once, enotes_bookmark_type_id);
	}
	return enotes_bookmark_type_id__once;
}

static gpointer
_database_table_ref0 (gpointer self)
{
	return self ? database_table_ref (self) : NULL;
}

ENotesBookmarkTable*
enotes_bookmark_table_get_instance (void)
{
	ENotesBookmarkTable* _tmp0_;
	ENotesBookmarkTable* _tmp2_;
	ENotesBookmarkTable* _tmp3_;
	ENotesBookmarkTable* result;
	_tmp0_ = enotes_bookmark_table_instance;
	if (_tmp0_ == NULL) {
		ENotesBookmarkTable* _tmp1_;
		_tmp1_ = enotes_bookmark_table_new ();
		_database_table_unref0 (enotes_bookmark_table_instance);
		enotes_bookmark_table_instance = _tmp1_;
	}
	_tmp2_ = enotes_bookmark_table_instance;
	_tmp3_ = _database_table_ref0 (_tmp2_);
	result = _tmp3_;
	return result;
}

static ENotesBookmarkTable*
enotes_bookmark_table_construct (GType object_type)
{
	ENotesBookmarkTable* self = NULL;
	sqlite3_stmt* stmt = NULL;
	sqlite3_stmt* _tmp0_;
	gint res = 0;
	sqlite3_stmt* _tmp1_;
	self = (ENotesBookmarkTable*) database_table_construct (object_type);
	_tmp0_ = database_table_create_stmt ("CREATE TABLE IF NOT EXISTS Bookmark (" "id INTEGER UNIQUE PRIMARY KEY, " "name TEXT)");
	stmt = _tmp0_;
	_tmp1_ = stmt;
	res = sqlite3_step (_tmp1_);
	if (res != SQLITE_DONE) {
		database_table_fatal ("create bookmark table", res);
	}
	database_table_set_table_name ((DatabaseTable*) self, "Bookmark");
	_sqlite3_finalize0 (stmt);
	return self;
}

static ENotesBookmarkTable*
enotes_bookmark_table_new (void)
{
	return enotes_bookmark_table_construct (ENOTES_TYPE_BOOKMARK_TABLE);
}

void
enotes_bookmark_table_add (ENotesBookmarkTable* self,
                           ENotesPage* page)
{
	sqlite3_stmt* stmt = NULL;
	sqlite3_stmt* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (page != NULL);
	_tmp0_ = database_table_create_stmt ("INSERT INTO Bookmark (id) values (?)");
	stmt = _tmp0_;
	database_table_bind_int (stmt, 1, page->id);
	sqlite3_step (stmt);
	g_signal_emit (self, enotes_bookmark_table_signals[ENOTES_BOOKMARK_TABLE_BOOKMARK_ADDED_SIGNAL], 0);
	_sqlite3_finalize0 (stmt);
}

void
enotes_bookmark_table_remove (ENotesBookmarkTable* self,
                              gint64 page_id)
{
	sqlite3_stmt* stmt = NULL;
	sqlite3_stmt* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = database_table_create_stmt ("DELETE FROM Bookmark Where id = ?");
	stmt = _tmp0_;
	database_table_bind_int (stmt, 1, page_id);
	sqlite3_step (stmt);
	g_signal_emit (self, enotes_bookmark_table_signals[ENOTES_BOOKMARK_TABLE_BOOKMARK_REMOVED_SIGNAL], 0, page_id);
	_sqlite3_finalize0 (stmt);
}

GeeArrayList*
enotes_bookmark_table_get_bookmarks (ENotesBookmarkTable* self)
{
	sqlite3_stmt* stmt = NULL;
	sqlite3_stmt* _tmp0_;
	GeeArrayList* bookmarks = NULL;
	GeeArrayList* _tmp1_;
	GeeArrayList* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = database_table_create_stmt ("SELECT Page.id, Page.name, Notebook.rgb, Bookmark.name " "FROM Bookmark JOIN Page on Bookmark.id = Page.id " "JOIN Notebook on page.notebook_id = Notebook.id");
	stmt = _tmp0_;
	_tmp1_ = gee_array_list_new (ENOTES_TYPE_BOOKMARK, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	bookmarks = _tmp1_;
	{
		gboolean _tmp2_ = FALSE;
		_tmp2_ = TRUE;
		while (TRUE) {
			gint res = 0;
			sqlite3_stmt* _tmp3_;
			ENotesBookmark* row = NULL;
			ENotesBookmark* _tmp4_;
			ENotesBookmark* _tmp5_;
			sqlite3_stmt* _tmp6_;
			sqlite3_stmt* _tmp7_;
			const gchar* _tmp8_;
			GdkRGBA rgba = {0};
			GdkRGBA _tmp17_ = {0};
			sqlite3_stmt* _tmp18_;
			const gchar* _tmp19_;
			ENotesBookmark* _tmp20_;
			GdkRGBA _tmp21_;
			GeeArrayList* _tmp22_;
			ENotesBookmark* _tmp23_;
			if (!_tmp2_) {
			}
			_tmp2_ = FALSE;
			_tmp3_ = stmt;
			res = sqlite3_step (_tmp3_);
			if (res == SQLITE_DONE) {
				break;
			} else {
				if (res != SQLITE_ROW) {
					database_table_fatal ("get bookmarks", res);
					break;
				}
			}
			_tmp4_ = enotes_bookmark_new ();
			row = _tmp4_;
			_tmp5_ = row;
			_tmp6_ = stmt;
			_tmp5_->page_id = sqlite3_column_int64 (_tmp6_, 0);
			_tmp7_ = stmt;
			_tmp8_ = (const gchar*) sqlite3_column_text (_tmp7_, 3);
			if (_tmp8_ != NULL) {
				ENotesBookmark* _tmp9_;
				sqlite3_stmt* _tmp10_;
				const gchar* _tmp11_;
				gchar* _tmp12_;
				_tmp9_ = row;
				_tmp10_ = stmt;
				_tmp11_ = (const gchar*) sqlite3_column_text (_tmp10_, 3);
				_tmp12_ = g_strdup (_tmp11_);
				_g_free0 (_tmp9_->name);
				_tmp9_->name = _tmp12_;
			} else {
				ENotesBookmark* _tmp13_;
				sqlite3_stmt* _tmp14_;
				const gchar* _tmp15_;
				gchar* _tmp16_;
				_tmp13_ = row;
				_tmp14_ = stmt;
				_tmp15_ = (const gchar*) sqlite3_column_text (_tmp14_, 1);
				_tmp16_ = g_strdup (_tmp15_);
				_g_free0 (_tmp13_->name);
				_tmp13_->name = _tmp16_;
			}
			rgba = _tmp17_;
			_tmp18_ = stmt;
			_tmp19_ = (const gchar*) sqlite3_column_text (_tmp18_, 2);
			gdk_rgba_parse (&rgba, _tmp19_);
			_tmp20_ = row;
			_tmp21_ = rgba;
			_tmp20_->color = _tmp21_;
			_tmp22_ = bookmarks;
			_tmp23_ = row;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp22_, _tmp23_);
			_g_object_unref0 (row);
		}
	}
	result = bookmarks;
	_sqlite3_finalize0 (stmt);
	return result;
}

void
enotes_bookmark_table_rename (ENotesBookmarkTable* self,
                              gint64 id,
                              const gchar* text)
{
	sqlite3_stmt* stmt = NULL;
	sqlite3_stmt* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (text != NULL);
	_tmp0_ = database_table_create_stmt ("UPDATE Bookmark SET name = ? WHERE id = ?");
	stmt = _tmp0_;
	database_table_bind_text (stmt, 1, text);
	database_table_bind_int (stmt, 2, id);
	sqlite3_step (stmt);
	_sqlite3_finalize0 (stmt);
}

gboolean
enotes_bookmark_table_is_bookmarked (ENotesBookmarkTable* self,
                                     ENotesPage* page)
{
	sqlite3_stmt* stmt = NULL;
	sqlite3_stmt* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = database_table_create_stmt ("SELECT CAST(CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END AS INTEGER) FROM " \
"Bookmark WHERE Bookmark.id = ?");
	stmt = _tmp0_;
	database_table_bind_int (stmt, 1, page->id);
	sqlite3_step (stmt);
	result = sqlite3_column_int64 (stmt, 0) == ((gint64) 1);
	_sqlite3_finalize0 (stmt);
	return result;
}

void
enotes_bookmark_table_reset_instance (void)
{
	_database_table_unref0 (enotes_bookmark_table_instance);
	enotes_bookmark_table_instance = NULL;
}

static void
g_cclosure_user_marshal_VOID__INT64 (GClosure * closure,
                                     GValue * return_value,
                                     guint n_param_values,
                                     const GValue * param_values,
                                     gpointer invocation_hint,
                                     gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__INT64) (gpointer data1, gint64 arg_1, gpointer data2);
	register GMarshalFunc_VOID__INT64 callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 2);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__INT64) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_int64 (param_values + 1), data2);
}

static void
enotes_bookmark_table_class_init (ENotesBookmarkTableClass * klass,
                                  gpointer klass_data)
{
	enotes_bookmark_table_parent_class = g_type_class_peek_parent (klass);
	((DatabaseTableClass *) klass)->finalize = enotes_bookmark_table_finalize;
	enotes_bookmark_table_signals[ENOTES_BOOKMARK_TABLE_BOOKMARK_ADDED_SIGNAL] = g_signal_new ("bookmark-added", ENOTES_TYPE_BOOKMARK_TABLE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	enotes_bookmark_table_signals[ENOTES_BOOKMARK_TABLE_BOOKMARK_REMOVED_SIGNAL] = g_signal_new ("bookmark-removed", ENOTES_TYPE_BOOKMARK_TABLE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__INT64, G_TYPE_NONE, 1, G_TYPE_INT64);
}

static void
enotes_bookmark_table_instance_init (ENotesBookmarkTable * self,
                                     gpointer klass)
{
}

static void
enotes_bookmark_table_finalize (DatabaseTable * obj)
{
	ENotesBookmarkTable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ENOTES_TYPE_BOOKMARK_TABLE, ENotesBookmarkTable);
	DATABASE_TABLE_CLASS (enotes_bookmark_table_parent_class)->finalize (obj);
}

static GType
enotes_bookmark_table_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ENotesBookmarkTableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) enotes_bookmark_table_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ENotesBookmarkTable), 0, (GInstanceInitFunc) enotes_bookmark_table_instance_init, NULL };
	GType enotes_bookmark_table_type_id;
	enotes_bookmark_table_type_id = g_type_register_static (TYPE_DATABASE_TABLE, "ENotesBookmarkTable", &g_define_type_info, 0);
	return enotes_bookmark_table_type_id;
}

GType
enotes_bookmark_table_get_type (void)
{
	static volatile gsize enotes_bookmark_table_type_id__once = 0;
	if (g_once_init_enter (&enotes_bookmark_table_type_id__once)) {
		GType enotes_bookmark_table_type_id;
		enotes_bookmark_table_type_id = enotes_bookmark_table_get_type_once ();
		g_once_init_leave (&enotes_bookmark_table_type_id__once, enotes_bookmark_table_type_id);
	}
	return enotes_bookmark_table_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;
}

