summaryrefslogtreecommitdiff
path: root/lib/CWayland
diff options
context:
space:
mode:
authorHannes Schulze <contact@haschu.me>2026-04-11 19:43:29 +0200
committerHannes Schulze <contact@haschu.me>2026-04-11 19:43:29 +0200
commit3d722b15a21977931a0bfa99bd8c6a235682a6d9 (patch)
treebf7343024e1cf0d80b1b7bd1de964e97fa9c86d7 /lib/CWayland
parentdab858e92dfa5705d1aef7259e03b25747372d95 (diff)
start implementing wm
Diffstat (limited to 'lib/CWayland')
-rw-r--r--lib/CWayland/CWayland.cc15
-rw-r--r--lib/CWayland/CWayland.h3
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/CWayland/CWayland.cc b/lib/CWayland/CWayland.cc
index db2983d..940584a 100644
--- a/lib/CWayland/CWayland.cc
+++ b/lib/CWayland/CWayland.cc
@@ -1292,3 +1292,18 @@ lean_obj_res waylean_proxy_get_type(b_lean_obj_arg proxy_obj)
auto name = wl_proxy_get_interface(proxy)->name;
return lean_io_result_mk_ok(lean_mk_string(name));
}
+
+// Proxy.isEqual : (x y : @& Proxy) → Bool
+lean_obj_res waylean_proxy_is_equal(b_lean_obj_arg x, b_lean_obj_arg y)
+{
+ auto x_proxy = static_cast<wl_proxy*>(lean_get_external_data(x));
+ auto y_proxy = static_cast<wl_proxy*>(lean_get_external_data(y));
+ return lean_box(x_proxy == y_proxy ? 1 : 0);
+}
+
+// Proxy.hash : (x : @& Proxy) → UInt64
+lean_obj_res waylean_proxy_hash(b_lean_obj_arg x)
+{
+ auto proxy = static_cast<wl_proxy*>(lean_get_external_data(x));
+ return lean_box_uint64(wl_proxy_get_id(proxy));
+} \ No newline at end of file
diff --git a/lib/CWayland/CWayland.h b/lib/CWayland/CWayland.h
index 1eeb98f..e4a6897 100644
--- a/lib/CWayland/CWayland.h
+++ b/lib/CWayland/CWayland.h
@@ -83,6 +83,9 @@ lean_obj_res waylean_proxy_listen (b_lean_obj_arg proxy,
lean_obj_arg handler);
lean_obj_res waylean_proxy_keep (b_lean_obj_arg proxy);
lean_obj_res waylean_proxy_get_type (b_lean_obj_arg proxy);
+lean_obj_res waylean_proxy_is_equal (b_lean_obj_arg x,
+ b_lean_obj_arg y);
+lean_obj_res waylean_proxy_hash (b_lean_obj_arg x);
#ifdef __cplusplus
}