aboutsummaryrefslogtreecommitdiff
path: root/src/slider-menu-item.c
diff options
context:
space:
mode:
authorKen VanDine <ken.vandine@canonical.com>2010-06-24 13:55:01 -0400
committerKen VanDine <ken.vandine@canonical.com>2010-06-24 13:55:01 -0400
commit288985d7c0a4dcdde22335a31d9eae7f7d5ec215 (patch)
treec270c8b758cfba94ad2e236a5cbf9685ee87a95b /src/slider-menu-item.c
parent619a7c5da5817b5da3bfd8af5c3af9de450b6d48 (diff)
downloadayatana-indicator-sound-288985d7c0a4dcdde22335a31d9eae7f7d5ec215.tar.gz
ayatana-indicator-sound-288985d7c0a4dcdde22335a31d9eae7f7d5ec215.tar.bz2
ayatana-indicator-sound-288985d7c0a4dcdde22335a31d9eae7f7d5ec215.zip
Import upstream version 0.3.2
Diffstat (limited to 'src/slider-menu-item.c')
-rw-r--r--src/slider-menu-item.c49
1 files changed, 24 insertions, 25 deletions
diff --git a/src/slider-menu-item.c b/src/slider-menu-item.c
index 8a21fcf..d56422a 100644
--- a/src/slider-menu-item.c
+++ b/src/slider-menu-item.c
@@ -4,16 +4,16 @@ Copyright 2010 Canonical Ltd.
Authors:
Conor Curran <conor.curran@canonical.com>
-This program is free software: you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 3, as published
+This program is free software: you can redistribute it and/or modify it
+under the terms of the GNU General Public License version 3, as published
by the Free Software Foundation.
-This program is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranties of
-MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranties of
+MERCHANTABILITY, SATISFACTORY QUALITY, 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
+You should have received a copy of the GNU General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
@@ -28,9 +28,8 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
typedef struct _SliderMenuItemPrivate SliderMenuItemPrivate;
-struct _SliderMenuItemPrivate
-{
- gdouble slider_value;
+struct _SliderMenuItemPrivate {
+ gdouble slider_value;
};
#define SLIDER_MENU_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SLIDER_MENU_ITEM_TYPE, SliderMenuItemPrivate))
@@ -46,58 +45,58 @@ G_DEFINE_TYPE (SliderMenuItem, slider_menu_item, DBUSMENU_TYPE_MENUITEM);
static void slider_menu_item_class_init (SliderMenuItemClass *klass)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (klass, sizeof (SliderMenuItemPrivate));
+ g_type_class_add_private (klass, sizeof (SliderMenuItemPrivate));
- object_class->dispose = slider_menu_item_dispose;
- object_class->finalize = slider_menu_item_finalize;
+ object_class->dispose = slider_menu_item_dispose;
+ object_class->finalize = slider_menu_item_finalize;
DbusmenuMenuitemClass * mclass = DBUSMENU_MENUITEM_CLASS(klass);
mclass->handle_event = handle_event;
- return;
+ return;
}
static void slider_menu_item_init (SliderMenuItem *self)
{
- g_debug("Building new Slider Menu Item");
- return;
+ g_debug("Building new Slider Menu Item");
+ return;
}
static void slider_menu_item_dispose (GObject *object)
{
- G_OBJECT_CLASS (slider_menu_item_parent_class)->dispose (object);
- return;
+ G_OBJECT_CLASS (slider_menu_item_parent_class)->dispose (object);
+ return;
}
static void
slider_menu_item_finalize (GObject *object)
{
- G_OBJECT_CLASS (slider_menu_item_parent_class)->finalize (object);
+ G_OBJECT_CLASS (slider_menu_item_parent_class)->finalize (object);
}
static void
handle_event (DbusmenuMenuitem * mi, const gchar * name, const GValue * value, guint timestamp)
{
- g_debug("in the handle event method of slider_menu_item");
+ g_debug("in the handle event method of slider_menu_item");
gdouble volume_input = 0;
volume_input = g_value_get_double(value);
- if(value != NULL)
- set_sink_volume(volume_input);
+ if (value != NULL)
+ set_sink_volume(volume_input);
}
SliderMenuItem* slider_menu_item_new(gboolean sinks_available, gdouble start_volume)
{
- SliderMenuItem *self = g_object_new(SLIDER_MENU_ITEM_TYPE, NULL);
+ SliderMenuItem *self = g_object_new(SLIDER_MENU_ITEM_TYPE, NULL);
dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_SLIDER_MENUITEM_TYPE);
dbusmenu_menuitem_property_set_bool(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_ENABLED, sinks_available);
dbusmenu_menuitem_property_set_bool(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_VISIBLE, sinks_available);
- return self;
+ return self;
}
-
+