summaryrefslogtreecommitdiff
path: root/lib/hyprland/structs.vala
diff options
context:
space:
mode:
authorAylur <[email protected]>2024-09-01 14:17:36 +0200
committerAylur <[email protected]>2024-09-01 14:17:36 +0200
commit3e3f045d650a839d21f7b649da7aa5c19bd2e38b (patch)
tree9a974eb0d38932d474940288c662bd1f01ea3088 /lib/hyprland/structs.vala
parent408faee16911ccfaa3e7dad69f9938fd4a696704 (diff)
monorepo structuring
Diffstat (limited to 'lib/hyprland/structs.vala')
-rw-r--r--lib/hyprland/structs.vala42
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/hyprland/structs.vala b/lib/hyprland/structs.vala
new file mode 100644
index 0000000..25f70c3
--- /dev/null
+++ b/lib/hyprland/structs.vala
@@ -0,0 +1,42 @@
+namespace AstalHyprland {
+public class Bind : Object {
+ public bool locked { get; construct set; }
+ public bool mouse { get; construct set; }
+ public bool release { get; construct set; }
+ public bool repeat { get; construct set; }
+ public bool non_consuming { get; construct set; }
+ public int64 modmask { get; construct set; }
+ public string submap { get; construct set; }
+ public string key { get; construct set; }
+ public int64 keycode { get; construct set; }
+ public bool catch_all { get; construct set; }
+ public string dispatcher { get; construct set; }
+ public string arg { get; construct set; }
+
+ internal Bind.from_json(Json.Object obj) {
+ locked = obj.get_boolean_member("locked");
+ mouse = obj.get_boolean_member("mouse");
+ release = obj.get_boolean_member("release");
+ repeat = obj.get_boolean_member("repeat");
+ non_consuming = obj.get_boolean_member("non_consuming");
+ modmask = obj.get_int_member("modmask");
+ submap = obj.get_string_member("submap");
+ key = obj.get_string_member("key");
+ keycode = obj.get_int_member("keycode");
+ catch_all = obj.get_boolean_member("catch_all");
+ dispatcher = obj.get_string_member("dispatcher");
+ arg = obj.get_string_member("arg");
+ }
+}
+
+public class Position : Object {
+ public int x { get; construct set; }
+ public int y { get; construct set; }
+
+ internal Position.cursorpos(string pos) {
+ var xy = pos.split(",");
+ x = int.parse(xy[0].strip());
+ y = int.parse(xy[1].strip());
+ }
+}
+}