2016-11-02 19:22:45 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "common.hpp"
|
|
|
|
#include "x11/connection.hpp"
|
|
|
|
|
2016-11-19 05:22:44 +00:00
|
|
|
POLYBAR_NS
|
2016-11-02 19:22:45 +00:00
|
|
|
|
2022-03-07 14:12:42 +00:00
|
|
|
static constexpr uint32_t XEMBED_VERSION = 0;
|
|
|
|
static constexpr uint32_t XEMBED_MAPPED = (1 << 0);
|
|
|
|
|
|
|
|
static constexpr uint32_t XEMBED_EMBEDDED_NOTIFY = 0;
|
|
|
|
static constexpr uint32_t XEMBED_WINDOW_ACTIVATE = 1;
|
|
|
|
static constexpr uint32_t XEMBED_WINDOW_DEACTIVATE = 2;
|
|
|
|
static constexpr uint32_t XEMBED_REQUEST_FOCUS = 3;
|
|
|
|
static constexpr uint32_t XEMBED_FOCUS_IN = 3;
|
|
|
|
static constexpr uint32_t XEMBED_FOCUS_OUT = 4;
|
|
|
|
static constexpr uint32_t XEMBED_FOCUS_NEXT = 5;
|
|
|
|
static constexpr uint32_t XEMBED_FOCUS_PREV = 6;
|
|
|
|
|
|
|
|
static constexpr uint32_t XEMBED_FOCUS_CURRENT = 0;
|
|
|
|
static constexpr uint32_t XEMBED_FOCUS_FIRST = 1;
|
|
|
|
static constexpr uint32_t XEMBED_FOCUS_LAST = 2;
|
2016-11-02 19:22:45 +00:00
|
|
|
|
2021-09-08 16:13:21 +00:00
|
|
|
/**
|
|
|
|
* Max XEMBED version supported.
|
|
|
|
*/
|
2022-03-07 14:12:42 +00:00
|
|
|
static constexpr uint32_t XEMBED_MAX_VERSION = 0;
|
2021-09-08 16:13:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Implementation of parts of the XEMBED spec (as much as needed to get the tray working).
|
|
|
|
*
|
|
|
|
* Ref: https://specifications.freedesktop.org/xembed-spec/xembed-spec-latest.html
|
|
|
|
*/
|
2016-11-02 19:22:45 +00:00
|
|
|
namespace xembed {
|
2021-09-08 16:13:21 +00:00
|
|
|
|
2022-10-31 22:21:00 +00:00
|
|
|
class info {
|
|
|
|
public:
|
|
|
|
void set(const uint32_t* data);
|
|
|
|
|
|
|
|
uint32_t get_version() const;
|
|
|
|
uint32_t get_flags() const;
|
|
|
|
|
|
|
|
bool is_mapped() const;
|
|
|
|
|
|
|
|
string to_string() const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
uint32_t version;
|
|
|
|
uint32_t flags;
|
|
|
|
};
|
|
|
|
|
|
|
|
bool query(connection& conn, xcb_window_t win, info& data);
|
|
|
|
void send_message(connection& conn, xcb_window_t target, uint32_t message, uint32_t d1, uint32_t d2, uint32_t d3);
|
|
|
|
void send_focus_event(connection& conn, xcb_window_t target);
|
|
|
|
void notify_embedded(connection& conn, xcb_window_t win, xcb_window_t embedder, uint32_t version);
|
|
|
|
void notify_activated(connection& conn, xcb_window_t win);
|
|
|
|
void notify_deactivated(connection& conn, xcb_window_t win);
|
|
|
|
void notify_focused(connection& conn, xcb_window_t win, uint32_t focus_type);
|
|
|
|
void notify_unfocused(connection& conn, xcb_window_t win);
|
|
|
|
void unembed(connection& conn, xcb_window_t win, xcb_window_t root);
|
2022-03-07 14:12:42 +00:00
|
|
|
} // namespace xembed
|
2016-11-02 19:22:45 +00:00
|
|
|
|
2016-11-19 05:22:44 +00:00
|
|
|
POLYBAR_NS_END
|