summaryrefslogtreecommitdiff
path: root/newctrl/control.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-10-14 15:17:35 -0400
committerPietro Gagliardi <[email protected]>2014-10-14 15:17:35 -0400
commiteef3e1136b51112c23620b150ffcf03caddc0ff9 (patch)
treea80096f1c580d23975032dd38aa7fd86700fb4ac /newctrl/control.go
parentaad6e4c699614d9911df16d0b3bf86b10db5087c (diff)
Started the new recontainerization..
Diffstat (limited to 'newctrl/control.go')
-rw-r--r--newctrl/control.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/newctrl/control.go b/newctrl/control.go
new file mode 100644
index 0000000..028b195
--- /dev/null
+++ b/newctrl/control.go
@@ -0,0 +1,29 @@
+// 30 july 2014
+
+package ui
+
+// Control represents a control.
+type Control interface {
+ setParent(p *controlParent) // controlParent defined per-platform
+// nChildren() int // TODO
+ preferredSize(d *sizing) (width, height int)
+ resize(x int, y int, width int, height int, d *sizing)
+}
+
+type controlbase struct {
+ fsetParent func(p *controlParent)
+ fpreferredSize func(d *sizing) (width, height int)
+ fresize func(x int, y int, width int, height int, d *sizing)
+}
+
+func (c *controlbase) setParent(p *controlParent) {
+ c.fsetParent(p)
+}
+
+func (c *controlbase) preferredSize(d *sizing) (width, height int) {
+ return c.fpreferredSize(d)
+}
+
+func (c *controlbase) resize(x int, y int, width int, height int, d *sizing) {
+ c.fresize(x, y, width, height, d)
+}