polybar-dwm/include/x11/tray_client.hpp

62 lines
1.2 KiB
C++
Raw Normal View History

#pragma once
#include <xcb/xcb.h>
#include "common.hpp"
#include "utils/concurrency.hpp"
#include "x11/xembed.hpp"
POLYBAR_NS
// fwd declarations
class connection;
class tray_client : public non_copyable_mixin {
public:
2022-02-27 20:36:16 +00:00
explicit tray_client(connection& conn, xcb_window_t win, size s);
2016-12-21 22:22:02 +00:00
~tray_client();
tray_client(tray_client&&);
tray_client& operator=(tray_client&&);
2017-01-19 10:11:28 +00:00
unsigned int width() const;
unsigned int height() const;
2016-12-21 22:22:02 +00:00
void clear_window() const;
2016-12-21 22:22:02 +00:00
bool match(const xcb_window_t& win) const;
bool mapped() const;
void mapped(bool state);
2016-12-21 22:22:02 +00:00
xcb_window_t window() const;
void query_xembed();
bool is_xembed_supported() const;
const xembed::info& get_xembed() const;
2016-12-21 22:22:02 +00:00
void ensure_state() const;
2017-01-19 10:11:28 +00:00
void reconfigure(int x, int y) const;
void configure_notify(int x, int y) const;
2016-12-21 22:22:02 +00:00
protected:
connection& m_connection;
xcb_window_t m_window{XCB_NONE};
/**
* Whether the client window supports XEMBED.
*
* A tray client can still work when it doesn't support XEMBED.
*/
bool m_xembed_supported{false};
/**
* _XEMBED_INFO of the client window
*/
xembed::info m_xembed;
2016-12-21 22:22:02 +00:00
bool m_mapped{false};
2022-02-27 20:36:16 +00:00
size m_size;
2016-12-21 22:22:02 +00:00
};
POLYBAR_NS_END