From 496ac14d4e3b4e5b9284083cf4ce277cfe5ef343 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Fri, 30 Jul 2010 18:51:03 +0100 Subject: refactor the volume slider into its own wrapper gobject --- src/volume-widget.h | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/volume-widget.h (limited to 'src/volume-widget.h') diff --git a/src/volume-widget.h b/src/volume-widget.h new file mode 100644 index 0000000..8e3e895 --- /dev/null +++ b/src/volume-widget.h @@ -0,0 +1,53 @@ +/* +Copyright 2010 Canonical Ltd. + +Authors: + Conor Curran + +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 +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 . +*/ +#ifndef __VOLUME_WIDGET_H__ +#define __VOLUME_WIDGET_H__ + +#include +#include +#include + +G_BEGIN_DECLS + +#define VOLUME_WIDGET_TYPE (volume_widget_get_type ()) +#define VOLUME_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VOLUME_WIDGET_TYPE, VolumeWidget)) +#define VOLUME_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VOLUME_WIDGET_TYPE, VolumeWidgetClass)) +#define IS_VOLUME_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VOLUME_WIDGET_TYPE)) +#define IS_VOLUME_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VOLUME_WIDGET_TYPE)) +#define VOLUME_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VOLUME_WIDGET_TYPE, VolumeWidgetClass)) + +typedef struct _VolumeWidget VolumeWidget; +typedef struct _VolumeWidgetClass VolumeWidgetClass; + +struct _VolumeWidgetClass { + GObjectClass parent_class; +}; + +struct _VolumeWidget { + GObject parent; +}; + +GType volume_widget_get_type (void) G_GNUC_CONST; +GtkWidget* volume_widget_new(DbusmenuMenuitem* twin_item); +GtkWidget* volume_widget_get_ido_bar(VolumeWidget* self); + +G_END_DECLS + +#endif + -- cgit v1.2.3 From 9f7e55264deaaad68280ae33daad95fca604df8b Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Mon, 2 Aug 2010 19:13:58 +0100 Subject: replaced now needs tweaking --- src/volume-widget.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/volume-widget.h') diff --git a/src/volume-widget.h b/src/volume-widget.h index 8e3e895..7e6ab84 100644 --- a/src/volume-widget.h +++ b/src/volume-widget.h @@ -45,7 +45,7 @@ struct _VolumeWidget { GType volume_widget_get_type (void) G_GNUC_CONST; GtkWidget* volume_widget_new(DbusmenuMenuitem* twin_item); -GtkWidget* volume_widget_get_ido_bar(VolumeWidget* self); +GtkWidget* volume_widget_get_ido_slider(VolumeWidget* self); G_END_DECLS -- cgit v1.2.3 From fe354978ea13a5d3d8cbfc8f8ec2b3ab20170cf5 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 3 Aug 2010 20:33:15 +0100 Subject: almost there --- src/volume-widget.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/volume-widget.h') diff --git a/src/volume-widget.h b/src/volume-widget.h index 7e6ab84..2b48c39 100644 --- a/src/volume-widget.h +++ b/src/volume-widget.h @@ -46,6 +46,7 @@ struct _VolumeWidget { GType volume_widget_get_type (void) G_GNUC_CONST; GtkWidget* volume_widget_new(DbusmenuMenuitem* twin_item); GtkWidget* volume_widget_get_ido_slider(VolumeWidget* self); +void volume_widget_update(VolumeWidget* self, gdouble update); G_END_DECLS -- cgit v1.2.3 From 734cf9dc8224140b6b729c09237d598aec546ef3 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Fri, 6 Aug 2010 13:20:03 +0100 Subject: merge comments have been acted upon --- src/volume-widget.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/volume-widget.h') diff --git a/src/volume-widget.h b/src/volume-widget.h index 2b48c39..d4929ec 100644 --- a/src/volume-widget.h +++ b/src/volume-widget.h @@ -21,7 +21,7 @@ with this program. If not, see . #include #include -#include +#include G_BEGIN_DECLS -- cgit v1.2.3 From 484518d33c44914196f85c19b92f3fac07d1b2e0 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 14 Sep 2010 18:21:02 +0100 Subject: indicator should handle any service problems gracefully --- src/volume-widget.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/volume-widget.h') diff --git a/src/volume-widget.h b/src/volume-widget.h index d4929ec..202bbb3 100644 --- a/src/volume-widget.h +++ b/src/volume-widget.h @@ -47,6 +47,8 @@ GType volume_widget_get_type (void) G_GNUC_CONST; GtkWidget* volume_widget_new(DbusmenuMenuitem* twin_item); GtkWidget* volume_widget_get_ido_slider(VolumeWidget* self); void volume_widget_update(VolumeWidget* self, gdouble update); +void volume_widget_tidy_up (GtkWidget *widget); +gdouble volume_widget_get_current_volume ( GtkWidget *widget ); G_END_DECLS -- cgit v1.2.3