aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-03-02 10:20:25 +0000
committerConor Curran <conor.curran@canonical.com>2010-03-02 10:20:25 +0000
commitbe2b2e73044d5ba0c656431f0d19723af6b55946 (patch)
tree0916a0332591d2dc3b048c40164a5803098842ee /src
parenta6152fcf5ec57d7252617a7ede36aa53de7f2930 (diff)
downloadayatana-indicator-sound-be2b2e73044d5ba0c656431f0d19723af6b55946.tar.gz
ayatana-indicator-sound-be2b2e73044d5ba0c656431f0d19723af6b55946.tar.bz2
ayatana-indicator-sound-be2b2e73044d5ba0c656431f0d19723af6b55946.zip
refactored the indicator tests so as no c file needs to be included
Diffstat (limited to 'src')
-rw-r--r--src/indicator-sound.c11
-rw-r--r--src/indicator-sound.h5
2 files changed, 14 insertions, 2 deletions
diff --git a/src/indicator-sound.c b/src/indicator-sound.c
index 546f404..3aca517 100644
--- a/src/indicator-sound.c
+++ b/src/indicator-sound.c
@@ -300,11 +300,22 @@ gint get_state()
return current_state;
}
+gchar* get_state_image_name(gint state)
+{
+ return g_hash_table_lookup(volume_states, GINT_TO_POINTER(state));
+}
+
void prepare_for_tests(IndicatorObject *io)
{
+ prepare_state_machine();
get_icon(io);
}
+void tidy_up_hash()
+{
+ g_hash_table_destroy(volume_states);
+}
+
static void update_state(const gint state)
{
/* g_debug("update state beginning - previous_state = %i", previous_state);*/
diff --git a/src/indicator-sound.h b/src/indicator-sound.h
index eaf8948..6d0c85c 100644
--- a/src/indicator-sound.h
+++ b/src/indicator-sound.h
@@ -21,9 +21,10 @@ You should have received a copy of the GNU General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
+// Essentially these are all exported to faciltiate testing
void prepare_state_machine();
void determine_state_from_volume(gdouble volume_percent);
gint get_state();
-// Not nice
+gchar* get_state_image_name(gint state);
void prepare_for_tests(IndicatorObject * io);
+void tidy_up_hash();