summaryrefslogtreecommitdiff
path: root/src/xcb_resource.cc
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2021-01-27 22:06:49 +0100
committerJoel Klinghed <the_jk@spawned.biz>2021-01-27 22:06:49 +0100
commit06950aab233de6a2f47293d59575bb42f6131660 (patch)
tree62f6eed4a6d35414f656d22b9ac7420849018a11 /src/xcb_resource.cc
parent1ef9c463f1efc1adfb62e42ab3dd17e8c6394373 (diff)
Complete rewrite using C++ and with shared state support
Diffstat (limited to 'src/xcb_resource.cc')
-rw-r--r--src/xcb_resource.cc37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/xcb_resource.cc b/src/xcb_resource.cc
new file mode 100644
index 0000000..b64b611
--- /dev/null
+++ b/src/xcb_resource.cc
@@ -0,0 +1,37 @@
+#include "common.hh"
+
+#include "xcb_resource.hh"
+
+namespace xcb {
+
+unique_wnd make_unique_wnd(shared_conn conn) {
+ return std::make_unique<xcb_resource<xcb_window_t,
+ internal::WndDeleter>>(conn);
+}
+
+shared_wnd make_shared_wnd(shared_conn conn) {
+ return std::make_shared<xcb_resource<xcb_window_t,
+ internal::WndDeleter>>(conn);
+}
+
+unique_gc make_unique_gc(shared_conn conn) {
+ return std::make_unique<xcb_resource<xcb_gcontext_t,
+ internal::GCDeleter>>(conn);
+}
+
+shared_gc make_shared_gc(shared_conn conn) {
+ return std::make_shared<xcb_resource<xcb_gcontext_t,
+ internal::GCDeleter>>(conn);
+}
+
+unique_font make_unique_font(shared_conn conn) {
+ return std::make_unique<xcb_resource<xcb_font_t,
+ internal::FontDeleter>>(conn);
+}
+
+shared_font make_shared_font(shared_conn conn) {
+ return std::make_shared<xcb_resource<xcb_font_t,
+ internal::FontDeleter>>(conn);
+}
+
+} // namespace xcb