From 5f1d857f263edd696fe1d9af793a26e9bbd5a6c3 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 12 Jan 2011 12:44:27 -0600 Subject: moving towards an encapsulated mute --- src/mute-menu-item.h | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/mute-menu-item.h (limited to 'src/mute-menu-item.h') diff --git a/src/mute-menu-item.h b/src/mute-menu-item.h new file mode 100644 index 0000000..36f5e69 --- /dev/null +++ b/src/mute-menu-item.h @@ -0,0 +1,55 @@ +/* +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 __MUTE_MENU_ITEM_H__ +#define __MUTE_MENU_ITEM_H__ + +#include +#include + +#include + +G_BEGIN_DECLS + +#define MUTE_MENU_ITEM_TYPE (mute_menu_item_get_type ()) +#define MUTE_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MUTE_MENU_ITEM_TYPE, MuteMenuItem)) +#define MUTE_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MUTE_MENU_ITEM_TYPE, MuteMenuItemClass)) +#define IS_MUTE_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MUTE_MENU_ITEM_TYPE)) +#define IS_MUTE_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MUTE_MENU_ITEM_TYPE)) +#define MUTE_MENU_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MUTE_MENU_ITEM_TYPE, MuteMenuItemClass)) + +typedef struct _MuteMenuItem MuteMenuItem; +typedef struct _MuteMenuItemClass MuteMenuItemClass; + +struct _MuteMenuItemClass { + DbusmenuMenuitemClass parent_class; +}; + +struct _MuteMenuItem { + DbusmenuMenuitem parent; +}; + +GType mute_menu_item_get_type (void); + +MuteMenuItem* mute_menu_item_new(); + +G_END_DECLS + +#endif + -- cgit v1.2.3 From 055df674f70f7961c6d47e3b031881e142f6dea8 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 12 Jan 2011 14:33:30 -0600 Subject: rf underway --- src/mute-menu-item.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mute-menu-item.h') diff --git a/src/mute-menu-item.h b/src/mute-menu-item.h index 36f5e69..d7232d0 100644 --- a/src/mute-menu-item.h +++ b/src/mute-menu-item.h @@ -49,6 +49,8 @@ GType mute_menu_item_get_type (void); MuteMenuItem* mute_menu_item_new(); +void mute_menu_item_update(MuteMenuItem* item, gboolean update); + G_END_DECLS #endif -- cgit v1.2.3 From 6db28ce9134db40a0808a3c67df5f9dd223303b5 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 12 Jan 2011 17:55:05 -0600 Subject: stage one of the refactor on the server side complete --- src/mute-menu-item.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mute-menu-item.h') diff --git a/src/mute-menu-item.h b/src/mute-menu-item.h index d7232d0..1432de1 100644 --- a/src/mute-menu-item.h +++ b/src/mute-menu-item.h @@ -50,6 +50,7 @@ GType mute_menu_item_get_type (void); MuteMenuItem* mute_menu_item_new(); void mute_menu_item_update(MuteMenuItem* item, gboolean update); +void mute_menu_item_enable(MuteMenuItem* item, gboolean active); G_END_DECLS -- cgit v1.2.3 From a31cd4c1759ff5b8cc75a0d43e6a45a4a5573b3a Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 26 Jan 2011 13:24:20 -0600 Subject: refactor complete --- src/mute-menu-item.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/mute-menu-item.h') diff --git a/src/mute-menu-item.h b/src/mute-menu-item.h index 1432de1..8240441 100644 --- a/src/mute-menu-item.h +++ b/src/mute-menu-item.h @@ -22,7 +22,6 @@ with this program. If not, see . #include #include - #include G_BEGIN_DECLS @@ -38,19 +37,21 @@ typedef struct _MuteMenuItem MuteMenuItem; typedef struct _MuteMenuItemClass MuteMenuItemClass; struct _MuteMenuItemClass { - DbusmenuMenuitemClass parent_class; + GObjectClass parent_class; }; struct _MuteMenuItem { - DbusmenuMenuitem parent; + GObject parent; }; GType mute_menu_item_get_type (void); -MuteMenuItem* mute_menu_item_new(); +MuteMenuItem* mute_menu_item_new (); + +void mute_menu_item_update (MuteMenuItem* item, gboolean update); +void mute_menu_item_enable (MuteMenuItem* item, gboolean active); -void mute_menu_item_update(MuteMenuItem* item, gboolean update); -void mute_menu_item_enable(MuteMenuItem* item, gboolean active); +DbusmenuMenuitem* mute_menu_item_get_button (MuteMenuItem* item); G_END_DECLS -- cgit v1.2.3 From 4e0d98ea31ff315c03d2a297af0743cd92acfedf Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 27 Jan 2011 16:10:48 -0600 Subject: sink automatically unmuted now when slider is manually changed in accordance with the spec revision, plus some tidy ups --- src/mute-menu-item.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mute-menu-item.h') diff --git a/src/mute-menu-item.h b/src/mute-menu-item.h index 8240441..81a4b33 100644 --- a/src/mute-menu-item.h +++ b/src/mute-menu-item.h @@ -50,10 +50,10 @@ MuteMenuItem* mute_menu_item_new (); void mute_menu_item_update (MuteMenuItem* item, gboolean update); void mute_menu_item_enable (MuteMenuItem* item, gboolean active); +gboolean mute_menu_item_is_muted (MuteMenuItem* item); DbusmenuMenuitem* mute_menu_item_get_button (MuteMenuItem* item); G_END_DECLS -#endif - +#endif \ No newline at end of file -- cgit v1.2.3