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

/*
* Copyright (c) 2014-2017 elementary LLC. (https://github.com/elementary/photos)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 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., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/

#include "io.elementary.photos.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.h>
#include <gee.h>
#include <glib-object.h>
#include <glib/gi18n-lib.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	LIBRARY_VIDEOS_ENTRY_0_PROPERTY,
	LIBRARY_VIDEOS_ENTRY_NUM_PROPERTIES
};
static GParamSpec* library_videos_entry_properties[LIBRARY_VIDEOS_ENTRY_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define LIBRARY_VIDEOS_PAGE_TYPE_VIDEOS_SEARCH_VIEW_FILTER (library_videos_page_videos_search_view_filter_get_type ())
#define LIBRARY_VIDEOS_PAGE_VIDEOS_SEARCH_VIEW_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LIBRARY_VIDEOS_PAGE_TYPE_VIDEOS_SEARCH_VIEW_FILTER, LibraryVideosPageVideosSearchViewFilter))
#define LIBRARY_VIDEOS_PAGE_VIDEOS_SEARCH_VIEW_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LIBRARY_VIDEOS_PAGE_TYPE_VIDEOS_SEARCH_VIEW_FILTER, LibraryVideosPageVideosSearchViewFilterClass))
#define LIBRARY_VIDEOS_PAGE_IS_VIDEOS_SEARCH_VIEW_FILTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LIBRARY_VIDEOS_PAGE_TYPE_VIDEOS_SEARCH_VIEW_FILTER))
#define LIBRARY_VIDEOS_PAGE_IS_VIDEOS_SEARCH_VIEW_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LIBRARY_VIDEOS_PAGE_TYPE_VIDEOS_SEARCH_VIEW_FILTER))
#define LIBRARY_VIDEOS_PAGE_VIDEOS_SEARCH_VIEW_FILTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LIBRARY_VIDEOS_PAGE_TYPE_VIDEOS_SEARCH_VIEW_FILTER, LibraryVideosPageVideosSearchViewFilterClass))

typedef struct _LibraryVideosPageVideosSearchViewFilter LibraryVideosPageVideosSearchViewFilter;
typedef struct _LibraryVideosPageVideosSearchViewFilterClass LibraryVideosPageVideosSearchViewFilterClass;
enum  {
	LIBRARY_VIDEOS_PAGE_0_PROPERTY,
	LIBRARY_VIDEOS_PAGE_NUM_PROPERTIES
};
static GParamSpec* library_videos_page_properties[LIBRARY_VIDEOS_PAGE_NUM_PROPERTIES];
#define _view_manager_unref0(var) ((var == NULL) ? NULL : (var = (view_manager_unref (var), NULL)))
#define _view_filter_unref0(var) ((var == NULL) ? NULL : (var = (view_filter_unref (var), NULL)))

#define LIBRARY_VIDEOS_PAGE_TYPE_VIDEOS_VIEW_MANAGER (library_videos_page_videos_view_manager_get_type ())
#define LIBRARY_VIDEOS_PAGE_VIDEOS_VIEW_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LIBRARY_VIDEOS_PAGE_TYPE_VIDEOS_VIEW_MANAGER, LibraryVideosPageVideosViewManager))
#define LIBRARY_VIDEOS_PAGE_VIDEOS_VIEW_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LIBRARY_VIDEOS_PAGE_TYPE_VIDEOS_VIEW_MANAGER, LibraryVideosPageVideosViewManagerClass))
#define LIBRARY_VIDEOS_PAGE_IS_VIDEOS_VIEW_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LIBRARY_VIDEOS_PAGE_TYPE_VIDEOS_VIEW_MANAGER))
#define LIBRARY_VIDEOS_PAGE_IS_VIDEOS_VIEW_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LIBRARY_VIDEOS_PAGE_TYPE_VIDEOS_VIEW_MANAGER))
#define LIBRARY_VIDEOS_PAGE_VIDEOS_VIEW_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LIBRARY_VIDEOS_PAGE_TYPE_VIDEOS_VIEW_MANAGER, LibraryVideosPageVideosViewManagerClass))

typedef struct _LibraryVideosPageVideosViewManager LibraryVideosPageVideosViewManager;
typedef struct _LibraryVideosPageVideosViewManagerClass LibraryVideosPageVideosViewManagerClass;
#define _media_collection_registry_unref0(var) ((var == NULL) ? NULL : (var = (media_collection_registry_unref (var), NULL)))
#define _view_collection_monitor_unref0(var) ((var == NULL) ? NULL : (var = (view_collection_monitor_unref (var), NULL)))
#define _data_collection_unref0(var) ((var == NULL) ? NULL : (var = (data_collection_unref (var), NULL)))
typedef struct _LibraryVideosPageVideosViewManagerPrivate LibraryVideosPageVideosViewManagerPrivate;
typedef struct _LibraryVideosPageVideosSearchViewFilterPrivate LibraryVideosPageVideosSearchViewFilterPrivate;

struct _LibraryVideosPagePrivate {
	ViewManager* view_manager;
	LibraryVideosPageVideosSearchViewFilter* search_filter;
};

struct _LibraryVideosPageVideosViewManager {
	CollectionViewManager parent_instance;
	LibraryVideosPageVideosViewManagerPrivate * priv;
};

struct _LibraryVideosPageVideosViewManagerClass {
	CollectionViewManagerClass parent_class;
};

struct _LibraryVideosPageVideosSearchViewFilter {
	CollectionPageCollectionSearchViewFilter parent_instance;
	LibraryVideosPageVideosSearchViewFilterPrivate * priv;
};

struct _LibraryVideosPageVideosSearchViewFilterClass {
	CollectionPageCollectionSearchViewFilterClass parent_class;
};

static gpointer library_videos_entry_parent_class = NULL;
static gint LibraryVideosPage_private_offset;
static gpointer library_videos_page_parent_class = NULL;
static gpointer library_videos_page_videos_view_manager_parent_class = NULL;
static gpointer library_videos_page_videos_search_view_filter_parent_class = NULL;

static void library_videos_entry_on_item_altered (LibraryVideosEntry* self,
                                           GeeIterable* items);
static void _library_videos_entry_on_item_altered_data_collection_items_added (DataCollection* _sender,
                                                                        GeeIterable* added,
                                                                        gpointer self);
static void _library_videos_entry_on_item_altered_data_collection_items_removed (DataCollection* _sender,
                                                                          GeeIterable* removed,
                                                                          gpointer self);
static gboolean library_videos_entry_has_video (LibraryVideosEntry* self);
static gchar* library_videos_entry_real_get_sidebar_name (SidebarSimplePageEntry* base);
static GIcon* library_videos_entry_real_get_sidebar_icon (SidebarSimplePageEntry* base);
static Page* library_videos_entry_real_create_page (SidebarSimplePageEntry* base);
static void library_videos_entry_finalize (GObject * obj);
static GType library_videos_entry_get_type_once (void);
static GType library_videos_page_videos_search_view_filter_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static LibraryVideosPageVideosSearchViewFilter* library_videos_page_videos_search_view_filter_new (void);
static LibraryVideosPageVideosSearchViewFilter* library_videos_page_videos_search_view_filter_construct (GType object_type);
static LibraryVideosPageVideosViewManager* library_videos_page_videos_view_manager_new (LibraryVideosPage* owner);
static LibraryVideosPageVideosViewManager* library_videos_page_videos_view_manager_construct (GType object_type,
                                                                                       LibraryVideosPage* owner);
static GType library_videos_page_videos_view_manager_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static SearchViewFilter* library_videos_page_real_get_search_view_filter (CheckerboardPage* base);
static gboolean library_videos_page_videos_view_manager_real_include_in_view (ViewManager* base,
                                                                       DataSource* source);
static GType library_videos_page_videos_view_manager_get_type_once (void);
static guint library_videos_page_videos_search_view_filter_real_get_criteria (SearchViewFilter* base);
static GType library_videos_page_videos_search_view_filter_get_type_once (void);
static void library_videos_page_finalize (GObject * obj);
static GType library_videos_page_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static void
_library_videos_entry_on_item_altered_data_collection_items_added (DataCollection* _sender,
                                                                   GeeIterable* added,
                                                                   gpointer self)
{
	library_videos_entry_on_item_altered ((LibraryVideosEntry*) self, added);
}

static void
_library_videos_entry_on_item_altered_data_collection_items_removed (DataCollection* _sender,
                                                                     GeeIterable* removed,
                                                                     gpointer self)
{
	library_videos_entry_on_item_altered ((LibraryVideosEntry*) self, removed);
}

LibraryVideosEntry*
library_videos_entry_construct (GType object_type)
{
	LibraryVideosEntry * self = NULL;
	VideoSourceCollection* _tmp0_;
	VideoSourceCollection* _tmp1_;
	self = (LibraryVideosEntry*) library_hideable_page_entry_construct (object_type);
	_tmp0_ = video_global;
	g_signal_connect_object ((DataCollection*) _tmp0_, "items-added", (GCallback) _library_videos_entry_on_item_altered_data_collection_items_added, self, 0);
	_tmp1_ = video_global;
	g_signal_connect_object ((DataCollection*) _tmp1_, "items-removed", (GCallback) _library_videos_entry_on_item_altered_data_collection_items_removed, self, 0);
	library_hideable_page_entry_set_visible ((LibraryHideablePageEntry*) self, library_videos_entry_has_video (self));
	return self;
}

LibraryVideosEntry*
library_videos_entry_new (void)
{
	return library_videos_entry_construct (LIBRARY_TYPE_VIDEOS_ENTRY);
}

static gchar*
library_videos_entry_real_get_sidebar_name (SidebarSimplePageEntry* base)
{
	LibraryVideosEntry * self;
	gchar* _tmp0_;
	gchar* result;
	self = (LibraryVideosEntry*) base;
	_tmp0_ = g_strdup (_ ("Videos"));
	result = _tmp0_;
	return result;
}

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

static GIcon*
library_videos_entry_real_get_sidebar_icon (SidebarSimplePageEntry* base)
{
	LibraryVideosEntry * self;
	GIcon* _tmp0_;
	GIcon* _tmp1_;
	GIcon* result;
	self = (LibraryVideosEntry*) base;
	_tmp0_ = self->icon;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static Page*
library_videos_entry_real_create_page (SidebarSimplePageEntry* base)
{
	LibraryVideosEntry * self;
	LibraryVideosPage* _tmp0_;
	Page* result;
	self = (LibraryVideosEntry*) base;
	_tmp0_ = library_videos_page_new (NULL, NULL);
	g_object_ref_sink (_tmp0_);
	result = (Page*) _tmp0_;
	return result;
}

static gboolean
library_videos_entry_has_video (LibraryVideosEntry* self)
{
	VideoSourceCollection* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = video_global;
	result = data_collection_get_count ((DataCollection*) _tmp0_) > 0;
	return result;
}

static void
library_videos_entry_on_item_altered (LibraryVideosEntry* self,
                                      GeeIterable* items)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (items != NULL);
	library_hideable_page_entry_set_visible ((LibraryHideablePageEntry*) self, library_videos_entry_has_video (self));
}

static void
library_videos_entry_class_init (LibraryVideosEntryClass * klass,
                                 gpointer klass_data)
{
	library_videos_entry_parent_class = g_type_class_peek_parent (klass);
	((SidebarSimplePageEntryClass *) klass)->get_sidebar_name = (gchar* (*) (SidebarSimplePageEntry*)) library_videos_entry_real_get_sidebar_name;
	((SidebarSimplePageEntryClass *) klass)->get_sidebar_icon = (GIcon* (*) (SidebarSimplePageEntry*)) library_videos_entry_real_get_sidebar_icon;
	((SidebarSimplePageEntryClass *) klass)->create_page = (Page* (*) (SidebarSimplePageEntry*)) library_videos_entry_real_create_page;
	G_OBJECT_CLASS (klass)->finalize = library_videos_entry_finalize;
}

static void
library_videos_entry_instance_init (LibraryVideosEntry * self,
                                    gpointer klass)
{
	GThemedIcon* _tmp0_;
	_tmp0_ = (GThemedIcon*) g_themed_icon_new (RESOURCES_ICON_VIDEOS_PAGE);
	self->icon = (GIcon*) _tmp0_;
}

static void
library_videos_entry_finalize (GObject * obj)
{
	LibraryVideosEntry * self;
	VideoSourceCollection* _tmp0_;
	guint _tmp1_;
	VideoSourceCollection* _tmp2_;
	guint _tmp3_;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIBRARY_TYPE_VIDEOS_ENTRY, LibraryVideosEntry);
	_tmp0_ = video_global;
	g_signal_parse_name ("items-added", TYPE_DATA_COLLECTION, &_tmp1_, NULL, FALSE);
	g_signal_handlers_disconnect_matched ((DataCollection*) _tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _library_videos_entry_on_item_altered_data_collection_items_added, self);
	_tmp2_ = video_global;
	g_signal_parse_name ("items-removed", TYPE_DATA_COLLECTION, &_tmp3_, NULL, FALSE);
	g_signal_handlers_disconnect_matched ((DataCollection*) _tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _library_videos_entry_on_item_altered_data_collection_items_removed, self);
	_g_object_unref0 (self->icon);
	G_OBJECT_CLASS (library_videos_entry_parent_class)->finalize (obj);
}

static GType
library_videos_entry_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (LibraryVideosEntryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) library_videos_entry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LibraryVideosEntry), 0, (GInstanceInitFunc) library_videos_entry_instance_init, NULL };
	GType library_videos_entry_type_id;
	library_videos_entry_type_id = g_type_register_static (LIBRARY_TYPE_HIDEABLE_PAGE_ENTRY, "LibraryVideosEntry", &g_define_type_info, 0);
	return library_videos_entry_type_id;
}

GType
library_videos_entry_get_type (void)
{
	static volatile gsize library_videos_entry_type_id__once = 0;
	if (g_once_init_enter (&library_videos_entry_type_id__once)) {
		GType library_videos_entry_type_id;
		library_videos_entry_type_id = library_videos_entry_get_type_once ();
		g_once_init_leave (&library_videos_entry_type_id__once, library_videos_entry_type_id);
	}
	return library_videos_entry_type_id__once;
}

static inline gpointer
library_videos_page_get_instance_private (LibraryVideosPage* self)
{
	return G_STRUCT_MEMBER_P (self, LibraryVideosPage_private_offset);
}

LibraryVideosPage*
library_videos_page_construct (GType object_type,
                               ProgressMonitor monitor,
                               gpointer monitor_target)
{
	LibraryVideosPage * self = NULL;
	LibraryVideosPageVideosViewManager* _tmp0_;
	self = (LibraryVideosPage*) collection_page_construct (object_type, LIBRARY_VIDEOS_PAGE_NAME);
	_tmp0_ = library_videos_page_videos_view_manager_new (self);
	_view_manager_unref0 (self->priv->view_manager);
	self->priv->view_manager = (ViewManager*) _tmp0_;
	{
		GeeIterator* _sources_it = NULL;
		MediaCollectionRegistry* _tmp1_;
		MediaCollectionRegistry* _tmp2_;
		GeeCollection* _tmp3_;
		GeeCollection* _tmp4_;
		GeeIterator* _tmp5_;
		GeeIterator* _tmp6_;
		_tmp1_ = media_collection_registry_get_instance ();
		_tmp2_ = _tmp1_;
		_tmp3_ = media_collection_registry_get_all (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_media_collection_registry_unref0 (_tmp2_);
		_sources_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_;
			MediaSourceCollection* sources = NULL;
			GeeIterator* _tmp8_;
			gpointer _tmp9_;
			ViewCollection* _tmp10_;
			ViewCollection* _tmp11_;
			MediaSourceCollection* _tmp12_;
			ViewManager* _tmp13_;
			ViewCollectionMonitor* _tmp14_;
			ViewCollectionMonitor* _tmp15_;
			_tmp7_ = _sources_it;
			if (!gee_iterator_next (_tmp7_)) {
				break;
			}
			_tmp8_ = _sources_it;
			_tmp9_ = gee_iterator_get (_tmp8_);
			sources = (MediaSourceCollection*) _tmp9_;
			_tmp10_ = page_get_view ((Page*) self);
			_tmp11_ = _tmp10_;
			_tmp12_ = sources;
			_tmp13_ = self->priv->view_manager;
			_tmp14_ = view_collection_monitor_source_collection (_tmp11_, (SourceCollection*) _tmp12_, _tmp13_, NULL, NULL, monitor, monitor_target);
			_tmp15_ = _tmp14_;
			_view_collection_monitor_unref0 (_tmp15_);
			_data_collection_unref0 (_tmp11_);
			_data_collection_unref0 (sources);
		}
		_g_object_unref0 (_sources_it);
	}
	return self;
}

LibraryVideosPage*
library_videos_page_new (ProgressMonitor monitor,
                         gpointer monitor_target)
{
	return library_videos_page_construct (LIBRARY_TYPE_VIDEOS_PAGE, monitor, monitor_target);
}

static gpointer
_view_filter_ref0 (gpointer self)
{
	return self ? view_filter_ref (self) : NULL;
}

static SearchViewFilter*
library_videos_page_real_get_search_view_filter (CheckerboardPage* base)
{
	LibraryVideosPage * self;
	LibraryVideosPageVideosSearchViewFilter* _tmp0_;
	SearchViewFilter* _tmp1_;
	SearchViewFilter* result;
	self = (LibraryVideosPage*) base;
	_tmp0_ = self->priv->search_filter;
	_tmp1_ = _view_filter_ref0 ((SearchViewFilter*) _tmp0_);
	result = _tmp1_;
	return result;
}

static LibraryVideosPageVideosViewManager*
library_videos_page_videos_view_manager_construct (GType object_type,
                                                   LibraryVideosPage* owner)
{
	LibraryVideosPageVideosViewManager* self = NULL;
	g_return_val_if_fail (owner != NULL, NULL);
	self = (LibraryVideosPageVideosViewManager*) collection_view_manager_construct (object_type, (CollectionPage*) owner);
	return self;
}

static LibraryVideosPageVideosViewManager*
library_videos_page_videos_view_manager_new (LibraryVideosPage* owner)
{
	return library_videos_page_videos_view_manager_construct (LIBRARY_VIDEOS_PAGE_TYPE_VIDEOS_VIEW_MANAGER, owner);
}

static gboolean
library_videos_page_videos_view_manager_real_include_in_view (ViewManager* base,
                                                              DataSource* source)
{
	LibraryVideosPageVideosViewManager * self;
	gboolean result;
	self = (LibraryVideosPageVideosViewManager*) base;
	g_return_val_if_fail (source != NULL, FALSE);
	result = IS_VIDEO (source);
	return result;
}

static void
library_videos_page_videos_view_manager_class_init (LibraryVideosPageVideosViewManagerClass * klass,
                                                    gpointer klass_data)
{
	library_videos_page_videos_view_manager_parent_class = g_type_class_peek_parent (klass);
	((ViewManagerClass *) klass)->include_in_view = (gboolean (*) (ViewManager*, DataSource*)) library_videos_page_videos_view_manager_real_include_in_view;
}

static void
library_videos_page_videos_view_manager_instance_init (LibraryVideosPageVideosViewManager * self,
                                                       gpointer klass)
{
}

static GType
library_videos_page_videos_view_manager_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (LibraryVideosPageVideosViewManagerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) library_videos_page_videos_view_manager_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LibraryVideosPageVideosViewManager), 0, (GInstanceInitFunc) library_videos_page_videos_view_manager_instance_init, NULL };
	GType library_videos_page_videos_view_manager_type_id;
	library_videos_page_videos_view_manager_type_id = g_type_register_static (TYPE_COLLECTION_VIEW_MANAGER, "LibraryVideosPageVideosViewManager", &g_define_type_info, 0);
	return library_videos_page_videos_view_manager_type_id;
}

static GType
library_videos_page_videos_view_manager_get_type (void)
{
	static volatile gsize library_videos_page_videos_view_manager_type_id__once = 0;
	if (g_once_init_enter (&library_videos_page_videos_view_manager_type_id__once)) {
		GType library_videos_page_videos_view_manager_type_id;
		library_videos_page_videos_view_manager_type_id = library_videos_page_videos_view_manager_get_type_once ();
		g_once_init_leave (&library_videos_page_videos_view_manager_type_id__once, library_videos_page_videos_view_manager_type_id);
	}
	return library_videos_page_videos_view_manager_type_id__once;
}

static guint
library_videos_page_videos_search_view_filter_real_get_criteria (SearchViewFilter* base)
{
	LibraryVideosPageVideosSearchViewFilter * self;
	guint result;
	self = (LibraryVideosPageVideosSearchViewFilter*) base;
	result = (guint) (SEARCH_FILTER_CRITERIA_TEXT | SEARCH_FILTER_CRITERIA_MEDIA);
	return result;
}

static LibraryVideosPageVideosSearchViewFilter*
library_videos_page_videos_search_view_filter_construct (GType object_type)
{
	LibraryVideosPageVideosSearchViewFilter* self = NULL;
	self = (LibraryVideosPageVideosSearchViewFilter*) collection_page_collection_search_view_filter_construct (object_type);
	return self;
}

static LibraryVideosPageVideosSearchViewFilter*
library_videos_page_videos_search_view_filter_new (void)
{
	return library_videos_page_videos_search_view_filter_construct (LIBRARY_VIDEOS_PAGE_TYPE_VIDEOS_SEARCH_VIEW_FILTER);
}

static void
library_videos_page_videos_search_view_filter_class_init (LibraryVideosPageVideosSearchViewFilterClass * klass,
                                                          gpointer klass_data)
{
	library_videos_page_videos_search_view_filter_parent_class = g_type_class_peek_parent (klass);
	((SearchViewFilterClass *) klass)->get_criteria = (guint (*) (SearchViewFilter*)) library_videos_page_videos_search_view_filter_real_get_criteria;
}

static void
library_videos_page_videos_search_view_filter_instance_init (LibraryVideosPageVideosSearchViewFilter * self,
                                                             gpointer klass)
{
}

static GType
library_videos_page_videos_search_view_filter_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (LibraryVideosPageVideosSearchViewFilterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) library_videos_page_videos_search_view_filter_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LibraryVideosPageVideosSearchViewFilter), 0, (GInstanceInitFunc) library_videos_page_videos_search_view_filter_instance_init, NULL };
	GType library_videos_page_videos_search_view_filter_type_id;
	library_videos_page_videos_search_view_filter_type_id = g_type_register_static (COLLECTION_PAGE_TYPE_COLLECTION_SEARCH_VIEW_FILTER, "LibraryVideosPageVideosSearchViewFilter", &g_define_type_info, 0);
	return library_videos_page_videos_search_view_filter_type_id;
}

static GType
library_videos_page_videos_search_view_filter_get_type (void)
{
	static volatile gsize library_videos_page_videos_search_view_filter_type_id__once = 0;
	if (g_once_init_enter (&library_videos_page_videos_search_view_filter_type_id__once)) {
		GType library_videos_page_videos_search_view_filter_type_id;
		library_videos_page_videos_search_view_filter_type_id = library_videos_page_videos_search_view_filter_get_type_once ();
		g_once_init_leave (&library_videos_page_videos_search_view_filter_type_id__once, library_videos_page_videos_search_view_filter_type_id);
	}
	return library_videos_page_videos_search_view_filter_type_id__once;
}

static void
library_videos_page_class_init (LibraryVideosPageClass * klass,
                                gpointer klass_data)
{
	library_videos_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &LibraryVideosPage_private_offset);
	((CheckerboardPageClass *) klass)->get_search_view_filter = (SearchViewFilter* (*) (CheckerboardPage*)) library_videos_page_real_get_search_view_filter;
	G_OBJECT_CLASS (klass)->finalize = library_videos_page_finalize;
}

static void
library_videos_page_instance_init (LibraryVideosPage * self,
                                   gpointer klass)
{
	LibraryVideosPageVideosSearchViewFilter* _tmp0_;
	self->priv = library_videos_page_get_instance_private (self);
	_tmp0_ = library_videos_page_videos_search_view_filter_new ();
	self->priv->search_filter = _tmp0_;
}

static void
library_videos_page_finalize (GObject * obj)
{
	LibraryVideosPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIBRARY_TYPE_VIDEOS_PAGE, LibraryVideosPage);
	_view_manager_unref0 (self->priv->view_manager);
	_view_filter_unref0 (self->priv->search_filter);
	G_OBJECT_CLASS (library_videos_page_parent_class)->finalize (obj);
}

static GType
library_videos_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (LibraryVideosPageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) library_videos_page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LibraryVideosPage), 0, (GInstanceInitFunc) library_videos_page_instance_init, NULL };
	GType library_videos_page_type_id;
	library_videos_page_type_id = g_type_register_static (TYPE_COLLECTION_PAGE, "LibraryVideosPage", &g_define_type_info, 0);
	LibraryVideosPage_private_offset = g_type_add_instance_private (library_videos_page_type_id, sizeof (LibraryVideosPagePrivate));
	return library_videos_page_type_id;
}

GType
library_videos_page_get_type (void)
{
	static volatile gsize library_videos_page_type_id__once = 0;
	if (g_once_init_enter (&library_videos_page_type_id__once)) {
		GType library_videos_page_type_id;
		library_videos_page_type_id = library_videos_page_get_type_once ();
		g_once_init_leave (&library_videos_page_type_id__once, library_videos_page_type_id);
	}
	return library_videos_page_type_id__once;
}

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

