/* 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 <glib-object.h>
#include <gtk/gtk.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))
typedef struct _Block3Data Block3Data;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
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;
};

struct _Block3Data {
	int _ref_count_;
	SoundDisplayWidget* self;
	GtkSpinner* mic_icon;
	GtkGestureClick* mic_gesture_click;
	GtkGestureClick* volume_gesture_click;
};

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 Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static gboolean _sound_display_widget___lambda5_ (SoundDisplayWidget* self,
                                           GdkEvent* e);
static gboolean __sound_display_widget___lambda5__gtk_event_controller_legacy_event (GtkEventControllerLegacy* _sender,
                                                                              GdkEvent* event,
                                                                              gpointer self);
static gboolean _sound_display_widget___lambda6_ (SoundDisplayWidget* self,
                                           GdkEvent* e);
static gboolean __sound_display_widget___lambda6__gtk_event_controller_legacy_event (GtkEventControllerLegacy* _sender,
                                                                              GdkEvent* event,
                                                                              gpointer self);
static void _sound_display_widget___lambda7_ (Block3Data* _data3_);
static void __sound_display_widget___lambda7__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                  gint n_press,
                                                                  gdouble x,
                                                                  gdouble y,
                                                                  gpointer self);
static void _sound_display_widget___lambda8_ (Block3Data* _data3_);
static void __sound_display_widget___lambda8__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                  gint n_press,
                                                                  gdouble x,
                                                                  gdouble y,
                                                                  gpointer self);
static void _sound_display_widget___lambda9_ (Block3Data* _data3_);
static void __sound_display_widget___lambda9__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 Block3Data*
block3_data_ref (Block3Data* _data3_)
{
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}

static void
block3_data_unref (void * _userdata_)
{
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		SoundDisplayWidget* self;
		self = _data3_->self;
		_g_object_unref0 (_data3_->volume_gesture_click);
		_g_object_unref0 (_data3_->mic_gesture_click);
		_g_object_unref0 (_data3_->mic_icon);
		_g_object_unref0 (self);
		g_slice_free (Block3Data, _data3_);
	}
}

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

static gboolean
_sound_display_widget___lambda5_ (SoundDisplayWidget* self,
                                  GdkEvent* e)
{
	GValue event_value = {0};
	GValue _tmp0_ = {0};
	GValue _tmp1_;
	gboolean result;
	g_return_val_if_fail (e != NULL, FALSE);
	if (gdk_event_get_event_type (e) != GDK_SCROLL) {
		result = GDK_EVENT_PROPAGATE;
		return result;
	}
	g_value_init (&_tmp0_, gdk_scroll_event_get_type ());
	event_value = _tmp0_;
	g_value_set_instance (&event_value, e);
	_tmp1_ = event_value;
	g_signal_emit (self, sound_display_widget_signals[SOUND_DISPLAY_WIDGET_MIC_SCROLL_EVENT_SIGNAL], 0, &_tmp1_);
	result = GDK_EVENT_STOP;
	G_IS_VALUE (&event_value) ? (g_value_unset (&event_value), NULL) : NULL;
	return result;
}

static gboolean
__sound_display_widget___lambda5__gtk_event_controller_legacy_event (GtkEventControllerLegacy* _sender,
                                                                     GdkEvent* event,
                                                                     gpointer self)
{
	gboolean result;
	result = _sound_display_widget___lambda5_ ((SoundDisplayWidget*) self, event);
	return result;
}

static gboolean
_sound_display_widget___lambda6_ (SoundDisplayWidget* self,
                                  GdkEvent* e)
{
	GValue event_value = {0};
	GValue _tmp0_ = {0};
	GValue _tmp1_;
	gboolean result;
	g_return_val_if_fail (e != NULL, FALSE);
	if (gdk_event_get_event_type (e) != GDK_SCROLL) {
		result = GDK_EVENT_PROPAGATE;
		return result;
	}
	g_value_init (&_tmp0_, gdk_scroll_event_get_type ());
	event_value = _tmp0_;
	g_value_set_instance (&event_value, e);
	_tmp1_ = event_value;
	g_signal_emit (self, sound_display_widget_signals[SOUND_DISPLAY_WIDGET_VOLUME_SCROLL_EVENT_SIGNAL], 0, &_tmp1_);
	result = GDK_EVENT_STOP;
	G_IS_VALUE (&event_value) ? (g_value_unset (&event_value), NULL) : NULL;
	return result;
}

static gboolean
__sound_display_widget___lambda6__gtk_event_controller_legacy_event (GtkEventControllerLegacy* _sender,
                                                                     GdkEvent* event,
                                                                     gpointer self)
{
	gboolean result;
	result = _sound_display_widget___lambda6_ ((SoundDisplayWidget*) self, event);
	return result;
}

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

static void
__sound_display_widget___lambda7__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                             gint n_press,
                                                             gdouble x,
                                                             gdouble y,
                                                             gpointer self)
{
	_sound_display_widget___lambda7_ (self);
}

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

static void
__sound_display_widget___lambda8__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                             gint n_press,
                                                             gdouble x,
                                                             gdouble y,
                                                             gpointer self)
{
	_sound_display_widget___lambda8_ (self);
}

static void
_sound_display_widget___lambda9_ (Block3Data* _data3_)
{
	SoundDisplayWidget* self;
	gboolean _tmp0_;
	self = _data3_->self;
	_tmp0_ = self->priv->_mic_muted;
	if (_tmp0_) {
		GtkSpinner* _tmp1_;
		_tmp1_ = _data3_->mic_icon;
		gtk_widget_add_css_class ((GtkWidget*) _tmp1_, "disabled");
	} else {
		GtkSpinner* _tmp2_;
		_tmp2_ = _data3_->mic_icon;
		gtk_widget_remove_css_class ((GtkWidget*) _tmp2_, "disabled");
	}
}

static void
__sound_display_widget___lambda9__g_object_notify (GObject* _sender,
                                                   GParamSpec* pspec,
                                                   gpointer self)
{
	_sound_display_widget___lambda9_ (self);
}

static GObject *
sound_display_widget_constructor (GType type,
                                  guint n_construct_properties,
                                  GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SoundDisplayWidget * self;
	Block3Data* _data3_;
	GtkImage* volume_icon = NULL;
	GtkImage* _tmp0_ = NULL;
	GtkSpinner* _tmp1_;
	GtkSpinner* _tmp2_;
	GtkSpinner* _tmp3_;
	GtkRevealer* mic_revealer = NULL;
	GtkSpinner* _tmp4_;
	GtkWidget* _tmp5_;
	GtkRevealer* _tmp6_ = NULL;
	GtkRevealer* _tmp7_;
	GtkImage* _tmp8_;
	GtkEventControllerLegacy* mic_scroll_controller = NULL;
	GtkEventControllerLegacy* _tmp9_;
	GtkEventControllerLegacy* _tmp10_;
	GtkEventControllerLegacy* volume_scroll_controller = NULL;
	GtkEventControllerLegacy* _tmp11_;
	GtkEventControllerLegacy* _tmp12_;
	GtkSpinner* _tmp13_;
	GtkEventControllerLegacy* _tmp14_;
	GtkEventController* _tmp15_;
	GtkImage* _tmp16_;
	GtkEventControllerLegacy* _tmp17_;
	GtkEventController* _tmp18_;
	GtkGestureClick* _tmp19_ = NULL;
	GtkGestureClick* _tmp20_;
	GtkSpinner* _tmp21_;
	GtkGestureClick* _tmp22_;
	GtkEventController* _tmp23_;
	GtkGestureClick* _tmp24_ = NULL;
	GtkGestureClick* _tmp25_;
	GtkImage* _tmp26_;
	GtkGestureClick* _tmp27_;
	GtkEventController* _tmp28_;
	GtkImage* _tmp29_;
	GtkRevealer* _tmp30_;
	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);
	_data3_ = g_slice_new0 (Block3Data);
	_data3_->_ref_count_ = 1;
	_data3_->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_ = (GtkSpinner*) gtk_spinner_new ();
	g_object_ref_sink (_tmp1_);
	_data3_->mic_icon = _tmp1_;
	_tmp2_ = _data3_->mic_icon;
	gtk_widget_add_css_class ((GtkWidget*) _tmp2_, "mic-icon");
	_tmp3_ = _data3_->mic_icon;
	gtk_widget_add_css_class ((GtkWidget*) _tmp3_, "composited-indicator");
	_tmp4_ = _data3_->mic_icon;
	_tmp5_ = _g_object_ref0 ((GtkWidget*) _tmp4_);
	_tmp6_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_child (_tmp6_, _tmp5_);
	_g_object_unref0 (_tmp5_);
	gtk_revealer_set_transition_type (_tmp6_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT);
	g_object_ref_sink (_tmp6_);
	mic_revealer = _tmp6_;
	gtk_widget_set_valign ((GtkWidget*) self, GTK_ALIGN_CENTER);
	_tmp7_ = mic_revealer;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp7_);
	_tmp8_ = volume_icon;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp8_);
	_tmp9_ = (GtkEventControllerLegacy*) gtk_event_controller_legacy_new ();
	mic_scroll_controller = _tmp9_;
	_tmp10_ = mic_scroll_controller;
	g_signal_connect_object (_tmp10_, "event", (GCallback) __sound_display_widget___lambda5__gtk_event_controller_legacy_event, self, 0);
	_tmp11_ = (GtkEventControllerLegacy*) gtk_event_controller_legacy_new ();
	volume_scroll_controller = _tmp11_;
	_tmp12_ = volume_scroll_controller;
	g_signal_connect_object (_tmp12_, "event", (GCallback) __sound_display_widget___lambda6__gtk_event_controller_legacy_event, self, 0);
	_tmp13_ = _data3_->mic_icon;
	_tmp14_ = mic_scroll_controller;
	_tmp15_ = _g_object_ref0 ((GtkEventController*) _tmp14_);
	gtk_widget_add_controller ((GtkWidget*) _tmp13_, _tmp15_);
	_tmp16_ = volume_icon;
	_tmp17_ = volume_scroll_controller;
	_tmp18_ = _g_object_ref0 ((GtkEventController*) _tmp17_);
	gtk_widget_add_controller ((GtkWidget*) _tmp16_, _tmp18_);
	_tmp19_ = (GtkGestureClick*) gtk_gesture_click_new ();
	gtk_gesture_single_set_button ((GtkGestureSingle*) _tmp19_, (guint) GDK_BUTTON_MIDDLE);
	_data3_->mic_gesture_click = _tmp19_;
	_tmp20_ = _data3_->mic_gesture_click;
	g_signal_connect_data (_tmp20_, "pressed", (GCallback) __sound_display_widget___lambda7__gtk_gesture_click_pressed, block3_data_ref (_data3_), (GClosureNotify) block3_data_unref, 0);
	_tmp21_ = _data3_->mic_icon;
	_tmp22_ = _data3_->mic_gesture_click;
	_tmp23_ = _g_object_ref0 ((GtkEventController*) _tmp22_);
	gtk_widget_add_controller ((GtkWidget*) _tmp21_, _tmp23_);
	_tmp24_ = (GtkGestureClick*) gtk_gesture_click_new ();
	gtk_gesture_single_set_button ((GtkGestureSingle*) _tmp24_, (guint) GDK_BUTTON_MIDDLE);
	_data3_->volume_gesture_click = _tmp24_;
	_tmp25_ = _data3_->volume_gesture_click;
	g_signal_connect_data (_tmp25_, "pressed", (GCallback) __sound_display_widget___lambda8__gtk_gesture_click_pressed, block3_data_ref (_data3_), (GClosureNotify) block3_data_unref, 0);
	_tmp26_ = volume_icon;
	_tmp27_ = _data3_->volume_gesture_click;
	_tmp28_ = _g_object_ref0 ((GtkEventController*) _tmp27_);
	gtk_widget_add_controller ((GtkWidget*) _tmp26_, _tmp28_);
	_tmp29_ = volume_icon;
	g_object_bind_property_with_closures ((GObject*) self, "icon-name", (GObject*) _tmp29_, "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)));
	_tmp30_ = mic_revealer;
	g_object_bind_property_with_closures ((GObject*) self, "show-mic", (GObject*) _tmp30_, "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___lambda9__g_object_notify, block3_data_ref (_data3_), (GClosureNotify) block3_data_unref, 0);
	_g_object_unref0 (volume_scroll_controller);
	_g_object_unref0 (mic_scroll_controller);
	_g_object_unref0 (mic_revealer);
	_g_object_unref0 (volume_icon);
	block3_data_unref (_data3_);
	_data3_ = 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, G_TYPE_VALUE);
	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, G_TYPE_VALUE);
}

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_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;
	}
}

