From a8357b3dc21ee666bd81aa2e1f3e27170354d226 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Sun, 15 Mar 2009 13:08:22 +0000 Subject: Move common setup into a shared header --- src/Makefile.am | 3 ++- src/channelwidget.cc | 2 ++ src/channelwidget.h | 11 +---------- src/minimalstreamwidget.h | 7 +------ src/pavucontrol.cc | 11 +---------- src/pavucontrol.h | 37 +++++++++++++++++++++++++++++++++++++ src/streamwidget.h | 9 +-------- 7 files changed, 45 insertions(+), 35 deletions(-) create mode 100644 src/pavucontrol.h (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 5df4619..4a228b8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -28,7 +28,8 @@ pavucontrol_SOURCES= \ minimalstreamwidget.h minimalstreamwidget.cc \ channelwidget.h channelwidget.cc \ streamwidget.h streamwidget.cc \ - pavucontrol.cc i18n.h + pavucontrol.h pavucontrol.cc \ + i18n.h pavucontrol_LDADD=$(AM_LDADD) $(GUILIBS_LIBS) $(PULSE_LIBS) pavucontrol_CXXFLAGS=$(AM_CXXFLAGS) $(GUILIBS_CFLAGS) $(PULSE_CFLAGS) -DLOCALEDIR=\"$(localedir)\" diff --git a/src/channelwidget.cc b/src/channelwidget.cc index f30a01a..d6832a3 100644 --- a/src/channelwidget.cc +++ b/src/channelwidget.cc @@ -21,6 +21,8 @@ #include "channelwidget.h" #include "streamwidget.h" +#include "i18n.h" + static bool show_decibel = true; /*** ChannelWidget ***/ diff --git a/src/channelwidget.h b/src/channelwidget.h index a999783..3472420 100644 --- a/src/channelwidget.h +++ b/src/channelwidget.h @@ -21,19 +21,10 @@ #ifndef channelwidget_h #define channelwidget_h -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include +#include "pavucontrol.h" #include -#include - -#include "i18n.h" - class StreamWidget; class ChannelWidget : public Gtk::EventBox { diff --git a/src/minimalstreamwidget.h b/src/minimalstreamwidget.h index c2f5b72..af5c9b5 100644 --- a/src/minimalstreamwidget.h +++ b/src/minimalstreamwidget.h @@ -21,12 +21,7 @@ #ifndef minimalstreamwidget_h #define minimalstreamwidget_h -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include +#include "pavucontrol.h" class MinimalStreamWidget : public Gtk::VBox { public: diff --git a/src/pavucontrol.cc b/src/pavucontrol.cc index 597591e..64b4d8c 100644 --- a/src/pavucontrol.cc +++ b/src/pavucontrol.cc @@ -18,20 +18,15 @@ along with pavucontrol. If not, see . ***/ -#ifdef HAVE_CONFIG_H -#include -#endif +#include "pavucontrol.h" #include #include -#include -#include #include #include -#include #include #include @@ -40,10 +35,6 @@ #include "channelwidget.h" #include "streamwidget.h" -#ifndef GLADE_FILE -#define GLADE_FILE "pavucontrol.glade" -#endif - static pa_context *context = NULL; static int n_outstanding = 0; diff --git a/src/pavucontrol.h b/src/pavucontrol.h new file mode 100644 index 0000000..55256d7 --- /dev/null +++ b/src/pavucontrol.h @@ -0,0 +1,37 @@ +/*** + This file is part of pavucontrol. + + Copyright 2006-2008 Lennart Poettering + Copyright 2009 Colin Guthrie + + pavucontrol is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + pavucontrol is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY 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 pavucontrol. If not, see . +***/ + +#ifndef pavucontrol_h +#define pavucontrol_h + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include + +#ifndef GLADE_FILE +#define GLADE_FILE "pavucontrol.glade" +#endif + +#endif diff --git a/src/streamwidget.h b/src/streamwidget.h index da4c8b8..c4b82bb 100644 --- a/src/streamwidget.h +++ b/src/streamwidget.h @@ -21,14 +21,7 @@ #ifndef streamwidget_h #define streamwidget_h -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include - -#include +#include "pavucontrol.h" #include "minimalstreamwidget.h" -- cgit