1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-11-11 13:50:56 -05:00
polybar/include/components/screen.hpp
2016-11-27 01:14:02 +01:00

45 lines
806 B
C++

#pragma once
#include "common.hpp"
#include "components/types.hpp"
#include "x11/events.hpp"
#include "x11/window.hpp"
POLYBAR_NS
// fwd
class config;
class logger;
class connection;
class screen : public xpp::event::sink<evt::randr_screen_change_notify> {
public:
explicit screen(connection& conn, const logger& logger, const config& conf);
~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;
const logger& m_log;
const config& m_conf;
xcb_window_t m_root;
xcb_window_t m_proxy;
struct size m_size{0U, 0U};
bool m_sigraised{false};
};
di::injector<unique_ptr<screen>> configure_screen();
POLYBAR_NS_END