/* Window.c generated by valac 0.56.19, the Vala compiler
 * generated from Window.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 <gtk/gtk.h>
#include <glib-object.h>
#include <webkit2/webkit2.h>
#include <gdk/gdk.h>
#include <glib.h>
#include <granite.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>

#define ENOTES_FEATURE_FLAGS_SHOW_NOTEBOOK_PANE FALSE
#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_WINDOW (enotes_window_get_type ())
#define ENOTES_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ENOTES_TYPE_WINDOW, ENotesWindow))
#define ENOTES_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ENOTES_TYPE_WINDOW, ENotesWindowClass))
#define ENOTES_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ENOTES_TYPE_WINDOW))
#define ENOTES_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ENOTES_TYPE_WINDOW))
#define ENOTES_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ENOTES_TYPE_WINDOW, ENotesWindowClass))

typedef struct _ENotesWindow ENotesWindow;
typedef struct _ENotesWindowClass ENotesWindowClass;
typedef struct _ENotesWindowPrivate ENotesWindowPrivate;

#define ENOTES_TYPE_EDITOR (enotes_editor_get_type ())
#define ENOTES_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ENOTES_TYPE_EDITOR, ENotesEditor))
#define ENOTES_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ENOTES_TYPE_EDITOR, ENotesEditorClass))
#define ENOTES_IS_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ENOTES_TYPE_EDITOR))
#define ENOTES_IS_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ENOTES_TYPE_EDITOR))
#define ENOTES_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ENOTES_TYPE_EDITOR, ENotesEditorClass))

typedef struct _ENotesEditor ENotesEditor;
typedef struct _ENotesEditorClass ENotesEditorClass;

#define ENOTES_TYPE_HEADERBAR (enotes_headerbar_get_type ())
#define ENOTES_HEADERBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ENOTES_TYPE_HEADERBAR, ENotesHeaderbar))
#define ENOTES_HEADERBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ENOTES_TYPE_HEADERBAR, ENotesHeaderbarClass))
#define ENOTES_IS_HEADERBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ENOTES_TYPE_HEADERBAR))
#define ENOTES_IS_HEADERBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ENOTES_TYPE_HEADERBAR))
#define ENOTES_HEADERBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ENOTES_TYPE_HEADERBAR, ENotesHeaderbarClass))

typedef struct _ENotesHeaderbar ENotesHeaderbar;
typedef struct _ENotesHeaderbarClass ENotesHeaderbarClass;

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

#define GRANITE_WIDGETS_TYPE_SOURCE_LIST_PATCH (granite_widgets_source_list_patch_get_type ())
#define GRANITE_WIDGETS_SOURCE_LIST_PATCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GRANITE_WIDGETS_TYPE_SOURCE_LIST_PATCH, GraniteWidgetsSourceListPatch))
#define GRANITE_WIDGETS_SOURCE_LIST_PATCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GRANITE_WIDGETS_TYPE_SOURCE_LIST_PATCH, GraniteWidgetsSourceListPatchClass))
#define GRANITE_WIDGETS_IS_SOURCE_LIST_PATCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GRANITE_WIDGETS_TYPE_SOURCE_LIST_PATCH))
#define GRANITE_WIDGETS_IS_SOURCE_LIST_PATCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GRANITE_WIDGETS_TYPE_SOURCE_LIST_PATCH))
#define GRANITE_WIDGETS_SOURCE_LIST_PATCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GRANITE_WIDGETS_TYPE_SOURCE_LIST_PATCH, GraniteWidgetsSourceListPatchClass))

typedef struct _GraniteWidgetsSourceListPatch GraniteWidgetsSourceListPatch;
typedef struct _GraniteWidgetsSourceListPatchClass GraniteWidgetsSourceListPatchClass;

#define ENOTES_TYPE_SIDEBAR (enotes_sidebar_get_type ())
#define ENOTES_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ENOTES_TYPE_SIDEBAR, ENotesSidebar))
#define ENOTES_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ENOTES_TYPE_SIDEBAR, ENotesSidebarClass))
#define ENOTES_IS_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ENOTES_TYPE_SIDEBAR))
#define ENOTES_IS_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ENOTES_TYPE_SIDEBAR))
#define ENOTES_SIDEBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ENOTES_TYPE_SIDEBAR, ENotesSidebarClass))

typedef struct _ENotesSidebar ENotesSidebar;
typedef struct _ENotesSidebarClass ENotesSidebarClass;

#define ENOTES_TYPE_PAGE_INFO_EDITOR (enotes_page_info_editor_get_type ())
#define ENOTES_PAGE_INFO_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ENOTES_TYPE_PAGE_INFO_EDITOR, ENotesPageInfoEditor))
#define ENOTES_PAGE_INFO_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ENOTES_TYPE_PAGE_INFO_EDITOR, ENotesPageInfoEditorClass))
#define ENOTES_IS_PAGE_INFO_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ENOTES_TYPE_PAGE_INFO_EDITOR))
#define ENOTES_IS_PAGE_INFO_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ENOTES_TYPE_PAGE_INFO_EDITOR))
#define ENOTES_PAGE_INFO_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ENOTES_TYPE_PAGE_INFO_EDITOR, ENotesPageInfoEditorClass))

typedef struct _ENotesPageInfoEditor ENotesPageInfoEditor;
typedef struct _ENotesPageInfoEditorClass ENotesPageInfoEditorClass;

#define ENOTES_TYPE_VIEW_EDIT_STACK (enotes_view_edit_stack_get_type ())
#define ENOTES_VIEW_EDIT_STACK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ENOTES_TYPE_VIEW_EDIT_STACK, ENotesViewEditStack))
#define ENOTES_VIEW_EDIT_STACK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ENOTES_TYPE_VIEW_EDIT_STACK, ENotesViewEditStackClass))
#define ENOTES_IS_VIEW_EDIT_STACK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ENOTES_TYPE_VIEW_EDIT_STACK))
#define ENOTES_IS_VIEW_EDIT_STACK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ENOTES_TYPE_VIEW_EDIT_STACK))
#define ENOTES_VIEW_EDIT_STACK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ENOTES_TYPE_VIEW_EDIT_STACK, ENotesViewEditStackClass))

typedef struct _ENotesViewEditStack ENotesViewEditStack;
typedef struct _ENotesViewEditStackClass ENotesViewEditStackClass;

#define ENOTES_TYPE_VIEWER (enotes_viewer_get_type ())
#define ENOTES_VIEWER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ENOTES_TYPE_VIEWER, ENotesViewer))
#define ENOTES_VIEWER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ENOTES_TYPE_VIEWER, ENotesViewerClass))
#define ENOTES_IS_VIEWER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ENOTES_TYPE_VIEWER))
#define ENOTES_IS_VIEWER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ENOTES_TYPE_VIEWER))
#define ENOTES_VIEWER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ENOTES_TYPE_VIEWER, ENotesViewerClass))

typedef struct _ENotesViewer ENotesViewer;
typedef struct _ENotesViewerClass ENotesViewerClass;

#define ENOTES_WINDOW_TYPE_FOUR_PANE_WINDOW (enotes_window_four_pane_window_get_type ())
#define ENOTES_WINDOW_FOUR_PANE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ENOTES_WINDOW_TYPE_FOUR_PANE_WINDOW, ENotesWindowFourPaneWindow))
#define ENOTES_WINDOW_FOUR_PANE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ENOTES_WINDOW_TYPE_FOUR_PANE_WINDOW, ENotesWindowFourPaneWindowClass))
#define ENOTES_WINDOW_IS_FOUR_PANE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ENOTES_WINDOW_TYPE_FOUR_PANE_WINDOW))
#define ENOTES_WINDOW_IS_FOUR_PANE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ENOTES_WINDOW_TYPE_FOUR_PANE_WINDOW))
#define ENOTES_WINDOW_FOUR_PANE_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ENOTES_WINDOW_TYPE_FOUR_PANE_WINDOW, ENotesWindowFourPaneWindowClass))

typedef struct _ENotesWindowFourPaneWindow ENotesWindowFourPaneWindow;
typedef struct _ENotesWindowFourPaneWindowClass ENotesWindowFourPaneWindowClass;
enum  {
	ENOTES_WINDOW_0_PROPERTY,
	ENOTES_WINDOW_NUM_PROPERTIES
};
static GParamSpec* enotes_window_properties[ENOTES_WINDOW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define ENOTES_TYPE_APPLICATION (enotes_application_get_type ())
#define ENOTES_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ENOTES_TYPE_APPLICATION, ENotesApplication))
#define ENOTES_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ENOTES_TYPE_APPLICATION, ENotesApplicationClass))
#define ENOTES_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ENOTES_TYPE_APPLICATION))
#define ENOTES_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ENOTES_TYPE_APPLICATION))
#define ENOTES_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ENOTES_TYPE_APPLICATION, ENotesApplicationClass))

typedef struct _ENotesApplication ENotesApplication;
typedef struct _ENotesApplicationClass ENotesApplicationClass;
typedef struct _Block7Data Block7Data;
typedef enum  {
	ENOTES_KEY_CHANGE_MODE,
	ENOTES_KEY_SAVE,
	ENOTES_KEY_QUIT,
	ENOTES_KEY_NEW_PAGE,
	ENOTES_KEY_FIND,
	ENOTES_KEY_BOOKMARK,
	ENOTES_KEY_BOLD,
	ENOTES_KEY_ITALICS,
	ENOTES_KEY_STRIKE,
	ENOTES_KEY_PAGE_INFO,
	ENOTES_KEY_PANEL_MODE,
	ENOTES_KEY_PANEL_MODE_R
} ENotesKey;

#define ENOTES_TYPE_KEY (enotes_key_get_type ())
typedef struct _ENotesApplicationPrivate ENotesApplicationPrivate;

#define ENOTES_APPLICATION_TYPE_STATE (enotes_application_state_get_type ())
#define ENOTES_APPLICATION_STATE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ENOTES_APPLICATION_TYPE_STATE, ENotesApplicationState))
#define ENOTES_APPLICATION_STATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ENOTES_APPLICATION_TYPE_STATE, ENotesApplicationStateClass))
#define ENOTES_APPLICATION_IS_STATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ENOTES_APPLICATION_TYPE_STATE))
#define ENOTES_APPLICATION_IS_STATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ENOTES_APPLICATION_TYPE_STATE))
#define ENOTES_APPLICATION_STATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ENOTES_APPLICATION_TYPE_STATE, ENotesApplicationStateClass))

typedef struct _ENotesApplicationState ENotesApplicationState;
typedef struct _ENotesApplicationStateClass ENotesApplicationStateClass;
typedef struct _ENotesHeaderbarPrivate ENotesHeaderbarPrivate;

#define ENOTES_TYPE_BOOKMARK_BUTTON (enotes_bookmark_button_get_type ())
#define ENOTES_BOOKMARK_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ENOTES_TYPE_BOOKMARK_BUTTON, ENotesBookmarkButton))
#define ENOTES_BOOKMARK_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ENOTES_TYPE_BOOKMARK_BUTTON, ENotesBookmarkButtonClass))
#define ENOTES_IS_BOOKMARK_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ENOTES_TYPE_BOOKMARK_BUTTON))
#define ENOTES_IS_BOOKMARK_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ENOTES_TYPE_BOOKMARK_BUTTON))
#define ENOTES_BOOKMARK_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ENOTES_TYPE_BOOKMARK_BUTTON, ENotesBookmarkButtonClass))

typedef struct _ENotesBookmarkButton ENotesBookmarkButton;
typedef struct _ENotesBookmarkButtonClass ENotesBookmarkButtonClass;

#define ENOTES_TYPE_NOTEBOOK_PICKER (enotes_notebook_picker_get_type ())
#define ENOTES_NOTEBOOK_PICKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ENOTES_TYPE_NOTEBOOK_PICKER, ENotesNotebookPicker))
#define ENOTES_NOTEBOOK_PICKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ENOTES_TYPE_NOTEBOOK_PICKER, ENotesNotebookPickerClass))
#define ENOTES_IS_NOTEBOOK_PICKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ENOTES_TYPE_NOTEBOOK_PICKER))
#define ENOTES_IS_NOTEBOOK_PICKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ENOTES_TYPE_NOTEBOOK_PICKER))
#define ENOTES_NOTEBOOK_PICKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ENOTES_TYPE_NOTEBOOK_PICKER, ENotesNotebookPickerClass))

typedef struct _ENotesNotebookPicker ENotesNotebookPicker;
typedef struct _ENotesNotebookPickerClass ENotesNotebookPickerClass;

#define ENOTES_SERVICES_TYPE_SETTINGS (enotes_services_settings_get_type ())
#define ENOTES_SERVICES_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ENOTES_SERVICES_TYPE_SETTINGS, ENotesServicesSettings))
#define ENOTES_SERVICES_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ENOTES_SERVICES_TYPE_SETTINGS, ENotesServicesSettingsClass))
#define ENOTES_SERVICES_IS_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ENOTES_SERVICES_TYPE_SETTINGS))
#define ENOTES_SERVICES_IS_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ENOTES_SERVICES_TYPE_SETTINGS))
#define ENOTES_SERVICES_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ENOTES_SERVICES_TYPE_SETTINGS, ENotesServicesSettingsClass))

typedef struct _ENotesServicesSettings ENotesServicesSettings;
typedef struct _ENotesServicesSettingsClass ENotesServicesSettingsClass;
typedef struct _ENotesEditorPrivate ENotesEditorPrivate;

#define ENOTES_TYPE_TOOLBAR_BUTTON (enotes_toolbar_button_get_type ())
#define ENOTES_TOOLBAR_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ENOTES_TYPE_TOOLBAR_BUTTON, ENotesToolbarButton))
#define ENOTES_TOOLBAR_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ENOTES_TYPE_TOOLBAR_BUTTON, ENotesToolbarButtonClass))
#define ENOTES_IS_TOOLBAR_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ENOTES_TYPE_TOOLBAR_BUTTON))
#define ENOTES_IS_TOOLBAR_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ENOTES_TYPE_TOOLBAR_BUTTON))
#define ENOTES_TOOLBAR_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ENOTES_TYPE_TOOLBAR_BUTTON, ENotesToolbarButtonClass))

typedef struct _ENotesToolbarButton ENotesToolbarButton;
typedef struct _ENotesToolbarButtonClass ENotesToolbarButtonClass;
typedef enum  {
	ENOTES_MODE_NONE = -1,
	ENOTES_MODE_VIEW = 0,
	ENOTES_MODE_EDIT = 1,
	ENOTES_MODE_BOTH = 2
} ENotesMode;

#define ENOTES_TYPE_MODE (enotes_mode_get_type ())

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

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

#define ENOTES_TYPE_FILE_DATA_TABLE (enotes_file_data_table_get_type ())
#define ENOTES_FILE_DATA_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ENOTES_TYPE_FILE_DATA_TABLE, ENotesFileDataTable))
#define ENOTES_FILE_DATA_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ENOTES_TYPE_FILE_DATA_TABLE, ENotesFileDataTableClass))
#define ENOTES_IS_FILE_DATA_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ENOTES_TYPE_FILE_DATA_TABLE))
#define ENOTES_IS_FILE_DATA_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ENOTES_TYPE_FILE_DATA_TABLE))
#define ENOTES_FILE_DATA_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ENOTES_TYPE_FILE_DATA_TABLE, ENotesFileDataTableClass))

typedef struct _ENotesFileDataTable ENotesFileDataTable;
typedef struct _ENotesFileDataTableClass ENotesFileDataTableClass;

#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;
typedef enum  {
	FILE_DATA_TYPE_FILE_NAME = 0,
	FILE_DATA_TYPE_LAST_NOTEBOOK = 10,
	FILE_DATA_TYPE_LAST_PAGE = 11,
	FILE_DATA_TYPE_STYLESHEET = 21,
	FILE_DATA_TYPE_CUSTOM_CSS = 22
} FileDataType;

#define TYPE_FILE_DATA_TYPE (file_data_type_get_type ())
typedef struct _ENotesNotebookPrivate ENotesNotebookPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _ENotesPagePrivate ENotesPagePrivate;

#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 _database_table_unref0(var) ((var == NULL) ? NULL : (var = (database_table_unref (var), NULL)))
typedef struct _ENotesWindowFourPaneWindowPrivate ENotesWindowFourPaneWindowPrivate;
enum  {
	ENOTES_WINDOW_FOUR_PANE_WINDOW_0_PROPERTY,
	ENOTES_WINDOW_FOUR_PANE_WINDOW_POSITION_1_2_PROPERTY,
	ENOTES_WINDOW_FOUR_PANE_WINDOW_POSITION_2_3_PROPERTY,
	ENOTES_WINDOW_FOUR_PANE_WINDOW_POSITION_3_4_PROPERTY,
	ENOTES_WINDOW_FOUR_PANE_WINDOW_SHOW_1_PROPERTY,
	ENOTES_WINDOW_FOUR_PANE_WINDOW_SHOW_2_PROPERTY,
	ENOTES_WINDOW_FOUR_PANE_WINDOW_SHOW_3_PROPERTY,
	ENOTES_WINDOW_FOUR_PANE_WINDOW_SHOW_4_PROPERTY,
	ENOTES_WINDOW_FOUR_PANE_WINDOW_NUM_PROPERTIES
};
static GParamSpec* enotes_window_four_pane_window_properties[ENOTES_WINDOW_FOUR_PANE_WINDOW_NUM_PROPERTIES];

struct _ENotesWindow {
	GtkApplicationWindow parent_instance;
	ENotesWindowPrivate * priv;
};

struct _ENotesWindowClass {
	GtkApplicationWindowClass parent_class;
};

struct _ENotesWindowPrivate {
	ENotesEditor* editor;
	ENotesHeaderbar* headerbar;
	ENotesPagesList* pages_list;
	ENotesSidebar* sidebar;
	ENotesPageInfoEditor* page_info;
	ENotesViewEditStack* view_edit_stack;
	ENotesViewer* viewer;
	ENotesWindowFourPaneWindow* panes;
};

struct _Block7Data {
	int _ref_count_;
	ENotesWindow* self;
	ENotesApplication* app;
};

struct _ENotesApplication {
	GraniteApplication parent_instance;
	ENotesApplicationPrivate * priv;
	gboolean running;
	ENotesApplicationState* state;
};

struct _ENotesApplicationClass {
	GraniteApplicationClass parent_class;
};

struct _ENotesHeaderbar {
	GtkHeaderBar parent_instance;
	ENotesHeaderbarPrivate * priv;
	ENotesBookmarkButton* bookmark_button;
	GtkGestureSwipe* gesture;
};

struct _ENotesHeaderbarClass {
	GtkHeaderBarClass parent_class;
};

struct _ENotesEditor {
	GtkBox parent_instance;
	ENotesEditorPrivate * priv;
	ENotesToolbarButton* bold_button;
	ENotesToolbarButton* italics_button;
	ENotesToolbarButton* strike_button;
};

struct _ENotesEditorClass {
	GtkBoxClass 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;
};

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 _ENotesWindowFourPaneWindow {
	GtkBin parent_instance;
	ENotesWindowFourPaneWindowPrivate * priv;
};

struct _ENotesWindowFourPaneWindowClass {
	GtkBinClass parent_class;
};

struct _ENotesWindowFourPaneWindowPrivate {
	GtkWidget* widget_1;
	GtkWidget* widget_2;
	GtkWidget* widget_3;
	GtkWidget* widget_4;
	GtkPaned* paned_1_2;
	GtkPaned* paned_2_3;
	GtkPaned* paned_3_4;
};

static gint ENotesWindow_private_offset;
static gpointer enotes_window_parent_class = NULL;
VALA_EXTERN ENotesServicesSettings* enotes_settings;
VALA_EXTERN ENotesApplication* enotes_app;
static gint ENotesWindowFourPaneWindow_private_offset;
static gpointer enotes_window_four_pane_window_parent_class = NULL;

VALA_EXTERN GType enotes_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesWindow, g_object_unref)
VALA_EXTERN GType enotes_editor_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesEditor, g_object_unref)
VALA_EXTERN GType enotes_headerbar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesHeaderbar, g_object_unref)
VALA_EXTERN GType enotes_pages_list_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesPagesList, g_object_unref)
VALA_EXTERN GType granite_widgets_source_list_patch_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GraniteWidgetsSourceListPatch, g_object_unref)
VALA_EXTERN GType enotes_sidebar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesSidebar, g_object_unref)
VALA_EXTERN GType enotes_page_info_editor_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesPageInfoEditor, g_object_unref)
VALA_EXTERN GType enotes_view_edit_stack_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesViewEditStack, g_object_unref)
VALA_EXTERN GType enotes_viewer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesViewer, g_object_unref)
static GType enotes_window_four_pane_window_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesWindowFourPaneWindow, g_object_unref)
VALA_EXTERN GType enotes_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesApplication, g_object_unref)
VALA_EXTERN ENotesWindow* enotes_window_new (ENotesApplication* app);
VALA_EXTERN ENotesWindow* enotes_window_construct (GType object_type,
                                       ENotesApplication* app);
static Block7Data* block7_data_ref (Block7Data* _data7_);
static void block7_data_unref (void * _userdata_);
VALA_EXTERN GType enotes_key_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gchar* enotes_key_to_key (ENotesKey self);
static void enotes_window_build_ui (ENotesWindow* self);
VALA_EXTERN GType enotes_application_state_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesApplicationState, g_object_unref)
VALA_EXTERN void enotes_application_state_toggle_app_mode (ENotesApplicationState* self);
static void _enotes_application_state_toggle_app_mode_g_simple_action_activate (GSimpleAction* _sender,
                                                                         GVariant* parameter,
                                                                         gpointer self);
static void enotes_window_save (ENotesWindow* self);
static void _enotes_window_save_g_simple_action_activate (GSimpleAction* _sender,
                                                   GVariant* parameter,
                                                   gpointer self);
static void enotes_window_request_close (ENotesWindow* self);
static void _enotes_window_request_close_g_simple_action_activate (GSimpleAction* _sender,
                                                            GVariant* parameter,
                                                            gpointer self);
static void enotes_window_new_page (ENotesWindow* self);
static void _enotes_window_new_page_g_simple_action_activate (GSimpleAction* _sender,
                                                       GVariant* parameter,
                                                       gpointer self);
VALA_EXTERN void enotes_headerbar_show_search (ENotesHeaderbar* self);
static void _enotes_headerbar_show_search_g_simple_action_activate (GSimpleAction* _sender,
                                                             GVariant* parameter,
                                                             gpointer self);
VALA_EXTERN GType enotes_bookmark_button_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesBookmarkButton, g_object_unref)
VALA_EXTERN void enotes_bookmark_button_main_action (ENotesBookmarkButton* self);
static void _enotes_bookmark_button_main_action_g_simple_action_activate (GSimpleAction* _sender,
                                                                   GVariant* parameter,
                                                                   gpointer self);
static void enotes_window_bold_act (ENotesWindow* self);
static void _enotes_window_bold_act_g_simple_action_activate (GSimpleAction* _sender,
                                                       GVariant* parameter,
                                                       gpointer self);
static void enotes_window_italics_act (ENotesWindow* self);
static void _enotes_window_italics_act_g_simple_action_activate (GSimpleAction* _sender,
                                                          GVariant* parameter,
                                                          gpointer self);
static void enotes_window_strike_act (ENotesWindow* self);
static void _enotes_window_strike_act_g_simple_action_activate (GSimpleAction* _sender,
                                                         GVariant* parameter,
                                                         gpointer self);
VALA_EXTERN void enotes_window_toggle_page_info (ENotesWindow* self);
static void _enotes_window_toggle_page_info_g_simple_action_activate (GSimpleAction* _sender,
                                                               GVariant* parameter,
                                                               gpointer self);
VALA_EXTERN void enotes_window_cycle_panel_mode (ENotesWindow* self);
static void _enotes_window_cycle_panel_mode_g_simple_action_activate (GSimpleAction* _sender,
                                                               GVariant* parameter,
                                                               gpointer self);
VALA_EXTERN void enotes_window_cycle_panel_mode_reverse (ENotesWindow* self);
static void _enotes_window_cycle_panel_mode_reverse_g_simple_action_activate (GSimpleAction* _sender,
                                                                       GVariant* parameter,
                                                                       gpointer self);
static void __lambda130_ (Block7Data* _data7_);
VALA_EXTERN const gchar* enotes_application_state_get_style_scheme (ENotesApplicationState* self);
static void ___lambda130__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda131_ (ENotesWindow* self);
static void enotes_window_close_database_file (ENotesWindow* self);
static void ___lambda131__enotes_application_state_pre_database_change (ENotesApplicationState* _sender,
                                                                 gpointer self);
static void __lambda132_ (ENotesWindow* self);
static void enotes_window_open_database (ENotesWindow* self);
static void ___lambda132__enotes_application_state_post_database_change (ENotesApplicationState* _sender,
                                                                  gpointer self);
static void __lambda133_ (Block7Data* _data7_);
static void enotes_window_four_pane_window_show_n_panes (ENotesWindowFourPaneWindow* self,
                                                  gint amount);
VALA_EXTERN gint enotes_application_state_get_panes_visible (ENotesApplicationState* self);
static void ___lambda133__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void enotes_window_load_settings (ENotesWindow* self);
VALA_EXTERN ENotesPageInfoEditor* enotes_page_info_editor_new (void);
VALA_EXTERN ENotesPageInfoEditor* enotes_page_info_editor_construct (GType object_type);
VALA_EXTERN ENotesHeaderbar* enotes_headerbar_new (ENotesPageInfoEditor* page_info);
VALA_EXTERN ENotesHeaderbar* enotes_headerbar_construct (GType object_type,
                                             ENotesPageInfoEditor* page_info);
static ENotesWindowFourPaneWindow* enotes_window_four_pane_window_new (void);
static ENotesWindowFourPaneWindow* enotes_window_four_pane_window_construct (GType object_type);
VALA_EXTERN ENotesSidebar* enotes_sidebar_get_instance (void);
VALA_EXTERN ENotesPagesList* enotes_pages_list_get_instance (void);
VALA_EXTERN ENotesViewEditStack* enotes_view_edit_stack_get_instance (void);
VALA_EXTERN ENotesEditor* enotes_view_edit_stack_get_editor (ENotesViewEditStack* self);
VALA_EXTERN ENotesViewer* enotes_view_edit_stack_get_viewer (ENotesViewEditStack* self);
VALA_EXTERN GType enotes_notebook_picker_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesNotebookPicker, g_object_unref)
VALA_EXTERN ENotesNotebookPicker* enotes_notebook_picker_new (void);
VALA_EXTERN ENotesNotebookPicker* enotes_notebook_picker_construct (GType object_type);
static void enotes_window_four_pane_window_pack1 (ENotesWindowFourPaneWindow* self,
                                           GtkWidget* widget);
static void enotes_window_four_pane_window_pack2 (ENotesWindowFourPaneWindow* self,
                                           GtkWidget* widget);
static void enotes_window_four_pane_window_pack3 (ENotesWindowFourPaneWindow* self,
                                           GtkWidget* widget);
static void enotes_window_four_pane_window_pack4 (ENotesWindowFourPaneWindow* self,
                                           GtkWidget* widget);
VALA_EXTERN GType enotes_services_settings_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesServicesSettings, g_object_unref)
VALA_EXTERN gint enotes_services_settings_get_pos_x (ENotesServicesSettings* self);
VALA_EXTERN gint enotes_services_settings_get_pos_y (ENotesServicesSettings* self);
static gboolean enotes_window_editor_open (ENotesWindow* self);
VALA_EXTERN GType enotes_toolbar_button_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesToolbarButton, g_object_unref)
VALA_EXTERN GType enotes_mode_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ENotesMode enotes_application_state_get_mode (ENotesApplicationState* self);
VALA_EXTERN GType enotes_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesPage, g_object_unref)
VALA_EXTERN ENotesPage* enotes_application_state_get_opened_page (ENotesApplicationState* self);
static gboolean enotes_window_real_delete_event (GtkWidget* base,
                                          GdkEventAny* event);
VALA_EXTERN void enotes_services_settings_set_pos_x (ENotesServicesSettings* self,
                                         gint value);
VALA_EXTERN void enotes_services_settings_set_pos_y (ENotesServicesSettings* self,
                                         gint value);
static gint enotes_window_four_pane_window_get_position_2_3 (ENotesWindowFourPaneWindow* self);
VALA_EXTERN void enotes_services_settings_set_notebook_panel_size (ENotesServicesSettings* self,
                                                       gint value);
static gint enotes_window_four_pane_window_get_position_3_4 (ENotesWindowFourPaneWindow* self);
VALA_EXTERN void enotes_services_settings_set_panel_size (ENotesServicesSettings* self,
                                              gint value);
VALA_EXTERN void enotes_services_settings_set_window_width (ENotesServicesSettings* self,
                                                gint value);
VALA_EXTERN void enotes_services_settings_set_window_height (ENotesServicesSettings* self,
                                                 gint value);
VALA_EXTERN void enotes_services_settings_set_mode (ENotesServicesSettings* self,
                                        gint value);
VALA_EXTERN void enotes_services_settings_set_style_scheme (ENotesServicesSettings* self,
                                                const gchar* value);
VALA_EXTERN gboolean enotes_application_state_get_show_page_info (ENotesApplicationState* self);
VALA_EXTERN void enotes_services_settings_set_show_page_info (ENotesServicesSettings* self,
                                                  gboolean value);
VALA_EXTERN const gchar* enotes_application_state_get_editor_font (ENotesApplicationState* self);
VALA_EXTERN void enotes_services_settings_set_editor_font (ENotesServicesSettings* self,
                                               const gchar* value);
VALA_EXTERN const gchar* enotes_application_state_get_editor_scheme (ENotesApplicationState* self);
VALA_EXTERN void enotes_services_settings_set_editor_scheme (ENotesServicesSettings* self,
                                                 const gchar* value);
VALA_EXTERN gboolean enotes_application_state_get_editor_show_line_numbers (ENotesApplicationState* self);
VALA_EXTERN void enotes_services_settings_set_line_numbers (ENotesServicesSettings* self,
                                                gboolean value);
VALA_EXTERN gboolean enotes_application_state_get_editor_auto_indent (ENotesApplicationState* self);
VALA_EXTERN void enotes_services_settings_set_auto_indent (ENotesServicesSettings* self,
                                               gboolean value);
VALA_EXTERN void enotes_services_settings_set_panes_visible (ENotesServicesSettings* self,
                                                 gint value);
VALA_EXTERN void enotes_editor_save_file (ENotesEditor* self);
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_file_data_table_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesFileDataTable, database_table_unref)
VALA_EXTERN ENotesFileDataTable* enotes_file_data_table_get_instance (void);
VALA_EXTERN GType enotes_notebook_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesNotebook, g_object_unref)
VALA_EXTERN ENotesNotebook* enotes_application_state_get_opened_notebook (ENotesApplicationState* self);
VALA_EXTERN GType file_data_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void enotes_file_data_table_set_value_silent (ENotesFileDataTable* self,
                                              FileDataType type,
                                              const gchar* value);
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_clear_files (ENotesTrash* self);
VALA_EXTERN gint enotes_services_settings_get_window_width (ENotesServicesSettings* self);
VALA_EXTERN gint enotes_services_settings_get_window_height (ENotesServicesSettings* self);
VALA_EXTERN gint enotes_services_settings_get_notebook_panel_size (ENotesServicesSettings* self);
static void enotes_window_four_pane_window_set_position_2_3 (ENotesWindowFourPaneWindow* self,
                                                      gint value);
VALA_EXTERN gint enotes_services_settings_get_panel_size (ENotesServicesSettings* self);
static void enotes_window_four_pane_window_set_position_3_4 (ENotesWindowFourPaneWindow* self,
                                                      gint value);
VALA_EXTERN ENotesMode enotes_mode_get_mode (gint value);
VALA_EXTERN gint enotes_services_settings_get_mode (ENotesServicesSettings* self);
VALA_EXTERN void enotes_application_state_set_mode (ENotesApplicationState* self,
                                        ENotesMode value);
VALA_EXTERN void enotes_application_state_set_style (ENotesApplicationState* self,
                                         const gchar* style);
VALA_EXTERN const gchar* enotes_services_settings_get_style_scheme (ENotesServicesSettings* self);
VALA_EXTERN const gchar* enotes_services_settings_get_editor_scheme (ENotesServicesSettings* self);
VALA_EXTERN void enotes_application_state_set_editor_scheme (ENotesApplicationState* self,
                                                 const gchar* value);
VALA_EXTERN gboolean enotes_services_settings_get_show_page_info (ENotesServicesSettings* self);
VALA_EXTERN void enotes_application_state_set_show_page_info (ENotesApplicationState* self,
                                                  gboolean value);
VALA_EXTERN const gchar* enotes_services_settings_get_editor_font (ENotesServicesSettings* self);
VALA_EXTERN void enotes_application_state_set_editor_font (ENotesApplicationState* self,
                                               const gchar* value);
VALA_EXTERN gboolean enotes_services_settings_get_line_numbers (ENotesServicesSettings* self);
VALA_EXTERN void enotes_application_state_set_editor_show_line_numbers (ENotesApplicationState* self,
                                                            gboolean value);
VALA_EXTERN gboolean enotes_services_settings_get_auto_indent (ENotesServicesSettings* self);
VALA_EXTERN void enotes_application_state_set_editor_auto_indent (ENotesApplicationState* self,
                                                      gboolean value);
VALA_EXTERN gint enotes_services_settings_get_panes_visible (ENotesServicesSettings* self);
VALA_EXTERN void enotes_application_state_set_panes_visible (ENotesApplicationState* self,
                                                 gint value);
VALA_EXTERN gint enotes_services_settings_get_last_page (ENotesServicesSettings* self);
VALA_EXTERN void enotes_application_state_open_notebook (ENotesApplicationState* self,
                                             gint64 notebook_id);
VALA_EXTERN gint enotes_services_settings_get_last_notebook (ENotesServicesSettings* self);
VALA_EXTERN void enotes_application_state_open_page (ENotesApplicationState* self,
                                         gint64 page_id);
VALA_EXTERN void enotes_services_settings_set_last_notebook (ENotesServicesSettings* self,
                                                 gint value);
VALA_EXTERN void enotes_services_settings_set_last_page (ENotesServicesSettings* self,
                                             gint value);
VALA_EXTERN gint64 enotes_file_data_table_get_int64 (ENotesFileDataTable* self,
                                         FileDataType type);
VALA_EXTERN void enotes_pages_list_new_blank_page (ENotesPagesList* self);
VALA_EXTERN void enotes_window_set_mode (ENotesWindow* self,
                             ENotesMode mode);
VALA_EXTERN void enotes_window_show_app (ENotesWindow* self);
static void enotes_window_four_pane_window_set_show_1 (ENotesWindowFourPaneWindow* self,
                                                gboolean value);
static void enotes_window_four_pane_window_set_show_2 (ENotesWindowFourPaneWindow* self,
                                                gboolean value);
static void enotes_window_four_pane_window_set_show_3 (ENotesWindowFourPaneWindow* self,
                                                gboolean value);
static gint enotes_window_four_pane_window_get_position_1_2 (ENotesWindowFourPaneWindow* self);
static void enotes_window_four_pane_window_set_position_1_2 (ENotesWindowFourPaneWindow* self,
                                                      gint value);
static gboolean enotes_window_four_pane_window_get_show_1 (ENotesWindowFourPaneWindow* self);
static gboolean enotes_window_four_pane_window_get_show_2 (ENotesWindowFourPaneWindow* self);
static gboolean enotes_window_four_pane_window_get_show_3 (ENotesWindowFourPaneWindow* self);
static gboolean enotes_window_four_pane_window_get_show_4 (ENotesWindowFourPaneWindow* self);
static void enotes_window_four_pane_window_set_show_4 (ENotesWindowFourPaneWindow* self,
                                                gboolean value);
static GObject * enotes_window_four_pane_window_constructor (GType type,
                                                      guint n_construct_properties,
                                                      GObjectConstructParam * construct_properties);
static void enotes_window_four_pane_window_finalize (GObject * obj);
static GType enotes_window_four_pane_window_get_type_once (void);
static void _vala_enotes_window_four_pane_window_get_property (GObject * object,
                                                        guint property_id,
                                                        GValue * value,
                                                        GParamSpec * pspec);
static void _vala_enotes_window_four_pane_window_set_property (GObject * object,
                                                        guint property_id,
                                                        const GValue * value,
                                                        GParamSpec * pspec);
static void enotes_window_finalize (GObject * obj);
static GType enotes_window_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 inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
enotes_window_get_instance_private (ENotesWindow* self)
{
	return G_STRUCT_MEMBER_P (self, ENotesWindow_private_offset);
}

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

static Block7Data*
block7_data_ref (Block7Data* _data7_)
{
	g_atomic_int_inc (&_data7_->_ref_count_);
	return _data7_;
}

static void
block7_data_unref (void * _userdata_)
{
	Block7Data* _data7_;
	_data7_ = (Block7Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
		ENotesWindow* self;
		self = _data7_->self;
		_g_object_unref0 (_data7_->app);
		_g_object_unref0 (self);
		g_slice_free (Block7Data, _data7_);
	}
}

static void
_enotes_application_state_toggle_app_mode_g_simple_action_activate (GSimpleAction* _sender,
                                                                    GVariant* parameter,
                                                                    gpointer self)
{
	enotes_application_state_toggle_app_mode ((ENotesApplicationState*) self);
}

static void
_enotes_window_save_g_simple_action_activate (GSimpleAction* _sender,
                                              GVariant* parameter,
                                              gpointer self)
{
	enotes_window_save ((ENotesWindow*) self);
}

static void
_enotes_window_request_close_g_simple_action_activate (GSimpleAction* _sender,
                                                       GVariant* parameter,
                                                       gpointer self)
{
	enotes_window_request_close ((ENotesWindow*) self);
}

static void
_enotes_window_new_page_g_simple_action_activate (GSimpleAction* _sender,
                                                  GVariant* parameter,
                                                  gpointer self)
{
	enotes_window_new_page ((ENotesWindow*) self);
}

static void
_enotes_headerbar_show_search_g_simple_action_activate (GSimpleAction* _sender,
                                                        GVariant* parameter,
                                                        gpointer self)
{
	enotes_headerbar_show_search ((ENotesHeaderbar*) self);
}

static void
_enotes_bookmark_button_main_action_g_simple_action_activate (GSimpleAction* _sender,
                                                              GVariant* parameter,
                                                              gpointer self)
{
	enotes_bookmark_button_main_action ((ENotesBookmarkButton*) self);
}

static void
_enotes_window_bold_act_g_simple_action_activate (GSimpleAction* _sender,
                                                  GVariant* parameter,
                                                  gpointer self)
{
	enotes_window_bold_act ((ENotesWindow*) self);
}

static void
_enotes_window_italics_act_g_simple_action_activate (GSimpleAction* _sender,
                                                     GVariant* parameter,
                                                     gpointer self)
{
	enotes_window_italics_act ((ENotesWindow*) self);
}

static void
_enotes_window_strike_act_g_simple_action_activate (GSimpleAction* _sender,
                                                    GVariant* parameter,
                                                    gpointer self)
{
	enotes_window_strike_act ((ENotesWindow*) self);
}

static void
_enotes_window_toggle_page_info_g_simple_action_activate (GSimpleAction* _sender,
                                                          GVariant* parameter,
                                                          gpointer self)
{
	enotes_window_toggle_page_info ((ENotesWindow*) self);
}

static void
_enotes_window_cycle_panel_mode_g_simple_action_activate (GSimpleAction* _sender,
                                                          GVariant* parameter,
                                                          gpointer self)
{
	enotes_window_cycle_panel_mode ((ENotesWindow*) self);
}

static void
_enotes_window_cycle_panel_mode_reverse_g_simple_action_activate (GSimpleAction* _sender,
                                                                  GVariant* parameter,
                                                                  gpointer self)
{
	enotes_window_cycle_panel_mode_reverse ((ENotesWindow*) self);
}

static void
__lambda130_ (Block7Data* _data7_)
{
	ENotesWindow* self;
	GtkStyleContext* _tmp0_;
	GtkStyleContext* _tmp1_;
	ENotesApplicationState* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	self = _data7_->self;
	_tmp0_ = gtk_widget_get_style_context ((GtkWidget*) self);
	gtk_style_context_remove_class (_tmp0_, "solarized-light");
	_tmp1_ = gtk_widget_get_style_context ((GtkWidget*) self);
	gtk_style_context_remove_class (_tmp1_, "solarized-dark");
	_tmp2_ = _data7_->app->state;
	_tmp3_ = enotes_application_state_get_style_scheme (_tmp2_);
	_tmp4_ = _tmp3_;
	if (g_strcmp0 (_tmp4_, "high-contrast") != 0) {
		GtkStyleContext* _tmp5_;
		ENotesApplicationState* _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		_tmp5_ = gtk_widget_get_style_context ((GtkWidget*) self);
		_tmp6_ = _data7_->app->state;
		_tmp7_ = enotes_application_state_get_style_scheme (_tmp6_);
		_tmp8_ = _tmp7_;
		gtk_style_context_add_class (_tmp5_, _tmp8_);
	}
}

static void
___lambda130__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda130_ (self);
}

static void
__lambda131_ (ENotesWindow* self)
{
	enotes_window_close_database_file (self);
}

static void
___lambda131__enotes_application_state_pre_database_change (ENotesApplicationState* _sender,
                                                            gpointer self)
{
	__lambda131_ ((ENotesWindow*) self);
}

static void
__lambda132_ (ENotesWindow* self)
{
	enotes_window_open_database (self);
}

static void
___lambda132__enotes_application_state_post_database_change (ENotesApplicationState* _sender,
                                                             gpointer self)
{
	__lambda132_ ((ENotesWindow*) self);
}

static void
__lambda133_ (Block7Data* _data7_)
{
	ENotesWindow* self;
	ENotesWindowFourPaneWindow* _tmp0_;
	ENotesApplicationState* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	self = _data7_->self;
	_tmp0_ = self->priv->panes;
	_tmp1_ = _data7_->app->state;
	_tmp2_ = enotes_application_state_get_panes_visible (_tmp1_);
	_tmp3_ = _tmp2_;
	enotes_window_four_pane_window_show_n_panes (_tmp0_, _tmp3_);
}

static void
___lambda133__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda133_ (self);
}

ENotesWindow*
enotes_window_construct (GType object_type,
                         ENotesApplication* app)
{
	ENotesWindow * self = NULL;
	Block7Data* _data7_;
	ENotesApplication* _tmp0_;
	GSimpleAction* change_mode = NULL;
	GSimpleAction* _tmp1_;
	GSimpleAction* save_action = NULL;
	GSimpleAction* _tmp2_;
	GSimpleAction* close_action = NULL;
	GSimpleAction* _tmp3_;
	GSimpleAction* new_action = NULL;
	GSimpleAction* _tmp4_;
	GSimpleAction* find_action = NULL;
	GSimpleAction* _tmp5_;
	GSimpleAction* bookmark_action = NULL;
	GSimpleAction* _tmp6_;
	GSimpleAction* bold_action = NULL;
	GSimpleAction* _tmp7_;
	GSimpleAction* italics_action = NULL;
	GSimpleAction* _tmp8_;
	GSimpleAction* strike_action = NULL;
	GSimpleAction* _tmp9_;
	GSimpleAction* page_info_action = NULL;
	GSimpleAction* _tmp10_;
	GSimpleAction* cycle_panel_action = NULL;
	GSimpleAction* _tmp11_;
	GSimpleAction* cycle_panel_r_action = NULL;
	GSimpleAction* _tmp12_;
	gchar* _tmp13_;
	gchar** _tmp14_;
	gchar** _tmp15_;
	gint _tmp15__length1;
	gchar* _tmp16_;
	gchar** _tmp17_;
	gchar** _tmp18_;
	gint _tmp18__length1;
	gchar* _tmp19_;
	gchar** _tmp20_;
	gchar** _tmp21_;
	gint _tmp21__length1;
	gchar* _tmp22_;
	gchar** _tmp23_;
	gchar** _tmp24_;
	gint _tmp24__length1;
	gchar* _tmp25_;
	gchar** _tmp26_;
	gchar** _tmp27_;
	gint _tmp27__length1;
	gchar* _tmp28_;
	gchar** _tmp29_;
	gchar** _tmp30_;
	gint _tmp30__length1;
	gchar* _tmp31_;
	gchar** _tmp32_;
	gchar** _tmp33_;
	gint _tmp33__length1;
	gchar* _tmp34_;
	gchar** _tmp35_;
	gchar** _tmp36_;
	gint _tmp36__length1;
	gchar* _tmp37_;
	gchar** _tmp38_;
	gchar** _tmp39_;
	gint _tmp39__length1;
	gchar* _tmp40_;
	gchar** _tmp41_;
	gchar** _tmp42_;
	gint _tmp42__length1;
	gchar* _tmp43_;
	gchar** _tmp44_;
	gchar** _tmp45_;
	gint _tmp45__length1;
	gchar* _tmp46_;
	gchar** _tmp47_;
	gchar** _tmp48_;
	gint _tmp48__length1;
	ENotesApplicationState* _tmp49_;
	ENotesHeaderbar* _tmp50_;
	ENotesHeaderbar* _tmp51_;
	ENotesBookmarkButton* _tmp52_;
	GtkCssProvider* provider = NULL;
	GtkCssProvider* _tmp53_;
	GdkScreen* _tmp54_;
	ENotesApplicationState* _tmp55_;
	ENotesApplicationState* _tmp56_;
	ENotesApplicationState* _tmp57_;
	ENotesApplicationState* _tmp58_;
	g_return_val_if_fail (app != NULL, NULL);
	_data7_ = g_slice_new0 (Block7Data);
	_data7_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (app);
	_g_object_unref0 (_data7_->app);
	_data7_->app = _tmp0_;
	self = (ENotesWindow*) g_object_new (object_type, "application", _data7_->app, NULL);
	_data7_->self = g_object_ref (self);
	_tmp1_ = g_simple_action_new ("change-mode", NULL);
	change_mode = _tmp1_;
	_tmp2_ = g_simple_action_new ("save", NULL);
	save_action = _tmp2_;
	_tmp3_ = g_simple_action_new ("close-action", NULL);
	close_action = _tmp3_;
	_tmp4_ = g_simple_action_new ("new-action", NULL);
	new_action = _tmp4_;
	_tmp5_ = g_simple_action_new ("find-action", NULL);
	find_action = _tmp5_;
	_tmp6_ = g_simple_action_new ("bookmark-action", NULL);
	bookmark_action = _tmp6_;
	_tmp7_ = g_simple_action_new ("bold-action", NULL);
	bold_action = _tmp7_;
	_tmp8_ = g_simple_action_new ("italics-action", NULL);
	italics_action = _tmp8_;
	_tmp9_ = g_simple_action_new ("strike-action", NULL);
	strike_action = _tmp9_;
	_tmp10_ = g_simple_action_new ("page-info-action", NULL);
	page_info_action = _tmp10_;
	_tmp11_ = g_simple_action_new ("cycle-panel-mode", NULL);
	cycle_panel_action = _tmp11_;
	_tmp12_ = g_simple_action_new ("cycle-panel-mode-reverse", NULL);
	cycle_panel_r_action = _tmp12_;
	g_action_map_add_action ((GActionMap*) self, (GAction*) change_mode);
	g_action_map_add_action ((GActionMap*) self, (GAction*) save_action);
	g_action_map_add_action ((GActionMap*) self, (GAction*) close_action);
	g_action_map_add_action ((GActionMap*) self, (GAction*) new_action);
	g_action_map_add_action ((GActionMap*) self, (GAction*) find_action);
	g_action_map_add_action ((GActionMap*) self, (GAction*) bookmark_action);
	g_action_map_add_action ((GActionMap*) self, (GAction*) bold_action);
	g_action_map_add_action ((GActionMap*) self, (GAction*) italics_action);
	g_action_map_add_action ((GActionMap*) self, (GAction*) strike_action);
	g_action_map_add_action ((GActionMap*) self, (GAction*) page_info_action);
	g_action_map_add_action ((GActionMap*) self, (GAction*) cycle_panel_action);
	g_action_map_add_action ((GActionMap*) self, (GAction*) cycle_panel_r_action);
	_tmp13_ = enotes_key_to_key (ENOTES_KEY_CHANGE_MODE);
	_tmp14_ = g_new0 (gchar*, 1 + 1);
	_tmp14_[0] = _tmp13_;
	_tmp15_ = _tmp14_;
	_tmp15__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) _data7_->app, "win.change-mode", _tmp15_);
	_tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) g_free), NULL);
	_tmp16_ = enotes_key_to_key (ENOTES_KEY_SAVE);
	_tmp17_ = g_new0 (gchar*, 1 + 1);
	_tmp17_[0] = _tmp16_;
	_tmp18_ = _tmp17_;
	_tmp18__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) _data7_->app, "win.save", _tmp18_);
	_tmp18_ = (_vala_array_free (_tmp18_, _tmp18__length1, (GDestroyNotify) g_free), NULL);
	_tmp19_ = enotes_key_to_key (ENOTES_KEY_QUIT);
	_tmp20_ = g_new0 (gchar*, 1 + 1);
	_tmp20_[0] = _tmp19_;
	_tmp21_ = _tmp20_;
	_tmp21__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) _data7_->app, "win.close-action", _tmp21_);
	_tmp21_ = (_vala_array_free (_tmp21_, _tmp21__length1, (GDestroyNotify) g_free), NULL);
	_tmp22_ = enotes_key_to_key (ENOTES_KEY_NEW_PAGE);
	_tmp23_ = g_new0 (gchar*, 1 + 1);
	_tmp23_[0] = _tmp22_;
	_tmp24_ = _tmp23_;
	_tmp24__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) _data7_->app, "win.new-action", _tmp24_);
	_tmp24_ = (_vala_array_free (_tmp24_, _tmp24__length1, (GDestroyNotify) g_free), NULL);
	_tmp25_ = enotes_key_to_key (ENOTES_KEY_FIND);
	_tmp26_ = g_new0 (gchar*, 1 + 1);
	_tmp26_[0] = _tmp25_;
	_tmp27_ = _tmp26_;
	_tmp27__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) _data7_->app, "win.find-action", _tmp27_);
	_tmp27_ = (_vala_array_free (_tmp27_, _tmp27__length1, (GDestroyNotify) g_free), NULL);
	_tmp28_ = enotes_key_to_key (ENOTES_KEY_BOOKMARK);
	_tmp29_ = g_new0 (gchar*, 1 + 1);
	_tmp29_[0] = _tmp28_;
	_tmp30_ = _tmp29_;
	_tmp30__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) _data7_->app, "win.bookmark-action", _tmp30_);
	_tmp30_ = (_vala_array_free (_tmp30_, _tmp30__length1, (GDestroyNotify) g_free), NULL);
	_tmp31_ = enotes_key_to_key (ENOTES_KEY_BOLD);
	_tmp32_ = g_new0 (gchar*, 1 + 1);
	_tmp32_[0] = _tmp31_;
	_tmp33_ = _tmp32_;
	_tmp33__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) _data7_->app, "win.bold-action", _tmp33_);
	_tmp33_ = (_vala_array_free (_tmp33_, _tmp33__length1, (GDestroyNotify) g_free), NULL);
	_tmp34_ = enotes_key_to_key (ENOTES_KEY_ITALICS);
	_tmp35_ = g_new0 (gchar*, 1 + 1);
	_tmp35_[0] = _tmp34_;
	_tmp36_ = _tmp35_;
	_tmp36__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) _data7_->app, "win.italics-action", _tmp36_);
	_tmp36_ = (_vala_array_free (_tmp36_, _tmp36__length1, (GDestroyNotify) g_free), NULL);
	_tmp37_ = enotes_key_to_key (ENOTES_KEY_STRIKE);
	_tmp38_ = g_new0 (gchar*, 1 + 1);
	_tmp38_[0] = _tmp37_;
	_tmp39_ = _tmp38_;
	_tmp39__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) _data7_->app, "win.strike-action", _tmp39_);
	_tmp39_ = (_vala_array_free (_tmp39_, _tmp39__length1, (GDestroyNotify) g_free), NULL);
	_tmp40_ = enotes_key_to_key (ENOTES_KEY_PAGE_INFO);
	_tmp41_ = g_new0 (gchar*, 1 + 1);
	_tmp41_[0] = _tmp40_;
	_tmp42_ = _tmp41_;
	_tmp42__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) _data7_->app, "win.page-info-action", _tmp42_);
	_tmp42_ = (_vala_array_free (_tmp42_, _tmp42__length1, (GDestroyNotify) g_free), NULL);
	_tmp43_ = enotes_key_to_key (ENOTES_KEY_PANEL_MODE);
	_tmp44_ = g_new0 (gchar*, 1 + 1);
	_tmp44_[0] = _tmp43_;
	_tmp45_ = _tmp44_;
	_tmp45__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) _data7_->app, "win.cycle-panel-mode", _tmp45_);
	_tmp45_ = (_vala_array_free (_tmp45_, _tmp45__length1, (GDestroyNotify) g_free), NULL);
	_tmp46_ = enotes_key_to_key (ENOTES_KEY_PANEL_MODE_R);
	_tmp47_ = g_new0 (gchar*, 1 + 1);
	_tmp47_[0] = _tmp46_;
	_tmp48_ = _tmp47_;
	_tmp48__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) _data7_->app, "win.cycle-panel-mode-reverse", _tmp48_);
	_tmp48_ = (_vala_array_free (_tmp48_, _tmp48__length1, (GDestroyNotify) g_free), NULL);
	enotes_window_build_ui (self);
	_tmp49_ = _data7_->app->state;
	g_signal_connect_object (change_mode, "activate", (GCallback) _enotes_application_state_toggle_app_mode_g_simple_action_activate, _tmp49_, 0);
	g_signal_connect_object (save_action, "activate", (GCallback) _enotes_window_save_g_simple_action_activate, self, 0);
	g_signal_connect_object (close_action, "activate", (GCallback) _enotes_window_request_close_g_simple_action_activate, self, 0);
	g_signal_connect_object (new_action, "activate", (GCallback) _enotes_window_new_page_g_simple_action_activate, self, 0);
	_tmp50_ = self->priv->headerbar;
	g_signal_connect_object (find_action, "activate", (GCallback) _enotes_headerbar_show_search_g_simple_action_activate, _tmp50_, 0);
	_tmp51_ = self->priv->headerbar;
	_tmp52_ = _tmp51_->bookmark_button;
	g_signal_connect_object (bookmark_action, "activate", (GCallback) _enotes_bookmark_button_main_action_g_simple_action_activate, _tmp52_, 0);
	g_signal_connect_object (bold_action, "activate", (GCallback) _enotes_window_bold_act_g_simple_action_activate, self, 0);
	g_signal_connect_object (italics_action, "activate", (GCallback) _enotes_window_italics_act_g_simple_action_activate, self, 0);
	g_signal_connect_object (strike_action, "activate", (GCallback) _enotes_window_strike_act_g_simple_action_activate, self, 0);
	g_signal_connect_object (page_info_action, "activate", (GCallback) _enotes_window_toggle_page_info_g_simple_action_activate, self, 0);
	g_signal_connect_object (cycle_panel_action, "activate", (GCallback) _enotes_window_cycle_panel_mode_g_simple_action_activate, self, 0);
	g_signal_connect_object (cycle_panel_r_action, "activate", (GCallback) _enotes_window_cycle_panel_mode_reverse_g_simple_action_activate, self, 0);
	_tmp53_ = gtk_css_provider_new ();
	provider = _tmp53_;
	gtk_css_provider_load_from_resource (provider, "/com/github/philip-scott/notes-up/Application.css");
	_tmp54_ = gdk_screen_get_default ();
	gtk_style_context_add_provider_for_screen (_tmp54_, (GtkStyleProvider*) provider, (guint) GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
	_tmp55_ = _data7_->app->state;
	g_signal_connect_data ((GObject*) _tmp55_, "notify::style-scheme", (GCallback) ___lambda130__g_object_notify, block7_data_ref (_data7_), (GClosureNotify) block7_data_unref, 0);
	_tmp56_ = _data7_->app->state;
	g_signal_connect_object (_tmp56_, "pre-database-change", (GCallback) ___lambda131__enotes_application_state_pre_database_change, self, 0);
	_tmp57_ = _data7_->app->state;
	g_signal_connect_object (_tmp57_, "post-database-change", (GCallback) ___lambda132__enotes_application_state_post_database_change, self, 0);
	_tmp58_ = _data7_->app->state;
	g_signal_connect_data ((GObject*) _tmp58_, "notify::panes-visible", (GCallback) ___lambda133__g_object_notify, block7_data_ref (_data7_), (GClosureNotify) block7_data_unref, 0);
	enotes_window_load_settings (self);
	_g_object_unref0 (provider);
	_g_object_unref0 (cycle_panel_r_action);
	_g_object_unref0 (cycle_panel_action);
	_g_object_unref0 (page_info_action);
	_g_object_unref0 (strike_action);
	_g_object_unref0 (italics_action);
	_g_object_unref0 (bold_action);
	_g_object_unref0 (bookmark_action);
	_g_object_unref0 (find_action);
	_g_object_unref0 (new_action);
	_g_object_unref0 (close_action);
	_g_object_unref0 (save_action);
	_g_object_unref0 (change_mode);
	block7_data_unref (_data7_);
	_data7_ = NULL;
	return self;
}

ENotesWindow*
enotes_window_new (ENotesApplication* app)
{
	return enotes_window_construct (ENOTES_TYPE_WINDOW, app);
}

static void
enotes_window_build_ui (ENotesWindow* self)
{
	ENotesPageInfoEditor* _tmp0_;
	ENotesPageInfoEditor* _tmp1_;
	ENotesHeaderbar* _tmp2_;
	ENotesHeaderbar* _tmp3_;
	ENotesWindowFourPaneWindow* _tmp4_;
	ENotesSidebar* _tmp5_;
	ENotesPagesList* _tmp6_;
	ENotesViewEditStack* _tmp7_;
	ENotesViewEditStack* _tmp8_;
	ENotesViewEditStack* _tmp9_;
	ENotesEditor* _tmp10_;
	ENotesEditor* _tmp11_;
	ENotesEditor* _tmp12_;
	ENotesViewEditStack* _tmp13_;
	ENotesViewEditStack* _tmp14_;
	ENotesViewer* _tmp15_;
	ENotesViewer* _tmp16_;
	ENotesViewer* _tmp17_;
	GtkGrid* main_area_grid = NULL;
	GtkGrid* _tmp18_;
	ENotesPageInfoEditor* _tmp19_;
	ENotesViewEditStack* _tmp20_;
	ENotesNotebookPicker* notebook_picker = NULL;
	ENotesNotebookPicker* _tmp21_;
	ENotesWindowFourPaneWindow* _tmp22_;
	ENotesWindowFourPaneWindow* _tmp23_;
	ENotesSidebar* _tmp24_;
	ENotesWindowFourPaneWindow* _tmp25_;
	ENotesPagesList* _tmp26_;
	ENotesWindowFourPaneWindow* _tmp27_;
	ENotesServicesSettings* _tmp28_;
	gint _tmp29_;
	gint _tmp30_;
	ENotesServicesSettings* _tmp31_;
	gint _tmp32_;
	gint _tmp33_;
	ENotesWindowFourPaneWindow* _tmp34_;
	g_return_if_fail (self != NULL);
	_tmp0_ = enotes_page_info_editor_new ();
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->page_info);
	self->priv->page_info = _tmp0_;
	_tmp1_ = self->priv->page_info;
	_tmp2_ = enotes_headerbar_new (_tmp1_);
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->headerbar);
	self->priv->headerbar = _tmp2_;
	_tmp3_ = self->priv->headerbar;
	gtk_window_set_titlebar ((GtkWindow*) self, (GtkWidget*) _tmp3_);
	gtk_widget_set_events ((GtkWidget*) self, (gint) GDK_BUTTON_PRESS_MASK);
	_tmp4_ = enotes_window_four_pane_window_new ();
	g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->panes);
	self->priv->panes = _tmp4_;
	_tmp5_ = enotes_sidebar_get_instance ();
	_g_object_unref0 (self->priv->sidebar);
	self->priv->sidebar = _tmp5_;
	_tmp6_ = enotes_pages_list_get_instance ();
	_g_object_unref0 (self->priv->pages_list);
	self->priv->pages_list = _tmp6_;
	_tmp7_ = enotes_view_edit_stack_get_instance ();
	_g_object_unref0 (self->priv->view_edit_stack);
	self->priv->view_edit_stack = _tmp7_;
	_tmp8_ = enotes_view_edit_stack_get_instance ();
	_tmp9_ = _tmp8_;
	_tmp10_ = enotes_view_edit_stack_get_editor (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = _g_object_ref0 (_tmp11_);
	_g_object_unref0 (self->priv->editor);
	self->priv->editor = _tmp12_;
	_g_object_unref0 (_tmp9_);
	_tmp13_ = enotes_view_edit_stack_get_instance ();
	_tmp14_ = _tmp13_;
	_tmp15_ = enotes_view_edit_stack_get_viewer (_tmp14_);
	_tmp16_ = _tmp15_;
	_tmp17_ = _g_object_ref0 (_tmp16_);
	_g_object_unref0 (self->priv->viewer);
	self->priv->viewer = _tmp17_;
	_g_object_unref0 (_tmp14_);
	_tmp18_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp18_);
	main_area_grid = _tmp18_;
	gtk_orientable_set_orientation ((GtkOrientable*) main_area_grid, GTK_ORIENTATION_VERTICAL);
	_tmp19_ = self->priv->page_info;
	gtk_container_add ((GtkContainer*) main_area_grid, (GtkWidget*) _tmp19_);
	_tmp20_ = self->priv->view_edit_stack;
	gtk_container_add ((GtkContainer*) main_area_grid, (GtkWidget*) _tmp20_);
	_tmp21_ = enotes_notebook_picker_new ();
	g_object_ref_sink (_tmp21_);
	notebook_picker = _tmp21_;
	_tmp22_ = self->priv->panes;
	enotes_window_four_pane_window_pack1 (_tmp22_, (GtkWidget*) notebook_picker);
	_tmp23_ = self->priv->panes;
	_tmp24_ = self->priv->sidebar;
	enotes_window_four_pane_window_pack2 (_tmp23_, (GtkWidget*) _tmp24_);
	_tmp25_ = self->priv->panes;
	_tmp26_ = self->priv->pages_list;
	enotes_window_four_pane_window_pack3 (_tmp25_, (GtkWidget*) _tmp26_);
	_tmp27_ = self->priv->panes;
	enotes_window_four_pane_window_pack4 (_tmp27_, (GtkWidget*) main_area_grid);
	_tmp28_ = enotes_settings;
	_tmp29_ = enotes_services_settings_get_pos_x (_tmp28_);
	_tmp30_ = _tmp29_;
	_tmp31_ = enotes_settings;
	_tmp32_ = enotes_services_settings_get_pos_y (_tmp31_);
	_tmp33_ = _tmp32_;
	gtk_window_move ((GtkWindow*) self, _tmp30_, _tmp33_);
	_tmp34_ = self->priv->panes;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp34_);
	gtk_widget_show_all ((GtkWidget*) self);
	_g_object_unref0 (notebook_picker);
	_g_object_unref0 (main_area_grid);
}

static void
enotes_window_bold_act (ENotesWindow* self)
{
	g_return_if_fail (self != NULL);
	if (enotes_window_editor_open (self)) {
		ENotesViewEditStack* _tmp0_;
		ENotesViewEditStack* _tmp1_;
		ENotesEditor* _tmp2_;
		ENotesEditor* _tmp3_;
		ENotesToolbarButton* _tmp4_;
		_tmp0_ = enotes_view_edit_stack_get_instance ();
		_tmp1_ = _tmp0_;
		_tmp2_ = enotes_view_edit_stack_get_editor (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_->bold_button;
		gtk_button_clicked ((GtkButton*) _tmp4_);
		_g_object_unref0 (_tmp1_);
	}
}

static void
enotes_window_italics_act (ENotesWindow* self)
{
	g_return_if_fail (self != NULL);
	if (enotes_window_editor_open (self)) {
		ENotesViewEditStack* _tmp0_;
		ENotesViewEditStack* _tmp1_;
		ENotesEditor* _tmp2_;
		ENotesEditor* _tmp3_;
		ENotesToolbarButton* _tmp4_;
		_tmp0_ = enotes_view_edit_stack_get_instance ();
		_tmp1_ = _tmp0_;
		_tmp2_ = enotes_view_edit_stack_get_editor (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_->italics_button;
		gtk_button_clicked ((GtkButton*) _tmp4_);
		_g_object_unref0 (_tmp1_);
	}
}

static void
enotes_window_strike_act (ENotesWindow* self)
{
	g_return_if_fail (self != NULL);
	if (enotes_window_editor_open (self)) {
		ENotesViewEditStack* _tmp0_;
		ENotesViewEditStack* _tmp1_;
		ENotesEditor* _tmp2_;
		ENotesEditor* _tmp3_;
		ENotesToolbarButton* _tmp4_;
		_tmp0_ = enotes_view_edit_stack_get_instance ();
		_tmp1_ = _tmp0_;
		_tmp2_ = enotes_view_edit_stack_get_editor (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_->strike_button;
		gtk_button_clicked ((GtkButton*) _tmp4_);
		_g_object_unref0 (_tmp1_);
	}
}

static gboolean
enotes_window_editor_open (ENotesWindow* self)
{
	gboolean _tmp0_ = FALSE;
	ENotesApplication* _tmp1_;
	ENotesApplicationState* _tmp2_;
	ENotesMode _tmp3_;
	ENotesMode _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = enotes_app;
	_tmp2_ = _tmp1_->state;
	_tmp3_ = enotes_application_state_get_mode (_tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp4_ != ENOTES_MODE_VIEW) {
		ENotesApplication* _tmp5_;
		ENotesApplicationState* _tmp6_;
		ENotesPage* _tmp7_;
		ENotesPage* _tmp8_;
		_tmp5_ = enotes_app;
		_tmp6_ = _tmp5_->state;
		_tmp7_ = enotes_application_state_get_opened_page (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp0_ = _tmp8_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static gboolean
enotes_window_real_delete_event (GtkWidget* base,
                                 GdkEventAny* event)
{
	ENotesWindow * self;
	gint width = 0;
	gint height = 0;
	gint x = 0;
	gint y = 0;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	ENotesServicesSettings* _tmp4_;
	ENotesServicesSettings* _tmp5_;
	ENotesServicesSettings* _tmp6_;
	ENotesWindowFourPaneWindow* _tmp7_;
	gint _tmp8_;
	gint _tmp9_;
	ENotesServicesSettings* _tmp10_;
	ENotesWindowFourPaneWindow* _tmp11_;
	gint _tmp12_;
	gint _tmp13_;
	ENotesServicesSettings* _tmp14_;
	ENotesServicesSettings* _tmp15_;
	ENotesServicesSettings* _tmp16_;
	ENotesApplication* _tmp17_;
	ENotesApplicationState* _tmp18_;
	ENotesMode _tmp19_;
	ENotesMode _tmp20_;
	ENotesServicesSettings* _tmp21_;
	ENotesApplication* _tmp22_;
	ENotesApplicationState* _tmp23_;
	const gchar* _tmp24_;
	const gchar* _tmp25_;
	ENotesServicesSettings* _tmp26_;
	ENotesApplication* _tmp27_;
	ENotesApplicationState* _tmp28_;
	gboolean _tmp29_;
	gboolean _tmp30_;
	ENotesServicesSettings* _tmp31_;
	ENotesApplication* _tmp32_;
	ENotesApplicationState* _tmp33_;
	const gchar* _tmp34_;
	const gchar* _tmp35_;
	ENotesServicesSettings* _tmp36_;
	ENotesApplication* _tmp37_;
	ENotesApplicationState* _tmp38_;
	const gchar* _tmp39_;
	const gchar* _tmp40_;
	ENotesServicesSettings* _tmp41_;
	ENotesApplication* _tmp42_;
	ENotesApplicationState* _tmp43_;
	gboolean _tmp44_;
	gboolean _tmp45_;
	ENotesServicesSettings* _tmp46_;
	ENotesApplication* _tmp47_;
	ENotesApplicationState* _tmp48_;
	gboolean _tmp49_;
	gboolean _tmp50_;
	ENotesServicesSettings* _tmp51_;
	ENotesApplication* _tmp52_;
	ENotesApplicationState* _tmp53_;
	gint _tmp54_;
	gint _tmp55_;
	gboolean result;
	self = (ENotesWindow*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	enotes_window_close_database_file (self);
	gtk_window_get_size ((GtkWindow*) self, &_tmp0_, &_tmp1_);
	width = _tmp0_;
	height = _tmp1_;
	gtk_window_get_position ((GtkWindow*) self, &_tmp2_, &_tmp3_);
	x = _tmp2_;
	y = _tmp3_;
	_tmp4_ = enotes_settings;
	enotes_services_settings_set_pos_x (_tmp4_, x);
	_tmp5_ = enotes_settings;
	enotes_services_settings_set_pos_y (_tmp5_, y);
	_tmp6_ = enotes_settings;
	_tmp7_ = self->priv->panes;
	_tmp8_ = enotes_window_four_pane_window_get_position_2_3 (_tmp7_);
	_tmp9_ = _tmp8_;
	enotes_services_settings_set_notebook_panel_size (_tmp6_, _tmp9_);
	_tmp10_ = enotes_settings;
	_tmp11_ = self->priv->panes;
	_tmp12_ = enotes_window_four_pane_window_get_position_3_4 (_tmp11_);
	_tmp13_ = _tmp12_;
	enotes_services_settings_set_panel_size (_tmp10_, _tmp13_);
	_tmp14_ = enotes_settings;
	enotes_services_settings_set_window_width (_tmp14_, width);
	_tmp15_ = enotes_settings;
	enotes_services_settings_set_window_height (_tmp15_, height);
	_tmp16_ = enotes_settings;
	_tmp17_ = enotes_app;
	_tmp18_ = _tmp17_->state;
	_tmp19_ = enotes_application_state_get_mode (_tmp18_);
	_tmp20_ = _tmp19_;
	enotes_services_settings_set_mode (_tmp16_, (gint) _tmp20_);
	_tmp21_ = enotes_settings;
	_tmp22_ = enotes_app;
	_tmp23_ = _tmp22_->state;
	_tmp24_ = enotes_application_state_get_style_scheme (_tmp23_);
	_tmp25_ = _tmp24_;
	enotes_services_settings_set_style_scheme (_tmp21_, _tmp25_);
	_tmp26_ = enotes_settings;
	_tmp27_ = enotes_app;
	_tmp28_ = _tmp27_->state;
	_tmp29_ = enotes_application_state_get_show_page_info (_tmp28_);
	_tmp30_ = _tmp29_;
	enotes_services_settings_set_show_page_info (_tmp26_, _tmp30_);
	_tmp31_ = enotes_settings;
	_tmp32_ = enotes_app;
	_tmp33_ = _tmp32_->state;
	_tmp34_ = enotes_application_state_get_editor_font (_tmp33_);
	_tmp35_ = _tmp34_;
	enotes_services_settings_set_editor_font (_tmp31_, _tmp35_);
	_tmp36_ = enotes_settings;
	_tmp37_ = enotes_app;
	_tmp38_ = _tmp37_->state;
	_tmp39_ = enotes_application_state_get_editor_scheme (_tmp38_);
	_tmp40_ = _tmp39_;
	enotes_services_settings_set_editor_scheme (_tmp36_, _tmp40_);
	_tmp41_ = enotes_settings;
	_tmp42_ = enotes_app;
	_tmp43_ = _tmp42_->state;
	_tmp44_ = enotes_application_state_get_editor_show_line_numbers (_tmp43_);
	_tmp45_ = _tmp44_;
	enotes_services_settings_set_line_numbers (_tmp41_, _tmp45_);
	_tmp46_ = enotes_settings;
	_tmp47_ = enotes_app;
	_tmp48_ = _tmp47_->state;
	_tmp49_ = enotes_application_state_get_editor_auto_indent (_tmp48_);
	_tmp50_ = _tmp49_;
	enotes_services_settings_set_auto_indent (_tmp46_, _tmp50_);
	_tmp51_ = enotes_settings;
	_tmp52_ = enotes_app;
	_tmp53_ = _tmp52_->state;
	_tmp54_ = enotes_application_state_get_panes_visible (_tmp53_);
	_tmp55_ = _tmp54_;
	enotes_services_settings_set_panes_visible (_tmp51_, _tmp55_);
	result = FALSE;
	return result;
}

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

static void
enotes_window_close_database_file (ENotesWindow* self)
{
	ENotesEditor* _tmp0_;
	ENotesFileDataTable* file_data = NULL;
	ENotesFileDataTable* _tmp1_;
	ENotesFileDataTable* _tmp2_;
	ENotesFileDataTable* _tmp3_;
	ENotesNotebook* opened_notebook = NULL;
	ENotesApplication* _tmp4_;
	ENotesApplicationState* _tmp5_;
	ENotesNotebook* _tmp6_;
	ENotesNotebook* _tmp7_;
	ENotesNotebook* _tmp8_;
	ENotesNotebook* _tmp9_;
	ENotesPage* opened_page = NULL;
	ENotesApplication* _tmp15_;
	ENotesApplicationState* _tmp16_;
	ENotesPage* _tmp17_;
	ENotesPage* _tmp18_;
	ENotesPage* _tmp19_;
	ENotesPage* _tmp20_;
	ENotesTrash* _tmp26_;
	ENotesTrash* _tmp27_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->editor;
	enotes_editor_save_file (_tmp0_);
	_tmp1_ = enotes_file_data_table_get_instance ();
	_tmp2_ = _tmp1_;
	_tmp3_ = _database_table_ref0 (_tmp2_);
	file_data = _tmp3_;
	_tmp4_ = enotes_app;
	_tmp5_ = _tmp4_->state;
	_tmp6_ = enotes_application_state_get_opened_notebook (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = _g_object_ref0 (_tmp7_);
	opened_notebook = _tmp8_;
	_tmp9_ = opened_notebook;
	if (_tmp9_ != NULL) {
		ENotesFileDataTable* _tmp10_;
		ENotesNotebook* _tmp11_;
		gchar* _tmp12_;
		gchar* _tmp13_;
		_tmp10_ = file_data;
		_tmp11_ = opened_notebook;
		_tmp12_ = g_strdup_printf ("%" G_GINT64_FORMAT, _tmp11_->id);
		_tmp13_ = _tmp12_;
		enotes_file_data_table_set_value_silent (_tmp10_, FILE_DATA_TYPE_LAST_NOTEBOOK, _tmp13_);
		_g_free0 (_tmp13_);
	} else {
		ENotesFileDataTable* _tmp14_;
		_tmp14_ = file_data;
		enotes_file_data_table_set_value_silent (_tmp14_, FILE_DATA_TYPE_LAST_NOTEBOOK, "0");
	}
	_tmp15_ = enotes_app;
	_tmp16_ = _tmp15_->state;
	_tmp17_ = enotes_application_state_get_opened_page (_tmp16_);
	_tmp18_ = _tmp17_;
	_tmp19_ = _g_object_ref0 (_tmp18_);
	opened_page = _tmp19_;
	_tmp20_ = opened_page;
	if (_tmp20_ != NULL) {
		ENotesFileDataTable* _tmp21_;
		ENotesPage* _tmp22_;
		gchar* _tmp23_;
		gchar* _tmp24_;
		_tmp21_ = file_data;
		_tmp22_ = opened_page;
		_tmp23_ = g_strdup_printf ("%" G_GINT64_FORMAT, _tmp22_->id);
		_tmp24_ = _tmp23_;
		enotes_file_data_table_set_value_silent (_tmp21_, FILE_DATA_TYPE_LAST_PAGE, _tmp24_);
		_g_free0 (_tmp24_);
	} else {
		ENotesFileDataTable* _tmp25_;
		_tmp25_ = file_data;
		enotes_file_data_table_set_value_silent (_tmp25_, FILE_DATA_TYPE_LAST_PAGE, "0");
	}
	_tmp26_ = enotes_trash_get_instance ();
	_tmp27_ = _tmp26_;
	enotes_trash_clear_files (_tmp27_);
	_g_object_unref0 (_tmp27_);
	_g_object_unref0 (opened_page);
	_g_object_unref0 (opened_notebook);
	_database_table_unref0 (file_data);
}

static void
enotes_window_load_settings (ENotesWindow* self)
{
	ENotesServicesSettings* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	ENotesServicesSettings* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	ENotesWindowFourPaneWindow* _tmp6_;
	ENotesServicesSettings* _tmp7_;
	gint _tmp8_;
	gint _tmp9_;
	ENotesWindowFourPaneWindow* _tmp10_;
	ENotesServicesSettings* _tmp11_;
	gint _tmp12_;
	gint _tmp13_;
	ENotesApplication* _tmp14_;
	ENotesApplicationState* _tmp15_;
	ENotesServicesSettings* _tmp16_;
	gint _tmp17_;
	gint _tmp18_;
	ENotesApplication* _tmp19_;
	ENotesApplicationState* _tmp20_;
	ENotesServicesSettings* _tmp21_;
	const gchar* _tmp22_;
	const gchar* _tmp23_;
	ENotesApplication* _tmp24_;
	ENotesApplicationState* _tmp25_;
	ENotesServicesSettings* _tmp26_;
	const gchar* _tmp27_;
	const gchar* _tmp28_;
	ENotesApplication* _tmp29_;
	ENotesApplicationState* _tmp30_;
	ENotesServicesSettings* _tmp31_;
	gboolean _tmp32_;
	gboolean _tmp33_;
	ENotesApplication* _tmp34_;
	ENotesApplicationState* _tmp35_;
	ENotesServicesSettings* _tmp36_;
	const gchar* _tmp37_;
	const gchar* _tmp38_;
	ENotesApplication* _tmp39_;
	ENotesApplicationState* _tmp40_;
	ENotesServicesSettings* _tmp41_;
	gboolean _tmp42_;
	gboolean _tmp43_;
	ENotesApplication* _tmp44_;
	ENotesApplicationState* _tmp45_;
	ENotesServicesSettings* _tmp46_;
	gboolean _tmp47_;
	gboolean _tmp48_;
	ENotesApplication* _tmp49_;
	ENotesApplicationState* _tmp50_;
	ENotesServicesSettings* _tmp51_;
	gint _tmp52_;
	gint _tmp53_;
	g_return_if_fail (self != NULL);
	_tmp0_ = enotes_settings;
	_tmp1_ = enotes_services_settings_get_window_width (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = enotes_settings;
	_tmp4_ = enotes_services_settings_get_window_height (_tmp3_);
	_tmp5_ = _tmp4_;
	gtk_window_resize ((GtkWindow*) self, _tmp2_, _tmp5_);
	_tmp6_ = self->priv->panes;
	_tmp7_ = enotes_settings;
	_tmp8_ = enotes_services_settings_get_notebook_panel_size (_tmp7_);
	_tmp9_ = _tmp8_;
	enotes_window_four_pane_window_set_position_2_3 (_tmp6_, _tmp9_);
	_tmp10_ = self->priv->panes;
	_tmp11_ = enotes_settings;
	_tmp12_ = enotes_services_settings_get_panel_size (_tmp11_);
	_tmp13_ = _tmp12_;
	enotes_window_four_pane_window_set_position_3_4 (_tmp10_, _tmp13_);
	_tmp14_ = enotes_app;
	_tmp15_ = _tmp14_->state;
	_tmp16_ = enotes_settings;
	_tmp17_ = enotes_services_settings_get_mode (_tmp16_);
	_tmp18_ = _tmp17_;
	enotes_application_state_set_mode (_tmp15_, enotes_mode_get_mode (_tmp18_));
	enotes_window_open_database (self);
	_tmp19_ = enotes_app;
	_tmp20_ = _tmp19_->state;
	_tmp21_ = enotes_settings;
	_tmp22_ = enotes_services_settings_get_style_scheme (_tmp21_);
	_tmp23_ = _tmp22_;
	enotes_application_state_set_style (_tmp20_, _tmp23_);
	_tmp24_ = enotes_app;
	_tmp25_ = _tmp24_->state;
	_tmp26_ = enotes_settings;
	_tmp27_ = enotes_services_settings_get_editor_scheme (_tmp26_);
	_tmp28_ = _tmp27_;
	enotes_application_state_set_editor_scheme (_tmp25_, _tmp28_);
	_tmp29_ = enotes_app;
	_tmp30_ = _tmp29_->state;
	_tmp31_ = enotes_settings;
	_tmp32_ = enotes_services_settings_get_show_page_info (_tmp31_);
	_tmp33_ = _tmp32_;
	enotes_application_state_set_show_page_info (_tmp30_, _tmp33_);
	_tmp34_ = enotes_app;
	_tmp35_ = _tmp34_->state;
	_tmp36_ = enotes_settings;
	_tmp37_ = enotes_services_settings_get_editor_font (_tmp36_);
	_tmp38_ = _tmp37_;
	enotes_application_state_set_editor_font (_tmp35_, _tmp38_);
	_tmp39_ = enotes_app;
	_tmp40_ = _tmp39_->state;
	_tmp41_ = enotes_settings;
	_tmp42_ = enotes_services_settings_get_line_numbers (_tmp41_);
	_tmp43_ = _tmp42_;
	enotes_application_state_set_editor_show_line_numbers (_tmp40_, _tmp43_);
	_tmp44_ = enotes_app;
	_tmp45_ = _tmp44_->state;
	_tmp46_ = enotes_settings;
	_tmp47_ = enotes_services_settings_get_auto_indent (_tmp46_);
	_tmp48_ = _tmp47_;
	enotes_application_state_set_editor_auto_indent (_tmp45_, _tmp48_);
	_tmp49_ = enotes_app;
	_tmp50_ = _tmp49_->state;
	_tmp51_ = enotes_settings;
	_tmp52_ = enotes_services_settings_get_panes_visible (_tmp51_);
	_tmp53_ = _tmp52_;
	enotes_application_state_set_panes_visible (_tmp50_, _tmp53_);
}

static void
enotes_window_open_database (ENotesWindow* self)
{
	ENotesServicesSettings* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = enotes_settings;
	_tmp1_ = enotes_services_settings_get_last_page (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != 0) {
		ENotesApplication* _tmp3_;
		ENotesApplicationState* _tmp4_;
		ENotesServicesSettings* _tmp5_;
		gint _tmp6_;
		gint _tmp7_;
		ENotesApplication* _tmp8_;
		ENotesApplicationState* _tmp9_;
		ENotesServicesSettings* _tmp10_;
		gint _tmp11_;
		gint _tmp12_;
		ENotesServicesSettings* _tmp13_;
		ENotesServicesSettings* _tmp14_;
		_tmp3_ = enotes_app;
		_tmp4_ = _tmp3_->state;
		_tmp5_ = enotes_settings;
		_tmp6_ = enotes_services_settings_get_last_notebook (_tmp5_);
		_tmp7_ = _tmp6_;
		enotes_application_state_open_notebook (_tmp4_, (gint64) _tmp7_);
		_tmp8_ = enotes_app;
		_tmp9_ = _tmp8_->state;
		_tmp10_ = enotes_settings;
		_tmp11_ = enotes_services_settings_get_last_page (_tmp10_);
		_tmp12_ = _tmp11_;
		enotes_application_state_open_page (_tmp9_, (gint64) _tmp12_);
		_tmp13_ = enotes_settings;
		enotes_services_settings_set_last_notebook (_tmp13_, 0);
		_tmp14_ = enotes_settings;
		enotes_services_settings_set_last_page (_tmp14_, 0);
	} else {
		ENotesFileDataTable* file_data = NULL;
		ENotesFileDataTable* _tmp15_;
		ENotesFileDataTable* _tmp16_;
		ENotesFileDataTable* _tmp17_;
		ENotesApplication* _tmp18_;
		ENotesApplicationState* _tmp19_;
		ENotesFileDataTable* _tmp20_;
		ENotesApplication* _tmp21_;
		ENotesApplicationState* _tmp22_;
		ENotesFileDataTable* _tmp23_;
		_tmp15_ = enotes_file_data_table_get_instance ();
		_tmp16_ = _tmp15_;
		_tmp17_ = _database_table_ref0 (_tmp16_);
		file_data = _tmp17_;
		_tmp18_ = enotes_app;
		_tmp19_ = _tmp18_->state;
		_tmp20_ = file_data;
		enotes_application_state_open_notebook (_tmp19_, enotes_file_data_table_get_int64 (_tmp20_, FILE_DATA_TYPE_LAST_NOTEBOOK));
		_tmp21_ = enotes_app;
		_tmp22_ = _tmp21_->state;
		_tmp23_ = file_data;
		enotes_application_state_open_page (_tmp22_, enotes_file_data_table_get_int64 (_tmp23_, FILE_DATA_TYPE_LAST_PAGE));
		_database_table_unref0 (file_data);
	}
}

static void
enotes_window_new_page (ENotesWindow* self)
{
	ENotesPagesList* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->pages_list;
	enotes_pages_list_new_blank_page (_tmp0_);
}

static void
enotes_window_request_close (ENotesWindow* self)
{
	g_return_if_fail (self != NULL);
	gtk_window_close ((GtkWindow*) self);
}

static void
enotes_window_save (ENotesWindow* self)
{
	ENotesEditor* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->editor;
	enotes_editor_save_file (_tmp0_);
}

void
enotes_window_set_mode (ENotesWindow* self,
                        ENotesMode mode)
{
	ENotesApplication* _tmp0_;
	ENotesApplicationState* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = enotes_app;
	_tmp1_ = _tmp0_->state;
	enotes_application_state_set_mode (_tmp1_, mode);
}

void
enotes_window_show_app (ENotesWindow* self)
{
	g_return_if_fail (self != NULL);
	gtk_widget_show ((GtkWidget*) self);
	gtk_window_present ((GtkWindow*) self);
}

void
enotes_window_toggle_page_info (ENotesWindow* self)
{
	ENotesApplication* _tmp0_;
	ENotesApplicationState* _tmp1_;
	ENotesApplication* _tmp2_;
	ENotesApplicationState* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = enotes_app;
	_tmp1_ = _tmp0_->state;
	_tmp2_ = enotes_app;
	_tmp3_ = _tmp2_->state;
	_tmp4_ = enotes_application_state_get_show_page_info (_tmp3_);
	_tmp5_ = _tmp4_;
	enotes_application_state_set_show_page_info (_tmp1_, !_tmp5_);
}

void
enotes_window_cycle_panel_mode (ENotesWindow* self)
{
	gint panes_visible = 0;
	ENotesApplication* _tmp0_;
	ENotesApplicationState* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint _tmp4_ = 0;
	ENotesApplication* _tmp6_;
	ENotesApplicationState* _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = enotes_app;
	_tmp1_ = _tmp0_->state;
	_tmp2_ = enotes_application_state_get_panes_visible (_tmp1_);
	_tmp3_ = _tmp2_;
	panes_visible = _tmp3_ - 1;
	if (panes_visible >= 0) {
		_tmp4_ = panes_visible;
	} else {
		gint _tmp5_ = 0;
		if (ENOTES_FEATURE_FLAGS_SHOW_NOTEBOOK_PANE) {
			_tmp5_ = 3;
		} else {
			_tmp5_ = 2;
		}
		_tmp4_ = _tmp5_;
	}
	_tmp6_ = enotes_app;
	_tmp7_ = _tmp6_->state;
	enotes_application_state_set_panes_visible (_tmp7_, _tmp4_);
}

void
enotes_window_cycle_panel_mode_reverse (ENotesWindow* self)
{
	gint _tmp0_ = 0;
	ENotesApplication* _tmp1_;
	ENotesApplicationState* _tmp2_;
	ENotesApplication* _tmp3_;
	ENotesApplicationState* _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	g_return_if_fail (self != NULL);
	if (ENOTES_FEATURE_FLAGS_SHOW_NOTEBOOK_PANE) {
		_tmp0_ = 4;
	} else {
		_tmp0_ = 3;
	}
	_tmp1_ = enotes_app;
	_tmp2_ = _tmp1_->state;
	_tmp3_ = enotes_app;
	_tmp4_ = _tmp3_->state;
	_tmp5_ = enotes_application_state_get_panes_visible (_tmp4_);
	_tmp6_ = _tmp5_;
	enotes_application_state_set_panes_visible (_tmp2_, (_tmp6_ + 1) % _tmp0_);
}

static inline gpointer
enotes_window_four_pane_window_get_instance_private (ENotesWindowFourPaneWindow* self)
{
	return G_STRUCT_MEMBER_P (self, ENotesWindowFourPaneWindow_private_offset);
}

static void
enotes_window_four_pane_window_show_n_panes (ENotesWindowFourPaneWindow* self,
                                             gint amount)
{
	g_return_if_fail (self != NULL);
	enotes_window_four_pane_window_set_show_1 (self, amount >= 3);
	enotes_window_four_pane_window_set_show_2 (self, amount >= 2);
	enotes_window_four_pane_window_set_show_3 (self, amount >= 1);
}

static void
enotes_window_four_pane_window_pack1 (ENotesWindowFourPaneWindow* self,
                                      GtkWidget* widget)
{
	GtkPaned* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (widget != NULL);
	self->priv->widget_1 = widget;
	_tmp0_ = self->priv->paned_1_2;
	gtk_paned_pack1 (_tmp0_, widget, FALSE, FALSE);
}

static void
enotes_window_four_pane_window_pack2 (ENotesWindowFourPaneWindow* self,
                                      GtkWidget* widget)
{
	GtkPaned* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (widget != NULL);
	self->priv->widget_2 = widget;
	_tmp0_ = self->priv->paned_2_3;
	gtk_paned_pack1 (_tmp0_, widget, FALSE, FALSE);
}

static void
enotes_window_four_pane_window_pack3 (ENotesWindowFourPaneWindow* self,
                                      GtkWidget* widget)
{
	GtkPaned* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (widget != NULL);
	self->priv->widget_3 = widget;
	_tmp0_ = self->priv->paned_3_4;
	gtk_paned_pack1 (_tmp0_, widget, FALSE, FALSE);
}

static void
enotes_window_four_pane_window_pack4 (ENotesWindowFourPaneWindow* self,
                                      GtkWidget* widget)
{
	GtkPaned* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (widget != NULL);
	self->priv->widget_4 = widget;
	_tmp0_ = self->priv->paned_3_4;
	gtk_paned_pack2 (_tmp0_, widget, TRUE, FALSE);
}

static ENotesWindowFourPaneWindow*
enotes_window_four_pane_window_construct (GType object_type)
{
	ENotesWindowFourPaneWindow * self = NULL;
	self = (ENotesWindowFourPaneWindow*) g_object_new (object_type, NULL);
	return self;
}

static ENotesWindowFourPaneWindow*
enotes_window_four_pane_window_new (void)
{
	return enotes_window_four_pane_window_construct (ENOTES_WINDOW_TYPE_FOUR_PANE_WINDOW);
}

static gint
enotes_window_four_pane_window_get_position_1_2 (ENotesWindowFourPaneWindow* self)
{
	gint result;
	GtkPaned* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	g_return_val_if_fail (self != NULL, -1);
	_tmp0_ = self->priv->paned_1_2;
	_tmp1_ = gtk_paned_get_position (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

static void
enotes_window_four_pane_window_set_position_1_2 (ENotesWindowFourPaneWindow* self,
                                                 gint value)
{
	GtkPaned* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->paned_1_2;
	gtk_paned_set_position (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, enotes_window_four_pane_window_properties[ENOTES_WINDOW_FOUR_PANE_WINDOW_POSITION_1_2_PROPERTY]);
}

static gint
enotes_window_four_pane_window_get_position_2_3 (ENotesWindowFourPaneWindow* self)
{
	gint result;
	GtkPaned* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	g_return_val_if_fail (self != NULL, -1);
	_tmp0_ = self->priv->paned_2_3;
	_tmp1_ = gtk_paned_get_position (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

static void
enotes_window_four_pane_window_set_position_2_3 (ENotesWindowFourPaneWindow* self,
                                                 gint value)
{
	GtkPaned* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->paned_2_3;
	gtk_paned_set_position (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, enotes_window_four_pane_window_properties[ENOTES_WINDOW_FOUR_PANE_WINDOW_POSITION_2_3_PROPERTY]);
}

static gint
enotes_window_four_pane_window_get_position_3_4 (ENotesWindowFourPaneWindow* self)
{
	gint result;
	GtkPaned* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	g_return_val_if_fail (self != NULL, -1);
	_tmp0_ = self->priv->paned_3_4;
	_tmp1_ = gtk_paned_get_position (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

static void
enotes_window_four_pane_window_set_position_3_4 (ENotesWindowFourPaneWindow* self,
                                                 gint value)
{
	GtkPaned* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->paned_3_4;
	gtk_paned_set_position (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, enotes_window_four_pane_window_properties[ENOTES_WINDOW_FOUR_PANE_WINDOW_POSITION_3_4_PROPERTY]);
}

static gboolean
enotes_window_four_pane_window_get_show_1 (ENotesWindowFourPaneWindow* self)
{
	gboolean result;
	GtkWidget* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->widget_1;
	_tmp1_ = gtk_widget_get_visible (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

static void
enotes_window_four_pane_window_set_show_1 (ENotesWindowFourPaneWindow* self,
                                           gboolean value)
{
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->widget_1;
	gtk_widget_set_visible (_tmp0_, value);
	_tmp1_ = self->priv->widget_1;
	gtk_widget_set_no_show_all (_tmp1_, !value);
	g_object_notify_by_pspec ((GObject *) self, enotes_window_four_pane_window_properties[ENOTES_WINDOW_FOUR_PANE_WINDOW_SHOW_1_PROPERTY]);
}

static gboolean
enotes_window_four_pane_window_get_show_2 (ENotesWindowFourPaneWindow* self)
{
	gboolean result;
	GtkWidget* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->widget_2;
	_tmp1_ = gtk_widget_get_visible (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

static void
enotes_window_four_pane_window_set_show_2 (ENotesWindowFourPaneWindow* self,
                                           gboolean value)
{
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->widget_2;
	gtk_widget_set_visible (_tmp0_, value);
	_tmp1_ = self->priv->widget_2;
	gtk_widget_set_no_show_all (_tmp1_, !value);
	g_object_notify_by_pspec ((GObject *) self, enotes_window_four_pane_window_properties[ENOTES_WINDOW_FOUR_PANE_WINDOW_SHOW_2_PROPERTY]);
}

static gboolean
enotes_window_four_pane_window_get_show_3 (ENotesWindowFourPaneWindow* self)
{
	gboolean result;
	GtkWidget* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->widget_3;
	_tmp1_ = gtk_widget_get_visible (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

static void
enotes_window_four_pane_window_set_show_3 (ENotesWindowFourPaneWindow* self,
                                           gboolean value)
{
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->widget_3;
	gtk_widget_set_visible (_tmp0_, value);
	_tmp1_ = self->priv->widget_3;
	gtk_widget_set_no_show_all (_tmp1_, !value);
	g_object_notify_by_pspec ((GObject *) self, enotes_window_four_pane_window_properties[ENOTES_WINDOW_FOUR_PANE_WINDOW_SHOW_3_PROPERTY]);
}

static gboolean
enotes_window_four_pane_window_get_show_4 (ENotesWindowFourPaneWindow* self)
{
	gboolean result;
	GtkWidget* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->widget_4;
	_tmp1_ = gtk_widget_get_visible (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

static void
enotes_window_four_pane_window_set_show_4 (ENotesWindowFourPaneWindow* self,
                                           gboolean value)
{
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->widget_4;
	gtk_widget_set_visible (_tmp0_, value);
	_tmp1_ = self->priv->widget_4;
	gtk_widget_set_no_show_all (_tmp1_, !value);
	g_object_notify_by_pspec ((GObject *) self, enotes_window_four_pane_window_properties[ENOTES_WINDOW_FOUR_PANE_WINDOW_SHOW_4_PROPERTY]);
}

static GObject *
enotes_window_four_pane_window_constructor (GType type,
                                            guint n_construct_properties,
                                            GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ENotesWindowFourPaneWindow * self;
	GtkPaned* _tmp0_;
	GtkPaned* _tmp1_;
	GtkPaned* _tmp2_;
	GtkPaned* _tmp3_;
	GtkPaned* _tmp4_;
	GtkPaned* _tmp5_;
	GtkPaned* _tmp6_;
	GtkPaned* _tmp7_;
	parent_class = G_OBJECT_CLASS (enotes_window_four_pane_window_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ENOTES_WINDOW_TYPE_FOUR_PANE_WINDOW, ENotesWindowFourPaneWindow);
	_tmp0_ = (GtkPaned*) gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->paned_1_2);
	self->priv->paned_1_2 = _tmp0_;
	_tmp1_ = (GtkPaned*) gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->paned_2_3);
	self->priv->paned_2_3 = _tmp1_;
	_tmp2_ = (GtkPaned*) gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->paned_3_4);
	self->priv->paned_3_4 = _tmp2_;
	_tmp3_ = self->priv->paned_1_2;
	_tmp4_ = self->priv->paned_2_3;
	gtk_paned_pack2 (_tmp3_, (GtkWidget*) _tmp4_, TRUE, FALSE);
	_tmp5_ = self->priv->paned_2_3;
	_tmp6_ = self->priv->paned_3_4;
	gtk_paned_pack2 (_tmp5_, (GtkWidget*) _tmp6_, TRUE, FALSE);
	_tmp7_ = self->priv->paned_1_2;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp7_);
	return obj;
}

static void
enotes_window_four_pane_window_class_init (ENotesWindowFourPaneWindowClass * klass,
                                           gpointer klass_data)
{
	enotes_window_four_pane_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ENotesWindowFourPaneWindow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_enotes_window_four_pane_window_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_enotes_window_four_pane_window_set_property;
	G_OBJECT_CLASS (klass)->constructor = enotes_window_four_pane_window_constructor;
	G_OBJECT_CLASS (klass)->finalize = enotes_window_four_pane_window_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), ENOTES_WINDOW_FOUR_PANE_WINDOW_POSITION_1_2_PROPERTY, enotes_window_four_pane_window_properties[ENOTES_WINDOW_FOUR_PANE_WINDOW_POSITION_1_2_PROPERTY] = g_param_spec_int ("position-1-2", "position-1-2", "position-1-2", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), ENOTES_WINDOW_FOUR_PANE_WINDOW_POSITION_2_3_PROPERTY, enotes_window_four_pane_window_properties[ENOTES_WINDOW_FOUR_PANE_WINDOW_POSITION_2_3_PROPERTY] = g_param_spec_int ("position-2-3", "position-2-3", "position-2-3", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), ENOTES_WINDOW_FOUR_PANE_WINDOW_POSITION_3_4_PROPERTY, enotes_window_four_pane_window_properties[ENOTES_WINDOW_FOUR_PANE_WINDOW_POSITION_3_4_PROPERTY] = g_param_spec_int ("position-3-4", "position-3-4", "position-3-4", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), ENOTES_WINDOW_FOUR_PANE_WINDOW_SHOW_1_PROPERTY, enotes_window_four_pane_window_properties[ENOTES_WINDOW_FOUR_PANE_WINDOW_SHOW_1_PROPERTY] = g_param_spec_boolean ("show-1", "show-1", "show-1", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), ENOTES_WINDOW_FOUR_PANE_WINDOW_SHOW_2_PROPERTY, enotes_window_four_pane_window_properties[ENOTES_WINDOW_FOUR_PANE_WINDOW_SHOW_2_PROPERTY] = g_param_spec_boolean ("show-2", "show-2", "show-2", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), ENOTES_WINDOW_FOUR_PANE_WINDOW_SHOW_3_PROPERTY, enotes_window_four_pane_window_properties[ENOTES_WINDOW_FOUR_PANE_WINDOW_SHOW_3_PROPERTY] = g_param_spec_boolean ("show-3", "show-3", "show-3", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), ENOTES_WINDOW_FOUR_PANE_WINDOW_SHOW_4_PROPERTY, enotes_window_four_pane_window_properties[ENOTES_WINDOW_FOUR_PANE_WINDOW_SHOW_4_PROPERTY] = g_param_spec_boolean ("show-4", "show-4", "show-4", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
enotes_window_four_pane_window_instance_init (ENotesWindowFourPaneWindow * self,
                                              gpointer klass)
{
	self->priv = enotes_window_four_pane_window_get_instance_private (self);
}

static void
enotes_window_four_pane_window_finalize (GObject * obj)
{
	ENotesWindowFourPaneWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ENOTES_WINDOW_TYPE_FOUR_PANE_WINDOW, ENotesWindowFourPaneWindow);
	_g_object_unref0 (self->priv->paned_1_2);
	_g_object_unref0 (self->priv->paned_2_3);
	_g_object_unref0 (self->priv->paned_3_4);
	G_OBJECT_CLASS (enotes_window_four_pane_window_parent_class)->finalize (obj);
}

static GType
enotes_window_four_pane_window_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ENotesWindowFourPaneWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) enotes_window_four_pane_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ENotesWindowFourPaneWindow), 0, (GInstanceInitFunc) enotes_window_four_pane_window_instance_init, NULL };
	GType enotes_window_four_pane_window_type_id;
	enotes_window_four_pane_window_type_id = g_type_register_static (gtk_bin_get_type (), "ENotesWindowFourPaneWindow", &g_define_type_info, 0);
	ENotesWindowFourPaneWindow_private_offset = g_type_add_instance_private (enotes_window_four_pane_window_type_id, sizeof (ENotesWindowFourPaneWindowPrivate));
	return enotes_window_four_pane_window_type_id;
}

static GType
enotes_window_four_pane_window_get_type (void)
{
	static volatile gsize enotes_window_four_pane_window_type_id__once = 0;
	if (g_once_init_enter (&enotes_window_four_pane_window_type_id__once)) {
		GType enotes_window_four_pane_window_type_id;
		enotes_window_four_pane_window_type_id = enotes_window_four_pane_window_get_type_once ();
		g_once_init_leave (&enotes_window_four_pane_window_type_id__once, enotes_window_four_pane_window_type_id);
	}
	return enotes_window_four_pane_window_type_id__once;
}

static void
_vala_enotes_window_four_pane_window_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec)
{
	ENotesWindowFourPaneWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, ENOTES_WINDOW_TYPE_FOUR_PANE_WINDOW, ENotesWindowFourPaneWindow);
	switch (property_id) {
		case ENOTES_WINDOW_FOUR_PANE_WINDOW_POSITION_1_2_PROPERTY:
		g_value_set_int (value, enotes_window_four_pane_window_get_position_1_2 (self));
		break;
		case ENOTES_WINDOW_FOUR_PANE_WINDOW_POSITION_2_3_PROPERTY:
		g_value_set_int (value, enotes_window_four_pane_window_get_position_2_3 (self));
		break;
		case ENOTES_WINDOW_FOUR_PANE_WINDOW_POSITION_3_4_PROPERTY:
		g_value_set_int (value, enotes_window_four_pane_window_get_position_3_4 (self));
		break;
		case ENOTES_WINDOW_FOUR_PANE_WINDOW_SHOW_1_PROPERTY:
		g_value_set_boolean (value, enotes_window_four_pane_window_get_show_1 (self));
		break;
		case ENOTES_WINDOW_FOUR_PANE_WINDOW_SHOW_2_PROPERTY:
		g_value_set_boolean (value, enotes_window_four_pane_window_get_show_2 (self));
		break;
		case ENOTES_WINDOW_FOUR_PANE_WINDOW_SHOW_3_PROPERTY:
		g_value_set_boolean (value, enotes_window_four_pane_window_get_show_3 (self));
		break;
		case ENOTES_WINDOW_FOUR_PANE_WINDOW_SHOW_4_PROPERTY:
		g_value_set_boolean (value, enotes_window_four_pane_window_get_show_4 (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_enotes_window_four_pane_window_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec)
{
	ENotesWindowFourPaneWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, ENOTES_WINDOW_TYPE_FOUR_PANE_WINDOW, ENotesWindowFourPaneWindow);
	switch (property_id) {
		case ENOTES_WINDOW_FOUR_PANE_WINDOW_POSITION_1_2_PROPERTY:
		enotes_window_four_pane_window_set_position_1_2 (self, g_value_get_int (value));
		break;
		case ENOTES_WINDOW_FOUR_PANE_WINDOW_POSITION_2_3_PROPERTY:
		enotes_window_four_pane_window_set_position_2_3 (self, g_value_get_int (value));
		break;
		case ENOTES_WINDOW_FOUR_PANE_WINDOW_POSITION_3_4_PROPERTY:
		enotes_window_four_pane_window_set_position_3_4 (self, g_value_get_int (value));
		break;
		case ENOTES_WINDOW_FOUR_PANE_WINDOW_SHOW_1_PROPERTY:
		enotes_window_four_pane_window_set_show_1 (self, g_value_get_boolean (value));
		break;
		case ENOTES_WINDOW_FOUR_PANE_WINDOW_SHOW_2_PROPERTY:
		enotes_window_four_pane_window_set_show_2 (self, g_value_get_boolean (value));
		break;
		case ENOTES_WINDOW_FOUR_PANE_WINDOW_SHOW_3_PROPERTY:
		enotes_window_four_pane_window_set_show_3 (self, g_value_get_boolean (value));
		break;
		case ENOTES_WINDOW_FOUR_PANE_WINDOW_SHOW_4_PROPERTY:
		enotes_window_four_pane_window_set_show_4 (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
enotes_window_class_init (ENotesWindowClass * klass,
                          gpointer klass_data)
{
	enotes_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ENotesWindow_private_offset);
	((GtkWidgetClass *) klass)->delete_event = (gboolean (*) (GtkWidget*, GdkEventAny*)) enotes_window_real_delete_event;
	G_OBJECT_CLASS (klass)->finalize = enotes_window_finalize;
}

static void
enotes_window_instance_init (ENotesWindow * self,
                             gpointer klass)
{
	self->priv = enotes_window_get_instance_private (self);
}

static void
enotes_window_finalize (GObject * obj)
{
	ENotesWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ENOTES_TYPE_WINDOW, ENotesWindow);
	_g_object_unref0 (self->priv->editor);
	_g_object_unref0 (self->priv->headerbar);
	_g_object_unref0 (self->priv->pages_list);
	_g_object_unref0 (self->priv->sidebar);
	_g_object_unref0 (self->priv->page_info);
	_g_object_unref0 (self->priv->view_edit_stack);
	_g_object_unref0 (self->priv->viewer);
	_g_object_unref0 (self->priv->panes);
	G_OBJECT_CLASS (enotes_window_parent_class)->finalize (obj);
}

static GType
enotes_window_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ENotesWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) enotes_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ENotesWindow), 0, (GInstanceInitFunc) enotes_window_instance_init, NULL };
	GType enotes_window_type_id;
	enotes_window_type_id = g_type_register_static (gtk_application_window_get_type (), "ENotesWindow", &g_define_type_info, 0);
	ENotesWindow_private_offset = g_type_add_instance_private (enotes_window_type_id, sizeof (ENotesWindowPrivate));
	return enotes_window_type_id;
}

GType
enotes_window_get_type (void)
{
	static volatile gsize enotes_window_type_id__once = 0;
	if (g_once_init_enter (&enotes_window_type_id__once)) {
		GType enotes_window_type_id;
		enotes_window_type_id = enotes_window_get_type_once ();
		g_once_init_leave (&enotes_window_type_id__once, enotes_window_type_id);
	}
	return enotes_window_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 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;
}

