summaryrefslogtreecommitdiff
path: root/sysdata.go
blob: a331ddceb40bf68e4eb7389729b08e30f5dd1095 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// 11 february 2014
package main

import (
	"runtime"
)

// The sysData type contains all system data. It provides the system-specific underlying implementation. It is guaranteed to have the following by embedding:
type cSysData struct {
	ctype	int
	event	chan struct{}
	resize	func(x int, y int, width int, height int) error
	alternate	bool		// editable for Combobox, multi-select for listbox
}
func (c *cSysData) make(initText string, initWidth int, initHeight int, window *sysData) error {
	panic(runtime.GOOS + " sysData does not define make()")
}
func (c *cSysData) show() error {
	panic(runtime.GOOS + " sysData does not define show()")
}
func (c *cSysData) hide() error {
	panic(runtime.GOOS + " sysData does not define hide()")
}
func (c *cSysData) setText(text string) error {
	panic(runtime.GOOS + " sysData does not define setText()")
}
func (c *cSysData) setRect(x int, y int, width int, height int) error {
	panic(runtime.GOOS + " sysData does not define setRect()")
}
func (c *cSysData) isChecked() (bool, error) {
	panic(runtime.GOOS + " sysData does not define isChecked()")
}
func (c *cSysData) text() (string, error) {
	panic(runtime.GOOS + " sysData does not define text()")
}
func (c *cSysData) append(string) error {
	panic(runtime.GOOS + " sysData does not define append()")
}
func (c *cSysData) insertBefore(string, int) error {
	panic(runtime.GOOS + " sysData does not define insertBefore()")
}
// TODO selectedIndex, selectedIndices, selectedTexts

const (
	c_window = iota
	c_button
	c_checkbox
	c_combobox
	c_lineedit
	c_label
	c_listbox
	nctypes
)

func mksysdata(ctype int) *sysData {
	return &sysData{
		cSysData:		cSysData{
			ctype:	ctype,
		},
	}
}