summaryrefslogtreecommitdiff
path: root/src/xcb_resource.cc
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@opera.com>2026-01-12 23:06:20 +0100
committerJoel Klinghed <the_jk@opera.com>2026-01-12 23:06:20 +0100
commitdfeb19b0a83b8ce57d28bf94a4f8d129993d1064 (patch)
treed352908df286058059e306c350d89a07c67049eb /src/xcb_resource.cc
Initial commit
Diffstat (limited to 'src/xcb_resource.cc')
-rw-r--r--src/xcb_resource.cc41
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