summaryrefslogtreecommitdiff
path: root/src/objects.nim
diff options
context:
space:
mode:
authorkitty piapiac <kcp@bsd.computer>2020-08-10 01:41:31 -0700
committerkitty piapiac <kcp@bsd.computer>2020-08-10 01:41:31 -0700
commit1ff1a0f51255958e83ee7c3f17fd0be8c628fc51 (patch)
tree7036f3685c67ba45cfc34dff5449569a8bd80047 /src/objects.nim
parent90c3fb297e2992cd311e85a236d3fef754296591 (diff)
some stuff
Diffstat (limited to 'src/objects.nim')
-rw-r--r--src/objects.nim31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/objects.nim b/src/objects.nim
new file mode 100644
index 0000000..ed83fa8
--- /dev/null
+++ b/src/objects.nim
@@ -0,0 +1,31 @@
+import tables, x11/[x, xlib]
+
+type
+ KeyFunc* = enum
+ closeWindow,
+ nextWindow,
+ setMaster,
+ spawnCustom
+
+ Key* = object
+ mods*: cuint
+ key*: string
+ keyfunc*: KeyFunc
+ command*: string
+
+ WindowManager* = ref object
+ display*: PDisplay
+ screen*: PScreen
+ colormap*: Colormap
+ root*: Window
+
+ clients*: seq[Window]
+ focused*: int
+ keys*: Table[cuint, objects.Key]
+
+proc initKey* (keyfunc: KeyFunc, mods: cuint, key: string, command = ""): Key =
+ return Key(
+ mods: mods,
+ key: key,
+ command: command,
+ keyfunc: keyfunc) \ No newline at end of file