polybar-dwm/include/x11/xlib.hpp

31 lines
519 B
C++
Raw Normal View History

2016-11-02 19:22:45 +00:00
#pragma once
#include <X11/Xutil.h>
#include "common.hpp"
2016-11-19 05:22:44 +00:00
POLYBAR_NS
2016-11-02 19:22:45 +00:00
namespace xlib {
shared_ptr<Display> get_display();
shared_ptr<Visual> get_visual(int screen = 0, uint8_t depth = 32);
2016-11-02 19:22:45 +00:00
Colormap create_colormap(int screen = 0);
2016-11-02 19:22:45 +00:00
/**
* RAII wrapper for Xlib display locking
*/
class display_lock {
2016-11-02 19:22:45 +00:00
public:
explicit display_lock(shared_ptr<Display>&& display);
~display_lock();
2016-11-02 19:22:45 +00:00
protected:
shared_ptr<Display> m_display;
2016-11-02 19:22:45 +00:00
};
inline auto make_display_lock();
2016-11-02 19:22:45 +00:00
}
2016-11-19 05:22:44 +00:00
POLYBAR_NS_END