mirror-chatterino2/src/windowmanager.hpp

50 lines
1.1 KiB
C++
Raw Normal View History

#pragma once
2017-01-15 16:38:30 +01:00
2017-11-12 17:21:50 +01:00
#include "widgets/window.hpp"
2017-01-15 16:38:30 +01:00
2017-04-13 19:25:33 +02:00
#include <mutex>
2017-01-15 16:38:30 +01:00
2017-01-18 21:30:23 +01:00
namespace chatterino {
class ChannelManager;
class ColorScheme;
class CompletionManager;
2017-04-12 17:46:44 +02:00
class WindowManager
2017-01-15 16:38:30 +01:00
{
public:
explicit WindowManager(ChannelManager &_channelManager, ColorScheme &_colorScheme,
CompletionManager &_completionManager);
2017-11-12 17:21:50 +01:00
static WindowManager *instance;
ChannelManager &channelManager;
ColorScheme &colorScheme;
CompletionManager &completionManager;
2017-01-15 16:38:30 +01:00
2017-04-13 19:25:33 +02:00
void layoutVisibleChatWidgets(Channel *channel = nullptr);
void repaintVisibleChatWidgets(Channel *channel = nullptr);
void repaintGifEmotes();
// void updateAll();
2017-04-13 19:25:33 +02:00
2017-11-12 17:21:50 +01:00
widgets::Window &getMainWindow();
widgets::Window &getCurrentWindow();
widgets::Window &createWindow();
2017-04-13 19:25:33 +02:00
void load();
void save();
2017-01-26 21:04:01 +01:00
2017-09-17 02:13:57 +02:00
boost::signals2::signal<void()> repaintGifs;
boost::signals2::signal<void()> layout;
2017-09-17 02:13:57 +02:00
2017-01-15 16:38:30 +01:00
private:
std::mutex windowMutex;
2017-11-12 17:21:50 +01:00
std::vector<widgets::Window *> windows;
2017-01-15 16:38:30 +01:00
// TODO(pajlada): Store as a value instead of a pointer
2017-11-12 17:21:50 +01:00
widgets::Window *mainWindow = nullptr;
2017-01-15 16:38:30 +01:00
};
2017-04-14 17:52:22 +02:00
} // namespace chatterino