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 {
|
2016-12-14 09:09:11 -05:00
|
|
|
shared_ptr<Display> get_display();
|
|
|
|
shared_ptr<Visual> get_visual(int screen = 0);
|
2016-11-02 15:22:45 -04:00
|
|
|
|
2016-12-14 09:09:11 -05:00
|
|
|
Colormap create_colormap(int screen = 0);
|
2016-11-02 15:22:45 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* RAII wrapper for Xlib display locking
|
|
|
|
*/
|
2016-12-14 09:09:11 -05:00
|
|
|
class display_lock {
|
2016-11-02 15:22:45 -04:00
|
|
|
public:
|
2016-12-14 09:09:11 -05:00
|
|
|
explicit display_lock(shared_ptr<Display>&& display);
|
|
|
|
~display_lock();
|
2016-11-02 15:22:45 -04:00
|
|
|
|
|
|
|
protected:
|
2016-12-14 09:09:11 -05:00
|
|
|
shared_ptr<Display> m_display;
|
2016-11-02 15:22:45 -04:00
|
|
|
};
|
|
|
|
|
2016-12-14 09:09:11 -05: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
|