remove unnecessary Window -> MainWindow casting

mainwindow.h and pavucontrol.h include each other, which makes it
necessary to declare some types before the include directives.
This commit is contained in:
Tanu Kaskinen 2017-11-01 13:47:06 +02:00
parent 107a8dd305
commit 36d82f23aa
4 changed files with 7 additions and 3 deletions

View File

@ -21,6 +21,8 @@
#ifndef mainwindow_h
#define mainwindow_h
class MainWindow;
#include "pavucontrol.h"
#include <pulse/ext-stream-restore.h>
#if HAVE_EXT_DEVICE_RESTORE_API

View File

@ -42,7 +42,7 @@ MainWindow* PavuApplication::create_window()
m = pa_glib_mainloop_new(g_main_context_default());
g_assert(m);
MainWindow* pavucontrol_window = (MainWindow *)pavucontrol_get_window(m, maximize, retry, tab);
MainWindow* pavucontrol_window = pavucontrol_get_window(m, maximize, retry, tab);
pavucontrol_window->signal_hide().connect(
sigc::bind<Gtk::Window*>(sigc::mem_fun(*this,

View File

@ -625,7 +625,7 @@ gboolean connect_to_pulse(gpointer userdata) {
return false;
}
Gtk::Window* pavucontrol_get_window(pa_glib_mainloop *m, bool maximize, bool _retry, int _tab_number) {
MainWindow* pavucontrol_get_window(pa_glib_mainloop *m, bool maximize, bool _retry, int _tab_number) {
MainWindow* mainWindow = NULL;

View File

@ -69,8 +69,10 @@ enum SourceType {
SOURCE_MONITOR,
};
#include "mainwindow.h"
pa_context* get_context(void);
void show_error(const char *txt);
Gtk::Window* pavucontrol_get_window(pa_glib_mainloop *m, bool maximize, bool retry, int tab_number);
MainWindow* pavucontrol_get_window(pa_glib_mainloop *m, bool maximize, bool retry, int tab_number);
#endif