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

/* MainPane.vala
 *
 * Copyright (C) 2009-2025 Jerry Casiano
 *
 * 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 3 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, see <http://www.gnu.org/licenses/gpl-3.0.txt>.
*/

#include <gtk/gtk.h>
#include <glib-object.h>
#include <json-glib/json-glib.h>
#include "font-manager.h"
#include "vala-common.h"
#include <glib.h>
#include <gdk/gdk.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define FONT_MANAGER_TYPE_DUAL_PANED (font_manager_dual_paned_get_type ())
#define FONT_MANAGER_DUAL_PANED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_DUAL_PANED, FontManagerDualPaned))
#define FONT_MANAGER_DUAL_PANED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_DUAL_PANED, FontManagerDualPanedClass))
#define FONT_MANAGER_IS_DUAL_PANED(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_DUAL_PANED))
#define FONT_MANAGER_IS_DUAL_PANED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_DUAL_PANED))
#define FONT_MANAGER_DUAL_PANED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_DUAL_PANED, FontManagerDualPanedClass))

typedef struct _FontManagerDualPaned FontManagerDualPaned;
typedef struct _FontManagerDualPanedClass FontManagerDualPanedClass;
typedef struct _FontManagerDualPanedPrivate FontManagerDualPanedPrivate;

#define FONT_MANAGER_TYPE_MAIN_PANE (font_manager_main_pane_get_type ())
#define FONT_MANAGER_MAIN_PANE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_MAIN_PANE, FontManagerMainPane))
#define FONT_MANAGER_MAIN_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_MAIN_PANE, FontManagerMainPaneClass))
#define FONT_MANAGER_IS_MAIN_PANE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_MAIN_PANE))
#define FONT_MANAGER_IS_MAIN_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_MAIN_PANE))
#define FONT_MANAGER_MAIN_PANE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_MAIN_PANE, FontManagerMainPaneClass))

typedef struct _FontManagerMainPane FontManagerMainPane;
typedef struct _FontManagerMainPaneClass FontManagerMainPaneClass;
typedef struct _FontManagerMainPanePrivate FontManagerMainPanePrivate;
typedef enum  {
	FONT_MANAGER_MODE_MANAGE,
	FONT_MANAGER_MODE_BROWSE,
	FONT_MANAGER_MODE_COMPARE,
	FONT_MANAGER_MODE_GOOGLE_FONTS,
	FONT_MANAGER_MODE_N_MODES
} FontManagerMode;

#define FONT_MANAGER_TYPE_MODE (font_manager_mode_get_type ())

#define FONT_MANAGER_TYPE_USER_ACTION_MODEL (font_manager_user_action_model_get_type ())
#define FONT_MANAGER_USER_ACTION_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_USER_ACTION_MODEL, FontManagerUserActionModel))
#define FONT_MANAGER_USER_ACTION_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_USER_ACTION_MODEL, FontManagerUserActionModelClass))
#define FONT_MANAGER_IS_USER_ACTION_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_USER_ACTION_MODEL))
#define FONT_MANAGER_IS_USER_ACTION_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_USER_ACTION_MODEL))
#define FONT_MANAGER_USER_ACTION_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_USER_ACTION_MODEL, FontManagerUserActionModelClass))

typedef struct _FontManagerUserActionModel FontManagerUserActionModel;
typedef struct _FontManagerUserActionModelClass FontManagerUserActionModelClass;

#define FONT_MANAGER_TYPE_USER_SOURCE_MODEL (font_manager_user_source_model_get_type ())
#define FONT_MANAGER_USER_SOURCE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_USER_SOURCE_MODEL, FontManagerUserSourceModel))
#define FONT_MANAGER_USER_SOURCE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_USER_SOURCE_MODEL, FontManagerUserSourceModelClass))
#define FONT_MANAGER_IS_USER_SOURCE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_USER_SOURCE_MODEL))
#define FONT_MANAGER_IS_USER_SOURCE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_USER_SOURCE_MODEL))
#define FONT_MANAGER_USER_SOURCE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_USER_SOURCE_MODEL, FontManagerUserSourceModelClass))

typedef struct _FontManagerUserSourceModel FontManagerUserSourceModel;
typedef struct _FontManagerUserSourceModelClass FontManagerUserSourceModelClass;

#define FONT_MANAGER_TYPE_SIDEBAR_STACK (font_manager_sidebar_stack_get_type ())
#define FONT_MANAGER_SIDEBAR_STACK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_SIDEBAR_STACK, FontManagerSidebarStack))
#define FONT_MANAGER_SIDEBAR_STACK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_SIDEBAR_STACK, FontManagerSidebarStackClass))
#define FONT_MANAGER_IS_SIDEBAR_STACK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_SIDEBAR_STACK))
#define FONT_MANAGER_IS_SIDEBAR_STACK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_SIDEBAR_STACK))
#define FONT_MANAGER_SIDEBAR_STACK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_SIDEBAR_STACK, FontManagerSidebarStackClass))

typedef struct _FontManagerSidebarStack FontManagerSidebarStack;
typedef struct _FontManagerSidebarStackClass FontManagerSidebarStackClass;

#define FONT_MANAGER_TYPE_FONT_LIST_BASE (font_manager_font_list_base_get_type ())
#define FONT_MANAGER_FONT_LIST_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_FONT_LIST_BASE, FontManagerFontListBase))
#define FONT_MANAGER_FONT_LIST_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_FONT_LIST_BASE, FontManagerFontListBaseClass))
#define FONT_MANAGER_IS_FONT_LIST_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_FONT_LIST_BASE))
#define FONT_MANAGER_IS_FONT_LIST_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_FONT_LIST_BASE))
#define FONT_MANAGER_FONT_LIST_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_FONT_LIST_BASE, FontManagerFontListBaseClass))

typedef struct _FontManagerFontListBase FontManagerFontListBase;
typedef struct _FontManagerFontListBaseClass FontManagerFontListBaseClass;

#define FONT_MANAGER_TYPE_BASE_FONT_LIST_VIEW (font_manager_base_font_list_view_get_type ())
#define FONT_MANAGER_BASE_FONT_LIST_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_BASE_FONT_LIST_VIEW, FontManagerBaseFontListView))
#define FONT_MANAGER_BASE_FONT_LIST_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_BASE_FONT_LIST_VIEW, FontManagerBaseFontListViewClass))
#define FONT_MANAGER_IS_BASE_FONT_LIST_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_BASE_FONT_LIST_VIEW))
#define FONT_MANAGER_IS_BASE_FONT_LIST_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_BASE_FONT_LIST_VIEW))
#define FONT_MANAGER_BASE_FONT_LIST_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_BASE_FONT_LIST_VIEW, FontManagerBaseFontListViewClass))

typedef struct _FontManagerBaseFontListView FontManagerBaseFontListView;
typedef struct _FontManagerBaseFontListViewClass FontManagerBaseFontListViewClass;

#define FONT_MANAGER_TYPE_FONT_LIST_VIEW (font_manager_font_list_view_get_type ())
#define FONT_MANAGER_FONT_LIST_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_FONT_LIST_VIEW, FontManagerFontListView))
#define FONT_MANAGER_FONT_LIST_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_FONT_LIST_VIEW, FontManagerFontListViewClass))
#define FONT_MANAGER_IS_FONT_LIST_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_FONT_LIST_VIEW))
#define FONT_MANAGER_IS_FONT_LIST_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_FONT_LIST_VIEW))
#define FONT_MANAGER_FONT_LIST_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_FONT_LIST_VIEW, FontManagerFontListViewClass))

typedef struct _FontManagerFontListView FontManagerFontListView;
typedef struct _FontManagerFontListViewClass FontManagerFontListViewClass;

#define FONT_MANAGER_TYPE_COMPARE_PANE (font_manager_compare_pane_get_type ())
#define FONT_MANAGER_COMPARE_PANE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_COMPARE_PANE, FontManagerComparePane))
#define FONT_MANAGER_COMPARE_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_COMPARE_PANE, FontManagerComparePaneClass))
#define FONT_MANAGER_IS_COMPARE_PANE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_COMPARE_PANE))
#define FONT_MANAGER_IS_COMPARE_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_COMPARE_PANE))
#define FONT_MANAGER_COMPARE_PANE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_COMPARE_PANE, FontManagerComparePaneClass))

typedef struct _FontManagerComparePane FontManagerComparePane;
typedef struct _FontManagerComparePaneClass FontManagerComparePaneClass;
enum  {
	FONT_MANAGER_MAIN_PANE_0_PROPERTY,
	FONT_MANAGER_MAIN_PANE_AVAILABLE_FONTS_PROPERTY,
	FONT_MANAGER_MAIN_PANE_DISABLED_FAMILIES_PROPERTY,
	FONT_MANAGER_MAIN_PANE_MODE_PROPERTY,
	FONT_MANAGER_MAIN_PANE_USER_ACTIONS_PROPERTY,
	FONT_MANAGER_MAIN_PANE_USER_SOURCES_PROPERTY,
	FONT_MANAGER_MAIN_PANE_WATERFALL_SETTINGS_PROPERTY,
	FONT_MANAGER_MAIN_PANE_PREDEFINED_SIZE_PROPERTY,
	FONT_MANAGER_MAIN_PANE_SHOW_LINE_SIZE_PROPERTY,
	FONT_MANAGER_MAIN_PANE_CATEGORY_MODEL_PROPERTY,
	FONT_MANAGER_MAIN_PANE_COLLECTION_MODEL_PROPERTY,
	FONT_MANAGER_MAIN_PANE_NUM_PROPERTIES
};
static GParamSpec* font_manager_main_pane_properties[FONT_MANAGER_MAIN_PANE_NUM_PROPERTIES];
#define _json_array_unref0(var) ((var == NULL) ? NULL : (var = (json_array_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block11Data Block11Data;
#define _g_free0(var) (var = (g_free (var), NULL))

#define FONT_MANAGER_TYPE_FONT_LIST_FILTER_MODEL (font_manager_font_list_filter_model_get_type ())
#define FONT_MANAGER_FONT_LIST_FILTER_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_FONT_LIST_FILTER_MODEL, FontManagerFontListFilterModel))
#define FONT_MANAGER_FONT_LIST_FILTER_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_FONT_LIST_FILTER_MODEL, FontManagerFontListFilterModelClass))
#define FONT_MANAGER_IS_FONT_LIST_FILTER_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_FONT_LIST_FILTER_MODEL))
#define FONT_MANAGER_IS_FONT_LIST_FILTER_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_FONT_LIST_FILTER_MODEL))
#define FONT_MANAGER_FONT_LIST_FILTER_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_FONT_LIST_FILTER_MODEL, FontManagerFontListFilterModelClass))

typedef struct _FontManagerFontListFilterModel FontManagerFontListFilterModel;
typedef struct _FontManagerFontListFilterModelClass FontManagerFontListFilterModelClass;

#define FONT_MANAGER_TYPE_CATEGORY_LIST_MODEL (font_manager_category_list_model_get_type ())
#define FONT_MANAGER_CATEGORY_LIST_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_CATEGORY_LIST_MODEL, FontManagerCategoryListModel))
#define FONT_MANAGER_CATEGORY_LIST_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_CATEGORY_LIST_MODEL, FontManagerCategoryListModelClass))
#define FONT_MANAGER_IS_CATEGORY_LIST_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_CATEGORY_LIST_MODEL))
#define FONT_MANAGER_IS_CATEGORY_LIST_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_CATEGORY_LIST_MODEL))
#define FONT_MANAGER_CATEGORY_LIST_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_CATEGORY_LIST_MODEL, FontManagerCategoryListModelClass))

typedef struct _FontManagerCategoryListModel FontManagerCategoryListModel;
typedef struct _FontManagerCategoryListModelClass FontManagerCategoryListModelClass;

#define FONT_MANAGER_TYPE_COLLECTION_LIST_MODEL (font_manager_collection_list_model_get_type ())
#define FONT_MANAGER_COLLECTION_LIST_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FONT_MANAGER_TYPE_COLLECTION_LIST_MODEL, FontManagerCollectionListModel))
#define FONT_MANAGER_COLLECTION_LIST_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FONT_MANAGER_TYPE_COLLECTION_LIST_MODEL, FontManagerCollectionListModelClass))
#define FONT_MANAGER_IS_COLLECTION_LIST_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FONT_MANAGER_TYPE_COLLECTION_LIST_MODEL))
#define FONT_MANAGER_IS_COLLECTION_LIST_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FONT_MANAGER_TYPE_COLLECTION_LIST_MODEL))
#define FONT_MANAGER_COLLECTION_LIST_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FONT_MANAGER_TYPE_COLLECTION_LIST_MODEL, FontManagerCollectionListModelClass))

typedef struct _FontManagerCollectionListModel FontManagerCollectionListModel;
typedef struct _FontManagerCollectionListModelClass FontManagerCollectionListModelClass;

struct _FontManagerDualPaned {
	GtkWidget parent_instance;
	FontManagerDualPanedPrivate * priv;
	GtkOverlay* overlay;
};

struct _FontManagerDualPanedClass {
	GtkWidgetClass parent_class;
	void (*on_map) (FontManagerDualPaned* self);
};

struct _FontManagerMainPane {
	FontManagerDualPaned parent_instance;
	FontManagerMainPanePrivate * priv;
};

struct _FontManagerMainPaneClass {
	FontManagerDualPanedClass parent_class;
};

struct _FontManagerMainPanePrivate {
	JsonArray* _available_fonts;
	FontManagerReject* _disabled_families;
	FontManagerMode _mode;
	FontManagerUserActionModel* _user_actions;
	FontManagerUserSourceModel* _user_sources;
	FontManagerWaterfallSettings* _waterfall_settings;
	gint _predefined_size;
	gboolean _show_line_size;
	GtkStack* content;
	GdkRectangle clicked_area;
	FontManagerSidebarStack* sidebar;
	FontManagerFontListView* fontlist;
	FontManagerComparePane* compare;
	FontManagerPreviewPane* preview;
};

struct _Block11Data {
	int _ref_count_;
	FontManagerMainPane* self;
	FontManagerPreviewColors* preview_colors;
	GSettings* settings;
};

static gint FontManagerMainPane_private_offset;
static gpointer font_manager_main_pane_parent_class = NULL;

VALA_EXTERN GType font_manager_dual_paned_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerDualPaned, g_object_unref)
VALA_EXTERN GType font_manager_main_pane_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerMainPane, g_object_unref)
VALA_EXTERN GType font_manager_mode_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType font_manager_user_action_model_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerUserActionModel, g_object_unref)
VALA_EXTERN GType font_manager_user_source_model_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerUserSourceModel, g_object_unref)
VALA_EXTERN GType font_manager_sidebar_stack_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerSidebarStack, g_object_unref)
VALA_EXTERN GType font_manager_font_list_base_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerFontListBase, g_object_unref)
VALA_EXTERN GType font_manager_base_font_list_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerBaseFontListView, g_object_unref)
VALA_EXTERN GType font_manager_font_list_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerFontListView, g_object_unref)
VALA_EXTERN GType font_manager_compare_pane_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerComparePane, g_object_unref)
VALA_EXTERN FontManagerMainPane* font_manager_main_pane_new (GSettings* settings);
VALA_EXTERN FontManagerMainPane* font_manager_main_pane_construct (GType object_type,
                                                       GSettings* settings);
static Block11Data* block11_data_ref (Block11Data* _data11_);
static void block11_data_unref (void * _userdata_);
VALA_EXTERN FontManagerDualPaned* font_manager_dual_paned_new (GSettings* settings);
VALA_EXTERN FontManagerDualPaned* font_manager_dual_paned_construct (GType object_type,
                                                         GSettings* settings);
VALA_EXTERN FontManagerSidebarStack* font_manager_sidebar_stack_new (GSettings* settings);
VALA_EXTERN FontManagerSidebarStack* font_manager_sidebar_stack_construct (GType object_type,
                                                               GSettings* settings);
VALA_EXTERN FontManagerFontListView* font_manager_font_list_view_new (void);
VALA_EXTERN FontManagerFontListView* font_manager_font_list_view_construct (GType object_type);
VALA_EXTERN FontManagerComparePane* font_manager_compare_pane_new (void);
VALA_EXTERN FontManagerComparePane* font_manager_compare_pane_construct (GType object_type);
VALA_EXTERN gchar* font_manager_mode_to_string (FontManagerMode self);
VALA_EXTERN void font_manager_dual_paned_set_sidebar_widget (FontManagerDualPaned* self,
                                                 GtkWidget* widget);
VALA_EXTERN void font_manager_dual_paned_set_list_widget (FontManagerDualPaned* self,
                                              GtkWidget* widget);
VALA_EXTERN void font_manager_dual_paned_set_content_widget (FontManagerDualPaned* self,
                                                 GtkWidget* widget);
static void font_manager_main_pane_on_mode_changed (FontManagerMainPane* self,
                                             GParamSpec* pspec);
static void _font_manager_main_pane_on_mode_changed_g_object_notify (GObject* _sender,
                                                              GParamSpec* pspec,
                                                              gpointer self);
static void font_manager_main_pane_on_selection_changed (FontManagerMainPane* self,
                                                  GObject* item);
static void _font_manager_main_pane_on_selection_changed_font_manager_font_list_base_selection_changed (FontManagerFontListBase* _sender,
                                                                                                 GObject* item,
                                                                                                 gpointer self);
static void __lambda116_ (FontManagerMainPane* self);
VALA_EXTERN void font_manager_font_list_base_queue_update (FontManagerFontListBase* self);
static void ___lambda116__font_manager_sidebar_stack_changed (FontManagerSidebarStack* _sender,
                                                       gpointer self);
static void __lambda117_ (FontManagerMainPane* self);
VALA_EXTERN void font_manager_sidebar_stack_update_collections (FontManagerSidebarStack* self);
static void ___lambda117__font_manager_font_list_view_collection_changed (FontManagerFontListView* _sender,
                                                                   gpointer self);
static void font_manager_main_pane_on_show_context_menu (FontManagerMainPane* self,
                                                  gint n_press,
                                                  gdouble x,
                                                  gdouble y);
static void _font_manager_main_pane_on_show_context_menu_gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                             gint n_press,
                                                                             gdouble x,
                                                                             gdouble y,
                                                                             gpointer self);
static void __lambda118_ (FontManagerMainPane* self);
VALA_EXTERN FontManagerWaterfallSettings* font_manager_main_pane_get_waterfall_settings (FontManagerMainPane* self);
static void ___lambda118__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda119_ (FontManagerMainPane* self);
static void ___lambda119__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda120_ (Block11Data* _data11_);
static void ___lambda120__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda121_ (Block11Data* _data11_);
static void ___lambda121__gtk_widget_realize (GtkWidget* _sender,
                                       gpointer self);
static void __lambda122_ (Block11Data* _data11_);
VALA_EXTERN void font_manager_compare_pane_restore_state (FontManagerComparePane* self,
                                              GSettings* settings);
static void ___lambda122__gtk_widget_realize (GtkWidget* _sender,
                                       gpointer self);
VALA_EXTERN void font_manager_main_pane_search (FontManagerMainPane* self,
                                    const gchar* needle);
VALA_EXTERN void font_manager_main_pane_set_mode (FontManagerMainPane* self,
                                      FontManagerMode value);
VALA_EXTERN void font_manager_main_pane_select_first_category (FontManagerMainPane* self);
VALA_EXTERN void font_manager_main_pane_select_first_font (FontManagerMainPane* self);
VALA_EXTERN void font_manager_font_list_view_set_search_term (FontManagerFontListView* self,
                                                  const gchar* needle);
VALA_EXTERN void font_manager_sidebar_stack_select_first_category (FontManagerSidebarStack* self);
VALA_EXTERN void font_manager_font_list_base_select_item (FontManagerFontListBase* self,
                                              guint position);
VALA_EXTERN void font_manager_main_pane_focus_search_entry (FontManagerMainPane* self);
VALA_EXTERN void font_manager_base_font_list_view_focus_search_entry (FontManagerBaseFontListView* self);
VALA_EXTERN FontManagerMode font_manager_main_pane_get_mode (FontManagerMainPane* self);
VALA_EXTERN JsonArray* font_manager_main_pane_get_available_fonts (FontManagerMainPane* self);
VALA_EXTERN void font_manager_main_pane_set_available_fonts (FontManagerMainPane* self,
                                                 JsonArray* value);
VALA_EXTERN FontManagerReject* font_manager_main_pane_get_disabled_families (FontManagerMainPane* self);
VALA_EXTERN void font_manager_main_pane_set_disabled_families (FontManagerMainPane* self,
                                                   FontManagerReject* value);
VALA_EXTERN FontManagerUserActionModel* font_manager_main_pane_get_user_actions (FontManagerMainPane* self);
VALA_EXTERN void font_manager_main_pane_set_user_actions (FontManagerMainPane* self,
                                              FontManagerUserActionModel* value);
VALA_EXTERN FontManagerUserSourceModel* font_manager_main_pane_get_user_sources (FontManagerMainPane* self);
VALA_EXTERN void font_manager_main_pane_set_user_sources (FontManagerMainPane* self,
                                              FontManagerUserSourceModel* value);
VALA_EXTERN void font_manager_main_pane_set_waterfall_settings (FontManagerMainPane* self,
                                                    FontManagerWaterfallSettings* value);
VALA_EXTERN gint font_manager_main_pane_get_predefined_size (FontManagerMainPane* self);
VALA_EXTERN void font_manager_main_pane_set_predefined_size (FontManagerMainPane* self,
                                                 gint value);
VALA_EXTERN gboolean font_manager_main_pane_get_show_line_size (FontManagerMainPane* self);
VALA_EXTERN void font_manager_main_pane_set_show_line_size (FontManagerMainPane* self,
                                                gboolean value);
VALA_EXTERN GType font_manager_font_list_filter_model_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerFontListFilterModel, g_object_unref)
VALA_EXTERN GType font_manager_category_list_model_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerCategoryListModel, g_object_unref)
VALA_EXTERN FontManagerCategoryListModel* font_manager_main_pane_get_category_model (FontManagerMainPane* self);
VALA_EXTERN FontManagerCategoryListModel* font_manager_sidebar_stack_get_category_model (FontManagerSidebarStack* self);
VALA_EXTERN GType font_manager_collection_list_model_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontManagerCollectionListModel, g_object_unref)
VALA_EXTERN FontManagerCollectionListModel* font_manager_main_pane_get_collection_model (FontManagerMainPane* self);
VALA_EXTERN FontManagerCollectionListModel* font_manager_sidebar_stack_get_collection_model (FontManagerSidebarStack* self);
static void font_manager_main_pane_finalize (GObject * obj);
static GType font_manager_main_pane_get_type_once (void);
static void _vala_font_manager_main_pane_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec);
static void _vala_font_manager_main_pane_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
font_manager_main_pane_get_instance_private (FontManagerMainPane* self)
{
	return G_STRUCT_MEMBER_P (self, FontManagerMainPane_private_offset);
}

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

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

static void
block11_data_unref (void * _userdata_)
{
	Block11Data* _data11_;
	_data11_ = (Block11Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data11_->_ref_count_)) {
		FontManagerMainPane* self;
		self = _data11_->self;
		_g_object_unref0 (_data11_->preview_colors);
		_g_object_unref0 (_data11_->settings);
		_g_object_unref0 (self);
		g_slice_free (Block11Data, _data11_);
	}
}

static void
_font_manager_main_pane_on_mode_changed_g_object_notify (GObject* _sender,
                                                         GParamSpec* pspec,
                                                         gpointer self)
{
	font_manager_main_pane_on_mode_changed ((FontManagerMainPane*) self, pspec);
}

static void
_font_manager_main_pane_on_selection_changed_font_manager_font_list_base_selection_changed (FontManagerFontListBase* _sender,
                                                                                            GObject* item,
                                                                                            gpointer self)
{
	font_manager_main_pane_on_selection_changed ((FontManagerMainPane*) self, item);
}

static void
__lambda116_ (FontManagerMainPane* self)
{
	FontManagerFontListView* _tmp0_;
	_tmp0_ = self->priv->fontlist;
	font_manager_font_list_base_queue_update ((FontManagerFontListBase*) _tmp0_);
}

static void
___lambda116__font_manager_sidebar_stack_changed (FontManagerSidebarStack* _sender,
                                                  gpointer self)
{
	__lambda116_ ((FontManagerMainPane*) self);
}

static void
__lambda117_ (FontManagerMainPane* self)
{
	FontManagerSidebarStack* _tmp0_;
	_tmp0_ = self->priv->sidebar;
	font_manager_sidebar_stack_update_collections (_tmp0_);
}

static void
___lambda117__font_manager_font_list_view_collection_changed (FontManagerFontListView* _sender,
                                                              gpointer self)
{
	__lambda117_ ((FontManagerMainPane*) self);
}

static void
_font_manager_main_pane_on_show_context_menu_gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                        gint n_press,
                                                                        gdouble x,
                                                                        gdouble y,
                                                                        gpointer self)
{
	font_manager_main_pane_on_show_context_menu ((FontManagerMainPane*) self, n_press, x, y);
}

static void
__lambda118_ (FontManagerMainPane* self)
{
	GBindingFlags _flags = 0U;
	FontManagerWaterfallSettings* _tmp0_;
	FontManagerWaterfallSettings* _tmp1_;
	_flags = G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE;
	_tmp0_ = self->priv->_waterfall_settings;
	g_object_bind_property_with_closures ((GObject*) _tmp0_, "predefined-size", (GObject*) self, "predefined-size", _flags, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp1_ = self->priv->_waterfall_settings;
	g_object_bind_property_with_closures ((GObject*) _tmp1_, "show-line-size", (GObject*) self, "show-line-size", _flags, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
}

static void
___lambda118__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda118_ ((FontManagerMainPane*) self);
}

static void
__lambda119_ (FontManagerMainPane* self)
{
	FontManagerWaterfallSettings* _tmp0_;
	FontManagerPreviewPane* _tmp1_;
	FontManagerWaterfallSettings* _tmp2_;
	gdouble _tmp3_;
	gdouble _tmp4_;
	FontManagerWaterfallSettings* _tmp5_;
	gdouble _tmp6_;
	gdouble _tmp7_;
	FontManagerWaterfallSettings* _tmp8_;
	gdouble _tmp9_;
	gdouble _tmp10_;
	_tmp0_ = self->priv->_waterfall_settings;
	font_manager_waterfall_settings_on_selection_changed (_tmp0_);
	_tmp1_ = self->priv->preview;
	_tmp2_ = self->priv->_waterfall_settings;
	_tmp3_ = font_manager_waterfall_settings_get_minimum (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = self->priv->_waterfall_settings;
	_tmp6_ = font_manager_waterfall_settings_get_maximum (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = self->priv->_waterfall_settings;
	_tmp9_ = font_manager_waterfall_settings_get_ratio (_tmp8_);
	_tmp10_ = _tmp9_;
	font_manager_preview_pane_set_waterfall_size (_tmp1_, _tmp4_, _tmp7_, _tmp10_);
}

static void
___lambda119__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda119_ ((FontManagerMainPane*) self);
}

static void
__lambda120_ (Block11Data* _data11_)
{
	FontManagerMainPane* self;
	FontManagerPreviewPane* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	self = _data11_->self;
	_tmp0_ = self->priv->preview;
	g_object_get (_tmp0_, "page", &_tmp1_, NULL);
	_tmp2_ = _tmp1_;
	gtk_widget_set_visible ((GtkWidget*) _data11_->preview_colors, _tmp2_ == ((gint) FONT_MANAGER_PREVIEW_PANE_PAGE_PREVIEW));
}

static void
___lambda120__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda120_ (self);
}

static void
__lambda121_ (Block11Data* _data11_)
{
	FontManagerMainPane* self;
	FontManagerPreviewPane* _tmp0_;
	FontManagerPreviewPane* _tmp1_;
	FontManagerPreviewPane* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	self = _data11_->self;
	_tmp0_ = self->priv->preview;
	font_manager_preview_pane_restore_state (_tmp0_, _data11_->settings);
	_tmp1_ = self->priv->preview;
	font_manager_preview_pane_add_action_widget (_tmp1_, (GtkWidget*) _data11_->preview_colors, GTK_PACK_END);
	_tmp2_ = self->priv->preview;
	g_object_get (_tmp2_, "page", &_tmp3_, NULL);
	_tmp4_ = _tmp3_;
	gtk_widget_set_visible ((GtkWidget*) _data11_->preview_colors, _tmp4_ == ((gint) FONT_MANAGER_PREVIEW_PANE_PAGE_PREVIEW));
	font_manager_preview_colors_restore_state (_data11_->preview_colors, _data11_->settings);
}

static void
___lambda121__gtk_widget_realize (GtkWidget* _sender,
                                  gpointer self)
{
	__lambda121_ (self);
}

static void
__lambda122_ (Block11Data* _data11_)
{
	FontManagerMainPane* self;
	FontManagerComparePane* _tmp0_;
	self = _data11_->self;
	_tmp0_ = self->priv->compare;
	font_manager_compare_pane_restore_state (_tmp0_, _data11_->settings);
}

static void
___lambda122__gtk_widget_realize (GtkWidget* _sender,
                                  gpointer self)
{
	__lambda122_ (self);
}

FontManagerMainPane*
font_manager_main_pane_construct (GType object_type,
                                  GSettings* settings)
{
	FontManagerMainPane * self = NULL;
	Block11Data* _data11_;
	GSettings* _tmp0_;
	FontManagerSidebarStack* _tmp1_;
	FontManagerFontListView* _tmp2_;
	FontManagerPreviewPane* _tmp3_;
	FontManagerPreviewColors* _tmp4_;
	FontManagerComparePane* _tmp5_;
	GtkStack* _tmp6_ = NULL;
	GtkStack* _tmp7_;
	FontManagerPreviewPane* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	GtkStack* _tmp11_;
	FontManagerComparePane* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	FontManagerSidebarStack* _tmp15_;
	FontManagerFontListView* _tmp16_;
	GtkStack* _tmp17_;
	GBindingFlags flags = 0U;
	FontManagerFontListView* _tmp18_;
	FontManagerSidebarStack* _tmp19_;
	FontManagerFontListView* _tmp20_;
	FontManagerFontListView* _tmp21_;
	FontManagerFontListView* _tmp22_;
	FontManagerSidebarStack* _tmp23_;
	FontManagerSidebarStack* _tmp24_;
	FontManagerFontListView* _tmp25_;
	FontManagerFontListView* _tmp26_;
	FontManagerSidebarStack* _tmp27_;
	FontManagerFontListView* _tmp28_;
	FontManagerComparePane* _tmp29_;
	FontManagerFontListView* _tmp30_;
	FontManagerComparePane* _tmp31_;
	FontManagerPreviewPane* _tmp32_;
	FontManagerSidebarStack* _tmp33_;
	FontManagerSidebarStack* _tmp34_;
	FontManagerPreviewPane* _tmp35_;
	FontManagerFontListView* _tmp36_;
	FontManagerSidebarStack* _tmp37_;
	FontManagerFontListView* _tmp38_;
	GtkGesture* right_click = NULL;
	GtkGestureClick* _tmp39_ = NULL;
	FontManagerPreviewPane* _tmp40_;
	GtkEventController* _tmp41_;
	FontManagerPreviewPane* _tmp42_;
	FontManagerPreviewPane* _tmp43_;
	FontManagerComparePane* _tmp44_;
	_data11_ = g_slice_new0 (Block11Data);
	_data11_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (settings);
	_g_object_unref0 (_data11_->settings);
	_data11_->settings = _tmp0_;
	self = (FontManagerMainPane*) font_manager_dual_paned_construct (object_type, _data11_->settings);
	_data11_->self = g_object_ref (self);
	_tmp1_ = font_manager_sidebar_stack_new (_data11_->settings);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->sidebar);
	self->priv->sidebar = _tmp1_;
	_tmp2_ = font_manager_font_list_view_new ();
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->fontlist);
	self->priv->fontlist = _tmp2_;
	_tmp3_ = (FontManagerPreviewPane*) font_manager_preview_pane_new ();
	g_object_ref_sink (_tmp3_);
	_g_object_unref0 (self->priv->preview);
	self->priv->preview = _tmp3_;
	_tmp4_ = font_manager_preview_colors_new ();
	g_object_ref_sink (_tmp4_);
	_data11_->preview_colors = _tmp4_;
	_tmp5_ = font_manager_compare_pane_new ();
	g_object_ref_sink (_tmp5_);
	_g_object_unref0 (self->priv->compare);
	self->priv->compare = _tmp5_;
	_tmp6_ = (GtkStack*) gtk_stack_new ();
	gtk_stack_set_transition_type (_tmp6_, GTK_STACK_TRANSITION_TYPE_CROSSFADE);
	gtk_stack_set_transition_duration (_tmp6_, (guint) 420);
	g_object_ref_sink (_tmp6_);
	_g_object_unref0 (self->priv->content);
	self->priv->content = _tmp6_;
	_tmp7_ = self->priv->content;
	_tmp8_ = self->priv->preview;
	_tmp9_ = font_manager_mode_to_string (FONT_MANAGER_MODE_MANAGE);
	_tmp10_ = _tmp9_;
	gtk_stack_add_named (_tmp7_, (GtkWidget*) _tmp8_, _tmp10_);
	_g_free0 (_tmp10_);
	_tmp11_ = self->priv->content;
	_tmp12_ = self->priv->compare;
	_tmp13_ = font_manager_mode_to_string (FONT_MANAGER_MODE_COMPARE);
	_tmp14_ = _tmp13_;
	gtk_stack_add_named (_tmp11_, (GtkWidget*) _tmp12_, _tmp14_);
	_g_free0 (_tmp14_);
	_tmp15_ = self->priv->sidebar;
	font_manager_dual_paned_set_sidebar_widget ((FontManagerDualPaned*) self, (GtkWidget*) _tmp15_);
	_tmp16_ = self->priv->fontlist;
	font_manager_dual_paned_set_list_widget ((FontManagerDualPaned*) self, (GtkWidget*) _tmp16_);
	_tmp17_ = self->priv->content;
	font_manager_dual_paned_set_content_widget ((FontManagerDualPaned*) self, (GtkWidget*) _tmp17_);
	flags = G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE;
	_tmp18_ = self->priv->fontlist;
	g_object_bind_property_with_closures ((GObject*) self, "available-fonts", (GObject*) _tmp18_, "available-fonts", flags, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp19_ = self->priv->sidebar;
	g_object_bind_property_with_closures ((GObject*) self, "available-fonts", (GObject*) _tmp19_, "available-fonts", flags, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp20_ = self->priv->fontlist;
	g_object_bind_property_with_closures ((GObject*) self, "user-actions", (GObject*) _tmp20_, "user-actions", flags, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp21_ = self->priv->fontlist;
	g_object_bind_property_with_closures ((GObject*) self, "user-sources", (GObject*) _tmp21_, "user-sources", flags, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp22_ = self->priv->fontlist;
	g_object_bind_property_with_closures ((GObject*) self, "disabled-families", (GObject*) _tmp22_, "disabled-families", flags, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp23_ = self->priv->sidebar;
	g_object_bind_property_with_closures ((GObject*) self, "disabled-families", (GObject*) _tmp23_, "disabled-families", flags, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp24_ = self->priv->sidebar;
	_tmp25_ = self->priv->fontlist;
	g_object_bind_property_with_closures ((GObject*) _tmp24_, "filter", (GObject*) _tmp25_, "filter", flags, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp26_ = self->priv->fontlist;
	_tmp27_ = self->priv->sidebar;
	g_object_bind_property_with_closures ((GObject*) _tmp26_, "selected-item", (GObject*) _tmp27_, "selected-item", flags, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp28_ = self->priv->fontlist;
	_tmp29_ = self->priv->compare;
	g_object_bind_property_with_closures ((GObject*) _tmp28_, "selected-items", (GObject*) _tmp29_, "selected-items", flags, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp30_ = self->priv->fontlist;
	_tmp31_ = self->priv->compare;
	g_object_bind_property_with_closures ((GObject*) _tmp30_, "selected-children", (GObject*) _tmp31_, "selected-children", flags, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp32_ = self->priv->preview;
	_tmp33_ = self->priv->sidebar;
	g_object_bind_property_with_closures ((GObject*) _tmp32_, "page", (GObject*) _tmp33_, "mode", flags, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp34_ = self->priv->sidebar;
	_tmp35_ = self->priv->preview;
	g_object_bind_property_with_closures ((GObject*) _tmp34_, "selected-orthography", (GObject*) _tmp35_, "orthography", flags, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_signal_connect_object ((GObject*) self, "notify::mode", (GCallback) _font_manager_main_pane_on_mode_changed_g_object_notify, self, 0);
	_tmp36_ = self->priv->fontlist;
	g_signal_connect_object ((FontManagerFontListBase*) _tmp36_, "selection-changed", (GCallback) _font_manager_main_pane_on_selection_changed_font_manager_font_list_base_selection_changed, self, 0);
	_tmp37_ = self->priv->sidebar;
	g_signal_connect_object (_tmp37_, "changed", (GCallback) ___lambda116__font_manager_sidebar_stack_changed, self, G_CONNECT_AFTER);
	_tmp38_ = self->priv->fontlist;
	g_signal_connect_object (_tmp38_, "collection-changed", (GCallback) ___lambda117__font_manager_font_list_view_collection_changed, self, 0);
	memset (&self->priv->clicked_area, 0, sizeof (GdkRectangle));
	_tmp39_ = (GtkGestureClick*) gtk_gesture_click_new ();
	gtk_gesture_single_set_button ((GtkGestureSingle*) _tmp39_, (guint) GDK_BUTTON_SECONDARY);
	right_click = (GtkGesture*) _tmp39_;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (right_click, gtk_gesture_click_get_type (), GtkGestureClick), "pressed", (GCallback) _font_manager_main_pane_on_show_context_menu_gtk_gesture_click_pressed, self, 0);
	_tmp40_ = self->priv->preview;
	_tmp41_ = _g_object_ref0 ((GtkEventController*) right_click);
	gtk_widget_add_controller ((GtkWidget*) _tmp40_, _tmp41_);
	g_signal_connect_object ((GObject*) self, "notify::waterfall-settings", (GCallback) ___lambda118__g_object_notify, self, 0);
	g_signal_connect_object ((GObject*) self, "notify::predefined-size", (GCallback) ___lambda119__g_object_notify, self, G_CONNECT_AFTER);
	_tmp42_ = self->priv->preview;
	g_signal_connect_data ((GObject*) _tmp42_, "notify::page", (GCallback) ___lambda120__g_object_notify, block11_data_ref (_data11_), (GClosureNotify) block11_data_unref, 0);
	_tmp43_ = self->priv->preview;
	g_signal_connect_data ((GtkWidget*) _tmp43_, "realize", (GCallback) ___lambda121__gtk_widget_realize, block11_data_ref (_data11_), (GClosureNotify) block11_data_unref, G_CONNECT_AFTER);
	_tmp44_ = self->priv->compare;
	g_signal_connect_data ((GtkWidget*) _tmp44_, "realize", (GCallback) ___lambda122__gtk_widget_realize, block11_data_ref (_data11_), (GClosureNotify) block11_data_unref, G_CONNECT_AFTER);
	_g_object_unref0 (right_click);
	block11_data_unref (_data11_);
	_data11_ = NULL;
	return self;
}

FontManagerMainPane*
font_manager_main_pane_new (GSettings* settings)
{
	return font_manager_main_pane_construct (FONT_MANAGER_TYPE_MAIN_PANE, settings);
}

void
font_manager_main_pane_search (FontManagerMainPane* self,
                               const gchar* needle)
{
	FontManagerPreviewPane* _tmp0_;
	FontManagerFontListView* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (needle != NULL);
	font_manager_main_pane_set_mode (self, FONT_MANAGER_MODE_MANAGE);
	_tmp0_ = self->priv->preview;
	g_object_set (_tmp0_, "page", (gint) FONT_MANAGER_PREVIEW_PANE_PAGE_PREVIEW, NULL);
	font_manager_main_pane_select_first_category (self);
	font_manager_main_pane_select_first_font (self);
	_tmp1_ = self->priv->fontlist;
	font_manager_font_list_view_set_search_term (_tmp1_, needle);
	return;
}

void
font_manager_main_pane_select_first_category (FontManagerMainPane* self)
{
	FontManagerSidebarStack* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->sidebar;
	font_manager_sidebar_stack_select_first_category (_tmp0_);
	return;
}

void
font_manager_main_pane_select_first_font (FontManagerMainPane* self)
{
	FontManagerFontListView* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->fontlist;
	font_manager_font_list_base_select_item ((FontManagerFontListBase*) _tmp0_, (guint) 0);
	return;
}

void
font_manager_main_pane_focus_search_entry (FontManagerMainPane* self)
{
	FontManagerFontListView* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->fontlist;
	font_manager_base_font_list_view_focus_search_entry ((FontManagerBaseFontListView*) _tmp0_);
	return;
}

static void
font_manager_main_pane_on_mode_changed (FontManagerMainPane* self,
                                        GParamSpec* pspec)
{
	gboolean _tmp0_ = FALSE;
	FontManagerMode _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_mode;
	if (_tmp1_ == FONT_MANAGER_MODE_MANAGE) {
		_tmp0_ = TRUE;
	} else {
		FontManagerMode _tmp2_;
		_tmp2_ = self->priv->_mode;
		_tmp0_ = _tmp2_ == FONT_MANAGER_MODE_COMPARE;
	}
	if (_tmp0_) {
		GtkStack* _tmp3_;
		FontManagerMode _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		_tmp3_ = self->priv->content;
		_tmp4_ = self->priv->_mode;
		_tmp5_ = font_manager_mode_to_string ((FontManagerMode) _tmp4_);
		_tmp6_ = _tmp5_;
		gtk_stack_set_visible_child_name (_tmp3_, _tmp6_);
		_g_free0 (_tmp6_);
	}
	return;
}

static void
font_manager_main_pane_on_selection_changed (FontManagerMainPane* self,
                                             GObject* item)
{
	gboolean _tmp0_ = FALSE;
	FontManagerFont* font = NULL;
	FontManagerFont* _tmp1_;
	FontManagerPreviewPane* _tmp5_;
	FontManagerFont* _tmp6_;
	g_return_if_fail (self != NULL);
	if (G_TYPE_CHECK_INSTANCE_TYPE (item, font_manager_font_get_type ())) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = G_TYPE_CHECK_INSTANCE_TYPE (item, font_manager_family_get_type ());
	}
	g_return_if_fail (_tmp0_);
	_tmp1_ = font_manager_font_new ();
	font = _tmp1_;
	if (G_TYPE_CHECK_INSTANCE_TYPE (item, font_manager_font_get_type ())) {
		FontManagerFont* _tmp2_;
		_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (item, font_manager_font_get_type (), FontManagerFont));
		_g_object_unref0 (font);
		font = _tmp2_;
	} else {
		FontManagerFont* _tmp3_;
		JsonObject* _tmp4_;
		_tmp3_ = font;
		_tmp4_ = font_manager_family_get_default_variant (G_TYPE_CHECK_INSTANCE_CAST (item, font_manager_family_get_type (), FontManagerFamily));
		g_object_set (_tmp3_, "source-object", _tmp4_, NULL);
	}
	_tmp5_ = self->priv->preview;
	_tmp6_ = font;
	g_object_set (_tmp5_, "font", _tmp6_, NULL);
	_g_object_unref0 (font);
	return;
}

static void
font_manager_main_pane_on_show_context_menu (FontManagerMainPane* self,
                                             gint n_press,
                                             gdouble x,
                                             gdouble y)
{
	FontManagerWaterfallSettings* _tmp0_;
	gboolean _tmp1_ = FALSE;
	FontManagerPreviewPane* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	FontManagerWaterfallSettings* _tmp8_;
	GtkPopoverMenu* _tmp9_;
	GtkPopoverMenu* _tmp10_;
	GtkWidget* _tmp11_;
	FontManagerWaterfallSettings* _tmp15_;
	GtkPopoverMenu* _tmp16_;
	GtkPopoverMenu* _tmp17_;
	FontManagerPreviewPane* _tmp18_;
	FontManagerWaterfallSettings* _tmp19_;
	GtkPopoverMenu* _tmp20_;
	GtkPopoverMenu* _tmp21_;
	GdkRectangle _tmp22_;
	FontManagerWaterfallSettings* _tmp23_;
	GtkPopoverMenu* _tmp24_;
	GtkPopoverMenu* _tmp25_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_waterfall_settings;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp2_ = self->priv->preview;
	g_object_get (_tmp2_, "page", &_tmp3_, NULL);
	_tmp4_ = _tmp3_;
	if (_tmp4_ != ((gint) FONT_MANAGER_PREVIEW_PANE_PAGE_PREVIEW)) {
		_tmp1_ = TRUE;
	} else {
		FontManagerPreviewPane* _tmp5_;
		FontManagerPreviewPageMode _tmp6_;
		FontManagerPreviewPageMode _tmp7_;
		_tmp5_ = self->priv->preview;
		g_object_get (_tmp5_, "preview-mode", &_tmp6_, NULL);
		_tmp7_ = _tmp6_;
		_tmp1_ = _tmp7_ != FONT_MANAGER_PREVIEW_PAGE_MODE_WATERFALL;
	}
	if (_tmp1_) {
		return;
	}
	self->priv->clicked_area.x = (gint) x;
	self->priv->clicked_area.y = (gint) y;
	self->priv->clicked_area.width = 2;
	self->priv->clicked_area.height = 2;
	_tmp8_ = self->priv->_waterfall_settings;
	_tmp9_ = font_manager_waterfall_settings_get_context_menu (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = gtk_widget_get_parent ((GtkWidget*) _tmp10_);
	if (_tmp11_ != NULL) {
		FontManagerWaterfallSettings* _tmp12_;
		GtkPopoverMenu* _tmp13_;
		GtkPopoverMenu* _tmp14_;
		_tmp12_ = self->priv->_waterfall_settings;
		_tmp13_ = font_manager_waterfall_settings_get_context_menu (_tmp12_);
		_tmp14_ = _tmp13_;
		gtk_widget_unparent ((GtkWidget*) _tmp14_);
	}
	_tmp15_ = self->priv->_waterfall_settings;
	_tmp16_ = font_manager_waterfall_settings_get_context_menu (_tmp15_);
	_tmp17_ = _tmp16_;
	_tmp18_ = self->priv->preview;
	gtk_widget_set_parent ((GtkWidget*) _tmp17_, (GtkWidget*) _tmp18_);
	_tmp19_ = self->priv->_waterfall_settings;
	_tmp20_ = font_manager_waterfall_settings_get_context_menu (_tmp19_);
	_tmp21_ = _tmp20_;
	_tmp22_ = self->priv->clicked_area;
	gtk_popover_set_pointing_to ((GtkPopover*) _tmp21_, &_tmp22_);
	_tmp23_ = self->priv->_waterfall_settings;
	_tmp24_ = font_manager_waterfall_settings_get_context_menu (_tmp23_);
	_tmp25_ = _tmp24_;
	gtk_popover_popup ((GtkPopover*) _tmp25_);
	return;
}

JsonArray*
font_manager_main_pane_get_available_fonts (FontManagerMainPane* self)
{
	JsonArray* result;
	JsonArray* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_available_fonts;
	result = _tmp0_;
	return result;
}

static gpointer
_json_array_ref0 (gpointer self)
{
	return self ? json_array_ref (self) : NULL;
}

void
font_manager_main_pane_set_available_fonts (FontManagerMainPane* self,
                                            JsonArray* value)
{
	JsonArray* old_value;
	g_return_if_fail (self != NULL);
	old_value = font_manager_main_pane_get_available_fonts (self);
	if (old_value != value) {
		JsonArray* _tmp0_;
		_tmp0_ = _json_array_ref0 (value);
		_json_array_unref0 (self->priv->_available_fonts);
		self->priv->_available_fonts = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, font_manager_main_pane_properties[FONT_MANAGER_MAIN_PANE_AVAILABLE_FONTS_PROPERTY]);
	}
}

FontManagerReject*
font_manager_main_pane_get_disabled_families (FontManagerMainPane* self)
{
	FontManagerReject* result;
	FontManagerReject* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_disabled_families;
	result = _tmp0_;
	return result;
}

void
font_manager_main_pane_set_disabled_families (FontManagerMainPane* self,
                                              FontManagerReject* value)
{
	FontManagerReject* old_value;
	g_return_if_fail (self != NULL);
	old_value = font_manager_main_pane_get_disabled_families (self);
	if (old_value != value) {
		FontManagerReject* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_disabled_families);
		self->priv->_disabled_families = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, font_manager_main_pane_properties[FONT_MANAGER_MAIN_PANE_DISABLED_FAMILIES_PROPERTY]);
	}
}

FontManagerMode
font_manager_main_pane_get_mode (FontManagerMainPane* self)
{
	FontManagerMode result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_mode;
	return result;
}

void
font_manager_main_pane_set_mode (FontManagerMainPane* self,
                                 FontManagerMode value)
{
	FontManagerMode old_value;
	g_return_if_fail (self != NULL);
	old_value = font_manager_main_pane_get_mode (self);
	if (old_value != value) {
		self->priv->_mode = value;
		g_object_notify_by_pspec ((GObject *) self, font_manager_main_pane_properties[FONT_MANAGER_MAIN_PANE_MODE_PROPERTY]);
	}
}

FontManagerUserActionModel*
font_manager_main_pane_get_user_actions (FontManagerMainPane* self)
{
	FontManagerUserActionModel* result;
	FontManagerUserActionModel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_user_actions;
	result = _tmp0_;
	return result;
}

void
font_manager_main_pane_set_user_actions (FontManagerMainPane* self,
                                         FontManagerUserActionModel* value)
{
	FontManagerUserActionModel* old_value;
	g_return_if_fail (self != NULL);
	old_value = font_manager_main_pane_get_user_actions (self);
	if (old_value != value) {
		FontManagerUserActionModel* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_user_actions);
		self->priv->_user_actions = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, font_manager_main_pane_properties[FONT_MANAGER_MAIN_PANE_USER_ACTIONS_PROPERTY]);
	}
}

FontManagerUserSourceModel*
font_manager_main_pane_get_user_sources (FontManagerMainPane* self)
{
	FontManagerUserSourceModel* result;
	FontManagerUserSourceModel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_user_sources;
	result = _tmp0_;
	return result;
}

void
font_manager_main_pane_set_user_sources (FontManagerMainPane* self,
                                         FontManagerUserSourceModel* value)
{
	FontManagerUserSourceModel* old_value;
	g_return_if_fail (self != NULL);
	old_value = font_manager_main_pane_get_user_sources (self);
	if (old_value != value) {
		FontManagerUserSourceModel* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_user_sources);
		self->priv->_user_sources = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, font_manager_main_pane_properties[FONT_MANAGER_MAIN_PANE_USER_SOURCES_PROPERTY]);
	}
}

FontManagerWaterfallSettings*
font_manager_main_pane_get_waterfall_settings (FontManagerMainPane* self)
{
	FontManagerWaterfallSettings* result;
	FontManagerWaterfallSettings* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_waterfall_settings;
	result = _tmp0_;
	return result;
}

void
font_manager_main_pane_set_waterfall_settings (FontManagerMainPane* self,
                                               FontManagerWaterfallSettings* value)
{
	FontManagerWaterfallSettings* old_value;
	g_return_if_fail (self != NULL);
	old_value = font_manager_main_pane_get_waterfall_settings (self);
	if (old_value != value) {
		FontManagerWaterfallSettings* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_waterfall_settings);
		self->priv->_waterfall_settings = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, font_manager_main_pane_properties[FONT_MANAGER_MAIN_PANE_WATERFALL_SETTINGS_PROPERTY]);
	}
}

gint
font_manager_main_pane_get_predefined_size (FontManagerMainPane* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_predefined_size;
	return result;
}

void
font_manager_main_pane_set_predefined_size (FontManagerMainPane* self,
                                            gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = font_manager_main_pane_get_predefined_size (self);
	if (old_value != value) {
		self->priv->_predefined_size = value;
		g_object_notify_by_pspec ((GObject *) self, font_manager_main_pane_properties[FONT_MANAGER_MAIN_PANE_PREDEFINED_SIZE_PROPERTY]);
	}
}

gboolean
font_manager_main_pane_get_show_line_size (FontManagerMainPane* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_show_line_size;
	return result;
}

void
font_manager_main_pane_set_show_line_size (FontManagerMainPane* self,
                                           gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = font_manager_main_pane_get_show_line_size (self);
	if (old_value != value) {
		self->priv->_show_line_size = value;
		g_object_notify_by_pspec ((GObject *) self, font_manager_main_pane_properties[FONT_MANAGER_MAIN_PANE_SHOW_LINE_SIZE_PROPERTY]);
	}
}

FontManagerCategoryListModel*
font_manager_main_pane_get_category_model (FontManagerMainPane* self)
{
	FontManagerCategoryListModel* result;
	FontManagerSidebarStack* _tmp0_;
	FontManagerCategoryListModel* _tmp1_;
	FontManagerCategoryListModel* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->sidebar;
	_tmp1_ = font_manager_sidebar_stack_get_category_model (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

FontManagerCollectionListModel*
font_manager_main_pane_get_collection_model (FontManagerMainPane* self)
{
	FontManagerCollectionListModel* result;
	FontManagerSidebarStack* _tmp0_;
	FontManagerCollectionListModel* _tmp1_;
	FontManagerCollectionListModel* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->sidebar;
	_tmp1_ = font_manager_sidebar_stack_get_collection_model (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

static void
font_manager_main_pane_class_init (FontManagerMainPaneClass * klass,
                                   gpointer klass_data)
{
	font_manager_main_pane_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FontManagerMainPane_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_font_manager_main_pane_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_font_manager_main_pane_set_property;
	G_OBJECT_CLASS (klass)->finalize = font_manager_main_pane_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_MAIN_PANE_AVAILABLE_FONTS_PROPERTY, font_manager_main_pane_properties[FONT_MANAGER_MAIN_PANE_AVAILABLE_FONTS_PROPERTY] = g_param_spec_boxed ("available-fonts", "available-fonts", "available-fonts", json_array_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_MAIN_PANE_DISABLED_FAMILIES_PROPERTY, font_manager_main_pane_properties[FONT_MANAGER_MAIN_PANE_DISABLED_FAMILIES_PROPERTY] = g_param_spec_object ("disabled-families", "disabled-families", "disabled-families", font_manager_reject_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_MAIN_PANE_MODE_PROPERTY, font_manager_main_pane_properties[FONT_MANAGER_MAIN_PANE_MODE_PROPERTY] = g_param_spec_enum ("mode", "mode", "mode", FONT_MANAGER_TYPE_MODE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_MAIN_PANE_USER_ACTIONS_PROPERTY, font_manager_main_pane_properties[FONT_MANAGER_MAIN_PANE_USER_ACTIONS_PROPERTY] = g_param_spec_object ("user-actions", "user-actions", "user-actions", FONT_MANAGER_TYPE_USER_ACTION_MODEL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_MAIN_PANE_USER_SOURCES_PROPERTY, font_manager_main_pane_properties[FONT_MANAGER_MAIN_PANE_USER_SOURCES_PROPERTY] = g_param_spec_object ("user-sources", "user-sources", "user-sources", FONT_MANAGER_TYPE_USER_SOURCE_MODEL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_MAIN_PANE_WATERFALL_SETTINGS_PROPERTY, font_manager_main_pane_properties[FONT_MANAGER_MAIN_PANE_WATERFALL_SETTINGS_PROPERTY] = g_param_spec_object ("waterfall-settings", "waterfall-settings", "waterfall-settings", FONT_MANAGER_TYPE_WATERFALL_SETTINGS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_MAIN_PANE_PREDEFINED_SIZE_PROPERTY, font_manager_main_pane_properties[FONT_MANAGER_MAIN_PANE_PREDEFINED_SIZE_PROPERTY] = g_param_spec_int ("predefined-size", "predefined-size", "predefined-size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_MAIN_PANE_SHOW_LINE_SIZE_PROPERTY, font_manager_main_pane_properties[FONT_MANAGER_MAIN_PANE_SHOW_LINE_SIZE_PROPERTY] = g_param_spec_boolean ("show-line-size", "show-line-size", "show-line-size", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_MAIN_PANE_CATEGORY_MODEL_PROPERTY, font_manager_main_pane_properties[FONT_MANAGER_MAIN_PANE_CATEGORY_MODEL_PROPERTY] = g_param_spec_object ("category-model", "category-model", "category-model", FONT_MANAGER_TYPE_CATEGORY_LIST_MODEL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FONT_MANAGER_MAIN_PANE_COLLECTION_MODEL_PROPERTY, font_manager_main_pane_properties[FONT_MANAGER_MAIN_PANE_COLLECTION_MODEL_PROPERTY] = g_param_spec_object ("collection-model", "collection-model", "collection-model", FONT_MANAGER_TYPE_COLLECTION_LIST_MODEL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	gtk_widget_class_install_property_action (GTK_WIDGET_CLASS (klass), "predefined-size", "predefined-size");
	gtk_widget_class_install_property_action (GTK_WIDGET_CLASS (klass), "show-line-size", "show-line-size");
}

static void
font_manager_main_pane_instance_init (FontManagerMainPane * self,
                                      gpointer klass)
{
	self->priv = font_manager_main_pane_get_instance_private (self);
	self->priv->_available_fonts = NULL;
	self->priv->_disabled_families = NULL;
	self->priv->_mode = 0;
}

static void
font_manager_main_pane_finalize (GObject * obj)
{
	FontManagerMainPane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FONT_MANAGER_TYPE_MAIN_PANE, FontManagerMainPane);
	_json_array_unref0 (self->priv->_available_fonts);
	_g_object_unref0 (self->priv->_disabled_families);
	_g_object_unref0 (self->priv->_user_actions);
	_g_object_unref0 (self->priv->_user_sources);
	_g_object_unref0 (self->priv->_waterfall_settings);
	_g_object_unref0 (self->priv->content);
	_g_object_unref0 (self->priv->sidebar);
	_g_object_unref0 (self->priv->fontlist);
	_g_object_unref0 (self->priv->compare);
	_g_object_unref0 (self->priv->preview);
	G_OBJECT_CLASS (font_manager_main_pane_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
font_manager_main_pane_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FontManagerMainPaneClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) font_manager_main_pane_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FontManagerMainPane), 0, (GInstanceInitFunc) font_manager_main_pane_instance_init, NULL };
	GType font_manager_main_pane_type_id;
	font_manager_main_pane_type_id = g_type_register_static (FONT_MANAGER_TYPE_DUAL_PANED, "FontManagerMainPane", &g_define_type_info, 0);
	FontManagerMainPane_private_offset = g_type_add_instance_private (font_manager_main_pane_type_id, sizeof (FontManagerMainPanePrivate));
	return font_manager_main_pane_type_id;
}

GType
font_manager_main_pane_get_type (void)
{
	static volatile gsize font_manager_main_pane_type_id__once = 0;
	if (g_once_init_enter (&font_manager_main_pane_type_id__once)) {
		GType font_manager_main_pane_type_id;
		font_manager_main_pane_type_id = font_manager_main_pane_get_type_once ();
		g_once_init_leave (&font_manager_main_pane_type_id__once, font_manager_main_pane_type_id);
	}
	return font_manager_main_pane_type_id__once;
}

static void
_vala_font_manager_main_pane_get_property (GObject * object,
                                           guint property_id,
                                           GValue * value,
                                           GParamSpec * pspec)
{
	FontManagerMainPane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FONT_MANAGER_TYPE_MAIN_PANE, FontManagerMainPane);
	switch (property_id) {
		case FONT_MANAGER_MAIN_PANE_AVAILABLE_FONTS_PROPERTY:
		g_value_set_boxed (value, font_manager_main_pane_get_available_fonts (self));
		break;
		case FONT_MANAGER_MAIN_PANE_DISABLED_FAMILIES_PROPERTY:
		g_value_set_object (value, font_manager_main_pane_get_disabled_families (self));
		break;
		case FONT_MANAGER_MAIN_PANE_MODE_PROPERTY:
		g_value_set_enum (value, font_manager_main_pane_get_mode (self));
		break;
		case FONT_MANAGER_MAIN_PANE_USER_ACTIONS_PROPERTY:
		g_value_set_object (value, font_manager_main_pane_get_user_actions (self));
		break;
		case FONT_MANAGER_MAIN_PANE_USER_SOURCES_PROPERTY:
		g_value_set_object (value, font_manager_main_pane_get_user_sources (self));
		break;
		case FONT_MANAGER_MAIN_PANE_WATERFALL_SETTINGS_PROPERTY:
		g_value_set_object (value, font_manager_main_pane_get_waterfall_settings (self));
		break;
		case FONT_MANAGER_MAIN_PANE_PREDEFINED_SIZE_PROPERTY:
		g_value_set_int (value, font_manager_main_pane_get_predefined_size (self));
		break;
		case FONT_MANAGER_MAIN_PANE_SHOW_LINE_SIZE_PROPERTY:
		g_value_set_boolean (value, font_manager_main_pane_get_show_line_size (self));
		break;
		case FONT_MANAGER_MAIN_PANE_CATEGORY_MODEL_PROPERTY:
		g_value_set_object (value, font_manager_main_pane_get_category_model (self));
		break;
		case FONT_MANAGER_MAIN_PANE_COLLECTION_MODEL_PROPERTY:
		g_value_set_object (value, font_manager_main_pane_get_collection_model (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_font_manager_main_pane_set_property (GObject * object,
                                           guint property_id,
                                           const GValue * value,
                                           GParamSpec * pspec)
{
	FontManagerMainPane * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FONT_MANAGER_TYPE_MAIN_PANE, FontManagerMainPane);
	switch (property_id) {
		case FONT_MANAGER_MAIN_PANE_AVAILABLE_FONTS_PROPERTY:
		font_manager_main_pane_set_available_fonts (self, g_value_get_boxed (value));
		break;
		case FONT_MANAGER_MAIN_PANE_DISABLED_FAMILIES_PROPERTY:
		font_manager_main_pane_set_disabled_families (self, g_value_get_object (value));
		break;
		case FONT_MANAGER_MAIN_PANE_MODE_PROPERTY:
		font_manager_main_pane_set_mode (self, g_value_get_enum (value));
		break;
		case FONT_MANAGER_MAIN_PANE_USER_ACTIONS_PROPERTY:
		font_manager_main_pane_set_user_actions (self, g_value_get_object (value));
		break;
		case FONT_MANAGER_MAIN_PANE_USER_SOURCES_PROPERTY:
		font_manager_main_pane_set_user_sources (self, g_value_get_object (value));
		break;
		case FONT_MANAGER_MAIN_PANE_WATERFALL_SETTINGS_PROPERTY:
		font_manager_main_pane_set_waterfall_settings (self, g_value_get_object (value));
		break;
		case FONT_MANAGER_MAIN_PANE_PREDEFINED_SIZE_PROPERTY:
		font_manager_main_pane_set_predefined_size (self, g_value_get_int (value));
		break;
		case FONT_MANAGER_MAIN_PANE_SHOW_LINE_SIZE_PROPERTY:
		font_manager_main_pane_set_show_line_size (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

