2016-11-26 23:46:41 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "common.hpp"
|
2016-12-05 19:41:00 +00:00
|
|
|
#include "components/config.hpp"
|
|
|
|
#include "components/logger.hpp"
|
2016-11-26 23:46:41 +00:00
|
|
|
#include "components/types.hpp"
|
2016-12-05 19:41:00 +00:00
|
|
|
#include "events/signal_emitter.hpp"
|
2016-11-26 23:46:41 +00:00
|
|
|
#include "x11/events.hpp"
|
|
|
|
#include "x11/window.hpp"
|
|
|
|
|
|
|
|
POLYBAR_NS
|
|
|
|
|
|
|
|
// fwd
|
|
|
|
class config;
|
|
|
|
class logger;
|
|
|
|
class connection;
|
2016-12-05 19:41:00 +00:00
|
|
|
class signal_emitter;
|
2016-11-26 23:46:41 +00:00
|
|
|
|
|
|
|
class screen : public xpp::event::sink<evt::randr_screen_change_notify> {
|
|
|
|
public:
|
2016-12-09 08:40:46 +00:00
|
|
|
using make_type = unique_ptr<screen>;
|
|
|
|
static make_type make();
|
2016-12-09 08:02:47 +00:00
|
|
|
|
2016-12-05 19:41:00 +00:00
|
|
|
explicit screen(connection& conn, signal_emitter& emitter, const logger& logger, const config& conf);
|
2016-11-26 23:46:41 +00:00
|
|
|
~screen();
|
|
|
|
|
|
|
|
struct size size() const {
|
|
|
|
return m_size;
|
|
|
|
}
|
|
|
|
|
|
|
|
xcb_window_t root() const {
|
|
|
|
return m_root;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void handle(const evt::randr_screen_change_notify& evt);
|
|
|
|
|
|
|
|
private:
|
|
|
|
connection& m_connection;
|
2016-12-05 19:41:00 +00:00
|
|
|
signal_emitter& m_sig;
|
2016-11-26 23:46:41 +00:00
|
|
|
const logger& m_log;
|
|
|
|
const config& m_conf;
|
|
|
|
|
|
|
|
xcb_window_t m_root;
|
2016-12-01 07:41:49 +00:00
|
|
|
xcb_window_t m_proxy{XCB_NONE};
|
2016-11-26 23:46:41 +00:00
|
|
|
|
2016-12-03 15:44:31 +00:00
|
|
|
vector<monitor_t> m_monitors;
|
2016-12-05 19:41:00 +00:00
|
|
|
struct size m_size {
|
|
|
|
0U, 0U
|
|
|
|
};
|
2016-11-26 23:46:41 +00:00
|
|
|
bool m_sigraised{false};
|
|
|
|
};
|
|
|
|
|
|
|
|
POLYBAR_NS_END
|