1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-11-11 13:50:56 -05:00
polybar/include/x11/xlib.hpp

31 lines
519 B
C++
Raw Normal View History

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