2017-06-07 10:09:24 +02:00
|
|
|
#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-01-18 21:30:23 +01:00
|
|
|
namespace chatterino {
|
|
|
|
|
2017-06-13 21:13:58 +02:00
|
|
|
class ChannelManager;
|
2017-06-26 16:41:20 +02:00
|
|
|
class ColorScheme;
|
2017-07-23 14:16:13 +02:00
|
|
|
class CompletionManager;
|
2017-06-13 21:13:58 +02:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
class WindowManager
|
2017-01-15 16:38:30 +01:00
|
|
|
{
|
|
|
|
public:
|
2017-07-23 14:16:13 +02:00
|
|
|
explicit WindowManager(ChannelManager &_channelManager, ColorScheme &_colorScheme,
|
|
|
|
CompletionManager &_completionManager);
|
2017-06-26 16:41:20 +02:00
|
|
|
|
2017-11-12 17:21:50 +01:00
|
|
|
static WindowManager *instance;
|
|
|
|
|
2017-06-26 16:41:20 +02:00
|
|
|
ChannelManager &channelManager;
|
|
|
|
ColorScheme &colorScheme;
|
2017-07-23 14:16:13 +02:00
|
|
|
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();
|
2017-12-14 00:25:06 +01:00
|
|
|
void initMainWindow();
|
2017-09-16 00:05:06 +02:00
|
|
|
// void updateAll();
|
2017-04-13 19:25:33 +02:00
|
|
|
|
2017-11-12 17:21:50 +01:00
|
|
|
widgets::Window &getMainWindow();
|
2017-12-14 00:25:06 +01:00
|
|
|
widgets::Window &getSelectedWindow();
|
2017-11-12 17:21:50 +01:00
|
|
|
widgets::Window &createWindow();
|
2017-04-13 19:25:33 +02:00
|
|
|
|
2017-12-14 00:25:06 +01:00
|
|
|
int windowCount();
|
|
|
|
widgets::Window *windowAt(int index);
|
|
|
|
|
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;
|
2017-09-21 17:34:41 +02:00
|
|
|
boost::signals2::signal<void()> layout;
|
2017-09-17 02:13:57 +02:00
|
|
|
|
2017-01-15 16:38:30 +01:00
|
|
|
private:
|
2017-11-12 17:21:50 +01:00
|
|
|
std::vector<widgets::Window *> windows;
|
2017-01-15 16:38:30 +01:00
|
|
|
|
2017-11-12 17:21:50 +01:00
|
|
|
widgets::Window *mainWindow = nullptr;
|
2017-12-14 00:25:06 +01:00
|
|
|
widgets::Window *selectedWindow = nullptr;
|
2017-01-15 16:38:30 +01:00
|
|
|
};
|
2017-01-28 22:35:23 +01:00
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
} // namespace chatterino
|