aboutsummaryrefslogtreecommitdiffstats
path: root/gui/layout/layout.go
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2024-01-19 22:07:42 -0500
committerSam Anthony <sam@samanthony.xyz>2024-01-19 22:07:42 -0500
commit54d71a24b6eaa191b2777f6070de252fc26801a3 (patch)
tree1d26f49dfcacc5578b4e6c91e8ffb31b09a9f662 /gui/layout/layout.go
parent39a3b948e525fe2b22b90e07df323ab77f6a81f6 (diff)
downloadvolute-54d71a24b6eaa191b2777f6070de252fc26801a3.zip
add layout from Keitio
Diffstat (limited to 'gui/layout/layout.go')
-rw-r--r--gui/layout/layout.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/gui/layout/layout.go b/gui/layout/layout.go
new file mode 100644
index 0000000..4d8e616
--- /dev/null
+++ b/gui/layout/layout.go
@@ -0,0 +1,20 @@
+package layout
+
+import (
+ "image"
+)
+
+// Layout represents any graphical layout
+//
+// Lay represents the way to divide space among your childs.
+// It takes a parameter of how much space is available,
+// and returns where exactly to put its childs.
+//
+// Intercept transforms an Env channel to another.
+// This way the Layout can emit its own Events, re-emit previous ones,
+// or even stop an event from propagating, think win.MoScroll.
+// It can be a no-op.
+type Layout interface {
+ Lay(image.Rectangle) []image.Rectangle
+ Intercepter
+}