mirror-chatterino2/windows.h

40 lines
661 B
C
Raw Normal View History

2017-01-15 16:38:30 +01:00
#ifndef WINDOWS_H
#define WINDOWS_H
2017-01-18 21:30:23 +01:00
#include "widgets/mainwindow.h"
2017-01-15 16:38:30 +01:00
#include <QMutex>
2017-01-18 21:30:23 +01:00
namespace chatterino {
2017-01-15 16:38:30 +01:00
class Windows
{
public:
static void layoutVisibleChatWidgets(Channel *channel = NULL);
static void repaintVisibleChatWidgets(Channel *channel = NULL);
2017-01-15 16:38:30 +01:00
2017-01-18 21:52:36 +01:00
static widgets::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) {
2017-01-18 21:52:36 +01:00
mainWindow = new widgets::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 21:52:36 +01:00
static widgets::MainWindow *mainWindow;
2017-01-15 16:38:30 +01:00
};
2017-01-18 21:30:23 +01:00
}
2017-01-15 16:38:30 +01:00
#endif // WINDOWS_H