From 9a0a7255bfdcc1441277e211b4d45dffedb34e1f Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Mon, 24 Jan 2011 09:24:42 -0600 Subject: refactoring the indicator --- src/sound-state-manager.h | 53 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/sound-state-manager.h (limited to 'src/sound-state-manager.h') diff --git a/src/sound-state-manager.h b/src/sound-state-manager.h new file mode 100644 index 0000000..5f26682 --- /dev/null +++ b/src/sound-state-manager.h @@ -0,0 +1,53 @@ +/* +Copyright 2011 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 _SOUND_STATE_MANAGER_H_ +#define _SOUND_STATE_MANAGER_H_ + +#include + +G_BEGIN_DECLS + +#define SOUND_TYPE_STATE_MANAGER (sound_state_manager_get_type ()) +#define SOUND_STATE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOUND_TYPE_STATE_MANAGER, SoundStateManager)) +#define SOUND_STATE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SOUND_TYPE_STATE_MANAGER, SoundStateManagerClass)) +#define SOUND_IS_STATE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SOUND_TYPE_STATE_MANAGER)) +#define SOUND_IS_STATE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SOUND_TYPE_STATE_MANAGER)) +#define SOUND_STATE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SOUND_TYPE_STATE_MANAGER, SoundStateManagerClass)) + +typedef struct _SoundStateManagerClass SoundStateManagerClass; +typedef struct _SoundStateManager SoundStateManager; + +struct _SoundStateManagerClass +{ + GObjectClass parent_class; +}; + +struct _SoundStateManager +{ + GObject parent_instance; +}; + +GType sound_state_manager_get_type (void) G_GNUC_CONST; +void sound_state_manager_prepare_state_machine(SoundStateManager* self); +SoundStateManager* sound_state_manager_new (GDProxy* proxy); +gchar* sound_state_manager_get_current_icon_name (SoundStateManager* self); +G_END_DECLS + +#endif /* _SOUND_STATE_MANAGER_H_ */ -- cgit v1.2.3 From 49df0fb3ea29693bdb8decf51f4da055c8e1a7cb Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Mon, 24 Jan 2011 16:26:21 -0600 Subject: indicator side almost up and going --- src/sound-state-manager.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/sound-state-manager.h') diff --git a/src/sound-state-manager.h b/src/sound-state-manager.h index 5f26682..1799822 100644 --- a/src/sound-state-manager.h +++ b/src/sound-state-manager.h @@ -21,6 +21,7 @@ with this program. If not, see . #define _SOUND_STATE_MANAGER_H_ #include +#include "common-defs.h" G_BEGIN_DECLS @@ -45,9 +46,13 @@ struct _SoundStateManager }; GType sound_state_manager_get_type (void) G_GNUC_CONST; -void sound_state_manager_prepare_state_machine(SoundStateManager* self); -SoundStateManager* sound_state_manager_new (GDProxy* proxy); -gchar* sound_state_manager_get_current_icon_name (SoundStateManager* self); + +void sound_state_manager_style_changed_cb (GtkWidget *widget, gpointer user_data); +GtkImage* sound_state_manager_get_current_icon (SoundStateManager* self); +SoundState sound_state_manager_get_current_state (SoundStateManager* self); +void sound_state_manager_connect_to_dbus (SoundStateManager* self, + GDProxy* proxy); + G_END_DECLS #endif /* _SOUND_STATE_MANAGER_H_ */ -- cgit v1.2.3 From 729ff587783dcf571b4a94132b57bce695a5e30f Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Mon, 24 Jan 2011 17:29:31 -0600 Subject: compiling ... --- src/sound-state-manager.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sound-state-manager.h') diff --git a/src/sound-state-manager.h b/src/sound-state-manager.h index 1799822..ef8fc40 100644 --- a/src/sound-state-manager.h +++ b/src/sound-state-manager.h @@ -20,7 +20,7 @@ with this program. If not, see . #ifndef _SOUND_STATE_MANAGER_H_ #define _SOUND_STATE_MANAGER_H_ -#include +#include #include "common-defs.h" G_BEGIN_DECLS @@ -51,7 +51,7 @@ void sound_state_manager_style_changed_cb (GtkWidget *widget, gpointer user_data GtkImage* sound_state_manager_get_current_icon (SoundStateManager* self); SoundState sound_state_manager_get_current_state (SoundStateManager* self); void sound_state_manager_connect_to_dbus (SoundStateManager* self, - GDProxy* proxy); + GDBusProxy* proxy); G_END_DECLS -- cgit v1.2.3 From 8bbf7ea5805ed69a2d7450065a558398a623525f Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 26 Jan 2011 16:08:46 -0600 Subject: blocking state now workings as expected --- src/sound-state-manager.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/sound-state-manager.h') diff --git a/src/sound-state-manager.h b/src/sound-state-manager.h index ef8fc40..76264e2 100644 --- a/src/sound-state-manager.h +++ b/src/sound-state-manager.h @@ -47,7 +47,9 @@ struct _SoundStateManager GType sound_state_manager_get_type (void) G_GNUC_CONST; -void sound_state_manager_style_changed_cb (GtkWidget *widget, gpointer user_data); +void sound_state_manager_style_changed_cb (GtkWidget *widget, + GtkStyle *previous_style, + gpointer user_data); GtkImage* sound_state_manager_get_current_icon (SoundStateManager* self); SoundState sound_state_manager_get_current_state (SoundStateManager* self); void sound_state_manager_connect_to_dbus (SoundStateManager* self, -- cgit v1.2.3 From 46cbdc7d1607b20c1bba67df4471f8e5d1243c3d Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 26 Jan 2011 16:40:38 -0600 Subject: last minute tidy up --- src/sound-state-manager.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/sound-state-manager.h') diff --git a/src/sound-state-manager.h b/src/sound-state-manager.h index 76264e2..d73d5d9 100644 --- a/src/sound-state-manager.h +++ b/src/sound-state-manager.h @@ -54,6 +54,12 @@ GtkImage* sound_state_manager_get_current_icon (SoundStateManager* self); SoundState sound_state_manager_get_current_state (SoundStateManager* self); void sound_state_manager_connect_to_dbus (SoundStateManager* self, GDBusProxy* proxy); +void sound_state_manager_deal_with_disconnect (SoundStateManager* self); +void sound_state_manager_get_state_cb (GObject *object, + GAsyncResult *res, + gpointer user_data); + + G_END_DECLS -- cgit v1.2.3