diff options
Diffstat (limited to 'src/xcb_resource.cc')
| -rw-r--r-- | src/xcb_resource.cc | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/xcb_resource.cc b/src/xcb_resource.cc new file mode 100644 index 0000000..8005c6f --- /dev/null +++ b/src/xcb_resource.cc @@ -0,0 +1,41 @@ +#include "xcb_resource.hh" + +#include "xcb_connection.hh" + +#include <memory> +#include <utility> +#include <xcb/xproto.h> + +namespace xcb { + +unique_wnd make_unique_wnd(shared_conn conn) { + return std::make_unique<xcb_resource<xcb_window_t, internal::WndDeleter>>( + std::move(conn)); +} + +shared_wnd make_shared_wnd(shared_conn conn) { + return std::make_shared<xcb_resource<xcb_window_t, internal::WndDeleter>>( + std::move(conn)); +} + +unique_gc make_unique_gc(shared_conn conn) { + return std::make_unique<xcb_resource<xcb_gcontext_t, internal::GCDeleter>>( + std::move(conn)); +} + +shared_gc make_shared_gc(shared_conn conn) { + return std::make_shared<xcb_resource<xcb_gcontext_t, internal::GCDeleter>>( + std::move(conn)); +} + +unique_font make_unique_font(shared_conn conn) { + return std::make_unique<xcb_resource<xcb_font_t, internal::FontDeleter>>( + std::move(conn)); +} + +shared_font make_shared_font(shared_conn conn) { + return std::make_shared<xcb_resource<xcb_font_t, internal::FontDeleter>>( + std::move(conn)); +} + +} // namespace xcb |
