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

/* SPDX-License-Identifier: GPL-3.0-or-later*/

#include "graphs.h"
#include <glib.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <adwaita.h>
#include <glib/gi18n-lib.h>
#include "config.h"
#include <gtk/gtk.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

#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_bytes_unref0(var) ((var == NULL) ? NULL : (var = (g_bytes_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

/**
     * Show Graphs's about window.
     *
     * Displays the about window, fetching the changelog from whats_new
     *
     * @param application Appplication
     */
void
graphs_show_about_dialog (GraphsApplication* application)
{
	GFile* file = NULL;
	GFile* _tmp0_;
	gchar* release_notes = NULL;
	AdwAboutDialog* dialog = NULL;
	gchar* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar** _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	gchar** _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	const gchar* _tmp26_;
	gchar* _tmp27_;
	AdwAboutDialog* _tmp28_ = NULL;
	GraphsWindow* _tmp29_;
	GraphsWindow* _tmp30_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (application != NULL);
	_tmp0_ = g_file_new_for_uri ("resource:///se/sjoerd/Graphs/whats_new");
	file = _tmp0_;
	{
		GBytes* _tmp1_ = NULL;
		GBytes* _tmp2_;
		gsize _tmp3_ = 0;
		guint8* _tmp4_;
		gchar* _tmp5_;
		_tmp2_ = g_file_load_bytes (file, NULL, NULL, &_inner_error0_);
		_tmp1_ = _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp4_ = g_bytes_get_data (_tmp1_, &_tmp3_);
		_tmp5_ = g_strdup ((const gchar*) _tmp4_);
		_g_free0 (release_notes);
		release_notes = _tmp5_;
		_g_bytes_unref0 (_tmp1_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		gchar* _tmp6_;
		g_clear_error (&_inner_error0_);
		_tmp6_ = g_strdup ("");
		_g_free0 (release_notes);
		release_notes = _tmp6_;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (release_notes);
		_g_object_unref0 (file);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_tmp7_ = g_strdup (_ ("Graphs"));
	_tmp8_ = g_application_get_application_id ((GApplication*) application);
	_tmp9_ = _tmp8_;
	_tmp10_ = g_strdup (_tmp9_);
	_tmp11_ = g_strdup (HOMEPAGE_URL);
	_tmp12_ = g_strdup (AUTHOR);
	_tmp13_ = g_strdup (ISSUE_URL);
	_tmp14_ = g_application_get_version ((GApplication*) application);
	_tmp15_ = _tmp14_;
	_tmp16_ = g_strdup (_tmp15_);
	_tmp17_ = g_strdup ("Sjoerd Stendahl <contact@sjoerd.se>");
	_tmp18_ = g_strdup ("Christoph Kohnen <christoph.kohnen@disroot.org>");
	_tmp19_ = g_new0 (gchar*, 2 + 1);
	_tmp19_[0] = _tmp17_;
	_tmp19_[1] = _tmp18_;
	_tmp20_ = g_strdup ("Sjoerd Stendahl <contact@sjoerd.se>");
	_tmp21_ = g_strdup ("Christoph Kohnen <christoph.kohnen@disroot.org>");
	_tmp22_ = g_strdup ("Tobias Bernard <tbernard@gnome.org>");
	_tmp23_ = g_new0 (gchar*, 3 + 1);
	_tmp23_[0] = _tmp20_;
	_tmp23_[1] = _tmp21_;
	_tmp23_[2] = _tmp22_;
	_tmp24_ = g_strdup ("© 2022 – 2024");
	_tmp25_ = g_strdup (_ ("translator-credits"));
	_tmp26_ = release_notes;
	_tmp27_ = g_strdup (_tmp26_);
	_tmp28_ = (AdwAboutDialog*) adw_about_dialog_new ();
	adw_about_dialog_set_application_name (_tmp28_, _tmp7_);
	_g_free0 (_tmp7_);
	adw_about_dialog_set_application_icon (_tmp28_, _tmp10_);
	_g_free0 (_tmp10_);
	adw_about_dialog_set_website (_tmp28_, _tmp11_);
	_g_free0 (_tmp11_);
	adw_about_dialog_set_developer_name (_tmp28_, _tmp12_);
	_g_free0 (_tmp12_);
	adw_about_dialog_set_issue_url (_tmp28_, _tmp13_);
	_g_free0 (_tmp13_);
	adw_about_dialog_set_version (_tmp28_, _tmp16_);
	_g_free0 (_tmp16_);
	adw_about_dialog_set_developers (_tmp28_, _tmp19_);
	_tmp19_ = (_vala_array_free (_tmp19_, 2, (GDestroyNotify) g_free), NULL);
	adw_about_dialog_set_designers (_tmp28_, _tmp23_);
	_tmp23_ = (_vala_array_free (_tmp23_, 3, (GDestroyNotify) g_free), NULL);
	adw_about_dialog_set_copyright (_tmp28_, _tmp24_);
	_g_free0 (_tmp24_);
	adw_about_dialog_set_license_type (_tmp28_, GTK_LICENSE_GPL_3_0);
	adw_about_dialog_set_translator_credits (_tmp28_, _tmp25_);
	_g_free0 (_tmp25_);
	adw_about_dialog_set_release_notes (_tmp28_, _tmp27_);
	_g_free0 (_tmp27_);
	g_object_ref_sink (_tmp28_);
	dialog = _tmp28_;
	_tmp29_ = graphs_application_get_window (application);
	_tmp30_ = _tmp29_;
	adw_dialog_present ((AdwDialog*) dialog, (GtkWidget*) _tmp30_);
	_g_object_unref0 (dialog);
	_g_free0 (release_notes);
	_g_object_unref0 (file);
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

