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

/*
* Copyright (c) 2016-2018 elementary, Inc. (https://elementary.io)
*
* 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, see <http://www.gnu.org/licenses/>.
*/

#include "sound.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <glib-object.h>
#include <gdk/gdk.h>
#include <float.h>
#include <math.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  {
	SOUND_DISPLAY_WIDGET_0_PROPERTY,
	SOUND_DISPLAY_WIDGET_SHOW_MIC_PROPERTY,
	SOUND_DISPLAY_WIDGET_MIC_MUTED_PROPERTY,
	SOUND_DISPLAY_WIDGET_ICON_NAME_PROPERTY,
	SOUND_DISPLAY_WIDGET_NUM_PROPERTIES
};
static GParamSpec* sound_display_widget_properties[SOUND_DISPLAY_WIDGET_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block2Data Block2Data;
enum  {
	SOUND_DISPLAY_WIDGET_VOLUME_PRESS_EVENT_SIGNAL,
	SOUND_DISPLAY_WIDGET_MIC_PRESS_EVENT_SIGNAL,
	SOUND_DISPLAY_WIDGET_VOLUME_SCROLL_EVENT_SIGNAL,
	SOUND_DISPLAY_WIDGET_MIC_SCROLL_EVENT_SIGNAL,
	SOUND_DISPLAY_WIDGET_NUM_SIGNALS
};
static guint sound_display_widget_signals[SOUND_DISPLAY_WIDGET_NUM_SIGNALS] = {0};

struct _SoundDisplayWidgetPrivate {
	gboolean _show_mic;
	gboolean _mic_muted;
	gchar* _icon_name;
	GtkGestureMultiPress* mic_gesture_click;
	GtkGestureMultiPress* volume_gesture_click;
};

struct _Block2Data {
	int _ref_count_;
	SoundDisplayWidget* self;
	GtkSpinner* mic_icon;
};

static gint SoundDisplayWidget_private_offset;
static gpointer sound_display_widget_parent_class = NULL;

static GObject * sound_display_widget_constructor (GType type,
                                            guint n_construct_properties,
                                            GObjectConstructParam * construct_properties);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static gboolean _sound_display_widget___lambda4_ (SoundDisplayWidget* self,
                                           GdkEventScroll* e);
static gboolean __sound_display_widget___lambda4__gtk_widget_scroll_event (GtkWidget* _sender,
                                                                    GdkEventScroll* event,
                                                                    gpointer self);
static gboolean _sound_display_widget___lambda5_ (SoundDisplayWidget* self,
                                           GdkEventScroll* e);
static gboolean __sound_display_widget___lambda5__gtk_widget_scroll_event (GtkWidget* _sender,
                                                                    GdkEventScroll* event,
                                                                    gpointer self);
static void _sound_display_widget___lambda6_ (SoundDisplayWidget* self);
static void __sound_display_widget___lambda6__gtk_gesture_multi_press_pressed (GtkGestureMultiPress* _sender,
                                                                        gint n_press,
                                                                        gdouble x,
                                                                        gdouble y,
                                                                        gpointer self);
static void _sound_display_widget___lambda7_ (SoundDisplayWidget* self);
static void __sound_display_widget___lambda7__gtk_gesture_multi_press_pressed (GtkGestureMultiPress* _sender,
                                                                        gint n_press,
                                                                        gdouble x,
                                                                        gdouble y,
                                                                        gpointer self);
static void _sound_display_widget___lambda8_ (Block2Data* _data2_);
static void __sound_display_widget___lambda8__g_object_notify (GObject* _sender,
                                                        GParamSpec* pspec,
                                                        gpointer self);
static void sound_display_widget_finalize (GObject * obj);
static GType sound_display_widget_get_type_once (void);
static void _vala_sound_display_widget_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec);
static void _vala_sound_display_widget_set_property (GObject * object,
                                              guint property_id,
                                              const GValue * value,
                                              GParamSpec * pspec);

static inline gpointer
sound_display_widget_get_instance_private (SoundDisplayWidget* self)
{
	return G_STRUCT_MEMBER_P (self, SoundDisplayWidget_private_offset);
}

SoundDisplayWidget*
sound_display_widget_construct (GType object_type)
{
	SoundDisplayWidget * self = NULL;
	self = (SoundDisplayWidget*) g_object_new (object_type, NULL);
	return self;
}

SoundDisplayWidget*
sound_display_widget_new (void)
{
	return sound_display_widget_construct (SOUND_TYPE_DISPLAY_WIDGET);
}

gboolean
sound_display_widget_get_show_mic (SoundDisplayWidget* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_show_mic;
	return result;
}

void
sound_display_widget_set_show_mic (SoundDisplayWidget* self,
                                   gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = sound_display_widget_get_show_mic (self);
	if (old_value != value) {
		self->priv->_show_mic = value;
		g_object_notify_by_pspec ((GObject *) self, sound_display_widget_properties[SOUND_DISPLAY_WIDGET_SHOW_MIC_PROPERTY]);
	}
}

gboolean
sound_display_widget_get_mic_muted (SoundDisplayWidget* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_mic_muted;
	return result;
}

void
sound_display_widget_set_mic_muted (SoundDisplayWidget* self,
                                    gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = sound_display_widget_get_mic_muted (self);
	if (old_value != value) {
		self->priv->_mic_muted = value;
		g_object_notify_by_pspec ((GObject *) self, sound_display_widget_properties[SOUND_DISPLAY_WIDGET_MIC_MUTED_PROPERTY]);
	}
}

const gchar*
sound_display_widget_get_icon_name (SoundDisplayWidget* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_icon_name;
	result = _tmp0_;
	return result;
}

void
sound_display_widget_set_icon_name (SoundDisplayWidget* self,
                                    const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = sound_display_widget_get_icon_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_icon_name);
		self->priv->_icon_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, sound_display_widget_properties[SOUND_DISPLAY_WIDGET_ICON_NAME_PROPERTY]);
	}
}

static Block2Data*
block2_data_ref (Block2Data* _data2_)
{
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}

static void
block2_data_unref (void * _userdata_)
{
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		SoundDisplayWidget* self;
		self = _data2_->self;
		_g_object_unref0 (_data2_->mic_icon);
		_g_object_unref0 (self);
		g_slice_free (Block2Data, _data2_);
	}
}

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

static gboolean
_sound_display_widget___lambda4_ (SoundDisplayWidget* self,
                                  GdkEventScroll* e)
{
	gboolean result;
	g_return_val_if_fail (e != NULL, FALSE);
	g_signal_emit (self, sound_display_widget_signals[SOUND_DISPLAY_WIDGET_MIC_SCROLL_EVENT_SIGNAL], 0, e);
	result = GDK_EVENT_STOP;
	return result;
}

static gboolean
__sound_display_widget___lambda4__gtk_widget_scroll_event (GtkWidget* _sender,
                                                           GdkEventScroll* event,
                                                           gpointer self)
{
	gboolean result;
	result = _sound_display_widget___lambda4_ ((SoundDisplayWidget*) self, event);
	return result;
}

static gboolean
_sound_display_widget___lambda5_ (SoundDisplayWidget* self,
                                  GdkEventScroll* e)
{
	gboolean result;
	g_return_val_if_fail (e != NULL, FALSE);
	g_signal_emit (self, sound_display_widget_signals[SOUND_DISPLAY_WIDGET_VOLUME_SCROLL_EVENT_SIGNAL], 0, e);
	result = GDK_EVENT_STOP;
	return result;
}

static gboolean
__sound_display_widget___lambda5__gtk_widget_scroll_event (GtkWidget* _sender,
                                                           GdkEventScroll* event,
                                                           gpointer self)
{
	gboolean result;
	result = _sound_display_widget___lambda5_ ((SoundDisplayWidget*) self, event);
	return result;
}

static void
_sound_display_widget___lambda6_ (SoundDisplayWidget* self)
{
	GtkGestureMultiPress* _tmp0_;
	GtkGestureMultiPress* _tmp1_;
	g_signal_emit (self, sound_display_widget_signals[SOUND_DISPLAY_WIDGET_MIC_PRESS_EVENT_SIGNAL], 0);
	_tmp0_ = self->priv->mic_gesture_click;
	gtk_gesture_set_state ((GtkGesture*) _tmp0_, GTK_EVENT_SEQUENCE_CLAIMED);
	_tmp1_ = self->priv->mic_gesture_click;
	gtk_event_controller_reset ((GtkEventController*) _tmp1_);
}

static void
__sound_display_widget___lambda6__gtk_gesture_multi_press_pressed (GtkGestureMultiPress* _sender,
                                                                   gint n_press,
                                                                   gdouble x,
                                                                   gdouble y,
                                                                   gpointer self)
{
	_sound_display_widget___lambda6_ ((SoundDisplayWidget*) self);
}

static void
_sound_display_widget___lambda7_ (SoundDisplayWidget* self)
{
	GtkGestureMultiPress* _tmp0_;
	GtkGestureMultiPress* _tmp1_;
	g_signal_emit (self, sound_display_widget_signals[SOUND_DISPLAY_WIDGET_VOLUME_PRESS_EVENT_SIGNAL], 0);
	_tmp0_ = self->priv->volume_gesture_click;
	gtk_gesture_set_state ((GtkGesture*) _tmp0_, GTK_EVENT_SEQUENCE_CLAIMED);
	_tmp1_ = self->priv->volume_gesture_click;
	gtk_event_controller_reset ((GtkEventController*) _tmp1_);
}

static void
__sound_display_widget___lambda7__gtk_gesture_multi_press_pressed (GtkGestureMultiPress* _sender,
                                                                   gint n_press,
                                                                   gdouble x,
                                                                   gdouble y,
                                                                   gpointer self)
{
	_sound_display_widget___lambda7_ ((SoundDisplayWidget*) self);
}

static void
_sound_display_widget___lambda8_ (Block2Data* _data2_)
{
	SoundDisplayWidget* self;
	gboolean _tmp0_;
	self = _data2_->self;
	_tmp0_ = self->priv->_mic_muted;
	if (_tmp0_) {
		GtkSpinner* _tmp1_;
		GtkStyleContext* _tmp2_;
		_tmp1_ = _data2_->mic_icon;
		_tmp2_ = gtk_widget_get_style_context ((GtkWidget*) _tmp1_);
		gtk_style_context_add_class (_tmp2_, "disabled");
	} else {
		GtkSpinner* _tmp3_;
		GtkStyleContext* _tmp4_;
		_tmp3_ = _data2_->mic_icon;
		_tmp4_ = gtk_widget_get_style_context ((GtkWidget*) _tmp3_);
		gtk_style_context_remove_class (_tmp4_, "disabled");
	}
}

static void
__sound_display_widget___lambda8__g_object_notify (GObject* _sender,
                                                   GParamSpec* pspec,
                                                   gpointer self)
{
	_sound_display_widget___lambda8_ (self);
}

static GObject *
sound_display_widget_constructor (GType type,
                                  guint n_construct_properties,
                                  GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SoundDisplayWidget * self;
	Block2Data* _data2_;
	GtkImage* volume_icon = NULL;
	GtkImage* _tmp0_ = NULL;
	GtkEventBox* volume_event_box = NULL;
	GtkImage* _tmp1_;
	GtkWidget* _tmp2_;
	GtkEventBox* _tmp3_ = NULL;
	GtkEventBox* _tmp4_;
	GtkSpinner* _tmp5_ = NULL;
	GtkSpinner* _tmp6_;
	GtkStyleContext* _tmp7_;
	GtkEventBox* mic_event_box = NULL;
	GtkSpinner* _tmp8_;
	GtkWidget* _tmp9_;
	GtkEventBox* _tmp10_ = NULL;
	GtkEventBox* _tmp11_;
	GtkRevealer* mic_revealer = NULL;
	GtkEventBox* _tmp12_;
	GtkWidget* _tmp13_;
	GtkRevealer* _tmp14_ = NULL;
	GtkRevealer* _tmp15_;
	GtkEventBox* _tmp16_;
	GtkEventBox* _tmp17_;
	GtkEventBox* _tmp18_;
	GtkEventBox* _tmp19_;
	GtkGestureMultiPress* _tmp20_ = NULL;
	GtkGestureMultiPress* _tmp21_;
	GtkEventBox* _tmp22_;
	GtkGestureMultiPress* _tmp23_ = NULL;
	GtkGestureMultiPress* _tmp24_;
	GtkImage* _tmp25_;
	GtkRevealer* _tmp26_;
	parent_class = G_OBJECT_CLASS (sound_display_widget_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SOUND_TYPE_DISPLAY_WIDGET, SoundDisplayWidget);
	_data2_ = g_slice_new0 (Block2Data);
	_data2_->_ref_count_ = 1;
	_data2_->self = g_object_ref (self);
	_tmp0_ = (GtkImage*) gtk_image_new ();
	gtk_image_set_pixel_size (_tmp0_, 24);
	g_object_ref_sink (_tmp0_);
	volume_icon = _tmp0_;
	_tmp1_ = volume_icon;
	_tmp2_ = _g_object_ref0 ((GtkWidget*) _tmp1_);
	_tmp3_ = (GtkEventBox*) gtk_event_box_new ();
	g_object_set ((GtkContainer*) _tmp3_, "child", _tmp2_, NULL);
	_g_object_unref0 (_tmp2_);
	g_object_ref_sink (_tmp3_);
	volume_event_box = _tmp3_;
	_tmp4_ = volume_event_box;
	gtk_widget_set_events ((GtkWidget*) _tmp4_, ((GDK_SCROLL_MASK | GDK_SMOOTH_SCROLL_MASK) | GDK_BUTTON_PRESS_MASK) | GDK_BUTTON_RELEASE_MASK);
	_tmp5_ = (GtkSpinner*) gtk_spinner_new ();
	gtk_widget_set_margin_end ((GtkWidget*) _tmp5_, 18);
	g_object_ref_sink (_tmp5_);
	_data2_->mic_icon = _tmp5_;
	_tmp6_ = _data2_->mic_icon;
	_tmp7_ = gtk_widget_get_style_context ((GtkWidget*) _tmp6_);
	gtk_style_context_add_class (_tmp7_, "mic-icon");
	_tmp8_ = _data2_->mic_icon;
	_tmp9_ = _g_object_ref0 ((GtkWidget*) _tmp8_);
	_tmp10_ = (GtkEventBox*) gtk_event_box_new ();
	g_object_set ((GtkContainer*) _tmp10_, "child", _tmp9_, NULL);
	_g_object_unref0 (_tmp9_);
	g_object_ref_sink (_tmp10_);
	mic_event_box = _tmp10_;
	_tmp11_ = mic_event_box;
	gtk_widget_set_events ((GtkWidget*) _tmp11_, ((GDK_SCROLL_MASK | GDK_SMOOTH_SCROLL_MASK) | GDK_BUTTON_PRESS_MASK) | GDK_BUTTON_RELEASE_MASK);
	_tmp12_ = mic_event_box;
	_tmp13_ = _g_object_ref0 ((GtkWidget*) _tmp12_);
	_tmp14_ = (GtkRevealer*) gtk_revealer_new ();
	g_object_set ((GtkContainer*) _tmp14_, "child", _tmp13_, NULL);
	_g_object_unref0 (_tmp13_);
	gtk_revealer_set_transition_type (_tmp14_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT);
	g_object_ref_sink (_tmp14_);
	mic_revealer = _tmp14_;
	gtk_widget_set_valign ((GtkWidget*) self, GTK_ALIGN_CENTER);
	_tmp15_ = mic_revealer;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp15_);
	_tmp16_ = volume_event_box;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp16_);
	_tmp17_ = mic_event_box;
	g_signal_connect_object ((GtkWidget*) _tmp17_, "scroll-event", (GCallback) __sound_display_widget___lambda4__gtk_widget_scroll_event, self, 0);
	_tmp18_ = volume_event_box;
	g_signal_connect_object ((GtkWidget*) _tmp18_, "scroll-event", (GCallback) __sound_display_widget___lambda5__gtk_widget_scroll_event, self, 0);
	_tmp19_ = mic_event_box;
	_tmp20_ = (GtkGestureMultiPress*) gtk_gesture_multi_press_new ((GtkWidget*) _tmp19_);
	gtk_gesture_single_set_button ((GtkGestureSingle*) _tmp20_, (guint) GDK_BUTTON_MIDDLE);
	_g_object_unref0 (self->priv->mic_gesture_click);
	self->priv->mic_gesture_click = _tmp20_;
	_tmp21_ = self->priv->mic_gesture_click;
	g_signal_connect_object (_tmp21_, "pressed", (GCallback) __sound_display_widget___lambda6__gtk_gesture_multi_press_pressed, self, 0);
	_tmp22_ = volume_event_box;
	_tmp23_ = (GtkGestureMultiPress*) gtk_gesture_multi_press_new ((GtkWidget*) _tmp22_);
	gtk_gesture_single_set_button ((GtkGestureSingle*) _tmp23_, (guint) GDK_BUTTON_MIDDLE);
	_g_object_unref0 (self->priv->volume_gesture_click);
	self->priv->volume_gesture_click = _tmp23_;
	_tmp24_ = self->priv->volume_gesture_click;
	g_signal_connect_object (_tmp24_, "pressed", (GCallback) __sound_display_widget___lambda7__gtk_gesture_multi_press_pressed, self, 0);
	_tmp25_ = volume_icon;
	g_object_bind_property_with_closures ((GObject*) self, "icon-name", (GObject*) _tmp25_, "icon-name", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp26_ = mic_revealer;
	g_object_bind_property_with_closures ((GObject*) self, "show-mic", (GObject*) _tmp26_, "reveal-child", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_signal_connect_data ((GObject*) self, "notify::mic-muted", (GCallback) __sound_display_widget___lambda8__g_object_notify, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
	_g_object_unref0 (mic_revealer);
	_g_object_unref0 (mic_event_box);
	_g_object_unref0 (volume_event_box);
	_g_object_unref0 (volume_icon);
	block2_data_unref (_data2_);
	_data2_ = NULL;
	return obj;
}

static void
sound_display_widget_class_init (SoundDisplayWidgetClass * klass,
                                 gpointer klass_data)
{
	sound_display_widget_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SoundDisplayWidget_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_sound_display_widget_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_sound_display_widget_set_property;
	G_OBJECT_CLASS (klass)->constructor = sound_display_widget_constructor;
	G_OBJECT_CLASS (klass)->finalize = sound_display_widget_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SOUND_DISPLAY_WIDGET_SHOW_MIC_PROPERTY, sound_display_widget_properties[SOUND_DISPLAY_WIDGET_SHOW_MIC_PROPERTY] = g_param_spec_boolean ("show-mic", "show-mic", "show-mic", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SOUND_DISPLAY_WIDGET_MIC_MUTED_PROPERTY, sound_display_widget_properties[SOUND_DISPLAY_WIDGET_MIC_MUTED_PROPERTY] = g_param_spec_boolean ("mic-muted", "mic-muted", "mic-muted", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SOUND_DISPLAY_WIDGET_ICON_NAME_PROPERTY, sound_display_widget_properties[SOUND_DISPLAY_WIDGET_ICON_NAME_PROPERTY] = g_param_spec_string ("icon-name", "icon-name", "icon-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	sound_display_widget_signals[SOUND_DISPLAY_WIDGET_VOLUME_PRESS_EVENT_SIGNAL] = g_signal_new ("volume-press-event", SOUND_TYPE_DISPLAY_WIDGET, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	sound_display_widget_signals[SOUND_DISPLAY_WIDGET_MIC_PRESS_EVENT_SIGNAL] = g_signal_new ("mic-press-event", SOUND_TYPE_DISPLAY_WIDGET, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	sound_display_widget_signals[SOUND_DISPLAY_WIDGET_VOLUME_SCROLL_EVENT_SIGNAL] = g_signal_new ("volume-scroll-event", SOUND_TYPE_DISPLAY_WIDGET, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__BOXED, G_TYPE_NONE, 1, gdk_event_get_type ());
	sound_display_widget_signals[SOUND_DISPLAY_WIDGET_MIC_SCROLL_EVENT_SIGNAL] = g_signal_new ("mic-scroll-event", SOUND_TYPE_DISPLAY_WIDGET, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__BOXED, G_TYPE_NONE, 1, gdk_event_get_type ());
}

static void
sound_display_widget_instance_init (SoundDisplayWidget * self,
                                    gpointer klass)
{
	self->priv = sound_display_widget_get_instance_private (self);
}

static void
sound_display_widget_finalize (GObject * obj)
{
	SoundDisplayWidget * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SOUND_TYPE_DISPLAY_WIDGET, SoundDisplayWidget);
	_g_free0 (self->priv->_icon_name);
	_g_object_unref0 (self->priv->mic_gesture_click);
	_g_object_unref0 (self->priv->volume_gesture_click);
	G_OBJECT_CLASS (sound_display_widget_parent_class)->finalize (obj);
}

static GType
sound_display_widget_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SoundDisplayWidgetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sound_display_widget_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SoundDisplayWidget), 0, (GInstanceInitFunc) sound_display_widget_instance_init, NULL };
	GType sound_display_widget_type_id;
	sound_display_widget_type_id = g_type_register_static (gtk_box_get_type (), "SoundDisplayWidget", &g_define_type_info, 0);
	SoundDisplayWidget_private_offset = g_type_add_instance_private (sound_display_widget_type_id, sizeof (SoundDisplayWidgetPrivate));
	return sound_display_widget_type_id;
}

GType
sound_display_widget_get_type (void)
{
	static volatile gsize sound_display_widget_type_id__once = 0;
	if (g_once_init_enter (&sound_display_widget_type_id__once)) {
		GType sound_display_widget_type_id;
		sound_display_widget_type_id = sound_display_widget_get_type_once ();
		g_once_init_leave (&sound_display_widget_type_id__once, sound_display_widget_type_id);
	}
	return sound_display_widget_type_id__once;
}

static void
_vala_sound_display_widget_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec)
{
	SoundDisplayWidget * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SOUND_TYPE_DISPLAY_WIDGET, SoundDisplayWidget);
	switch (property_id) {
		case SOUND_DISPLAY_WIDGET_SHOW_MIC_PROPERTY:
		g_value_set_boolean (value, sound_display_widget_get_show_mic (self));
		break;
		case SOUND_DISPLAY_WIDGET_MIC_MUTED_PROPERTY:
		g_value_set_boolean (value, sound_display_widget_get_mic_muted (self));
		break;
		case SOUND_DISPLAY_WIDGET_ICON_NAME_PROPERTY:
		g_value_set_string (value, sound_display_widget_get_icon_name (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_sound_display_widget_set_property (GObject * object,
                                         guint property_id,
                                         const GValue * value,
                                         GParamSpec * pspec)
{
	SoundDisplayWidget * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SOUND_TYPE_DISPLAY_WIDGET, SoundDisplayWidget);
	switch (property_id) {
		case SOUND_DISPLAY_WIDGET_SHOW_MIC_PROPERTY:
		sound_display_widget_set_show_mic (self, g_value_get_boolean (value));
		break;
		case SOUND_DISPLAY_WIDGET_MIC_MUTED_PROPERTY:
		sound_display_widget_set_mic_muted (self, g_value_get_boolean (value));
		break;
		case SOUND_DISPLAY_WIDGET_ICON_NAME_PROPERTY:
		sound_display_widget_set_icon_name (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

