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

/*
 * Copyright 2025 elementary, Inc. (https://elementary.io)
 * SPDX-License-Identifier: LGPL-3.0-or-later
 */

#include "granite-7.h"
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <gio/gio.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 TYPE_DEMO_PAGE (demo_page_get_type ())
#define DEMO_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DEMO_PAGE, DemoPage))
#define DEMO_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DEMO_PAGE, DemoPageClass))
#define IS_DEMO_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DEMO_PAGE))
#define IS_DEMO_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DEMO_PAGE))
#define DEMO_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DEMO_PAGE, DemoPageClass))

typedef struct _DemoPage DemoPage;
typedef struct _DemoPageClass DemoPageClass;
typedef struct _DemoPagePrivate DemoPagePrivate;

#define TYPE_VIDEO_VIEW (video_view_get_type ())
#define VIDEO_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_VIDEO_VIEW, VideoView))
#define VIDEO_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_VIDEO_VIEW, VideoViewClass))
#define IS_VIDEO_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_VIDEO_VIEW))
#define IS_VIDEO_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_VIDEO_VIEW))
#define VIDEO_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_VIDEO_VIEW, VideoViewClass))

typedef struct _VideoView VideoView;
typedef struct _VideoViewClass VideoViewClass;
typedef struct _VideoViewPrivate VideoViewPrivate;
enum  {
	VIDEO_VIEW_0_PROPERTY,
	VIDEO_VIEW_NUM_PROPERTIES
};
static GParamSpec* video_view_properties[VIDEO_VIEW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _DemoPage {
	GraniteToolBox parent_instance;
	DemoPagePrivate * priv;
};

struct _DemoPageClass {
	GraniteToolBoxClass parent_class;
};

struct _VideoView {
	DemoPage parent_instance;
	VideoViewPrivate * priv;
};

struct _VideoViewClass {
	DemoPageClass parent_class;
};

static gpointer video_view_parent_class = NULL;

VALA_EXTERN GType demo_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DemoPage, g_object_unref)
VALA_EXTERN GType video_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (VideoView, g_object_unref)
VALA_EXTERN VideoView* video_view_new (void);
VALA_EXTERN VideoView* video_view_construct (GType object_type);
VALA_EXTERN DemoPage* demo_page_new (void);
VALA_EXTERN DemoPage* demo_page_construct (GType object_type);
static GObject * video_view_constructor (GType type,
                                  guint n_construct_properties,
                                  GObjectConstructParam * construct_properties);
VALA_EXTERN void demo_page_set_title (DemoPage* self,
                          const gchar* value);
VALA_EXTERN void demo_page_set_child (DemoPage* self,
                          GtkWidget* value);
static GType video_view_get_type_once (void);

VideoView*
video_view_construct (GType object_type)
{
	VideoView * self = NULL;
	self = (VideoView*) demo_page_construct (object_type);
	return self;
}

VideoView*
video_view_new (void)
{
	return video_view_construct (TYPE_VIDEO_VIEW);
}

static GObject *
video_view_constructor (GType type,
                        guint n_construct_properties,
                        GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	VideoView * self;
	GtkVideo* video = NULL;
	GFile* _tmp0_;
	GtkVideo* _tmp1_ = NULL;
	GtkVideo* _tmp2_;
	GtkVideo* _tmp3_;
	parent_class = G_OBJECT_CLASS (video_view_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_VIDEO_VIEW, VideoView);
	demo_page_set_title ((DemoPage*) self, "Video");
	_tmp0_ = g_file_new_for_uri ("https://download.blender.org/peach/trailer/trailer_400p.ogg");
	_tmp1_ = (GtkVideo*) gtk_video_new ();
	gtk_video_set_file (_tmp1_, _tmp0_);
	_g_object_unref0 (_tmp0_);
	gtk_video_set_loop (_tmp1_, TRUE);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp1_, 12);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp1_, 12);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp1_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp1_, 12);
	gtk_widget_set_overflow ((GtkWidget*) _tmp1_, GTK_OVERFLOW_HIDDEN);
	g_object_ref_sink (_tmp1_);
	video = _tmp1_;
	_tmp2_ = video;
	gtk_widget_add_css_class ((GtkWidget*) _tmp2_, GRANITE_CSS_CLASS_CARD);
	_tmp3_ = video;
	demo_page_set_child ((DemoPage*) self, (GtkWidget*) _tmp3_);
	_g_object_unref0 (video);
	return obj;
}

static void
video_view_class_init (VideoViewClass * klass,
                       gpointer klass_data)
{
	video_view_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = video_view_constructor;
}

static void
video_view_instance_init (VideoView * self,
                          gpointer klass)
{
}

static GType
video_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (VideoViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) video_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (VideoView), 0, (GInstanceInitFunc) video_view_instance_init, NULL };
	GType video_view_type_id;
	video_view_type_id = g_type_register_static (TYPE_DEMO_PAGE, "VideoView", &g_define_type_info, 0);
	return video_view_type_id;
}

GType
video_view_get_type (void)
{
	static volatile gsize video_view_type_id__once = 0;
	if (g_once_init_enter (&video_view_type_id__once)) {
		GType video_view_type_id;
		video_view_type_id = video_view_get_type_once ();
		g_once_init_leave (&video_view_type_id__once, video_view_type_id);
	}
	return video_view_type_id__once;
}

