diff options
| author | Pietro Gagliardi <[email protected]> | 2014-07-02 17:13:40 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-07-02 17:13:40 -0400 |
| commit | 5d339e656b66d00356960ae057969532d34245b4 (patch) | |
| tree | 01f00932aba2a4b996603beeda788995e0f0a382 /prevlib/sysdata.go | |
| parent | 2d7e168e6a350a0cfb52970fbf74c9e37834eaec (diff) | |
Moved everything out of the way pending rewrite.
Diffstat (limited to 'prevlib/sysdata.go')
| -rw-r--r-- | prevlib/sysdata.go | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/prevlib/sysdata.go b/prevlib/sysdata.go new file mode 100644 index 0000000..006595c --- /dev/null +++ b/prevlib/sysdata.go @@ -0,0 +1,61 @@ +// 11 february 2014 + +package ui + +// 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 + allocate func(x int, y int, width int, height int, d *sysSizeData) []*allocation + spaced bool + alternate bool // editable for Combobox, multi-select for listbox, password for lineedit + handler AreaHandler // for Areas; TODO rename to areahandler + close func() bool // provided by each Window + event func() // provided by each control +} + +// this interface is used to make sure all sysDatas are synced +var _xSysData interface { + sysDataSizingFunctions + make(window *sysData) error + firstShow() error + show() + hide() + setText(text string) + setRect(x int, y int, width int, height int, winheight int) error + isChecked() bool + text() string + append(string) + insertBefore(string, int) + selectedIndex() int + selectedIndices() []int + selectedTexts() []string + setWindowSize(int, int) error + setProgress(int) + len() int + setAreaSize(int, int) + repaintAll() + center() + setChecked(bool) +} = &sysData{} // this line will error if there's an inconsistency + +const ( + c_window = iota + c_button + c_checkbox + c_combobox + c_lineedit + c_label + c_listbox + c_progressbar + c_area + nctypes +) + +func mksysdata(ctype int) *sysData { + s := &sysData{ + cSysData: cSysData{ + ctype: ctype, + }, + } + return s +} |
