├── vendor ├── github.com │ ├── godbus │ │ └── dbus │ │ │ └── v5 │ │ │ ├── go.sum │ │ │ ├── go.mod │ │ │ ├── transport_darwin.go │ │ │ ├── MAINTAINERS │ │ │ ├── homedir_dynamic.go │ │ │ ├── transport_unixcred_openbsd.go │ │ │ ├── conn_windows.go │ │ │ ├── conn_unix.go │ │ │ ├── homedir.go │ │ │ ├── auth_anonymous.go │ │ │ ├── auth_external.go │ │ │ ├── transport_unixcred_linux.go │ │ │ ├── homedir_static.go │ │ │ ├── conn_darwin.go │ │ │ ├── transport_nonce_tcp.go │ │ │ ├── transport_tcp.go │ │ │ └── transport_generic.go │ ├── srwiley │ │ └── oksvg │ │ │ └── .gitignore │ ├── fsnotify │ │ └── fsnotify │ │ │ ├── .gitattributes │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── .gitignore │ │ │ ├── .editorconfig │ │ │ ├── open_mode_bsd.go │ │ │ ├── open_mode_darwin.go │ │ │ ├── .travis.yml │ │ │ └── fen.go │ ├── go-gl │ │ ├── glfw │ │ │ └── v3.3 │ │ │ │ └── glfw │ │ │ │ ├── GLFW_C_REVISION.txt │ │ │ │ ├── go.mod │ │ │ │ ├── error.c │ │ │ │ ├── c_glfw.go │ │ │ │ ├── c_glfw_windows.go │ │ │ │ ├── c_glfw_darwin.go │ │ │ │ ├── monitor.c │ │ │ │ ├── c_glfw_linbsd.go │ │ │ │ ├── vulkan.go │ │ │ │ ├── util.go │ │ │ │ ├── glfw │ │ │ │ └── LICENSE.md │ │ │ │ ├── native_windows.go │ │ │ │ └── native_darwin.go │ │ └── gl │ │ │ ├── v3.1 │ │ │ └── gles2 │ │ │ │ └── debug.go │ │ │ ├── v3.2-core │ │ │ └── gl │ │ │ │ └── debug.go │ │ │ └── LICENSE │ ├── antchfx │ │ ├── xpath │ │ │ ├── func_go110.go │ │ │ ├── .travis.yml │ │ │ ├── func_pre_go110.go │ │ │ ├── .gitignore │ │ │ └── LICENSE │ │ └── htmlquery │ │ │ ├── go.mod │ │ │ ├── .travis.yml │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── cache.go │ │ │ └── go.sum │ ├── fyne-io │ │ └── mobile │ │ │ ├── AUTHORS │ │ │ ├── CONTRIBUTORS │ │ │ ├── internal │ │ │ └── mobileinit │ │ │ │ ├── mobileinit_ios.m │ │ │ │ ├── mobileinit.go │ │ │ │ └── mobileinit_ios.go │ │ │ ├── gl │ │ │ ├── work_windows_386.s │ │ │ ├── work_windows_amd64.s │ │ │ └── work_other.go │ │ │ ├── app │ │ │ ├── internal │ │ │ │ └── callfn │ │ │ │ │ ├── callfn_386.s │ │ │ │ │ ├── callfn_amd64.s │ │ │ │ │ ├── callfn_arm.s │ │ │ │ │ ├── callfn_arm64.s │ │ │ │ │ └── callfn.go │ │ │ └── shiny.go │ │ │ ├── event │ │ │ └── paint │ │ │ │ └── paint.go │ │ │ └── exp │ │ │ └── f32 │ │ │ ├── vec4.go │ │ │ └── vec3.go │ ├── willf │ │ └── bitset │ │ │ ├── trailing_zeros_19.go │ │ │ ├── .gitignore │ │ │ ├── trailing_zeros_18.go │ │ │ ├── popcnt_generic.go │ │ │ ├── .travis.yml │ │ │ ├── popcnt_19.go │ │ │ ├── popcnt.go │ │ │ └── azure-pipelines.yml │ ├── stretchr │ │ └── testify │ │ │ ├── require │ │ │ ├── require_forward.go.tmpl │ │ │ ├── require.go.tmpl │ │ │ ├── forward_requirements.go │ │ │ ├── doc.go │ │ │ └── requirements.go │ │ │ ├── assert │ │ │ ├── assertion_format.go.tmpl │ │ │ ├── assertion_forward.go.tmpl │ │ │ ├── errors.go │ │ │ └── forward_assertions.go │ │ │ └── LICENSE │ ├── goki │ │ └── freetype │ │ │ ├── LICENSE │ │ │ ├── AUTHORS │ │ │ └── README │ └── davecgh │ │ └── go-spew │ │ └── LICENSE ├── golang.org │ └── x │ │ ├── sys │ │ ├── unix │ │ │ ├── .gitignore │ │ │ ├── endian_big.go │ │ │ ├── endian_little.go │ │ │ ├── constants.go │ │ │ ├── syscall_darwin_386.1_11.go │ │ │ ├── syscall_darwin_amd64.1_11.go │ │ │ ├── syscall_darwin_arm.1_11.go │ │ │ ├── syscall_darwin_arm64.1_11.go │ │ │ ├── syscall_linux_amd64_gc.go │ │ │ ├── zsyscall_darwin_386.1_13.s │ │ │ ├── zsyscall_darwin_arm.1_13.s │ │ │ ├── zsyscall_darwin_amd64.1_13.s │ │ │ ├── zsyscall_darwin_arm64.1_13.s │ │ │ ├── aliases.go │ │ │ ├── pagesize_unix.go │ │ │ ├── readdirent_getdents.go │ │ │ ├── fcntl_linux_32bit.go │ │ │ ├── asm_aix_ppc64.s │ │ │ ├── asm_solaris_amd64.s │ │ │ ├── gccgo_linux_amd64.go │ │ │ ├── syscall_linux_gc.go │ │ │ ├── errors_freebsd_arm64.go │ │ │ ├── race0.go │ │ │ ├── sockcmsg_dragonfly.go │ │ │ ├── syscall_linux_gc_386.go │ │ │ ├── fcntl_darwin.go │ │ │ ├── syscall_linux_gccgo_arm.go │ │ │ ├── syscall_unix_gc.go │ │ │ ├── syscall_solaris_amd64.go │ │ │ ├── str.go │ │ │ ├── race.go │ │ │ ├── env_unix.go │ │ │ ├── asm_freebsd_arm.s │ │ │ ├── asm_netbsd_arm.s │ │ │ ├── asm_openbsd_arm.s │ │ │ ├── asm_netbsd_arm64.s │ │ │ ├── readdirent_getdirentries.go │ │ │ ├── asm_darwin_386.s │ │ │ ├── asm_freebsd_386.s │ │ │ ├── asm_netbsd_386.s │ │ │ ├── asm_openbsd_386.s │ │ │ ├── asm_darwin_amd64.s │ │ │ ├── asm_freebsd_amd64.s │ │ │ ├── asm_freebsd_arm64.s │ │ │ ├── asm_netbsd_amd64.s │ │ │ ├── asm_openbsd_amd64.s │ │ │ ├── asm_openbsd_arm64.s │ │ │ ├── asm_dragonfly_amd64.s │ │ │ ├── asm_darwin_arm.s │ │ │ ├── zptrace_linux_arm64.go │ │ │ ├── asm_darwin_arm64.s │ │ │ ├── bluetooth_linux.go │ │ │ ├── dev_darwin.go │ │ │ ├── dev_aix_ppc.go │ │ │ ├── fdset.go │ │ │ ├── syscall_unix_gc_ppc64x.go │ │ │ ├── syscall_darwin.1_12.go │ │ │ ├── syscall_netbsd_amd64.go │ │ │ ├── syscall_netbsd_arm64.go │ │ │ ├── syscall_netbsd_386.go │ │ │ ├── syscall_netbsd_arm.go │ │ │ ├── dev_aix_ppc64.go │ │ │ ├── dev_netbsd.go │ │ │ ├── dev_openbsd.go │ │ │ ├── asm_linux_ppc64x.s │ │ │ ├── syscall_linux_gccgo_386.go │ │ │ ├── sockcmsg_unix_other.go │ │ │ ├── dev_freebsd.go │ │ │ ├── dev_dragonfly.go │ │ │ ├── syscall_openbsd_amd64.go │ │ │ ├── syscall_openbsd_arm64.go │ │ │ ├── syscall_openbsd_386.go │ │ │ ├── syscall_openbsd_arm.go │ │ │ ├── fcntl.go │ │ │ ├── sockcmsg_linux.go │ │ │ ├── gccgo_c.c │ │ │ ├── asm_linux_riscv64.s │ │ │ └── unveil_openbsd.go │ │ ├── AUTHORS │ │ └── CONTRIBUTORS │ │ ├── image │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── colornames │ │ │ └── colornames.go │ │ ├── vector │ │ │ ├── acc_other.go │ │ │ └── acc_amd64.go │ │ └── math │ │ │ └── f64 │ │ │ └── f64.go │ │ ├── net │ │ ├── AUTHORS │ │ └── CONTRIBUTORS │ │ └── text │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── language │ │ ├── go1_2.go │ │ └── go1_1.go │ │ ├── encoding │ │ ├── japanese │ │ │ └── all.go │ │ └── simplifiedchinese │ │ │ └── all.go │ │ └── internal │ │ └── language │ │ ├── common.go │ │ ├── coverage.go │ │ └── compact.go ├── gopkg.in │ ├── yaml.v2 │ │ ├── go.mod │ │ ├── .travis.yml │ │ ├── NOTICE │ │ └── writerc.go │ └── ini.v1 │ │ ├── .gitignore │ │ ├── codecov.yml │ │ ├── Makefile │ │ ├── helper.go │ │ ├── deprecated.go │ │ └── error.go └── fyne.io │ └── fyne │ ├── test │ ├── device_mobile.go │ ├── device_other.go │ ├── testclipboard.go │ ├── device.go │ ├── notification.go │ └── testfile.go │ ├── app │ ├── settings_mobile.go │ ├── preferences_other.go │ ├── preferences_android.go │ ├── app_gl.go │ ├── app_mobile.go │ ├── app_software.go │ └── app_other.go │ ├── internal │ ├── driver │ │ ├── glfw │ │ │ ├── menu_other.go │ │ │ ├── glfw_core.go │ │ │ ├── glfw_es.go │ │ │ ├── menu.go │ │ │ ├── clipboard.go │ │ │ ├── device.go │ │ │ └── file.go │ │ ├── context.go │ │ └── gomobile │ │ │ ├── device_desktop.go │ │ │ ├── device_ios.go │ │ │ ├── clipboard.go │ │ │ ├── file_desktop.go │ │ │ ├── device_android.go │ │ │ ├── clipboard_ios.m │ │ │ ├── file_ios.m │ │ │ ├── keyboard.go │ │ │ ├── clipboard_desktop.go │ │ │ ├── clipboard_ios.go │ │ │ ├── device.go │ │ │ └── clipboard_android.go │ ├── hints_disabled.go │ ├── hints.go │ ├── scale.go │ ├── painter │ │ └── gl │ │ │ └── capture.go │ ├── widget │ │ └── base_renderer.go │ └── cache │ │ └── widget.go │ ├── clipboard.go │ ├── driver │ ├── desktop │ │ ├── driver.go │ │ ├── canvas.go │ │ ├── cursor.go │ │ ├── mouse.go │ │ └── shortcut.go │ └── mobile │ │ ├── touch.go │ │ ├── device.go │ │ └── keyboard.go │ ├── math.go │ ├── layout │ ├── fixedgridlayout.go │ └── maxlayout.go │ ├── AUTHORS │ ├── notification.go │ ├── layout.go │ ├── log.go │ ├── settings.go │ ├── overlay_stack.go │ ├── dialog │ ├── file_other.go │ ├── file_mobile.go │ ├── progress.go │ └── progressinfinite.go │ ├── .gitignore │ ├── serialise.go │ ├── storage │ ├── file.go │ └── uri.go │ ├── widget.go │ ├── fyne.go │ ├── canvas │ └── rectangle.go │ ├── uri.go │ ├── theme.go │ └── event.go ├── .gitignore ├── pic ├── a2.png ├── a3.png ├── a4.png ├── e.png ├── f.png ├── g.png ├── h.png ├── i.png ├── j.png ├── main.png ├── cookie1.png ├── cookie2.png ├── main2.png └── markdown.png ├── script └── build.ps1 ├── internal ├── gui │ ├── error.go │ └── log.go ├── error2 │ └── handler.go ├── xpath │ └── parser_test.go ├── log │ └── log.go ├── request │ └── handler_test.go ├── ini │ └── config_test.go ├── preference │ └── Preference.go ├── bloom │ └── bloom.go └── markdown │ └── markdown_test.go ├── test └── test.go └── go.mod /vendor/github.com/godbus/dbus/v5/go.sum: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/github.com/srwiley/oksvg/.gitignore: -------------------------------------------------------------------------------- 1 | /testdata/*.png 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | unix.test 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | 爬取结果.md 3 | bin/main.exe 4 | DouBanConfig.ini -------------------------------------------------------------------------------- /pic/a2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itning/DouBanReptile/master/pic/a2.png -------------------------------------------------------------------------------- /pic/a3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itning/DouBanReptile/master/pic/a3.png -------------------------------------------------------------------------------- /pic/a4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itning/DouBanReptile/master/pic/a4.png -------------------------------------------------------------------------------- /pic/e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itning/DouBanReptile/master/pic/e.png -------------------------------------------------------------------------------- /pic/f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itning/DouBanReptile/master/pic/f.png -------------------------------------------------------------------------------- /pic/g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itning/DouBanReptile/master/pic/g.png -------------------------------------------------------------------------------- /pic/h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itning/DouBanReptile/master/pic/h.png -------------------------------------------------------------------------------- /pic/i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itning/DouBanReptile/master/pic/i.png -------------------------------------------------------------------------------- /pic/j.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itning/DouBanReptile/master/pic/j.png -------------------------------------------------------------------------------- /pic/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itning/DouBanReptile/master/pic/main.png -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/.gitattributes: -------------------------------------------------------------------------------- 1 | go.sum linguist-generated 2 | -------------------------------------------------------------------------------- /pic/cookie1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itning/DouBanReptile/master/pic/cookie1.png -------------------------------------------------------------------------------- /pic/cookie2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itning/DouBanReptile/master/pic/cookie2.png -------------------------------------------------------------------------------- /pic/main2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itning/DouBanReptile/master/pic/main2.png -------------------------------------------------------------------------------- /pic/markdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itning/DouBanReptile/master/pic/markdown.png -------------------------------------------------------------------------------- /vendor/github.com/godbus/dbus/v5/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/godbus/dbus/v5 2 | 3 | go 1.12 4 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/GLFW_C_REVISION.txt: -------------------------------------------------------------------------------- 1 | 0a49ef0a00baa3ab520ddc452f0e3b1e099c5589 2 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/go-gl/glfw/v3.3/glfw 2 | 3 | go 1.10 4 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/go.mod: -------------------------------------------------------------------------------- 1 | module "gopkg.in/yaml.v2" 2 | 3 | require ( 4 | "gopkg.in/check.v1" v0.0.0-20161208181325-20d25e280405 5 | ) 6 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/test/device_mobile.go: -------------------------------------------------------------------------------- 1 | // +build mobile 2 | 3 | package test 4 | 5 | func (d *device) IsMobile() bool { 6 | return true 7 | } 8 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/test/device_other.go: -------------------------------------------------------------------------------- 1 | // +build !mobile 2 | 3 | package test 4 | 5 | func (d *device) IsMobile() bool { 6 | return false 7 | } 8 | -------------------------------------------------------------------------------- /vendor/gopkg.in/ini.v1/.gitignore: -------------------------------------------------------------------------------- 1 | testdata/conf_out.ini 2 | ini.sublime-project 3 | ini.sublime-workspace 4 | testdata/conf_reflect.ini 5 | .idea 6 | /.vscode 7 | -------------------------------------------------------------------------------- /script/build.ps1: -------------------------------------------------------------------------------- 1 | go build -ldflags="-s -w -H windowsgui" -o ..\bin\main.exe github.com/itning/DouBanReptile 2 | cd ../bin 3 | upx main.exe 4 | echo SUCCESS 5 | pause -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/fsnotify/fsnotify 2 | 3 | go 1.13 4 | 5 | require golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9 6 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/error.c: -------------------------------------------------------------------------------- 1 | #include "_cgo_export.h" 2 | 3 | void glfwSetErrorCallbackCB() { glfwSetErrorCallback((GLFWerrorfun)goErrorCB); } 4 | -------------------------------------------------------------------------------- /vendor/github.com/godbus/dbus/v5/transport_darwin.go: -------------------------------------------------------------------------------- 1 | package dbus 2 | 3 | func (t *unixTransport) SendNullByte() error { 4 | _, err := t.Write([]byte{0}) 5 | return err 6 | } 7 | -------------------------------------------------------------------------------- /internal/gui/error.go: -------------------------------------------------------------------------------- 1 | package gui 2 | 3 | type ErrorHandler struct { 4 | } 5 | 6 | func (deh ErrorHandler) Handler(e error) { 7 | if e != nil { 8 | Print(e.Error()) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func main() { 6 | str := "标题:滨江区 近西兴地铁口 春波南苑精装修 朝南大主卧 带内独厨独卫 独立阳台 采光好 空间大 家电齐全 有需要的联系" 7 | fmt.Println(string([]rune(str)[3:])) 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/antchfx/xpath/func_go110.go: -------------------------------------------------------------------------------- 1 | // +build go1.10 2 | 3 | package xpath 4 | 5 | import "math" 6 | 7 | func round(f float64) int { 8 | return int(math.Round(f)) 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/godbus/dbus/v5/MAINTAINERS: -------------------------------------------------------------------------------- 1 | Brandon Philips (@philips) 2 | Brian Waldon (@bcwaldon) 3 | John Southworth (@jsouthworth) 4 | -------------------------------------------------------------------------------- /vendor/gopkg.in/ini.v1/codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | range: "60...95" 3 | status: 4 | project: 5 | default: 6 | threshold: 1% 7 | 8 | comment: 9 | layout: 'diff, files' 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/image/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/image/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/github.com/fyne-io/mobile/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/github.com/fyne-io/mobile/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/github.com/willf/bitset/trailing_zeros_19.go: -------------------------------------------------------------------------------- 1 | // +build go1.9 2 | 3 | package bitset 4 | 5 | import "math/bits" 6 | 7 | func trailingZeroes64(v uint64) uint { 8 | return uint(bits.TrailingZeros64(v)) 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/fyne-io/mobile/internal/mobileinit/mobileinit_ios.m: -------------------------------------------------------------------------------- 1 | // +build darwin 2 | // +build arm arm64 3 | 4 | #import 5 | 6 | void log_wrap(const char *logStr) { 7 | NSLog(@"GoLog: %s", logStr); 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/antchfx/xpath/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.6 5 | - 1.9 6 | - '1.10' 7 | 8 | install: 9 | - go get github.com/mattn/goveralls 10 | 11 | script: 12 | - $HOME/gopath/bin/goveralls -service=travis-ci -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/go.sum: -------------------------------------------------------------------------------- 1 | golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9 h1:L2auWcuQIvxz9xSEqzESnV/QN/gNRXNApHi3fYwl2w0= 2 | golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 3 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/require_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) { 3 | if h, ok := a.t.(tHelper); ok { h.Helper() } 4 | {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 5 | } 6 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/app/settings_mobile.go: -------------------------------------------------------------------------------- 1 | // +build android ios mobile nacl 2 | 3 | package app 4 | 5 | func (s *settings) watchSettings() { 6 | // no-op on mobile 7 | } 8 | 9 | func (s *settings) stopWatching() { 10 | // no-op on mobile 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/.gitignore: -------------------------------------------------------------------------------- 1 | # Setup a Global .gitignore for OS and editor generated files: 2 | # https://help.github.com/articles/ignoring-files 3 | # git config --global core.excludesfile ~/.gitignore_global 4 | 5 | .vagrant 6 | *.sublime-project 7 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/assertion_format.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentFormat}} 2 | func {{.DocInfo.Name}}f(t TestingT, {{.ParamsFormat}}) bool { 3 | if h, ok := t.(tHelper); ok { h.Helper() } 4 | return {{.DocInfo.Name}}(t, {{.ForwardedParamsFormat}}) 5 | } 6 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) bool { 3 | if h, ok := a.t.(tHelper); ok { h.Helper() } 4 | return {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 5 | } 6 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/require.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.Comment}} 2 | func {{.DocInfo.Name}}(t TestingT, {{.Params}}) { 3 | if h, ok := t.(tHelper); ok { h.Helper() } 4 | if assert.{{.DocInfo.Name}}(t, {{.ForwardedParams}}) { return } 5 | t.FailNow() 6 | } 7 | -------------------------------------------------------------------------------- /vendor/github.com/antchfx/htmlquery/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/antchfx/htmlquery 2 | 3 | go 1.14 4 | 5 | require ( 6 | github.com/antchfx/xpath v1.1.6 7 | github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e 8 | golang.org/x/net v0.0.0-20200421231249-e086a090c8fd 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/github.com/godbus/dbus/v5/homedir_dynamic.go: -------------------------------------------------------------------------------- 1 | // +build !static_build 2 | 3 | package dbus 4 | 5 | import ( 6 | "os/user" 7 | ) 8 | 9 | func lookupHomeDir() string { 10 | u, err := user.Current() 11 | if err != nil { 12 | return "/" 13 | } 14 | return u.HomeDir 15 | } 16 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/internal/driver/glfw/menu_other.go: -------------------------------------------------------------------------------- 1 | // +build !darwin no_native_menus 2 | 3 | package glfw 4 | 5 | import "fyne.io/fyne" 6 | 7 | func hasNativeMenu() bool { 8 | return false 9 | } 10 | 11 | func setupNativeMenu(_ *window, _ *fyne.MainMenu) { 12 | // no-op 13 | } 14 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/clipboard.go: -------------------------------------------------------------------------------- 1 | package fyne 2 | 3 | // Clipboard represents the system clipboard interface 4 | type Clipboard interface { 5 | // Content returns the clipboard content 6 | Content() string 7 | // SetContent sets the clipboard content 8 | SetContent(content string) 9 | } 10 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/internal/driver/glfw/glfw_core.go: -------------------------------------------------------------------------------- 1 | // +build !gles,!arm,!arm64 2 | 3 | package glfw 4 | 5 | import "github.com/go-gl/glfw/v3.3/glfw" 6 | 7 | func initWindowHints() { 8 | glfw.WindowHint(glfw.ContextVersionMajor, 2) 9 | glfw.WindowHint(glfw.ContextVersionMinor, 0) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*.go] 4 | indent_style = tab 5 | indent_size = 4 6 | insert_final_newline = true 7 | 8 | [*.{yml,yaml}] 9 | indent_style = space 10 | indent_size = 2 11 | insert_final_newline = true 12 | trim_trailing_whitespace = true 13 | -------------------------------------------------------------------------------- /internal/gui/log.go: -------------------------------------------------------------------------------- 1 | package gui 2 | 3 | import "fmt" 4 | 5 | type Log struct { 6 | } 7 | 8 | func (consoleLog Log) Println(content string) { 9 | Print(content + "\n") 10 | } 11 | 12 | func (consoleLog Log) Printf(format string, v ...interface{}) { 13 | Print(fmt.Sprintf(format, v...) + "\n") 14 | } 15 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/driver/desktop/driver.go: -------------------------------------------------------------------------------- 1 | package desktop 2 | 3 | import "fyne.io/fyne" 4 | 5 | // Driver represents the extended capabilities of a desktop driver 6 | type Driver interface { 7 | // Create a new borderless window that is centered on screen 8 | CreateSplashWindow() fyne.Window 9 | } 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build ppc64 s390x mips mips64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - "1.4.x" 5 | - "1.5.x" 6 | - "1.6.x" 7 | - "1.7.x" 8 | - "1.8.x" 9 | - "1.9.x" 10 | - "1.10.x" 11 | - "1.11.x" 12 | - "1.12.x" 13 | - "1.13.x" 14 | - "tip" 15 | 16 | go_import_path: gopkg.in/yaml.v2 17 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/app/preferences_other.go: -------------------------------------------------------------------------------- 1 | // +build !ios,!android 2 | 3 | package app 4 | 5 | import "path/filepath" 6 | 7 | // storagePath returns the location of the settings storage 8 | func (p *preferences) storagePath() string { 9 | return filepath.Join(rootConfigDir(), p.uniqueID(), "preferences.json") 10 | } 11 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/internal/hints_disabled.go: -------------------------------------------------------------------------------- 1 | // +build !hints 2 | 3 | package internal 4 | 5 | // LogHint reports a developer hint that should be followed to improve their app. 6 | // This does nothing unless the "hints" build flag is used. 7 | func LogHint(reason string) { 8 | // no-op when hints not enabled 9 | } 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/language/go1_2.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.2 6 | 7 | package language 8 | 9 | import "sort" 10 | 11 | var sortStable = sort.Stable 12 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/internal/driver/context.go: -------------------------------------------------------------------------------- 1 | package driver 2 | 3 | // WithContext allows drivers to execute within another context. 4 | // Mostly this helps GLFW code execute within the painter's GL context. 5 | type WithContext interface { 6 | RunWithContext(f func()) 7 | RescaleContext() 8 | Context() interface{} 9 | } 10 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/internal/driver/gomobile/device_desktop.go: -------------------------------------------------------------------------------- 1 | // +build !ios,!android 2 | 3 | package gomobile 4 | 5 | import "fyne.io/fyne" 6 | 7 | func (*device) SystemScaleForWindow(_ fyne.Window) float32 { 8 | return 2 // this is simply due to the high number of pixels on a mobile device - just an approximation 9 | } 10 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/internal/driver/gomobile/device_ios.go: -------------------------------------------------------------------------------- 1 | // +build ios 2 | 3 | package gomobile 4 | 5 | import "fyne.io/fyne" 6 | 7 | func (*device) SystemScaleForWindow(_ fyne.Window) float32 { 8 | if currentDPI >= 450 { 9 | return 3 10 | } else if currentDPI >= 340 { 11 | return 2.5 12 | } 13 | return 2 14 | } 15 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/internal/driver/gomobile/clipboard.go: -------------------------------------------------------------------------------- 1 | package gomobile 2 | 3 | import ( 4 | "fyne.io/fyne" 5 | ) 6 | 7 | // Declare conformity with Clipboard interface 8 | var _ fyne.Clipboard = (*mobileClipboard)(nil) 9 | 10 | // mobileClipboard represents the system mobileClipboard 11 | type mobileClipboard struct { 12 | } 13 | -------------------------------------------------------------------------------- /vendor/gopkg.in/ini.v1/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: build test bench vet coverage 2 | 3 | build: vet bench 4 | 5 | test: 6 | go test -v -cover -race 7 | 8 | bench: 9 | go test -v -cover -test.bench=. -test.benchmem 10 | 11 | vet: 12 | go vet 13 | 14 | coverage: 15 | go test -coverprofile=c.out && go tool cover -html=c.out && rm c.out 16 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/math.go: -------------------------------------------------------------------------------- 1 | package fyne 2 | 3 | // Min returns the smaller of the passed values. 4 | func Min(x, y int) int { 5 | if x < y { 6 | return x 7 | } 8 | return y 9 | } 10 | 11 | // Max returns the larger of the passed values. 12 | func Max(x, y int) int { 13 | if x > y { 14 | return x 15 | } 16 | return y 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/c_glfw.go: -------------------------------------------------------------------------------- 1 | package glfw 2 | 3 | /* 4 | #include "glfw/src/context.c" 5 | #include "glfw/src/init.c" 6 | #include "glfw/src/input.c" 7 | #include "glfw/src/monitor.c" 8 | #include "glfw/src/vulkan.c" 9 | #include "glfw/src/window.c" 10 | #include "glfw/src/osmesa_context.c" 11 | */ 12 | import "C" 13 | -------------------------------------------------------------------------------- /vendor/github.com/godbus/dbus/v5/transport_unixcred_openbsd.go: -------------------------------------------------------------------------------- 1 | package dbus 2 | 3 | import "io" 4 | 5 | func (t *unixTransport) SendNullByte() error { 6 | n, _, err := t.UnixConn.WriteMsgUnix([]byte{0}, nil, nil) 7 | if err != nil { 8 | return err 9 | } 10 | if n != 1 { 11 | return io.ErrShortWrite 12 | } 13 | return nil 14 | } 15 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/internal/driver/glfw/glfw_es.go: -------------------------------------------------------------------------------- 1 | // +build gles arm arm64 2 | 3 | package glfw 4 | 5 | import "github.com/go-gl/glfw/v3.3/glfw" 6 | 7 | func initWindowHints() { 8 | glfw.WindowHint(glfw.ClientAPI, glfw.OpenGLESAPI) 9 | glfw.WindowHint(glfw.ContextVersionMajor, 2) 10 | glfw.WindowHint(glfw.ContextVersionMinor, 0) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/fyne-io/mobile/gl/work_windows_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | // fixFloat is unnecessary for windows/386 8 | TEXT ·fixFloat(SB),NOSPLIT,$0-16 9 | RET 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le riscv64 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/driver/desktop/canvas.go: -------------------------------------------------------------------------------- 1 | package desktop 2 | 3 | import "fyne.io/fyne" 4 | 5 | // Canvas defines the desktop specific extensions to a fyne.Canvas. 6 | type Canvas interface { 7 | OnKeyDown() func(*fyne.KeyEvent) 8 | SetOnKeyDown(func(*fyne.KeyEvent)) 9 | OnKeyUp() func(*fyne.KeyEvent) 10 | SetOnKeyUp(func(*fyne.KeyEvent)) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/fyne-io/mobile/app/internal/callfn/callfn_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | #include "funcdata.h" 7 | 8 | TEXT ·CallFn(SB),$0-4 9 | MOVL fn+0(FP), AX 10 | CALL AX 11 | RET 12 | -------------------------------------------------------------------------------- /vendor/github.com/fyne-io/mobile/app/internal/callfn/callfn_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | #include "funcdata.h" 7 | 8 | TEXT ·CallFn(SB),$0-8 9 | MOVQ fn+0(FP), AX 10 | CALL AX 11 | RET 12 | -------------------------------------------------------------------------------- /vendor/github.com/fyne-io/mobile/app/internal/callfn/callfn_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | #include "funcdata.h" 7 | 8 | TEXT ·CallFn(SB),$0-4 9 | MOVW fn+0(FP), R0 10 | BL (R0) 11 | RET 12 | -------------------------------------------------------------------------------- /vendor/github.com/fyne-io/mobile/app/internal/callfn/callfn_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | #include "funcdata.h" 7 | 8 | TEXT ·CallFn(SB),$0-8 9 | MOVD fn+0(FP), R0 10 | BL (R0) 11 | RET 12 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/layout/fixedgridlayout.go: -------------------------------------------------------------------------------- 1 | package layout 2 | 3 | import ( 4 | "fyne.io/fyne" 5 | ) 6 | 7 | // NewFixedGridLayout returns a new FixedGridLayout instance 8 | // Deprecated: use the replacement NewGridWrapLayout. This method will be removed in 2.0. 9 | func NewFixedGridLayout(size fyne.Size) fyne.Layout { 10 | return NewGridWrapLayout(size) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/AUTHORS: -------------------------------------------------------------------------------- 1 | Andy Williams 2 | Steve OConnor 3 | Luca Corbo 4 | Paul Hovey 5 | Charles Corbett 6 | Tilo Prütz 7 | Stephen Houston 8 | Storm Hess 9 | Stuart Scott 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/github.com/godbus/dbus/v5/conn_windows.go: -------------------------------------------------------------------------------- 1 | //+build windows 2 | 3 | package dbus 4 | 5 | import "os" 6 | 7 | const defaultSystemBusAddress = "tcp:host=127.0.0.1,port=12434" 8 | 9 | func getSystemBusPlatformAddress() string { 10 | address := os.Getenv("DBUS_SYSTEM_BUS_ADDRESS") 11 | if address != "" { 12 | return address 13 | } 14 | return defaultSystemBusAddress 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_386.1_11.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,386,!go1.12 6 | 7 | package unix 8 | 9 | //sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_amd64.1_11.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,amd64,!go1.12 6 | 7 | package unix 8 | 9 | //sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_arm.1_11.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,arm,!go1.12 6 | 7 | package unix 8 | 9 | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { 10 | return 0, ENOSYS 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/antchfx/xpath/func_pre_go110.go: -------------------------------------------------------------------------------- 1 | // +build !go1.10 2 | 3 | package xpath 4 | 5 | import "math" 6 | 7 | // math.Round() is supported by Go 1.10+, 8 | // This method just compatible for version <1.10. 9 | // https://github.com/golang/go/issues/20100 10 | func round(f float64) int { 11 | if math.Abs(f) < 0.5 { 12 | return 0 13 | } 14 | return int(f + math.Copysign(0.5, f)) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/fyne-io/mobile/gl/work_windows_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | TEXT ·fixFloat(SB),NOSPLIT,$0-32 8 | MOVQ x0+0(FP), X0 9 | MOVQ x1+8(FP), X1 10 | MOVQ x2+16(FP), X2 11 | MOVQ x3+24(FP), X3 12 | RET 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_arm64.1_11.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,arm64,!go1.12 6 | 7 | package unix 8 | 9 | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { 10 | return 0, ENOSYS 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,linux 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //go:noescape 13 | func gettimeofday(tv *Timeval) (err syscall.Errno) 14 | -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/open_mode_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build freebsd openbsd netbsd dragonfly 6 | 7 | package fsnotify 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | const openMode = unix.O_NONBLOCK | unix.O_RDONLY | unix.O_CLOEXEC 12 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/errors.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | // AnError is an error instance useful for testing. If the code does not care 8 | // about error specifics, and only needs to return the error for example, this 9 | // error should be used to make the test code more readable. 10 | var AnError = errors.New("assert.AnError general error for testing") 11 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/internal/driver/gomobile/file_desktop.go: -------------------------------------------------------------------------------- 1 | // +build !ios,!android 2 | 3 | package gomobile 4 | 5 | import ( 6 | "errors" 7 | "io" 8 | "os" 9 | ) 10 | 11 | func nativeFileOpen(f *fileOpen) (io.ReadCloser, error) { 12 | if f.uri.Scheme() != "file" { 13 | return nil, errors.New("Mobile simulator mode only supports file:// URIs") 14 | } 15 | 16 | return os.Open(f.uri.String()[7:]) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/antchfx/htmlquery/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.9.x 5 | - 1.12.x 6 | - 1.13.x 7 | 8 | install: 9 | - go get golang.org/x/net/html/charset 10 | - go get golang.org/x/net/html 11 | - go get github.com/antchfx/xpath 12 | - go get github.com/mattn/goveralls 13 | - go get github.com/golang/groupcache 14 | 15 | script: 16 | - $HOME/gopath/bin/goveralls -service=travis-ci -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/c_glfw_windows.go: -------------------------------------------------------------------------------- 1 | package glfw 2 | 3 | /* 4 | #include "glfw/src/win32_init.c" 5 | #include "glfw/src/win32_joystick.c" 6 | #include "glfw/src/win32_monitor.c" 7 | #include "glfw/src/win32_time.c" 8 | #include "glfw/src/win32_thread.c" 9 | #include "glfw/src/win32_window.c" 10 | #include "glfw/src/wgl_context.c" 11 | #include "glfw/src/egl_context.c" 12 | */ 13 | import "C" 14 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/app/preferences_android.go: -------------------------------------------------------------------------------- 1 | // +build android 2 | 3 | package app 4 | 5 | import "path/filepath" 6 | 7 | // storagePath returns the location of the settings storage 8 | func (p *preferences) storagePath() string { 9 | // we have no global storage, use app global instead - rootConfigDir looks up in app_mobile_and.go 10 | return filepath.Join(rootConfigDir(), "storage", "preferences.json") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/open_mode_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin 6 | 7 | package fsnotify 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | // note: this constant is not defined on BSD 12 | const openMode = unix.O_EVTONLY | unix.O_CLOEXEC 13 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/driver/mobile/touch.go: -------------------------------------------------------------------------------- 1 | package mobile 2 | 3 | import "fyne.io/fyne" 4 | 5 | // TouchEvent contains data relating to mobile touch events 6 | type TouchEvent struct { 7 | fyne.PointEvent 8 | } 9 | 10 | // Touchable represents mobile touch events that can be sent to CanvasObjects 11 | type Touchable interface { 12 | TouchDown(*TouchEvent) 13 | TouchUp(*TouchEvent) 14 | TouchCancel(*TouchEvent) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/godbus/dbus/v5/conn_unix.go: -------------------------------------------------------------------------------- 1 | //+build !windows,!solaris,!darwin 2 | 3 | package dbus 4 | 5 | import ( 6 | "os" 7 | ) 8 | 9 | const defaultSystemBusAddress = "unix:path=/var/run/dbus/system_bus_socket" 10 | 11 | func getSystemBusPlatformAddress() string { 12 | address := os.Getenv("DBUS_SYSTEM_BUS_ADDRESS") 13 | if address != "" { 14 | return address 15 | } 16 | return defaultSystemBusAddress 17 | } 18 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/app/app_gl.go: -------------------------------------------------------------------------------- 1 | // +build !ci,!nacl,!android,!ios,!mobile 2 | 3 | package app 4 | 5 | import ( 6 | "fyne.io/fyne" 7 | "fyne.io/fyne/internal/driver/glfw" 8 | ) 9 | 10 | // NewWithID returns a new app instance using the appropriate runtime driver. 11 | // The ID string should be globally unique to this app. 12 | func NewWithID(id string) fyne.App { 13 | return newAppWithDriver(glfw.NewGLDriver(), id) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/internal/hints.go: -------------------------------------------------------------------------------- 1 | // +build hints 2 | 3 | package internal 4 | 5 | import ( 6 | "log" 7 | "runtime" 8 | ) 9 | 10 | // LogHint reports a developer hint that should be followed to improve their app. 11 | func LogHint(reason string) { 12 | log.Println("Fyne hint: ", reason) 13 | 14 | _, file, line, ok := runtime.Caller(2) 15 | if ok { 16 | log.Printf(" Created at: %s:%d", file, line) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/willf/bitset/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | 26 | target 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/image/colornames/colornames.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:generate go run gen.go 6 | 7 | // Package colornames provides named colors as defined in the SVG 1.1 spec. 8 | // 9 | // See http://www.w3.org/TR/SVG/types.html#ColorKeywords 10 | package colornames 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/encoding/japanese/all.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package japanese 6 | 7 | import ( 8 | "golang.org/x/text/encoding" 9 | ) 10 | 11 | // All is a list of all defined encodings in this package. 12 | var All = []encoding.Encoding{EUCJP, ISO2022JP, ShiftJIS} 13 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/internal/driver/gomobile/device_android.go: -------------------------------------------------------------------------------- 1 | // +build android 2 | 3 | package gomobile 4 | 5 | import "fyne.io/fyne" 6 | 7 | func (*device) SystemScaleForWindow(_ fyne.Window) float32 { 8 | if currentDPI >= 600 { 9 | return 4 10 | } else if currentDPI >= 405 { 11 | return 3 12 | } else if currentDPI >= 270 { 13 | return 2 14 | } else if currentDPI >= 180 { 15 | return 1.5 16 | } 17 | return 1 18 | } 19 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/notification.go: -------------------------------------------------------------------------------- 1 | package fyne 2 | 3 | // Notification represents a user notification that can be sent to the operating system. 4 | type Notification struct { 5 | Title, Content string 6 | } 7 | 8 | // NewNotification creates a notification that can be passed to App.SendNotification. 9 | func NewNotification(title, content string) *Notification { 10 | return &Notification{Title: title, Content: content} 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.s: -------------------------------------------------------------------------------- 1 | // go run mkasm_darwin.go 386 2 | // Code generated by the command above; DO NOT EDIT. 3 | 4 | // +build go1.13 5 | 6 | #include "textflag.h" 7 | TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0 8 | JMP libc_fdopendir(SB) 9 | TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0 10 | JMP libc_closedir(SB) 11 | TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0 12 | JMP libc_readdir_r(SB) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.s: -------------------------------------------------------------------------------- 1 | // go run mkasm_darwin.go arm 2 | // Code generated by the command above; DO NOT EDIT. 3 | 4 | // +build go1.13 5 | 6 | #include "textflag.h" 7 | TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0 8 | JMP libc_fdopendir(SB) 9 | TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0 10 | JMP libc_closedir(SB) 11 | TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0 12 | JMP libc_readdir_r(SB) 13 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/c_glfw_darwin.go: -------------------------------------------------------------------------------- 1 | package glfw 2 | 3 | /* 4 | #cgo CFLAGS: -x objective-c 5 | #include "glfw/src/cocoa_init.m" 6 | #include "glfw/src/cocoa_joystick.m" 7 | #include "glfw/src/cocoa_monitor.m" 8 | #include "glfw/src/cocoa_window.m" 9 | #include "glfw/src/cocoa_time.c" 10 | #include "glfw/src/posix_thread.c" 11 | #include "glfw/src/nsgl_context.m" 12 | #include "glfw/src/egl_context.c" 13 | */ 14 | import "C" 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.s: -------------------------------------------------------------------------------- 1 | // go run mkasm_darwin.go amd64 2 | // Code generated by the command above; DO NOT EDIT. 3 | 4 | // +build go1.13 5 | 6 | #include "textflag.h" 7 | TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0 8 | JMP libc_fdopendir(SB) 9 | TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0 10 | JMP libc_closedir(SB) 11 | TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0 12 | JMP libc_readdir_r(SB) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.s: -------------------------------------------------------------------------------- 1 | // go run mkasm_darwin.go arm64 2 | // Code generated by the command above; DO NOT EDIT. 3 | 4 | // +build go1.13 5 | 6 | #include "textflag.h" 7 | TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0 8 | JMP libc_fdopendir(SB) 9 | TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0 10 | JMP libc_closedir(SB) 11 | TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0 12 | JMP libc_readdir_r(SB) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/encoding/simplifiedchinese/all.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package simplifiedchinese 6 | 7 | import ( 8 | "golang.org/x/text/encoding" 9 | ) 10 | 11 | // All is a list of all defined encodings in this package. 12 | var All = []encoding.Encoding{GB18030, GBK, HZGB2312} 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/common.go: -------------------------------------------------------------------------------- 1 | // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. 2 | 3 | package language 4 | 5 | // This file contains code common to the maketables.go and the package code. 6 | 7 | // AliasType is the type of an alias in AliasMap. 8 | type AliasType int8 9 | 10 | const ( 11 | Deprecated AliasType = iota 12 | Macro 13 | Legacy 14 | 15 | AliasTypeUnknown AliasType = -1 16 | ) 17 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/app/app_mobile.go: -------------------------------------------------------------------------------- 1 | // +build !ci 2 | 3 | // +build android ios mobile 4 | 5 | package app 6 | 7 | import ( 8 | "fyne.io/fyne" 9 | "fyne.io/fyne/internal/driver/gomobile" 10 | ) 11 | 12 | // NewWithID returns a new app instance using the appropriate runtime driver. 13 | // The ID string should be globally unique to this app. 14 | func NewWithID(id string) fyne.App { 15 | return newAppWithDriver(gomobile.NewGoMobileDriver(), id) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build go1.9 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | type Signal = syscall.Signal 13 | type Errno = syscall.Errno 14 | type SysProcAttr = syscall.SysProcAttr 15 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/app/app_software.go: -------------------------------------------------------------------------------- 1 | // +build ci nacl 2 | 3 | package app 4 | 5 | import ( 6 | "fyne.io/fyne" 7 | "fyne.io/fyne/internal/painter/software" 8 | "fyne.io/fyne/test" 9 | ) 10 | 11 | // NewWithID returns a new app instance using the test (headless) driver. 12 | // The ID string should be globally unique to this app. 13 | func NewWithID(id string) fyne.App { 14 | return newAppWithDriver(test.NewDriverWithPainter(software.NewPainter()), id) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/layout.go: -------------------------------------------------------------------------------- 1 | package fyne 2 | 3 | // Layout defines how CanvasObjects may be laid out in a specified Size. 4 | type Layout interface { 5 | // Layout will manipulate the listed CanvasObjects Size and Position 6 | // to fit within the specified size. 7 | Layout([]CanvasObject, Size) 8 | // MinSize calculates the smallest size that will fit the listed 9 | // CanvasObjects using this Layout algorithm. 10 | MinSize(objects []CanvasObject) Size 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/pagesize_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // For Unix, get the pagesize from the runtime. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getpagesize() int { 14 | return syscall.Getpagesize() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdents.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix dragonfly freebsd linux netbsd openbsd 6 | 7 | package unix 8 | 9 | // ReadDirent reads directory entries from fd and writes them into buf. 10 | func ReadDirent(fd int, buf []byte) (n int, err error) { 11 | return Getdents(fd, buf) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm linux,mips linux,mipsle 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/test/testclipboard.go: -------------------------------------------------------------------------------- 1 | package test 2 | 3 | import "fyne.io/fyne" 4 | 5 | type testClipboard struct { 6 | content string 7 | } 8 | 9 | func (c *testClipboard) Content() string { 10 | return c.content 11 | } 12 | 13 | func (c *testClipboard) SetContent(content string) { 14 | c.content = content 15 | } 16 | 17 | // NewClipboard returns a single use in-memory clipboard used for testing 18 | func NewClipboard() fyne.Clipboard { 19 | return &testClipboard{} 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/antchfx/htmlquery/.gitignore: -------------------------------------------------------------------------------- 1 | # vscode 2 | .vscode 3 | debug 4 | *.test 5 | 6 | ./build 7 | 8 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 9 | *.o 10 | *.a 11 | *.so 12 | 13 | 14 | # Folders 15 | _obj 16 | _test 17 | 18 | # Architecture specific extensions/prefixes 19 | *.[568vq] 20 | [568vq].out 21 | 22 | *.cgo1.go 23 | *.cgo2.c 24 | _cgo_defun.c 25 | _cgo_gotypes.go 26 | _cgo_export.* 27 | 28 | _testmain.go 29 | 30 | *.exe 31 | *.test 32 | *.prof -------------------------------------------------------------------------------- /vendor/github.com/antchfx/xpath/.gitignore: -------------------------------------------------------------------------------- 1 | # vscode 2 | .vscode 3 | debug 4 | *.test 5 | 6 | ./build 7 | 8 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 9 | *.o 10 | *.a 11 | *.so 12 | 13 | 14 | # Folders 15 | _obj 16 | _test 17 | 18 | # Architecture specific extensions/prefixes 19 | *.[568vq] 20 | [568vq].out 21 | 22 | *.cgo1.go 23 | *.cgo2.c 24 | _cgo_defun.c 25 | _cgo_gotypes.go 26 | _cgo_export.* 27 | 28 | _testmain.go 29 | 30 | *.exe 31 | *.test 32 | *.prof -------------------------------------------------------------------------------- /vendor/github.com/godbus/dbus/v5/homedir.go: -------------------------------------------------------------------------------- 1 | package dbus 2 | 3 | import ( 4 | "os" 5 | "sync" 6 | ) 7 | 8 | var ( 9 | homeDir string 10 | homeDirLock sync.Mutex 11 | ) 12 | 13 | func getHomeDir() string { 14 | homeDirLock.Lock() 15 | defer homeDirLock.Unlock() 16 | 17 | if homeDir != "" { 18 | return homeDir 19 | } 20 | 21 | homeDir = os.Getenv("HOME") 22 | if homeDir != "" { 23 | return homeDir 24 | } 25 | 26 | homeDir = lookupHomeDir() 27 | return homeDir 28 | } 29 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/itning/DouBanReptile 2 | 3 | go 1.14 4 | 5 | require ( 6 | fyne.io/fyne v1.3.1-0.20200616154823-a82c32879cba 7 | github.com/antchfx/htmlquery v1.2.4-0.20200429125914-f04d0ddf4707 8 | github.com/antchfx/xpath v1.1.9 // indirect 9 | github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect 10 | github.com/willf/bitset v1.1.11-0.20200420120211-5e48506878a5 11 | golang.org/x/net v0.0.0-20200421231249-e086a090c8fd 12 | gopkg.in/ini.v1 v1.57.0 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/internal/driver/gomobile/clipboard_ios.m: -------------------------------------------------------------------------------- 1 | // +build ios 2 | 3 | #import 4 | #import 5 | 6 | void setClipboardContent(char *content) { 7 | NSString *value = [NSString stringWithUTF8String:content]; 8 | [[UIPasteboard generalPasteboard] setString:value]; 9 | } 10 | 11 | char *getClipboardContent() { 12 | NSString *str = [[UIPasteboard generalPasteboard] string]; 13 | 14 | return [str UTF8String]; 15 | } 16 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/driver/mobile/device.go: -------------------------------------------------------------------------------- 1 | package mobile 2 | 3 | // Device describes functionality only available on mobile 4 | type Device interface { 5 | // Request that the mobile device show the touch screen keyboard (standard layout) 6 | ShowVirtualKeyboard() 7 | // Request that the mobile device show the touch screen keyboard (custom layout) 8 | ShowVirtualKeyboardType(KeyboardType) 9 | // Request that the mobile device dismiss the touch screen keyboard 10 | HideVirtualKeyboard() 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/godbus/dbus/v5/auth_anonymous.go: -------------------------------------------------------------------------------- 1 | package dbus 2 | 3 | // AuthAnonymous returns an Auth that uses the ANONYMOUS mechanism. 4 | func AuthAnonymous() Auth { 5 | return &authAnonymous{} 6 | } 7 | 8 | type authAnonymous struct{} 9 | 10 | func (a *authAnonymous) FirstData() (name, resp []byte, status AuthStatus) { 11 | return []byte("ANONYMOUS"), nil, AuthOk 12 | } 13 | 14 | func (a *authAnonymous) HandleData(data []byte) (resp []byte, status AuthStatus) { 15 | return nil, AuthError 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/willf/bitset/trailing_zeros_18.go: -------------------------------------------------------------------------------- 1 | // +build !go1.9 2 | 3 | package bitset 4 | 5 | var deBruijn = [...]byte{ 6 | 0, 1, 56, 2, 57, 49, 28, 3, 61, 58, 42, 50, 38, 29, 17, 4, 7 | 62, 47, 59, 36, 45, 43, 51, 22, 53, 39, 33, 30, 24, 18, 12, 5, 8 | 63, 55, 48, 27, 60, 41, 37, 16, 46, 35, 44, 21, 52, 32, 23, 11, 9 | 54, 26, 40, 15, 34, 20, 31, 10, 25, 14, 19, 9, 13, 8, 7, 6, 10 | } 11 | 12 | func trailingZeroes64(v uint64) uint { 13 | return uint(deBruijn[((v&-v)*0x03f79d71b4ca8b09)>>58]) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/fyne-io/mobile/internal/mobileinit/mobileinit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package mobileinit contains common initialization logic for mobile platforms 6 | // that is relevant to both all-Go apps and gobind-based apps. 7 | // 8 | // Long-term, some code in this package should consider moving into Go stdlib. 9 | package mobileinit 10 | 11 | import "C" 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_aix_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go 11 | // 12 | 13 | TEXT ·syscall6(SB),NOSPLIT,$0-88 14 | JMP syscall·syscall6(SB) 15 | 16 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSyscall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/internal/driver/gomobile/file_ios.m: -------------------------------------------------------------------------------- 1 | // +build ios 2 | 3 | #import 4 | 5 | #import 6 | 7 | void* iosParseUrl(const char* url) { 8 | NSString *urlStr = [NSString stringWithUTF8String:url]; 9 | return [NSURL URLWithString:urlStr]; 10 | } 11 | 12 | const void* iosReadFromURL(void* urlPtr, int* len) { 13 | NSURL* url = (NSURL*)urlPtr; 14 | NSData* data = [NSData dataWithContentsOfURL:url]; 15 | 16 | *len = data.length; 17 | return data.bytes; 18 | } 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/log.go: -------------------------------------------------------------------------------- 1 | package fyne 2 | 3 | import ( 4 | "log" 5 | "runtime" 6 | ) 7 | 8 | // LogError reports an error to the command line with the specified err cause, 9 | // if not nil. 10 | // The function also reports basic information about the code location. 11 | func LogError(reason string, err error) { 12 | log.Println("Fyne error: ", reason) 13 | if err != nil { 14 | log.Println(" Cause:", err) 15 | } 16 | 17 | _, file, line, ok := runtime.Caller(1) 18 | if ok { 19 | log.Printf(" At: %s:%d", file, line) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/settings.go: -------------------------------------------------------------------------------- 1 | package fyne 2 | 3 | // SettingsScaleAuto is a specific scale value that indicates a canvas should 4 | // scale according to the DPI of the window that contains it. 5 | // Deprecated: Automatic scaling is now handled in the drivers and is not a user setting. 6 | const SettingsScaleAuto = float32(-1.0) 7 | 8 | // Settings describes the application configuration available. 9 | type Settings interface { 10 | Theme() Theme 11 | SetTheme(Theme) 12 | Scale() float32 13 | 14 | AddChangeListener(chan Settings) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/forward_assertions.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate sh -c "cd ../_codegen && go build && cd - && ../_codegen/_codegen -output-package=assert -template=assertion_forward.go.tmpl -include-format-funcs" 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/forward_requirements.go: -------------------------------------------------------------------------------- 1 | package require 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate sh -c "cd ../_codegen && go build && cd - && ../_codegen/_codegen -output-package=require -template=require_forward.go.tmpl -include-format-funcs" 17 | -------------------------------------------------------------------------------- /internal/error2/handler.go: -------------------------------------------------------------------------------- 1 | package error2 2 | 3 | import "github.com/itning/DouBanReptile/internal/log" 4 | 5 | type Error interface { 6 | Handler(e error) 7 | } 8 | 9 | var handlerImpl Error = DefaultErrorHandler{} 10 | 11 | type DefaultErrorHandler struct { 12 | } 13 | 14 | func (deh DefaultErrorHandler) Handler(e error) { 15 | if e != nil { 16 | log.GetImpl().Printf("Have Error %s", e.Error()) 17 | panic(e) 18 | } 19 | } 20 | 21 | func SetImpl(e Error) { 22 | handlerImpl = e 23 | } 24 | 25 | func GetImpl() Error { 26 | return handlerImpl 27 | } 28 | -------------------------------------------------------------------------------- /internal/xpath/parser_test.go: -------------------------------------------------------------------------------- 1 | package xpath 2 | 3 | import ( 4 | "fmt" 5 | "github.com/itning/DouBanReptile/internal/request" 6 | "testing" 7 | ) 8 | 9 | func TestParser(t *testing.T) { 10 | data := request.Data{Url: "https://www.nowcoder.com/contestRoom"} 11 | bytes := request.Handler(data) 12 | nodes := Parser(Data{Body: bytes, Xpath: `//div[@class="pagination"]//li//a`}) 13 | for i, vv := range nodes.Attr("href") { 14 | fmt.Printf("%d %s\n", i+1, vv) 15 | } 16 | for i, vv := range nodes.Text() { 17 | fmt.Printf("%d %s\n", i+1, vv) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/internal/driver/glfw/menu.go: -------------------------------------------------------------------------------- 1 | package glfw 2 | 3 | import ( 4 | "fyne.io/fyne" 5 | ) 6 | 7 | func buildMenuOverlay(menus *fyne.MainMenu, c fyne.Canvas) fyne.CanvasObject { 8 | if menus.Items[0].Items[len(menus.Items[0].Items)-1].Label != "Quit" { // make sure the first menu always has a quit option 9 | quitItem := fyne.NewMenuItem("Quit", func() { 10 | fyne.CurrentApp().Quit() 11 | }) 12 | menus.Items[0].Items = append(menus.Items[0].Items, fyne.NewMenuItemSeparator(), quitItem) 13 | } 14 | 15 | return NewMenuBar(menus, c) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/internal/driver/gomobile/keyboard.go: -------------------------------------------------------------------------------- 1 | package gomobile 2 | 3 | import ( 4 | "fyne.io/fyne" 5 | "fyne.io/fyne/driver/mobile" 6 | "github.com/fyne-io/mobile/app" 7 | ) 8 | 9 | func showVirtualKeyboard(keyboard mobile.KeyboardType) { 10 | if driver, ok := fyne.CurrentApp().Driver().(*mobileDriver); ok { 11 | driver.app.ShowVirtualKeyboard(app.KeyboardType(keyboard)) 12 | } 13 | } 14 | 15 | func hideVirtualKeyboard() { 16 | if driver, ok := fyne.CurrentApp().Driver().(*mobileDriver); ok { 17 | driver.app.HideVirtualKeyboard() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/test/device.go: -------------------------------------------------------------------------------- 1 | package test 2 | 3 | import "fyne.io/fyne" 4 | 5 | type device struct { 6 | } 7 | 8 | // Declare conformity with Device 9 | var _ fyne.Device = (*device)(nil) 10 | 11 | func (d *device) Orientation() fyne.DeviceOrientation { 12 | return fyne.OrientationVertical 13 | } 14 | 15 | func (d *device) HasKeyboard() bool { 16 | return false 17 | } 18 | 19 | func (d *device) SystemScale() float32 { 20 | return d.SystemScaleForWindow(nil) 21 | } 22 | 23 | func (d *device) SystemScaleForWindow(fyne.Window) float32 { 24 | return 1 25 | } 26 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/overlay_stack.go: -------------------------------------------------------------------------------- 1 | package fyne 2 | 3 | // OverlayStack is a stack of CanvasObjects intended to be used as overlays of a Canvas. 4 | type OverlayStack interface { 5 | // Add adds an overlay on the top of the overlay stack. 6 | Add(overlay CanvasObject) 7 | // List returns the overlays currently on the overlay stack. 8 | List() []CanvasObject 9 | // Remove removes the given object and all objects above it from the overlay stack. 10 | Remove(overlay CanvasObject) 11 | // Top returns the top-most object of the overlay stack. 12 | Top() CanvasObject 13 | } 14 | -------------------------------------------------------------------------------- /internal/log/log.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import ( 4 | "log" 5 | ) 6 | 7 | type Log interface { 8 | Println(string) 9 | Printf(format string, v ...interface{}) 10 | } 11 | 12 | var logImpl Log = ConsoleLog{} 13 | 14 | type ConsoleLog struct { 15 | } 16 | 17 | func (consoleLog ConsoleLog) Println(content string) { 18 | log.Println(content) 19 | } 20 | 21 | func (consoleLog ConsoleLog) Printf(format string, v ...interface{}) { 22 | log.Printf(format, v...) 23 | } 24 | 25 | func SetImpl(a Log) { 26 | logImpl = a 27 | } 28 | 29 | func GetImpl() Log { 30 | return logImpl 31 | } 32 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/internal/driver/gomobile/clipboard_desktop.go: -------------------------------------------------------------------------------- 1 | // +build !ios,!android 2 | 3 | package gomobile 4 | 5 | import "fyne.io/fyne" 6 | 7 | // Content returns the clipboard content for mobile simulator runs 8 | func (c *mobileClipboard) Content() string { 9 | fyne.LogError("Clipboard is not supported in mobile simulation", nil) 10 | return "" 11 | } 12 | 13 | // SetContent sets the clipboard content for mobile simulator runs 14 | func (c *mobileClipboard) SetContent(content string) { 15 | fyne.LogError("Clipboard is not supported in mobile simulation", nil) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/willf/bitset/popcnt_generic.go: -------------------------------------------------------------------------------- 1 | // +build !go1.9 2 | // +build !amd64 appengine 3 | 4 | package bitset 5 | 6 | func popcntSlice(s []uint64) uint64 { 7 | return popcntSliceGo(s) 8 | } 9 | 10 | func popcntMaskSlice(s, m []uint64) uint64 { 11 | return popcntMaskSliceGo(s, m) 12 | } 13 | 14 | func popcntAndSlice(s, m []uint64) uint64 { 15 | return popcntAndSliceGo(s, m) 16 | } 17 | 18 | func popcntOrSlice(s, m []uint64) uint64 { 19 | return popcntOrSliceGo(s, m) 20 | } 21 | 22 | func popcntXorSlice(s, m []uint64) uint64 { 23 | return popcntXorSliceGo(s, m) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,!gccgo 6 | 7 | package unix 8 | 9 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail. 10 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 11 | 12 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't 13 | // fail. 14 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/errors_freebsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Constants that were deprecated or moved to enums in the FreeBSD headers. Keep 6 | // them here for backwards compatibility. 7 | 8 | package unix 9 | 10 | const ( 11 | DLT_HHDLC = 0x79 12 | IPV6_MIN_MEMBERSHIPS = 0x1f 13 | IP_MAX_SOURCE_FILTER = 0x400 14 | IP_MIN_MEMBERSHIPS = 0x1f 15 | RT_CACHING_CONTEXT = 0x1 16 | RT_NORTREF = 0x2 17 | ) 18 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/dialog/file_other.go: -------------------------------------------------------------------------------- 1 | // +build !windows,!android,!ios 2 | 3 | package dialog 4 | 5 | import ( 6 | "fyne.io/fyne" 7 | "fyne.io/fyne/widget" 8 | ) 9 | 10 | func (f *fileDialog) loadPlaces() []fyne.CanvasObject { 11 | return []fyne.CanvasObject{widget.NewButton("Computer", func() { 12 | f.setDirectory("/") 13 | })} 14 | } 15 | 16 | func isHidden(file, _ string) bool { 17 | return len(file) == 0 || file[0] == '.' 18 | } 19 | 20 | func fileOpenOSOverride(*FileDialog) bool { 21 | return false 22 | } 23 | 24 | func fileSaveOSOverride(*FileDialog) bool { 25 | return false 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/monitor.c: -------------------------------------------------------------------------------- 1 | #include "_cgo_export.h" 2 | 3 | GLFWmonitor *GetMonitorAtIndex(GLFWmonitor **monitors, int index) { 4 | return monitors[index]; 5 | } 6 | 7 | GLFWvidmode GetVidmodeAtIndex(GLFWvidmode *vidmodes, int index) { 8 | return vidmodes[index]; 9 | } 10 | 11 | void glfwSetMonitorCallbackCB() { 12 | glfwSetMonitorCallback((GLFWmonitorfun)goMonitorCB); 13 | } 14 | 15 | unsigned int GetGammaAtIndex(unsigned short *color, int i) { return color[i]; } 16 | 17 | void SetGammaAtIndex(unsigned short *color, int i, unsigned short value) { 18 | color[i] = value; 19 | } 20 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Canonical Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/.gitignore: -------------------------------------------------------------------------------- 1 | ### Project Specific 2 | cmd/fyne/fyne 3 | cmd/fyne_demo/fyne_demo 4 | cmd/hello/hello 5 | 6 | ### Tests 7 | **/testdata/failed 8 | 9 | ### Go 10 | # Output of the coverage tool 11 | *.out 12 | 13 | ### macOS 14 | # General 15 | .DS_Store 16 | 17 | # Thumbnails 18 | ._* 19 | 20 | ### JetBrains 21 | .idea 22 | 23 | ### VSCode 24 | .vscode 25 | 26 | ### Vim 27 | # Swap 28 | [._]*.s[a-v][a-z] 29 | [._]*.sw[a-p] 30 | [._]s[a-v][a-z] 31 | [._]sw[a-p] 32 | 33 | # Session 34 | Session.vim 35 | 36 | # Temporary 37 | .netrwhist 38 | *~ 39 | # Auto-generated tag files 40 | tags 41 | # Persistent undo 42 | [._]*.un~ 43 | -------------------------------------------------------------------------------- /vendor/github.com/goki/freetype/LICENSE: -------------------------------------------------------------------------------- 1 | Use of the Freetype-Go software is subject to your choice of exactly one of 2 | the following two licenses: 3 | * The FreeType License, which is similar to the original BSD license with 4 | an advertising clause, or 5 | * The GNU General Public License (GPL), version 2 or later. 6 | 7 | The text of these licenses are available in the licenses/ftl.txt and the 8 | licenses/gpl.txt files respectively. They are also available at 9 | http://freetype.sourceforge.net/license.html 10 | 11 | The Luxi fonts in the testdata directory are licensed separately. See the 12 | testdata/COPYING file for details. 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | // Round the length of a raw sockaddr up to align it properly. 8 | func cmsgAlignOf(salen int) int { 9 | salign := SizeofPtr 10 | if SizeofPtr == 8 && !supportsABI(_dragonflyABIChangeVersion) { 11 | // 64-bit Dragonfly before the September 2019 ABI changes still requires 12 | // 32-bit aligned access to network subsystem. 13 | salign = 4 14 | } 15 | return (salen + salign - 1) & ^(salign - 1) 16 | } 17 | -------------------------------------------------------------------------------- /internal/request/handler_test.go: -------------------------------------------------------------------------------- 1 | package request 2 | 3 | import ( 4 | "strings" 5 | "testing" 6 | ) 7 | 8 | func TestHandler(t *testing.T) { 9 | data := Data{Url: "https://www.baidu.com"} 10 | bytes := Handler(data) 11 | t.Log(string(bytes)) 12 | } 13 | 14 | func TestAnalysisCookieString(t *testing.T) { 15 | cookieMap := AnalysisCookieString(`NOWCODERUID=792B9A5DA08as4A826ADS2FBFACFDF9BFD55A3; NOWCODERCLINETID=674ECEE734D6C1D29455B91; gr_user_id=5d4-ffc3-44b2-84ae-0e272a`) 16 | t.Log(cookieMap) 17 | } 18 | 19 | func TestSplit(t *testing.T) { 20 | array := strings.Split("asa=a", "=") 21 | t.Log(array) 22 | t.Log(len(array)) 23 | t.Log(cap(array)) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/internal/scale.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import ( 4 | "math" 5 | 6 | "fyne.io/fyne" 7 | ) 8 | 9 | // ScaleInt converts a fyne coordinate in the given canvas to a screen coordinate 10 | func ScaleInt(c fyne.Canvas, v int) int { 11 | switch c.Scale() { 12 | case 1.0: 13 | return v 14 | default: 15 | return int(math.Round(float64(v) * float64(c.Scale()))) 16 | } 17 | } 18 | 19 | // UnscaleInt converts a screen coordinate for a given canvas to a fyne coordinate 20 | func UnscaleInt(c fyne.Canvas, v int) int { 21 | switch c.Scale() { 22 | case 1.0: 23 | return v 24 | default: 25 | return int(float32(v) / c.Scale()) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/app/app_other.go: -------------------------------------------------------------------------------- 1 | // +build ci !linux,!darwin,!windows,!freebsd,!openbsd,!netbsd 2 | 3 | package app 4 | 5 | import ( 6 | "errors" 7 | "net/url" 8 | 9 | "fyne.io/fyne" 10 | "fyne.io/fyne/theme" 11 | ) 12 | 13 | func defaultTheme() fyne.Theme { 14 | return theme.DarkTheme() 15 | } 16 | 17 | func rootConfigDir() string { 18 | return "/tmp/fyne-test/" 19 | } 20 | 21 | func (app *fyneApp) OpenURL(_ *url.URL) error { 22 | return errors.New("Unable to open url for unknown operating system") 23 | } 24 | 25 | func (app *fyneApp) SendNotification(_ *fyne.Notification) { 26 | fyne.LogError("Refusing to show notification for unknown operating system", nil) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,!gccgo,386 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // Underlying system call writes to newoffset via pointer. 12 | // Implemented in assembly to avoid allocation. 13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 14 | 15 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 16 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 10 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 11 | return fcntl(int(fd), cmd, arg) 12 | } 13 | 14 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 15 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 16 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk)))) 17 | return err 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/c_glfw_linbsd.go: -------------------------------------------------------------------------------- 1 | // +build linux freebsd 2 | 3 | package glfw 4 | 5 | /* 6 | #ifdef _GLFW_WAYLAND 7 | #include "glfw/src/wl_init.c" 8 | #include "glfw/src/wl_monitor.c" 9 | #include "glfw/src/wl_window.c" 10 | #include "glfw/src/wl_platform.h" 11 | #endif 12 | #ifdef _GLFW_X11 13 | #include "glfw/src/x11_init.c" 14 | #include "glfw/src/x11_monitor.c" 15 | #include "glfw/src/x11_window.c" 16 | #include "glfw/src/glx_context.c" 17 | #endif 18 | #include "glfw/src/linux_joystick.c" 19 | #include "glfw/src/posix_time.c" 20 | #include "glfw/src/posix_thread.c" 21 | #include "glfw/src/xkb_unicode.c" 22 | #include "glfw/src/egl_context.c" 23 | */ 24 | import "C" 25 | -------------------------------------------------------------------------------- /vendor/github.com/fyne-io/mobile/app/internal/callfn/callfn.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build android 6 | // +build arm 386 amd64 arm64 7 | 8 | // Package callfn provides an android entry point. 9 | // 10 | // It is a separate package from app because it contains Go assembly, 11 | // which does not compile in a package using cgo. 12 | package callfn 13 | 14 | // CallFn calls a zero-argument function by its program counter. 15 | // It is only intended for calling main.main. Using it for 16 | // anything else will not end well. 17 | func CallFn(fn uintptr) 18 | -------------------------------------------------------------------------------- /internal/ini/config_test.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | import ( 4 | "fmt" 5 | "github.com/itning/DouBanReptile/internal/preference" 6 | "testing" 7 | ) 8 | 9 | func TestRead(t *testing.T) { 10 | var config = Config{} 11 | pre := config.Read() 12 | fmt.Println(*pre) 13 | } 14 | 15 | func TestWrite1(t *testing.T) { 16 | var config = Config{} 17 | var pre = preference.Preference{ 18 | GroupEntityURL: "a", 19 | MaxPrice: 0, 20 | IncludeNoContentPriceCheck: true, 21 | ExcludeKeyArray: []string{"a", "cc"}, 22 | IncludeKeyArray: []string{}, 23 | MaxPage: 1, 24 | SavePreference: true, 25 | } 26 | config.Write(&pre) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/serialise.go: -------------------------------------------------------------------------------- 1 | package fyne 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | ) 7 | 8 | // GoString converts a Resource object to Go code. 9 | // This is useful if serialising to a Go file for compilation into a binary. 10 | func (r *StaticResource) GoString() string { 11 | var buffer bytes.Buffer 12 | 13 | buffer.WriteString("&fyne.StaticResource{\n") 14 | buffer.WriteString("\tStaticName: \"" + r.StaticName + "\",\n") 15 | buffer.WriteString("\tStaticContent: []byte{\n\t\t") 16 | for i, v := range r.StaticContent { 17 | if i > 0 { 18 | buffer.WriteString(", ") 19 | } 20 | 21 | buffer.WriteString(fmt.Sprint(v)) 22 | } 23 | buffer.WriteString("}}") 24 | 25 | return buffer.String() 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,gccgo,arm 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build !gccgo,!ppc64le,!ppc64 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 16 | -------------------------------------------------------------------------------- /vendor/github.com/godbus/dbus/v5/auth_external.go: -------------------------------------------------------------------------------- 1 | package dbus 2 | 3 | import ( 4 | "encoding/hex" 5 | ) 6 | 7 | // AuthExternal returns an Auth that authenticates as the given user with the 8 | // EXTERNAL mechanism. 9 | func AuthExternal(user string) Auth { 10 | return authExternal{user} 11 | } 12 | 13 | // AuthExternal implements the EXTERNAL authentication mechanism. 14 | type authExternal struct { 15 | user string 16 | } 17 | 18 | func (a authExternal) FirstData() ([]byte, []byte, AuthStatus) { 19 | b := make([]byte, 2*len(a.user)) 20 | hex.Encode(b, []byte(a.user)) 21 | return []byte("EXTERNAL"), b, AuthOk 22 | } 23 | 24 | func (a authExternal) HandleData(b []byte) ([]byte, AuthStatus) { 25 | return nil, AuthError 26 | } 27 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/driver/mobile/keyboard.go: -------------------------------------------------------------------------------- 1 | package mobile 2 | 3 | import ( 4 | "fyne.io/fyne" 5 | ) 6 | 7 | // KeyboardType represents a type of virtual keyboard 8 | type KeyboardType int32 9 | 10 | const ( 11 | // DefaultKeyboard is the keyboard with default input style and "return" return key 12 | DefaultKeyboard KeyboardType = iota 13 | // SingleLineKeyboard is the keyboard with default input style and "Done" return key 14 | SingleLineKeyboard 15 | // NumberKeyboard is the keyboard with number input style and "Done" return key 16 | NumberKeyboard 17 | ) 18 | 19 | // Keyboardable describes any CanvasObject that needs a keyboard 20 | type Keyboardable interface { 21 | fyne.Focusable 22 | 23 | Keyboard() KeyboardType 24 | } 25 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/storage/file.go: -------------------------------------------------------------------------------- 1 | package storage 2 | 3 | import ( 4 | "fyne.io/fyne" 5 | ) 6 | 7 | // OpenFileFromURI loads a file read stream from a resource identifier. 8 | // This is mostly provided so that file references can be saved using their URI and loaded again later. 9 | func OpenFileFromURI(uri fyne.URI) (fyne.URIReadCloser, error) { 10 | return fyne.CurrentApp().Driver().FileReaderForURI(uri) 11 | } 12 | 13 | // SaveFileToURI loads a file write stream to a resource identifier. 14 | // This is mostly provided so that file references can be saved using their URI and written to again later. 15 | func SaveFileToURI(uri fyne.URI) (fyne.URIWriteCloser, error) { 16 | return fyne.CurrentApp().Driver().FileWriterForURI(uri) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/image/vector/acc_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64 appengine !gc noasm 6 | 7 | package vector 8 | 9 | const haveAccumulateSIMD = false 10 | 11 | func fixedAccumulateOpOverSIMD(dst []uint8, src []uint32) {} 12 | func fixedAccumulateOpSrcSIMD(dst []uint8, src []uint32) {} 13 | func fixedAccumulateMaskSIMD(buf []uint32) {} 14 | func floatingAccumulateOpOverSIMD(dst []uint8, src []float32) {} 15 | func floatingAccumulateOpSrcSIMD(dst []uint8, src []float32) {} 16 | func floatingAccumulateMaskSIMD(dst []uint32, src []float32) {} 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func (iov *Iovec) SetLen(length int) { 18 | iov.Len = uint64(length) 19 | } 20 | 21 | func (msghdr *Msghdr) SetIovlen(length int) { 22 | msghdr.Iovlen = int32(length) 23 | } 24 | 25 | func (cmsg *Cmsghdr) SetLen(length int) { 26 | cmsg.Len = uint32(length) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/vulkan.go: -------------------------------------------------------------------------------- 1 | package glfw 2 | 3 | //#define GLFW_INCLUDE_NONE 4 | //#include "glfw/include/GLFW/glfw3.h" 5 | import "C" 6 | 7 | // VulkanSupported reports whether the Vulkan loader has been found. This check is performed by Init. 8 | // 9 | // The availability of a Vulkan loader does not by itself guarantee that window surface creation or 10 | // even device creation is possible. Call GetRequiredInstanceExtensions to check whether the 11 | // extensions necessary for Vulkan surface creation are available and GetPhysicalDevicePresentationSupport 12 | // to check whether a queue family of a physical device supports image presentation. 13 | func VulkanSupported() bool { 14 | return glfwbool(C.glfwVulkanSupported()) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + uitoa(uint(-val)) 12 | } 13 | return uitoa(uint(val)) 14 | } 15 | 16 | func uitoa(val uint) string { 17 | var buf [32]byte // big enough for int64 18 | i := len(buf) - 1 19 | for val >= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,race linux,race freebsd,race 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/gl/v3.1/gles2/debug.go: -------------------------------------------------------------------------------- 1 | // Code generated by glow (https://github.com/go-gl/glow). DO NOT EDIT. 2 | 3 | package gles2 4 | 5 | import "C" 6 | import "unsafe" 7 | 8 | type DebugProc func( 9 | source uint32, 10 | gltype uint32, 11 | id uint32, 12 | severity uint32, 13 | length int32, 14 | message string, 15 | userParam unsafe.Pointer) 16 | 17 | var userDebugCallback DebugProc 18 | 19 | //export glowDebugCallback_gles231 20 | func glowDebugCallback_gles231( 21 | source uint32, 22 | gltype uint32, 23 | id uint32, 24 | severity uint32, 25 | length int32, 26 | message *uint8, 27 | userParam unsafe.Pointer) { 28 | if userDebugCallback != nil { 29 | userDebugCallback(source, gltype, id, severity, length, GoStr(message), userParam) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/gl/v3.2-core/gl/debug.go: -------------------------------------------------------------------------------- 1 | // Code generated by glow (https://github.com/go-gl/glow). DO NOT EDIT. 2 | 3 | package gl 4 | 5 | import "C" 6 | import "unsafe" 7 | 8 | type DebugProc func( 9 | source uint32, 10 | gltype uint32, 11 | id uint32, 12 | severity uint32, 13 | length int32, 14 | message string, 15 | userParam unsafe.Pointer) 16 | 17 | var userDebugCallback DebugProc 18 | 19 | //export glowDebugCallback_glcore32 20 | func glowDebugCallback_glcore32( 21 | source uint32, 22 | gltype uint32, 23 | id uint32, 24 | severity uint32, 25 | length int32, 26 | message *uint8, 27 | userParam unsafe.Pointer) { 28 | if userDebugCallback != nil { 29 | userDebugCallback(source, gltype, id, severity, length, GoStr(message), userParam) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/util.go: -------------------------------------------------------------------------------- 1 | package glfw 2 | 3 | //#include 4 | //#define GLFW_INCLUDE_NONE 5 | //#include "glfw/include/GLFW/glfw3.h" 6 | import "C" 7 | 8 | import ( 9 | "reflect" 10 | "unsafe" 11 | ) 12 | 13 | func glfwbool(b C.int) bool { 14 | if b == C.int(True) { 15 | return true 16 | } 17 | return false 18 | } 19 | 20 | func bytes(origin []byte) (pointer *uint8, free func()) { 21 | n := len(origin) 22 | 23 | if n == 0 { 24 | return nil, func() {} 25 | } 26 | 27 | data := C.malloc(C.size_t(n)) 28 | 29 | dataSlice := *(*[]byte)(unsafe.Pointer(&reflect.SliceHeader{ 30 | Data: uintptr(data), 31 | Len: n, 32 | Cap: n, 33 | })) 34 | 35 | copy(dataSlice, origin) 36 | 37 | return &dataSlice[0], func() { C.free(data) } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | 29 | func Unsetenv(key string) error { 30 | return syscall.Unsetenv(key) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | 4 | go: 5 | - "stable" 6 | - "1.11.x" 7 | - "1.10.x" 8 | - "1.9.x" 9 | 10 | matrix: 11 | include: 12 | - go: "stable" 13 | env: GOLINT=true 14 | allow_failures: 15 | - go: tip 16 | fast_finish: true 17 | 18 | 19 | before_install: 20 | - if [ ! -z "${GOLINT}" ]; then go get -u golang.org/x/lint/golint; fi 21 | 22 | script: 23 | - go test --race ./... 24 | 25 | after_script: 26 | - test -z "$(gofmt -s -l -w . | tee /dev/stderr)" 27 | - if [ ! -z "${GOLINT}" ]; then echo running golint; golint --set_exit_status ./...; else echo skipping golint; fi 28 | - go vet ./... 29 | 30 | os: 31 | - linux 32 | - osx 33 | - windows 34 | 35 | notifications: 36 | email: false 37 | -------------------------------------------------------------------------------- /vendor/github.com/fyne-io/mobile/app/shiny.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package app 8 | 9 | import ( 10 | "fmt" 11 | ) 12 | 13 | func main(f func(a App)) { 14 | fmt.Errorf("Running mobile simulation mode does not currently work on Windows.") 15 | } 16 | 17 | // driverShowVirtualKeyboard does nothing on desktop 18 | func driverShowVirtualKeyboard(KeyboardType) { 19 | } 20 | 21 | // driverHideVirtualKeyboard does nothing on desktop 22 | func driverHideVirtualKeyboard() { 23 | } 24 | 25 | // driverShowFileOpenPicker does nothing on desktop 26 | func driverShowFileOpenPicker(func(string, func()), *FileFilter) { 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/godbus/dbus/v5/transport_unixcred_linux.go: -------------------------------------------------------------------------------- 1 | // The UnixCredentials system call is currently only implemented on Linux 2 | // http://golang.org/src/pkg/syscall/sockcmsg_linux.go 3 | // https://golang.org/s/go1.4-syscall 4 | // http://code.google.com/p/go/source/browse/unix/sockcmsg_linux.go?repo=sys 5 | 6 | package dbus 7 | 8 | import ( 9 | "io" 10 | "os" 11 | "syscall" 12 | ) 13 | 14 | func (t *unixTransport) SendNullByte() error { 15 | ucred := &syscall.Ucred{Pid: int32(os.Getpid()), Uid: uint32(os.Getuid()), Gid: uint32(os.Getgid())} 16 | b := syscall.UnixCredentials(ucred) 17 | _, oobn, err := t.UnixConn.WriteMsgUnix([]byte{0}, b, nil) 18 | if err != nil { 19 | return err 20 | } 21 | if oobn != len(b) { 22 | return io.ErrShortWrite 23 | } 24 | return nil 25 | } 26 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/dialog/file_mobile.go: -------------------------------------------------------------------------------- 1 | // +build ios android 2 | 3 | package dialog 4 | 5 | import ( 6 | "fyne.io/fyne" 7 | "fyne.io/fyne/internal/driver/gomobile" 8 | ) 9 | 10 | func (f *fileDialog) loadPlaces() []fyne.CanvasObject { 11 | return nil 12 | } 13 | 14 | func isHidden(file, _ string) bool { 15 | return false 16 | } 17 | 18 | func fileOpenOSOverride(f *FileDialog) bool { 19 | gomobile.ShowFileOpenPicker(f.callback.(func(fyne.URIReadCloser, error)), f.filter) 20 | return true 21 | } 22 | 23 | func fileSaveOSOverride(f *FileDialog) bool { 24 | ShowInformation("File Save", "File save not available on mobile", f.parent) 25 | 26 | callback := f.callback.(func(fyne.URIWriteCloser, error)) 27 | if callback != nil { 28 | callback(nil, nil) 29 | } 30 | 31 | return true 32 | } 33 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/widget.go: -------------------------------------------------------------------------------- 1 | package fyne 2 | 3 | import "image/color" 4 | 5 | // Widget defines the standard behaviours of any widget. This extends the 6 | // CanvasObject - a widget behaves in the same basic way but will encapsulate 7 | // many child objects to create the rendered widget. 8 | type Widget interface { 9 | CanvasObject 10 | 11 | CreateRenderer() WidgetRenderer 12 | } 13 | 14 | // WidgetRenderer defines the behaviour of a widget's implementation. 15 | // This is returned from a widget's declarative object through the Render() 16 | // function and should be exactly one instance per widget in memory. 17 | type WidgetRenderer interface { 18 | Layout(Size) 19 | MinSize() Size 20 | 21 | Refresh() 22 | BackgroundColor() color.Color 23 | Objects() []CanvasObject 24 | Destroy() 25 | } 26 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/writerc.go: -------------------------------------------------------------------------------- 1 | package yaml 2 | 3 | // Set the writer error and return false. 4 | func yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool { 5 | emitter.error = yaml_WRITER_ERROR 6 | emitter.problem = problem 7 | return false 8 | } 9 | 10 | // Flush the output buffer. 11 | func yaml_emitter_flush(emitter *yaml_emitter_t) bool { 12 | if emitter.write_handler == nil { 13 | panic("write handler not set") 14 | } 15 | 16 | // Check if the buffer is empty. 17 | if emitter.buffer_pos == 0 { 18 | return true 19 | } 20 | 21 | if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil { 22 | return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) 23 | } 24 | emitter.buffer_pos = 0 25 | return true 26 | } 27 | -------------------------------------------------------------------------------- /internal/preference/Preference.go: -------------------------------------------------------------------------------- 1 | package preference 2 | 3 | import "fmt" 4 | 5 | type Preference struct { 6 | GroupEntityURL string // 群组URL 7 | MaxPrice int // 最大价格 8 | IncludeNoContentPriceCheck bool // 包含标题没有写价格的 9 | ExcludeKeyArray []string // 排除关键字 10 | IncludeKeyArray []string // 包含关键字 11 | MaxPage int // 爬取最大页数 12 | SavePreference bool // 是否持久化配置 13 | CookieString string // See request#AnalysisCookieString Function 14 | } 15 | 16 | func (p Preference) String() string { 17 | return fmt.Sprintf("群组链接:%s\n最大价格:%d\n爬取不带价格的:%t\n爬取关键字:%s\n排除关键字:%s\n爬取最大页数:%d\n", 18 | p.GroupEntityURL, p.MaxPrice, p.IncludeNoContentPriceCheck, p.IncludeKeyArray, p.ExcludeKeyArray, p.MaxPage) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdirentries.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // ReadDirent reads directory entries from fd and writes them into buf. 12 | func ReadDirent(fd int, buf []byte) (n int, err error) { 13 | // Final argument is (basep *uintptr) and the syscall doesn't take nil. 14 | // 64 bits should be enough. (32 bits isn't even on 386). Since the 15 | // actual system call is getdirentries64, 64 is a good guess. 16 | // TODO(rsc): Can we use a single global basep for all calls? 17 | var base = (*uintptr)(unsafe.Pointer(new(uint64))) 18 | return Getdirentries(fd, buf, base) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/internal/driver/gomobile/clipboard_ios.go: -------------------------------------------------------------------------------- 1 | // +build ios 2 | 3 | package gomobile 4 | 5 | /* 6 | #cgo CFLAGS: -x objective-c 7 | #cgo LDFLAGS: -framework Foundation -framework UIKit -framework MobileCoreServices 8 | 9 | #include 10 | 11 | void setClipboardContent(char *content); 12 | char *getClipboardContent(); 13 | */ 14 | import "C" 15 | import "unsafe" 16 | 17 | // Content returns the clipboard content for iOS 18 | func (c *mobileClipboard) Content() string { 19 | content := C.getClipboardContent() 20 | 21 | return C.GoString(content) 22 | } 23 | 24 | // SetContent sets the clipboard content for iOS 25 | func (c *mobileClipboard) SetContent(content string) { 26 | contentStr := C.CString(content) 27 | defer C.free(unsafe.Pointer(contentStr)) 28 | 29 | C.setClipboardContent(contentStr) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/goki/freetype/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of Freetype-Go authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS files. 3 | # See the latter for an explanation. 4 | # 5 | # Freetype-Go is derived from Freetype, which is written in C. The latter 6 | # is copyright 1996-2010 David Turner, Robert Wilhelm, and Werner Lemberg. 7 | 8 | # Names should be added to this file as 9 | # Name or Organization 10 | # The email address is not required for organizations. 11 | 12 | # Please keep the list sorted. 13 | 14 | Google Inc. 15 | Jeff R. Allen 16 | Maksim Kochkin 17 | Michael Fogleman 18 | Rémy Oudompheng 19 | Roger Peppe 20 | Steven Edwards 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for arm64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/fyne.go: -------------------------------------------------------------------------------- 1 | // Package fyne describes the objects and components available to any Fyne app. 2 | // These can all be created, manipulated and tested without rendering (for speed). 3 | // Your main package should use the app package to create an application with 4 | // a default driver that will render your UI. 5 | // 6 | // A simple application may look like this: 7 | // 8 | // package main 9 | // 10 | // import "fyne.io/fyne/app" 11 | // import "fyne.io/fyne/widget" 12 | // 13 | // func main() { 14 | // a := app.New() 15 | // 16 | // w := a.NewWindow("Hello") 17 | // w.SetContent(widget.NewVBox( 18 | // widget.NewLabel("Hello Fyne!"), 19 | // widget.NewButton("Quit", func() { 20 | // a.Quit() 21 | // }))) 22 | // 23 | // w.ShowAndRun() 24 | // } 25 | package fyne // import "fyne.io/fyne" 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/driver/desktop/cursor.go: -------------------------------------------------------------------------------- 1 | package desktop 2 | 3 | // Cursor represents a standard fyne cursor 4 | type Cursor int 5 | 6 | const ( 7 | // DefaultCursor is the default cursor typically an arrow 8 | DefaultCursor Cursor = iota 9 | // TextCursor is the cursor often used to indicate text selection 10 | TextCursor 11 | // CrosshairCursor is the cursor often used to indicate bitmaps 12 | CrosshairCursor 13 | // PointerCursor is the cursor often used to indicate a link 14 | PointerCursor 15 | // HResizeCursor is the cursor often used to indicate horizontal resize 16 | HResizeCursor 17 | // VResizeCursor is the cursor often used to indicate vertical resize 18 | VResizeCursor 19 | ) 20 | 21 | // Cursorable describes any CanvasObject that needs a cursor change 22 | type Cursorable interface { 23 | Cursor() Cursor 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for ARM, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtraceRegSet("arm64"). DO NOT EDIT. 2 | 3 | package unix 4 | 5 | import "unsafe" 6 | 7 | // PtraceGetRegSetArm64 fetches the registers used by arm64 binaries. 8 | func PtraceGetRegSetArm64(pid, addr int, regsout *PtraceRegsArm64) error { 9 | iovec := Iovec{(*byte)(unsafe.Pointer(regsout)), uint64(unsafe.Sizeof(*regsout))} 10 | return ptrace(PTRACE_GETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec))) 11 | } 12 | 13 | // PtraceSetRegSetArm64 sets the registers used by arm64 binaries. 14 | func PtraceSetRegSetArm64(pid, addr int, regs *PtraceRegsArm64) error { 15 | iovec := Iovec{(*byte)(unsafe.Pointer(regs)), uint64(unsafe.Sizeof(*regs))} 16 | return ptrace(PTRACE_SETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec))) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/gopkg.in/ini.v1/helper.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Unknwon 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package ini 16 | 17 | func inSlice(str string, s []string) bool { 18 | for _, v := range s { 19 | if str == v { 20 | return true 21 | } 22 | } 23 | return false 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2012-2016 Dave Collins 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /vendor/github.com/fyne-io/mobile/internal/mobileinit/mobileinit_ios.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin 6 | // +build arm arm64 7 | 8 | package mobileinit 9 | 10 | import ( 11 | "log" 12 | "unsafe" 13 | ) 14 | 15 | /* 16 | #cgo CFLAGS: -x objective-c 17 | #cgo LDFLAGS: -framework Foundation 18 | 19 | #include 20 | #include 21 | 22 | void log_wrap(const char *logStr); 23 | */ 24 | import "C" 25 | 26 | type aslWriter struct{} 27 | 28 | func (aslWriter) Write(p []byte) (n int, err error) { 29 | cstr := C.CString(string(p)) 30 | C.log_wrap(cstr) 31 | C.free(unsafe.Pointer(cstr)) 32 | return len(p), nil 33 | } 34 | 35 | func init() { 36 | log.SetOutput(aslWriter{}) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm64,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for AMD64, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/canvas/rectangle.go: -------------------------------------------------------------------------------- 1 | package canvas 2 | 3 | import ( 4 | "image/color" 5 | 6 | "fyne.io/fyne" 7 | ) 8 | 9 | // Declare conformity with CanvasObject interface 10 | var _ fyne.CanvasObject = (*Rectangle)(nil) 11 | 12 | // Rectangle describes a colored rectangle primitive in a Fyne canvas 13 | type Rectangle struct { 14 | baseObject 15 | 16 | FillColor color.Color // The rectangle fill color 17 | StrokeColor color.Color // The rectangle stroke color 18 | StrokeWidth float32 // The stroke width of the rectangle 19 | } 20 | 21 | // Refresh causes this object to be redrawn in it's current state 22 | func (r *Rectangle) Refresh() { 23 | Refresh(r) 24 | } 25 | 26 | // NewRectangle returns a new Rectangle instance 27 | func NewRectangle(color color.Color) *Rectangle { 28 | return &Rectangle{ 29 | FillColor: color, 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/godbus/dbus/v5/homedir_static.go: -------------------------------------------------------------------------------- 1 | // +build static_build 2 | 3 | package dbus 4 | 5 | import ( 6 | "bufio" 7 | "os" 8 | "strconv" 9 | "strings" 10 | ) 11 | 12 | func lookupHomeDir() string { 13 | myUid := os.Getuid() 14 | 15 | f, err := os.Open("/etc/passwd") 16 | if err != nil { 17 | return "/" 18 | } 19 | defer f.Close() 20 | 21 | s := bufio.NewScanner(f) 22 | 23 | for s.Scan() { 24 | if err := s.Err(); err != nil { 25 | break 26 | } 27 | 28 | line := strings.TrimSpace(s.Text()) 29 | if line == "" { 30 | continue 31 | } 32 | 33 | parts := strings.Split(line, ":") 34 | 35 | if len(parts) >= 6 { 36 | uid, err := strconv.Atoi(parts[2]) 37 | if err == nil && uid == myUid { 38 | return parts[5] 39 | } 40 | } 41 | } 42 | 43 | // Default to / if we can't get a better value 44 | return "/" 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/willf/bitset/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | sudo: false 4 | 5 | branches: 6 | except: 7 | - release 8 | 9 | branches: 10 | only: 11 | - master 12 | - travis 13 | 14 | go: 15 | - "1.11.x" 16 | - tip 17 | 18 | matrix: 19 | allow_failures: 20 | - go: tip 21 | 22 | before_install: 23 | - if [ -n "$GH_USER" ]; then git config --global github.user ${GH_USER}; fi; 24 | - if [ -n "$GH_TOKEN" ]; then git config --global github.token ${GH_TOKEN}; fi; 25 | - go get github.com/mattn/goveralls 26 | 27 | before_script: 28 | - make deps 29 | 30 | script: 31 | - make qa 32 | 33 | after_failure: 34 | - cat ./target/test/report.xml 35 | 36 | after_success: 37 | - if [ "$TRAVIS_GO_VERSION" = "1.11.1" ]; then $HOME/gopath/bin/goveralls -covermode=count -coverprofile=target/report/coverage.out -service=travis-ci; fi; 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | HCI_CHANNEL_LOGGING = 4 27 | ) 28 | 29 | // Socketoption Level 30 | const ( 31 | SOL_BLUETOOTH = 0x112 32 | SOL_HCI = 0x0 33 | SOL_L2CAP = 0x6 34 | SOL_RFCOMM = 0x12 35 | SOL_SCO = 0x11 36 | ) 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Darwin's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a Darwin device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev >> 24) & 0xff) 13 | } 14 | 15 | // Minor returns the minor component of a Darwin device number. 16 | func Minor(dev uint64) uint32 { 17 | return uint32(dev & 0xffffff) 18 | } 19 | 20 | // Mkdev returns a Darwin device number generated from the given major and minor 21 | // components. 22 | func Mkdev(major, minor uint32) uint64 { 23 | return (uint64(major) << 24) | uint64(minor) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/image/vector/acc_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !appengine 6 | // +build gc 7 | // +build !noasm 8 | 9 | package vector 10 | 11 | func haveSSE4_1() bool 12 | 13 | var haveAccumulateSIMD = haveSSE4_1() 14 | 15 | //go:noescape 16 | func fixedAccumulateOpOverSIMD(dst []uint8, src []uint32) 17 | 18 | //go:noescape 19 | func fixedAccumulateOpSrcSIMD(dst []uint8, src []uint32) 20 | 21 | //go:noescape 22 | func fixedAccumulateMaskSIMD(buf []uint32) 23 | 24 | //go:noescape 25 | func floatingAccumulateOpOverSIMD(dst []uint8, src []float32) 26 | 27 | //go:noescape 28 | func floatingAccumulateOpSrcSIMD(dst []uint8, src []float32) 29 | 30 | //go:noescape 31 | func floatingAccumulateMaskSIMD(dst []uint32, src []float32) 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix 6 | // +build ppc 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used by AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev >> 16) & 0xffff) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32(dev & 0xffff) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | return uint64(((major) << 16) | (minor)) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/coverage.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package language 6 | 7 | // BaseLanguages returns the list of all supported base languages. It generates 8 | // the list by traversing the internal structures. 9 | func BaseLanguages() []Language { 10 | base := make([]Language, 0, NumLanguages) 11 | for i := 0; i < langNoIndexOffset; i++ { 12 | // We included "und" already for the value 0. 13 | if i != nonCanonicalUnd { 14 | base = append(base, Language(i)) 15 | } 16 | } 17 | i := langNoIndexOffset 18 | for _, v := range langNoIndex { 19 | for k := 0; k < 8; k++ { 20 | if v&1 == 1 { 21 | base = append(base, Language(i)) 22 | } 23 | v >>= 1 24 | i++ 25 | } 26 | } 27 | return base 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/language/go1_1.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.2 6 | 7 | package language 8 | 9 | import "sort" 10 | 11 | func sortStable(s sort.Interface) { 12 | ss := stableSort{ 13 | s: s, 14 | pos: make([]int, s.Len()), 15 | } 16 | for i := range ss.pos { 17 | ss.pos[i] = i 18 | } 19 | sort.Sort(&ss) 20 | } 21 | 22 | type stableSort struct { 23 | s sort.Interface 24 | pos []int 25 | } 26 | 27 | func (s *stableSort) Len() int { 28 | return len(s.pos) 29 | } 30 | 31 | func (s *stableSort) Less(i, j int) bool { 32 | return s.s.Less(i, j) || !s.s.Less(j, i) && s.pos[i] < s.pos[j] 33 | } 34 | 35 | func (s *stableSort) Swap(i, j int) { 36 | s.s.Swap(i, j) 37 | s.pos[i], s.pos[j] = s.pos[j], s.pos[i] 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fdset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | // Set adds fd to the set fds. 10 | func (fds *FdSet) Set(fd int) { 11 | fds.Bits[fd/NFDBITS] |= (1 << (uintptr(fd) % NFDBITS)) 12 | } 13 | 14 | // Clear removes fd from the set fds. 15 | func (fds *FdSet) Clear(fd int) { 16 | fds.Bits[fd/NFDBITS] &^= (1 << (uintptr(fd) % NFDBITS)) 17 | } 18 | 19 | // IsSet returns whether fd is in the set fds. 20 | func (fds *FdSet) IsSet(fd int) bool { 21 | return fds.Bits[fd/NFDBITS]&(1<<(uintptr(fd)%NFDBITS)) != 0 22 | } 23 | 24 | // Zero clears the set fds. 25 | func (fds *FdSet) Zero() { 26 | for i := range fds.Bits { 27 | fds.Bits[i] = 0 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/uri.go: -------------------------------------------------------------------------------- 1 | package fyne 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | ) 7 | 8 | // URIReadCloser represents a cross platform data stream from a file or provider of data. 9 | // It may refer to an item on a filesystem or data in another application that we have access to. 10 | type URIReadCloser interface { 11 | io.ReadCloser 12 | Name() string 13 | URI() URI 14 | } 15 | 16 | // URIWriteCloser represents a cross platform data writer for a file resource. 17 | // This will normally refer to a local file resource. 18 | type URIWriteCloser interface { 19 | io.WriteCloser 20 | Name() string 21 | URI() URI 22 | } 23 | 24 | // URI represents the identifier of a resource on a target system. 25 | // This resource may be a file or another data source such as an app or file sharing system. 26 | type URI interface { 27 | fmt.Stringer 28 | Extension() string 29 | MimeType() string 30 | Scheme() string 31 | } 32 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/internal/driver/glfw/clipboard.go: -------------------------------------------------------------------------------- 1 | package glfw 2 | 3 | import ( 4 | "fyne.io/fyne" 5 | 6 | "github.com/go-gl/glfw/v3.3/glfw" 7 | ) 8 | 9 | // Declare conformity with Clipboard interface 10 | var _ fyne.Clipboard = (*clipboard)(nil) 11 | 12 | // clipboard represents the system clipboard 13 | type clipboard struct { 14 | window *glfw.Window 15 | } 16 | 17 | // Content returns the clipboard content 18 | func (c *clipboard) Content() string { 19 | content := "" 20 | runOnMain(func() { 21 | content = glfw.GetClipboardString() 22 | }) 23 | return content 24 | } 25 | 26 | // SetContent sets the clipboard content 27 | func (c *clipboard) SetContent(content string) { 28 | runOnMain(func() { 29 | defer func() { 30 | if r := recover(); r != nil { 31 | fyne.LogError("GLFW clipboard error (details above)", nil) 32 | } 33 | }() 34 | 35 | glfw.SetClipboardString(content) 36 | }) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/theme.go: -------------------------------------------------------------------------------- 1 | package fyne 2 | 3 | import "image/color" 4 | 5 | // Theme defines the requirements of any Fyne theme. 6 | type Theme interface { 7 | BackgroundColor() color.Color 8 | ButtonColor() color.Color 9 | DisabledButtonColor() color.Color 10 | HyperlinkColor() color.Color 11 | TextColor() color.Color 12 | DisabledTextColor() color.Color 13 | IconColor() color.Color 14 | DisabledIconColor() color.Color 15 | PlaceHolderColor() color.Color 16 | PrimaryColor() color.Color 17 | HoverColor() color.Color 18 | FocusColor() color.Color 19 | ScrollBarColor() color.Color 20 | ShadowColor() color.Color 21 | 22 | TextSize() int 23 | TextFont() Resource 24 | TextBoldFont() Resource 25 | TextItalicFont() Resource 26 | TextBoldItalicFont() Resource 27 | TextMonospaceFont() Resource 28 | 29 | Padding() int 30 | IconInlineSize() int 31 | ScrollBarSize() int 32 | ScrollBarSmallSize() int 33 | } 34 | -------------------------------------------------------------------------------- /vendor/gopkg.in/ini.v1/deprecated.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Unknwon 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package ini 16 | 17 | const ( 18 | // Deprecated: Use "DefaultSection" instead. 19 | DEFAULT_SECTION = DefaultSection 20 | ) 21 | 22 | var ( 23 | // Deprecated: AllCapsUnderscore converts to format ALL_CAPS_UNDERSCORE. 24 | AllCapsUnderscore = SnackCase 25 | ) 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build ppc64le ppc64 7 | // +build !gccgo 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 14 | return syscall.Syscall(trap, a1, a2, a3) 15 | } 16 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 17 | return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) 18 | } 19 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 20 | return syscall.RawSyscall(trap, a1, a2, a3) 21 | } 22 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 23 | return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/event.go: -------------------------------------------------------------------------------- 1 | package fyne 2 | 3 | // KeyEvent describes a keyboard input event. 4 | type KeyEvent struct { 5 | Name KeyName 6 | } 7 | 8 | // PointEvent describes a pointer input event. The position is relative to the 9 | // top-left of the CanvasObject this is triggered on. 10 | type PointEvent struct { 11 | AbsolutePosition Position // The absolute position of the event 12 | Position Position // The relative position of the event 13 | } 14 | 15 | // ScrollEvent defines the parameters of a pointer or other scroll event. 16 | // The DeltaX and DeltaY represent how large the scroll was in two dimensions. 17 | type ScrollEvent struct { 18 | PointEvent 19 | DeltaX, DeltaY int 20 | } 21 | 22 | // DragEvent defines the parameters of a pointer or other drag event. 23 | // The DraggedX and DraggedY fields show how far the item was dragged since the last event. 24 | type DragEvent struct { 25 | PointEvent 26 | DraggedX, DraggedY int 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/godbus/dbus/v5/conn_darwin.go: -------------------------------------------------------------------------------- 1 | package dbus 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | "os" 7 | "os/exec" 8 | ) 9 | 10 | const defaultSystemBusAddress = "unix:path=/opt/local/var/run/dbus/system_bus_socket" 11 | 12 | func getSessionBusPlatformAddress() (string, error) { 13 | cmd := exec.Command("launchctl", "getenv", "DBUS_LAUNCHD_SESSION_BUS_SOCKET") 14 | b, err := cmd.CombinedOutput() 15 | 16 | if err != nil { 17 | return "", err 18 | } 19 | 20 | if len(b) == 0 { 21 | return "", errors.New("dbus: couldn't determine address of session bus") 22 | } 23 | 24 | return "unix:path=" + string(b[:len(b)-1]), nil 25 | } 26 | 27 | func getSystemBusPlatformAddress() string { 28 | address := os.Getenv("DBUS_LAUNCHD_SESSION_BUS_SOCKET") 29 | if address != "" { 30 | return fmt.Sprintf("unix:path=%s", address) 31 | } 32 | return defaultSystemBusAddress 33 | } 34 | 35 | func tryDiscoverDbusSessionBusAddress() string { 36 | return "" 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,go1.12,!go1.13 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { 14 | // To implement this using libSystem we'd need syscall_syscallPtr for 15 | // fdopendir. However, syscallPtr was only added in Go 1.13, so we fall 16 | // back to raw syscalls for this func on Go 1.12. 17 | var p unsafe.Pointer 18 | if len(buf) > 0 { 19 | p = unsafe.Pointer(&buf[0]) 20 | } else { 21 | p = unsafe.Pointer(&_zero) 22 | } 23 | r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(p), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) 24 | n = int(r0) 25 | if e1 != 0 { 26 | return n, errnoErr(e1) 27 | } 28 | return n, nil 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/willf/bitset/popcnt_19.go: -------------------------------------------------------------------------------- 1 | // +build go1.9 2 | 3 | package bitset 4 | 5 | import "math/bits" 6 | 7 | func popcntSlice(s []uint64) uint64 { 8 | var cnt int 9 | for _, x := range s { 10 | cnt += bits.OnesCount64(x) 11 | } 12 | return uint64(cnt) 13 | } 14 | 15 | func popcntMaskSlice(s, m []uint64) uint64 { 16 | var cnt int 17 | for i := range s { 18 | cnt += bits.OnesCount64(s[i] &^ m[i]) 19 | } 20 | return uint64(cnt) 21 | } 22 | 23 | func popcntAndSlice(s, m []uint64) uint64 { 24 | var cnt int 25 | for i := range s { 26 | cnt += bits.OnesCount64(s[i] & m[i]) 27 | } 28 | return uint64(cnt) 29 | } 30 | 31 | func popcntOrSlice(s, m []uint64) uint64 { 32 | var cnt int 33 | for i := range s { 34 | cnt += bits.OnesCount64(s[i] | m[i]) 35 | } 36 | return uint64(cnt) 37 | } 38 | 39 | func popcntXorSlice(s, m []uint64) uint64 { 40 | var cnt int 41 | for i := range s { 42 | cnt += bits.OnesCount64(s[i] ^ m[i]) 43 | } 44 | return uint64(cnt) 45 | } 46 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/test/notification.go: -------------------------------------------------------------------------------- 1 | package test 2 | 3 | import ( 4 | "testing" 5 | 6 | "fyne.io/fyne" 7 | 8 | "github.com/stretchr/testify/assert" 9 | "github.com/stretchr/testify/require" 10 | ) 11 | 12 | // AssertNotificationSent allows an app developer to assert that a notification was sent. 13 | // After the content of f has executed this utility will check that the specified notification was sent. 14 | func AssertNotificationSent(t *testing.T, n *fyne.Notification, f func()) { 15 | require.NotNil(t, f, "function has to be specified") 16 | require.IsType(t, &testApp{}, fyne.CurrentApp()) 17 | a := fyne.CurrentApp().(*testApp) 18 | a.lastNotification = nil 19 | 20 | f() 21 | if n == nil { 22 | assert.Nil(t, a.lastNotification) 23 | return 24 | } else if a.lastNotification == nil { 25 | t.Error("No notification sent") 26 | return 27 | } 28 | 29 | assert.Equal(t, n.Title, a.lastNotification.Title) 30 | assert.Equal(t, n.Content, a.lastNotification.Content) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/dialog/progress.go: -------------------------------------------------------------------------------- 1 | package dialog 2 | 3 | import ( 4 | "fyne.io/fyne" 5 | "fyne.io/fyne/theme" 6 | "fyne.io/fyne/widget" 7 | ) 8 | 9 | // ProgressDialog is a simple dialog window that displays text and a progress bar. 10 | type ProgressDialog struct { 11 | *dialog 12 | 13 | bar *widget.ProgressBar 14 | } 15 | 16 | // SetValue updates the value of the progress bar - this should be between 0.0 and 1.0. 17 | func (p *ProgressDialog) SetValue(v float64) { 18 | p.bar.SetValue(v) 19 | } 20 | 21 | // NewProgress creates a progress dialog and returns the handle. 22 | // Using the returned type you should call Show() and then set its value through SetValue(). 23 | func NewProgress(title, message string, parent fyne.Window) *ProgressDialog { 24 | d := newDialog(title, message, theme.InfoIcon(), nil /*cancel?*/, parent) 25 | bar := widget.NewProgressBar() 26 | bar.Resize(fyne.NewSize(200, bar.MinSize().Height)) 27 | 28 | d.setButtons(bar) 29 | return &ProgressDialog{d, bar} 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/godbus/dbus/v5/transport_nonce_tcp.go: -------------------------------------------------------------------------------- 1 | //+build !windows 2 | 3 | package dbus 4 | 5 | import ( 6 | "errors" 7 | "io/ioutil" 8 | "net" 9 | ) 10 | 11 | func init() { 12 | transports["nonce-tcp"] = newNonceTcpTransport 13 | } 14 | 15 | func newNonceTcpTransport(keys string) (transport, error) { 16 | host := getKey(keys, "host") 17 | port := getKey(keys, "port") 18 | noncefile := getKey(keys, "noncefile") 19 | if host == "" || port == "" || noncefile == "" { 20 | return nil, errors.New("dbus: unsupported address (must set host, port and noncefile)") 21 | } 22 | protocol, err := tcpFamily(keys) 23 | if err != nil { 24 | return nil, err 25 | } 26 | socket, err := net.Dial(protocol, net.JoinHostPort(host, port)) 27 | if err != nil { 28 | return nil, err 29 | } 30 | b, err := ioutil.ReadFile(noncefile) 31 | if err != nil { 32 | return nil, err 33 | } 34 | _, err = socket.Write(b) 35 | if err != nil { 36 | return nil, err 37 | } 38 | return NewConn(socket) 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/goki/freetype/README: -------------------------------------------------------------------------------- 1 | The Freetype font rasterizer in the Go programming language. 2 | 3 | To download and install from source: 4 | $ go get github.com/tdewolff/freetype 5 | 6 | It is an incomplete port: 7 | * It only supports TrueType fonts, and not Type 1 fonts nor bitmap fonts. 8 | * It only supports the Unicode encoding. 9 | 10 | There are also some implementation differences: 11 | * It uses a 26.6 fixed point co-ordinate system everywhere internally, 12 | as opposed to the original Freetype's mix of 26.6 (or 10.6 for 16-bit 13 | systems) in some places, and 24.8 in the "smooth" rasterizer. 14 | 15 | Freetype-Go is derived from Freetype, which is written in C. Freetype is 16 | copyright 1996-2010 David Turner, Robert Wilhelm, and Werner Lemberg. 17 | Freetype-Go is copyright The Freetype-Go Authors, who are listed in the 18 | AUTHORS file. 19 | 20 | Unless otherwise noted, the Freetype-Go source files are distributed 21 | under the BSD-style license found in the LICENSE file. 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm64,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/godbus/dbus/v5/transport_tcp.go: -------------------------------------------------------------------------------- 1 | package dbus 2 | 3 | import ( 4 | "errors" 5 | "net" 6 | ) 7 | 8 | func init() { 9 | transports["tcp"] = newTcpTransport 10 | } 11 | 12 | func tcpFamily(keys string) (string, error) { 13 | switch getKey(keys, "family") { 14 | case "": 15 | return "tcp", nil 16 | case "ipv4": 17 | return "tcp4", nil 18 | case "ipv6": 19 | return "tcp6", nil 20 | default: 21 | return "", errors.New("dbus: invalid tcp family (must be ipv4 or ipv6)") 22 | } 23 | } 24 | 25 | func newTcpTransport(keys string) (transport, error) { 26 | host := getKey(keys, "host") 27 | port := getKey(keys, "port") 28 | if host == "" || port == "" { 29 | return nil, errors.New("dbus: unsupported address (must set host and port)") 30 | } 31 | 32 | protocol, err := tcpFamily(keys) 33 | if err != nil { 34 | return nil, err 35 | } 36 | socket, err := net.Dial(protocol, net.JoinHostPort(host, port)) 37 | if err != nil { 38 | return nil, err 39 | } 40 | return NewConn(socket) 41 | } 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/compact.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package language 6 | 7 | // CompactCoreInfo is a compact integer with the three core tags encoded. 8 | type CompactCoreInfo uint32 9 | 10 | // GetCompactCore generates a uint32 value that is guaranteed to be unique for 11 | // different language, region, and script values. 12 | func GetCompactCore(t Tag) (cci CompactCoreInfo, ok bool) { 13 | if t.LangID > langNoIndexOffset { 14 | return 0, false 15 | } 16 | cci |= CompactCoreInfo(t.LangID) << (8 + 12) 17 | cci |= CompactCoreInfo(t.ScriptID) << 12 18 | cci |= CompactCoreInfo(t.RegionID) 19 | return cci, true 20 | } 21 | 22 | // Tag generates a tag from c. 23 | func (c CompactCoreInfo) Tag() Tag { 24 | return Tag{ 25 | LangID: Language(c >> 20), 26 | RegionID: Region(c & 0x3ff), 27 | ScriptID: Script(c>>12) & 0xff, 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix 6 | // +build ppc64 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev & 0x3fffffff00000000) >> 32) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32((dev & 0x00000000ffffffff) >> 0) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | var DEVNO64 uint64 27 | DEVNO64 = 0x8000000000000000 28 | return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/dialog/progressinfinite.go: -------------------------------------------------------------------------------- 1 | package dialog 2 | 3 | import ( 4 | "fyne.io/fyne" 5 | "fyne.io/fyne/theme" 6 | "fyne.io/fyne/widget" 7 | ) 8 | 9 | // ProgressInfiniteDialog is a simple dialog window that displays text and a infinite progress bar. 10 | type ProgressInfiniteDialog struct { 11 | *dialog 12 | 13 | bar *widget.ProgressBarInfinite 14 | } 15 | 16 | // NewProgressInfinite creates a infinite progress dialog and returns the handle. 17 | // Using the returned type you should call Show(). 18 | func NewProgressInfinite(title, message string, parent fyne.Window) *ProgressInfiniteDialog { 19 | d := newDialog(title, message, theme.InfoIcon(), nil /*cancel?*/, parent) 20 | bar := widget.NewProgressBarInfinite() 21 | bar.Resize(fyne.NewSize(200, bar.MinSize().Height)) 22 | 23 | d.setButtons(bar) 24 | return &ProgressInfiniteDialog{d, bar} 25 | } 26 | 27 | // Hide this dialog and stop the infinite progress goroutine 28 | func (d *ProgressInfiniteDialog) Hide() { 29 | d.bar.Hide() 30 | d.dialog.Hide() 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/doc.go: -------------------------------------------------------------------------------- 1 | // Package require implements the same assertions as the `assert` package but 2 | // stops test execution when a test fails. 3 | // 4 | // Example Usage 5 | // 6 | // The following is a complete example using require in a standard test function: 7 | // import ( 8 | // "testing" 9 | // "github.com/stretchr/testify/require" 10 | // ) 11 | // 12 | // func TestSomething(t *testing.T) { 13 | // 14 | // var a string = "Hello" 15 | // var b string = "Hello" 16 | // 17 | // require.Equal(t, a, b, "The two words should be the same.") 18 | // 19 | // } 20 | // 21 | // Assertions 22 | // 23 | // The `require` package have same global functions as in the `assert` package, 24 | // but instead of returning a boolean result they call `t.FailNow()`. 25 | // 26 | // Every assertion function also takes an optional string message as the final argument, 27 | // allowing custom error messages to be appended to the message the assertion method outputs. 28 | package require 29 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/glfw/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2006 Marcus Geelnard 2 | 3 | Copyright (c) 2006-2019 Camilla Löwy 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would 16 | be appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not 19 | be misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_netbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in NetBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a NetBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x000fff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of a NetBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xfff00000) >> 12) 19 | return minor 20 | } 21 | 22 | // Mkdev returns a NetBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x000fff00 26 | dev |= (uint64(minor) << 12) & 0xfff00000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in OpenBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of an OpenBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x0000ff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of an OpenBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xffff0000) >> 8) 19 | return minor 20 | } 21 | 22 | // Mkdev returns an OpenBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x0000ff00 26 | dev |= (uint64(minor) << 8) & 0xffff0000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/driver/desktop/mouse.go: -------------------------------------------------------------------------------- 1 | package desktop 2 | 3 | import "fyne.io/fyne" 4 | 5 | // MouseButton represents a single button in a desktop MouseEvent 6 | type MouseButton int 7 | 8 | const ( 9 | // LeftMouseButton is the most common mouse button - on some systems the only one 10 | LeftMouseButton MouseButton = iota + 1 11 | // Don't currently expose this button 12 | middleMouseButton 13 | // RightMouseButton is the secondary button on most mouse input devices. 14 | RightMouseButton 15 | ) 16 | 17 | // MouseEvent contains data relating to desktop mouse events 18 | type MouseEvent struct { 19 | fyne.PointEvent 20 | Button MouseButton 21 | Modifier Modifier 22 | } 23 | 24 | // Mouseable represents desktop mouse events that can be sent to CanvasObjects 25 | type Mouseable interface { 26 | MouseDown(*MouseEvent) 27 | MouseUp(*MouseEvent) 28 | } 29 | 30 | // Hoverable is used when a canvas object wishes to know if a pointer device moves over it. 31 | type Hoverable interface { 32 | MouseIn(*MouseEvent) 33 | MouseOut() 34 | MouseMoved(*MouseEvent) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/fyne-io/mobile/event/paint/paint.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package paint defines an event for the app being ready to paint. 6 | // 7 | // See the golang.org/x/mobile/app package for details on the event model. 8 | package paint // import "github.com/fyne-io/mobile/event/paint" 9 | 10 | // Event indicates that the app is ready to paint the next frame of the GUI. 11 | // 12 | //A frame is completed by calling the App's Publish method. 13 | type Event struct { 14 | // External is true for paint events sent by the screen driver. 15 | // 16 | // An external event may be sent at any time in response to an 17 | // operating system event, for example the window opened, was 18 | // resized, or the screen memory was lost. 19 | // 20 | // Programs actively drawing to the screen as fast as vsync allows 21 | // should ignore external paint events to avoid a backlog of paint 22 | // events building up. 23 | External bool 24 | } 25 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/internal/painter/gl/capture.go: -------------------------------------------------------------------------------- 1 | package gl 2 | 3 | import ( 4 | "image" 5 | "image/color" 6 | 7 | "fyne.io/fyne" 8 | ) 9 | 10 | type captureImage struct { 11 | pix []uint8 12 | width, height int 13 | } 14 | 15 | func (c *captureImage) ColorModel() color.Model { 16 | return color.RGBAModel 17 | } 18 | 19 | func (c *captureImage) Bounds() image.Rectangle { 20 | return image.Rect(0, 0, c.width, c.height) 21 | } 22 | 23 | func (c *captureImage) At(x, y int) color.Color { 24 | start := ((c.height-y-1)*c.width + x) * 4 25 | return color.RGBA{R: c.pix[start], G: c.pix[start+1], B: c.pix[start+2], A: c.pix[start+3]} 26 | } 27 | 28 | func (p *glPainter) Capture(c fyne.Canvas) image.Image { 29 | width := int(float32(c.Size().Width) * c.Scale()) 30 | height := int(float32(c.Size().Height) * c.Scale()) 31 | pixels := make([]uint8, width*height*4) 32 | 33 | p.context.RunWithContext(func() { 34 | p.glCapture(int32(width), int32(height), &pixels) 35 | }) 36 | 37 | return &captureImage{ 38 | pix: pixels, 39 | width: width, 40 | height: height, 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/antchfx/xpath/LICENSE: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining a copy 2 | of this software and associated documentation files (the "Software"), to deal 3 | in the Software without restriction, including without limitation the rights 4 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 5 | copies of the Software, and to permit persons to whom the Software is 6 | furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in 9 | all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/native_windows.go: -------------------------------------------------------------------------------- 1 | package glfw 2 | 3 | //#define GLFW_EXPOSE_NATIVE_WIN32 4 | //#define GLFW_EXPOSE_NATIVE_WGL 5 | //#define GLFW_INCLUDE_NONE 6 | //#include "glfw/include/GLFW/glfw3.h" 7 | //#include "glfw/include/GLFW/glfw3native.h" 8 | import "C" 9 | 10 | // GetWin32Adapter returns the adapter device name of the monitor. 11 | func (m *Monitor) GetWin32Adapter() string { 12 | ret := C.glfwGetWin32Adapter(m.data) 13 | panicError() 14 | return C.GoString(ret) 15 | } 16 | 17 | // GetWin32Monitor returns the display device name of the monitor. 18 | func (m *Monitor) GetWin32Monitor() string { 19 | ret := C.glfwGetWin32Monitor(m.data) 20 | panicError() 21 | return C.GoString(ret) 22 | } 23 | 24 | // GetWin32Window returns the HWND of the window. 25 | func (w *Window) GetWin32Window() C.HWND { 26 | ret := C.glfwGetWin32Window(w.data) 27 | panicError() 28 | return ret 29 | } 30 | 31 | // GetWGLContext returns the HGLRC of the window. 32 | func (w *Window) GetWGLContext() C.HGLRC { 33 | ret := C.glfwGetWGLContext(w.data) 34 | panicError() 35 | return ret 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/antchfx/htmlquery/LICENSE: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining a copy 2 | of this software and associated documentation files (the "Software"), to deal 3 | in the Software without restriction, including without limitation the rights 4 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 5 | copies of the Software, and to permit persons to whom the Software is 6 | furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in 9 | all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/fen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build solaris 6 | 7 | package fsnotify 8 | 9 | import ( 10 | "errors" 11 | ) 12 | 13 | // Watcher watches a set of files, delivering events to a channel. 14 | type Watcher struct { 15 | Events chan Event 16 | Errors chan error 17 | } 18 | 19 | // NewWatcher establishes a new watcher with the underlying OS and begins waiting for events. 20 | func NewWatcher() (*Watcher, error) { 21 | return nil, errors.New("FEN based watcher not yet supported for fsnotify\n") 22 | } 23 | 24 | // Close removes all watches and closes the events channel. 25 | func (w *Watcher) Close() error { 26 | return nil 27 | } 28 | 29 | // Add starts watching the named file or directory (non-recursively). 30 | func (w *Watcher) Add(name string) error { 31 | return nil 32 | } 33 | 34 | // Remove stops watching the the named file or directory (non-recursively). 35 | func (w *Watcher) Remove(name string) error { 36 | return nil 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/antchfx/htmlquery/cache.go: -------------------------------------------------------------------------------- 1 | package htmlquery 2 | 3 | import ( 4 | "sync" 5 | 6 | "github.com/antchfx/xpath" 7 | "github.com/golang/groupcache/lru" 8 | ) 9 | 10 | // DisableSelectorCache will disable caching for the query selector if value is true. 11 | var DisableSelectorCache = false 12 | 13 | // SelectorCacheMaxEntries allows how many selector object can be caching. Default is 50. 14 | // Will disable caching if SelectorCacheMaxEntries <= 0. 15 | var SelectorCacheMaxEntries = 50 16 | 17 | var ( 18 | cacheOnce sync.Once 19 | cache *lru.Cache 20 | cacheMutex sync.Mutex 21 | ) 22 | 23 | func getQuery(expr string) (*xpath.Expr, error) { 24 | if DisableSelectorCache || SelectorCacheMaxEntries <= 0 { 25 | return xpath.Compile(expr) 26 | } 27 | cacheOnce.Do(func() { 28 | cache = lru.New(SelectorCacheMaxEntries) 29 | }) 30 | cacheMutex.Lock() 31 | defer cacheMutex.Unlock() 32 | if v, ok := cache.Get(expr); ok { 33 | return v.(*xpath.Expr), nil 34 | } 35 | v, err := xpath.Compile(expr) 36 | if err != nil { 37 | return nil, err 38 | } 39 | cache.Add(expr, v) 40 | return v, nil 41 | 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/antchfx/htmlquery/go.sum: -------------------------------------------------------------------------------- 1 | github.com/antchfx/xpath v1.1.6 h1:6sVh6hB5T6phw1pFpHRQ+C4bd8sNI+O58flqtg7h0R0= 2 | github.com/antchfx/xpath v1.1.6/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk= 3 | github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= 4 | github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 5 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 6 | golang.org/x/net v0.0.0-20200421231249-e086a090c8fd h1:QPwSajcTUrFriMF1nJ3XzgoqakqQEsnZf9LdXdi2nkI= 7 | golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 8 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 9 | golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 10 | golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= 11 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 12 | -------------------------------------------------------------------------------- /internal/bloom/bloom.go: -------------------------------------------------------------------------------- 1 | package bloom 2 | 3 | import ( 4 | "github.com/willf/bitset" 5 | ) 6 | 7 | const DefaultSize = 2 << 24 8 | 9 | var seeds = []uint{7, 11, 13, 31, 37, 61} 10 | 11 | type SimpleHash struct { 12 | cap uint 13 | seed uint 14 | } 15 | 16 | type Filter struct { 17 | set *bitset.BitSet 18 | funcs [6]SimpleHash 19 | } 20 | 21 | func NewBloomFilter() *Filter { 22 | bf := new(Filter) 23 | for i := 0; i < len(bf.funcs); i++ { 24 | bf.funcs[i] = SimpleHash{DefaultSize, seeds[i]} 25 | } 26 | bf.set = bitset.New(DefaultSize) 27 | return bf 28 | } 29 | 30 | func (bf Filter) Add(value string) { 31 | for _, f := range bf.funcs { 32 | bf.set.Set(f.hash(value)) 33 | } 34 | } 35 | 36 | func (bf Filter) Contains(value string) bool { 37 | if "" == value { 38 | return false 39 | } 40 | ret := true 41 | for _, f := range bf.funcs { 42 | ret = ret && bf.set.Test(f.hash(value)) 43 | } 44 | return ret 45 | } 46 | 47 | func (s SimpleHash) hash(value string) uint { 48 | var result uint = 0 49 | for i := 0; i < len(value); i++ { 50 | result = result*s.seed + uint(value[i]) 51 | } 52 | return (s.cap - 1) & result 53 | } 54 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build ppc64 ppc64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for ppc64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 19 | BL runtime·entersyscall(SB) 20 | MOVD a1+8(FP), R3 21 | MOVD a2+16(FP), R4 22 | MOVD a3+24(FP), R5 23 | MOVD R0, R6 24 | MOVD R0, R7 25 | MOVD R0, R8 26 | MOVD trap+0(FP), R9 // syscall entry 27 | SYSCALL R9 28 | MOVD R3, r1+32(FP) 29 | MOVD R4, r2+40(FP) 30 | BL runtime·exitsyscall(SB) 31 | RET 32 | 33 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 34 | MOVD a1+8(FP), R3 35 | MOVD a2+16(FP), R4 36 | MOVD a3+24(FP), R5 37 | MOVD R0, R6 38 | MOVD R0, R7 39 | MOVD R0, R8 40 | MOVD trap+0(FP), R9 // syscall entry 41 | SYSCALL R9 42 | MOVD R3, r1+32(FP) 43 | MOVD R4, r2+40(FP) 44 | RET 45 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,gccgo,386 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | 22 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 23 | fd, _, err := Syscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 24 | return int(fd), err 25 | } 26 | 27 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 28 | fd, _, err := RawSyscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 29 | return int(fd), err 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | ) 12 | 13 | // Round the length of a raw sockaddr up to align it properly. 14 | func cmsgAlignOf(salen int) int { 15 | salign := SizeofPtr 16 | 17 | // dragonfly needs to check ABI version at runtime, see cmsgAlignOf in 18 | // sockcmsg_dragonfly.go 19 | switch runtime.GOOS { 20 | case "aix": 21 | // There is no alignment on AIX. 22 | salign = 1 23 | case "darwin", "illumos", "solaris": 24 | // NOTE: It seems like 64-bit Darwin, Illumos and Solaris 25 | // kernels still require 32-bit aligned access to network 26 | // subsystem. 27 | if SizeofPtr == 8 { 28 | salign = 4 29 | } 30 | case "netbsd", "openbsd": 31 | // NetBSD and OpenBSD armv7 require 64-bit alignment. 32 | if runtime.GOARCH == "arm" { 33 | salign = 8 34 | } 35 | } 36 | 37 | return (salen + salign - 1) & ^(salign - 1) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_freebsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in FreeBSD's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a FreeBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a FreeBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a FreeBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /internal/markdown/markdown_test.go: -------------------------------------------------------------------------------- 1 | package markdown 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | "time" 7 | ) 8 | 9 | func TestSort(t *testing.T) { 10 | loc, _ := time.LoadLocation("Asia/Shanghai") 11 | theTime1, _ := time.ParseInLocation("2006-01-02 15:04:05", "2020-06-03 23:54:35", loc) 12 | theTime2, _ := time.ParseInLocation("2006-01-02 15:04:05", "2020-06-03 20:54:35", loc) 13 | theTime3, _ := time.ParseInLocation("2006-01-02 15:04:05", "2020-06-03 22:56:35", loc) 14 | theTime4, _ := time.ParseInLocation("2006-01-02 15:04:05", "2020-06-03 22:55:35", loc) 15 | persons := DataArray{ 16 | {Price: 1200, Time: theTime1, Content: "哈哈", Link: "https://www.douban.com/group/topic/178647758/", Title: "as"}, 17 | {Price: 3200, Time: theTime2, Content: "哈哈", Link: "https://www.douban.com/group/topic/178647758/", Title: "as"}, 18 | {Price: 1600, Time: theTime3, Content: "哈哈", Link: "https://www.douban.com/group/topic/178647758/", Title: "as"}, 19 | {Price: 1600, Time: theTime4, Content: "哈哈", Link: "https://www.douban.com/group/topic/178647758/", Title: "as"}, 20 | } 21 | //persons = append(persons, Data{price: 3200, time: theTime1}) 22 | fmt.Println(persons) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/fyne-io/mobile/exp/f32/vec4.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package f32 6 | 7 | import "fmt" 8 | 9 | type Vec4 [4]float32 10 | 11 | func (v Vec4) String() string { 12 | return fmt.Sprintf("Vec4[% 0.3f, % 0.3f, % 0.3f, % 0.3f]", v[0], v[1], v[2], v[3]) 13 | } 14 | 15 | func (v *Vec4) Normalize() { 16 | sq := v.Dot(v) 17 | inv := 1 / Sqrt(sq) 18 | v[0] *= inv 19 | v[1] *= inv 20 | v[2] *= inv 21 | v[3] *= inv 22 | } 23 | 24 | func (v *Vec4) Sub(v0, v1 *Vec4) { 25 | v[0] = v0[0] - v1[0] 26 | v[1] = v0[1] - v1[1] 27 | v[2] = v0[2] - v1[2] 28 | v[3] = v0[3] - v1[3] 29 | } 30 | 31 | func (v *Vec4) Add(v0, v1 *Vec4) { 32 | v[0] = v0[0] + v1[0] 33 | v[1] = v0[1] + v1[1] 34 | v[2] = v0[2] + v1[2] 35 | v[3] = v0[3] + v1[3] 36 | } 37 | 38 | func (v *Vec4) Mul(v0, v1 *Vec4) { 39 | v[0] = v0[0] * v1[0] 40 | v[1] = v0[1] * v1[1] 41 | v[2] = v0[2] * v1[2] 42 | v[3] = v0[3] * v1[3] 43 | } 44 | 45 | func (v *Vec4) Dot(v1 *Vec4) float32 { 46 | return v[0]*v1[0] + v[1]*v1[1] + v[2]*v1[2] + v[3]*v1[3] 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/godbus/dbus/v5/transport_generic.go: -------------------------------------------------------------------------------- 1 | package dbus 2 | 3 | import ( 4 | "encoding/binary" 5 | "errors" 6 | "io" 7 | "unsafe" 8 | ) 9 | 10 | var nativeEndian binary.ByteOrder 11 | 12 | func detectEndianness() binary.ByteOrder { 13 | var x uint32 = 0x01020304 14 | if *(*byte)(unsafe.Pointer(&x)) == 0x01 { 15 | return binary.BigEndian 16 | } 17 | return binary.LittleEndian 18 | } 19 | 20 | func init() { 21 | nativeEndian = detectEndianness() 22 | } 23 | 24 | type genericTransport struct { 25 | io.ReadWriteCloser 26 | } 27 | 28 | func (t genericTransport) SendNullByte() error { 29 | _, err := t.Write([]byte{0}) 30 | return err 31 | } 32 | 33 | func (t genericTransport) SupportsUnixFDs() bool { 34 | return false 35 | } 36 | 37 | func (t genericTransport) EnableUnixFDs() {} 38 | 39 | func (t genericTransport) ReadMessage() (*Message, error) { 40 | return DecodeMessage(t) 41 | } 42 | 43 | func (t genericTransport) SendMessage(msg *Message) error { 44 | for _, v := range msg.Body { 45 | if _, ok := v.(UnixFD); ok { 46 | return errors.New("dbus: unix fd passing not enabled") 47 | } 48 | } 49 | return msg.EncodeTo(t, nativeEndian) 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/gl/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Eric Woroshow 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/fyne-io/mobile/gl/work_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !cgo !darwin,!linux,!openbsd,!freebsd 6 | // +build !windows 7 | 8 | package gl 9 | 10 | // This file contains stub implementations of what the other work*.go files 11 | // provide. These stubs don't do anything, other than compile (e.g. when cgo is 12 | // disabled). 13 | 14 | type context struct{} 15 | 16 | func (*context) enqueue(c call) uintptr { 17 | panic("unimplemented; GOOS/CGO combination not supported") 18 | } 19 | 20 | func (*context) cString(str string) (uintptr, func()) { 21 | panic("unimplemented; GOOS/CGO combination not supported") 22 | } 23 | 24 | func (*context) cStringPtr(str string) (uintptr, func()) { 25 | panic("unimplemented; GOOS/CGO combination not supported") 26 | } 27 | 28 | type context3 = context 29 | 30 | func NewContext() (Context, Worker) { 31 | panic("unimplemented; GOOS/CGO combination not supported") 32 | } 33 | 34 | func Version() string { 35 | panic("unimplemented; GOOS/CGO combination not supported") 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Dragonfly's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a DragonFlyBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a DragonFlyBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a DragonFlyBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2012-2018 Mat Ryer and Tyler Bunnell 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/layout/maxlayout.go: -------------------------------------------------------------------------------- 1 | // Package layout defines the various layouts available to Fyne apps 2 | package layout // import "fyne.io/fyne/layout" 3 | 4 | import "fyne.io/fyne" 5 | 6 | // Declare conformity with Layout interface 7 | var _ fyne.Layout = (*maxLayout)(nil) 8 | 9 | type maxLayout struct { 10 | } 11 | 12 | // Layout is called to pack all child objects into a specified size. 13 | // For MaxLayout this sets all children to the full size passed. 14 | func (m *maxLayout) Layout(objects []fyne.CanvasObject, size fyne.Size) { 15 | for _, child := range objects { 16 | child.Resize(size) 17 | } 18 | } 19 | 20 | // MinSize finds the smallest size that satisfies all the child objects. 21 | // For MaxLayout this is determined simply as the MinSize of the largest child. 22 | func (m *maxLayout) MinSize(objects []fyne.CanvasObject) fyne.Size { 23 | minSize := fyne.NewSize(0, 0) 24 | for _, child := range objects { 25 | if !child.Visible() { 26 | continue 27 | } 28 | 29 | minSize = minSize.Union(child.MinSize()) 30 | } 31 | 32 | return minSize 33 | } 34 | 35 | // NewMaxLayout creates a new MaxLayout instance 36 | func NewMaxLayout() fyne.Layout { 37 | return &maxLayout{} 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm64,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/386 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/arm the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/github.com/fyne-io/mobile/exp/f32/vec3.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package f32 6 | 7 | import "fmt" 8 | 9 | type Vec3 [3]float32 10 | 11 | func (v Vec3) String() string { 12 | return fmt.Sprintf("Vec3[% 0.3f, % 0.3f, % 0.3f]", v[0], v[1], v[2]) 13 | } 14 | 15 | func (v *Vec3) Normalize() { 16 | sq := v.Dot(v) 17 | inv := 1 / Sqrt(sq) 18 | v[0] *= inv 19 | v[1] *= inv 20 | v[2] *= inv 21 | } 22 | 23 | func (v *Vec3) Sub(v0, v1 *Vec3) { 24 | v[0] = v0[0] - v1[0] 25 | v[1] = v0[1] - v1[1] 26 | v[2] = v0[2] - v1[2] 27 | } 28 | 29 | func (v *Vec3) Add(v0, v1 *Vec3) { 30 | v[0] = v0[0] + v1[0] 31 | v[1] = v0[1] + v1[1] 32 | v[2] = v0[2] + v1[2] 33 | } 34 | 35 | func (v *Vec3) Mul(v0, v1 *Vec3) { 36 | v[0] = v0[0] * v1[0] 37 | v[1] = v0[1] * v1[1] 38 | v[2] = v0[2] * v1[2] 39 | } 40 | 41 | func (v *Vec3) Cross(v0, v1 *Vec3) { 42 | v[0] = v0[1]*v1[2] - v0[2]*v1[1] 43 | v[1] = v0[2]*v1[0] - v0[0]*v1[2] 44 | v[2] = v0[0]*v1[1] - v0[1]*v1[0] 45 | } 46 | 47 | func (v *Vec3) Dot(v1 *Vec3) float32 { 48 | return v[0]*v1[0] + v[1]*v1[1] + v[2]*v1[2] 49 | } 50 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/internal/widget/base_renderer.go: -------------------------------------------------------------------------------- 1 | package widget 2 | 3 | import ( 4 | "image/color" 5 | 6 | "fyne.io/fyne" 7 | "fyne.io/fyne/theme" 8 | ) 9 | 10 | // BaseRenderer is a renderer base providing the most common implementations of a part of the 11 | // widget.Renderer interface. 12 | type BaseRenderer struct { 13 | objects []fyne.CanvasObject 14 | } 15 | 16 | // NewBaseRenderer creates a new BaseRenderer. 17 | func NewBaseRenderer(objects []fyne.CanvasObject) BaseRenderer { 18 | return BaseRenderer{objects} 19 | } 20 | 21 | // BackgroundColor returns the theme background color. 22 | // Implements: fyne.WidgetRenderer 23 | func (r *BaseRenderer) BackgroundColor() color.Color { 24 | return theme.BackgroundColor() 25 | } 26 | 27 | // Destroy does nothing in the base implementation. 28 | // Implements: fyne.WidgetRenderer 29 | func (r *BaseRenderer) Destroy() { 30 | } 31 | 32 | // Objects returns the objects that should be rendered. 33 | // Implements: fyne.WidgetRenderer 34 | func (r *BaseRenderer) Objects() []fyne.CanvasObject { 35 | return r.objects 36 | } 37 | 38 | // SetObjects updates the objects of the renderer. 39 | func (r *BaseRenderer) SetObjects(objects []fyne.CanvasObject) { 40 | r.objects = objects 41 | } 42 | -------------------------------------------------------------------------------- /vendor/gopkg.in/ini.v1/error.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Unknwon 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package ini 16 | 17 | import ( 18 | "fmt" 19 | ) 20 | 21 | // ErrDelimiterNotFound indicates the error type of no delimiter is found which there should be one. 22 | type ErrDelimiterNotFound struct { 23 | Line string 24 | } 25 | 26 | // IsErrDelimiterNotFound returns true if the given error is an instance of ErrDelimiterNotFound. 27 | func IsErrDelimiterNotFound(err error) bool { 28 | _, ok := err.(ErrDelimiterNotFound) 29 | return ok 30 | } 31 | 32 | func (err ErrDelimiterNotFound) Error() string { 33 | return fmt.Sprintf("key-value delimiter not found: %s", err.Line) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build dragonfly freebsd linux netbsd openbsd 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 12 | // systems by fcntl_linux_32bit.go to be SYS_FCNTL64. 13 | var fcntl64Syscall uintptr = SYS_FCNTL 14 | 15 | func fcntl(fd int, cmd, arg int) (int, error) { 16 | valptr, _, errno := Syscall(fcntl64Syscall, uintptr(fd), uintptr(cmd), uintptr(arg)) 17 | var err error 18 | if errno != 0 { 19 | err = errno 20 | } 21 | return int(valptr), err 22 | } 23 | 24 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 25 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 26 | return fcntl(int(fd), cmd, arg) 27 | } 28 | 29 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 30 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 31 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 32 | if errno == 0 { 33 | return nil 34 | } 35 | return errno 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Socket control messages 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // UnixCredentials encodes credentials into a socket control message 12 | // for sending to another process. This can be used for 13 | // authentication. 14 | func UnixCredentials(ucred *Ucred) []byte { 15 | b := make([]byte, CmsgSpace(SizeofUcred)) 16 | h := (*Cmsghdr)(unsafe.Pointer(&b[0])) 17 | h.Level = SOL_SOCKET 18 | h.Type = SCM_CREDENTIALS 19 | h.SetLen(CmsgLen(SizeofUcred)) 20 | *(*Ucred)(h.data(0)) = *ucred 21 | return b 22 | } 23 | 24 | // ParseUnixCredentials decodes a socket control message that contains 25 | // credentials in a Ucred structure. To receive such a message, the 26 | // SO_PASSCRED option must be enabled on the socket. 27 | func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) { 28 | if m.Header.Level != SOL_SOCKET { 29 | return nil, EINVAL 30 | } 31 | if m.Header.Type != SCM_CREDENTIALS { 32 | return nil, EINVAL 33 | } 34 | ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0])) 35 | return &ucred, nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/internal/driver/gomobile/device.go: -------------------------------------------------------------------------------- 1 | package gomobile 2 | 3 | import ( 4 | "fyne.io/fyne/driver/mobile" 5 | "github.com/fyne-io/mobile/event/size" 6 | 7 | "fyne.io/fyne" 8 | ) 9 | 10 | type device struct { 11 | insetTop, insetBottom, insetLeft, insetRight int 12 | } 13 | 14 | var ( 15 | currentOrientation size.Orientation 16 | currentDPI float32 17 | ) 18 | 19 | // Declare conformity with Device 20 | var _ fyne.Device = (*device)(nil) 21 | 22 | func (*device) Orientation() fyne.DeviceOrientation { 23 | switch currentOrientation { 24 | case size.OrientationLandscape: 25 | return fyne.OrientationHorizontalLeft 26 | default: 27 | return fyne.OrientationVertical 28 | } 29 | } 30 | 31 | func (*device) IsMobile() bool { 32 | return true 33 | } 34 | 35 | func (*device) HasKeyboard() bool { 36 | return false 37 | } 38 | 39 | func (d *device) SystemScale() float32 { 40 | return d.SystemScaleForWindow(nil) 41 | } 42 | 43 | func (*device) ShowVirtualKeyboard() { 44 | showVirtualKeyboard(mobile.DefaultKeyboard) 45 | } 46 | 47 | func (*device) ShowVirtualKeyboardType(keyboard mobile.KeyboardType) { 48 | showVirtualKeyboard(keyboard) 49 | } 50 | 51 | func (*device) HideVirtualKeyboard() { 52 | hideVirtualKeyboard() 53 | } 54 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_c.c: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo 6 | // +build !aix 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #define _STRINGIFY2_(x) #x 13 | #define _STRINGIFY_(x) _STRINGIFY2_(x) 14 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) 15 | 16 | // Call syscall from C code because the gccgo support for calling from 17 | // Go to C does not support varargs functions. 18 | 19 | struct ret { 20 | uintptr_t r; 21 | uintptr_t err; 22 | }; 23 | 24 | struct ret 25 | gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 26 | { 27 | struct ret r; 28 | 29 | errno = 0; 30 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 31 | r.err = errno; 32 | return r; 33 | } 34 | 35 | uintptr_t 36 | gccgoRealSyscallNoError(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 37 | { 38 | return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/native_darwin.go: -------------------------------------------------------------------------------- 1 | package glfw 2 | 3 | /* 4 | #define GLFW_EXPOSE_NATIVE_COCOA 5 | #define GLFW_EXPOSE_NATIVE_NSGL 6 | #include "glfw/include/GLFW/glfw3.h" 7 | #include "glfw/include/GLFW/glfw3native.h" 8 | 9 | // workaround wrappers needed due to a cgo and/or LLVM bug. 10 | // See: https://github.com/go-gl/glfw/issues/136 11 | void *workaround_glfwGetCocoaWindow(GLFWwindow *w) { 12 | return (void *)glfwGetCocoaWindow(w); 13 | } 14 | void *workaround_glfwGetNSGLContext(GLFWwindow *w) { 15 | return (void *)glfwGetNSGLContext(w); 16 | } 17 | */ 18 | import "C" 19 | import "unsafe" 20 | 21 | // GetCocoaMonitor returns the CGDirectDisplayID of the monitor. 22 | func (m *Monitor) GetCocoaMonitor() uintptr { 23 | ret := uintptr(C.glfwGetCocoaMonitor(m.data)) 24 | panicError() 25 | return ret 26 | } 27 | 28 | // GetCocoaWindow returns the NSWindow of the window. 29 | func (w *Window) GetCocoaWindow() unsafe.Pointer { 30 | ret := C.workaround_glfwGetCocoaWindow(w.data) 31 | panicError() 32 | return ret 33 | } 34 | 35 | // GetNSGLContext returns the NSOpenGLContext of the window. 36 | func (w *Window) GetNSGLContext() unsafe.Pointer { 37 | ret := C.workaround_glfwGetNSGLContext(w.data) 38 | panicError() 39 | return ret 40 | } 41 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/internal/driver/gomobile/clipboard_android.go: -------------------------------------------------------------------------------- 1 | // +build android 2 | 3 | package gomobile 4 | 5 | /* 6 | #cgo LDFLAGS: -landroid -llog -lEGL -lGLESv2 7 | 8 | #include 9 | 10 | char *getClipboardContent(uintptr_t java_vm, uintptr_t jni_env, uintptr_t ctx); 11 | void setClipboardContent(uintptr_t java_vm, uintptr_t jni_env, uintptr_t ctx, char *content); 12 | */ 13 | import "C" 14 | import ( 15 | "unsafe" 16 | 17 | "github.com/fyne-io/mobile/app" 18 | ) 19 | 20 | // Content returns the clipboard content for Android 21 | func (c *mobileClipboard) Content() string { 22 | content := "" 23 | app.RunOnJVM(func(vm, env, ctx uintptr) error { 24 | chars := C.getClipboardContent(C.uintptr_t(vm), C.uintptr_t(env), C.uintptr_t(ctx)) 25 | content = C.GoString(chars) 26 | C.free(unsafe.Pointer(chars)) 27 | return nil 28 | }) 29 | return content 30 | } 31 | 32 | // SetContent sets the clipboard content for Android 33 | func (c *mobileClipboard) SetContent(content string) { 34 | contentStr := C.CString(content) 35 | defer C.free(unsafe.Pointer(contentStr)) 36 | 37 | app.RunOnJVM(func(vm, env, ctx uintptr) error { 38 | C.setClipboardContent(C.uintptr_t(vm), C.uintptr_t(env), C.uintptr_t(ctx), contentStr) 39 | return nil 40 | }) 41 | } 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_riscv64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build riscv64,!gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for linux/riscv64. 11 | // 12 | // Where available, just jump to package syscall's implementation of 13 | // these functions. 14 | 15 | TEXT ·Syscall(SB),NOSPLIT,$0-56 16 | JMP syscall·Syscall(SB) 17 | 18 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 19 | JMP syscall·Syscall6(SB) 20 | 21 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 22 | CALL runtime·entersyscall(SB) 23 | MOV a1+8(FP), A0 24 | MOV a2+16(FP), A1 25 | MOV a3+24(FP), A2 26 | MOV trap+0(FP), A7 // syscall entry 27 | ECALL 28 | MOV A0, r1+32(FP) // r1 29 | MOV A1, r2+40(FP) // r2 30 | CALL runtime·exitsyscall(SB) 31 | RET 32 | 33 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 34 | JMP syscall·RawSyscall(SB) 35 | 36 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 37 | JMP syscall·RawSyscall6(SB) 38 | 39 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 40 | MOV a1+8(FP), A0 41 | MOV a2+16(FP), A1 42 | MOV a3+24(FP), A2 43 | MOV trap+0(FP), A7 // syscall entry 44 | ECALL 45 | MOV A0, r1+32(FP) 46 | MOV A1, r2+40(FP) 47 | RET 48 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/driver/desktop/shortcut.go: -------------------------------------------------------------------------------- 1 | package desktop 2 | 3 | import ( 4 | "runtime" 5 | "strings" 6 | 7 | "fyne.io/fyne" 8 | ) 9 | 10 | // Declare conformity with Shortcut interface 11 | var _ fyne.Shortcut = (*CustomShortcut)(nil) 12 | 13 | // CustomShortcut describes a shortcut desktop event. 14 | type CustomShortcut struct { 15 | fyne.KeyName 16 | Modifier 17 | } 18 | 19 | // ShortcutName returns the shortcut name associated to the event 20 | func (cs *CustomShortcut) ShortcutName() string { 21 | id := &strings.Builder{} 22 | id.WriteString("CustomDesktop:") 23 | id.WriteString(modifierToString(cs.Modifier)) 24 | id.WriteString("+") 25 | id.WriteString(string(cs.KeyName)) 26 | return id.String() 27 | } 28 | 29 | func modifierToString(mods Modifier) string { 30 | s := []string{} 31 | if (mods & ShiftModifier) != 0 { 32 | s = append(s, string("Shift")) 33 | } 34 | if (mods & ControlModifier) != 0 { 35 | s = append(s, string("Control")) 36 | } 37 | if (mods & AltModifier) != 0 { 38 | s = append(s, string("Alt")) 39 | } 40 | if (mods & SuperModifier) != 0 { 41 | if runtime.GOOS == "darwin" { 42 | s = append(s, string("Command")) 43 | } else { 44 | s = append(s, string("Super")) 45 | } 46 | } 47 | return strings.Join(s, "+") 48 | } 49 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/internal/driver/glfw/device.go: -------------------------------------------------------------------------------- 1 | package glfw 2 | 3 | import ( 4 | "runtime" 5 | 6 | "fyne.io/fyne" 7 | ) 8 | 9 | type glDevice struct { 10 | } 11 | 12 | // Declare conformity with Device 13 | var _ fyne.Device = (*glDevice)(nil) 14 | 15 | func (*glDevice) Orientation() fyne.DeviceOrientation { 16 | return fyne.OrientationHorizontalLeft // TODO should we consider the monitor orientation or topmost window? 17 | } 18 | 19 | func (*glDevice) IsMobile() bool { 20 | return false 21 | } 22 | 23 | func (*glDevice) HasKeyboard() bool { 24 | return true // TODO actually check - we could be in tablet mode 25 | } 26 | 27 | // Deprecated: SystemScaleForWindow provides an accurate answer, this method may return incorrect results! 28 | func (d *glDevice) SystemScale() float32 { 29 | if runtime.GOOS == "windows" || runtime.GOOS == "darwin" { 30 | return 1.0 31 | } 32 | 33 | return fyne.SettingsScaleAuto 34 | } 35 | 36 | func (*glDevice) SystemScaleForWindow(w fyne.Window) float32 { 37 | if runtime.GOOS == "darwin" { 38 | return 1.0 // macOS scaling is done at the texture level 39 | } 40 | if runtime.GOOS == "windows" { 41 | xScale, _ := w.(*window).viewport.GetContentScale() 42 | return xScale 43 | } 44 | 45 | return fyne.SettingsScaleAuto 46 | } 47 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/unveil_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import ( 8 | "syscall" 9 | "unsafe" 10 | ) 11 | 12 | // Unveil implements the unveil syscall. 13 | // For more information see unveil(2). 14 | // Note that the special case of blocking further 15 | // unveil calls is handled by UnveilBlock. 16 | func Unveil(path string, flags string) error { 17 | pathPtr, err := syscall.BytePtrFromString(path) 18 | if err != nil { 19 | return err 20 | } 21 | flagsPtr, err := syscall.BytePtrFromString(flags) 22 | if err != nil { 23 | return err 24 | } 25 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(unsafe.Pointer(pathPtr)), uintptr(unsafe.Pointer(flagsPtr)), 0) 26 | if e != 0 { 27 | return e 28 | } 29 | return nil 30 | } 31 | 32 | // UnveilBlock blocks future unveil calls. 33 | // For more information see unveil(2). 34 | func UnveilBlock() error { 35 | // Both pointers must be nil. 36 | var pathUnsafe, flagsUnsafe unsafe.Pointer 37 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(pathUnsafe), uintptr(flagsUnsafe), 0) 38 | if e != 0 { 39 | return e 40 | } 41 | return nil 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/image/math/f64/f64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package f64 implements float64 vector and matrix types. 6 | package f64 // import "golang.org/x/image/math/f64" 7 | 8 | // Vec2 is a 2-element vector. 9 | type Vec2 [2]float64 10 | 11 | // Vec3 is a 3-element vector. 12 | type Vec3 [3]float64 13 | 14 | // Vec4 is a 4-element vector. 15 | type Vec4 [4]float64 16 | 17 | // Mat3 is a 3x3 matrix in row major order. 18 | // 19 | // m[3*r + c] is the element in the r'th row and c'th column. 20 | type Mat3 [9]float64 21 | 22 | // Mat4 is a 4x4 matrix in row major order. 23 | // 24 | // m[4*r + c] is the element in the r'th row and c'th column. 25 | type Mat4 [16]float64 26 | 27 | // Aff3 is a 3x3 affine transformation matrix in row major order, where the 28 | // bottom row is implicitly [0 0 1]. 29 | // 30 | // m[3*r + c] is the element in the r'th row and c'th column. 31 | type Aff3 [6]float64 32 | 33 | // Aff4 is a 4x4 affine transformation matrix in row major order, where the 34 | // bottom row is implicitly [0 0 0 1]. 35 | // 36 | // m[4*r + c] is the element in the r'th row and c'th column. 37 | type Aff4 [12]float64 38 | -------------------------------------------------------------------------------- /vendor/github.com/willf/bitset/popcnt.go: -------------------------------------------------------------------------------- 1 | package bitset 2 | 3 | // bit population count, take from 4 | // https://code.google.com/p/go/issues/detail?id=4988#c11 5 | // credit: https://code.google.com/u/arnehormann/ 6 | func popcount(x uint64) (n uint64) { 7 | x -= (x >> 1) & 0x5555555555555555 8 | x = (x>>2)&0x3333333333333333 + x&0x3333333333333333 9 | x += x >> 4 10 | x &= 0x0f0f0f0f0f0f0f0f 11 | x *= 0x0101010101010101 12 | return x >> 56 13 | } 14 | 15 | func popcntSliceGo(s []uint64) uint64 { 16 | cnt := uint64(0) 17 | for _, x := range s { 18 | cnt += popcount(x) 19 | } 20 | return cnt 21 | } 22 | 23 | func popcntMaskSliceGo(s, m []uint64) uint64 { 24 | cnt := uint64(0) 25 | for i := range s { 26 | cnt += popcount(s[i] &^ m[i]) 27 | } 28 | return cnt 29 | } 30 | 31 | func popcntAndSliceGo(s, m []uint64) uint64 { 32 | cnt := uint64(0) 33 | for i := range s { 34 | cnt += popcount(s[i] & m[i]) 35 | } 36 | return cnt 37 | } 38 | 39 | func popcntOrSliceGo(s, m []uint64) uint64 { 40 | cnt := uint64(0) 41 | for i := range s { 42 | cnt += popcount(s[i] | m[i]) 43 | } 44 | return cnt 45 | } 46 | 47 | func popcntXorSliceGo(s, m []uint64) uint64 { 48 | cnt := uint64(0) 49 | for i := range s { 50 | cnt += popcount(s[i] ^ m[i]) 51 | } 52 | return cnt 53 | } 54 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/test/testfile.go: -------------------------------------------------------------------------------- 1 | package test 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | "os" 7 | "path/filepath" 8 | 9 | "fyne.io/fyne" 10 | "fyne.io/fyne/storage" 11 | ) 12 | 13 | type file struct { 14 | *os.File 15 | path string 16 | } 17 | 18 | func (f *file) Open() (io.ReadCloser, error) { 19 | return os.Open(f.path) 20 | } 21 | 22 | func (f *file) Save() (io.WriteCloser, error) { 23 | return os.Open(f.path) 24 | } 25 | 26 | func (f *file) ReadOnly() bool { 27 | return true 28 | } 29 | 30 | func (f *file) Name() string { 31 | return filepath.Base(f.path) 32 | } 33 | 34 | func (f *file) URI() fyne.URI { 35 | return storage.NewURI("file://" + f.path) 36 | } 37 | 38 | func openFile(uri fyne.URI, create bool) (*file, error) { 39 | if uri.Scheme() != "file" { 40 | return nil, fmt.Errorf("unsupported URL protocol") 41 | } 42 | 43 | path := uri.String()[7:] 44 | f, err := os.Open(path) 45 | if err != nil && create { 46 | f, err = os.Create(path) 47 | } 48 | return &file{File: f, path: path}, err 49 | } 50 | 51 | func (d *testDriver) FileReaderForURI(uri fyne.URI) (fyne.URIReadCloser, error) { 52 | return openFile(uri, false) 53 | } 54 | 55 | func (d *testDriver) FileWriterForURI(uri fyne.URI) (fyne.URIWriteCloser, error) { 56 | return openFile(uri, true) 57 | } 58 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/requirements.go: -------------------------------------------------------------------------------- 1 | package require 2 | 3 | // TestingT is an interface wrapper around *testing.T 4 | type TestingT interface { 5 | Errorf(format string, args ...interface{}) 6 | FailNow() 7 | } 8 | 9 | type tHelper interface { 10 | Helper() 11 | } 12 | 13 | // ComparisonAssertionFunc is a common function prototype when comparing two values. Can be useful 14 | // for table driven tests. 15 | type ComparisonAssertionFunc func(TestingT, interface{}, interface{}, ...interface{}) 16 | 17 | // ValueAssertionFunc is a common function prototype when validating a single value. Can be useful 18 | // for table driven tests. 19 | type ValueAssertionFunc func(TestingT, interface{}, ...interface{}) 20 | 21 | // BoolAssertionFunc is a common function prototype when validating a bool value. Can be useful 22 | // for table driven tests. 23 | type BoolAssertionFunc func(TestingT, bool, ...interface{}) 24 | 25 | // ErrorAssertionFunc is a common function prototype when validating an error value. Can be useful 26 | // for table driven tests. 27 | type ErrorAssertionFunc func(TestingT, error, ...interface{}) 28 | 29 | //go:generate sh -c "cd ../_codegen && go build && cd - && ../_codegen/_codegen -output-package=require -template=require.go.tmpl -include-format-funcs" 30 | -------------------------------------------------------------------------------- /vendor/github.com/willf/bitset/azure-pipelines.yml: -------------------------------------------------------------------------------- 1 | # Go 2 | # Build your Go project. 3 | # Add steps that test, save build artifacts, deploy, and more: 4 | # https://docs.microsoft.com/azure/devops/pipelines/languages/go 5 | 6 | trigger: 7 | - master 8 | 9 | pool: 10 | vmImage: 'Ubuntu-16.04' 11 | 12 | variables: 13 | GOBIN: '$(GOPATH)/bin' # Go binaries path 14 | GOROOT: '/usr/local/go1.11' # Go installation path 15 | GOPATH: '$(system.defaultWorkingDirectory)/gopath' # Go workspace path 16 | modulePath: '$(GOPATH)/src/github.com/$(build.repository.name)' # Path to the module's code 17 | 18 | steps: 19 | - script: | 20 | mkdir -p '$(GOBIN)' 21 | mkdir -p '$(GOPATH)/pkg' 22 | mkdir -p '$(modulePath)' 23 | shopt -s extglob 24 | shopt -s dotglob 25 | mv !(gopath) '$(modulePath)' 26 | echo '##vso[task.prependpath]$(GOBIN)' 27 | echo '##vso[task.prependpath]$(GOROOT)/bin' 28 | displayName: 'Set up the Go workspace' 29 | 30 | - script: | 31 | go version 32 | go get -v -t -d ./... 33 | if [ -f Gopkg.toml ]; then 34 | curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh 35 | dep ensure 36 | fi 37 | go build -v . 38 | workingDirectory: '$(modulePath)' 39 | displayName: 'Get dependencies, then build' 40 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/storage/uri.go: -------------------------------------------------------------------------------- 1 | package storage 2 | 3 | import ( 4 | "bufio" 5 | "mime" 6 | "path/filepath" 7 | "strings" 8 | "unicode/utf8" 9 | 10 | "fyne.io/fyne" 11 | ) 12 | 13 | type uri struct { 14 | raw string 15 | } 16 | 17 | // NewURI creates a new URI from the given string representation. 18 | // This could be a URI from an external source or one saved from URI.String() 19 | func NewURI(u string) fyne.URI { 20 | return &uri{raw: u} 21 | } 22 | 23 | func (u *uri) Extension() string { 24 | return filepath.Ext(u.raw) 25 | } 26 | 27 | func (u *uri) MimeType() string { 28 | mimeTypeFull := mime.TypeByExtension(u.Extension()) 29 | if mimeTypeFull == "" { 30 | mimeTypeFull = "text/plain" 31 | readCloser, err := fyne.CurrentApp().Driver().FileReaderForURI(u) 32 | if err == nil { 33 | defer readCloser.Close() 34 | scanner := bufio.NewScanner(readCloser) 35 | if scanner.Scan() && !utf8.Valid(scanner.Bytes()) { 36 | mimeTypeFull = "application/octet-stream" 37 | } 38 | } 39 | } 40 | 41 | return strings.Split(mimeTypeFull, ";")[0] 42 | } 43 | 44 | func (u *uri) Scheme() string { 45 | pos := strings.Index(u.raw, ":") 46 | if pos == -1 { 47 | return "" 48 | } 49 | 50 | return u.raw[:pos] 51 | } 52 | 53 | func (u *uri) String() string { 54 | return u.raw 55 | } 56 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/internal/cache/widget.go: -------------------------------------------------------------------------------- 1 | package cache 2 | 3 | import ( 4 | "sync" 5 | 6 | "fyne.io/fyne" 7 | ) 8 | 9 | var renderers sync.Map 10 | 11 | type isBaseWidget interface { 12 | ExtendBaseWidget(fyne.Widget) 13 | super() fyne.Widget 14 | } 15 | 16 | // Renderer looks up the render implementation for a widget 17 | func Renderer(wid fyne.Widget) fyne.WidgetRenderer { 18 | if wid == nil { 19 | return nil 20 | } 21 | 22 | if wd, ok := wid.(isBaseWidget); ok { 23 | if wd.super() != nil { 24 | wid = wd.super() 25 | } 26 | } 27 | renderer, ok := renderers.Load(wid) 28 | if !ok { 29 | renderer = wid.CreateRenderer() 30 | renderers.Store(wid, renderer) 31 | } 32 | 33 | if renderer == nil { 34 | return nil 35 | } 36 | return renderer.(fyne.WidgetRenderer) 37 | } 38 | 39 | // DestroyRenderer frees a render implementation for a widget. 40 | // This is typically for internal use only. 41 | func DestroyRenderer(wid fyne.Widget) { 42 | Renderer(wid).Destroy() 43 | 44 | renderers.Delete(wid) 45 | } 46 | 47 | // IsRendered returns true of the widget currently has a renderer. 48 | // One will be created the first time a widget is shown but may be removed after it is hidden. 49 | func IsRendered(wid fyne.Widget) bool { 50 | _, found := renderers.Load(wid) 51 | return found 52 | } 53 | -------------------------------------------------------------------------------- /vendor/fyne.io/fyne/internal/driver/glfw/file.go: -------------------------------------------------------------------------------- 1 | package glfw 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "path/filepath" 7 | 8 | "fyne.io/fyne" 9 | "fyne.io/fyne/storage" 10 | ) 11 | 12 | type file struct { 13 | *os.File 14 | path string 15 | } 16 | 17 | func (d *gLDriver) FileReaderForURI(uri fyne.URI) (fyne.URIReadCloser, error) { 18 | return openFile(uri, false) 19 | } 20 | 21 | func (f *file) Name() string { 22 | return filepath.Base(f.path) 23 | } 24 | 25 | func (f *file) URI() fyne.URI { 26 | return storage.NewURI("file://" + f.path) 27 | } 28 | 29 | type fileWriter struct { 30 | *os.File 31 | path string 32 | } 33 | 34 | func (d *gLDriver) FileWriterForURI(uri fyne.URI) (fyne.URIWriteCloser, error) { 35 | return openFile(uri, true) 36 | } 37 | 38 | func (f *fileWriter) Name() string { 39 | return filepath.Base(f.path) 40 | } 41 | 42 | func (f *fileWriter) URI() fyne.URI { 43 | return storage.NewURI("file://" + f.path) 44 | } 45 | 46 | func openFile(uri fyne.URI, create bool) (*file, error) { 47 | if uri.Scheme() != "file" { 48 | return nil, fmt.Errorf("invalid URI for file: %s", uri) 49 | } 50 | 51 | path := uri.String()[7:] 52 | f, err := os.Open(path) 53 | if err != nil && create { 54 | f, err = os.Create(path) 55 | } 56 | 57 | return &file{File: f, path: path}, err 58 | } 59 | --------------------------------------------------------------------------------