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

/*
 *  Copyright (c) 2009-2010 Mike Massonnet <mmassonnet@xfce.org>
 *  Copyright (c) 2009-2010 Vincent Legout <vincent@xfce.org>
 *
 *  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 2 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 "xfmpc.h"
#include <src/libc/mpdclient.h>
#include <glib-object.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <libxfce4ui/libxfce4ui.h>
#include <pango/pango.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  {
	XFMPC_SONG_DIALOG_0_PROPERTY,
	XFMPC_SONG_DIALOG_NUM_PROPERTIES
};
static GParamSpec* xfmpc_song_dialog_properties[XFMPC_SONG_DIALOG_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _pango_attr_list_unref0(var) ((var == NULL) ? NULL : (var = (pango_attr_list_unref (var), NULL)))

struct _XfmpcSongDialogPrivate {
	XfmpcMpdclient* mpdclient;
	XfmpcSongInfo* song;
};

static gint XfmpcSongDialog_private_offset;
static gpointer xfmpc_song_dialog_parent_class = NULL;

static void xfmpc_song_dialog_cb_response (XfmpcSongDialog* self,
                                    gint response);
static void _xfmpc_song_dialog_cb_response_gtk_dialog_response (GtkDialog* _sender,
                                                         gint response_id,
                                                         gpointer self);
static void xfmpc_song_dialog_finalize (GObject * obj);
static GType xfmpc_song_dialog_get_type_once (void);

static inline gpointer
xfmpc_song_dialog_get_instance_private (XfmpcSongDialog* self)
{
	return G_STRUCT_MEMBER_P (self, XfmpcSongDialog_private_offset);
}

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

static void
_xfmpc_song_dialog_cb_response_gtk_dialog_response (GtkDialog* _sender,
                                                    gint response_id,
                                                    gpointer self)
{
	xfmpc_song_dialog_cb_response ((XfmpcSongDialog*) self, response_id);
}

XfmpcSongDialog*
xfmpc_song_dialog_construct (GType object_type,
                             gint song_id)
{
	XfmpcSongDialog * self = NULL;
	XfmpcMpdclient* _tmp0_;
	XfmpcMpdclient* _tmp1_;
	XfmpcSongInfo* _tmp2_;
	XfmpcSongInfo* _tmp3_;
	const gchar* _tmp4_;
	GtkBox* _tmp5_;
	GtkBox* vbox2 = NULL;
	GtkBox* _tmp6_;
	GtkWidget* frame = NULL;
	GtkWidget* _tmp7_;
	GtkWidget* _tmp8_;
	PangoAttrList* attrs = NULL;
	PangoAttrList* _tmp9_;
	PangoAttribute* _tmp10_;
	GtkBox* hbox = NULL;
	GtkBox* _tmp11_;
	GtkLabel* label = NULL;
	GtkLabel* _tmp12_;
	GtkLabel* _tmp13_;
	GtkBox* _tmp14_;
	GtkLabel* _tmp15_;
	XfmpcSongInfo* _tmp16_;
	const gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	GtkLabel* _tmp20_;
	GtkBox* _tmp21_;
	GtkLabel* _tmp22_;
	GtkBox* _tmp23_;
	GtkBox* _tmp24_;
	GtkLabel* _tmp25_;
	GtkLabel* _tmp26_;
	GtkBox* _tmp27_;
	GtkLabel* _tmp28_;
	XfmpcSongInfo* _tmp29_;
	const gchar* _tmp30_;
	GtkLabel* _tmp31_;
	GtkBox* _tmp32_;
	GtkLabel* _tmp33_;
	GtkBox* _tmp34_;
	GtkBox* _tmp35_;
	GtkLabel* _tmp36_;
	GtkLabel* _tmp37_;
	GtkBox* _tmp38_;
	GtkLabel* _tmp39_;
	XfmpcSongInfo* _tmp40_;
	const gchar* _tmp41_;
	GtkLabel* _tmp42_;
	GtkBox* _tmp43_;
	GtkLabel* _tmp44_;
	GtkBox* _tmp45_;
	GtkBox* _tmp46_;
	GtkLabel* _tmp47_;
	GtkLabel* _tmp48_;
	GtkBox* _tmp49_;
	GtkLabel* _tmp50_;
	XfmpcSongInfo* _tmp51_;
	const gchar* _tmp52_;
	GtkLabel* _tmp53_;
	GtkBox* _tmp54_;
	GtkLabel* _tmp55_;
	GtkBox* _tmp56_;
	GtkBox* _tmp57_;
	GtkLabel* _tmp58_;
	GtkLabel* _tmp59_;
	GtkBox* _tmp60_;
	GtkLabel* _tmp61_;
	XfmpcSongInfo* _tmp62_;
	const gchar* _tmp63_;
	GtkLabel* _tmp64_;
	GtkBox* _tmp65_;
	GtkLabel* _tmp66_;
	GtkLabel* _tmp67_;
	GtkLabel* _tmp68_;
	GtkBox* _tmp69_;
	GtkLabel* _tmp70_;
	XfmpcSongInfo* _tmp71_;
	const gchar* _tmp72_;
	GtkLabel* _tmp73_;
	GtkBox* _tmp74_;
	GtkLabel* _tmp75_;
	GtkBox* _tmp76_;
	GtkBox* _tmp77_;
	GtkLabel* _tmp78_;
	GtkLabel* _tmp79_;
	GtkBox* _tmp80_;
	GtkLabel* _tmp81_;
	XfmpcSongInfo* _tmp82_;
	const gchar* _tmp83_;
	GtkLabel* _tmp84_;
	GtkBox* _tmp85_;
	GtkLabel* _tmp86_;
	GtkBox* _tmp87_;
	GtkBox* _tmp88_;
	GtkDialog* dialog = NULL;
	GtkDialog* _tmp89_;
	self = (XfmpcSongDialog*) g_object_new (object_type, NULL);
	gtk_window_set_skip_taskbar_hint ((GtkWindow*) self, TRUE);
	gtk_window_set_icon_name ((GtkWindow*) self, "multimedia-player");
	gtk_window_set_resizable ((GtkWindow*) self, FALSE);
	_tmp0_ = xfmpc_mpdclient_get_default ();
	self->priv->mpdclient = _tmp0_;
	_tmp1_ = self->priv->mpdclient;
	_tmp2_ = xfmpc_mpdclient_get_song_info (_tmp1_, song_id);
	self->priv->song = _tmp2_;
	_tmp3_ = self->priv->song;
	_tmp4_ = _tmp3_->title;
	gtk_window_set_title ((GtkWindow*) self, _tmp4_);
	_tmp5_ = gtk_dialog_get_content_area ((GtkDialog*) self);
	gtk_box_set_spacing (_tmp5_, 0);
	_tmp6_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp6_);
	vbox2 = _tmp6_;
	_tmp7_ = xfce_gtk_frame_box_new_with_content ("", (GtkWidget*) vbox2);
	_tmp8_ = _g_object_ref0 (_tmp7_);
	frame = _tmp8_;
	_tmp9_ = pango_attr_list_new ();
	attrs = _tmp9_;
	_tmp10_ = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
	pango_attr_list_insert (attrs, _tmp10_);
	_tmp11_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp11_);
	hbox = _tmp11_;
	_tmp12_ = (GtkLabel*) gtk_label_new (_ ("File"));
	g_object_ref_sink (_tmp12_);
	label = _tmp12_;
	_tmp13_ = label;
	gtk_label_set_attributes (_tmp13_, attrs);
	_tmp14_ = hbox;
	_tmp15_ = label;
	gtk_box_pack_start (_tmp14_, (GtkWidget*) _tmp15_, FALSE, FALSE, (guint) 5);
	_tmp16_ = self->priv->song;
	_tmp17_ = _tmp16_->filename;
	_tmp18_ = g_path_get_basename (_tmp17_);
	_tmp19_ = _tmp18_;
	_tmp20_ = (GtkLabel*) gtk_label_new (_tmp19_);
	g_object_ref_sink (_tmp20_);
	_g_object_unref0 (label);
	label = _tmp20_;
	_g_free0 (_tmp19_);
	_tmp21_ = hbox;
	_tmp22_ = label;
	gtk_box_pack_start (_tmp21_, (GtkWidget*) _tmp22_, FALSE, FALSE, (guint) 5);
	_tmp23_ = hbox;
	gtk_box_pack_start (vbox2, (GtkWidget*) _tmp23_, FALSE, FALSE, (guint) 6);
	_tmp24_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp24_);
	_g_object_unref0 (hbox);
	hbox = _tmp24_;
	_tmp25_ = (GtkLabel*) gtk_label_new (_ ("Artist"));
	g_object_ref_sink (_tmp25_);
	_g_object_unref0 (label);
	label = _tmp25_;
	_tmp26_ = label;
	gtk_label_set_attributes (_tmp26_, attrs);
	_tmp27_ = hbox;
	_tmp28_ = label;
	gtk_box_pack_start (_tmp27_, (GtkWidget*) _tmp28_, FALSE, FALSE, (guint) 5);
	_tmp29_ = self->priv->song;
	_tmp30_ = _tmp29_->artist;
	_tmp31_ = (GtkLabel*) gtk_label_new (_tmp30_);
	g_object_ref_sink (_tmp31_);
	_g_object_unref0 (label);
	label = _tmp31_;
	_tmp32_ = hbox;
	_tmp33_ = label;
	gtk_box_pack_start (_tmp32_, (GtkWidget*) _tmp33_, FALSE, FALSE, (guint) 5);
	_tmp34_ = hbox;
	gtk_box_pack_start (vbox2, (GtkWidget*) _tmp34_, FALSE, FALSE, (guint) 6);
	_tmp35_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp35_);
	_g_object_unref0 (hbox);
	hbox = _tmp35_;
	_tmp36_ = (GtkLabel*) gtk_label_new (_ ("Title"));
	g_object_ref_sink (_tmp36_);
	_g_object_unref0 (label);
	label = _tmp36_;
	_tmp37_ = label;
	gtk_label_set_attributes (_tmp37_, attrs);
	_tmp38_ = hbox;
	_tmp39_ = label;
	gtk_box_pack_start (_tmp38_, (GtkWidget*) _tmp39_, FALSE, FALSE, (guint) 5);
	_tmp40_ = self->priv->song;
	_tmp41_ = _tmp40_->title;
	_tmp42_ = (GtkLabel*) gtk_label_new (_tmp41_);
	g_object_ref_sink (_tmp42_);
	_g_object_unref0 (label);
	label = _tmp42_;
	_tmp43_ = hbox;
	_tmp44_ = label;
	gtk_box_pack_start (_tmp43_, (GtkWidget*) _tmp44_, FALSE, FALSE, (guint) 5);
	_tmp45_ = hbox;
	gtk_box_pack_start (vbox2, (GtkWidget*) _tmp45_, FALSE, FALSE, (guint) 6);
	_tmp46_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp46_);
	_g_object_unref0 (hbox);
	hbox = _tmp46_;
	_tmp47_ = (GtkLabel*) gtk_label_new (_ ("Album"));
	g_object_ref_sink (_tmp47_);
	_g_object_unref0 (label);
	label = _tmp47_;
	_tmp48_ = label;
	gtk_label_set_attributes (_tmp48_, attrs);
	_tmp49_ = hbox;
	_tmp50_ = label;
	gtk_box_pack_start (_tmp49_, (GtkWidget*) _tmp50_, FALSE, FALSE, (guint) 5);
	_tmp51_ = self->priv->song;
	_tmp52_ = _tmp51_->album;
	_tmp53_ = (GtkLabel*) gtk_label_new (_tmp52_);
	g_object_ref_sink (_tmp53_);
	_g_object_unref0 (label);
	label = _tmp53_;
	_tmp54_ = hbox;
	_tmp55_ = label;
	gtk_box_pack_start (_tmp54_, (GtkWidget*) _tmp55_, FALSE, FALSE, (guint) 5);
	_tmp56_ = hbox;
	gtk_box_pack_start (vbox2, (GtkWidget*) _tmp56_, FALSE, FALSE, (guint) 6);
	_tmp57_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp57_);
	_g_object_unref0 (hbox);
	hbox = _tmp57_;
	_tmp58_ = (GtkLabel*) gtk_label_new (_ ("Date"));
	g_object_ref_sink (_tmp58_);
	_g_object_unref0 (label);
	label = _tmp58_;
	_tmp59_ = label;
	gtk_label_set_attributes (_tmp59_, attrs);
	_tmp60_ = hbox;
	_tmp61_ = label;
	gtk_box_pack_start (_tmp60_, (GtkWidget*) _tmp61_, FALSE, FALSE, (guint) 5);
	_tmp62_ = self->priv->song;
	_tmp63_ = _tmp62_->date;
	_tmp64_ = (GtkLabel*) gtk_label_new (_tmp63_);
	g_object_ref_sink (_tmp64_);
	_g_object_unref0 (label);
	label = _tmp64_;
	_tmp65_ = hbox;
	_tmp66_ = label;
	gtk_box_pack_start (_tmp65_, (GtkWidget*) _tmp66_, FALSE, FALSE, (guint) 5);
	_tmp67_ = (GtkLabel*) gtk_label_new (_ ("Track"));
	g_object_ref_sink (_tmp67_);
	_g_object_unref0 (label);
	label = _tmp67_;
	_tmp68_ = label;
	gtk_label_set_attributes (_tmp68_, attrs);
	_tmp69_ = hbox;
	_tmp70_ = label;
	gtk_box_pack_start (_tmp69_, (GtkWidget*) _tmp70_, FALSE, FALSE, (guint) 15);
	_tmp71_ = self->priv->song;
	_tmp72_ = _tmp71_->track;
	_tmp73_ = (GtkLabel*) gtk_label_new (_tmp72_);
	g_object_ref_sink (_tmp73_);
	_g_object_unref0 (label);
	label = _tmp73_;
	_tmp74_ = hbox;
	_tmp75_ = label;
	gtk_box_pack_start (_tmp74_, (GtkWidget*) _tmp75_, FALSE, FALSE, (guint) 5);
	_tmp76_ = hbox;
	gtk_box_pack_start (vbox2, (GtkWidget*) _tmp76_, FALSE, FALSE, (guint) 6);
	_tmp77_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp77_);
	_g_object_unref0 (hbox);
	hbox = _tmp77_;
	_tmp78_ = (GtkLabel*) gtk_label_new (_ ("Genre"));
	g_object_ref_sink (_tmp78_);
	_g_object_unref0 (label);
	label = _tmp78_;
	_tmp79_ = label;
	gtk_label_set_attributes (_tmp79_, attrs);
	_tmp80_ = hbox;
	_tmp81_ = label;
	gtk_box_pack_start (_tmp80_, (GtkWidget*) _tmp81_, FALSE, FALSE, (guint) 5);
	_tmp82_ = self->priv->song;
	_tmp83_ = _tmp82_->genre;
	_tmp84_ = (GtkLabel*) gtk_label_new (_tmp83_);
	g_object_ref_sink (_tmp84_);
	_g_object_unref0 (label);
	label = _tmp84_;
	_tmp85_ = hbox;
	_tmp86_ = label;
	gtk_box_pack_start (_tmp85_, (GtkWidget*) _tmp86_, FALSE, FALSE, (guint) 5);
	_tmp87_ = hbox;
	gtk_box_pack_start (vbox2, (GtkWidget*) _tmp87_, FALSE, FALSE, (guint) 6);
	_tmp88_ = gtk_dialog_get_content_area ((GtkDialog*) self);
	gtk_box_pack_start (_tmp88_, frame, TRUE, TRUE, (guint) 0);
	_tmp89_ = _g_object_ref0 ((GtkDialog*) self);
	dialog = _tmp89_;
	gtk_dialog_add_button (dialog, _ ("Close"), (gint) GTK_RESPONSE_CLOSE);
	gtk_widget_show_all ((GtkWidget*) self);
	g_signal_connect_object ((GtkDialog*) self, "response", (GCallback) _xfmpc_song_dialog_cb_response_gtk_dialog_response, self, 0);
	_g_object_unref0 (dialog);
	_g_object_unref0 (label);
	_g_object_unref0 (hbox);
	_pango_attr_list_unref0 (attrs);
	_g_object_unref0 (frame);
	_g_object_unref0 (vbox2);
	return self;
}

XfmpcSongDialog*
xfmpc_song_dialog_new (gint song_id)
{
	return xfmpc_song_dialog_construct (XFMPC_TYPE_SONG_DIALOG, song_id);
}

static void
xfmpc_song_dialog_cb_response (XfmpcSongDialog* self,
                               gint response)
{
	g_return_if_fail (self != NULL);
	switch (response) {
		case GTK_RESPONSE_CLOSE:
		{
			gtk_widget_destroy ((GtkWidget*) self);
			break;
		}
		default:
		break;
	}
}

static void
xfmpc_song_dialog_class_init (XfmpcSongDialogClass * klass,
                              gpointer klass_data)
{
	xfmpc_song_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &XfmpcSongDialog_private_offset);
	G_OBJECT_CLASS (klass)->finalize = xfmpc_song_dialog_finalize;
}

static void
xfmpc_song_dialog_instance_init (XfmpcSongDialog * self,
                                 gpointer klass)
{
	self->priv = xfmpc_song_dialog_get_instance_private (self);
}

static void
xfmpc_song_dialog_finalize (GObject * obj)
{
	XfmpcSongDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XFMPC_TYPE_SONG_DIALOG, XfmpcSongDialog);
	G_OBJECT_CLASS (xfmpc_song_dialog_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
xfmpc_song_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XfmpcSongDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xfmpc_song_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XfmpcSongDialog), 0, (GInstanceInitFunc) xfmpc_song_dialog_instance_init, NULL };
	GType xfmpc_song_dialog_type_id;
	xfmpc_song_dialog_type_id = g_type_register_static (xfce_titled_dialog_get_type (), "XfmpcSongDialog", &g_define_type_info, 0);
	XfmpcSongDialog_private_offset = g_type_add_instance_private (xfmpc_song_dialog_type_id, sizeof (XfmpcSongDialogPrivate));
	return xfmpc_song_dialog_type_id;
}

GType
xfmpc_song_dialog_get_type (void)
{
	static volatile gsize xfmpc_song_dialog_type_id__once = 0;
	if (g_once_init_enter (&xfmpc_song_dialog_type_id__once)) {
		GType xfmpc_song_dialog_type_id;
		xfmpc_song_dialog_type_id = xfmpc_song_dialog_get_type_once ();
		g_once_init_leave (&xfmpc_song_dialog_type_id__once, xfmpc_song_dialog_type_id);
	}
	return xfmpc_song_dialog_type_id__once;
}

