mirror-chatterino2/windows.h

45 lines
765 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-02-02 01:23:26 +01:00
static void updateAll();
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
}
2017-01-26 21:04:01 +01:00
static void load();
static void save();
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
};
} // namespace chatterino
2017-01-15 16:38:30 +01:00
#endif // WINDOWS_H