summaryrefslogtreecommitdiff
path: root/prev/container_unix.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2016-05-30 00:14:46 -0400
committerPietro Gagliardi <[email protected]>2016-05-30 00:14:46 -0400
commit52f7d276a6bb04b8827ac019ad1e135b43819cea (patch)
tree5f0ebbfdf5885ef832e77e243b5916e59f46ba18 /prev/container_unix.go
parentc9b32c1333e4009b342eedc5f5b39127a724fb42 (diff)
Removed prev/.
Diffstat (limited to 'prev/container_unix.go')
-rw-r--r--prev/container_unix.go70
1 files changed, 0 insertions, 70 deletions
diff --git a/prev/container_unix.go b/prev/container_unix.go
deleted file mode 100644
index c9ed89c..0000000
--- a/prev/container_unix.go
+++ /dev/null
@@ -1,70 +0,0 @@
-// +build !windows,!darwin
-
-// 23 february 2014
-
-package ui
-
-import (
- "unsafe"
-)
-
-// #include "gtk_unix.h"
-import "C"
-
-// TODO avoid direct access to contents?
-type container struct {
- widget *C.GtkWidget
- container *C.GtkContainer
- resize func(x int, y int, width int, height int, d *sizing)
- margined bool
-}
-
-type sizing struct {
- sizingbase
-
- // for size calculations
- // gtk+ needs nothing
-
- // for the actual resizing
- // gtk+ needs nothing
-}
-
-func newContainer() *container {
- c := new(container)
- c.widget = C.newContainer(unsafe.Pointer(c))
- c.container = (*C.GtkContainer)(unsafe.Pointer(c.widget))
- return c
-}
-
-func (c *container) parent() *controlParent {
- return &controlParent{c.container}
-}
-
-//export containerResize
-func containerResize(data unsafe.Pointer, aorig *C.GtkAllocation) {
- c := (*container)(data)
- d := beginResize()
- // copy aorig
- a := *aorig
- if c.margined {
- a.x += C.int(gtkXMargin)
- a.y += C.int(gtkYMargin)
- a.width -= C.int(gtkXMargin) * 2
- a.height -= C.int(gtkYMargin) * 2
- }
- c.resize(int(a.x), int(a.y), int(a.width), int(a.height), d)
-}
-
-const (
- gtkXMargin = 12
- gtkYMargin = 12
- gtkXPadding = 12
- gtkYPadding = 6
-)
-
-func beginResize() (d *sizing) {
- d = new(sizing)
- d.xpadding = gtkXPadding
- d.ypadding = gtkYPadding
- return d
-}