mirror-chatterino2/windows.h

37 lines
600 B
C
Raw Normal View History

2017-01-15 16:38:30 +01:00
#ifndef WINDOWS_H
#define WINDOWS_H
#include "mainwindow.h"
#include <QMutex>
class Windows
{
public:
static void layoutVisibleChatWidgets(Channel *channel = NULL);
static void repaintVisibleChatWidgets(Channel *channel = NULL);
2017-01-15 16:38:30 +01:00
static MainWindow &
2017-01-18 04:33:30 +01:00
getMainWindow()
2017-01-15 16:38:30 +01:00
{
2017-01-18 04:33:30 +01:00
windowMutex.lock();
if (mainWindow == NULL) {
mainWindow = new MainWindow();
2017-01-15 16:38:30 +01:00
}
2017-01-18 04:33:30 +01:00
windowMutex.unlock();
2017-01-15 16:38:30 +01:00
2017-01-18 04:33:30 +01:00
return *mainWindow;
2017-01-15 16:38:30 +01:00
}
private:
Windows()
{
}
2017-01-18 04:33:30 +01:00
static QMutex windowMutex;
2017-01-15 16:38:30 +01:00
2017-01-18 04:33:30 +01:00
static MainWindow *mainWindow;
2017-01-15 16:38:30 +01:00
};
#endif // WINDOWS_H