/* screen-recorder.c generated by valac 0.56.17, the Vala compiler
 * generated from screen-recorder.vala, do not modify */

/*
Peek Copyright (c) 2016-2017 by Philipp Wolfer <ph.wolfer@gmail.com>

This file is part of Peek.

This software is licensed under the GNU General Public License
(version 3 or later). See the LICENSE file in this distribution.
*/

#include "../../application.h"
#include <glib.h>
#include <gio/gio.h>
#include <string.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  {
	PEEK_RECORDING_SCREEN_RECORDER_RECORDING_STARTED_SIGNAL,
	PEEK_RECORDING_SCREEN_RECORDER_RECORDING_POSTPROCESS_STARTED_SIGNAL,
	PEEK_RECORDING_SCREEN_RECORDER_RECORDING_FINISHED_SIGNAL,
	PEEK_RECORDING_SCREEN_RECORDER_RECORDING_ABORTED_SIGNAL,
	PEEK_RECORDING_SCREEN_RECORDER_NUM_SIGNALS
};
static guint peek_recording_screen_recorder_signals[PEEK_RECORDING_SCREEN_RECORDER_NUM_SIGNALS] = {0};

static GType peek_recording_screen_recorder_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

void
peek_recording_screen_recorder_record (PeekRecordingScreenRecorder* self,
                                       PeekRecordingRecordingArea* area,
                                       GError** error)
{
	PeekRecordingScreenRecorderIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = PEEK_RECORDING_SCREEN_RECORDER_GET_INTERFACE (self);
	if (_iface_->record) {
		_iface_->record (self, area, error);
	}
}

void
peek_recording_screen_recorder_stop (PeekRecordingScreenRecorder* self)
{
	PeekRecordingScreenRecorderIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = PEEK_RECORDING_SCREEN_RECORDER_GET_INTERFACE (self);
	if (_iface_->stop) {
		_iface_->stop (self);
	}
}

void
peek_recording_screen_recorder_cancel (PeekRecordingScreenRecorder* self)
{
	PeekRecordingScreenRecorderIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = PEEK_RECORDING_SCREEN_RECORDER_GET_INTERFACE (self);
	if (_iface_->cancel) {
		_iface_->cancel (self);
	}
}

gboolean
peek_recording_screen_recorder_get_is_recording (PeekRecordingScreenRecorder* self)
{
	PeekRecordingScreenRecorderIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = PEEK_RECORDING_SCREEN_RECORDER_GET_INTERFACE (self);
	if (_iface_->get_is_recording) {
		return _iface_->get_is_recording (self);
	}
	return FALSE;
}

void
peek_recording_screen_recorder_set_is_recording (PeekRecordingScreenRecorder* self,
                                                 gboolean value)
{
	PeekRecordingScreenRecorderIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = PEEK_RECORDING_SCREEN_RECORDER_GET_INTERFACE (self);
	if (_iface_->set_is_recording) {
		_iface_->set_is_recording (self, value);
	}
}

PeekRecordingRecordingConfig*
peek_recording_screen_recorder_get_config (PeekRecordingScreenRecorder* self)
{
	PeekRecordingScreenRecorderIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = PEEK_RECORDING_SCREEN_RECORDER_GET_INTERFACE (self);
	if (_iface_->get_config) {
		return _iface_->get_config (self);
	}
	return NULL;
}

void
peek_recording_screen_recorder_set_config (PeekRecordingScreenRecorder* self,
                                           PeekRecordingRecordingConfig* value)
{
	PeekRecordingScreenRecorderIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = PEEK_RECORDING_SCREEN_RECORDER_GET_INTERFACE (self);
	if (_iface_->set_config) {
		_iface_->set_config (self, value);
	}
}

gint64
peek_recording_screen_recorder_get_elapsed_seconds (PeekRecordingScreenRecorder* self)
{
	PeekRecordingScreenRecorderIface* _iface_;
	g_return_val_if_fail (self != NULL, 0LL);
	_iface_ = PEEK_RECORDING_SCREEN_RECORDER_GET_INTERFACE (self);
	if (_iface_->get_elapsed_seconds) {
		return _iface_->get_elapsed_seconds (self);
	}
	return -1LL;
}

static void
peek_recording_screen_recorder_default_init (PeekRecordingScreenRecorderIface * iface,
                                             gpointer iface_data)
{
	g_object_interface_install_property (iface, g_param_spec_boolean ("is-recording", "is-recording", "is-recording", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_interface_install_property (iface, g_param_spec_object ("config", "config", "config", PEEK_RECORDING_TYPE_RECORDING_CONFIG, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_interface_install_property (iface, g_param_spec_int64 ("elapsed-seconds", "elapsed-seconds", "elapsed-seconds", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	peek_recording_screen_recorder_signals[PEEK_RECORDING_SCREEN_RECORDER_RECORDING_STARTED_SIGNAL] = g_signal_new ("recording-started", PEEK_RECORDING_TYPE_SCREEN_RECORDER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	peek_recording_screen_recorder_signals[PEEK_RECORDING_SCREEN_RECORDER_RECORDING_POSTPROCESS_STARTED_SIGNAL] = g_signal_new ("recording-postprocess-started", PEEK_RECORDING_TYPE_SCREEN_RECORDER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	peek_recording_screen_recorder_signals[PEEK_RECORDING_SCREEN_RECORDER_RECORDING_FINISHED_SIGNAL] = g_signal_new ("recording-finished", PEEK_RECORDING_TYPE_SCREEN_RECORDER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, g_file_get_type ());
	peek_recording_screen_recorder_signals[PEEK_RECORDING_SCREEN_RECORDER_RECORDING_ABORTED_SIGNAL] = g_signal_new ("recording-aborted", PEEK_RECORDING_TYPE_SCREEN_RECORDER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__BOXED, G_TYPE_NONE, 1, G_TYPE_ERROR);
}

static GType
peek_recording_screen_recorder_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PeekRecordingScreenRecorderIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) peek_recording_screen_recorder_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType peek_recording_screen_recorder_type_id;
	peek_recording_screen_recorder_type_id = g_type_register_static (G_TYPE_INTERFACE, "PeekRecordingScreenRecorder", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (peek_recording_screen_recorder_type_id, G_TYPE_OBJECT);
	return peek_recording_screen_recorder_type_id;
}

GType
peek_recording_screen_recorder_get_type (void)
{
	static volatile gsize peek_recording_screen_recorder_type_id__once = 0;
	if (g_once_init_enter (&peek_recording_screen_recorder_type_id__once)) {
		GType peek_recording_screen_recorder_type_id;
		peek_recording_screen_recorder_type_id = peek_recording_screen_recorder_get_type_once ();
		g_once_init_leave (&peek_recording_screen_recorder_type_id__once, peek_recording_screen_recorder_type_id);
	}
	return peek_recording_screen_recorder_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;
}

