From c6744f173d98e227152db44252391b7b417bb091 Mon Sep 17 00:00:00 2001 From: Miguel Mota Date: Sun, 31 Jan 2021 20:16:26 -0800 Subject: [PATCH] Undo notification sound --- cointop/config.go | 2 +- cointop/price_alerts.go | 2 +- go.mod | 1 - go.sum | 27 - pkg/notifier/mp3.go | 4 - pkg/notifier/notiifer.go | 58 - vendor/github.com/faiface/beep/LICENSE | 21 - vendor/github.com/faiface/beep/README.md | 44 - vendor/github.com/faiface/beep/buffer.go | 262 -- vendor/github.com/faiface/beep/compositors.go | 173 - vendor/github.com/faiface/beep/ctrl.go | 52 - vendor/github.com/faiface/beep/go.mod | 11 - vendor/github.com/faiface/beep/go.sum | 39 - vendor/github.com/faiface/beep/interface.go | 106 - vendor/github.com/faiface/beep/mixer.go | 70 - vendor/github.com/faiface/beep/mp3/decode.go | 104 - vendor/github.com/faiface/beep/resample.go | 174 - .../faiface/beep/speaker/speaker.go | 130 - vendor/github.com/faiface/beep/streamers.go | 65 - .../github.com/hajimehoshi/go-mp3/.gitignore | 2 - vendor/github.com/hajimehoshi/go-mp3/AUTHORS | 2 - vendor/github.com/hajimehoshi/go-mp3/LICENSE | 201 - .../github.com/hajimehoshi/go-mp3/README.md | 7 - .../github.com/hajimehoshi/go-mp3/decode.go | 217 - vendor/github.com/hajimehoshi/go-mp3/go.mod | 3 - vendor/github.com/hajimehoshi/go-mp3/go.sum | 6 - .../hajimehoshi/go-mp3/internal/bits/bits.go | 78 - .../go-mp3/internal/consts/consts.go | 102 - .../go-mp3/internal/frame/frame.go | 676 --- .../internal/frameheader/frameheader.go | 206 - .../go-mp3/internal/huffman/huffman.go | 419 -- .../go-mp3/internal/imdct/imdct.go | 107 - .../go-mp3/internal/maindata/huffman.go | 129 - .../go-mp3/internal/maindata/maindata.go | 194 - .../go-mp3/internal/sideinfo/sideinfo.go | 142 - .../github.com/hajimehoshi/go-mp3/source.go | 124 - vendor/github.com/hajimehoshi/oto/.gitignore | 2 - vendor/github.com/hajimehoshi/oto/AUTHORS | 5 - vendor/github.com/hajimehoshi/oto/LICENSE | 201 - vendor/github.com/hajimehoshi/oto/README.md | 35 - vendor/github.com/hajimehoshi/oto/context.go | 164 - .../hajimehoshi/oto/driver_android.go | 291 -- .../github.com/hajimehoshi/oto/driver_js.go | 154 - .../hajimehoshi/oto/driver_linux.go | 166 - .../hajimehoshi/oto/driver_openal.go | 258 -- .../hajimehoshi/oto/driver_windows.go | 134 - vendor/github.com/hajimehoshi/oto/go.mod | 9 - vendor/github.com/hajimehoshi/oto/go.sum | 14 - .../hajimehoshi/oto/internal/mux/mux.go | 167 - vendor/github.com/hajimehoshi/oto/player.go | 100 - .../hajimehoshi/oto/winmm_windows.go | 196 - vendor/github.com/pkg/errors/.gitignore | 24 - vendor/github.com/pkg/errors/.travis.yml | 15 - vendor/github.com/pkg/errors/LICENSE | 23 - vendor/github.com/pkg/errors/README.md | 52 - vendor/github.com/pkg/errors/appveyor.yml | 32 - vendor/github.com/pkg/errors/errors.go | 282 -- vendor/github.com/pkg/errors/stack.go | 147 - vendor/golang.org/x/exp/AUTHORS | 3 - vendor/golang.org/x/exp/CONTRIBUTORS | 3 - vendor/golang.org/x/exp/LICENSE | 27 - vendor/golang.org/x/exp/PATENTS | 22 - .../x/exp/shiny/driver/gldriver/buffer.go | 32 - .../x/exp/shiny/driver/gldriver/cocoa.go | 671 --- .../x/exp/shiny/driver/gldriver/cocoa.m | 327 -- .../x/exp/shiny/driver/gldriver/context.go | 35 - .../x/exp/shiny/driver/gldriver/egl.go | 106 - .../x/exp/shiny/driver/gldriver/gldriver.go | 133 - .../x/exp/shiny/driver/gldriver/other.go | 28 - .../x/exp/shiny/driver/gldriver/screen.go | 149 - .../x/exp/shiny/driver/gldriver/texture.go | 160 - .../x/exp/shiny/driver/gldriver/win32.go | 357 -- .../x/exp/shiny/driver/gldriver/window.go | 389 -- .../x/exp/shiny/driver/gldriver/x11.c | 327 -- .../x/exp/shiny/driver/gldriver/x11.go | 318 -- .../shiny/driver/internal/drawer/drawer.go | 34 - .../driver/internal/errscreen/errscreen.go | 25 - .../exp/shiny/driver/internal/event/event.go | 68 - .../driver/internal/lifecycler/lifecycler.go | 80 - .../x/exp/shiny/driver/internal/win32/key.go | 350 -- .../shiny/driver/internal/win32/syscall.go | 7 - .../driver/internal/win32/syscall_windows.go | 185 - .../exp/shiny/driver/internal/win32/win32.go | 491 --- .../driver/internal/win32/zsyscall_windows.go | 286 -- .../shiny/driver/internal/x11key/x11key.go | 224 - .../golang.org/x/exp/shiny/screen/screen.go | 354 -- vendor/golang.org/x/image/AUTHORS | 3 - vendor/golang.org/x/image/CONTRIBUTORS | 3 - vendor/golang.org/x/image/LICENSE | 27 - vendor/golang.org/x/image/PATENTS | 22 - vendor/golang.org/x/image/math/f64/f64.go | 37 - vendor/golang.org/x/mobile/AUTHORS | 3 - vendor/golang.org/x/mobile/CONTRIBUTORS | 3 - vendor/golang.org/x/mobile/LICENSE | 27 - vendor/golang.org/x/mobile/PATENTS | 22 - .../x/mobile/app/GoNativeActivity.java | 67 - vendor/golang.org/x/mobile/app/android.c | 191 - vendor/golang.org/x/mobile/app/android.go | 819 ---- vendor/golang.org/x/mobile/app/app.go | 208 - .../golang.org/x/mobile/app/darwin_desktop.go | 496 --- .../golang.org/x/mobile/app/darwin_desktop.m | 245 -- vendor/golang.org/x/mobile/app/darwin_ios.go | 216 - vendor/golang.org/x/mobile/app/darwin_ios.m | 165 - vendor/golang.org/x/mobile/app/doc.go | 85 - .../x/mobile/app/internal/callfn/callfn.go | 17 - .../x/mobile/app/internal/callfn/callfn_386.s | 11 - .../mobile/app/internal/callfn/callfn_amd64.s | 11 - .../x/mobile/app/internal/callfn/callfn_arm.s | 11 - .../mobile/app/internal/callfn/callfn_arm64.s | 11 - vendor/golang.org/x/mobile/app/shiny.go | 70 - vendor/golang.org/x/mobile/app/x11.c | 173 - vendor/golang.org/x/mobile/app/x11.go | 122 - .../x/mobile/event/key/code_string.go | 60 - vendor/golang.org/x/mobile/event/key/key.go | 270 -- .../x/mobile/event/lifecycle/lifecycle.go | 135 - .../golang.org/x/mobile/event/mouse/mouse.go | 90 - .../golang.org/x/mobile/event/paint/paint.go | 24 - vendor/golang.org/x/mobile/event/size/size.go | 92 - .../golang.org/x/mobile/event/touch/touch.go | 72 - vendor/golang.org/x/mobile/geom/geom.go | 102 - vendor/golang.org/x/mobile/gl/consts.go | 657 --- vendor/golang.org/x/mobile/gl/dll_windows.go | 243 -- vendor/golang.org/x/mobile/gl/doc.go | 66 - vendor/golang.org/x/mobile/gl/fn.go | 210 - vendor/golang.org/x/mobile/gl/gl.go | 1844 --------- vendor/golang.org/x/mobile/gl/gldebug.go | 3673 ----------------- vendor/golang.org/x/mobile/gl/interface.go | 889 ---- vendor/golang.org/x/mobile/gl/types_debug.go | 82 - vendor/golang.org/x/mobile/gl/types_prod.go | 93 - vendor/golang.org/x/mobile/gl/work.c | 556 --- vendor/golang.org/x/mobile/gl/work.go | 176 - vendor/golang.org/x/mobile/gl/work.h | 217 - vendor/golang.org/x/mobile/gl/work_windows.go | 569 --- .../golang.org/x/mobile/gl/work_windows_386.s | 9 - .../x/mobile/gl/work_windows_amd64.s | 12 - .../mobile/internal/mobileinit/ctx_android.go | 124 - .../mobile/internal/mobileinit/mobileinit.go | 11 - .../internal/mobileinit/mobileinit_android.go | 93 - .../internal/mobileinit/mobileinit_ios.go | 38 - vendor/modules.txt | 42 - 140 files changed, 2 insertions(+), 25134 deletions(-) delete mode 100644 pkg/notifier/mp3.go delete mode 100644 vendor/github.com/faiface/beep/LICENSE delete mode 100644 vendor/github.com/faiface/beep/README.md delete mode 100644 vendor/github.com/faiface/beep/buffer.go delete mode 100644 vendor/github.com/faiface/beep/compositors.go delete mode 100644 vendor/github.com/faiface/beep/ctrl.go delete mode 100644 vendor/github.com/faiface/beep/go.mod delete mode 100644 vendor/github.com/faiface/beep/go.sum delete mode 100644 vendor/github.com/faiface/beep/interface.go delete mode 100644 vendor/github.com/faiface/beep/mixer.go delete mode 100644 vendor/github.com/faiface/beep/mp3/decode.go delete mode 100644 vendor/github.com/faiface/beep/resample.go delete mode 100644 vendor/github.com/faiface/beep/speaker/speaker.go delete mode 100644 vendor/github.com/faiface/beep/streamers.go delete mode 100644 vendor/github.com/hajimehoshi/go-mp3/.gitignore delete mode 100644 vendor/github.com/hajimehoshi/go-mp3/AUTHORS delete mode 100644 vendor/github.com/hajimehoshi/go-mp3/LICENSE delete mode 100644 vendor/github.com/hajimehoshi/go-mp3/README.md delete mode 100644 vendor/github.com/hajimehoshi/go-mp3/decode.go delete mode 100644 vendor/github.com/hajimehoshi/go-mp3/go.mod delete mode 100644 vendor/github.com/hajimehoshi/go-mp3/go.sum delete mode 100644 vendor/github.com/hajimehoshi/go-mp3/internal/bits/bits.go delete mode 100644 vendor/github.com/hajimehoshi/go-mp3/internal/consts/consts.go delete mode 100644 vendor/github.com/hajimehoshi/go-mp3/internal/frame/frame.go delete mode 100644 vendor/github.com/hajimehoshi/go-mp3/internal/frameheader/frameheader.go delete mode 100644 vendor/github.com/hajimehoshi/go-mp3/internal/huffman/huffman.go delete mode 100644 vendor/github.com/hajimehoshi/go-mp3/internal/imdct/imdct.go delete mode 100644 vendor/github.com/hajimehoshi/go-mp3/internal/maindata/huffman.go delete mode 100644 vendor/github.com/hajimehoshi/go-mp3/internal/maindata/maindata.go delete mode 100644 vendor/github.com/hajimehoshi/go-mp3/internal/sideinfo/sideinfo.go delete mode 100644 vendor/github.com/hajimehoshi/go-mp3/source.go delete mode 100644 vendor/github.com/hajimehoshi/oto/.gitignore delete mode 100644 vendor/github.com/hajimehoshi/oto/AUTHORS delete mode 100644 vendor/github.com/hajimehoshi/oto/LICENSE delete mode 100644 vendor/github.com/hajimehoshi/oto/README.md delete mode 100644 vendor/github.com/hajimehoshi/oto/context.go delete mode 100644 vendor/github.com/hajimehoshi/oto/driver_android.go delete mode 100644 vendor/github.com/hajimehoshi/oto/driver_js.go delete mode 100644 vendor/github.com/hajimehoshi/oto/driver_linux.go delete mode 100644 vendor/github.com/hajimehoshi/oto/driver_openal.go delete mode 100644 vendor/github.com/hajimehoshi/oto/driver_windows.go delete mode 100644 vendor/github.com/hajimehoshi/oto/go.mod delete mode 100644 vendor/github.com/hajimehoshi/oto/go.sum delete mode 100644 vendor/github.com/hajimehoshi/oto/internal/mux/mux.go delete mode 100644 vendor/github.com/hajimehoshi/oto/player.go delete mode 100644 vendor/github.com/hajimehoshi/oto/winmm_windows.go delete mode 100644 vendor/github.com/pkg/errors/.gitignore delete mode 100644 vendor/github.com/pkg/errors/.travis.yml delete mode 100644 vendor/github.com/pkg/errors/LICENSE delete mode 100644 vendor/github.com/pkg/errors/README.md delete mode 100644 vendor/github.com/pkg/errors/appveyor.yml delete mode 100644 vendor/github.com/pkg/errors/errors.go delete mode 100644 vendor/github.com/pkg/errors/stack.go delete mode 100644 vendor/golang.org/x/exp/AUTHORS delete mode 100644 vendor/golang.org/x/exp/CONTRIBUTORS delete mode 100644 vendor/golang.org/x/exp/LICENSE delete mode 100644 vendor/golang.org/x/exp/PATENTS delete mode 100644 vendor/golang.org/x/exp/shiny/driver/gldriver/buffer.go delete mode 100644 vendor/golang.org/x/exp/shiny/driver/gldriver/cocoa.go delete mode 100644 vendor/golang.org/x/exp/shiny/driver/gldriver/cocoa.m delete mode 100644 vendor/golang.org/x/exp/shiny/driver/gldriver/context.go delete mode 100644 vendor/golang.org/x/exp/shiny/driver/gldriver/egl.go delete mode 100644 vendor/golang.org/x/exp/shiny/driver/gldriver/gldriver.go delete mode 100644 vendor/golang.org/x/exp/shiny/driver/gldriver/other.go delete mode 100644 vendor/golang.org/x/exp/shiny/driver/gldriver/screen.go delete mode 100644 vendor/golang.org/x/exp/shiny/driver/gldriver/texture.go delete mode 100644 vendor/golang.org/x/exp/shiny/driver/gldriver/win32.go delete mode 100644 vendor/golang.org/x/exp/shiny/driver/gldriver/window.go delete mode 100644 vendor/golang.org/x/exp/shiny/driver/gldriver/x11.c delete mode 100644 vendor/golang.org/x/exp/shiny/driver/gldriver/x11.go delete mode 100644 vendor/golang.org/x/exp/shiny/driver/internal/drawer/drawer.go delete mode 100644 vendor/golang.org/x/exp/shiny/driver/internal/errscreen/errscreen.go delete mode 100644 vendor/golang.org/x/exp/shiny/driver/internal/event/event.go delete mode 100644 vendor/golang.org/x/exp/shiny/driver/internal/lifecycler/lifecycler.go delete mode 100644 vendor/golang.org/x/exp/shiny/driver/internal/win32/key.go delete mode 100644 vendor/golang.org/x/exp/shiny/driver/internal/win32/syscall.go delete mode 100644 vendor/golang.org/x/exp/shiny/driver/internal/win32/syscall_windows.go delete mode 100644 vendor/golang.org/x/exp/shiny/driver/internal/win32/win32.go delete mode 100644 vendor/golang.org/x/exp/shiny/driver/internal/win32/zsyscall_windows.go delete mode 100644 vendor/golang.org/x/exp/shiny/driver/internal/x11key/x11key.go delete mode 100644 vendor/golang.org/x/exp/shiny/screen/screen.go delete mode 100644 vendor/golang.org/x/image/AUTHORS delete mode 100644 vendor/golang.org/x/image/CONTRIBUTORS delete mode 100644 vendor/golang.org/x/image/LICENSE delete mode 100644 vendor/golang.org/x/image/PATENTS delete mode 100644 vendor/golang.org/x/image/math/f64/f64.go delete mode 100644 vendor/golang.org/x/mobile/AUTHORS delete mode 100644 vendor/golang.org/x/mobile/CONTRIBUTORS delete mode 100644 vendor/golang.org/x/mobile/LICENSE delete mode 100644 vendor/golang.org/x/mobile/PATENTS delete mode 100644 vendor/golang.org/x/mobile/app/GoNativeActivity.java delete mode 100644 vendor/golang.org/x/mobile/app/android.c delete mode 100644 vendor/golang.org/x/mobile/app/android.go delete mode 100644 vendor/golang.org/x/mobile/app/app.go delete mode 100644 vendor/golang.org/x/mobile/app/darwin_desktop.go delete mode 100644 vendor/golang.org/x/mobile/app/darwin_desktop.m delete mode 100644 vendor/golang.org/x/mobile/app/darwin_ios.go delete mode 100644 vendor/golang.org/x/mobile/app/darwin_ios.m delete mode 100644 vendor/golang.org/x/mobile/app/doc.go delete mode 100644 vendor/golang.org/x/mobile/app/internal/callfn/callfn.go delete mode 100644 vendor/golang.org/x/mobile/app/internal/callfn/callfn_386.s delete mode 100644 vendor/golang.org/x/mobile/app/internal/callfn/callfn_amd64.s delete mode 100644 vendor/golang.org/x/mobile/app/internal/callfn/callfn_arm.s delete mode 100644 vendor/golang.org/x/mobile/app/internal/callfn/callfn_arm64.s delete mode 100644 vendor/golang.org/x/mobile/app/shiny.go delete mode 100644 vendor/golang.org/x/mobile/app/x11.c delete mode 100644 vendor/golang.org/x/mobile/app/x11.go delete mode 100644 vendor/golang.org/x/mobile/event/key/code_string.go delete mode 100644 vendor/golang.org/x/mobile/event/key/key.go delete mode 100644 vendor/golang.org/x/mobile/event/lifecycle/lifecycle.go delete mode 100644 vendor/golang.org/x/mobile/event/mouse/mouse.go delete mode 100644 vendor/golang.org/x/mobile/event/paint/paint.go delete mode 100644 vendor/golang.org/x/mobile/event/size/size.go delete mode 100644 vendor/golang.org/x/mobile/event/touch/touch.go delete mode 100644 vendor/golang.org/x/mobile/geom/geom.go delete mode 100644 vendor/golang.org/x/mobile/gl/consts.go delete mode 100644 vendor/golang.org/x/mobile/gl/dll_windows.go delete mode 100644 vendor/golang.org/x/mobile/gl/doc.go delete mode 100644 vendor/golang.org/x/mobile/gl/fn.go delete mode 100644 vendor/golang.org/x/mobile/gl/gl.go delete mode 100644 vendor/golang.org/x/mobile/gl/gldebug.go delete mode 100644 vendor/golang.org/x/mobile/gl/interface.go delete mode 100644 vendor/golang.org/x/mobile/gl/types_debug.go delete mode 100644 vendor/golang.org/x/mobile/gl/types_prod.go delete mode 100644 vendor/golang.org/x/mobile/gl/work.c delete mode 100644 vendor/golang.org/x/mobile/gl/work.go delete mode 100644 vendor/golang.org/x/mobile/gl/work.h delete mode 100644 vendor/golang.org/x/mobile/gl/work_windows.go delete mode 100644 vendor/golang.org/x/mobile/gl/work_windows_386.s delete mode 100644 vendor/golang.org/x/mobile/gl/work_windows_amd64.s delete mode 100644 vendor/golang.org/x/mobile/internal/mobileinit/ctx_android.go delete mode 100644 vendor/golang.org/x/mobile/internal/mobileinit/mobileinit.go delete mode 100644 vendor/golang.org/x/mobile/internal/mobileinit/mobileinit_android.go delete mode 100644 vendor/golang.org/x/mobile/internal/mobileinit/mobileinit_ios.go diff --git a/cointop/config.go b/cointop/config.go index 9825a26..501931b 100644 --- a/cointop/config.go +++ b/cointop/config.go @@ -276,7 +276,7 @@ func (ct *Cointop) configToToml() ([]byte, error) { } priceAlertsMapIfc := map[string]interface{}{ "alerts": priceAlertsIfc, - "sound": ct.State.priceAlerts.SoundEnabled, + //"sound": ct.State.priceAlerts.SoundEnabled, } var coinsTableColumnsIfc interface{} = ct.State.coinsTableColumns diff --git a/cointop/price_alerts.go b/cointop/price_alerts.go index b233101..54f6525 100644 --- a/cointop/price_alerts.go +++ b/cointop/price_alerts.go @@ -182,7 +182,7 @@ func (ct *Cointop) CheckPriceAlert(alert *PriceAlert) error { if msg != "" { if ct.State.priceAlerts.SoundEnabled { - notifier.NotifyWithSound(title, msg) + notifier.Notify(title, msg) } else { notifier.Notify(title, msg) } diff --git a/go.mod b/go.mod index be80829..10e616c 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,6 @@ require ( github.com/anaskhan96/soup v1.1.1 // indirect github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect github.com/creack/pty v1.1.11 - github.com/faiface/beep v1.0.2 github.com/fatih/color v1.9.0 github.com/gen2brain/beeep v0.0.0-20200526185328-e9c15c258e28 github.com/gliderlabs/ssh v0.3.0 diff --git a/go.sum b/go.sum index 45b2ceb..f55aa25 100644 --- a/go.sum +++ b/go.sum @@ -26,14 +26,10 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/faiface/beep v1.0.2 h1:UB5DiRNmA4erfUYnHbgU4UB6DlBOrsdEFRtcc8sCkdQ= -github.com/faiface/beep v1.0.2/go.mod h1:1yLb5yRdHMsovYYWVqYLioXkVuziCSITW1oarTeduQM= github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= -github.com/gdamore/tcell v1.1.1/go.mod h1:K1udHkiR3cOtlpKG5tZPD5XxrF7v2y7lDq7Whcj+xkQ= github.com/gen2brain/beeep v0.0.0-20200526185328-e9c15c258e28 h1:M2Zt3G2w6Q57GZndOYk42p7RvMeO8izO8yKTfIxGqxA= github.com/gen2brain/beeep v0.0.0-20200526185328-e9c15c258e28/go.mod h1:ElSskYZe3oM8kThaHGJ+kiN2yyUMVXMZ7WxF9QqLDS8= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -58,27 +54,17 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/gopherjs/gopherjs v0.0.0-20180628210949-0892b62f0d9f/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20180825215210-0210a2f0f73c h1:16eHWuMGvCjSfgRJKqIzapE78onvvTbdi1rMkU00lZw= github.com/gopherjs/gopherjs v0.0.0-20180825215210-0210a2f0f73c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gopherjs/gopherwasm v0.1.1/go.mod h1:kx4n9a+MzHH0BJJhvlsQ65hqLFXDO/m256AsaDPQ+/4= -github.com/gopherjs/gopherwasm v1.0.0/go.mod h1:SkZ8z7CWBz5VXbhJel8TxCmAcsQqzgWGR/8nMhyhZSI= github.com/gopherjs/gopherwasm v1.1.0 h1:fA2uLoctU5+T3OhOn2vYP0DVT6pxc7xhTlBB1paATqQ= github.com/gopherjs/gopherwasm v1.1.0/go.mod h1:SkZ8z7CWBz5VXbhJel8TxCmAcsQqzgWGR/8nMhyhZSI= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/hajimehoshi/go-mp3 v0.1.1 h1:Y33fAdTma70fkrxnc9u50Uq0lV6eZ+bkAlssdMmCwUc= -github.com/hajimehoshi/go-mp3 v0.1.1/go.mod h1:4i+c5pDNKDrxl1iu9iG90/+fhP37lio6gNhjCx9WBJw= -github.com/hajimehoshi/oto v0.1.1/go.mod h1:hUiLWeBQnbDu4pZsAhOnGqMI1ZGibS6e2qhQdfpwz04= -github.com/hajimehoshi/oto v0.3.1 h1:cpf/uIv4Q0oc5uf9loQn7PIehv+mZerh+0KKma6gzMk= -github.com/hajimehoshi/oto v0.3.1/go.mod h1:e9eTLBB9iZto045HLbzfHJIc+jP3xaKrjZTghvb6fdM= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jfreymuth/oggvorbis v1.0.0/go.mod h1:abe6F9QRjuU9l+2jek3gj46lu40N4qlYxh2grqkLEDM= -github.com/jfreymuth/vorbis v1.0.0/go.mod h1:8zy3lUAm9K/rJJk223RKy6vjCZTWC61NA2QD06bfOE0= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= @@ -89,7 +75,6 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/lucasb-eyer/go-colorful v0.0.0-20181028223441-12d3b2882a08/go.mod h1:NXg0ArsFk0Y01623LgUqoqcouGDB+PwCCQlrwrG6xJ4= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/maruel/panicparse v1.5.0 h1:etK4QAf/Spw8eyowKbOHRkOfhblp/kahGUy96RvbMjI= github.com/maruel/panicparse v1.5.0/go.mod h1:aOutY/MUjdj80R0AEVI9qE2zHqig+67t2ffUDDiLzAM= @@ -102,13 +87,11 @@ github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54= github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mewkiz/flac v1.0.5/go.mod h1:EHZNU32dMF6alpurYyKHDLYpW1lYpBZ5WrXi/VuNIGs= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/miguelmota/go-coinmarketcap v0.1.6 h1:YIe+VdFhEgyGESfmkL7BHRDIdf6CUOAjJisml01AFqs= github.com/miguelmota/go-coinmarketcap v0.1.6/go.mod h1:Jdv/kqtKclIElmoNAZMMJn0DSQv+j7p/H1te/GGnxhA= @@ -130,8 +113,6 @@ github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaR github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -178,14 +159,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de h1:ikNHVSjEfnvz6sxdSPCaPt572qowuyMDMJLLm3Db3ig= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20180710024300-14dda7b62fcd h1:nLIcFw7GiqKXUS7HiChg6OAYWgASB2H97dZKd1GhDSs= -golang.org/x/exp v0.0.0-20180710024300-14dda7b62fcd/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81 h1:00VmoueYNlNz/aHIilyyQz/MHSqGoWJzpFv/HW8xpzI= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mobile v0.0.0-20180806140643-507816974b79 h1:t2JRgCWkY7Qaa1J2jal+wqC9OjbyHCHwIA9rVlRUSMo= -golang.org/x/mobile v0.0.0-20180806140643-507816974b79/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/net v0.0.0-20180215212450-dc948dff8834/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -203,7 +178,6 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181228144115-9a3f9b0469bb/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -228,7 +202,6 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.0/go.mod h1:OdE7CF6DbADk7lN8LIKRzRJTTZXIjtWgA5THM5lhBAw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/pkg/notifier/mp3.go b/pkg/notifier/mp3.go deleted file mode 100644 index 1bb1306..0000000 --- a/pkg/notifier/mp3.go +++ /dev/null @@ -1,4 +0,0 @@ -package notifier -func Mp3() string { -return `fffb90c40000000000000000000000000000000000496e666f0000000f000000840000d923000305070b0d0f1315171b1d1f2224262a2c2e3234363a3c3e414345474b4d4f5355575b5d5f6264666a6c6e7274767a7c7e818385878b8d8f9395979b9d9fa2a4a6aaacaeb2b4b6babcbec1c3c5c7cbcdcfd3d5d7dbdddfe2e4e6eaeceef2f4f6fafcfe000000394c414d45332e31303001cd000000002e13000014802406a8420000800000d923ac07a296000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffb90c4000053f9ecef031879caeb419f428c90000210420041d3b68733231edb0f27a9b3eb934d90d332d907be78393d83f4838461e9b4639e1127a6d1e3240617587a7db79f40883eba0e9b102081e9b934ecf269ffae4f5d882989d1021366001400c3c99441564c00a269ef7dce4c2d362100881887876204321076211eec867e7ebeb774db18102248493a8cb640c2087f10e4d0b600207eb427eb9b9ee849c4dcdc208c211a201c4e5033a002111bcb40cd00dbc5110b02228423745a05431ace9d84d12eb7c61a8175b9e626691c5e8e28dccd6ce3dd67ad66e6a54487114a6e18cdb9b916b2ca91d66525850ab3243f544e9a5254ac1f8d9a33a285968aa936440c91a87882523c489ae862b4e49cb74c9b44b36289152cab68e329d45bd8966184ef5b32f141936bcc9d642b3fa47cab963296b770791a4a215dbdc21622488a9924956a893295f4bb9cba461488a1d680b2149ee511a931f23ab5e0b17cb5667a455640888e5d4f5041054010180406040309101010293cc140d00c381ab9581dd8867de307c1132d04e34f81a37995bb78183a2281853161d4c1b0fffb92c418801b018b2199da8002db21a54bbba000b505819982c062d2581f1176061217a92603198140c4e150bde06673b0194c5006343c26a306713313c8595819805c066d0e8183c3e06342c26b741601c0f291aa4620635120220608061ec03504b3ef1c62e33ec90eb0c0420f06f19121de412eaa171c62732e2cfaa06060900a108592490e21c1ffadd4ba996a26cd9632e52598b9bfffeafdcaa59193335199aa967cb9fffeff7b37d24d04de641abdfffffffe1642db959e0008f804c2d510c53f08f0c0bcc030e4880630f40b30743f000f061204a60d01e2802808091103660f8280c00d314c0339cd921033030620cfae33ac4047993b2c11832fb8c8a0e04062684a110d42c779d981eb51ca5cf7c850501c0acd7f695dddc72350f61dcabc66331a8f3bd0f0e866ff099c29bf29567dc32fc7559650583bf516addfffdeb1feef1e7fef2ffffd7759c0d73b87e597d6c71fdfffef9965dfffc6f3bd461083a2ea028043b42d727eb76d6268a901915d90c0d038c4c2c0e718247f3931541030500a30b41530481130101546240738aa020c044c080280000981e039fffb92c4178314e9152a6ec87c83a22be2c5fdadf883c7587098b71a46952b335359c5b2d2cbd32c56c6bf16953f520b54b4922a8f08e0440e076cd885b42bcd6a1982a5b289a78dfa791ff947d232f55d67fa8a91535482ea452019211e1062cd238e8bacd2b74533cca5a975dd02796dd57bd3e3550e30d58f0b31662e1230f3a6765c36cf4a6d84ef956f5a4103022c0f81e02fcc19f6524c5420d04c11b04b8c03102b4c0960208700403015c07122016c42005888009300640103000002d301800413012802e000016603305366763a61650303c61e6c6123c676003c12aed88a268d0cb583151a415505610ac4d919dbc6a1c2c02e1aa500dc1c795d335d5febdabcec51fe853182e233e401b7aff4ff20b11a7a9d4e4fe5ca78d3d4fcbfb721fb18e7349da0ea00070324a58a39390e4acf1f5169862f75f795181b44cdf33cbb9ae5e71d3f19b45cbbbba8b8fba6c5f34ce2e1b3130cbd8ce2ad479244eb615246ab53dc98abf41f193eab98a4d4ce84cca10420016051311707b3530e3538811ff30c202c1607f3007013302301f30060222200e40197795850c0c0240cfffb92c41603189143184f710fc325aee285ee21f814f0401b181c0a59cbc0e633081709a0b6412074b155a0380dd17e44011795f98bc4e81c15f8dd9b3c3cfc98246c25cf4835e6a2f24a96a7a214b4094b3576f50beb0c3fe000b930628eb638e3626a2db94fd8d7d2b183058441e0b89bae95e5ac78e7ee79b5b88c504dd344d6fdd4c7058b9c41db7d6bcd3cd731e8fc8e86f8c60ecc36126cb22ad4e764934a4be1ed8a5f6689b4e61d796040c1880b4c3c4368cb08b3cfb24034c46805cc0f40f4c1500389809cc03802042018bdda096c90c8ac024980181004a60580f27652e05c3e23093d2a52aed9e46e1eb9d64ca52a32bd20ebbb8ddc76a0a8cb3830397cde2262fdbfeba550476f4bead5bcdca7f2b525a48cdc0209848330f4b73bd670cafeff2b3cb7edcc0a1a0a112a7ed150f8ac1d8f91d2755ef8f0637ab316f8aa49dc87e63d9faaaff6eaa7b98d62eaf879e2beee2ad2eae13e576e6a068bda2d6214a176acf2108957a03ec73c58c3ed6de920040c1e021cc4c4890d343318fafc758c4881c4c2741c0c02c000c02c0694cd3a53961f60adc93213081a00fffb92c41583985d0f122f6d6fdb24aba205fe21f9c4006c60c9c628243810d6d2d12ce04811faab0b8d0c003defe37d6ef4fd6eba4fbaca25af111d36181d6aa104a33c2be766c6aae3f729648234046bb5cffef7f0ffd5dbf8f6c18c06807f4a2c5ea1e34b36b363779d5b75ee98bcac85be78be5f1dd325d2b24d7b78cf065007a8a440e43de3961b96b8da737699df39fe568bb607777afb7d923027fc5d947f0fc93bb537f76f2a432ea983029814b303743a230e31e5e3180c3d4302401153015c07e0b00c63a00d1803a00020b94000090cfcc3495f2750426004cd102b4e269a88cb115dc172b95d0341a446e8e486ec6e4319ad8e100b846083e9c081c5000678aa495b3972ed2e522c73977e724a7b018061e1959cbfbacb1d65db3f8eb72a0e1f02cb5298791031c6dceb3507415232a981d1c8ffa70a99e912c51b0cd37156b174b57131df0d3f330bc4d7d71690dda99999610ad15979e251fb5af97c9f59d5fb12e7857d4e87c8d27a41c55fbf07020281d2608e05bc6397b4d866fb06d460ab81ca602e0088601d804e600400389b6600880120a00212ee0b6628fffb92c4160119897b100ff0cfcaf2246259fd21f9c51167a55010cc3a0310075e7779ce95412f34ec71ec91c1af93d50743520965b9cc2cb5f305080e10112f42f05864ab83f9857f8bc5ef5fa7b537949454629254bacf0cb2ab773b9da4c35a7c448116aa3e69cec63a8ff945b6b57adce68ffab5fee65d552acedd8df9bfffbb3d3d79ffe353421f3ef68dcdc777cb6fdebee7669a9399be23f1e55bab53d2e72c9772dbe53d6db5a17810403e2b8ddbdbe50501082403020c02230570000318d40c5268a30c1910038040aa93018e60130000090024200036a8f1d3412b00f0560b00125da0b16ce215e10ecb938c521fa48fc02fccb2532fe5da4dc918188ba1cc46d218a0b025118c4b65304d998cebdffe7dc89880ca2c6f5cbdbc30ef79cfb3499dc616a3056eceea44214dcca20af39126d14904bb54239fefaf5f68effe15d51ba3279bce115675c9bc70b8ffe2eaca441aea38677f7b5d87fdcf7151be351ea9cdaf65ccd58304852ea37aaa3030c0c630518197313f576b3457831b305e40de30248039300e401a300200133007400048861ca2aeb4065ed7597a8efffb92c4180018dd9f0e0fec6fcb62a7e8f5dd0a7e80282c688a77a290147e0c6f60783650ecbdb19a92f8a4ccb756a3348dc4131073e42bfa5abad3ca76e6757bde4ab2bfba1c6b0200068465d4bcdfe35b2e7dcfe6feba95280d3d520b72061508e8a212496bc83ce209d6115e68c2cdb0f45aa9be33665b96f0eebb9a11542aa14c399f739446879c235718ce11a05c41d335d26b0176f980e925d7c4c8833a247165cc2b59822e4ad2ae007becfda0c9624299998c13a61802c2c0e29b8500430001632d0593211333e26093639d4310cab3150ba30a4cd31b44030c8190e0d90a1e91083261e86e652a6464825e6ae87265e164658505170d502d30b1d39afcaa90d01032858ca020a26964ae5f31394ee7525aa4c33943d6a0f2ebb4482ed821d912ec7d5e74ecc339b77e0774dda41c805622f930e34583c39729587c4587c0f0c380e44cbff2f95c823ee7810310ab3a73499f2b95c4cdd764330b963ff413b1e71e6a0d77e21454fae53cb274bf06063885367229ff745398431fac003610d88a000040188001812015004301409531d253f344d51f307601a300b01503fffb92c40e8018dd4125af6c51c2b620a409edc1b803c1810801981001d182f01589021008114c01c005668040000c01242096601c0220200c4891100198b101d1e0249d5c708a9cea2fcc616ccd424481109ec051e53081434bc16d0d1485c10c1c29249e74e644f26168acb64ce5402d60a80662c28ecccbed13756a65bb5946a7aa61ba182df5a677ac5308009bea5d534f5fce330cbfb4bbb356c5365118e3fe66c24a154aaacfd7edf6de9735c0132eca969baa292867b9ec2c8f7310000d4604808260561ac61ec40e7acaaac610a07a600400e603a024300bc5bb1603110817a7b17896342d681811785058b00a62c62620607dbb6200c6f90c4bec220d28276b92c7e5f978c58064d0f0f033fcc965d02c44702d2f2fcd43194b626300068832f24f6772456a829a9b4e1cba66dbaa32a89839f73c17f8784ab44d6a736a0a4eec8a2600311516d4d067536dfd97ad6ce8de6c6416419b093942a3daca8eb1ec259752dcebdf451d15020c1c8194c30c438c97a798e9f0320c7a0094c2b41d0c1e0094c0a402cc0a8024a8054101043401cd611b54761d10869880c00874fffb92c41a831741031a2f6e6dc2cda72305ed45b81418022339af60e5a2d4a5c8f033b2f2b29705e591bed47158e0f00d151d4e4590e23cb0d7620bca9a5d190b831c086aa296fc467f99637b4c2658ddafc344193968f9f2884e232264929231a2b264d547d9b5394c021662a77f5742ea65ad9bb2eb5294c6248746b4bb9e260983c2ad716eb2dbdd0bb1f2eec5bb7ddeda228db1ef63fd8d1387003cc08c410c36fb70eba54c4c51c0ecc110038c0dc05cc05807c0a00eb3d0105c686e24adae6b2830e511601a303801f7120eb02c69b5409c4dce9e9648e552fa48ac694dacc5b39350a20075d8e4edc9557820b05c191a0da96a1b732a6ef6be40e6c35cb679cc4f1d770da44d514a9a17ba9564d54a7025892641dd1a4921b3a914e920a5a6ad74990322614eda2d7b5b529299592a4c66b28f3cc0d892ab479d38c82cf0a4ca9437ccf5d56fd9dba52a00149c9060052ef198b171f0d1e18982318ac12252b40425b442d62a46426018160a03dafb1368c8f68a6d6c4002d44844241721bd478534548ba28a1b7fe8df444f45371e9e9e1b86a4affb385d8ce1f8c66058fffb92c42a0314653f2e6ebcda4390282489ede898097e2a35b1c6b7e44310c1b8260ccc948113bc79de3c2a20529aa3c01838593260301934e1ef609a118f7af77777fc4102104023608108c6f711f1efbba119fb7fbff8c8686befed3100d1ebfca3b50004c1805800182d07898b888719c02f29b58a10824174d8854129a6923a1615165b002083878f7188dd480d69635aa8e3be358b4c6230c3a660c83879877e063672869aefa69c81a13c67480f07060c5ee63461991461d219c262208c09305a58d0d5dcbbd0030d3720b0305012ecb882d0d25c990092831a28c28246a30610b5c98c5a6342bd1d96164336d670ce1d7f6d5f97c66cdec682d635f2dd996cabb2ab306c6a352a94f6fcec46313f8f33fad5af5ebf72d52d98f295afe7da7b3d63de5daf4b6696cd2e729a5cb2efe5bd65731feff3fbbfd7ef1c5a45a115add1dffffff65500261302704230360d33101665337f22a362d628306d063303708230690423049036260490c0275e6020830f2b33f083071050757ab46056251e8fa9131c0d0a8e1d580aa14034be2afab3a90475605059fb7fafbeb09cc880fffb92c42c8315613f224f6e8bc23527e4cded4cb8a939490f5a892fb24029d7da081c44c14ca8a385b0350282ca49e456cb5b22a618d75556372f974a283a4b30322285773218e40d114daad7d2daa711139b21adab32a955af7bcfb21fff93eefb7fecfeafe800026b2cc01c060541d4c0813ecd5011ace8d8048c47004ce19e225a443d05d9c402fa191204c89e575acbbb2fb8c8fae2c3c99272452916b96bcb0553636366a478c543e4648853ac6ab3321803191cc272e5b260963a5f20007330e724b4eaa75a87212aeaa0cfd7b949599aa9d6d32558c1369f4903c745ca2da92dfb75d4f7a92d97affff35fc6747d7f6a55034c02803c3808cc559544eafd160cc75964c164320700952a919d22cbf288d111202460922aee0c21dd7edc141e46004a30247380497aab88d52cfccce50fca7b671a6a65155c11cafaa9f4ef5062350250669b2d8e3843a059c3ccf09846aaf61177875cf661e05c2d344c5c74d34a679a73e3ecec43647565a4c6cfa540cd9d4fb5d92d73117d537a7ff1b7eb5d3428bdaffb8da0c1980ecc2fc240cbb8c40d630c48ffd5460c9f4284f214fffb92c4568392a541202f68edd26a27e345edd0b80dd4d4cc860c3880c141de867a0e0f5daeecfe4d761a8d0e012f6430010511009c90ab3650f77603269050bf26c87b245026944685060a45a816cd448c05c60d61718f2b383582ea8f9a0af0025016948c4daeecaa229eb53a69aa95dd25d6b317cd996dd2e935990652e5237b76aecfffb29bb297f75726687ffedfffafd372ffe94a10ad2301300814007308c70636057933a9854c314e091305d0141e0005382b00a0801f2dc30d1e0036e15dc6811c474e48a011b68ed59258e65a8fdd3c4a1d9f9cbf4d391798b78e4dd17ec4ac7e5dce905abf0f773f9dde1dccdad72b1cbf3cf0c759e515a3fdd4ced0a28e20380057211de7015769ce8866964766e71fbfe4ffe76f56ffc17fcadde9eda9a2b600ad4498307261c861800a9718ab41b1adf3159813837193399c6981b7058113c1a3c60a54257821187e1025104c233701124805111830316a47879375e701132fc54e9be8060b2a98f241dbfd98e68183469b613930f23dbb8050104092662641503e05b10fe3519826bc79fd600c452a88801a1bb9669c583632eefffb92c4850311ad41204f604fc38628244dcf6c084ddfa49b972e856f66af7b588b40952077e5a51a3611e018038fd5ea7234f6b2b008f6adf1153a5816b5393d0964eb5d824fd9fa7de5288d59a7771df67117775cf81a975befe1dc399eb9adeb1effef2bb6353735aee3ddfe58ebff1ffbba9decabfe5bd30028606005980782818559b71aed2009d6b8d0988c2ea99068359684d0bc70d1c24433034146e2e5d02c132734ab31055354a057ece5f887c5996250530e8d1788e017f61c609d85a86f8aa4c8690514e22441903e8975024c31111622c78d85308b9b5cc800430f4cb45965d4133273745d271f877804d00a801dc5d4133575ba2a36be8ad9ead76d152924c7cabff6fffaca9096eb5dfffdb2babb4da3045040307209131f130734171f333a47d633d853c33db0fc3084065741134c6430c68542029359855b91158ca029934ec92ebaeff3a0bbfe252cb540ed98347a11a9f8c47deda4a6eb4685d95ea59a0160ac9179c5a836a7a8b2050b938d30a99ea4ca2b652c6e0e2022202944acc9a2aafedbd6eb5ad052d1b97bacb46bfe9e87ecbf5156f0ff3e9deffffb92c49403938921224f668782612463c9edd1381712543ed754f576550f92feb5008001fe600a00060180a660c29866d8c33871b454a61aab5c628c124600203a880980b3cb482c443cfef18db0e8fc52210cd1cc54aed7bf2b19e34e22e503a47b4caaab11c37d2f9c139a5b38a9bd4a0bd062ecabfd07e52488183e5fffab7d4ea5fb3b6ec4a12659c543178a0e0b34a24443286282a9abf4d814eda99409269adc4982c04d79998a0899a0a63eb98ca241598a78098981ba01f0b950a183287c1311349a043d2560245119d3bb931274a96089f4e1aef4d5cf91a305c4b65208b455924af0d4148c74b7b7963a7ad2dbbabf7daaa395fb1dbc0e0efd63f95fa5e7feee47ac7e7f014c108d1e9b9191480e2bbdcab0dd01fd64aebef586c8d075553fb2b55b676492decce24666b721f60bfa5c378cd051000180043bcac080c1f4094c9c93fcc574bd0e656420cc0b08cce0c49cc1300b07804c1c01606000301702101013b48799ff4da06000cf43f244d57e9a74dcb163dd78f785d92100218b01a4e3d8644218e986846c4d1756693502c92a9b1aa0193898a0b3233002fffb92c4c0028fc4eb24cf6647c266952301bfe81088e6e608a46f6a8cd1d0291702510542955ef7d1a861aebe643c13ba694e12d24cb736fa91512e89f303562ae4ec789fec7e5723e551d773e54d6e7aa4532266ae72a18c9f463e5a93266fa1c12d11e37dfbd694d3a400300c034090c0f81c0c5a1378cd55bd4f9f0460d271d58c75d040ce106b0c0a00e0c454394c4d88c713cc8918d69e0e6ad0e8108cc5bce1d74d7020c0c74c94f4d5524cccacced44d5d54d451ccd4454259918c251b6351a40e01820402e1890632b275d204e1488b1a0706f9f1c07c6e171a44c6706018ba12d05e5ca2e6145997129ac638e1b12e32082062cd85a682660246932692b488aa7396ccbc698eb1d63a603c8ccd22d97da861fc9c4754d86e690e98ebadd3008931214cb2839998ee2231eccd48d4176df6cc0140dbf80d97cffba6b1e16edb96d7e4728861fc8c390b0e98f2fcf3ce9e9edd7b7288739de7e34949becc525efcf0e6fee525887ca043e200f9f89cd1c1039fee802836b93a3fffdc00018301801f30790de30fe41e349163032ff49d32a760435f324037681a2076e870fffb92c4fa8217b99d192f4d170454a5e389ede930e9aa561c70898f318205895e0d9adcf1060cfc40cfb5c084c0125102f1adb198307930205010d1550c98eccd0147158d059c1cd261e2c65e2042583a066bafe736179814188acc19e46c6a5498c9b6608048b04515c04292d8960100108028466312818f448240243a1814080a053d66240787149eb83e552168c8a4e335ea75f2a625e17b61e77aec5e52dcd88aa57529addb70ac3e86010805692301905084b825b55358ab726bda769de8d55a07fb74afc53f2bdec2e4b691dea6c65d76316b96d714cb66ceae1434d1194d351cae96cd7cb3a4954babd2cee566b56cadd4e67aa6fe615f2fb97c5e81254446ab88a79164006d996ad602ab46d420a73499464abc267970e6c8172607010bd0cba6210d49284aa5dc5e677d7243744adcb7abcebf56f3d302575c96cec41ae05688631ca5b531c28f4646e9ae7c9a279d4a303052cc013046489a3d4faacfb3aa75fcc524512040601b0931aa4dfff39feb524b651c385f11a93a606eb5b29d140bc2866a88898e400987dab2d9ab2efabeea0002a3005002301800f30a50fffb92c4d781a29557224f6f87c237a3269ddd5138e4314f1393380178314834530105db32250a131416030c190999601574a3cc16cd4ba09443050e83fee12994ae18fcaf535687ec53bd0c8d00055b5034a04b84aa055313052540d9261c3317519164993526c0493763ece95d4934eb55663ba9e4722a71c206b5187007d9fffe64dfd7fad430dcccb316c5a9082a7515f39c07fff6950638e91801010985c9449a5b1ad199717c98b81fb18d90111ad4813983100c180801501430c18092980bc699e2220e7bc1a584c6b13dae9b3d9ecb97728a535d5e023095886547636deb821a8b4fd9a1a928bf15b9b92385bbdca78bc8b2b128308189746619cf23634673440c0d4b66a7d14e74af7758f941d022e0363438f3474287a9fea2d7db4d34dd6e8ac6082e17730400c0559023335a99906941e558cbe9247d257994550000137080028020ee602881264e668670760b46582af466a5650691e2a060b002a2a03469d4e60a2261604de3e106840337861a4a24c2fd3b8b0d03d8ab23fa9043b32e8cbc45509118199d631d882206bbd57729bd2929144aa6c5c23c4b4e9ab1fffb92c4cc8391e1032c4f6e87d29ca064cdedd1b8012a8b8921ca2b0226e2c0521673a8bc9ae91c2b189a97915a2a353fad894376614c0386e85c8576d3749d35e92544cc907ef64a8b29d49990a0cd5955d4e9b18add25db453a9d6a536f6db4a751b99296a9c48d4ddc366cd615baddc942150242406f31608cb352336035fc7e6339396530535898324f836e342d05326c8b34015a315c981a31c1c0e2412a997f9080467980855634cfd5a215159b9641361231a566e22be770c3b0d4c31af8c730e81a01bf90cd2bd6b11585ed87e252186a3a280643ec0a6a50d01deaf4ea766260769af236972ca9629b93f4b2585bb6e46eb654b56cbcdcb762bc1715a380894013138a94358f5dd65fafc39bd7f39dec1b3b96f1fffe6b7fce7ebf17f236ed2e3826696cf4e8c638045424a4982c5cf0644439a826714d36168bb393dab07103fcc458cea5000195d6603202462f027a65dc72e79b8b1a6add036722214c7cc8158635216a61061a26094460603a12c1503143930b5e892ed30c05025c0c1171e8e4152a91ceadd7ea65a33bf2b8c40e401826299947706c6122b5debffffb92c4f78397e969226f6e89cb5d2062c5eff4803b2d54aefc42e52c2a79a008007298f4b9d55a6eed57fe0230d931a043ae245efeebe37f74346fc4269a6a92cd4a69fcff0df32c63adc884dcc1a77bcf472bb8b5b785acbae54cd578064546d1733b92858c218241479b792181c3e6479d972ab34de1c2f10948b1c243a834e096ead5defeb020bb31044cad030d039437933c638672dd31c6520342be1136081b93654a30e1537bd23242632a0b2ff34d9127fc54b2a4cdcf2d14adfab176f5aa67da1e94e104954203038c65986d862d39ba5eb4d9bcb1c69b1604a6195abb4b521897d2ba63242e25b85732afaffe728edd9a9dfc2dd6cbbffaadbd7674c0c75b5cbfff3ffd61aeeff5fabb9effff0ffe6b563f7dfce1a9dfcff0df7b9e154980883024925905b92b395b4501078c3a0ee071ed021d09351fabfd8a004d1053c3b0c1062968c9c61234c74f2738c5f91e38c86e6a54c9ad0ff4f197836c368e938b349134cb81a08198f020981ebf5508208410ce82da7bf4faedc68d4393d59cbbb59c12a070b4c341e39e01d973f39c85f0570ef514896d4fd2a8098140fffb92c4f28299512b184f70b1c2dba323e5af6c10b49c89cb624d6752c57461a0d249beed76d58a3cb1c69e45334b334b4b5aec4649639cab5e3b5b1d35a3150494fdec7f3d6b7cb986fbfac7fbdfe7eb787fef7cfef7fdc1f76ed9386676f3c0bfec762b6f3cf781ccd535c95faa72402a35ff9a3aedc530e7e7795ed65cf376ef89bf9aa148084ab2b00f3048036317d59e32d54113bd60db31f171b37002793b8501b3120048303a08230011b32a83f980180f20cb7680d92382380643408d3add2621edcc6120d5e7ea975647001e0109689a2c5a334b8c7200d61a801ecd46810090fc8ec6a6a2dcb5503059b34ecc7ef7579bc3fb52b5bb9f7f585ec77fca0eff6300e267933cbfb7b49dc33753d55ad3b4d713c45e00cdb7d73dc5ff5134d433f7abe62afd7e6ef8d55612d46d26328d8401c008c601c383d287b3746e8f77b9b5d5000800031a0c0380a4c0782a8c4144a4d741ec0d295a9cc819264c083f10dfec0ecc5043b0cf94d34c2fc148c4d010cc7b463cc02c3e0c4002a8c1c333349b4c6e06330924cde1730c100c7c12008640a2a333210d0864011a0c203efffb92c4f8021a8d05142d7f808afb2ea359eda238333248d68c03521780a7935baecd0e27314180c9c1a30c030d8c220a8acc6a1b2a048c340c5a8200318703862506abe4e4578fe20d8081660919993c966a0781cba346c0270147e655258388c62619018f08f260a0135d627051903188219022289a6f9e50008136e137c9111067181003c82114c638d2400c83babbe0f87295cb7524a0214b3861040a11a8a55968d0d196439b6e85fc4344df30c30821aa96cd006cbe371ba38619db8f3f108c524a1d89d701d494f6312947b30430706e68841324b050e98eaee34fe45357abd3e710670e250b0c6591d61ed7e7ea5258cf2a952f5786dcb87ec789c781a000049970206367d86eb6247e29a99a979493c0000203ca0428026611e29662cc47e66ca2bc60fc4e06326b9463780b460220a860581a46d0615a603201060e00aa60441da61c411c0d0141d404b20661a8ca22182a40296261c7903048351d390b44530dc39cc4ce0612246aab0a8e24eb5da5895a6ceb0aaf63ebb5dd7063aeebb8df8281c19ac6684a580c31b0862e0c050702a8e29b44683bcb134ff3bd2efffb92c4f4822b615b1b2f732dc385a76571eceda99a7fa5d334b4534ca9633295358aff6b5367525348ef5c954ba9bb6b2a6cb1ca9a555a456e1a8d675798ebbfbb3bc79aad6b1fffd56b5dc6b535c2606b57696cf2ad9c2d7ef54d1ae56955a39d24c6e4f3bb8a8a301f024302c07530174c333ad12c36b22fa31493b632bb23a387006630660a930ae67b31146ca302209732fc06666d380e6d6280430522938bc56938ef41841a0a46946c2345dcda262d2bcf0b53006622e6b5d7ead5553dba631299013320270619070584d0268800c388011670d172b13c3364b24606e78b89e8991b132686c6b41451492742b5a514e0c666aec8d9ea4968b2462666aa7ad074aeab2f56fd546a36050035ccbc7a7ffbbfa12852604200e61dc6a266c430066cc8326212a2661d359a6a3822e607611e63080727c7c23c6348050441cc606401282654885cc9494001586018d4719230775315a63408b2575220fd5aa6860a80424c03ba9aa4ab27a7c7b9cb69afcfc5555c4821cc0447781c296c99e575ac598ecff375ba7625d26f4c5a14b8cdceb6179ef80a846ba8987c6a39b4de34fffb92c49c839599191e0f66cb82a9a2e3c5e5b792e219b5dffeef6dafa87f0666687febf7e6e36b4a1371b154d0df6fa7bbf4d50400e4719a91009183804619c08549a0681c18410f998162f09904855996640184398199597908a460003a89c8f2cfaecaa43522b2dc2512de650429ea9b211489f60c38764b8b41574dea75a64585ac180d00d650166b9062eba1283d265d0569d5fd3a9ed74c6e1267bad25a4b5d06ad46eb4d553d1d7ebb75325c5f8a32eb41ab3d1eb934d1e8fd230803ed52980080a183112c18be045193b145184f16a18d40cd9a4780f980b03e187d85e1cce89d988e8058752838d87835289a8b27a58acaa3704d0569549dba29c5e71b1e57ca75275a852d4ad495ade1ddcd6b7a7f54748888c1750294f24967cd5c9f5f5ab4ec92aebdd36f7493960d755a93a904ee5d494e82d149e8a956d0415afa353c5d912393b36abbd48fa97e81fdbdaa0244402e60240ec6162ea8610e6fe74289666522b4c6a4df5c6df644466482ce61054566a5334c60d6332605a158040471081418002691c94ab5d18199b4c5e32e7aa0b9f210223453359563a38a47fffb92c4b703114919286f76a78250a2e489edd57864c300f7b6cdba9574f9eabd8ca96ec01011602e5639309ec05f3e89521b5cc9cd8d6f3b550f36dac357b88671c87d30de25bafd343f0a2c8e97653191b1ae57a4366ab6e7fdf0cee6b8bf99c5a74544f4b45ac61f15bd362d042924b6095f13307c522015488ad4f435cbe7562ef2ecd4841802401e85809e3052c3523005875c32b0c45d3098c627303951103123822a3030019d30b2035935e7030030ab80373043402c301f8031300f400a08169582468091049150e6c3390f46236fa05c18b3dd268b169c77699e42a805dc86f2ca2b5deea698b505c82666910c5022343630dc5017962803bcb3d452a61d773b95ad51958a9724bc242c072268bdc745c8b0a17309368badcdcc38c4898a5e1f8ebfe79e2693803444540f41d10c5e4c62693e855e9ae80850a91416435e3a36c262e175626b0fa9248751a818000064d00cd240280460303e6389167bf54a6a2cac69f32a743b907d403469f86461cf9c77271660d128210c4a80921dd6d3a7147e6a4b63735c96d261106872e8c4833fede49f56197e74b02c461e8dfffb92c4ee0317fd17162f716dc330a322c5fe21b85133ad12784f2560120a018890ef344eb5a9991b6c583fb7b1020cfc19110c0e09ecc6edd18649a2536c68d80f6498190c67f3fb25c2f0ebb04a15561dbde2f1b30870b196b4c5a83925dc4b9e262a80180ea03818168064983de46398eca0dc19f3808d988a849d18d2a9f5995d41239857e0ee188422d01c0361af987d2094183040419817e02a180d001398dc0018391a118a805943385facf9e49a8720f891303d9708410d59bf85d33f82215b37a57ae44ec32390d16f500c2edbba992000487074c169b3ba90915d9a43718b2f7614f7a7fa7dc7e072436c1c1f2b95955d9fa47d9aea854eb4ee8ed3f7d3a25d513374faa7435d0d63adf14ffa55f50f2328d5dbcfd32e5f5676d9c3398e214df735cbb86eef8dbb7db2fe5cc9fee223a967c3ae6eefed673cbf9414ff239a852280710e526a0202003d3018c0433055087531c705d631d9c63d312643583152942b30d7426930e00057300f0b6f32bb4b2c302941a5301600ae3001c0711400b02e2e89897ec6d5e58a07a998d587e7e46d3a5ca1eb4e91e377e5a401fffb90c4ee8213dd19254ed518839bb7a205fe2dbba4c07abd495e5739aab94393d52615e27487188e659b09134577a6e3d7a7219bd56b64362090526c8b4e39aa463b2a76b5458028dac6c66a38b2e6b8f1f4a283ee8488911bc277b47fcbd559bc3dee5a6debf34d8446536cf4df254295fbed80a53fe57158d96dcfebb081decf127faa1184cc38499ddf09100600000306024810a60cb05aa64428e0e644f8a1461528fde62f90aea65078216612f0186619509126b0e0504616a0202607380d06038004a601b803463c0610044c2134e1cba92311d80a579beafb7c65a14a2f4961d7e4981e9395ecc7643a95d88e6b29a64ef2070c8127cd68417acba5b96a2f10cb0e6c60f1f8393b88ca930f51b723ab741c57c3cefd73d72b2f49cdc354ed14efd63aa3195abdbb72e1b9eddfe7b377f6f43f5dff3b09ab365193fefeeba25126ff3b1e83d2f00d1ef0824cff576eaa080c02006cc08c1b0c5f8b50cd555f8f2b09f8d048aa4c493d00e664738c99c290c14a8f0ec2aabcc370438c14c2240008c2a032281c5d707002001a7b5ca677691fb91daeca5d22000847218bfffb92c4f18299e519122fed0ddb1aa0e295fda1b934ca188c52898cee5d90f7b75e2e6b38098d0f009803991b035d71acdcdc866f767bd18211e80f074e21b5dbe6d9bcb34f30602edba5ba6d261abb568d7e9aeaae5ebab8ffbfba1b14bdd5435fb3d47f8d93e85a8b19fb78bd57bc9dab6ad9fd9912c73ef6621ecf5898f373fff1573ba25bcf6030014a980240159803a03c181282d41842c0bc9820028e9822438a184d26f71858c0f61834e0471851221b1a20e17e98472051181240229808a00218040003808f29163ec05fe95dca94b471a9e694ea4f3ccead342e7ae36062faa5b16aa4ededd6f9dd4ccb9bb3f20c264fd604cfec5e8d7398fe6a6f81f6935bcf020878b4f474710c5cab46a978e888868b9d1fd526ea66279f9b71285c426450461b000d0b1973848ba86b80599b931f03098abcac410937d8e41fdcf545e9421a94c55d0040c80009cc048290c48ddf8dca50e0f87cb98d0e4ea0cd3dbb0f298578c8104a4c32e9ecf2febe0c53c354c0f81f01206a400443206200458eb4db3514959f43effbbf13871f46f4a8070cce4669ab3304e29759c32d4b6afffb92c4ed02180d41122f6d0dcb0221a2e5fd21b8e54d2596d04da8429539e20140196afc7ce92a4f3f3498f6a662871f62a145534c5ee1845536c68b49da037158bf77b29f2ae14c9219d969ae2263f498b6b41dbed32bffdc2d48d7e8fa8eb4fc66a977b4eab6f3bba28ce5e06a3146af35c99d971b379b8e1f77737fc2aa17cae621bf387f6cd8e00a54c05c030c0b8024c49c950e1b0bdcd928fd0c2119dcc8eea64d9b05ecc450324c8391b4fc18f40c78813cc20c0b0c0d0044c06c010200553396a390ffcba4d62188ec9e962f62189a64f0996c46b32066f4b35f4b7e733c2df3f1b923749be2401e1605d9ab15b2fa6aff958c4aba70c7914e9e81d8892a5499c0da00207c5bcc837cc107763bc859dc893e67997a52387653f90a5a6729a18e4b3b7efd9cf22ddd95e8c790c70994494f71e70e157913cf313fd3b2836a5f32850040418076016180f00329840624498836013990bc2f09881c1f29834e958989e61469841a09518250470199a0497982d007e1800e03c8300260a80323800426faaa280352b8d4ef489fe9e933b7199121e32e8dc4a19c1291debf6efffb92c4f30219957d10af6d0dcaf3ada2d9e40f882bf9c625bb9ade376dc3d126842a01b0b0062fa49f94971f9b18e572fb2edb553f4695ff34c72d77adab1bfadaa3462facf5658bbb5b4f45d053af1a1d69ec37d86aba1428e49d9bb7a538f041ee343a5babf4128a3c8738761a318cc6b63dd270b8e6f044425386aa1281d73f1d646d1cbae1b575c486c593c7e53d20c84344d24a12601e03e604c86a65746506cea1ce61ae82c65286526b8a0c260ea1906286694747660e626204860c802e604600c0a01501585e91e7ac8de722b970abd2b9087546f75231c2b154654f6871a06ab6def7bc4591d8218a1569dd21fad406648489447b38543e161702c7670fc54e3054bbdeb22229805cd1f1ac4f67d9e45476bba25f72f3abe9c7f503545d0d443a1750c2026012da5cabc7225e68913500881c03bc71e69d21ebfefffd54aa44012070603a196625cb0e66cb2c262f8da467465dc6badc506f5236464e412a61b6f4e7936eb062aa27260440fc601205e6000034150034dc4af646de51b7389cfd9db0e750b805a58f08b83183b874c384c5053115c61c5bfd6dbd4938fffb92c4f4821b0dab10afb07c8ac721e369e7a1b813417101c64ce0bec1c43cd2be2d1822dbc2ce738bbdde9e3ec535bfb2598aee067d21b9a22a068e88cda6a69dba9d8e7a065076914eb711cff6a465d326f31e1e5dcabcc8bcd7b862436c11f9e79155374faf652db33786c9f99f7d323a87dd7550cda89fe7201002730034058305e82ed321e478e3355048330560771307e53403121829e306581f5309f870735000600309380d330414064301d8043300ec0163008000528002c9800176182c3f1094cbe131f8ae2eed3a8e3b52e998e44e06579725f418bc53dab362bf65f2f7b9c0bce814008941aa9da06e549be6b7314d0acdef29f73a6892fcfd20efcb5407d2b589c0c70ab8ba214d3b2111cf38f04b5f52dc33b870a12179a7984dcc341cc7905360318fbba2a86dc34599ca73d4a9c92e45a958765a8c99763d62ae72fea74bcd888d62b14e95e52e8a7555200c0c80e4c174200c649408cfb0168e1454eccb505ccd9ad918e4e0318c96c05cc329a88f1e991cc4a04b8c1641d4c0800d0c00c054000045e34b8620cddf4a182e332cbd2487352a4f69b89c226bfffb92c4f5835881f7102f3c71cb5dc061c5f60f89268ed470c33c2fc6aa76deb0ca5b023709f758a0102479dba955badab95b9d95de03a5caca684e4c5e36527db581314dd67b6acb48c97732736855548e379440a73fd77a579961a99074e9134fac650c8c9131b362a8bc32cf949113525cad72e19fc2399bee69e168419086b903b9b255b21c17be82800a3003004230114834324dc37f3222c6c6301a0722311f4dff321e01d33093418a30abc63e346545033089c1363039007b301a403c300c001d3846070ad0a5ac1a5adca4714872cdf86a97a87786eec1721a443f683529e7a535a4f6792bb3fba4b3054aa4452e431952e738cc2bd9c2973851c3814a50f3cd5197c19ddbb42640243990e5abb7eda31ed48fa6b1ac268f5dab0d5bc6c2f6929fcbcd5cadd906a9fcaf4bd0f49ed652a2e2cdde74d34b8aadda21fb6b577a421d95ea7bfa9e3be7ae3ebd7c6ccf7755fc35c1304e750044007003980f022187ca331bdf1301cf90c718e780d19856f198cd8d198c00331847a9b9d75ab4189a845982c01f180f80d81001002148453395c396e7738bd046a8e5d9ca1dfffb92c4ee035885c5102f187c5b42bfa1c1fca1b8180e5913fc97cc2b5632de77f1ce9793166b4be6a250c09166a579678bef632cb7c6a1820c68f74126541d563a938296cc37565395e8e6661c67a3aea43b6544b4aed3511ac4dcc5434a3dd7d4d4d166b99957b2a59ecc8abb3e67bcc5aa4cf617457db1a740d1430163539cb354c49a140487802cc0e0008c6c4320c2588d4cb0db04c4dde14d541f74e6a43ccca3833cc9d98e4fde9370c8084fcc2841f8c1400d4c0a4070c02801cb6cb35894cc3545158cff619236584450fb888f5b830c9ba874c3582cf06c9ac476e9d99b198b2140782eb307970b52fbabfcbcc2eb3780cd1e033cd6c67c48958b6854cabdcb737a2c7804122d7c0b0bd33372216d74635dd48c31bc96291f93454628c389b292752c222299c2b5736d73d777667e99258635be54183258faba91e9b454ccdf2081b21bd45579f437b0240a0000a091d059908009cc26d064c670c40de948f0c4c8084c48a1d8d84c338c27c000c3210f8e5292a4c3c00d8e6a132018b7eb51afab81c8fdf98eaf74ac65f2aae29bcadc623f1c84399f0ff11eccf022fffb92c4ea035701bf12af60adc329baa1c9e78e39eb51f4d148c7a1a8af973888b7a85ed89a4ae5bef8d449b72d7c55bdc7a3745891a2432827acb0cb052d4a0640dcf1c81ef2ae35d0358badef81ae3bdffdb58cf74dda296adf9c18f118efb79bb363fd477eff6a54d70836f62b8747a4796fb6900300d40643008810b300b085731c889a9330c868a306989e4308555ba307582aa30ac40d630b6c802346a46f7309a413a3025808530144034300b001f3ab10b654d35954b5dd8269222f244e5d19720bef4af03fb4f3e426944b2dc3b411d98a5d5fd472a5a88cd5e61e890df4d56a7ebab8dadf3d69f3cb46483b266afac8b659586e0d341da2cc354bc2b5dc86ea552845dc3f4266dd4fb6513a9ca16699a41f7d1d9f051db3286322e563f6ac533d655172de7d5512c232f35ba7c1533d51b190ee627b78b28d67a793ca31056de425798465ff8eaa42c8a35f6b5b363e4e147d39b856558011053ecc39958ce3bd580d701774c7e4590cb45d20e598568c1c8284c5fd614f5a58c0c63409cc1400a0c05c01cb400671081c65fd0c3bdfd57756d9329aa1295530180a65fffb92c4ef021628c3152f69ea4b97c1a145fc19b832ac92d5fc1bc38b8936f21cd72f70b43241d0643db45888752db9b270781a9310a48289a1934f44a009089455d8571cc8a03efddcbffaade5eeeef9a57d9af5c2501ca39a8258f545e7234722c95b3387e670929decba762987554cd091966a6298a8910896182abb994f3d74ab45f718c2a8c99820013984381f191808b19f60f61e348ab9885c0299f7e3c9cb60b798ca08c99043849ede37118e8052983f82b181d010980f8071802000a5731c86a0e9a7f666f6562436e238286416fc7d6ac93ea7a6ad4aeaeef615bbabb5e6e6ab5e76438062dc0d3b967334385fbdabff0f7beb638e9bd4d4d2ced944050420a360fd0060d9a99d1b6c58895cd4af01311982208d331d41d896b989290e73d96e4511249bd2888a6140caa9b2293b0ac491760426f0b48623657920589031f6d1642da90488e4d09e28222b5c73c1ae42aa611800030070084d5308656c367355f32d4528327a15531abd1131b31e130bb08431544343b6a457316405c302f0250700a02801d391ff5a90887ef3f7ddeb0c1fc8edc7dac4fdcadc4ff8fffb92c4e9835745f30e2f3c6ddb3abfa181e30f89671abf5374b76d4aabe14b8b993557026009957d35ce5aef7596ccb6937d49d8ff70f49b1fa5f3c02eb9770592a97d272df11b2e09e0c59eec7d38196e7a5b124846ea78b86bfba2f958b6aa62b69622f6352f5746bb4c54e869f99137e57e9032a78b20ff18352606f7759803020800360c2a5d80d4aa190f1a113cc031fa0d5ca51cec14544c5f4650c80df70f82df44c6cc2a0c2c017cc1140c0c09005ce2242969db6c0ec4352582aa4ba3d3586087f52512ef94a3ab7d3d73562e6fb452ea7b5564919a0c5f729aad5b38527296beb3bbb2651fa6372d10f2761a5d4d13b4da8869c3be18caed05ce2e762630bdbd395277c2a20bbd4ae4ed7be468f30d3507797752a1e3bb33d569f993d992f59f9fd3aef99df67679e7bc6deae1dce8c209d655776978c9adef59a8e1b076b1154fdb896d372be6144fbe6c917512032a0000a9b8300201310819186b9c119e314e9ba69ab998082c1a3842b1b0c8970189a4c46cdbcecbcd40c53423cc0f80b0040560a004417608b5c759d0e472bf629db5e21a9c3f0cf3ce147cc1fffb92c4eb8356a535104f187c4b54402141ec19b930479bd708b064d7dbbbf9767dc2b97405eb3ddefae6f4bef2dbbc45de74f339ac7f703253206d1514c53843049753410644a34263607e70cda36e6ef74faa08de96e445911ffc2d7372253ced232373ee964b7292679c38c56fbf4c8c909bd0cb9d94b6a7cbde343e7a1d6cf06c885e00301d00a304a02d31a92f5324918435ad520307c603317bf9a324e210319c163318869f3ad460031400db309f0543040039301f00c0100897ca89a896ad3965cecf9ec48e860a63440b41e7e2d2bf0c715f3cf0f39c4463856760c80f2a4faad925a8d58718a987740b2b22a770bd82f25a72b420a751f32d639c9eb7a8886f9ca23934de31ddcd74f0d732e9ccab56b3c70c4fd4f8b0f4fadb1095ce1d8f37aecc7153b1cbf0d3eca78dc685d6467fcf6c68deee5bf4f772ed8afb3b1e959dddfe65ee9f09c3fa693692192319400c0ac0e0c100234c335884e358b4cec401a8cfb8708d835ee8e0b8348c66426cc4d0e78f868e04c6302c0c1dc0d4c0c00280403e180088fe9d0f045e2384e5598a5bf63b7e14f25265f9a6440d94fffb92c4ec821779f9110f3c6fc338bf2185e799f1b6f4a2231999ab3b857d5684ea79178452273ebb456df7f479f7be5373f3a8fcaf36dfd85cb64e1d56bd03eea2b30ad880695c4a271c88ba0b0721becef92b520c1a69296644c6e719de36444cddbf502b654524555cc535c937e1932b0859b1466af9213113025527517ed94c43cd932165be421e164541b85a81200c480ce60ecc466fc63cc686e9da6132bbc666f3f66df026a6426200631abe872a2a96624a23861040ce6072070602c02a6006008805939d25e9662dab7726b82b5c69bf7cc5b9c284a98accf60b7b0c5dba82e30e04591a428887a5a0f8111591e2da958f5be1b374b5e7f24bba09ee90c191a90b4041946521d222ba0aac2e759c3a94dea3ed1ca81a0e81ee07760cc9b29fc415e8aa15f340c713d16a7d323b98469d296e7e8c690538e40ab0bc6f604509e9b1bc43d98c8481392ac3031b0e45c07372020669004c00001808260d602a6380626624c48c715674466be5aa6665d1261ee35e6208154624e6967b0e77462da0a6610c038606a01a1c0485f34d44d72debcb94b2bdfb2297b4ccc47221fffb92c4ee035916070c2f307a9b28bde185e78df96cadc907c5102f16d1c9b56de3c4d6313e2c7dcee62741ed8293436e96f96cf0448f465694611432040d19f8320d0209902d20c81e0c1c19ad22504c194737b29391b2d2d4296f051ab4d38ab5d9b893ac62dec67c4840408eb7fdc91431cad7cd9d4ba39a5b595f733eddf5c1211a2a66c6670e1f53c9a957b26d510621033db260c0140204804cc4f9308d5adc74e6f8fa0c5d9bd4cf0a14ce0b4434c9a828cc6e99dce601678c55050cc18c1b8c0b80dcc0540600000a8f4ecca9c17e9c990cfd3d7bb5a96917c41d5edcd5e47755b8de99ab249ebb73777bda7976f24da1e006a2dcba4ba9653f6adbf3cc6756bd645171e55d4390714c4d864468477a54a356d1a5d1c6f74df6b3954ce421495153a4e2b19e5153ad2f87b552111d24ba0cb76b873d2cfcd5de0bdf3087869394dbd26539aefbba867b896fa7cbf786fb4753637512baf7aeeb87d90c61f55ba72e8935da0f34ce5482300a02d0084f181224c1979b1819c124498fd13f18a73ee1b31863180b81b989015c1d931c6989d0008082fc140783c026900a5efffb92c4eb025932050ccf3c6f8b60c0a155e41b88c91ea87e5553ecd6ce6e9e72e5f7f2594db994fd1c19beb393eb5ee35231a9f0a81a1f8f44b5762f6fb7b3d8fd9cc5e9ee8ba73a65e7c80dff4a0dd6886db778750d9428913f1091c82412f9ca3876d7a7b77789063714b33e397b553553076d5e9939ce3aea5bb5791e58f333ca65c7446dc14169a706530885d2d9f1a9e16dd5b6f68300c013300f044304d4cc35222bd384107431b75243098bba30ab160315f06631214c6364547330e70ae393b345230852d9359bd097eaa59a3a9f4f7bb5258dc6ed24a31a25650261a131279081f9c4cd38c7a7038e081875b895654b31dde083c763cdb1acd9103db874e44ab6fca2b3791dab3d45c570d8e5c8ff441d6d2976935f14b70b352e6f5436325b75c9e26d2feee3b56a1888d1ef5c4d55afd334c57308bdefcabc9ad0fc5a523f5d220c655a1eab490757099433a2f7a19003021016305600b31951d032f921133a646e31532313215706370e1163043035316f2d13bdd38031710120304a0d0198f00224d368bae9e9a6e9aa6e5d6f752414752250fdb90d0b11563999fffb92c4e08356ddd70e0f2c770af03e61c5eca169f974af3c2e2c8f5983de9a838180f3eaaea4bc9ef0578dd439169cfabb2db29964f1c71abd9b77606f966c5f14446338c21d4243a45dce0a47f41c329d1ba6d8555b0d19a19f1c8308ce247c198852120c3135dca4c2b13c26662ca4a659113f9ee0d029223dba9d6065105bc35438eacb55ce215a5acc5bad18400701518180099884a079bf51a81bbf1d2991527399ebbd89b91058987b063987e2ac9b0f2aa186403f98188191808005980080004746f3f7ce0e4e2f63c79170ac7b93bb119dc290ec3ca0c664a7de350b3b81979776408e938e0b93e8ea4545a1459dfb2da36668d26c1e63da6380570bb8313921328d482b29a3ee2e6c0ba550199054742cf16908ce0a95d6de3e66b50f17561341abae7aeafb1be5c319c8a88a154199134aa67a2c763b73882cc3cd4b812d60e462a3012f117721e93c34892100030050221c093301b5db344f337391f27b316a23c31b7d75301d1ef301f032318c2783cce2cd319c01e304100d260302600b0221271701b88bcf55f5b6aab728a21cf121bb92e2985ecd1ac4793bfdfffb92c4ed8318f9f70c4f3078cb083f2185e78dbbc365b42973174a62815c8c707d7aaee0c662c4773da4a4f7333a54bcaf950f98ab3d8eefd58d3a637c89a26f6eeb6e8a8beccdc853c54c15dd937edf7fc45e356d39ea6d2c4d997bd29adf768635c3e34c2aa5a01a2235a335aa67dd49530eacb62b90a48f36bbd3eeaf75dfe97388ceff188ed735eb7e10ce5f2e4202860560ca623ca62655a398655eac0643e89068c0f1e6eee26e61d2248617ebb86b5eb72613e110609c0766036024600800a89cb1655c8bd59b956133c9adbcf4d25ab775f42b68d0b5cf36b1e59775b5f8daad90b85f7b63343dccdf969d74783cbc21a669e75a9a2753d05028218831a6db95b7ed34e669ec49e41b48dec626e9c2bd55966466dd1b3327ed35371da92a4ef666d445dca16ad274fdcc59d9da694859588333378a68c2e20a4bdebfbfd65976dab75dc9ad374c534a178a689bccc9f33b79b87274b8a83d080480240c08662540a060346ee713424a62ae4e267a0cac6bc21d0613404c626a2a6754228862820a2607c0204c05e2c010b5d5c38ea7563f5a78fdfbdb40c3c492dc7fbbfffb92c4ef03597e070a4f3ccdcb33c0a141e61ad11bc9a566624ff1e0efc46e9678f08f42ba36ef25dfff3eb1032ee3b7f79bd47ccb7e4037a7d2a205930320852836243b1c960c51d77d925327287e08019c28a4cdc9842c21e694ac80a0e3140f093a66f1f30c0ca85444525418ca521448aa9d66aeab6a15dcc4f83ffaa8e76142585a0a40549f2b1de1c3216eb108180f019980c84b18671ff1ba3a971a7fa7998981bc98c8e1318640df18a308298542a79a2b277183305d982881d180b011980280416759740ee4995c302bd7106eb5b57b2a7948a4cbc8aae3163477b58116f5c62b780f1ee9743ad51b9e4a446ddefddeaa16870f1d1235a12e49811dea6181d631c61723a0ec936614a1aef274190f0ced7078d79f5e4d22d169e9ac7a22dd23a440f6e17a6c91efd20db576cc49a2c82c8ee11e8fa1eae30fab61cff39a73b08967435c5fbc2cc2c8f88bb49b7feca3e5e966cfefb9a59b4a81b600b5ba005f5300502a30203d633ba11f34b526830f224632d74da3414068306705730c408237c609730d602a0303b8f010251afc73dfc7627b77ed6a66b123425f95fffb92c4e9035812050c2f3c6fcb3dc1a145e7a1f0e3e96ebea88188f245ccd6544271d2ea1ab5fb01366dcc3ae99b548bf6f1a732aaad4a313d8b0dca363e9e62b6f9cf6edd2b1bcb8bc64b692cf2f3af9799647c4695c178bfa9316f69daa4da436f2fd0fd354734f2a9972364e7f9dafee892cd2ca8af2f991e5c8adb118976d82eecd86ffba90768c0bc048982a0c575138c944f1cde60b50c05ce50c87db74d6403b4c674280c2cd358cbf50f4c174380c0c011cc0340800800a5ee6531c9040d5226ca676acf93d30e30450ddd4edaf451a243abb02c7ebed6eb8721bbeffd64aa650bb5ec6dc8e3a47b0cd6f695769e76bb0eef14efacddf4f1147ce5ceb15ef3adc8fc29d1df6d6f7d716ed3d51a5eaf21ddd9d18a814531d3ea9aab2f374f95abb9cd3e56d51a49d9b6acbd291390bb28b7f3f34a9a776bd7cd777b6697865b3eff778ef75712c65b4bded32d5c192a004980e01318918f79ab72d6193d23998b79c198ed5ae88c4bcc000248c48c184eb84438389b8883707815c88054880097e36e664c4e61756fa1d152a7c8060c471694cdef2e4d7ed9656fac511dfffb92c4e78216d9d710cf3c71cb24c0a141e61a3912c8dcd1f9ca972f4f77cd3188966953e8af06d8ceab4cbf71719feed96d4a9d8c2d3eb8d2fca9ae0c3ac993e71d3793c4fed338626cd3e178fd5193bb31cdf3519a816db8e8137dc8ab38e474d6c80bbd85cec6ad8f6bf88e4fdb6f6ec61a9eb273bfbad4d66ef8e55ef52a547f8b7f6460843a06848a0050141406f306f4053266467381f0f030203f732365fb353f0b5319803930b045931c83f4305a0d1300703c30000170a802232b4476d3241e12874d1e19691eb044431205cd9506d5517f056506aec95a3cd410848dd21943b755af6d9732fb291224a33d084a34a65b1c5b35a27cbf9d395b6e86db4cfd97b832d4fe3b3212de932b199c97d99ab39d025af4da919090ca14c5126a97a642ee0bd42f1e1d23adfdb6abbee72e939e6c6ea7a5ccb4463cea8b655a7db4dc6aa8d85a08a99b70be9b6aa5a3c4a1da00920180b80d1804030980428b99f486119eb1ef18bd19218b63721aae83e1842023989502c1d020ad9896021982e8000d01e8d009216afe720702596515e555fd7baa056d2c4a4d58403a6d2b12fffb92c4ee0258a6050a0f30cf8b223ee155e499f1756889651714a20b538098c50fccf752d0e294918210f78ef18362ac7c3b4265f4e365c6b1858a65b33ed43adedef9a65a8bdb1f52c3b2198e21ba2d1763875a4fb9f76d54f8ce62dba171f284c622936e54d3eb2aa7db5d4b442c56378bd237b81abad1f0976d475424aa92652e5d169c20a267b78774555c981780a989f1b999c200f9ba71aa9889a3418825bf18498af18ad819185ba5718cda5598308570e01b85403909ab04a3ae8387d8c29252151638a569a16ca4fbf60b0fb20510d63b2c74f336bf574ac3bc5b8daf50a6aebdb62d472965fd3ce982d365f5a4cb2a0e1e53df02d0d1aee69a8cf82905a4727cbf787f330c9aa79e6a2551f91e96bf38404bd9eb4b0e45aa6e91a32cff565197370bc7987b9c2ca27d399f3334fbb647ea65c18457aecccce7fc9a6245a05e41b7265bbb633651685231afdcfe64ab7a7b15240003004015302b03030f419e370f11636cd26f31872a131bf50035340da2212f312f061394313a312704403038838078bf2cd9b47fcab11563567e7873b07ae3a554851a9151e944dffffb92c4ed8258b9e10aaf310f0b2ac02101e619f16175142ad7ae64ecaa65130ac7873b9162e8099e77a5f2a71a21bd9865255e503ef01497ff0bf555a5dcc0177f547623788bc6d7f1fe5bbceb762ddd9defef2ed35f6bdc9d94e7b6a1856efd2389c5b33c62e9a597e712a38a4dfe37496d1e5aa275bd3aa18b7f2ed5fcfc632dabccbe734b8c972a48cfad4aaf2a55fb520294980180f183015f18d904018a0931187810e9903a0199c802f983801d981c1569844160180601988c0113d5b92f96952f1fd419184472f9ead1385274512cfc0c3a84584d04690ecff95c7b9cd3aef27088e1f632879cb9c5b1b113d884cd3732cc4d3838761238d099146519c1b8b6550f2054edadafcc51d6534e4e33e60ad8db0fcac75c4cfaf9fec0b31b2a42c19677b4fdff5ef8aebad3c982c1028c9ca9570622eb465040580fd18f241801c0646064054619ec70602681671e80e264506a0628374e3034a1817262fc052765c0ba62d802a0a07e010128600125831e762c47e55370e405434139dab46d86cc7a8a8e969277709924f72bcfe32cceac7a9afdcc59186e8654325259b3d2fffb92c4eb82189e010a4f30cf4ac4a26225e60df9b2ce7a157d1ec4a5ee6596d759759e7fbefb671b7d232be638cb6eddd5b7f4999ea3da67eebae7118d38a3cc94621cca7468e938b392648f92c4ba28d16c6d1e4dcf47ff904f133d87a10c475d2bccd2c0f66b4f4f469cd6288adb4a2650cd53ea866c4d427fa5ade4f48d178268b9e9e5cc995cd6479d4957da63c39e4caac2802e0804430d51d031104be33bb33131d522a3332503350d0ad308709a30233cc001ea8e8291808009834011789a46ec8e99eca68aabdb332519df3143c52f2b5c91a9965a35c9a9a58312247de8ab416e0d6581077a813e214d24d6f9483ca1731b25162720d77bfcb3a4ad6fd334df5ad8f8c72e2ee599edbdd6753136c432d5377a5bbeb37edb09bf2a706f8479f3d575abd8c56b2b331ece6932b18ef2912b6d6449cf66cd56a3ad27d34b672ddef113d8b7cf39d241b97e1fe07cd415230902832a000160910a0006542201f307712333e22c333bf1fa311d23f320c3c63389074300a03430b5096363108d030b79580d0b0052bd68502bbf4528b314b427e5b6f9f75a56eae66482f1c2fffb92c4f7035c0e07062f30dacb0f3fa141e799b9ebd1562fc7e1accc5d80e8062ca01088ce81c6cb462845a66eddbb56bff0732eec2787eca4afb36b3aebbf6d4ceb081f133bd0e79850b4e352a039ee477a5eb118ce6dfce9b428a618ce320d4936d13cecbbb12dc5132366bae9751c38b57dfa4cd4412cdcaec0e41fc2d8ebf2996e88103cc094070c0c8154c33d1dccdd430cda18690c9005d4c7365f0c2e04f8c35029cc010ff4c62cea8c05421cc03c0981002684e2724f917a5cb12bd088a92c456e8d11b581b5f35c795fb3c75edc67b0e34f99dba4ae16468aa77785e0be62855a6ae4e3133d254bda2b474d7351995569489f6e81a9d427a20999919af9f9dac82749c11ba32f22ae593c4591b95da16aa7524d3a85c4bb6937264106b3d5c9dedb49299dea6e509b43152e44fe96f87b0dac7f44e3df9ac54941915744a299b5edd56c8915725eae0d40a2f375ed934b49e7c4948a42000670600a022611081a6678580629864661a069864ee9bc6868100600a0f661902766ecc230103301c0dc2404a2c00c3c4b556489da30e63c271738ef63df0e12bccd67b5e1fffb92c4eb021759990f4f3071cb4f40e101e799b8660ef316b165a40bb872ea36b11de468f0623c57e9bfbd4420a4b0bd4512e7e8bdd44a6eefeda8b77cbaad420fc32155dcc8dc3dfe5c492d6f511e129c9b7f65fd30d4e2ddd6c71f924d6d32dee134710b3f271f2cc779ac6f3d32dd8946c4590d73c9561dedfc9b7243e6b4625f5acfc77c2eadee0b93eebb7ad8778bc4da4a56140166180d811987009c9a5496f9afb89b18d186d1873a4b99dc04c98738280a185193914a98120450800842e010b026124d74e0d3159d9f198f58ccf85c394b37bd9f3f8f86f91fd195170e468ca8920c6932b647bd9ebd9758ac8e0a488814e0983aa5472259f2387db1f42d04e4f106e7ad26979ab369d7ee731c3b3ebb9b5fcea9454cbbf53ad1bac5193aab2f132282365d465b63654aa6397b7ef65a975863f9a9c4e5914e91968a7734bfda2fa0dd377d762b773ee7d769a667ad2a4ccaad74abb461f8d1309a00294000de180580918570f518e58d219c114218029aa985b3db980e86f982783c18608b81b5d881985b8100081d448078380159b36ae3a25ec18fb8d2de24747478fffb90c4ea0318ea030a4f3ccdcb29402149e799b9187f17dcf49ab1695837bc07ce5e7babe139320cd534ebd01c1f3fdc07ab922244c40c50d646c2b6a875271e951d4d604b4ce07ac81c1526e28882cc96dd553067203345d55430eeca4cb60d2086e9909a1cb5410438c8023e9c763214339d8e294190550ae1de92c17b24092038442a9bc360ce7530204b424330ccf4e8776c4ecc6a207216540010681b18181e218d20ac9a2912798aa07a988120899c082f8186f470a6ccc4c950c0ac1e4c56190b3c67f187fedca2e4509381a9eab62216624c39c64a210872207c4c5d4d1c180f45c571f554c2e7d8d9e126da2de47d5106b63a674386b37376f4b66713d2354256554d420db2c6b9f4628c14a839c585a459861290e3084ab8664cd1c94efb9e4452cdc50d3587b444136bbc55f1335c2b9a55b516346143ea9e495299cce6db424e9a32a34781fc8d664b3a3a3d086df3a352c5040078a01e183c97819479511a9a8af984697918ce26219bf831185302498610b99b0306c18580269de709225c660b27bcc12487ea0713216804459e53996368fec0c729e3393520fffb92c4e70258fe090acf3c6f8af7402141ec21518b95a85112aa5cde5da3b88dd9230d9993ef6f673b937c32993237750c7f3623f2d129f6b6f148617edb9b081aed64fbb6b3977e258e0bfdaf0d657c68a5c9a7a2b840fbbacf1876b397a566ff171b2ced365a0d6ba856c93f91eb75040a972cc314ccfad0ff1e9b62f69dea79f3a9bab7dc9d79a520a00e4b930b312035a022f314330a31610fe30de7ec200d62216a30122ba33c82b3303e06230150154505f6aa8e1be81e349f78a04d150f2aa1c36b8a8cd9d2411b07da9a0a1b4e514b3579e49c38b4cd46812c91b53a5a6e90d324b61496152e9ba65338e58fbaac2529a24c8d2c8ee03479172c63595ef252f8fa943178f1f62c89ef1b186014e495b331b66e69eb48bb5b904db20f88af125edec4117cc45e6f5d8aafd29f0566366e22b3fedbd3ccbbdf8f06274795ab7f28c975f4364cbdd1d29929d500400180f80b181901a987694298c98c09ad1074987c15099089b51a07049186e80318758cb1b0c882986382b1c08982120ab0e81754b5b1a8f25348a2b52fd3fd2515bbf953c1b6585a7c1c14fdb4130a45fffb92c4ea825786050a0f64ca4b18c0a115e499e1e8b12729979a4255b04350bc6c45998e56aa0ad87259ac99028e5f83e3687a66b391bafb069972c44a79982d94ef3d7fc4f9df0e5e596e553c8b49dfba4c5679ccb2a0c7ecd850d4d04b10d7470da2bedf30db5f6bee6b2053272fbbfdee9d1b2b6e931c74e4c17f5c35c5e996564f6bf986a285a8b64acb06a8e80888906cc9c0e38cbdcac4c4781bcc9e54fccf981bcc13806cc0c4a0cceecb08c12c09c140408a6bb1c78444c8c4ac9815a89956d83eb88d568d953885b82c9309b5855a6d65d4654e231c6728965b8169075560a2caae89a815df1cd5ae60f8c22e0731b75286a8124cce593c313793b5e99d8a311a818d075635f12baa2fe9f15b4fade18cdd75b66c3fc20595295a0ce7f3d28bbba72cc625dbde927e8a14bdcb2c5cfb78b4d31e627b1998536bf8da728433b6d73ae598c1785d59cda7d451852e75d002a020600e0ae6158516641e7c2688252061324046128dce616e2062427a61ac3366afc2b4617406e60260085a15366bb0d4652ef3a4cd171c9cc83292555660e2e9a1e324f08a1b2cb3d44685fffb92c4ef82d9460708af64cb4b19c12115e499e9c07bc8a9946708175166d2e7cd324d169b1f22f4fb920bc9598f2d8405c1b9e40c790fe1036554f2e76118d87739340e79513a40af2d524a9cc0f173ab5a1ac8950ca989974b7731d44dce6772b65bdb2948b229d1138facb828a252b56572adf97871df330fc477659e9c83ec5345320618d73b5986336f7f2ce5d003d6936614810667463ac69f82e861ae0ba650464a682a0f2603e08860904a0672452260b40305df4547ed227141e2a7b96e192c9245ce28404705da24474a6af06e10560d5377bc154994514e803a43611267124515d13387106225a8916fb6a8b640b30d5a7d387e4a8d41abd2ce45045336ff5dd49c8210573ac917785554984baf5816b366e586a7b873e6fa69cbf90d267a4b319aa8b98e068614c6d1e9a50631283e5d230d3ae6cad3dcbd3a7c4277bbd727425a9361f0d665a58b8bb474fc7c132bda30302130944432aa9a373088359aed308dfd318c4783377098304302c309d1c035051af309b0060700e838009415e68667a455a59220411346a40d553a88c71428d855e9f09930bad88c81fffb92c4ed83595609082f24cf8b143f6101e499b12a2efc6973a85165c783aa0d4d32d481fd965ed5a66c9e6a5690295973968758655869292362e8bf7949ea6945e510a25179a470eb636a71bcb1508f29335c85b113309af0caf0695a5455d3a385617a7208b116524f4ba6af6ae6979874205e7a2a0e9dfd65e2cadd271467433c3c558ec7ac61d7b16ef59289f7888aaa23034300d36a33a701835310a430960d2313b67630de0ce304c04530572033391204305f03546c46f761c39648da3b4f34020805a68561446f12526804abc056c1485a3229db9b712c464bcc26914db5271129c8d97b784b0e2f6ac0c2db2ad34e5062e8ae5a93c72af51dbb627b37ca5b206ad2ca424d4361d02cdd48e926a872a2db6fe44c914ac798c6f6ba7b828a3e0ebc4ba564da253b602d75ed9a75ff18759aab95736182649add459a776b1169ff38889d61755766e26bae6bebe6625846932c54f3d577ccce308726c341c02a330824c305623631b334a338c048302405b30841cf34741bc010788080d83002535a132ae5b9c8bd74cf6828a34283681d0d40086132e5529e1d4a984912fffb92c4ec0258c609080ef8c54324402115e499e967a2340f811390338f3957339886561c4bccef37ebca09614e7536563ba7e34c3e6ef352a39f5adb4855cb93762ca3396c4aad528b1b84db1d92370d29232264cb4c819367d6bc1e63a5735441937ed0bc6de4cfac8d7ed6915a5e5925c3e475a116414b7966a899d6b3f33e8c6e7dee365d2732973f9ce5c1b38401460c00a66280c67629a7a141662896a61a282665d80ea0610e30441ae33d216f30540480b802a94386fa5da2bcf9ca6f112522d9469c386812303480c38a474b2c971045083cbd48e1e4cfb35f87a640f8c86a48910513084b08385959d28d39b58ac3c61d682bc1067d859a4714c64c3c12fbbfcca7aa3a04d4328505629284d23914d2aa04d7675c62bd21786eacbd9f379d1db23ef2db1ade0ba6ba9358f968206fbe59884673fcf2b5a67e6555463f4db11f0b745d045fe3641f3aefa5a914e701d4aa0095493e608e4f2619448867d61b660823ea6088a82611e12260a609860be33c668e2b260aa03c602c0025d24e95d4fccf8f27e4fe3664fdbb3a8cfea7d144054f169eaf4726e7bd19845e31fffb92c4ea83d84607080c78c1cb0fc12101df18a9849985a66110196e0a65e49924e4ecd4c424f78b16c2450ab6227cab0e819951336c6d3189e9a94f9c2ed4d11cbdf196f32f0b29e9f59f9db9b48e946af7b776ab8dfb7b45225e7a29f35fb5ce64772e390ef27e907ef153efd5e453b644778f5516c544fc7cf6a8d3624ecb27185b9dbae9eed39181a0802e071288e6135866ee64a6134f064c08467f58a7798b263e04061ea7e682221c60ae0860a0204c3570d7e0497db98c253ac2925b2abf6ab6e5f9da9f9749459f491c61059602223970754890f6d870faef5ab74c2481106d93b48a2057fe4e477ac34c3be16e498c45b9f0a99f07dba796a4c0da2d1cb679e5bd0bf09c54a3706ad2b8c4397c18f46cc25e084651663ae49eaa8e74a5df504716e5bb9bb8e57ad3b292db2a0db339c974fe4992bdb5a4534d7f64f96f26c6a496452bc219b3bcc8db65c255000019d6501ca4b53119c93c95123e78c93019cc34836e38e44c32002f3129913a213031083930340848961c089f2194f60d4452b8e09c64982f494db2403cd5084c9515d0a58d14176d9d38c87eb113fffb92c4ee0218b2030acf30cf0b173fa105df19314651348309cc9e0960250e2447913e0322220d27a51e063a8d38f90d54e62030f8087ad87351a3cd33263e763f7937b28f2f7f3138aed0e7c3cc615956db2fd5b4f4607754c5b7963be33e16fe5f6f6aa6b217b9b9ee548aa4c3bdb3799dd76a5a30ec9bc94a2b466e950e7078e6e06846bba1b32001800002980c80c185203a18890af19278d2986a809982e250182503f181480d982006319c306d982400a0b011aac81c701b4a8f11152343a61114462215ac2272ec2e6e088952d690b7271e71e57560f9ec460c0b3e6b9119497e5e98394b312307254128bd6972c7a1b745fe8cc205464e9272e937c5e3d466990cd967276f4b7c7d576be876667a461a5333728d360ddb73b4ee7dfda26c94977b5cdb2fbc5137aef4f665c3147ea2f3ae8343c148bcb951fe59930c77e74c666cb9b191f633a7a7d170a7579141f00c8c4ac58f7f9b4f1f7e0c3c7dcdbf928f0e110cbd030c75798e81614c4f1400807a0294a5a5632eb116ad4cf8731e487d849b8849a524802966db1e28d70b721e4d03006d4683a42cfc44b45e12fffb92c4ee821851cf0b2ea4cdcb293fa159e499b98450452f42e4c19edd1158e4968acda8e4ae257166b6cd8cc641380ba329f7334cc98ed881f2db0511248a346a3862b5a1127627b52709279712c8a93cd29e106bd8c9c9dbd4a532d3862786b224a31240d1699aa72b660c620ba30e8823b705d177305d99478805c4177d738cd6b4178e52e34c5004c096bc08121887381b70eb1f8c511a24341b37e69cc429808163164c33f55062b174982d4e26cc373d6a1f3f69d71e74f02f3b1c8f0acc54c570a8b86a24ae3878f62b38df58f0f2b45a59addcb741f4a6c3ac75283f58a01d0d490ed51169b8e9b260aa2db588b3c461a0a4f1e0aa30b94d11c5e772aede4fd3a6acd8bb5264a0ec4d7005ae8dad3e97c5e14ae7f409e20591698340ff8022ed5ec964fd82ce6a247e230871471a5bc32b10e5b45957af663de2547eb472b5b9c64f9a30a3e339a8e40160b9e44eb0100218468e2192b094981a90598318ce18612a198668548608e982f0e998f80d3182201b8a8052c967cdd639183c3944f295ae59325d44e229a1914d28a1893453b32812d3cd2d32e10783d042a3fffb92c4ee8258960d060c74c1c321bfe125d619b90dc9a94c826d48010d421879d54746e287268f6447a41d88a499abc4a33420e4e626ae4ae0519a70754a2c6e1c7948f25cc7b63d0de55a64ee1c9e989170b591b741d0d2cb3628c06250e68f1c4b4f8ab3c9a88a03b1a4e6b7c4fb1c7f3fa491f177889995904e0c3e4c155048f9379c998339e8b5f1c7bd9fba403a25decd2a280c02b4104a63aa7e65aa587c899c67d98e6e02ba75886261400463312c7ca1da105c8d00cd05cf0f579e2e46ee3f55ed96ccd43985b5aa0fd396dc80c9d8e98f6f6d57f9c6c3c585f0b1451fd7832108060607b898ec0d828331046330bcc4858be0c00db1b825ed1e56530c608765ab0a85aec306a09052000fa9a1ec20d5293385341454139b10912f186c5c1d9c607582bda41708e418254e38a0a38e8546098a081647040d05adc15a1dc4503048e2c2e2b90214191c5d670e603430edb824a11d00a00018981294f99ac0f099790cf183d0bd98672031928837195c2c641dd1e2f8662d0824aa8f35980adfc31dc2dcb2fee6ecdf87f3e1b8412289891a46960c6845a291c4d8d87721fffb92c4ee825a220b060f24cf8b0740e119d60db92c5238fc59e48eda4749b236726a19d1eb922c883d96428a5c21107e1d807d0e4f4816492ff9e9a0ca0dad552430f45970c9aef34cb36727ce51a9a23910484c9c9c4634c6b9a7ac3a49a322d1c2b0faaca030d1713597cd45338201d8a797490462a0bc2cc993499c84442f5e3bd7a216512dd1922a85864ec8d43d5398858a4440101000cc058924ca9c200c83865cc308408c3fd048c428208c054044c1741bccd34268682bd024b8a0e0b0a57de8630150a06e59f50ab30550b580945028594a1ac93ca30a489304b0075c92f624d24810459aee433a2457dce720411f16829f0dc36b220a4ebd15274ca519a8208629ef49a6a40ab687cc6e2d5bad3ab7ae30e42cd95ff3b14cf64d16fb185ca6d14715acddaf17491b733ae9dc6230d4f2e6a107eec2d3db6afcfdec7a105c1cca8c7d864ffe9ff5cd83de2c8c5828a7007b025c8282232292730b9703d146732054633bd2e39b00e30882b30696f345978010428acd761a549ae66243e17044e1965350b71193a8d24099b309992032fb9c60a3d95549acbc908daeb1fffb92c4eb82592603060f70c78303bfa119e499a1f4246f4508a3d13933828f4965bbbf6fa2cd4c1a8fc55cbdc1806411c3cef125173289b6718629f353cc4a0eaee7c92efa53e28b37e6137aa3fe6b52c0a8d9207b095461e4ce7a9333a2f0799e3985c94e5b5f65f9d849459f646938359cebd254f69434560f4cbf99a93b6b5e36cebb16773649dd7bbd31a43c67100e6313046f4c9a6453846269f662ae366d30ba4407989c141e1816989804223b348d1913a8da826236d8328d94c90308e81187f27d6413b22301766c1163dcd48a4c0393a2d07997bb22448966a68a40e30f412c372099fb45aed02c08d81cba9dcca6a4c97630e450cb8df912910266a4638b3f362e00df0ee713d9c309aeb9c91364251b44960bd390777299653cfa7ab39d034e248d168617693f2940b0821d32e31a62615fc25e75a4b8dcebbb41de2b1ca87253e10fb0e9a024dce55fc2b10214015401c900b8084a4625248c66d823e612c2a26078872620a0e6608a05c601a2fc61722c605014300400141e5e21b861a11b30287847cf8ba3c683802879328c9151b8284a551b4844c54f32b3dafffb92c4ed0258c20908aea4cdcb0f41a115d499984448b49c20a0687024e6096ab3533dfa527872b4d347e289191c8a881c69a9441c566437101ca42b9e1a2ad282212c0e8abb23b179886f8638d3ecd8bb55e4bea638ca38822c5f2acc30a56ea0531d4f7b259b251d79b6ced0c69c8559e6712eca1ac9c9f9d47186a5352ebcdcc45a2933750830b27c9a99284900243811a9acb032f38408251d058c11818e0417ce5b4a4125f1990869c1606982409187e091d9e0898760291010c5a0e13962350808110fa014119759864304cf319307e3509379a2c8e168204658d939747a231cab4d19314a475115766e5a4ea8a5a76581a8ad41039c9a2a2959313677849831c6590a6fac99069cb4912eb10a5da56465f7db297f4f315148bc54e190fd445fce497579f5d2a48554c19944e5e9fefb76c2eb7054ae4a887542c4f6de5a9e4d73af2d8c25dd05ecd63b41a73367cc5c25682d2555100bb44c0619226a1a4a4e9bd6db18fe8e19e59f1b3a2418c0099810a59832841004209001f560402a827276e5a6925ede8d755692b24244c4c4705de3a79ed948971239920d3a484cfffb92c4ee825a660106af24cd8b00c0e115d49999466778611268cb35695ae935e79c55209324fc901eb24a5d023dfc2cad4940c83bb24e4d2248617344503c816309b473e30f416ab2c9ee27bbca2d184c869a90923a5951a8a0e94ce24412445948d11a724929af56791731cf8bc252cec71f485bee9ae2cd56b1bb25dd44a0782ab0c5937ea083809038bbb9e72881c55cacd412945e0ec90469a84048a2e6986a819c38211491a04194c1f9b0c860f8aa0898381a9be00b0f078934bd61784356a116d82d328915e649ba46888342cf5094ea092b25098e89674a6e7542a9324538278dacec9a4c174115986a0849afa1863068863d74087c166d1c04a90b6631025428261c055c1d3796858ec56934961f45861c8c887aafb060632692431544f07e5b7442aa74464c6b69d8cc4aa415ad82643fceb9683426c98173929cdf3dd48c24d4721ce82586323000004a41001070280b981b139a76489a42cf98c8679a62681bf407091ac01468ce035caa1022eaf2b8351e9610464f2769734c958471e0b437d0496463ea613205c46585c4a612465530a644eb2ab2a6e2cbae74fffb92c4eb0219ca0b062ea4cdcacec121a5d48df9f0694504f88052bdb787892e2a2368f409db5f11aef85932ef2b98cdb6db914977eb564728490c91c35747642a329aabc6a37aa3752b47194994aa3383f51229ad38c65aff6aeb9a71a4abce76f66f5861792b269aef8b0911209b1514d4d41aa21d723b9a26a9b91bcec4e1396209af788d2b6989d239a09ad53c6264f383e52660c8d526102ff50200ad497e6202f665298870a990001e8c978a4d100ccc1d038c2b180de304c0c210602abf9f90282364e5cea9ce6a16c029e9333220f8ab109870fa21530650e108293020906a0331bbef48f74ebfa7cef472051cfa67b000818773096d149d344db19caf38ac52e1451753a9fbb6ddb3ee7fe6dcf4749c732d8f6422d1b5ca05d3e9f36a65c59c96d3228664a1f9ef283d417169eb22ba535d91d93f6cbcecf16bf481907b6b95a56b6b325f1e8e6d87f67c431d8000d1e004900cb2058060081e63800c628bd674b24c60b91465064e65b8b662000028719a7e670540f4003a788554194cf4042aaeaae991269205d193898a8813224689b12a12eb887b2664f88a856afffb92c4f0821b5a05072eb12d0af53de159d499a9e15928c08d066b0b9461230153742c248b8e46ccc24b2cf0e825d34916e81c62cbd3c0037d110e649c76c1a0e42a29d2342f6eea5a9da4cfc9b3027b1526a96a7e4d120c59c51452aad4e4dfd5b5d82c147f083d0740b5a7ab334d79d4caf54ca7a9b3b722c6819b6655f828d77a0b2f2aa96c471c5d17367c6272841a3ec1444095da40908405b50a82861426470aaec69129a61a94667a11a0ecac206530c87337503230980b4527165c251732c0cb2d21218138fe40406c515a6a1964245a913f502fa398634eea70493a290ec8913a600e4d24a20129e5afd5c18e5d211f700e6e21d27fa84346579c98833c190422b58bb51cc87471b35a4c02ad9f1b0e8415587d2da5ae0bc2ad2c7fed5125c5151b7e6990c593b3d4746b69ec65dbbeebe6d769787943e51ed89e09f7fc03e2dd3dc7298d6a47cd55f3b9aab597a8131402101845201bfc201e420d982a5598e9801aee2615822083a8d864141c08200da452891109030230f090825209a0150e869600e1a2e80681542d8194d828ab08444b188a90a4034a10ac3512fffb92c4eb0219b205062ea4cdcae6412115d49999526404d69ac2716120439cf4418a225c434b35b90928a537bc0a0c681d69c24e60464090d2d328f8d29b9183a8bd7e673a9494a2f2592209ad71465a94826154c4ec2c2e54c4d37288b69a67460ea6d94d72a2d23dc26cb9dab0248811a311335334dc21851a40116927b088202ea651e42b50a344dee169663d0d2e18b3cb5252068bd87b0262aa64500298dac719b6a79980a918c46a195f6e198422140ce6159006e18be614800b55debc12463848d2e6a62a679528a21326fb736717543ee9ca4d36153933646c4af4989b21754831fa887a85dd0da49b64951c624841c0e5fa348ebd7351adb6ba48c3b1cc4e1e66e1d3d44f72099c812bed6c718dc8923b321d4a2f2e148c27d10c5a1078149b9964033b268d98ea20723730c9ee544904a790b3cb39ea66f7410b0e572c20f7e5623ae573528ac8225b49a8a0d0f1008baa4516b70755727d0b75bda40702863a90273737074c1f66001a86668f87020183204982a679ada7a0b03ca08edbf86ec366455322f271f12158f2977970c63a98df8972742dccc5bc285905fffb92c4ee035ace09042ea4cdcb1141a0c1d499b0d986a0a31621c39cdacadafd0212623470617469d3d13059b8ab331d9f779237649356e78e69344d31514995584081a5a2f442c9fb613a966ced77f5d25c9538e1250526aa196ae5b5c826aa9db5182d93710bb10ab24d0a4db5e737235e283c945eb5f2575441263195947b4d28f74d4275a6863ba425e259583df16d55d19a41f534a06329cd3692b3b6eb56c8c13491cd384cc18400530cc44cfcc33cea54c7e9330df6cdb0252e89860ca72a300d085b696c688526270459349546e11f813a4bf4e4cc2a2aa85dea3784448a63075b4a9993ef29991c469944c69043271c804a2e0c30bcb4871a2a11080c4ae6e909f04e806440909541c81f864661cc825095128e4150c3140f049a53107847351760907ee43cd6d20786880854d8949fcd4ad5a8e321274184d6e87850e884ccbb84a8638972e1ab9987e71e0be868c50030021f1203e6034426a48e869eac06101c66175de6738b60d061849587565e89091b9de86cb0220b9208d35669b93274284f933646a86604e2b148c1dd26243e59026296d185965565bc1a61fffb92c4e7025a760b040eb12d0ab3c02155c48db9e58d0a535594f50a4dc113d02028c1a2643b421669c863db2ad3085b4e7706e09ac8fcde46d424d2937659e618995e811205956892fa2faad94239daf528d2abbcfc4dbda71221f98caff75f77150b2d060e6309630b8563385abde94d54f51901cc5b598b09b928d225e6c2ea2c48f9b9d061b44e823baabc82ac2bd646dc2dbbac6b2134b1589091ee3ecf8039a210198c19669a4c82fa062e371998c20b2d92800c0664380984980ed46d4e25036211c0ca2160da64d238271d649d343202e4791c7419dcc92082d066b9145352a50cd3f7524ed188b4abd79baa779da0e59ec63dbc2bdd72fe6dcdbab483226ddf6df9fefc3169ee3c7aec51c9565778ecfb2562a4d79de714b6ceb696a4adca7fcdf086e3b378b92f274b75aa98a738c9986e520d96feaee669a5d8bcc8eff722114fdb1cbfcda24040a69500002179001604b746230b872e980677a566279386464246848601010980e309a162d0181f66101fc9e51763318b75dba4a5d469cb541909090e48ca561c170d101644a8e4e158f22d664cc713d7cbe7cf12fffb92c4ed025b0a0d04aef12682bc3ea159c499a1d0e18d7be77d016f8eeb02258a8965b4963ca5905d3f5ee726ba7abbaed9f490aed72397adfadff955cef4af5bd545a5974d0e9b8432be90e85d6cb3cde0acb9cdb206ee199661a7000e7b35062ea0e8c33499c0498c3d91391e7a4a69263dc8bc9e6294749243c01a27052568426ee6c24867de8029c8d98b248c985614e98205a0488d0d898b83360e84418054a592316428cfc3e3afa18c6a51300f28cbc240400400513691192e51c99acf993f3548df4f6257060ea532784fb61f19617ecfbf246d075418704069455b809271a65e5ca653953b485ecf8ee67998aca22954461cfebe7d4d27931acac733667e31d38cc919edae0a3eaace716f8515f364aeebc2e357754667bed976e794d0b6f9146e341ae6238ef69f9f91df79eed312857f4b366fa318d3137b8f2f7aa44b2ee2e7337f373af6718f09002e00009a89d861ac8063ab167391a46530e66889e46e301061e80620188d5412cc0c0113ada0ca987d83a0738ba5d372d1a924f07d3df391214959240b84f31259c072413b387c1c36cae6e64b655a2ab3d9fffb92c4ef825ba60b072eb0d3c2bbc0e159c499a14a485513bc69815cdb2a37486db0dcca92a7064cb3a854e927cbe3050ea064bafed23e8cd41857068f3084a1ae206b60d2e46e6e84a847c9576283169152489ad2ef44bc78ad0469121cd25c7e23c744846193dd64103c8d320d8f64bb7739a18662aa19e817a1c4d6e487e587979a6ddc225e5279876aa5965ecaaa30ab264f1a7d9f365a957a78a149c5b8c101321ecaa02d2d15571080146455c1b0b0068c8798a0f467fe99bf83e62101182cc06d91b981c00a6ae952eae4e4c96938e0ad6d4d599132a11c50d01e860b09561b92305358e5be2037c3b23b64d32f0380dcd84fb19ea666c89c418fa5af5224b78cc3c63acdde9859334fb5c629ca68a7cd393a0d486310628b4f1bb75b9e796ee799121f6317592f5e19a591d41a60c2eb409140939ba66b446db1d09865c380af087b3d8fda02c4e30c6e5d668a32fdba0fa8e9381c6e120e70d3cb39726d968eca4ce4d382ca20157a6e986cbe750629efc6c0255196bbe6451298080023159b84589f6da3bd201b3e4502842c413e891cf49ecd49847f97e898b448d8fffb92c4f0025d0a0d02ceb12d4b01c060c1c499a984da25270f4f14a357c1f7239f72c253603145169e4bbd4ccc0b7a8515a6a08a90d456fbb45ef39987c33bc2ad526b7b93d54f5b70e71a535cb1a8eafbdcad7f3b61873d3c171b152caa4eec572e7994479035d728a1ad8578b7828af0c647772cbe763c37c78d861e52eddccbd97e62e4d2aab271e97baa30f832cc405816ada10411181816617909af48a6cc6108d0267c469bdc06503130213ccfc26040058140b2c83abd2c35179f95a8493a242d6078981b4c664985c38f72e0d970a2e40320e13118ac4e0e0641334dc22896b46cb8c5db059b26c1967532e215c4f4a32c88531f4c98d8b99029434a246f54321041b0c7464b3164da4d40718522dc28afa1d3762aad22053aed83841e25e1b3ac84e4bc63278c20b6864daba6ff4ddd86975fb85569c7a912da492769452746aef18a24d56b391c8976ded13b7a690db49b169b79a335d6a9736464356a5e29a261aad9c50fc77e5e841e4c558e36e879e1301088df03d4290cf59a2475f312aa981a2d2d2c20a593f2c155acc9a03a18e660120a3cd2489c4a886448fffb92c4e202169a03082e24cd8b3e3fe125c49a396e4c06b0e0603d2d901b3c106de402f3bf426c9da618e937ca45e143d12622cf36c22a821d5cdf5b299e597048824e7f7c735a9f62c0926b244b4e47c90997b30db3934c3f83a5b72ac4ca387810a1e88552ddce0e7c14b2617b007889b26250c757ab429ab020b21378841b728c7d54d0413e776183a4113c2ab513dcbf44e831e5115938533cc4823cdd91ccde51ccc0b2d8c438a0c580b899518fd07e6f8085373d6652c5a81c81e1e6c945133c6620b1565cca1421b3f151564c2e615724a8a0a9f491ba2a4d55256a3bda685cbad70550513a192ee62ce8d7a4089ec4963106e9235519d5a05231f54a465cb4aa04afc5f1de69dca6db92627443392134ee875340349a042d471b5519892f4688c894993e6c4b1d60de2558a5b886e8fb7b4aa3609a1afb257d22efb6d19a34f5cf42446e9c5a86aacce309b3733b0496a8e176d99a4cb2b1437249162292062b75a7239d2200ac6550c6bacc67f6463620686c41f889f601113cf3016028ac4a68e30a449162f501de77a713902f713a81c8413409626b73d406e69d88fffb92c4e603d85a07060e30cb4b3fc1a081dd24d0d103725acc7409da5de56e6c18416295779632cc6a36dcc2dd23fc51e48a8d44e2f224eaa35328e431592fe4c462b0f524f2ad6bb45044e298bb6f66e45c3b9ab8743a2626d6f39126526f8628d7f9cd5943ddbd3d1b7d91b6ccca41cd272db4527b10d25b5620f65a6a37ceb3652d1410e69f0c6248bb12ca1f4f60b600c9ce13f00b4c6093323eacdac1d451001a4cc4764459e964c4bedd2437044aabf5fcdcf8f181854522b2c8cf351b6dee9e326ce1a5c3d1489555d3d26242347931a7a56aabb3d5911e2ee407a6590bda4deb2065ce7b2c21456ddd91c3cc62692894987bacfb1ea0b1c160f0746dae1f12c28b37445280f05498811225d2a4446a61e70c325039e9f2b18d97ce8932fc60482a0e897758931862cb4162ce357605681c50f16ad8475d8b2cf0a5162fca6402058315aeaa00a27932052745d8b18015916a2fd1691f8940690028c3ef2345c40dcab930208409a333087d881820286d6108f0161158edf42c832ed3095c1ab5913a5245126131060310401af34f4543d4b9536c6921984e926cbd32c2fffb92c4e303d63a070807ecc14b39416081c49a78a7db4114e88bb8acb10649f142f6bc525facab5282c5dcbaf1eb368dccdb4b4e29e410218a6766a204f2059cfd694b92edb3966e481442dda52b7369651569684d49a5e9673902d06d45189460aef6f32f5369456d46364bc06d55ae0e4934592558c2b35a38c3dfe9f067c0e2256d28175188e3f2ed2451b85268b6d2c524282a50da987c8c780469c7d3c60f281998966f100a1f084a865732b9c19501d0f1aa6ac1f1872acc4903ee06cf2860b01120938f80512046051ed8e48cc3ee0691b19656661c2b50383c269774ba2941a52525af7e70a2e0b442e200b7bc399cc483931fa9a91392e0644f0d089e4c8661cef2c5d11abcc2451b2a20be8206aa258ec2f0ae410645251feffd6582492d431b0e9d2724ba50696c6b5b276375457d20a288954cad5932ba05bc9ba6cbf3d329ce453a0f235a06a1ea545ef9110871345eaa003802038b2a6415899a4f274a2605440654a41a6c1cf698140a06c50702c90e8c152123657589cb0b4911a58741023559d1546d0346ad1b8aa1432c480eb49634c1aa3ce83190036129fffb90c4e982d8ba0b060e192bcb09c1a0d5c499609238591856f4031b169cca57749a8e51d9cc0ac7f041222c9bad8e8960bbde48e39373c991d5207d2e3189815e9489cec4b4b2572564d33155c5dbe1b76b318198818b3ed7103d18bda1de8ecf64350852d5050519b244f51fba4b9b3888c22bd373b9fd1b4124f970b6ad6dcf2bc3081f89bf1db4914c63261f40bb8b2cb13b36c368c88c106094c2b743290888006284b32b129acc3d159ec69ad22f7b2e66b9b39b517b4c860acac745c4cbe02a8342dbab5db33d779c318ecdd8f59828e6b0f285a6a7679977eece49d3705e20fae8b2220bb4cd379c3b52c23860ad4693d9b7729a4e4330959ea6b3748ad98f9520701cc3b9b87e9845c08d3cf1ae6ec722f7f4cd02295a9b59a04fd5575fa42c96dfbc2b0b0babbb85c1e8153149831ad31db10472ea34b48d4fd094503102acc6db8a0386aa2af00cd086e91113351e40ca4c5d1b37dc4cfc63c20029a3d201e240706c0006077b41c0465ef260221c2e64545448180ce82ca32e45870511263ee19648d92091d80bd232c71a3b39132a656b07d336724e00f0718afffb92c4eb02587e0906ae24cbcb1340e0c9c619f90e5b288408aac99b3705d12a658388ec561fb5c880e228b2403e4e89668d244c8e64a4ac9d778870dc1614ab3950fa7ae6cf9dd4128b6d97bc6ce0a932563d71d28c24b596563b3924be98832acd24dc9d2e92a2a9aee489f49bb1a9b3d226aaeeedbf73147a1c692a64bc23d2a609d57313962443162b6a2cb76b30e8b860d2385a4b9022369512d97234cfa7a0b422dcdd630a073912c3805c020a18ed981ae52487470c843de242819a99036588c9d95a8c288ca4d32511b6caf34fb2dfcc49a51ef920b568eb1e0ebb5065bc04a14001021616b8a88130687c8b11dd8a2e63adb083f0f2a505b78c4c43ba87714614399394ea933d1c81b2892ab42fd19ddeee434ba1f21aac261624914430856e2c2d4ca1a2be887d4508144bb9006a8f166ac4521b1e45bb90ce9ed2e0c39aa492003402a41c0032ae03501f38e27cbae62ac698bc3aa5098e6bb0229312d100400ca16e0d8f085881a04c56198854151336884e10b7a14e085e8c802eba146404c44613a597d9b3192182344ca2b6d414552144885e153406264b4662fffb92c4ed025b4e0f020c7121428d3fa1a5b48d797261e526b23a17b3ee51021627da8324935ce63109a480d31680a6d39b5956e4b0fc114a0e7f49a25949d14d64f3d490b5a888164d145cda26533ec2ed4ef0da68a0551a5879555b93ebcdf19b136505f618f4a9254a946934f5e9a64689611193d07de4d1948ea067204b2694328958a4ad310d219a3d9eab92c00a2eb1846fe376930e823f30c89cca4730cb18f020082f30d049455dea18613b94e52faba26938544d68d8baa8c46e3f1cfbad7b2c1e22c337b090a7d7b553aadcf30b94890e5c69602c71afa320394bc353458beb5a0bc4a3268eb72479b8eb430b394a1e64da09d687108ec169ae52a4b0fd34896a2a6cce787f2237d21490c449bd7be591cd3c4477946f17589ba549f26182b4f983cf39cad28e41fcb91b89df944074b9815cc539bd09ec6a249f5e59958e95f2d933a95659b41ded3b4113750028017190d0c32ce39802c28b42e218b2306a7022b92e01ce04a448241503c4184241c56141d722261d1123425254212b823149313b6883c3c69b272f0d46b3cd1249bd36c8915899466d8a7ce2f5a4fffb92c4f4835ac60b04adf122cb0940a0c9c619b96234439d2c59424d7c6b164f4568e728411b4b496d566dc45368d09f6a468fa928e4948266ce2f53510e4616e041a2073551dd55a6304b8d11536a348d1310a852174e2bc08755657b7c26e60cc99d28867b8c256b1314af38aca96d92169bd6d8e46b3dee1dc71aa5626944f1154e139455229611ad35b506b31ee793a25e29cbad18310a488a462c359c686e61a20184e6061a080f00c42261087e1e01d30fea258424869768aa15edb12d45b232744590ce28e8fa558312a284f33b68a25123d841d2b1f04a4c59cc993d4af4fa8f498a6926c7bea568cf51a817665a499bb892874da30c595a9e922132413939221ce042aa510d4c969008d62506954f0a72536a311582f71148e589441d16ed0801a8a888745f126d3f698d5f708934e8b492246212a33d1ac6a979f928b2cb7edb768dbde9aa4ab95a422ca9393a6db5ce44461260fc26c1b87bf021c1c67ad4035c4e357e70a0c9242c090a5b4442b05cd2ed51e426ca858f8d4d803d824e1b8e5696e690942d25912329e6679597c32860d379a6582b35690e107869fffb92c4ee825a520d04ae6d2642f9c120c1c499790c0662521355195645481868ed269a081c610a9df88086e392deab9f04e89ed85751e3db205da68feb69ae84c3106cd54148aaf6d7234b4e527346369c8aa0dc5ef74da351b82c92ec4d259469223660da9af74ded6dbda14a047358d172282071ba356853ad4d0f5349e251a8288db2e731551229d1eadd1a4467f2edf13e4e70f1961f2503302bf34aaf39f78119e991e59b900b5818a40b55810934446941ec3ae4f8b2e5ce132046f30db0a130d24e204898d363c3abe08d7015545f66b0a101554d118a0e2cacf08143e4f4de1392456d86ce0bcb28ac10205352418ab36fb6a2b365a65d3517658dc6d8ba6e6d66369dc197453a6d15c676a77a72556d6e4b15beebf7084a2e5dd1822af286223b93373c9a536ae3030e9c59f9bf7ab771622d75a49cfbe08f45f372f6f2a71eaf259af2dad9b231aaebb79ed85c7355617a41092a08ea50010138e604f67ba387dc34023514fd31b0961860002459aaf63f9505dd4edc9143175b2c096a8e53284ac42f7248d089ad1e9ed4a5a5f7a1448eae5979bb257523a66267befffb92c4ec8359b205040ded22cb0b4160c9bca4c91bb90dcad6790685c0c4b4485e5550657c81640cafe8d57fb098ab559d3203285f1c42cdf27c95cb3486e189ba4aa63d3214c6f64c93c62150f9183b729f9863d924cb245a19e5223b27e52074f53273f9c7838b299214b65a486e81be62435173701e8bb74809383dce0e452d97c35063894a41c813bc41234d0b42d0ea27a56a40a9f17d43208a0ce8c9090cf92840e2012a33a3d090f650423c608532188a90232e4a40acccb68ca09e54a5a82a2a0b9b8c2c898e2888f05ca48ed59f653a702112cfe52cd67b39cf309d907073e5e314bc4e40cdc2f50366c982c28d4cacac1c5ad0fcca1a0a4e4835520636a68f441144fa4ef147ca1e67482a0643f5a3350a23278cc208b35abe20f0665f92ae5df25e9a6f98d2b519cb975ce6422fb88ea646f53366af0c336c694520e0a8ce6237b05958f234b3866289e231071174d5404ac1021946f7299c2460344231e360ce6088611e8ce6054e32fae4b71d4b5e3416892578ce8b87aa1754785555d54b42eaff5c89d6fb8c2b55835efcc1d012b311674829884a5b078c1010fffb92c4ea8059ca0906cdb0d1cae7c160c5b49968d87aa482a917e349e00fc101d6693be3adb640895207a48133a8675518923944d1b893107a8276787d002596927448987a093892914930651b01a988a3261af8cb4a048e667d1896a17a608d459344d37a0d0915d520f0040b64e520a31cb5f9302041af548a2145c8d369c417bba6a6bd26692559f63154b3f99483ab0d01390c06c8e2188ea938c288cc6ff0cc811658e93814a22f2ebd3e84241f092464a21b8493bb403b3d4517da9c1e150c91884bdaa9cc066477fca8c32b49c862a100ba344457259fa727995008cab7c1801d0ac2187b54980672210f40c91a5020716a5e9a0a985a2493797932e3a0660a39aa132903cd2903a19d1f708dc92ce1acfb03744d17a9a0705112a810262b58a4073492a51a5c5e03e9586b986a29c56150d9b79b7e5044f3feb2ced22fc5b1f6a3d004c6d4c34902886968a74b5d9e91f6364d43b9adbcc945404b46319643884339263011c1a39a0786239a429ec00c505660b69309c54a6ab35099219d23214636bc0c30482c23a07def6c4ece368996966622aabb3a820c238a13e8fffb92c4ec8258f20b040e30cb8335412099b619b85bb8c5e809a1344c450b1e78bf2a6d65a0d63493ca2f68604ee4513a5884e5a3a49951b81df277a2360ba1368d5b2375492c5503bccdebaa9561ba666d41778d218d7675049364c6d20b275db6f0cb0b2e735149a32418b93496652492262abf4452105f1556e58dec60ac0d6a1c649d47ce3159cb2d120e83487b05209238dd7458c21c4fd2daa419bbf2622a255663d70d30b0a317a5348015744a1c140953a94c6ae32f3079645090fae2828da4a105c12ed66e46e988f36cc082cf0e393602923b446ca892f714934cfce74a2b2444e22f544cfce7999326eb931308fa4ae10316c2e211f367275426d882312bce44aebecbe408d229b059a939b86ac8a0d0f03b636b189434136640a5c2189f6f833daa0f533bd14b5a8954b882d169bde44bcc3f7311774f010bc1970b2d2ae619f60d2b7091d0b7363907e6946074f39b4a47c4df00e49f25398c4c0e8a98421663103a7623d073bd9bafdbb102a4470120a85546132a0924570f210254549c2e6722d9d74136919b3654e5239b2dae8da0f942b03cda81f5c9d62a51fffb92c4e883d98a0d040de92642e4c1a0c1b499b82c2f43b66a41b9e10c92656ed912324465a0e82c0918711b4c26aa8b2055c8717dd6e1abb976cc644ca048b9648866569f5dae9cd52d44922b8dda04d77af86690a48d54e5e2c24f728c924a958cdb60ccb49d32664a22ee0fa2497ca6276934d9021db3c81146b070bb104055555ea223ebb465c81e44ba99a2ba38e6576a4221e8d24a10a77842a48b2118920fa8a4293939ce0e96a4c48a44a9d8a10009709e93e558c7cf028c3cf0958661036f33343d0cf47a295338f6357295936562ce35a8eab0214f48c5b44129354c669770cc522531cbeec06f6baa4a26886259db292c4b31532797b36fa7ed99e0c789c329a4c2a4cd4a9ad6a6381a59de1e79a12c62ab13c8738e2ea5ca4e5eb32cd4a2eca7b48af2da4709c1714f0434f67f8f630b55d1d64b409d1cc325ae2aca6779ec5c4902a4fd625675d50350d9cc996428ec75ac660e1c645846de009825fd0cb571671e2878c13a837360342c14404220141d48f41aa470811c933e85612b122c3af4e44e70c345665a56424eb90344123261e60480b24a11d1b20c7efffb92c4ec03dade0b020df124cab6412101b4997014689a49a9254990d20911bceb3a895911aaa9726373454d81252cc30c530d952ca3ee0ec275d3c6958a36d24dad318a51b6a1b8c54b4e40fbd14d45904d3a65b5745326d86662360951ebcb1e1552d4f5d0b1b05d4759b89f428165d6aa82cdb6aa855f49951d61522a5a718a35258f6c98dd6bb93da908d1290eb249d226f3c4178402e009a8610cc72f066e6c03a1405d6308047d89408c080e508cecf8809d86cd50133b07b2711552a18c9d2b42f9b6bd46c8524cee168e98ad6d42c754c64fad3823790ca51a3a892202144ed7462d325fb49b0b39aa6a98de5cc9e561b0a3d15d16b91a3a32aa230883f379bdc827175a13f334da6731bbe4dd8416ae086063126d03d268dfa4708c91acb238a32abec882689ad9bda6f18447d1664673b6faf67982255963c23320526937329d01b9206a391f68a898e36814a75535d950f25a44c14559aad8b048a2edb6087403b290838e86266852382c0a62e543d28a4d990b25434790c1a213b5174c032cca93791884bed12e9563519ce70b2a42027b1816708c93a4b3889f23fffb92c4f0035ab60b02086d214b3140a085b6256948c63cba55a8da145a3881aea2cc0f67d262139b24796f29efa839d0686765427917a549ca644f59eb7011c7b618d48d5a573acfb3aaf199fea7da509bc92a8ba34e99840ede821b1d1c0f7b066de15ced320833956e996cc974d1b5655f9b692dfdd99afad132556ddfdb7762a1a2fe5277e0dd20201d7518cd10786999b39694c7e7cd98062a421a622296c3ab2cb29223889740a0e1f6de423ae3da2c4a5f583bb8996074b8aaba059c5d8159088508515738481e176181fe2b242c7d65539e33a4e6cba6649e2a08deb9a8b6d8684670ba58803ee844b209a33817383cb740c1736c9874542a5e1059b1a4d93ddb327211448ed246ebf45cc5ce119488d451a465c9584cd90abaa2cda02b33649a8c9575047a236c90b4d64ca9d61f32a6a071053314749102e9dc59b8232382ac3465254cd3328fc5526648135136024d2c554635e86c89368a2e8a92b9b4d6b73a676ff980850f1b9cc932818825c0c07154c5263490e16e31ec1f9b1a6b43047c646789b1c4b53365e5b1b1669874c9f3e8d7624dfcea1e6fa149e4c2fffb92c4e58056420d08ada4cb837241a045b625705ed82122bae5c34b97819d1231d51092782668c8459752ddb3cf4566a2662153480765b3ed13279a89d3041adca90ceb53187bad2f21b21c524448a4edbb57d91d26bbab3c02b227124e0f64b501a7a7ed9ccc97d1659aed0edd68965958cb489b92c03dc4082526c23073b186690a23478e7c4ca51bea4f55e1500c852150730f773ea133ba4051a32e4f12df754441462023152be83693a302a0f67a7e39a93b3e0b8c0964526ba64c3056116336a4df426668130cf20c50a965e20b1325371b360d235f944881be1a713b5a99193b040a3c650c62b1020400caa65346b981120d429952ed36e42ba325d271a149128acdeb90a4c5ac5c3a71461b2cb200f451350103894ac0b1f20e2c4e864d205970a1c54a2e86f508e20278e139b7134ce13a17d1392e591a68e475e4c4562bf23aa1b3eba25290b0b309296f1960eac7898872092ac13b2804a6b92a9031659126ecc34f24a14228d9d0aaeb29d29295401afb5320d66a499ae673c62ae0d62bcc480cae0fd9b5a36283b8604ba7a0c9c28c318caeacc8e85cc2ab3d08fffb92c4e483d6fe09060db0cdcb8e416001b62569a243b103e9b34696eb29776827bce6224934891a84c05353924ea481e774923836ea0cc5b1c8e4441e26491a740b366050f830cd814542a20fc3bd9ea590708d693a7139268045b5d7747bd9db885acfa84397127279885a6e559f74b7374db8ca067c48df87a14c9c739d3a8e5e61886e015d6a8c57cb2adcc564336f288324bd68dc834153067c45005d8946045d3194a13375633018e2e430b2507311048b34bc72a9f1d1a864e3aa49e0d0b4c890ace0660c84403c1285a6ed61d9075a59a23166eb0f9c8183f7d15a749a98dae4ca06c8492c9dfd160e2725d62498b220344153a7d7b54757a3504cabcc6768d2eb102706b75ec37294e72c8aad2cda49a1555946d68ec9c4133c9a8ab28b1054d543340fbb4976489745ecca8fc2ef5a6bde196db5d0ac71695f493449a8703c1a6daf69ad8dc218b4fa07c539ab343792520ba7b04e2d31b68d4de6b11a71c734ba7bed0469f2522a6200044a65901ac3b680002ea622cfc18251361d6e21c449a9eb5c9ccb513bbbdf2ef732cab299b612115906371c61d6751af479fffb92c4dd00166603062d24cb8b4e41a099b6257899263c8c9d372906f3c9363631b56507ad7972bb619a9b3932144abd7b339ba608d8825261536abe56814cba61a410d32325b851091bc2a340868856b3183308c6b02a6d4b49273442f330c68cc92c6ed189df7d1b8b48f28f5f20ccd59f8529d75a3d712841a9ea0f682e68ee243edb8e12819eaf0042c1c5ac1bc0da120c2dcca1d69125020759408a7e21ab84427426e381c28725a3e33312da2407c8102f3f287d7606b248c43cc1893c8530a1707c8a94571225854460586511224bb481b0388d91d0a1861023402ba0a6c6110aa1247b6d30b60d262b284eb22796742deca0d61740e9a350a69d622a36a4169aac1731b35de749881692c8d85201656cc466bf2a88711b69204d4ba1832da861834d4f9db51a513c69ccb46cb10a035c77d8c3240c83d949dc51a84f11492b8da3b68ab7419f272c80b4461651e7d22d979af252d697c34bd06b502b7d0048037ac2072d09983a25cb5e04ea100ed2ca072f9752c9e29f852c88d03029252a1326c0f4d93e1a9acd1d1a328513aea7d0cdb58c636da054571553ce5625fffb92c4e002147de10d2ca473cb6f412055b625686046311df8412822e6a38cb123cf9c2394ed2c467755898119a4cd28fc4ad057e95c6e5104b453b95ed0eba7670032c83dea289ac203be9973b926137d89649a50a44532b570ad20e7c96c63381f6039e7143618ba3512aea9938fc8798c1f3c270eea7da2ba7ac76908a413a4301f41f0fe7411c1899130a42d887588b5604c832e8cd8b82a03320646c1b4c5b22459a5da943898d151598d50d70588be5981c1f5c59a681d52436365c94844890a70f16159d0299329b24a65582343a89076d46cbb028b5b573a9c34577a208b7124930ac175d5e5526746a691844d621e01c7c104952070244900744f4899a046934c0cd4a5241395a517d04d5a6d33a1f83032777a3285206d920241038a28ab694e96b21a3b96ee4d2c4b6d5ad86329edeb00839c22d5a3a9029408e44b30e92d4683c63990b69bc230480fa2838c229b5e18a922b4754ca68061a3674c6c36a85d030c80074939887126548fa5a95c383d1ca85865697521d2755cda1193572c9b9044a3b2aa27d66980eaa399271c63081edb96222826a203c23478b1fffb92c4e68257520906ad24cfcb2d416095a49a381a021a3f012b02750f9889c0b3281049b488d61010c0a99670b2be10140a6294f7142212431289612af6b3db7c4e91ccda84cc8ae6d9f48aa776a2e8c2066da031688f206dc4aa402e624da0c36c970f0ad415b04cd91943afd1e32866cc276a61c18993a6e643eda88c40c15d3c5110eb2ce49b68b34c9d5d533db2dac2191c1050c3da081adb223a9a13ab978140d1345a4524e1693512674114a065850bb930c1cc8a17685692b64bdba234cfd3e751b7175d069659725112f180c1e58a11250485b1eb38e39eab5da6912b538206103e030f6cd4ba0e774c743cc161b987c7ab4f7fa38acc6b883488ec24aaa5d9330d74191d3132ab24f99abc61e6f7cc292399cc1a107749f4861d571dd222824cb6e4670fe92661de7547f88d5e1c85247f8b52bbf73d348d3715d21b3076a3115de4a4ed7795198c69e5c01ba66f2b1cc77f18ff9f08cc9a18d20470aa00db458ab640d28eb8e9a30a608a83f6d68ac4bd537bb74d3f72964576989f44e67017de325a888418be380c59e6d52781b69854d3c92da98fd3ef370ccad3fffb92c4ea025c220b000db12b8ac2c06115a499b9741dab174a7af2e450eb0b9536bbab2c3289a75e1dda3c203589fb051eb256e4d8bf564dd56f082a1a51de515856c209d997c7df2bb35b0f291430e2bd6a933f0ad7353336e64a4962840a2505e42455b62065a19528f2daa3189968a355852091b329742dcc9ccd61ff494239fb7ad2f5d29e56964d29452f27b186ae894210c80003aaed1825e17427a8e23e9858e1955de6e2624148a197febd8a6bd72237e935d8c5b84dac2a46c2e98c8882080eb0f2127497168c185841ab1746c2130ac12554b6de464f2693661cd92308d230590e0a514d112144a1d945d04d738a2f08ea42d07a37448ef3e10c994cb343074e11d34aecd646e49b4dc650775758f4d5721059bc295a236080a92cb053ac1b07c05521a596e8986000b4d7a84b9e56804c4124d63cbc5207ae9bb5c0e9a40e7a4cc23c9c306a7c6ee8c1870c38bc7c84479ec7234e79c4834995d9ea00105b68e01d8731100f518ca66a8a7eb9e42faacd99ad72be76355f1a3c6274b8d4b8d3e335a142b0b1d476c9f21662809e64a86f82e16bd152e4c5041044c1fffb92c4e78218320b06cd30d1cb3340a099a49ab93120ab0918559f2f08d249271debb00e931e221872a24102d3e4d2b36b5b64b0688df254f2ac1e1f736e8208d77a48979475334cd2b7fa591554cfdca7ab6ccd2253ed31e81cc24e86a5b5a05c3e4c45b15ddf765a9ef1afe47931bb6eff929d3a9516dafb1f5ca83f6d4cd2f76c8b3da65ecba14834f28b1336c0dd58701241881c27387839904e518e26cc1a4b5d88d2d76c4a3c3a3fa282b640789d6bcb562f25a7394866d38584a1a89cba07a029c2cb28bdec39239147633104c4c227234824c342911085c48e0f87a28c9b0bd994e29148715c771a4e48a2da8ff269b2e710ce249f0f986d8a6cbe4105e9d39420569582333ea2890aebd0a6499835899f5119a6a26d1cd191cda566689230511c8fa013b972d19ad6da37aa81970dc4e29d5959e2215ad4c4c91a8b64afa2eae5e9944caf18c1f26d98cdb5ad117349ce2b2e8196ccc5849e9b49b647a9a261ec559b87057e10b669251204483d56740fbbb226348c910121c2102884b2ae9aec0790f28a451b7589195db8ff040c90091977dc5bed146b13d7983cb2fffb92c4e6801736030b2ca4d58b6041a045a625b8ed779ac9394840d4620a684ed294114b6318ec31ad0e86be18ba9a250b2456a164f1b4aa15ce51820a094273f8127d4a685529dd2dc1ec464c7bf8ef85c67a6922e20820049d5f4a91fb91a4ca51d751705142c797a962294532c8a2e7d0fb24048ec169325ed69a1e58b2592dfc3b9c7ceb1ca6862a049f01346e647113af011da5f0edc4d8fdd141b0745229b93688f06c2e2324190697356d2119204616328cf11b47da4475ecb6a5b5d12aeb9a16d321262f08ec94554ed1c7a08267ad1eb6423054c1cf2a4cd345350930a7689c80fec9626a69b71a4533921d305092cd13cd06121988ec4c1a524912a12c48d122a245b226c52f211506089323530e9d42244515533e65233350985e38c08eb55490914188d9449380a6447ac20b5d2a8d22bb4f54226cb1b69cd3e116d69c156c70573c467f4b0ad245db4d6c70789ed7ec4db55120432841442d62800460a870847019a578b520b90352362b028c15d5150ac1c9c69eab78a2d50eceaaf9814d188531231869a2e697a15b4ca8c0894cf247bb14963087c9a36835cdfffb92c4e403d60605060ca4cbcb5a41e0419d2458ac945015666c955c3f264fa4557920394a2c9a149ab9ae790286dcd5122e9b586bce29531ad363cd29142e404087ff574ac8b3e5906a5ae13cac960ddc513a5242b5c6685e5b1e310d9916411b0ba345e6934562bbdccd2337a8b5a6c9d32e429b2ca16cbccb6b641dcb296caed2a8a2b198b7ee904760ae1f5e15294232469c97c99d8422ba4c5823b914e3b116f96ea642eb22894320c095547160f932e9356380b236e989304a071da6941c13440826b45c8ac2c1c9a400b498e491269b92d921695a12551741ea40caf2e9ea25d8135236f093a7d90e7a4bc33709b36c9e8a90e67c34d68eead6276d657775a7b2f86d94c9bce4e611731cf7cecb6731b5057b9bf99acf4bb5639aa9a297851a7a640ef8d328b9052f4e92ca043ff9999689de5526d531d8e6b1a5b9572f45976cc9d2d3156391b147a2d607cca6a8827b0f7c57305e0d0d0f4b27a823c2954847fc9178e8068ece17974d008e714ef730850422c235c1f6c60486550d2e9983e44518588c4ea1991e51c830cc4ba1428c982886d391c2c7162055423213fffb92c4e702591e09042cb12782ae4021158498e921571f82e2a991c1932933915112da563470a2c7c9973aa324a42cd9080b82623120c7273634548e4b8ba26e63a33836a50514845128133aaa2549d136c50ec139a6ba44884f30c26b901e8f525acaaa2a883a8e1a462b71002c55442bd4d73cb2a53a446c198f4890e69bd71fa54cb96d25ed13878f398362d87cf156d9175e44caacac250900a06c4d7886fe6d4c582851adc7a81cf8604042dd2b8745112430c868bc03e48552710fa200f1e4c22079b079c5c89b0f30893689163085916235d6610e41a61776b338202a9a1304ed214103f217474d5b54aacada9ad92a6e49a9e3dcda0f0b34f8b534f62cdf4fa4f47094d37d6cd45f0bc8e2174904e12570db731532ec36da536a1d5510b28583cd205cdc544b2dce69e8df65db402749c46896444aabd9c60adaea104d11a5ae0b5a936884851a715f60b4a4cc9995ea1698b95abfa095a39a538a8aa7c0058c3d02241090e609705a8512b32fa4ab6e97b2f8172b17e19d21431406dcb2cb422268e94206e489a42d079f13acfc4e074a2734ed5a25dbb611f6c9a4b3fffb92c4f3025bc20b000d31294b2640a0999c2459d29cdaa538cb865d07dde6ecfc91b1ae83f6591381eb6e4b9b59141375949a7fd0be81a91a7b2656ca1891d7c974659e4659c73da61f27a720a452cc65276049e86376c820676d8772e352bb27269510e8f17a5d04bee7a836f68f8353ded55947ee484b41a28cb6fa2998b6aa9b45f1712a4aa68329040f8449c0601f8218ca612e842303bc471d44a02b01bb4593a601b192df6022f149308cacd6018a157060509129944c8d4172b14099a4c9d34d0d82880e13159d2488999056d255161c7c4464246465539bc2a2736809e58855650caad03058c8fa16dcb2c546484cc9c464594271f5d9ad3e46262d0ec91b9b622639741224324525ada98914b9698151321140a542028a96cd3ed1683320fc1616b4d62eb1824275dd86da9f2b25d23e162a8fb09e391a33cb02c847d12182325895490756d9560648543e84ab4cb2294684813663ca37ecb2cca5924cf1e4a9017f82db7204620ba07077cbec3c0b73e46d24c68442c7904e544d323371549e4e272647389a05db452254cc118a3c4c3b89a3e5440f6966b2300651fffb92c4e583d6420b060c24d1cb7341e001a62558e83a272b010803425dee4ed5991492d02f6e098162b7db317268d96d2c995cc8af4aef724f7550cec56212fdf262352f0ab64fbae1f7c25ebdd20c53d4674dea55150e5ff27ed5fc8b6cb6c78578d59771929d9d6a9a9c97a757b23a7e35d641cf2aaef2d7fcec5190f258e0281c8ccb580e745b935b0aa31e3b59908d02ae6e242f4061b0e9f1c8a64e5c3a98bc6a228013590a0a0d08d0064e08094f365145942648819686048608dbb45e83a454254c7d1a9340e2d46d53c6c688e08a42b15c4ec09c342b14db3737f42f616264e4a932a42912948b48644248f58c2308526f10bcda129b6dd68d2884a2b0502040b9278e2136bb7ed82079b6155f48a00c6c4a93c28c90419339162057c0e302349b239d25150bb306e13916a274fac940f364273a6dc95662866861354b1a872555955c9d1a7a3d28f458696d2adce71bf4a2214a4598e8a9e5bb338a704455c3e623eac2d182a5833434e6866b1498a4318b4a6e9a9d86c9c8871c9ca993918bd8205cf58bc1955349edc0c0a50c5074e0ac1a72c81369fb24d4d2d875fffb92c4e48254d9ff0aac24c9cb62c16055a625595a21555d5e4a3ee3f10c0da2275c9903288bcc8c9534ea2a152eb5dcd8199a929a4dba6288b482507c9560f7d520c373826c5bd37c18851c1432b9d7cb5fada6de4e2a44b215eb357a4d05d3678e49482158f5649582c8553aa2e7d26a946da413aea4cf630520d26dc87d884507722c4e6892bd48c32aad1729d690a8cbf23149680dc25c811061c1980a95055c6a058a81b60de061955b055e444691834daaa84cc21091e984b82031c4ce7d36ca4da90b5844d03ac28272a90e493604358658181d0c48e3705c243cb630d1336d266d930e2c9a66a69eaa98894b1869e498614ec40d4b030e49141c922af0414047fc012f5d6475017972ee587268933c51172ccac6442b020632920759846c81c19c164c3356490353cf66249a6c7c6b1a494728e5b9ba08209949d1230faeba93893740c11824385a02924d05030bc422021c0404e98817128c34b77c5042b065efc6715749e29417564ad1d58a10089c408490d4865ed08c804c442c688081821250d2c7864a61058fabc8abc1804cd1370b2f92172366c62724a531a0fffb90c4eb03d8b20b040cb1274b0d41a0819498f8e9a92286b1212511b04c9707a1e9c16596e8acfa4460c516417380f0f125a44488dbc2629454e62faaea4d02060191d620e74971b8741bb45ad46db1409239305a8b405061bf8bf24f531140107e491879a2dd3c9a2b567c257576390313d84e090d722d72e8a284b319e394b4e8a38e187da644e65081db1a08813ec2f0c08354153da9e17cf07a1e0ecf4de3472841f95225872e3a7e0f27abc625f711a325dec88e6c858951855040590b6ba022348833566ac891d4ce9697f114209345558233668f536936d14c79736612ecacd4a72b36ca3c8aa4c8e9f6b69bd38b2e473d62525f57d554a81012ea0468e4be2d23cd64a08857a468a1a39283f923ba493334d45149d45522823f19198ce65729f272714a34851225d8f34428b9cb16ea2d07ce64c46c426ab319114548a6a4bf49aa8dbe169430d07903d2347ada80252d4040d2c70935d5425204a32e5c55eb8cd04ab562210dc371392e1729253665143f2d2050c972541cd33381aa408da9b08cc93a182248d942ed996f166c9cea34485683d1a344db25183ca4fffb92c4ec80585a0b04aca4cd8b214160958624f9d42a9593184339e7472764b597f58b199a0ee26d751feab4895513675940e3b453544c6e4c921544da1627174a13374edc0e7249a14530a1a6278084b4e03b4f5193c95100342e4b92ecd508710701189ba246e4c3cffc49b58d8d2e7d9889cd249428e11a84e5559a48bd956d175a89a66262a161f4d828942190661560e110a1f809d15aab8aa1b96e9a253613d8411a0c878260e100c931192495902802a84636c963210907e646713dd22912953532c8817446504504acb88c40b1d974e6448fc09c810a5e8744c8895c8631a5d11e80851e8790a7a11a21200248c844501b22e2cb18159f362b458a95999292653223aabda5d2ba5110e28cc8e102dcfa8771487120f0528bb098c212599e44810b1915f5c9aadf22448813b468551926328179956834988d611d30b2c89f85585ad1af16c735744469cd19330203081c46697e87925fbc38b0da1810231f6e35440897b4d500440067bc450942c4e853e80ba84420542c14ef535ac4b49c1b2f691ac652292100a594218409e4a484ad1c28b0da5b9f149f72cadaa2a2fffb92c4ed8359020b042ca4d5cb68c16001962518342e6ee0efbca20199b30e46e21d1618e7472adf10eb03d49a14cfa78d4672e9ed9f55a6dd14cbd4b48c31126cf56649ba73b44f22eecfa7cb42575b2959a572a59e8ac7839b34cb4d8d2f689591f351f0f6356ca333529b5afb1c7b23739a8c455a48c7cdc4b48252897932f4b3b05a9125f9ac5c112248925d42d38a9f3304c42747c39309346ac7ebcf179e9faa804b2dd8f52033b2014864102a0310908a54444a54eb894d221100a58987520ae094902a2828b6202444162434c72a9c1a1d5c062bba439712744d07e8db53611902a9c0ecf9932d09de44810ac8b252424f499f281221e348cb2d093038d1a64f0bec194d97cd069030cb4b243e8cc690aebb418a444f3c234671a424c5d82e7d19846d9462ce911109f72caa07949972430d2c447605248927886c877287c80e8ad12272681a8749169f982332571f2c68ccd6e70e37deca02c8986d041500328000488dd09296c246ae642c68438292fa5a99284cb9d60e5e45cd4b90b4865db81e5c70c9524b4993a65074af12ba268b0625a66c404734d49325d9d0fffb92c4e28254f60908a7a4c74b76c1a0058624f8599d87762b235a24f247ddbb98511d434c45d10ca4f902282ea569b2ade5a748c16191830250d308136dbbab6630e74b40f59c8a68ed51a4e91b42f13073b4d2dc6990a20efef250e44ac65934693238920c67d376b4dd65463779982c6234739082765926a470e28d9489d1d9ac55326a32b01d6ac4a22cb5a8c24303fc48c104798ca430b4e1e682698926c6a26510b17a987056683830f307078f91182a30716263ea93a6ba87652386909092a14c8c9cbb171e8e0bc9e750a35565d460c3ca8d18296c54cd1f726849a89936976d0c1dacb229458c90ea4df28dcd344b4a0cae247b12b657b57b726d484e9665b9ac89269782375b46d3b56d3b7a15554736185b48fa156bae6947371bf6db0e7410ed19f06101855882cb5ea894a98c55b8cba0d690a6d2a90d2696e4e787d16e14ad2edba37859399d66642ddb6b50c5010c8000c15e2692512428811c2629177527e40d342c1dcb454115562d271ed604a6074e960752394521cd49b41dc823a31e1d9f5da2e9ec018a1295123ed75090a4c1e111232f9267dd059e3bfffb92c4e60256ee0706c7b0c9cb1cc12094f624d19278a8c4b63a7ad58a259a3f902e6cc2f060ea114399b2a2f02af6e1d741a55d8d084a30f90f9298120d5b468ea315a48101550444b125e1a2568e72ecdb4a2aa3d884df48d136376d53cc9045038e8c10929332456a43622a9124eb4ab64b322a696c773f046b2c689d44f3c68a9ba6b08708a39462d12e659314f697585281455c952f12160b16d75a5815e4b114648ac664cd08a61521303e54f88850b06d4401e1a8c4e268090ea902b17cb052ea0249a29d9a9119b48a481589117a606d250a3b60123634cab4131a4cf9c937962df4e8a48525052024d0710c42317260ab358d9fb04e92c35046d585a3c14fa7eab2e4b9a0955f8a9ca73ce68c9905e1dd77ebc39c968b54a3b169ec158672e4811e5fc7936e9069c298c6bc2a309107b836ce2c85a2f67a73f6e5df24f5ac56424b962cad5d8b6942e0c783502661a9ac20a1df96b6cacf8251fc6989e19c6a572d36258e2b632af0c9392c8859608274564a76c90bb49e6367898bc8111f7995d746f1505cb153b09a32d146251319a4227232240b94697c42b30891fffb92c4ed025afe0d02cc312bc2b3bfe0c0f498e9d2eaacd23426e08b5ac447715e951ed45257a061475aa22141c92093544e94f532cb35442b2ed32da1131dc2220d5d76501444245db568c205129c2715a2829f00da6a8d2caabaa280eae72a12209aac9220489a68f1b614671b96181c545bafd228d13a3d2069a744f9e3f1e9abac2c5979b0b173301c4512226670d1d5a7ac392c0e925c102096096a441270909d97894182a274004ae264deb152678ae6cd3477583a54c36731212a701195f3d36822bb2c986da55ca30c11314a330b22242adbd632899d2361021f726594d13125d57b716096a0c5f32f7e393d249121e58e235f70b144d98c891b935ab189a4c6eab89d6ab2253d6d346ce5a26db8a6e4a25dea464b7a8af4cb479621a411ec23ced26d4871edcb668e9b4adfada691935ce4584905da1a408884a324eea828ac1b5d1c64f5103db9fc9a32142c42255b40472653d52e0024014225c4985843415c371548a8882a643602aa27275c42a2425b624846c4001c4b25c79c8172e19821467a47580c986c9056403af2668a4245621623e26ecb22a83676287bfffb92c4f103dae20d020c3129c310412080f624601246c162c4078cca4910214d5d448cc5612953ccab92692e4cd20cc83cca13e7d34ba0959f2abfc5d436e41042812aa471471c227da2196976324851ab227b5d8424debb722eb0dc68b53d61449b49746ae2267103464ea4d54cab69cd84d661ac630df2630ab046d9f844ebcf46cde90a64aac1511a0331b6ee28eb7c0a49017fb885960997070082e06d81b863aa435a805981b2c2442c016722d2c36ca6393c6503312623148814539b9bd45a4442e401844a4a2295c5cbb0b2c2491558a25024969d991b495d53ba336b200d26b429aeb9f9b42c60fbdd73509e1988e9962480ca12368809188a26a1b733b4842e85b56ec8d7732c2d4480c5ada994f26c4c4f8bc69362752368a0d1a8aac6c15556453660c956e4c1562332ac6eb149e97406d3dd922722d27ec32deaad36bc9c8b1b468575d0c26285e985a6c9c0f4f5a79f4890c2ab4945dd0ebd393d66f5e0244a02846ea8b2751d149d20d725d7ddab992b0e57ee1b75d4d3dded5750e1b039766bb0406dbbdaed7eae2d8fad58efcb97784490ab308b5d9b325a3afffb92c4ea0259c20702a7bd208b1e412040c7a4105131bf0394f4d3fc81a5b80c06c9a3609d8d92d9d14a9b5b0cf0e7b92a23709aed2227f26a5b1b52641d57030fd83ee4bc849257633d30b41e92a811a25e4891198f45976ea474c6bd89cd38c54d63dac93ae987ba10561053764f4151baaea2124b5d6ebd667a596592c4d994fc7137544ba4c5202412249494efe64706401fcc70c03950f402db9e9c67d46c2c30c1626b80b97956a5d17f8ce94e26130d9083522c84a5232791d78022c744e2952cc8a9150b3246782e7dc70115cb13893551e202322443ebc9b204714b587943ada8d742558de8331f022520daf384d5c6503fc9330b65393ed512db91da182025e8a68ee03ad39e3526617698098504ab3c1638123a1920c90138c1e8e0ad214443b161a329d9c0e143443e1dc7ee4ddd59b613da76c726750b93f3e0631122003c812a4f81544086c9443837f46214b4b01e70a63922585f30243c27b4d1209c1d0ac4168403d23174842509deb87f27105695571f2d1d0b87a7f60a84d8db3de56a50512116e0343a338ce9b8f53a85a99e483d8923f164ccb83d0f26fffb92c4e580167e030627993b0ae3406170f48eb907be72ba9c49332b5912e4d761a89b28d5c47199544b60b0c9e5aed347e86b5d7db54a9b7d8836eb97d204c7a7a60e129c2abe62c17d3fadbc6672ea3317e250927b55bd539995eed0d8f9763f75d55ade1ce57cc59e382debf67d7b494ca85e4ec58e58249c36f369dc71654f99793d0be74eac590b8aaa84d7f54b0d69e9d911fe7dd4a92eacc56209fb7a016003f51c348b18ce673952ce90a501d367ebc7e8a208c8fa4656881a06c122c41645c18952db7b2344081a7992c234fa17a291d56f6490798e4514da5349a04b52dd8d867eb8ba944c7d6a33196f88fa5695d0f10895b392962ad88e9da4bdd986e9b48d38ac5e581cd3195ac1ad2796491959c1427a5252132c4b6bbde207788c5dff169b740f4a2486d157b2ff7aa666bb2c05ec3d64672e0969e268b35dd0da9dada18832f22590000024910b25bcb01faccbe2dae2b2913a95a8c933239af35359bead6e50ba677d0cbe1be31d0c4c1fa71992c22281a1b240acd466d889cc2cd20b3b01d30d8e70c112038ac9ba68e932a466c5d86ceae4f64d1642ba42fffb92c4f5821d3e0efea7e18402a340a0e0f4999980f01e5950f1af335a802ef3c8e04ed0a4aaa1655b212c4858951bfcc92cdaaf6cd1726364d6cc1b427f12131de94caaa61185644243cd328c2a4b1b92a4c72c9f1f4aac460d2c69526c73a7a46ca9034aac22605246609d4811984689bd72455c51929121496e1426fe66d3523026308cf913dc7787e693009a02ca912d358eb32584664bfd661090171f1b08a2219018469a870c0e27eac964b3e1b9306165db3908b5090e99265979d1143b9957b539ac8c8a28110a95c623297592c479ef1812fc5f1b567101094d19440c86c234b41351bb31b693c049d890e3a029f513cf96b842a21c1b57684513446a92137d210f8424992a3c04a79d2b09d8ddcbc2c981bfe099166bf724495a8ccbb949749c0ef76648090c87376c48a36521e74d87b4028e2062266da245ea0bd0e7be5c46fd352fa91652d4926acc621b89c2faf5adf9d919272a39368e50322a2d9b9d030a2a4c76483bb40554e24089476058392f2a202c594ea9b991624e4ed7c2907d570ade7212c2e88c5264271231a55e221f30760ac50c456c36c26608fffb92c4f2835c0a0afe47b1360acdc0a040c499f904d505951e6090b55a25051dd36961065b705d35cf11183ec346d09ec691cda7d9494e5083c6946d57ae64ab64f26da98685d091ce48043023361a058c9d1955a2771bae8193028158af1727269c527205a52364a3c7152424924d1d9112489b826bc8f46488910a868d52596a07acae245111f628a32466d620920106a8c2e9188638c112046dc00288626008119391aa2040cac4c7b5522c4265fab346e26d28c43e534bd13b0000a490661b332c79c04e3f51d4743a7a1c819498fda4c91d64426db096ca3ccdfd2d48f83496635a051a6ba0d884082532893311a4cb2325444a263c887366708a65ae50e39418d3211a48bbcde61017b11098a4ca2da55554c72d31c84f65da65742bf252af53aa6dabb8654a9df2118c9126ae26c49d8877ee5994d966a7a7dbe4d2fa89b49862ea7292ea6b4d2c887315031d582152657d05bf4da3c603e5876581140b9e607931503c40d1e13493099d0f1ad8c50222513dbde4e20402d2d78c1f32da330479a4098b53514d41105605e8891b88530614d68984b32450a32407d00843fffb92c4ef03db1a0efe07b12dc2c6c0a0409326f94cc6c846838a90a4219f550a2284a2d16ca2a3c487b3df41ba3691e234680da3b99846301148b28bbe070e865099df4d45369c4288c8f221a68f95284cf93cc13b61e512e89a254881116a720bb0b189cd76c8d305a64468a607918ec0987da54e6af13ca199102cd0a0f0f959964e5645173d9635c617471add450210821516557159b138c9a991e652d04b601f5ca2212b050cb854c79a871010b00f9c15db09ccb1e105173562b347d591446d4155d8525ce233c428694129b384e2469b516233c8da28b89ba8715d6d4690ae2db0a6a9fad562d33e2ec14159642f6b4566e4c42346f05d0122145e0dbd0b96560c2239d1468946a2f4308bec36f8a4d2f6b3566717edccdcac88bd34c20a29840ab8e7cd258b05246d6438590e3d0cd549928d9fc99f9abab85a7d992c55c8c544baf497236a506d646cae9bdb4899d28b49762d674d88b127afbc9b20aa60bc78491183a5447450096bca712d2d12482abcc939b2f4fe43616257943ac670e59bfa5996da91460613666daab2048856621346ba47cc0bbd26a260851288fffb92c4f003db460efc0c31278314415fc0f62401938a9331a7f12204308eac5dcab122b2161b55cc9f4cad2459da82d11fc3f64f024844fc0a144c42898d947c0c9faa8346ef524e0d768fbc9e8f10d632a6b9124453379dc2776a14919193212340f5d689e8b5c9da64fd41273689aa693d8f49e8533a9c54ea1891d14129a8358ae12288a2c8b9598a94633a440e0c4dd52552bb4e1464b3cd2b62a0e3074b21caf34218a234c587046ba753184c7c5b462c0b360992b64eed846047140a170c1845050a976168a526a10c409ab6bd34599c6199128d287653a3302532f2e5a50814a2cd28913b4a65134c3eb8f198c979306b46a041af8eb3d12372e81a448503231513ee40da3290689d1987a9268a9f89471b5173a5956e107ad6591424476d9a234329ca3856c79a5f16952cad217c35a2e856719a60dd97c59f7a466962928308f9d239c748c7997c9861b2aba3575593d7657a90acba7472280d1d3cdc2a400190823006c54e205cd0520387994c4a4c38090bb4c0a741e1679b72f1684c80548d04c20b23422e60a7d542eba23ee6c91e4053b2cd104d0e0bac70b145fffb92c4e683d8ee0efe0619340317c11fc0f62408cd55144ee6a07d70fd8fb4a205d56959a39a8c46928b68088cb3165032d212b34caa04691251111d969219dc4cea260d202627468fd2f689b616430d8969e421717f5a9926592c5ca991cb2042428de88bc2a4868bdc3126f5546a209ad19744650c75982a2d384d19fbcd69f3b4099d5a32b9c13524f852445d1b5e65902684b4d38391d48f1f892ee4403d57ccaa70e91159b56cad1624413d64d5728bd1c3fdcd7d887272a7a5a93cc5d04e18648d9504c7c91010493eda532ee92efc4872996d33a8dc812591368318c589ee1ee3548608ceaaaad070b4146125e0b2af777ca972c5f525527fcda6169b9a740f35880e2c80ed6e9320f4a530a5e2aca77b924134ed8cecd3dcba57e68e47c8cc1dfa853d4db7b2e6a47aa3b694981c64b73c85a44025296be55f1d90f72c7d3c96f3cb2099b9ede93a25c361264830d8ca02820e755261e4ae43326bc308a12a19191a2b302a07e75a4c1b86502340c919040990212440424c4ada8a80c7d4c5b29b32f1f3c70f100645e085c5580a07e5a7c4bce1f2f3a69ca3c5724b9dfffb92c4e603591e0afe27a5200ad7c16004c49b393cc2135084563889194644e60ca25044d2a5d43b8e5e691d69e615462a489f0a04458045e6cb45565d70b09d72e9960c1a5919c133d0eaaa0f17347c620215c367508b39054a86facb12a244a0a165498a92488e716e4c1d44ad321e691ac7c46d6bc9583326f98ef8b725c1c2f3524c8bcc46dc0b204902ea06523449882a2a22403a4492ebaee46697c0f03822602cd827e4c181f44692405a8e152a7c158880c94734d54e2d2179c5d8ed2c69f24d743c8d454cb95404423531c2a1669940a406fd02126228a4b2c35228681be01b966a251323b6895cec638a75db0bc4dc6b2054c9c893d419adb0e9adbb3e4edac98ac30c9281ce752704566f5a48a92c735a26b748391b03fe3a24905165cda1d33d1ad3d8343decca849cf72f69d9ce4692ca2caf3c79e972d7a9248216099157e9598625728d7e5ed5216619d2b64d106abb2e512ca84d51e700ba1298ea90cb4b83d05ef979708ec094d199a9dafa92959600fbeb97935028b101397284104c802288bb451a42514b1b65188ea0c3838ca242a9380c850c450884abfffb92c4ed03db1208fa07b123cab6c1a000941b4002e80eac5d92e58f07c5c8ca0e75c2030891222201a6b9714aec80c168aec080fd2f42b3c4a5cab042a849d39497585670d901e1209593678501f261489cd0404a11e5debae32b9889c393b241815a6252ca3426045b99922514b243a2a405940db7cf32f04d82ab1b46711b48e42bc2d8428db59a6a421462b38543709ae0b8683c4a221402c464f0158ac80f83d39b976667c8a69a88040d26489917361e28da2212713cdf008b07132eb5b4b0f052662481a6a529130ce5610452b285604e10117568045401bae12ab4d2212d66160cd08915239d0a169361480267bb208cd46a3f3473257eb9e34a8d794047c73724c3ba1f4bf489584e9691547341a724d740ea8afab2b0c28d948ea2e9c5a148228a67bb1cf2c87eb20ecdf676b005720e795a7ed4e5b1eda3355dc12725eecfb9e9904f5ca514b4d49969819e10c4ad4182d52007d266380690046268e7542848a911c855909e79186cc08d913964429231c16a0b22d9098b0c6ae2960844d45d19336caab2689846affc344a2b388ea5324416b1a9436684549a2264fffb92c4f003dd660af807b12d4aa8c0a000c498310812556495506044c341640a91da6da6f4c9261623960c122c9b454c11984710e164d0a38b926c5b49593881d9e4b8f54e69cd959268c58b0e22e698652659dd4d86d01128611cd19a20208285848a0845106cb231a69b787c928aa52a92b46869ecf30ab58d52caa4428e4246b452c196c8e34e61034b181e62726e4144261b2340dd326c864e40fa5820004f54a1207d056952462a71324e9a2b6d408c06ee12222a623368fd265d41584dcbc469ed4206dfcda77345a4fb8e82f56cb41e255cc95b9b09922aae902a9c750117080f0143a587ec4b73f4a3d389ab6399bc49793879222dbcee47360aff1d07ae8ecf2bc3e3ea9f19f57adf9e9d46d7bdef5cc9a8e75f9835c8db20fff7f95b3116cdda61e328afd27ddd76d3d3fe46e4bfffe2a6d7748247bdd19509d276608c2217c1006a21210b03f7571e95cfae82a2fac0f4b39a3f38576326225a2432be928c6b13ddb2756b6e80f24b295dcc99ac4cb4ecfce983a58f40ad618266c9e4c7122e6686066816671742c207af2b72a6d80fdc186866c7c46f38f327625afffb92c4eb801a760afa26192c028941a0a4649a68f04e89b524408488d022ac84ac2c80e1b45230808e071628e98648d0a0204d5506d1411215595c2c8cb449a135495003ed484c0412ad20d8a18643229214472733c7c0691960a20c449b8ba7244608c506e00ab265e4143cf668782eb26c1005d71e350647d03da36334892d2221d5510d992c4260e080560a06a26bb3202abc884a34a9d160e55b942152179710e1828997501a1e11213e0b929f6dc214de6cb9736cce47cc218964260a8a9247030348d35c22d1796a236e6f33893446d1a42a30dc137237124d6d28c1d5aca0798c6413d2f15a4bd28f9a4717122c9ba4b9c91b4e4d2f79b2223a5d2a445df4189144d161499d936816240b0d3cc615950986e4d97b64fa29becaa0424e40a0aa167561b81e0d453d3e0eb53d9b6be0f53c759504134978b48d684891a16e4e8a1b67d0c97d2024273ed0ece08d6741b28f45d8592464c44d195770592a100b4a801bd0405a62e33a718b7794ba5c3e44d94d7a9f8bdf5cb9852f60366d95a64fd93c4e944483446ca34019b68629632150c2e151b444457932a3174eeb2afffb92c4f703dbd20cf806312fc338419f40c4a5b89978a6471806e4b72019e4b23434bf28a1940b4552c898863cc35228764e78c280a84520470dc275d2eda5c666922ab0d0a3c9a27933d4c9fab5bb1d0284e977109c6222245df3d4392a97c2588041a778640b1fba50187ad080f722a1f8f28c665205c41d3acb7f6802256ae1d6cb3db879cb872fa952525b294810134c4d8e0b21285167da210a443646741a31a54e974cf30c305e4c4c89b7bc9d04c95d84670c9a7ac7adac9b0dae91491504498a2a2083584735d86545085a2ecd329a85cbb50405113c950bd4597227cd13e42bd0fa1d34ace687ba70838a8d904148a4b3cb92943fac8cc481772a4cd4c79942b2aa23713a2474aa72644e8dd8299232ce5e7ac4df4c902f643f594e7964870db1523e4994d4d665b9ae59a3260dca9c37474a922382c9d3cfa24d5644abc525595dcc94b9901d469b7242c9c44c5964322782d5040004c482a424e85a407c3ce610fc4e4ca9cdb7c88568af51b44d47c8bcd0b0e93629713a2ea3d4930489340c02924d0a3bc148227628d44680ac1eba6e82daf4b07b21034fb9393afffb92c4e70117760cfec624d3c323409f40c324903d9d6431df10830b59e3134ce410441a912d3939ba612e790b664b45598d2525d759b2c8099740e24a3a30a22eae13a84189f2356228a6cc410a29d4765240ae1c99aa923438ba134858d6e246daa622b9037b5143a4a889cea858a1e623247d9934daf58b129f48ca434f51a47246f3882b69882a9923d26a61a590195557963933f34281b5c97e44dfc5556a1a6e514eca5b0d4dd2989ad78a1f64a7531c7b4484481468685cf1210102101c801d2010b2a179e0d08592ebae60ba36cb34167e6dca66dd9c848c44c23a3ab203586a0191504d8132090e0b139e7930bf90669d7ccae5133478908803930b8b351095b41fc916c61dde620dd6ce532307b22a488421271716eb0d48274939fa5cbedbbf7b6a4d1d9974e20832e3123313d8205c6ad3c4b341d0445526414049220b0b3dacb04015951d5338b4711dd593cb05d743db2e2e174bf688948b9592ec85a74734a2f8cffd19ef4892b0e959c38987d897af191d97d41710c49510164016c28405900dbc81992336275308488640b10fa03817172cc2ec9b05909559fffb92c4eb0118520afca4993acaef40dfc8949a790228b55db20588cda64629223c889894943c48862446684c14b11e388e0a9b42b118502a6c4459a15a47f18881c70e489a83cce8d850686c2890f97205213a46f9e1f32c744a1f597731f4486a225f96e242d2755f3b982b022ba75341ae03b4a6476cfa126f29888a1334a0a898e5d6633c5eed4a6a839425c992d13ae3a4dd098c4fddd5eeb7858756943a054590288d942aaf85588a28a41f598f22e6226c130c692b294014621f0fb8977b5955cd40f2680498dedcdef2c65991031650c34fc465db54b2d0c5539c9f9d7c32f27574b54af034ab116e6ba2dc3e49a4c46a203554c2294f612841d76dbe135254e73d552d1a76dc90fc9cdbd9ae9cda4a0cde4975164aa52428f7b92f2a6a75593aad7e5be3a9b081d23e9aaa2d191a4e6ba8550b72a4a3737b128c4c7bada8cd1ad6936a1872087823a9413d6e4398a5058da88c26e65b381edc9aa24084ac20887ab1cc69645a6cd0733a10403cf55311248cecc4c49382ac901b79941c3d04548914acd28db92214681559bd8992f4fcd9b6d0aa26069136c50ac9482dfffb92c4f2031c420af606259b4ace415fc49325e071d0fa3312404c796676d034a2048a6ab42882364a2249a244467c63184d582690a4dace352509b145d53cf2d320658598b6ab2f519b20688e0f549d66d764d92ca63423589b569cbb555264eb6b7245a324e71446498909cd5a0550a04d95975156b5bb9b0c36b90983b6b0aa75e0d3d12b64ad93b59cdae12a0028395eaaa7cf97d234e2c3b3280fa1cea61fae5e60b0b486f9d16dd71fbbead862af5bd858560bca8bd18b850770a112911a11b78ed34388700da68c3c64671b2e5d636909900c87c98bb3024a44660b602a7dcb670ca5c9e8f693132a48dc9b775e4d912ef510afdbeca21af4d520dd431e8e69032c325455158dac85bf0b34a5202eab51a47dc9ac632564934eb6df7a2a8c6d06bc55b64bd1f56327916b2eb9ae520d0acae17968d6b6af7c48522eb324c8cd1944def8192035161cc291523b8215d1b09c55580460b2374c6494d1d1303a7a5d0192678ed8323cc6d2af42fae98597b4711b45248f9d18c11499ae7ba60412c7a62b32064254232281b99dc84f1806c568e6b10bc3c34308888522510dfffb92c4ed8318ce0cfa04992d0323c11f48c62578c974121c51ea51da5ae29212731ab21307db5fbe708b28cb463091c9952aaacfde7cafad18c48b983cda4ad1b04e0f4f6eb4c9a36451408c8d314a0e44829668ecc98c074e36de1378a8ac1612628bda3142d474c36c3f67898ca07c08521ee6cd9b79d694429613a912649522466524709209b346a059948e101d261e2ef14c0572d430b4b0108191616c0855a180c8256f026347d5d5d749b619ad42551b5ba3681f8c89df8b2dcc06d08222a88f8000c092641724117895be53b84ca45212a32866732b030a205289db9b5c890527a888dc31091bcd429b66dca3a49d13a8a459792b1314a4abe0ace5241701fb64cb76d88e32a550185d1a0275182d045af3d884d0a20f252c565140e74cbb2c983f34e0ba9c3c2466c8d0a24a440851149a25499a9913448d48c5722474d1c6d44d0244da9ce4c4326932d221b792cd95d684e2564dac54e3d54369452c9107c34c3402a226333361874e2d2c47a42cae1ced9a0c048f15598559228e382ec3819a9a87161092d53ae0070a0e1f231d2e2b6db4459195710393443a9032fffb92c4ec015a1a0cf824b12dc320415f58932461809d6366d359e70c196cf1b6475eba44eaa925d153d940935485848a8d3619225915d4527a74c32c13931697d426d72096b5ecda3ab159946866805c9e952d1e442929181b38f9235e0d1d60282b23928e4b30848e28532b173650d13c585d1aa467e71fa8894c21b108a6d02142b207d58bb6498c48fb6490b112b322e0b63533d9c36d4452a6b2651a8e65b9879b0998a1282a454127b2b2cfeab6424d6c640b7112ad1bfd257331e875e3b680e172b0217bca247e61f56251b3ed9640a76a2b2d45b94158104dc848694cec2298294b83b102666ea0a541ec408830600019fa129dcaf4cc4e57eb6ead9b9327545d22f66a06468fd92a0f812fa2eaea4b2976f9773cfa296b8424a767888242aa1ecb03329dd046b502e407bdcf8d3cec68aad56b4946d153f688c8d740d792c921fcee90c82505caea1002ad8e75c94a0f223ada33880e221068f405019419436d2e0417253d24d90cf09c32a06bd9e2a5d6d482be9e2e0d8981644daa30a93200d2dbd0a6abdf732f4c9c104880a14227aa296934644570daaa411ab81afffb92c4e60319a60af8049932caa5415fc4649a9969387619711710ae7d13664e3135e9821411743050d186c57281b14a89902709bd45e6ca29b5dd068844916d113a85cc158530a49620ef2c4454157d3674964db64b8f10b3438d34aa3de65192332344212250764874993a6870b1d267220f9c9a44c9c996291141f5d62e8183085113cdcca3388de6569cccbe9904eaad37248923a553e50de4669588bea6caf1276257cb4df7f439e986396b46125f34f284286cf324d128e5b4750969a64d86995c81813a53178101464a48c38a1c12180d4ba6aafa47d57a135d74289b3444267d92baa084d7f18ef5196c1b34aa46dad1851cf29eb9ac723fa07b325916e4eada4ac6d352bda4935c236eca730aefac65b158212f59def11c13f1249a0dac6c897c016b5507a74da08205661b02caa00a0b05f87de91a40d0bcdb2171a3282445d0069ea28aa01f30da88a64275b070cb671b12899c2a13990ab40536a0180f2750d35936cb31d87721c8254b4af2ac98c91d0d6ad2f39ea12fac1293882c128a4463844a4aa6e5680fe34eb92a1255a3b166635ac62129447704612386fffb90c4f1001a020af82499360a80342128649b215118d8ae9569ba68c86e168f0ccf4d5aab6ce1f191d2ecc4363d62c7161bca35e8261ef1256d56a4ab05b5a9a33d56f2d8757b712142587579c34e283844e921638a1cbe4b957bb992ab0894375887896df5e5b4fad67b69218a4f4e9050d5b6f225c60b2c94e0a911fba8c8cd24d84e1d3913ad1a58f432891b060a1a8215ca2bac928b2c272354b524659279121210b42041a74f4cd596820b91489438203fb0422cab26484c3d39418f44ad6448347ca4994b5344c90ae474427931b492444e64813e72d97490b088f28751a24db55443b059576fee11a0193294a5670969aaf99c7ca952ca45a9607709c415b75a7326fda8e02a3ea91574fbda2c263d75ccc41db276ac544aa1a79ab58d121f42d1f1d96ad8cbeb10d24d57387ab0f0c0f793a0c283493d328da5ab9e8102a609ce128fae3d1b4fd0dcf49a5954b365cd3860eca2932ada883e20082020c1c0c81f40d4e83038a38d7b621230e838d782d64481e8134084db0d3480fdac1f158ad75cc2a89edd325c138a159b42aa11bd4f9b5616a0814226d86da6c8fffb92c4ff001d1a0ef8c4bd9a434841dec094b2783565ee725a0737f65564aeaa61a294bced77b2a2489a516242154d4a0e35e2aa42445082f929215e417263fa454b3246b9c4f57da84e9811976e44cb6b28b93b026cb92d2da47a94565095cd2259149498a9815b09f8214d049c5f6d6930b2885574a04e99b933382ed162ac2ca45d344c2a40c2ca11b8a0915665246d345b166501252a02348650740c40eb7a1054e4493c0eaf89b1687471c5a73a0c0e44c86837a0f250ab4c8ac785cca00fa42924a109941a3c3a3048e4cb244e4260866fa6956d489707582230cb260aaa59259447a8159ac25941cb9288c8545dc28ef62927ad2725681cb4a5b548b3099b30b521528ca713caea6cb954e4af4440dda567ae53c562b2063123ab2f18b7d6ecd348a6e4e6bdedf63c5a3aa64613f525914d06e424b228d10529313395d562bc57685cd4d9486d65588252da4fae8a7b110b553292a8e20da94b280a844444b2043679e8d6687cf37a809b90246e981b04d0a174d678ba11724908cd99c3aa1825122c66cac56289130a09031358e9b452589a0f65049a1393ac426a2888fffb92c4e801188e0cfa231925c300419f9893253894117203444c93c82875832428d824227e59a6c4d4b17316a8d8908f486dca965d460a1c952643ccda30aeae91530aa2b2c244ce2e40589da82ab94600753dc34846cc176c5a6d28ca985a728197985a0809120daf13c813c47342a73eab898bc2689225b6d2e2a262389a82996b1330771092aabb48e6081e3536b6744ea198a3215575d724e69a4056a73212014c248043e02a0c4d09ba200f09088c9e3c48bba90c5254c286a715b4465880d24a41130a324b2246a283534dc65caa37c647d840b1f150830f5b46179e13141d52665942bc61a46d543d1ce60d4e91c1964aa17a24a64870aa247164b0fae2234865878cb0367d82440dc4f46d2c3893321534d26a2cf2595c9792cd1b15ba671e81e8495540c75902d36934d01430803aa1320c2259521344a4e88104110b08b3c240910cabf3618081d8e4a766164c04d47ae77230b0847312d0879080050376ce365556a0860274988e28b13b87a0bc1e4c28728a2cd2868c965de84eb47d02689bb25cef1288d15a341a465218c31650c9003729965469724d13ae99a8fffb92c4ec03da020af80489280b18401f00949b3954e5318c6a28a298581c527f1b48c32d48fd1428a89ececc91119412e8de50c1979430694d23450593a7156c9ce98936b9d6be36aa79a8ad097c249aad24b9fd8a6d21659818c6902f251a9216f6edb62659a7222a472414a4871ec9e4cd92ac4125d090227f2f3698996219414aca9a2895a3e75823776e290566bea232a1bb509b0b890310221d12a4d246e15a40188b5a49a0243c44baadaea50d22231e599ee2e12341a5dc263816486c909ee2c040d15848a9f651879087a7ae6de3fb33cf385d52792b0129a14132118446a099161c85848f16cd0f290a202d8235888b6b44a891167cd4b611cde3d06c9899538d457ba514345dfa8a7506e6ba3936eb815aa51556344ab87981b0b100e206c81ad81423ed5a47f18589e6928ba1963e28183459acd63068bb2c3488554a0eb50945d0286c9541a44a4b58191d699d36483c78d2359861b18c6020ca2482afc615402000809414fa47462372a12c0a9a8d62c831ba1dd04943e4f73a28c311756bd68aa38787356c12b1231247395866ed072e9fb11374e22cc6d8486bfffb92c4e78158a608faa4993e0b34c11f20632469dc6ec96c54b9dced94e496c7b40e74ce77417b88e2088c2ecbd22804503eea7865a682cd2f524933b1c81912c6b81a678875134a913a41a1147518ae8e90b4c793a07219075e220bac79d434e5518b33dd3eb9e7125f0750ec2133db90930836da1c56208188a17166232a07408a171052b13489c7c285b95a89904060f243e8c94468241b27a21263e47d4710099b48fcdb446fedcda1d3286623932176d33a985f5568e3922852062b4a964d0900a099040ee21282d3464e2c23260ca0f2205b114d2149480e908dab3175104f49c3ec9e4455882631cb710c1028da515b64940791b64726da59960d33642aa35903ce4c8562c913a14d88b12075724328176db5d01f30cb48cc2daf5db8411236184025d594243868a214450f90372272fde8d7171c282c4e952c425cd07cb9f3266ef05ee092ea848aa6da6b2221232424a558599a08000349c07945d62e444e282aa94e615490ac8099122590edae4ea9234c1b5cf23422032c94d81c0c4e082196614e3458b2d92987cb2af5c89b506524c634a45b4a9cc102889a265dfffb92c4e48155ba0efd0320d8034941dec09324688689aeb16a255e4595204481abe8953e1e58d91a055a2335ed29aca7548dc940d1981f6ad0ae42f14523c9aedcd72c40837c896d365141ca9c551a1162a61b65ac13b450946397277a6a42a4a1155c1646c9302c9aa7945174947100a8e4dc189d5acbae5528192204fbaa29b1036542726df24e783cf54d8a1cab9c2530a2c913eb3222858128a9449a292574604121574488c4174278cebfa8c3335901a6bb3327278344258ea35cbd328c2c29140d9927c59b6f03e8936e2586d8e5cea225367c462a3a48233c08954c196872894161789532069908212d359546513560456f5495e7a429765196b59c43a8110590cd12d4d3536526d94ae6dcc5071228a227a6a26b424ed2e5a6ba6d27cc214b9e44646e96795db28deaeda582713179408d19f67157674074d8b901c9ec651e61451945f5960e48f0bb240212018925f20298c585130b593927220aa37a010085284000012b2ec8955451dcba65c41272806048d6a4435094544bc10d28f48a3d674e9287a04a85dcdf40901f94eb1451b24f275f3588966311b81e34a3fffb92c4eb0019820cf8a499380337c15f14949b3913de453569f7cbcb4a1222898c636a8c2cd7c1f08c68bd04409945165be73c8e5004d92e149490b28c5845270e9a2c8519a04c4490d2524e457d28d2262ec1324e3c81aa1c432686c1b8c62051a959d564c9e12a72dcbe3be6134da4a51cb5c020712d56631d00501256936d6a301859d764aa6950155558b2a1650b2b6c7884330d890b884972a5718a442cd8a5468a92d2a29252a089959a56529b2b0a89954254112582215134c8516c62ab3d542b1122449b3044895cd2125890854008a854d759a4488542933e38b224c8454bb2b22265c11751d0cc1126292514ee5e22452f5d34294d0d5c108a4962850a14854850a1ad8ca78a8a496ae3d564a8227888991222204992125eaa1c59165c08812049ab428889b0a82229662a9122d550d113c8516a416048d1514b01504411148a4969600c1961149a4c95090c888030242a15132244ce554c414d45332e313030555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555fffb92c4e481d5f20afca318d10b4ec1dd4011a420555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555554c414d45332e313030555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555fffb92c43903c00001a4000000200000348000000455555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555` -} \ No newline at end of file diff --git a/pkg/notifier/notiifer.go b/pkg/notifier/notiifer.go index c987f7d..2f68dbd 100644 --- a/pkg/notifier/notiifer.go +++ b/pkg/notifier/notiifer.go @@ -1,16 +1,6 @@ package notifier import ( - "bytes" - "encoding/hex" - "io" - "io/ioutil" - "strings" - "time" - - "github.com/faiface/beep" - "github.com/faiface/beep/mp3" - "github.com/faiface/beep/speaker" notifylib "github.com/gen2brain/beeep" ) @@ -18,51 +8,3 @@ import ( func Notify(title string, msg string) error { return notifylib.Notify(title, msg, "") } - -// NotifyWithSound ... -func NotifyWithSound(title string, msg string) error { - err := Notify(title, msg) - if err != nil { - return err - } - - err = PlaySound() - if err != nil { - return err - } - - return nil -} - -// PlaySound ... -func PlaySound() error { - f, err := mp3File() - if err != nil { - return err - } - streamer, format, err := mp3.Decode(f) - if err != nil { - return err - } - defer streamer.Close() - - speaker.Init(format.SampleRate, format.SampleRate.N(time.Second/10)) - done := make(chan bool) - speaker.Play(beep.Seq(streamer, beep.Callback(func() { - done <- true - }))) - - <-done - return nil -} - -func mp3File() (io.ReadCloser, error) { - r := strings.TrimRight(strings.TrimLeft(Mp3(), "\r\n"), "\r\n") - mp3Bytes, err := hex.DecodeString(r) - if err != nil { - return nil, err - } - - f := ioutil.NopCloser(bytes.NewReader(mp3Bytes)) - return f, nil -} diff --git a/vendor/github.com/faiface/beep/LICENSE b/vendor/github.com/faiface/beep/LICENSE deleted file mode 100644 index b497e83..0000000 --- a/vendor/github.com/faiface/beep/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Michal Štrba - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/faiface/beep/README.md b/vendor/github.com/faiface/beep/README.md deleted file mode 100644 index 1624c22..0000000 --- a/vendor/github.com/faiface/beep/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# Beep [![GoDoc](https://godoc.org/github.com/faiface/beep?status.svg)](https://godoc.org/github.com/faiface/beep) [![Go Report Card](https://goreportcard.com/badge/github.com/faiface/beep)](https://goreportcard.com/report/github.com/faiface/beep) - -A little package that brings sound to any Go application. Suitable for playback and audio-processing. - -``` -go get -u github.com/faiface/beep -``` - -## Features - -Beep is built on top of its [Streamer](https://godoc.org/github.com/faiface/beep#Streamer) interface, which is like [io.Reader](https://golang.org/pkg/io/#Reader), but for audio. It was one of the best design decisions I've ever made and it enabled all the rest of the features to naturally come together with not much code. - -- **Decode and play WAV, MP3, OGG, and FLAC.** -- **Encode and save WAV.** -- **Very simple API.** Limiting the support to stereo (two channel) audio made it possible to simplify the architecture and the API. -- **Rich library of compositors and effects.** Loop, pause/resume, change volume, mix, sequence, change playback speed, and more. -- **Easily create new effects.** With the `Streamer` interface, creating new effects is very easy. -- **Generate completely own artificial sounds.** Again, the `Streamer` interface enables easy sound generation. -- **Very small codebase.** The core is just ~1K LOC. - -## Tutorial - -The [Wiki](https://github.com/faiface/beep/wiki) contains a handful of tutorials for you to get started. They teach the fundamentals and advanced topics alike. **Read them especially if you call `speaker.Init` every time you play something.** - -- [Hello, Beep!](https://github.com/faiface/beep/wiki/Hello,-Beep!) -- [Composing and controlling](https://github.com/faiface/beep/wiki/Composing-and-controlling) -- [To buffer, or not to buffer, that is the question](https://github.com/faiface/beep/wiki/To-buffer,-or-not-to-buffer,-that-is-the-question) -- [Making own streamers](https://github.com/faiface/beep/wiki/Making-own-streamers) - -## Examples - -| [Speedy Player](https://github.com/faiface/beep/tree/master/examples/speedy-player) | [Doppler Stereo Room](https://github.com/faiface/beep/tree/master/examples/doppler-stereo-room) | -| --- | --- | -| ![Speedy Player](https://github.com/faiface/beep/blob/master/examples/speedy-player/screenshot.png) | ![Doppler Stereo Room](https://github.com/faiface/beep/blob/master/examples/doppler-stereo-room/screenshot.png) | - -## Dependencies - -For playback, Beep uses [Oto](https://github.com/hajimehoshi/oto) under the hood. Check its requirements to see what you need to install for building your application. - -Running an already built application should work with no extra dependencies. - -## Licence - -[MIT](https://github.com/faiface/beep/blob/master/LICENSE) diff --git a/vendor/github.com/faiface/beep/buffer.go b/vendor/github.com/faiface/beep/buffer.go deleted file mode 100644 index c20b993..0000000 --- a/vendor/github.com/faiface/beep/buffer.go +++ /dev/null @@ -1,262 +0,0 @@ -package beep - -import ( - "fmt" - "math" - "time" -) - -// SampleRate is the number of samples per second. -type SampleRate int - -// D returns the duration of n samples. -func (sr SampleRate) D(n int) time.Duration { - return time.Second * time.Duration(n) / time.Duration(sr) -} - -// N returns the number of samples that last for d duration. -func (sr SampleRate) N(d time.Duration) int { - return int(d * time.Duration(sr) / time.Second) -} - -// Format is the format of a Buffer or another audio source. -type Format struct { - // SampleRate is the number of samples per second. - SampleRate SampleRate - - // NumChannels is the number of channels. The value of 1 is mono, the value of 2 is stereo. - // The samples should always be interleaved. - NumChannels int - - // Precision is the number of bytes used to encode a single sample. Only values up to 6 work - // well, higher values loose precision due to floating point numbers. - Precision int -} - -// Width returns the number of bytes per one frame (samples in all channels). -// -// This is equal to f.NumChannels * f.Precision. -func (f Format) Width() int { - return f.NumChannels * f.Precision -} - -// EncodeSigned encodes a single sample in f.Width() bytes to p in signed format. -func (f Format) EncodeSigned(p []byte, sample [2]float64) (n int) { - return f.encode(true, p, sample) -} - -// EncodeUnsigned encodes a single sample in f.Width() bytes to p in unsigned format. -func (f Format) EncodeUnsigned(p []byte, sample [2]float64) (n int) { - return f.encode(false, p, sample) -} - -// DecodeSigned decodes a single sample encoded in f.Width() bytes from p in signed format. -func (f Format) DecodeSigned(p []byte) (sample [2]float64, n int) { - return f.decode(true, p) -} - -// DecodeUnsigned decodes a single sample encoded in f.Width() bytes from p in unsigned format. -func (f Format) DecodeUnsigned(p []byte) (sample [2]float64, n int) { - return f.decode(false, p) -} - -func (f Format) encode(signed bool, p []byte, sample [2]float64) (n int) { - switch { - case f.NumChannels == 1: - x := norm((sample[0] + sample[1]) / 2) - p = p[encodeFloat(signed, f.Precision, p, x):] - case f.NumChannels >= 2: - for c := range sample { - x := norm(sample[c]) - p = p[encodeFloat(signed, f.Precision, p, x):] - } - for c := len(sample); c < f.NumChannels; c++ { - p = p[encodeFloat(signed, f.Precision, p, 0):] - } - default: - panic(fmt.Errorf("format: encode: invalid number of channels: %d", f.NumChannels)) - } - return f.Width() -} - -func (f Format) decode(signed bool, p []byte) (sample [2]float64, n int) { - switch { - case f.NumChannels == 1: - x, _ := decodeFloat(signed, f.Precision, p) - return [2]float64{x, x}, f.Width() - case f.NumChannels >= 2: - for c := range sample { - x, n := decodeFloat(signed, f.Precision, p) - sample[c] = x - p = p[n:] - } - for c := len(sample); c < f.NumChannels; c++ { - _, n := decodeFloat(signed, f.Precision, p) - p = p[n:] - } - return sample, f.Width() - default: - panic(fmt.Errorf("format: decode: invalid number of channels: %d", f.NumChannels)) - } -} - -func encodeFloat(signed bool, precision int, p []byte, x float64) (n int) { - var xUint64 uint64 - if signed { - xUint64 = floatToSigned(precision, x) - } else { - xUint64 = floatToUnsigned(precision, x) - } - for i := 0; i < precision; i++ { - p[i] = byte(xUint64) - xUint64 >>= 8 - } - return precision -} - -func decodeFloat(signed bool, precision int, p []byte) (x float64, n int) { - var xUint64 uint64 - for i := precision - 1; i >= 0; i-- { - xUint64 <<= 8 - xUint64 += uint64(p[i]) - } - if signed { - return signedToFloat(precision, xUint64), precision - } - return unsignedToFloat(precision, xUint64), precision -} - -func floatToSigned(precision int, x float64) uint64 { - if x < 0 { - compl := uint64(-x * (math.Exp2(float64(precision)*8-1) - 1)) - return uint64(1<= 1< +1 { - return +1 - } - return x -} - -// Buffer is a storage for audio data. You can think of it as a bytes.Buffer for audio samples. -type Buffer struct { - f Format - data []byte - tmp []byte -} - -// NewBuffer creates a new empty Buffer which stores samples in the provided format. -func NewBuffer(f Format) *Buffer { - return &Buffer{f: f, tmp: make([]byte, f.Width())} -} - -// Format returns the format of the Buffer. -func (b *Buffer) Format() Format { - return b.f -} - -// Len returns the number of samples currently in the Buffer. -func (b *Buffer) Len() int { - return len(b.data) / b.f.Width() -} - -// Pop removes n samples from the beginning of the Buffer. -// -// Existing Streamers are not affected. -func (b *Buffer) Pop(n int) { - b.data = b.data[n*b.f.Width():] -} - -// Append adds all audio data from the given Streamer to the end of the Buffer. -// -// The Streamer will be drained when this method finishes. -func (b *Buffer) Append(s Streamer) { - var samples [512][2]float64 - for { - n, ok := s.Stream(samples[:]) - if !ok { - break - } - for _, sample := range samples[:n] { - b.f.EncodeSigned(b.tmp, sample) - b.data = append(b.data, b.tmp...) - } - } -} - -// Streamer returns a StreamSeeker which streams samples in the given interval (including from, -// excluding to). If from<0 or to>b.Len() or to= len(bs.data) { - return 0, false - } - for i := range samples { - if bs.pos >= len(bs.data) { - break - } - sample, advance := bs.f.DecodeSigned(bs.data[bs.pos:]) - samples[i] = sample - bs.pos += advance - n++ - } - return n, true -} - -func (bs *bufferStreamer) Err() error { - return nil -} - -func (bs *bufferStreamer) Len() int { - return len(bs.data) / bs.f.Width() -} - -func (bs *bufferStreamer) Position() int { - return bs.pos / bs.f.Width() -} - -func (bs *bufferStreamer) Seek(p int) error { - if p < 0 || bs.Len() < p { - return fmt.Errorf("buffer: seek position %v out of range [%v, %v]", p, 0, bs.Len()) - } - bs.pos = p * bs.f.Width() - return nil -} diff --git a/vendor/github.com/faiface/beep/compositors.go b/vendor/github.com/faiface/beep/compositors.go deleted file mode 100644 index d874d9f..0000000 --- a/vendor/github.com/faiface/beep/compositors.go +++ /dev/null @@ -1,173 +0,0 @@ -package beep - -// Take returns a Streamer which streams at most num samples from s. -// -// The returned Streamer propagates s's errors through Err. -func Take(num int, s Streamer) Streamer { - return &take{ - s: s, - remains: num, - } -} - -type take struct { - s Streamer - remains int -} - -func (t *take) Stream(samples [][2]float64) (n int, ok bool) { - if t.remains <= 0 { - return 0, false - } - toStream := t.remains - if len(samples) < toStream { - toStream = len(samples) - } - n, ok = t.s.Stream(samples[:toStream]) - t.remains -= n - return n, ok -} - -func (t *take) Err() error { - return t.s.Err() -} - -// Loop takes a StreamSeeker and plays it count times. If count is negative, s is looped infinitely. -// -// The returned Streamer propagates s's errors. -func Loop(count int, s StreamSeeker) Streamer { - return &loop{ - s: s, - remains: count, - } -} - -type loop struct { - s StreamSeeker - remains int -} - -func (l *loop) Stream(samples [][2]float64) (n int, ok bool) { - if l.remains == 0 || l.s.Err() != nil { - return 0, false - } - for len(samples) > 0 { - sn, sok := l.s.Stream(samples) - if !sok { - if l.remains > 0 { - l.remains-- - } - if l.remains == 0 { - break - } - err := l.s.Seek(0) - if err != nil { - return n, true - } - continue - } - samples = samples[sn:] - n += sn - } - return n, true -} - -func (l *loop) Err() error { - return l.s.Err() -} - -// Seq takes zero or more Streamers and returns a Streamer which streams them one by one without pauses. -// -// Seq does not propagate errors from the Streamers. -func Seq(s ...Streamer) Streamer { - i := 0 - return StreamerFunc(func(samples [][2]float64) (n int, ok bool) { - for i < len(s) && len(samples) > 0 { - sn, sok := s[i].Stream(samples) - samples = samples[sn:] - n, ok = n+sn, ok || sok - if !sok { - i++ - } - } - return n, ok - }) -} - -// Mix takes zero or more Streamers and returns a Streamer which streams them mixed together. -// -// Mix does not propagate errors from the Streamers. -func Mix(s ...Streamer) Streamer { - return StreamerFunc(func(samples [][2]float64) (n int, ok bool) { - var tmp [512][2]float64 - - for len(samples) > 0 { - toStream := len(tmp) - if toStream > len(samples) { - toStream = len(samples) - } - - // clear the samples - for i := range samples[:toStream] { - samples[i] = [2]float64{} - } - - snMax := 0 // max number of streamed samples in this iteration - for _, st := range s { - // mix the stream - sn, sok := st.Stream(tmp[:toStream]) - if sn > snMax { - snMax = sn - } - ok = ok || sok - - for i := range tmp[:sn] { - samples[i][0] += tmp[i][0] - samples[i][1] += tmp[i][1] - } - } - - n += snMax - if snMax < len(tmp) { - break - } - samples = samples[snMax:] - } - - return n, ok - }) -} - -// Dup returns two Streamers which both stream the same data as the original s. The two Streamers -// can't be used concurrently without synchronization. -func Dup(s Streamer) (t, u Streamer) { - var tBuf, uBuf [][2]float64 - return &dup{&tBuf, &uBuf, s}, &dup{&uBuf, &tBuf, s} -} - -type dup struct { - myBuf, itsBuf *[][2]float64 - s Streamer -} - -func (d *dup) Stream(samples [][2]float64) (n int, ok bool) { - buf := *d.myBuf - n = copy(samples, buf) - ok = len(buf) > 0 - buf = buf[n:] - samples = samples[n:] - *d.myBuf = buf - - if len(samples) > 0 { - sn, sok := d.s.Stream(samples) - n += sn - ok = ok || sok - *d.itsBuf = append(*d.itsBuf, samples[:sn]...) - } - - return n, ok -} - -func (d *dup) Err() error { - return d.s.Err() -} diff --git a/vendor/github.com/faiface/beep/ctrl.go b/vendor/github.com/faiface/beep/ctrl.go deleted file mode 100644 index 88fd8bc..0000000 --- a/vendor/github.com/faiface/beep/ctrl.go +++ /dev/null @@ -1,52 +0,0 @@ -package beep - -// Ctrl allows for pausing a Streamer. -// -// Wrap a Streamer in a Ctrl. -// -// ctrl := &beep.Ctrl{Streamer: s} -// -// Then, we can pause the streaming (this will cause Ctrl to stream silence). -// -// ctrl.Paused = true -// -// To completely stop a Ctrl before the wrapped Streamer is drained, just set the wrapped Streamer -// to nil. -// -// ctrl.Streamer = nil -// -// If you're playing a Streamer wrapped in a Ctrl through the speaker, you need to lock and unlock -// the speaker when modifying the Ctrl to avoid race conditions. -// -// speaker.Play(ctrl) -// // ... -// speaker.Lock() -// ctrl.Paused = true -// speaker.Unlock() -type Ctrl struct { - Streamer Streamer - Paused bool -} - -// Stream streams the wrapped Streamer, if not nil. If the Streamer is nil, Ctrl acts as drained. -// When paused, Ctrl streams silence. -func (c *Ctrl) Stream(samples [][2]float64) (n int, ok bool) { - if c.Streamer == nil { - return 0, false - } - if c.Paused { - for i := range samples { - samples[i] = [2]float64{} - } - return len(samples), true - } - return c.Streamer.Stream(samples) -} - -// Err returns the error of the wrapped Streamer, if not nil. -func (c *Ctrl) Err() error { - if c.Streamer == nil { - return nil - } - return c.Streamer.Err() -} diff --git a/vendor/github.com/faiface/beep/go.mod b/vendor/github.com/faiface/beep/go.mod deleted file mode 100644 index 3612300..0000000 --- a/vendor/github.com/faiface/beep/go.mod +++ /dev/null @@ -1,11 +0,0 @@ -module github.com/faiface/beep - -require ( - github.com/gdamore/tcell v1.1.1 - github.com/hajimehoshi/go-mp3 v0.1.1 - github.com/hajimehoshi/oto v0.3.1 - github.com/jfreymuth/oggvorbis v1.0.0 - github.com/jfreymuth/vorbis v1.0.0 // indirect - github.com/mewkiz/flac v1.0.5 - github.com/pkg/errors v0.8.1 -) diff --git a/vendor/github.com/faiface/beep/go.sum b/vendor/github.com/faiface/beep/go.sum deleted file mode 100644 index d9b3a61..0000000 --- a/vendor/github.com/faiface/beep/go.sum +++ /dev/null @@ -1,39 +0,0 @@ -github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko= -github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= -github.com/gdamore/tcell v1.1.1 h1:U73YL+jMem2XfhvaIUfPO6MpJawaG92B2funXVb9qLs= -github.com/gdamore/tcell v1.1.1/go.mod h1:K1udHkiR3cOtlpKG5tZPD5XxrF7v2y7lDq7Whcj+xkQ= -github.com/gopherjs/gopherjs v0.0.0-20180628210949-0892b62f0d9f/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gopherjs/gopherjs v0.0.0-20180825215210-0210a2f0f73c h1:16eHWuMGvCjSfgRJKqIzapE78onvvTbdi1rMkU00lZw= -github.com/gopherjs/gopherjs v0.0.0-20180825215210-0210a2f0f73c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gopherjs/gopherwasm v0.1.1/go.mod h1:kx4n9a+MzHH0BJJhvlsQ65hqLFXDO/m256AsaDPQ+/4= -github.com/gopherjs/gopherwasm v1.0.0 h1:32nge/RlujS1Im4HNCJPp0NbBOAeBXFuT1KonUuLl+Y= -github.com/gopherjs/gopherwasm v1.0.0/go.mod h1:SkZ8z7CWBz5VXbhJel8TxCmAcsQqzgWGR/8nMhyhZSI= -github.com/hajimehoshi/go-mp3 v0.1.1 h1:Y33fAdTma70fkrxnc9u50Uq0lV6eZ+bkAlssdMmCwUc= -github.com/hajimehoshi/go-mp3 v0.1.1/go.mod h1:4i+c5pDNKDrxl1iu9iG90/+fhP37lio6gNhjCx9WBJw= -github.com/hajimehoshi/oto v0.1.1/go.mod h1:hUiLWeBQnbDu4pZsAhOnGqMI1ZGibS6e2qhQdfpwz04= -github.com/hajimehoshi/oto v0.3.1 h1:cpf/uIv4Q0oc5uf9loQn7PIehv+mZerh+0KKma6gzMk= -github.com/hajimehoshi/oto v0.3.1/go.mod h1:e9eTLBB9iZto045HLbzfHJIc+jP3xaKrjZTghvb6fdM= -github.com/jfreymuth/oggvorbis v1.0.0 h1:aOpiihGrFLXpsh2osOlEvTcg5/aluzGQeC7m3uYWOZ0= -github.com/jfreymuth/oggvorbis v1.0.0/go.mod h1:abe6F9QRjuU9l+2jek3gj46lu40N4qlYxh2grqkLEDM= -github.com/jfreymuth/vorbis v1.0.0 h1:SmDf783s82lIjGZi8EGUUaS7YxPHgRj4ZXW/h7rUi7U= -github.com/jfreymuth/vorbis v1.0.0/go.mod h1:8zy3lUAm9K/rJJk223RKy6vjCZTWC61NA2QD06bfOE0= -github.com/lucasb-eyer/go-colorful v0.0.0-20181028223441-12d3b2882a08 h1:5MnxBC15uMxFv5FY/J/8vzyaBiArCOkMdFT9Jsw78iY= -github.com/lucasb-eyer/go-colorful v0.0.0-20181028223441-12d3b2882a08/go.mod h1:NXg0ArsFk0Y01623LgUqoqcouGDB+PwCCQlrwrG6xJ4= -github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= -github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mewkiz/flac v1.0.5 h1:dHGW/2kf+/KZ2GGqSVayNEhL9pluKn/rr/h/QqD9Ogc= -github.com/mewkiz/flac v1.0.5/go.mod h1:EHZNU32dMF6alpurYyKHDLYpW1lYpBZ5WrXi/VuNIGs= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -golang.org/x/exp v0.0.0-20180710024300-14dda7b62fcd h1:nLIcFw7GiqKXUS7HiChg6OAYWgASB2H97dZKd1GhDSs= -golang.org/x/exp v0.0.0-20180710024300-14dda7b62fcd/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81 h1:00VmoueYNlNz/aHIilyyQz/MHSqGoWJzpFv/HW8xpzI= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= -golang.org/x/mobile v0.0.0-20180806140643-507816974b79 h1:t2JRgCWkY7Qaa1J2jal+wqC9OjbyHCHwIA9rVlRUSMo= -golang.org/x/mobile v0.0.0-20180806140643-507816974b79/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/sys v0.0.0-20181228144115-9a3f9b0469bb h1:pf3XwC90UUdNPYWZdFjhGBE7DUFuK3Ct1zWmZ65QN30= -golang.org/x/sys v0.0.0-20181228144115-9a3f9b0469bb/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.0 h1:FVCohIoYO7IJoDDVpV2pdq7SgrMH6wHnuTyrdrxJNoY= -gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.0/go.mod h1:OdE7CF6DbADk7lN8LIKRzRJTTZXIjtWgA5THM5lhBAw= diff --git a/vendor/github.com/faiface/beep/interface.go b/vendor/github.com/faiface/beep/interface.go deleted file mode 100644 index 8e90919..0000000 --- a/vendor/github.com/faiface/beep/interface.go +++ /dev/null @@ -1,106 +0,0 @@ -package beep - -// Streamer is able to stream a finite or infinite sequence of audio samples. -type Streamer interface { - // Stream copies at most len(samples) next audio samples to the samples slice. - // - // The sample rate of the samples is unspecified in general, but should be specified for - // each concrete Streamer. - // - // The value at samples[i][0] is the value of the left channel of the i-th sample. - // Similarly, samples[i][1] is the value of the right channel of the i-th sample. - // - // Stream returns the number of streamed samples. If the Streamer is drained and no more - // samples will be produced, it returns 0 and false. Stream must not touch any samples - // outside samples[:n]. - // - // There are 3 valid return pattterns of the Stream method: - // - // 1. n == len(samples) && ok - // - // Stream streamed all of the requested samples. Cases 1, 2 and 3 may occur in the following - // calls. - // - // 2. 0 < n && n < len(samples) && ok - // - // Stream streamed n samples and drained the Streamer. Only case 3 may occur in the - // following calls. - // - // 3. n == 0 && !ok - // - // The Streamer is drained and no more samples will come. If Err returns a non-nil error, only - // this case is valid. Only this case may occur in the following calls. - Stream(samples [][2]float64) (n int, ok bool) - - // Err returns an error which occurred during streaming. If no error occurred, nil is - // returned. - // - // When an error occurs, Streamer must become drained and Stream must return 0, false - // forever. - // - // The reason why Stream doesn't return an error is that it dramatically simplifies - // programming with Streamer. It's not very important to catch the error right when it - // happens. - Err() error -} - -// StreamSeeker is a finite duration Streamer which supports seeking to an arbitrary position. -type StreamSeeker interface { - Streamer - - // Duration returns the total number of samples of the Streamer. - Len() int - - // Position returns the current position of the Streamer. This value is between 0 and the - // total length. - Position() int - - // Seek sets the position of the Streamer to the provided value. - // - // If an error occurs during seeking, the position remains unchanged. This error will not be - // returned through the Streamer's Err method. - Seek(p int) error -} - -// StreamCloser is a Streamer streaming from a resource which needs to be released, such as a file -// or a network connection. -type StreamCloser interface { - Streamer - - // Close closes the Streamer and releases it's resources. Streamer will no longer stream any - // samples. - Close() error -} - -// StreamSeekCloser is a union of StreamSeeker and StreamCloser. -type StreamSeekCloser interface { - Streamer - Len() int - Position() int - Seek(p int) error - Close() error -} - -// StreamerFunc is a Streamer created by simply wrapping a streaming function (usually a closure, -// which encloses a time tracking variable). This sometimes simplifies creating new streamers. -// -// Example: -// -// noise := StreamerFunc(func(samples [][2]float64) (n int, ok bool) { -// for i := range samples { -// samples[i][0] = rand.Float64()*2 - 1 -// samples[i][1] = rand.Float64()*2 - 1 -// } -// return len(samples), true -// }) -type StreamerFunc func(samples [][2]float64) (n int, ok bool) - -// Stream calls the wrapped streaming function. -func (sf StreamerFunc) Stream(samples [][2]float64) (n int, ok bool) { - return sf(samples) -} - -// Err always returns nil. -func (sf StreamerFunc) Err() error { - return nil -} diff --git a/vendor/github.com/faiface/beep/mixer.go b/vendor/github.com/faiface/beep/mixer.go deleted file mode 100644 index 9f0dd19..0000000 --- a/vendor/github.com/faiface/beep/mixer.go +++ /dev/null @@ -1,70 +0,0 @@ -package beep - -// Mixer allows for dynamic mixing of arbitrary number of Streamers. Mixer automatically removes -// drained Streamers. Mixer's stream never drains, when empty, Mixer streams silence. -type Mixer struct { - streamers []Streamer -} - -// Len returns the number of Streamers currently playing in the Mixer. -func (m *Mixer) Len() int { - return len(m.streamers) -} - -// Add adds Streamers to the Mixer. -func (m *Mixer) Add(s ...Streamer) { - m.streamers = append(m.streamers, s...) -} - -// Clear removes all Streamers from the mixer. -func (m *Mixer) Clear() { - m.streamers = m.streamers[:0] -} - -// Stream streams all Streamers currently in the Mixer mixed together. This method always returns -// len(samples), true. If there are no Streamers available, this methods streams silence. -func (m *Mixer) Stream(samples [][2]float64) (n int, ok bool) { - var tmp [512][2]float64 - - for len(samples) > 0 { - toStream := len(tmp) - if toStream > len(samples) { - toStream = len(samples) - } - - // clear the samples - for i := range samples[:toStream] { - samples[i] = [2]float64{} - } - - for si := 0; si < len(m.streamers); si++ { - // mix the stream - sn, sok := m.streamers[si].Stream(tmp[:toStream]) - for i := range tmp[:sn] { - samples[i][0] += tmp[i][0] - samples[i][1] += tmp[i][1] - } - if !sok { - // remove drained streamer - sj := len(m.streamers) - 1 - m.streamers[si], m.streamers[sj] = m.streamers[sj], m.streamers[si] - m.streamers = m.streamers[:sj] - si-- - } - } - - samples = samples[toStream:] - n += toStream - } - - return n, true -} - -// Err always returns nil for Mixer. -// -// There are two reasons. The first one is that erroring Streamers are immediately drained and -// removed from the Mixer. The second one is that one Streamer shouldn't break the whole Mixer and -// you should handle the errors right where they can happen. -func (m *Mixer) Err() error { - return nil -} diff --git a/vendor/github.com/faiface/beep/mp3/decode.go b/vendor/github.com/faiface/beep/mp3/decode.go deleted file mode 100644 index 4ddcf8f..0000000 --- a/vendor/github.com/faiface/beep/mp3/decode.go +++ /dev/null @@ -1,104 +0,0 @@ -// Package mp3 implements audio data decoding in MP3 format. -package mp3 - -import ( - "fmt" - "io" - - "github.com/faiface/beep" - gomp3 "github.com/hajimehoshi/go-mp3" - "github.com/pkg/errors" -) - -const ( - gomp3NumChannels = 2 - gomp3Precision = 2 - gomp3BytesPerFrame = gomp3NumChannels * gomp3Precision -) - -// Decode takes a ReadCloser containing audio data in MP3 format and returns a StreamSeekCloser, -// which streams that audio. The Seek method will panic if rc is not io.Seeker. -// -// Do not close the supplied ReadSeekCloser, instead, use the Close method of the returned -// StreamSeekCloser when you want to release the resources. -func Decode(rc io.ReadCloser) (s beep.StreamSeekCloser, format beep.Format, err error) { - defer func() { - if err != nil { - err = errors.Wrap(err, "mp3") - } - }() - d, err := gomp3.NewDecoder(rc) - if err != nil { - return nil, beep.Format{}, err - } - format = beep.Format{ - SampleRate: beep.SampleRate(d.SampleRate()), - NumChannels: gomp3NumChannels, - Precision: gomp3Precision, - } - return &decoder{rc, d, format, 0, nil}, format, nil -} - -type decoder struct { - closer io.Closer - d *gomp3.Decoder - f beep.Format - pos int - err error -} - -func (d *decoder) Stream(samples [][2]float64) (n int, ok bool) { - if d.err != nil { - return 0, false - } - var tmp [gomp3BytesPerFrame]byte - for i := range samples { - dn, err := d.d.Read(tmp[:]) - if dn == len(tmp) { - samples[i], _ = d.f.DecodeSigned(tmp[:]) - d.pos += dn - n++ - ok = true - } - if err == io.EOF { - break - } - if err != nil { - d.err = errors.Wrap(err, "mp3") - break - } - } - return n, ok -} - -func (d *decoder) Err() error { - return d.err -} - -func (d *decoder) Len() int { - return int(d.d.Length()) / gomp3BytesPerFrame -} - -func (d *decoder) Position() int { - return d.pos / gomp3BytesPerFrame -} - -func (d *decoder) Seek(p int) error { - if p < 0 || d.Len() < p { - return fmt.Errorf("mp3: seek position %v out of range [%v, %v]", p, 0, d.Len()) - } - _, err := d.d.Seek(int64(p)*gomp3BytesPerFrame, io.SeekStart) - if err != nil { - return errors.Wrap(err, "mp3") - } - d.pos = p * gomp3BytesPerFrame - return nil -} - -func (d *decoder) Close() error { - err := d.closer.Close() - if err != nil { - return errors.Wrap(err, "mp3") - } - return nil -} diff --git a/vendor/github.com/faiface/beep/resample.go b/vendor/github.com/faiface/beep/resample.go deleted file mode 100644 index 902a123..0000000 --- a/vendor/github.com/faiface/beep/resample.go +++ /dev/null @@ -1,174 +0,0 @@ -package beep - -import "fmt" - -// Resample takes a Streamer which is assumed to stream at the old sample rate and returns a -// Streamer, which streams the data from the original Streamer resampled to the new sample rate. -// -// This is, for example, useful when mixing multiple Streamer with different sample rates, either -// through a beep.Mixer, or through a speaker. Speaker has a constant sample rate. Thus, playing -// Streamer which stream at a different sample rate will lead to a changed speed and pitch of the -// playback. -// -// sr := beep.SampleRate(48000) -// speaker.Init(sr, sr.N(time.Second/2)) -// speaker.Play(beep.Resample(3, format.SampleRate, sr, s)) -// -// In the example, the original sample rate of the source if format.SampleRate. We want to play it -// at the speaker's native sample rate and thus we need to resample. -// -// The quality argument specifies the quality of the resampling process. Higher quality implies -// worse performance. Values below 1 or above 64 are invalid and Resample will panic. Here's a table -// for deciding which quality to pick. -// -// quality | use case -// --------|--------- -// 1 | very high performance, on-the-fly resampling, low quality -// 3-4 | good performance, on-the-fly resampling, good quality -// 6 | higher CPU usage, usually not suitable for on-the-fly resampling, very good quality -// >6 | even higher CPU usage, for offline resampling, very good quality -// -// Sane quality values are usually below 16. Higher values will consume too much CPU, giving -// negligible quality improvements. -// -// Resample propagates errors from s. -func Resample(quality int, old, new SampleRate, s Streamer) *Resampler { - return ResampleRatio(quality, float64(old)/float64(new), s) -} - -// ResampleRatio is same as Resample, except it takes the ratio of the old and the new sample rate, -// specifically, the old sample rate divided by the new sample rate. Aside from correcting the -// sample rate, this can be used to change the speed of the audio. For example, resampling at the -// ratio of 2 and playing at the original sample rate will cause doubled speed in playback. -func ResampleRatio(quality int, ratio float64, s Streamer) *Resampler { - if quality < 1 || 64 < quality { - panic(fmt.Errorf("resample: invalid quality: %d", quality)) - } - return &Resampler{ - s: s, - ratio: ratio, - first: true, - buf1: make([][2]float64, 512), - buf2: make([][2]float64, 512), - pts: make([]point, quality*2), - off: 0, - pos: 0, - } -} - -// Resampler is a Streamer created by Resample and ResampleRatio functions. It allows dynamic -// changing of the resampling ratio, which can be useful for dynamically changing the speed of -// streaming. -type Resampler struct { - s Streamer // the orignal streamer - ratio float64 // old sample rate / new sample rate - first bool // true when Stream was not called before - buf1, buf2 [][2]float64 // buf1 contains previous buf2, new data goes into buf2, buf1 is because interpolation might require old samples - pts []point // pts is for points used for interpolation - off int // off is the position of the start of buf2 in the original data - pos int // pos is the current position in the resampled data -} - -// Stream streams the original audio resampled according to the current ratio. -func (r *Resampler) Stream(samples [][2]float64) (n int, ok bool) { - // if it's the first time, we need to fill buf2 with initial data, buf1 remains zeroed - if r.first { - sn, _ := r.s.Stream(r.buf2) - r.buf2 = r.buf2[:sn] - r.first = false - } - // we start resampling, sample by sample - for len(samples) > 0 { - again: - for c := range samples[0] { - // calculate the current position in the original data - j := float64(r.pos) * r.ratio - - // find quality*2 closest samples to j and translate them to points for interpolation - for pi := range r.pts { - // calculate the index of one of the closest samples - k := int(j) + pi - len(r.pts)/2 + 1 - - var y float64 - switch { - // the sample is in buf1 - case k < r.off: - y = r.buf1[len(r.buf1)+k-r.off][c] - // the sample is in buf2 - case k < r.off+len(r.buf2): - y = r.buf2[k-r.off][c] - // the sample is beyond buf2, so we need to load new data - case k >= r.off+len(r.buf2): - // we load into buf1 - sn, _ := r.s.Stream(r.buf1) - // this condition happens when the original Streamer got - // drained and j is after the end of the - // original data - if int(j) >= r.off+len(r.buf2)+sn { - return n, n > 0 - } - // this condition happens when the original Streamer got - // drained and this one of the closest samples is after the - // end of the original data - if k >= r.off+len(r.buf2)+sn { - y = 0 - break - } - // otherwise everything is fine, we swap buffers and start - // calculating the sample again - r.off += len(r.buf2) - r.buf1 = r.buf1[:sn] - r.buf1, r.buf2 = r.buf2, r.buf1 - goto again - } - - r.pts[pi] = point{float64(k), y} - } - - // calculate the resampled sample using polynomial interpolation from the - // quality*2 closest samples - samples[0][c] = lagrange(r.pts, j) - } - samples = samples[1:] - n++ - r.pos++ - } - return n, true -} - -// Err propagates the original Streamer's errors. -func (r *Resampler) Err() error { - return r.s.Err() -} - -// Ratio returns the current resampling ratio. -func (r *Resampler) Ratio() float64 { - return r.ratio -} - -// SetRatio sets the resampling ratio. This does not cause any glitches in the stream. -func (r *Resampler) SetRatio(ratio float64) { - r.pos = int(float64(r.pos) * r.ratio / ratio) - r.ratio = ratio -} - -// lagrange calculates the value at x of a polynomial of order len(pts)+1 which goes through all -// points in pts -func lagrange(pts []point, x float64) (y float64) { - y = 0.0 - for j := range pts { - l := 1.0 - for m := range pts { - if j == m { - continue - } - l *= (x - pts[m].X) / (pts[j].X - pts[m].X) - } - y += pts[j].Y * l - } - return y -} - -type point struct { - X, Y float64 -} diff --git a/vendor/github.com/faiface/beep/speaker/speaker.go b/vendor/github.com/faiface/beep/speaker/speaker.go deleted file mode 100644 index d59389f..0000000 --- a/vendor/github.com/faiface/beep/speaker/speaker.go +++ /dev/null @@ -1,130 +0,0 @@ -// Package speaker implements playback of beep.Streamer values through physical speakers. -package speaker - -import ( - "sync" - - "github.com/faiface/beep" - "github.com/hajimehoshi/oto" - "github.com/pkg/errors" -) - -var ( - mu sync.Mutex - mixer beep.Mixer - samples [][2]float64 - buf []byte - context *oto.Context - player *oto.Player - done chan struct{} -) - -// Init initializes audio playback through speaker. Must be called before using this package. -// -// The bufferSize argument specifies the number of samples of the speaker's buffer. Bigger -// bufferSize means lower CPU usage and more reliable playback. Lower bufferSize means better -// responsiveness and less delay. -func Init(sampleRate beep.SampleRate, bufferSize int) error { - mu.Lock() - defer mu.Unlock() - - Close() - - mixer = beep.Mixer{} - - numBytes := bufferSize * 4 - samples = make([][2]float64, bufferSize) - buf = make([]byte, numBytes) - - var err error - context, err = oto.NewContext(int(sampleRate), 2, 2, numBytes) - if err != nil { - return errors.Wrap(err, "failed to initialize speaker") - } - player = context.NewPlayer() - - done = make(chan struct{}) - - go func() { - for { - select { - default: - update() - case <-done: - return - } - } - }() - - return nil -} - -// Close closes the playback and the driver. In most cases, there is certainly no need to call Close -// even when the program doesn't play anymore, because in properly set systems, the default mixer -// handles multiple concurrent processes. It's only when the default device is not a virtual but hardware -// device, that you'll probably want to manually manage the device from your application. -func Close() { - if player != nil { - if done != nil { - done <- struct{}{} - done = nil - } - player.Close() - context.Close() - player = nil - } -} - -// Lock locks the speaker. While locked, speaker won't pull new data from the playing Stramers. Lock -// if you want to modify any currently playing Streamers to avoid race conditions. -// -// Always lock speaker for as little time as possible, to avoid playback glitches. -func Lock() { - mu.Lock() -} - -// Unlock unlocks the speaker. Call after modifying any currently playing Streamer. -func Unlock() { - mu.Unlock() -} - -// Play starts playing all provided Streamers through the speaker. -func Play(s ...beep.Streamer) { - mu.Lock() - mixer.Add(s...) - mu.Unlock() -} - -// Clear removes all currently playing Streamers from the speaker. -func Clear() { - mu.Lock() - mixer.Clear() - mu.Unlock() -} - -// update pulls new data from the playing Streamers and sends it to the speaker. Blocks until the -// data is sent and started playing. -func update() { - mu.Lock() - mixer.Stream(samples) - mu.Unlock() - - for i := range samples { - for c := range samples[i] { - val := samples[i][c] - if val < -1 { - val = -1 - } - if val > +1 { - val = +1 - } - valInt16 := int16(val * (1<<15 - 1)) - low := byte(valInt16) - high := byte(valInt16 >> 8) - buf[i*4+c*2+0] = low - buf[i*4+c*2+1] = high - } - } - - player.Write(buf) -} diff --git a/vendor/github.com/faiface/beep/streamers.go b/vendor/github.com/faiface/beep/streamers.go deleted file mode 100644 index 39348b6..0000000 --- a/vendor/github.com/faiface/beep/streamers.go +++ /dev/null @@ -1,65 +0,0 @@ -package beep - -// Silence returns a Streamer which streams num samples of silence. If num is negative, silence is -// streamed forever. -func Silence(num int) Streamer { - return StreamerFunc(func(samples [][2]float64) (n int, ok bool) { - if num == 0 { - return 0, false - } - if 0 < num && num < len(samples) { - samples = samples[:num] - } - for i := range samples { - samples[i] = [2]float64{} - } - if num > 0 { - num -= len(samples) - } - return len(samples), true - }) -} - -// Callback returns a Streamer, which does not stream any samples, but instead calls f the first -// time its Stream method is called. -func Callback(f func()) Streamer { - return StreamerFunc(func(samples [][2]float64) (n int, ok bool) { - if f != nil { - f() - f = nil - } - return 0, false - }) -} - -// Iterate returns a Streamer which successively streams Streamers obtains by calling the provided g -// function. The streaming stops when g returns nil. -// -// Iterate does not propagate errors from the generated Streamers. -func Iterate(g func() Streamer) Streamer { - var ( - s Streamer - first = true - ) - return StreamerFunc(func(samples [][2]float64) (n int, ok bool) { - if first { - s = g() - first = false - } - if s == nil { - return 0, false - } - for len(samples) > 0 { - if s == nil { - break - } - sn, sok := s.Stream(samples) - if !sok { - s = g() - } - samples = samples[sn:] - n += sn - } - return n, true - }) -} diff --git a/vendor/github.com/hajimehoshi/go-mp3/.gitignore b/vendor/github.com/hajimehoshi/go-mp3/.gitignore deleted file mode 100644 index 93bfd12..0000000 --- a/vendor/github.com/hajimehoshi/go-mp3/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*~ -.DS_Store diff --git a/vendor/github.com/hajimehoshi/go-mp3/AUTHORS b/vendor/github.com/hajimehoshi/go-mp3/AUTHORS deleted file mode 100644 index d9a8c81..0000000 --- a/vendor/github.com/hajimehoshi/go-mp3/AUTHORS +++ /dev/null @@ -1,2 +0,0 @@ -Christopher Cooper -Hajime Hoshi diff --git a/vendor/github.com/hajimehoshi/go-mp3/LICENSE b/vendor/github.com/hajimehoshi/go-mp3/LICENSE deleted file mode 100644 index 8dada3e..0000000 --- a/vendor/github.com/hajimehoshi/go-mp3/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/hajimehoshi/go-mp3/README.md b/vendor/github.com/hajimehoshi/go-mp3/README.md deleted file mode 100644 index 184c3f2..0000000 --- a/vendor/github.com/hajimehoshi/go-mp3/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# go-mp3 - -[![GoDoc](https://godoc.org/github.com/hajimehoshi/go-mp3?status.svg)](http://godoc.org/github.com/hajimehoshi/go-mp3) - -An MP3 decoder in pure Go based on [PDMP3](https://github.com/technosaurus/PDMP3). - -[Slide at golang.tokyo #11](https://docs.google.com/presentation/d/e/2PACX-1vTTXf-LWNRvMVGQ7GI4Wh8EKohot_9CMtlF4dswpYGpuYKOek5NeNP-_QZnNcRFZp9Cwm0pCcykjqDN/pub?start=false&loop=false&delayms=3000) diff --git a/vendor/github.com/hajimehoshi/go-mp3/decode.go b/vendor/github.com/hajimehoshi/go-mp3/decode.go deleted file mode 100644 index 0da8100..0000000 --- a/vendor/github.com/hajimehoshi/go-mp3/decode.go +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright 2017 Hajime Hoshi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package mp3 - -import ( - "fmt" - "io" - - "github.com/hajimehoshi/go-mp3/internal/consts" - "github.com/hajimehoshi/go-mp3/internal/frame" - "github.com/hajimehoshi/go-mp3/internal/frameheader" -) - -// A Decoder is a MP3-decoded stream. -// -// Decoder decodes its underlying source on the fly. -type Decoder struct { - source *source - sampleRate int - length int64 - frameStarts []int64 - buf []byte - frame *frame.Frame - pos int64 -} - -func (d *Decoder) readFrame() error { - var err error - d.frame, _, err = frame.Read(d.source, d.source.pos, d.frame) - if err != nil { - if err == io.EOF { - return io.EOF - } - if _, ok := err.(*consts.UnexpectedEOF); ok { - // TODO: Log here? - return io.EOF - } - return err - } - d.buf = append(d.buf, d.frame.Decode()...) - return nil -} - -// Read is io.Reader's Read. -func (d *Decoder) Read(buf []byte) (int, error) { - for len(d.buf) == 0 { - if err := d.readFrame(); err != nil { - return 0, err - } - } - n := copy(buf, d.buf) - d.buf = d.buf[n:] - d.pos += int64(n) - return n, nil -} - -// Seek is io.Seeker's Seek. -// -// Seek panics when the underlying source is not io.Seeker. -func (d *Decoder) Seek(offset int64, whence int) (int64, error) { - npos := int64(0) - switch whence { - case io.SeekStart: - npos = offset - case io.SeekCurrent: - npos = d.pos + offset - case io.SeekEnd: - npos = d.Length() + offset - default: - panic(fmt.Sprintf("mp3: invalid whence: %v", whence)) - } - d.pos = npos - d.buf = nil - d.frame = nil - f := d.pos / consts.BytesPerFrame - // If the frame is not first, read the previous ahead of reading that - // because the previous frame can affect the targeted frame. - if f > 0 { - f-- - if _, err := d.source.Seek(d.frameStarts[f], 0); err != nil { - return 0, err - } - if err := d.readFrame(); err != nil { - return 0, err - } - if err := d.readFrame(); err != nil { - return 0, err - } - d.buf = d.buf[consts.BytesPerFrame+(d.pos%consts.BytesPerFrame):] - } else { - if _, err := d.source.Seek(d.frameStarts[f], 0); err != nil { - return 0, err - } - if err := d.readFrame(); err != nil { - return 0, err - } - d.buf = d.buf[d.pos:] - } - return npos, nil -} - -// Close is io.Closer's Close. -func (d *Decoder) Close() error { - return d.source.Close() -} - -// SampleRate returns the sample rate like 44100. -// -// Note that the sample rate is retrieved from the first frame. -func (d *Decoder) SampleRate() int { - return d.sampleRate -} - -func (d *Decoder) ensureFrameStartsAndLength() error { - if d.length != invalidLength { - return nil - } - - if _, ok := d.source.reader.(io.Seeker); !ok { - return nil - } - - // Keep the current position. - pos, err := d.source.Seek(0, io.SeekCurrent) - if err != nil { - return err - } - if err := d.source.rewind(); err != nil { - return err - } - - if err := d.source.skipTags(); err != nil { - return err - } - l := int64(0) - for { - h, pos, err := frameheader.Read(d.source, d.source.pos) - if err != nil { - if err == io.EOF { - break - } - if _, ok := err.(*consts.UnexpectedEOF); ok { - // TODO: Log here? - break - } - return err - } - d.frameStarts = append(d.frameStarts, pos) - l += consts.BytesPerFrame - - buf := make([]byte, h.FrameSize()-4) - if _, err := d.source.ReadFull(buf); err != nil { - if err == io.EOF { - break - } - return err - } - } - d.length = l - - if _, err := d.source.Seek(pos, io.SeekStart); err != nil { - return err - } - return nil -} - -const invalidLength = -1 - -// Length returns the total size in bytes. -// -// Length returns -1 when the total size is not available -// e.g. when the given source is not io.Seeker. -func (d *Decoder) Length() int64 { - return d.length -} - -// NewDecoder decodes the given io.ReadCloser and returns a decoded stream. -// -// The stream is always formatted as 16bit (little endian) 2 channels -// even if the source is single channel MP3. -// Thus, a sample always consists of 4 bytes. -func NewDecoder(r io.ReadCloser) (*Decoder, error) { - s := &source{ - reader: r, - } - d := &Decoder{ - source: s, - length: invalidLength, - } - - if err := s.skipTags(); err != nil { - return nil, err - } - // TODO: Is readFrame here really needed? - if err := d.readFrame(); err != nil { - return nil, err - } - d.sampleRate = d.frame.SamplingFrequency() - - if err := d.ensureFrameStartsAndLength(); err != nil { - return nil, err - } - - return d, nil -} diff --git a/vendor/github.com/hajimehoshi/go-mp3/go.mod b/vendor/github.com/hajimehoshi/go-mp3/go.mod deleted file mode 100644 index a89e70e..0000000 --- a/vendor/github.com/hajimehoshi/go-mp3/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/hajimehoshi/go-mp3 - -require github.com/hajimehoshi/oto v0.1.1 diff --git a/vendor/github.com/hajimehoshi/go-mp3/go.sum b/vendor/github.com/hajimehoshi/go-mp3/go.sum deleted file mode 100644 index e4df059..0000000 --- a/vendor/github.com/hajimehoshi/go-mp3/go.sum +++ /dev/null @@ -1,6 +0,0 @@ -github.com/gopherjs/gopherjs v0.0.0-20180628210949-0892b62f0d9f h1:FDM3EtwZLyhW48YRiyqjivNlNZjAObv4xt4NnJaU+NQ= -github.com/gopherjs/gopherjs v0.0.0-20180628210949-0892b62f0d9f/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gopherjs/gopherwasm v0.1.1 h1:R/3+SfgCFStiql6ICfyfke1WtpglfjIvTEBux8R1euc= -github.com/gopherjs/gopherwasm v0.1.1/go.mod h1:kx4n9a+MzHH0BJJhvlsQ65hqLFXDO/m256AsaDPQ+/4= -github.com/hajimehoshi/oto v0.1.1 h1:EG+WxxeAfde1mI0adhLYvGbKgDCxm7bCTd6g+JIA6vI= -github.com/hajimehoshi/oto v0.1.1/go.mod h1:hUiLWeBQnbDu4pZsAhOnGqMI1ZGibS6e2qhQdfpwz04= diff --git a/vendor/github.com/hajimehoshi/go-mp3/internal/bits/bits.go b/vendor/github.com/hajimehoshi/go-mp3/internal/bits/bits.go deleted file mode 100644 index c4c116a..0000000 --- a/vendor/github.com/hajimehoshi/go-mp3/internal/bits/bits.go +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2017 Hajime Hoshi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bits - -type Bits struct { - vec []byte - bitPos int - bytePos int -} - -func New(vec []byte) *Bits { - return &Bits{ - vec: vec, - } -} - -func Append(bits *Bits, buf []byte) *Bits { - return New(append(bits.vec, buf...)) -} - -func (b *Bits) Bit() int { - if len(b.vec) <= b.bytePos { - // TODO: Should this return error? - return 0 - } - tmp := uint(b.vec[b.bytePos]) >> (7 - uint(b.bitPos)) - tmp &= 0x01 - b.bytePos += (b.bitPos + 1) >> 3 - b.bitPos = (b.bitPos + 1) & 0x07 - return int(tmp) -} - -func (b *Bits) Bits(num int) int { - if num == 0 { - return 0 - } - if len(b.vec) <= b.bytePos { - // TODO: Should this return error? - return 0 - } - bb := make([]byte, 4) - copy(bb, b.vec[b.bytePos:]) - tmp := (uint32(bb[0]) << 24) | (uint32(bb[1]) << 16) | (uint32(bb[2]) << 8) | (uint32(bb[3])) - tmp <<= uint(b.bitPos) - tmp >>= (32 - uint(num)) - b.bytePos += (b.bitPos + num) >> 3 - b.bitPos = (b.bitPos + num) & 0x07 - return int(tmp) -} - -func (b *Bits) BitPos() int { - return b.bytePos<<3 + b.bitPos -} - -func (b *Bits) SetPos(pos int) { - b.bytePos = pos >> 3 - b.bitPos = pos & 0x7 -} - -func (b *Bits) LenInBytes() int { - return len(b.vec) -} - -func (b *Bits) Tail(offset int) []byte { - return b.vec[len(b.vec)-offset:] -} diff --git a/vendor/github.com/hajimehoshi/go-mp3/internal/consts/consts.go b/vendor/github.com/hajimehoshi/go-mp3/internal/consts/consts.go deleted file mode 100644 index 29bfae8..0000000 --- a/vendor/github.com/hajimehoshi/go-mp3/internal/consts/consts.go +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2017 Hajime Hoshi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package consts - -import ( - "fmt" -) - -type UnexpectedEOF struct { - At string -} - -func (u *UnexpectedEOF) Error() string { - return fmt.Sprintf("mp3: unexpected EOF at %s", u.At) -} - -type Version int - -const ( - Version2_5 Version = 0 - VersionReserved Version = 1 - Version2 Version = 2 - Version1 Version = 3 -) - -type Layer int - -const ( - LayerReserved Layer = 0 - Layer3 Layer = 1 - Layer2 Layer = 2 - Layer1 Layer = 3 -) - -type Mode int - -const ( - ModeStereo Mode = 0 - ModeJointStereo Mode = 1 - ModeDualChannel Mode = 2 - ModeSingleChannel Mode = 3 -) - -const ( - SamplesPerGr = 576 - BytesPerFrame = SamplesPerGr * 2 * 4 -) - -type SamplingFrequency int - -const ( - SamplingFrequency44100 SamplingFrequency = 0 - SamplingFrequency48000 SamplingFrequency = 1 - SamplingFrequency32000 SamplingFrequency = 2 - SamplingFrequencyReserved SamplingFrequency = 3 -) - -func (s SamplingFrequency) Int() int { - switch s { - case SamplingFrequency44100: - return 44100 - case SamplingFrequency48000: - return 48000 - case SamplingFrequency32000: - return 32000 - } - panic("not reahed") -} - -type SfBandIndices struct { - L []int - S []int -} - -var ( - SfBandIndicesSet = map[SamplingFrequency]SfBandIndices{ - SamplingFrequency44100: { - L: []int{0, 4, 8, 12, 16, 20, 24, 30, 36, 44, 52, 62, 74, 90, 110, 134, 162, 196, 238, 288, 342, 418, 576}, - S: []int{0, 4, 8, 12, 16, 22, 30, 40, 52, 66, 84, 106, 136, 192}, - }, - SamplingFrequency48000: { - L: []int{0, 4, 8, 12, 16, 20, 24, 30, 36, 42, 50, 60, 72, 88, 106, 128, 156, 190, 230, 276, 330, 384, 576}, - S: []int{0, 4, 8, 12, 16, 22, 28, 38, 50, 64, 80, 100, 126, 192}, - }, - SamplingFrequency32000: { - L: []int{0, 4, 8, 12, 16, 20, 24, 30, 36, 44, 54, 66, 82, 102, 126, 156, 194, 240, 296, 364, 448, 550, 576}, - S: []int{0, 4, 8, 12, 16, 22, 30, 42, 58, 78, 104, 138, 180, 192}, - }, - } -) diff --git a/vendor/github.com/hajimehoshi/go-mp3/internal/frame/frame.go b/vendor/github.com/hajimehoshi/go-mp3/internal/frame/frame.go deleted file mode 100644 index 110e2d3..0000000 --- a/vendor/github.com/hajimehoshi/go-mp3/internal/frame/frame.go +++ /dev/null @@ -1,676 +0,0 @@ -// Copyright 2017 Hajime Hoshi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package frame - -import ( - "fmt" - "io" - "math" - - "github.com/hajimehoshi/go-mp3/internal/bits" - "github.com/hajimehoshi/go-mp3/internal/consts" - "github.com/hajimehoshi/go-mp3/internal/frameheader" - "github.com/hajimehoshi/go-mp3/internal/imdct" - "github.com/hajimehoshi/go-mp3/internal/maindata" - "github.com/hajimehoshi/go-mp3/internal/sideinfo" -) - -var ( - powtab34 = make([]float64, 8207) - pretab = []float64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3, 2, 0} -) - -func init() { - for i := range powtab34 { - powtab34[i] = math.Pow(float64(i), 4.0/3.0) - } -} - -type Frame struct { - header frameheader.FrameHeader - sideInfo *sideinfo.SideInfo - mainData *maindata.MainData - - mainDataBits *bits.Bits - store [2][32][18]float32 - v_vec [2][1024]float32 -} - -type FullReader interface { - ReadFull([]byte) (int, error) -} - -func readCRC(source FullReader) error { - buf := make([]byte, 2) - if n, err := source.ReadFull(buf); n < 2 { - if err == io.EOF { - return &consts.UnexpectedEOF{"readCRC"} - } - return fmt.Errorf("mp3: error at readCRC: %v", err) - } - return nil -} - -func Read(source FullReader, position int64, prev *Frame) (frame *Frame, startPosition int64, err error) { - h, pos, err := frameheader.Read(source, position) - if err != nil { - return nil, 0, err - } - - if h.ProtectionBit() == 0 { - if err := readCRC(source); err != nil { - return nil, 0, err - } - } - - if h.ID() != consts.Version1 { - return nil, 0, fmt.Errorf("mp3: only MPEG version 1 (want %d; got %d) is supported", consts.Version1, h.ID()) - } - if h.Layer() != consts.Layer3 { - return nil, 0, fmt.Errorf("mp3: only layer3 (want %d; got %d) is supported", consts.Layer3, h.Layer()) - } - - si, err := sideinfo.Read(source, h) - if err != nil { - return nil, 0, err - } - - // If there's not enough main data in the bit reservoir, - // signal to calling function so that decoding isn't done! - // Get main data (scalefactors and Huffman coded frequency data) - var prevM *bits.Bits - if prev != nil { - prevM = prev.mainDataBits - } - md, mdb, err := maindata.Read(source, prevM, h, si) - if err != nil { - return nil, 0, err - } - nf := &Frame{ - header: h, - sideInfo: si, - mainData: md, - mainDataBits: mdb, - } - if prev != nil { - nf.store = prev.store - nf.v_vec = prev.v_vec - } - return nf, pos, nil -} - -func (f *Frame) SamplingFrequency() int { - return f.header.SamplingFrequency().Int() -} - -func (f *Frame) Decode() []byte { - out := make([]byte, consts.BytesPerFrame) - nch := f.header.NumberOfChannels() - for gr := 0; gr < 2; gr++ { - for ch := 0; ch < nch; ch++ { - f.requantize(gr, ch) - f.reorder(gr, ch) - } - f.stereo(gr) - for ch := 0; ch < nch; ch++ { - f.antialias(gr, ch) - f.hybridSynthesis(gr, ch) - f.frequencyInversion(gr, ch) - f.subbandSynthesis(gr, ch, out[consts.SamplesPerGr*4*gr:]) - } - } - return out -} - -func (f *Frame) requantizeProcessLong(gr, ch, is_pos, sfb int) { - sf_mult := 0.5 - if f.sideInfo.ScalefacScale[gr][ch] != 0 { - sf_mult = 1.0 - } - pf_x_pt := float64(f.sideInfo.Preflag[gr][ch]) * pretab[sfb] - idx := -(sf_mult * (float64(f.mainData.ScalefacL[gr][ch][sfb]) + pf_x_pt)) + - 0.25*(float64(f.sideInfo.GlobalGain[gr][ch])-210) - tmp1 := math.Pow(2.0, idx) - tmp2 := 0.0 - if f.mainData.Is[gr][ch][is_pos] < 0.0 { - tmp2 = -powtab34[int(-f.mainData.Is[gr][ch][is_pos])] - } else { - tmp2 = powtab34[int(f.mainData.Is[gr][ch][is_pos])] - } - f.mainData.Is[gr][ch][is_pos] = float32(tmp1 * tmp2) -} - -func (f *Frame) requantizeProcessShort(gr, ch, is_pos, sfb, win int) { - sf_mult := 0.5 - if f.sideInfo.ScalefacScale[gr][ch] != 0 { - sf_mult = 1.0 - } - idx := -(sf_mult * float64(f.mainData.ScalefacS[gr][ch][sfb][win])) + - 0.25*(float64(f.sideInfo.GlobalGain[gr][ch])-210.0- - 8.0*float64(f.sideInfo.SubblockGain[gr][ch][win])) - tmp1 := math.Pow(2.0, idx) - tmp2 := 0.0 - if f.mainData.Is[gr][ch][is_pos] < 0 { - tmp2 = -powtab34[int(-f.mainData.Is[gr][ch][is_pos])] - } else { - tmp2 = powtab34[int(f.mainData.Is[gr][ch][is_pos])] - } - f.mainData.Is[gr][ch][is_pos] = float32(tmp1 * tmp2) -} - -func (f *Frame) requantize(gr int, ch int) { - // Setup sampling frequency index - sfreq := f.header.SamplingFrequency() - // Determine type of block to process - if f.sideInfo.WinSwitchFlag[gr][ch] == 1 && f.sideInfo.BlockType[gr][ch] == 2 { // Short blocks - // Check if the first two subbands - // (=2*18 samples = 8 long or 3 short sfb's) uses long blocks - if f.sideInfo.MixedBlockFlag[gr][ch] != 0 { // 2 longbl. sb first - // First process the 2 long block subbands at the start - sfb := 0 - next_sfb := consts.SfBandIndicesSet[sfreq].L[sfb+1] - for i := 0; i < 36; i++ { - if i == next_sfb { - sfb++ - next_sfb = consts.SfBandIndicesSet[sfreq].L[sfb+1] - } - f.requantizeProcessLong(gr, ch, i, sfb) - } - // And next the remaining,non-zero,bands which uses short blocks - sfb = 3 - next_sfb = consts.SfBandIndicesSet[sfreq].S[sfb+1] * 3 - win_len := consts.SfBandIndicesSet[sfreq].S[sfb+1] - - consts.SfBandIndicesSet[sfreq].S[sfb] - - for i := 36; i < int(f.sideInfo.Count1[gr][ch]); /* i++ done below! */ { - // Check if we're into the next scalefac band - if i == next_sfb { - sfb++ - next_sfb = consts.SfBandIndicesSet[sfreq].S[sfb+1] * 3 - win_len = consts.SfBandIndicesSet[sfreq].S[sfb+1] - - consts.SfBandIndicesSet[sfreq].S[sfb] - } - for win := 0; win < 3; win++ { - for j := 0; j < win_len; j++ { - f.requantizeProcessShort(gr, ch, i, sfb, win) - i++ - } - } - - } - } else { // Only short blocks - sfb := 0 - next_sfb := consts.SfBandIndicesSet[sfreq].S[sfb+1] * 3 - win_len := consts.SfBandIndicesSet[sfreq].S[sfb+1] - - consts.SfBandIndicesSet[sfreq].S[sfb] - for i := 0; i < int(f.sideInfo.Count1[gr][ch]); /* i++ done below! */ { - // Check if we're into the next scalefac band - if i == next_sfb { - sfb++ - next_sfb = consts.SfBandIndicesSet[sfreq].S[sfb+1] * 3 - win_len = consts.SfBandIndicesSet[sfreq].S[sfb+1] - - consts.SfBandIndicesSet[sfreq].S[sfb] - } - for win := 0; win < 3; win++ { - for j := 0; j < win_len; j++ { - f.requantizeProcessShort(gr, ch, i, sfb, win) - i++ - } - } - } - } - } else { // Only long blocks - sfb := 0 - next_sfb := consts.SfBandIndicesSet[sfreq].L[sfb+1] - for i := 0; i < int(f.sideInfo.Count1[gr][ch]); i++ { - if i == next_sfb { - sfb++ - next_sfb = consts.SfBandIndicesSet[sfreq].L[sfb+1] - } - f.requantizeProcessLong(gr, ch, i, sfb) - } - } -} - -func (f *Frame) reorder(gr int, ch int) { - re := make([]float32, consts.SamplesPerGr) - - sfreq := f.header.SamplingFrequency() // Setup sampling freq index - // Only reorder short blocks - if (f.sideInfo.WinSwitchFlag[gr][ch] == 1) && (f.sideInfo.BlockType[gr][ch] == 2) { // Short blocks - // Check if the first two subbands - // (=2*18 samples = 8 long or 3 short sfb's) uses long blocks - sfb := 0 - // 2 longbl. sb first - if f.sideInfo.MixedBlockFlag[gr][ch] != 0 { - sfb = 3 - } - next_sfb := consts.SfBandIndicesSet[sfreq].S[sfb+1] * 3 - win_len := consts.SfBandIndicesSet[sfreq].S[sfb+1] - consts.SfBandIndicesSet[sfreq].S[sfb] - i := 36 - if sfb == 0 { - i = 0 - } - for i < consts.SamplesPerGr { - // Check if we're into the next scalefac band - if i == next_sfb { - // Copy reordered data back to the original vector - j := 3 * consts.SfBandIndicesSet[sfreq].S[sfb] - copy(f.mainData.Is[gr][ch][j:j+3*win_len], re[0:3*win_len]) - // Check if this band is above the rzero region,if so we're done - if i >= f.sideInfo.Count1[gr][ch] { - return - } - sfb++ - next_sfb = consts.SfBandIndicesSet[sfreq].S[sfb+1] * 3 - win_len = consts.SfBandIndicesSet[sfreq].S[sfb+1] - consts.SfBandIndicesSet[sfreq].S[sfb] - } - for win := 0; win < 3; win++ { // Do the actual reordering - for j := 0; j < win_len; j++ { - re[j*3+win] = f.mainData.Is[gr][ch][i] - i++ - } - } - } - // Copy reordered data of last band back to original vector - j := 3 * consts.SfBandIndicesSet[sfreq].S[12] - copy(f.mainData.Is[gr][ch][j:j+3*win_len], re[0:3*win_len]) - } -} - -var ( - isRatios = []float32{0.000000, 0.267949, 0.577350, 1.000000, 1.732051, 3.732051} -) - -func (f *Frame) stereoProcessIntensityLong(gr int, sfb int) { - is_ratio_l := float32(0) - is_ratio_r := float32(0) - // Check that((is_pos[sfb]=scalefac) < 7) => no intensity stereo - if is_pos := f.mainData.ScalefacL[gr][0][sfb]; is_pos < 7 { - sfreq := f.header.SamplingFrequency() // Setup sampling freq index - sfb_start := consts.SfBandIndicesSet[sfreq].L[sfb] - sfb_stop := consts.SfBandIndicesSet[sfreq].L[sfb+1] - if is_pos == 6 { // tan((6*PI)/12 = PI/2) needs special treatment! - is_ratio_l = 1.0 - is_ratio_r = 0.0 - } else { - is_ratio_l = isRatios[is_pos] / (1.0 + isRatios[is_pos]) - is_ratio_r = 1.0 / (1.0 + isRatios[is_pos]) - } - // Now decode all samples in this scale factor band - for i := sfb_start; i < sfb_stop; i++ { - f.mainData.Is[gr][0][i] *= is_ratio_l - f.mainData.Is[gr][1][i] *= is_ratio_r - } - } -} - -func (f *Frame) stereoProcessIntensityShort(gr int, sfb int) { - is_ratio_l := float32(0) - is_ratio_r := float32(0) - sfreq := f.header.SamplingFrequency() // Setup sampling freq index - // The window length - win_len := consts.SfBandIndicesSet[sfreq].S[sfb+1] - consts.SfBandIndicesSet[sfreq].S[sfb] - // The three windows within the band has different scalefactors - for win := 0; win < 3; win++ { - // Check that((is_pos[sfb]=scalefac) < 7) => no intensity stereo - is_pos := f.mainData.ScalefacS[gr][0][sfb][win] - if is_pos < 7 { - sfb_start := consts.SfBandIndicesSet[sfreq].S[sfb]*3 + win_len*win - sfb_stop := sfb_start + win_len - if is_pos == 6 { // tan((6*PI)/12 = PI/2) needs special treatment! - is_ratio_l = 1.0 - is_ratio_r = 0.0 - } else { - is_ratio_l = isRatios[is_pos] / (1.0 + isRatios[is_pos]) - is_ratio_r = 1.0 / (1.0 + isRatios[is_pos]) - } - // Now decode all samples in this scale factor band - for i := sfb_start; i < sfb_stop; i++ { - // https://github.com/technosaurus/PDMP3/issues/3 - f.mainData.Is[gr][0][i] *= is_ratio_l - f.mainData.Is[gr][1][i] *= is_ratio_r - } - } - } -} - -func (f *Frame) stereo(gr int) { - if f.header.UseMSStereo() { - // Determine how many frequency lines to transform - i := 1 - if f.sideInfo.Count1[gr][0] > f.sideInfo.Count1[gr][1] { - i = 0 - } - max_pos := int(f.sideInfo.Count1[gr][i]) - // Do the actual processing - const invSqrt2 = math.Sqrt2 / 2 - for i := 0; i < max_pos; i++ { - left := (f.mainData.Is[gr][0][i] + f.mainData.Is[gr][1][i]) * invSqrt2 - right := (f.mainData.Is[gr][0][i] - f.mainData.Is[gr][1][i]) * invSqrt2 - f.mainData.Is[gr][0][i] = left - f.mainData.Is[gr][1][i] = right - } - } - - if f.header.UseIntensityStereo() { - // Setup sampling frequency index - sfreq := f.header.SamplingFrequency() - - // First band that is intensity stereo encoded is first band scale factor - // band on or above count1 frequency line. N.B.: Intensity stereo coding is - // only done for higher subbands, but logic is here for lower subbands. - // Determine type of block to process - if (f.sideInfo.WinSwitchFlag[gr][0] == 1) && - (f.sideInfo.BlockType[gr][0] == 2) { // Short blocks - // Check if the first two subbands - // (=2*18 samples = 8 long or 3 short sfb's) uses long blocks - if f.sideInfo.MixedBlockFlag[gr][0] != 0 { // 2 longbl. sb first - for sfb := 0; sfb < 8; sfb++ { // First process 8 sfb's at start - // Is this scale factor band above count1 for the right channel? - if consts.SfBandIndicesSet[sfreq].L[sfb] >= f.sideInfo.Count1[gr][1] { - f.stereoProcessIntensityLong(gr, sfb) - } - } - // And next the remaining bands which uses short blocks - for sfb := 3; sfb < 12; sfb++ { - // Is this scale factor band above count1 for the right channel? - if consts.SfBandIndicesSet[sfreq].S[sfb]*3 >= f.sideInfo.Count1[gr][1] { - f.stereoProcessIntensityShort(gr, sfb) - } - } - } else { // Only short blocks - for sfb := 0; sfb < 12; sfb++ { - // Is this scale factor band above count1 for the right channel? - if consts.SfBandIndicesSet[sfreq].S[sfb]*3 >= f.sideInfo.Count1[gr][1] { - f.stereoProcessIntensityShort(gr, sfb) - } - } - } - } else { // Only long blocks - for sfb := 0; sfb < 21; sfb++ { - // Is this scale factor band above count1 for the right channel? - if consts.SfBandIndicesSet[sfreq].L[sfb] >= f.sideInfo.Count1[gr][1] { - f.stereoProcessIntensityLong(gr, sfb) - } - } - } - } -} - -var ( - cs = []float32{0.857493, 0.881742, 0.949629, 0.983315, 0.995518, 0.999161, 0.999899, 0.999993} - ca = []float32{-0.514496, -0.471732, -0.313377, -0.181913, -0.094574, -0.040966, -0.014199, -0.003700} -) - -func (f *Frame) antialias(gr int, ch int) { - // No antialiasing is done for short blocks - if (f.sideInfo.WinSwitchFlag[gr][ch] == 1) && - (f.sideInfo.BlockType[gr][ch] == 2) && - (f.sideInfo.MixedBlockFlag[gr][ch]) == 0 { - return - } - // Setup the limit for how many subbands to transform - sblim := 32 - if (f.sideInfo.WinSwitchFlag[gr][ch] == 1) && - (f.sideInfo.BlockType[gr][ch] == 2) && - (f.sideInfo.MixedBlockFlag[gr][ch] == 1) { - sblim = 2 - } - // Do the actual antialiasing - for sb := 1; sb < sblim; sb++ { - for i := 0; i < 8; i++ { - li := 18*sb - 1 - i - ui := 18*sb + i - lb := f.mainData.Is[gr][ch][li]*cs[i] - f.mainData.Is[gr][ch][ui]*ca[i] - ub := f.mainData.Is[gr][ch][ui]*cs[i] + f.mainData.Is[gr][ch][li]*ca[i] - f.mainData.Is[gr][ch][li] = lb - f.mainData.Is[gr][ch][ui] = ub - } - } -} - -func (f *Frame) hybridSynthesis(gr int, ch int) { - // Loop through all 32 subbands - for sb := 0; sb < 32; sb++ { - // Determine blocktype for this subband - bt := int(f.sideInfo.BlockType[gr][ch]) - if (f.sideInfo.WinSwitchFlag[gr][ch] == 1) && - (f.sideInfo.MixedBlockFlag[gr][ch] == 1) && (sb < 2) { - bt = 0 - } - // Do the inverse modified DCT and windowing - in := make([]float32, 18) - for i := range in { - in[i] = f.mainData.Is[gr][ch][sb*18+i] - } - rawout := imdct.Win(in, bt) - // Overlapp add with stored vector into main_data vector - for i := 0; i < 18; i++ { - f.mainData.Is[gr][ch][sb*18+i] = rawout[i] + f.store[ch][sb][i] - f.store[ch][sb][i] = rawout[i+18] - } - } -} - -func (f *Frame) frequencyInversion(gr int, ch int) { - for sb := 1; sb < 32; sb += 2 { - for i := 1; i < 18; i += 2 { - f.mainData.Is[gr][ch][sb*18+i] = -f.mainData.Is[gr][ch][sb*18+i] - } - } -} - -var synthNWin = [64][32]float32{} - -func init() { - for i := 0; i < 64; i++ { - for j := 0; j < 32; j++ { - synthNWin[i][j] = - float32(math.Cos(float64((16+i)*(2*j+1)) * (math.Pi / 64.0))) - } - } -} - -var synthDtbl = [512]float32{ - 0.000000000, -0.000015259, -0.000015259, -0.000015259, - -0.000015259, -0.000015259, -0.000015259, -0.000030518, - -0.000030518, -0.000030518, -0.000030518, -0.000045776, - -0.000045776, -0.000061035, -0.000061035, -0.000076294, - -0.000076294, -0.000091553, -0.000106812, -0.000106812, - -0.000122070, -0.000137329, -0.000152588, -0.000167847, - -0.000198364, -0.000213623, -0.000244141, -0.000259399, - -0.000289917, -0.000320435, -0.000366211, -0.000396729, - -0.000442505, -0.000473022, -0.000534058, -0.000579834, - -0.000625610, -0.000686646, -0.000747681, -0.000808716, - -0.000885010, -0.000961304, -0.001037598, -0.001113892, - -0.001205444, -0.001296997, -0.001388550, -0.001480103, - -0.001586914, -0.001693726, -0.001785278, -0.001907349, - -0.002014160, -0.002120972, -0.002243042, -0.002349854, - -0.002456665, -0.002578735, -0.002685547, -0.002792358, - -0.002899170, -0.002990723, -0.003082275, -0.003173828, - 0.003250122, 0.003326416, 0.003387451, 0.003433228, - 0.003463745, 0.003479004, 0.003479004, 0.003463745, - 0.003417969, 0.003372192, 0.003280640, 0.003173828, - 0.003051758, 0.002883911, 0.002700806, 0.002487183, - 0.002227783, 0.001937866, 0.001617432, 0.001266479, - 0.000869751, 0.000442505, -0.000030518, -0.000549316, - -0.001098633, -0.001693726, -0.002334595, -0.003005981, - -0.003723145, -0.004486084, -0.005294800, -0.006118774, - -0.007003784, -0.007919312, -0.008865356, -0.009841919, - -0.010848999, -0.011886597, -0.012939453, -0.014022827, - -0.015121460, -0.016235352, -0.017349243, -0.018463135, - -0.019577026, -0.020690918, -0.021789551, -0.022857666, - -0.023910522, -0.024932861, -0.025909424, -0.026840210, - -0.027725220, -0.028533936, -0.029281616, -0.029937744, - -0.030532837, -0.031005859, -0.031387329, -0.031661987, - -0.031814575, -0.031845093, -0.031738281, -0.031478882, - 0.031082153, 0.030517578, 0.029785156, 0.028884888, - 0.027801514, 0.026535034, 0.025085449, 0.023422241, - 0.021575928, 0.019531250, 0.017257690, 0.014801025, - 0.012115479, 0.009231567, 0.006134033, 0.002822876, - -0.000686646, -0.004394531, -0.008316040, -0.012420654, - -0.016708374, -0.021179199, -0.025817871, -0.030609131, - -0.035552979, -0.040634155, -0.045837402, -0.051132202, - -0.056533813, -0.061996460, -0.067520142, -0.073059082, - -0.078628540, -0.084182739, -0.089706421, -0.095169067, - -0.100540161, -0.105819702, -0.110946655, -0.115921021, - -0.120697021, -0.125259399, -0.129562378, -0.133590698, - -0.137298584, -0.140670776, -0.143676758, -0.146255493, - -0.148422241, -0.150115967, -0.151306152, -0.151962280, - -0.152069092, -0.151596069, -0.150497437, -0.148773193, - -0.146362305, -0.143264771, -0.139450073, -0.134887695, - -0.129577637, -0.123474121, -0.116577148, -0.108856201, - 0.100311279, 0.090927124, 0.080688477, 0.069595337, - 0.057617188, 0.044784546, 0.031082153, 0.016510010, - 0.001068115, -0.015228271, -0.032379150, -0.050354004, - -0.069168091, -0.088775635, -0.109161377, -0.130310059, - -0.152206421, -0.174789429, -0.198059082, -0.221984863, - -0.246505737, -0.271591187, -0.297210693, -0.323318481, - -0.349868774, -0.376800537, -0.404083252, -0.431655884, - -0.459472656, -0.487472534, -0.515609741, -0.543823242, - -0.572036743, -0.600219727, -0.628295898, -0.656219482, - -0.683914185, -0.711318970, -0.738372803, -0.765029907, - -0.791213989, -0.816864014, -0.841949463, -0.866363525, - -0.890090942, -0.913055420, -0.935195923, -0.956481934, - -0.976852417, -0.996246338, -1.014617920, -1.031936646, - -1.048156738, -1.063217163, -1.077117920, -1.089782715, - -1.101211548, -1.111373901, -1.120223999, -1.127746582, - -1.133926392, -1.138763428, -1.142211914, -1.144287109, - 1.144989014, 1.144287109, 1.142211914, 1.138763428, - 1.133926392, 1.127746582, 1.120223999, 1.111373901, - 1.101211548, 1.089782715, 1.077117920, 1.063217163, - 1.048156738, 1.031936646, 1.014617920, 0.996246338, - 0.976852417, 0.956481934, 0.935195923, 0.913055420, - 0.890090942, 0.866363525, 0.841949463, 0.816864014, - 0.791213989, 0.765029907, 0.738372803, 0.711318970, - 0.683914185, 0.656219482, 0.628295898, 0.600219727, - 0.572036743, 0.543823242, 0.515609741, 0.487472534, - 0.459472656, 0.431655884, 0.404083252, 0.376800537, - 0.349868774, 0.323318481, 0.297210693, 0.271591187, - 0.246505737, 0.221984863, 0.198059082, 0.174789429, - 0.152206421, 0.130310059, 0.109161377, 0.088775635, - 0.069168091, 0.050354004, 0.032379150, 0.015228271, - -0.001068115, -0.016510010, -0.031082153, -0.044784546, - -0.057617188, -0.069595337, -0.080688477, -0.090927124, - 0.100311279, 0.108856201, 0.116577148, 0.123474121, - 0.129577637, 0.134887695, 0.139450073, 0.143264771, - 0.146362305, 0.148773193, 0.150497437, 0.151596069, - 0.152069092, 0.151962280, 0.151306152, 0.150115967, - 0.148422241, 0.146255493, 0.143676758, 0.140670776, - 0.137298584, 0.133590698, 0.129562378, 0.125259399, - 0.120697021, 0.115921021, 0.110946655, 0.105819702, - 0.100540161, 0.095169067, 0.089706421, 0.084182739, - 0.078628540, 0.073059082, 0.067520142, 0.061996460, - 0.056533813, 0.051132202, 0.045837402, 0.040634155, - 0.035552979, 0.030609131, 0.025817871, 0.021179199, - 0.016708374, 0.012420654, 0.008316040, 0.004394531, - 0.000686646, -0.002822876, -0.006134033, -0.009231567, - -0.012115479, -0.014801025, -0.017257690, -0.019531250, - -0.021575928, -0.023422241, -0.025085449, -0.026535034, - -0.027801514, -0.028884888, -0.029785156, -0.030517578, - 0.031082153, 0.031478882, 0.031738281, 0.031845093, - 0.031814575, 0.031661987, 0.031387329, 0.031005859, - 0.030532837, 0.029937744, 0.029281616, 0.028533936, - 0.027725220, 0.026840210, 0.025909424, 0.024932861, - 0.023910522, 0.022857666, 0.021789551, 0.020690918, - 0.019577026, 0.018463135, 0.017349243, 0.016235352, - 0.015121460, 0.014022827, 0.012939453, 0.011886597, - 0.010848999, 0.009841919, 0.008865356, 0.007919312, - 0.007003784, 0.006118774, 0.005294800, 0.004486084, - 0.003723145, 0.003005981, 0.002334595, 0.001693726, - 0.001098633, 0.000549316, 0.000030518, -0.000442505, - -0.000869751, -0.001266479, -0.001617432, -0.001937866, - -0.002227783, -0.002487183, -0.002700806, -0.002883911, - -0.003051758, -0.003173828, -0.003280640, -0.003372192, - -0.003417969, -0.003463745, -0.003479004, -0.003479004, - -0.003463745, -0.003433228, -0.003387451, -0.003326416, - 0.003250122, 0.003173828, 0.003082275, 0.002990723, - 0.002899170, 0.002792358, 0.002685547, 0.002578735, - 0.002456665, 0.002349854, 0.002243042, 0.002120972, - 0.002014160, 0.001907349, 0.001785278, 0.001693726, - 0.001586914, 0.001480103, 0.001388550, 0.001296997, - 0.001205444, 0.001113892, 0.001037598, 0.000961304, - 0.000885010, 0.000808716, 0.000747681, 0.000686646, - 0.000625610, 0.000579834, 0.000534058, 0.000473022, - 0.000442505, 0.000396729, 0.000366211, 0.000320435, - 0.000289917, 0.000259399, 0.000244141, 0.000213623, - 0.000198364, 0.000167847, 0.000152588, 0.000137329, - 0.000122070, 0.000106812, 0.000106812, 0.000091553, - 0.000076294, 0.000076294, 0.000061035, 0.000061035, - 0.000045776, 0.000045776, 0.000030518, 0.000030518, - 0.000030518, 0.000030518, 0.000015259, 0.000015259, - 0.000015259, 0.000015259, 0.000015259, 0.000015259, -} - -func (f *Frame) subbandSynthesis(gr int, ch int, out []byte) { - u_vec := make([]float32, 512) - s_vec := make([]float32, 32) - - nch := f.header.NumberOfChannels() - // Setup the n_win windowing vector and the v_vec intermediate vector - for ss := 0; ss < 18; ss++ { // Loop through 18 samples in 32 subbands - copy(f.v_vec[ch][64:1024], f.v_vec[ch][0:1024-64]) - d := f.mainData.Is[gr][ch] - for i := 0; i < 32; i++ { // Copy next 32 time samples to a temp vector - s_vec[i] = d[i*18+ss] - } - for i := 0; i < 64; i++ { // Matrix multiply input with n_win[][] matrix - sum := float32(0) - for j := 0; j < 32; j++ { - sum += synthNWin[i][j] * s_vec[j] - } - f.v_vec[ch][i] = sum - } - v := f.v_vec[ch] - for i := 0; i < 512; i += 64 { // Build the U vector - copy(u_vec[i:i+32], v[(i<<1):(i<<1)+32]) - copy(u_vec[i+32:i+64], v[(i<<1)+96:(i<<1)+128]) - } - for i := 0; i < 512; i++ { // Window by u_vec[i] with synthDtbl[i] - u_vec[i] *= synthDtbl[i] - } - for i := 0; i < 32; i++ { // Calc 32 samples,store in outdata vector - sum := float32(0) - for j := 0; j < 512; j += 32 { - sum += u_vec[j+i] - } - // sum now contains time sample 32*ss+i. Convert to 16-bit signed int - samp := int(sum * 32767) - if samp > 32767 { - samp = 32767 - } else if samp < -32767 { - samp = -32767 - } - s := int16(samp) - idx := 4 * (32*ss + i) - if nch == 1 { - // We always run in stereo mode and duplicate channels here for mono. - out[idx] = byte(s) - out[idx+1] = byte(s >> 8) - out[idx+2] = byte(s) - out[idx+3] = byte(s >> 8) - continue - } - if ch == 0 { - out[idx] = byte(s) - out[idx+1] = byte(s >> 8) - } else { - out[idx+2] = byte(s) - out[idx+3] = byte(s >> 8) - } - } - } -} diff --git a/vendor/github.com/hajimehoshi/go-mp3/internal/frameheader/frameheader.go b/vendor/github.com/hajimehoshi/go-mp3/internal/frameheader/frameheader.go deleted file mode 100644 index f2ce034..0000000 --- a/vendor/github.com/hajimehoshi/go-mp3/internal/frameheader/frameheader.go +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright 2017 Hajime Hoshi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package frameheader - -import ( - "fmt" - "io" - - "github.com/hajimehoshi/go-mp3/internal/consts" -) - -// A mepg1FrameHeader is MPEG1 Layer 1-3 frame header -type FrameHeader uint32 - -// ID returns this header's ID stored in position 20,19 -func (f FrameHeader) ID() consts.Version { - return consts.Version((f & 0x00180000) >> 19) -} - -// Layer returns the mpeg layer of this frame stored in position 18,17 -func (f FrameHeader) Layer() consts.Layer { - return consts.Layer((f & 0x00060000) >> 17) -} - -// ProtectionBit returns the protection bit stored in position 16 -func (f FrameHeader) ProtectionBit() int { - return int(f&0x00010000) >> 16 -} - -// BirateIndex returns the bitrate index stored in position 15,12 -func (f FrameHeader) BitrateIndex() int { - return int(f&0x0000f000) >> 12 -} - -// SamplingFrequency returns the SamplingFrequency in Hz stored in position 11,10 -func (f FrameHeader) SamplingFrequency() consts.SamplingFrequency { - return consts.SamplingFrequency(int(f&0x00000c00) >> 10) -} - -// PaddingBit returns the padding bit stored in position 9 -func (f FrameHeader) PaddingBit() int { - return int(f&0x00000200) >> 9 -} - -// PrivateBit returns the private bit stored in position 8 - this bit may be used to store arbitrary data to be used -// by an application -func (f FrameHeader) PrivateBit() int { - return int(f&0x00000100) >> 8 -} - -// Mode returns the channel mode, stored in position 7,6 -func (f FrameHeader) Mode() consts.Mode { - return consts.Mode((f & 0x000000c0) >> 6) -} - -// modeExtension returns the mode_extension - for use with Joint Stereo - stored in position 4,5 -func (f FrameHeader) modeExtension() int { - return int(f&0x00000030) >> 4 -} - -// UseMSStereo returns a boolean value indicating whether the frame uses middle/side stereo. -func (f FrameHeader) UseMSStereo() bool { - if f.Mode() != consts.ModeJointStereo { - return false - } - return f.modeExtension()&0x2 != 0 -} - -// UseIntensityStereo returns a boolean value indicating whether the frame uses intensity stereo. -func (f FrameHeader) UseIntensityStereo() bool { - if f.Mode() != consts.ModeJointStereo { - return false - } - return f.modeExtension()&0x1 != 0 -} - -// Copyright returns whether or not this recording is copywritten - stored in position 3 -func (f FrameHeader) Copyright() int { - return int(f&0x00000008) >> 3 -} - -// OriginalOrCopy returns whether or not this is an Original recording or a copy of one - stored in position 2 -func (f FrameHeader) OriginalOrCopy() int { - return int(f&0x00000004) >> 2 -} - -// Emphasis returns emphasis - the emphasis indication is here to tell the decoder that the file must be de-emphasized - stored in position 0,1 -func (f FrameHeader) Emphasis() int { - return int(f&0x00000003) >> 0 -} - -// IsValid returns a boolean value indicating whether the header is valid or not. -func (f FrameHeader) IsValid() bool { - const sync = 0xffe00000 - if (f & sync) != sync { - return false - } - if f.ID() == consts.VersionReserved { - return false - } - if f.BitrateIndex() == 15 { - return false - } - if f.SamplingFrequency() == consts.SamplingFrequencyReserved { - return false - } - if f.Layer() == consts.LayerReserved { - return false - } - if f.Emphasis() == 2 { - return false - } - return true -} - -func bitrate(layer consts.Layer, index int) int { - switch layer { - case consts.Layer1: - return []int{ - 0, 32000, 64000, 96000, 128000, 160000, 192000, 224000, - 256000, 288000, 320000, 352000, 384000, 416000, 448000}[index] - case consts.Layer2: - return []int{ - 0, 32000, 48000, 56000, 64000, 80000, 96000, 112000, - 128000, 160000, 192000, 224000, 256000, 320000, 384000}[index] - case consts.Layer3: - return []int{ - 0, 32000, 40000, 48000, 56000, 64000, 80000, 96000, - 112000, 128000, 160000, 192000, 224000, 256000, 320000}[index] - } - panic("not reached") -} - -func (f FrameHeader) FrameSize() int { - return (144*bitrate(f.Layer(), f.BitrateIndex()))/ - f.SamplingFrequency().Int() + - int(f.PaddingBit()) -} - -func (f FrameHeader) NumberOfChannels() int { - if f.Mode() == consts.ModeSingleChannel { - return 1 - } - return 2 -} - -type FullReader interface { - ReadFull([]byte) (int, error) -} - -func Read(source FullReader, position int64) (h FrameHeader, startPosition int64, err error) { - buf := make([]byte, 4) - if n, err := source.ReadFull(buf); n < 4 { - if err == io.EOF { - if n == 0 { - // Expected EOF - return 0, 0, io.EOF - } - return 0, 0, &consts.UnexpectedEOF{"readHeader (1)"} - } - return 0, 0, err - } - - b1 := uint32(buf[0]) - b2 := uint32(buf[1]) - b3 := uint32(buf[2]) - b4 := uint32(buf[3]) - header := FrameHeader((b1 << 24) | (b2 << 16) | (b3 << 8) | (b4 << 0)) - for !header.IsValid() { - b1 = b2 - b2 = b3 - b3 = b4 - - buf := make([]byte, 1) - if _, err := source.ReadFull(buf); err != nil { - if err == io.EOF { - return 0, 0, &consts.UnexpectedEOF{"readHeader (2)"} - } - return 0, 0, err - } - b4 = uint32(buf[0]) - header = FrameHeader((b1 << 24) | (b2 << 16) | (b3 << 8) | (b4 << 0)) - position++ - } - - // If we get here we've found the sync word, and can decode the header - // which is in the low 20 bits of the 32-bit sync+header word. - - if header.BitrateIndex() == 0 { - return 0, 0, fmt.Errorf("mp3: free bitrate format is not supported. Header word is 0x%08x at position %d", - header, position) - } - return header, position, nil -} diff --git a/vendor/github.com/hajimehoshi/go-mp3/internal/huffman/huffman.go b/vendor/github.com/hajimehoshi/go-mp3/internal/huffman/huffman.go deleted file mode 100644 index abc3005..0000000 --- a/vendor/github.com/hajimehoshi/go-mp3/internal/huffman/huffman.go +++ /dev/null @@ -1,419 +0,0 @@ -// Copyright 2017 Hajime Hoshi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package huffman - -import ( - "fmt" - - "github.com/hajimehoshi/go-mp3/internal/bits" -) - -var huffmanTable = []uint16{ - // 1 - 0x0201, 0x0000, 0x0201, 0x0010, 0x0201, 0x0001, 0x0011, - // 2 - 0x0201, 0x0000, 0x0401, 0x0201, 0x0010, 0x0001, 0x0201, 0x0011, 0x0401, 0x0201, 0x0020, - 0x0021, 0x0201, 0x0012, 0x0201, 0x0002, 0x0022, - // 3 - 0x0401, 0x0201, 0x0000, 0x0001, 0x0201, 0x0011, 0x0201, 0x0010, 0x0401, 0x0201, 0x0020, - 0x0021, 0x0201, 0x0012, 0x0201, 0x0002, 0x0022, - // 5 - 0x0201, 0x0000, 0x0401, 0x0201, 0x0010, 0x0001, 0x0201, 0x0011, 0x0801, 0x0401, 0x0201, - 0x0020, 0x0002, 0x0201, 0x0021, 0x0012, 0x0801, 0x0401, 0x0201, 0x0022, 0x0030, 0x0201, - 0x0003, 0x0013, 0x0201, 0x0031, 0x0201, 0x0032, 0x0201, 0x0023, 0x0033, - // 6 - 0x0601, 0x0401, 0x0201, 0x0000, 0x0010, 0x0011, 0x0601, 0x0201, 0x0001, 0x0201, 0x0020, - 0x0021, 0x0601, 0x0201, 0x0012, 0x0201, 0x0002, 0x0022, 0x0401, 0x0201, 0x0031, 0x0013, - 0x0401, 0x0201, 0x0030, 0x0032, 0x0201, 0x0023, 0x0201, 0x0003, 0x0033, - // 7 - 0x0201, 0x0000, 0x0401, 0x0201, 0x0010, 0x0001, 0x0801, 0x0201, 0x0011, 0x0401, 0x0201, - 0x0020, 0x0002, 0x0021, 0x1201, 0x0601, 0x0201, 0x0012, 0x0201, 0x0022, 0x0030, 0x0401, - 0x0201, 0x0031, 0x0013, 0x0401, 0x0201, 0x0003, 0x0032, 0x0201, 0x0023, 0x0004, 0x0a01, - 0x0401, 0x0201, 0x0040, 0x0041, 0x0201, 0x0014, 0x0201, 0x0042, 0x0024, 0x0c01, 0x0601, - 0x0401, 0x0201, 0x0033, 0x0043, 0x0050, 0x0401, 0x0201, 0x0034, 0x0005, 0x0051, 0x0601, - 0x0201, 0x0015, 0x0201, 0x0052, 0x0025, 0x0401, 0x0201, 0x0044, 0x0035, 0x0401, 0x0201, - 0x0053, 0x0054, 0x0201, 0x0045, 0x0055, - // 8 - 0x0601, 0x0201, 0x0000, 0x0201, 0x0010, 0x0001, 0x0201, 0x0011, 0x0401, 0x0201, 0x0021, - 0x0012, 0x0e01, 0x0401, 0x0201, 0x0020, 0x0002, 0x0201, 0x0022, 0x0401, 0x0201, 0x0030, - 0x0003, 0x0201, 0x0031, 0x0013, 0x0e01, 0x0801, 0x0401, 0x0201, 0x0032, 0x0023, 0x0201, - 0x0040, 0x0004, 0x0201, 0x0041, 0x0201, 0x0014, 0x0042, 0x0c01, 0x0601, 0x0201, 0x0024, - 0x0201, 0x0033, 0x0050, 0x0401, 0x0201, 0x0043, 0x0034, 0x0051, 0x0601, 0x0201, 0x0015, - 0x0201, 0x0005, 0x0052, 0x0601, 0x0201, 0x0025, 0x0201, 0x0044, 0x0035, 0x0201, 0x0053, - 0x0201, 0x0045, 0x0201, 0x0054, 0x0055, - // 9 - 0x0801, 0x0401, 0x0201, 0x0000, 0x0010, 0x0201, 0x0001, 0x0011, 0x0a01, 0x0401, 0x0201, - 0x0020, 0x0021, 0x0201, 0x0012, 0x0201, 0x0002, 0x0022, 0x0c01, 0x0601, 0x0401, 0x0201, - 0x0030, 0x0003, 0x0031, 0x0201, 0x0013, 0x0201, 0x0032, 0x0023, 0x0c01, 0x0401, 0x0201, - 0x0041, 0x0014, 0x0401, 0x0201, 0x0040, 0x0033, 0x0201, 0x0042, 0x0024, 0x0a01, 0x0601, - 0x0401, 0x0201, 0x0004, 0x0050, 0x0043, 0x0201, 0x0034, 0x0051, 0x0801, 0x0401, 0x0201, - 0x0015, 0x0052, 0x0201, 0x0025, 0x0044, 0x0601, 0x0401, 0x0201, 0x0005, 0x0054, 0x0053, - 0x0201, 0x0035, 0x0201, 0x0045, 0x0055, - // 10 - 0x0201, 0x0000, 0x0401, 0x0201, 0x0010, 0x0001, 0x0a01, 0x0201, 0x0011, 0x0401, 0x0201, - 0x0020, 0x0002, 0x0201, 0x0021, 0x0012, 0x1c01, 0x0801, 0x0401, 0x0201, 0x0022, 0x0030, - 0x0201, 0x0031, 0x0013, 0x0801, 0x0401, 0x0201, 0x0003, 0x0032, 0x0201, 0x0023, 0x0040, - 0x0401, 0x0201, 0x0041, 0x0014, 0x0401, 0x0201, 0x0004, 0x0033, 0x0201, 0x0042, 0x0024, - 0x1c01, 0x0a01, 0x0601, 0x0401, 0x0201, 0x0050, 0x0005, 0x0060, 0x0201, 0x0061, 0x0016, - 0x0c01, 0x0601, 0x0401, 0x0201, 0x0043, 0x0034, 0x0051, 0x0201, 0x0015, 0x0201, 0x0052, - 0x0025, 0x0401, 0x0201, 0x0026, 0x0036, 0x0071, 0x1401, 0x0801, 0x0201, 0x0017, 0x0401, - 0x0201, 0x0044, 0x0053, 0x0006, 0x0601, 0x0401, 0x0201, 0x0035, 0x0045, 0x0062, 0x0201, - 0x0070, 0x0201, 0x0007, 0x0064, 0x0e01, 0x0401, 0x0201, 0x0072, 0x0027, 0x0601, 0x0201, - 0x0063, 0x0201, 0x0054, 0x0055, 0x0201, 0x0046, 0x0073, 0x0801, 0x0401, 0x0201, 0x0037, - 0x0065, 0x0201, 0x0056, 0x0074, 0x0601, 0x0201, 0x0047, 0x0201, 0x0066, 0x0075, 0x0401, - 0x0201, 0x0057, 0x0076, 0x0201, 0x0067, 0x0077, - // 11 - 0x0601, 0x0201, 0x0000, 0x0201, 0x0010, 0x0001, 0x0801, 0x0201, 0x0011, 0x0401, 0x0201, - 0x0020, 0x0002, 0x0012, 0x1801, 0x0801, 0x0201, 0x0021, 0x0201, 0x0022, 0x0201, 0x0030, - 0x0003, 0x0401, 0x0201, 0x0031, 0x0013, 0x0401, 0x0201, 0x0032, 0x0023, 0x0401, 0x0201, - 0x0040, 0x0004, 0x0201, 0x0041, 0x0014, 0x1e01, 0x1001, 0x0a01, 0x0401, 0x0201, 0x0042, - 0x0024, 0x0401, 0x0201, 0x0033, 0x0043, 0x0050, 0x0401, 0x0201, 0x0034, 0x0051, 0x0061, - 0x0601, 0x0201, 0x0016, 0x0201, 0x0006, 0x0026, 0x0201, 0x0062, 0x0201, 0x0015, 0x0201, - 0x0005, 0x0052, 0x1001, 0x0a01, 0x0601, 0x0401, 0x0201, 0x0025, 0x0044, 0x0060, 0x0201, - 0x0063, 0x0036, 0x0401, 0x0201, 0x0070, 0x0017, 0x0071, 0x1001, 0x0601, 0x0401, 0x0201, - 0x0007, 0x0064, 0x0072, 0x0201, 0x0027, 0x0401, 0x0201, 0x0053, 0x0035, 0x0201, 0x0054, - 0x0045, 0x0a01, 0x0401, 0x0201, 0x0046, 0x0073, 0x0201, 0x0037, 0x0201, 0x0065, 0x0056, - 0x0a01, 0x0601, 0x0401, 0x0201, 0x0055, 0x0057, 0x0074, 0x0201, 0x0047, 0x0066, 0x0401, - 0x0201, 0x0075, 0x0076, 0x0201, 0x0067, 0x0077, - // 12 - 0x0c01, 0x0401, 0x0201, 0x0010, 0x0001, 0x0201, 0x0011, 0x0201, 0x0000, 0x0201, 0x0020, - 0x0002, 0x1001, 0x0401, 0x0201, 0x0021, 0x0012, 0x0401, 0x0201, 0x0022, 0x0031, 0x0201, - 0x0013, 0x0201, 0x0030, 0x0201, 0x0003, 0x0040, 0x1a01, 0x0801, 0x0401, 0x0201, 0x0032, - 0x0023, 0x0201, 0x0041, 0x0033, 0x0a01, 0x0401, 0x0201, 0x0014, 0x0042, 0x0201, 0x0024, - 0x0201, 0x0004, 0x0050, 0x0401, 0x0201, 0x0043, 0x0034, 0x0201, 0x0051, 0x0015, 0x1c01, - 0x0e01, 0x0801, 0x0401, 0x0201, 0x0052, 0x0025, 0x0201, 0x0053, 0x0035, 0x0401, 0x0201, - 0x0060, 0x0016, 0x0061, 0x0401, 0x0201, 0x0062, 0x0026, 0x0601, 0x0401, 0x0201, 0x0005, - 0x0006, 0x0044, 0x0201, 0x0054, 0x0045, 0x1201, 0x0a01, 0x0401, 0x0201, 0x0063, 0x0036, - 0x0401, 0x0201, 0x0070, 0x0007, 0x0071, 0x0401, 0x0201, 0x0017, 0x0064, 0x0201, 0x0046, - 0x0072, 0x0a01, 0x0601, 0x0201, 0x0027, 0x0201, 0x0055, 0x0073, 0x0201, 0x0037, 0x0056, - 0x0801, 0x0401, 0x0201, 0x0065, 0x0074, 0x0201, 0x0047, 0x0066, 0x0401, 0x0201, 0x0075, - 0x0057, 0x0201, 0x0076, 0x0201, 0x0067, 0x0077, - // 13 - 0x0201, 0x0000, 0x0601, 0x0201, 0x0010, 0x0201, 0x0001, 0x0011, 0x1c01, 0x0801, 0x0401, - 0x0201, 0x0020, 0x0002, 0x0201, 0x0021, 0x0012, 0x0801, 0x0401, 0x0201, 0x0022, 0x0030, - 0x0201, 0x0003, 0x0031, 0x0601, 0x0201, 0x0013, 0x0201, 0x0032, 0x0023, 0x0401, 0x0201, - 0x0040, 0x0004, 0x0041, 0x4601, 0x1c01, 0x0e01, 0x0601, 0x0201, 0x0014, 0x0201, 0x0033, - 0x0042, 0x0401, 0x0201, 0x0024, 0x0050, 0x0201, 0x0043, 0x0034, 0x0401, 0x0201, 0x0051, - 0x0015, 0x0401, 0x0201, 0x0005, 0x0052, 0x0201, 0x0025, 0x0201, 0x0044, 0x0053, 0x0e01, - 0x0801, 0x0401, 0x0201, 0x0060, 0x0006, 0x0201, 0x0061, 0x0016, 0x0401, 0x0201, 0x0080, - 0x0008, 0x0081, 0x1001, 0x0801, 0x0401, 0x0201, 0x0035, 0x0062, 0x0201, 0x0026, 0x0054, - 0x0401, 0x0201, 0x0045, 0x0063, 0x0201, 0x0036, 0x0070, 0x0601, 0x0401, 0x0201, 0x0007, - 0x0055, 0x0071, 0x0201, 0x0017, 0x0201, 0x0027, 0x0037, 0x4801, 0x1801, 0x0c01, 0x0401, - 0x0201, 0x0018, 0x0082, 0x0201, 0x0028, 0x0401, 0x0201, 0x0064, 0x0046, 0x0072, 0x0801, - 0x0401, 0x0201, 0x0084, 0x0048, 0x0201, 0x0090, 0x0009, 0x0201, 0x0091, 0x0019, 0x1801, - 0x0e01, 0x0801, 0x0401, 0x0201, 0x0073, 0x0065, 0x0201, 0x0056, 0x0074, 0x0401, 0x0201, - 0x0047, 0x0066, 0x0083, 0x0601, 0x0201, 0x0038, 0x0201, 0x0075, 0x0057, 0x0201, 0x0092, - 0x0029, 0x0e01, 0x0801, 0x0401, 0x0201, 0x0067, 0x0085, 0x0201, 0x0058, 0x0039, 0x0201, - 0x0093, 0x0201, 0x0049, 0x0086, 0x0601, 0x0201, 0x00a0, 0x0201, 0x0068, 0x000a, 0x0201, - 0x00a1, 0x001a, 0x4401, 0x1801, 0x0c01, 0x0401, 0x0201, 0x00a2, 0x002a, 0x0401, 0x0201, - 0x0095, 0x0059, 0x0201, 0x00a3, 0x003a, 0x0801, 0x0401, 0x0201, 0x004a, 0x0096, 0x0201, - 0x00b0, 0x000b, 0x0201, 0x00b1, 0x001b, 0x1401, 0x0801, 0x0201, 0x00b2, 0x0401, 0x0201, - 0x0076, 0x0077, 0x0094, 0x0601, 0x0401, 0x0201, 0x0087, 0x0078, 0x00a4, 0x0401, 0x0201, - 0x0069, 0x00a5, 0x002b, 0x0c01, 0x0601, 0x0401, 0x0201, 0x005a, 0x0088, 0x00b3, 0x0201, - 0x003b, 0x0201, 0x0079, 0x00a6, 0x0601, 0x0401, 0x0201, 0x006a, 0x00b4, 0x00c0, 0x0401, - 0x0201, 0x000c, 0x0098, 0x00c1, 0x3c01, 0x1601, 0x0a01, 0x0601, 0x0201, 0x001c, 0x0201, - 0x0089, 0x00b5, 0x0201, 0x005b, 0x00c2, 0x0401, 0x0201, 0x002c, 0x003c, 0x0401, 0x0201, - 0x00b6, 0x006b, 0x0201, 0x00c4, 0x004c, 0x1001, 0x0801, 0x0401, 0x0201, 0x00a8, 0x008a, - 0x0201, 0x00d0, 0x000d, 0x0201, 0x00d1, 0x0201, 0x004b, 0x0201, 0x0097, 0x00a7, 0x0c01, - 0x0601, 0x0201, 0x00c3, 0x0201, 0x007a, 0x0099, 0x0401, 0x0201, 0x00c5, 0x005c, 0x00b7, - 0x0401, 0x0201, 0x001d, 0x00d2, 0x0201, 0x002d, 0x0201, 0x007b, 0x00d3, 0x3401, 0x1c01, - 0x0c01, 0x0401, 0x0201, 0x003d, 0x00c6, 0x0401, 0x0201, 0x006c, 0x00a9, 0x0201, 0x009a, - 0x00d4, 0x0801, 0x0401, 0x0201, 0x00b8, 0x008b, 0x0201, 0x004d, 0x00c7, 0x0401, 0x0201, - 0x007c, 0x00d5, 0x0201, 0x005d, 0x00e0, 0x0a01, 0x0401, 0x0201, 0x00e1, 0x001e, 0x0401, - 0x0201, 0x000e, 0x002e, 0x00e2, 0x0801, 0x0401, 0x0201, 0x00e3, 0x006d, 0x0201, 0x008c, - 0x00e4, 0x0401, 0x0201, 0x00e5, 0x00ba, 0x00f0, 0x2601, 0x1001, 0x0401, 0x0201, 0x00f1, - 0x001f, 0x0601, 0x0401, 0x0201, 0x00aa, 0x009b, 0x00b9, 0x0201, 0x003e, 0x0201, 0x00d6, - 0x00c8, 0x0c01, 0x0601, 0x0201, 0x004e, 0x0201, 0x00d7, 0x007d, 0x0201, 0x00ab, 0x0201, - 0x005e, 0x00c9, 0x0601, 0x0201, 0x000f, 0x0201, 0x009c, 0x006e, 0x0201, 0x00f2, 0x002f, - 0x2001, 0x1001, 0x0601, 0x0401, 0x0201, 0x00d8, 0x008d, 0x003f, 0x0601, 0x0201, 0x00f3, - 0x0201, 0x00e6, 0x00ca, 0x0201, 0x00f4, 0x004f, 0x0801, 0x0401, 0x0201, 0x00bb, 0x00ac, - 0x0201, 0x00e7, 0x00f5, 0x0401, 0x0201, 0x00d9, 0x009d, 0x0201, 0x005f, 0x00e8, 0x1e01, - 0x0c01, 0x0601, 0x0201, 0x006f, 0x0201, 0x00f6, 0x00cb, 0x0401, 0x0201, 0x00bc, 0x00ad, - 0x00da, 0x0801, 0x0201, 0x00f7, 0x0401, 0x0201, 0x007e, 0x007f, 0x008e, 0x0601, 0x0401, - 0x0201, 0x009e, 0x00ae, 0x00cc, 0x0201, 0x00f8, 0x008f, 0x1201, 0x0801, 0x0401, 0x0201, - 0x00db, 0x00bd, 0x0201, 0x00ea, 0x00f9, 0x0401, 0x0201, 0x009f, 0x00eb, 0x0201, 0x00be, - 0x0201, 0x00cd, 0x00fa, 0x0e01, 0x0401, 0x0201, 0x00dd, 0x00ec, 0x0601, 0x0401, 0x0201, - 0x00e9, 0x00af, 0x00dc, 0x0201, 0x00ce, 0x00fb, 0x0801, 0x0401, 0x0201, 0x00bf, 0x00de, - 0x0201, 0x00cf, 0x00ee, 0x0401, 0x0201, 0x00df, 0x00ef, 0x0201, 0x00ff, 0x0201, 0x00ed, - 0x0201, 0x00fd, 0x0201, 0x00fc, 0x00fe, - // 15 - 0x1001, 0x0601, 0x0201, 0x0000, 0x0201, 0x0010, 0x0001, 0x0201, 0x0011, 0x0401, 0x0201, - 0x0020, 0x0002, 0x0201, 0x0021, 0x0012, 0x3201, 0x1001, 0x0601, 0x0201, 0x0022, 0x0201, - 0x0030, 0x0031, 0x0601, 0x0201, 0x0013, 0x0201, 0x0003, 0x0040, 0x0201, 0x0032, 0x0023, - 0x0e01, 0x0601, 0x0401, 0x0201, 0x0004, 0x0014, 0x0041, 0x0401, 0x0201, 0x0033, 0x0042, - 0x0201, 0x0024, 0x0043, 0x0a01, 0x0601, 0x0201, 0x0034, 0x0201, 0x0050, 0x0005, 0x0201, - 0x0051, 0x0015, 0x0401, 0x0201, 0x0052, 0x0025, 0x0401, 0x0201, 0x0044, 0x0053, 0x0061, - 0x5a01, 0x2401, 0x1201, 0x0a01, 0x0601, 0x0201, 0x0035, 0x0201, 0x0060, 0x0006, 0x0201, - 0x0016, 0x0062, 0x0401, 0x0201, 0x0026, 0x0054, 0x0201, 0x0045, 0x0063, 0x0a01, 0x0601, - 0x0201, 0x0036, 0x0201, 0x0070, 0x0007, 0x0201, 0x0071, 0x0055, 0x0401, 0x0201, 0x0017, - 0x0064, 0x0201, 0x0072, 0x0027, 0x1801, 0x1001, 0x0801, 0x0401, 0x0201, 0x0046, 0x0073, - 0x0201, 0x0037, 0x0065, 0x0401, 0x0201, 0x0056, 0x0080, 0x0201, 0x0008, 0x0074, 0x0401, - 0x0201, 0x0081, 0x0018, 0x0201, 0x0082, 0x0028, 0x1001, 0x0801, 0x0401, 0x0201, 0x0047, - 0x0066, 0x0201, 0x0083, 0x0038, 0x0401, 0x0201, 0x0075, 0x0057, 0x0201, 0x0084, 0x0048, - 0x0601, 0x0401, 0x0201, 0x0090, 0x0019, 0x0091, 0x0401, 0x0201, 0x0092, 0x0076, 0x0201, - 0x0067, 0x0029, 0x5c01, 0x2401, 0x1201, 0x0a01, 0x0401, 0x0201, 0x0085, 0x0058, 0x0401, - 0x0201, 0x0009, 0x0077, 0x0093, 0x0401, 0x0201, 0x0039, 0x0094, 0x0201, 0x0049, 0x0086, - 0x0a01, 0x0601, 0x0201, 0x0068, 0x0201, 0x00a0, 0x000a, 0x0201, 0x00a1, 0x001a, 0x0401, - 0x0201, 0x00a2, 0x002a, 0x0201, 0x0095, 0x0059, 0x1a01, 0x0e01, 0x0601, 0x0201, 0x00a3, - 0x0201, 0x003a, 0x0087, 0x0401, 0x0201, 0x0078, 0x00a4, 0x0201, 0x004a, 0x0096, 0x0601, - 0x0401, 0x0201, 0x0069, 0x00b0, 0x00b1, 0x0401, 0x0201, 0x001b, 0x00a5, 0x00b2, 0x0e01, - 0x0801, 0x0401, 0x0201, 0x005a, 0x002b, 0x0201, 0x0088, 0x0097, 0x0201, 0x00b3, 0x0201, - 0x0079, 0x003b, 0x0801, 0x0401, 0x0201, 0x006a, 0x00b4, 0x0201, 0x004b, 0x00c1, 0x0401, - 0x0201, 0x0098, 0x0089, 0x0201, 0x001c, 0x00b5, 0x5001, 0x2201, 0x1001, 0x0601, 0x0401, - 0x0201, 0x005b, 0x002c, 0x00c2, 0x0601, 0x0401, 0x0201, 0x000b, 0x00c0, 0x00a6, 0x0201, - 0x00a7, 0x007a, 0x0a01, 0x0401, 0x0201, 0x00c3, 0x003c, 0x0401, 0x0201, 0x000c, 0x0099, - 0x00b6, 0x0401, 0x0201, 0x006b, 0x00c4, 0x0201, 0x004c, 0x00a8, 0x1401, 0x0a01, 0x0401, - 0x0201, 0x008a, 0x00c5, 0x0401, 0x0201, 0x00d0, 0x005c, 0x00d1, 0x0401, 0x0201, 0x00b7, - 0x007b, 0x0201, 0x001d, 0x0201, 0x000d, 0x002d, 0x0c01, 0x0401, 0x0201, 0x00d2, 0x00d3, - 0x0401, 0x0201, 0x003d, 0x00c6, 0x0201, 0x006c, 0x00a9, 0x0601, 0x0401, 0x0201, 0x009a, - 0x00b8, 0x00d4, 0x0401, 0x0201, 0x008b, 0x004d, 0x0201, 0x00c7, 0x007c, 0x4401, 0x2201, - 0x1201, 0x0a01, 0x0401, 0x0201, 0x00d5, 0x005d, 0x0401, 0x0201, 0x00e0, 0x000e, 0x00e1, - 0x0401, 0x0201, 0x001e, 0x00e2, 0x0201, 0x00aa, 0x002e, 0x0801, 0x0401, 0x0201, 0x00b9, - 0x009b, 0x0201, 0x00e3, 0x00d6, 0x0401, 0x0201, 0x006d, 0x003e, 0x0201, 0x00c8, 0x008c, - 0x1001, 0x0801, 0x0401, 0x0201, 0x00e4, 0x004e, 0x0201, 0x00d7, 0x007d, 0x0401, 0x0201, - 0x00e5, 0x00ba, 0x0201, 0x00ab, 0x005e, 0x0801, 0x0401, 0x0201, 0x00c9, 0x009c, 0x0201, - 0x00f1, 0x001f, 0x0601, 0x0401, 0x0201, 0x00f0, 0x006e, 0x00f2, 0x0201, 0x002f, 0x00e6, - 0x2601, 0x1201, 0x0801, 0x0401, 0x0201, 0x00d8, 0x00f3, 0x0201, 0x003f, 0x00f4, 0x0601, - 0x0201, 0x004f, 0x0201, 0x008d, 0x00d9, 0x0201, 0x00bb, 0x00ca, 0x0801, 0x0401, 0x0201, - 0x00ac, 0x00e7, 0x0201, 0x007e, 0x00f5, 0x0801, 0x0401, 0x0201, 0x009d, 0x005f, 0x0201, - 0x00e8, 0x008e, 0x0201, 0x00f6, 0x00cb, 0x2201, 0x1201, 0x0a01, 0x0601, 0x0401, 0x0201, - 0x000f, 0x00ae, 0x006f, 0x0201, 0x00bc, 0x00da, 0x0401, 0x0201, 0x00ad, 0x00f7, 0x0201, - 0x007f, 0x00e9, 0x0801, 0x0401, 0x0201, 0x009e, 0x00cc, 0x0201, 0x00f8, 0x008f, 0x0401, - 0x0201, 0x00db, 0x00bd, 0x0201, 0x00ea, 0x00f9, 0x1001, 0x0801, 0x0401, 0x0201, 0x009f, - 0x00dc, 0x0201, 0x00cd, 0x00eb, 0x0401, 0x0201, 0x00be, 0x00fa, 0x0201, 0x00af, 0x00dd, - 0x0e01, 0x0601, 0x0401, 0x0201, 0x00ec, 0x00ce, 0x00fb, 0x0401, 0x0201, 0x00bf, 0x00ed, - 0x0201, 0x00de, 0x00fc, 0x0601, 0x0401, 0x0201, 0x00cf, 0x00fd, 0x00ee, 0x0401, 0x0201, - 0x00df, 0x00fe, 0x0201, 0x00ef, 0x00ff, - // 16 - 0x0201, 0x0000, 0x0601, 0x0201, 0x0010, 0x0201, 0x0001, 0x0011, 0x2a01, 0x0801, 0x0401, - 0x0201, 0x0020, 0x0002, 0x0201, 0x0021, 0x0012, 0x0a01, 0x0601, 0x0201, 0x0022, 0x0201, - 0x0030, 0x0003, 0x0201, 0x0031, 0x0013, 0x0a01, 0x0401, 0x0201, 0x0032, 0x0023, 0x0401, - 0x0201, 0x0040, 0x0004, 0x0041, 0x0601, 0x0201, 0x0014, 0x0201, 0x0033, 0x0042, 0x0401, - 0x0201, 0x0024, 0x0050, 0x0201, 0x0043, 0x0034, 0x8a01, 0x2801, 0x1001, 0x0601, 0x0401, - 0x0201, 0x0005, 0x0015, 0x0051, 0x0401, 0x0201, 0x0052, 0x0025, 0x0401, 0x0201, 0x0044, - 0x0035, 0x0053, 0x0a01, 0x0601, 0x0401, 0x0201, 0x0060, 0x0006, 0x0061, 0x0201, 0x0016, - 0x0062, 0x0801, 0x0401, 0x0201, 0x0026, 0x0054, 0x0201, 0x0045, 0x0063, 0x0401, 0x0201, - 0x0036, 0x0070, 0x0071, 0x2801, 0x1201, 0x0801, 0x0201, 0x0017, 0x0201, 0x0007, 0x0201, - 0x0055, 0x0064, 0x0401, 0x0201, 0x0072, 0x0027, 0x0401, 0x0201, 0x0046, 0x0065, 0x0073, - 0x0a01, 0x0601, 0x0201, 0x0037, 0x0201, 0x0056, 0x0008, 0x0201, 0x0080, 0x0081, 0x0601, - 0x0201, 0x0018, 0x0201, 0x0074, 0x0047, 0x0201, 0x0082, 0x0201, 0x0028, 0x0066, 0x1801, - 0x0e01, 0x0801, 0x0401, 0x0201, 0x0083, 0x0038, 0x0201, 0x0075, 0x0084, 0x0401, 0x0201, - 0x0048, 0x0090, 0x0091, 0x0601, 0x0201, 0x0019, 0x0201, 0x0009, 0x0076, 0x0201, 0x0092, - 0x0029, 0x0e01, 0x0801, 0x0401, 0x0201, 0x0085, 0x0058, 0x0201, 0x0093, 0x0039, 0x0401, - 0x0201, 0x00a0, 0x000a, 0x001a, 0x0801, 0x0201, 0x00a2, 0x0201, 0x0067, 0x0201, 0x0057, - 0x0049, 0x0601, 0x0201, 0x0094, 0x0201, 0x0077, 0x0086, 0x0201, 0x00a1, 0x0201, 0x0068, - 0x0095, 0xdc01, 0x7e01, 0x3201, 0x1a01, 0x0c01, 0x0601, 0x0201, 0x002a, 0x0201, 0x0059, - 0x003a, 0x0201, 0x00a3, 0x0201, 0x0087, 0x0078, 0x0801, 0x0401, 0x0201, 0x00a4, 0x004a, - 0x0201, 0x0096, 0x0069, 0x0401, 0x0201, 0x00b0, 0x000b, 0x00b1, 0x0a01, 0x0401, 0x0201, - 0x001b, 0x00b2, 0x0201, 0x002b, 0x0201, 0x00a5, 0x005a, 0x0601, 0x0201, 0x00b3, 0x0201, - 0x00a6, 0x006a, 0x0401, 0x0201, 0x00b4, 0x004b, 0x0201, 0x000c, 0x00c1, 0x1e01, 0x0e01, - 0x0601, 0x0401, 0x0201, 0x00b5, 0x00c2, 0x002c, 0x0401, 0x0201, 0x00a7, 0x00c3, 0x0201, - 0x006b, 0x00c4, 0x0801, 0x0201, 0x001d, 0x0401, 0x0201, 0x0088, 0x0097, 0x003b, 0x0401, - 0x0201, 0x00d1, 0x00d2, 0x0201, 0x002d, 0x00d3, 0x1201, 0x0601, 0x0401, 0x0201, 0x001e, - 0x002e, 0x00e2, 0x0601, 0x0401, 0x0201, 0x0079, 0x0098, 0x00c0, 0x0201, 0x001c, 0x0201, - 0x0089, 0x005b, 0x0e01, 0x0601, 0x0201, 0x003c, 0x0201, 0x007a, 0x00b6, 0x0401, 0x0201, - 0x004c, 0x0099, 0x0201, 0x00a8, 0x008a, 0x0601, 0x0201, 0x000d, 0x0201, 0x00c5, 0x005c, - 0x0401, 0x0201, 0x003d, 0x00c6, 0x0201, 0x006c, 0x009a, 0x5801, 0x5601, 0x2401, 0x1001, - 0x0801, 0x0401, 0x0201, 0x008b, 0x004d, 0x0201, 0x00c7, 0x007c, 0x0401, 0x0201, 0x00d5, - 0x005d, 0x0201, 0x00e0, 0x000e, 0x0801, 0x0201, 0x00e3, 0x0401, 0x0201, 0x00d0, 0x00b7, - 0x007b, 0x0601, 0x0401, 0x0201, 0x00a9, 0x00b8, 0x00d4, 0x0201, 0x00e1, 0x0201, 0x00aa, - 0x00b9, 0x1801, 0x0a01, 0x0601, 0x0401, 0x0201, 0x009b, 0x00d6, 0x006d, 0x0201, 0x003e, - 0x00c8, 0x0601, 0x0401, 0x0201, 0x008c, 0x00e4, 0x004e, 0x0401, 0x0201, 0x00d7, 0x00e5, - 0x0201, 0x00ba, 0x00ab, 0x0c01, 0x0401, 0x0201, 0x009c, 0x00e6, 0x0401, 0x0201, 0x006e, - 0x00d8, 0x0201, 0x008d, 0x00bb, 0x0801, 0x0401, 0x0201, 0x00e7, 0x009d, 0x0201, 0x00e8, - 0x008e, 0x0401, 0x0201, 0x00cb, 0x00bc, 0x009e, 0x00f1, 0x0201, 0x001f, 0x0201, 0x000f, - 0x002f, 0x4201, 0x3801, 0x0201, 0x00f2, 0x3401, 0x3201, 0x1401, 0x0801, 0x0201, 0x00bd, - 0x0201, 0x005e, 0x0201, 0x007d, 0x00c9, 0x0601, 0x0201, 0x00ca, 0x0201, 0x00ac, 0x007e, - 0x0401, 0x0201, 0x00da, 0x00ad, 0x00cc, 0x0a01, 0x0601, 0x0201, 0x00ae, 0x0201, 0x00db, - 0x00dc, 0x0201, 0x00cd, 0x00be, 0x0601, 0x0401, 0x0201, 0x00eb, 0x00ed, 0x00ee, 0x0601, - 0x0401, 0x0201, 0x00d9, 0x00ea, 0x00e9, 0x0201, 0x00de, 0x0401, 0x0201, 0x00dd, 0x00ec, - 0x00ce, 0x003f, 0x00f0, 0x0401, 0x0201, 0x00f3, 0x00f4, 0x0201, 0x004f, 0x0201, 0x00f5, - 0x005f, 0x0a01, 0x0201, 0x00ff, 0x0401, 0x0201, 0x00f6, 0x006f, 0x0201, 0x00f7, 0x007f, - 0x0c01, 0x0601, 0x0201, 0x008f, 0x0201, 0x00f8, 0x00f9, 0x0401, 0x0201, 0x009f, 0x00fa, - 0x00af, 0x0801, 0x0401, 0x0201, 0x00fb, 0x00bf, 0x0201, 0x00fc, 0x00cf, 0x0401, 0x0201, - 0x00fd, 0x00df, 0x0201, 0x00fe, 0x00ef, - // 24 - 0x3c01, 0x0801, 0x0401, 0x0201, 0x0000, 0x0010, 0x0201, 0x0001, 0x0011, 0x0e01, 0x0601, - 0x0401, 0x0201, 0x0020, 0x0002, 0x0021, 0x0201, 0x0012, 0x0201, 0x0022, 0x0201, 0x0030, - 0x0003, 0x0e01, 0x0401, 0x0201, 0x0031, 0x0013, 0x0401, 0x0201, 0x0032, 0x0023, 0x0401, - 0x0201, 0x0040, 0x0004, 0x0041, 0x0801, 0x0401, 0x0201, 0x0014, 0x0033, 0x0201, 0x0042, - 0x0024, 0x0601, 0x0401, 0x0201, 0x0043, 0x0034, 0x0051, 0x0601, 0x0401, 0x0201, 0x0050, - 0x0005, 0x0015, 0x0201, 0x0052, 0x0025, 0xfa01, 0x6201, 0x2201, 0x1201, 0x0a01, 0x0401, - 0x0201, 0x0044, 0x0053, 0x0201, 0x0035, 0x0201, 0x0060, 0x0006, 0x0401, 0x0201, 0x0061, - 0x0016, 0x0201, 0x0062, 0x0026, 0x0801, 0x0401, 0x0201, 0x0054, 0x0045, 0x0201, 0x0063, - 0x0036, 0x0401, 0x0201, 0x0071, 0x0055, 0x0201, 0x0064, 0x0046, 0x2001, 0x0e01, 0x0601, - 0x0201, 0x0072, 0x0201, 0x0027, 0x0037, 0x0201, 0x0073, 0x0401, 0x0201, 0x0070, 0x0007, - 0x0017, 0x0a01, 0x0401, 0x0201, 0x0065, 0x0056, 0x0401, 0x0201, 0x0080, 0x0008, 0x0081, - 0x0401, 0x0201, 0x0074, 0x0047, 0x0201, 0x0018, 0x0082, 0x1001, 0x0801, 0x0401, 0x0201, - 0x0028, 0x0066, 0x0201, 0x0083, 0x0038, 0x0401, 0x0201, 0x0075, 0x0057, 0x0201, 0x0084, - 0x0048, 0x0801, 0x0401, 0x0201, 0x0091, 0x0019, 0x0201, 0x0092, 0x0076, 0x0401, 0x0201, - 0x0067, 0x0029, 0x0201, 0x0085, 0x0058, 0x5c01, 0x2201, 0x1001, 0x0801, 0x0401, 0x0201, - 0x0093, 0x0039, 0x0201, 0x0094, 0x0049, 0x0401, 0x0201, 0x0077, 0x0086, 0x0201, 0x0068, - 0x00a1, 0x0801, 0x0401, 0x0201, 0x00a2, 0x002a, 0x0201, 0x0095, 0x0059, 0x0401, 0x0201, - 0x00a3, 0x003a, 0x0201, 0x0087, 0x0201, 0x0078, 0x004a, 0x1601, 0x0c01, 0x0401, 0x0201, - 0x00a4, 0x0096, 0x0401, 0x0201, 0x0069, 0x00b1, 0x0201, 0x001b, 0x00a5, 0x0601, 0x0201, - 0x00b2, 0x0201, 0x005a, 0x002b, 0x0201, 0x0088, 0x00b3, 0x1001, 0x0a01, 0x0601, 0x0201, - 0x0090, 0x0201, 0x0009, 0x00a0, 0x0201, 0x0097, 0x0079, 0x0401, 0x0201, 0x00a6, 0x006a, - 0x00b4, 0x0c01, 0x0601, 0x0201, 0x001a, 0x0201, 0x000a, 0x00b0, 0x0201, 0x003b, 0x0201, - 0x000b, 0x00c0, 0x0401, 0x0201, 0x004b, 0x00c1, 0x0201, 0x0098, 0x0089, 0x4301, 0x2201, - 0x1001, 0x0801, 0x0401, 0x0201, 0x001c, 0x00b5, 0x0201, 0x005b, 0x00c2, 0x0401, 0x0201, - 0x002c, 0x00a7, 0x0201, 0x007a, 0x00c3, 0x0a01, 0x0601, 0x0201, 0x003c, 0x0201, 0x000c, - 0x00d0, 0x0201, 0x00b6, 0x006b, 0x0401, 0x0201, 0x00c4, 0x004c, 0x0201, 0x0099, 0x00a8, - 0x1001, 0x0801, 0x0401, 0x0201, 0x008a, 0x00c5, 0x0201, 0x005c, 0x00d1, 0x0401, 0x0201, - 0x00b7, 0x007b, 0x0201, 0x001d, 0x00d2, 0x0901, 0x0401, 0x0201, 0x002d, 0x00d3, 0x0201, - 0x003d, 0x00c6, 0x55fa, 0x0401, 0x0201, 0x006c, 0x00a9, 0x0201, 0x009a, 0x00d4, 0x2001, - 0x1001, 0x0801, 0x0401, 0x0201, 0x00b8, 0x008b, 0x0201, 0x004d, 0x00c7, 0x0401, 0x0201, - 0x007c, 0x00d5, 0x0201, 0x005d, 0x00e1, 0x0801, 0x0401, 0x0201, 0x001e, 0x00e2, 0x0201, - 0x00aa, 0x00b9, 0x0401, 0x0201, 0x009b, 0x00e3, 0x0201, 0x00d6, 0x006d, 0x1401, 0x0a01, - 0x0601, 0x0201, 0x003e, 0x0201, 0x002e, 0x004e, 0x0201, 0x00c8, 0x008c, 0x0401, 0x0201, - 0x00e4, 0x00d7, 0x0401, 0x0201, 0x007d, 0x00ab, 0x00e5, 0x0a01, 0x0401, 0x0201, 0x00ba, - 0x005e, 0x0201, 0x00c9, 0x0201, 0x009c, 0x006e, 0x0801, 0x0201, 0x00e6, 0x0201, 0x000d, - 0x0201, 0x00e0, 0x000e, 0x0401, 0x0201, 0x00d8, 0x008d, 0x0201, 0x00bb, 0x00ca, 0x4a01, - 0x0201, 0x00ff, 0x4001, 0x3a01, 0x2001, 0x1001, 0x0801, 0x0401, 0x0201, 0x00ac, 0x00e7, - 0x0201, 0x007e, 0x00d9, 0x0401, 0x0201, 0x009d, 0x00e8, 0x0201, 0x008e, 0x00cb, 0x0801, - 0x0401, 0x0201, 0x00bc, 0x00da, 0x0201, 0x00ad, 0x00e9, 0x0401, 0x0201, 0x009e, 0x00cc, - 0x0201, 0x00db, 0x00bd, 0x1001, 0x0801, 0x0401, 0x0201, 0x00ea, 0x00ae, 0x0201, 0x00dc, - 0x00cd, 0x0401, 0x0201, 0x00eb, 0x00be, 0x0201, 0x00dd, 0x00ec, 0x0801, 0x0401, 0x0201, - 0x00ce, 0x00ed, 0x0201, 0x00de, 0x00ee, 0x000f, 0x0401, 0x0201, 0x00f0, 0x001f, 0x00f1, - 0x0401, 0x0201, 0x00f2, 0x002f, 0x0201, 0x00f3, 0x003f, 0x1201, 0x0801, 0x0401, 0x0201, - 0x00f4, 0x004f, 0x0201, 0x00f5, 0x005f, 0x0401, 0x0201, 0x00f6, 0x006f, 0x0201, 0x00f7, - 0x0201, 0x007f, 0x008f, 0x0a01, 0x0401, 0x0201, 0x00f8, 0x00f9, 0x0401, 0x0201, 0x009f, - 0x00af, 0x00fa, 0x0801, 0x0401, 0x0201, 0x00fb, 0x00bf, 0x0201, 0x00fc, 0x00cf, 0x0401, - 0x0201, 0x00fd, 0x00df, 0x0201, 0x00fe, 0x00ef, - // 32 - 0x0201, 0x0000, 0x0801, 0x0401, 0x0201, 0x0008, 0x0004, 0x0201, 0x0001, 0x0002, 0x0801, - 0x0401, 0x0201, 0x000c, 0x000a, 0x0201, 0x0003, 0x0006, 0x0601, 0x0201, 0x0009, 0x0201, - 0x0005, 0x0007, 0x0401, 0x0201, 0x000e, 0x000d, 0x0201, 0x000f, 0x000b, - // 33 - 0x1001, 0x0801, 0x0401, 0x0201, 0x0000, 0x0001, 0x0201, 0x0002, 0x0003, 0x0401, 0x0201, - 0x0004, 0x0005, 0x0201, 0x0006, 0x0007, 0x0801, 0x0401, 0x0201, 0x0008, 0x0009, 0x0201, - 0x000a, 0x000b, 0x0401, 0x0201, 0x000c, 0x000d, 0x0201, 0x000e, 0x000f, -} - -type huffTables struct { - hufftable []uint16 - treelen int - linbits int -} - -var huffmanMain = [...]huffTables{ - {nil, 0, 0}, // Table 0 - {huffmanTable, 7, 0}, // Table 1 - {huffmanTable[7:], 17, 0}, // Table 2 - {huffmanTable[24:], 17, 0}, // Table 3 - {nil, 0, 0}, // Table 4 - {huffmanTable[41:], 31, 0}, // Table 5 - {huffmanTable[72:], 31, 0}, // Table 6 - {huffmanTable[103:], 71, 0}, // Table 7 - {huffmanTable[174:], 71, 0}, // Table 8 - {huffmanTable[245:], 71, 0}, // Table 9 - {huffmanTable[316:], 127, 0}, // Table 10 - {huffmanTable[443:], 127, 0}, // Table 11 - {huffmanTable[570:], 127, 0}, // Table 12 - {huffmanTable[697:], 511, 0}, // Table 13 - {nil, 0, 0}, // Table 14 - {huffmanTable[1208:], 511, 0}, // Table 15 - {huffmanTable[1719:], 511, 1}, // Table 16 - {huffmanTable[1719:], 511, 2}, // Table 17 - {huffmanTable[1719:], 511, 3}, // Table 18 - {huffmanTable[1719:], 511, 4}, // Table 19 - {huffmanTable[1719:], 511, 6}, // Table 20 - {huffmanTable[1719:], 511, 8}, // Table 21 - {huffmanTable[1719:], 511, 10}, // Table 22 - {huffmanTable[1719:], 511, 13}, // Table 23 - {huffmanTable[2230:], 512, 4}, // Table 24 - {huffmanTable[2230:], 512, 5}, // Table 25 - {huffmanTable[2230:], 512, 6}, // Table 26 - {huffmanTable[2230:], 512, 7}, // Table 27 - {huffmanTable[2230:], 512, 8}, // Table 28 - {huffmanTable[2230:], 512, 9}, // Table 29 - {huffmanTable[2230:], 512, 11}, // Table 30 - {huffmanTable[2230:], 512, 13}, // Table 31 - {huffmanTable[2742:], 31, 0}, // Table 32 - {huffmanTable[2773:], 31, 0}, // Table 33 -} - -func Decode(m *bits.Bits, table_num int) (x, y, v, w int, err error) { - point := 0 - error := 1 - bitsleft := 32 - treelen := huffmanMain[table_num].treelen - linbits := huffmanMain[table_num].linbits - if treelen == 0 { // Check for empty tables - return 0, 0, 0, 0, nil - } - htptr := huffmanMain[table_num].hufftable - for { // Start reading the Huffman code word,bit by bit - // Check if we've matched a code word - if (htptr[point] & 0xff00) == 0 { - error = 0 - x = int((htptr[point] >> 4) & 0xf) - y = int(htptr[point] & 0xf) - break - } - if m.Bit() != 0 { // Go right in tree - for (htptr[point] & 0xff) >= 250 { - point += int(htptr[point]) & 0xff - } - point += int(htptr[point]) & 0xff - } else { // Go left in tree - for (htptr[point] >> 8) >= 250 { - point += int(htptr[point]) >> 8 - } - point += int(htptr[point]) >> 8 - } - bitsleft-- - if bitsleft <= 0 || point >= treelen { - break - } - } - if error != 0 { // Check for error. - err := fmt.Errorf("mp3: illegal Huff code in data. bleft = %d, point = %d. tab = %d.", - bitsleft, point, table_num) - return 0, 0, 0, 0, err - } - if table_num > 31 { // Process sign encodings for quadruples tables. - v = (y >> 3) & 1 - w = (y >> 2) & 1 - x = (y >> 1) & 1 - y = y & 1 - if (v != 0) && (m.Bit() == 1) { - v = -v - } - if (w != 0) && (m.Bit() == 1) { - w = -w - } - if (x != 0) && (m.Bit() == 1) { - x = -x - } - if (y != 0) && (m.Bit() == 1) { - y = -y - } - } else { - if (linbits != 0) && (x == 15) { - x += m.Bits(linbits) // Get linbits - } - if (x != 0) && (m.Bit() == 1) { - x = -x // Get sign bit - } - if (linbits != 0) && (y == 15) { - y += m.Bits(linbits) // Get linbits - } - if (y != 0) && (m.Bit() == 1) { - y = -y // Get sign bit - } - } - return x, y, v, w, nil -} diff --git a/vendor/github.com/hajimehoshi/go-mp3/internal/imdct/imdct.go b/vendor/github.com/hajimehoshi/go-mp3/internal/imdct/imdct.go deleted file mode 100644 index d114617..0000000 --- a/vendor/github.com/hajimehoshi/go-mp3/internal/imdct/imdct.go +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2017 Hajime Hoshi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package imdct - -import ( - "math" -) - -var imdctWinData = [4][36]float32{} - -func init() { - for i := 0; i < 36; i++ { - imdctWinData[0][i] = float32(math.Sin(math.Pi / 36 * (float64(i) + 0.5))) - } - for i := 0; i < 18; i++ { - imdctWinData[1][i] = float32(math.Sin(math.Pi / 36 * (float64(i) + 0.5))) - } - for i := 18; i < 24; i++ { - imdctWinData[1][i] = 1.0 - } - for i := 24; i < 30; i++ { - imdctWinData[1][i] = float32(math.Sin(math.Pi / 12 * (float64(i) + 0.5 - 18.0))) - } - for i := 30; i < 36; i++ { - imdctWinData[1][i] = 0.0 - } - for i := 0; i < 12; i++ { - imdctWinData[2][i] = float32(math.Sin(math.Pi / 12 * (float64(i) + 0.5))) - } - for i := 12; i < 36; i++ { - imdctWinData[2][i] = 0.0 - } - for i := 0; i < 6; i++ { - imdctWinData[3][i] = 0.0 - } - for i := 6; i < 12; i++ { - imdctWinData[3][i] = float32(math.Sin(math.Pi / 12 * (float64(i) + 0.5 - 6.0))) - } - for i := 12; i < 18; i++ { - imdctWinData[3][i] = 1.0 - } - for i := 18; i < 36; i++ { - imdctWinData[3][i] = float32(math.Sin(math.Pi / 36 * (float64(i) + 0.5))) - } -} - -var cosN12 = [6][12]float32{} - -func init() { - const N = 12 - for i := 0; i < 6; i++ { - for j := 0; j < 12; j++ { - cosN12[i][j] = float32(math.Cos(math.Pi / (2 * N) * (2*float64(j) + 1 + N/2) * (2*float64(i) + 1))) - } - } -} - -var cosN36 = [18][36]float32{} - -func init() { - const N = 36 - for i := 0; i < 18; i++ { - for j := 0; j < 36; j++ { - cosN36[i][j] = float32(math.Cos(math.Pi / (2 * N) * (2*float64(j) + 1 + N/2) * (2*float64(i) + 1))) - } - } -} - -func Win(in []float32, blockType int) []float32 { - out := make([]float32, 36) - if blockType == 2 { - iwd := imdctWinData[blockType] - const N = 12 - for i := 0; i < 3; i++ { - for p := 0; p < N; p++ { - sum := float32(0.0) - for m := 0; m < N/2; m++ { - sum += in[i+3*m] * cosN12[m][p] - } - out[6*i+p+6] += sum * iwd[p] - } - } - return out - } - const N = 36 - iwd := imdctWinData[blockType] - for p := 0; p < N; p++ { - sum := float32(0.0) - for m := 0; m < N/2; m++ { - sum += in[m] * cosN36[m][p] - } - out[p] = sum * iwd[p] - } - return out -} diff --git a/vendor/github.com/hajimehoshi/go-mp3/internal/maindata/huffman.go b/vendor/github.com/hajimehoshi/go-mp3/internal/maindata/huffman.go deleted file mode 100644 index 44521d8..0000000 --- a/vendor/github.com/hajimehoshi/go-mp3/internal/maindata/huffman.go +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright 2017 Hajime Hoshi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package maindata - -import ( - "fmt" - - "github.com/hajimehoshi/go-mp3/internal/bits" - "github.com/hajimehoshi/go-mp3/internal/consts" - "github.com/hajimehoshi/go-mp3/internal/frameheader" - "github.com/hajimehoshi/go-mp3/internal/huffman" - "github.com/hajimehoshi/go-mp3/internal/sideinfo" -) - -func readHuffman(m *bits.Bits, header frameheader.FrameHeader, sideInfo *sideinfo.SideInfo, mainData *MainData, part_2_start, gr, ch int) error { - // Check that there is any data to decode. If not, zero the array. - if sideInfo.Part2_3Length[gr][ch] == 0 { - for i := 0; i < consts.SamplesPerGr; i++ { - mainData.Is[gr][ch][i] = 0.0 - } - return nil - } - - // Calculate bit_pos_end which is the index of the last bit for this part. - bit_pos_end := part_2_start + sideInfo.Part2_3Length[gr][ch] - 1 - // Determine region boundaries - region_1_start := 0 - region_2_start := 0 - if (sideInfo.WinSwitchFlag[gr][ch] == 1) && (sideInfo.BlockType[gr][ch] == 2) { - region_1_start = 36 // sfb[9/3]*3=36 - region_2_start = consts.SamplesPerGr // No Region2 for short block case. - } else { - sfreq := header.SamplingFrequency() - l := consts.SfBandIndicesSet[sfreq].L - i := sideInfo.Region0Count[gr][ch] + 1 - if i < 0 || len(l) <= i { - // TODO: Better error messages (#3) - return fmt.Errorf("mp3: readHuffman failed: invalid index i: %d", i) - } - region_1_start = l[i] - j := sideInfo.Region0Count[gr][ch] + sideInfo.Region1Count[gr][ch] + 2 - if j < 0 || len(l) <= j { - // TODO: Better error messages (#3) - return fmt.Errorf("mp3: readHuffman failed: invalid index j: %d", j) - } - region_2_start = l[j] - } - // Read big_values using tables according to region_x_start - for is_pos := 0; is_pos < sideInfo.BigValues[gr][ch]*2; is_pos++ { - // #22 - if is_pos >= len(mainData.Is[gr][ch]) { - return fmt.Errorf("mp3: is_pos was too big: %d", is_pos) - } - table_num := 0 - if is_pos < region_1_start { - table_num = sideInfo.TableSelect[gr][ch][0] - } else if is_pos < region_2_start { - table_num = sideInfo.TableSelect[gr][ch][1] - } else { - table_num = sideInfo.TableSelect[gr][ch][2] - } - // Get next Huffman coded words - x, y, _, _, err := huffman.Decode(m, table_num) - if err != nil { - return err - } - // In the big_values area there are two freq lines per Huffman word - mainData.Is[gr][ch][is_pos] = float32(x) - is_pos++ - mainData.Is[gr][ch][is_pos] = float32(y) - } - // Read small values until is_pos = 576 or we run out of huffman data - // TODO: Is this comment wrong? - table_num := sideInfo.Count1TableSelect[gr][ch] + 32 - is_pos := sideInfo.BigValues[gr][ch] * 2 - for is_pos <= 572 && m.BitPos() <= bit_pos_end { - // Get next Huffman coded words - x, y, v, w, err := huffman.Decode(m, table_num) - if err != nil { - return err - } - mainData.Is[gr][ch][is_pos] = float32(v) - is_pos++ - if is_pos >= consts.SamplesPerGr { - break - } - mainData.Is[gr][ch][is_pos] = float32(w) - is_pos++ - if is_pos >= consts.SamplesPerGr { - break - } - mainData.Is[gr][ch][is_pos] = float32(x) - is_pos++ - if is_pos >= consts.SamplesPerGr { - break - } - mainData.Is[gr][ch][is_pos] = float32(y) - is_pos++ - } - // Check that we didn't read past the end of this section - if m.BitPos() > (bit_pos_end + 1) { - // Remove last words read - is_pos -= 4 - } - - // Setup count1 which is the index of the first sample in the rzero reg. - sideInfo.Count1[gr][ch] = is_pos - - // Zero out the last part if necessary - for is_pos < consts.SamplesPerGr { - mainData.Is[gr][ch][is_pos] = 0.0 - is_pos++ - } - // Set the bitpos to point to the next part to read - m.SetPos(bit_pos_end + 1) - return nil -} diff --git a/vendor/github.com/hajimehoshi/go-mp3/internal/maindata/maindata.go b/vendor/github.com/hajimehoshi/go-mp3/internal/maindata/maindata.go deleted file mode 100644 index 0056339..0000000 --- a/vendor/github.com/hajimehoshi/go-mp3/internal/maindata/maindata.go +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright 2017 Hajime Hoshi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package maindata - -import ( - "fmt" - "io" - - "github.com/hajimehoshi/go-mp3/internal/bits" - "github.com/hajimehoshi/go-mp3/internal/consts" - "github.com/hajimehoshi/go-mp3/internal/frameheader" - "github.com/hajimehoshi/go-mp3/internal/sideinfo" -) - -type FullReader interface { - ReadFull([]byte) (int, error) -} - -// A MainData is MPEG1 Layer 3 Main Data. -type MainData struct { - ScalefacL [2][2][22]int // 0-4 bits - ScalefacS [2][2][13][3]int // 0-4 bits - Is [2][2][576]float32 // Huffman coded freq. lines -} - -var scalefacSizes = [16][2]int{ - {0, 0}, {0, 1}, {0, 2}, {0, 3}, {3, 0}, {1, 1}, {1, 2}, {1, 3}, - {2, 1}, {2, 2}, {2, 3}, {3, 1}, {3, 2}, {3, 3}, {4, 2}, {4, 3}, -} - -func Read(source FullReader, prev *bits.Bits, header frameheader.FrameHeader, sideInfo *sideinfo.SideInfo) (*MainData, *bits.Bits, error) { - nch := header.NumberOfChannels() - // Calculate header audio data size - framesize := header.FrameSize() - if framesize > 2000 { - return nil, nil, fmt.Errorf("mp3: framesize = %d", framesize) - } - // Sideinfo is 17 bytes for one channel and 32 bytes for two - sideinfo_size := 32 - if nch == 1 { - sideinfo_size = 17 - } - // Main data size is the rest of the frame,including ancillary data - main_data_size := framesize - sideinfo_size - 4 // sync+header - // CRC is 2 bytes - if header.ProtectionBit() == 0 { - main_data_size -= 2 - } - // Assemble main data buffer with data from this frame and the previous - // two frames. main_data_begin indicates how many bytes from previous - // frames that should be used. This buffer is later accessed by the - // Bits function in the same way as the side info is. - m, err := read(source, prev, main_data_size, sideInfo.MainDataBegin) - if err != nil { - // This could be due to not enough data in reservoir - return nil, nil, err - } - md := &MainData{} - for gr := 0; gr < 2; gr++ { - for ch := 0; ch < nch; ch++ { - part_2_start := m.BitPos() - // Number of bits in the bitstream for the bands - slen1 := scalefacSizes[sideInfo.ScalefacCompress[gr][ch]][0] - slen2 := scalefacSizes[sideInfo.ScalefacCompress[gr][ch]][1] - if sideInfo.WinSwitchFlag[gr][ch] == 1 && sideInfo.BlockType[gr][ch] == 2 { - if sideInfo.MixedBlockFlag[gr][ch] != 0 { - for sfb := 0; sfb < 8; sfb++ { - md.ScalefacL[gr][ch][sfb] = m.Bits(slen1) - } - for sfb := 3; sfb < 12; sfb++ { - //slen1 for band 3-5,slen2 for 6-11 - nbits := slen2 - if sfb < 6 { - nbits = slen1 - } - for win := 0; win < 3; win++ { - md.ScalefacS[gr][ch][sfb][win] = m.Bits(nbits) - } - } - } else { - for sfb := 0; sfb < 12; sfb++ { - //slen1 for band 3-5,slen2 for 6-11 - nbits := slen2 - if sfb < 6 { - nbits = slen1 - } - for win := 0; win < 3; win++ { - md.ScalefacS[gr][ch][sfb][win] = m.Bits(nbits) - } - } - } - } else { - // Scale factor bands 0-5 - if sideInfo.Scfsi[ch][0] == 0 || gr == 0 { - for sfb := 0; sfb < 6; sfb++ { - md.ScalefacL[gr][ch][sfb] = m.Bits(slen1) - } - } else if sideInfo.Scfsi[ch][0] == 1 && gr == 1 { - // Copy scalefactors from granule 0 to granule 1 - // TODO: This is not listed on the spec. - for sfb := 0; sfb < 6; sfb++ { - md.ScalefacL[1][ch][sfb] = md.ScalefacL[0][ch][sfb] - } - } - // Scale factor bands 6-10 - if sideInfo.Scfsi[ch][1] == 0 || gr == 0 { - for sfb := 6; sfb < 11; sfb++ { - md.ScalefacL[gr][ch][sfb] = m.Bits(slen1) - } - } else if sideInfo.Scfsi[ch][1] == 1 && gr == 1 { - // Copy scalefactors from granule 0 to granule 1 - for sfb := 6; sfb < 11; sfb++ { - md.ScalefacL[1][ch][sfb] = md.ScalefacL[0][ch][sfb] - } - } - // Scale factor bands 11-15 - if sideInfo.Scfsi[ch][2] == 0 || gr == 0 { - for sfb := 11; sfb < 16; sfb++ { - md.ScalefacL[gr][ch][sfb] = m.Bits(slen2) - } - } else if sideInfo.Scfsi[ch][2] == 1 && gr == 1 { - // Copy scalefactors from granule 0 to granule 1 - for sfb := 11; sfb < 16; sfb++ { - md.ScalefacL[1][ch][sfb] = md.ScalefacL[0][ch][sfb] - } - } - // Scale factor bands 16-20 - if sideInfo.Scfsi[ch][3] == 0 || gr == 0 { - for sfb := 16; sfb < 21; sfb++ { - md.ScalefacL[gr][ch][sfb] = m.Bits(slen2) - } - } else if sideInfo.Scfsi[ch][3] == 1 && gr == 1 { - // Copy scalefactors from granule 0 to granule 1 - for sfb := 16; sfb < 21; sfb++ { - md.ScalefacL[1][ch][sfb] = md.ScalefacL[0][ch][sfb] - } - } - } - // Read Huffman coded data. Skip stuffing bits. - if err := readHuffman(m, header, sideInfo, md, part_2_start, gr, ch); err != nil { - return nil, nil, err - } - } - } - // The ancillary data is stored here,but we ignore it. - return md, m, nil -} - -func read(source FullReader, prev *bits.Bits, size int, offset int) (*bits.Bits, error) { - if size > 1500 { - return nil, fmt.Errorf("mp3: size = %d", size) - } - // Check that there's data available from previous frames if needed - if prev != nil && offset > prev.LenInBytes() { - // No, there is not, so we skip decoding this frame, but we have to - // read the main_data bits from the bitstream in case they are needed - // for decoding the next frame. - buf := make([]byte, size) - if n, err := source.ReadFull(buf); n < size { - if err == io.EOF { - return nil, &consts.UnexpectedEOF{"maindata.Read (1)"} - } - return nil, err - } - // TODO: Define a special error and enable to continue the next frame. - return bits.Append(prev, buf), nil - } - // Copy data from previous frames - vec := []byte{} - if prev != nil { - vec = prev.Tail(offset) - } - // Read the main_data from file - buf := make([]byte, size) - if n, err := source.ReadFull(buf); n < size { - if err == io.EOF { - return nil, &consts.UnexpectedEOF{"maindata.Read (2)"} - } - return nil, err - } - return bits.New(append(vec, buf...)), nil -} diff --git a/vendor/github.com/hajimehoshi/go-mp3/internal/sideinfo/sideinfo.go b/vendor/github.com/hajimehoshi/go-mp3/internal/sideinfo/sideinfo.go deleted file mode 100644 index 996a0ed..0000000 --- a/vendor/github.com/hajimehoshi/go-mp3/internal/sideinfo/sideinfo.go +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2017 Hajime Hoshi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package sideinfo - -import ( - "fmt" - "io" - - "github.com/hajimehoshi/go-mp3/internal/bits" - "github.com/hajimehoshi/go-mp3/internal/consts" - "github.com/hajimehoshi/go-mp3/internal/frameheader" -) - -type FullReader interface { - ReadFull([]byte) (int, error) -} - -// A SideInfo is MPEG1 Layer 3 Side Information. -// [2][2] means [gr][ch]. -type SideInfo struct { - MainDataBegin int // 9 bits - PrivateBits int // 3 bits in mono, 5 in stereo - Scfsi [2][4]int // 1 bit - Part2_3Length [2][2]int // 12 bits - BigValues [2][2]int // 9 bits - GlobalGain [2][2]int // 8 bits - ScalefacCompress [2][2]int // 4 bits - WinSwitchFlag [2][2]int // 1 bit - - BlockType [2][2]int // 2 bits - MixedBlockFlag [2][2]int // 1 bit - TableSelect [2][2][3]int // 5 bits - SubblockGain [2][2][3]int // 3 bits - - Region0Count [2][2]int // 4 bits - Region1Count [2][2]int // 3 bits - - Preflag [2][2]int // 1 bit - ScalefacScale [2][2]int // 1 bit - Count1TableSelect [2][2]int // 1 bit - Count1 [2][2]int // Not in file, calc by huffman decoder -} - -func Read(source FullReader, header frameheader.FrameHeader) (*SideInfo, error) { - nch := header.NumberOfChannels() - // Calculate header audio data size - framesize := header.FrameSize() - if framesize > 2000 { - return nil, fmt.Errorf("mp3: framesize = %d\n", framesize) - } - // Sideinfo is 17 bytes for one channel and 32 bytes for two - sideinfo_size := 32 - if nch == 1 { - sideinfo_size = 17 - } - // Main data size is the rest of the frame,including ancillary data - main_data_size := framesize - sideinfo_size - 4 // sync+header - // CRC is 2 bytes - if header.ProtectionBit() == 0 { - main_data_size -= 2 - } - // Read sideinfo from bitstream into buffer used by Bits() - buf := make([]byte, sideinfo_size) - n, err := source.ReadFull(buf) - if n < sideinfo_size { - if err == io.EOF { - return nil, &consts.UnexpectedEOF{"sideinfo.Read"} - } - return nil, fmt.Errorf("mp3: couldn't read sideinfo %d bytes: %v", sideinfo_size, err) - } - s := bits.New(buf) - - // Parse audio data - // Pointer to where we should start reading main data - si := &SideInfo{} - si.MainDataBegin = s.Bits(9) - // Get private bits. Not used for anything. - if header.Mode() == consts.ModeSingleChannel { - si.PrivateBits = s.Bits(5) - } else { - si.PrivateBits = s.Bits(3) - } - // Get scale factor selection information - for ch := 0; ch < nch; ch++ { - for scfsi_band := 0; scfsi_band < 4; scfsi_band++ { - si.Scfsi[ch][scfsi_band] = s.Bits(1) - } - } - // Get the rest of the side information - for gr := 0; gr < 2; gr++ { - for ch := 0; ch < nch; ch++ { - si.Part2_3Length[gr][ch] = s.Bits(12) - si.BigValues[gr][ch] = s.Bits(9) - si.GlobalGain[gr][ch] = s.Bits(8) - si.ScalefacCompress[gr][ch] = s.Bits(4) - si.WinSwitchFlag[gr][ch] = s.Bits(1) - if si.WinSwitchFlag[gr][ch] == 1 { - si.BlockType[gr][ch] = s.Bits(2) - si.MixedBlockFlag[gr][ch] = s.Bits(1) - for region := 0; region < 2; region++ { - si.TableSelect[gr][ch][region] = s.Bits(5) - } - for window := 0; window < 3; window++ { - si.SubblockGain[gr][ch][window] = s.Bits(3) - } - - // TODO: This is not listed on the spec. Is this correct?? - if si.BlockType[gr][ch] == 2 && si.MixedBlockFlag[gr][ch] == 0 { - si.Region0Count[gr][ch] = 8 // Implicit - } else { - si.Region0Count[gr][ch] = 7 // Implicit - } - // The standard is wrong on this!!! - // Implicit - si.Region1Count[gr][ch] = 20 - si.Region0Count[gr][ch] - } else { - for region := 0; region < 3; region++ { - si.TableSelect[gr][ch][region] = s.Bits(5) - } - si.Region0Count[gr][ch] = s.Bits(4) - si.Region1Count[gr][ch] = s.Bits(3) - si.BlockType[gr][ch] = 0 // Implicit - } - si.Preflag[gr][ch] = s.Bits(1) - si.ScalefacScale[gr][ch] = s.Bits(1) - si.Count1TableSelect[gr][ch] = s.Bits(1) - } - } - return si, nil -} diff --git a/vendor/github.com/hajimehoshi/go-mp3/source.go b/vendor/github.com/hajimehoshi/go-mp3/source.go deleted file mode 100644 index 5a123ef..0000000 --- a/vendor/github.com/hajimehoshi/go-mp3/source.go +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2017 Hajime Hoshi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package mp3 - -import ( - "io" -) - -type source struct { - reader io.ReadCloser - buf []byte - pos int64 -} - -func (s *source) Seek(position int64, whence int) (int64, error) { - seeker, ok := s.reader.(io.Seeker) - if !ok { - panic("mp3: source must be io.Seeker") - } - s.buf = nil - n, err := seeker.Seek(position, whence) - if err != nil { - return 0, err - } - s.pos = n - return n, nil -} - -func (s *source) Close() error { - s.buf = nil - return s.reader.Close() -} - -func (s *source) skipTags() error { - buf := make([]byte, 3) - if _, err := s.ReadFull(buf); err != nil { - return err - } - switch string(buf) { - case "TAG": - buf := make([]byte, 125) - if _, err := s.ReadFull(buf); err != nil { - return err - } - - case "ID3": - // Skip version (2 bytes) and flag (1 byte) - buf := make([]byte, 3) - if _, err := s.ReadFull(buf); err != nil { - return err - } - - buf = make([]byte, 4) - n, err := s.ReadFull(buf) - if err != nil { - return err - } - if n != 4 { - return nil - } - size := (uint32(buf[0]) << 21) | (uint32(buf[1]) << 14) | - (uint32(buf[2]) << 7) | uint32(buf[3]) - buf = make([]byte, size) - if _, err := s.ReadFull(buf); err != nil { - return err - } - - default: - s.Unread(buf) - } - - return nil -} - -func (s *source) rewind() error { - if _, err := s.Seek(0, io.SeekStart); err != nil { - return err - } - s.pos = 0 - s.buf = nil - return nil -} - -func (s *source) Unread(buf []byte) { - s.buf = append(s.buf, buf...) - s.pos -= int64(len(buf)) -} - -func (s *source) ReadFull(buf []byte) (int, error) { - read := 0 - if s.buf != nil { - read = copy(buf, s.buf) - if len(s.buf) > read { - s.buf = s.buf[read:] - } else { - s.buf = nil - } - if len(buf) == read { - return read, nil - } - } - - n, err := io.ReadFull(s.reader, buf[read:]) - if err != nil { - // Allow if all data can't be read. This is common. - if err == io.ErrUnexpectedEOF { - err = io.EOF - } - } - s.pos += int64(n) - return n + read, err -} diff --git a/vendor/github.com/hajimehoshi/oto/.gitignore b/vendor/github.com/hajimehoshi/oto/.gitignore deleted file mode 100644 index 538c8c5..0000000 --- a/vendor/github.com/hajimehoshi/oto/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.DS_Store -*~ diff --git a/vendor/github.com/hajimehoshi/oto/AUTHORS b/vendor/github.com/hajimehoshi/oto/AUTHORS deleted file mode 100644 index 5f7bb19..0000000 --- a/vendor/github.com/hajimehoshi/oto/AUTHORS +++ /dev/null @@ -1,5 +0,0 @@ -Christopher Cooper -Hajime Hoshi -Medusalix <8124898+medusalix@users.noreply.github.com> -Michal Štrba -Yosuke Akatsuka diff --git a/vendor/github.com/hajimehoshi/oto/LICENSE b/vendor/github.com/hajimehoshi/oto/LICENSE deleted file mode 100644 index 8dada3e..0000000 --- a/vendor/github.com/hajimehoshi/oto/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/hajimehoshi/oto/README.md b/vendor/github.com/hajimehoshi/oto/README.md deleted file mode 100644 index e886bce..0000000 --- a/vendor/github.com/hajimehoshi/oto/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# Oto (音) - -[![GoDoc](https://godoc.org/github.com/hajimehoshi/oto?status.svg)](http://godoc.org/github.com/hajimehoshi/oto) - -A low-level library to play sound. This package offers `io.WriteCloser` to play PCM sound. - -## Platforms - -* Windows -* macOS -* Linux -* FreeBSD -* Android -* iOS -* Web browsers ([GopherJS](https://github.com/gopherjs/gopherjs) and WebAssembly) - -## Prerequisite - -### Linux - -libasound2-dev is required. On Ubuntu or Debian, run this command: - -```sh -apt install libasound2-dev -``` - -In most cases this command must be run by root user or through `sudo` command. - -### FreeBSD - -OpenAL is required. Install openal-soft: - -```sh -pkg install openal-soft -``` diff --git a/vendor/github.com/hajimehoshi/oto/context.go b/vendor/github.com/hajimehoshi/oto/context.go deleted file mode 100644 index 12ddc88..0000000 --- a/vendor/github.com/hajimehoshi/oto/context.go +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright 2019 The Oto Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package oto - -import ( - "errors" - "io" - "sync" - "time" - - "github.com/hajimehoshi/oto/internal/mux" -) - -type Context struct { - driverWriter *driverWriter - mux *mux.Mux - errCh chan error -} - -var ( - theContext *Context - contextM sync.Mutex -) - -var errClosed = errors.New("closed") - -// NewContext creates a new context, that creates and holds ready-to-use Player objects. -// -// The sampleRate argument specifies the number of samples that should be played during one second. -// Usual numbers are 44100 or 48000. -// -// The channelNum argument specifies the number of channels. One channel is mono playback. Two -// channels are stereo playback. No other values are supported. -// -// The bitDepthInBytes argument specifies the number of bytes per sample per channel. The usual value -// is 2. Only values 1 and 2 are supported. -// -// The bufferSizeInBytes argument specifies the size of the buffer of the Context. This means, how -// many bytes can Context remember before actually playing them. Bigger buffer can reduce the number -// of Player's Write calls, thus reducing CPU time. Smaller buffer enables more precise timing. The -// longest delay between when samples were written and when they started playing is equal to the size -// of the buffer. -func NewContext(sampleRate, channelNum, bitDepthInBytes, bufferSizeInBytes int) (*Context, error) { - contextM.Lock() - defer contextM.Unlock() - - if theContext != nil { - panic("oto: NewContext can be called only once") - } - - d, err := newDriver(sampleRate, channelNum, bitDepthInBytes, bufferSizeInBytes) - if err != nil { - return nil, err - } - dw := &driverWriter{ - driver: d, - bufferSize: bufferSizeInBytes, - bytesPerSecond: sampleRate * channelNum * bitDepthInBytes, - } - c := &Context{ - driverWriter: dw, - mux: mux.New(channelNum, bitDepthInBytes), - errCh: make(chan error), - } - theContext = c - go func() { - if _, err := io.Copy(c.driverWriter, c.mux); err != nil { - c.errCh <- err - } - close(c.errCh) - }() - return c, nil -} - -// NewPlayer is a short-hand of creating a Context by NewContext and a Player by the context's NewPlayer. -func NewPlayer(sampleRate, channelNum, bitDepthInBytes, bufferSizeInBytes int) (*Player, error) { - c, err := NewContext(sampleRate, channelNum, bitDepthInBytes, bufferSizeInBytes) - if err != nil { - return nil, err - } - return c.NewPlayer(), nil -} - -// NewPlayer creates a new, ready-to-use Player belonging to the Context. -func (c *Context) NewPlayer() *Player { - p := newPlayer(c) - c.mux.AddSource(p.r) - return p -} - -// Close closes the Context and its Players and frees any resources associated with it. The Context is no longer -// usable after calling Close. -func (c *Context) Close() error { - contextM.Lock() - theContext = nil - contextM.Unlock() - - if err := c.driverWriter.Close(); err != nil { - return err - } - if err := c.mux.Close(); err != nil { - return err - } - return <-c.errCh -} - -type driverWriter struct { - driver *driver - bufferSize int - bytesPerSecond int - - m sync.Mutex -} - -func (d *driverWriter) Write(buf []byte) (int, error) { - d.m.Lock() - defer d.m.Unlock() - - written := 0 - for len(buf) > 0 { - if d.driver == nil { - return written, errClosed - } - n, err := d.driver.TryWrite(buf) - written += n - if err != nil { - return written, err - } - buf = buf[n:] - // When not all buf is written, the underlying buffer is full. - // Mitigate the busy loop by sleeping (#10). - if len(buf) > 0 { - t := time.Second * time.Duration(d.bufferSize) / time.Duration(d.bytesPerSecond) / 8 - time.Sleep(t) - } - } - return written, nil -} - -func (d *driverWriter) Close() error { - d.m.Lock() - defer d.m.Unlock() - - // Close should be wait until the buffer data is consumed (#36). - // This is the simplest (but ugly) fix. - // TODO: Implement player's Close to wait the buffer played. - time.Sleep(time.Second * time.Duration(d.bufferSize) / time.Duration(d.bytesPerSecond)) - if err := d.driver.Close(); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/hajimehoshi/oto/driver_android.go b/vendor/github.com/hajimehoshi/oto/driver_android.go deleted file mode 100644 index fe392ad..0000000 --- a/vendor/github.com/hajimehoshi/oto/driver_android.go +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright 2016 Hajime Hoshi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package oto - -/* - -#include -#include - -static jclass android_media_AudioFormat; -static jclass android_media_AudioManager; -static jclass android_media_AudioTrack; - -static char* initAudioTrack(uintptr_t java_vm, uintptr_t jni_env, - int sampleRate, int channelNum, int bitDepthInBytes, jobject* audioTrack, int bufferSize) { - JavaVM* vm = (JavaVM*)java_vm; - JNIEnv* env = (JNIEnv*)jni_env; - - jclass local = (*env)->FindClass(env, "android/media/AudioFormat"); - android_media_AudioFormat = (*env)->NewGlobalRef(env, local); - (*env)->DeleteLocalRef(env, local); - - local = (*env)->FindClass(env, "android/media/AudioManager"); - android_media_AudioManager = (*env)->NewGlobalRef(env, local); - (*env)->DeleteLocalRef(env, local); - - local = (*env)->FindClass(env, "android/media/AudioTrack"); - android_media_AudioTrack = (*env)->NewGlobalRef(env, local); - (*env)->DeleteLocalRef(env, local); - - const jint android_media_AudioManager_STREAM_MUSIC = - (*env)->GetStaticIntField( - env, android_media_AudioManager, - (*env)->GetStaticFieldID(env, android_media_AudioManager, "STREAM_MUSIC", "I")); - const jint android_media_AudioTrack_MODE_STREAM = - (*env)->GetStaticIntField( - env, android_media_AudioTrack, - (*env)->GetStaticFieldID(env, android_media_AudioTrack, "MODE_STREAM", "I")); - const jint android_media_AudioFormat_CHANNEL_OUT_MONO = - (*env)->GetStaticIntField( - env, android_media_AudioFormat, - (*env)->GetStaticFieldID(env, android_media_AudioFormat, "CHANNEL_OUT_MONO", "I")); - const jint android_media_AudioFormat_CHANNEL_OUT_STEREO = - (*env)->GetStaticIntField( - env, android_media_AudioFormat, - (*env)->GetStaticFieldID(env, android_media_AudioFormat, "CHANNEL_OUT_STEREO", "I")); - const jint android_media_AudioFormat_ENCODING_PCM_8BIT = - (*env)->GetStaticIntField( - env, android_media_AudioFormat, - (*env)->GetStaticFieldID(env, android_media_AudioFormat, "ENCODING_PCM_8BIT", "I")); - const jint android_media_AudioFormat_ENCODING_PCM_16BIT = - (*env)->GetStaticIntField( - env, android_media_AudioFormat, - (*env)->GetStaticFieldID(env, android_media_AudioFormat, "ENCODING_PCM_16BIT", "I")); - - jint channel = android_media_AudioFormat_CHANNEL_OUT_MONO; - switch (channelNum) { - case 1: - channel = android_media_AudioFormat_CHANNEL_OUT_MONO; - break; - case 2: - channel = android_media_AudioFormat_CHANNEL_OUT_STEREO; - break; - default: - return "invalid channel"; - } - - jint encoding = android_media_AudioFormat_ENCODING_PCM_8BIT; - switch (bitDepthInBytes) { - case 1: - encoding = android_media_AudioFormat_ENCODING_PCM_8BIT; - break; - case 2: - encoding = android_media_AudioFormat_ENCODING_PCM_16BIT; - break; - default: - return "invalid bitDepthInBytes"; - } - - const jobject tmpAudioTrack = - (*env)->NewObject( - env, android_media_AudioTrack, - (*env)->GetMethodID(env, android_media_AudioTrack, "", "(IIIIII)V"), - android_media_AudioManager_STREAM_MUSIC, - sampleRate, channel, encoding, bufferSize, - android_media_AudioTrack_MODE_STREAM); - *audioTrack = (*env)->NewGlobalRef(env, tmpAudioTrack); - (*env)->DeleteLocalRef(env, tmpAudioTrack); - - (*env)->CallVoidMethod( - env, *audioTrack, - (*env)->GetMethodID(env, android_media_AudioTrack, "play", "()V")); - - return NULL; -} - -static char* writeToAudioTrack(uintptr_t java_vm, uintptr_t jni_env, - jobject audioTrack, int bitDepthInBytes, void* data, int length) { - JavaVM* vm = (JavaVM*)java_vm; - JNIEnv* env = (JNIEnv*)jni_env; - - jbyteArray arrInBytes; - jshortArray arrInShorts; - switch (bitDepthInBytes) { - case 1: - arrInBytes = (*env)->NewByteArray(env, length); - (*env)->SetByteArrayRegion(env, arrInBytes, 0, length, data); - break; - case 2: - arrInShorts = (*env)->NewShortArray(env, length); - (*env)->SetShortArrayRegion(env, arrInShorts, 0, length, data); - break; - } - - jint result; - static jmethodID write1 = NULL; - static jmethodID write2 = NULL; - if (!write1) { - write1 = (*env)->GetMethodID(env, android_media_AudioTrack, "write", "([BII)I"); - } - if (!write2) { - write2 = (*env)->GetMethodID(env, android_media_AudioTrack, "write", "([SII)I"); - } - switch (bitDepthInBytes) { - case 1: - result = (*env)->CallIntMethod(env, audioTrack, write1, arrInBytes, 0, length); - (*env)->DeleteLocalRef(env, arrInBytes); - break; - case 2: - result = (*env)->CallIntMethod(env, audioTrack, write2, arrInShorts, 0, length); - (*env)->DeleteLocalRef(env, arrInShorts); - break; - } - - switch (result) { - case -3: // ERROR_INVALID_OPERATION - return "invalid operation"; - case -2: // ERROR_BAD_VALUE - return "bad value"; - case -1: // ERROR - return "error"; - } - if (result < 0) { - return "unknown error"; - } - return NULL; -} - -static char* releaseAudioTrack(uintptr_t java_vm, uintptr_t jni_env, - jobject audioTrack) { - JavaVM* vm = (JavaVM*)java_vm; - JNIEnv* env = (JNIEnv*)jni_env; - - (*env)->CallVoidMethod( - env, audioTrack, - (*env)->GetMethodID(env, android_media_AudioTrack, "release", "()V")); - return NULL; -} - -*/ -import "C" - -import ( - "errors" - "runtime" - "unsafe" - - "golang.org/x/mobile/app" -) - -type driver struct { - sampleRate int - channelNum int - bitDepthInBytes int - audioTrack C.jobject - chErr chan error - chBuffer chan []byte - tmp []byte - bufferSize int -} - -func newDriver(sampleRate, channelNum, bitDepthInBytes, bufferSizeInBytes int) (*driver, error) { - p := &driver{ - sampleRate: sampleRate, - channelNum: channelNum, - bitDepthInBytes: bitDepthInBytes, - chErr: make(chan error), - chBuffer: make(chan []byte), - } - runtime.SetFinalizer(p, (*driver).Close) - - if err := app.RunOnJVM(func(vm, env, ctx uintptr) error { - audioTrack := C.jobject(0) - bufferSize := C.int(bufferSizeInBytes) - if msg := C.initAudioTrack(C.uintptr_t(vm), C.uintptr_t(env), - C.int(sampleRate), C.int(channelNum), C.int(bitDepthInBytes), - &audioTrack, bufferSize); msg != nil { - return errors.New("oto: initAutioTrack failed: " + C.GoString(msg)) - } - p.audioTrack = audioTrack - p.bufferSize = int(bufferSize) - return nil - }); err != nil { - return nil, err - } - - go p.loop() - return p, nil -} - -func (p *driver) loop() { - for bufInBytes := range p.chBuffer { - var bufInShorts []int16 - if p.bitDepthInBytes == 2 { - bufInShorts = make([]int16, len(bufInBytes)/2) - for i := 0; i < len(bufInShorts); i++ { - bufInShorts[i] = int16(bufInBytes[2*i]) | (int16(bufInBytes[2*i+1]) << 8) - } - } - if err := app.RunOnJVM(func(vm, env, ctx uintptr) error { - msg := (*C.char)(nil) - switch p.bitDepthInBytes { - case 1: - msg = C.writeToAudioTrack(C.uintptr_t(vm), C.uintptr_t(env), - p.audioTrack, C.int(p.bitDepthInBytes), - unsafe.Pointer(&bufInBytes[0]), C.int(len(bufInBytes))) - case 2: - msg = C.writeToAudioTrack(C.uintptr_t(vm), C.uintptr_t(env), - p.audioTrack, C.int(p.bitDepthInBytes), - unsafe.Pointer(&bufInShorts[0]), C.int(len(bufInShorts))) - default: - panic("not reach") - } - if msg != nil { - return errors.New("oto: loop failed: " + C.GoString(msg)) - } - return nil - }); err != nil { - p.chErr <- err - return - } - } -} - -func (p *driver) TryWrite(data []byte) (int, error) { - n := min(len(data), p.bufferSize-len(p.tmp)) - p.tmp = append(p.tmp, data[:n]...) - - if len(p.tmp) < p.bufferSize { - return n, nil - } - - select { - case p.chBuffer <- p.tmp: - case err := <-p.chErr: - return 0, err - } - - p.tmp = nil - return n, nil -} - -func (p *driver) Close() error { - if p.audioTrack == 0 { - return nil - } - - runtime.SetFinalizer(p, nil) - err := app.RunOnJVM(func(vm, env, ctx uintptr) error { - if msg := C.releaseAudioTrack(C.uintptr_t(vm), C.uintptr_t(env), - p.audioTrack); msg != nil { - return errors.New("oto: release failed: " + C.GoString(msg)) - } - return nil - }) - - p.audioTrack = 0 - return err -} diff --git a/vendor/github.com/hajimehoshi/oto/driver_js.go b/vendor/github.com/hajimehoshi/oto/driver_js.go deleted file mode 100644 index fa73f25..0000000 --- a/vendor/github.com/hajimehoshi/oto/driver_js.go +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright 2015 Hajime Hoshi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// +build js - -package oto - -import ( - "errors" - - "github.com/gopherjs/gopherwasm/js" -) - -type driver struct { - sampleRate int - channelNum int - bitDepthInBytes int - nextPos float64 - tmp []byte - bufferSize int - context js.Value - lastTime float64 - lastAudioTime float64 - ready bool -} - -const audioBufferSamples = 3200 - -func newDriver(sampleRate, channelNum, bitDepthInBytes, bufferSize int) (*driver, error) { - class := js.Global().Get("AudioContext") - if class == js.Undefined() { - class = js.Global().Get("webkitAudioContext") - } - if class == js.Undefined() { - return nil, errors.New("oto: audio couldn't be initialized") - } - p := &driver{ - sampleRate: sampleRate, - channelNum: channelNum, - bitDepthInBytes: bitDepthInBytes, - context: class.New(), - bufferSize: max(bufferSize, audioBufferSamples*channelNum*bitDepthInBytes), - } - - setCallback := func(event string) { - var f js.Callback - f = js.NewCallback(func(arguments []js.Value) { - if !p.ready { - p.context.Call("resume") - p.ready = true - } - js.Global().Get("document").Call("removeEventListener", event, f) - }) - js.Global().Get("document").Call("addEventListener", event, f) - } - - // Browsers require user interaction to start the audio. - // https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#webaudio - setCallback("touchend") - setCallback("keyup") - setCallback("mouseup") - return p, nil -} - -func toLR(data []byte) ([]float32, []float32) { - const max = 1 << 15 - - l := make([]float32, len(data)/4) - r := make([]float32, len(data)/4) - for i := 0; i < len(data)/4; i++ { - l[i] = float32(int16(data[4*i])|int16(data[4*i+1])<<8) / max - r[i] = float32(int16(data[4*i+2])|int16(data[4*i+3])<<8) / max - } - return l, r -} - -func nowInSeconds() float64 { - return js.Global().Get("performance").Call("now").Float() / 1000.0 -} - -func (p *driver) TryWrite(data []byte) (int, error) { - if !p.ready { - return 0, nil - } - - n := min(len(data), max(0, p.bufferSize-len(p.tmp))) - p.tmp = append(p.tmp, data[:n]...) - - c := p.context.Get("currentTime").Float() - now := nowInSeconds() - - if p.lastTime != 0 && p.lastAudioTime != 0 && p.lastAudioTime >= c && p.lastTime != now { - // Unfortunately, currentTime might not be precise enough on some devices - // (e.g. Android Chrome). Adjust the audio time with OS clock. - c = p.lastAudioTime + now - p.lastTime - } - - p.lastAudioTime = c - p.lastTime = now - - if p.nextPos < c { - p.nextPos = c - } - - // It's too early to enqueue a buffer. - // Highly likely, there are two playing buffers now. - if c+float64(p.bufferSize/p.bitDepthInBytes/p.channelNum)/float64(p.sampleRate) < p.nextPos { - return n, nil - } - - le := audioBufferSamples * p.bitDepthInBytes * p.channelNum - if len(p.tmp) < le { - return n, nil - } - - buf := p.context.Call("createBuffer", p.channelNum, audioBufferSamples, p.sampleRate) - l, r := toLR(p.tmp[:le]) - tl := js.TypedArrayOf(l) - tr := js.TypedArrayOf(r) - if buf.Get("copyToChannel") != js.Undefined() { - buf.Call("copyToChannel", tl, 0, 0) - buf.Call("copyToChannel", tr, 1, 0) - } else { - // copyToChannel is not defined on Safari 11 - buf.Call("getChannelData", 0).Call("set", tl) - buf.Call("getChannelData", 1).Call("set", tr) - } - tl.Release() - tr.Release() - - s := p.context.Call("createBufferSource") - s.Set("buffer", buf) - s.Call("connect", p.context.Get("destination")) - s.Call("start", p.nextPos) - p.nextPos += buf.Get("duration").Float() - - p.tmp = p.tmp[le:] - return n, nil -} - -func (p *driver) Close() error { - return nil -} diff --git a/vendor/github.com/hajimehoshi/oto/driver_linux.go b/vendor/github.com/hajimehoshi/oto/driver_linux.go deleted file mode 100644 index b84090a..0000000 --- a/vendor/github.com/hajimehoshi/oto/driver_linux.go +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright 2017 The Oto Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// +build !js -// +build !android -// +build !ios - -package oto - -/* -#cgo LDFLAGS: -lasound -#include - -static void check(int *err, int newErr) { - if (*err) { - return; - } - *err = newErr; -} - -static int ALSA_hw_params( - snd_pcm_t *pcm, - unsigned sampleRate, - unsigned numChans, - snd_pcm_format_t format, - snd_pcm_uframes_t* buffer_size, - snd_pcm_uframes_t* period_size) { - snd_pcm_hw_params_t* params = NULL; - int err = 0; - snd_pcm_hw_params_alloca(¶ms); - check(&err, snd_pcm_hw_params_any(pcm, params)); - - check(&err, snd_pcm_hw_params_set_access(pcm, params, SND_PCM_ACCESS_RW_INTERLEAVED)); - check(&err, snd_pcm_hw_params_set_format(pcm, params, format)); - check(&err, snd_pcm_hw_params_set_channels(pcm, params, numChans)); - check(&err, snd_pcm_hw_params_set_rate_resample(pcm, params, 1)); - check(&err, snd_pcm_hw_params_set_rate_near(pcm, params, &sampleRate, NULL)); - check(&err, snd_pcm_hw_params_set_buffer_size_near(pcm, params, buffer_size)); - check(&err, snd_pcm_hw_params_set_period_size_near(pcm, params, period_size, NULL)); - - check(&err, snd_pcm_hw_params(pcm, params)); - - return err; -} -*/ -import "C" - -import ( - "fmt" - "unsafe" -) - -type driver struct { - handle *C.snd_pcm_t - buf []byte - bufSamples int - numChans int - bitDepthInBytes int -} - -func alsaError(err C.int) error { - return fmt.Errorf("oto: ALSA error: %s", C.GoString(C.snd_strerror(err))) -} - -func newDriver(sampleRate, numChans, bitDepthInBytes, bufferSizeInBytes int) (*driver, error) { - p := &driver{ - numChans: numChans, - bitDepthInBytes: bitDepthInBytes, - } - - // open a default ALSA audio device for blocking stream playback - if errCode := C.snd_pcm_open(&p.handle, C.CString("default"), C.SND_PCM_STREAM_PLAYBACK, 0); errCode < 0 { - return nil, alsaError(errCode) - } - - // bufferSize is the total size of the main circular buffer fullness of this buffer - // oscilates somewhere between bufferSize and bufferSize-periodSize - bufferSize := C.snd_pcm_uframes_t(bufferSizeInBytes / (numChans * bitDepthInBytes)) - // periodSize is the number of samples that will be taken from the main circular - // buffer at once, we leave this value to bufferSize, because ALSA will change that - // to the maximum viable number, obviously lower than bufferSize - periodSize := bufferSize - - // choose the correct sample format according to bitDepthInBytes - var format C.snd_pcm_format_t - switch bitDepthInBytes { - case 1: - format = C.SND_PCM_FORMAT_S8 - case 2: - format = C.SND_PCM_FORMAT_S16_LE - default: - panic(fmt.Errorf("oto: bitDepthInBytes must be 1 or 2, got %d", bitDepthInBytes)) - } - - // set the device hardware parameters according to sampleRate, numChans, format, bufferSize - // and periodSize - // - // bufferSize and periodSize are passed as pointers, because they may be changed according - // to the wisdom of ALSA - // - // ALSA will try too keep them as close to what was requested as possible - if errCode := C.ALSA_hw_params(p.handle, C.uint(sampleRate), C.uint(numChans), format, &bufferSize, &periodSize); errCode < 0 { - p.Close() - return nil, alsaError(errCode) - } - - // allocate the buffer of the size of the period, use the periodSize that we've got back - // from ALSA after it's wise decision - p.bufSamples = int(periodSize) - p.buf = []byte{} - - return p, nil -} - -func (p *driver) TryWrite(data []byte) (n int, err error) { - bufSize := p.bufSamples * p.numChans * p.bitDepthInBytes - for len(data) > 0 { - toWrite := min(len(data), max(0, bufSize-len(p.buf))) - p.buf = append(p.buf, data[:toWrite]...) - data = data[toWrite:] - n += toWrite - - // our buffer is not full and we've used up all the data, we'll keep them and finish - if len(p.buf) < bufSize { - break - } - - // write samples to the main circular buffer - wrote := C.snd_pcm_writei(p.handle, unsafe.Pointer(&p.buf[0]), C.snd_pcm_uframes_t(p.bufSamples)) - if wrote == -C.EPIPE { - // Underrun! - if errCode := C.snd_pcm_prepare(p.handle); errCode < 0 { - return 0, alsaError(errCode) - } - continue - } - if wrote < 0 { - // an error occured while writing samples - return 0, alsaError(C.int(wrote)) - } - p.buf = p.buf[int(wrote)*p.numChans*p.bitDepthInBytes:] - } - return n, nil -} - -func (p *driver) Close() error { - // drop the remaining unprocessed samples in the main circular buffer - if errCode := C.snd_pcm_drop(p.handle); errCode < 0 { - return alsaError(errCode) - } - if errCode := C.snd_pcm_close(p.handle); errCode < 0 { - return alsaError(errCode) - } - return nil -} diff --git a/vendor/github.com/hajimehoshi/oto/driver_openal.go b/vendor/github.com/hajimehoshi/oto/driver_openal.go deleted file mode 100644 index 31f2d24..0000000 --- a/vendor/github.com/hajimehoshi/oto/driver_openal.go +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright 2015 Hajime Hoshi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// +build darwin freebsd -// +build !js -// +build !android - -package oto - -// #cgo darwin LDFLAGS: -framework OpenAL -// #cgo freebsd LDFLAGS: -lopenal -// -// #include -// -// #ifdef __APPLE__ -// #include -// #include -// #else -// #include -// #include -// #endif -// -// static uintptr_t _alcOpenDevice(const ALCchar* name) { -// return (uintptr_t)alcOpenDevice(name); -// } -// -// static ALCboolean _alcCloseDevice(uintptr_t device) { -// return alcCloseDevice((void*)device); -// } -// -// static uintptr_t _alcCreateContext(uintptr_t device, const ALCint* attrList) { -// return (uintptr_t)alcCreateContext((void*)device, attrList); -// } -// -// static ALCenum _alcGetError(uintptr_t device) { -// return alcGetError((void*)device); -// } -// -// static void _alcMakeContextCurrent(uintptr_t context) { -// alcMakeContextCurrent((void*)context); -// } -// -// static void _alcDestroyContext(uintptr_t context) { -// alcDestroyContext((void*)context); -// } -import "C" - -import ( - "errors" - "fmt" - "runtime" - "unsafe" -) - -// As x/mobile/exp/audio/al is broken on macOS (https://github.com/golang/go/issues/15075), -// and that doesn't support FreeBSD, use OpenAL directly here. - -type driver struct { - // alContext represents a pointer to ALCcontext. The type is uintptr since the value - // can be 0x18 on macOS, which is invalid as a pointer value, and this might cause - // GC errors. - alContext alContext - alDevice alDevice - alDeviceName string - alSource C.ALuint - sampleRate int - isClosed bool - alFormat C.ALenum - - bufs []C.ALuint - tmp []byte - bufferSize int -} - -// alContext is a pointer to OpenAL context. -// The value is not unsafe.Pointer for C.ALCcontext but uintptr, -// because device pointer value can be an invalid value as a pointer on macOS, -// and Cgo pointer checker complains (#65). -type alContext uintptr - -// alDevice is a pointer to OpenAL device. -type alDevice uintptr - -func (a alDevice) getError() error { - switch c := C._alcGetError(C.uintptr_t(a)); c { - case C.ALC_NO_ERROR: - return nil - case C.ALC_INVALID_DEVICE: - return errors.New("OpenAL error: invalid device") - case C.ALC_INVALID_CONTEXT: - return errors.New("OpenAL error: invalid context") - case C.ALC_INVALID_ENUM: - return errors.New("OpenAL error: invalid enum") - case C.ALC_INVALID_VALUE: - return errors.New("OpenAL error: invalid value") - case C.ALC_OUT_OF_MEMORY: - return errors.New("OpenAL error: out of memory") - default: - return fmt.Errorf("OpenAL error: code %d", c) - } -} - -func alFormat(channelNum, bitDepthInBytes int) C.ALenum { - switch { - case channelNum == 1 && bitDepthInBytes == 1: - return C.AL_FORMAT_MONO8 - case channelNum == 1 && bitDepthInBytes == 2: - return C.AL_FORMAT_MONO16 - case channelNum == 2 && bitDepthInBytes == 1: - return C.AL_FORMAT_STEREO8 - case channelNum == 2 && bitDepthInBytes == 2: - return C.AL_FORMAT_STEREO16 - } - panic(fmt.Sprintf("oto: invalid channel num (%d) or bytes per sample (%d)", channelNum, bitDepthInBytes)) -} - -const numBufs = 2 - -func newDriver(sampleRate, channelNum, bitDepthInBytes, bufferSizeInBytes int) (*driver, error) { - name := C.alGetString(C.ALC_DEFAULT_DEVICE_SPECIFIER) - d := alDevice(C._alcOpenDevice((*C.ALCchar)(name))) - if d == 0 { - return nil, fmt.Errorf("oto: alcOpenDevice must not return null") - } - c := alContext(C._alcCreateContext(C.uintptr_t(d), nil)) - if c == 0 { - return nil, fmt.Errorf("oto: alcCreateContext must not return null") - } - - // Don't check getError until making the current context is done. - // Linux might fail this check even though it succeeds (hajimehoshi/ebiten#204). - C._alcMakeContextCurrent(C.uintptr_t(c)) - if err := d.getError(); err != nil { - return nil, fmt.Errorf("oto: Activate: %v", err) - } - - s := C.ALuint(0) - C.alGenSources(1, &s) - if err := d.getError(); err != nil { - return nil, fmt.Errorf("oto: NewSource: %v", err) - } - - p := &driver{ - alContext: c, - alDevice: d, - alSource: s, - alDeviceName: C.GoString((*C.char)(name)), - sampleRate: sampleRate, - alFormat: alFormat(channelNum, bitDepthInBytes), - bufs: make([]C.ALuint, numBufs), - bufferSize: bufferSizeInBytes, - } - runtime.SetFinalizer(p, (*driver).Close) - C.alGenBuffers(C.ALsizei(numBufs), &p.bufs[0]) - C.alSourcePlay(p.alSource) - - if err := d.getError(); err != nil { - return nil, fmt.Errorf("oto: Play: %v", err) - } - - return p, nil -} - -func (p *driver) TryWrite(data []byte) (int, error) { - if err := p.alDevice.getError(); err != nil { - return 0, fmt.Errorf("oto: starting Write: %v", err) - } - n := min(len(data), max(0, p.bufferSize-len(p.tmp))) - p.tmp = append(p.tmp, data[:n]...) - if len(p.tmp) < p.bufferSize { - return n, nil - } - - pn := C.ALint(0) - C.alGetSourcei(p.alSource, C.AL_BUFFERS_PROCESSED, &pn) - - if pn > 0 { - bufs := make([]C.ALuint, pn) - C.alSourceUnqueueBuffers(p.alSource, C.ALsizei(len(bufs)), &bufs[0]) - if err := p.alDevice.getError(); err != nil { - return 0, fmt.Errorf("oto: UnqueueBuffers: %v", err) - } - p.bufs = append(p.bufs, bufs...) - } - - if len(p.bufs) == 0 { - return n, nil - } - - buf := p.bufs[0] - p.bufs = p.bufs[1:] - C.alBufferData(buf, p.alFormat, unsafe.Pointer(&p.tmp[0]), C.ALsizei(p.bufferSize), C.ALsizei(p.sampleRate)) - C.alSourceQueueBuffers(p.alSource, 1, &buf) - if err := p.alDevice.getError(); err != nil { - return 0, fmt.Errorf("oto: QueueBuffer: %v", err) - } - - state := C.ALint(0) - C.alGetSourcei(p.alSource, C.AL_SOURCE_STATE, &state) - if state == C.AL_STOPPED || state == C.AL_INITIAL { - C.alSourceRewind(p.alSource) - C.alSourcePlay(p.alSource) - if err := p.alDevice.getError(); err != nil { - return 0, fmt.Errorf("oto: Rewind or Play: %v", err) - } - } - - p.tmp = nil - return n, nil -} - -func (p *driver) Close() error { - if err := p.alDevice.getError(); err != nil { - return fmt.Errorf("oto: starting Close: %v", err) - } - if p.isClosed { - return nil - } - - n := C.ALint(0) - C.alGetSourcei(p.alSource, C.AL_BUFFERS_QUEUED, &n) - if 0 < n { - bs := make([]C.ALuint, n) - C.alSourceUnqueueBuffers(p.alSource, C.ALsizei(len(bs)), &bs[0]) - p.bufs = append(p.bufs, bs...) - } - - C.alSourceStop(p.alSource) - C.alDeleteSources(1, &p.alSource) - if len(p.bufs) != 0 { - C.alDeleteBuffers(C.ALsizei(numBufs), &p.bufs[0]) - } - C._alcDestroyContext(C.uintptr_t(p.alContext)) - - if err := p.alDevice.getError(); err != nil { - return fmt.Errorf("oto: CloseDevice: %v", err) - } - - b := C._alcCloseDevice(C.uintptr_t(p.alDevice)) - if b == C.ALC_FALSE { - return fmt.Errorf("oto: CloseDevice: %s failed to close", p.alDeviceName) - } - - p.isClosed = true - runtime.SetFinalizer(p, nil) - return nil -} diff --git a/vendor/github.com/hajimehoshi/oto/driver_windows.go b/vendor/github.com/hajimehoshi/oto/driver_windows.go deleted file mode 100644 index 8ea02ba..0000000 --- a/vendor/github.com/hajimehoshi/oto/driver_windows.go +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright 2015 Hajime Hoshi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// +build !js - -package oto - -import ( - "errors" - "runtime" - "unsafe" -) - -type header struct { - buffer []byte - waveHdr *wavehdr -} - -func newHeader(waveOut uintptr, bufferSize int) (*header, error) { - h := &header{ - buffer: make([]byte, bufferSize), - } - h.waveHdr = &wavehdr{ - lpData: uintptr(unsafe.Pointer(&h.buffer[0])), - dwBufferLength: uint32(bufferSize), - } - if err := waveOutPrepareHeader(waveOut, h.waveHdr); err != nil { - return nil, err - } - return h, nil -} - -func (h *header) Write(waveOut uintptr, data []byte) error { - if len(data) != len(h.buffer) { - return errors.New("oto: len(data) must equal to len(h.buffer)") - } - copy(h.buffer, data) - if err := waveOutWrite(waveOut, h.waveHdr); err != nil { - return err - } - return nil -} - -type driver struct { - out uintptr - headers []*header - tmp []byte - bufferSize int -} - -func newDriver(sampleRate, channelNum, bitDepthInBytes, bufferSizeInBytes int) (*driver, error) { - numBlockAlign := channelNum * bitDepthInBytes - f := &waveformatex{ - wFormatTag: waveFormatPCM, - nChannels: uint16(channelNum), - nSamplesPerSec: uint32(sampleRate), - nAvgBytesPerSec: uint32(sampleRate * numBlockAlign), - wBitsPerSample: uint16(bitDepthInBytes * 8), - nBlockAlign: uint16(numBlockAlign), - } - w, err := waveOutOpen(f) - if err != nil { - return nil, err - } - - const numBufs = 2 - p := &driver{ - out: w, - headers: make([]*header, numBufs), - bufferSize: bufferSizeInBytes, - } - runtime.SetFinalizer(p, (*driver).Close) - for i := range p.headers { - var err error - p.headers[i], err = newHeader(w, p.bufferSize) - if err != nil { - return nil, err - } - } - return p, nil -} - -func (p *driver) TryWrite(data []byte) (int, error) { - n := min(len(data), max(0, p.bufferSize-len(p.tmp))) - p.tmp = append(p.tmp, data[:n]...) - if len(p.tmp) < p.bufferSize { - return n, nil - } - - var headerToWrite *header - for _, h := range p.headers { - // TODO: Need to check WHDR_DONE? - if h.waveHdr.dwFlags&whdrInqueue == 0 { - headerToWrite = h - break - } - } - if headerToWrite == nil { - return n, nil - } - - if err := headerToWrite.Write(p.out, p.tmp); err != nil { - // This error can happen when e.g. a new HDMI connection is detected (#51). - const errorNotFound = 1168 - werr := err.(*winmmError) - if werr.fname == "waveOutWrite" && werr.errno == errorNotFound { - return 0, nil - } - return 0, err - } - - p.tmp = nil - return n, nil -} - -func (p *driver) Close() error { - runtime.SetFinalizer(p, nil) - // TODO: Call waveOutUnprepareHeader here - if err := waveOutClose(p.out); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/hajimehoshi/oto/go.mod b/vendor/github.com/hajimehoshi/oto/go.mod deleted file mode 100644 index 23087eb..0000000 --- a/vendor/github.com/hajimehoshi/oto/go.mod +++ /dev/null @@ -1,9 +0,0 @@ -module github.com/hajimehoshi/oto - -require ( - github.com/gopherjs/gopherwasm v1.0.0 - golang.org/x/exp v0.0.0-20180710024300-14dda7b62fcd // indirect - golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81 // indirect - golang.org/x/mobile v0.0.0-20180806140643-507816974b79 - golang.org/x/sys v0.0.0-20181228144115-9a3f9b0469bb -) diff --git a/vendor/github.com/hajimehoshi/oto/go.sum b/vendor/github.com/hajimehoshi/oto/go.sum deleted file mode 100644 index 7602620..0000000 --- a/vendor/github.com/hajimehoshi/oto/go.sum +++ /dev/null @@ -1,14 +0,0 @@ -github.com/gopherjs/gopherjs v0.0.0-20180825215210-0210a2f0f73c h1:16eHWuMGvCjSfgRJKqIzapE78onvvTbdi1rMkU00lZw= -github.com/gopherjs/gopherjs v0.0.0-20180825215210-0210a2f0f73c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gopherjs/gopherwasm v1.0.0 h1:32nge/RlujS1Im4HNCJPp0NbBOAeBXFuT1KonUuLl+Y= -github.com/gopherjs/gopherwasm v1.0.0/go.mod h1:SkZ8z7CWBz5VXbhJel8TxCmAcsQqzgWGR/8nMhyhZSI= -golang.org/x/exp v0.0.0-20180710024300-14dda7b62fcd h1:nLIcFw7GiqKXUS7HiChg6OAYWgASB2H97dZKd1GhDSs= -golang.org/x/exp v0.0.0-20180710024300-14dda7b62fcd/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81 h1:00VmoueYNlNz/aHIilyyQz/MHSqGoWJzpFv/HW8xpzI= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= -golang.org/x/mobile v0.0.0-20180806140643-507816974b79 h1:t2JRgCWkY7Qaa1J2jal+wqC9OjbyHCHwIA9rVlRUSMo= -golang.org/x/mobile v0.0.0-20180806140643-507816974b79/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/sys v0.0.0-20180806082429-34b17bdb4300 h1:eJa+6+7jje7fOYUrLnwKNR9kcpvLANj1Asw0Ou1pBiI= -golang.org/x/sys v0.0.0-20180806082429-34b17bdb4300/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181228144115-9a3f9b0469bb h1:pf3XwC90UUdNPYWZdFjhGBE7DUFuK3Ct1zWmZ65QN30= -golang.org/x/sys v0.0.0-20181228144115-9a3f9b0469bb/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/vendor/github.com/hajimehoshi/oto/internal/mux/mux.go b/vendor/github.com/hajimehoshi/oto/internal/mux/mux.go deleted file mode 100644 index 3675f7a..0000000 --- a/vendor/github.com/hajimehoshi/oto/internal/mux/mux.go +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2019 The Oto Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package mux - -import ( - "bufio" - "io" - "runtime" - "sync" -) - -// Mux is a multiplexer for multiple io.Reader objects. -type Mux struct { - channelNum int - bitDepthInBytes int - readers map[io.Reader]*bufio.Reader - closed bool - - m sync.RWMutex -} - -func New(channelNum, bitDepthInBytes int) *Mux { - m := &Mux{ - channelNum: channelNum, - bitDepthInBytes: bitDepthInBytes, - readers: map[io.Reader]*bufio.Reader{}, - } - runtime.SetFinalizer(m, (*Mux).Close) - return m -} - -func (m *Mux) Read(buf []byte) (int, error) { - m.m.Lock() - defer m.m.Unlock() - - if m.closed { - return 0, io.EOF - } - - if len(m.readers) == 0 { - // When there is no reader, Read should return with 0s or Read caller can block forever. - // See https://github.com/hajimehoshi/go-mp3/issues/28 - n := 256 - if len(buf) < 256 { - n = len(buf) - } - copy(buf, make([]byte, n)) - return n, nil - } - - bs := m.channelNum * m.bitDepthInBytes - l := len(buf) - l = l / bs * bs // Adjust the length in order not to mix different channels. - - bufs := map[*bufio.Reader][]byte{} - for _, p := range m.readers { - peeked, err := p.Peek(l) - if err != nil && err != bufio.ErrBufferFull && err != io.EOF { - return 0, err - } - if l > len(peeked) { - l = len(peeked) - l = l / bs * bs - } - bufs[p] = peeked[:l] - } - - if l == 0 { - return 0, nil - } - - for _, p := range m.readers { - if _, err := p.Discard(l); err != nil { - return 0, err - } - } - - switch m.bitDepthInBytes { - case 1: - const ( - max = 127 - min = -128 - offset = 128 - ) - for i := 0; i < l; i++ { - x := 0 - for _, b := range bufs { - x += int(b[i]) - offset - } - if x > max { - x = max - } - if x < min { - x = min - } - buf[i] = byte(x + offset) - } - case 2: - const ( - max = (1 << 15) - 1 - min = -(1 << 15) - ) - for i := 0; i < l/2; i++ { - x := 0 - for _, b := range bufs { - x += int(int16(b[2*i]) | (int16(b[2*i+1]) << 8)) - } - if x > max { - x = max - } - if x < min { - x = min - } - buf[2*i] = byte(x) - buf[2*i+1] = byte(x >> 8) - } - default: - panic("not reached") - } - - return l, nil -} - -func (m *Mux) Close() error { - m.m.Lock() - runtime.SetFinalizer(m, nil) - m.readers = nil - m.closed = true - m.m.Unlock() - return nil -} - -func (m *Mux) AddSource(source io.Reader) { - m.m.Lock() - if m.closed { - panic("mux: already closed") - } - if _, ok := m.readers[source]; ok { - panic("mux: the io.Reader cannot be added multiple times") - } - m.readers[source] = bufio.NewReaderSize(source, 256) - m.m.Unlock() -} - -func (m *Mux) RemoveSource(source io.Reader) { - m.m.Lock() - if m.closed { - panic("mux: already closed") - } - if _, ok := m.readers[source]; !ok { - panic("mux: the io.Reader is already removed") - } - delete(m.readers, source) - m.m.Unlock() -} diff --git a/vendor/github.com/hajimehoshi/oto/player.go b/vendor/github.com/hajimehoshi/oto/player.go deleted file mode 100644 index 21b968b..0000000 --- a/vendor/github.com/hajimehoshi/oto/player.go +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2017 Hajime Hoshi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package oto offers io.Writer to play sound on multiple platforms. -package oto - -import ( - "io" - "runtime" -) - -// Player is a PCM (pulse-code modulation) audio player. -// Player implements io.WriteCloser. -// Use Write method to play samples. -type Player struct { - context *Context - r *io.PipeReader - w *io.PipeWriter -} - -func newPlayer(context *Context) *Player { - r, w := io.Pipe() - p := &Player{ - context: context, - r: r, - w: w, - } - runtime.SetFinalizer(p, (*Player).Close) - return p -} - -// Write writes PCM samples to the Player. -// -// The format is as follows: -// [data] = [sample 1] [sample 2] [sample 3] ... -// [sample *] = [channel 1] ... -// [channel *] = [byte 1] [byte 2] ... -// Byte ordering is little endian. -// -// The data is first put into the Player's buffer. Once the buffer is full, Player starts playing -// the data and empties the buffer. -// -// If the supplied data doesn't fit into the Player's buffer, Write block until a sufficient amount -// of data has been played (or at least started playing) and the remaining unplayed data fits into -// the buffer. -// -// Note, that the Player won't start playing anything until the buffer is full. -func (p *Player) Write(buf []byte) (int, error) { - return p.w.Write(buf) -} - -// Close closes the Player and frees any resources associated with it. The Player is no longer -// usable after calling Close. -func (p *Player) Close() error { - runtime.SetFinalizer(p, nil) - - // Already closed - if p.context == nil { - return nil - } - - // Close the pipe writer before RemoveSource, or Read-ing in the mux takes forever. - if err := p.w.Close(); err != nil { - return err - } - - p.context.mux.RemoveSource(p.r) - p.context = nil - - // Close the pipe reader after RemoveSource, or ErrClosedPipe happens at Read-ing. - if err := p.r.Close(); err != nil { - return err - } - return nil -} - -func max(a, b int) int { - if a < b { - return b - } - return a -} - -func min(a, b int) int { - if a < b { - return a - } - return b -} diff --git a/vendor/github.com/hajimehoshi/oto/winmm_windows.go b/vendor/github.com/hajimehoshi/oto/winmm_windows.go deleted file mode 100644 index bec8751..0000000 --- a/vendor/github.com/hajimehoshi/oto/winmm_windows.go +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2017 Hajime Hoshi -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// +build !js - -package oto - -import ( - "fmt" - "unsafe" - - "golang.org/x/sys/windows" -) - -var ( - winmm = windows.NewLazySystemDLL("winmm") -) - -var ( - procWaveOutOpen = winmm.NewProc("waveOutOpen") - procWaveOutClose = winmm.NewProc("waveOutClose") - procWaveOutPrepareHeader = winmm.NewProc("waveOutPrepareHeader") - procWaveOutWrite = winmm.NewProc("waveOutWrite") -) - -type wavehdr struct { - lpData uintptr - dwBufferLength uint32 - dwBytesRecorded uint32 - dwUser uintptr - dwFlags uint32 - dwLoops uint32 - lpNext uintptr - reserved uintptr -} - -type waveformatex struct { - wFormatTag uint16 - nChannels uint16 - nSamplesPerSec uint32 - nAvgBytesPerSec uint32 - nBlockAlign uint16 - wBitsPerSample uint16 - cbSize uint16 -} - -const ( - waveFormatPCM = 1 - whdrInqueue = 16 -) - -type mmresult uint - -const ( - mmsyserrNoerror mmresult = 0 - mmsyserrError mmresult = 1 - mmsyserrBaddeviceid mmresult = 2 - mmsyserrAllocated mmresult = 4 - mmsyserrInvalidhandle mmresult = 5 - mmsyserrNodriver mmresult = 6 - mmsyserrNomem mmresult = 7 - waveerrBadformat mmresult = 32 - waveerrStillplaying mmresult = 33 - waveerrUnprepared mmresult = 34 - waveerrSync mmresult = 35 -) - -func (m mmresult) String() string { - switch m { - case mmsyserrNoerror: - return "MMSYSERR_NOERROR" - case mmsyserrError: - return "MMSYSERR_ERROR" - case mmsyserrBaddeviceid: - return "MMSYSERR_BADDEVICEID" - case mmsyserrAllocated: - return "MMSYSERR_ALLOCATED" - case mmsyserrInvalidhandle: - return "MMSYSERR_INVALIDHANDLE" - case mmsyserrNodriver: - return "MMSYSERR_NODRIVER" - case mmsyserrNomem: - return "MMSYSERR_NOMEM" - case waveerrBadformat: - return "WAVEERR_BADFORMAT" - case waveerrStillplaying: - return "WAVEERR_STILLPLAYING" - case waveerrUnprepared: - return "WAVEERR_UNPREPARED" - case waveerrSync: - return "WAVEERR_SYNC" - } - return fmt.Sprintf("MMRESULT (%d)", m) -} - -type winmmError struct { - fname string - errno windows.Errno - mmresult mmresult -} - -func (e *winmmError) Error() string { - if e.errno != 0 { - return fmt.Sprintf("winmm error at %s: Errno: %d", e.fname, e.errno) - } - if e.mmresult != mmsyserrNoerror { - return fmt.Sprintf("winmm error at %s: %s", e.fname, e.mmresult) - } - return fmt.Sprintf("winmm error at %s", e.fname) -} - -func waveOutOpen(f *waveformatex) (uintptr, error) { - const ( - waveMapper = 0xffffffff - callbackNull = 0 - ) - var w uintptr - r, _, e := procWaveOutOpen.Call(uintptr(unsafe.Pointer(&w)), waveMapper, uintptr(unsafe.Pointer(f)), - 0, 0, callbackNull) - if e.(windows.Errno) != 0 { - return 0, &winmmError{ - fname: "waveOutOpen", - errno: e.(windows.Errno), - } - } - if mmresult(r) != mmsyserrNoerror { - return 0, &winmmError{ - fname: "waveOutOpen", - mmresult: mmresult(r), - } - } - return w, nil -} - -func waveOutClose(hwo uintptr) error { - r, _, e := procWaveOutClose.Call(hwo) - if e.(windows.Errno) != 0 { - return &winmmError{ - fname: "waveOutClose", - errno: e.(windows.Errno), - } - } - // WAVERR_STILLPLAYING is ignored. - if mmresult(r) != mmsyserrNoerror && mmresult(r) != waveerrStillplaying { - return &winmmError{ - fname: "waveOutClose", - mmresult: mmresult(r), - } - } - return nil -} - -func waveOutPrepareHeader(hwo uintptr, pwh *wavehdr) error { - r, _, e := procWaveOutPrepareHeader.Call(hwo, uintptr(unsafe.Pointer(pwh)), unsafe.Sizeof(wavehdr{})) - if e.(windows.Errno) != 0 { - return &winmmError{ - fname: "waveOutPrepareHeader", - errno: e.(windows.Errno), - } - } - if mmresult(r) != mmsyserrNoerror { - return &winmmError{ - fname: "waveOutPrepareHeader", - mmresult: mmresult(r), - } - } - return nil -} - -func waveOutWrite(hwo uintptr, pwh *wavehdr) error { - r, _, e := procWaveOutWrite.Call(hwo, uintptr(unsafe.Pointer(pwh)), unsafe.Sizeof(wavehdr{})) - if e.(windows.Errno) != 0 { - return &winmmError{ - fname: "waveOutWrite", - errno: e.(windows.Errno), - } - } - if mmresult(r) != mmsyserrNoerror { - return &winmmError{ - fname: "waveOutWrite", - mmresult: mmresult(r), - } - } - return nil -} diff --git a/vendor/github.com/pkg/errors/.gitignore b/vendor/github.com/pkg/errors/.gitignore deleted file mode 100644 index daf913b..0000000 --- a/vendor/github.com/pkg/errors/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof diff --git a/vendor/github.com/pkg/errors/.travis.yml b/vendor/github.com/pkg/errors/.travis.yml deleted file mode 100644 index d4b9266..0000000 --- a/vendor/github.com/pkg/errors/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: go -go_import_path: github.com/pkg/errors -go: - - 1.4.x - - 1.5.x - - 1.6.x - - 1.7.x - - 1.8.x - - 1.9.x - - 1.10.x - - 1.11.x - - tip - -script: - - go test -v ./... diff --git a/vendor/github.com/pkg/errors/LICENSE b/vendor/github.com/pkg/errors/LICENSE deleted file mode 100644 index 835ba3e..0000000 --- a/vendor/github.com/pkg/errors/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2015, Dave Cheney -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/pkg/errors/README.md b/vendor/github.com/pkg/errors/README.md deleted file mode 100644 index 6483ba2..0000000 --- a/vendor/github.com/pkg/errors/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# errors [![Travis-CI](https://travis-ci.org/pkg/errors.svg)](https://travis-ci.org/pkg/errors) [![AppVeyor](https://ci.appveyor.com/api/projects/status/b98mptawhudj53ep/branch/master?svg=true)](https://ci.appveyor.com/project/davecheney/errors/branch/master) [![GoDoc](https://godoc.org/github.com/pkg/errors?status.svg)](http://godoc.org/github.com/pkg/errors) [![Report card](https://goreportcard.com/badge/github.com/pkg/errors)](https://goreportcard.com/report/github.com/pkg/errors) [![Sourcegraph](https://sourcegraph.com/github.com/pkg/errors/-/badge.svg)](https://sourcegraph.com/github.com/pkg/errors?badge) - -Package errors provides simple error handling primitives. - -`go get github.com/pkg/errors` - -The traditional error handling idiom in Go is roughly akin to -```go -if err != nil { - return err -} -``` -which applied recursively up the call stack results in error reports without context or debugging information. The errors package allows programmers to add context to the failure path in their code in a way that does not destroy the original value of the error. - -## Adding context to an error - -The errors.Wrap function returns a new error that adds context to the original error. For example -```go -_, err := ioutil.ReadAll(r) -if err != nil { - return errors.Wrap(err, "read failed") -} -``` -## Retrieving the cause of an error - -Using `errors.Wrap` constructs a stack of errors, adding context to the preceding error. Depending on the nature of the error it may be necessary to reverse the operation of errors.Wrap to retrieve the original error for inspection. Any error value which implements this interface can be inspected by `errors.Cause`. -```go -type causer interface { - Cause() error -} -``` -`errors.Cause` will recursively retrieve the topmost error which does not implement `causer`, which is assumed to be the original cause. For example: -```go -switch err := errors.Cause(err).(type) { -case *MyError: - // handle specifically -default: - // unknown error -} -``` - -[Read the package documentation for more information](https://godoc.org/github.com/pkg/errors). - -## Contributing - -We welcome pull requests, bug fixes and issue reports. With that said, the bar for adding new symbols to this package is intentionally set high. - -Before proposing a change, please discuss your change by raising an issue. - -## License - -BSD-2-Clause diff --git a/vendor/github.com/pkg/errors/appveyor.yml b/vendor/github.com/pkg/errors/appveyor.yml deleted file mode 100644 index a932ead..0000000 --- a/vendor/github.com/pkg/errors/appveyor.yml +++ /dev/null @@ -1,32 +0,0 @@ -version: build-{build}.{branch} - -clone_folder: C:\gopath\src\github.com\pkg\errors -shallow_clone: true # for startup speed - -environment: - GOPATH: C:\gopath - -platform: - - x64 - -# http://www.appveyor.com/docs/installed-software -install: - # some helpful output for debugging builds - - go version - - go env - # pre-installed MinGW at C:\MinGW is 32bit only - # but MSYS2 at C:\msys64 has mingw64 - - set PATH=C:\msys64\mingw64\bin;%PATH% - - gcc --version - - g++ --version - -build_script: - - go install -v ./... - -test_script: - - set PATH=C:\gopath\bin;%PATH% - - go test -v ./... - -#artifacts: -# - path: '%GOPATH%\bin\*.exe' -deploy: off diff --git a/vendor/github.com/pkg/errors/errors.go b/vendor/github.com/pkg/errors/errors.go deleted file mode 100644 index 7421f32..0000000 --- a/vendor/github.com/pkg/errors/errors.go +++ /dev/null @@ -1,282 +0,0 @@ -// Package errors provides simple error handling primitives. -// -// The traditional error handling idiom in Go is roughly akin to -// -// if err != nil { -// return err -// } -// -// which when applied recursively up the call stack results in error reports -// without context or debugging information. The errors package allows -// programmers to add context to the failure path in their code in a way -// that does not destroy the original value of the error. -// -// Adding context to an error -// -// The errors.Wrap function returns a new error that adds context to the -// original error by recording a stack trace at the point Wrap is called, -// together with the supplied message. For example -// -// _, err := ioutil.ReadAll(r) -// if err != nil { -// return errors.Wrap(err, "read failed") -// } -// -// If additional control is required, the errors.WithStack and -// errors.WithMessage functions destructure errors.Wrap into its component -// operations: annotating an error with a stack trace and with a message, -// respectively. -// -// Retrieving the cause of an error -// -// Using errors.Wrap constructs a stack of errors, adding context to the -// preceding error. Depending on the nature of the error it may be necessary -// to reverse the operation of errors.Wrap to retrieve the original error -// for inspection. Any error value which implements this interface -// -// type causer interface { -// Cause() error -// } -// -// can be inspected by errors.Cause. errors.Cause will recursively retrieve -// the topmost error that does not implement causer, which is assumed to be -// the original cause. For example: -// -// switch err := errors.Cause(err).(type) { -// case *MyError: -// // handle specifically -// default: -// // unknown error -// } -// -// Although the causer interface is not exported by this package, it is -// considered a part of its stable public interface. -// -// Formatted printing of errors -// -// All error values returned from this package implement fmt.Formatter and can -// be formatted by the fmt package. The following verbs are supported: -// -// %s print the error. If the error has a Cause it will be -// printed recursively. -// %v see %s -// %+v extended format. Each Frame of the error's StackTrace will -// be printed in detail. -// -// Retrieving the stack trace of an error or wrapper -// -// New, Errorf, Wrap, and Wrapf record a stack trace at the point they are -// invoked. This information can be retrieved with the following interface: -// -// type stackTracer interface { -// StackTrace() errors.StackTrace -// } -// -// The returned errors.StackTrace type is defined as -// -// type StackTrace []Frame -// -// The Frame type represents a call site in the stack trace. Frame supports -// the fmt.Formatter interface that can be used for printing information about -// the stack trace of this error. For example: -// -// if err, ok := err.(stackTracer); ok { -// for _, f := range err.StackTrace() { -// fmt.Printf("%+s:%d", f) -// } -// } -// -// Although the stackTracer interface is not exported by this package, it is -// considered a part of its stable public interface. -// -// See the documentation for Frame.Format for more details. -package errors - -import ( - "fmt" - "io" -) - -// New returns an error with the supplied message. -// New also records the stack trace at the point it was called. -func New(message string) error { - return &fundamental{ - msg: message, - stack: callers(), - } -} - -// Errorf formats according to a format specifier and returns the string -// as a value that satisfies error. -// Errorf also records the stack trace at the point it was called. -func Errorf(format string, args ...interface{}) error { - return &fundamental{ - msg: fmt.Sprintf(format, args...), - stack: callers(), - } -} - -// fundamental is an error that has a message and a stack, but no caller. -type fundamental struct { - msg string - *stack -} - -func (f *fundamental) Error() string { return f.msg } - -func (f *fundamental) Format(s fmt.State, verb rune) { - switch verb { - case 'v': - if s.Flag('+') { - io.WriteString(s, f.msg) - f.stack.Format(s, verb) - return - } - fallthrough - case 's': - io.WriteString(s, f.msg) - case 'q': - fmt.Fprintf(s, "%q", f.msg) - } -} - -// WithStack annotates err with a stack trace at the point WithStack was called. -// If err is nil, WithStack returns nil. -func WithStack(err error) error { - if err == nil { - return nil - } - return &withStack{ - err, - callers(), - } -} - -type withStack struct { - error - *stack -} - -func (w *withStack) Cause() error { return w.error } - -func (w *withStack) Format(s fmt.State, verb rune) { - switch verb { - case 'v': - if s.Flag('+') { - fmt.Fprintf(s, "%+v", w.Cause()) - w.stack.Format(s, verb) - return - } - fallthrough - case 's': - io.WriteString(s, w.Error()) - case 'q': - fmt.Fprintf(s, "%q", w.Error()) - } -} - -// Wrap returns an error annotating err with a stack trace -// at the point Wrap is called, and the supplied message. -// If err is nil, Wrap returns nil. -func Wrap(err error, message string) error { - if err == nil { - return nil - } - err = &withMessage{ - cause: err, - msg: message, - } - return &withStack{ - err, - callers(), - } -} - -// Wrapf returns an error annotating err with a stack trace -// at the point Wrapf is called, and the format specifier. -// If err is nil, Wrapf returns nil. -func Wrapf(err error, format string, args ...interface{}) error { - if err == nil { - return nil - } - err = &withMessage{ - cause: err, - msg: fmt.Sprintf(format, args...), - } - return &withStack{ - err, - callers(), - } -} - -// WithMessage annotates err with a new message. -// If err is nil, WithMessage returns nil. -func WithMessage(err error, message string) error { - if err == nil { - return nil - } - return &withMessage{ - cause: err, - msg: message, - } -} - -// WithMessagef annotates err with the format specifier. -// If err is nil, WithMessagef returns nil. -func WithMessagef(err error, format string, args ...interface{}) error { - if err == nil { - return nil - } - return &withMessage{ - cause: err, - msg: fmt.Sprintf(format, args...), - } -} - -type withMessage struct { - cause error - msg string -} - -func (w *withMessage) Error() string { return w.msg + ": " + w.cause.Error() } -func (w *withMessage) Cause() error { return w.cause } - -func (w *withMessage) Format(s fmt.State, verb rune) { - switch verb { - case 'v': - if s.Flag('+') { - fmt.Fprintf(s, "%+v\n", w.Cause()) - io.WriteString(s, w.msg) - return - } - fallthrough - case 's', 'q': - io.WriteString(s, w.Error()) - } -} - -// Cause returns the underlying cause of the error, if possible. -// An error value has a cause if it implements the following -// interface: -// -// type causer interface { -// Cause() error -// } -// -// If the error does not implement Cause, the original error will -// be returned. If the error is nil, nil will be returned without further -// investigation. -func Cause(err error) error { - type causer interface { - Cause() error - } - - for err != nil { - cause, ok := err.(causer) - if !ok { - break - } - err = cause.Cause() - } - return err -} diff --git a/vendor/github.com/pkg/errors/stack.go b/vendor/github.com/pkg/errors/stack.go deleted file mode 100644 index 2874a04..0000000 --- a/vendor/github.com/pkg/errors/stack.go +++ /dev/null @@ -1,147 +0,0 @@ -package errors - -import ( - "fmt" - "io" - "path" - "runtime" - "strings" -) - -// Frame represents a program counter inside a stack frame. -type Frame uintptr - -// pc returns the program counter for this frame; -// multiple frames may have the same PC value. -func (f Frame) pc() uintptr { return uintptr(f) - 1 } - -// file returns the full path to the file that contains the -// function for this Frame's pc. -func (f Frame) file() string { - fn := runtime.FuncForPC(f.pc()) - if fn == nil { - return "unknown" - } - file, _ := fn.FileLine(f.pc()) - return file -} - -// line returns the line number of source code of the -// function for this Frame's pc. -func (f Frame) line() int { - fn := runtime.FuncForPC(f.pc()) - if fn == nil { - return 0 - } - _, line := fn.FileLine(f.pc()) - return line -} - -// Format formats the frame according to the fmt.Formatter interface. -// -// %s source file -// %d source line -// %n function name -// %v equivalent to %s:%d -// -// Format accepts flags that alter the printing of some verbs, as follows: -// -// %+s function name and path of source file relative to the compile time -// GOPATH separated by \n\t (\n\t) -// %+v equivalent to %+s:%d -func (f Frame) Format(s fmt.State, verb rune) { - switch verb { - case 's': - switch { - case s.Flag('+'): - pc := f.pc() - fn := runtime.FuncForPC(pc) - if fn == nil { - io.WriteString(s, "unknown") - } else { - file, _ := fn.FileLine(pc) - fmt.Fprintf(s, "%s\n\t%s", fn.Name(), file) - } - default: - io.WriteString(s, path.Base(f.file())) - } - case 'd': - fmt.Fprintf(s, "%d", f.line()) - case 'n': - name := runtime.FuncForPC(f.pc()).Name() - io.WriteString(s, funcname(name)) - case 'v': - f.Format(s, 's') - io.WriteString(s, ":") - f.Format(s, 'd') - } -} - -// StackTrace is stack of Frames from innermost (newest) to outermost (oldest). -type StackTrace []Frame - -// Format formats the stack of Frames according to the fmt.Formatter interface. -// -// %s lists source files for each Frame in the stack -// %v lists the source file and line number for each Frame in the stack -// -// Format accepts flags that alter the printing of some verbs, as follows: -// -// %+v Prints filename, function, and line number for each Frame in the stack. -func (st StackTrace) Format(s fmt.State, verb rune) { - switch verb { - case 'v': - switch { - case s.Flag('+'): - for _, f := range st { - fmt.Fprintf(s, "\n%+v", f) - } - case s.Flag('#'): - fmt.Fprintf(s, "%#v", []Frame(st)) - default: - fmt.Fprintf(s, "%v", []Frame(st)) - } - case 's': - fmt.Fprintf(s, "%s", []Frame(st)) - } -} - -// stack represents a stack of program counters. -type stack []uintptr - -func (s *stack) Format(st fmt.State, verb rune) { - switch verb { - case 'v': - switch { - case st.Flag('+'): - for _, pc := range *s { - f := Frame(pc) - fmt.Fprintf(st, "\n%+v", f) - } - } - } -} - -func (s *stack) StackTrace() StackTrace { - f := make([]Frame, len(*s)) - for i := 0; i < len(f); i++ { - f[i] = Frame((*s)[i]) - } - return f -} - -func callers() *stack { - const depth = 32 - var pcs [depth]uintptr - n := runtime.Callers(3, pcs[:]) - var st stack = pcs[0:n] - return &st -} - -// funcname removes the path prefix component of a function's name reported by func.Name(). -func funcname(name string) string { - i := strings.LastIndex(name, "/") - name = name[i+1:] - i = strings.Index(name, ".") - return name[i+1:] -} diff --git a/vendor/golang.org/x/exp/AUTHORS b/vendor/golang.org/x/exp/AUTHORS deleted file mode 100644 index 15167cd..0000000 --- a/vendor/golang.org/x/exp/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code refers to The Go Authors for copyright purposes. -# The master list of authors is in the main Go distribution, -# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/golang.org/x/exp/CONTRIBUTORS b/vendor/golang.org/x/exp/CONTRIBUTORS deleted file mode 100644 index 1c4577e..0000000 --- a/vendor/golang.org/x/exp/CONTRIBUTORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code was written by the Go contributors. -# The master list of contributors is in the main Go distribution, -# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/golang.org/x/exp/LICENSE b/vendor/golang.org/x/exp/LICENSE deleted file mode 100644 index 6a66aea..0000000 --- a/vendor/golang.org/x/exp/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/exp/PATENTS b/vendor/golang.org/x/exp/PATENTS deleted file mode 100644 index 7330990..0000000 --- a/vendor/golang.org/x/exp/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Go project. - -Google hereby grants to You a perpetual, worldwide, non-exclusive, -no-charge, royalty-free, irrevocable (except as stated in this section) -patent license to make, have made, use, offer to sell, sell, import, -transfer and otherwise run, modify and propagate the contents of this -implementation of Go, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of Go. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of Go or any code incorporated within this -implementation of Go constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of Go -shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/exp/shiny/driver/gldriver/buffer.go b/vendor/golang.org/x/exp/shiny/driver/gldriver/buffer.go deleted file mode 100644 index 94b4b9a..0000000 --- a/vendor/golang.org/x/exp/shiny/driver/gldriver/buffer.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gldriver - -import "image" - -type bufferImpl struct { - // buf should always be equal to (i.e. the same ptr, len, cap as) rgba.Pix. - // It is a separate, redundant field in order to detect modifications to - // the rgba field that are invalid as per the screen.Buffer documentation. - buf []byte - rgba image.RGBA - size image.Point -} - -func (b *bufferImpl) Release() {} -func (b *bufferImpl) Size() image.Point { return b.size } -func (b *bufferImpl) Bounds() image.Rectangle { return image.Rectangle{Max: b.size} } -func (b *bufferImpl) RGBA() *image.RGBA { return &b.rgba } - -func (b *bufferImpl) preUpload() { - // Check that the program hasn't tried to modify the rgba field via the - // pointer returned by the bufferImpl.RGBA method. This check doesn't catch - // 100% of all cases; it simply tries to detect some invalid uses of a - // screen.Buffer such as: - // *buffer.RGBA() = anotherImageRGBA - if len(b.buf) != 0 && len(b.rgba.Pix) != 0 && &b.buf[0] != &b.rgba.Pix[0] { - panic("gldriver: invalid Buffer.RGBA modification") - } -} diff --git a/vendor/golang.org/x/exp/shiny/driver/gldriver/cocoa.go b/vendor/golang.org/x/exp/shiny/driver/gldriver/cocoa.go deleted file mode 100644 index 8e44d5b..0000000 --- a/vendor/golang.org/x/exp/shiny/driver/gldriver/cocoa.go +++ /dev/null @@ -1,671 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin -// +build 386 amd64 -// +build !ios - -package gldriver - -/* -#cgo CFLAGS: -x objective-c -#cgo LDFLAGS: -framework Cocoa -framework OpenGL -#include -#import // for HIToolbox/Events.h -#import -#include -#include -#include - -void startDriver(); -void stopDriver(); -void makeCurrentContext(uintptr_t ctx); -void flushContext(uintptr_t ctx); -uintptr_t doNewWindow(int width, int height, char* title); -void doShowWindow(uintptr_t id); -void doCloseWindow(uintptr_t id); -uint64_t threadID(); -*/ -import "C" - -import ( - "errors" - "fmt" - "log" - "runtime" - "unsafe" - - "golang.org/x/exp/shiny/driver/internal/lifecycler" - "golang.org/x/exp/shiny/screen" - "golang.org/x/mobile/event/key" - "golang.org/x/mobile/event/mouse" - "golang.org/x/mobile/event/paint" - "golang.org/x/mobile/event/size" - "golang.org/x/mobile/geom" - "golang.org/x/mobile/gl" -) - -const useLifecycler = true - -// TODO: change this to true, after manual testing on OS X. -const handleSizeEventsAtChannelReceive = false - -var initThreadID C.uint64_t - -func init() { - // Lock the goroutine responsible for initialization to an OS thread. - // This means the goroutine running main (and calling startDriver below) - // is locked to the OS thread that started the program. This is - // necessary for the correct delivery of Cocoa events to the process. - // - // A discussion on this topic: - // https://groups.google.com/forum/#!msg/golang-nuts/IiWZ2hUuLDA/SNKYYZBelsYJ - runtime.LockOSThread() - initThreadID = C.threadID() -} - -func newWindow(opts *screen.NewWindowOptions) (uintptr, error) { - width, height := optsSize(opts) - - title := C.CString(opts.GetTitle()) - defer C.free(unsafe.Pointer(title)) - - return uintptr(C.doNewWindow(C.int(width), C.int(height), title)), nil -} - -func initWindow(w *windowImpl) { - w.glctx, w.worker = gl.NewContext() -} - -func showWindow(w *windowImpl) { - C.doShowWindow(C.uintptr_t(w.id)) -} - -//export preparedOpenGL -func preparedOpenGL(id, ctx, vba uintptr) { - theScreen.mu.Lock() - w := theScreen.windows[id] - theScreen.mu.Unlock() - - w.ctx = ctx - go drawLoop(w, vba) -} - -func closeWindow(id uintptr) { - C.doCloseWindow(C.uintptr_t(id)) -} - -var mainCallback func(screen.Screen) - -func main(f func(screen.Screen)) error { - if tid := C.threadID(); tid != initThreadID { - log.Fatalf("gldriver.Main called on thread %d, but gldriver.init ran on %d", tid, initThreadID) - } - - mainCallback = f - C.startDriver() - return nil -} - -//export driverStarted -func driverStarted() { - go func() { - mainCallback(theScreen) - C.stopDriver() - }() -} - -//export drawgl -func drawgl(id uintptr) { - theScreen.mu.Lock() - w := theScreen.windows[id] - theScreen.mu.Unlock() - - if w == nil { - return // closing window - } - - // TODO: is this necessary? - w.lifecycler.SetVisible(true) - w.lifecycler.SendEvent(w, w.glctx) - - w.Send(paint.Event{External: true}) - <-w.drawDone -} - -// drawLoop is the primary drawing loop. -// -// After Cocoa has created an NSWindow and called prepareOpenGL, -// it starts drawLoop on a locked goroutine to handle OpenGL calls. -// -// The screen is drawn every time a paint.Event is received, which can be -// triggered either by the user or by Cocoa via drawgl (for example, when -// the window is resized). -func drawLoop(w *windowImpl, vba uintptr) { - runtime.LockOSThread() - C.makeCurrentContext(C.uintptr_t(w.ctx.(uintptr))) - - // Starting in OS X 10.11 (El Capitan), the vertex array is - // occasionally getting unbound when the context changes threads. - // - // Avoid this by binding it again. - C.glBindVertexArray(C.GLuint(vba)) - if errno := C.glGetError(); errno != 0 { - panic(fmt.Sprintf("gldriver: glBindVertexArray failed: %d", errno)) - } - - workAvailable := w.worker.WorkAvailable() - - // TODO(crawshaw): exit this goroutine on Release. - for { - select { - case <-workAvailable: - w.worker.DoWork() - case <-w.publish: - loop: - for { - select { - case <-workAvailable: - w.worker.DoWork() - default: - break loop - } - } - C.flushContext(C.uintptr_t(w.ctx.(uintptr))) - w.publishDone <- screen.PublishResult{} - } - } -} - -//export setGeom -func setGeom(id uintptr, ppp float32, widthPx, heightPx int) { - theScreen.mu.Lock() - w := theScreen.windows[id] - theScreen.mu.Unlock() - - if w == nil { - return // closing window - } - - sz := size.Event{ - WidthPx: widthPx, - HeightPx: heightPx, - WidthPt: geom.Pt(float32(widthPx) / ppp), - HeightPt: geom.Pt(float32(heightPx) / ppp), - PixelsPerPt: ppp, - } - - if !handleSizeEventsAtChannelReceive { - w.szMu.Lock() - w.sz = sz - w.szMu.Unlock() - } - - w.Send(sz) -} - -//export windowClosing -func windowClosing(id uintptr) { - sendLifecycle(id, (*lifecycler.State).SetDead, true) -} - -func sendWindowEvent(id uintptr, e interface{}) { - theScreen.mu.Lock() - w := theScreen.windows[id] - theScreen.mu.Unlock() - - if w == nil { - return // closing window - } - w.Send(e) -} - -var mods = [...]struct { - flags uint32 - code uint16 - mod key.Modifiers -}{ - // Left and right variants of modifier keys have their own masks, - // but they are not documented. These were determined empirically. - {1<<17 | 0x102, C.kVK_Shift, key.ModShift}, - {1<<17 | 0x104, C.kVK_RightShift, key.ModShift}, - {1<<18 | 0x101, C.kVK_Control, key.ModControl}, - // TODO key.ControlRight - {1<<19 | 0x120, C.kVK_Option, key.ModAlt}, - {1<<19 | 0x140, C.kVK_RightOption, key.ModAlt}, - {1<<20 | 0x108, C.kVK_Command, key.ModMeta}, - {1<<20 | 0x110, C.kVK_Command, key.ModMeta}, // TODO: missing kVK_RightCommand -} - -func cocoaMods(flags uint32) (m key.Modifiers) { - for _, mod := range mods { - if flags&mod.flags == mod.flags { - m |= mod.mod - } - } - return m -} - -func cocoaMouseDir(ty int32) mouse.Direction { - switch ty { - case C.NSLeftMouseDown, C.NSRightMouseDown, C.NSOtherMouseDown: - return mouse.DirPress - case C.NSLeftMouseUp, C.NSRightMouseUp, C.NSOtherMouseUp: - return mouse.DirRelease - default: // dragged - return mouse.DirNone - } -} - -func cocoaMouseButton(button int32) mouse.Button { - switch button { - case 0: - return mouse.ButtonLeft - case 1: - return mouse.ButtonRight - case 2: - return mouse.ButtonMiddle - default: - return mouse.ButtonNone - } -} - -//export mouseEvent -func mouseEvent(id uintptr, x, y, dx, dy float32, ty, button int32, flags uint32) { - cmButton := mouse.ButtonNone - switch ty { - default: - cmButton = cocoaMouseButton(button) - case C.NSMouseMoved, C.NSLeftMouseDragged, C.NSRightMouseDragged, C.NSOtherMouseDragged: - // No-op. - case C.NSScrollWheel: - // Note that the direction of scrolling is inverted by default - // on OS X by the "natural scrolling" setting. At the Cocoa - // level this inversion is applied to trackpads and mice behind - // the scenes, and the value of dy goes in the direction the OS - // wants scrolling to go. - // - // This means the same trackpad/mouse motion on OS X and Linux - // can produce wheel events in opposite directions, but the - // direction matches what other programs on the OS do. - // - // If we wanted to expose the phsyical device motion in the - // event we could use [NSEvent isDirectionInvertedFromDevice] - // to know if "natural scrolling" is enabled. - // - // TODO: On a trackpad, a scroll can be a drawn-out affair with a - // distinct beginning and end. Should the intermediate events be - // DirNone? - // - // TODO: handle horizontal scrolling - button := mouse.ButtonWheelUp - if dy < 0 { - dy = -dy - button = mouse.ButtonWheelDown - } - e := mouse.Event{ - X: x, - Y: y, - Button: button, - Direction: mouse.DirStep, - Modifiers: cocoaMods(flags), - } - for delta := int(dy); delta != 0; delta-- { - sendWindowEvent(id, e) - } - return - } - sendWindowEvent(id, mouse.Event{ - X: x, - Y: y, - Button: cmButton, - Direction: cocoaMouseDir(ty), - Modifiers: cocoaMods(flags), - }) -} - -//export keyEvent -func keyEvent(id uintptr, runeVal rune, dir uint8, code uint16, flags uint32) { - sendWindowEvent(id, key.Event{ - Rune: cocoaRune(runeVal), - Direction: key.Direction(dir), - Code: cocoaKeyCode(code), - Modifiers: cocoaMods(flags), - }) -} - -//export flagEvent -func flagEvent(id uintptr, flags uint32) { - for _, mod := range mods { - if flags&mod.flags == mod.flags && lastFlags&mod.flags != mod.flags { - keyEvent(id, -1, C.NSKeyDown, mod.code, flags) - } - if lastFlags&mod.flags == mod.flags && flags&mod.flags != mod.flags { - keyEvent(id, -1, C.NSKeyUp, mod.code, flags) - } - } - lastFlags = flags -} - -var lastFlags uint32 - -func sendLifecycle(id uintptr, setter func(*lifecycler.State, bool), val bool) { - theScreen.mu.Lock() - w := theScreen.windows[id] - theScreen.mu.Unlock() - - if w == nil { - return - } - setter(&w.lifecycler, val) - w.lifecycler.SendEvent(w, w.glctx) -} - -func sendLifecycleAll(dead bool) { - windows := []*windowImpl{} - - theScreen.mu.Lock() - for _, w := range theScreen.windows { - windows = append(windows, w) - } - theScreen.mu.Unlock() - - for _, w := range windows { - w.lifecycler.SetFocused(false) - w.lifecycler.SetVisible(false) - if dead { - w.lifecycler.SetDead(true) - } - w.lifecycler.SendEvent(w, w.glctx) - } -} - -//export lifecycleDeadAll -func lifecycleDeadAll() { sendLifecycleAll(true) } - -//export lifecycleHideAll -func lifecycleHideAll() { sendLifecycleAll(false) } - -//export lifecycleVisible -func lifecycleVisible(id uintptr, val bool) { - sendLifecycle(id, (*lifecycler.State).SetVisible, val) -} - -//export lifecycleFocused -func lifecycleFocused(id uintptr, val bool) { - sendLifecycle(id, (*lifecycler.State).SetFocused, val) -} - -// cocoaRune marks the Carbon/Cocoa private-range unicode rune representing -// a non-unicode key event to -1, used for Rune in the key package. -// -// http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/CORPCHAR.TXT -func cocoaRune(r rune) rune { - if '\uE000' <= r && r <= '\uF8FF' { - return -1 - } - return r -} - -// cocoaKeyCode converts a Carbon/Cocoa virtual key code number -// into the standard keycodes used by the key package. -// -// To get a sense of the key map, see the diagram on -// http://boredzo.org/blog/archives/2007-05-22/virtual-key-codes -func cocoaKeyCode(vkcode uint16) key.Code { - switch vkcode { - case C.kVK_ANSI_A: - return key.CodeA - case C.kVK_ANSI_B: - return key.CodeB - case C.kVK_ANSI_C: - return key.CodeC - case C.kVK_ANSI_D: - return key.CodeD - case C.kVK_ANSI_E: - return key.CodeE - case C.kVK_ANSI_F: - return key.CodeF - case C.kVK_ANSI_G: - return key.CodeG - case C.kVK_ANSI_H: - return key.CodeH - case C.kVK_ANSI_I: - return key.CodeI - case C.kVK_ANSI_J: - return key.CodeJ - case C.kVK_ANSI_K: - return key.CodeK - case C.kVK_ANSI_L: - return key.CodeL - case C.kVK_ANSI_M: - return key.CodeM - case C.kVK_ANSI_N: - return key.CodeN - case C.kVK_ANSI_O: - return key.CodeO - case C.kVK_ANSI_P: - return key.CodeP - case C.kVK_ANSI_Q: - return key.CodeQ - case C.kVK_ANSI_R: - return key.CodeR - case C.kVK_ANSI_S: - return key.CodeS - case C.kVK_ANSI_T: - return key.CodeT - case C.kVK_ANSI_U: - return key.CodeU - case C.kVK_ANSI_V: - return key.CodeV - case C.kVK_ANSI_W: - return key.CodeW - case C.kVK_ANSI_X: - return key.CodeX - case C.kVK_ANSI_Y: - return key.CodeY - case C.kVK_ANSI_Z: - return key.CodeZ - case C.kVK_ANSI_1: - return key.Code1 - case C.kVK_ANSI_2: - return key.Code2 - case C.kVK_ANSI_3: - return key.Code3 - case C.kVK_ANSI_4: - return key.Code4 - case C.kVK_ANSI_5: - return key.Code5 - case C.kVK_ANSI_6: - return key.Code6 - case C.kVK_ANSI_7: - return key.Code7 - case C.kVK_ANSI_8: - return key.Code8 - case C.kVK_ANSI_9: - return key.Code9 - case C.kVK_ANSI_0: - return key.Code0 - // TODO: move the rest of these codes to constants in key.go - // if we are happy with them. - case C.kVK_Return: - return key.CodeReturnEnter - case C.kVK_Escape: - return key.CodeEscape - case C.kVK_Delete: - return key.CodeDeleteBackspace - case C.kVK_Tab: - return key.CodeTab - case C.kVK_Space: - return key.CodeSpacebar - case C.kVK_ANSI_Minus: - return key.CodeHyphenMinus - case C.kVK_ANSI_Equal: - return key.CodeEqualSign - case C.kVK_ANSI_LeftBracket: - return key.CodeLeftSquareBracket - case C.kVK_ANSI_RightBracket: - return key.CodeRightSquareBracket - case C.kVK_ANSI_Backslash: - return key.CodeBackslash - // 50: Keyboard Non-US "#" and ~ - case C.kVK_ANSI_Semicolon: - return key.CodeSemicolon - case C.kVK_ANSI_Quote: - return key.CodeApostrophe - case C.kVK_ANSI_Grave: - return key.CodeGraveAccent - case C.kVK_ANSI_Comma: - return key.CodeComma - case C.kVK_ANSI_Period: - return key.CodeFullStop - case C.kVK_ANSI_Slash: - return key.CodeSlash - case C.kVK_CapsLock: - return key.CodeCapsLock - case C.kVK_F1: - return key.CodeF1 - case C.kVK_F2: - return key.CodeF2 - case C.kVK_F3: - return key.CodeF3 - case C.kVK_F4: - return key.CodeF4 - case C.kVK_F5: - return key.CodeF5 - case C.kVK_F6: - return key.CodeF6 - case C.kVK_F7: - return key.CodeF7 - case C.kVK_F8: - return key.CodeF8 - case C.kVK_F9: - return key.CodeF9 - case C.kVK_F10: - return key.CodeF10 - case C.kVK_F11: - return key.CodeF11 - case C.kVK_F12: - return key.CodeF12 - // 70: PrintScreen - // 71: Scroll Lock - // 72: Pause - // 73: Insert - case C.kVK_Home: - return key.CodeHome - case C.kVK_PageUp: - return key.CodePageUp - case C.kVK_ForwardDelete: - return key.CodeDeleteForward - case C.kVK_End: - return key.CodeEnd - case C.kVK_PageDown: - return key.CodePageDown - case C.kVK_RightArrow: - return key.CodeRightArrow - case C.kVK_LeftArrow: - return key.CodeLeftArrow - case C.kVK_DownArrow: - return key.CodeDownArrow - case C.kVK_UpArrow: - return key.CodeUpArrow - case C.kVK_ANSI_KeypadClear: - return key.CodeKeypadNumLock - case C.kVK_ANSI_KeypadDivide: - return key.CodeKeypadSlash - case C.kVK_ANSI_KeypadMultiply: - return key.CodeKeypadAsterisk - case C.kVK_ANSI_KeypadMinus: - return key.CodeKeypadHyphenMinus - case C.kVK_ANSI_KeypadPlus: - return key.CodeKeypadPlusSign - case C.kVK_ANSI_KeypadEnter: - return key.CodeKeypadEnter - case C.kVK_ANSI_Keypad1: - return key.CodeKeypad1 - case C.kVK_ANSI_Keypad2: - return key.CodeKeypad2 - case C.kVK_ANSI_Keypad3: - return key.CodeKeypad3 - case C.kVK_ANSI_Keypad4: - return key.CodeKeypad4 - case C.kVK_ANSI_Keypad5: - return key.CodeKeypad5 - case C.kVK_ANSI_Keypad6: - return key.CodeKeypad6 - case C.kVK_ANSI_Keypad7: - return key.CodeKeypad7 - case C.kVK_ANSI_Keypad8: - return key.CodeKeypad8 - case C.kVK_ANSI_Keypad9: - return key.CodeKeypad9 - case C.kVK_ANSI_Keypad0: - return key.CodeKeypad0 - case C.kVK_ANSI_KeypadDecimal: - return key.CodeKeypadFullStop - case C.kVK_ANSI_KeypadEquals: - return key.CodeKeypadEqualSign - case C.kVK_F13: - return key.CodeF13 - case C.kVK_F14: - return key.CodeF14 - case C.kVK_F15: - return key.CodeF15 - case C.kVK_F16: - return key.CodeF16 - case C.kVK_F17: - return key.CodeF17 - case C.kVK_F18: - return key.CodeF18 - case C.kVK_F19: - return key.CodeF19 - case C.kVK_F20: - return key.CodeF20 - // 116: Keyboard Execute - case C.kVK_Help: - return key.CodeHelp - // 118: Keyboard Menu - // 119: Keyboard Select - // 120: Keyboard Stop - // 121: Keyboard Again - // 122: Keyboard Undo - // 123: Keyboard Cut - // 124: Keyboard Copy - // 125: Keyboard Paste - // 126: Keyboard Find - case C.kVK_Mute: - return key.CodeMute - case C.kVK_VolumeUp: - return key.CodeVolumeUp - case C.kVK_VolumeDown: - return key.CodeVolumeDown - // 130: Keyboard Locking Caps Lock - // 131: Keyboard Locking Num Lock - // 132: Keyboard Locking Scroll Lock - // 133: Keyboard Comma - // 134: Keyboard Equal Sign - // ...: Bunch of stuff - case C.kVK_Control: - return key.CodeLeftControl - case C.kVK_Shift: - return key.CodeLeftShift - case C.kVK_Option: - return key.CodeLeftAlt - case C.kVK_Command: - return key.CodeLeftGUI - case C.kVK_RightControl: - return key.CodeRightControl - case C.kVK_RightShift: - return key.CodeRightShift - case C.kVK_RightOption: - return key.CodeRightAlt - // TODO key.CodeRightGUI - default: - return key.CodeUnknown - } -} - -func surfaceCreate() error { - return errors.New("gldriver: surface creation not implemented on darwin") -} diff --git a/vendor/golang.org/x/exp/shiny/driver/gldriver/cocoa.m b/vendor/golang.org/x/exp/shiny/driver/gldriver/cocoa.m deleted file mode 100644 index d8bfb8c..0000000 --- a/vendor/golang.org/x/exp/shiny/driver/gldriver/cocoa.m +++ /dev/null @@ -1,327 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin -// +build 386 amd64 -// +build !ios - -#include "_cgo_export.h" -#include -#include - -#import -#import -#import - -// The variables did not exist on older OS X releases, -// we use the old variables deprecated on macOS to define them. -#if __MAC_OS_X_VERSION_MAX_ALLOWED < 101200 -enum -{ - NSEventTypeScrollWheel = NSScrollWheel, - NSEventTypeKeyDown = NSKeyDown -}; -enum -{ - NSWindowStyleMaskTitled = NSTitledWindowMask, - NSWindowStyleMaskResizable = NSResizableWindowMask, - NSWindowStyleMaskMiniaturizable = NSMiniaturizableWindowMask, - NSWindowStyleMaskClosable = NSClosableWindowMask -}; -#endif - -void makeCurrentContext(uintptr_t context) { - NSOpenGLContext* ctx = (NSOpenGLContext*)context; - [ctx makeCurrentContext]; -} - -void flushContext(uintptr_t context) { - NSOpenGLContext* ctx = (NSOpenGLContext*)context; - [ctx flushBuffer]; -} - -uint64 threadID() { - uint64 id; - if (pthread_threadid_np(pthread_self(), &id)) { - abort(); - } - return id; -} - -@interface ScreenGLView : NSOpenGLView -{ -} -@end - -@implementation ScreenGLView -- (void)prepareOpenGL { - [self setWantsBestResolutionOpenGLSurface:YES]; - GLint swapInt = 1; - NSOpenGLContext *ctx = [self openGLContext]; - [ctx setValues:&swapInt forParameter:NSOpenGLCPSwapInterval]; - - // Using attribute arrays in OpenGL 3.3 requires the use of a VBA. - // But VBAs don't exist in ES 2. So we bind a default one. - GLuint vba; - glGenVertexArrays(1, &vba); - glBindVertexArray(vba); - - preparedOpenGL((GoUintptr)self, (GoUintptr)ctx, (GoUintptr)vba); -} - -- (void)callSetGeom { - // Calculate screen PPI. - // - // Note that the backingScaleFactor converts from logical - // pixels to actual pixels, but both of these units vary - // independently from real world size. E.g. - // - // 13" Retina Macbook Pro, 2560x1600, 227ppi, backingScaleFactor=2, scale=3.15 - // 15" Retina Macbook Pro, 2880x1800, 220ppi, backingScaleFactor=2, scale=3.06 - // 27" iMac, 2560x1440, 109ppi, backingScaleFactor=1, scale=1.51 - // 27" Retina iMac, 5120x2880, 218ppi, backingScaleFactor=2, scale=3.03 - NSScreen *screen = self.window.screen; - double screenPixW = [screen frame].size.width * [screen backingScaleFactor]; - - CGDirectDisplayID display = (CGDirectDisplayID)[[[screen deviceDescription] valueForKey:@"NSScreenNumber"] intValue]; - CGSize screenSizeMM = CGDisplayScreenSize(display); // in millimeters - float ppi = 25.4 * screenPixW / screenSizeMM.width; - float pixelsPerPt = ppi/72.0; - - // The width and height reported to the geom package are the - // bounds of the OpenGL view. Several steps are necessary. - // First, [self bounds] gives us the number of logical pixels - // in the view. Multiplying this by the backingScaleFactor - // gives us the number of actual pixels. - NSRect r = [self bounds]; - int w = r.size.width * [screen backingScaleFactor]; - int h = r.size.height * [screen backingScaleFactor]; - - setGeom((GoUintptr)self, pixelsPerPt, w, h); -} - -- (void)reshape { - [super reshape]; - [self callSetGeom]; -} - -- (void)drawRect:(NSRect)theRect { - // Called during resize. Do an extra draw if we are visible. - // This gets rid of flicker when resizing. - drawgl((GoUintptr)self); -} - -- (void)mouseEventNS:(NSEvent *)theEvent { - NSPoint p = [theEvent locationInWindow]; - double h = self.frame.size.height; - - // Both h and p are measured in Cocoa pixels, which are a fraction of - // physical pixels, so we multiply by backingScaleFactor. - double scale = [self.window.screen backingScaleFactor]; - - double x = p.x * scale; - double y = (h - p.y) * scale - 1; // flip origin from bottom-left to top-left. - - double dx, dy; - if (theEvent.type == NSEventTypeScrollWheel) { - dx = theEvent.scrollingDeltaX; - dy = theEvent.scrollingDeltaY; - } - - mouseEvent((GoUintptr)self, x, y, dx, dy, theEvent.type, theEvent.buttonNumber, theEvent.modifierFlags); -} - -- (void)mouseMoved:(NSEvent *)theEvent { [self mouseEventNS:theEvent]; } -- (void)mouseDown:(NSEvent *)theEvent { [self mouseEventNS:theEvent]; } -- (void)mouseUp:(NSEvent *)theEvent { [self mouseEventNS:theEvent]; } -- (void)mouseDragged:(NSEvent *)theEvent { [self mouseEventNS:theEvent]; } -- (void)rightMouseDown:(NSEvent *)theEvent { [self mouseEventNS:theEvent]; } -- (void)rightMouseUp:(NSEvent *)theEvent { [self mouseEventNS:theEvent]; } -- (void)rightMouseDragged:(NSEvent *)theEvent { [self mouseEventNS:theEvent]; } -- (void)otherMouseDown:(NSEvent *)theEvent { [self mouseEventNS:theEvent]; } -- (void)otherMouseUp:(NSEvent *)theEvent { [self mouseEventNS:theEvent]; } -- (void)otherMouseDragged:(NSEvent *)theEvent { [self mouseEventNS:theEvent]; } -- (void)scrollWheel:(NSEvent *)theEvent { [self mouseEventNS:theEvent]; } - -// raw modifier key presses -- (void)flagsChanged:(NSEvent *)theEvent { - flagEvent((GoUintptr)self, theEvent.modifierFlags); -} - -// overrides special handling of escape and tab -- (BOOL)performKeyEquivalent:(NSEvent *)theEvent { - [self key:theEvent]; - return YES; -} - -- (void)keyDown:(NSEvent *)theEvent { [self key:theEvent]; } -- (void)keyUp:(NSEvent *)theEvent { [self key:theEvent]; } - -- (void)key:(NSEvent *)theEvent { - NSRange range = [theEvent.characters rangeOfComposedCharacterSequenceAtIndex:0]; - - uint8_t buf[4] = {0, 0, 0, 0}; - if (![theEvent.characters getBytes:buf - maxLength:4 - usedLength:nil - encoding:NSUTF32LittleEndianStringEncoding - options:NSStringEncodingConversionAllowLossy - range:range - remainingRange:nil]) { - NSLog(@"failed to read key event %@", theEvent); - return; - } - - uint32_t rune = (uint32_t)buf[0]<<0 | (uint32_t)buf[1]<<8 | (uint32_t)buf[2]<<16 | (uint32_t)buf[3]<<24; - - uint8_t direction; - if ([theEvent isARepeat]) { - direction = 0; - } else if (theEvent.type == NSEventTypeKeyDown) { - direction = 1; - } else { - direction = 2; - } - keyEvent((GoUintptr)self, (int32_t)rune, direction, theEvent.keyCode, theEvent.modifierFlags); -} - -- (void)windowDidChangeScreenProfile:(NSNotification *)notification { - [self callSetGeom]; -} - -// TODO: catch windowDidMiniaturize? - -- (void)windowDidExpose:(NSNotification *)notification { - lifecycleVisible((GoUintptr)self, true); -} - -- (void)windowDidBecomeKey:(NSNotification *)notification { - lifecycleFocused((GoUintptr)self, true); -} - -- (void)windowDidResignKey:(NSNotification *)notification { - lifecycleFocused((GoUintptr)self, false); - if ([NSApp isHidden]) { - lifecycleVisible((GoUintptr)self, false); - } -} - -- (void)windowWillClose:(NSNotification *)notification { - // TODO: is this right? Closing a window via the top-left red button - // seems to return early without ever calling windowClosing. - if (self.window.nextResponder == NULL) { - return; // already called close - } - - windowClosing((GoUintptr)self); - [self.window.nextResponder release]; - self.window.nextResponder = NULL; -} -@end - -@interface AppDelegate : NSObject -{ -} -@end - -@implementation AppDelegate -- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { - driverStarted(); - [[NSRunningApplication currentApplication] activateWithOptions:(NSApplicationActivateAllWindows | NSApplicationActivateIgnoringOtherApps)]; -} - -- (void)applicationWillTerminate:(NSNotification *)aNotification { - lifecycleDeadAll(); -} - -- (void)applicationWillHide:(NSNotification *)aNotification { - lifecycleHideAll(); -} -@end - -uintptr_t doNewWindow(int width, int height, char* title) { - NSScreen *screen = [NSScreen mainScreen]; - double w = (double)width / [screen backingScaleFactor]; - double h = (double)height / [screen backingScaleFactor]; - __block ScreenGLView* view = NULL; - - dispatch_sync(dispatch_get_main_queue(), ^{ - id menuBar = [NSMenu new]; - id menuItem = [NSMenuItem new]; - [menuBar addItem:menuItem]; - [NSApp setMainMenu:menuBar]; - - id menu = [NSMenu new]; - NSString* name = [[NSString alloc] initWithUTF8String:title]; - - id hideMenuItem = [[NSMenuItem alloc] initWithTitle:@"Hide" - action:@selector(hide:) keyEquivalent:@"h"]; - [menu addItem:hideMenuItem]; - - id quitMenuItem = [[NSMenuItem alloc] initWithTitle:@"Quit" - action:@selector(terminate:) keyEquivalent:@"q"]; - [menu addItem:quitMenuItem]; - [menuItem setSubmenu:menu]; - - NSRect rect = NSMakeRect(0, 0, w, h); - - NSWindow* window = [[NSWindow alloc] initWithContentRect:rect - styleMask:NSWindowStyleMaskTitled - backing:NSBackingStoreBuffered - defer:NO]; - window.styleMask |= NSWindowStyleMaskResizable; - window.styleMask |= NSWindowStyleMaskMiniaturizable; - window.styleMask |= NSWindowStyleMaskClosable; - window.title = name; - window.displaysWhenScreenProfileChanges = YES; - [window cascadeTopLeftFromPoint:NSMakePoint(20,20)]; - [window setAcceptsMouseMovedEvents:YES]; - - NSOpenGLPixelFormatAttribute attr[] = { - NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core, - NSOpenGLPFAColorSize, 24, - NSOpenGLPFAAlphaSize, 8, - NSOpenGLPFADepthSize, 16, - NSOpenGLPFADoubleBuffer, - NSOpenGLPFAAllowOfflineRenderers, - 0 - }; - id pixFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attr]; - view = [[ScreenGLView alloc] initWithFrame:rect pixelFormat:pixFormat]; - [window setContentView:view]; - [window setDelegate:view]; - [window makeFirstResponder:view]; - }); - - return (uintptr_t)view; -} - -void doShowWindow(uintptr_t viewID) { - ScreenGLView* view = (ScreenGLView*)viewID; - dispatch_async(dispatch_get_main_queue(), ^{ - [view.window makeKeyAndOrderFront:view.window]; - }); -} - -void doCloseWindow(uintptr_t viewID) { - ScreenGLView* view = (ScreenGLView*)viewID; - dispatch_sync(dispatch_get_main_queue(), ^{ - [view.window performClose:view]; - }); -} - -void startDriver() { - [NSAutoreleasePool new]; - [NSApplication sharedApplication]; - [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; - AppDelegate* delegate = [[AppDelegate alloc] init]; - [NSApp setDelegate:delegate]; - [NSApp run]; -} - -void stopDriver() { - dispatch_async(dispatch_get_main_queue(), ^{ - [NSApp terminate:nil]; - }); -} diff --git a/vendor/golang.org/x/exp/shiny/driver/gldriver/context.go b/vendor/golang.org/x/exp/shiny/driver/gldriver/context.go deleted file mode 100644 index 63fb170..0000000 --- a/vendor/golang.org/x/exp/shiny/driver/gldriver/context.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gldriver - -import ( - "runtime" - - "golang.org/x/mobile/gl" -) - -// NewContext creates an OpenGL ES context with a dedicated processing thread. -func NewContext() (gl.Context, error) { - glctx, worker := gl.NewContext() - - errCh := make(chan error) - workAvailable := worker.WorkAvailable() - go func() { - runtime.LockOSThread() - err := surfaceCreate() - errCh <- err - if err != nil { - return - } - - for range workAvailable { - worker.DoWork() - } - }() - if err := <-errCh; err != nil { - return nil, err - } - return glctx, nil -} diff --git a/vendor/golang.org/x/exp/shiny/driver/gldriver/egl.go b/vendor/golang.org/x/exp/shiny/driver/gldriver/egl.go deleted file mode 100644 index 6f5d3d7..0000000 --- a/vendor/golang.org/x/exp/shiny/driver/gldriver/egl.go +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gldriver - -// These constants match the values found in the EGL 1.4 headers, -// egl.h, eglext.h, and eglplatform.h. -const ( - _EGL_DONT_CARE = -1 - - _EGL_NO_SURFACE = 0 - _EGL_NO_CONTEXT = 0 - _EGL_NO_DISPLAY = 0 - - _EGL_OPENGL_ES2_BIT = 0x04 // EGL_RENDERABLE_TYPE mask - _EGL_WINDOW_BIT = 0x04 // EGL_SURFACE_TYPE mask - - _EGL_OPENGL_ES_API = 0x30A0 - _EGL_RENDERABLE_TYPE = 0x3040 - _EGL_SURFACE_TYPE = 0x3033 - _EGL_BUFFER_SIZE = 0x3020 - _EGL_ALPHA_SIZE = 0x3021 - _EGL_BLUE_SIZE = 0x3022 - _EGL_GREEN_SIZE = 0x3023 - _EGL_RED_SIZE = 0x3024 - _EGL_DEPTH_SIZE = 0x3025 - _EGL_STENCIL_SIZE = 0x3026 - _EGL_SAMPLE_BUFFERS = 0x3032 - _EGL_CONFIG_CAVEAT = 0x3027 - _EGL_NONE = 0x3038 - - _EGL_CONTEXT_CLIENT_VERSION = 0x3098 -) - -// ANGLE specific options found in eglext.h -const ( - _EGL_PLATFORM_ANGLE_ANGLE = 0x3202 - _EGL_PLATFORM_ANGLE_TYPE_ANGLE = 0x3203 - _EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE = 0x3204 - _EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE = 0x3205 - _EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE = 0x3206 - - _EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE = 0x3207 - _EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE = 0x3208 - _EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE = 0x3209 - _EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE = 0x320A - _EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE = 0x320B - - _EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE = 0x320D - _EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE = 0x320E -) - -const ( - _EGL_SUCCESS = 0x3000 - _EGL_NOT_INITIALIZED = 0x3001 - _EGL_BAD_ACCESS = 0x3002 - _EGL_BAD_ALLOC = 0x3003 - _EGL_BAD_ATTRIBUTE = 0x3004 - _EGL_BAD_CONFIG = 0x3005 - _EGL_BAD_CONTEXT = 0x3006 - _EGL_BAD_CURRENT_SURFACE = 0x3007 - _EGL_BAD_DISPLAY = 0x3008 - _EGL_BAD_MATCH = 0x3009 - _EGL_BAD_NATIVE_PIXMAP = 0x300A - _EGL_BAD_NATIVE_WINDOW = 0x300B - _EGL_BAD_PARAMETER = 0x300C - _EGL_BAD_SURFACE = 0x300D - _EGL_CONTEXT_LOST = 0x300E -) - -func eglErrString(errno uintptr) string { - switch errno { - case _EGL_SUCCESS: - return "EGL_SUCCESS" - case _EGL_NOT_INITIALIZED: - return "EGL_NOT_INITIALIZED" - case _EGL_BAD_ACCESS: - return "EGL_BAD_ACCESS" - case _EGL_BAD_ALLOC: - return "EGL_BAD_ALLOC" - case _EGL_BAD_ATTRIBUTE: - return "EGL_BAD_ATTRIBUTE" - case _EGL_BAD_CONFIG: - return "EGL_BAD_CONFIG" - case _EGL_BAD_CONTEXT: - return "EGL_BAD_CONTEXT" - case _EGL_BAD_CURRENT_SURFACE: - return "EGL_BAD_CURRENT_SURFACE" - case _EGL_BAD_DISPLAY: - return "EGL_BAD_DISPLAY" - case _EGL_BAD_MATCH: - return "EGL_BAD_MATCH" - case _EGL_BAD_NATIVE_PIXMAP: - return "EGL_BAD_NATIVE_PIXMAP" - case _EGL_BAD_NATIVE_WINDOW: - return "EGL_BAD_NATIVE_WINDOW" - case _EGL_BAD_PARAMETER: - return "EGL_BAD_PARAMETER" - case _EGL_BAD_SURFACE: - return "EGL_BAD_SURFACE" - case _EGL_CONTEXT_LOST: - return "EGL_CONTEXT_LOST" - } - return "EGL: unknown error" -} diff --git a/vendor/golang.org/x/exp/shiny/driver/gldriver/gldriver.go b/vendor/golang.org/x/exp/shiny/driver/gldriver/gldriver.go deleted file mode 100644 index 37eb467..0000000 --- a/vendor/golang.org/x/exp/shiny/driver/gldriver/gldriver.go +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package gldriver provides an OpenGL driver for accessing a screen. -package gldriver // import "golang.org/x/exp/shiny/driver/gldriver" - -import ( - "encoding/binary" - "fmt" - "math" - - "golang.org/x/exp/shiny/driver/internal/errscreen" - "golang.org/x/exp/shiny/screen" - "golang.org/x/image/math/f64" - "golang.org/x/mobile/gl" -) - -// Main is called by the program's main function to run the graphical -// application. -// -// It calls f on the Screen, possibly in a separate goroutine, as some OS- -// specific libraries require being on 'the main thread'. It returns when f -// returns. -func Main(f func(screen.Screen)) { - if err := main(f); err != nil { - f(errscreen.Stub(err)) - } -} - -func mul(a, b f64.Aff3) f64.Aff3 { - return f64.Aff3{ - a[0]*b[0] + a[1]*b[3], - a[0]*b[1] + a[1]*b[4], - a[0]*b[2] + a[1]*b[5] + a[2], - - a[3]*b[0] + a[4]*b[3], - a[3]*b[1] + a[4]*b[4], - a[3]*b[2] + a[4]*b[5] + a[5], - } -} - -// writeAff3 must only be called while holding windowImpl.glctxMu. -func writeAff3(glctx gl.Context, u gl.Uniform, a f64.Aff3) { - var m [9]float32 - m[0*3+0] = float32(a[0*3+0]) - m[0*3+1] = float32(a[1*3+0]) - m[0*3+2] = 0 - m[1*3+0] = float32(a[0*3+1]) - m[1*3+1] = float32(a[1*3+1]) - m[1*3+2] = 0 - m[2*3+0] = float32(a[0*3+2]) - m[2*3+1] = float32(a[1*3+2]) - m[2*3+2] = 1 - glctx.UniformMatrix3fv(u, m[:]) -} - -// f32Bytes returns the byte representation of float32 values in the given byte -// order. byteOrder must be either binary.BigEndian or binary.LittleEndian. -func f32Bytes(byteOrder binary.ByteOrder, values ...float32) []byte { - le := false - switch byteOrder { - case binary.BigEndian: - case binary.LittleEndian: - le = true - default: - panic(fmt.Sprintf("invalid byte order %v", byteOrder)) - } - - b := make([]byte, 4*len(values)) - for i, v := range values { - u := math.Float32bits(v) - if le { - b[4*i+0] = byte(u >> 0) - b[4*i+1] = byte(u >> 8) - b[4*i+2] = byte(u >> 16) - b[4*i+3] = byte(u >> 24) - } else { - b[4*i+0] = byte(u >> 24) - b[4*i+1] = byte(u >> 16) - b[4*i+2] = byte(u >> 8) - b[4*i+3] = byte(u >> 0) - } - } - return b -} - -// compileProgram must only be called while holding windowImpl.glctxMu. -func compileProgram(glctx gl.Context, vSrc, fSrc string) (gl.Program, error) { - program := glctx.CreateProgram() - if program.Value == 0 { - return gl.Program{}, fmt.Errorf("gldriver: no programs available") - } - - vertexShader, err := compileShader(glctx, gl.VERTEX_SHADER, vSrc) - if err != nil { - return gl.Program{}, err - } - fragmentShader, err := compileShader(glctx, gl.FRAGMENT_SHADER, fSrc) - if err != nil { - glctx.DeleteShader(vertexShader) - return gl.Program{}, err - } - - glctx.AttachShader(program, vertexShader) - glctx.AttachShader(program, fragmentShader) - glctx.LinkProgram(program) - - // Flag shaders for deletion when program is unlinked. - glctx.DeleteShader(vertexShader) - glctx.DeleteShader(fragmentShader) - - if glctx.GetProgrami(program, gl.LINK_STATUS) == 0 { - defer glctx.DeleteProgram(program) - return gl.Program{}, fmt.Errorf("gldriver: program compile: %s", glctx.GetProgramInfoLog(program)) - } - return program, nil -} - -// compileShader must only be called while holding windowImpl.glctxMu. -func compileShader(glctx gl.Context, shaderType gl.Enum, src string) (gl.Shader, error) { - shader := glctx.CreateShader(shaderType) - if shader.Value == 0 { - return gl.Shader{}, fmt.Errorf("gldriver: could not create shader (type %v)", shaderType) - } - glctx.ShaderSource(shader, src) - glctx.CompileShader(shader) - if glctx.GetShaderi(shader, gl.COMPILE_STATUS) == 0 { - defer glctx.DeleteShader(shader) - return gl.Shader{}, fmt.Errorf("gldriver: shader compile: %s", glctx.GetShaderInfoLog(shader)) - } - return shader, nil -} diff --git a/vendor/golang.org/x/exp/shiny/driver/gldriver/other.go b/vendor/golang.org/x/exp/shiny/driver/gldriver/other.go deleted file mode 100644 index 6da5133..0000000 --- a/vendor/golang.org/x/exp/shiny/driver/gldriver/other.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !darwin !386,!amd64 ios -// +build !linux android -// +build !windows -// +build !openbsd - -package gldriver - -import ( - "fmt" - "runtime" - - "golang.org/x/exp/shiny/screen" -) - -func newWindow(opts *screen.NewWindowOptions) (uintptr, error) { return 0, nil } - -func initWindow(id *windowImpl) {} -func showWindow(id *windowImpl) {} -func closeWindow(id uintptr) {} -func drawLoop(w *windowImpl) {} - -func main(f func(screen.Screen)) error { - return fmt.Errorf("gldriver: unsupported GOOS/GOARCH %s/%s", runtime.GOOS, runtime.GOARCH) -} diff --git a/vendor/golang.org/x/exp/shiny/driver/gldriver/screen.go b/vendor/golang.org/x/exp/shiny/driver/gldriver/screen.go deleted file mode 100644 index 3100ebc..0000000 --- a/vendor/golang.org/x/exp/shiny/driver/gldriver/screen.go +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gldriver - -import ( - "fmt" - "image" - "sync" - - "golang.org/x/exp/shiny/screen" - "golang.org/x/mobile/gl" -) - -var theScreen = &screenImpl{ - windows: make(map[uintptr]*windowImpl), -} - -type screenImpl struct { - texture struct { - program gl.Program - pos gl.Attrib - mvp gl.Uniform - uvp gl.Uniform - inUV gl.Attrib - sample gl.Uniform - quad gl.Buffer - } - fill struct { - program gl.Program - pos gl.Attrib - mvp gl.Uniform - color gl.Uniform - quad gl.Buffer - } - - mu sync.Mutex - windows map[uintptr]*windowImpl -} - -func (s *screenImpl) NewBuffer(size image.Point) (retBuf screen.Buffer, retErr error) { - m := image.NewRGBA(image.Rectangle{Max: size}) - return &bufferImpl{ - buf: m.Pix, - rgba: *m, - size: size, - }, nil -} - -func (s *screenImpl) NewTexture(size image.Point) (screen.Texture, error) { - // TODO: can we compile these programs eagerly instead of lazily? - - // Find a GL context for this texture. - // TODO: this might be correct. Some GL objects can be shared - // across contexts. But this needs a review of the spec to make - // sure it's correct, and some testing would be nice. - var w *windowImpl - - s.mu.Lock() - for _, window := range s.windows { - w = window - break - } - s.mu.Unlock() - - if w == nil { - return nil, fmt.Errorf("gldriver: no window available") - } - - w.glctxMu.Lock() - defer w.glctxMu.Unlock() - glctx := w.glctx - if glctx == nil { - return nil, fmt.Errorf("gldriver: no GL context available") - } - - if !glctx.IsProgram(s.texture.program) { - p, err := compileProgram(glctx, textureVertexSrc, textureFragmentSrc) - if err != nil { - return nil, err - } - s.texture.program = p - s.texture.pos = glctx.GetAttribLocation(p, "pos") - s.texture.mvp = glctx.GetUniformLocation(p, "mvp") - s.texture.uvp = glctx.GetUniformLocation(p, "uvp") - s.texture.inUV = glctx.GetAttribLocation(p, "inUV") - s.texture.sample = glctx.GetUniformLocation(p, "sample") - s.texture.quad = glctx.CreateBuffer() - - glctx.BindBuffer(gl.ARRAY_BUFFER, s.texture.quad) - glctx.BufferData(gl.ARRAY_BUFFER, quadCoords, gl.STATIC_DRAW) - } - - t := &textureImpl{ - w: w, - id: glctx.CreateTexture(), - size: size, - } - - glctx.BindTexture(gl.TEXTURE_2D, t.id) - glctx.TexImage2D(gl.TEXTURE_2D, 0, size.X, size.Y, gl.RGBA, gl.UNSIGNED_BYTE, nil) - glctx.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR) - glctx.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR) - glctx.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE) - glctx.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE) - - return t, nil -} - -func optsSize(opts *screen.NewWindowOptions) (width, height int) { - width, height = 1024, 768 - if opts != nil { - if opts.Width > 0 { - width = opts.Width - } - if opts.Height > 0 { - height = opts.Height - } - } - return width, height -} - -func (s *screenImpl) NewWindow(opts *screen.NewWindowOptions) (screen.Window, error) { - id, err := newWindow(opts) - if err != nil { - return nil, err - } - w := &windowImpl{ - s: s, - id: id, - publish: make(chan struct{}), - publishDone: make(chan screen.PublishResult), - drawDone: make(chan struct{}), - } - initWindow(w) - - s.mu.Lock() - s.windows[id] = w - s.mu.Unlock() - - if useLifecycler { - w.lifecycler.SendEvent(w, nil) - } - - showWindow(w) - - return w, nil -} diff --git a/vendor/golang.org/x/exp/shiny/driver/gldriver/texture.go b/vendor/golang.org/x/exp/shiny/driver/gldriver/texture.go deleted file mode 100644 index a691ed8..0000000 --- a/vendor/golang.org/x/exp/shiny/driver/gldriver/texture.go +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gldriver - -import ( - "encoding/binary" - "image" - "image/color" - "image/draw" - - "golang.org/x/exp/shiny/screen" - "golang.org/x/mobile/gl" -) - -type textureImpl struct { - w *windowImpl - id gl.Texture - fb gl.Framebuffer - size image.Point -} - -func (t *textureImpl) Size() image.Point { return t.size } -func (t *textureImpl) Bounds() image.Rectangle { return image.Rectangle{Max: t.size} } - -func (t *textureImpl) Release() { - t.w.glctxMu.Lock() - defer t.w.glctxMu.Unlock() - - if t.fb.Value != 0 { - t.w.glctx.DeleteFramebuffer(t.fb) - t.fb = gl.Framebuffer{} - } - t.w.glctx.DeleteTexture(t.id) - t.id = gl.Texture{} -} - -func (t *textureImpl) Upload(dp image.Point, src screen.Buffer, sr image.Rectangle) { - buf := src.(*bufferImpl) - buf.preUpload() - - // src2dst is added to convert from the src coordinate space to the dst - // coordinate space. It is subtracted to convert the other way. - src2dst := dp.Sub(sr.Min) - - // Clip to the source. - sr = sr.Intersect(buf.Bounds()) - - // Clip to the destination. - dr := sr.Add(src2dst) - dr = dr.Intersect(t.Bounds()) - if dr.Empty() { - return - } - - // Bring dr.Min in dst-space back to src-space to get the pixel buffer offset. - pix := buf.rgba.Pix[buf.rgba.PixOffset(dr.Min.X-src2dst.X, dr.Min.Y-src2dst.Y):] - - t.w.glctxMu.Lock() - defer t.w.glctxMu.Unlock() - - t.w.glctx.BindTexture(gl.TEXTURE_2D, t.id) - - width := dr.Dx() - if width*4 == buf.rgba.Stride { - t.w.glctx.TexSubImage2D(gl.TEXTURE_2D, 0, dr.Min.X, dr.Min.Y, width, dr.Dy(), gl.RGBA, gl.UNSIGNED_BYTE, pix) - return - } - // TODO: can we use GL_UNPACK_ROW_LENGTH with glPixelStorei for stride in - // ES 3.0, instead of uploading the pixels row-by-row? - for y, p := dr.Min.Y, 0; y < dr.Max.Y; y++ { - t.w.glctx.TexSubImage2D(gl.TEXTURE_2D, 0, dr.Min.X, y, width, 1, gl.RGBA, gl.UNSIGNED_BYTE, pix[p:]) - p += buf.rgba.Stride - } -} - -func (t *textureImpl) Fill(dr image.Rectangle, src color.Color, op draw.Op) { - minX := float64(dr.Min.X) - minY := float64(dr.Min.Y) - maxX := float64(dr.Max.X) - maxY := float64(dr.Max.Y) - mvp := calcMVP( - t.size.X, t.size.Y, - minX, minY, - maxX, minY, - minX, maxY, - ) - - glctx := t.w.glctx - - t.w.glctxMu.Lock() - defer t.w.glctxMu.Unlock() - - create := t.fb.Value == 0 - if create { - t.fb = glctx.CreateFramebuffer() - } - glctx.BindFramebuffer(gl.FRAMEBUFFER, t.fb) - if create { - glctx.FramebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, t.id, 0) - } - - glctx.Viewport(0, 0, t.size.X, t.size.Y) - doFill(t.w.s, t.w.glctx, mvp, src, op) - - // We can't restore the GL state (i.e. bind the back buffer, also known as - // gl.Framebuffer{Value: 0}) right away, since we don't necessarily know - // the right viewport size yet. It is valid to call textureImpl.Fill before - // we've gotten our first size.Event. We bind it lazily instead. - t.w.backBufferBound = false -} - -var quadCoords = f32Bytes(binary.LittleEndian, - 0, 0, // top left - 1, 0, // top right - 0, 1, // bottom left - 1, 1, // bottom right -) - -const textureVertexSrc = `#version 100 -uniform mat3 mvp; -uniform mat3 uvp; -attribute vec3 pos; -attribute vec2 inUV; -varying vec2 uv; -void main() { - vec3 p = pos; - p.z = 1.0; - gl_Position = vec4(mvp * p, 1); - uv = (uvp * vec3(inUV, 1)).xy; -} -` - -const textureFragmentSrc = `#version 100 -precision mediump float; -varying vec2 uv; -uniform sampler2D sample; -void main() { - gl_FragColor = texture2D(sample, uv); -} -` - -const fillVertexSrc = `#version 100 -uniform mat3 mvp; -attribute vec3 pos; -void main() { - vec3 p = pos; - p.z = 1.0; - gl_Position = vec4(mvp * p, 1); -} -` - -const fillFragmentSrc = `#version 100 -precision mediump float; -uniform vec4 color; -void main() { - gl_FragColor = color; -} -` diff --git a/vendor/golang.org/x/exp/shiny/driver/gldriver/win32.go b/vendor/golang.org/x/exp/shiny/driver/gldriver/win32.go deleted file mode 100644 index 343fb45..0000000 --- a/vendor/golang.org/x/exp/shiny/driver/gldriver/win32.go +++ /dev/null @@ -1,357 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package gldriver - -import ( - "errors" - "fmt" - "runtime" - "syscall" - "unsafe" - - "golang.org/x/exp/shiny/driver/internal/win32" - "golang.org/x/exp/shiny/screen" - "golang.org/x/mobile/event/key" - "golang.org/x/mobile/event/lifecycle" - "golang.org/x/mobile/event/mouse" - "golang.org/x/mobile/event/paint" - "golang.org/x/mobile/event/size" - "golang.org/x/mobile/gl" -) - -// TODO: change this to true, after manual testing on Win32. -const useLifecycler = false - -// TODO: change this to true, after manual testing on Win32. -const handleSizeEventsAtChannelReceive = false - -func main(f func(screen.Screen)) error { - return win32.Main(func() { f(theScreen) }) -} - -var ( - eglGetPlatformDisplayEXT = gl.LibEGL.NewProc("eglGetPlatformDisplayEXT") - eglInitialize = gl.LibEGL.NewProc("eglInitialize") - eglChooseConfig = gl.LibEGL.NewProc("eglChooseConfig") - eglGetError = gl.LibEGL.NewProc("eglGetError") - eglBindAPI = gl.LibEGL.NewProc("eglBindAPI") - eglCreateWindowSurface = gl.LibEGL.NewProc("eglCreateWindowSurface") - eglCreateContext = gl.LibEGL.NewProc("eglCreateContext") - eglMakeCurrent = gl.LibEGL.NewProc("eglMakeCurrent") - eglSwapInterval = gl.LibEGL.NewProc("eglSwapInterval") - eglDestroySurface = gl.LibEGL.NewProc("eglDestroySurface") - eglSwapBuffers = gl.LibEGL.NewProc("eglSwapBuffers") -) - -type eglConfig uintptr // void* - -type eglInt int32 - -var rgb888 = [...]eglInt{ - _EGL_RENDERABLE_TYPE, _EGL_OPENGL_ES2_BIT, - _EGL_SURFACE_TYPE, _EGL_WINDOW_BIT, - _EGL_BLUE_SIZE, 8, - _EGL_GREEN_SIZE, 8, - _EGL_RED_SIZE, 8, - _EGL_DEPTH_SIZE, 16, - _EGL_STENCIL_SIZE, 8, - _EGL_NONE, -} - -type ctxWin32 struct { - ctx uintptr - display uintptr // EGLDisplay - surface uintptr // EGLSurface -} - -func newWindow(opts *screen.NewWindowOptions) (uintptr, error) { - w, err := win32.NewWindow(opts) - if err != nil { - return 0, err - } - return uintptr(w), nil -} - -func initWindow(w *windowImpl) { - w.glctx, w.worker = gl.NewContext() -} - -func showWindow(w *windowImpl) { - // Show makes an initial call to sizeEvent (via win32.SizeEvent), where - // we setup the EGL surface and GL context. - win32.Show(syscall.Handle(w.id)) -} - -func closeWindow(id uintptr) {} // TODO - -func drawLoop(w *windowImpl) { - runtime.LockOSThread() - - display := w.ctx.(ctxWin32).display - surface := w.ctx.(ctxWin32).surface - ctx := w.ctx.(ctxWin32).ctx - - if ret, _, _ := eglMakeCurrent.Call(display, surface, surface, ctx); ret == 0 { - panic(fmt.Sprintf("eglMakeCurrent failed: %v", eglErr())) - } - - // TODO(crawshaw): exit this goroutine on Release. - workAvailable := w.worker.WorkAvailable() - for { - select { - case <-workAvailable: - w.worker.DoWork() - case <-w.publish: - loop: - for { - select { - case <-workAvailable: - w.worker.DoWork() - default: - break loop - } - } - if ret, _, _ := eglSwapBuffers.Call(display, surface); ret == 0 { - panic(fmt.Sprintf("eglSwapBuffers failed: %v", eglErr())) - } - w.publishDone <- screen.PublishResult{} - } - } -} - -func init() { - win32.SizeEvent = sizeEvent - win32.PaintEvent = paintEvent - win32.MouseEvent = mouseEvent - win32.KeyEvent = keyEvent - win32.LifecycleEvent = lifecycleEvent -} - -func lifecycleEvent(hwnd syscall.Handle, to lifecycle.Stage) { - theScreen.mu.Lock() - w := theScreen.windows[uintptr(hwnd)] - theScreen.mu.Unlock() - - if w.lifecycleStage == to { - return - } - w.Send(lifecycle.Event{ - From: w.lifecycleStage, - To: to, - DrawContext: w.glctx, - }) - w.lifecycleStage = to -} - -func mouseEvent(hwnd syscall.Handle, e mouse.Event) { - theScreen.mu.Lock() - w := theScreen.windows[uintptr(hwnd)] - theScreen.mu.Unlock() - - w.Send(e) -} - -func keyEvent(hwnd syscall.Handle, e key.Event) { - theScreen.mu.Lock() - w := theScreen.windows[uintptr(hwnd)] - theScreen.mu.Unlock() - - w.Send(e) -} - -func paintEvent(hwnd syscall.Handle, e paint.Event) { - theScreen.mu.Lock() - w := theScreen.windows[uintptr(hwnd)] - theScreen.mu.Unlock() - - if w.ctx == nil { - // Sometimes a paint event comes in before initial - // window size is set. Ignore it. - return - } - - // TODO: the paint.Event should have External: true. - w.Send(paint.Event{}) -} - -func sizeEvent(hwnd syscall.Handle, e size.Event) { - theScreen.mu.Lock() - w := theScreen.windows[uintptr(hwnd)] - theScreen.mu.Unlock() - - if w.ctx == nil { - // This is the initial size event on window creation. - // Create an EGL surface and spin up a GL context. - if err := createEGLSurface(hwnd, w); err != nil { - panic(err) - } - go drawLoop(w) - } - - if !handleSizeEventsAtChannelReceive { - w.szMu.Lock() - w.sz = e - w.szMu.Unlock() - } - - w.Send(e) - - if handleSizeEventsAtChannelReceive { - return - } - - // Screen is dirty, generate a paint event. - // - // The sizeEvent function is called on the goroutine responsible for - // calling the GL worker.DoWork. When compiling with -tags gldebug, - // these GL calls are blocking (so we can read the error message), so - // to make progress they need to happen on another goroutine. - go func() { - // TODO: this call to Viewport is not right, but is very hard to - // do correctly with our async events channel model. We want - // the call to Viewport to be made the instant before the - // paint.Event is received. - w.glctxMu.Lock() - w.glctx.Viewport(0, 0, e.WidthPx, e.HeightPx) - w.glctx.ClearColor(0, 0, 0, 1) - w.glctx.Clear(gl.COLOR_BUFFER_BIT) - w.glctxMu.Unlock() - - w.Send(paint.Event{}) - }() -} - -func eglErr() error { - if ret, _, _ := eglGetError.Call(); ret != _EGL_SUCCESS { - return errors.New(eglErrString(ret)) - } - return nil -} - -func createEGLSurface(hwnd syscall.Handle, w *windowImpl) error { - var displayAttribPlatforms = [][]eglInt{ - // Default - []eglInt{ - _EGL_PLATFORM_ANGLE_TYPE_ANGLE, - _EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE, - _EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE, _EGL_DONT_CARE, - _EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE, _EGL_DONT_CARE, - _EGL_NONE, - }, - // Direct3D 11 - []eglInt{ - _EGL_PLATFORM_ANGLE_TYPE_ANGLE, - _EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, - _EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE, _EGL_DONT_CARE, - _EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE, _EGL_DONT_CARE, - _EGL_NONE, - }, - // Direct3D 9 - []eglInt{ - _EGL_PLATFORM_ANGLE_TYPE_ANGLE, - _EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE, - _EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE, _EGL_DONT_CARE, - _EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE, _EGL_DONT_CARE, - _EGL_NONE, - }, - // Direct3D 11 with WARP - // https://msdn.microsoft.com/en-us/library/windows/desktop/gg615082.aspx - []eglInt{ - _EGL_PLATFORM_ANGLE_TYPE_ANGLE, - _EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, - _EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE, - _EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE, - _EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE, _EGL_DONT_CARE, - _EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE, _EGL_DONT_CARE, - _EGL_NONE, - }, - } - - dc, err := win32.GetDC(hwnd) - if err != nil { - return fmt.Errorf("win32.GetDC failed: %v", err) - } - - var display uintptr = _EGL_NO_DISPLAY - for i, displayAttrib := range displayAttribPlatforms { - lastTry := i == len(displayAttribPlatforms)-1 - - display, _, _ = eglGetPlatformDisplayEXT.Call( - _EGL_PLATFORM_ANGLE_ANGLE, - uintptr(dc), - uintptr(unsafe.Pointer(&displayAttrib[0])), - ) - - if display == _EGL_NO_DISPLAY { - if !lastTry { - continue - } - return fmt.Errorf("eglGetPlatformDisplayEXT failed: %v", eglErr()) - } - - if ret, _, _ := eglInitialize.Call(display, 0, 0); ret == 0 { - if !lastTry { - continue - } - return fmt.Errorf("eglInitialize failed: %v", eglErr()) - } - } - - eglBindAPI.Call(_EGL_OPENGL_ES_API) - if err := eglErr(); err != nil { - return err - } - - var numConfigs eglInt - var config eglConfig - ret, _, _ := eglChooseConfig.Call( - display, - uintptr(unsafe.Pointer(&rgb888[0])), - uintptr(unsafe.Pointer(&config)), - 1, - uintptr(unsafe.Pointer(&numConfigs)), - ) - if ret == 0 { - return fmt.Errorf("eglChooseConfig failed: %v", eglErr()) - } - if numConfigs <= 0 { - return errors.New("eglChooseConfig found no valid config") - } - - surface, _, _ := eglCreateWindowSurface.Call(display, uintptr(config), uintptr(hwnd), 0, 0) - if surface == _EGL_NO_SURFACE { - return fmt.Errorf("eglCreateWindowSurface failed: %v", eglErr()) - } - - contextAttribs := [...]eglInt{ - _EGL_CONTEXT_CLIENT_VERSION, 2, - _EGL_NONE, - } - context, _, _ := eglCreateContext.Call( - display, - uintptr(config), - _EGL_NO_CONTEXT, - uintptr(unsafe.Pointer(&contextAttribs[0])), - ) - if context == _EGL_NO_CONTEXT { - return fmt.Errorf("eglCreateContext failed: %v", eglErr()) - } - - eglSwapInterval.Call(display, 1) - - w.ctx = ctxWin32{ - ctx: context, - display: display, - surface: surface, - } - - return nil -} - -func surfaceCreate() error { - return errors.New("gldriver: surface creation not implemented on windows") -} diff --git a/vendor/golang.org/x/exp/shiny/driver/gldriver/window.go b/vendor/golang.org/x/exp/shiny/driver/gldriver/window.go deleted file mode 100644 index 82baf2c..0000000 --- a/vendor/golang.org/x/exp/shiny/driver/gldriver/window.go +++ /dev/null @@ -1,389 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gldriver - -import ( - "image" - "image/color" - "image/draw" - "sync" - - "golang.org/x/exp/shiny/driver/internal/drawer" - "golang.org/x/exp/shiny/driver/internal/event" - "golang.org/x/exp/shiny/driver/internal/lifecycler" - "golang.org/x/exp/shiny/screen" - "golang.org/x/image/math/f64" - "golang.org/x/mobile/event/lifecycle" - "golang.org/x/mobile/event/size" - "golang.org/x/mobile/gl" -) - -type windowImpl struct { - s *screenImpl - - // id is an OS-specific data structure for the window. - // - Cocoa: ScreenGLView* - // - X11: Window - // - Windows: win32.HWND - id uintptr - - // ctx is a C data structure for the GL context. - // - Cocoa: uintptr holding a NSOpenGLContext*. - // - X11: uintptr holding an EGLSurface. - // - Windows: ctxWin32 - ctx interface{} - - lifecycler lifecycler.State - // TODO: Delete the field below (and the useLifecycler constant), and use - // the field above for cocoa and win32. - lifecycleStage lifecycle.Stage // current stage - - event.Deque - publish chan struct{} - publishDone chan screen.PublishResult - drawDone chan struct{} - - // glctxMu is a mutex that enforces the atomicity of methods like - // Texture.Upload or Window.Draw that are conceptually one operation - // but are implemented by multiple OpenGL calls. OpenGL is a stateful - // API, so interleaving OpenGL calls from separate higher-level - // operations causes inconsistencies. - glctxMu sync.Mutex - glctx gl.Context - worker gl.Worker - // backBufferBound is whether the default Framebuffer, with ID 0, also - // known as the back buffer or the window's Framebuffer, is bound and its - // viewport is known to equal the window size. It can become false when we - // bind to a texture's Framebuffer or when the window size changes. - backBufferBound bool - - // szMu protects only sz. If you need to hold both glctxMu and szMu, the - // lock ordering is to lock glctxMu first (and unlock it last). - szMu sync.Mutex - sz size.Event -} - -// NextEvent implements the screen.EventDeque interface. -func (w *windowImpl) NextEvent() interface{} { - e := w.Deque.NextEvent() - if handleSizeEventsAtChannelReceive { - if sz, ok := e.(size.Event); ok { - w.glctxMu.Lock() - w.backBufferBound = false - w.szMu.Lock() - w.sz = sz - w.szMu.Unlock() - w.glctxMu.Unlock() - } - } - return e -} - -func (w *windowImpl) Release() { - // There are two ways a window can be closed: the Operating System or - // Desktop Environment can initiate (e.g. in response to a user clicking a - // red button), or the Go app can programatically close the window (by - // calling Window.Release). - // - // When the OS closes a window: - // - Cocoa: Obj-C's windowWillClose calls Go's windowClosing. - // - X11: the X11 server sends a WM_DELETE_WINDOW message. - // - Windows: TODO: implement and document this. - // - // This should send a lifecycle event (To: StageDead) to the Go app's event - // loop, which should respond by calling Window.Release (this method). - // Window.Release is where system resources are actually cleaned up. - // - // When Window.Release is called, the closeWindow call below: - // - Cocoa: calls Obj-C's performClose, which emulates the red button - // being clicked. (TODO: document how this actually cleans up - // resources??) - // - X11: calls C's XDestroyWindow. - // - Windows: TODO: implement and document this. - // - // On Cocoa, if these two approaches race, experiments suggest that the - // race is won by performClose (which is called serially on the main - // thread). Even if that isn't true, the windowWillClose handler is - // idempotent. - - theScreen.mu.Lock() - delete(theScreen.windows, w.id) - theScreen.mu.Unlock() - - closeWindow(w.id) -} - -func (w *windowImpl) Upload(dp image.Point, src screen.Buffer, sr image.Rectangle) { - originalSRMin := sr.Min - sr = sr.Intersect(src.Bounds()) - if sr.Empty() { - return - } - dp = dp.Add(sr.Min.Sub(originalSRMin)) - // TODO: keep a texture around for this purpose? - t, err := w.s.NewTexture(sr.Size()) - if err != nil { - panic(err) - } - t.Upload(image.Point{}, src, sr) - w.Draw(f64.Aff3{ - 1, 0, float64(dp.X), - 0, 1, float64(dp.Y), - }, t, t.Bounds(), draw.Src, nil) - t.Release() -} - -func useOp(glctx gl.Context, op draw.Op) { - if op == draw.Over { - glctx.Enable(gl.BLEND) - glctx.BlendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA) - } else { - glctx.Disable(gl.BLEND) - } -} - -func (w *windowImpl) bindBackBuffer() { - w.szMu.Lock() - sz := w.sz - w.szMu.Unlock() - - w.backBufferBound = true - w.glctx.BindFramebuffer(gl.FRAMEBUFFER, gl.Framebuffer{Value: 0}) - w.glctx.Viewport(0, 0, sz.WidthPx, sz.HeightPx) -} - -func (w *windowImpl) fill(mvp f64.Aff3, src color.Color, op draw.Op) { - w.glctxMu.Lock() - defer w.glctxMu.Unlock() - - if !w.backBufferBound { - w.bindBackBuffer() - } - - doFill(w.s, w.glctx, mvp, src, op) -} - -func doFill(s *screenImpl, glctx gl.Context, mvp f64.Aff3, src color.Color, op draw.Op) { - useOp(glctx, op) - if !glctx.IsProgram(s.fill.program) { - p, err := compileProgram(glctx, fillVertexSrc, fillFragmentSrc) - if err != nil { - // TODO: initialize this somewhere else we can better handle the error. - panic(err.Error()) - } - s.fill.program = p - s.fill.pos = glctx.GetAttribLocation(p, "pos") - s.fill.mvp = glctx.GetUniformLocation(p, "mvp") - s.fill.color = glctx.GetUniformLocation(p, "color") - s.fill.quad = glctx.CreateBuffer() - - glctx.BindBuffer(gl.ARRAY_BUFFER, s.fill.quad) - glctx.BufferData(gl.ARRAY_BUFFER, quadCoords, gl.STATIC_DRAW) - } - glctx.UseProgram(s.fill.program) - - writeAff3(glctx, s.fill.mvp, mvp) - - r, g, b, a := src.RGBA() - glctx.Uniform4f( - s.fill.color, - float32(r)/65535, - float32(g)/65535, - float32(b)/65535, - float32(a)/65535, - ) - - glctx.BindBuffer(gl.ARRAY_BUFFER, s.fill.quad) - glctx.EnableVertexAttribArray(s.fill.pos) - glctx.VertexAttribPointer(s.fill.pos, 2, gl.FLOAT, false, 0, 0) - - glctx.DrawArrays(gl.TRIANGLE_STRIP, 0, 4) - - glctx.DisableVertexAttribArray(s.fill.pos) -} - -func (w *windowImpl) Fill(dr image.Rectangle, src color.Color, op draw.Op) { - minX := float64(dr.Min.X) - minY := float64(dr.Min.Y) - maxX := float64(dr.Max.X) - maxY := float64(dr.Max.Y) - w.fill(w.mvp( - minX, minY, - maxX, minY, - minX, maxY, - ), src, op) -} - -func (w *windowImpl) DrawUniform(src2dst f64.Aff3, src color.Color, sr image.Rectangle, op draw.Op, opts *screen.DrawOptions) { - minX := float64(sr.Min.X) - minY := float64(sr.Min.Y) - maxX := float64(sr.Max.X) - maxY := float64(sr.Max.Y) - w.fill(w.mvp( - src2dst[0]*minX+src2dst[1]*minY+src2dst[2], - src2dst[3]*minX+src2dst[4]*minY+src2dst[5], - src2dst[0]*maxX+src2dst[1]*minY+src2dst[2], - src2dst[3]*maxX+src2dst[4]*minY+src2dst[5], - src2dst[0]*minX+src2dst[1]*maxY+src2dst[2], - src2dst[3]*minX+src2dst[4]*maxY+src2dst[5], - ), src, op) -} - -func (w *windowImpl) Draw(src2dst f64.Aff3, src screen.Texture, sr image.Rectangle, op draw.Op, opts *screen.DrawOptions) { - t := src.(*textureImpl) - sr = sr.Intersect(t.Bounds()) - if sr.Empty() { - return - } - - w.glctxMu.Lock() - defer w.glctxMu.Unlock() - - if !w.backBufferBound { - w.bindBackBuffer() - } - - useOp(w.glctx, op) - w.glctx.UseProgram(w.s.texture.program) - - // Start with src-space left, top, right and bottom. - srcL := float64(sr.Min.X) - srcT := float64(sr.Min.Y) - srcR := float64(sr.Max.X) - srcB := float64(sr.Max.Y) - // Transform to dst-space via the src2dst matrix, then to a MVP matrix. - writeAff3(w.glctx, w.s.texture.mvp, w.mvp( - src2dst[0]*srcL+src2dst[1]*srcT+src2dst[2], - src2dst[3]*srcL+src2dst[4]*srcT+src2dst[5], - src2dst[0]*srcR+src2dst[1]*srcT+src2dst[2], - src2dst[3]*srcR+src2dst[4]*srcT+src2dst[5], - src2dst[0]*srcL+src2dst[1]*srcB+src2dst[2], - src2dst[3]*srcL+src2dst[4]*srcB+src2dst[5], - )) - - // OpenGL's fragment shaders' UV coordinates run from (0,0)-(1,1), - // unlike vertex shaders' XY coordinates running from (-1,+1)-(+1,-1). - // - // We are drawing a rectangle PQRS, defined by two of its - // corners, onto the entire texture. The two quads may actually - // be equal, but in the general case, PQRS can be smaller. - // - // (0,0) +---------------+ (1,0) - // | P +-----+ Q | - // | | | | - // | S +-----+ R | - // (0,1) +---------------+ (1,1) - // - // The PQRS quad is always axis-aligned. First of all, convert - // from pixel space to texture space. - tw := float64(t.size.X) - th := float64(t.size.Y) - px := float64(sr.Min.X-0) / tw - py := float64(sr.Min.Y-0) / th - qx := float64(sr.Max.X-0) / tw - sy := float64(sr.Max.Y-0) / th - // Due to axis alignment, qy = py and sx = px. - // - // The simultaneous equations are: - // 0 + 0 + a02 = px - // 0 + 0 + a12 = py - // a00 + 0 + a02 = qx - // a10 + 0 + a12 = qy = py - // 0 + a01 + a02 = sx = px - // 0 + a11 + a12 = sy - writeAff3(w.glctx, w.s.texture.uvp, f64.Aff3{ - qx - px, 0, px, - 0, sy - py, py, - }) - - w.glctx.ActiveTexture(gl.TEXTURE0) - w.glctx.BindTexture(gl.TEXTURE_2D, t.id) - w.glctx.Uniform1i(w.s.texture.sample, 0) - - w.glctx.BindBuffer(gl.ARRAY_BUFFER, w.s.texture.quad) - w.glctx.EnableVertexAttribArray(w.s.texture.pos) - w.glctx.VertexAttribPointer(w.s.texture.pos, 2, gl.FLOAT, false, 0, 0) - - w.glctx.BindBuffer(gl.ARRAY_BUFFER, w.s.texture.quad) - w.glctx.EnableVertexAttribArray(w.s.texture.inUV) - w.glctx.VertexAttribPointer(w.s.texture.inUV, 2, gl.FLOAT, false, 0, 0) - - w.glctx.DrawArrays(gl.TRIANGLE_STRIP, 0, 4) - - w.glctx.DisableVertexAttribArray(w.s.texture.pos) - w.glctx.DisableVertexAttribArray(w.s.texture.inUV) -} - -func (w *windowImpl) Copy(dp image.Point, src screen.Texture, sr image.Rectangle, op draw.Op, opts *screen.DrawOptions) { - drawer.Copy(w, dp, src, sr, op, opts) -} - -func (w *windowImpl) Scale(dr image.Rectangle, src screen.Texture, sr image.Rectangle, op draw.Op, opts *screen.DrawOptions) { - drawer.Scale(w, dr, src, sr, op, opts) -} - -func (w *windowImpl) mvp(tlx, tly, trx, try, blx, bly float64) f64.Aff3 { - w.szMu.Lock() - sz := w.sz - w.szMu.Unlock() - - return calcMVP(sz.WidthPx, sz.HeightPx, tlx, tly, trx, try, blx, bly) -} - -// calcMVP returns the Model View Projection matrix that maps the quadCoords -// unit square, (0, 0) to (1, 1), to a quad QV, such that QV in vertex shader -// space corresponds to the quad QP in pixel space, where QP is defined by -// three of its four corners - the arguments to this function. The three -// corners are nominally the top-left, top-right and bottom-left, but there is -// no constraint that e.g. tlx < trx. -// -// In pixel space, the window ranges from (0, 0) to (widthPx, heightPx). The -// Y-axis points downwards. -// -// In vertex shader space, the window ranges from (-1, +1) to (+1, -1), which -// is a 2-unit by 2-unit square. The Y-axis points upwards. -func calcMVP(widthPx, heightPx int, tlx, tly, trx, try, blx, bly float64) f64.Aff3 { - // Convert from pixel coords to vertex shader coords. - invHalfWidth := +2 / float64(widthPx) - invHalfHeight := -2 / float64(heightPx) - tlx = tlx*invHalfWidth - 1 - tly = tly*invHalfHeight + 1 - trx = trx*invHalfWidth - 1 - try = try*invHalfHeight + 1 - blx = blx*invHalfWidth - 1 - bly = bly*invHalfHeight + 1 - - // The resultant affine matrix: - // - maps (0, 0) to (tlx, tly). - // - maps (1, 0) to (trx, try). - // - maps (0, 1) to (blx, bly). - return f64.Aff3{ - trx - tlx, blx - tlx, tlx, - try - tly, bly - tly, tly, - } -} - -func (w *windowImpl) Publish() screen.PublishResult { - // gl.Flush is a lightweight (on modern GL drivers) blocking call - // that ensures all GL functions pending in the gl package have - // been passed onto the GL driver before the app package attempts - // to swap the screen buffer. - // - // This enforces that the final receive (for this paint cycle) on - // gl.WorkAvailable happens before the send on publish. - w.glctxMu.Lock() - w.glctx.Flush() - w.glctxMu.Unlock() - - w.publish <- struct{}{} - res := <-w.publishDone - - select { - case w.drawDone <- struct{}{}: - default: - } - - return res -} diff --git a/vendor/golang.org/x/exp/shiny/driver/gldriver/x11.c b/vendor/golang.org/x/exp/shiny/driver/gldriver/x11.c deleted file mode 100644 index afb38dc..0000000 --- a/vendor/golang.org/x/exp/shiny/driver/gldriver/x11.c +++ /dev/null @@ -1,327 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build linux,!android openbsd - -#include "_cgo_export.h" -#include -#include -#include -#include - -Atom net_wm_name; -Atom utf8_string; -Atom wm_delete_window; -Atom wm_protocols; -Atom wm_take_focus; - -EGLConfig e_config; -EGLContext e_ctx; -EGLDisplay e_dpy; -Colormap x_colormap; -Display *x_dpy; -XVisualInfo *x_visual_info; -Window x_root; - -// TODO: share code with eglErrString -char * -eglGetErrorStr() { - switch (eglGetError()) { - case EGL_SUCCESS: - return "EGL_SUCCESS"; - case EGL_NOT_INITIALIZED: - return "EGL_NOT_INITIALIZED"; - case EGL_BAD_ACCESS: - return "EGL_BAD_ACCESS"; - case EGL_BAD_ALLOC: - return "EGL_BAD_ALLOC"; - case EGL_BAD_ATTRIBUTE: - return "EGL_BAD_ATTRIBUTE"; - case EGL_BAD_CONFIG: - return "EGL_BAD_CONFIG"; - case EGL_BAD_CONTEXT: - return "EGL_BAD_CONTEXT"; - case EGL_BAD_CURRENT_SURFACE: - return "EGL_BAD_CURRENT_SURFACE"; - case EGL_BAD_DISPLAY: - return "EGL_BAD_DISPLAY"; - case EGL_BAD_MATCH: - return "EGL_BAD_MATCH"; - case EGL_BAD_NATIVE_PIXMAP: - return "EGL_BAD_NATIVE_PIXMAP"; - case EGL_BAD_NATIVE_WINDOW: - return "EGL_BAD_NATIVE_WINDOW"; - case EGL_BAD_PARAMETER: - return "EGL_BAD_PARAMETER"; - case EGL_BAD_SURFACE: - return "EGL_BAD_SURFACE"; - case EGL_CONTEXT_LOST: - return "EGL_CONTEXT_LOST"; - } - return "unknown EGL error"; -} - -void -startDriver() { - x_dpy = XOpenDisplay(NULL); - if (!x_dpy) { - fprintf(stderr, "XOpenDisplay failed\n"); - exit(1); - } - e_dpy = eglGetDisplay(x_dpy); - if (!e_dpy) { - fprintf(stderr, "eglGetDisplay failed: %s\n", eglGetErrorStr()); - exit(1); - } - EGLint e_major, e_minor; - if (!eglInitialize(e_dpy, &e_major, &e_minor)) { - fprintf(stderr, "eglInitialize failed: %s\n", eglGetErrorStr()); - exit(1); - } - if (!eglBindAPI(EGL_OPENGL_ES_API)) { - fprintf(stderr, "eglBindAPI failed: %s\n", eglGetErrorStr()); - exit(1); - } - - static const EGLint attribs[] = { - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_BLUE_SIZE, 8, - EGL_GREEN_SIZE, 8, - EGL_RED_SIZE, 8, - EGL_DEPTH_SIZE, 16, - EGL_CONFIG_CAVEAT, EGL_NONE, - EGL_NONE - }; - EGLint num_configs; - if (!eglChooseConfig(e_dpy, attribs, &e_config, 1, &num_configs)) { - fprintf(stderr, "eglChooseConfig failed: %s\n", eglGetErrorStr()); - exit(1); - } - EGLint vid; - if (!eglGetConfigAttrib(e_dpy, e_config, EGL_NATIVE_VISUAL_ID, &vid)) { - fprintf(stderr, "eglGetConfigAttrib failed: %s\n", eglGetErrorStr()); - exit(1); - } - - XVisualInfo visTemplate; - visTemplate.visualid = vid; - int num_visuals; - x_visual_info = XGetVisualInfo(x_dpy, VisualIDMask, &visTemplate, &num_visuals); - if (!x_visual_info) { - fprintf(stderr, "XGetVisualInfo failed\n"); - exit(1); - } - - x_root = RootWindow(x_dpy, DefaultScreen(x_dpy)); - x_colormap = XCreateColormap(x_dpy, x_root, x_visual_info->visual, AllocNone); - if (!x_colormap) { - fprintf(stderr, "XCreateColormap failed\n"); - exit(1); - } - - static const EGLint ctx_attribs[] = { - EGL_CONTEXT_CLIENT_VERSION, 3, - EGL_NONE - }; - e_ctx = eglCreateContext(e_dpy, e_config, EGL_NO_CONTEXT, ctx_attribs); - if (!e_ctx) { - fprintf(stderr, "eglCreateContext failed: %s\n", eglGetErrorStr()); - exit(1); - } - - net_wm_name = XInternAtom(x_dpy, "_NET_WM_NAME", False); - utf8_string = XInternAtom(x_dpy, "UTF8_STRING", False); - wm_delete_window = XInternAtom(x_dpy, "WM_DELETE_WINDOW", False); - wm_protocols = XInternAtom(x_dpy, "WM_PROTOCOLS", False); - wm_take_focus = XInternAtom(x_dpy, "WM_TAKE_FOCUS", False); - - const int key_lo = 8; - const int key_hi = 255; - int keysyms_per_keycode; - KeySym *keysyms = XGetKeyboardMapping(x_dpy, key_lo, key_hi-key_lo+1, &keysyms_per_keycode); - if (keysyms_per_keycode < 2) { - fprintf(stderr, "XGetKeyboardMapping returned too few keysyms per keycode: %d\n", keysyms_per_keycode); - exit(1); - } - int k; - for (k = key_lo; k <= key_hi; k++) { - onKeysym(k, - keysyms[(k-key_lo)*keysyms_per_keycode + 0], - keysyms[(k-key_lo)*keysyms_per_keycode + 1]); - } -} - -void -processEvents() { - while (XPending(x_dpy)) { - XEvent ev; - XNextEvent(x_dpy, &ev); - switch (ev.type) { - case KeyPress: - case KeyRelease: - onKey(ev.xkey.window, ev.xkey.state, ev.xkey.keycode, ev.type == KeyPress ? 1 : 2); - break; - case ButtonPress: - case ButtonRelease: - onMouse(ev.xbutton.window, ev.xbutton.x, ev.xbutton.y, ev.xbutton.state, ev.xbutton.button, - ev.type == ButtonPress ? 1 : 2); - break; - case MotionNotify: - onMouse(ev.xmotion.window, ev.xmotion.x, ev.xmotion.y, ev.xmotion.state, 0, 0); - break; - case FocusIn: - case FocusOut: - onFocus(ev.xmotion.window, ev.type == FocusIn); - break; - case Expose: - // A non-zero Count means that there are more expose events coming. For - // example, a non-rectangular exposure (e.g. from a partially overlapped - // window) will result in multiple expose events whose dirty rectangles - // combine to define the dirty region. Go's paint events do not provide - // dirty regions, so we only pass on the final X11 expose event. - if (ev.xexpose.count == 0) { - onExpose(ev.xexpose.window); - } - break; - case ConfigureNotify: - onConfigure(ev.xconfigure.window, ev.xconfigure.x, ev.xconfigure.y, - ev.xconfigure.width, ev.xconfigure.height, - DisplayWidth(x_dpy, DefaultScreen(x_dpy)), - DisplayWidthMM(x_dpy, DefaultScreen(x_dpy))); - break; - case ClientMessage: - if ((ev.xclient.message_type != wm_protocols) || (ev.xclient.format != 32)) { - break; - } - Atom a = ev.xclient.data.l[0]; - if (a == wm_delete_window) { - onDeleteWindow(ev.xclient.window); - } else if (a == wm_take_focus) { - XSetInputFocus(x_dpy, ev.xclient.window, RevertToParent, ev.xclient.data.l[1]); - } - break; - } - } -} - -void -makeCurrent(uintptr_t surface) { - EGLSurface surf = (EGLSurface)(surface); - if (!eglMakeCurrent(e_dpy, surf, surf, e_ctx)) { - fprintf(stderr, "eglMakeCurrent failed: %s\n", eglGetErrorStr()); - exit(1); - } -} - -void -swapBuffers(uintptr_t surface) { - EGLSurface surf = (EGLSurface)(surface); - if (!eglSwapBuffers(e_dpy, surf)) { - fprintf(stderr, "eglSwapBuffers failed: %s\n", eglGetErrorStr()); - exit(1); - } -} - -void -doCloseWindow(uintptr_t id) { - Window win = (Window)(id); - XDestroyWindow(x_dpy, win); -} - -uintptr_t -doNewWindow(int width, int height, char* title, int title_len) { - XSetWindowAttributes attr; - attr.colormap = x_colormap; - attr.event_mask = - KeyPressMask | - KeyReleaseMask | - ButtonPressMask | - ButtonReleaseMask | - PointerMotionMask | - ExposureMask | - StructureNotifyMask | - FocusChangeMask; - - Window win = XCreateWindow( - x_dpy, x_root, 0, 0, width, height, 0, x_visual_info->depth, InputOutput, - x_visual_info->visual, CWColormap | CWEventMask, &attr); - - XSizeHints sizehints; - sizehints.width = width; - sizehints.height = height; - sizehints.flags = USSize; - XSetNormalHints(x_dpy, win, &sizehints); - - Atom atoms[2]; - atoms[0] = wm_delete_window; - atoms[1] = wm_take_focus; - XSetWMProtocols(x_dpy, win, atoms, 2); - - XSetStandardProperties(x_dpy, win, "", "App", None, (char **)NULL, 0, &sizehints); - XChangeProperty(x_dpy, win, net_wm_name, utf8_string, 8, PropModeReplace, title, title_len); - - return win; -} - -uintptr_t -doShowWindow(uintptr_t id) { - Window win = (Window)(id); - XMapWindow(x_dpy, win); - EGLSurface surf = eglCreateWindowSurface(e_dpy, e_config, win, NULL); - if (!surf) { - fprintf(stderr, "eglCreateWindowSurface failed: %s\n", eglGetErrorStr()); - exit(1); - } - return (uintptr_t)(surf); -} - -uintptr_t -surfaceCreate() { - static const EGLint ctx_attribs[] = { - EGL_CONTEXT_CLIENT_VERSION, 3, - EGL_NONE - }; - EGLContext ctx = eglCreateContext(e_dpy, e_config, EGL_NO_CONTEXT, ctx_attribs); - if (!ctx) { - fprintf(stderr, "surface eglCreateContext failed: %s\n", eglGetErrorStr()); - return 0; - } - - static const EGLint cfg_attribs[] = { - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - EGL_SURFACE_TYPE, EGL_PBUFFER_BIT, - EGL_BLUE_SIZE, 8, - EGL_GREEN_SIZE, 8, - EGL_RED_SIZE, 8, - EGL_DEPTH_SIZE, 16, - EGL_CONFIG_CAVEAT, EGL_NONE, - EGL_NONE - }; - EGLConfig cfg; - EGLint num_configs; - if (!eglChooseConfig(e_dpy, cfg_attribs, &cfg, 1, &num_configs)) { - fprintf(stderr, "gldriver: surface eglChooseConfig failed: %s\n", eglGetErrorStr()); - return 0; - } - - // TODO: use the size of the monitor as a bound for texture size. - static const EGLint attribs[] = { - EGL_WIDTH, 4096, - EGL_HEIGHT, 3072, - EGL_NONE - }; - EGLSurface surface = eglCreatePbufferSurface(e_dpy, cfg, attribs); - if (!surface) { - fprintf(stderr, "gldriver: surface eglCreatePbufferSurface failed: %s\n", eglGetErrorStr()); - return 0; - } - - if (!eglMakeCurrent(e_dpy, surface, surface, ctx)) { - fprintf(stderr, "gldriver: surface eglMakeCurrent failed: %s\n", eglGetErrorStr()); - return 0; - } - - return (uintptr_t)surface; -} diff --git a/vendor/golang.org/x/exp/shiny/driver/gldriver/x11.go b/vendor/golang.org/x/exp/shiny/driver/gldriver/x11.go deleted file mode 100644 index 61bb7ed..0000000 --- a/vendor/golang.org/x/exp/shiny/driver/gldriver/x11.go +++ /dev/null @@ -1,318 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build linux,!android openbsd - -package gldriver - -/* -#cgo linux LDFLAGS: -lEGL -lGLESv2 -lX11 -#cgo openbsd LDFLAGS: -L/usr/X11R6/lib/ -lEGL -lGLESv2 -lX11 - -#cgo openbsd CFLAGS: -I/usr/X11R6/include/ - -#include -#include -#include - -char *eglGetErrorStr(); -void startDriver(); -void processEvents(); -void makeCurrent(uintptr_t ctx); -void swapBuffers(uintptr_t ctx); -void doCloseWindow(uintptr_t id); -uintptr_t doNewWindow(int width, int height, char* title, int title_len); -uintptr_t doShowWindow(uintptr_t id); -uintptr_t surfaceCreate(); -*/ -import "C" -import ( - "errors" - "runtime" - "time" - "unsafe" - - "golang.org/x/exp/shiny/driver/internal/x11key" - "golang.org/x/exp/shiny/screen" - "golang.org/x/mobile/event/key" - "golang.org/x/mobile/event/mouse" - "golang.org/x/mobile/event/paint" - "golang.org/x/mobile/event/size" - "golang.org/x/mobile/geom" - "golang.org/x/mobile/gl" -) - -const useLifecycler = true - -const handleSizeEventsAtChannelReceive = true - -var theKeysyms x11key.KeysymTable - -func init() { - // It might not be necessary, but it probably doesn't hurt to try to make - // 'the main thread' be 'the X11 / OpenGL thread'. - runtime.LockOSThread() -} - -func newWindow(opts *screen.NewWindowOptions) (uintptr, error) { - width, height := optsSize(opts) - - title := opts.GetTitle() - ctitle := C.CString(title) - defer C.free(unsafe.Pointer(ctitle)) - - retc := make(chan uintptr) - uic <- uiClosure{ - f: func() uintptr { - return uintptr(C.doNewWindow(C.int(width), C.int(height), ctitle, C.int(len(title)))) - }, - retc: retc, - } - return <-retc, nil -} - -func initWindow(w *windowImpl) { - w.glctx, w.worker = glctx, worker -} - -func showWindow(w *windowImpl) { - retc := make(chan uintptr) - uic <- uiClosure{ - f: func() uintptr { - return uintptr(C.doShowWindow(C.uintptr_t(w.id))) - }, - retc: retc, - } - w.ctx = <-retc - go drawLoop(w) -} - -func closeWindow(id uintptr) { - uic <- uiClosure{ - f: func() uintptr { - C.doCloseWindow(C.uintptr_t(id)) - return 0 - }, - } -} - -func drawLoop(w *windowImpl) { - glcontextc <- w.ctx.(uintptr) - go func() { - for range w.publish { - publishc <- w - } - }() -} - -var ( - glcontextc = make(chan uintptr) - publishc = make(chan *windowImpl) - uic = make(chan uiClosure) - - // TODO: don't assume that there is only one window, and hence only - // one (global) GL context. - // - // TODO: should we be able to make a shiny.Texture before having a - // shiny.Window's GL context? Should something like gl.IsProgram be a - // method instead of a function, and have each shiny.Window have its own - // gl.Context? - glctx gl.Context - worker gl.Worker -) - -// uiClosure is a closure to be run on C's UI thread. -type uiClosure struct { - f func() uintptr - retc chan uintptr -} - -func main(f func(screen.Screen)) error { - if gl.Version() == "GL_ES_2_0" { - return errors.New("gldriver: ES 3 required on X11") - } - C.startDriver() - glctx, worker = gl.NewContext() - - closec := make(chan struct{}) - go func() { - f(theScreen) - close(closec) - }() - - // heartbeat is a channel that, at regular intervals, directs the select - // below to also consider X11 events, not just Go events (channel - // communications). - // - // TODO: select instead of poll. Note that knowing whether to call - // C.processEvents needs to select on a file descriptor, and the other - // cases below select on Go channels. - heartbeat := time.NewTicker(time.Second / 60) - workAvailable := worker.WorkAvailable() - - for { - select { - case <-closec: - return nil - case ctx := <-glcontextc: - // TODO: do we need to synchronize with seeing a size event for - // this window's context before or after calling makeCurrent? - // Otherwise, are we racing with the gl.Viewport call? I've - // occasionally seen a stale viewport, if the window manager sets - // the window width and height to something other than that - // requested by XCreateWindow, but it's not easily reproducible. - C.makeCurrent(C.uintptr_t(ctx)) - case w := <-publishc: - C.swapBuffers(C.uintptr_t(w.ctx.(uintptr))) - w.publishDone <- screen.PublishResult{} - case req := <-uic: - ret := req.f() - if req.retc != nil { - req.retc <- ret - } - case <-heartbeat.C: - C.processEvents() - case <-workAvailable: - worker.DoWork() - } - } -} - -//export onExpose -func onExpose(id uintptr) { - theScreen.mu.Lock() - w := theScreen.windows[id] - theScreen.mu.Unlock() - - if w == nil { - return - } - - w.Send(paint.Event{External: true}) -} - -//export onKeysym -func onKeysym(k, unshifted, shifted uint32) { - theKeysyms[k][0] = unshifted - theKeysyms[k][1] = shifted -} - -//export onKey -func onKey(id uintptr, state uint16, detail, dir uint8) { - theScreen.mu.Lock() - w := theScreen.windows[id] - theScreen.mu.Unlock() - - if w == nil { - return - } - - r, c := theKeysyms.Lookup(detail, state) - w.Send(key.Event{ - Rune: r, - Code: c, - Modifiers: x11key.KeyModifiers(state), - Direction: key.Direction(dir), - }) -} - -//export onMouse -func onMouse(id uintptr, x, y int32, state uint16, button, dir uint8) { - theScreen.mu.Lock() - w := theScreen.windows[id] - theScreen.mu.Unlock() - - if w == nil { - return - } - - // TODO: should a mouse.Event have a separate MouseModifiers field, for - // which buttons are pressed during a mouse move? - btn := mouse.Button(button) - switch btn { - case 4: - btn = mouse.ButtonWheelUp - case 5: - btn = mouse.ButtonWheelDown - case 6: - btn = mouse.ButtonWheelLeft - case 7: - btn = mouse.ButtonWheelRight - } - if btn.IsWheel() { - if dir != uint8(mouse.DirPress) { - return - } - dir = uint8(mouse.DirStep) - } - w.Send(mouse.Event{ - X: float32(x), - Y: float32(y), - Button: btn, - Modifiers: x11key.KeyModifiers(state), - Direction: mouse.Direction(dir), - }) -} - -//export onFocus -func onFocus(id uintptr, focused bool) { - theScreen.mu.Lock() - w := theScreen.windows[id] - theScreen.mu.Unlock() - - if w == nil { - return - } - - w.lifecycler.SetFocused(focused) - w.lifecycler.SendEvent(w, w.glctx) -} - -//export onConfigure -func onConfigure(id uintptr, x, y, width, height, displayWidth, displayWidthMM int32) { - theScreen.mu.Lock() - w := theScreen.windows[id] - theScreen.mu.Unlock() - - if w == nil { - return - } - - w.lifecycler.SetVisible(x+width > 0 && y+height > 0) - w.lifecycler.SendEvent(w, w.glctx) - - const ( - mmPerInch = 25.4 - ptPerInch = 72 - ) - pixelsPerMM := float32(displayWidth) / float32(displayWidthMM) - w.Send(size.Event{ - WidthPx: int(width), - HeightPx: int(height), - WidthPt: geom.Pt(width), - HeightPt: geom.Pt(height), - PixelsPerPt: pixelsPerMM * mmPerInch / ptPerInch, - }) -} - -//export onDeleteWindow -func onDeleteWindow(id uintptr) { - theScreen.mu.Lock() - w := theScreen.windows[id] - theScreen.mu.Unlock() - - if w == nil { - return - } - - w.lifecycler.SetDead(true) - w.lifecycler.SendEvent(w, w.glctx) -} - -func surfaceCreate() error { - if C.surfaceCreate() == 0 { - return errors.New("gldriver: surface creation failed") - } - return nil -} diff --git a/vendor/golang.org/x/exp/shiny/driver/internal/drawer/drawer.go b/vendor/golang.org/x/exp/shiny/driver/internal/drawer/drawer.go deleted file mode 100644 index 230a174..0000000 --- a/vendor/golang.org/x/exp/shiny/driver/internal/drawer/drawer.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package drawer provides functions that help implement screen.Drawer methods. -package drawer // import "golang.org/x/exp/shiny/driver/internal/drawer" - -import ( - "image" - "image/draw" - - "golang.org/x/exp/shiny/screen" - "golang.org/x/image/math/f64" -) - -// Copy implements the Copy method of the screen.Drawer interface by calling -// the Draw method of that same interface. -func Copy(dst screen.Drawer, dp image.Point, src screen.Texture, sr image.Rectangle, op draw.Op, opts *screen.DrawOptions) { - dst.Draw(f64.Aff3{ - 1, 0, float64(dp.X - sr.Min.X), - 0, 1, float64(dp.Y - sr.Min.Y), - }, src, sr, op, opts) -} - -// Scale implements the Scale method of the screen.Drawer interface by calling -// the Draw method of that same interface. -func Scale(dst screen.Drawer, dr image.Rectangle, src screen.Texture, sr image.Rectangle, op draw.Op, opts *screen.DrawOptions) { - rx := float64(dr.Dx()) / float64(sr.Dx()) - ry := float64(dr.Dy()) / float64(sr.Dy()) - dst.Draw(f64.Aff3{ - rx, 0, float64(dr.Min.X) - rx*float64(sr.Min.X), - 0, ry, float64(dr.Min.Y) - ry*float64(sr.Min.Y), - }, src, sr, op, opts) -} diff --git a/vendor/golang.org/x/exp/shiny/driver/internal/errscreen/errscreen.go b/vendor/golang.org/x/exp/shiny/driver/internal/errscreen/errscreen.go deleted file mode 100644 index 97f9773..0000000 --- a/vendor/golang.org/x/exp/shiny/driver/internal/errscreen/errscreen.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package errscreen provides a stub Screen implementation. -package errscreen // import "golang.org/x/exp/shiny/driver/internal/errscreen" - -import ( - "image" - - "golang.org/x/exp/shiny/screen" -) - -// Stub returns a Screen whose methods all return the given error. -func Stub(err error) screen.Screen { - return stub{err} -} - -type stub struct { - err error -} - -func (s stub) NewBuffer(size image.Point) (screen.Buffer, error) { return nil, s.err } -func (s stub) NewTexture(size image.Point) (screen.Texture, error) { return nil, s.err } -func (s stub) NewWindow(opts *screen.NewWindowOptions) (screen.Window, error) { return nil, s.err } diff --git a/vendor/golang.org/x/exp/shiny/driver/internal/event/event.go b/vendor/golang.org/x/exp/shiny/driver/internal/event/event.go deleted file mode 100644 index 686a123..0000000 --- a/vendor/golang.org/x/exp/shiny/driver/internal/event/event.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package event provides an infinitely buffered double-ended queue of events. -package event // import "golang.org/x/exp/shiny/driver/internal/event" - -import ( - "sync" -) - -// Deque is an infinitely buffered double-ended queue of events. The zero value -// is usable, but a Deque value must not be copied. -type Deque struct { - mu sync.Mutex - cond sync.Cond // cond.L is lazily initialized to &Deque.mu. - back []interface{} // FIFO. - front []interface{} // LIFO. -} - -func (q *Deque) lockAndInit() { - q.mu.Lock() - if q.cond.L == nil { - q.cond.L = &q.mu - } -} - -// NextEvent implements the screen.EventDeque interface. -func (q *Deque) NextEvent() interface{} { - q.lockAndInit() - defer q.mu.Unlock() - - for { - if n := len(q.front); n > 0 { - e := q.front[n-1] - q.front[n-1] = nil - q.front = q.front[:n-1] - return e - } - - if n := len(q.back); n > 0 { - e := q.back[0] - q.back[0] = nil - q.back = q.back[1:] - return e - } - - q.cond.Wait() - } -} - -// Send implements the screen.EventDeque interface. -func (q *Deque) Send(event interface{}) { - q.lockAndInit() - defer q.mu.Unlock() - - q.back = append(q.back, event) - q.cond.Signal() -} - -// SendFirst implements the screen.EventDeque interface. -func (q *Deque) SendFirst(event interface{}) { - q.lockAndInit() - defer q.mu.Unlock() - - q.front = append(q.front, event) - q.cond.Signal() -} diff --git a/vendor/golang.org/x/exp/shiny/driver/internal/lifecycler/lifecycler.go b/vendor/golang.org/x/exp/shiny/driver/internal/lifecycler/lifecycler.go deleted file mode 100644 index 53d3543..0000000 --- a/vendor/golang.org/x/exp/shiny/driver/internal/lifecycler/lifecycler.go +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package lifecycler tracks a window's lifecycle state. -// -// It eliminates sending redundant lifecycle events, ones where the From and To -// stages are equal. For example, moving a window from one part of the screen -// to another should not send multiple events from StageVisible to -// StageVisible, even though the underlying window system's message might only -// hold the new position, and not whether the window was previously visible. -package lifecycler // import "golang.org/x/exp/shiny/driver/internal/lifecycler" - -import ( - "sync" - - "golang.org/x/mobile/event/lifecycle" -) - -// State is a window's lifecycle state. -type State struct { - mu sync.Mutex - stage lifecycle.Stage - dead bool - focused bool - visible bool -} - -func (s *State) SetDead(b bool) { - s.mu.Lock() - s.dead = b - s.mu.Unlock() -} - -func (s *State) SetFocused(b bool) { - s.mu.Lock() - s.focused = b - s.mu.Unlock() -} - -func (s *State) SetVisible(b bool) { - s.mu.Lock() - s.visible = b - s.mu.Unlock() -} - -func (s *State) SendEvent(r Sender, drawContext interface{}) { - s.mu.Lock() - from, to := s.stage, lifecycle.StageAlive - // The order of these if's is important. For example, once a window becomes - // StageDead, it should never change stage again. - // - // Similarly, focused trumps visible. It's hard to imagine a situation - // where a window is focused and not visible on screen, but in that - // unlikely case, StageFocused seems the most appropriate stage. - if s.dead { - to = lifecycle.StageDead - } else if s.focused { - to = lifecycle.StageFocused - } else if s.visible { - to = lifecycle.StageVisible - } - s.stage = to - s.mu.Unlock() - - if from != to { - r.Send(lifecycle.Event{ - From: from, - To: to, - - // TODO: does shiny use this at all? - DrawContext: drawContext, - }) - } -} - -// Sender is who to send the lifecycle event to. -type Sender interface { - Send(event interface{}) -} diff --git a/vendor/golang.org/x/exp/shiny/driver/internal/win32/key.go b/vendor/golang.org/x/exp/shiny/driver/internal/win32/key.go deleted file mode 100644 index c7b9e38..0000000 --- a/vendor/golang.org/x/exp/shiny/driver/internal/win32/key.go +++ /dev/null @@ -1,350 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package win32 - -import ( - "fmt" - "syscall" - "unicode/utf16" - - "golang.org/x/mobile/event/key" -) - -// convVirtualKeyCode converts a Win32 virtual key code number -// into the standard keycodes used by the key package. -func convVirtualKeyCode(vKey uint32) key.Code { - switch vKey { - case 0x01: // VK_LBUTTON left mouse button - case 0x02: // VK_RBUTTON right mouse button - case 0x03: // VK_CANCEL control-break processing - case 0x04: // VK_MBUTTON middle mouse button - case 0x05: // VK_XBUTTON1 X1 mouse button - case 0x06: // VK_XBUTTON2 X2 mouse button - case 0x08: // VK_BACK - return key.CodeDeleteBackspace - case 0x09: // VK_TAB - return key.CodeTab - case 0x0C: // VK_CLEAR - case 0x0D: // VK_RETURN - return key.CodeReturnEnter - case 0x10: // VK_SHIFT - return key.CodeLeftShift - case 0x11: // VK_CONTROL - return key.CodeLeftControl - case 0x12: // VK_MENU - return key.CodeLeftAlt - case 0x13: // VK_PAUSE - case 0x14: // VK_CAPITAL - return key.CodeCapsLock - case 0x15: // VK_KANA, VK_HANGUEL, VK_HANGUL - case 0x17: // VK_JUNJA - case 0x18: // VK_FINA, L - case 0x19: // VK_HANJA, VK_KANJI - case 0x1B: // VK_ESCAPE - return key.CodeEscape - case 0x1C: // VK_CONVERT - case 0x1D: // VK_NONCONVERT - case 0x1E: // VK_ACCEPT - case 0x1F: // VK_MODECHANGE - case 0x20: // VK_SPACE - return key.CodeSpacebar - case 0x21: // VK_PRIOR - return key.CodePageUp - case 0x22: // VK_NEXT - return key.CodePageDown - case 0x23: // VK_END - return key.CodeEnd - case 0x24: // VK_HOME - return key.CodeHome - case 0x25: // VK_LEFT - return key.CodeLeftArrow - case 0x26: // VK_UP - return key.CodeUpArrow - case 0x27: // VK_RIGHT - return key.CodeRightArrow - case 0x28: // VK_DOWN - return key.CodeDownArrow - case 0x29: // VK_SELECT - case 0x2A: // VK_PRINT - case 0x2B: // VK_EXECUTE - case 0x2C: // VK_SNAPSHOT - case 0x2D: // VK_INSERT - case 0x2E: // VK_DELETE - return key.CodeDeleteForward - case 0x2F: // VK_HELP - return key.CodeHelp - case 0x30: - return key.Code0 - case 0x31: - return key.Code1 - case 0x32: - return key.Code2 - case 0x33: - return key.Code3 - case 0x34: - return key.Code4 - case 0x35: - return key.Code5 - case 0x36: - return key.Code6 - case 0x37: - return key.Code7 - case 0x38: - return key.Code8 - case 0x39: - return key.Code9 - case 0x41: - return key.CodeA - case 0x42: - return key.CodeB - case 0x43: - return key.CodeC - case 0x44: - return key.CodeD - case 0x45: - return key.CodeE - case 0x46: - return key.CodeF - case 0x47: - return key.CodeG - case 0x48: - return key.CodeH - case 0x49: - return key.CodeI - case 0x4A: - return key.CodeJ - case 0x4B: - return key.CodeK - case 0x4C: - return key.CodeL - case 0x4D: - return key.CodeM - case 0x4E: - return key.CodeN - case 0x4F: - return key.CodeO - case 0x50: - return key.CodeP - case 0x51: - return key.CodeQ - case 0x52: - return key.CodeR - case 0x53: - return key.CodeS - case 0x54: - return key.CodeT - case 0x55: - return key.CodeU - case 0x56: - return key.CodeV - case 0x57: - return key.CodeW - case 0x58: - return key.CodeX - case 0x59: - return key.CodeY - case 0x5A: - return key.CodeZ - case 0x5B: // VK_LWIN - return key.CodeLeftGUI - case 0x5C: // VK_RWIN - return key.CodeRightGUI - case 0x5D: // VK_APPS - case 0x5F: // VK_SLEEP - case 0x60: // VK_NUMPAD0 - return key.CodeKeypad0 - case 0x61: // VK_NUMPAD1 - return key.CodeKeypad1 - case 0x62: // VK_NUMPAD2 - return key.CodeKeypad2 - case 0x63: // VK_NUMPAD3 - return key.CodeKeypad3 - case 0x64: // VK_NUMPAD4 - return key.CodeKeypad4 - case 0x65: // VK_NUMPAD5 - return key.CodeKeypad5 - case 0x66: // VK_NUMPAD6 - return key.CodeKeypad6 - case 0x67: // VK_NUMPAD7 - return key.CodeKeypad7 - case 0x68: // VK_NUMPAD8 - return key.CodeKeypad8 - case 0x69: // VK_NUMPAD9 - return key.CodeKeypad9 - case 0x6A: // VK_MULTIPLY - return key.CodeKeypadAsterisk - case 0x6B: // VK_ADD - return key.CodeKeypadPlusSign - case 0x6C: // VK_SEPARATOR - case 0x6D: // VK_SUBTRACT - return key.CodeKeypadHyphenMinus - case 0x6E: // VK_DECIMAL - return key.CodeFullStop - case 0x6F: // VK_DIVIDE - return key.CodeKeypadSlash - case 0x70: // VK_F1 - return key.CodeF1 - case 0x71: // VK_F2 - return key.CodeF2 - case 0x72: // VK_F3 - return key.CodeF3 - case 0x73: // VK_F4 - return key.CodeF4 - case 0x74: // VK_F5 - return key.CodeF5 - case 0x75: // VK_F6 - return key.CodeF6 - case 0x76: // VK_F7 - return key.CodeF7 - case 0x77: // VK_F8 - return key.CodeF8 - case 0x78: // VK_F9 - return key.CodeF9 - case 0x79: // VK_F10 - return key.CodeF10 - case 0x7A: // VK_F11 - return key.CodeF11 - case 0x7B: // VK_F12 - return key.CodeF12 - case 0x7C: // VK_F13 - return key.CodeF13 - case 0x7D: // VK_F14 - return key.CodeF14 - case 0x7E: // VK_F15 - return key.CodeF15 - case 0x7F: // VK_F16 - return key.CodeF16 - case 0x80: // VK_F17 - return key.CodeF17 - case 0x81: // VK_F18 - return key.CodeF18 - case 0x82: // VK_F19 - return key.CodeF19 - case 0x83: // VK_F20 - return key.CodeF20 - case 0x84: // VK_F21 - return key.CodeF21 - case 0x85: // VK_F22 - return key.CodeF22 - case 0x86: // VK_F23 - return key.CodeF23 - case 0x87: // VK_F24 - return key.CodeF24 - case 0x90: // VK_NUMLOCK - return key.CodeKeypadNumLock - case 0x91: // VK_SCROLL - case 0xA0: // VK_LSHIFT - return key.CodeLeftShift - case 0xA1: // VK_RSHIFT - return key.CodeRightShift - case 0xA2: // VK_LCONTROL - return key.CodeLeftControl - case 0xA3: // VK_RCONTROL - return key.CodeRightControl - case 0xA4: // VK_LMENU - case 0xA5: // VK_RMENU - case 0xA6: // VK_BROWSER_BACK - case 0xA7: // VK_BROWSER_FORWARD - case 0xA8: // VK_BROWSER_REFRESH - case 0xA9: // VK_BROWSER_STOP - case 0xAA: // VK_BROWSER_SEARCH - case 0xAB: // VK_BROWSER_FAVORITES - case 0xAC: // VK_BROWSER_HOME - case 0xAD: // VK_VOLUME_MUTE - return key.CodeMute - case 0xAE: // VK_VOLUME_DOWN - return key.CodeVolumeDown - case 0xAF: // VK_VOLUME_UP - return key.CodeVolumeUp - case 0xB0: // VK_MEDIA_NEXT_TRACK - case 0xB1: // VK_MEDIA_PREV_TRACK - case 0xB2: // VK_MEDIA_STOP - case 0xB3: // VK_MEDIA_PLAY_PAUSE - case 0xB4: // VK_LAUNCH_MAIL - case 0xB5: // VK_LAUNCH_MEDIA_SELECT - case 0xB6: // VK_LAUNCH_APP1 - case 0xB7: // VK_LAUNCH_APP2 - case 0xBA: // VK_OEM_1 ';:' - return key.CodeSemicolon - case 0xBB: // VK_OEM_PLUS '+' - return key.CodeEqualSign - case 0xBC: // VK_OEM_COMMA ',' - return key.CodeComma - case 0xBD: // VK_OEM_MINUS '-' - return key.CodeHyphenMinus - case 0xBE: // VK_OEM_PERIOD '.' - return key.CodeFullStop - case 0xBF: // VK_OEM_2 '/?' - return key.CodeSlash - case 0xC0: // VK_OEM_3 '`~' - return key.CodeGraveAccent - case 0xDB: // VK_OEM_4 '[{' - return key.CodeLeftSquareBracket - case 0xDC: // VK_OEM_5 '\|' - return key.CodeBackslash - case 0xDD: // VK_OEM_6 ']}' - return key.CodeRightSquareBracket - case 0xDE: // VK_OEM_7 'single-quote/double-quote' - return key.CodeApostrophe - case 0xDF: // VK_OEM_8 - return key.CodeUnknown - case 0xE2: // VK_OEM_102 - case 0xE5: // VK_PROCESSKEY - case 0xE7: // VK_PACKET - case 0xF6: // VK_ATTN - case 0xF7: // VK_CRSEL - case 0xF8: // VK_EXSEL - case 0xF9: // VK_EREOF - case 0xFA: // VK_PLAY - case 0xFB: // VK_ZOOM - case 0xFC: // VK_NONAME - case 0xFD: // VK_PA1 - case 0xFE: // VK_OEM_CLEAR - } - return key.CodeUnknown -} - -func readRune(vKey uint32, scanCode uint8) rune { - var ( - keystate [256]byte - buf [4]uint16 - ) - if err := _GetKeyboardState(&keystate[0]); err != nil { - panic(fmt.Sprintf("win32: %v", err)) - } - // TODO: cache GetKeyboardLayout result, update on WM_INPUTLANGCHANGE - layout := _GetKeyboardLayout(0) - ret := _ToUnicodeEx(vKey, uint32(scanCode), &keystate[0], &buf[0], int32(len(buf)), 0, layout) - if ret < 1 { - return -1 - } - return utf16.Decode(buf[:ret])[0] -} - -func sendKeyEvent(hwnd syscall.Handle, uMsg uint32, wParam, lParam uintptr) (lResult uintptr) { - e := key.Event{ - Rune: readRune(uint32(wParam), uint8(lParam>>16)), - Code: convVirtualKeyCode(uint32(wParam)), - Modifiers: keyModifiers(), - } - switch uMsg { - case _WM_KEYDOWN: - const prevMask = 1 << 30 - if repeat := lParam&prevMask == prevMask; repeat { - e.Direction = key.DirNone - } else { - e.Direction = key.DirPress - } - case _WM_KEYUP: - e.Direction = key.DirRelease - default: - panic(fmt.Sprintf("win32: unexpected key message: %d", uMsg)) - } - - KeyEvent(hwnd, e) - return 0 -} diff --git a/vendor/golang.org/x/exp/shiny/driver/internal/win32/syscall.go b/vendor/golang.org/x/exp/shiny/driver/internal/win32/syscall.go deleted file mode 100644 index 43366e9..0000000 --- a/vendor/golang.org/x/exp/shiny/driver/internal/win32/syscall.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go syscall_windows.go - -package win32 diff --git a/vendor/golang.org/x/exp/shiny/driver/internal/win32/syscall_windows.go b/vendor/golang.org/x/exp/shiny/driver/internal/win32/syscall_windows.go deleted file mode 100644 index 36e0dfe..0000000 --- a/vendor/golang.org/x/exp/shiny/driver/internal/win32/syscall_windows.go +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package win32 - -import ( - "syscall" -) - -type _COLORREF uint32 - -func _RGB(r, g, b byte) _COLORREF { - return _COLORREF(r) | _COLORREF(g)<<8 | _COLORREF(b)<<16 -} - -type _POINT struct { - X int32 - Y int32 -} - -type _RECT struct { - Left int32 - Top int32 - Right int32 - Bottom int32 -} - -type _MSG struct { - HWND syscall.Handle - Message uint32 - Wparam uintptr - Lparam uintptr - Time uint32 - Pt _POINT -} - -type _WNDCLASS struct { - Style uint32 - LpfnWndProc uintptr - CbClsExtra int32 - CbWndExtra int32 - HInstance syscall.Handle - HIcon syscall.Handle - HCursor syscall.Handle - HbrBackground syscall.Handle - LpszMenuName *uint16 - LpszClassName *uint16 -} - -type _WINDOWPOS struct { - HWND syscall.Handle - HWNDInsertAfter syscall.Handle - X int32 - Y int32 - Cx int32 - Cy int32 - Flags uint32 -} - -const ( - _WM_SETFOCUS = 7 - _WM_KILLFOCUS = 8 - _WM_PAINT = 15 - _WM_CLOSE = 16 - _WM_WINDOWPOSCHANGED = 71 - _WM_KEYDOWN = 256 - _WM_KEYUP = 257 - _WM_SYSKEYDOWN = 260 - _WM_SYSKEYUP = 261 - _WM_MOUSEMOVE = 512 - _WM_MOUSEWHEEL = 522 - _WM_LBUTTONDOWN = 513 - _WM_LBUTTONUP = 514 - _WM_RBUTTONDOWN = 516 - _WM_RBUTTONUP = 517 - _WM_MBUTTONDOWN = 519 - _WM_MBUTTONUP = 520 - _WM_USER = 0x0400 -) - -const ( - _WS_OVERLAPPED = 0x00000000 - _WS_CAPTION = 0x00C00000 - _WS_SYSMENU = 0x00080000 - _WS_THICKFRAME = 0x00040000 - _WS_MINIMIZEBOX = 0x00020000 - _WS_MAXIMIZEBOX = 0x00010000 - _WS_OVERLAPPEDWINDOW = _WS_OVERLAPPED | _WS_CAPTION | _WS_SYSMENU | _WS_THICKFRAME | _WS_MINIMIZEBOX | _WS_MAXIMIZEBOX -) - -const ( - _VK_SHIFT = 16 - _VK_CONTROL = 17 - _VK_MENU = 18 - _VK_LWIN = 0x5B - _VK_RWIN = 0x5C -) - -const ( - _MK_LBUTTON = 0x0001 - _MK_MBUTTON = 0x0010 - _MK_RBUTTON = 0x0002 -) - -const ( - _COLOR_BTNFACE = 15 -) - -const ( - _IDI_APPLICATION = 32512 - _IDC_ARROW = 32512 -) - -const ( - _CW_USEDEFAULT = 0x80000000 - 0x100000000 - - _SW_SHOWDEFAULT = 10 - - _HWND_MESSAGE = syscall.Handle(^uintptr(2)) // -3 - - _SWP_NOSIZE = 0x0001 -) - -const ( - _BI_RGB = 0 - _DIB_RGB_COLORS = 0 - - _AC_SRC_OVER = 0x00 - _AC_SRC_ALPHA = 0x01 - - _SRCCOPY = 0x00cc0020 - - _WHEEL_DELTA = 120 -) - -func _GET_X_LPARAM(lp uintptr) int32 { - return int32(_LOWORD(lp)) -} - -func _GET_Y_LPARAM(lp uintptr) int32 { - return int32(_HIWORD(lp)) -} - -func _GET_WHEEL_DELTA_WPARAM(lp uintptr) int16 { - return int16(_HIWORD(lp)) -} - -func _LOWORD(l uintptr) uint16 { - return uint16(uint32(l)) -} - -func _HIWORD(l uintptr) uint16 { - return uint16(uint32(l >> 16)) -} - -// notes to self -// UINT = uint32 -// callbacks = uintptr -// strings = *uint16 - -//sys GetDC(hwnd syscall.Handle) (dc syscall.Handle, err error) = user32.GetDC -//sys ReleaseDC(hwnd syscall.Handle, dc syscall.Handle) (err error) = user32.ReleaseDC -//sys sendMessage(hwnd syscall.Handle, uMsg uint32, wParam uintptr, lParam uintptr) (lResult uintptr) = user32.SendMessageW - -//sys _CreateWindowEx(exstyle uint32, className *uint16, windowText *uint16, style uint32, x int32, y int32, width int32, height int32, parent syscall.Handle, menu syscall.Handle, hInstance syscall.Handle, lpParam uintptr) (hwnd syscall.Handle, err error) = user32.CreateWindowExW -//sys _DefWindowProc(hwnd syscall.Handle, uMsg uint32, wParam uintptr, lParam uintptr) (lResult uintptr) = user32.DefWindowProcW -//sys _DestroyWindow(hwnd syscall.Handle) (err error) = user32.DestroyWindow -//sys _DispatchMessage(msg *_MSG) (ret int32) = user32.DispatchMessageW -//sys _GetClientRect(hwnd syscall.Handle, rect *_RECT) (err error) = user32.GetClientRect -//sys _GetWindowRect(hwnd syscall.Handle, rect *_RECT) (err error) = user32.GetWindowRect -//sys _GetKeyboardLayout(threadID uint32) (locale syscall.Handle) = user32.GetKeyboardLayout -//sys _GetKeyboardState(lpKeyState *byte) (err error) = user32.GetKeyboardState -//sys _GetKeyState(virtkey int32) (keystatus int16) = user32.GetKeyState -//sys _GetMessage(msg *_MSG, hwnd syscall.Handle, msgfiltermin uint32, msgfiltermax uint32) (ret int32, err error) [failretval==-1] = user32.GetMessageW -//sys _LoadCursor(hInstance syscall.Handle, cursorName uintptr) (cursor syscall.Handle, err error) = user32.LoadCursorW -//sys _LoadIcon(hInstance syscall.Handle, iconName uintptr) (icon syscall.Handle, err error) = user32.LoadIconW -//sys _MoveWindow(hwnd syscall.Handle, x int32, y int32, w int32, h int32, repaint bool) (err error) = user32.MoveWindow -//sys _PostMessage(hwnd syscall.Handle, uMsg uint32, wParam uintptr, lParam uintptr) (lResult bool) = user32.PostMessageW -//sys _PostQuitMessage(exitCode int32) = user32.PostQuitMessage -//sys _RegisterClass(wc *_WNDCLASS) (atom uint16, err error) = user32.RegisterClassW -//sys _ShowWindow(hwnd syscall.Handle, cmdshow int32) (wasvisible bool) = user32.ShowWindow -//sys _ScreenToClient(hwnd syscall.Handle, lpPoint *_POINT) (ok bool) = user32.ScreenToClient -//sys _ToUnicodeEx(wVirtKey uint32, wScanCode uint32, lpKeyState *byte, pwszBuff *uint16, cchBuff int32, wFlags uint32, dwhkl syscall.Handle) (ret int32) = user32.ToUnicodeEx -//sys _TranslateMessage(msg *_MSG) (done bool) = user32.TranslateMessage diff --git a/vendor/golang.org/x/exp/shiny/driver/internal/win32/win32.go b/vendor/golang.org/x/exp/shiny/driver/internal/win32/win32.go deleted file mode 100644 index deaeb37..0000000 --- a/vendor/golang.org/x/exp/shiny/driver/internal/win32/win32.go +++ /dev/null @@ -1,491 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -// Package win32 implements a partial shiny screen driver using the Win32 API. -// It provides window, lifecycle, key, and mouse management, but no drawing. -// That is left to windriver (using GDI) or gldriver (using DirectX via ANGLE). -package win32 // import "golang.org/x/exp/shiny/driver/internal/win32" - -import ( - "fmt" - "runtime" - "sync" - "syscall" - "unsafe" - - "golang.org/x/exp/shiny/screen" - "golang.org/x/mobile/event/key" - "golang.org/x/mobile/event/lifecycle" - "golang.org/x/mobile/event/mouse" - "golang.org/x/mobile/event/paint" - "golang.org/x/mobile/event/size" - "golang.org/x/mobile/geom" -) - -// screenHWND is the handle to the "Screen window". -// The Screen window encapsulates all screen.Screen operations -// in an actual Windows window so they all run on the main thread. -// Since any messages sent to a window will be executed on the -// main thread, we can safely use the messages below. -var screenHWND syscall.Handle - -const ( - msgCreateWindow = _WM_USER + iota - msgMainCallback - msgShow - msgQuit - msgLast -) - -// userWM is used to generate private (WM_USER and above) window message IDs -// for use by screenWindowWndProc and windowWndProc. -type userWM struct { - sync.Mutex - id uint32 -} - -func (m *userWM) next() uint32 { - m.Lock() - if m.id == 0 { - m.id = msgLast - } - r := m.id - m.id++ - m.Unlock() - return r -} - -var currentUserWM userWM - -func newWindow(opts *screen.NewWindowOptions) (syscall.Handle, error) { - // TODO(brainman): convert windowClass to *uint16 once (in initWindowClass) - wcname, err := syscall.UTF16PtrFromString(windowClass) - if err != nil { - return 0, err - } - title, err := syscall.UTF16PtrFromString(opts.GetTitle()) - if err != nil { - return 0, err - } - hwnd, err := _CreateWindowEx(0, - wcname, title, - _WS_OVERLAPPEDWINDOW, - _CW_USEDEFAULT, _CW_USEDEFAULT, - _CW_USEDEFAULT, _CW_USEDEFAULT, - 0, 0, hThisInstance, 0) - if err != nil { - return 0, err - } - // TODO(andlabs): use proper nCmdShow - // TODO(andlabs): call UpdateWindow() - - return hwnd, nil -} - -// ResizeClientRect makes hwnd client rectangle opts.Width by opts.Height in size. -func ResizeClientRect(hwnd syscall.Handle, opts *screen.NewWindowOptions) error { - if opts == nil || opts.Width <= 0 || opts.Height <= 0 { - return nil - } - var cr, wr _RECT - err := _GetClientRect(hwnd, &cr) - if err != nil { - return err - } - err = _GetWindowRect(hwnd, &wr) - if err != nil { - return err - } - w := (wr.Right - wr.Left) - (cr.Right - int32(opts.Width)) - h := (wr.Bottom - wr.Top) - (cr.Bottom - int32(opts.Height)) - return _MoveWindow(hwnd, wr.Left, wr.Top, w, h, false) -} - -// Show shows a newly created window. -// It sends the appropriate lifecycle events, makes the window appear -// on the screen, and sends an initial size event. -// -// This is a separate step from NewWindow to give the driver a chance -// to setup its internal state for a window before events start being -// delivered. -func Show(hwnd syscall.Handle) { - SendMessage(hwnd, msgShow, 0, 0) -} - -func Release(hwnd syscall.Handle) { - SendMessage(hwnd, _WM_CLOSE, 0, 0) -} - -func sendFocus(hwnd syscall.Handle, uMsg uint32, wParam, lParam uintptr) (lResult uintptr) { - switch uMsg { - case _WM_SETFOCUS: - LifecycleEvent(hwnd, lifecycle.StageFocused) - case _WM_KILLFOCUS: - LifecycleEvent(hwnd, lifecycle.StageVisible) - default: - panic(fmt.Sprintf("unexpected focus message: %d", uMsg)) - } - return _DefWindowProc(hwnd, uMsg, wParam, lParam) -} - -func sendShow(hwnd syscall.Handle, uMsg uint32, wParam, lParam uintptr) (lResult uintptr) { - LifecycleEvent(hwnd, lifecycle.StageVisible) - _ShowWindow(hwnd, _SW_SHOWDEFAULT) - sendSize(hwnd) - return 0 -} - -func sendSizeEvent(hwnd syscall.Handle, uMsg uint32, wParam, lParam uintptr) (lResult uintptr) { - wp := (*_WINDOWPOS)(unsafe.Pointer(lParam)) - if wp.Flags&_SWP_NOSIZE != 0 { - return 0 - } - sendSize(hwnd) - return 0 -} - -func sendSize(hwnd syscall.Handle) { - var r _RECT - if err := _GetClientRect(hwnd, &r); err != nil { - panic(err) // TODO(andlabs) - } - - width := int(r.Right - r.Left) - height := int(r.Bottom - r.Top) - - // TODO(andlabs): don't assume that PixelsPerPt == 1 - SizeEvent(hwnd, size.Event{ - WidthPx: width, - HeightPx: height, - WidthPt: geom.Pt(width), - HeightPt: geom.Pt(height), - PixelsPerPt: 1, - }) -} - -func sendClose(hwnd syscall.Handle, uMsg uint32, wParam, lParam uintptr) (lResult uintptr) { - // TODO(ktye): DefWindowProc calls DestroyWindow by default. - // To intercept destruction of the window, return 0 and call - // DestroyWindow when appropriate. - LifecycleEvent(hwnd, lifecycle.StageDead) - return _DefWindowProc(hwnd, uMsg, wParam, lParam) -} - -func sendMouseEvent(hwnd syscall.Handle, uMsg uint32, wParam, lParam uintptr) (lResult uintptr) { - e := mouse.Event{ - X: float32(_GET_X_LPARAM(lParam)), - Y: float32(_GET_Y_LPARAM(lParam)), - Modifiers: keyModifiers(), - } - - switch uMsg { - case _WM_MOUSEMOVE: - e.Direction = mouse.DirNone - case _WM_LBUTTONDOWN, _WM_MBUTTONDOWN, _WM_RBUTTONDOWN: - e.Direction = mouse.DirPress - case _WM_LBUTTONUP, _WM_MBUTTONUP, _WM_RBUTTONUP: - e.Direction = mouse.DirRelease - case _WM_MOUSEWHEEL: - // TODO: On a trackpad, a scroll can be a drawn-out affair with a - // distinct beginning and end. Should the intermediate events be - // DirNone? - e.Direction = mouse.DirStep - - // Convert from screen to window coordinates. - p := _POINT{ - int32(e.X), - int32(e.Y), - } - _ScreenToClient(hwnd, &p) - e.X = float32(p.X) - e.Y = float32(p.Y) - default: - panic("sendMouseEvent() called on non-mouse message") - } - - switch uMsg { - case _WM_MOUSEMOVE: - // No-op. - case _WM_LBUTTONDOWN, _WM_LBUTTONUP: - e.Button = mouse.ButtonLeft - case _WM_MBUTTONDOWN, _WM_MBUTTONUP: - e.Button = mouse.ButtonMiddle - case _WM_RBUTTONDOWN, _WM_RBUTTONUP: - e.Button = mouse.ButtonRight - case _WM_MOUSEWHEEL: - // TODO: handle horizontal scrolling - delta := _GET_WHEEL_DELTA_WPARAM(wParam) / _WHEEL_DELTA - switch { - case delta > 0: - e.Button = mouse.ButtonWheelUp - case delta < 0: - e.Button = mouse.ButtonWheelDown - delta = -delta - default: - return - } - for delta > 0 { - MouseEvent(hwnd, e) - delta-- - } - return - } - - MouseEvent(hwnd, e) - - return 0 -} - -// Precondition: this is called in immediate response to the message that triggered the event (so not after w.Send). -func keyModifiers() (m key.Modifiers) { - down := func(x int32) bool { - // GetKeyState gets the key state at the time of the message, so this is what we want. - return _GetKeyState(x)&0x80 != 0 - } - - if down(_VK_CONTROL) { - m |= key.ModControl - } - if down(_VK_MENU) { - m |= key.ModAlt - } - if down(_VK_SHIFT) { - m |= key.ModShift - } - if down(_VK_LWIN) || down(_VK_RWIN) { - m |= key.ModMeta - } - return m -} - -var ( - MouseEvent func(hwnd syscall.Handle, e mouse.Event) - PaintEvent func(hwnd syscall.Handle, e paint.Event) - SizeEvent func(hwnd syscall.Handle, e size.Event) - KeyEvent func(hwnd syscall.Handle, e key.Event) - LifecycleEvent func(hwnd syscall.Handle, e lifecycle.Stage) - - // TODO: use the golang.org/x/exp/shiny/driver/internal/lifecycler package - // instead of or together with the LifecycleEvent callback? -) - -func sendPaint(hwnd syscall.Handle, uMsg uint32, wParam, lParam uintptr) (lResult uintptr) { - PaintEvent(hwnd, paint.Event{}) - return _DefWindowProc(hwnd, uMsg, wParam, lParam) -} - -var screenMsgs = map[uint32]func(hwnd syscall.Handle, uMsg uint32, wParam, lParam uintptr) (lResult uintptr){} - -func AddScreenMsg(fn func(hwnd syscall.Handle, uMsg uint32, wParam, lParam uintptr)) uint32 { - uMsg := currentUserWM.next() - screenMsgs[uMsg] = func(hwnd syscall.Handle, uMsg uint32, wParam, lParam uintptr) uintptr { - fn(hwnd, uMsg, wParam, lParam) - return 0 - } - return uMsg -} - -func screenWindowWndProc(hwnd syscall.Handle, uMsg uint32, wParam uintptr, lParam uintptr) (lResult uintptr) { - switch uMsg { - case msgCreateWindow: - p := (*newWindowParams)(unsafe.Pointer(lParam)) - p.w, p.err = newWindow(p.opts) - case msgMainCallback: - go func() { - mainCallback() - SendScreenMessage(msgQuit, 0, 0) - }() - case msgQuit: - _PostQuitMessage(0) - } - fn := screenMsgs[uMsg] - if fn != nil { - return fn(hwnd, uMsg, wParam, lParam) - } - return _DefWindowProc(hwnd, uMsg, wParam, lParam) -} - -//go:uintptrescapes - -func SendScreenMessage(uMsg uint32, wParam uintptr, lParam uintptr) (lResult uintptr) { - return SendMessage(screenHWND, uMsg, wParam, lParam) -} - -var windowMsgs = map[uint32]func(hwnd syscall.Handle, uMsg uint32, wParam, lParam uintptr) (lResult uintptr){ - _WM_SETFOCUS: sendFocus, - _WM_KILLFOCUS: sendFocus, - _WM_PAINT: sendPaint, - msgShow: sendShow, - _WM_WINDOWPOSCHANGED: sendSizeEvent, - _WM_CLOSE: sendClose, - - _WM_LBUTTONDOWN: sendMouseEvent, - _WM_LBUTTONUP: sendMouseEvent, - _WM_MBUTTONDOWN: sendMouseEvent, - _WM_MBUTTONUP: sendMouseEvent, - _WM_RBUTTONDOWN: sendMouseEvent, - _WM_RBUTTONUP: sendMouseEvent, - _WM_MOUSEMOVE: sendMouseEvent, - _WM_MOUSEWHEEL: sendMouseEvent, - - _WM_KEYDOWN: sendKeyEvent, - _WM_KEYUP: sendKeyEvent, - // TODO case _WM_SYSKEYDOWN, _WM_SYSKEYUP: -} - -func AddWindowMsg(fn func(hwnd syscall.Handle, uMsg uint32, wParam, lParam uintptr)) uint32 { - uMsg := currentUserWM.next() - windowMsgs[uMsg] = func(hwnd syscall.Handle, uMsg uint32, wParam, lParam uintptr) uintptr { - fn(hwnd, uMsg, wParam, lParam) - return 0 - } - return uMsg -} - -func windowWndProc(hwnd syscall.Handle, uMsg uint32, wParam uintptr, lParam uintptr) (lResult uintptr) { - fn := windowMsgs[uMsg] - if fn != nil { - return fn(hwnd, uMsg, wParam, lParam) - } - return _DefWindowProc(hwnd, uMsg, wParam, lParam) -} - -type newWindowParams struct { - opts *screen.NewWindowOptions - w syscall.Handle - err error -} - -func NewWindow(opts *screen.NewWindowOptions) (syscall.Handle, error) { - var p newWindowParams - p.opts = opts - SendScreenMessage(msgCreateWindow, 0, uintptr(unsafe.Pointer(&p))) - return p.w, p.err -} - -const windowClass = "shiny_Window" - -func initWindowClass() (err error) { - wcname, err := syscall.UTF16PtrFromString(windowClass) - if err != nil { - return err - } - _, err = _RegisterClass(&_WNDCLASS{ - LpszClassName: wcname, - LpfnWndProc: syscall.NewCallback(windowWndProc), - HIcon: hDefaultIcon, - HCursor: hDefaultCursor, - HInstance: hThisInstance, - // TODO(andlabs): change this to something else? NULL? the hollow brush? - HbrBackground: syscall.Handle(_COLOR_BTNFACE + 1), - }) - return err -} - -func initScreenWindow() (err error) { - const screenWindowClass = "shiny_ScreenWindow" - swc, err := syscall.UTF16PtrFromString(screenWindowClass) - if err != nil { - return err - } - emptyString, err := syscall.UTF16PtrFromString("") - if err != nil { - return err - } - wc := _WNDCLASS{ - LpszClassName: swc, - LpfnWndProc: syscall.NewCallback(screenWindowWndProc), - HIcon: hDefaultIcon, - HCursor: hDefaultCursor, - HInstance: hThisInstance, - HbrBackground: syscall.Handle(_COLOR_BTNFACE + 1), - } - _, err = _RegisterClass(&wc) - if err != nil { - return err - } - screenHWND, err = _CreateWindowEx(0, - swc, emptyString, - _WS_OVERLAPPEDWINDOW, - _CW_USEDEFAULT, _CW_USEDEFAULT, - _CW_USEDEFAULT, _CW_USEDEFAULT, - _HWND_MESSAGE, 0, hThisInstance, 0) - if err != nil { - return err - } - return nil -} - -var ( - hDefaultIcon syscall.Handle - hDefaultCursor syscall.Handle - hThisInstance syscall.Handle -) - -func initCommon() (err error) { - hDefaultIcon, err = _LoadIcon(0, _IDI_APPLICATION) - if err != nil { - return err - } - hDefaultCursor, err = _LoadCursor(0, _IDC_ARROW) - if err != nil { - return err - } - // TODO(andlabs) hThisInstance - return nil -} - -//go:uintptrescapes - -func SendMessage(hwnd syscall.Handle, uMsg uint32, wParam uintptr, lParam uintptr) (lResult uintptr) { - return sendMessage(hwnd, uMsg, wParam, lParam) -} - -var mainCallback func() - -func Main(f func()) (retErr error) { - // It does not matter which OS thread we are on. - // All that matters is that we confine all UI operations - // to the thread that created the respective window. - runtime.LockOSThread() - - if err := initCommon(); err != nil { - return err - } - - if err := initScreenWindow(); err != nil { - return err - } - defer func() { - // TODO(andlabs): log an error if this fails? - _DestroyWindow(screenHWND) - // TODO(andlabs): unregister window class - }() - - if err := initWindowClass(); err != nil { - return err - } - - // Prime the pump. - mainCallback = f - _PostMessage(screenHWND, msgMainCallback, 0, 0) - - // Main message pump. - var m _MSG - for { - done, err := _GetMessage(&m, 0, 0, 0) - if err != nil { - return fmt.Errorf("win32 GetMessage failed: %v", err) - } - if done == 0 { // WM_QUIT - break - } - _TranslateMessage(&m) - _DispatchMessage(&m) - } - - return nil -} diff --git a/vendor/golang.org/x/exp/shiny/driver/internal/win32/zsyscall_windows.go b/vendor/golang.org/x/exp/shiny/driver/internal/win32/zsyscall_windows.go deleted file mode 100644 index 1759c01..0000000 --- a/vendor/golang.org/x/exp/shiny/driver/internal/win32/zsyscall_windows.go +++ /dev/null @@ -1,286 +0,0 @@ -// MACHINE GENERATED BY 'go generate' COMMAND; DO NOT EDIT - -package win32 - -import ( - "syscall" - "unsafe" - - "golang.org/x/sys/windows" -) - -var _ unsafe.Pointer - -// Do the interface allocations only once for common -// Errno values. -const ( - errnoERROR_IO_PENDING = 997 -) - -var ( - errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING) -) - -// errnoErr returns common boxed Errno values, to prevent -// allocations at runtime. -func errnoErr(e syscall.Errno) error { - switch e { - case 0: - return nil - case errnoERROR_IO_PENDING: - return errERROR_IO_PENDING - } - // TODO: add more here, after collecting data on the common - // error values see on Windows. (perhaps when running - // all.bat?) - return e -} - -var ( - moduser32 = windows.NewLazySystemDLL("user32.dll") - - procGetDC = moduser32.NewProc("GetDC") - procReleaseDC = moduser32.NewProc("ReleaseDC") - procSendMessageW = moduser32.NewProc("SendMessageW") - procCreateWindowExW = moduser32.NewProc("CreateWindowExW") - procDefWindowProcW = moduser32.NewProc("DefWindowProcW") - procDestroyWindow = moduser32.NewProc("DestroyWindow") - procDispatchMessageW = moduser32.NewProc("DispatchMessageW") - procGetClientRect = moduser32.NewProc("GetClientRect") - procGetWindowRect = moduser32.NewProc("GetWindowRect") - procGetKeyboardLayout = moduser32.NewProc("GetKeyboardLayout") - procGetKeyboardState = moduser32.NewProc("GetKeyboardState") - procGetKeyState = moduser32.NewProc("GetKeyState") - procGetMessageW = moduser32.NewProc("GetMessageW") - procLoadCursorW = moduser32.NewProc("LoadCursorW") - procLoadIconW = moduser32.NewProc("LoadIconW") - procMoveWindow = moduser32.NewProc("MoveWindow") - procPostMessageW = moduser32.NewProc("PostMessageW") - procPostQuitMessage = moduser32.NewProc("PostQuitMessage") - procRegisterClassW = moduser32.NewProc("RegisterClassW") - procShowWindow = moduser32.NewProc("ShowWindow") - procScreenToClient = moduser32.NewProc("ScreenToClient") - procToUnicodeEx = moduser32.NewProc("ToUnicodeEx") - procTranslateMessage = moduser32.NewProc("TranslateMessage") -) - -func GetDC(hwnd syscall.Handle) (dc syscall.Handle, err error) { - r0, _, e1 := syscall.Syscall(procGetDC.Addr(), 1, uintptr(hwnd), 0, 0) - dc = syscall.Handle(r0) - if dc == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func ReleaseDC(hwnd syscall.Handle, dc syscall.Handle) (err error) { - r1, _, e1 := syscall.Syscall(procReleaseDC.Addr(), 2, uintptr(hwnd), uintptr(dc), 0) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func sendMessage(hwnd syscall.Handle, uMsg uint32, wParam uintptr, lParam uintptr) (lResult uintptr) { - r0, _, _ := syscall.Syscall6(procSendMessageW.Addr(), 4, uintptr(hwnd), uintptr(uMsg), uintptr(wParam), uintptr(lParam), 0, 0) - lResult = uintptr(r0) - return -} - -func _CreateWindowEx(exstyle uint32, className *uint16, windowText *uint16, style uint32, x int32, y int32, width int32, height int32, parent syscall.Handle, menu syscall.Handle, hInstance syscall.Handle, lpParam uintptr) (hwnd syscall.Handle, err error) { - r0, _, e1 := syscall.Syscall12(procCreateWindowExW.Addr(), 12, uintptr(exstyle), uintptr(unsafe.Pointer(className)), uintptr(unsafe.Pointer(windowText)), uintptr(style), uintptr(x), uintptr(y), uintptr(width), uintptr(height), uintptr(parent), uintptr(menu), uintptr(hInstance), uintptr(lpParam)) - hwnd = syscall.Handle(r0) - if hwnd == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func _DefWindowProc(hwnd syscall.Handle, uMsg uint32, wParam uintptr, lParam uintptr) (lResult uintptr) { - r0, _, _ := syscall.Syscall6(procDefWindowProcW.Addr(), 4, uintptr(hwnd), uintptr(uMsg), uintptr(wParam), uintptr(lParam), 0, 0) - lResult = uintptr(r0) - return -} - -func _DestroyWindow(hwnd syscall.Handle) (err error) { - r1, _, e1 := syscall.Syscall(procDestroyWindow.Addr(), 1, uintptr(hwnd), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func _DispatchMessage(msg *_MSG) (ret int32) { - r0, _, _ := syscall.Syscall(procDispatchMessageW.Addr(), 1, uintptr(unsafe.Pointer(msg)), 0, 0) - ret = int32(r0) - return -} - -func _GetClientRect(hwnd syscall.Handle, rect *_RECT) (err error) { - r1, _, e1 := syscall.Syscall(procGetClientRect.Addr(), 2, uintptr(hwnd), uintptr(unsafe.Pointer(rect)), 0) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func _GetWindowRect(hwnd syscall.Handle, rect *_RECT) (err error) { - r1, _, e1 := syscall.Syscall(procGetWindowRect.Addr(), 2, uintptr(hwnd), uintptr(unsafe.Pointer(rect)), 0) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func _GetKeyboardLayout(threadID uint32) (locale syscall.Handle) { - r0, _, _ := syscall.Syscall(procGetKeyboardLayout.Addr(), 1, uintptr(threadID), 0, 0) - locale = syscall.Handle(r0) - return -} - -func _GetKeyboardState(lpKeyState *byte) (err error) { - r1, _, e1 := syscall.Syscall(procGetKeyboardState.Addr(), 1, uintptr(unsafe.Pointer(lpKeyState)), 0, 0) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func _GetKeyState(virtkey int32) (keystatus int16) { - r0, _, _ := syscall.Syscall(procGetKeyState.Addr(), 1, uintptr(virtkey), 0, 0) - keystatus = int16(r0) - return -} - -func _GetMessage(msg *_MSG, hwnd syscall.Handle, msgfiltermin uint32, msgfiltermax uint32) (ret int32, err error) { - r0, _, e1 := syscall.Syscall6(procGetMessageW.Addr(), 4, uintptr(unsafe.Pointer(msg)), uintptr(hwnd), uintptr(msgfiltermin), uintptr(msgfiltermax), 0, 0) - ret = int32(r0) - if ret == -1 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func _LoadCursor(hInstance syscall.Handle, cursorName uintptr) (cursor syscall.Handle, err error) { - r0, _, e1 := syscall.Syscall(procLoadCursorW.Addr(), 2, uintptr(hInstance), uintptr(cursorName), 0) - cursor = syscall.Handle(r0) - if cursor == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func _LoadIcon(hInstance syscall.Handle, iconName uintptr) (icon syscall.Handle, err error) { - r0, _, e1 := syscall.Syscall(procLoadIconW.Addr(), 2, uintptr(hInstance), uintptr(iconName), 0) - icon = syscall.Handle(r0) - if icon == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func _MoveWindow(hwnd syscall.Handle, x int32, y int32, w int32, h int32, repaint bool) (err error) { - var _p0 uint32 - if repaint { - _p0 = 1 - } else { - _p0 = 0 - } - r1, _, e1 := syscall.Syscall6(procMoveWindow.Addr(), 6, uintptr(hwnd), uintptr(x), uintptr(y), uintptr(w), uintptr(h), uintptr(_p0)) - if r1 == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func _PostMessage(hwnd syscall.Handle, uMsg uint32, wParam uintptr, lParam uintptr) (lResult bool) { - r0, _, _ := syscall.Syscall6(procPostMessageW.Addr(), 4, uintptr(hwnd), uintptr(uMsg), uintptr(wParam), uintptr(lParam), 0, 0) - lResult = r0 != 0 - return -} - -func _PostQuitMessage(exitCode int32) { - syscall.Syscall(procPostQuitMessage.Addr(), 1, uintptr(exitCode), 0, 0) - return -} - -func _RegisterClass(wc *_WNDCLASS) (atom uint16, err error) { - r0, _, e1 := syscall.Syscall(procRegisterClassW.Addr(), 1, uintptr(unsafe.Pointer(wc)), 0, 0) - atom = uint16(r0) - if atom == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func _ShowWindow(hwnd syscall.Handle, cmdshow int32) (wasvisible bool) { - r0, _, _ := syscall.Syscall(procShowWindow.Addr(), 2, uintptr(hwnd), uintptr(cmdshow), 0) - wasvisible = r0 != 0 - return -} - -func _ScreenToClient(hwnd syscall.Handle, lpPoint *_POINT) (ok bool) { - r0, _, _ := syscall.Syscall(procScreenToClient.Addr(), 2, uintptr(hwnd), uintptr(unsafe.Pointer(lpPoint)), 0) - ok = r0 != 0 - return -} - -func _ToUnicodeEx(wVirtKey uint32, wScanCode uint32, lpKeyState *byte, pwszBuff *uint16, cchBuff int32, wFlags uint32, dwhkl syscall.Handle) (ret int32) { - r0, _, _ := syscall.Syscall9(procToUnicodeEx.Addr(), 7, uintptr(wVirtKey), uintptr(wScanCode), uintptr(unsafe.Pointer(lpKeyState)), uintptr(unsafe.Pointer(pwszBuff)), uintptr(cchBuff), uintptr(wFlags), uintptr(dwhkl), 0, 0) - ret = int32(r0) - return -} - -func _TranslateMessage(msg *_MSG) (done bool) { - r0, _, _ := syscall.Syscall(procTranslateMessage.Addr(), 1, uintptr(unsafe.Pointer(msg)), 0, 0) - done = r0 != 0 - return -} diff --git a/vendor/golang.org/x/exp/shiny/driver/internal/x11key/x11key.go b/vendor/golang.org/x/exp/shiny/driver/internal/x11key/x11key.go deleted file mode 100644 index 5fa39b6..0000000 --- a/vendor/golang.org/x/exp/shiny/driver/internal/x11key/x11key.go +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// x11key contains X11 numeric codes for the keyboard and mouse. -package x11key // import "golang.org/x/exp/shiny/driver/internal/x11key" - -import ( - "golang.org/x/mobile/event/key" -) - -// These constants come from /usr/include/X11/X.h -const ( - ShiftMask = 1 << 0 - LockMask = 1 << 1 - ControlMask = 1 << 2 - Mod1Mask = 1 << 3 - Mod2Mask = 1 << 4 - Mod3Mask = 1 << 5 - Mod4Mask = 1 << 6 - Mod5Mask = 1 << 7 - Button1Mask = 1 << 8 - Button2Mask = 1 << 9 - Button3Mask = 1 << 10 - Button4Mask = 1 << 11 - Button5Mask = 1 << 12 -) - -type KeysymTable [256][2]uint32 - -func (t *KeysymTable) Lookup(detail uint8, state uint16) (rune, key.Code) { - // The key event's rune depends on whether the shift key is down. - unshifted := rune(t[detail][0]) - r := unshifted - if state&ShiftMask != 0 { - r = rune(t[detail][1]) - // In X11, a zero keysym when shift is down means to use what the - // keysym is when shift is up. - if r == 0 { - r = unshifted - } - } - - // The key event's code is independent of whether the shift key is down. - var c key.Code - if 0 <= unshifted && unshifted < 0x80 { - // TODO: distinguish the regular '2' key and number-pad '2' key (with - // Num-Lock). - c = asciiKeycodes[unshifted] - } else { - r, c = -1, nonUnicodeKeycodes[unshifted] - } - - // TODO: Unicode-but-not-ASCII keysyms like the Swiss keyboard's 'ö'. - return r, c -} - -func KeyModifiers(state uint16) (m key.Modifiers) { - if state&ShiftMask != 0 { - m |= key.ModShift - } - if state&ControlMask != 0 { - m |= key.ModControl - } - if state&Mod1Mask != 0 { - m |= key.ModAlt - } - if state&Mod4Mask != 0 { - m |= key.ModMeta - } - return m -} - -// These constants come from /usr/include/X11/{keysymdef,XF86keysym}.h -const ( - xkISOLeftTab = 0xfe20 - xkBackSpace = 0xff08 - xkTab = 0xff09 - xkReturn = 0xff0d - xkEscape = 0xff1b - xkMultiKey = 0xff20 - xkHome = 0xff50 - xkLeft = 0xff51 - xkUp = 0xff52 - xkRight = 0xff53 - xkDown = 0xff54 - xkPageUp = 0xff55 - xkPageDown = 0xff56 - xkEnd = 0xff57 - xkInsert = 0xff63 - xkMenu = 0xff67 - xkF1 = 0xffbe - xkF2 = 0xffbf - xkF3 = 0xffc0 - xkF4 = 0xffc1 - xkF5 = 0xffc2 - xkF6 = 0xffc3 - xkF7 = 0xffc4 - xkF8 = 0xffc5 - xkF9 = 0xffc6 - xkF10 = 0xffc7 - xkF11 = 0xffc8 - xkF12 = 0xffc9 - xkShiftL = 0xffe1 - xkShiftR = 0xffe2 - xkControlL = 0xffe3 - xkControlR = 0xffe4 - xkAltL = 0xffe9 - xkAltR = 0xffea - xkSuperL = 0xffeb - xkSuperR = 0xffec - xkDelete = 0xffff - - xf86xkAudioLowerVolume = 0x1008ff11 - xf86xkAudioMute = 0x1008ff12 - xf86xkAudioRaiseVolume = 0x1008ff13 -) - -// nonUnicodeKeycodes maps from those xproto.Keysym values (converted to runes) -// that do not correspond to a Unicode code point, such as "Page Up", "F1" or -// "Left Shift", to key.Code values. -var nonUnicodeKeycodes = map[rune]key.Code{ - xkISOLeftTab: key.CodeTab, - xkBackSpace: key.CodeDeleteBackspace, - xkTab: key.CodeTab, - xkReturn: key.CodeReturnEnter, - xkEscape: key.CodeEscape, - xkHome: key.CodeHome, - xkLeft: key.CodeLeftArrow, - xkUp: key.CodeUpArrow, - xkRight: key.CodeRightArrow, - xkDown: key.CodeDownArrow, - xkPageUp: key.CodePageUp, - xkPageDown: key.CodePageDown, - xkEnd: key.CodeEnd, - xkInsert: key.CodeInsert, - xkMenu: key.CodeRightGUI, // TODO: CodeRightGUI or CodeMenu?? - xkMultiKey: key.CodeCompose, - - xkF1: key.CodeF1, - xkF2: key.CodeF2, - xkF3: key.CodeF3, - xkF4: key.CodeF4, - xkF5: key.CodeF5, - xkF6: key.CodeF6, - xkF7: key.CodeF7, - xkF8: key.CodeF8, - xkF9: key.CodeF9, - xkF10: key.CodeF10, - xkF11: key.CodeF11, - xkF12: key.CodeF12, - - xkShiftL: key.CodeLeftShift, - xkShiftR: key.CodeRightShift, - xkControlL: key.CodeLeftControl, - xkControlR: key.CodeRightControl, - xkAltL: key.CodeLeftAlt, - xkAltR: key.CodeRightAlt, - xkSuperL: key.CodeLeftGUI, - xkSuperR: key.CodeRightGUI, - - xkDelete: key.CodeDeleteForward, - - xf86xkAudioRaiseVolume: key.CodeVolumeUp, - xf86xkAudioLowerVolume: key.CodeVolumeDown, - xf86xkAudioMute: key.CodeMute, -} - -// asciiKeycodes maps lower-case ASCII runes to key.Code values. -var asciiKeycodes = [0x80]key.Code{ - 'a': key.CodeA, - 'b': key.CodeB, - 'c': key.CodeC, - 'd': key.CodeD, - 'e': key.CodeE, - 'f': key.CodeF, - 'g': key.CodeG, - 'h': key.CodeH, - 'i': key.CodeI, - 'j': key.CodeJ, - 'k': key.CodeK, - 'l': key.CodeL, - 'm': key.CodeM, - 'n': key.CodeN, - 'o': key.CodeO, - 'p': key.CodeP, - 'q': key.CodeQ, - 'r': key.CodeR, - 's': key.CodeS, - 't': key.CodeT, - 'u': key.CodeU, - 'v': key.CodeV, - 'w': key.CodeW, - 'x': key.CodeX, - 'y': key.CodeY, - 'z': key.CodeZ, - - '1': key.Code1, - '2': key.Code2, - '3': key.Code3, - '4': key.Code4, - '5': key.Code5, - '6': key.Code6, - '7': key.Code7, - '8': key.Code8, - '9': key.Code9, - '0': key.Code0, - - ' ': key.CodeSpacebar, - '-': key.CodeHyphenMinus, - '=': key.CodeEqualSign, - '[': key.CodeLeftSquareBracket, - ']': key.CodeRightSquareBracket, - '\\': key.CodeBackslash, - ';': key.CodeSemicolon, - '\'': key.CodeApostrophe, - '`': key.CodeGraveAccent, - ',': key.CodeComma, - '.': key.CodeFullStop, - '/': key.CodeSlash, - - // TODO: distinguish CodeKeypadSlash vs CodeSlash, and similarly for other - // keypad codes. -} diff --git a/vendor/golang.org/x/exp/shiny/screen/screen.go b/vendor/golang.org/x/exp/shiny/screen/screen.go deleted file mode 100644 index 5d89fe8..0000000 --- a/vendor/golang.org/x/exp/shiny/screen/screen.go +++ /dev/null @@ -1,354 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package screen provides interfaces for portable two-dimensional graphics and -// input events. -// -// Screens are not created directly. Instead, driver packages provide access to -// the screen through a Main function that is designed to be called by the -// program's main function. The golang.org/x/exp/shiny/driver package provides -// the default driver for the system, such as the X11 driver for desktop Linux, -// but other drivers, such as the OpenGL driver, can be explicitly invoked by -// calling that driver's Main function. To use the default driver: -// -// package main -// -// import ( -// "golang.org/x/exp/shiny/driver" -// "golang.org/x/exp/shiny/screen" -// "golang.org/x/mobile/event/lifecycle" -// ) -// -// func main() { -// driver.Main(func(s screen.Screen) { -// w, err := s.NewWindow(nil) -// if err != nil { -// handleError(err) -// return -// } -// defer w.Release() -// -// for { -// switch e := w.NextEvent().(type) { -// case lifecycle.Event: -// if e.To == lifecycle.StageDead { -// return -// } -// etc -// case etc: -// etc -// } -// } -// }) -// } -// -// Complete examples can be found in the shiny/example directory. -// -// Each driver package provides Screen, Buffer, Texture and Window -// implementations that work together. Such types are interface types because -// this package is driver-independent, but those interfaces aren't expected to -// be implemented outside of drivers. For example, a driver's Window -// implementation will generally work only with that driver's Buffer -// implementation, and will not work with an arbitrary type that happens to -// implement the Buffer methods. -package screen // import "golang.org/x/exp/shiny/screen" - -import ( - "image" - "image/color" - "image/draw" - "unicode/utf8" - - "golang.org/x/image/math/f64" -) - -// TODO: specify image format (Alpha or Gray, not just RGBA) for NewBuffer -// and/or NewTexture? - -// Screen creates Buffers, Textures and Windows. -type Screen interface { - // NewBuffer returns a new Buffer for this screen. - NewBuffer(size image.Point) (Buffer, error) - - // NewTexture returns a new Texture for this screen. - NewTexture(size image.Point) (Texture, error) - - // NewWindow returns a new Window for this screen. - // - // A nil opts is valid and means to use the default option values. - NewWindow(opts *NewWindowOptions) (Window, error) -} - -// TODO: rename Buffer to Image, to be less confusing with a Window's back and -// front buffers. - -// Buffer is an in-memory pixel buffer. Its pixels can be modified by any Go -// code that takes an *image.RGBA, such as the standard library's image/draw -// package. A Buffer is essentially an *image.RGBA, but not all *image.RGBA -// values (including those returned by image.NewRGBA) are valid Buffers, as a -// driver may assume that the memory backing a Buffer's pixels are specially -// allocated. -// -// To see a Buffer's contents on a screen, upload it to a Texture (and then -// draw the Texture on a Window) or upload it directly to a Window. -// -// When specifying a sub-Buffer via Upload, a Buffer's top-left pixel is always -// (0, 0) in its own coordinate space. -type Buffer interface { - // Release releases the Buffer's resources, after all pending uploads and - // draws resolve. - // - // The behavior of the Buffer after Release, whether calling its methods or - // passing it as an argument, is undefined. - Release() - - // Size returns the size of the Buffer's image. - Size() image.Point - - // Bounds returns the bounds of the Buffer's image. It is equal to - // image.Rectangle{Max: b.Size()}. - Bounds() image.Rectangle - - // RGBA returns the pixel buffer as an *image.RGBA. - // - // Its contents should not be accessed while the Buffer is uploading. - // - // The contents of the returned *image.RGBA's Pix field (of type []byte) - // can be modified at other times, but that Pix slice itself (i.e. its - // underlying pointer, length and capacity) should not be modified at any - // time. - // - // The following is valid: - // m := buffer.RGBA() - // if len(m.Pix) >= 4 { - // m.Pix[0] = 0xff - // m.Pix[1] = 0x00 - // m.Pix[2] = 0x00 - // m.Pix[3] = 0xff - // } - // or, equivalently: - // m := buffer.RGBA() - // m.SetRGBA(m.Rect.Min.X, m.Rect.Min.Y, color.RGBA{0xff, 0x00, 0x00, 0xff}) - // and using the standard library's image/draw package is also valid: - // dst := buffer.RGBA() - // draw.Draw(dst, dst.Bounds(), etc) - // but the following is invalid: - // m := buffer.RGBA() - // m.Pix = anotherByteSlice - // and so is this: - // *buffer.RGBA() = anotherImageRGBA - RGBA() *image.RGBA -} - -// Texture is a pixel buffer, but not one that is directly accessible as a -// []byte. Conceptually, it could live on a GPU, in another process or even be -// across a network, instead of on a CPU in this process. -// -// Buffers can be uploaded to Textures, and Textures can be drawn on Windows. -// -// When specifying a sub-Texture via Draw, a Texture's top-left pixel is always -// (0, 0) in its own coordinate space. -type Texture interface { - // Release releases the Texture's resources, after all pending uploads and - // draws resolve. - // - // The behavior of the Texture after Release, whether calling its methods - // or passing it as an argument, is undefined. - Release() - - // Size returns the size of the Texture's image. - Size() image.Point - - // Bounds returns the bounds of the Texture's image. It is equal to - // image.Rectangle{Max: t.Size()}. - Bounds() image.Rectangle - - Uploader - - // TODO: also implement Drawer? If so, merge the Uploader and Drawer - // interfaces?? -} - -// EventDeque is an infinitely buffered double-ended queue of events. -type EventDeque interface { - // Send adds an event to the end of the deque. They are returned by - // NextEvent in FIFO order. - Send(event interface{}) - - // SendFirst adds an event to the start of the deque. They are returned by - // NextEvent in LIFO order, and have priority over events sent via Send. - SendFirst(event interface{}) - - // NextEvent returns the next event in the deque. It blocks until such an - // event has been sent. - // - // Typical event types include: - // - lifecycle.Event - // - size.Event - // - paint.Event - // - key.Event - // - mouse.Event - // - touch.Event - // from the golang.org/x/mobile/event/... packages. Other packages may send - // events, of those types above or of other types, via Send or SendFirst. - NextEvent() interface{} - - // TODO: LatestLifecycleEvent? Is that still worth it if the - // lifecycle.Event struct type loses its DrawContext field? - - // TODO: LatestSizeEvent? -} - -// Window is a top-level, double-buffered GUI window. -type Window interface { - // Release closes the window. - // - // The behavior of the Window after Release, whether calling its methods or - // passing it as an argument, is undefined. - Release() - - EventDeque - - Uploader - - Drawer - - // Publish flushes any pending Upload and Draw calls to the window, and - // swaps the back buffer to the front. - Publish() PublishResult -} - -// PublishResult is the result of an Window.Publish call. -type PublishResult struct { - // BackBufferPreserved is whether the contents of the back buffer was - // preserved. If false, the contents are undefined. - BackBufferPreserved bool -} - -// NewWindowOptions are optional arguments to NewWindow. -type NewWindowOptions struct { - // Width and Height specify the dimensions of the new window. If Width - // or Height are zero, a driver-dependent default will be used for each - // zero value dimension. - Width, Height int - - // Title specifies the window title. - Title string - - // TODO: fullscreen, icon, cursorHidden? -} - -// GetTitle returns a sanitized form of o.Title. In particular, its length will -// not exceed 4096, and it may be further truncated so that it is valid UTF-8 -// and will not contain the NUL byte. -// -// o may be nil, in which case "" is returned. -func (o *NewWindowOptions) GetTitle() string { - if o == nil { - return "" - } - return sanitizeUTF8(o.Title, 4096) -} - -func sanitizeUTF8(s string, n int) string { - if n < len(s) { - s = s[:n] - } - i := 0 - for i < len(s) { - r, n := utf8.DecodeRuneInString(s[i:]) - if r == 0 || (r == utf8.RuneError && n == 1) { - break - } - i += n - } - return s[:i] -} - -// Uploader is something you can upload a Buffer to. -type Uploader interface { - // Upload uploads the sub-Buffer defined by src and sr to the destination - // (the method receiver), such that sr.Min in src-space aligns with dp in - // dst-space. The destination's contents are overwritten; the draw operator - // is implicitly draw.Src. - // - // It is valid to upload a Buffer while another upload of the same Buffer - // is in progress, but a Buffer's image.RGBA pixel contents should not be - // accessed while it is uploading. A Buffer is re-usable, in that its pixel - // contents can be further modified, once all outstanding calls to Upload - // have returned. - // - // TODO: make it optional that a Buffer's contents is preserved after - // Upload? Undoing a swizzle is a non-trivial amount of work, and can be - // redundant if the next paint cycle starts by clearing the buffer. - // - // When uploading to a Window, there will not be any visible effect until - // Publish is called. - Upload(dp image.Point, src Buffer, sr image.Rectangle) - - // Fill fills that part of the destination (the method receiver) defined by - // dr with the given color. - // - // When filling a Window, there will not be any visible effect until - // Publish is called. - Fill(dr image.Rectangle, src color.Color, op draw.Op) -} - -// TODO: have a Downloader interface? Not every graphical app needs to be -// interactive or involve a window. You could use the GPU for hardware- -// accelerated image manipulation: upload a buffer, do some texture ops, then -// download the result. - -// Drawer is something you can draw Textures on. -// -// Draw is the most general purpose of this interface's methods. It supports -// arbitrary affine transformations, such as translations, scales and -// rotations. -// -// Copy and Scale are more specific versions of Draw. The affected dst pixels -// are an axis-aligned rectangle, quantized to the pixel grid. Copy copies -// pixels in a 1:1 manner, Scale is more general. They have simpler parameters -// than Draw, using ints instead of float64s. -// -// When drawing on a Window, there will not be any visible effect until Publish -// is called. -type Drawer interface { - // Draw draws the sub-Texture defined by src and sr to the destination (the - // method receiver). src2dst defines how to transform src coordinates to - // dst coordinates. For example, if src2dst is the matrix - // - // m00 m01 m02 - // m10 m11 m12 - // - // then the src-space point (sx, sy) maps to the dst-space point - // (m00*sx + m01*sy + m02, m10*sx + m11*sy + m12). - Draw(src2dst f64.Aff3, src Texture, sr image.Rectangle, op draw.Op, opts *DrawOptions) - - // DrawUniform is like Draw except that the src is a uniform color instead - // of a Texture. - DrawUniform(src2dst f64.Aff3, src color.Color, sr image.Rectangle, op draw.Op, opts *DrawOptions) - - // Copy copies the sub-Texture defined by src and sr to the destination - // (the method receiver), such that sr.Min in src-space aligns with dp in - // dst-space. - Copy(dp image.Point, src Texture, sr image.Rectangle, op draw.Op, opts *DrawOptions) - - // Scale scales the sub-Texture defined by src and sr to the destination - // (the method receiver), such that sr in src-space is mapped to dr in - // dst-space. - Scale(dr image.Rectangle, src Texture, sr image.Rectangle, op draw.Op, opts *DrawOptions) -} - -// These draw.Op constants are provided so that users of this package don't -// have to explicitly import "image/draw". -const ( - Over = draw.Over - Src = draw.Src -) - -// DrawOptions are optional arguments to Draw. -type DrawOptions struct { - // TODO: transparency in [0x0000, 0xffff]? - // TODO: scaler (nearest neighbor vs linear)? -} diff --git a/vendor/golang.org/x/image/AUTHORS b/vendor/golang.org/x/image/AUTHORS deleted file mode 100644 index 15167cd..0000000 --- a/vendor/golang.org/x/image/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code refers to The Go Authors for copyright purposes. -# The master list of authors is in the main Go distribution, -# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/golang.org/x/image/CONTRIBUTORS b/vendor/golang.org/x/image/CONTRIBUTORS deleted file mode 100644 index 1c4577e..0000000 --- a/vendor/golang.org/x/image/CONTRIBUTORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code was written by the Go contributors. -# The master list of contributors is in the main Go distribution, -# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/golang.org/x/image/LICENSE b/vendor/golang.org/x/image/LICENSE deleted file mode 100644 index 6a66aea..0000000 --- a/vendor/golang.org/x/image/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/image/PATENTS b/vendor/golang.org/x/image/PATENTS deleted file mode 100644 index 7330990..0000000 --- a/vendor/golang.org/x/image/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Go project. - -Google hereby grants to You a perpetual, worldwide, non-exclusive, -no-charge, royalty-free, irrevocable (except as stated in this section) -patent license to make, have made, use, offer to sell, sell, import, -transfer and otherwise run, modify and propagate the contents of this -implementation of Go, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of Go. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of Go or any code incorporated within this -implementation of Go constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of Go -shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/image/math/f64/f64.go b/vendor/golang.org/x/image/math/f64/f64.go deleted file mode 100644 index a1f7fc0..0000000 --- a/vendor/golang.org/x/image/math/f64/f64.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package f64 implements float64 vector and matrix types. -package f64 // import "golang.org/x/image/math/f64" - -// Vec2 is a 2-element vector. -type Vec2 [2]float64 - -// Vec3 is a 3-element vector. -type Vec3 [3]float64 - -// Vec4 is a 4-element vector. -type Vec4 [4]float64 - -// Mat3 is a 3x3 matrix in row major order. -// -// m[3*r + c] is the element in the r'th row and c'th column. -type Mat3 [9]float64 - -// Mat4 is a 4x4 matrix in row major order. -// -// m[4*r + c] is the element in the r'th row and c'th column. -type Mat4 [16]float64 - -// Aff3 is a 3x3 affine transformation matrix in row major order, where the -// bottom row is implicitly [0 0 1]. -// -// m[3*r + c] is the element in the r'th row and c'th column. -type Aff3 [6]float64 - -// Aff4 is a 4x4 affine transformation matrix in row major order, where the -// bottom row is implicitly [0 0 0 1]. -// -// m[4*r + c] is the element in the r'th row and c'th column. -type Aff4 [12]float64 diff --git a/vendor/golang.org/x/mobile/AUTHORS b/vendor/golang.org/x/mobile/AUTHORS deleted file mode 100644 index 15167cd..0000000 --- a/vendor/golang.org/x/mobile/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code refers to The Go Authors for copyright purposes. -# The master list of authors is in the main Go distribution, -# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/golang.org/x/mobile/CONTRIBUTORS b/vendor/golang.org/x/mobile/CONTRIBUTORS deleted file mode 100644 index 1c4577e..0000000 --- a/vendor/golang.org/x/mobile/CONTRIBUTORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code was written by the Go contributors. -# The master list of contributors is in the main Go distribution, -# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/golang.org/x/mobile/LICENSE b/vendor/golang.org/x/mobile/LICENSE deleted file mode 100644 index 6a66aea..0000000 --- a/vendor/golang.org/x/mobile/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/mobile/PATENTS b/vendor/golang.org/x/mobile/PATENTS deleted file mode 100644 index 7330990..0000000 --- a/vendor/golang.org/x/mobile/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Go project. - -Google hereby grants to You a perpetual, worldwide, non-exclusive, -no-charge, royalty-free, irrevocable (except as stated in this section) -patent license to make, have made, use, offer to sell, sell, import, -transfer and otherwise run, modify and propagate the contents of this -implementation of Go, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of Go. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of Go or any code incorporated within this -implementation of Go constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of Go -shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/mobile/app/GoNativeActivity.java b/vendor/golang.org/x/mobile/app/GoNativeActivity.java deleted file mode 100644 index 7017853..0000000 --- a/vendor/golang.org/x/mobile/app/GoNativeActivity.java +++ /dev/null @@ -1,67 +0,0 @@ -package org.golang.app; - -import android.app.Activity; -import android.app.NativeActivity; -import android.content.Context; -import android.content.pm.ActivityInfo; -import android.content.pm.PackageManager; -import android.os.Bundle; -import android.util.Log; -import android.view.KeyCharacterMap; - -public class GoNativeActivity extends NativeActivity { - private static GoNativeActivity goNativeActivity; - - public GoNativeActivity() { - super(); - goNativeActivity = this; - } - - String getTmpdir() { - return getCacheDir().getAbsolutePath(); - } - - int getRune(int deviceId, int keyCode, int metaState) { - try { - int rune = KeyCharacterMap.load(deviceId).get(keyCode, metaState); - if (rune == 0) { - return -1; - } - return rune; - } catch (KeyCharacterMap.UnavailableException e) { - return -1; - } catch (Exception e) { - Log.e("Go", "exception reading KeyCharacterMap", e); - return -1; - } - } - - private void load() { - // Interestingly, NativeActivity uses a different method - // to find native code to execute, avoiding - // System.loadLibrary. The result is Java methods - // implemented in C with JNIEXPORT (and JNI_OnLoad) are not - // available unless an explicit call to System.loadLibrary - // is done. So we do it here, borrowing the name of the - // library from the same AndroidManifest.xml metadata used - // by NativeActivity. - try { - ActivityInfo ai = getPackageManager().getActivityInfo( - getIntent().getComponent(), PackageManager.GET_META_DATA); - if (ai.metaData == null) { - Log.e("Go", "loadLibrary: no manifest metadata found"); - return; - } - String libName = ai.metaData.getString("android.app.lib_name"); - System.loadLibrary(libName); - } catch (Exception e) { - Log.e("Go", "loadLibrary failed", e); - } - } - - @Override - public void onCreate(Bundle savedInstanceState) { - load(); - super.onCreate(savedInstanceState); - } -} diff --git a/vendor/golang.org/x/mobile/app/android.c b/vendor/golang.org/x/mobile/app/android.c deleted file mode 100644 index bde2592..0000000 --- a/vendor/golang.org/x/mobile/app/android.c +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build android - -#include -#include -#include -#include -#include -#include -#include "_cgo_export.h" - -#define LOG_INFO(...) __android_log_print(ANDROID_LOG_INFO, "Go", __VA_ARGS__) -#define LOG_FATAL(...) __android_log_print(ANDROID_LOG_FATAL, "Go", __VA_ARGS__) - -static jobject current_ctx; - -static jclass find_class(JNIEnv *env, const char *class_name) { - jclass clazz = (*env)->FindClass(env, class_name); - if (clazz == NULL) { - (*env)->ExceptionClear(env); - LOG_FATAL("cannot find %s", class_name); - return NULL; - } - return clazz; -} - -static jmethodID find_method(JNIEnv *env, jclass clazz, const char *name, const char *sig) { - jmethodID m = (*env)->GetMethodID(env, clazz, name, sig); - if (m == 0) { - (*env)->ExceptionClear(env); - LOG_FATAL("cannot find method %s %s", name, sig); - return 0; - } - return m; -} - -static jmethodID key_rune_method; - -jint JNI_OnLoad(JavaVM* vm, void* reserved) { - JNIEnv* env; - if ((*vm)->GetEnv(vm, (void**)&env, JNI_VERSION_1_6) != JNI_OK) { - return -1; - } - - return JNI_VERSION_1_6; -} - -static int main_running = 0; - -// Entry point from our subclassed NativeActivity. -// -// By here, the Go runtime has been initialized (as we are running in -// -buildmode=c-shared) but the first time it is called, Go's main.main -// hasn't been called yet. -// -// The Activity may be created and destroyed multiple times throughout -// the life of a single process. Each time, onCreate is called. -void ANativeActivity_onCreate(ANativeActivity *activity, void* savedState, size_t savedStateSize) { - if (!main_running) { - JNIEnv* env = activity->env; - - // Note that activity->clazz is mis-named. - current_ctx = activity->clazz; - - jclass clazz = (*env)->GetObjectClass(env, current_ctx); - key_rune_method = find_method(env, clazz, "getRune", "(III)I"); - - setCurrentContext(activity->vm, (*env)->NewGlobalRef(env, current_ctx)); - - // Set TMPDIR. - jmethodID gettmpdir = find_method(env, clazz, "getTmpdir", "()Ljava/lang/String;"); - jstring jpath = (jstring)(*env)->CallObjectMethod(env, current_ctx, gettmpdir, NULL); - const char* tmpdir = (*env)->GetStringUTFChars(env, jpath, NULL); - if (setenv("TMPDIR", tmpdir, 1) != 0) { - LOG_INFO("setenv(\"TMPDIR\", \"%s\", 1) failed: %d", tmpdir, errno); - } - (*env)->ReleaseStringUTFChars(env, jpath, tmpdir); - - // Call the Go main.main. - uintptr_t mainPC = (uintptr_t)dlsym(RTLD_DEFAULT, "main.main"); - if (!mainPC) { - LOG_FATAL("missing main.main"); - } - callMain(mainPC); - main_running = 1; - } - - // These functions match the methods on Activity, described at - // http://developer.android.com/reference/android/app/Activity.html - // - // Note that onNativeWindowResized is not called on resize. Avoid it. - // https://code.google.com/p/android/issues/detail?id=180645 - activity->callbacks->onStart = onStart; - activity->callbacks->onResume = onResume; - activity->callbacks->onSaveInstanceState = onSaveInstanceState; - activity->callbacks->onPause = onPause; - activity->callbacks->onStop = onStop; - activity->callbacks->onDestroy = onDestroy; - activity->callbacks->onWindowFocusChanged = onWindowFocusChanged; - activity->callbacks->onNativeWindowCreated = onNativeWindowCreated; - activity->callbacks->onNativeWindowRedrawNeeded = onNativeWindowRedrawNeeded; - activity->callbacks->onNativeWindowDestroyed = onNativeWindowDestroyed; - activity->callbacks->onInputQueueCreated = onInputQueueCreated; - activity->callbacks->onInputQueueDestroyed = onInputQueueDestroyed; - activity->callbacks->onConfigurationChanged = onConfigurationChanged; - activity->callbacks->onLowMemory = onLowMemory; - - onCreate(activity); -} - -// TODO(crawshaw): Test configuration on more devices. -static const EGLint RGB_888[] = { - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_BLUE_SIZE, 8, - EGL_GREEN_SIZE, 8, - EGL_RED_SIZE, 8, - EGL_DEPTH_SIZE, 16, - EGL_CONFIG_CAVEAT, EGL_NONE, - EGL_NONE -}; - -EGLDisplay display = NULL; -EGLSurface surface = NULL; - -static char* initEGLDisplay() { - display = eglGetDisplay(EGL_DEFAULT_DISPLAY); - if (!eglInitialize(display, 0, 0)) { - return "EGL initialize failed"; - } - return NULL; -} - -char* createEGLSurface(ANativeWindow* window) { - char* err; - EGLint numConfigs, format; - EGLConfig config; - EGLContext context; - - if (display == 0) { - if ((err = initEGLDisplay()) != NULL) { - return err; - } - } - - if (!eglChooseConfig(display, RGB_888, &config, 1, &numConfigs)) { - return "EGL choose RGB_888 config failed"; - } - if (numConfigs <= 0) { - return "EGL no config found"; - } - - eglGetConfigAttrib(display, config, EGL_NATIVE_VISUAL_ID, &format); - if (ANativeWindow_setBuffersGeometry(window, 0, 0, format) != 0) { - return "EGL set buffers geometry failed"; - } - - surface = eglCreateWindowSurface(display, config, window, NULL); - if (surface == EGL_NO_SURFACE) { - return "EGL create surface failed"; - } - - const EGLint contextAttribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE }; - context = eglCreateContext(display, config, EGL_NO_CONTEXT, contextAttribs); - - if (eglMakeCurrent(display, surface, surface, context) == EGL_FALSE) { - return "eglMakeCurrent failed"; - } - return NULL; -} - -char* destroyEGLSurface() { - if (!eglDestroySurface(display, surface)) { - return "EGL destroy surface failed"; - } - return NULL; -} - -int32_t getKeyRune(JNIEnv* env, AInputEvent* e) { - return (int32_t)(*env)->CallIntMethod( - env, - current_ctx, - key_rune_method, - AInputEvent_getDeviceId(e), - AKeyEvent_getKeyCode(e), - AKeyEvent_getMetaState(e) - ); -} diff --git a/vendor/golang.org/x/mobile/app/android.go b/vendor/golang.org/x/mobile/app/android.go deleted file mode 100644 index b6402e0..0000000 --- a/vendor/golang.org/x/mobile/app/android.go +++ /dev/null @@ -1,819 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build android - -/* -Android Apps are built with -buildmode=c-shared. They are loaded by a -running Java process. - -Before any entry point is reached, a global constructor initializes the -Go runtime, calling all Go init functions. All cgo calls will block -until this is complete. Next JNI_OnLoad is called. When that is -complete, one of two entry points is called. - -All-Go apps built using NativeActivity enter at ANativeActivity_onCreate. - -Go libraries (for example, those built with gomobile bind) do not use -the app package initialization. -*/ - -package app - -/* -#cgo LDFLAGS: -landroid -llog -lEGL -lGLESv2 - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -EGLDisplay display; -EGLSurface surface; - -char* createEGLSurface(ANativeWindow* window); -char* destroyEGLSurface(); -int32_t getKeyRune(JNIEnv* env, AInputEvent* e); -*/ -import "C" -import ( - "fmt" - "log" - "os" - "time" - "unsafe" - - "golang.org/x/mobile/app/internal/callfn" - "golang.org/x/mobile/event/key" - "golang.org/x/mobile/event/lifecycle" - "golang.org/x/mobile/event/paint" - "golang.org/x/mobile/event/size" - "golang.org/x/mobile/event/touch" - "golang.org/x/mobile/geom" - "golang.org/x/mobile/internal/mobileinit" -) - -// RunOnJVM runs fn on a new goroutine locked to an OS thread with a JNIEnv. -// -// RunOnJVM blocks until the call to fn is complete. Any Java -// exception or failure to attach to the JVM is returned as an error. -// -// The function fn takes vm, the current JavaVM*, -// env, the current JNIEnv*, and -// ctx, a jobject representing the global android.context.Context. -func RunOnJVM(fn func(vm, jniEnv, ctx uintptr) error) error { - return mobileinit.RunOnJVM(fn) -} - -//export setCurrentContext -func setCurrentContext(vm *C.JavaVM, ctx C.jobject) { - mobileinit.SetCurrentContext(unsafe.Pointer(vm), uintptr(ctx)) -} - -//export callMain -func callMain(mainPC uintptr) { - for _, name := range []string{"TMPDIR", "PATH", "LD_LIBRARY_PATH"} { - n := C.CString(name) - os.Setenv(name, C.GoString(C.getenv(n))) - C.free(unsafe.Pointer(n)) - } - - // Set timezone. - // - // Note that Android zoneinfo is stored in /system/usr/share/zoneinfo, - // but it is in some kind of packed TZiff file that we do not support - // yet. As a stopgap, we build a fixed zone using the tm_zone name. - var curtime C.time_t - var curtm C.struct_tm - C.time(&curtime) - C.localtime_r(&curtime, &curtm) - tzOffset := int(curtm.tm_gmtoff) - tz := C.GoString(curtm.tm_zone) - time.Local = time.FixedZone(tz, tzOffset) - - go callfn.CallFn(mainPC) -} - -//export onStart -func onStart(activity *C.ANativeActivity) { -} - -//export onResume -func onResume(activity *C.ANativeActivity) { -} - -//export onSaveInstanceState -func onSaveInstanceState(activity *C.ANativeActivity, outSize *C.size_t) unsafe.Pointer { - return nil -} - -//export onPause -func onPause(activity *C.ANativeActivity) { -} - -//export onStop -func onStop(activity *C.ANativeActivity) { -} - -//export onCreate -func onCreate(activity *C.ANativeActivity) { - // Set the initial configuration. - // - // Note we use unbuffered channels to talk to the activity loop, and - // NativeActivity calls these callbacks sequentially, so configuration - // will be set before <-windowRedrawNeeded is processed. - windowConfigChange <- windowConfigRead(activity) -} - -//export onDestroy -func onDestroy(activity *C.ANativeActivity) { -} - -//export onWindowFocusChanged -func onWindowFocusChanged(activity *C.ANativeActivity, hasFocus int) { -} - -//export onNativeWindowCreated -func onNativeWindowCreated(activity *C.ANativeActivity, window *C.ANativeWindow) { -} - -//export onNativeWindowRedrawNeeded -func onNativeWindowRedrawNeeded(activity *C.ANativeActivity, window *C.ANativeWindow) { - // Called on orientation change and window resize. - // Send a request for redraw, and block this function - // until a complete draw and buffer swap is completed. - // This is required by the redraw documentation to - // avoid bad draws. - windowRedrawNeeded <- window - <-windowRedrawDone -} - -//export onNativeWindowDestroyed -func onNativeWindowDestroyed(activity *C.ANativeActivity, window *C.ANativeWindow) { - windowDestroyed <- window -} - -//export onInputQueueCreated -func onInputQueueCreated(activity *C.ANativeActivity, q *C.AInputQueue) { - inputQueue <- q - <-inputQueueDone -} - -//export onInputQueueDestroyed -func onInputQueueDestroyed(activity *C.ANativeActivity, q *C.AInputQueue) { - inputQueue <- nil - <-inputQueueDone -} - -//export onContentRectChanged -func onContentRectChanged(activity *C.ANativeActivity, rect *C.ARect) { -} - -type windowConfig struct { - orientation size.Orientation - pixelsPerPt float32 -} - -func windowConfigRead(activity *C.ANativeActivity) windowConfig { - aconfig := C.AConfiguration_new() - C.AConfiguration_fromAssetManager(aconfig, activity.assetManager) - orient := C.AConfiguration_getOrientation(aconfig) - density := C.AConfiguration_getDensity(aconfig) - C.AConfiguration_delete(aconfig) - - // Calculate the screen resolution. This value is approximate. For example, - // a physical resolution of 200 DPI may be quantized to one of the - // ACONFIGURATION_DENSITY_XXX values such as 160 or 240. - // - // A more accurate DPI could possibly be calculated from - // https://developer.android.com/reference/android/util/DisplayMetrics.html#xdpi - // but this does not appear to be accessible via the NDK. In any case, the - // hardware might not even provide a more accurate number, as the system - // does not apparently use the reported value. See golang.org/issue/13366 - // for a discussion. - var dpi int - switch density { - case C.ACONFIGURATION_DENSITY_DEFAULT: - dpi = 160 - case C.ACONFIGURATION_DENSITY_LOW, - C.ACONFIGURATION_DENSITY_MEDIUM, - 213, // C.ACONFIGURATION_DENSITY_TV - C.ACONFIGURATION_DENSITY_HIGH, - 320, // ACONFIGURATION_DENSITY_XHIGH - 480, // ACONFIGURATION_DENSITY_XXHIGH - 640: // ACONFIGURATION_DENSITY_XXXHIGH - dpi = int(density) - case C.ACONFIGURATION_DENSITY_NONE: - log.Print("android device reports no screen density") - dpi = 72 - default: - log.Printf("android device reports unknown density: %d", density) - // All we can do is guess. - if density > 0 { - dpi = int(density) - } else { - dpi = 72 - } - } - - o := size.OrientationUnknown - switch orient { - case C.ACONFIGURATION_ORIENTATION_PORT: - o = size.OrientationPortrait - case C.ACONFIGURATION_ORIENTATION_LAND: - o = size.OrientationLandscape - } - - return windowConfig{ - orientation: o, - pixelsPerPt: float32(dpi) / 72, - } -} - -//export onConfigurationChanged -func onConfigurationChanged(activity *C.ANativeActivity) { - // A rotation event first triggers onConfigurationChanged, then - // calls onNativeWindowRedrawNeeded. We extract the orientation - // here and save it for the redraw event. - windowConfigChange <- windowConfigRead(activity) -} - -//export onLowMemory -func onLowMemory(activity *C.ANativeActivity) { -} - -var ( - inputQueue = make(chan *C.AInputQueue) - inputQueueDone = make(chan struct{}) - windowDestroyed = make(chan *C.ANativeWindow) - windowRedrawNeeded = make(chan *C.ANativeWindow) - windowRedrawDone = make(chan struct{}) - windowConfigChange = make(chan windowConfig) -) - -func init() { - theApp.registerGLViewportFilter() -} - -func main(f func(App)) { - mainUserFn = f - // TODO: merge the runInputQueue and mainUI functions? - go func() { - if err := mobileinit.RunOnJVM(runInputQueue); err != nil { - log.Fatalf("app: %v", err) - } - }() - // Preserve this OS thread for: - // 1. the attached JNI thread - // 2. the GL context - if err := mobileinit.RunOnJVM(mainUI); err != nil { - log.Fatalf("app: %v", err) - } -} - -var mainUserFn func(App) - -func mainUI(vm, jniEnv, ctx uintptr) error { - workAvailable := theApp.worker.WorkAvailable() - - donec := make(chan struct{}) - go func() { - mainUserFn(theApp) - close(donec) - }() - - var pixelsPerPt float32 - var orientation size.Orientation - - for { - select { - case <-donec: - return nil - case cfg := <-windowConfigChange: - pixelsPerPt = cfg.pixelsPerPt - orientation = cfg.orientation - case w := <-windowRedrawNeeded: - if C.surface == nil { - if errStr := C.createEGLSurface(w); errStr != nil { - return fmt.Errorf("%s (%s)", C.GoString(errStr), eglGetError()) - } - } - theApp.sendLifecycle(lifecycle.StageFocused) - widthPx := int(C.ANativeWindow_getWidth(w)) - heightPx := int(C.ANativeWindow_getHeight(w)) - theApp.eventsIn <- size.Event{ - WidthPx: widthPx, - HeightPx: heightPx, - WidthPt: geom.Pt(float32(widthPx) / pixelsPerPt), - HeightPt: geom.Pt(float32(heightPx) / pixelsPerPt), - PixelsPerPt: pixelsPerPt, - Orientation: orientation, - } - theApp.eventsIn <- paint.Event{External: true} - case <-windowDestroyed: - if C.surface != nil { - if errStr := C.destroyEGLSurface(); errStr != nil { - return fmt.Errorf("%s (%s)", C.GoString(errStr), eglGetError()) - } - } - C.surface = nil - theApp.sendLifecycle(lifecycle.StageAlive) - case <-workAvailable: - theApp.worker.DoWork() - case <-theApp.publish: - // TODO: compare a generation number to redrawGen for stale paints? - if C.surface != nil { - // eglSwapBuffers blocks until vsync. - if C.eglSwapBuffers(C.display, C.surface) == C.EGL_FALSE { - log.Printf("app: failed to swap buffers (%s)", eglGetError()) - } - } - select { - case windowRedrawDone <- struct{}{}: - default: - } - theApp.publishResult <- PublishResult{} - } - } -} - -func runInputQueue(vm, jniEnv, ctx uintptr) error { - env := (*C.JNIEnv)(unsafe.Pointer(jniEnv)) // not a Go heap pointer - - // Android loopers select on OS file descriptors, not Go channels, so we - // translate the inputQueue channel to an ALooper_wake call. - l := C.ALooper_prepare(C.ALOOPER_PREPARE_ALLOW_NON_CALLBACKS) - pending := make(chan *C.AInputQueue, 1) - go func() { - for q := range inputQueue { - pending <- q - C.ALooper_wake(l) - } - }() - - var q *C.AInputQueue - for { - if C.ALooper_pollAll(-1, nil, nil, nil) == C.ALOOPER_POLL_WAKE { - select { - default: - case p := <-pending: - if q != nil { - processEvents(env, q) - C.AInputQueue_detachLooper(q) - } - q = p - if q != nil { - C.AInputQueue_attachLooper(q, l, 0, nil, nil) - } - inputQueueDone <- struct{}{} - } - } - if q != nil { - processEvents(env, q) - } - } -} - -func processEvents(env *C.JNIEnv, q *C.AInputQueue) { - var e *C.AInputEvent - for C.AInputQueue_getEvent(q, &e) >= 0 { - if C.AInputQueue_preDispatchEvent(q, e) != 0 { - continue - } - processEvent(env, e) - C.AInputQueue_finishEvent(q, e, 0) - } -} - -func processEvent(env *C.JNIEnv, e *C.AInputEvent) { - switch C.AInputEvent_getType(e) { - case C.AINPUT_EVENT_TYPE_KEY: - processKey(env, e) - case C.AINPUT_EVENT_TYPE_MOTION: - // At most one of the events in this batch is an up or down event; get its index and change. - upDownIndex := C.size_t(C.AMotionEvent_getAction(e)&C.AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) >> C.AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT - upDownType := touch.TypeMove - switch C.AMotionEvent_getAction(e) & C.AMOTION_EVENT_ACTION_MASK { - case C.AMOTION_EVENT_ACTION_DOWN, C.AMOTION_EVENT_ACTION_POINTER_DOWN: - upDownType = touch.TypeBegin - case C.AMOTION_EVENT_ACTION_UP, C.AMOTION_EVENT_ACTION_POINTER_UP: - upDownType = touch.TypeEnd - } - - for i, n := C.size_t(0), C.AMotionEvent_getPointerCount(e); i < n; i++ { - t := touch.TypeMove - if i == upDownIndex { - t = upDownType - } - theApp.eventsIn <- touch.Event{ - X: float32(C.AMotionEvent_getX(e, i)), - Y: float32(C.AMotionEvent_getY(e, i)), - Sequence: touch.Sequence(C.AMotionEvent_getPointerId(e, i)), - Type: t, - } - } - default: - log.Printf("unknown input event, type=%d", C.AInputEvent_getType(e)) - } -} - -func processKey(env *C.JNIEnv, e *C.AInputEvent) { - deviceID := C.AInputEvent_getDeviceId(e) - if deviceID == 0 { - // Software keyboard input, leaving for scribe/IME. - return - } - - k := key.Event{ - Rune: rune(C.getKeyRune(env, e)), - Code: convAndroidKeyCode(int32(C.AKeyEvent_getKeyCode(e))), - } - switch C.AKeyEvent_getAction(e) { - case C.AKEY_STATE_DOWN: - k.Direction = key.DirPress - case C.AKEY_STATE_UP: - k.Direction = key.DirRelease - default: - k.Direction = key.DirNone - } - // TODO(crawshaw): set Modifiers. - theApp.eventsIn <- k -} - -func eglGetError() string { - switch errNum := C.eglGetError(); errNum { - case C.EGL_SUCCESS: - return "EGL_SUCCESS" - case C.EGL_NOT_INITIALIZED: - return "EGL_NOT_INITIALIZED" - case C.EGL_BAD_ACCESS: - return "EGL_BAD_ACCESS" - case C.EGL_BAD_ALLOC: - return "EGL_BAD_ALLOC" - case C.EGL_BAD_ATTRIBUTE: - return "EGL_BAD_ATTRIBUTE" - case C.EGL_BAD_CONTEXT: - return "EGL_BAD_CONTEXT" - case C.EGL_BAD_CONFIG: - return "EGL_BAD_CONFIG" - case C.EGL_BAD_CURRENT_SURFACE: - return "EGL_BAD_CURRENT_SURFACE" - case C.EGL_BAD_DISPLAY: - return "EGL_BAD_DISPLAY" - case C.EGL_BAD_SURFACE: - return "EGL_BAD_SURFACE" - case C.EGL_BAD_MATCH: - return "EGL_BAD_MATCH" - case C.EGL_BAD_PARAMETER: - return "EGL_BAD_PARAMETER" - case C.EGL_BAD_NATIVE_PIXMAP: - return "EGL_BAD_NATIVE_PIXMAP" - case C.EGL_BAD_NATIVE_WINDOW: - return "EGL_BAD_NATIVE_WINDOW" - case C.EGL_CONTEXT_LOST: - return "EGL_CONTEXT_LOST" - default: - return fmt.Sprintf("Unknown EGL err: %d", errNum) - } -} - -func convAndroidKeyCode(aKeyCode int32) key.Code { - // Many Android key codes do not map into USB HID codes. - // For those, key.CodeUnknown is returned. This switch has all - // cases, even the unknown ones, to serve as a documentation - // and search aid. - switch aKeyCode { - case C.AKEYCODE_UNKNOWN: - case C.AKEYCODE_SOFT_LEFT: - case C.AKEYCODE_SOFT_RIGHT: - case C.AKEYCODE_HOME: - return key.CodeHome - case C.AKEYCODE_BACK: - case C.AKEYCODE_CALL: - case C.AKEYCODE_ENDCALL: - case C.AKEYCODE_0: - return key.Code0 - case C.AKEYCODE_1: - return key.Code1 - case C.AKEYCODE_2: - return key.Code2 - case C.AKEYCODE_3: - return key.Code3 - case C.AKEYCODE_4: - return key.Code4 - case C.AKEYCODE_5: - return key.Code5 - case C.AKEYCODE_6: - return key.Code6 - case C.AKEYCODE_7: - return key.Code7 - case C.AKEYCODE_8: - return key.Code8 - case C.AKEYCODE_9: - return key.Code9 - case C.AKEYCODE_STAR: - case C.AKEYCODE_POUND: - case C.AKEYCODE_DPAD_UP: - case C.AKEYCODE_DPAD_DOWN: - case C.AKEYCODE_DPAD_LEFT: - case C.AKEYCODE_DPAD_RIGHT: - case C.AKEYCODE_DPAD_CENTER: - case C.AKEYCODE_VOLUME_UP: - return key.CodeVolumeUp - case C.AKEYCODE_VOLUME_DOWN: - return key.CodeVolumeDown - case C.AKEYCODE_POWER: - case C.AKEYCODE_CAMERA: - case C.AKEYCODE_CLEAR: - case C.AKEYCODE_A: - return key.CodeA - case C.AKEYCODE_B: - return key.CodeB - case C.AKEYCODE_C: - return key.CodeC - case C.AKEYCODE_D: - return key.CodeD - case C.AKEYCODE_E: - return key.CodeE - case C.AKEYCODE_F: - return key.CodeF - case C.AKEYCODE_G: - return key.CodeG - case C.AKEYCODE_H: - return key.CodeH - case C.AKEYCODE_I: - return key.CodeI - case C.AKEYCODE_J: - return key.CodeJ - case C.AKEYCODE_K: - return key.CodeK - case C.AKEYCODE_L: - return key.CodeL - case C.AKEYCODE_M: - return key.CodeM - case C.AKEYCODE_N: - return key.CodeN - case C.AKEYCODE_O: - return key.CodeO - case C.AKEYCODE_P: - return key.CodeP - case C.AKEYCODE_Q: - return key.CodeQ - case C.AKEYCODE_R: - return key.CodeR - case C.AKEYCODE_S: - return key.CodeS - case C.AKEYCODE_T: - return key.CodeT - case C.AKEYCODE_U: - return key.CodeU - case C.AKEYCODE_V: - return key.CodeV - case C.AKEYCODE_W: - return key.CodeW - case C.AKEYCODE_X: - return key.CodeX - case C.AKEYCODE_Y: - return key.CodeY - case C.AKEYCODE_Z: - return key.CodeZ - case C.AKEYCODE_COMMA: - return key.CodeComma - case C.AKEYCODE_PERIOD: - return key.CodeFullStop - case C.AKEYCODE_ALT_LEFT: - return key.CodeLeftAlt - case C.AKEYCODE_ALT_RIGHT: - return key.CodeRightAlt - case C.AKEYCODE_SHIFT_LEFT: - return key.CodeLeftShift - case C.AKEYCODE_SHIFT_RIGHT: - return key.CodeRightShift - case C.AKEYCODE_TAB: - return key.CodeTab - case C.AKEYCODE_SPACE: - return key.CodeSpacebar - case C.AKEYCODE_SYM: - case C.AKEYCODE_EXPLORER: - case C.AKEYCODE_ENVELOPE: - case C.AKEYCODE_ENTER: - return key.CodeReturnEnter - case C.AKEYCODE_DEL: - return key.CodeDeleteBackspace - case C.AKEYCODE_GRAVE: - return key.CodeGraveAccent - case C.AKEYCODE_MINUS: - return key.CodeHyphenMinus - case C.AKEYCODE_EQUALS: - return key.CodeEqualSign - case C.AKEYCODE_LEFT_BRACKET: - return key.CodeLeftSquareBracket - case C.AKEYCODE_RIGHT_BRACKET: - return key.CodeRightSquareBracket - case C.AKEYCODE_BACKSLASH: - return key.CodeBackslash - case C.AKEYCODE_SEMICOLON: - return key.CodeSemicolon - case C.AKEYCODE_APOSTROPHE: - return key.CodeApostrophe - case C.AKEYCODE_SLASH: - return key.CodeSlash - case C.AKEYCODE_AT: - case C.AKEYCODE_NUM: - case C.AKEYCODE_HEADSETHOOK: - case C.AKEYCODE_FOCUS: - case C.AKEYCODE_PLUS: - case C.AKEYCODE_MENU: - case C.AKEYCODE_NOTIFICATION: - case C.AKEYCODE_SEARCH: - case C.AKEYCODE_MEDIA_PLAY_PAUSE: - case C.AKEYCODE_MEDIA_STOP: - case C.AKEYCODE_MEDIA_NEXT: - case C.AKEYCODE_MEDIA_PREVIOUS: - case C.AKEYCODE_MEDIA_REWIND: - case C.AKEYCODE_MEDIA_FAST_FORWARD: - case C.AKEYCODE_MUTE: - case C.AKEYCODE_PAGE_UP: - return key.CodePageUp - case C.AKEYCODE_PAGE_DOWN: - return key.CodePageDown - case C.AKEYCODE_PICTSYMBOLS: - case C.AKEYCODE_SWITCH_CHARSET: - case C.AKEYCODE_BUTTON_A: - case C.AKEYCODE_BUTTON_B: - case C.AKEYCODE_BUTTON_C: - case C.AKEYCODE_BUTTON_X: - case C.AKEYCODE_BUTTON_Y: - case C.AKEYCODE_BUTTON_Z: - case C.AKEYCODE_BUTTON_L1: - case C.AKEYCODE_BUTTON_R1: - case C.AKEYCODE_BUTTON_L2: - case C.AKEYCODE_BUTTON_R2: - case C.AKEYCODE_BUTTON_THUMBL: - case C.AKEYCODE_BUTTON_THUMBR: - case C.AKEYCODE_BUTTON_START: - case C.AKEYCODE_BUTTON_SELECT: - case C.AKEYCODE_BUTTON_MODE: - case C.AKEYCODE_ESCAPE: - return key.CodeEscape - case C.AKEYCODE_FORWARD_DEL: - return key.CodeDeleteForward - case C.AKEYCODE_CTRL_LEFT: - return key.CodeLeftControl - case C.AKEYCODE_CTRL_RIGHT: - return key.CodeRightControl - case C.AKEYCODE_CAPS_LOCK: - return key.CodeCapsLock - case C.AKEYCODE_SCROLL_LOCK: - case C.AKEYCODE_META_LEFT: - return key.CodeLeftGUI - case C.AKEYCODE_META_RIGHT: - return key.CodeRightGUI - case C.AKEYCODE_FUNCTION: - case C.AKEYCODE_SYSRQ: - case C.AKEYCODE_BREAK: - case C.AKEYCODE_MOVE_HOME: - case C.AKEYCODE_MOVE_END: - case C.AKEYCODE_INSERT: - return key.CodeInsert - case C.AKEYCODE_FORWARD: - case C.AKEYCODE_MEDIA_PLAY: - case C.AKEYCODE_MEDIA_PAUSE: - case C.AKEYCODE_MEDIA_CLOSE: - case C.AKEYCODE_MEDIA_EJECT: - case C.AKEYCODE_MEDIA_RECORD: - case C.AKEYCODE_F1: - return key.CodeF1 - case C.AKEYCODE_F2: - return key.CodeF2 - case C.AKEYCODE_F3: - return key.CodeF3 - case C.AKEYCODE_F4: - return key.CodeF4 - case C.AKEYCODE_F5: - return key.CodeF5 - case C.AKEYCODE_F6: - return key.CodeF6 - case C.AKEYCODE_F7: - return key.CodeF7 - case C.AKEYCODE_F8: - return key.CodeF8 - case C.AKEYCODE_F9: - return key.CodeF9 - case C.AKEYCODE_F10: - return key.CodeF10 - case C.AKEYCODE_F11: - return key.CodeF11 - case C.AKEYCODE_F12: - return key.CodeF12 - case C.AKEYCODE_NUM_LOCK: - return key.CodeKeypadNumLock - case C.AKEYCODE_NUMPAD_0: - return key.CodeKeypad0 - case C.AKEYCODE_NUMPAD_1: - return key.CodeKeypad1 - case C.AKEYCODE_NUMPAD_2: - return key.CodeKeypad2 - case C.AKEYCODE_NUMPAD_3: - return key.CodeKeypad3 - case C.AKEYCODE_NUMPAD_4: - return key.CodeKeypad4 - case C.AKEYCODE_NUMPAD_5: - return key.CodeKeypad5 - case C.AKEYCODE_NUMPAD_6: - return key.CodeKeypad6 - case C.AKEYCODE_NUMPAD_7: - return key.CodeKeypad7 - case C.AKEYCODE_NUMPAD_8: - return key.CodeKeypad8 - case C.AKEYCODE_NUMPAD_9: - return key.CodeKeypad9 - case C.AKEYCODE_NUMPAD_DIVIDE: - return key.CodeKeypadSlash - case C.AKEYCODE_NUMPAD_MULTIPLY: - return key.CodeKeypadAsterisk - case C.AKEYCODE_NUMPAD_SUBTRACT: - return key.CodeKeypadHyphenMinus - case C.AKEYCODE_NUMPAD_ADD: - return key.CodeKeypadPlusSign - case C.AKEYCODE_NUMPAD_DOT: - return key.CodeKeypadFullStop - case C.AKEYCODE_NUMPAD_COMMA: - case C.AKEYCODE_NUMPAD_ENTER: - return key.CodeKeypadEnter - case C.AKEYCODE_NUMPAD_EQUALS: - return key.CodeKeypadEqualSign - case C.AKEYCODE_NUMPAD_LEFT_PAREN: - case C.AKEYCODE_NUMPAD_RIGHT_PAREN: - case C.AKEYCODE_VOLUME_MUTE: - return key.CodeMute - case C.AKEYCODE_INFO: - case C.AKEYCODE_CHANNEL_UP: - case C.AKEYCODE_CHANNEL_DOWN: - case C.AKEYCODE_ZOOM_IN: - case C.AKEYCODE_ZOOM_OUT: - case C.AKEYCODE_TV: - case C.AKEYCODE_WINDOW: - case C.AKEYCODE_GUIDE: - case C.AKEYCODE_DVR: - case C.AKEYCODE_BOOKMARK: - case C.AKEYCODE_CAPTIONS: - case C.AKEYCODE_SETTINGS: - case C.AKEYCODE_TV_POWER: - case C.AKEYCODE_TV_INPUT: - case C.AKEYCODE_STB_POWER: - case C.AKEYCODE_STB_INPUT: - case C.AKEYCODE_AVR_POWER: - case C.AKEYCODE_AVR_INPUT: - case C.AKEYCODE_PROG_RED: - case C.AKEYCODE_PROG_GREEN: - case C.AKEYCODE_PROG_YELLOW: - case C.AKEYCODE_PROG_BLUE: - case C.AKEYCODE_APP_SWITCH: - case C.AKEYCODE_BUTTON_1: - case C.AKEYCODE_BUTTON_2: - case C.AKEYCODE_BUTTON_3: - case C.AKEYCODE_BUTTON_4: - case C.AKEYCODE_BUTTON_5: - case C.AKEYCODE_BUTTON_6: - case C.AKEYCODE_BUTTON_7: - case C.AKEYCODE_BUTTON_8: - case C.AKEYCODE_BUTTON_9: - case C.AKEYCODE_BUTTON_10: - case C.AKEYCODE_BUTTON_11: - case C.AKEYCODE_BUTTON_12: - case C.AKEYCODE_BUTTON_13: - case C.AKEYCODE_BUTTON_14: - case C.AKEYCODE_BUTTON_15: - case C.AKEYCODE_BUTTON_16: - case C.AKEYCODE_LANGUAGE_SWITCH: - case C.AKEYCODE_MANNER_MODE: - case C.AKEYCODE_3D_MODE: - case C.AKEYCODE_CONTACTS: - case C.AKEYCODE_CALENDAR: - case C.AKEYCODE_MUSIC: - case C.AKEYCODE_CALCULATOR: - } - /* Defined in an NDK API version beyond what we use today: - C.AKEYCODE_ASSIST - C.AKEYCODE_BRIGHTNESS_DOWN - C.AKEYCODE_BRIGHTNESS_UP - C.AKEYCODE_EISU - C.AKEYCODE_HENKAN - C.AKEYCODE_KANA - C.AKEYCODE_KATAKANA_HIRAGANA - C.AKEYCODE_MEDIA_AUDIO_TRACK - C.AKEYCODE_MUHENKAN - C.AKEYCODE_RO - C.AKEYCODE_YEN - C.AKEYCODE_ZENKAKU_HANKAKU - */ - return key.CodeUnknown -} diff --git a/vendor/golang.org/x/mobile/app/app.go b/vendor/golang.org/x/mobile/app/app.go deleted file mode 100644 index fdcb4d0..0000000 --- a/vendor/golang.org/x/mobile/app/app.go +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build linux darwin windows - -package app - -import ( - "golang.org/x/mobile/event/lifecycle" - "golang.org/x/mobile/event/size" - "golang.org/x/mobile/gl" - _ "golang.org/x/mobile/internal/mobileinit" -) - -// Main is called by the main.main function to run the mobile application. -// -// It calls f on the App, in a separate goroutine, as some OS-specific -// libraries require being on 'the main thread'. -func Main(f func(App)) { - main(f) -} - -// App is how a GUI mobile application interacts with the OS. -type App interface { - // Events returns the events channel. It carries events from the system to - // the app. The type of such events include: - // - lifecycle.Event - // - mouse.Event - // - paint.Event - // - size.Event - // - touch.Event - // from the golang.org/x/mobile/event/etc packages. Other packages may - // define other event types that are carried on this channel. - Events() <-chan interface{} - - // Send sends an event on the events channel. It does not block. - Send(event interface{}) - - // Publish flushes any pending drawing commands, such as OpenGL calls, and - // swaps the back buffer to the screen. - Publish() PublishResult - - // TODO: replace filters (and the Events channel) with a NextEvent method? - - // Filter calls each registered event filter function in sequence. - Filter(event interface{}) interface{} - - // RegisterFilter registers a event filter function to be called by Filter. The - // function can return a different event, or return nil to consume the event, - // but the function can also return its argument unchanged, where its purpose - // is to trigger a side effect rather than modify the event. - RegisterFilter(f func(interface{}) interface{}) -} - -// PublishResult is the result of an App.Publish call. -type PublishResult struct { - // BackBufferPreserved is whether the contents of the back buffer was - // preserved. If false, the contents are undefined. - BackBufferPreserved bool -} - -var theApp = &app{ - eventsOut: make(chan interface{}), - lifecycleStage: lifecycle.StageDead, - publish: make(chan struct{}), - publishResult: make(chan PublishResult), -} - -func init() { - theApp.eventsIn = pump(theApp.eventsOut) - theApp.glctx, theApp.worker = gl.NewContext() -} - -func (a *app) sendLifecycle(to lifecycle.Stage) { - if a.lifecycleStage == to { - return - } - a.eventsIn <- lifecycle.Event{ - From: a.lifecycleStage, - To: to, - DrawContext: a.glctx, - } - a.lifecycleStage = to -} - -type app struct { - filters []func(interface{}) interface{} - - eventsOut chan interface{} - eventsIn chan interface{} - lifecycleStage lifecycle.Stage - publish chan struct{} - publishResult chan PublishResult - - glctx gl.Context - worker gl.Worker -} - -func (a *app) Events() <-chan interface{} { - return a.eventsOut -} - -func (a *app) Send(event interface{}) { - a.eventsIn <- event -} - -func (a *app) Publish() PublishResult { - // gl.Flush is a lightweight (on modern GL drivers) blocking call - // that ensures all GL functions pending in the gl package have - // been passed onto the GL driver before the app package attempts - // to swap the screen buffer. - // - // This enforces that the final receive (for this paint cycle) on - // gl.WorkAvailable happens before the send on endPaint. - a.glctx.Flush() - a.publish <- struct{}{} - return <-a.publishResult -} - -func (a *app) Filter(event interface{}) interface{} { - for _, f := range a.filters { - event = f(event) - } - return event -} - -func (a *app) RegisterFilter(f func(interface{}) interface{}) { - a.filters = append(a.filters, f) -} - -type stopPumping struct{} - -// pump returns a channel src such that sending on src will eventually send on -// dst, in order, but that src will always be ready to send/receive soon, even -// if dst currently isn't. It is effectively an infinitely buffered channel. -// -// In particular, goroutine A sending on src will not deadlock even if goroutine -// B that's responsible for receiving on dst is currently blocked trying to -// send to A on a separate channel. -// -// Send a stopPumping on the src channel to close the dst channel after all queued -// events are sent on dst. After that, other goroutines can still send to src, -// so that such sends won't block forever, but such events will be ignored. -func pump(dst chan interface{}) (src chan interface{}) { - src = make(chan interface{}) - go func() { - // initialSize is the initial size of the circular buffer. It must be a - // power of 2. - const initialSize = 16 - i, j, buf, mask := 0, 0, make([]interface{}, initialSize), initialSize-1 - - maybeSrc := src - for { - maybeDst := dst - if i == j { - maybeDst = nil - } - if maybeDst == nil && maybeSrc == nil { - break - } - - select { - case maybeDst <- buf[i&mask]: - buf[i&mask] = nil - i++ - - case e := <-maybeSrc: - if _, ok := e.(stopPumping); ok { - maybeSrc = nil - continue - } - - // Allocate a bigger buffer if necessary. - if i+len(buf) == j { - b := make([]interface{}, 2*len(buf)) - n := copy(b, buf[j&mask:]) - copy(b[n:], buf[:j&mask]) - i, j = 0, len(buf) - buf, mask = b, len(b)-1 - } - - buf[j&mask] = e - j++ - } - } - - close(dst) - // Block forever. - for range src { - } - }() - return src -} - -// TODO: do this for all build targets, not just linux (x11 and Android)? If -// so, should package gl instead of this package call RegisterFilter?? -// -// TODO: does Android need this?? It seems to work without it (Nexus 7, -// KitKat). If only x11 needs this, should we move this to x11.go?? -func (a *app) registerGLViewportFilter() { - a.RegisterFilter(func(e interface{}) interface{} { - if e, ok := e.(size.Event); ok { - a.glctx.Viewport(0, 0, e.WidthPx, e.HeightPx) - } - return e - }) -} diff --git a/vendor/golang.org/x/mobile/app/darwin_desktop.go b/vendor/golang.org/x/mobile/app/darwin_desktop.go deleted file mode 100644 index ecbc45a..0000000 --- a/vendor/golang.org/x/mobile/app/darwin_desktop.go +++ /dev/null @@ -1,496 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin -// +build !ios - -package app - -// Simple on-screen app debugging for OS X. Not an officially supported -// development target for apps, as screens with mice are very different -// than screens with touch panels. - -/* -#cgo CFLAGS: -x objective-c -#cgo LDFLAGS: -framework Cocoa -framework OpenGL -#import // for HIToolbox/Events.h -#import -#include - -void runApp(void); -void stopApp(void); -void makeCurrentContext(GLintptr); -uint64 threadID(); -*/ -import "C" -import ( - "log" - "runtime" - "sync" - - "golang.org/x/mobile/event/key" - "golang.org/x/mobile/event/lifecycle" - "golang.org/x/mobile/event/paint" - "golang.org/x/mobile/event/size" - "golang.org/x/mobile/event/touch" - "golang.org/x/mobile/geom" -) - -var initThreadID uint64 - -func init() { - // Lock the goroutine responsible for initialization to an OS thread. - // This means the goroutine running main (and calling runApp below) - // is locked to the OS thread that started the program. This is - // necessary for the correct delivery of Cocoa events to the process. - // - // A discussion on this topic: - // https://groups.google.com/forum/#!msg/golang-nuts/IiWZ2hUuLDA/SNKYYZBelsYJ - runtime.LockOSThread() - initThreadID = uint64(C.threadID()) -} - -func main(f func(App)) { - if tid := uint64(C.threadID()); tid != initThreadID { - log.Fatalf("app.Main called on thread %d, but app.init ran on %d", tid, initThreadID) - } - - go func() { - f(theApp) - C.stopApp() - // TODO(crawshaw): trigger runApp to return - }() - - C.runApp() -} - -// loop is the primary drawing loop. -// -// After Cocoa has captured the initial OS thread for processing Cocoa -// events in runApp, it starts loop on another goroutine. It is locked -// to an OS thread for its OpenGL context. -// -// The loop processes GL calls until a publish event appears. -// Then it runs any remaining GL calls and flushes the screen. -// -// As NSOpenGLCPSwapInterval is set to 1, the call to CGLFlushDrawable -// blocks until the screen refresh. -func (a *app) loop(ctx C.GLintptr) { - runtime.LockOSThread() - C.makeCurrentContext(ctx) - - workAvailable := a.worker.WorkAvailable() - - for { - select { - case <-workAvailable: - a.worker.DoWork() - case <-theApp.publish: - loop1: - for { - select { - case <-workAvailable: - a.worker.DoWork() - default: - break loop1 - } - } - C.CGLFlushDrawable(C.CGLGetCurrentContext()) - theApp.publishResult <- PublishResult{} - select { - case drawDone <- struct{}{}: - default: - } - } - } -} - -var drawDone = make(chan struct{}) - -// drawgl is used by Cocoa to occasionally request screen updates. -// -//export drawgl -func drawgl() { - switch theApp.lifecycleStage { - case lifecycle.StageFocused, lifecycle.StageVisible: - theApp.Send(paint.Event{ - External: true, - }) - <-drawDone - } -} - -//export startloop -func startloop(ctx C.GLintptr) { - go theApp.loop(ctx) -} - -var windowHeightPx float32 - -//export setGeom -func setGeom(pixelsPerPt float32, widthPx, heightPx int) { - windowHeightPx = float32(heightPx) - theApp.eventsIn <- size.Event{ - WidthPx: widthPx, - HeightPx: heightPx, - WidthPt: geom.Pt(float32(widthPx) / pixelsPerPt), - HeightPt: geom.Pt(float32(heightPx) / pixelsPerPt), - PixelsPerPt: pixelsPerPt, - } -} - -var touchEvents struct { - sync.Mutex - pending []touch.Event -} - -func sendTouch(t touch.Type, x, y float32) { - theApp.eventsIn <- touch.Event{ - X: x, - Y: windowHeightPx - y, - Sequence: 0, - Type: t, - } -} - -//export eventMouseDown -func eventMouseDown(x, y float32) { sendTouch(touch.TypeBegin, x, y) } - -//export eventMouseDragged -func eventMouseDragged(x, y float32) { sendTouch(touch.TypeMove, x, y) } - -//export eventMouseEnd -func eventMouseEnd(x, y float32) { sendTouch(touch.TypeEnd, x, y) } - -//export lifecycleDead -func lifecycleDead() { theApp.sendLifecycle(lifecycle.StageDead) } - -//export eventKey -func eventKey(runeVal int32, direction uint8, code uint16, flags uint32) { - var modifiers key.Modifiers - for _, mod := range mods { - if flags&mod.flags == mod.flags { - modifiers |= mod.mod - } - } - - theApp.eventsIn <- key.Event{ - Rune: convRune(rune(runeVal)), - Code: convVirtualKeyCode(code), - Modifiers: modifiers, - Direction: key.Direction(direction), - } -} - -//export eventFlags -func eventFlags(flags uint32) { - for _, mod := range mods { - if flags&mod.flags == mod.flags && lastFlags&mod.flags != mod.flags { - eventKey(-1, uint8(key.DirPress), mod.code, flags) - } - if lastFlags&mod.flags == mod.flags && flags&mod.flags != mod.flags { - eventKey(-1, uint8(key.DirRelease), mod.code, flags) - } - } - lastFlags = flags -} - -var lastFlags uint32 - -var mods = [...]struct { - flags uint32 - code uint16 - mod key.Modifiers -}{ - // Left and right variants of modifier keys have their own masks, - // but they are not documented. These were determined empirically. - {1<<17 | 0x102, C.kVK_Shift, key.ModShift}, - {1<<17 | 0x104, C.kVK_RightShift, key.ModShift}, - {1<<18 | 0x101, C.kVK_Control, key.ModControl}, - // TODO key.ControlRight - {1<<19 | 0x120, C.kVK_Option, key.ModAlt}, - {1<<19 | 0x140, C.kVK_RightOption, key.ModAlt}, - {1<<20 | 0x108, C.kVK_Command, key.ModMeta}, - {1<<20 | 0x110, C.kVK_Command, key.ModMeta}, // TODO: missing kVK_RightCommand -} - -//export lifecycleAlive -func lifecycleAlive() { theApp.sendLifecycle(lifecycle.StageAlive) } - -//export lifecycleVisible -func lifecycleVisible() { - theApp.sendLifecycle(lifecycle.StageVisible) -} - -//export lifecycleFocused -func lifecycleFocused() { theApp.sendLifecycle(lifecycle.StageFocused) } - -// convRune marks the Carbon/Cocoa private-range unicode rune representing -// a non-unicode key event to -1, used for Rune in the key package. -// -// http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/CORPCHAR.TXT -func convRune(r rune) rune { - if '\uE000' <= r && r <= '\uF8FF' { - return -1 - } - return r -} - -// convVirtualKeyCode converts a Carbon/Cocoa virtual key code number -// into the standard keycodes used by the key package. -// -// To get a sense of the key map, see the diagram on -// http://boredzo.org/blog/archives/2007-05-22/virtual-key-codes -func convVirtualKeyCode(vkcode uint16) key.Code { - switch vkcode { - case C.kVK_ANSI_A: - return key.CodeA - case C.kVK_ANSI_B: - return key.CodeB - case C.kVK_ANSI_C: - return key.CodeC - case C.kVK_ANSI_D: - return key.CodeD - case C.kVK_ANSI_E: - return key.CodeE - case C.kVK_ANSI_F: - return key.CodeF - case C.kVK_ANSI_G: - return key.CodeG - case C.kVK_ANSI_H: - return key.CodeH - case C.kVK_ANSI_I: - return key.CodeI - case C.kVK_ANSI_J: - return key.CodeJ - case C.kVK_ANSI_K: - return key.CodeK - case C.kVK_ANSI_L: - return key.CodeL - case C.kVK_ANSI_M: - return key.CodeM - case C.kVK_ANSI_N: - return key.CodeN - case C.kVK_ANSI_O: - return key.CodeO - case C.kVK_ANSI_P: - return key.CodeP - case C.kVK_ANSI_Q: - return key.CodeQ - case C.kVK_ANSI_R: - return key.CodeR - case C.kVK_ANSI_S: - return key.CodeS - case C.kVK_ANSI_T: - return key.CodeT - case C.kVK_ANSI_U: - return key.CodeU - case C.kVK_ANSI_V: - return key.CodeV - case C.kVK_ANSI_W: - return key.CodeW - case C.kVK_ANSI_X: - return key.CodeX - case C.kVK_ANSI_Y: - return key.CodeY - case C.kVK_ANSI_Z: - return key.CodeZ - case C.kVK_ANSI_1: - return key.Code1 - case C.kVK_ANSI_2: - return key.Code2 - case C.kVK_ANSI_3: - return key.Code3 - case C.kVK_ANSI_4: - return key.Code4 - case C.kVK_ANSI_5: - return key.Code5 - case C.kVK_ANSI_6: - return key.Code6 - case C.kVK_ANSI_7: - return key.Code7 - case C.kVK_ANSI_8: - return key.Code8 - case C.kVK_ANSI_9: - return key.Code9 - case C.kVK_ANSI_0: - return key.Code0 - // TODO: move the rest of these codes to constants in key.go - // if we are happy with them. - case C.kVK_Return: - return key.CodeReturnEnter - case C.kVK_Escape: - return key.CodeEscape - case C.kVK_Delete: - return key.CodeDeleteBackspace - case C.kVK_Tab: - return key.CodeTab - case C.kVK_Space: - return key.CodeSpacebar - case C.kVK_ANSI_Minus: - return key.CodeHyphenMinus - case C.kVK_ANSI_Equal: - return key.CodeEqualSign - case C.kVK_ANSI_LeftBracket: - return key.CodeLeftSquareBracket - case C.kVK_ANSI_RightBracket: - return key.CodeRightSquareBracket - case C.kVK_ANSI_Backslash: - return key.CodeBackslash - // 50: Keyboard Non-US "#" and ~ - case C.kVK_ANSI_Semicolon: - return key.CodeSemicolon - case C.kVK_ANSI_Quote: - return key.CodeApostrophe - case C.kVK_ANSI_Grave: - return key.CodeGraveAccent - case C.kVK_ANSI_Comma: - return key.CodeComma - case C.kVK_ANSI_Period: - return key.CodeFullStop - case C.kVK_ANSI_Slash: - return key.CodeSlash - case C.kVK_CapsLock: - return key.CodeCapsLock - case C.kVK_F1: - return key.CodeF1 - case C.kVK_F2: - return key.CodeF2 - case C.kVK_F3: - return key.CodeF3 - case C.kVK_F4: - return key.CodeF4 - case C.kVK_F5: - return key.CodeF5 - case C.kVK_F6: - return key.CodeF6 - case C.kVK_F7: - return key.CodeF7 - case C.kVK_F8: - return key.CodeF8 - case C.kVK_F9: - return key.CodeF9 - case C.kVK_F10: - return key.CodeF10 - case C.kVK_F11: - return key.CodeF11 - case C.kVK_F12: - return key.CodeF12 - // 70: PrintScreen - // 71: Scroll Lock - // 72: Pause - // 73: Insert - case C.kVK_Home: - return key.CodeHome - case C.kVK_PageUp: - return key.CodePageUp - case C.kVK_ForwardDelete: - return key.CodeDeleteForward - case C.kVK_End: - return key.CodeEnd - case C.kVK_PageDown: - return key.CodePageDown - case C.kVK_RightArrow: - return key.CodeRightArrow - case C.kVK_LeftArrow: - return key.CodeLeftArrow - case C.kVK_DownArrow: - return key.CodeDownArrow - case C.kVK_UpArrow: - return key.CodeUpArrow - case C.kVK_ANSI_KeypadClear: - return key.CodeKeypadNumLock - case C.kVK_ANSI_KeypadDivide: - return key.CodeKeypadSlash - case C.kVK_ANSI_KeypadMultiply: - return key.CodeKeypadAsterisk - case C.kVK_ANSI_KeypadMinus: - return key.CodeKeypadHyphenMinus - case C.kVK_ANSI_KeypadPlus: - return key.CodeKeypadPlusSign - case C.kVK_ANSI_KeypadEnter: - return key.CodeKeypadEnter - case C.kVK_ANSI_Keypad1: - return key.CodeKeypad1 - case C.kVK_ANSI_Keypad2: - return key.CodeKeypad2 - case C.kVK_ANSI_Keypad3: - return key.CodeKeypad3 - case C.kVK_ANSI_Keypad4: - return key.CodeKeypad4 - case C.kVK_ANSI_Keypad5: - return key.CodeKeypad5 - case C.kVK_ANSI_Keypad6: - return key.CodeKeypad6 - case C.kVK_ANSI_Keypad7: - return key.CodeKeypad7 - case C.kVK_ANSI_Keypad8: - return key.CodeKeypad8 - case C.kVK_ANSI_Keypad9: - return key.CodeKeypad9 - case C.kVK_ANSI_Keypad0: - return key.CodeKeypad0 - case C.kVK_ANSI_KeypadDecimal: - return key.CodeKeypadFullStop - case C.kVK_ANSI_KeypadEquals: - return key.CodeKeypadEqualSign - case C.kVK_F13: - return key.CodeF13 - case C.kVK_F14: - return key.CodeF14 - case C.kVK_F15: - return key.CodeF15 - case C.kVK_F16: - return key.CodeF16 - case C.kVK_F17: - return key.CodeF17 - case C.kVK_F18: - return key.CodeF18 - case C.kVK_F19: - return key.CodeF19 - case C.kVK_F20: - return key.CodeF20 - // 116: Keyboard Execute - case C.kVK_Help: - return key.CodeHelp - // 118: Keyboard Menu - // 119: Keyboard Select - // 120: Keyboard Stop - // 121: Keyboard Again - // 122: Keyboard Undo - // 123: Keyboard Cut - // 124: Keyboard Copy - // 125: Keyboard Paste - // 126: Keyboard Find - case C.kVK_Mute: - return key.CodeMute - case C.kVK_VolumeUp: - return key.CodeVolumeUp - case C.kVK_VolumeDown: - return key.CodeVolumeDown - // 130: Keyboard Locking Caps Lock - // 131: Keyboard Locking Num Lock - // 132: Keyboard Locking Scroll Lock - // 133: Keyboard Comma - // 134: Keyboard Equal Sign - // ...: Bunch of stuff - case C.kVK_Control: - return key.CodeLeftControl - case C.kVK_Shift: - return key.CodeLeftShift - case C.kVK_Option: - return key.CodeLeftAlt - case C.kVK_Command: - return key.CodeLeftGUI - case C.kVK_RightControl: - return key.CodeRightControl - case C.kVK_RightShift: - return key.CodeRightShift - case C.kVK_RightOption: - return key.CodeRightAlt - // TODO key.CodeRightGUI - default: - return key.CodeUnknown - } -} diff --git a/vendor/golang.org/x/mobile/app/darwin_desktop.m b/vendor/golang.org/x/mobile/app/darwin_desktop.m deleted file mode 100644 index b4f2e8d..0000000 --- a/vendor/golang.org/x/mobile/app/darwin_desktop.m +++ /dev/null @@ -1,245 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin -// +build !ios - -#include "_cgo_export.h" -#include -#include - -#import -#import -#import - -void makeCurrentContext(GLintptr context) { - NSOpenGLContext* ctx = (NSOpenGLContext*)context; - [ctx makeCurrentContext]; -} - -uint64 threadID() { - uint64 id; - if (pthread_threadid_np(pthread_self(), &id)) { - abort(); - } - return id; -} - -@interface MobileGLView : NSOpenGLView -{ -} -@end - -@implementation MobileGLView -- (void)prepareOpenGL { - [self setWantsBestResolutionOpenGLSurface:YES]; - GLint swapInt = 1; - [[self openGLContext] setValues:&swapInt forParameter:NSOpenGLCPSwapInterval]; - - // Using attribute arrays in OpenGL 3.3 requires the use of a VBA. - // But VBAs don't exist in ES 2. So we bind a default one. - GLuint vba; - glGenVertexArrays(1, &vba); - glBindVertexArray(vba); - - startloop((GLintptr)[self openGLContext]); -} - -- (void)reshape { - [super reshape]; - - // Calculate screen PPI. - // - // Note that the backingScaleFactor converts from logical - // pixels to actual pixels, but both of these units vary - // independently from real world size. E.g. - // - // 13" Retina Macbook Pro, 2560x1600, 227ppi, backingScaleFactor=2, scale=3.15 - // 15" Retina Macbook Pro, 2880x1800, 220ppi, backingScaleFactor=2, scale=3.06 - // 27" iMac, 2560x1440, 109ppi, backingScaleFactor=1, scale=1.51 - // 27" Retina iMac, 5120x2880, 218ppi, backingScaleFactor=2, scale=3.03 - NSScreen *screen = [NSScreen mainScreen]; - double screenPixW = [screen frame].size.width * [screen backingScaleFactor]; - - CGDirectDisplayID display = (CGDirectDisplayID)[[[screen deviceDescription] valueForKey:@"NSScreenNumber"] intValue]; - CGSize screenSizeMM = CGDisplayScreenSize(display); // in millimeters - float ppi = 25.4 * screenPixW / screenSizeMM.width; - float pixelsPerPt = ppi/72.0; - - // The width and height reported to the geom package are the - // bounds of the OpenGL view. Several steps are necessary. - // First, [self bounds] gives us the number of logical pixels - // in the view. Multiplying this by the backingScaleFactor - // gives us the number of actual pixels. - NSRect r = [self bounds]; - int w = r.size.width * [screen backingScaleFactor]; - int h = r.size.height * [screen backingScaleFactor]; - - setGeom(pixelsPerPt, w, h); -} - -- (void)drawRect:(NSRect)theRect { - // Called during resize. This gets rid of flicker when resizing. - drawgl(); -} - -- (void)mouseDown:(NSEvent *)theEvent { - double scale = [[NSScreen mainScreen] backingScaleFactor]; - NSPoint p = [theEvent locationInWindow]; - eventMouseDown(p.x * scale, p.y * scale); -} - -- (void)mouseUp:(NSEvent *)theEvent { - double scale = [[NSScreen mainScreen] backingScaleFactor]; - NSPoint p = [theEvent locationInWindow]; - eventMouseEnd(p.x * scale, p.y * scale); -} - -- (void)mouseDragged:(NSEvent *)theEvent { - double scale = [[NSScreen mainScreen] backingScaleFactor]; - NSPoint p = [theEvent locationInWindow]; - eventMouseDragged(p.x * scale, p.y * scale); -} - -- (void)windowDidBecomeKey:(NSNotification *)notification { - lifecycleFocused(); -} - -- (void)windowDidResignKey:(NSNotification *)notification { - if (![NSApp isHidden]) { - lifecycleVisible(); - } -} - -- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { - lifecycleAlive(); - [[NSRunningApplication currentApplication] activateWithOptions:(NSApplicationActivateAllWindows | NSApplicationActivateIgnoringOtherApps)]; - [self.window makeKeyAndOrderFront:self]; - lifecycleVisible(); -} - -- (void)applicationWillTerminate:(NSNotification *)aNotification { - lifecycleDead(); -} - -- (void)applicationDidHide:(NSNotification *)aNotification { - lifecycleAlive(); -} - -- (void)applicationWillUnhide:(NSNotification *)notification { - lifecycleVisible(); -} - -- (void)windowWillClose:(NSNotification *)notification { - lifecycleAlive(); -} -@end - -@interface MobileResponder : NSResponder -{ -} -@end - -@implementation MobileResponder -- (void)keyDown:(NSEvent *)theEvent { - [self key:theEvent]; -} -- (void)keyUp:(NSEvent *)theEvent { - [self key:theEvent]; -} -- (void)key:(NSEvent *)theEvent { - NSRange range = [theEvent.characters rangeOfComposedCharacterSequenceAtIndex:0]; - - uint8_t buf[4] = {0, 0, 0, 0}; - if (![theEvent.characters getBytes:buf - maxLength:4 - usedLength:nil - encoding:NSUTF32LittleEndianStringEncoding - options:NSStringEncodingConversionAllowLossy - range:range - remainingRange:nil]) { - NSLog(@"failed to read key event %@", theEvent); - return; - } - - uint32_t rune = (uint32_t)buf[0]<<0 | (uint32_t)buf[1]<<8 | (uint32_t)buf[2]<<16 | (uint32_t)buf[3]<<24; - - uint8_t direction; - if ([theEvent isARepeat]) { - direction = 0; - } else if (theEvent.type == NSKeyDown) { - direction = 1; - } else { - direction = 2; - } - eventKey((int32_t)rune, direction, theEvent.keyCode, theEvent.modifierFlags); -} - -- (void)flagsChanged:(NSEvent *)theEvent { - eventFlags(theEvent.modifierFlags); -} -@end - -void -runApp(void) { - [NSAutoreleasePool new]; - [NSApplication sharedApplication]; - [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; - - id menuBar = [[NSMenu new] autorelease]; - id menuItem = [[NSMenuItem new] autorelease]; - [menuBar addItem:menuItem]; - [NSApp setMainMenu:menuBar]; - - id menu = [[NSMenu new] autorelease]; - id name = [[NSProcessInfo processInfo] processName]; - - id hideMenuItem = [[[NSMenuItem alloc] initWithTitle:@"Hide" - action:@selector(hide:) keyEquivalent:@"h"] - autorelease]; - [menu addItem:hideMenuItem]; - - id quitMenuItem = [[[NSMenuItem alloc] initWithTitle:@"Quit" - action:@selector(terminate:) keyEquivalent:@"q"] - autorelease]; - [menu addItem:quitMenuItem]; - [menuItem setSubmenu:menu]; - - NSRect rect = NSMakeRect(0, 0, 600, 800); - - NSWindow* window = [[[NSWindow alloc] initWithContentRect:rect - styleMask:NSTitledWindowMask - backing:NSBackingStoreBuffered - defer:NO] - autorelease]; - window.styleMask |= NSResizableWindowMask; - window.styleMask |= NSMiniaturizableWindowMask ; - window.styleMask |= NSClosableWindowMask; - window.title = name; - [window cascadeTopLeftFromPoint:NSMakePoint(20,20)]; - - NSOpenGLPixelFormatAttribute attr[] = { - NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core, - NSOpenGLPFAColorSize, 24, - NSOpenGLPFAAlphaSize, 8, - NSOpenGLPFADepthSize, 16, - NSOpenGLPFAAccelerated, - NSOpenGLPFADoubleBuffer, - NSOpenGLPFAAllowOfflineRenderers, - 0 - }; - id pixFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attr]; - MobileGLView* view = [[MobileGLView alloc] initWithFrame:rect pixelFormat:pixFormat]; - [window setContentView:view]; - [window setDelegate:view]; - [NSApp setDelegate:view]; - - window.nextResponder = [[[MobileResponder alloc] init] autorelease]; - - [NSApp run]; -} - -void stopApp(void) { - [NSApp terminate:nil]; -} diff --git a/vendor/golang.org/x/mobile/app/darwin_ios.go b/vendor/golang.org/x/mobile/app/darwin_ios.go deleted file mode 100644 index 935b41b..0000000 --- a/vendor/golang.org/x/mobile/app/darwin_ios.go +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin -// +build ios - -package app - -/* -#cgo CFLAGS: -x objective-c -#cgo LDFLAGS: -framework Foundation -framework UIKit -framework GLKit -framework OpenGLES -framework QuartzCore -#include -#include -#include -#include -#import - -extern struct utsname sysInfo; - -void runApp(void); -void makeCurrentContext(GLintptr ctx); -void swapBuffers(GLintptr ctx); -uint64_t threadID(); -*/ -import "C" -import ( - "log" - "runtime" - "strings" - "sync" - - "golang.org/x/mobile/event/lifecycle" - "golang.org/x/mobile/event/paint" - "golang.org/x/mobile/event/size" - "golang.org/x/mobile/event/touch" - "golang.org/x/mobile/geom" -) - -var initThreadID uint64 - -func init() { - // Lock the goroutine responsible for initialization to an OS thread. - // This means the goroutine running main (and calling the run function - // below) is locked to the OS thread that started the program. This is - // necessary for the correct delivery of UIKit events to the process. - // - // A discussion on this topic: - // https://groups.google.com/forum/#!msg/golang-nuts/IiWZ2hUuLDA/SNKYYZBelsYJ - runtime.LockOSThread() - initThreadID = uint64(C.threadID()) -} - -func main(f func(App)) { - if tid := uint64(C.threadID()); tid != initThreadID { - log.Fatalf("app.Run called on thread %d, but app.init ran on %d", tid, initThreadID) - } - - go func() { - f(theApp) - // TODO(crawshaw): trigger runApp to return - }() - C.runApp() - panic("unexpected return from app.runApp") -} - -var pixelsPerPt float32 -var screenScale int // [UIScreen mainScreen].scale, either 1, 2, or 3. - -//export setScreen -func setScreen(scale int) { - C.uname(&C.sysInfo) - name := C.GoString(&C.sysInfo.machine[0]) - - var v float32 - - switch { - case strings.HasPrefix(name, "iPhone"): - v = 163 - case strings.HasPrefix(name, "iPad"): - // TODO: is there a better way to distinguish the iPad Mini? - switch name { - case "iPad2,5", "iPad2,6", "iPad2,7", "iPad4,4", "iPad4,5", "iPad4,6", "iPad4,7": - v = 163 // iPad Mini - default: - v = 132 - } - default: - v = 163 // names like i386 and x86_64 are the simulator - } - - if v == 0 { - log.Printf("unknown machine: %s", name) - v = 163 // emergency fallback - } - - pixelsPerPt = v * float32(scale) / 72 - screenScale = scale -} - -//export updateConfig -func updateConfig(width, height, orientation int32) { - o := size.OrientationUnknown - switch orientation { - case C.UIDeviceOrientationPortrait, C.UIDeviceOrientationPortraitUpsideDown: - o = size.OrientationPortrait - case C.UIDeviceOrientationLandscapeLeft, C.UIDeviceOrientationLandscapeRight: - o = size.OrientationLandscape - } - widthPx := screenScale * int(width) - heightPx := screenScale * int(height) - theApp.eventsIn <- size.Event{ - WidthPx: widthPx, - HeightPx: heightPx, - WidthPt: geom.Pt(float32(widthPx) / pixelsPerPt), - HeightPt: geom.Pt(float32(heightPx) / pixelsPerPt), - PixelsPerPt: pixelsPerPt, - Orientation: o, - } - theApp.eventsIn <- paint.Event{External: true} -} - -// touchIDs is the current active touches. The position in the array -// is the ID, the value is the UITouch* pointer value. -// -// It is widely reported that the iPhone can handle up to 5 simultaneous -// touch events, while the iPad can handle 11. -var touchIDs [11]uintptr - -var touchEvents struct { - sync.Mutex - pending []touch.Event -} - -//export sendTouch -func sendTouch(cTouch, cTouchType uintptr, x, y float32) { - id := -1 - for i, val := range touchIDs { - if val == cTouch { - id = i - break - } - } - if id == -1 { - for i, val := range touchIDs { - if val == 0 { - touchIDs[i] = cTouch - id = i - break - } - } - if id == -1 { - panic("out of touchIDs") - } - } - - t := touch.Type(cTouchType) - if t == touch.TypeEnd { - touchIDs[id] = 0 - } - - theApp.eventsIn <- touch.Event{ - X: x, - Y: y, - Sequence: touch.Sequence(id), - Type: t, - } -} - -//export lifecycleDead -func lifecycleDead() { theApp.sendLifecycle(lifecycle.StageDead) } - -//export lifecycleAlive -func lifecycleAlive() { theApp.sendLifecycle(lifecycle.StageAlive) } - -//export lifecycleVisible -func lifecycleVisible() { theApp.sendLifecycle(lifecycle.StageVisible) } - -//export lifecycleFocused -func lifecycleFocused() { theApp.sendLifecycle(lifecycle.StageFocused) } - -//export startloop -func startloop(ctx C.GLintptr) { - go theApp.loop(ctx) -} - -// loop is the primary drawing loop. -// -// After UIKit has captured the initial OS thread for processing UIKit -// events in runApp, it starts loop on another goroutine. It is locked -// to an OS thread for its OpenGL context. -func (a *app) loop(ctx C.GLintptr) { - runtime.LockOSThread() - C.makeCurrentContext(ctx) - - workAvailable := a.worker.WorkAvailable() - - for { - select { - case <-workAvailable: - a.worker.DoWork() - case <-theApp.publish: - loop1: - for { - select { - case <-workAvailable: - a.worker.DoWork() - default: - break loop1 - } - } - C.swapBuffers(ctx) - theApp.publishResult <- PublishResult{} - } - } -} diff --git a/vendor/golang.org/x/mobile/app/darwin_ios.m b/vendor/golang.org/x/mobile/app/darwin_ios.m deleted file mode 100644 index 08bb72f..0000000 --- a/vendor/golang.org/x/mobile/app/darwin_ios.m +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin -// +build ios - -#include "_cgo_export.h" -#include -#include -#include - -#import -#import - -struct utsname sysInfo; - -@interface GoAppAppController : GLKViewController -@end - -@interface GoAppAppDelegate : UIResponder -@property (strong, nonatomic) UIWindow *window; -@property (strong, nonatomic) GoAppAppController *controller; -@end - -@implementation GoAppAppDelegate -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - lifecycleAlive(); - self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; - self.controller = [[GoAppAppController alloc] initWithNibName:nil bundle:nil]; - self.window.rootViewController = self.controller; - [self.window makeKeyAndVisible]; - return YES; -} - -- (void)applicationDidBecomeActive:(UIApplication * )application { - lifecycleFocused(); -} - -- (void)applicationWillResignActive:(UIApplication *)application { - lifecycleVisible(); -} - -- (void)applicationDidEnterBackground:(UIApplication *)application { - lifecycleAlive(); -} - -- (void)applicationWillTerminate:(UIApplication *)application { - lifecycleDead(); -} -@end - -@interface GoAppAppController () -@property (strong, nonatomic) EAGLContext *context; -@property (strong, nonatomic) GLKView *glview; -@end - -@implementation GoAppAppController -- (void)viewWillAppear:(BOOL)animated -{ - // TODO: replace by swapping out GLKViewController for a UIVIewController. - [super viewWillAppear:animated]; - self.paused = YES; -} - -- (void)viewDidLoad { - [super viewDidLoad]; - self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; - self.glview = (GLKView*)self.view; - self.glview.drawableDepthFormat = GLKViewDrawableDepthFormat24; - self.glview.multipleTouchEnabled = true; // TODO expose setting to user. - self.glview.context = self.context; - self.glview.userInteractionEnabled = YES; - self.glview.enableSetNeedsDisplay = YES; // only invoked once - - // Do not use the GLKViewController draw loop. - self.paused = YES; - self.resumeOnDidBecomeActive = NO; - self.preferredFramesPerSecond = 0; - - int scale = 1; - if ([[UIScreen mainScreen] respondsToSelector:@selector(displayLinkWithTarget:selector:)]) { - scale = (int)[UIScreen mainScreen].scale; // either 1.0, 2.0, or 3.0. - } - setScreen(scale); - - CGSize size = [UIScreen mainScreen].bounds.size; - UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; - updateConfig((int)size.width, (int)size.height, orientation); -} - -- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator { - [coordinator animateAlongsideTransition:^(id context) { - // TODO(crawshaw): come up with a plan to handle animations. - } completion:^(id context) { - UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; - updateConfig((int)size.width, (int)size.height, orientation); - }]; -} - -- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect { - // Now that we have been asked to do the first draw, disable any - // future draw and hand control over to the Go paint.Event cycle. - self.glview.enableSetNeedsDisplay = NO; - startloop((GLintptr)self.context); -} - -#define TOUCH_TYPE_BEGIN 0 // touch.TypeBegin -#define TOUCH_TYPE_MOVE 1 // touch.TypeMove -#define TOUCH_TYPE_END 2 // touch.TypeEnd - -static void sendTouches(int change, NSSet* touches) { - CGFloat scale = [UIScreen mainScreen].scale; - for (UITouch* touch in touches) { - CGPoint p = [touch locationInView:touch.view]; - sendTouch((GoUintptr)touch, (GoUintptr)change, p.x*scale, p.y*scale); - } -} - -- (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event { - sendTouches(TOUCH_TYPE_BEGIN, touches); -} - -- (void)touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event { - sendTouches(TOUCH_TYPE_MOVE, touches); -} - -- (void)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event { - sendTouches(TOUCH_TYPE_END, touches); -} - -- (void)touchesCanceled:(NSSet*)touches withEvent:(UIEvent*)event { - sendTouches(TOUCH_TYPE_END, touches); -} -@end - -void runApp(void) { - @autoreleasepool { - UIApplicationMain(0, nil, nil, NSStringFromClass([GoAppAppDelegate class])); - } -} - -void makeCurrentContext(GLintptr context) { - EAGLContext* ctx = (EAGLContext*)context; - if (![EAGLContext setCurrentContext:ctx]) { - // TODO(crawshaw): determine how terrible this is. Exit? - NSLog(@"failed to set current context"); - } -} - -void swapBuffers(GLintptr context) { - __block EAGLContext* ctx = (EAGLContext*)context; - dispatch_sync(dispatch_get_main_queue(), ^{ - [EAGLContext setCurrentContext:ctx]; - [ctx presentRenderbuffer:GL_RENDERBUFFER]; - }); -} - -uint64_t threadID() { - uint64_t id; - if (pthread_threadid_np(pthread_self(), &id)) { - abort(); - } - return id; -} diff --git a/vendor/golang.org/x/mobile/app/doc.go b/vendor/golang.org/x/mobile/app/doc.go deleted file mode 100644 index 80e21a0..0000000 --- a/vendor/golang.org/x/mobile/app/doc.go +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -/* -Package app lets you write portable all-Go apps for Android and iOS. - -There are typically two ways to use Go on Android and iOS. The first -is to write a Go library and use `gomobile bind` to generate language -bindings for Java and Objective-C. Building a library does not -require the app package. The `gomobile bind` command produces output -that you can include in an Android Studio or Xcode project. For more -on language bindings, see https://golang.org/x/mobile/cmd/gobind. - -The second way is to write an app entirely in Go. The APIs are limited -to those that are portable between both Android and iOS, in particular -OpenGL, audio, and other Android NDK-like APIs. An all-Go app should -use this app package to initialize the app, manage its lifecycle, and -receive events. - -Building apps - -Apps written entirely in Go have a main function, and can be built -with `gomobile build`, which directly produces runnable output for -Android and iOS. - -The gomobile tool can get installed with go get. For reference, see -https://golang.org/x/mobile/cmd/gomobile. - -For detailed instructions and documentation, see -https://golang.org/wiki/Mobile. - -Event processing in Native Apps - -The Go runtime is initialized on Android when NativeActivity onCreate is -called, and on iOS when the process starts. In both cases, Go init functions -run before the app lifecycle has started. - -An app is expected to call the Main function in main.main. When the function -exits, the app exits. Inside the func passed to Main, call Filter on every -event received, and then switch on its type. Registered filters run when the -event is received, not when it is sent, so that filters run in the same -goroutine as other code that calls OpenGL. - - package main - - import ( - "log" - - "golang.org/x/mobile/app" - "golang.org/x/mobile/event/lifecycle" - "golang.org/x/mobile/event/paint" - ) - - func main() { - app.Main(func(a app.App) { - for e := range a.Events() { - switch e := a.Filter(e).(type) { - case lifecycle.Event: - // ... - case paint.Event: - log.Print("Call OpenGL here.") - a.Publish() - } - } - }) - } - -An event is represented by the empty interface type interface{}. Any value can -be an event. Commonly used types include Event types defined by the following -packages: - - golang.org/x/mobile/event/lifecycle - - golang.org/x/mobile/event/mouse - - golang.org/x/mobile/event/paint - - golang.org/x/mobile/event/size - - golang.org/x/mobile/event/touch -For example, touch.Event is the type that represents touch events. Other -packages may define their own events, and send them on an app's event channel. - -Other packages can also register event filters, e.g. to manage resources in -response to lifecycle events. Such packages should call: - app.RegisterFilter(etc) -in an init function inside that package. -*/ -package app // import "golang.org/x/mobile/app" diff --git a/vendor/golang.org/x/mobile/app/internal/callfn/callfn.go b/vendor/golang.org/x/mobile/app/internal/callfn/callfn.go deleted file mode 100644 index 42dd028..0000000 --- a/vendor/golang.org/x/mobile/app/internal/callfn/callfn.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build android -// +build arm 386 amd64 arm64 - -// Package callfn provides an android entry point. -// -// It is a separate package from app because it contains Go assembly, -// which does not compile in a package using cgo. -package callfn - -// CallFn calls a zero-argument function by its program counter. -// It is only intended for calling main.main. Using it for -// anything else will not end well. -func CallFn(fn uintptr) diff --git a/vendor/golang.org/x/mobile/app/internal/callfn/callfn_386.s b/vendor/golang.org/x/mobile/app/internal/callfn/callfn_386.s deleted file mode 100644 index d2bb54f..0000000 --- a/vendor/golang.org/x/mobile/app/internal/callfn/callfn_386.s +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -#include "textflag.h" -#include "funcdata.h" - -TEXT ·CallFn(SB),$0-4 - MOVL fn+0(FP), AX - CALL AX - RET diff --git a/vendor/golang.org/x/mobile/app/internal/callfn/callfn_amd64.s b/vendor/golang.org/x/mobile/app/internal/callfn/callfn_amd64.s deleted file mode 100644 index 8769604..0000000 --- a/vendor/golang.org/x/mobile/app/internal/callfn/callfn_amd64.s +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -#include "textflag.h" -#include "funcdata.h" - -TEXT ·CallFn(SB),$0-8 - MOVQ fn+0(FP), AX - CALL AX - RET diff --git a/vendor/golang.org/x/mobile/app/internal/callfn/callfn_arm.s b/vendor/golang.org/x/mobile/app/internal/callfn/callfn_arm.s deleted file mode 100644 index d71f748..0000000 --- a/vendor/golang.org/x/mobile/app/internal/callfn/callfn_arm.s +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -#include "textflag.h" -#include "funcdata.h" - -TEXT ·CallFn(SB),$0-4 - MOVW fn+0(FP), R0 - BL (R0) - RET diff --git a/vendor/golang.org/x/mobile/app/internal/callfn/callfn_arm64.s b/vendor/golang.org/x/mobile/app/internal/callfn/callfn_arm64.s deleted file mode 100644 index 545ad50..0000000 --- a/vendor/golang.org/x/mobile/app/internal/callfn/callfn_arm64.s +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -#include "textflag.h" -#include "funcdata.h" - -TEXT ·CallFn(SB),$0-8 - MOVD fn+0(FP), R0 - BL (R0) - RET diff --git a/vendor/golang.org/x/mobile/app/shiny.go b/vendor/golang.org/x/mobile/app/shiny.go deleted file mode 100644 index 3257dfa..0000000 --- a/vendor/golang.org/x/mobile/app/shiny.go +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package app - -import ( - "log" - - "golang.org/x/exp/shiny/driver/gldriver" - "golang.org/x/exp/shiny/screen" - "golang.org/x/mobile/event/lifecycle" - "golang.org/x/mobile/event/mouse" - "golang.org/x/mobile/event/touch" - "golang.org/x/mobile/gl" -) - -func main(f func(a App)) { - gldriver.Main(func(s screen.Screen) { - w, err := s.NewWindow(nil) - if err != nil { - log.Fatal(err) - } - defer w.Release() - - theApp.glctx = nil - theApp.worker = nil // handled by shiny - - go func() { - for range theApp.publish { - res := w.Publish() - theApp.publishResult <- PublishResult{ - BackBufferPreserved: res.BackBufferPreserved, - } - } - }() - - go f(theApp) - - for { - theApp.Send(convertEvent(w.NextEvent())) - } - }) -} - -func convertEvent(e interface{}) interface{} { - switch e := e.(type) { - case lifecycle.Event: - if theApp.glctx == nil { - theApp.glctx = e.DrawContext.(gl.Context) - } - case mouse.Event: - te := touch.Event{ - X: e.X, - Y: e.Y, - } - switch e.Direction { - case mouse.DirNone: - te.Type = touch.TypeMove - case mouse.DirPress: - te.Type = touch.TypeBegin - case mouse.DirRelease: - te.Type = touch.TypeEnd - } - return te - } - return e -} diff --git a/vendor/golang.org/x/mobile/app/x11.c b/vendor/golang.org/x/mobile/app/x11.c deleted file mode 100644 index f4a7ef3..0000000 --- a/vendor/golang.org/x/mobile/app/x11.c +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build linux,!android - -#include "_cgo_export.h" -#include -#include -#include -#include -#include - -static Atom wm_delete_window; - -static Window -new_window(Display *x_dpy, EGLDisplay e_dpy, int w, int h, EGLContext *ctx, EGLSurface *surf) { - static const EGLint attribs[] = { - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_BLUE_SIZE, 8, - EGL_GREEN_SIZE, 8, - EGL_RED_SIZE, 8, - EGL_DEPTH_SIZE, 16, - EGL_CONFIG_CAVEAT, EGL_NONE, - EGL_NONE - }; - EGLConfig config; - EGLint num_configs; - if (!eglChooseConfig(e_dpy, attribs, &config, 1, &num_configs)) { - fprintf(stderr, "eglChooseConfig failed\n"); - exit(1); - } - EGLint vid; - if (!eglGetConfigAttrib(e_dpy, config, EGL_NATIVE_VISUAL_ID, &vid)) { - fprintf(stderr, "eglGetConfigAttrib failed\n"); - exit(1); - } - - XVisualInfo visTemplate; - visTemplate.visualid = vid; - int num_visuals; - XVisualInfo *visInfo = XGetVisualInfo(x_dpy, VisualIDMask, &visTemplate, &num_visuals); - if (!visInfo) { - fprintf(stderr, "XGetVisualInfo failed\n"); - exit(1); - } - - Window root = RootWindow(x_dpy, DefaultScreen(x_dpy)); - XSetWindowAttributes attr; - - attr.colormap = XCreateColormap(x_dpy, root, visInfo->visual, AllocNone); - if (!attr.colormap) { - fprintf(stderr, "XCreateColormap failed\n"); - exit(1); - } - - attr.event_mask = StructureNotifyMask | ExposureMask | - ButtonPressMask | ButtonReleaseMask | ButtonMotionMask; - Window win = XCreateWindow( - x_dpy, root, 0, 0, w, h, 0, visInfo->depth, InputOutput, - visInfo->visual, CWColormap | CWEventMask, &attr); - XFree(visInfo); - - XSizeHints sizehints; - sizehints.width = w; - sizehints.height = h; - sizehints.flags = USSize; - XSetNormalHints(x_dpy, win, &sizehints); - XSetStandardProperties(x_dpy, win, "App", "App", None, (char **)NULL, 0, &sizehints); - - static const EGLint ctx_attribs[] = { - EGL_CONTEXT_CLIENT_VERSION, 2, - EGL_NONE - }; - *ctx = eglCreateContext(e_dpy, config, EGL_NO_CONTEXT, ctx_attribs); - if (!*ctx) { - fprintf(stderr, "eglCreateContext failed\n"); - exit(1); - } - *surf = eglCreateWindowSurface(e_dpy, config, win, NULL); - if (!*surf) { - fprintf(stderr, "eglCreateWindowSurface failed\n"); - exit(1); - } - return win; -} - -Display *x_dpy; -EGLDisplay e_dpy; -EGLContext e_ctx; -EGLSurface e_surf; -Window win; - -void -createWindow(void) { - x_dpy = XOpenDisplay(NULL); - if (!x_dpy) { - fprintf(stderr, "XOpenDisplay failed\n"); - exit(1); - } - e_dpy = eglGetDisplay(x_dpy); - if (!e_dpy) { - fprintf(stderr, "eglGetDisplay failed\n"); - exit(1); - } - EGLint e_major, e_minor; - if (!eglInitialize(e_dpy, &e_major, &e_minor)) { - fprintf(stderr, "eglInitialize failed\n"); - exit(1); - } - eglBindAPI(EGL_OPENGL_ES_API); - win = new_window(x_dpy, e_dpy, 600, 800, &e_ctx, &e_surf); - - wm_delete_window = XInternAtom(x_dpy, "WM_DELETE_WINDOW", True); - if (wm_delete_window != None) { - XSetWMProtocols(x_dpy, win, &wm_delete_window, 1); - } - - XMapWindow(x_dpy, win); - if (!eglMakeCurrent(e_dpy, e_surf, e_surf, e_ctx)) { - fprintf(stderr, "eglMakeCurrent failed\n"); - exit(1); - } - - // Window size and DPI should be initialized before starting app. - XEvent ev; - while (1) { - if (XCheckMaskEvent(x_dpy, StructureNotifyMask, &ev) == False) { - continue; - } - if (ev.type == ConfigureNotify) { - onResize(ev.xconfigure.width, ev.xconfigure.height); - break; - } - } -} - -void -processEvents(void) { - while (XPending(x_dpy)) { - XEvent ev; - XNextEvent(x_dpy, &ev); - switch (ev.type) { - case ButtonPress: - onTouchBegin((float)ev.xbutton.x, (float)ev.xbutton.y); - break; - case ButtonRelease: - onTouchEnd((float)ev.xbutton.x, (float)ev.xbutton.y); - break; - case MotionNotify: - onTouchMove((float)ev.xmotion.x, (float)ev.xmotion.y); - break; - case ConfigureNotify: - onResize(ev.xconfigure.width, ev.xconfigure.height); - break; - case ClientMessage: - if (wm_delete_window != None && (Atom)ev.xclient.data.l[0] == wm_delete_window) { - onStop(); - return; - } - break; - } - } -} - -void -swapBuffers(void) { - if (eglSwapBuffers(e_dpy, e_surf) == EGL_FALSE) { - fprintf(stderr, "eglSwapBuffer failed\n"); - exit(1); - } -} diff --git a/vendor/golang.org/x/mobile/app/x11.go b/vendor/golang.org/x/mobile/app/x11.go deleted file mode 100644 index d6fe7b2..0000000 --- a/vendor/golang.org/x/mobile/app/x11.go +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build linux,!android - -package app - -/* -Simple on-screen app debugging for X11. Not an officially supported -development target for apps, as screens with mice are very different -than screens with touch panels. -*/ - -/* -#cgo LDFLAGS: -lEGL -lGLESv2 -lX11 - -void createWindow(void); -void processEvents(void); -void swapBuffers(void); -*/ -import "C" -import ( - "runtime" - "time" - - "golang.org/x/mobile/event/lifecycle" - "golang.org/x/mobile/event/paint" - "golang.org/x/mobile/event/size" - "golang.org/x/mobile/event/touch" - "golang.org/x/mobile/geom" -) - -func init() { - theApp.registerGLViewportFilter() -} - -func main(f func(App)) { - runtime.LockOSThread() - - workAvailable := theApp.worker.WorkAvailable() - - C.createWindow() - - // TODO: send lifecycle events when e.g. the X11 window is iconified or moved off-screen. - theApp.sendLifecycle(lifecycle.StageFocused) - - // TODO: translate X11 expose events to shiny paint events, instead of - // sending this synthetic paint event as a hack. - theApp.eventsIn <- paint.Event{} - - donec := make(chan struct{}) - go func() { - f(theApp) - close(donec) - }() - - // TODO: can we get the actual vsync signal? - ticker := time.NewTicker(time.Second / 60) - defer ticker.Stop() - var tc <-chan time.Time - - for { - select { - case <-donec: - return - case <-workAvailable: - theApp.worker.DoWork() - case <-theApp.publish: - C.swapBuffers() - tc = ticker.C - case <-tc: - tc = nil - theApp.publishResult <- PublishResult{} - } - C.processEvents() - } -} - -//export onResize -func onResize(w, h int) { - // TODO(nigeltao): don't assume 72 DPI. DisplayWidth and DisplayWidthMM - // is probably the best place to start looking. - pixelsPerPt := float32(1) - theApp.eventsIn <- size.Event{ - WidthPx: w, - HeightPx: h, - WidthPt: geom.Pt(w), - HeightPt: geom.Pt(h), - PixelsPerPt: pixelsPerPt, - } -} - -func sendTouch(t touch.Type, x, y float32) { - theApp.eventsIn <- touch.Event{ - X: x, - Y: y, - Sequence: 0, // TODO: button?? - Type: t, - } -} - -//export onTouchBegin -func onTouchBegin(x, y float32) { sendTouch(touch.TypeBegin, x, y) } - -//export onTouchMove -func onTouchMove(x, y float32) { sendTouch(touch.TypeMove, x, y) } - -//export onTouchEnd -func onTouchEnd(x, y float32) { sendTouch(touch.TypeEnd, x, y) } - -var stopped bool - -//export onStop -func onStop() { - if stopped { - return - } - stopped = true - theApp.sendLifecycle(lifecycle.StageDead) - theApp.eventsIn <- stopPumping{} -} diff --git a/vendor/golang.org/x/mobile/event/key/code_string.go b/vendor/golang.org/x/mobile/event/key/code_string.go deleted file mode 100644 index 6af78b3..0000000 --- a/vendor/golang.org/x/mobile/event/key/code_string.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by "stringer -type=Code"; DO NOT EDIT - -package key - -import "fmt" - -const ( - _Code_name_0 = "CodeUnknown" - _Code_name_1 = "CodeACodeBCodeCCodeDCodeECodeFCodeGCodeHCodeICodeJCodeKCodeLCodeMCodeNCodeOCodePCodeQCodeRCodeSCodeTCodeUCodeVCodeWCodeXCodeYCodeZCode1Code2Code3Code4Code5Code6Code7Code8Code9Code0CodeReturnEnterCodeEscapeCodeDeleteBackspaceCodeTabCodeSpacebarCodeHyphenMinusCodeEqualSignCodeLeftSquareBracketCodeRightSquareBracketCodeBackslash" - _Code_name_2 = "CodeSemicolonCodeApostropheCodeGraveAccentCodeCommaCodeFullStopCodeSlashCodeCapsLockCodeF1CodeF2CodeF3CodeF4CodeF5CodeF6CodeF7CodeF8CodeF9CodeF10CodeF11CodeF12" - _Code_name_3 = "CodePauseCodeInsertCodeHomeCodePageUpCodeDeleteForwardCodeEndCodePageDownCodeRightArrowCodeLeftArrowCodeDownArrowCodeUpArrowCodeKeypadNumLockCodeKeypadSlashCodeKeypadAsteriskCodeKeypadHyphenMinusCodeKeypadPlusSignCodeKeypadEnterCodeKeypad1CodeKeypad2CodeKeypad3CodeKeypad4CodeKeypad5CodeKeypad6CodeKeypad7CodeKeypad8CodeKeypad9CodeKeypad0CodeKeypadFullStop" - _Code_name_4 = "CodeKeypadEqualSignCodeF13CodeF14CodeF15CodeF16CodeF17CodeF18CodeF19CodeF20CodeF21CodeF22CodeF23CodeF24" - _Code_name_5 = "CodeHelp" - _Code_name_6 = "CodeMuteCodeVolumeUpCodeVolumeDown" - _Code_name_7 = "CodeLeftControlCodeLeftShiftCodeLeftAltCodeLeftGUICodeRightControlCodeRightShiftCodeRightAltCodeRightGUI" - _Code_name_8 = "CodeCompose" -) - -var ( - _Code_index_0 = [...]uint8{0, 11} - _Code_index_1 = [...]uint16{0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 130, 135, 140, 145, 150, 155, 160, 165, 170, 175, 180, 195, 205, 224, 231, 243, 258, 271, 292, 314, 327} - _Code_index_2 = [...]uint8{0, 13, 27, 42, 51, 63, 72, 84, 90, 96, 102, 108, 114, 120, 126, 132, 138, 145, 152, 159} - _Code_index_3 = [...]uint16{0, 9, 19, 27, 37, 54, 61, 73, 87, 100, 113, 124, 141, 156, 174, 195, 213, 228, 239, 250, 261, 272, 283, 294, 305, 316, 327, 338, 356} - _Code_index_4 = [...]uint8{0, 19, 26, 33, 40, 47, 54, 61, 68, 75, 82, 89, 96, 103} - _Code_index_5 = [...]uint8{0, 8} - _Code_index_6 = [...]uint8{0, 8, 20, 34} - _Code_index_7 = [...]uint8{0, 15, 28, 39, 50, 66, 80, 92, 104} - _Code_index_8 = [...]uint8{0, 11} -) - -func (i Code) String() string { - switch { - case i == 0: - return _Code_name_0 - case 4 <= i && i <= 49: - i -= 4 - return _Code_name_1[_Code_index_1[i]:_Code_index_1[i+1]] - case 51 <= i && i <= 69: - i -= 51 - return _Code_name_2[_Code_index_2[i]:_Code_index_2[i+1]] - case 72 <= i && i <= 99: - i -= 72 - return _Code_name_3[_Code_index_3[i]:_Code_index_3[i+1]] - case 103 <= i && i <= 115: - i -= 103 - return _Code_name_4[_Code_index_4[i]:_Code_index_4[i+1]] - case i == 117: - return _Code_name_5 - case 127 <= i && i <= 129: - i -= 127 - return _Code_name_6[_Code_index_6[i]:_Code_index_6[i+1]] - case 224 <= i && i <= 231: - i -= 224 - return _Code_name_7[_Code_index_7[i]:_Code_index_7[i+1]] - case i == 65536: - return _Code_name_8 - default: - return fmt.Sprintf("Code(%d)", i) - } -} diff --git a/vendor/golang.org/x/mobile/event/key/key.go b/vendor/golang.org/x/mobile/event/key/key.go deleted file mode 100644 index d70f1c3..0000000 --- a/vendor/golang.org/x/mobile/event/key/key.go +++ /dev/null @@ -1,270 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:generate stringer -type=Code - -// Package key defines an event for physical keyboard keys. -// -// On-screen software keyboards do not send key events. -// -// See the golang.org/x/mobile/app package for details on the event model. -package key - -import ( - "fmt" - "strings" -) - -// Event is a key event. -type Event struct { - // Rune is the meaning of the key event as determined by the - // operating system. The mapping is determined by system-dependent - // current layout, modifiers, lock-states, etc. - // - // If non-negative, it is a Unicode codepoint: pressing the 'a' key - // generates different Runes 'a' or 'A' (but the same Code) depending on - // the state of the shift key. - // - // If -1, the key does not generate a Unicode codepoint. To distinguish - // them, look at Code. - Rune rune - - // Code is the identity of the physical key relative to a notional - // "standard" keyboard, independent of current layout, modifiers, - // lock-states, etc - // - // For standard key codes, its value matches USB HID key codes. - // Compare its value to uint32-typed constants in this package, such - // as CodeLeftShift and CodeEscape. - // - // Pressing the regular '2' key and number-pad '2' key (with Num-Lock) - // generate different Codes (but the same Rune). - Code Code - - // Modifiers is a bitmask representing a set of modifier keys: ModShift, - // ModAlt, etc. - Modifiers Modifiers - - // Direction is the direction of the key event: DirPress, DirRelease, - // or DirNone (for key repeats). - Direction Direction - - // TODO: add a Device ID, for multiple input devices? - // TODO: add a time.Time? -} - -func (e Event) String() string { - if e.Rune >= 0 { - return fmt.Sprintf("key.Event{%q (%v), %v, %v}", e.Rune, e.Code, e.Modifiers, e.Direction) - } - return fmt.Sprintf("key.Event{(%v), %v, %v}", e.Code, e.Modifiers, e.Direction) -} - -// Direction is the direction of the key event. -type Direction uint8 - -const ( - DirNone Direction = 0 - DirPress Direction = 1 - DirRelease Direction = 2 -) - -// Modifiers is a bitmask representing a set of modifier keys. -type Modifiers uint32 - -const ( - ModShift Modifiers = 1 << 0 - ModControl Modifiers = 1 << 1 - ModAlt Modifiers = 1 << 2 - ModMeta Modifiers = 1 << 3 // called "Command" on OS X -) - -// Code is the identity of a key relative to a notional "standard" keyboard. -type Code uint32 - -// Physical key codes. -// -// For standard key codes, its value matches USB HID key codes. -// TODO: add missing codes. -const ( - CodeUnknown Code = 0 - - CodeA Code = 4 - CodeB Code = 5 - CodeC Code = 6 - CodeD Code = 7 - CodeE Code = 8 - CodeF Code = 9 - CodeG Code = 10 - CodeH Code = 11 - CodeI Code = 12 - CodeJ Code = 13 - CodeK Code = 14 - CodeL Code = 15 - CodeM Code = 16 - CodeN Code = 17 - CodeO Code = 18 - CodeP Code = 19 - CodeQ Code = 20 - CodeR Code = 21 - CodeS Code = 22 - CodeT Code = 23 - CodeU Code = 24 - CodeV Code = 25 - CodeW Code = 26 - CodeX Code = 27 - CodeY Code = 28 - CodeZ Code = 29 - - Code1 Code = 30 - Code2 Code = 31 - Code3 Code = 32 - Code4 Code = 33 - Code5 Code = 34 - Code6 Code = 35 - Code7 Code = 36 - Code8 Code = 37 - Code9 Code = 38 - Code0 Code = 39 - - CodeReturnEnter Code = 40 - CodeEscape Code = 41 - CodeDeleteBackspace Code = 42 - CodeTab Code = 43 - CodeSpacebar Code = 44 - CodeHyphenMinus Code = 45 // - - CodeEqualSign Code = 46 // = - CodeLeftSquareBracket Code = 47 // [ - CodeRightSquareBracket Code = 48 // ] - CodeBackslash Code = 49 // \ - CodeSemicolon Code = 51 // ; - CodeApostrophe Code = 52 // ' - CodeGraveAccent Code = 53 // ` - CodeComma Code = 54 // , - CodeFullStop Code = 55 // . - CodeSlash Code = 56 // / - CodeCapsLock Code = 57 - - CodeF1 Code = 58 - CodeF2 Code = 59 - CodeF3 Code = 60 - CodeF4 Code = 61 - CodeF5 Code = 62 - CodeF6 Code = 63 - CodeF7 Code = 64 - CodeF8 Code = 65 - CodeF9 Code = 66 - CodeF10 Code = 67 - CodeF11 Code = 68 - CodeF12 Code = 69 - - CodePause Code = 72 - CodeInsert Code = 73 - CodeHome Code = 74 - CodePageUp Code = 75 - CodeDeleteForward Code = 76 - CodeEnd Code = 77 - CodePageDown Code = 78 - - CodeRightArrow Code = 79 - CodeLeftArrow Code = 80 - CodeDownArrow Code = 81 - CodeUpArrow Code = 82 - - CodeKeypadNumLock Code = 83 - CodeKeypadSlash Code = 84 // / - CodeKeypadAsterisk Code = 85 // * - CodeKeypadHyphenMinus Code = 86 // - - CodeKeypadPlusSign Code = 87 // + - CodeKeypadEnter Code = 88 - CodeKeypad1 Code = 89 - CodeKeypad2 Code = 90 - CodeKeypad3 Code = 91 - CodeKeypad4 Code = 92 - CodeKeypad5 Code = 93 - CodeKeypad6 Code = 94 - CodeKeypad7 Code = 95 - CodeKeypad8 Code = 96 - CodeKeypad9 Code = 97 - CodeKeypad0 Code = 98 - CodeKeypadFullStop Code = 99 // . - CodeKeypadEqualSign Code = 103 // = - - CodeF13 Code = 104 - CodeF14 Code = 105 - CodeF15 Code = 106 - CodeF16 Code = 107 - CodeF17 Code = 108 - CodeF18 Code = 109 - CodeF19 Code = 110 - CodeF20 Code = 111 - CodeF21 Code = 112 - CodeF22 Code = 113 - CodeF23 Code = 114 - CodeF24 Code = 115 - - CodeHelp Code = 117 - - CodeMute Code = 127 - CodeVolumeUp Code = 128 - CodeVolumeDown Code = 129 - - CodeLeftControl Code = 224 - CodeLeftShift Code = 225 - CodeLeftAlt Code = 226 - CodeLeftGUI Code = 227 - CodeRightControl Code = 228 - CodeRightShift Code = 229 - CodeRightAlt Code = 230 - CodeRightGUI Code = 231 - - // The following codes are not part of the standard USB HID Usage IDs for - // keyboards. See http://www.usb.org/developers/hidpage/Hut1_12v2.pdf - // - // Usage IDs are uint16s, so these non-standard values start at 0x10000. - - // CodeCompose is the Code for a compose key, sometimes called a multi key, - // used to input non-ASCII characters such as ñ being composed of n and ~. - // - // See https://en.wikipedia.org/wiki/Compose_key - CodeCompose Code = 0x10000 -) - -// TODO: Given we use runes outside the unicode space, should we provide a -// printing function? Related: it's a little unfortunate that printing a -// key.Event with %v gives not very readable output like: -// {100 7 key.Modifiers() Press} - -var mods = [...]struct { - m Modifiers - s string -}{ - {ModShift, "Shift"}, - {ModControl, "Control"}, - {ModAlt, "Alt"}, - {ModMeta, "Meta"}, -} - -func (m Modifiers) String() string { - var match []string - for _, mod := range mods { - if mod.m&m != 0 { - match = append(match, mod.s) - } - } - return "key.Modifiers(" + strings.Join(match, "|") + ")" -} - -func (d Direction) String() string { - switch d { - case DirNone: - return "None" - case DirPress: - return "Press" - case DirRelease: - return "Release" - default: - return fmt.Sprintf("key.Direction(%d)", d) - } -} diff --git a/vendor/golang.org/x/mobile/event/lifecycle/lifecycle.go b/vendor/golang.org/x/mobile/event/lifecycle/lifecycle.go deleted file mode 100644 index bed3b49..0000000 --- a/vendor/golang.org/x/mobile/event/lifecycle/lifecycle.go +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package lifecycle defines an event for an app's lifecycle. -// -// The app lifecycle consists of moving back and forth between an ordered -// sequence of stages. For example, being at a stage greater than or equal to -// StageVisible means that the app is visible on the screen. -// -// A lifecycle event is a change from one stage to another, which crosses every -// intermediate stage. For example, changing from StageAlive to StageFocused -// implicitly crosses StageVisible. -// -// Crosses can be in a positive or negative direction. A positive crossing of -// StageFocused means that the app has gained the focus. A negative crossing -// means it has lost the focus. -// -// See the golang.org/x/mobile/app package for details on the event model. -package lifecycle // import "golang.org/x/mobile/event/lifecycle" - -import ( - "fmt" -) - -// Cross is whether a lifecycle stage was crossed. -type Cross uint32 - -func (c Cross) String() string { - switch c { - case CrossOn: - return "on" - case CrossOff: - return "off" - } - return "none" -} - -const ( - CrossNone Cross = 0 - CrossOn Cross = 1 - CrossOff Cross = 2 -) - -// Event is a lifecycle change from an old stage to a new stage. -type Event struct { - From, To Stage - - // DrawContext is the state used for painting, if any is valid. - // - // For OpenGL apps, a non-nil DrawContext is a gl.Context. - // - // TODO: make this an App method if we move away from an event channel? - DrawContext interface{} -} - -func (e Event) String() string { - return fmt.Sprintf("lifecycle.Event{From:%v, To:%v, DrawContext:%v}", e.From, e.To, e.DrawContext) -} - -// Crosses returns whether the transition from From to To crosses the stage s: -// - It returns CrossOn if it does, and the lifecycle change is positive. -// - It returns CrossOff if it does, and the lifecycle change is negative. -// - Otherwise, it returns CrossNone. -// See the documentation for Stage for more discussion of positive and negative -// crosses. -func (e Event) Crosses(s Stage) Cross { - switch { - case e.From < s && e.To >= s: - return CrossOn - case e.From >= s && e.To < s: - return CrossOff - } - return CrossNone -} - -// Stage is a stage in the app's lifecycle. The values are ordered, so that a -// lifecycle change from stage From to stage To implicitly crosses every stage -// in the range (min, max], exclusive on the low end and inclusive on the high -// end, where min is the minimum of From and To, and max is the maximum. -// -// The documentation for individual stages talk about positive and negative -// crosses. A positive lifecycle change is one where its From stage is less -// than its To stage. Similarly, a negative lifecycle change is one where From -// is greater than To. Thus, a positive lifecycle change crosses every stage in -// the range (From, To] in increasing order, and a negative lifecycle change -// crosses every stage in the range (To, From] in decreasing order. -type Stage uint32 - -// TODO: how does iOS map to these stages? What do cross-platform mobile -// abstractions do? - -const ( - // StageDead is the zero stage. No lifecycle change crosses this stage, - // but: - // - A positive change from this stage is the very first lifecycle change. - // - A negative change to this stage is the very last lifecycle change. - StageDead Stage = iota - - // StageAlive means that the app is alive. - // - A positive cross means that the app has been created. - // - A negative cross means that the app is being destroyed. - // Each cross, either from or to StageDead, will occur only once. - // On Android, these correspond to onCreate and onDestroy. - StageAlive - - // StageVisible means that the app window is visible. - // - A positive cross means that the app window has become visible. - // - A negative cross means that the app window has become invisible. - // On Android, these correspond to onStart and onStop. - // On Desktop, an app window can become invisible if e.g. it is minimized, - // unmapped, or not on a visible workspace. - StageVisible - - // StageFocused means that the app window has the focus. - // - A positive cross means that the app window has gained the focus. - // - A negative cross means that the app window has lost the focus. - // On Android, these correspond to onResume and onFreeze. - StageFocused -) - -func (s Stage) String() string { - switch s { - case StageDead: - return "StageDead" - case StageAlive: - return "StageAlive" - case StageVisible: - return "StageVisible" - case StageFocused: - return "StageFocused" - default: - return fmt.Sprintf("lifecycle.Stage(%d)", s) - } -} diff --git a/vendor/golang.org/x/mobile/event/mouse/mouse.go b/vendor/golang.org/x/mobile/event/mouse/mouse.go deleted file mode 100644 index 45029cc..0000000 --- a/vendor/golang.org/x/mobile/event/mouse/mouse.go +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package mouse defines an event for mouse input. -// -// See the golang.org/x/mobile/app package for details on the event model. -package mouse // import "golang.org/x/mobile/event/mouse" - -import ( - "fmt" - - "golang.org/x/mobile/event/key" -) - -// Event is a mouse event. -type Event struct { - // X and Y are the mouse location, in pixels. - X, Y float32 - - // Button is the mouse button being pressed or released. Its value may be - // zero, for a mouse move or drag without any button change. - Button Button - - // TODO: have a field to hold what other buttons are down, for detecting - // drags or button-chords. - - // Modifiers is a bitmask representing a set of modifier keys: - // key.ModShift, key.ModAlt, etc. - Modifiers key.Modifiers - - // Direction is the direction of the mouse event: DirPress, DirRelease, - // or DirNone (for mouse moves or drags). - Direction Direction - - // TODO: add a Device ID, for multiple input devices? - // TODO: add a time.Time? -} - -// Button is a mouse button. -type Button int32 - -// IsWheel returns whether the button is for a scroll wheel. -func (b Button) IsWheel() bool { - return b < 0 -} - -// TODO: have a separate axis concept for wheel up/down? How does that relate -// to joystick events? - -const ( - ButtonNone Button = +0 - ButtonLeft Button = +1 - ButtonMiddle Button = +2 - ButtonRight Button = +3 - - ButtonWheelUp Button = -1 - ButtonWheelDown Button = -2 - ButtonWheelLeft Button = -3 - ButtonWheelRight Button = -4 -) - -// Direction is the direction of the mouse event. -type Direction uint8 - -const ( - DirNone Direction = 0 - DirPress Direction = 1 - DirRelease Direction = 2 - // DirStep is a simultaneous press and release, such as a single step of a - // mouse wheel. - // - // Its value equals DirPress | DirRelease. - DirStep Direction = 3 -) - -func (d Direction) String() string { - switch d { - case DirNone: - return "None" - case DirPress: - return "Press" - case DirRelease: - return "Release" - case DirStep: - return "Step" - default: - return fmt.Sprintf("mouse.Direction(%d)", d) - } -} diff --git a/vendor/golang.org/x/mobile/event/paint/paint.go b/vendor/golang.org/x/mobile/event/paint/paint.go deleted file mode 100644 index b7b4113..0000000 --- a/vendor/golang.org/x/mobile/event/paint/paint.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package paint defines an event for the app being ready to paint. -// -// See the golang.org/x/mobile/app package for details on the event model. -package paint // import "golang.org/x/mobile/event/paint" - -// Event indicates that the app is ready to paint the next frame of the GUI. -// -//A frame is completed by calling the App's Publish method. -type Event struct { - // External is true for paint events sent by the screen driver. - // - // An external event may be sent at any time in response to an - // operating system event, for example the window opened, was - // resized, or the screen memory was lost. - // - // Programs actively drawing to the screen as fast as vsync allows - // should ignore external paint events to avoid a backlog of paint - // events building up. - External bool -} diff --git a/vendor/golang.org/x/mobile/event/size/size.go b/vendor/golang.org/x/mobile/event/size/size.go deleted file mode 100644 index f396728..0000000 --- a/vendor/golang.org/x/mobile/event/size/size.go +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package size defines an event for the dimensions, physical resolution and -// orientation of the app's window. -// -// See the golang.org/x/mobile/app package for details on the event model. -package size // import "golang.org/x/mobile/event/size" - -import ( - "image" - - "golang.org/x/mobile/geom" -) - -// Event holds the dimensions, physical resolution and orientation of the app's -// window. -type Event struct { - // WidthPx and HeightPx are the window's dimensions in pixels. - WidthPx, HeightPx int - - // WidthPt and HeightPt are the window's physical dimensions in points - // (1/72 of an inch). - // - // The values are based on PixelsPerPt and are therefore approximate, as - // per the comment on PixelsPerPt. - WidthPt, HeightPt geom.Pt - - // PixelsPerPt is the window's physical resolution. It is the number of - // pixels in a single geom.Pt, from the golang.org/x/mobile/geom package. - // - // There are a wide variety of pixel densities in existing phones and - // tablets, so apps should be written to expect various non-integer - // PixelsPerPt values. In general, work in geom.Pt. - // - // The value is approximate, in that the OS, drivers or hardware may report - // approximate or quantized values. An N x N pixel square should be roughly - // 1 square inch for N = int(PixelsPerPt * 72), although different square - // lengths (in pixels) might be closer to 1 inch in practice. Nonetheless, - // this PixelsPerPt value should be consistent with e.g. the ratio of - // WidthPx to WidthPt. - PixelsPerPt float32 - - // Orientation is the orientation of the device screen. - Orientation Orientation -} - -// Size returns the window's size in pixels, at the time this size event was -// sent. -func (e Event) Size() image.Point { - return image.Point{e.WidthPx, e.HeightPx} -} - -// Bounds returns the window's bounds in pixels, at the time this size event -// was sent. -// -// The top-left pixel is always (0, 0). The bottom-right pixel is given by the -// width and height. -func (e Event) Bounds() image.Rectangle { - return image.Rectangle{Max: image.Point{e.WidthPx, e.HeightPx}} -} - -// Orientation is the orientation of the device screen. -type Orientation int - -const ( - // OrientationUnknown means device orientation cannot be determined. - // - // Equivalent on Android to Configuration.ORIENTATION_UNKNOWN - // and on iOS to: - // UIDeviceOrientationUnknown - // UIDeviceOrientationFaceUp - // UIDeviceOrientationFaceDown - OrientationUnknown Orientation = iota - - // OrientationPortrait is a device oriented so it is tall and thin. - // - // Equivalent on Android to Configuration.ORIENTATION_PORTRAIT - // and on iOS to: - // UIDeviceOrientationPortrait - // UIDeviceOrientationPortraitUpsideDown - OrientationPortrait - - // OrientationLandscape is a device oriented so it is short and wide. - // - // Equivalent on Android to Configuration.ORIENTATION_LANDSCAPE - // and on iOS to: - // UIDeviceOrientationLandscapeLeft - // UIDeviceOrientationLandscapeRight - OrientationLandscape -) diff --git a/vendor/golang.org/x/mobile/event/touch/touch.go b/vendor/golang.org/x/mobile/event/touch/touch.go deleted file mode 100644 index c91967b..0000000 --- a/vendor/golang.org/x/mobile/event/touch/touch.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package touch defines an event for touch input. -// -// See the golang.org/x/mobile/app package for details on the event model. -package touch // import "golang.org/x/mobile/event/touch" - -// The best source on android input events is the NDK: include/android/input.h -// -// iOS event handling guide: -// https://developer.apple.com/library/ios/documentation/EventHandling/Conceptual/EventHandlingiPhoneOS - -import ( - "fmt" -) - -// Event is a touch event. -type Event struct { - // X and Y are the touch location, in pixels. - X, Y float32 - - // Sequence is the sequence number. The same number is shared by all events - // in a sequence. A sequence begins with a single TypeBegin, is followed by - // zero or more TypeMoves, and ends with a single TypeEnd. A Sequence - // distinguishes concurrent sequences but its value is subsequently reused. - Sequence Sequence - - // Type is the touch type. - Type Type -} - -// Sequence identifies a sequence of touch events. -type Sequence int64 - -// Type describes the type of a touch event. -type Type byte - -const ( - // TypeBegin is a user first touching the device. - // - // On Android, this is a AMOTION_EVENT_ACTION_DOWN. - // On iOS, this is a call to touchesBegan. - TypeBegin Type = iota - - // TypeMove is a user dragging across the device. - // - // A TypeMove is delivered between a TypeBegin and TypeEnd. - // - // On Android, this is a AMOTION_EVENT_ACTION_MOVE. - // On iOS, this is a call to touchesMoved. - TypeMove - - // TypeEnd is a user no longer touching the device. - // - // On Android, this is a AMOTION_EVENT_ACTION_UP. - // On iOS, this is a call to touchesEnded. - TypeEnd -) - -func (t Type) String() string { - switch t { - case TypeBegin: - return "begin" - case TypeMove: - return "move" - case TypeEnd: - return "end" - } - return fmt.Sprintf("touch.Type(%d)", t) -} diff --git a/vendor/golang.org/x/mobile/geom/geom.go b/vendor/golang.org/x/mobile/geom/geom.go deleted file mode 100644 index 23cf67b..0000000 --- a/vendor/golang.org/x/mobile/geom/geom.go +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -/* -Package geom defines a two-dimensional coordinate system. - -The coordinate system is based on an left-handed Cartesian plane. -That is, X increases to the right and Y increases down. For (x,y), - - (0,0) → (1,0) - ↓ ↘ - (0,1) (1,1) - -The display window places the origin (0, 0) in the upper-left corner of -the screen. Positions on the plane are measured in typographic points, -1/72 of an inch, which is represented by the Pt type. - -Any interface that draws to the screen using types from the geom package -scales the number of pixels to maintain a Pt as 1/72 of an inch. -*/ -package geom // import "golang.org/x/mobile/geom" - -/* -Notes on the various underlying coordinate systems. - -Both Android and iOS (UIKit) use upper-left-origin coordinate systems -with for events, however they have different units. - -UIKit measures distance in points. A point is a single-pixel on a -pre-Retina display. UIKit maintains a scale factor that to turn points -into pixels. On current retina devices, the scale factor is 2.0. - -A UIKit point does not correspond to a fixed physical distance, as the -iPhone has a 163 DPI/PPI (326 PPI retina) display, and the iPad has a -132 PPI (264 retina) display. Points are 32-bit floats. - -Even though point is the official UIKit term, they are commonly called -pixels. Indeed, the units were equivalent until the retina display was -introduced. - -N.b. as a UIKit point is unrelated to a typographic point, it is not -related to this packages's Pt and Point types. - -More details about iOS drawing: - -https://developer.apple.com/library/ios/documentation/2ddrawing/conceptual/drawingprintingios/GraphicsDrawingOverview/GraphicsDrawingOverview.html - -Android uses pixels. Sub-pixel precision is possible, so pixels are -represented as 32-bit floats. The ACONFIGURATION_DENSITY enum provides -the screen DPI/PPI, which varies frequently between devices. - -It would be tempting to adopt the pixel, given the clear pixel/DPI split -in the core android events API. However, the plot thickens: - -http://developer.android.com/training/multiscreen/screendensities.html - -Android promotes the notion of a density-independent pixel in many of -their interfaces, often prefixed by "dp". 1dp is a real physical length, -as "independent" means it is assumed to be 1/160th of an inch and is -adjusted for the current screen. - -In addition, android has a scale-indepdendent pixel used for expressing -a user's preferred text size. The user text size preference is a useful -notion not yet expressed in the geom package. - -For the sake of clarity when working across platforms, the geom package -tries to put distance between it and the word pixel. -*/ - -import "fmt" - -// Pt is a length. -// -// The unit Pt is a typographical point, 1/72 of an inch (0.3527 mm). -// -// It can be be converted to a length in current device pixels by -// multiplying with PixelsPerPt after app initialization is complete. -type Pt float32 - -// Px converts the length to current device pixels. -func (p Pt) Px(pixelsPerPt float32) float32 { return float32(p) * pixelsPerPt } - -// String returns a string representation of p like "3.2pt". -func (p Pt) String() string { return fmt.Sprintf("%.2fpt", p) } - -// Point is a point in a two-dimensional plane. -type Point struct { - X, Y Pt -} - -// String returns a string representation of p like "(1.2,3.4)". -func (p Point) String() string { return fmt.Sprintf("(%.2f,%.2f)", p.X, p.Y) } - -// A Rectangle is region of points. -// The top-left point is Min, and the bottom-right point is Max. -type Rectangle struct { - Min, Max Point -} - -// String returns a string representation of r like "(3,4)-(6,5)". -func (r Rectangle) String() string { return r.Min.String() + "-" + r.Max.String() } diff --git a/vendor/golang.org/x/mobile/gl/consts.go b/vendor/golang.org/x/mobile/gl/consts.go deleted file mode 100644 index 370d0b8..0000000 --- a/vendor/golang.org/x/mobile/gl/consts.go +++ /dev/null @@ -1,657 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gl - -/* -Partially generated from the Khronos OpenGL API specification in XML -format, which is covered by the license: - - Copyright (c) 2013-2014 The Khronos Group Inc. - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and/or associated documentation files (the - "Materials"), to deal in the Materials without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Materials, and to - permit persons to whom the Materials are furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Materials. - - THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. - -*/ - -const ( - POINTS = 0x0000 - LINES = 0x0001 - LINE_LOOP = 0x0002 - LINE_STRIP = 0x0003 - TRIANGLES = 0x0004 - TRIANGLE_STRIP = 0x0005 - TRIANGLE_FAN = 0x0006 - SRC_COLOR = 0x0300 - ONE_MINUS_SRC_COLOR = 0x0301 - SRC_ALPHA = 0x0302 - ONE_MINUS_SRC_ALPHA = 0x0303 - DST_ALPHA = 0x0304 - ONE_MINUS_DST_ALPHA = 0x0305 - DST_COLOR = 0x0306 - ONE_MINUS_DST_COLOR = 0x0307 - SRC_ALPHA_SATURATE = 0x0308 - FUNC_ADD = 0x8006 - BLEND_EQUATION = 0x8009 - BLEND_EQUATION_RGB = 0x8009 - BLEND_EQUATION_ALPHA = 0x883D - FUNC_SUBTRACT = 0x800A - FUNC_REVERSE_SUBTRACT = 0x800B - BLEND_DST_RGB = 0x80C8 - BLEND_SRC_RGB = 0x80C9 - BLEND_DST_ALPHA = 0x80CA - BLEND_SRC_ALPHA = 0x80CB - CONSTANT_COLOR = 0x8001 - ONE_MINUS_CONSTANT_COLOR = 0x8002 - CONSTANT_ALPHA = 0x8003 - ONE_MINUS_CONSTANT_ALPHA = 0x8004 - BLEND_COLOR = 0x8005 - ARRAY_BUFFER = 0x8892 - ELEMENT_ARRAY_BUFFER = 0x8893 - ARRAY_BUFFER_BINDING = 0x8894 - ELEMENT_ARRAY_BUFFER_BINDING = 0x8895 - STREAM_DRAW = 0x88E0 - STATIC_DRAW = 0x88E4 - DYNAMIC_DRAW = 0x88E8 - BUFFER_SIZE = 0x8764 - BUFFER_USAGE = 0x8765 - CURRENT_VERTEX_ATTRIB = 0x8626 - FRONT = 0x0404 - BACK = 0x0405 - FRONT_AND_BACK = 0x0408 - TEXTURE_2D = 0x0DE1 - CULL_FACE = 0x0B44 - BLEND = 0x0BE2 - DITHER = 0x0BD0 - STENCIL_TEST = 0x0B90 - DEPTH_TEST = 0x0B71 - SCISSOR_TEST = 0x0C11 - POLYGON_OFFSET_FILL = 0x8037 - SAMPLE_ALPHA_TO_COVERAGE = 0x809E - SAMPLE_COVERAGE = 0x80A0 - INVALID_ENUM = 0x0500 - INVALID_VALUE = 0x0501 - INVALID_OPERATION = 0x0502 - OUT_OF_MEMORY = 0x0505 - CW = 0x0900 - CCW = 0x0901 - LINE_WIDTH = 0x0B21 - ALIASED_POINT_SIZE_RANGE = 0x846D - ALIASED_LINE_WIDTH_RANGE = 0x846E - CULL_FACE_MODE = 0x0B45 - FRONT_FACE = 0x0B46 - DEPTH_RANGE = 0x0B70 - DEPTH_WRITEMASK = 0x0B72 - DEPTH_CLEAR_VALUE = 0x0B73 - DEPTH_FUNC = 0x0B74 - STENCIL_CLEAR_VALUE = 0x0B91 - STENCIL_FUNC = 0x0B92 - STENCIL_FAIL = 0x0B94 - STENCIL_PASS_DEPTH_FAIL = 0x0B95 - STENCIL_PASS_DEPTH_PASS = 0x0B96 - STENCIL_REF = 0x0B97 - STENCIL_VALUE_MASK = 0x0B93 - STENCIL_WRITEMASK = 0x0B98 - STENCIL_BACK_FUNC = 0x8800 - STENCIL_BACK_FAIL = 0x8801 - STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802 - STENCIL_BACK_PASS_DEPTH_PASS = 0x8803 - STENCIL_BACK_REF = 0x8CA3 - STENCIL_BACK_VALUE_MASK = 0x8CA4 - STENCIL_BACK_WRITEMASK = 0x8CA5 - VIEWPORT = 0x0BA2 - SCISSOR_BOX = 0x0C10 - COLOR_CLEAR_VALUE = 0x0C22 - COLOR_WRITEMASK = 0x0C23 - UNPACK_ALIGNMENT = 0x0CF5 - PACK_ALIGNMENT = 0x0D05 - MAX_TEXTURE_SIZE = 0x0D33 - MAX_VIEWPORT_DIMS = 0x0D3A - SUBPIXEL_BITS = 0x0D50 - RED_BITS = 0x0D52 - GREEN_BITS = 0x0D53 - BLUE_BITS = 0x0D54 - ALPHA_BITS = 0x0D55 - DEPTH_BITS = 0x0D56 - STENCIL_BITS = 0x0D57 - POLYGON_OFFSET_UNITS = 0x2A00 - POLYGON_OFFSET_FACTOR = 0x8038 - TEXTURE_BINDING_2D = 0x8069 - SAMPLE_BUFFERS = 0x80A8 - SAMPLES = 0x80A9 - SAMPLE_COVERAGE_VALUE = 0x80AA - SAMPLE_COVERAGE_INVERT = 0x80AB - NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2 - COMPRESSED_TEXTURE_FORMATS = 0x86A3 - DONT_CARE = 0x1100 - FASTEST = 0x1101 - NICEST = 0x1102 - GENERATE_MIPMAP_HINT = 0x8192 - BYTE = 0x1400 - UNSIGNED_BYTE = 0x1401 - SHORT = 0x1402 - UNSIGNED_SHORT = 0x1403 - INT = 0x1404 - UNSIGNED_INT = 0x1405 - FLOAT = 0x1406 - FIXED = 0x140C - DEPTH_COMPONENT = 0x1902 - ALPHA = 0x1906 - RGB = 0x1907 - RGBA = 0x1908 - LUMINANCE = 0x1909 - LUMINANCE_ALPHA = 0x190A - UNSIGNED_SHORT_4_4_4_4 = 0x8033 - UNSIGNED_SHORT_5_5_5_1 = 0x8034 - UNSIGNED_SHORT_5_6_5 = 0x8363 - MAX_VERTEX_ATTRIBS = 0x8869 - MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB - MAX_VARYING_VECTORS = 0x8DFC - MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D - MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C - MAX_TEXTURE_IMAGE_UNITS = 0x8872 - MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD - SHADER_TYPE = 0x8B4F - DELETE_STATUS = 0x8B80 - LINK_STATUS = 0x8B82 - VALIDATE_STATUS = 0x8B83 - ATTACHED_SHADERS = 0x8B85 - ACTIVE_UNIFORMS = 0x8B86 - ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87 - ACTIVE_ATTRIBUTES = 0x8B89 - ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A - SHADING_LANGUAGE_VERSION = 0x8B8C - CURRENT_PROGRAM = 0x8B8D - NEVER = 0x0200 - LESS = 0x0201 - EQUAL = 0x0202 - LEQUAL = 0x0203 - GREATER = 0x0204 - NOTEQUAL = 0x0205 - GEQUAL = 0x0206 - ALWAYS = 0x0207 - KEEP = 0x1E00 - REPLACE = 0x1E01 - INCR = 0x1E02 - DECR = 0x1E03 - INVERT = 0x150A - INCR_WRAP = 0x8507 - DECR_WRAP = 0x8508 - VENDOR = 0x1F00 - RENDERER = 0x1F01 - VERSION = 0x1F02 - EXTENSIONS = 0x1F03 - NEAREST = 0x2600 - LINEAR = 0x2601 - NEAREST_MIPMAP_NEAREST = 0x2700 - LINEAR_MIPMAP_NEAREST = 0x2701 - NEAREST_MIPMAP_LINEAR = 0x2702 - LINEAR_MIPMAP_LINEAR = 0x2703 - TEXTURE_MAG_FILTER = 0x2800 - TEXTURE_MIN_FILTER = 0x2801 - TEXTURE_WRAP_S = 0x2802 - TEXTURE_WRAP_T = 0x2803 - TEXTURE = 0x1702 - TEXTURE_CUBE_MAP = 0x8513 - TEXTURE_BINDING_CUBE_MAP = 0x8514 - TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515 - TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516 - TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517 - TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518 - TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519 - TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A - MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C - TEXTURE0 = 0x84C0 - TEXTURE1 = 0x84C1 - TEXTURE2 = 0x84C2 - TEXTURE3 = 0x84C3 - TEXTURE4 = 0x84C4 - TEXTURE5 = 0x84C5 - TEXTURE6 = 0x84C6 - TEXTURE7 = 0x84C7 - TEXTURE8 = 0x84C8 - TEXTURE9 = 0x84C9 - TEXTURE10 = 0x84CA - TEXTURE11 = 0x84CB - TEXTURE12 = 0x84CC - TEXTURE13 = 0x84CD - TEXTURE14 = 0x84CE - TEXTURE15 = 0x84CF - TEXTURE16 = 0x84D0 - TEXTURE17 = 0x84D1 - TEXTURE18 = 0x84D2 - TEXTURE19 = 0x84D3 - TEXTURE20 = 0x84D4 - TEXTURE21 = 0x84D5 - TEXTURE22 = 0x84D6 - TEXTURE23 = 0x84D7 - TEXTURE24 = 0x84D8 - TEXTURE25 = 0x84D9 - TEXTURE26 = 0x84DA - TEXTURE27 = 0x84DB - TEXTURE28 = 0x84DC - TEXTURE29 = 0x84DD - TEXTURE30 = 0x84DE - TEXTURE31 = 0x84DF - ACTIVE_TEXTURE = 0x84E0 - REPEAT = 0x2901 - CLAMP_TO_EDGE = 0x812F - MIRRORED_REPEAT = 0x8370 - VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622 - VERTEX_ATTRIB_ARRAY_SIZE = 0x8623 - VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624 - VERTEX_ATTRIB_ARRAY_TYPE = 0x8625 - VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A - VERTEX_ATTRIB_ARRAY_POINTER = 0x8645 - VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F - IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A - IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B - COMPILE_STATUS = 0x8B81 - INFO_LOG_LENGTH = 0x8B84 - SHADER_SOURCE_LENGTH = 0x8B88 - SHADER_COMPILER = 0x8DFA - SHADER_BINARY_FORMATS = 0x8DF8 - NUM_SHADER_BINARY_FORMATS = 0x8DF9 - LOW_FLOAT = 0x8DF0 - MEDIUM_FLOAT = 0x8DF1 - HIGH_FLOAT = 0x8DF2 - LOW_INT = 0x8DF3 - MEDIUM_INT = 0x8DF4 - HIGH_INT = 0x8DF5 - FRAMEBUFFER = 0x8D40 - RENDERBUFFER = 0x8D41 - RGBA4 = 0x8056 - RGB5_A1 = 0x8057 - RGB565 = 0x8D62 - DEPTH_COMPONENT16 = 0x81A5 - STENCIL_INDEX8 = 0x8D48 - RENDERBUFFER_WIDTH = 0x8D42 - RENDERBUFFER_HEIGHT = 0x8D43 - RENDERBUFFER_INTERNAL_FORMAT = 0x8D44 - RENDERBUFFER_RED_SIZE = 0x8D50 - RENDERBUFFER_GREEN_SIZE = 0x8D51 - RENDERBUFFER_BLUE_SIZE = 0x8D52 - RENDERBUFFER_ALPHA_SIZE = 0x8D53 - RENDERBUFFER_DEPTH_SIZE = 0x8D54 - RENDERBUFFER_STENCIL_SIZE = 0x8D55 - FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0 - FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1 - FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2 - FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3 - COLOR_ATTACHMENT0 = 0x8CE0 - DEPTH_ATTACHMENT = 0x8D00 - STENCIL_ATTACHMENT = 0x8D20 - FRAMEBUFFER_COMPLETE = 0x8CD5 - FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6 - FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7 - FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9 - FRAMEBUFFER_UNSUPPORTED = 0x8CDD - FRAMEBUFFER_BINDING = 0x8CA6 - RENDERBUFFER_BINDING = 0x8CA7 - MAX_RENDERBUFFER_SIZE = 0x84E8 - INVALID_FRAMEBUFFER_OPERATION = 0x0506 -) - -const ( - DEPTH_BUFFER_BIT = 0x00000100 - STENCIL_BUFFER_BIT = 0x00000400 - COLOR_BUFFER_BIT = 0x00004000 -) - -const ( - FLOAT_VEC2 = 0x8B50 - FLOAT_VEC3 = 0x8B51 - FLOAT_VEC4 = 0x8B52 - INT_VEC2 = 0x8B53 - INT_VEC3 = 0x8B54 - INT_VEC4 = 0x8B55 - BOOL = 0x8B56 - BOOL_VEC2 = 0x8B57 - BOOL_VEC3 = 0x8B58 - BOOL_VEC4 = 0x8B59 - FLOAT_MAT2 = 0x8B5A - FLOAT_MAT3 = 0x8B5B - FLOAT_MAT4 = 0x8B5C - SAMPLER_2D = 0x8B5E - SAMPLER_CUBE = 0x8B60 -) - -const ( - FRAGMENT_SHADER = 0x8B30 - VERTEX_SHADER = 0x8B31 -) - -const ( - FALSE = 0 - TRUE = 1 - ZERO = 0 - ONE = 1 - NO_ERROR = 0 - NONE = 0 -) - -// GL ES 3.0 constants. -const ( - ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 0x8A35 - ACTIVE_UNIFORM_BLOCKS = 0x8A36 - ALREADY_SIGNALED = 0x911A - ANY_SAMPLES_PASSED = 0x8C2F - ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A - BLUE = 0x1905 - BUFFER_ACCESS_FLAGS = 0x911F - BUFFER_MAP_LENGTH = 0x9120 - BUFFER_MAP_OFFSET = 0x9121 - BUFFER_MAPPED = 0x88BC - BUFFER_MAP_POINTER = 0x88BD - COLOR = 0x1800 - COLOR_ATTACHMENT10 = 0x8CEA - COLOR_ATTACHMENT1 = 0x8CE1 - COLOR_ATTACHMENT11 = 0x8CEB - COLOR_ATTACHMENT12 = 0x8CEC - COLOR_ATTACHMENT13 = 0x8CED - COLOR_ATTACHMENT14 = 0x8CEE - COLOR_ATTACHMENT15 = 0x8CEF - COLOR_ATTACHMENT2 = 0x8CE2 - COLOR_ATTACHMENT3 = 0x8CE3 - COLOR_ATTACHMENT4 = 0x8CE4 - COLOR_ATTACHMENT5 = 0x8CE5 - COLOR_ATTACHMENT6 = 0x8CE6 - COLOR_ATTACHMENT7 = 0x8CE7 - COLOR_ATTACHMENT8 = 0x8CE8 - COLOR_ATTACHMENT9 = 0x8CE9 - COMPARE_REF_TO_TEXTURE = 0x884E - COMPRESSED_R11_EAC = 0x9270 - COMPRESSED_RG11_EAC = 0x9272 - COMPRESSED_RGB8_ETC2 = 0x9274 - COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276 - COMPRESSED_RGBA8_ETC2_EAC = 0x9278 - COMPRESSED_SIGNED_R11_EAC = 0x9271 - COMPRESSED_SIGNED_RG11_EAC = 0x9273 - COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279 - COMPRESSED_SRGB8_ETC2 = 0x9275 - COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277 - CONDITION_SATISFIED = 0x911C - COPY_READ_BUFFER = 0x8F36 - COPY_READ_BUFFER_BINDING = 0x8F36 - COPY_WRITE_BUFFER = 0x8F37 - COPY_WRITE_BUFFER_BINDING = 0x8F37 - CURRENT_QUERY = 0x8865 - DEPTH = 0x1801 - DEPTH24_STENCIL8 = 0x88F0 - DEPTH32F_STENCIL8 = 0x8CAD - DEPTH_COMPONENT24 = 0x81A6 - DEPTH_COMPONENT32F = 0x8CAC - DEPTH_STENCIL = 0x84F9 - DEPTH_STENCIL_ATTACHMENT = 0x821A - DRAW_BUFFER0 = 0x8825 - DRAW_BUFFER10 = 0x882F - DRAW_BUFFER1 = 0x8826 - DRAW_BUFFER11 = 0x8830 - DRAW_BUFFER12 = 0x8831 - DRAW_BUFFER13 = 0x8832 - DRAW_BUFFER14 = 0x8833 - DRAW_BUFFER15 = 0x8834 - DRAW_BUFFER2 = 0x8827 - DRAW_BUFFER3 = 0x8828 - DRAW_BUFFER4 = 0x8829 - DRAW_BUFFER5 = 0x882A - DRAW_BUFFER6 = 0x882B - DRAW_BUFFER7 = 0x882C - DRAW_BUFFER8 = 0x882D - DRAW_BUFFER9 = 0x882E - DRAW_FRAMEBUFFER = 0x8CA9 - DRAW_FRAMEBUFFER_BINDING = 0x8CA6 - DYNAMIC_COPY = 0x88EA - DYNAMIC_READ = 0x88E9 - FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD - FLOAT_MAT2x3 = 0x8B65 - FLOAT_MAT2x4 = 0x8B66 - FLOAT_MAT3x2 = 0x8B67 - FLOAT_MAT3x4 = 0x8B68 - FLOAT_MAT4x2 = 0x8B69 - FLOAT_MAT4x3 = 0x8B6A - FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B - FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215 - FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214 - FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210 - FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211 - FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216 - FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213 - FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212 - FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217 - FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4 - FRAMEBUFFER_DEFAULT = 0x8218 - FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56 - FRAMEBUFFER_UNDEFINED = 0x8219 - GREEN = 0x1904 - HALF_FLOAT = 0x140B - INT_2_10_10_10_REV = 0x8D9F - INTERLEAVED_ATTRIBS = 0x8C8C - INT_SAMPLER_2D = 0x8DCA - INT_SAMPLER_2D_ARRAY = 0x8DCF - INT_SAMPLER_3D = 0x8DCB - INT_SAMPLER_CUBE = 0x8DCC - INVALID_INDEX = 0xFFFFFFFF - MAJOR_VERSION = 0x821B - MAP_FLUSH_EXPLICIT_BIT = 0x0010 - MAP_INVALIDATE_BUFFER_BIT = 0x0008 - MAP_INVALIDATE_RANGE_BIT = 0x0004 - MAP_READ_BIT = 0x0001 - MAP_UNSYNCHRONIZED_BIT = 0x0020 - MAP_WRITE_BIT = 0x0002 - MAX = 0x8008 - MAX_3D_TEXTURE_SIZE = 0x8073 - MAX_ARRAY_TEXTURE_LAYERS = 0x88FF - MAX_COLOR_ATTACHMENTS = 0x8CDF - MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33 - MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E - MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31 - MAX_DRAW_BUFFERS = 0x8824 - MAX_ELEMENT_INDEX = 0x8D6B - MAX_ELEMENTS_INDICES = 0x80E9 - MAX_ELEMENTS_VERTICES = 0x80E8 - MAX_FRAGMENT_INPUT_COMPONENTS = 0x9125 - MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D - MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49 - MAX_PROGRAM_TEXEL_OFFSET = 0x8905 - MAX_SAMPLES = 0x8D57 - MAX_SERVER_WAIT_TIMEOUT = 0x9111 - MAX_TEXTURE_LOD_BIAS = 0x84FD - MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A - MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B - MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80 - MAX_UNIFORM_BLOCK_SIZE = 0x8A30 - MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F - MAX_VARYING_COMPONENTS = 0x8B4B - MAX_VERTEX_OUTPUT_COMPONENTS = 0x9122 - MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B - MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A - MIN = 0x8007 - MINOR_VERSION = 0x821C - MIN_PROGRAM_TEXEL_OFFSET = 0x8904 - NUM_EXTENSIONS = 0x821D - NUM_PROGRAM_BINARY_FORMATS = 0x87FE - NUM_SAMPLE_COUNTS = 0x9380 - OBJECT_TYPE = 0x9112 - PACK_ROW_LENGTH = 0x0D02 - PACK_SKIP_PIXELS = 0x0D04 - PACK_SKIP_ROWS = 0x0D03 - PIXEL_PACK_BUFFER = 0x88EB - PIXEL_PACK_BUFFER_BINDING = 0x88ED - PIXEL_UNPACK_BUFFER = 0x88EC - PIXEL_UNPACK_BUFFER_BINDING = 0x88EF - PRIMITIVE_RESTART_FIXED_INDEX = 0x8D69 - PROGRAM_BINARY_FORMATS = 0x87FF - PROGRAM_BINARY_LENGTH = 0x8741 - PROGRAM_BINARY_RETRIEVABLE_HINT = 0x8257 - QUERY_RESULT = 0x8866 - QUERY_RESULT_AVAILABLE = 0x8867 - R11F_G11F_B10F = 0x8C3A - R16F = 0x822D - R16I = 0x8233 - R16UI = 0x8234 - R32F = 0x822E - R32I = 0x8235 - R32UI = 0x8236 - R8 = 0x8229 - R8I = 0x8231 - R8_SNORM = 0x8F94 - R8UI = 0x8232 - RASTERIZER_DISCARD = 0x8C89 - READ_BUFFER = 0x0C02 - READ_FRAMEBUFFER = 0x8CA8 - READ_FRAMEBUFFER_BINDING = 0x8CAA - RED = 0x1903 - RED_INTEGER = 0x8D94 - RENDERBUFFER_SAMPLES = 0x8CAB - RG = 0x8227 - RG16F = 0x822F - RG16I = 0x8239 - RG16UI = 0x823A - RG32F = 0x8230 - RG32I = 0x823B - RG32UI = 0x823C - RG8 = 0x822B - RG8I = 0x8237 - RG8_SNORM = 0x8F95 - RG8UI = 0x8238 - RGB10_A2 = 0x8059 - RGB10_A2UI = 0x906F - RGB16F = 0x881B - RGB16I = 0x8D89 - RGB16UI = 0x8D77 - RGB32F = 0x8815 - RGB32I = 0x8D83 - RGB32UI = 0x8D71 - RGB8 = 0x8051 - RGB8I = 0x8D8F - RGB8_SNORM = 0x8F96 - RGB8UI = 0x8D7D - RGB9_E5 = 0x8C3D - RGBA16F = 0x881A - RGBA16I = 0x8D88 - RGBA16UI = 0x8D76 - RGBA32F = 0x8814 - RGBA32I = 0x8D82 - RGBA32UI = 0x8D70 - RGBA8 = 0x8058 - RGBA8I = 0x8D8E - RGBA8_SNORM = 0x8F97 - RGBA8UI = 0x8D7C - RGBA_INTEGER = 0x8D99 - RGB_INTEGER = 0x8D98 - RG_INTEGER = 0x8228 - SAMPLER_2D_ARRAY = 0x8DC1 - SAMPLER_2D_ARRAY_SHADOW = 0x8DC4 - SAMPLER_2D_SHADOW = 0x8B62 - SAMPLER_3D = 0x8B5F - SAMPLER_BINDING = 0x8919 - SAMPLER_CUBE_SHADOW = 0x8DC5 - SEPARATE_ATTRIBS = 0x8C8D - SIGNALED = 0x9119 - SIGNED_NORMALIZED = 0x8F9C - SRGB = 0x8C40 - SRGB8 = 0x8C41 - SRGB8_ALPHA8 = 0x8C43 - STATIC_COPY = 0x88E6 - STATIC_READ = 0x88E5 - STENCIL = 0x1802 - STREAM_COPY = 0x88E2 - STREAM_READ = 0x88E1 - SYNC_CONDITION = 0x9113 - SYNC_FENCE = 0x9116 - SYNC_FLAGS = 0x9115 - SYNC_FLUSH_COMMANDS_BIT = 0x00000001 - SYNC_GPU_COMMANDS_COMPLETE = 0x9117 - SYNC_STATUS = 0x9114 - TEXTURE_2D_ARRAY = 0x8C1A - TEXTURE_3D = 0x806F - TEXTURE_BASE_LEVEL = 0x813C - TEXTURE_BINDING_2D_ARRAY = 0x8C1D - TEXTURE_BINDING_3D = 0x806A - TEXTURE_COMPARE_FUNC = 0x884D - TEXTURE_COMPARE_MODE = 0x884C - TEXTURE_IMMUTABLE_FORMAT = 0x912F - TEXTURE_IMMUTABLE_LEVELS = 0x82DF - TEXTURE_MAX_LEVEL = 0x813D - TEXTURE_MAX_LOD = 0x813B - TEXTURE_MIN_LOD = 0x813A - TEXTURE_SWIZZLE_A = 0x8E45 - TEXTURE_SWIZZLE_B = 0x8E44 - TEXTURE_SWIZZLE_G = 0x8E43 - TEXTURE_SWIZZLE_R = 0x8E42 - TEXTURE_WRAP_R = 0x8072 - TIMEOUT_EXPIRED = 0x911B - TIMEOUT_IGNORED = 0xFFFFFFFFFFFFFFFF - TRANSFORM_FEEDBACK = 0x8E22 - TRANSFORM_FEEDBACK_ACTIVE = 0x8E24 - TRANSFORM_FEEDBACK_BINDING = 0x8E25 - TRANSFORM_FEEDBACK_BUFFER = 0x8C8E - TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F - TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F - TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85 - TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84 - TRANSFORM_FEEDBACK_PAUSED = 0x8E23 - TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88 - TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 0x8C76 - TRANSFORM_FEEDBACK_VARYINGS = 0x8C83 - UNIFORM_ARRAY_STRIDE = 0x8A3C - UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43 - UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42 - UNIFORM_BLOCK_BINDING = 0x8A3F - UNIFORM_BLOCK_DATA_SIZE = 0x8A40 - UNIFORM_BLOCK_INDEX = 0x8A3A - UNIFORM_BLOCK_NAME_LENGTH = 0x8A41 - UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46 - UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44 - UNIFORM_BUFFER = 0x8A11 - UNIFORM_BUFFER_BINDING = 0x8A28 - UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34 - UNIFORM_BUFFER_SIZE = 0x8A2A - UNIFORM_BUFFER_START = 0x8A29 - UNIFORM_IS_ROW_MAJOR = 0x8A3E - UNIFORM_MATRIX_STRIDE = 0x8A3D - UNIFORM_NAME_LENGTH = 0x8A39 - UNIFORM_OFFSET = 0x8A3B - UNIFORM_SIZE = 0x8A38 - UNIFORM_TYPE = 0x8A37 - UNPACK_IMAGE_HEIGHT = 0x806E - UNPACK_ROW_LENGTH = 0x0CF2 - UNPACK_SKIP_IMAGES = 0x806D - UNPACK_SKIP_PIXELS = 0x0CF4 - UNPACK_SKIP_ROWS = 0x0CF3 - UNSIGNALED = 0x9118 - UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B - UNSIGNED_INT_2_10_10_10_REV = 0x8368 - UNSIGNED_INT_24_8 = 0x84FA - UNSIGNED_INT_5_9_9_9_REV = 0x8C3E - UNSIGNED_INT_SAMPLER_2D = 0x8DD2 - UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7 - UNSIGNED_INT_SAMPLER_3D = 0x8DD3 - UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4 - UNSIGNED_INT_VEC2 = 0x8DC6 - UNSIGNED_INT_VEC3 = 0x8DC7 - UNSIGNED_INT_VEC4 = 0x8DC8 - UNSIGNED_NORMALIZED = 0x8C17 - VERTEX_ARRAY_BINDING = 0x85B5 - VERTEX_ATTRIB_ARRAY_DIVISOR = 0x88FE - VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD - WAIT_FAILED = 0x911D -) diff --git a/vendor/golang.org/x/mobile/gl/dll_windows.go b/vendor/golang.org/x/mobile/gl/dll_windows.go deleted file mode 100644 index 1afc5f8..0000000 --- a/vendor/golang.org/x/mobile/gl/dll_windows.go +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gl - -import ( - "archive/tar" - "compress/gzip" - "debug/pe" - "fmt" - "io" - "io/ioutil" - "log" - "net/http" - "os" - "path/filepath" - "runtime" -) - -var debug = log.New(ioutil.Discard, "gl: ", log.LstdFlags) - -func downloadDLLs() (path string, err error) { - url := "https://dl.google.com/go/mobile/angle-bd3f8780b-" + runtime.GOARCH + ".tgz" - debug.Printf("downloading %s", url) - resp, err := http.Get(url) - if err != nil { - return "", fmt.Errorf("gl: %v", err) - } - defer func() { - err2 := resp.Body.Close() - if err == nil && err2 != nil { - err = fmt.Errorf("gl: error reading body from %v: %v", url, err2) - } - }() - if resp.StatusCode != http.StatusOK { - err := fmt.Errorf("gl: error fetching %v, status: %v", url, resp.Status) - return "", err - } - - r, err := gzip.NewReader(resp.Body) - if err != nil { - return "", fmt.Errorf("gl: error reading gzip from %v: %v", url, err) - } - tr := tar.NewReader(r) - var bytesGLESv2, bytesEGL, bytesD3DCompiler []byte - for { - header, err := tr.Next() - if err == io.EOF { - break - } - if err != nil { - return "", fmt.Errorf("gl: error reading tar from %v: %v", url, err) - } - switch header.Name { - case "angle-" + runtime.GOARCH + "/libglesv2.dll": - bytesGLESv2, err = ioutil.ReadAll(tr) - case "angle-" + runtime.GOARCH + "/libegl.dll": - bytesEGL, err = ioutil.ReadAll(tr) - case "angle-" + runtime.GOARCH + "/d3dcompiler_47.dll": - bytesD3DCompiler, err = ioutil.ReadAll(tr) - default: // skip - } - if err != nil { - return "", fmt.Errorf("gl: error reading %v from %v: %v", header.Name, url, err) - } - } - if len(bytesGLESv2) == 0 || len(bytesEGL) == 0 || len(bytesD3DCompiler) == 0 { - return "", fmt.Errorf("gl: did not find all DLLs in %v", url) - } - - writeDLLs := func(path string) error { - if err := ioutil.WriteFile(filepath.Join(path, "libglesv2.dll"), bytesGLESv2, 0755); err != nil { - return fmt.Errorf("gl: cannot install ANGLE: %v", err) - } - if err := ioutil.WriteFile(filepath.Join(path, "libegl.dll"), bytesEGL, 0755); err != nil { - return fmt.Errorf("gl: cannot install ANGLE: %v", err) - } - if err := ioutil.WriteFile(filepath.Join(path, "d3dcompiler_47.dll"), bytesD3DCompiler, 0755); err != nil { - return fmt.Errorf("gl: cannot install ANGLE: %v", err) - } - return nil - } - - // First, we attempt to install these DLLs in LOCALAPPDATA/Shiny. - // - // Traditionally we would use the system32 directory, but it is - // no longer writable by normal programs. - os.MkdirAll(appdataPath(), 0775) - if err := writeDLLs(appdataPath()); err == nil { - return appdataPath(), nil - } - debug.Printf("DLLs could not be written to %s", appdataPath()) - - // Second, install in GOPATH/pkg if it exists. - gopath := os.Getenv("GOPATH") - gopathpkg := filepath.Join(gopath, "pkg") - if _, err := os.Stat(gopathpkg); err == nil && gopath != "" { - if err := writeDLLs(gopathpkg); err == nil { - return gopathpkg, nil - } - } - debug.Printf("DLLs could not be written to GOPATH") - - // Third, pick a temporary directory. - tmp := os.TempDir() - if err := writeDLLs(tmp); err != nil { - return "", fmt.Errorf("gl: unable to install ANGLE DLLs: %v", err) - } - return tmp, nil -} - -func appdataPath() string { - return filepath.Join(os.Getenv("LOCALAPPDATA"), "GoGL", runtime.GOARCH) -} - -func containsDLLs(dir string) bool { - compatible := func(name string) bool { - file, err := pe.Open(filepath.Join(dir, name)) - if err != nil { - return false - } - defer file.Close() - - switch file.Machine { - case pe.IMAGE_FILE_MACHINE_AMD64: - return "amd64" == runtime.GOARCH - case pe.IMAGE_FILE_MACHINE_ARM: - return "arm" == runtime.GOARCH - case pe.IMAGE_FILE_MACHINE_I386: - return "386" == runtime.GOARCH - } - return false - } - - return compatible("libglesv2.dll") && compatible("libegl.dll") && compatible("d3dcompiler_47.dll") -} - -func chromePath() string { - // dlls are stored in: - // //libglesv2.dll - - var installdirs = []string{ - // Chrome User - filepath.Join(os.Getenv("LOCALAPPDATA"), "Google", "Chrome", "Application"), - // Chrome System - filepath.Join(os.Getenv("ProgramFiles(x86)"), "Google", "Chrome", "Application"), - // Chromium - filepath.Join(os.Getenv("LOCALAPPDATA"), "Chromium", "Application"), - // Chrome Canary - filepath.Join(os.Getenv("LOCALAPPDATA"), "Google", "Chrome SxS", "Application"), - } - - for _, installdir := range installdirs { - versiondirs, err := ioutil.ReadDir(installdir) - if err != nil { - continue - } - - for _, versiondir := range versiondirs { - if !versiondir.IsDir() { - continue - } - - versionpath := filepath.Join(installdir, versiondir.Name()) - if containsDLLs(versionpath) { - return versionpath - } - } - } - - return "" -} - -func findDLLs() (err error) { - load := func(path string) (bool, error) { - if path != "" { - // don't try to start when one of the files is missing - if !containsDLLs(path) { - return false, nil - } - - LibD3DCompiler.Name = filepath.Join(path, filepath.Base(LibD3DCompiler.Name)) - LibGLESv2.Name = filepath.Join(path, filepath.Base(LibGLESv2.Name)) - LibEGL.Name = filepath.Join(path, filepath.Base(LibEGL.Name)) - } - - if err := LibGLESv2.Load(); err == nil { - if err := LibEGL.Load(); err != nil { - return false, fmt.Errorf("gl: loaded libglesv2 but not libegl: %v", err) - } - if err := LibD3DCompiler.Load(); err != nil { - return false, fmt.Errorf("gl: loaded libglesv2, libegl but not d3dcompiler: %v", err) - } - if path == "" { - debug.Printf("DLLs found") - } else { - debug.Printf("DLLs found in: %q", path) - } - return true, nil - } - - return false, nil - } - - // Look in the system directory. - if ok, err := load(""); ok || err != nil { - return err - } - - // Look in the AppData directory. - if ok, err := load(appdataPath()); ok || err != nil { - return err - } - - // Look for a Chrome installation - if dir := chromePath(); dir != "" { - if ok, err := load(dir); ok || err != nil { - return err - } - } - - // Look in GOPATH/pkg. - if ok, err := load(filepath.Join(os.Getenv("GOPATH"), "pkg")); ok || err != nil { - return err - } - - // Look in temporary directory. - if ok, err := load(os.TempDir()); ok || err != nil { - return err - } - - // Download the DLL binary. - path, err := downloadDLLs() - if err != nil { - return err - } - debug.Printf("DLLs written to %s", path) - if ok, err := load(path); !ok || err != nil { - return fmt.Errorf("gl: unable to load ANGLE after installation: %v", err) - } - return nil -} diff --git a/vendor/golang.org/x/mobile/gl/doc.go b/vendor/golang.org/x/mobile/gl/doc.go deleted file mode 100644 index 1eb1d77..0000000 --- a/vendor/golang.org/x/mobile/gl/doc.go +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -/* -Package gl implements Go bindings for OpenGL ES 2.0 and ES 3.0. - -The GL functions are defined on a Context object that is responsible for -tracking a GL context. Typically a windowing system package (such as -golang.org/x/exp/shiny/screen) will call NewContext and provide -a gl.Context for a user application. - -If the gl package is compiled on a platform capable of supporting ES 3.0, -the gl.Context object also implements gl.Context3. - -The bindings are deliberately minimal, staying as close the C API as -possible. The semantics of each function maps onto functions -described in the Khronos documentation: - -https://www.khronos.org/opengles/sdk/docs/man/ - -One notable departure from the C API is the introduction of types -to represent common uses of GLint: Texture, Surface, Buffer, etc. - -Debug Logging - -A tracing version of the OpenGL bindings is behind the `gldebug` build -tag. It acts as a simplified version of apitrace. Build your Go binary -with - - -tags gldebug - -and each call to a GL function will log its input, output, and any -error messages. For example, - - I/GoLog (27668): gl.GenBuffers(1) [Buffer(70001)] - I/GoLog (27668): gl.BindBuffer(ARRAY_BUFFER, Buffer(70001)) - I/GoLog (27668): gl.BufferData(ARRAY_BUFFER, 36, len(36), STATIC_DRAW) - I/GoLog (27668): gl.BindBuffer(ARRAY_BUFFER, Buffer(70001)) - I/GoLog (27668): gl.VertexAttribPointer(Attrib(0), 6, FLOAT, false, 0, 0) error: [INVALID_VALUE] - -The gldebug tracing has very high overhead, so make sure to remove -the build tag before deploying any binaries. -*/ -package gl // import "golang.org/x/mobile/gl" - -/* -Implementation details. - -All GL function calls fill out a C.struct_fnargs and drop it on the work -queue. The Start function drains the work queue and hands over a batch -of calls to C.process which runs them. This allows multiple GL calls to -be executed in a single cgo call. - -A GL call is marked as blocking if it returns a value, or if it takes a -Go pointer. In this case the call will not return until C.process sends a -value on the retvalue channel. - -This implementation ensures any goroutine can make GL calls, but it does -not make the GL interface safe for simultaneous use by multiple goroutines. -For the purpose of analyzing this code for race conditions, picture two -separate goroutines: one blocked on gl.Start, and another making calls to -the gl package exported functions. -*/ - -//go:generate go run gendebug.go -o gldebug.go diff --git a/vendor/golang.org/x/mobile/gl/fn.go b/vendor/golang.org/x/mobile/gl/fn.go deleted file mode 100644 index 3f2f3ad..0000000 --- a/vendor/golang.org/x/mobile/gl/fn.go +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gl - -import "unsafe" - -type call struct { - args fnargs - parg unsafe.Pointer - blocking bool -} - -type fnargs struct { - fn glfn - - a0 uintptr - a1 uintptr - a2 uintptr - a3 uintptr - a4 uintptr - a5 uintptr - a6 uintptr - a7 uintptr - a8 uintptr - a9 uintptr -} - -type glfn int - -const ( - glfnUNDEFINED glfn = iota - glfnActiveTexture - glfnAttachShader - glfnBindAttribLocation - glfnBindBuffer - glfnBindFramebuffer - glfnBindRenderbuffer - glfnBindTexture - glfnBindVertexArray - glfnBlendColor - glfnBlendEquation - glfnBlendEquationSeparate - glfnBlendFunc - glfnBlendFuncSeparate - glfnBufferData - glfnBufferSubData - glfnCheckFramebufferStatus - glfnClear - glfnClearColor - glfnClearDepthf - glfnClearStencil - glfnColorMask - glfnCompileShader - glfnCompressedTexImage2D - glfnCompressedTexSubImage2D - glfnCopyTexImage2D - glfnCopyTexSubImage2D - glfnCreateProgram - glfnCreateShader - glfnCullFace - glfnDeleteBuffer - glfnDeleteFramebuffer - glfnDeleteProgram - glfnDeleteRenderbuffer - glfnDeleteShader - glfnDeleteTexture - glfnDeleteVertexArray - glfnDepthFunc - glfnDepthRangef - glfnDepthMask - glfnDetachShader - glfnDisable - glfnDisableVertexAttribArray - glfnDrawArrays - glfnDrawElements - glfnEnable - glfnEnableVertexAttribArray - glfnFinish - glfnFlush - glfnFramebufferRenderbuffer - glfnFramebufferTexture2D - glfnFrontFace - glfnGenBuffer - glfnGenFramebuffer - glfnGenRenderbuffer - glfnGenTexture - glfnGenVertexArray - glfnGenerateMipmap - glfnGetActiveAttrib - glfnGetActiveUniform - glfnGetAttachedShaders - glfnGetAttribLocation - glfnGetBooleanv - glfnGetBufferParameteri - glfnGetError - glfnGetFloatv - glfnGetFramebufferAttachmentParameteriv - glfnGetIntegerv - glfnGetProgramInfoLog - glfnGetProgramiv - glfnGetRenderbufferParameteriv - glfnGetShaderInfoLog - glfnGetShaderPrecisionFormat - glfnGetShaderSource - glfnGetShaderiv - glfnGetString - glfnGetTexParameterfv - glfnGetTexParameteriv - glfnGetUniformLocation - glfnGetUniformfv - glfnGetUniformiv - glfnGetVertexAttribfv - glfnGetVertexAttribiv - glfnHint - glfnIsBuffer - glfnIsEnabled - glfnIsFramebuffer - glfnIsProgram - glfnIsRenderbuffer - glfnIsShader - glfnIsTexture - glfnLineWidth - glfnLinkProgram - glfnPixelStorei - glfnPolygonOffset - glfnReadPixels - glfnReleaseShaderCompiler - glfnRenderbufferStorage - glfnSampleCoverage - glfnScissor - glfnShaderSource - glfnStencilFunc - glfnStencilFuncSeparate - glfnStencilMask - glfnStencilMaskSeparate - glfnStencilOp - glfnStencilOpSeparate - glfnTexImage2D - glfnTexParameterf - glfnTexParameterfv - glfnTexParameteri - glfnTexParameteriv - glfnTexSubImage2D - glfnUniform1f - glfnUniform1fv - glfnUniform1i - glfnUniform1iv - glfnUniform2f - glfnUniform2fv - glfnUniform2i - glfnUniform2iv - glfnUniform3f - glfnUniform3fv - glfnUniform3i - glfnUniform3iv - glfnUniform4f - glfnUniform4fv - glfnUniform4i - glfnUniform4iv - glfnUniformMatrix2fv - glfnUniformMatrix3fv - glfnUniformMatrix4fv - glfnUseProgram - glfnValidateProgram - glfnVertexAttrib1f - glfnVertexAttrib1fv - glfnVertexAttrib2f - glfnVertexAttrib2fv - glfnVertexAttrib3f - glfnVertexAttrib3fv - glfnVertexAttrib4f - glfnVertexAttrib4fv - glfnVertexAttribPointer - glfnViewport - - // ES 3.0 functions - glfnUniformMatrix2x3fv - glfnUniformMatrix3x2fv - glfnUniformMatrix2x4fv - glfnUniformMatrix4x2fv - glfnUniformMatrix3x4fv - glfnUniformMatrix4x3fv - glfnBlitFramebuffer - glfnUniform1ui - glfnUniform2ui - glfnUniform3ui - glfnUniform4ui - glfnUniform1uiv - glfnUniform2uiv - glfnUniform3uiv - glfnUniform4uiv -) - -func goString(buf []byte) string { - for i, b := range buf { - if b == 0 { - return string(buf[:i]) - } - } - panic("buf is not NUL-terminated") -} - -func glBoolean(b bool) uintptr { - if b { - return TRUE - } - return FALSE -} diff --git a/vendor/golang.org/x/mobile/gl/gl.go b/vendor/golang.org/x/mobile/gl/gl.go deleted file mode 100644 index be4098e..0000000 --- a/vendor/golang.org/x/mobile/gl/gl.go +++ /dev/null @@ -1,1844 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build linux darwin windows openbsd -// +build !gldebug - -package gl - -// TODO(crawshaw): should functions on specific types become methods? E.g. -// func (t Texture) Bind(target Enum) -// this seems natural in Go, but moves us slightly -// further away from the underlying OpenGL spec. - -import ( - "math" - "unsafe" -) - -func (ctx *context) ActiveTexture(texture Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnActiveTexture, - a0: texture.c(), - }, - }) -} - -func (ctx *context) AttachShader(p Program, s Shader) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnAttachShader, - a0: p.c(), - a1: s.c(), - }, - }) -} - -func (ctx *context) BindAttribLocation(p Program, a Attrib, name string) { - s, free := ctx.cString(name) - defer free() - ctx.enqueue(call{ - args: fnargs{ - fn: glfnBindAttribLocation, - a0: p.c(), - a1: a.c(), - a2: s, - }, - blocking: true, - }) -} - -func (ctx *context) BindBuffer(target Enum, b Buffer) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnBindBuffer, - a0: target.c(), - a1: b.c(), - }, - }) -} - -func (ctx *context) BindFramebuffer(target Enum, fb Framebuffer) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnBindFramebuffer, - a0: target.c(), - a1: fb.c(), - }, - }) -} - -func (ctx *context) BindRenderbuffer(target Enum, rb Renderbuffer) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnBindRenderbuffer, - a0: target.c(), - a1: rb.c(), - }, - }) -} - -func (ctx *context) BindTexture(target Enum, t Texture) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnBindTexture, - a0: target.c(), - a1: t.c(), - }, - }) -} - -func (ctx *context) BindVertexArray(va VertexArray) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnBindVertexArray, - a0: va.c(), - }, - }) -} - -func (ctx *context) BlendColor(red, green, blue, alpha float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnBlendColor, - a0: uintptr(math.Float32bits(red)), - a1: uintptr(math.Float32bits(green)), - a2: uintptr(math.Float32bits(blue)), - a3: uintptr(math.Float32bits(alpha)), - }, - }) -} - -func (ctx *context) BlendEquation(mode Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnBlendEquation, - a0: mode.c(), - }, - }) -} - -func (ctx *context) BlendEquationSeparate(modeRGB, modeAlpha Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnBlendEquationSeparate, - a0: modeRGB.c(), - a1: modeAlpha.c(), - }, - }) -} - -func (ctx *context) BlendFunc(sfactor, dfactor Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnBlendFunc, - a0: sfactor.c(), - a1: dfactor.c(), - }, - }) -} - -func (ctx *context) BlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnBlendFuncSeparate, - a0: sfactorRGB.c(), - a1: dfactorRGB.c(), - a2: sfactorAlpha.c(), - a3: dfactorAlpha.c(), - }, - }) -} - -func (ctx *context) BufferData(target Enum, src []byte, usage Enum) { - parg := unsafe.Pointer(nil) - if len(src) > 0 { - parg = unsafe.Pointer(&src[0]) - } - ctx.enqueue(call{ - args: fnargs{ - fn: glfnBufferData, - a0: target.c(), - a1: uintptr(len(src)), - a2: usage.c(), - }, - parg: parg, - blocking: true, - }) -} - -func (ctx *context) BufferInit(target Enum, size int, usage Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnBufferData, - a0: target.c(), - a1: uintptr(size), - a2: usage.c(), - }, - parg: unsafe.Pointer(nil), - }) -} - -func (ctx *context) BufferSubData(target Enum, offset int, data []byte) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnBufferSubData, - a0: target.c(), - a1: uintptr(offset), - a2: uintptr(len(data)), - }, - parg: unsafe.Pointer(&data[0]), - blocking: true, - }) -} - -func (ctx *context) CheckFramebufferStatus(target Enum) Enum { - return Enum(ctx.enqueue(call{ - args: fnargs{ - fn: glfnCheckFramebufferStatus, - a0: target.c(), - }, - blocking: true, - })) -} - -func (ctx *context) Clear(mask Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnClear, - a0: uintptr(mask), - }, - }) -} - -func (ctx *context) ClearColor(red, green, blue, alpha float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnClearColor, - a0: uintptr(math.Float32bits(red)), - a1: uintptr(math.Float32bits(green)), - a2: uintptr(math.Float32bits(blue)), - a3: uintptr(math.Float32bits(alpha)), - }, - }) -} - -func (ctx *context) ClearDepthf(d float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnClearDepthf, - a0: uintptr(math.Float32bits(d)), - }, - }) -} - -func (ctx *context) ClearStencil(s int) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnClearStencil, - a0: uintptr(s), - }, - }) -} - -func (ctx *context) ColorMask(red, green, blue, alpha bool) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnColorMask, - a0: glBoolean(red), - a1: glBoolean(green), - a2: glBoolean(blue), - a3: glBoolean(alpha), - }, - }) -} - -func (ctx *context) CompileShader(s Shader) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnCompileShader, - a0: s.c(), - }, - }) -} - -func (ctx *context) CompressedTexImage2D(target Enum, level int, internalformat Enum, width, height, border int, data []byte) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnCompressedTexImage2D, - a0: target.c(), - a1: uintptr(level), - a2: internalformat.c(), - a3: uintptr(width), - a4: uintptr(height), - a5: uintptr(border), - a6: uintptr(len(data)), - }, - parg: unsafe.Pointer(&data[0]), - blocking: true, - }) -} - -func (ctx *context) CompressedTexSubImage2D(target Enum, level, xoffset, yoffset, width, height int, format Enum, data []byte) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnCompressedTexSubImage2D, - a0: target.c(), - a1: uintptr(level), - a2: uintptr(xoffset), - a3: uintptr(yoffset), - a4: uintptr(width), - a5: uintptr(height), - a6: format.c(), - a7: uintptr(len(data)), - }, - parg: unsafe.Pointer(&data[0]), - blocking: true, - }) -} - -func (ctx *context) CopyTexImage2D(target Enum, level int, internalformat Enum, x, y, width, height, border int) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnCopyTexImage2D, - a0: target.c(), - a1: uintptr(level), - a2: internalformat.c(), - a3: uintptr(x), - a4: uintptr(y), - a5: uintptr(width), - a6: uintptr(height), - a7: uintptr(border), - }, - }) -} - -func (ctx *context) CopyTexSubImage2D(target Enum, level, xoffset, yoffset, x, y, width, height int) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnCopyTexSubImage2D, - a0: target.c(), - a1: uintptr(level), - a2: uintptr(xoffset), - a3: uintptr(yoffset), - a4: uintptr(x), - a5: uintptr(y), - a6: uintptr(width), - a7: uintptr(height), - }, - }) -} - -func (ctx *context) CreateBuffer() Buffer { - return Buffer{Value: uint32(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGenBuffer, - }, - blocking: true, - }))} -} - -func (ctx *context) CreateFramebuffer() Framebuffer { - return Framebuffer{Value: uint32(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGenFramebuffer, - }, - blocking: true, - }))} -} - -func (ctx *context) CreateProgram() Program { - return Program{ - Init: true, - Value: uint32(ctx.enqueue(call{ - args: fnargs{ - fn: glfnCreateProgram, - }, - blocking: true, - }, - ))} -} - -func (ctx *context) CreateRenderbuffer() Renderbuffer { - return Renderbuffer{Value: uint32(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGenRenderbuffer, - }, - blocking: true, - }))} -} - -func (ctx *context) CreateShader(ty Enum) Shader { - return Shader{Value: uint32(ctx.enqueue(call{ - args: fnargs{ - fn: glfnCreateShader, - a0: uintptr(ty), - }, - blocking: true, - }))} -} - -func (ctx *context) CreateTexture() Texture { - return Texture{Value: uint32(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGenTexture, - }, - blocking: true, - }))} -} - -func (ctx *context) CreateVertexArray() VertexArray { - return VertexArray{Value: uint32(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGenVertexArray, - }, - blocking: true, - }))} -} - -func (ctx *context) CullFace(mode Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnCullFace, - a0: mode.c(), - }, - }) -} - -func (ctx *context) DeleteBuffer(v Buffer) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnDeleteBuffer, - a0: v.c(), - }, - }) -} - -func (ctx *context) DeleteFramebuffer(v Framebuffer) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnDeleteFramebuffer, - a0: v.c(), - }, - }) -} - -func (ctx *context) DeleteProgram(p Program) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnDeleteProgram, - a0: p.c(), - }, - }) -} - -func (ctx *context) DeleteRenderbuffer(v Renderbuffer) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnDeleteRenderbuffer, - a0: v.c(), - }, - }) -} - -func (ctx *context) DeleteShader(s Shader) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnDeleteShader, - a0: s.c(), - }, - }) -} - -func (ctx *context) DeleteTexture(v Texture) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnDeleteTexture, - a0: v.c(), - }, - }) -} - -func (ctx *context) DeleteVertexArray(v VertexArray) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnDeleteVertexArray, - a0: v.c(), - }, - }) -} - -func (ctx *context) DepthFunc(fn Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnDepthFunc, - a0: fn.c(), - }, - }) -} - -func (ctx *context) DepthMask(flag bool) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnDepthMask, - a0: glBoolean(flag), - }, - }) -} - -func (ctx *context) DepthRangef(n, f float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnDepthRangef, - a0: uintptr(math.Float32bits(n)), - a1: uintptr(math.Float32bits(f)), - }, - }) -} - -func (ctx *context) DetachShader(p Program, s Shader) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnDetachShader, - a0: p.c(), - a1: s.c(), - }, - }) -} - -func (ctx *context) Disable(cap Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnDisable, - a0: cap.c(), - }, - }) -} - -func (ctx *context) DisableVertexAttribArray(a Attrib) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnDisableVertexAttribArray, - a0: a.c(), - }, - }) -} - -func (ctx *context) DrawArrays(mode Enum, first, count int) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnDrawArrays, - a0: mode.c(), - a1: uintptr(first), - a2: uintptr(count), - }, - }) -} - -func (ctx *context) DrawElements(mode Enum, count int, ty Enum, offset int) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnDrawElements, - a0: mode.c(), - a1: uintptr(count), - a2: ty.c(), - a3: uintptr(offset), - }, - }) -} - -func (ctx *context) Enable(cap Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnEnable, - a0: cap.c(), - }, - }) -} - -func (ctx *context) EnableVertexAttribArray(a Attrib) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnEnableVertexAttribArray, - a0: a.c(), - }, - }) -} - -func (ctx *context) Finish() { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnFinish, - }, - blocking: true, - }) -} - -func (ctx *context) Flush() { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnFlush, - }, - blocking: true, - }) -} - -func (ctx *context) FramebufferRenderbuffer(target, attachment, rbTarget Enum, rb Renderbuffer) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnFramebufferRenderbuffer, - a0: target.c(), - a1: attachment.c(), - a2: rbTarget.c(), - a3: rb.c(), - }, - }) -} - -func (ctx *context) FramebufferTexture2D(target, attachment, texTarget Enum, t Texture, level int) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnFramebufferTexture2D, - a0: target.c(), - a1: attachment.c(), - a2: texTarget.c(), - a3: t.c(), - a4: uintptr(level), - }, - }) -} - -func (ctx *context) FrontFace(mode Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnFrontFace, - a0: mode.c(), - }, - }) -} - -func (ctx *context) GenerateMipmap(target Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGenerateMipmap, - a0: target.c(), - }, - }) -} - -func (ctx *context) GetActiveAttrib(p Program, index uint32) (name string, size int, ty Enum) { - bufSize := ctx.GetProgrami(p, ACTIVE_ATTRIBUTE_MAX_LENGTH) - buf := make([]byte, bufSize) - var cType int - - cSize := ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetActiveAttrib, - a0: p.c(), - a1: uintptr(index), - a2: uintptr(bufSize), - a3: uintptr(unsafe.Pointer(&cType)), // TODO(crawshaw): not safe for a moving collector - }, - parg: unsafe.Pointer(&buf[0]), - blocking: true, - }) - - return goString(buf), int(cSize), Enum(cType) -} - -func (ctx *context) GetActiveUniform(p Program, index uint32) (name string, size int, ty Enum) { - bufSize := ctx.GetProgrami(p, ACTIVE_UNIFORM_MAX_LENGTH) - buf := make([]byte, bufSize+8) // extra space for cType - var cType int - - cSize := ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetActiveUniform, - a0: p.c(), - a1: uintptr(index), - a2: uintptr(bufSize), - a3: uintptr(unsafe.Pointer(&cType)), // TODO(crawshaw): not safe for a moving collector - }, - parg: unsafe.Pointer(&buf[0]), - blocking: true, - }) - - return goString(buf), int(cSize), Enum(cType) -} - -func (ctx *context) GetAttachedShaders(p Program) []Shader { - shadersLen := ctx.GetProgrami(p, ATTACHED_SHADERS) - if shadersLen == 0 { - return nil - } - buf := make([]uint32, shadersLen) - - n := int(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetAttachedShaders, - a0: p.c(), - a1: uintptr(shadersLen), - }, - parg: unsafe.Pointer(&buf[0]), - blocking: true, - })) - - buf = buf[:int(n)] - shaders := make([]Shader, len(buf)) - for i, s := range buf { - shaders[i] = Shader{Value: uint32(s)} - } - return shaders -} - -func (ctx *context) GetAttribLocation(p Program, name string) Attrib { - s, free := ctx.cString(name) - defer free() - return Attrib{Value: uint(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetAttribLocation, - a0: p.c(), - a1: s, - }, - blocking: true, - }))} -} - -func (ctx *context) GetBooleanv(dst []bool, pname Enum) { - buf := make([]int32, len(dst)) - - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetBooleanv, - a0: pname.c(), - }, - parg: unsafe.Pointer(&buf[0]), - blocking: true, - }) - - for i, v := range buf { - dst[i] = v != 0 - } -} - -func (ctx *context) GetFloatv(dst []float32, pname Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetFloatv, - a0: pname.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -func (ctx *context) GetIntegerv(dst []int32, pname Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetIntegerv, - a0: pname.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -func (ctx *context) GetInteger(pname Enum) int { - var v [1]int32 - ctx.GetIntegerv(v[:], pname) - return int(v[0]) -} - -func (ctx *context) GetBufferParameteri(target, value Enum) int { - return int(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetBufferParameteri, - a0: target.c(), - a1: value.c(), - }, - blocking: true, - })) -} - -func (ctx *context) GetError() Enum { - return Enum(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetError, - }, - blocking: true, - })) -} - -func (ctx *context) GetFramebufferAttachmentParameteri(target, attachment, pname Enum) int { - return int(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetFramebufferAttachmentParameteriv, - a0: target.c(), - a1: attachment.c(), - a2: pname.c(), - }, - blocking: true, - })) -} - -func (ctx *context) GetProgrami(p Program, pname Enum) int { - return int(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetProgramiv, - a0: p.c(), - a1: pname.c(), - }, - blocking: true, - })) -} - -func (ctx *context) GetProgramInfoLog(p Program) string { - infoLen := ctx.GetProgrami(p, INFO_LOG_LENGTH) - if infoLen == 0 { - return "" - } - buf := make([]byte, infoLen) - - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetProgramInfoLog, - a0: p.c(), - a1: uintptr(infoLen), - }, - parg: unsafe.Pointer(&buf[0]), - blocking: true, - }) - - return goString(buf) -} - -func (ctx *context) GetRenderbufferParameteri(target, pname Enum) int { - return int(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetRenderbufferParameteriv, - a0: target.c(), - a1: pname.c(), - }, - blocking: true, - })) -} - -func (ctx *context) GetShaderi(s Shader, pname Enum) int { - return int(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetShaderiv, - a0: s.c(), - a1: pname.c(), - }, - blocking: true, - })) -} - -func (ctx *context) GetShaderInfoLog(s Shader) string { - infoLen := ctx.GetShaderi(s, INFO_LOG_LENGTH) - if infoLen == 0 { - return "" - } - buf := make([]byte, infoLen) - - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetShaderInfoLog, - a0: s.c(), - a1: uintptr(infoLen), - }, - parg: unsafe.Pointer(&buf[0]), - blocking: true, - }) - - return goString(buf) -} - -func (ctx *context) GetShaderPrecisionFormat(shadertype, precisiontype Enum) (rangeLow, rangeHigh, precision int) { - var rangeAndPrec [3]int32 - - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetShaderPrecisionFormat, - a0: shadertype.c(), - a1: precisiontype.c(), - }, - parg: unsafe.Pointer(&rangeAndPrec[0]), - blocking: true, - }) - - return int(rangeAndPrec[0]), int(rangeAndPrec[1]), int(rangeAndPrec[2]) -} - -func (ctx *context) GetShaderSource(s Shader) string { - sourceLen := ctx.GetShaderi(s, SHADER_SOURCE_LENGTH) - if sourceLen == 0 { - return "" - } - buf := make([]byte, sourceLen) - - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetShaderSource, - a0: s.c(), - a1: uintptr(sourceLen), - }, - parg: unsafe.Pointer(&buf[0]), - blocking: true, - }) - - return goString(buf) -} - -func (ctx *context) GetString(pname Enum) string { - ret := ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetString, - a0: pname.c(), - }, - blocking: true, - }) - retp := unsafe.Pointer(ret) - buf := (*[1 << 24]byte)(retp)[:] - return goString(buf) -} - -func (ctx *context) GetTexParameterfv(dst []float32, target, pname Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetTexParameterfv, - a0: target.c(), - a1: pname.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -func (ctx *context) GetTexParameteriv(dst []int32, target, pname Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetTexParameteriv, - a0: target.c(), - a1: pname.c(), - }, - blocking: true, - }) -} - -func (ctx *context) GetUniformfv(dst []float32, src Uniform, p Program) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetUniformfv, - a0: p.c(), - a1: src.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -func (ctx *context) GetUniformiv(dst []int32, src Uniform, p Program) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetUniformiv, - a0: p.c(), - a1: src.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -func (ctx *context) GetUniformLocation(p Program, name string) Uniform { - s, free := ctx.cString(name) - defer free() - return Uniform{Value: int32(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetUniformLocation, - a0: p.c(), - a1: s, - }, - blocking: true, - }))} -} - -func (ctx *context) GetVertexAttribf(src Attrib, pname Enum) float32 { - var params [1]float32 - ctx.GetVertexAttribfv(params[:], src, pname) - return params[0] -} - -func (ctx *context) GetVertexAttribfv(dst []float32, src Attrib, pname Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetVertexAttribfv, - a0: src.c(), - a1: pname.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -func (ctx *context) GetVertexAttribi(src Attrib, pname Enum) int32 { - var params [1]int32 - ctx.GetVertexAttribiv(params[:], src, pname) - return params[0] -} - -func (ctx *context) GetVertexAttribiv(dst []int32, src Attrib, pname Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetVertexAttribiv, - a0: src.c(), - a1: pname.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -func (ctx *context) Hint(target, mode Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnHint, - a0: target.c(), - a1: mode.c(), - }, - }) -} - -func (ctx *context) IsBuffer(b Buffer) bool { - return 0 != ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsBuffer, - a0: b.c(), - }, - blocking: true, - }) -} - -func (ctx *context) IsEnabled(cap Enum) bool { - return 0 != ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsEnabled, - a0: cap.c(), - }, - blocking: true, - }) -} - -func (ctx *context) IsFramebuffer(fb Framebuffer) bool { - return 0 != ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsFramebuffer, - a0: fb.c(), - }, - blocking: true, - }) -} - -func (ctx *context) IsProgram(p Program) bool { - return 0 != ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsProgram, - a0: p.c(), - }, - blocking: true, - }) -} - -func (ctx *context) IsRenderbuffer(rb Renderbuffer) bool { - return 0 != ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsRenderbuffer, - a0: rb.c(), - }, - blocking: true, - }) -} - -func (ctx *context) IsShader(s Shader) bool { - return 0 != ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsShader, - a0: s.c(), - }, - blocking: true, - }) -} - -func (ctx *context) IsTexture(t Texture) bool { - return 0 != ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsTexture, - a0: t.c(), - }, - blocking: true, - }) -} - -func (ctx *context) LineWidth(width float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnLineWidth, - a0: uintptr(math.Float32bits(width)), - }, - }) -} - -func (ctx *context) LinkProgram(p Program) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnLinkProgram, - a0: p.c(), - }, - }) -} - -func (ctx *context) PixelStorei(pname Enum, param int32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnPixelStorei, - a0: pname.c(), - a1: uintptr(param), - }, - }) -} - -func (ctx *context) PolygonOffset(factor, units float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnPolygonOffset, - a0: uintptr(math.Float32bits(factor)), - a1: uintptr(math.Float32bits(units)), - }, - }) -} - -func (ctx *context) ReadPixels(dst []byte, x, y, width, height int, format, ty Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnReadPixels, - // TODO(crawshaw): support PIXEL_PACK_BUFFER in GLES3, uses offset. - a0: uintptr(x), - a1: uintptr(y), - a2: uintptr(width), - a3: uintptr(height), - a4: format.c(), - a5: ty.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -func (ctx *context) ReleaseShaderCompiler() { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnReleaseShaderCompiler, - }, - }) -} - -func (ctx *context) RenderbufferStorage(target, internalFormat Enum, width, height int) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnRenderbufferStorage, - a0: target.c(), - a1: internalFormat.c(), - a2: uintptr(width), - a3: uintptr(height), - }, - }) -} - -func (ctx *context) SampleCoverage(value float32, invert bool) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnSampleCoverage, - a0: uintptr(math.Float32bits(value)), - a1: glBoolean(invert), - }, - }) -} - -func (ctx *context) Scissor(x, y, width, height int32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnScissor, - a0: uintptr(x), - a1: uintptr(y), - a2: uintptr(width), - a3: uintptr(height), - }, - }) -} - -func (ctx *context) ShaderSource(s Shader, src string) { - strp, free := ctx.cStringPtr(src) - defer free() - ctx.enqueue(call{ - args: fnargs{ - fn: glfnShaderSource, - a0: s.c(), - a1: 1, - a2: strp, - }, - blocking: true, - }) -} - -func (ctx *context) StencilFunc(fn Enum, ref int, mask uint32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnStencilFunc, - a0: fn.c(), - a1: uintptr(ref), - a2: uintptr(mask), - }, - }) -} - -func (ctx *context) StencilFuncSeparate(face, fn Enum, ref int, mask uint32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnStencilFuncSeparate, - a0: face.c(), - a1: fn.c(), - a2: uintptr(ref), - a3: uintptr(mask), - }, - }) -} - -func (ctx *context) StencilMask(mask uint32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnStencilMask, - a0: uintptr(mask), - }, - }) -} - -func (ctx *context) StencilMaskSeparate(face Enum, mask uint32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnStencilMaskSeparate, - a0: face.c(), - a1: uintptr(mask), - }, - }) -} - -func (ctx *context) StencilOp(fail, zfail, zpass Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnStencilOp, - a0: fail.c(), - a1: zfail.c(), - a2: zpass.c(), - }, - }) -} - -func (ctx *context) StencilOpSeparate(face, sfail, dpfail, dppass Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnStencilOpSeparate, - a0: face.c(), - a1: sfail.c(), - a2: dpfail.c(), - a3: dppass.c(), - }, - }) -} - -func (ctx *context) TexImage2D(target Enum, level int, width, height int, format Enum, ty Enum, data []byte) { - // It is common to pass TexImage2D a nil data, indicating that a - // bound GL buffer is being used as the source. In that case, it - // is not necessary to block. - parg := unsafe.Pointer(nil) - if len(data) > 0 { - parg = unsafe.Pointer(&data[0]) - } - - ctx.enqueue(call{ - args: fnargs{ - fn: glfnTexImage2D, - // TODO(crawshaw): GLES3 offset for PIXEL_UNPACK_BUFFER and PIXEL_PACK_BUFFER. - a0: target.c(), - a1: uintptr(level), - a2: uintptr(format), - a3: uintptr(width), - a4: uintptr(height), - a5: format.c(), - a6: ty.c(), - }, - parg: parg, - blocking: parg != nil, - }) -} - -func (ctx *context) TexSubImage2D(target Enum, level int, x, y, width, height int, format, ty Enum, data []byte) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnTexSubImage2D, - // TODO(crawshaw): GLES3 offset for PIXEL_UNPACK_BUFFER and PIXEL_PACK_BUFFER. - a0: target.c(), - a1: uintptr(level), - a2: uintptr(x), - a3: uintptr(y), - a4: uintptr(width), - a5: uintptr(height), - a6: format.c(), - a7: ty.c(), - }, - parg: unsafe.Pointer(&data[0]), - blocking: true, - }) -} - -func (ctx *context) TexParameterf(target, pname Enum, param float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnTexParameterf, - a0: target.c(), - a1: pname.c(), - a2: uintptr(math.Float32bits(param)), - }, - }) -} - -func (ctx *context) TexParameterfv(target, pname Enum, params []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnTexParameterfv, - a0: target.c(), - a1: pname.c(), - }, - parg: unsafe.Pointer(¶ms[0]), - blocking: true, - }) -} - -func (ctx *context) TexParameteri(target, pname Enum, param int) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnTexParameteri, - a0: target.c(), - a1: pname.c(), - a2: uintptr(param), - }, - }) -} - -func (ctx *context) TexParameteriv(target, pname Enum, params []int32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnTexParameteriv, - a0: target.c(), - a1: pname.c(), - }, - parg: unsafe.Pointer(¶ms[0]), - blocking: true, - }) -} - -func (ctx *context) Uniform1f(dst Uniform, v float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform1f, - a0: dst.c(), - a1: uintptr(math.Float32bits(v)), - }, - }) -} - -func (ctx *context) Uniform1fv(dst Uniform, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform1fv, - a0: dst.c(), - a1: uintptr(len(src)), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) Uniform1i(dst Uniform, v int) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform1i, - a0: dst.c(), - a1: uintptr(v), - }, - }) -} - -func (ctx *context) Uniform1iv(dst Uniform, src []int32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform1iv, - a0: dst.c(), - a1: uintptr(len(src)), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) Uniform2f(dst Uniform, v0, v1 float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform2f, - a0: dst.c(), - a1: uintptr(math.Float32bits(v0)), - a2: uintptr(math.Float32bits(v1)), - }, - }) -} - -func (ctx *context) Uniform2fv(dst Uniform, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform2fv, - a0: dst.c(), - a1: uintptr(len(src) / 2), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) Uniform2i(dst Uniform, v0, v1 int) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform2i, - a0: dst.c(), - a1: uintptr(v0), - a2: uintptr(v1), - }, - }) -} - -func (ctx *context) Uniform2iv(dst Uniform, src []int32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform2iv, - a0: dst.c(), - a1: uintptr(len(src) / 2), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) Uniform3f(dst Uniform, v0, v1, v2 float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform3f, - a0: dst.c(), - a1: uintptr(math.Float32bits(v0)), - a2: uintptr(math.Float32bits(v1)), - a3: uintptr(math.Float32bits(v2)), - }, - }) -} - -func (ctx *context) Uniform3fv(dst Uniform, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform3fv, - a0: dst.c(), - a1: uintptr(len(src) / 3), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) Uniform3i(dst Uniform, v0, v1, v2 int32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform3i, - a0: dst.c(), - a1: uintptr(v0), - a2: uintptr(v1), - a3: uintptr(v2), - }, - }) -} - -func (ctx *context) Uniform3iv(dst Uniform, src []int32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform3iv, - a0: dst.c(), - a1: uintptr(len(src) / 3), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) Uniform4f(dst Uniform, v0, v1, v2, v3 float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform4f, - a0: dst.c(), - a1: uintptr(math.Float32bits(v0)), - a2: uintptr(math.Float32bits(v1)), - a3: uintptr(math.Float32bits(v2)), - a4: uintptr(math.Float32bits(v3)), - }, - }) -} - -func (ctx *context) Uniform4fv(dst Uniform, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform4fv, - a0: dst.c(), - a1: uintptr(len(src) / 4), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) Uniform4i(dst Uniform, v0, v1, v2, v3 int32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform4i, - a0: dst.c(), - a1: uintptr(v0), - a2: uintptr(v1), - a3: uintptr(v2), - a4: uintptr(v3), - }, - }) -} - -func (ctx *context) Uniform4iv(dst Uniform, src []int32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform4iv, - a0: dst.c(), - a1: uintptr(len(src) / 4), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) UniformMatrix2fv(dst Uniform, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniformMatrix2fv, - // OpenGL ES 2 does not support transpose. - a0: dst.c(), - a1: uintptr(len(src) / 4), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) UniformMatrix3fv(dst Uniform, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniformMatrix3fv, - a0: dst.c(), - a1: uintptr(len(src) / 9), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) UniformMatrix4fv(dst Uniform, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniformMatrix4fv, - a0: dst.c(), - a1: uintptr(len(src) / 16), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) UseProgram(p Program) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUseProgram, - a0: p.c(), - }, - }) -} - -func (ctx *context) ValidateProgram(p Program) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnValidateProgram, - a0: p.c(), - }, - }) -} - -func (ctx *context) VertexAttrib1f(dst Attrib, x float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnVertexAttrib1f, - a0: dst.c(), - a1: uintptr(math.Float32bits(x)), - }, - }) -} - -func (ctx *context) VertexAttrib1fv(dst Attrib, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnVertexAttrib1fv, - a0: dst.c(), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) VertexAttrib2f(dst Attrib, x, y float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnVertexAttrib2f, - a0: dst.c(), - a1: uintptr(math.Float32bits(x)), - a2: uintptr(math.Float32bits(y)), - }, - }) -} - -func (ctx *context) VertexAttrib2fv(dst Attrib, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnVertexAttrib2fv, - a0: dst.c(), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) VertexAttrib3f(dst Attrib, x, y, z float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnVertexAttrib3f, - a0: dst.c(), - a1: uintptr(math.Float32bits(x)), - a2: uintptr(math.Float32bits(y)), - a3: uintptr(math.Float32bits(z)), - }, - }) -} - -func (ctx *context) VertexAttrib3fv(dst Attrib, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnVertexAttrib3fv, - a0: dst.c(), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) VertexAttrib4f(dst Attrib, x, y, z, w float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnVertexAttrib4f, - a0: dst.c(), - a1: uintptr(math.Float32bits(x)), - a2: uintptr(math.Float32bits(y)), - a3: uintptr(math.Float32bits(z)), - a4: uintptr(math.Float32bits(w)), - }, - }) -} - -func (ctx *context) VertexAttrib4fv(dst Attrib, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnVertexAttrib4fv, - a0: dst.c(), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) VertexAttribPointer(dst Attrib, size int, ty Enum, normalized bool, stride, offset int) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnVertexAttribPointer, - a0: dst.c(), - a1: uintptr(size), - a2: ty.c(), - a3: glBoolean(normalized), - a4: uintptr(stride), - a5: uintptr(offset), - }, - }) -} - -func (ctx *context) Viewport(x, y, width, height int) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnViewport, - a0: uintptr(x), - a1: uintptr(y), - a2: uintptr(width), - a3: uintptr(height), - }, - }) -} - -func (ctx context3) UniformMatrix2x3fv(dst Uniform, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniformMatrix2x3fv, - a0: dst.c(), - a1: uintptr(len(src) / 6), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx context3) UniformMatrix3x2fv(dst Uniform, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniformMatrix3x2fv, - a0: dst.c(), - a1: uintptr(len(src) / 6), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx context3) UniformMatrix2x4fv(dst Uniform, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniformMatrix2x4fv, - a0: dst.c(), - a1: uintptr(len(src) / 8), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx context3) UniformMatrix4x2fv(dst Uniform, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniformMatrix4x2fv, - a0: dst.c(), - a1: uintptr(len(src) / 8), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx context3) UniformMatrix3x4fv(dst Uniform, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniformMatrix3x4fv, - a0: dst.c(), - a1: uintptr(len(src) / 12), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx context3) UniformMatrix4x3fv(dst Uniform, src []float32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniformMatrix4x3fv, - a0: dst.c(), - a1: uintptr(len(src) / 12), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx context3) BlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1 int, mask uint, filter Enum) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnBlitFramebuffer, - a0: uintptr(srcX0), - a1: uintptr(srcY0), - a2: uintptr(srcX1), - a3: uintptr(srcY1), - a4: uintptr(dstX0), - a5: uintptr(dstY0), - a6: uintptr(dstX1), - a7: uintptr(dstY1), - a8: uintptr(mask), - a9: filter.c(), - }, - }) -} - -func (ctx context3) Uniform1ui(dst Uniform, v uint32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform1ui, - a0: dst.c(), - a1: uintptr(v), - }, - }) -} - -func (ctx context3) Uniform2ui(dst Uniform, v0, v1 uint32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform2ui, - a0: dst.c(), - a1: uintptr(v0), - a2: uintptr(v1), - }, - }) -} - -func (ctx context3) Uniform3ui(dst Uniform, v0, v1, v2 uint) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform3ui, - a0: dst.c(), - a1: uintptr(v0), - a2: uintptr(v1), - a3: uintptr(v2), - }, - }) -} - -func (ctx context3) Uniform4ui(dst Uniform, v0, v1, v2, v3 uint32) { - ctx.enqueue(call{ - args: fnargs{ - fn: glfnUniform4ui, - a0: dst.c(), - a1: uintptr(v0), - a2: uintptr(v1), - a3: uintptr(v2), - a4: uintptr(v3), - }, - }) -} diff --git a/vendor/golang.org/x/mobile/gl/gldebug.go b/vendor/golang.org/x/mobile/gl/gldebug.go deleted file mode 100644 index 5a5777f..0000000 --- a/vendor/golang.org/x/mobile/gl/gldebug.go +++ /dev/null @@ -1,3673 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Code generated from gl.go using go generate. DO NOT EDIT. -// See doc.go for details. - -// +build linux darwin windows openbsd -// +build gldebug - -package gl - -import ( - "fmt" - "log" - "math" - "sync/atomic" - "unsafe" -) - -func (ctx *context) errDrain() string { - var errs []Enum - for { - e := ctx.GetError() - if e == 0 { - break - } - errs = append(errs, e) - } - if len(errs) > 0 { - return fmt.Sprintf(" error: %v", errs) - } - return "" -} - -func (ctx *context) enqueueDebug(c call) uintptr { - numCalls := atomic.AddInt32(&ctx.debug, 1) - if numCalls > 1 { - panic("concurrent calls made to the same GL context") - } - defer func() { - if atomic.AddInt32(&ctx.debug, -1) > 0 { - select {} // block so you see us in the panic - } - }() - - return ctx.enqueue(c) -} - -func (v Enum) String() string { - switch v { - case 0x0: - return "0" - case 0x1: - return "1" - case 0x2: - return "2" - case 0x3: - return "LINE_STRIP" - case 0x4: - return "4" - case 0x5: - return "TRIANGLE_STRIP" - case 0x6: - return "TRIANGLE_FAN" - case 0x300: - return "SRC_COLOR" - case 0x301: - return "ONE_MINUS_SRC_COLOR" - case 0x302: - return "SRC_ALPHA" - case 0x303: - return "ONE_MINUS_SRC_ALPHA" - case 0x304: - return "DST_ALPHA" - case 0x305: - return "ONE_MINUS_DST_ALPHA" - case 0x306: - return "DST_COLOR" - case 0x307: - return "ONE_MINUS_DST_COLOR" - case 0x308: - return "SRC_ALPHA_SATURATE" - case 0x8006: - return "FUNC_ADD" - case 0x8009: - return "32777" - case 0x883d: - return "BLEND_EQUATION_ALPHA" - case 0x800a: - return "FUNC_SUBTRACT" - case 0x800b: - return "FUNC_REVERSE_SUBTRACT" - case 0x80c8: - return "BLEND_DST_RGB" - case 0x80c9: - return "BLEND_SRC_RGB" - case 0x80ca: - return "BLEND_DST_ALPHA" - case 0x80cb: - return "BLEND_SRC_ALPHA" - case 0x8001: - return "CONSTANT_COLOR" - case 0x8002: - return "ONE_MINUS_CONSTANT_COLOR" - case 0x8003: - return "CONSTANT_ALPHA" - case 0x8004: - return "ONE_MINUS_CONSTANT_ALPHA" - case 0x8005: - return "BLEND_COLOR" - case 0x8892: - return "ARRAY_BUFFER" - case 0x8893: - return "ELEMENT_ARRAY_BUFFER" - case 0x8894: - return "ARRAY_BUFFER_BINDING" - case 0x8895: - return "ELEMENT_ARRAY_BUFFER_BINDING" - case 0x88e0: - return "STREAM_DRAW" - case 0x88e4: - return "STATIC_DRAW" - case 0x88e8: - return "DYNAMIC_DRAW" - case 0x8764: - return "BUFFER_SIZE" - case 0x8765: - return "BUFFER_USAGE" - case 0x8626: - return "CURRENT_VERTEX_ATTRIB" - case 0x404: - return "FRONT" - case 0x405: - return "BACK" - case 0x408: - return "FRONT_AND_BACK" - case 0xde1: - return "TEXTURE_2D" - case 0xb44: - return "CULL_FACE" - case 0xbe2: - return "BLEND" - case 0xbd0: - return "DITHER" - case 0xb90: - return "STENCIL_TEST" - case 0xb71: - return "DEPTH_TEST" - case 0xc11: - return "SCISSOR_TEST" - case 0x8037: - return "POLYGON_OFFSET_FILL" - case 0x809e: - return "SAMPLE_ALPHA_TO_COVERAGE" - case 0x80a0: - return "SAMPLE_COVERAGE" - case 0x500: - return "INVALID_ENUM" - case 0x501: - return "INVALID_VALUE" - case 0x502: - return "INVALID_OPERATION" - case 0x505: - return "OUT_OF_MEMORY" - case 0x900: - return "CW" - case 0x901: - return "CCW" - case 0xb21: - return "LINE_WIDTH" - case 0x846d: - return "ALIASED_POINT_SIZE_RANGE" - case 0x846e: - return "ALIASED_LINE_WIDTH_RANGE" - case 0xb45: - return "CULL_FACE_MODE" - case 0xb46: - return "FRONT_FACE" - case 0xb70: - return "DEPTH_RANGE" - case 0xb72: - return "DEPTH_WRITEMASK" - case 0xb73: - return "DEPTH_CLEAR_VALUE" - case 0xb74: - return "DEPTH_FUNC" - case 0xb91: - return "STENCIL_CLEAR_VALUE" - case 0xb92: - return "STENCIL_FUNC" - case 0xb94: - return "STENCIL_FAIL" - case 0xb95: - return "STENCIL_PASS_DEPTH_FAIL" - case 0xb96: - return "STENCIL_PASS_DEPTH_PASS" - case 0xb97: - return "STENCIL_REF" - case 0xb93: - return "STENCIL_VALUE_MASK" - case 0xb98: - return "STENCIL_WRITEMASK" - case 0x8800: - return "STENCIL_BACK_FUNC" - case 0x8801: - return "STENCIL_BACK_FAIL" - case 0x8802: - return "STENCIL_BACK_PASS_DEPTH_FAIL" - case 0x8803: - return "STENCIL_BACK_PASS_DEPTH_PASS" - case 0x8ca3: - return "STENCIL_BACK_REF" - case 0x8ca4: - return "STENCIL_BACK_VALUE_MASK" - case 0x8ca5: - return "STENCIL_BACK_WRITEMASK" - case 0xba2: - return "VIEWPORT" - case 0xc10: - return "SCISSOR_BOX" - case 0xc22: - return "COLOR_CLEAR_VALUE" - case 0xc23: - return "COLOR_WRITEMASK" - case 0xcf5: - return "UNPACK_ALIGNMENT" - case 0xd05: - return "PACK_ALIGNMENT" - case 0xd33: - return "MAX_TEXTURE_SIZE" - case 0xd3a: - return "MAX_VIEWPORT_DIMS" - case 0xd50: - return "SUBPIXEL_BITS" - case 0xd52: - return "RED_BITS" - case 0xd53: - return "GREEN_BITS" - case 0xd54: - return "BLUE_BITS" - case 0xd55: - return "ALPHA_BITS" - case 0xd56: - return "DEPTH_BITS" - case 0xd57: - return "STENCIL_BITS" - case 0x2a00: - return "POLYGON_OFFSET_UNITS" - case 0x8038: - return "POLYGON_OFFSET_FACTOR" - case 0x8069: - return "TEXTURE_BINDING_2D" - case 0x80a8: - return "SAMPLE_BUFFERS" - case 0x80a9: - return "SAMPLES" - case 0x80aa: - return "SAMPLE_COVERAGE_VALUE" - case 0x80ab: - return "SAMPLE_COVERAGE_INVERT" - case 0x86a2: - return "NUM_COMPRESSED_TEXTURE_FORMATS" - case 0x86a3: - return "COMPRESSED_TEXTURE_FORMATS" - case 0x1100: - return "DONT_CARE" - case 0x1101: - return "FASTEST" - case 0x1102: - return "NICEST" - case 0x8192: - return "GENERATE_MIPMAP_HINT" - case 0x1400: - return "BYTE" - case 0x1401: - return "UNSIGNED_BYTE" - case 0x1402: - return "SHORT" - case 0x1403: - return "UNSIGNED_SHORT" - case 0x1404: - return "INT" - case 0x1405: - return "UNSIGNED_INT" - case 0x1406: - return "FLOAT" - case 0x140c: - return "FIXED" - case 0x1902: - return "DEPTH_COMPONENT" - case 0x1906: - return "ALPHA" - case 0x1907: - return "RGB" - case 0x1908: - return "RGBA" - case 0x1909: - return "LUMINANCE" - case 0x190a: - return "LUMINANCE_ALPHA" - case 0x8033: - return "UNSIGNED_SHORT_4_4_4_4" - case 0x8034: - return "UNSIGNED_SHORT_5_5_5_1" - case 0x8363: - return "UNSIGNED_SHORT_5_6_5" - case 0x8869: - return "MAX_VERTEX_ATTRIBS" - case 0x8dfb: - return "MAX_VERTEX_UNIFORM_VECTORS" - case 0x8dfc: - return "MAX_VARYING_VECTORS" - case 0x8b4d: - return "MAX_COMBINED_TEXTURE_IMAGE_UNITS" - case 0x8b4c: - return "MAX_VERTEX_TEXTURE_IMAGE_UNITS" - case 0x8872: - return "MAX_TEXTURE_IMAGE_UNITS" - case 0x8dfd: - return "MAX_FRAGMENT_UNIFORM_VECTORS" - case 0x8b4f: - return "SHADER_TYPE" - case 0x8b80: - return "DELETE_STATUS" - case 0x8b82: - return "LINK_STATUS" - case 0x8b83: - return "VALIDATE_STATUS" - case 0x8b85: - return "ATTACHED_SHADERS" - case 0x8b86: - return "ACTIVE_UNIFORMS" - case 0x8b87: - return "ACTIVE_UNIFORM_MAX_LENGTH" - case 0x8b89: - return "ACTIVE_ATTRIBUTES" - case 0x8b8a: - return "ACTIVE_ATTRIBUTE_MAX_LENGTH" - case 0x8b8c: - return "SHADING_LANGUAGE_VERSION" - case 0x8b8d: - return "CURRENT_PROGRAM" - case 0x200: - return "NEVER" - case 0x201: - return "LESS" - case 0x202: - return "EQUAL" - case 0x203: - return "LEQUAL" - case 0x204: - return "GREATER" - case 0x205: - return "NOTEQUAL" - case 0x206: - return "GEQUAL" - case 0x207: - return "ALWAYS" - case 0x1e00: - return "KEEP" - case 0x1e01: - return "REPLACE" - case 0x1e02: - return "INCR" - case 0x1e03: - return "DECR" - case 0x150a: - return "INVERT" - case 0x8507: - return "INCR_WRAP" - case 0x8508: - return "DECR_WRAP" - case 0x1f00: - return "VENDOR" - case 0x1f01: - return "RENDERER" - case 0x1f02: - return "VERSION" - case 0x1f03: - return "EXTENSIONS" - case 0x2600: - return "NEAREST" - case 0x2601: - return "LINEAR" - case 0x2700: - return "NEAREST_MIPMAP_NEAREST" - case 0x2701: - return "LINEAR_MIPMAP_NEAREST" - case 0x2702: - return "NEAREST_MIPMAP_LINEAR" - case 0x2703: - return "LINEAR_MIPMAP_LINEAR" - case 0x2800: - return "TEXTURE_MAG_FILTER" - case 0x2801: - return "TEXTURE_MIN_FILTER" - case 0x2802: - return "TEXTURE_WRAP_S" - case 0x2803: - return "TEXTURE_WRAP_T" - case 0x1702: - return "TEXTURE" - case 0x8513: - return "TEXTURE_CUBE_MAP" - case 0x8514: - return "TEXTURE_BINDING_CUBE_MAP" - case 0x8515: - return "TEXTURE_CUBE_MAP_POSITIVE_X" - case 0x8516: - return "TEXTURE_CUBE_MAP_NEGATIVE_X" - case 0x8517: - return "TEXTURE_CUBE_MAP_POSITIVE_Y" - case 0x8518: - return "TEXTURE_CUBE_MAP_NEGATIVE_Y" - case 0x8519: - return "TEXTURE_CUBE_MAP_POSITIVE_Z" - case 0x851a: - return "TEXTURE_CUBE_MAP_NEGATIVE_Z" - case 0x851c: - return "MAX_CUBE_MAP_TEXTURE_SIZE" - case 0x84c0: - return "TEXTURE0" - case 0x84c1: - return "TEXTURE1" - case 0x84c2: - return "TEXTURE2" - case 0x84c3: - return "TEXTURE3" - case 0x84c4: - return "TEXTURE4" - case 0x84c5: - return "TEXTURE5" - case 0x84c6: - return "TEXTURE6" - case 0x84c7: - return "TEXTURE7" - case 0x84c8: - return "TEXTURE8" - case 0x84c9: - return "TEXTURE9" - case 0x84ca: - return "TEXTURE10" - case 0x84cb: - return "TEXTURE11" - case 0x84cc: - return "TEXTURE12" - case 0x84cd: - return "TEXTURE13" - case 0x84ce: - return "TEXTURE14" - case 0x84cf: - return "TEXTURE15" - case 0x84d0: - return "TEXTURE16" - case 0x84d1: - return "TEXTURE17" - case 0x84d2: - return "TEXTURE18" - case 0x84d3: - return "TEXTURE19" - case 0x84d4: - return "TEXTURE20" - case 0x84d5: - return "TEXTURE21" - case 0x84d6: - return "TEXTURE22" - case 0x84d7: - return "TEXTURE23" - case 0x84d8: - return "TEXTURE24" - case 0x84d9: - return "TEXTURE25" - case 0x84da: - return "TEXTURE26" - case 0x84db: - return "TEXTURE27" - case 0x84dc: - return "TEXTURE28" - case 0x84dd: - return "TEXTURE29" - case 0x84de: - return "TEXTURE30" - case 0x84df: - return "TEXTURE31" - case 0x84e0: - return "ACTIVE_TEXTURE" - case 0x2901: - return "REPEAT" - case 0x812f: - return "CLAMP_TO_EDGE" - case 0x8370: - return "MIRRORED_REPEAT" - case 0x8622: - return "VERTEX_ATTRIB_ARRAY_ENABLED" - case 0x8623: - return "VERTEX_ATTRIB_ARRAY_SIZE" - case 0x8624: - return "VERTEX_ATTRIB_ARRAY_STRIDE" - case 0x8625: - return "VERTEX_ATTRIB_ARRAY_TYPE" - case 0x886a: - return "VERTEX_ATTRIB_ARRAY_NORMALIZED" - case 0x8645: - return "VERTEX_ATTRIB_ARRAY_POINTER" - case 0x889f: - return "VERTEX_ATTRIB_ARRAY_BUFFER_BINDING" - case 0x8b9a: - return "IMPLEMENTATION_COLOR_READ_TYPE" - case 0x8b9b: - return "IMPLEMENTATION_COLOR_READ_FORMAT" - case 0x8b81: - return "COMPILE_STATUS" - case 0x8b84: - return "INFO_LOG_LENGTH" - case 0x8b88: - return "SHADER_SOURCE_LENGTH" - case 0x8dfa: - return "SHADER_COMPILER" - case 0x8df8: - return "SHADER_BINARY_FORMATS" - case 0x8df9: - return "NUM_SHADER_BINARY_FORMATS" - case 0x8df0: - return "LOW_FLOAT" - case 0x8df1: - return "MEDIUM_FLOAT" - case 0x8df2: - return "HIGH_FLOAT" - case 0x8df3: - return "LOW_INT" - case 0x8df4: - return "MEDIUM_INT" - case 0x8df5: - return "HIGH_INT" - case 0x8d40: - return "FRAMEBUFFER" - case 0x8d41: - return "RENDERBUFFER" - case 0x8056: - return "RGBA4" - case 0x8057: - return "RGB5_A1" - case 0x8d62: - return "RGB565" - case 0x81a5: - return "DEPTH_COMPONENT16" - case 0x8d48: - return "STENCIL_INDEX8" - case 0x8d42: - return "RENDERBUFFER_WIDTH" - case 0x8d43: - return "RENDERBUFFER_HEIGHT" - case 0x8d44: - return "RENDERBUFFER_INTERNAL_FORMAT" - case 0x8d50: - return "RENDERBUFFER_RED_SIZE" - case 0x8d51: - return "RENDERBUFFER_GREEN_SIZE" - case 0x8d52: - return "RENDERBUFFER_BLUE_SIZE" - case 0x8d53: - return "RENDERBUFFER_ALPHA_SIZE" - case 0x8d54: - return "RENDERBUFFER_DEPTH_SIZE" - case 0x8d55: - return "RENDERBUFFER_STENCIL_SIZE" - case 0x8cd0: - return "FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE" - case 0x8cd1: - return "FRAMEBUFFER_ATTACHMENT_OBJECT_NAME" - case 0x8cd2: - return "FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL" - case 0x8cd3: - return "FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE" - case 0x8ce0: - return "COLOR_ATTACHMENT0" - case 0x8d00: - return "DEPTH_ATTACHMENT" - case 0x8d20: - return "STENCIL_ATTACHMENT" - case 0x8cd5: - return "FRAMEBUFFER_COMPLETE" - case 0x8cd6: - return "FRAMEBUFFER_INCOMPLETE_ATTACHMENT" - case 0x8cd7: - return "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT" - case 0x8cd9: - return "FRAMEBUFFER_INCOMPLETE_DIMENSIONS" - case 0x8cdd: - return "FRAMEBUFFER_UNSUPPORTED" - case 0x8ca6: - return "36006" - case 0x8ca7: - return "RENDERBUFFER_BINDING" - case 0x84e8: - return "MAX_RENDERBUFFER_SIZE" - case 0x506: - return "INVALID_FRAMEBUFFER_OPERATION" - case 0x100: - return "DEPTH_BUFFER_BIT" - case 0x400: - return "STENCIL_BUFFER_BIT" - case 0x4000: - return "COLOR_BUFFER_BIT" - case 0x8b50: - return "FLOAT_VEC2" - case 0x8b51: - return "FLOAT_VEC3" - case 0x8b52: - return "FLOAT_VEC4" - case 0x8b53: - return "INT_VEC2" - case 0x8b54: - return "INT_VEC3" - case 0x8b55: - return "INT_VEC4" - case 0x8b56: - return "BOOL" - case 0x8b57: - return "BOOL_VEC2" - case 0x8b58: - return "BOOL_VEC3" - case 0x8b59: - return "BOOL_VEC4" - case 0x8b5a: - return "FLOAT_MAT2" - case 0x8b5b: - return "FLOAT_MAT3" - case 0x8b5c: - return "FLOAT_MAT4" - case 0x8b5e: - return "SAMPLER_2D" - case 0x8b60: - return "SAMPLER_CUBE" - case 0x8b30: - return "FRAGMENT_SHADER" - case 0x8b31: - return "VERTEX_SHADER" - case 0x8a35: - return "ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH" - case 0x8a36: - return "ACTIVE_UNIFORM_BLOCKS" - case 0x911a: - return "ALREADY_SIGNALED" - case 0x8c2f: - return "ANY_SAMPLES_PASSED" - case 0x8d6a: - return "ANY_SAMPLES_PASSED_CONSERVATIVE" - case 0x1905: - return "BLUE" - case 0x911f: - return "BUFFER_ACCESS_FLAGS" - case 0x9120: - return "BUFFER_MAP_LENGTH" - case 0x9121: - return "BUFFER_MAP_OFFSET" - case 0x88bc: - return "BUFFER_MAPPED" - case 0x88bd: - return "BUFFER_MAP_POINTER" - case 0x1800: - return "COLOR" - case 0x8cea: - return "COLOR_ATTACHMENT10" - case 0x8ce1: - return "COLOR_ATTACHMENT1" - case 0x8ceb: - return "COLOR_ATTACHMENT11" - case 0x8cec: - return "COLOR_ATTACHMENT12" - case 0x8ced: - return "COLOR_ATTACHMENT13" - case 0x8cee: - return "COLOR_ATTACHMENT14" - case 0x8cef: - return "COLOR_ATTACHMENT15" - case 0x8ce2: - return "COLOR_ATTACHMENT2" - case 0x8ce3: - return "COLOR_ATTACHMENT3" - case 0x8ce4: - return "COLOR_ATTACHMENT4" - case 0x8ce5: - return "COLOR_ATTACHMENT5" - case 0x8ce6: - return "COLOR_ATTACHMENT6" - case 0x8ce7: - return "COLOR_ATTACHMENT7" - case 0x8ce8: - return "COLOR_ATTACHMENT8" - case 0x8ce9: - return "COLOR_ATTACHMENT9" - case 0x884e: - return "COMPARE_REF_TO_TEXTURE" - case 0x9270: - return "COMPRESSED_R11_EAC" - case 0x9272: - return "COMPRESSED_RG11_EAC" - case 0x9274: - return "COMPRESSED_RGB8_ETC2" - case 0x9276: - return "COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2" - case 0x9278: - return "COMPRESSED_RGBA8_ETC2_EAC" - case 0x9271: - return "COMPRESSED_SIGNED_R11_EAC" - case 0x9273: - return "COMPRESSED_SIGNED_RG11_EAC" - case 0x9279: - return "COMPRESSED_SRGB8_ALPHA8_ETC2_EAC" - case 0x9275: - return "COMPRESSED_SRGB8_ETC2" - case 0x9277: - return "COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2" - case 0x911c: - return "CONDITION_SATISFIED" - case 0x8f36: - return "36662" - case 0x8f37: - return "36663" - case 0x8865: - return "CURRENT_QUERY" - case 0x1801: - return "DEPTH" - case 0x88f0: - return "DEPTH24_STENCIL8" - case 0x8cad: - return "DEPTH32F_STENCIL8" - case 0x81a6: - return "DEPTH_COMPONENT24" - case 0x8cac: - return "DEPTH_COMPONENT32F" - case 0x84f9: - return "DEPTH_STENCIL" - case 0x821a: - return "DEPTH_STENCIL_ATTACHMENT" - case 0x8825: - return "DRAW_BUFFER0" - case 0x882f: - return "DRAW_BUFFER10" - case 0x8826: - return "DRAW_BUFFER1" - case 0x8830: - return "DRAW_BUFFER11" - case 0x8831: - return "DRAW_BUFFER12" - case 0x8832: - return "DRAW_BUFFER13" - case 0x8833: - return "DRAW_BUFFER14" - case 0x8834: - return "DRAW_BUFFER15" - case 0x8827: - return "DRAW_BUFFER2" - case 0x8828: - return "DRAW_BUFFER3" - case 0x8829: - return "DRAW_BUFFER4" - case 0x882a: - return "DRAW_BUFFER5" - case 0x882b: - return "DRAW_BUFFER6" - case 0x882c: - return "DRAW_BUFFER7" - case 0x882d: - return "DRAW_BUFFER8" - case 0x882e: - return "DRAW_BUFFER9" - case 0x8ca9: - return "DRAW_FRAMEBUFFER" - case 0x88ea: - return "DYNAMIC_COPY" - case 0x88e9: - return "DYNAMIC_READ" - case 0x8dad: - return "FLOAT_32_UNSIGNED_INT_24_8_REV" - case 0x8b65: - return "FLOAT_MAT2x3" - case 0x8b66: - return "FLOAT_MAT2x4" - case 0x8b67: - return "FLOAT_MAT3x2" - case 0x8b68: - return "FLOAT_MAT3x4" - case 0x8b69: - return "FLOAT_MAT4x2" - case 0x8b6a: - return "FLOAT_MAT4x3" - case 0x8b8b: - return "FRAGMENT_SHADER_DERIVATIVE_HINT" - case 0x8215: - return "FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE" - case 0x8214: - return "FRAMEBUFFER_ATTACHMENT_BLUE_SIZE" - case 0x8210: - return "FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING" - case 0x8211: - return "FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE" - case 0x8216: - return "FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE" - case 0x8213: - return "FRAMEBUFFER_ATTACHMENT_GREEN_SIZE" - case 0x8212: - return "FRAMEBUFFER_ATTACHMENT_RED_SIZE" - case 0x8217: - return "FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE" - case 0x8cd4: - return "FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER" - case 0x8218: - return "FRAMEBUFFER_DEFAULT" - case 0x8d56: - return "FRAMEBUFFER_INCOMPLETE_MULTISAMPLE" - case 0x8219: - return "FRAMEBUFFER_UNDEFINED" - case 0x1904: - return "GREEN" - case 0x140b: - return "HALF_FLOAT" - case 0x8d9f: - return "INT_2_10_10_10_REV" - case 0x8c8c: - return "INTERLEAVED_ATTRIBS" - case 0x8dca: - return "INT_SAMPLER_2D" - case 0x8dcf: - return "INT_SAMPLER_2D_ARRAY" - case 0x8dcb: - return "INT_SAMPLER_3D" - case 0x8dcc: - return "INT_SAMPLER_CUBE" - case 0xffffffff: - return "INVALID_INDEX" - case 0x821b: - return "MAJOR_VERSION" - case 0x10: - return "MAP_FLUSH_EXPLICIT_BIT" - case 0x8: - return "MAP_INVALIDATE_BUFFER_BIT" - case 0x20: - return "MAP_UNSYNCHRONIZED_BIT" - case 0x8008: - return "MAX" - case 0x8073: - return "MAX_3D_TEXTURE_SIZE" - case 0x88ff: - return "MAX_ARRAY_TEXTURE_LAYERS" - case 0x8cdf: - return "MAX_COLOR_ATTACHMENTS" - case 0x8a33: - return "MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS" - case 0x8a2e: - return "MAX_COMBINED_UNIFORM_BLOCKS" - case 0x8a31: - return "MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS" - case 0x8824: - return "MAX_DRAW_BUFFERS" - case 0x8d6b: - return "MAX_ELEMENT_INDEX" - case 0x80e9: - return "MAX_ELEMENTS_INDICES" - case 0x80e8: - return "MAX_ELEMENTS_VERTICES" - case 0x9125: - return "MAX_FRAGMENT_INPUT_COMPONENTS" - case 0x8a2d: - return "MAX_FRAGMENT_UNIFORM_BLOCKS" - case 0x8b49: - return "MAX_FRAGMENT_UNIFORM_COMPONENTS" - case 0x8905: - return "MAX_PROGRAM_TEXEL_OFFSET" - case 0x8d57: - return "MAX_SAMPLES" - case 0x9111: - return "MAX_SERVER_WAIT_TIMEOUT" - case 0x84fd: - return "MAX_TEXTURE_LOD_BIAS" - case 0x8c8a: - return "MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS" - case 0x8c8b: - return "MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS" - case 0x8c80: - return "MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS" - case 0x8a30: - return "MAX_UNIFORM_BLOCK_SIZE" - case 0x8a2f: - return "MAX_UNIFORM_BUFFER_BINDINGS" - case 0x8b4b: - return "MAX_VARYING_COMPONENTS" - case 0x9122: - return "MAX_VERTEX_OUTPUT_COMPONENTS" - case 0x8a2b: - return "MAX_VERTEX_UNIFORM_BLOCKS" - case 0x8b4a: - return "MAX_VERTEX_UNIFORM_COMPONENTS" - case 0x8007: - return "MIN" - case 0x821c: - return "MINOR_VERSION" - case 0x8904: - return "MIN_PROGRAM_TEXEL_OFFSET" - case 0x821d: - return "NUM_EXTENSIONS" - case 0x87fe: - return "NUM_PROGRAM_BINARY_FORMATS" - case 0x9380: - return "NUM_SAMPLE_COUNTS" - case 0x9112: - return "OBJECT_TYPE" - case 0xd02: - return "PACK_ROW_LENGTH" - case 0xd04: - return "PACK_SKIP_PIXELS" - case 0xd03: - return "PACK_SKIP_ROWS" - case 0x88eb: - return "PIXEL_PACK_BUFFER" - case 0x88ed: - return "PIXEL_PACK_BUFFER_BINDING" - case 0x88ec: - return "PIXEL_UNPACK_BUFFER" - case 0x88ef: - return "PIXEL_UNPACK_BUFFER_BINDING" - case 0x8d69: - return "PRIMITIVE_RESTART_FIXED_INDEX" - case 0x87ff: - return "PROGRAM_BINARY_FORMATS" - case 0x8741: - return "PROGRAM_BINARY_LENGTH" - case 0x8257: - return "PROGRAM_BINARY_RETRIEVABLE_HINT" - case 0x8866: - return "QUERY_RESULT" - case 0x8867: - return "QUERY_RESULT_AVAILABLE" - case 0x8c3a: - return "R11F_G11F_B10F" - case 0x822d: - return "R16F" - case 0x8233: - return "R16I" - case 0x8234: - return "R16UI" - case 0x822e: - return "R32F" - case 0x8235: - return "R32I" - case 0x8236: - return "R32UI" - case 0x8229: - return "R8" - case 0x8231: - return "R8I" - case 0x8f94: - return "R8_SNORM" - case 0x8232: - return "R8UI" - case 0x8c89: - return "RASTERIZER_DISCARD" - case 0xc02: - return "READ_BUFFER" - case 0x8ca8: - return "READ_FRAMEBUFFER" - case 0x8caa: - return "READ_FRAMEBUFFER_BINDING" - case 0x1903: - return "RED" - case 0x8d94: - return "RED_INTEGER" - case 0x8cab: - return "RENDERBUFFER_SAMPLES" - case 0x8227: - return "RG" - case 0x822f: - return "RG16F" - case 0x8239: - return "RG16I" - case 0x823a: - return "RG16UI" - case 0x8230: - return "RG32F" - case 0x823b: - return "RG32I" - case 0x823c: - return "RG32UI" - case 0x822b: - return "RG8" - case 0x8237: - return "RG8I" - case 0x8f95: - return "RG8_SNORM" - case 0x8238: - return "RG8UI" - case 0x8059: - return "RGB10_A2" - case 0x906f: - return "RGB10_A2UI" - case 0x881b: - return "RGB16F" - case 0x8d89: - return "RGB16I" - case 0x8d77: - return "RGB16UI" - case 0x8815: - return "RGB32F" - case 0x8d83: - return "RGB32I" - case 0x8d71: - return "RGB32UI" - case 0x8051: - return "RGB8" - case 0x8d8f: - return "RGB8I" - case 0x8f96: - return "RGB8_SNORM" - case 0x8d7d: - return "RGB8UI" - case 0x8c3d: - return "RGB9_E5" - case 0x881a: - return "RGBA16F" - case 0x8d88: - return "RGBA16I" - case 0x8d76: - return "RGBA16UI" - case 0x8814: - return "RGBA32F" - case 0x8d82: - return "RGBA32I" - case 0x8d70: - return "RGBA32UI" - case 0x8058: - return "RGBA8" - case 0x8d8e: - return "RGBA8I" - case 0x8f97: - return "RGBA8_SNORM" - case 0x8d7c: - return "RGBA8UI" - case 0x8d99: - return "RGBA_INTEGER" - case 0x8d98: - return "RGB_INTEGER" - case 0x8228: - return "RG_INTEGER" - case 0x8dc1: - return "SAMPLER_2D_ARRAY" - case 0x8dc4: - return "SAMPLER_2D_ARRAY_SHADOW" - case 0x8b62: - return "SAMPLER_2D_SHADOW" - case 0x8b5f: - return "SAMPLER_3D" - case 0x8919: - return "SAMPLER_BINDING" - case 0x8dc5: - return "SAMPLER_CUBE_SHADOW" - case 0x8c8d: - return "SEPARATE_ATTRIBS" - case 0x9119: - return "SIGNALED" - case 0x8f9c: - return "SIGNED_NORMALIZED" - case 0x8c40: - return "SRGB" - case 0x8c41: - return "SRGB8" - case 0x8c43: - return "SRGB8_ALPHA8" - case 0x88e6: - return "STATIC_COPY" - case 0x88e5: - return "STATIC_READ" - case 0x1802: - return "STENCIL" - case 0x88e2: - return "STREAM_COPY" - case 0x88e1: - return "STREAM_READ" - case 0x9113: - return "SYNC_CONDITION" - case 0x9116: - return "SYNC_FENCE" - case 0x9115: - return "SYNC_FLAGS" - case 0x9117: - return "SYNC_GPU_COMMANDS_COMPLETE" - case 0x9114: - return "SYNC_STATUS" - case 0x8c1a: - return "TEXTURE_2D_ARRAY" - case 0x806f: - return "TEXTURE_3D" - case 0x813c: - return "TEXTURE_BASE_LEVEL" - case 0x8c1d: - return "TEXTURE_BINDING_2D_ARRAY" - case 0x806a: - return "TEXTURE_BINDING_3D" - case 0x884d: - return "TEXTURE_COMPARE_FUNC" - case 0x884c: - return "TEXTURE_COMPARE_MODE" - case 0x912f: - return "TEXTURE_IMMUTABLE_FORMAT" - case 0x82df: - return "TEXTURE_IMMUTABLE_LEVELS" - case 0x813d: - return "TEXTURE_MAX_LEVEL" - case 0x813b: - return "TEXTURE_MAX_LOD" - case 0x813a: - return "TEXTURE_MIN_LOD" - case 0x8e45: - return "TEXTURE_SWIZZLE_A" - case 0x8e44: - return "TEXTURE_SWIZZLE_B" - case 0x8e43: - return "TEXTURE_SWIZZLE_G" - case 0x8e42: - return "TEXTURE_SWIZZLE_R" - case 0x8072: - return "TEXTURE_WRAP_R" - case 0x911b: - return "TIMEOUT_EXPIRED" - case 0x8e22: - return "TRANSFORM_FEEDBACK" - case 0x8e24: - return "TRANSFORM_FEEDBACK_ACTIVE" - case 0x8e25: - return "TRANSFORM_FEEDBACK_BINDING" - case 0x8c8e: - return "TRANSFORM_FEEDBACK_BUFFER" - case 0x8c8f: - return "TRANSFORM_FEEDBACK_BUFFER_BINDING" - case 0x8c7f: - return "TRANSFORM_FEEDBACK_BUFFER_MODE" - case 0x8c85: - return "TRANSFORM_FEEDBACK_BUFFER_SIZE" - case 0x8c84: - return "TRANSFORM_FEEDBACK_BUFFER_START" - case 0x8e23: - return "TRANSFORM_FEEDBACK_PAUSED" - case 0x8c88: - return "TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN" - case 0x8c76: - return "TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH" - case 0x8c83: - return "TRANSFORM_FEEDBACK_VARYINGS" - case 0x8a3c: - return "UNIFORM_ARRAY_STRIDE" - case 0x8a43: - return "UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES" - case 0x8a42: - return "UNIFORM_BLOCK_ACTIVE_UNIFORMS" - case 0x8a3f: - return "UNIFORM_BLOCK_BINDING" - case 0x8a40: - return "UNIFORM_BLOCK_DATA_SIZE" - case 0x8a3a: - return "UNIFORM_BLOCK_INDEX" - case 0x8a41: - return "UNIFORM_BLOCK_NAME_LENGTH" - case 0x8a46: - return "UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER" - case 0x8a44: - return "UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER" - case 0x8a11: - return "UNIFORM_BUFFER" - case 0x8a28: - return "UNIFORM_BUFFER_BINDING" - case 0x8a34: - return "UNIFORM_BUFFER_OFFSET_ALIGNMENT" - case 0x8a2a: - return "UNIFORM_BUFFER_SIZE" - case 0x8a29: - return "UNIFORM_BUFFER_START" - case 0x8a3e: - return "UNIFORM_IS_ROW_MAJOR" - case 0x8a3d: - return "UNIFORM_MATRIX_STRIDE" - case 0x8a39: - return "UNIFORM_NAME_LENGTH" - case 0x8a3b: - return "UNIFORM_OFFSET" - case 0x8a38: - return "UNIFORM_SIZE" - case 0x8a37: - return "UNIFORM_TYPE" - case 0x806e: - return "UNPACK_IMAGE_HEIGHT" - case 0xcf2: - return "UNPACK_ROW_LENGTH" - case 0x806d: - return "UNPACK_SKIP_IMAGES" - case 0xcf4: - return "UNPACK_SKIP_PIXELS" - case 0xcf3: - return "UNPACK_SKIP_ROWS" - case 0x9118: - return "UNSIGNALED" - case 0x8c3b: - return "UNSIGNED_INT_10F_11F_11F_REV" - case 0x8368: - return "UNSIGNED_INT_2_10_10_10_REV" - case 0x84fa: - return "UNSIGNED_INT_24_8" - case 0x8c3e: - return "UNSIGNED_INT_5_9_9_9_REV" - case 0x8dd2: - return "UNSIGNED_INT_SAMPLER_2D" - case 0x8dd7: - return "UNSIGNED_INT_SAMPLER_2D_ARRAY" - case 0x8dd3: - return "UNSIGNED_INT_SAMPLER_3D" - case 0x8dd4: - return "UNSIGNED_INT_SAMPLER_CUBE" - case 0x8dc6: - return "UNSIGNED_INT_VEC2" - case 0x8dc7: - return "UNSIGNED_INT_VEC3" - case 0x8dc8: - return "UNSIGNED_INT_VEC4" - case 0x8c17: - return "UNSIGNED_NORMALIZED" - case 0x85b5: - return "VERTEX_ARRAY_BINDING" - case 0x88fe: - return "VERTEX_ATTRIB_ARRAY_DIVISOR" - case 0x88fd: - return "VERTEX_ATTRIB_ARRAY_INTEGER" - case 0x911d: - return "WAIT_FAILED" - default: - return fmt.Sprintf("gl.Enum(0x%x)", uint32(v)) - } -} - -func (ctx *context) ActiveTexture(texture Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.ActiveTexture(%v) %v", texture, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnActiveTexture, - a0: texture.c(), - }, - blocking: true}) -} - -func (ctx *context) AttachShader(p Program, s Shader) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.AttachShader(%v, %v) %v", p, s, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnAttachShader, - a0: p.c(), - a1: s.c(), - }, - blocking: true}) -} - -func (ctx *context) BindAttribLocation(p Program, a Attrib, name string) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BindAttribLocation(%v, %v, %v) %v", p, a, name, errstr) - }() - s, free := ctx.cString(name) - defer free() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBindAttribLocation, - a0: p.c(), - a1: a.c(), - a2: s, - }, - blocking: true, - }) -} - -func (ctx *context) BindBuffer(target Enum, b Buffer) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BindBuffer(%v, %v) %v", target, b, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBindBuffer, - a0: target.c(), - a1: b.c(), - }, - blocking: true}) -} - -func (ctx *context) BindFramebuffer(target Enum, fb Framebuffer) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BindFramebuffer(%v, %v) %v", target, fb, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBindFramebuffer, - a0: target.c(), - a1: fb.c(), - }, - blocking: true}) -} - -func (ctx *context) BindRenderbuffer(target Enum, rb Renderbuffer) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BindRenderbuffer(%v, %v) %v", target, rb, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBindRenderbuffer, - a0: target.c(), - a1: rb.c(), - }, - blocking: true}) -} - -func (ctx *context) BindTexture(target Enum, t Texture) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BindTexture(%v, %v) %v", target, t, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBindTexture, - a0: target.c(), - a1: t.c(), - }, - blocking: true}) -} - -func (ctx *context) BindVertexArray(va VertexArray) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BindVertexArray(%v) %v", va, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBindVertexArray, - a0: va.c(), - }, - blocking: true}) -} - -func (ctx *context) BlendColor(red, green, blue, alpha float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BlendColor(%v, %v, %v, %v) %v", red, green, blue, alpha, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBlendColor, - a0: uintptr(math.Float32bits(red)), - a1: uintptr(math.Float32bits(green)), - a2: uintptr(math.Float32bits(blue)), - a3: uintptr(math.Float32bits(alpha)), - }, - blocking: true}) -} - -func (ctx *context) BlendEquation(mode Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BlendEquation(%v) %v", mode, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBlendEquation, - a0: mode.c(), - }, - blocking: true}) -} - -func (ctx *context) BlendEquationSeparate(modeRGB, modeAlpha Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BlendEquationSeparate(%v, %v) %v", modeRGB, modeAlpha, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBlendEquationSeparate, - a0: modeRGB.c(), - a1: modeAlpha.c(), - }, - blocking: true}) -} - -func (ctx *context) BlendFunc(sfactor, dfactor Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BlendFunc(%v, %v) %v", sfactor, dfactor, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBlendFunc, - a0: sfactor.c(), - a1: dfactor.c(), - }, - blocking: true}) -} - -func (ctx *context) BlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BlendFuncSeparate(%v, %v, %v, %v) %v", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBlendFuncSeparate, - a0: sfactorRGB.c(), - a1: dfactorRGB.c(), - a2: sfactorAlpha.c(), - a3: dfactorAlpha.c(), - }, - blocking: true}) -} - -func (ctx *context) BufferData(target Enum, src []byte, usage Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BufferData(%v, len(%d), %v) %v", target, len(src), usage, errstr) - }() - parg := unsafe.Pointer(nil) - if len(src) > 0 { - parg = unsafe.Pointer(&src[0]) - } - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBufferData, - a0: target.c(), - a1: uintptr(len(src)), - a2: usage.c(), - }, - parg: parg, - blocking: true, - }) -} - -func (ctx *context) BufferInit(target Enum, size int, usage Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BufferInit(%v, %v, %v) %v", target, size, usage, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBufferData, - a0: target.c(), - a1: uintptr(size), - a2: usage.c(), - }, - parg: unsafe.Pointer(nil), - blocking: true}) -} - -func (ctx *context) BufferSubData(target Enum, offset int, data []byte) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BufferSubData(%v, %v, len(%d)) %v", target, offset, len(data), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBufferSubData, - a0: target.c(), - a1: uintptr(offset), - a2: uintptr(len(data)), - }, - parg: unsafe.Pointer(&data[0]), - blocking: true, - }) -} - -func (ctx *context) CheckFramebufferStatus(target Enum) (r0 Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CheckFramebufferStatus(%v) %v%v", target, r0, errstr) - }() - return Enum(ctx.enqueue(call{ - args: fnargs{ - fn: glfnCheckFramebufferStatus, - a0: target.c(), - }, - blocking: true, - })) -} - -func (ctx *context) Clear(mask Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Clear(%v) %v", mask, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnClear, - a0: uintptr(mask), - }, - blocking: true}) -} - -func (ctx *context) ClearColor(red, green, blue, alpha float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.ClearColor(%v, %v, %v, %v) %v", red, green, blue, alpha, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnClearColor, - a0: uintptr(math.Float32bits(red)), - a1: uintptr(math.Float32bits(green)), - a2: uintptr(math.Float32bits(blue)), - a3: uintptr(math.Float32bits(alpha)), - }, - blocking: true}) -} - -func (ctx *context) ClearDepthf(d float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.ClearDepthf(%v) %v", d, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnClearDepthf, - a0: uintptr(math.Float32bits(d)), - }, - blocking: true}) -} - -func (ctx *context) ClearStencil(s int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.ClearStencil(%v) %v", s, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnClearStencil, - a0: uintptr(s), - }, - blocking: true}) -} - -func (ctx *context) ColorMask(red, green, blue, alpha bool) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.ColorMask(%v, %v, %v, %v) %v", red, green, blue, alpha, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnColorMask, - a0: glBoolean(red), - a1: glBoolean(green), - a2: glBoolean(blue), - a3: glBoolean(alpha), - }, - blocking: true}) -} - -func (ctx *context) CompileShader(s Shader) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CompileShader(%v) %v", s, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnCompileShader, - a0: s.c(), - }, - blocking: true}) -} - -func (ctx *context) CompressedTexImage2D(target Enum, level int, internalformat Enum, width, height, border int, data []byte) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CompressedTexImage2D(%v, %v, %v, %v, %v, %v, len(%d)) %v", target, level, internalformat, width, height, border, len(data), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnCompressedTexImage2D, - a0: target.c(), - a1: uintptr(level), - a2: internalformat.c(), - a3: uintptr(width), - a4: uintptr(height), - a5: uintptr(border), - a6: uintptr(len(data)), - }, - parg: unsafe.Pointer(&data[0]), - blocking: true, - }) -} - -func (ctx *context) CompressedTexSubImage2D(target Enum, level, xoffset, yoffset, width, height int, format Enum, data []byte) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CompressedTexSubImage2D(%v, %v, %v, %v, %v, %v, %v, len(%d)) %v", target, level, xoffset, yoffset, width, height, format, len(data), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnCompressedTexSubImage2D, - a0: target.c(), - a1: uintptr(level), - a2: uintptr(xoffset), - a3: uintptr(yoffset), - a4: uintptr(width), - a5: uintptr(height), - a6: format.c(), - a7: uintptr(len(data)), - }, - parg: unsafe.Pointer(&data[0]), - blocking: true, - }) -} - -func (ctx *context) CopyTexImage2D(target Enum, level int, internalformat Enum, x, y, width, height, border int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CopyTexImage2D(%v, %v, %v, %v, %v, %v, %v, %v) %v", target, level, internalformat, x, y, width, height, border, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnCopyTexImage2D, - a0: target.c(), - a1: uintptr(level), - a2: internalformat.c(), - a3: uintptr(x), - a4: uintptr(y), - a5: uintptr(width), - a6: uintptr(height), - a7: uintptr(border), - }, - blocking: true}) -} - -func (ctx *context) CopyTexSubImage2D(target Enum, level, xoffset, yoffset, x, y, width, height int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CopyTexSubImage2D(%v, %v, %v, %v, %v, %v, %v, %v) %v", target, level, xoffset, yoffset, x, y, width, height, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnCopyTexSubImage2D, - a0: target.c(), - a1: uintptr(level), - a2: uintptr(xoffset), - a3: uintptr(yoffset), - a4: uintptr(x), - a5: uintptr(y), - a6: uintptr(width), - a7: uintptr(height), - }, - blocking: true}) -} - -func (ctx *context) CreateBuffer() (r0 Buffer) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CreateBuffer() %v%v", r0, errstr) - }() - return Buffer{Value: uint32(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGenBuffer, - }, - blocking: true, - }))} -} - -func (ctx *context) CreateFramebuffer() (r0 Framebuffer) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CreateFramebuffer() %v%v", r0, errstr) - }() - return Framebuffer{Value: uint32(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGenFramebuffer, - }, - blocking: true, - }))} -} - -func (ctx *context) CreateProgram() (r0 Program) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CreateProgram() %v%v", r0, errstr) - }() - return Program{ - Init: true, - Value: uint32(ctx.enqueue(call{ - args: fnargs{ - fn: glfnCreateProgram, - }, - blocking: true, - }, - ))} -} - -func (ctx *context) CreateRenderbuffer() (r0 Renderbuffer) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CreateRenderbuffer() %v%v", r0, errstr) - }() - return Renderbuffer{Value: uint32(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGenRenderbuffer, - }, - blocking: true, - }))} -} - -func (ctx *context) CreateShader(ty Enum) (r0 Shader) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CreateShader(%v) %v%v", ty, r0, errstr) - }() - return Shader{Value: uint32(ctx.enqueue(call{ - args: fnargs{ - fn: glfnCreateShader, - a0: uintptr(ty), - }, - blocking: true, - }))} -} - -func (ctx *context) CreateTexture() (r0 Texture) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CreateTexture() %v%v", r0, errstr) - }() - return Texture{Value: uint32(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGenTexture, - }, - blocking: true, - }))} -} - -func (ctx *context) CreateVertexArray() (r0 VertexArray) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CreateVertexArray() %v%v", r0, errstr) - }() - return VertexArray{Value: uint32(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGenVertexArray, - }, - blocking: true, - }))} -} - -func (ctx *context) CullFace(mode Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.CullFace(%v) %v", mode, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnCullFace, - a0: mode.c(), - }, - blocking: true}) -} - -func (ctx *context) DeleteBuffer(v Buffer) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DeleteBuffer(%v) %v", v, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDeleteBuffer, - a0: v.c(), - }, - blocking: true}) -} - -func (ctx *context) DeleteFramebuffer(v Framebuffer) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DeleteFramebuffer(%v) %v", v, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDeleteFramebuffer, - a0: v.c(), - }, - blocking: true}) -} - -func (ctx *context) DeleteProgram(p Program) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DeleteProgram(%v) %v", p, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDeleteProgram, - a0: p.c(), - }, - blocking: true}) -} - -func (ctx *context) DeleteRenderbuffer(v Renderbuffer) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DeleteRenderbuffer(%v) %v", v, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDeleteRenderbuffer, - a0: v.c(), - }, - blocking: true}) -} - -func (ctx *context) DeleteShader(s Shader) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DeleteShader(%v) %v", s, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDeleteShader, - a0: s.c(), - }, - blocking: true}) -} - -func (ctx *context) DeleteTexture(v Texture) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DeleteTexture(%v) %v", v, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDeleteTexture, - a0: v.c(), - }, - blocking: true}) -} - -func (ctx *context) DeleteVertexArray(v VertexArray) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DeleteVertexArray(%v) %v", v, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDeleteVertexArray, - a0: v.c(), - }, - blocking: true}) -} - -func (ctx *context) DepthFunc(fn Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DepthFunc(%v) %v", fn, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDepthFunc, - a0: fn.c(), - }, - blocking: true}) -} - -func (ctx *context) DepthMask(flag bool) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DepthMask(%v) %v", flag, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDepthMask, - a0: glBoolean(flag), - }, - blocking: true}) -} - -func (ctx *context) DepthRangef(n, f float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DepthRangef(%v, %v) %v", n, f, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDepthRangef, - a0: uintptr(math.Float32bits(n)), - a1: uintptr(math.Float32bits(f)), - }, - blocking: true}) -} - -func (ctx *context) DetachShader(p Program, s Shader) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DetachShader(%v, %v) %v", p, s, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDetachShader, - a0: p.c(), - a1: s.c(), - }, - blocking: true}) -} - -func (ctx *context) Disable(cap Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Disable(%v) %v", cap, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDisable, - a0: cap.c(), - }, - blocking: true}) -} - -func (ctx *context) DisableVertexAttribArray(a Attrib) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DisableVertexAttribArray(%v) %v", a, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDisableVertexAttribArray, - a0: a.c(), - }, - blocking: true}) -} - -func (ctx *context) DrawArrays(mode Enum, first, count int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DrawArrays(%v, %v, %v) %v", mode, first, count, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDrawArrays, - a0: mode.c(), - a1: uintptr(first), - a2: uintptr(count), - }, - blocking: true}) -} - -func (ctx *context) DrawElements(mode Enum, count int, ty Enum, offset int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.DrawElements(%v, %v, %v, %v) %v", mode, count, ty, offset, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnDrawElements, - a0: mode.c(), - a1: uintptr(count), - a2: ty.c(), - a3: uintptr(offset), - }, - blocking: true}) -} - -func (ctx *context) Enable(cap Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Enable(%v) %v", cap, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnEnable, - a0: cap.c(), - }, - blocking: true}) -} - -func (ctx *context) EnableVertexAttribArray(a Attrib) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.EnableVertexAttribArray(%v) %v", a, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnEnableVertexAttribArray, - a0: a.c(), - }, - blocking: true}) -} - -func (ctx *context) Finish() { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Finish() %v", errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnFinish, - }, - blocking: true, - }) -} - -func (ctx *context) Flush() { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Flush() %v", errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnFlush, - }, - blocking: true, - }) -} - -func (ctx *context) FramebufferRenderbuffer(target, attachment, rbTarget Enum, rb Renderbuffer) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.FramebufferRenderbuffer(%v, %v, %v, %v) %v", target, attachment, rbTarget, rb, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnFramebufferRenderbuffer, - a0: target.c(), - a1: attachment.c(), - a2: rbTarget.c(), - a3: rb.c(), - }, - blocking: true}) -} - -func (ctx *context) FramebufferTexture2D(target, attachment, texTarget Enum, t Texture, level int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.FramebufferTexture2D(%v, %v, %v, %v, %v) %v", target, attachment, texTarget, t, level, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnFramebufferTexture2D, - a0: target.c(), - a1: attachment.c(), - a2: texTarget.c(), - a3: t.c(), - a4: uintptr(level), - }, - blocking: true}) -} - -func (ctx *context) FrontFace(mode Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.FrontFace(%v) %v", mode, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnFrontFace, - a0: mode.c(), - }, - blocking: true}) -} - -func (ctx *context) GenerateMipmap(target Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GenerateMipmap(%v) %v", target, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnGenerateMipmap, - a0: target.c(), - }, - blocking: true}) -} - -func (ctx *context) GetActiveAttrib(p Program, index uint32) (name string, size int, ty Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetActiveAttrib(%v, %v) (%v, %v, %v) %v", p, index, name, size, ty, errstr) - }() - bufSize := ctx.GetProgrami(p, ACTIVE_ATTRIBUTE_MAX_LENGTH) - buf := make([]byte, bufSize) - var cType int - cSize := ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetActiveAttrib, - a0: p.c(), - a1: uintptr(index), - a2: uintptr(bufSize), - a3: uintptr(unsafe.Pointer(&cType)), - }, - parg: unsafe.Pointer(&buf[0]), - blocking: true, - }) - return goString(buf), int(cSize), Enum(cType) -} - -func (ctx *context) GetActiveUniform(p Program, index uint32) (name string, size int, ty Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetActiveUniform(%v, %v) (%v, %v, %v) %v", p, index, name, size, ty, errstr) - }() - bufSize := ctx.GetProgrami(p, ACTIVE_UNIFORM_MAX_LENGTH) - buf := make([]byte, bufSize+8) - var cType int - cSize := ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetActiveUniform, - a0: p.c(), - a1: uintptr(index), - a2: uintptr(bufSize), - a3: uintptr(unsafe.Pointer(&cType)), - }, - parg: unsafe.Pointer(&buf[0]), - blocking: true, - }) - return goString(buf), int(cSize), Enum(cType) -} - -func (ctx *context) GetAttachedShaders(p Program) (r0 []Shader) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetAttachedShaders(%v) %v%v", p, r0, errstr) - }() - shadersLen := ctx.GetProgrami(p, ATTACHED_SHADERS) - if shadersLen == 0 { - return nil - } - buf := make([]uint32, shadersLen) - n := int(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetAttachedShaders, - a0: p.c(), - a1: uintptr(shadersLen), - }, - parg: unsafe.Pointer(&buf[0]), - blocking: true, - })) - buf = buf[:int(n)] - shaders := make([]Shader, len(buf)) - for i, s := range buf { - shaders[i] = Shader{Value: uint32(s)} - } - return shaders -} - -func (ctx *context) GetAttribLocation(p Program, name string) (r0 Attrib) { - defer func() { - errstr := ctx.errDrain() - r0.name = name - log.Printf("gl.GetAttribLocation(%v, %v) %v%v", p, name, r0, errstr) - }() - s, free := ctx.cString(name) - defer free() - return Attrib{Value: uint(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetAttribLocation, - a0: p.c(), - a1: s, - }, - blocking: true, - }))} -} - -func (ctx *context) GetBooleanv(dst []bool, pname Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetBooleanv(%v, %v) %v", dst, pname, errstr) - }() - buf := make([]int32, len(dst)) - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnGetBooleanv, - a0: pname.c(), - }, - parg: unsafe.Pointer(&buf[0]), - blocking: true, - }) - for i, v := range buf { - dst[i] = v != 0 - } -} - -func (ctx *context) GetFloatv(dst []float32, pname Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetFloatv(len(%d), %v) %v", len(dst), pname, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnGetFloatv, - a0: pname.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -func (ctx *context) GetIntegerv(dst []int32, pname Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetIntegerv(%v, %v) %v", dst, pname, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnGetIntegerv, - a0: pname.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -func (ctx *context) GetInteger(pname Enum) (r0 int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetInteger(%v) %v%v", pname, r0, errstr) - }() - var v [1]int32 - ctx.GetIntegerv(v[:], pname) - return int(v[0]) -} - -func (ctx *context) GetBufferParameteri(target, value Enum) (r0 int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetBufferParameteri(%v, %v) %v%v", target, value, r0, errstr) - }() - return int(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetBufferParameteri, - a0: target.c(), - a1: value.c(), - }, - blocking: true, - })) -} - -func (ctx *context) GetError() (r0 Enum) { - return Enum(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetError, - }, - blocking: true, - })) -} - -func (ctx *context) GetFramebufferAttachmentParameteri(target, attachment, pname Enum) (r0 int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetFramebufferAttachmentParameteri(%v, %v, %v) %v%v", target, attachment, pname, r0, errstr) - }() - return int(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetFramebufferAttachmentParameteriv, - a0: target.c(), - a1: attachment.c(), - a2: pname.c(), - }, - blocking: true, - })) -} - -func (ctx *context) GetProgrami(p Program, pname Enum) (r0 int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetProgrami(%v, %v) %v%v", p, pname, r0, errstr) - }() - return int(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetProgramiv, - a0: p.c(), - a1: pname.c(), - }, - blocking: true, - })) -} - -func (ctx *context) GetProgramInfoLog(p Program) (r0 string) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetProgramInfoLog(%v) %v%v", p, r0, errstr) - }() - infoLen := ctx.GetProgrami(p, INFO_LOG_LENGTH) - if infoLen == 0 { - return "" - } - buf := make([]byte, infoLen) - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnGetProgramInfoLog, - a0: p.c(), - a1: uintptr(infoLen), - }, - parg: unsafe.Pointer(&buf[0]), - blocking: true, - }) - return goString(buf) -} - -func (ctx *context) GetRenderbufferParameteri(target, pname Enum) (r0 int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetRenderbufferParameteri(%v, %v) %v%v", target, pname, r0, errstr) - }() - return int(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetRenderbufferParameteriv, - a0: target.c(), - a1: pname.c(), - }, - blocking: true, - })) -} - -func (ctx *context) GetShaderi(s Shader, pname Enum) (r0 int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetShaderi(%v, %v) %v%v", s, pname, r0, errstr) - }() - return int(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetShaderiv, - a0: s.c(), - a1: pname.c(), - }, - blocking: true, - })) -} - -func (ctx *context) GetShaderInfoLog(s Shader) (r0 string) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetShaderInfoLog(%v) %v%v", s, r0, errstr) - }() - infoLen := ctx.GetShaderi(s, INFO_LOG_LENGTH) - if infoLen == 0 { - return "" - } - buf := make([]byte, infoLen) - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnGetShaderInfoLog, - a0: s.c(), - a1: uintptr(infoLen), - }, - parg: unsafe.Pointer(&buf[0]), - blocking: true, - }) - return goString(buf) -} - -func (ctx *context) GetShaderPrecisionFormat(shadertype, precisiontype Enum) (rangeLow, rangeHigh, precision int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetShaderPrecisionFormat(%v, %v) (%v, %v, %v) %v", shadertype, precisiontype, rangeLow, rangeHigh, precision, errstr) - }() - var rangeAndPrec [3]int32 - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnGetShaderPrecisionFormat, - a0: shadertype.c(), - a1: precisiontype.c(), - }, - parg: unsafe.Pointer(&rangeAndPrec[0]), - blocking: true, - }) - return int(rangeAndPrec[0]), int(rangeAndPrec[1]), int(rangeAndPrec[2]) -} - -func (ctx *context) GetShaderSource(s Shader) (r0 string) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetShaderSource(%v) %v%v", s, r0, errstr) - }() - sourceLen := ctx.GetShaderi(s, SHADER_SOURCE_LENGTH) - if sourceLen == 0 { - return "" - } - buf := make([]byte, sourceLen) - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnGetShaderSource, - a0: s.c(), - a1: uintptr(sourceLen), - }, - parg: unsafe.Pointer(&buf[0]), - blocking: true, - }) - return goString(buf) -} - -func (ctx *context) GetString(pname Enum) (r0 string) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetString(%v) %v%v", pname, r0, errstr) - }() - ret := ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetString, - a0: pname.c(), - }, - blocking: true, - }) - retp := unsafe.Pointer(ret) - buf := (*[1 << 24]byte)(retp)[:] - return goString(buf) -} - -func (ctx *context) GetTexParameterfv(dst []float32, target, pname Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetTexParameterfv(len(%d), %v, %v) %v", len(dst), target, pname, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnGetTexParameterfv, - a0: target.c(), - a1: pname.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -func (ctx *context) GetTexParameteriv(dst []int32, target, pname Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetTexParameteriv(%v, %v, %v) %v", dst, target, pname, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnGetTexParameteriv, - a0: target.c(), - a1: pname.c(), - }, - blocking: true, - }) -} - -func (ctx *context) GetUniformfv(dst []float32, src Uniform, p Program) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetUniformfv(len(%d), %v, %v) %v", len(dst), src, p, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnGetUniformfv, - a0: p.c(), - a1: src.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -func (ctx *context) GetUniformiv(dst []int32, src Uniform, p Program) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetUniformiv(%v, %v, %v) %v", dst, src, p, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnGetUniformiv, - a0: p.c(), - a1: src.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -func (ctx *context) GetUniformLocation(p Program, name string) (r0 Uniform) { - defer func() { - errstr := ctx.errDrain() - r0.name = name - log.Printf("gl.GetUniformLocation(%v, %v) %v%v", p, name, r0, errstr) - }() - s, free := ctx.cString(name) - defer free() - return Uniform{Value: int32(ctx.enqueue(call{ - args: fnargs{ - fn: glfnGetUniformLocation, - a0: p.c(), - a1: s, - }, - blocking: true, - }))} -} - -func (ctx *context) GetVertexAttribf(src Attrib, pname Enum) (r0 float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetVertexAttribf(%v, %v) %v%v", src, pname, r0, errstr) - }() - var params [1]float32 - ctx.GetVertexAttribfv(params[:], src, pname) - return params[0] -} - -func (ctx *context) GetVertexAttribfv(dst []float32, src Attrib, pname Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetVertexAttribfv(len(%d), %v, %v) %v", len(dst), src, pname, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnGetVertexAttribfv, - a0: src.c(), - a1: pname.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -func (ctx *context) GetVertexAttribi(src Attrib, pname Enum) (r0 int32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetVertexAttribi(%v, %v) %v%v", src, pname, r0, errstr) - }() - var params [1]int32 - ctx.GetVertexAttribiv(params[:], src, pname) - return params[0] -} - -func (ctx *context) GetVertexAttribiv(dst []int32, src Attrib, pname Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.GetVertexAttribiv(%v, %v, %v) %v", dst, src, pname, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnGetVertexAttribiv, - a0: src.c(), - a1: pname.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -func (ctx *context) Hint(target, mode Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Hint(%v, %v) %v", target, mode, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnHint, - a0: target.c(), - a1: mode.c(), - }, - blocking: true}) -} - -func (ctx *context) IsBuffer(b Buffer) (r0 bool) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.IsBuffer(%v) %v%v", b, r0, errstr) - }() - return 0 != ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsBuffer, - a0: b.c(), - }, - blocking: true, - }) -} - -func (ctx *context) IsEnabled(cap Enum) (r0 bool) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.IsEnabled(%v) %v%v", cap, r0, errstr) - }() - return 0 != ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsEnabled, - a0: cap.c(), - }, - blocking: true, - }) -} - -func (ctx *context) IsFramebuffer(fb Framebuffer) (r0 bool) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.IsFramebuffer(%v) %v%v", fb, r0, errstr) - }() - return 0 != ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsFramebuffer, - a0: fb.c(), - }, - blocking: true, - }) -} - -func (ctx *context) IsProgram(p Program) (r0 bool) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.IsProgram(%v) %v%v", p, r0, errstr) - }() - return 0 != ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsProgram, - a0: p.c(), - }, - blocking: true, - }) -} - -func (ctx *context) IsRenderbuffer(rb Renderbuffer) (r0 bool) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.IsRenderbuffer(%v) %v%v", rb, r0, errstr) - }() - return 0 != ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsRenderbuffer, - a0: rb.c(), - }, - blocking: true, - }) -} - -func (ctx *context) IsShader(s Shader) (r0 bool) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.IsShader(%v) %v%v", s, r0, errstr) - }() - return 0 != ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsShader, - a0: s.c(), - }, - blocking: true, - }) -} - -func (ctx *context) IsTexture(t Texture) (r0 bool) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.IsTexture(%v) %v%v", t, r0, errstr) - }() - return 0 != ctx.enqueue(call{ - args: fnargs{ - fn: glfnIsTexture, - a0: t.c(), - }, - blocking: true, - }) -} - -func (ctx *context) LineWidth(width float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.LineWidth(%v) %v", width, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnLineWidth, - a0: uintptr(math.Float32bits(width)), - }, - blocking: true}) -} - -func (ctx *context) LinkProgram(p Program) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.LinkProgram(%v) %v", p, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnLinkProgram, - a0: p.c(), - }, - blocking: true}) -} - -func (ctx *context) PixelStorei(pname Enum, param int32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.PixelStorei(%v, %v) %v", pname, param, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnPixelStorei, - a0: pname.c(), - a1: uintptr(param), - }, - blocking: true}) -} - -func (ctx *context) PolygonOffset(factor, units float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.PolygonOffset(%v, %v) %v", factor, units, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnPolygonOffset, - a0: uintptr(math.Float32bits(factor)), - a1: uintptr(math.Float32bits(units)), - }, - blocking: true}) -} - -func (ctx *context) ReadPixels(dst []byte, x, y, width, height int, format, ty Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.ReadPixels(len(%d), %v, %v, %v, %v, %v, %v) %v", len(dst), x, y, width, height, format, ty, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnReadPixels, - - a0: uintptr(x), - a1: uintptr(y), - a2: uintptr(width), - a3: uintptr(height), - a4: format.c(), - a5: ty.c(), - }, - parg: unsafe.Pointer(&dst[0]), - blocking: true, - }) -} - -func (ctx *context) ReleaseShaderCompiler() { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.ReleaseShaderCompiler() %v", errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnReleaseShaderCompiler, - }, - blocking: true}) -} - -func (ctx *context) RenderbufferStorage(target, internalFormat Enum, width, height int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.RenderbufferStorage(%v, %v, %v, %v) %v", target, internalFormat, width, height, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnRenderbufferStorage, - a0: target.c(), - a1: internalFormat.c(), - a2: uintptr(width), - a3: uintptr(height), - }, - blocking: true}) -} - -func (ctx *context) SampleCoverage(value float32, invert bool) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.SampleCoverage(%v, %v) %v", value, invert, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnSampleCoverage, - a0: uintptr(math.Float32bits(value)), - a1: glBoolean(invert), - }, - blocking: true}) -} - -func (ctx *context) Scissor(x, y, width, height int32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Scissor(%v, %v, %v, %v) %v", x, y, width, height, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnScissor, - a0: uintptr(x), - a1: uintptr(y), - a2: uintptr(width), - a3: uintptr(height), - }, - blocking: true}) -} - -func (ctx *context) ShaderSource(s Shader, src string) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.ShaderSource(%v, %v) %v", s, src, errstr) - }() - strp, free := ctx.cStringPtr(src) - defer free() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnShaderSource, - a0: s.c(), - a1: 1, - a2: strp, - }, - blocking: true, - }) -} - -func (ctx *context) StencilFunc(fn Enum, ref int, mask uint32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.StencilFunc(%v, %v, %v) %v", fn, ref, mask, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnStencilFunc, - a0: fn.c(), - a1: uintptr(ref), - a2: uintptr(mask), - }, - blocking: true}) -} - -func (ctx *context) StencilFuncSeparate(face, fn Enum, ref int, mask uint32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.StencilFuncSeparate(%v, %v, %v, %v) %v", face, fn, ref, mask, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnStencilFuncSeparate, - a0: face.c(), - a1: fn.c(), - a2: uintptr(ref), - a3: uintptr(mask), - }, - blocking: true}) -} - -func (ctx *context) StencilMask(mask uint32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.StencilMask(%v) %v", mask, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnStencilMask, - a0: uintptr(mask), - }, - blocking: true}) -} - -func (ctx *context) StencilMaskSeparate(face Enum, mask uint32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.StencilMaskSeparate(%v, %v) %v", face, mask, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnStencilMaskSeparate, - a0: face.c(), - a1: uintptr(mask), - }, - blocking: true}) -} - -func (ctx *context) StencilOp(fail, zfail, zpass Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.StencilOp(%v, %v, %v) %v", fail, zfail, zpass, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnStencilOp, - a0: fail.c(), - a1: zfail.c(), - a2: zpass.c(), - }, - blocking: true}) -} - -func (ctx *context) StencilOpSeparate(face, sfail, dpfail, dppass Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.StencilOpSeparate(%v, %v, %v, %v) %v", face, sfail, dpfail, dppass, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnStencilOpSeparate, - a0: face.c(), - a1: sfail.c(), - a2: dpfail.c(), - a3: dppass.c(), - }, - blocking: true}) -} - -func (ctx *context) TexImage2D(target Enum, level int, width, height int, format Enum, ty Enum, data []byte) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.TexImage2D(%v, %v, %v, %v, %v, %v, len(%d)) %v", target, level, width, height, format, ty, len(data), errstr) - }() - parg := unsafe.Pointer(nil) - if len(data) > 0 { - parg = unsafe.Pointer(&data[0]) - } - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnTexImage2D, - - a0: target.c(), - a1: uintptr(level), - a2: uintptr(format), - a3: uintptr(width), - a4: uintptr(height), - a5: format.c(), - a6: ty.c(), - }, - parg: parg, - blocking: true, - }) -} - -func (ctx *context) TexSubImage2D(target Enum, level int, x, y, width, height int, format, ty Enum, data []byte) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.TexSubImage2D(%v, %v, %v, %v, %v, %v, %v, %v, len(%d)) %v", target, level, x, y, width, height, format, ty, len(data), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnTexSubImage2D, - - a0: target.c(), - a1: uintptr(level), - a2: uintptr(x), - a3: uintptr(y), - a4: uintptr(width), - a5: uintptr(height), - a6: format.c(), - a7: ty.c(), - }, - parg: unsafe.Pointer(&data[0]), - blocking: true, - }) -} - -func (ctx *context) TexParameterf(target, pname Enum, param float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.TexParameterf(%v, %v, %v) %v", target, pname, param, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnTexParameterf, - a0: target.c(), - a1: pname.c(), - a2: uintptr(math.Float32bits(param)), - }, - blocking: true}) -} - -func (ctx *context) TexParameterfv(target, pname Enum, params []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.TexParameterfv(%v, %v, len(%d)) %v", target, pname, len(params), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnTexParameterfv, - a0: target.c(), - a1: pname.c(), - }, - parg: unsafe.Pointer(¶ms[0]), - blocking: true, - }) -} - -func (ctx *context) TexParameteri(target, pname Enum, param int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.TexParameteri(%v, %v, %v) %v", target, pname, param, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnTexParameteri, - a0: target.c(), - a1: pname.c(), - a2: uintptr(param), - }, - blocking: true}) -} - -func (ctx *context) TexParameteriv(target, pname Enum, params []int32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.TexParameteriv(%v, %v, %v) %v", target, pname, params, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnTexParameteriv, - a0: target.c(), - a1: pname.c(), - }, - parg: unsafe.Pointer(¶ms[0]), - blocking: true, - }) -} - -func (ctx *context) Uniform1f(dst Uniform, v float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform1f(%v, %v) %v", dst, v, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform1f, - a0: dst.c(), - a1: uintptr(math.Float32bits(v)), - }, - blocking: true}) -} - -func (ctx *context) Uniform1fv(dst Uniform, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform1fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform1fv, - a0: dst.c(), - a1: uintptr(len(src)), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) Uniform1i(dst Uniform, v int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform1i(%v, %v) %v", dst, v, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform1i, - a0: dst.c(), - a1: uintptr(v), - }, - blocking: true}) -} - -func (ctx *context) Uniform1iv(dst Uniform, src []int32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform1iv(%v, %v) %v", dst, src, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform1iv, - a0: dst.c(), - a1: uintptr(len(src)), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) Uniform2f(dst Uniform, v0, v1 float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform2f(%v, %v, %v) %v", dst, v0, v1, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform2f, - a0: dst.c(), - a1: uintptr(math.Float32bits(v0)), - a2: uintptr(math.Float32bits(v1)), - }, - blocking: true}) -} - -func (ctx *context) Uniform2fv(dst Uniform, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform2fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform2fv, - a0: dst.c(), - a1: uintptr(len(src) / 2), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) Uniform2i(dst Uniform, v0, v1 int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform2i(%v, %v, %v) %v", dst, v0, v1, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform2i, - a0: dst.c(), - a1: uintptr(v0), - a2: uintptr(v1), - }, - blocking: true}) -} - -func (ctx *context) Uniform2iv(dst Uniform, src []int32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform2iv(%v, %v) %v", dst, src, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform2iv, - a0: dst.c(), - a1: uintptr(len(src) / 2), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) Uniform3f(dst Uniform, v0, v1, v2 float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform3f(%v, %v, %v, %v) %v", dst, v0, v1, v2, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform3f, - a0: dst.c(), - a1: uintptr(math.Float32bits(v0)), - a2: uintptr(math.Float32bits(v1)), - a3: uintptr(math.Float32bits(v2)), - }, - blocking: true}) -} - -func (ctx *context) Uniform3fv(dst Uniform, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform3fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform3fv, - a0: dst.c(), - a1: uintptr(len(src) / 3), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) Uniform3i(dst Uniform, v0, v1, v2 int32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform3i(%v, %v, %v, %v) %v", dst, v0, v1, v2, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform3i, - a0: dst.c(), - a1: uintptr(v0), - a2: uintptr(v1), - a3: uintptr(v2), - }, - blocking: true}) -} - -func (ctx *context) Uniform3iv(dst Uniform, src []int32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform3iv(%v, %v) %v", dst, src, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform3iv, - a0: dst.c(), - a1: uintptr(len(src) / 3), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) Uniform4f(dst Uniform, v0, v1, v2, v3 float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform4f(%v, %v, %v, %v, %v) %v", dst, v0, v1, v2, v3, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform4f, - a0: dst.c(), - a1: uintptr(math.Float32bits(v0)), - a2: uintptr(math.Float32bits(v1)), - a3: uintptr(math.Float32bits(v2)), - a4: uintptr(math.Float32bits(v3)), - }, - blocking: true}) -} - -func (ctx *context) Uniform4fv(dst Uniform, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform4fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform4fv, - a0: dst.c(), - a1: uintptr(len(src) / 4), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) Uniform4i(dst Uniform, v0, v1, v2, v3 int32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform4i(%v, %v, %v, %v, %v) %v", dst, v0, v1, v2, v3, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform4i, - a0: dst.c(), - a1: uintptr(v0), - a2: uintptr(v1), - a3: uintptr(v2), - a4: uintptr(v3), - }, - blocking: true}) -} - -func (ctx *context) Uniform4iv(dst Uniform, src []int32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform4iv(%v, %v) %v", dst, src, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform4iv, - a0: dst.c(), - a1: uintptr(len(src) / 4), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) UniformMatrix2fv(dst Uniform, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.UniformMatrix2fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniformMatrix2fv, - - a0: dst.c(), - a1: uintptr(len(src) / 4), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) UniformMatrix3fv(dst Uniform, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.UniformMatrix3fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniformMatrix3fv, - a0: dst.c(), - a1: uintptr(len(src) / 9), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) UniformMatrix4fv(dst Uniform, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.UniformMatrix4fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniformMatrix4fv, - a0: dst.c(), - a1: uintptr(len(src) / 16), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) UseProgram(p Program) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.UseProgram(%v) %v", p, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUseProgram, - a0: p.c(), - }, - blocking: true}) -} - -func (ctx *context) ValidateProgram(p Program) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.ValidateProgram(%v) %v", p, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnValidateProgram, - a0: p.c(), - }, - blocking: true}) -} - -func (ctx *context) VertexAttrib1f(dst Attrib, x float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.VertexAttrib1f(%v, %v) %v", dst, x, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnVertexAttrib1f, - a0: dst.c(), - a1: uintptr(math.Float32bits(x)), - }, - blocking: true}) -} - -func (ctx *context) VertexAttrib1fv(dst Attrib, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.VertexAttrib1fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnVertexAttrib1fv, - a0: dst.c(), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) VertexAttrib2f(dst Attrib, x, y float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.VertexAttrib2f(%v, %v, %v) %v", dst, x, y, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnVertexAttrib2f, - a0: dst.c(), - a1: uintptr(math.Float32bits(x)), - a2: uintptr(math.Float32bits(y)), - }, - blocking: true}) -} - -func (ctx *context) VertexAttrib2fv(dst Attrib, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.VertexAttrib2fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnVertexAttrib2fv, - a0: dst.c(), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) VertexAttrib3f(dst Attrib, x, y, z float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.VertexAttrib3f(%v, %v, %v, %v) %v", dst, x, y, z, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnVertexAttrib3f, - a0: dst.c(), - a1: uintptr(math.Float32bits(x)), - a2: uintptr(math.Float32bits(y)), - a3: uintptr(math.Float32bits(z)), - }, - blocking: true}) -} - -func (ctx *context) VertexAttrib3fv(dst Attrib, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.VertexAttrib3fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnVertexAttrib3fv, - a0: dst.c(), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) VertexAttrib4f(dst Attrib, x, y, z, w float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.VertexAttrib4f(%v, %v, %v, %v, %v) %v", dst, x, y, z, w, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnVertexAttrib4f, - a0: dst.c(), - a1: uintptr(math.Float32bits(x)), - a2: uintptr(math.Float32bits(y)), - a3: uintptr(math.Float32bits(z)), - a4: uintptr(math.Float32bits(w)), - }, - blocking: true}) -} - -func (ctx *context) VertexAttrib4fv(dst Attrib, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.VertexAttrib4fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnVertexAttrib4fv, - a0: dst.c(), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx *context) VertexAttribPointer(dst Attrib, size int, ty Enum, normalized bool, stride, offset int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.VertexAttribPointer(%v, %v, %v, %v, %v, %v) %v", dst, size, ty, normalized, stride, offset, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnVertexAttribPointer, - a0: dst.c(), - a1: uintptr(size), - a2: ty.c(), - a3: glBoolean(normalized), - a4: uintptr(stride), - a5: uintptr(offset), - }, - blocking: true}) -} - -func (ctx *context) Viewport(x, y, width, height int) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Viewport(%v, %v, %v, %v) %v", x, y, width, height, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnViewport, - a0: uintptr(x), - a1: uintptr(y), - a2: uintptr(width), - a3: uintptr(height), - }, - blocking: true}) -} - -func (ctx context3) UniformMatrix2x3fv(dst Uniform, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.UniformMatrix2x3fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniformMatrix2x3fv, - a0: dst.c(), - a1: uintptr(len(src) / 6), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx context3) UniformMatrix3x2fv(dst Uniform, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.UniformMatrix3x2fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniformMatrix3x2fv, - a0: dst.c(), - a1: uintptr(len(src) / 6), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx context3) UniformMatrix2x4fv(dst Uniform, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.UniformMatrix2x4fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniformMatrix2x4fv, - a0: dst.c(), - a1: uintptr(len(src) / 8), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx context3) UniformMatrix4x2fv(dst Uniform, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.UniformMatrix4x2fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniformMatrix4x2fv, - a0: dst.c(), - a1: uintptr(len(src) / 8), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx context3) UniformMatrix3x4fv(dst Uniform, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.UniformMatrix3x4fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniformMatrix3x4fv, - a0: dst.c(), - a1: uintptr(len(src) / 12), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx context3) UniformMatrix4x3fv(dst Uniform, src []float32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.UniformMatrix4x3fv(%v, len(%d)) %v", dst, len(src), errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniformMatrix4x3fv, - a0: dst.c(), - a1: uintptr(len(src) / 12), - }, - parg: unsafe.Pointer(&src[0]), - blocking: true, - }) -} - -func (ctx context3) BlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1 int, mask uint, filter Enum) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.BlitFramebuffer(%v, %v, %v, %v, %v, %v, %v, %v, %v, %v) %v", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnBlitFramebuffer, - a0: uintptr(srcX0), - a1: uintptr(srcY0), - a2: uintptr(srcX1), - a3: uintptr(srcY1), - a4: uintptr(dstX0), - a5: uintptr(dstY0), - a6: uintptr(dstX1), - a7: uintptr(dstY1), - a8: uintptr(mask), - a9: filter.c(), - }, - blocking: true}) -} - -func (ctx context3) Uniform1ui(dst Uniform, v uint32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform1ui(%v, %v) %v", dst, v, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform1ui, - a0: dst.c(), - a1: uintptr(v), - }, - blocking: true}) -} - -func (ctx context3) Uniform2ui(dst Uniform, v0, v1 uint32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform2ui(%v, %v, %v) %v", dst, v0, v1, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform2ui, - a0: dst.c(), - a1: uintptr(v0), - a2: uintptr(v1), - }, - blocking: true}) -} - -func (ctx context3) Uniform3ui(dst Uniform, v0, v1, v2 uint) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform3ui(%v, %v, %v, %v) %v", dst, v0, v1, v2, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform3ui, - a0: dst.c(), - a1: uintptr(v0), - a2: uintptr(v1), - a3: uintptr(v2), - }, - blocking: true}) -} - -func (ctx context3) Uniform4ui(dst Uniform, v0, v1, v2, v3 uint32) { - defer func() { - errstr := ctx.errDrain() - log.Printf("gl.Uniform4ui(%v, %v, %v, %v, %v) %v", dst, v0, v1, v2, v3, errstr) - }() - ctx.enqueueDebug(call{ - args: fnargs{ - fn: glfnUniform4ui, - a0: dst.c(), - a1: uintptr(v0), - a2: uintptr(v1), - a3: uintptr(v2), - a4: uintptr(v3), - }, - blocking: true}) -} diff --git a/vendor/golang.org/x/mobile/gl/interface.go b/vendor/golang.org/x/mobile/gl/interface.go deleted file mode 100644 index 2083327..0000000 --- a/vendor/golang.org/x/mobile/gl/interface.go +++ /dev/null @@ -1,889 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gl - -// Context is an OpenGL ES context. -// -// A Context has a method for every GL function supported by ES 2 or later. -// In a program compiled with ES 3 support, a Context is also a Context3. -// For example, a program can: -// -// func f(glctx gl.Context) { -// glctx.(gl.Context3).BlitFramebuffer(...) -// } -// -// Calls are not safe for concurrent use. However calls can be made from -// any goroutine, the gl package removes the notion of thread-local -// context. -// -// Contexts are independent. Two contexts can be used concurrently. -type Context interface { - // ActiveTexture sets the active texture unit. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glActiveTexture.xhtml - ActiveTexture(texture Enum) - - // AttachShader attaches a shader to a program. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glAttachShader.xhtml - AttachShader(p Program, s Shader) - - // BindAttribLocation binds a vertex attribute index with a named - // variable. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glBindAttribLocation.xhtml - BindAttribLocation(p Program, a Attrib, name string) - - // BindBuffer binds a buffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glBindBuffer.xhtml - BindBuffer(target Enum, b Buffer) - - // BindFramebuffer binds a framebuffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glBindFramebuffer.xhtml - BindFramebuffer(target Enum, fb Framebuffer) - - // BindRenderbuffer binds a render buffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glBindRenderbuffer.xhtml - BindRenderbuffer(target Enum, rb Renderbuffer) - - // BindTexture binds a texture. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glBindTexture.xhtml - BindTexture(target Enum, t Texture) - - // BindVertexArray binds a vertex array. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glBindVertexArray.xhtml - BindVertexArray(rb VertexArray) - - // BlendColor sets the blend color. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glBlendColor.xhtml - BlendColor(red, green, blue, alpha float32) - - // BlendEquation sets both RGB and alpha blend equations. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glBlendEquation.xhtml - BlendEquation(mode Enum) - - // BlendEquationSeparate sets RGB and alpha blend equations separately. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glBlendEquationSeparate.xhtml - BlendEquationSeparate(modeRGB, modeAlpha Enum) - - // BlendFunc sets the pixel blending factors. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glBlendFunc.xhtml - BlendFunc(sfactor, dfactor Enum) - - // BlendFunc sets the pixel RGB and alpha blending factors separately. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glBlendFuncSeparate.xhtml - BlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha Enum) - - // BufferData creates a new data store for the bound buffer object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glBufferData.xhtml - BufferData(target Enum, src []byte, usage Enum) - - // BufferInit creates a new uninitialized data store for the bound buffer object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glBufferData.xhtml - BufferInit(target Enum, size int, usage Enum) - - // BufferSubData sets some of data in the bound buffer object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glBufferSubData.xhtml - BufferSubData(target Enum, offset int, data []byte) - - // CheckFramebufferStatus reports the completeness status of the - // active framebuffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glCheckFramebufferStatus.xhtml - CheckFramebufferStatus(target Enum) Enum - - // Clear clears the window. - // - // The behavior of Clear is influenced by the pixel ownership test, - // the scissor test, dithering, and the buffer writemasks. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glClear.xhtml - Clear(mask Enum) - - // ClearColor specifies the RGBA values used to clear color buffers. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glClearColor.xhtml - ClearColor(red, green, blue, alpha float32) - - // ClearDepthf sets the depth value used to clear the depth buffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glClearDepthf.xhtml - ClearDepthf(d float32) - - // ClearStencil sets the index used to clear the stencil buffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glClearStencil.xhtml - ClearStencil(s int) - - // ColorMask specifies whether color components in the framebuffer - // can be written. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glColorMask.xhtml - ColorMask(red, green, blue, alpha bool) - - // CompileShader compiles the source code of s. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glCompileShader.xhtml - CompileShader(s Shader) - - // CompressedTexImage2D writes a compressed 2D texture. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glCompressedTexImage2D.xhtml - CompressedTexImage2D(target Enum, level int, internalformat Enum, width, height, border int, data []byte) - - // CompressedTexSubImage2D writes a subregion of a compressed 2D texture. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glCompressedTexSubImage2D.xhtml - CompressedTexSubImage2D(target Enum, level, xoffset, yoffset, width, height int, format Enum, data []byte) - - // CopyTexImage2D writes a 2D texture from the current framebuffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glCopyTexImage2D.xhtml - CopyTexImage2D(target Enum, level int, internalformat Enum, x, y, width, height, border int) - - // CopyTexSubImage2D writes a 2D texture subregion from the - // current framebuffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glCopyTexSubImage2D.xhtml - CopyTexSubImage2D(target Enum, level, xoffset, yoffset, x, y, width, height int) - - // CreateBuffer creates a buffer object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGenBuffers.xhtml - CreateBuffer() Buffer - - // CreateFramebuffer creates a framebuffer object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGenFramebuffers.xhtml - CreateFramebuffer() Framebuffer - - // CreateProgram creates a new empty program object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glCreateProgram.xhtml - CreateProgram() Program - - // CreateRenderbuffer create a renderbuffer object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGenRenderbuffers.xhtml - CreateRenderbuffer() Renderbuffer - - // CreateShader creates a new empty shader object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glCreateShader.xhtml - CreateShader(ty Enum) Shader - - // CreateTexture creates a texture object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGenTextures.xhtml - CreateTexture() Texture - - // CreateTVertexArray creates a vertex array. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGenVertexArrays.xhtml - CreateVertexArray() VertexArray - - // CullFace specifies which polygons are candidates for culling. - // - // Valid modes: FRONT, BACK, FRONT_AND_BACK. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glCullFace.xhtml - CullFace(mode Enum) - - // DeleteBuffer deletes the given buffer object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteBuffers.xhtml - DeleteBuffer(v Buffer) - - // DeleteFramebuffer deletes the given framebuffer object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteFramebuffers.xhtml - DeleteFramebuffer(v Framebuffer) - - // DeleteProgram deletes the given program object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteProgram.xhtml - DeleteProgram(p Program) - - // DeleteRenderbuffer deletes the given render buffer object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteRenderbuffers.xhtml - DeleteRenderbuffer(v Renderbuffer) - - // DeleteShader deletes shader s. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteShader.xhtml - DeleteShader(s Shader) - - // DeleteTexture deletes the given texture object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteTextures.xhtml - DeleteTexture(v Texture) - - // DeleteVertexArray deletes the given render buffer object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteVertexArrays.xhtml - DeleteVertexArray(v VertexArray) - - // DepthFunc sets the function used for depth buffer comparisons. - // - // Valid fn values: - // NEVER - // LESS - // EQUAL - // LEQUAL - // GREATER - // NOTEQUAL - // GEQUAL - // ALWAYS - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glDepthFunc.xhtml - DepthFunc(fn Enum) - - // DepthMask sets the depth buffer enabled for writing. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glDepthMask.xhtml - DepthMask(flag bool) - - // DepthRangef sets the mapping from normalized device coordinates to - // window coordinates. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glDepthRangef.xhtml - DepthRangef(n, f float32) - - // DetachShader detaches the shader s from the program p. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glDetachShader.xhtml - DetachShader(p Program, s Shader) - - // Disable disables various GL capabilities. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glDisable.xhtml - Disable(cap Enum) - - // DisableVertexAttribArray disables a vertex attribute array. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glDisableVertexAttribArray.xhtml - DisableVertexAttribArray(a Attrib) - - // DrawArrays renders geometric primitives from the bound data. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glDrawArrays.xhtml - DrawArrays(mode Enum, first, count int) - - // DrawElements renders primitives from a bound buffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glDrawElements.xhtml - DrawElements(mode Enum, count int, ty Enum, offset int) - - // TODO(crawshaw): consider DrawElements8 / DrawElements16 / DrawElements32 - - // Enable enables various GL capabilities. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glEnable.xhtml - Enable(cap Enum) - - // EnableVertexAttribArray enables a vertex attribute array. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glEnableVertexAttribArray.xhtml - EnableVertexAttribArray(a Attrib) - - // Finish blocks until the effects of all previously called GL - // commands are complete. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glFinish.xhtml - Finish() - - // Flush empties all buffers. It does not block. - // - // An OpenGL implementation may buffer network communication, - // the command stream, or data inside the graphics accelerator. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glFlush.xhtml - Flush() - - // FramebufferRenderbuffer attaches rb to the current frame buffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glFramebufferRenderbuffer.xhtml - FramebufferRenderbuffer(target, attachment, rbTarget Enum, rb Renderbuffer) - - // FramebufferTexture2D attaches the t to the current frame buffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glFramebufferTexture2D.xhtml - FramebufferTexture2D(target, attachment, texTarget Enum, t Texture, level int) - - // FrontFace defines which polygons are front-facing. - // - // Valid modes: CW, CCW. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glFrontFace.xhtml - FrontFace(mode Enum) - - // GenerateMipmap generates mipmaps for the current texture. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGenerateMipmap.xhtml - GenerateMipmap(target Enum) - - // GetActiveAttrib returns details about an active attribute variable. - // A value of 0 for index selects the first active attribute variable. - // Permissible values for index range from 0 to the number of active - // attribute variables minus 1. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetActiveAttrib.xhtml - GetActiveAttrib(p Program, index uint32) (name string, size int, ty Enum) - - // GetActiveUniform returns details about an active uniform variable. - // A value of 0 for index selects the first active uniform variable. - // Permissible values for index range from 0 to the number of active - // uniform variables minus 1. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetActiveUniform.xhtml - GetActiveUniform(p Program, index uint32) (name string, size int, ty Enum) - - // GetAttachedShaders returns the shader objects attached to program p. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetAttachedShaders.xhtml - GetAttachedShaders(p Program) []Shader - - // GetAttribLocation returns the location of an attribute variable. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetAttribLocation.xhtml - GetAttribLocation(p Program, name string) Attrib - - // GetBooleanv returns the boolean values of parameter pname. - // - // Many boolean parameters can be queried more easily using IsEnabled. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGet.xhtml - GetBooleanv(dst []bool, pname Enum) - - // GetFloatv returns the float values of parameter pname. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGet.xhtml - GetFloatv(dst []float32, pname Enum) - - // GetIntegerv returns the int values of parameter pname. - // - // Single values may be queried more easily using GetInteger. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGet.xhtml - GetIntegerv(dst []int32, pname Enum) - - // GetInteger returns the int value of parameter pname. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGet.xhtml - GetInteger(pname Enum) int - - // GetBufferParameteri returns a parameter for the active buffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetBufferParameter.xhtml - GetBufferParameteri(target, value Enum) int - - // GetError returns the next error. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetError.xhtml - GetError() Enum - - // GetFramebufferAttachmentParameteri returns attachment parameters - // for the active framebuffer object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetFramebufferAttachmentParameteriv.xhtml - GetFramebufferAttachmentParameteri(target, attachment, pname Enum) int - - // GetProgrami returns a parameter value for a program. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetProgramiv.xhtml - GetProgrami(p Program, pname Enum) int - - // GetProgramInfoLog returns the information log for a program. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetProgramInfoLog.xhtml - GetProgramInfoLog(p Program) string - - // GetRenderbufferParameteri returns a parameter value for a render buffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetRenderbufferParameteriv.xhtml - GetRenderbufferParameteri(target, pname Enum) int - - // GetShaderi returns a parameter value for a shader. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetShaderiv.xhtml - GetShaderi(s Shader, pname Enum) int - - // GetShaderInfoLog returns the information log for a shader. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetShaderInfoLog.xhtml - GetShaderInfoLog(s Shader) string - - // GetShaderPrecisionFormat returns range and precision limits for - // shader types. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetShaderPrecisionFormat.xhtml - GetShaderPrecisionFormat(shadertype, precisiontype Enum) (rangeLow, rangeHigh, precision int) - - // GetShaderSource returns source code of shader s. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetShaderSource.xhtml - GetShaderSource(s Shader) string - - // GetString reports current GL state. - // - // Valid name values: - // EXTENSIONS - // RENDERER - // SHADING_LANGUAGE_VERSION - // VENDOR - // VERSION - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetString.xhtml - GetString(pname Enum) string - - // GetTexParameterfv returns the float values of a texture parameter. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetTexParameter.xhtml - GetTexParameterfv(dst []float32, target, pname Enum) - - // GetTexParameteriv returns the int values of a texture parameter. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetTexParameter.xhtml - GetTexParameteriv(dst []int32, target, pname Enum) - - // GetUniformfv returns the float values of a uniform variable. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetUniform.xhtml - GetUniformfv(dst []float32, src Uniform, p Program) - - // GetUniformiv returns the float values of a uniform variable. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetUniform.xhtml - GetUniformiv(dst []int32, src Uniform, p Program) - - // GetUniformLocation returns the location of a uniform variable. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetUniformLocation.xhtml - GetUniformLocation(p Program, name string) Uniform - - // GetVertexAttribf reads the float value of a vertex attribute. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetVertexAttrib.xhtml - GetVertexAttribf(src Attrib, pname Enum) float32 - - // GetVertexAttribfv reads float values of a vertex attribute. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetVertexAttrib.xhtml - GetVertexAttribfv(dst []float32, src Attrib, pname Enum) - - // GetVertexAttribi reads the int value of a vertex attribute. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetVertexAttrib.xhtml - GetVertexAttribi(src Attrib, pname Enum) int32 - - // GetVertexAttribiv reads int values of a vertex attribute. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glGetVertexAttrib.xhtml - GetVertexAttribiv(dst []int32, src Attrib, pname Enum) - - // TODO(crawshaw): glGetVertexAttribPointerv - - // Hint sets implementation-specific modes. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glHint.xhtml - Hint(target, mode Enum) - - // IsBuffer reports if b is a valid buffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glIsBuffer.xhtml - IsBuffer(b Buffer) bool - - // IsEnabled reports if cap is an enabled capability. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glIsEnabled.xhtml - IsEnabled(cap Enum) bool - - // IsFramebuffer reports if fb is a valid frame buffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glIsFramebuffer.xhtml - IsFramebuffer(fb Framebuffer) bool - - // IsProgram reports if p is a valid program object. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glIsProgram.xhtml - IsProgram(p Program) bool - - // IsRenderbuffer reports if rb is a valid render buffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glIsRenderbuffer.xhtml - IsRenderbuffer(rb Renderbuffer) bool - - // IsShader reports if s is valid shader. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glIsShader.xhtml - IsShader(s Shader) bool - - // IsTexture reports if t is a valid texture. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glIsTexture.xhtml - IsTexture(t Texture) bool - - // LineWidth specifies the width of lines. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glLineWidth.xhtml - LineWidth(width float32) - - // LinkProgram links the specified program. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glLinkProgram.xhtml - LinkProgram(p Program) - - // PixelStorei sets pixel storage parameters. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glPixelStorei.xhtml - PixelStorei(pname Enum, param int32) - - // PolygonOffset sets the scaling factors for depth offsets. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glPolygonOffset.xhtml - PolygonOffset(factor, units float32) - - // ReadPixels returns pixel data from a buffer. - // - // In GLES 3, the source buffer is controlled with ReadBuffer. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glReadPixels.xhtml - ReadPixels(dst []byte, x, y, width, height int, format, ty Enum) - - // ReleaseShaderCompiler frees resources allocated by the shader compiler. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glReleaseShaderCompiler.xhtml - ReleaseShaderCompiler() - - // RenderbufferStorage establishes the data storage, format, and - // dimensions of a renderbuffer object's image. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glRenderbufferStorage.xhtml - RenderbufferStorage(target, internalFormat Enum, width, height int) - - // SampleCoverage sets multisample coverage parameters. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glSampleCoverage.xhtml - SampleCoverage(value float32, invert bool) - - // Scissor defines the scissor box rectangle, in window coordinates. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glScissor.xhtml - Scissor(x, y, width, height int32) - - // TODO(crawshaw): ShaderBinary - - // ShaderSource sets the source code of s to the given source code. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glShaderSource.xhtml - ShaderSource(s Shader, src string) - - // StencilFunc sets the front and back stencil test reference value. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glStencilFunc.xhtml - StencilFunc(fn Enum, ref int, mask uint32) - - // StencilFunc sets the front or back stencil test reference value. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glStencilFuncSeparate.xhtml - StencilFuncSeparate(face, fn Enum, ref int, mask uint32) - - // StencilMask controls the writing of bits in the stencil planes. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glStencilMask.xhtml - StencilMask(mask uint32) - - // StencilMaskSeparate controls the writing of bits in the stencil planes. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glStencilMaskSeparate.xhtml - StencilMaskSeparate(face Enum, mask uint32) - - // StencilOp sets front and back stencil test actions. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glStencilOp.xhtml - StencilOp(fail, zfail, zpass Enum) - - // StencilOpSeparate sets front or back stencil tests. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glStencilOpSeparate.xhtml - StencilOpSeparate(face, sfail, dpfail, dppass Enum) - - // TexImage2D writes a 2D texture image. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glTexImage2D.xhtml - TexImage2D(target Enum, level int, width, height int, format Enum, ty Enum, data []byte) - - // TexSubImage2D writes a subregion of a 2D texture image. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glTexSubImage2D.xhtml - TexSubImage2D(target Enum, level int, x, y, width, height int, format, ty Enum, data []byte) - - // TexParameterf sets a float texture parameter. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glTexParameter.xhtml - TexParameterf(target, pname Enum, param float32) - - // TexParameterfv sets a float texture parameter array. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glTexParameter.xhtml - TexParameterfv(target, pname Enum, params []float32) - - // TexParameteri sets an integer texture parameter. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glTexParameter.xhtml - TexParameteri(target, pname Enum, param int) - - // TexParameteriv sets an integer texture parameter array. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glTexParameter.xhtml - TexParameteriv(target, pname Enum, params []int32) - - // Uniform1f writes a float uniform variable. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform1f(dst Uniform, v float32) - - // Uniform1fv writes a [len(src)]float uniform array. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform1fv(dst Uniform, src []float32) - - // Uniform1i writes an int uniform variable. - // - // Uniform1i and Uniform1iv are the only two functions that may be used - // to load uniform variables defined as sampler types. Loading samplers - // with any other function will result in a INVALID_OPERATION error. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform1i(dst Uniform, v int) - - // Uniform1iv writes a int uniform array of len(src) elements. - // - // Uniform1i and Uniform1iv are the only two functions that may be used - // to load uniform variables defined as sampler types. Loading samplers - // with any other function will result in a INVALID_OPERATION error. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform1iv(dst Uniform, src []int32) - - // Uniform2f writes a vec2 uniform variable. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform2f(dst Uniform, v0, v1 float32) - - // Uniform2fv writes a vec2 uniform array of len(src)/2 elements. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform2fv(dst Uniform, src []float32) - - // Uniform2i writes an ivec2 uniform variable. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform2i(dst Uniform, v0, v1 int) - - // Uniform2iv writes an ivec2 uniform array of len(src)/2 elements. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform2iv(dst Uniform, src []int32) - - // Uniform3f writes a vec3 uniform variable. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform3f(dst Uniform, v0, v1, v2 float32) - - // Uniform3fv writes a vec3 uniform array of len(src)/3 elements. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform3fv(dst Uniform, src []float32) - - // Uniform3i writes an ivec3 uniform variable. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform3i(dst Uniform, v0, v1, v2 int32) - - // Uniform3iv writes an ivec3 uniform array of len(src)/3 elements. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform3iv(dst Uniform, src []int32) - - // Uniform4f writes a vec4 uniform variable. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform4f(dst Uniform, v0, v1, v2, v3 float32) - - // Uniform4fv writes a vec4 uniform array of len(src)/4 elements. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform4fv(dst Uniform, src []float32) - - // Uniform4i writes an ivec4 uniform variable. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform4i(dst Uniform, v0, v1, v2, v3 int32) - - // Uniform4i writes an ivec4 uniform array of len(src)/4 elements. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - Uniform4iv(dst Uniform, src []int32) - - // UniformMatrix2fv writes 2x2 matrices. Each matrix uses four - // float32 values, so the number of matrices written is len(src)/4. - // - // Each matrix must be supplied in column major order. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - UniformMatrix2fv(dst Uniform, src []float32) - - // UniformMatrix3fv writes 3x3 matrices. Each matrix uses nine - // float32 values, so the number of matrices written is len(src)/9. - // - // Each matrix must be supplied in column major order. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - UniformMatrix3fv(dst Uniform, src []float32) - - // UniformMatrix4fv writes 4x4 matrices. Each matrix uses 16 - // float32 values, so the number of matrices written is len(src)/16. - // - // Each matrix must be supplied in column major order. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml - UniformMatrix4fv(dst Uniform, src []float32) - - // UseProgram sets the active program. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glUseProgram.xhtml - UseProgram(p Program) - - // ValidateProgram checks to see whether the executables contained in - // program can execute given the current OpenGL state. - // - // Typically only used for debugging. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glValidateProgram.xhtml - ValidateProgram(p Program) - - // VertexAttrib1f writes a float vertex attribute. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glVertexAttrib.xhtml - VertexAttrib1f(dst Attrib, x float32) - - // VertexAttrib1fv writes a float vertex attribute. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glVertexAttrib.xhtml - VertexAttrib1fv(dst Attrib, src []float32) - - // VertexAttrib2f writes a vec2 vertex attribute. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glVertexAttrib.xhtml - VertexAttrib2f(dst Attrib, x, y float32) - - // VertexAttrib2fv writes a vec2 vertex attribute. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glVertexAttrib.xhtml - VertexAttrib2fv(dst Attrib, src []float32) - - // VertexAttrib3f writes a vec3 vertex attribute. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glVertexAttrib.xhtml - VertexAttrib3f(dst Attrib, x, y, z float32) - - // VertexAttrib3fv writes a vec3 vertex attribute. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glVertexAttrib.xhtml - VertexAttrib3fv(dst Attrib, src []float32) - - // VertexAttrib4f writes a vec4 vertex attribute. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glVertexAttrib.xhtml - VertexAttrib4f(dst Attrib, x, y, z, w float32) - - // VertexAttrib4fv writes a vec4 vertex attribute. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glVertexAttrib.xhtml - VertexAttrib4fv(dst Attrib, src []float32) - - // VertexAttribPointer uses a bound buffer to define vertex attribute data. - // - // Direct use of VertexAttribPointer to load data into OpenGL is not - // supported via the Go bindings. Instead, use BindBuffer with an - // ARRAY_BUFFER and then fill it using BufferData. - // - // The size argument specifies the number of components per attribute, - // between 1-4. The stride argument specifies the byte offset between - // consecutive vertex attributes. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glVertexAttribPointer.xhtml - VertexAttribPointer(dst Attrib, size int, ty Enum, normalized bool, stride, offset int) - - // Viewport sets the viewport, an affine transformation that - // normalizes device coordinates to window coordinates. - // - // http://www.khronos.org/opengles/sdk/docs/man3/html/glViewport.xhtml - Viewport(x, y, width, height int) -} - -// Context3 is an OpenGL ES 3 context. -// -// When the gl package is compiled with GL ES 3 support, the produced -// Context object also implements the Context3 interface. -type Context3 interface { - Context - - // BlitFramebuffer copies a block of pixels between framebuffers. - // - // https://www.khronos.org/opengles/sdk/docs/man3/html/glBlitFramebuffer.xhtml - BlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1 int, mask uint, filter Enum) -} - -// Worker is used by display driver code to execute OpenGL calls. -// -// Typically display driver code creates a gl.Context for an application, -// and along with it establishes a locked OS thread to execute the cgo -// calls: -// -// go func() { -// runtime.LockOSThread() -// // ... platform-specific cgo call to bind a C OpenGL context -// // into thread-local storage. -// -// glctx, worker := gl.NewContext() -// workAvailable := worker.WorkAvailable() -// go userAppCode(glctx) -// for { -// select { -// case <-workAvailable: -// worker.DoWork() -// case <-drawEvent: -// // ... platform-specific cgo call to draw screen -// } -// } -// }() -// -// This interface is an internal implementation detail and should only be used -// by the package responsible for managing the screen, such as -// golang.org/x/mobile/app. -type Worker interface { - // WorkAvailable returns a channel that communicates when DoWork should be - // called. - WorkAvailable() <-chan struct{} - - // DoWork performs any pending OpenGL calls. - DoWork() -} diff --git a/vendor/golang.org/x/mobile/gl/types_debug.go b/vendor/golang.org/x/mobile/gl/types_debug.go deleted file mode 100644 index f5a888e..0000000 --- a/vendor/golang.org/x/mobile/gl/types_debug.go +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build linux darwin windows openbsd -// +build gldebug - -package gl - -// Alternate versions of the types defined in types.go with extra -// debugging information attached. For documentation, see types.go. - -import "fmt" - -type Enum uint32 - -type Attrib struct { - Value uint - name string -} - -type Program struct { - Init bool - Value uint32 -} - -type Shader struct { - Value uint32 -} - -type Buffer struct { - Value uint32 -} - -type Framebuffer struct { - Value uint32 -} - -type Renderbuffer struct { - Value uint32 -} - -type Texture struct { - Value uint32 -} - -type Uniform struct { - Value int32 - name string -} - -type VertexArray struct { - Value uint32 -} - -func (v Attrib) c() uintptr { return uintptr(v.Value) } -func (v Enum) c() uintptr { return uintptr(v) } -func (v Program) c() uintptr { - if !v.Init { - ret := uintptr(0) - ret-- - return ret - } - return uintptr(v.Value) -} -func (v Shader) c() uintptr { return uintptr(v.Value) } -func (v Buffer) c() uintptr { return uintptr(v.Value) } -func (v Framebuffer) c() uintptr { return uintptr(v.Value) } -func (v Renderbuffer) c() uintptr { return uintptr(v.Value) } -func (v Texture) c() uintptr { return uintptr(v.Value) } -func (v Uniform) c() uintptr { return uintptr(v.Value) } -func (v VertexArray) c() uintptr { return uintptr(v.Value) } - -func (v Attrib) String() string { return fmt.Sprintf("Attrib(%d:%s)", v.Value, v.name) } -func (v Program) String() string { return fmt.Sprintf("Program(%d)", v.Value) } -func (v Shader) String() string { return fmt.Sprintf("Shader(%d)", v.Value) } -func (v Buffer) String() string { return fmt.Sprintf("Buffer(%d)", v.Value) } -func (v Framebuffer) String() string { return fmt.Sprintf("Framebuffer(%d)", v.Value) } -func (v Renderbuffer) String() string { return fmt.Sprintf("Renderbuffer(%d)", v.Value) } -func (v Texture) String() string { return fmt.Sprintf("Texture(%d)", v.Value) } -func (v Uniform) String() string { return fmt.Sprintf("Uniform(%d:%s)", v.Value, v.name) } -func (v VertexArray) String() string { return fmt.Sprintf("VertexArray(%d)", v.Value) } diff --git a/vendor/golang.org/x/mobile/gl/types_prod.go b/vendor/golang.org/x/mobile/gl/types_prod.go deleted file mode 100644 index 716116e..0000000 --- a/vendor/golang.org/x/mobile/gl/types_prod.go +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build linux darwin windows openbsd -// +build !gldebug - -package gl - -import "fmt" - -// Enum is equivalent to GLenum, and is normally used with one of the -// constants defined in this package. -type Enum uint32 - -// Types are defined a structs so that in debug mode they can carry -// extra information, such as a string name. See typesdebug.go. - -// Attrib identifies the location of a specific attribute variable. -type Attrib struct { - Value uint -} - -// Program identifies a compiled shader program. -type Program struct { - // Init is set by CreateProgram, as some GL drivers (in particular, - // ANGLE) return true for glIsProgram(0). - Init bool - Value uint32 -} - -// Shader identifies a GLSL shader. -type Shader struct { - Value uint32 -} - -// Buffer identifies a GL buffer object. -type Buffer struct { - Value uint32 -} - -// Framebuffer identifies a GL framebuffer. -type Framebuffer struct { - Value uint32 -} - -// A Renderbuffer is a GL object that holds an image in an internal format. -type Renderbuffer struct { - Value uint32 -} - -// A Texture identifies a GL texture unit. -type Texture struct { - Value uint32 -} - -// Uniform identifies the location of a specific uniform variable. -type Uniform struct { - Value int32 -} - -// A VertexArray is a GL object that holds vertices in an internal format. -type VertexArray struct { - Value uint32 -} - -func (v Attrib) c() uintptr { return uintptr(v.Value) } -func (v Enum) c() uintptr { return uintptr(v) } -func (v Program) c() uintptr { - if !v.Init { - ret := uintptr(0) - ret-- - return ret - } - return uintptr(v.Value) -} -func (v Shader) c() uintptr { return uintptr(v.Value) } -func (v Buffer) c() uintptr { return uintptr(v.Value) } -func (v Framebuffer) c() uintptr { return uintptr(v.Value) } -func (v Renderbuffer) c() uintptr { return uintptr(v.Value) } -func (v Texture) c() uintptr { return uintptr(v.Value) } -func (v Uniform) c() uintptr { return uintptr(v.Value) } -func (v VertexArray) c() uintptr { return uintptr(v.Value) } - -func (v Attrib) String() string { return fmt.Sprintf("Attrib(%d)", v.Value) } -func (v Program) String() string { return fmt.Sprintf("Program(%d)", v.Value) } -func (v Shader) String() string { return fmt.Sprintf("Shader(%d)", v.Value) } -func (v Buffer) String() string { return fmt.Sprintf("Buffer(%d)", v.Value) } -func (v Framebuffer) String() string { return fmt.Sprintf("Framebuffer(%d)", v.Value) } -func (v Renderbuffer) String() string { return fmt.Sprintf("Renderbuffer(%d)", v.Value) } -func (v Texture) String() string { return fmt.Sprintf("Texture(%d)", v.Value) } -func (v Uniform) String() string { return fmt.Sprintf("Uniform(%d)", v.Value) } -func (v VertexArray) String() string { return fmt.Sprintf("VertexArray(%d)", v.Value) } diff --git a/vendor/golang.org/x/mobile/gl/work.c b/vendor/golang.org/x/mobile/gl/work.c deleted file mode 100644 index 7203acf..0000000 --- a/vendor/golang.org/x/mobile/gl/work.c +++ /dev/null @@ -1,556 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin linux openbsd - -#include -#include "_cgo_export.h" -#include "work.h" - -#if defined(GL_ES_VERSION_3_0) && GL_ES_VERSION_3_0 -#else -#include -static void gles3missing() { - printf("GLES3 function is missing\n"); - exit(2); -} -static void glUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) { gles3missing(); } -static void glUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) { gles3missing(); } -static void glUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) { gles3missing(); } -static void glUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) { gles3missing(); } -static void glUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) { gles3missing(); } -static void glUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) { gles3missing(); } -static void glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) { gles3missing(); } -static void glUniform1ui(GLint location, GLuint v0) { gles3missing(); } -static void glUniform2ui(GLint location, GLuint v0, GLuint v1) { gles3missing(); } -static void glUniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2) { gles3missing(); } -static void glUniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) { gles3missing(); } -static void glUniform1uiv(GLint location, GLsizei count, const GLuint *value) { gles3missing(); } -static void glUniform2uiv(GLint location, GLsizei count, const GLuint *value) { gles3missing(); } -static void glUniform3uiv(GLint location, GLsizei count, const GLuint *value) { gles3missing(); } -static void glUniform4uiv(GLint location, GLsizei count, const GLuint *value) { gles3missing(); } -static void glBindVertexArray(GLuint array) { gles3missing(); } -static void glGenVertexArrays(GLsizei n, GLuint *arrays) { gles3missing(); } -static void glDeleteVertexArrays(GLsizei n, const GLuint *arrays) { gles3missing(); } -#endif - -uintptr_t processFn(struct fnargs* args, char* parg) { - uintptr_t ret = 0; - switch (args->fn) { - case glfnUNDEFINED: - abort(); // bad glfn - break; - case glfnActiveTexture: - glActiveTexture((GLenum)args->a0); - break; - case glfnAttachShader: - glAttachShader((GLint)args->a0, (GLint)args->a1); - break; - case glfnBindAttribLocation: - glBindAttribLocation((GLint)args->a0, (GLint)args->a1, (GLchar*)args->a2); - break; - case glfnBindBuffer: - glBindBuffer((GLenum)args->a0, (GLuint)args->a1); - break; - case glfnBindFramebuffer: - glBindFramebuffer((GLenum)args->a0, (GLint)args->a1); - break; - case glfnBindRenderbuffer: - glBindRenderbuffer((GLenum)args->a0, (GLint)args->a1); - break; - case glfnBindTexture: - glBindTexture((GLenum)args->a0, (GLint)args->a1); - break; - case glfnBindVertexArray: - glBindVertexArray((GLenum)args->a0); - break; - case glfnBlendColor: - glBlendColor(*(GLfloat*)&args->a0, *(GLfloat*)&args->a1, *(GLfloat*)&args->a2, *(GLfloat*)&args->a3); - break; - case glfnBlendEquation: - glBlendEquation((GLenum)args->a0); - break; - case glfnBlendEquationSeparate: - glBlendEquationSeparate((GLenum)args->a0, (GLenum)args->a1); - break; - case glfnBlendFunc: - glBlendFunc((GLenum)args->a0, (GLenum)args->a1); - break; - case glfnBlendFuncSeparate: - glBlendFuncSeparate((GLenum)args->a0, (GLenum)args->a1, (GLenum)args->a2, (GLenum)args->a3); - break; - case glfnBlitFramebuffer: - glBlitFramebuffer((GLint)args->a0, (GLint)args->a1, (GLint)args->a2, (GLint)args->a3, (GLint)args->a4, (GLint)args->a5, (GLint)args->a6, (GLint)args->a7, (GLbitfield)args->a8, (GLenum)args->a9); - break; - case glfnBufferData: - glBufferData((GLenum)args->a0, (GLsizeiptr)args->a1, (GLvoid*)parg, (GLenum)args->a2); - break; - case glfnBufferSubData: - glBufferSubData((GLenum)args->a0, (GLint)args->a1, (GLsizeiptr)args->a2, (GLvoid*)parg); - break; - case glfnCheckFramebufferStatus: - ret = glCheckFramebufferStatus((GLenum)args->a0); - break; - case glfnClear: - glClear((GLenum)args->a0); - break; - case glfnClearColor: - glClearColor(*(GLfloat*)&args->a0, *(GLfloat*)&args->a1, *(GLfloat*)&args->a2, *(GLfloat*)&args->a3); - break; - case glfnClearDepthf: - glClearDepthf(*(GLfloat*)&args->a0); - break; - case glfnClearStencil: - glClearStencil((GLint)args->a0); - break; - case glfnColorMask: - glColorMask((GLboolean)args->a0, (GLboolean)args->a1, (GLboolean)args->a2, (GLboolean)args->a3); - break; - case glfnCompileShader: - glCompileShader((GLint)args->a0); - break; - case glfnCompressedTexImage2D: - glCompressedTexImage2D((GLenum)args->a0, (GLint)args->a1, (GLenum)args->a2, (GLint)args->a3, (GLint)args->a4, (GLint)args->a5, (GLsizeiptr)args->a6, (GLvoid*)parg); - break; - case glfnCompressedTexSubImage2D: - glCompressedTexSubImage2D((GLenum)args->a0, (GLint)args->a1, (GLint)args->a2, (GLint)args->a3, (GLint)args->a4, (GLint)args->a5, (GLenum)args->a6, (GLsizeiptr)args->a7, (GLvoid*)parg); - break; - case glfnCopyTexImage2D: - glCopyTexImage2D((GLenum)args->a0, (GLint)args->a1, (GLenum)args->a2, (GLint)args->a3, (GLint)args->a4, (GLint)args->a5, (GLint)args->a6, (GLint)args->a7); - break; - case glfnCopyTexSubImage2D: - glCopyTexSubImage2D((GLenum)args->a0, (GLint)args->a1, (GLint)args->a2, (GLint)args->a3, (GLint)args->a4, (GLint)args->a5, (GLint)args->a6, (GLint)args->a7); - break; - case glfnCreateProgram: - ret = glCreateProgram(); - break; - case glfnCreateShader: - ret = glCreateShader((GLenum)args->a0); - break; - case glfnCullFace: - glCullFace((GLenum)args->a0); - break; - case glfnDeleteBuffer: - glDeleteBuffers(1, (const GLuint*)(&args->a0)); - break; - case glfnDeleteFramebuffer: - glDeleteFramebuffers(1, (const GLuint*)(&args->a0)); - break; - case glfnDeleteProgram: - glDeleteProgram((GLint)args->a0); - break; - case glfnDeleteRenderbuffer: - glDeleteRenderbuffers(1, (const GLuint*)(&args->a0)); - break; - case glfnDeleteShader: - glDeleteShader((GLint)args->a0); - break; - case glfnDeleteTexture: - glDeleteTextures(1, (const GLuint*)(&args->a0)); - break; - case glfnDeleteVertexArray: - glDeleteVertexArrays(1, (const GLuint*)(&args->a0)); - break; - case glfnDepthFunc: - glDepthFunc((GLenum)args->a0); - break; - case glfnDepthMask: - glDepthMask((GLboolean)args->a0); - break; - case glfnDepthRangef: - glDepthRangef(*(GLfloat*)&args->a0, *(GLfloat*)&args->a1); - break; - case glfnDetachShader: - glDetachShader((GLint)args->a0, (GLint)args->a1); - break; - case glfnDisable: - glDisable((GLenum)args->a0); - break; - case glfnDisableVertexAttribArray: - glDisableVertexAttribArray((GLint)args->a0); - break; - case glfnDrawArrays: - glDrawArrays((GLenum)args->a0, (GLint)args->a1, (GLint)args->a2); - break; - case glfnDrawElements: - glDrawElements((GLenum)args->a0, (GLint)args->a1, (GLenum)args->a2, (void*)args->a3); - break; - case glfnEnable: - glEnable((GLenum)args->a0); - break; - case glfnEnableVertexAttribArray: - glEnableVertexAttribArray((GLint)args->a0); - break; - case glfnFinish: - glFinish(); - break; - case glfnFlush: - glFlush(); - break; - case glfnFramebufferRenderbuffer: - glFramebufferRenderbuffer((GLenum)args->a0, (GLenum)args->a1, (GLenum)args->a2, (GLint)args->a3); - break; - case glfnFramebufferTexture2D: - glFramebufferTexture2D((GLenum)args->a0, (GLenum)args->a1, (GLenum)args->a2, (GLint)args->a3, (GLint)args->a4); - break; - case glfnFrontFace: - glFrontFace((GLenum)args->a0); - break; - case glfnGenBuffer: - glGenBuffers(1, (GLuint*)&ret); - break; - case glfnGenFramebuffer: - glGenFramebuffers(1, (GLuint*)&ret); - break; - case glfnGenRenderbuffer: - glGenRenderbuffers(1, (GLuint*)&ret); - break; - case glfnGenTexture: - glGenTextures(1, (GLuint*)&ret); - break; - case glfnGenVertexArray: - glGenVertexArrays(1, (GLuint*)&ret); - break; - case glfnGenerateMipmap: - glGenerateMipmap((GLenum)args->a0); - break; - case glfnGetActiveAttrib: - glGetActiveAttrib( - (GLuint)args->a0, - (GLuint)args->a1, - (GLsizei)args->a2, - NULL, - (GLint*)&ret, - (GLenum*)args->a3, - (GLchar*)parg); - break; - case glfnGetActiveUniform: - glGetActiveUniform( - (GLuint)args->a0, - (GLuint)args->a1, - (GLsizei)args->a2, - NULL, - (GLint*)&ret, - (GLenum*)args->a3, - (GLchar*)parg); - break; - case glfnGetAttachedShaders: - glGetAttachedShaders((GLuint)args->a0, (GLsizei)args->a1, (GLsizei*)&ret, (GLuint*)parg); - break; - case glfnGetAttribLocation: - ret = glGetAttribLocation((GLint)args->a0, (GLchar*)args->a1); - break; - case glfnGetBooleanv: - glGetBooleanv((GLenum)args->a0, (GLboolean*)parg); - break; - case glfnGetBufferParameteri: - glGetBufferParameteriv((GLenum)args->a0, (GLenum)args->a1, (GLint*)&ret); - break; - case glfnGetFloatv: - glGetFloatv((GLenum)args->a0, (GLfloat*)parg); - break; - case glfnGetIntegerv: - glGetIntegerv((GLenum)args->a0, (GLint*)parg); - break; - case glfnGetError: - ret = glGetError(); - break; - case glfnGetFramebufferAttachmentParameteriv: - glGetFramebufferAttachmentParameteriv((GLenum)args->a0, (GLenum)args->a1, (GLenum)args->a2, (GLint*)&ret); - break; - case glfnGetProgramiv: - glGetProgramiv((GLint)args->a0, (GLenum)args->a1, (GLint*)&ret); - break; - case glfnGetProgramInfoLog: - glGetProgramInfoLog((GLuint)args->a0, (GLsizei)args->a1, 0, (GLchar*)parg); - break; - case glfnGetRenderbufferParameteriv: - glGetRenderbufferParameteriv((GLenum)args->a0, (GLenum)args->a1, (GLint*)&ret); - break; - case glfnGetShaderiv: - glGetShaderiv((GLint)args->a0, (GLenum)args->a1, (GLint*)&ret); - break; - case glfnGetShaderInfoLog: - glGetShaderInfoLog((GLuint)args->a0, (GLsizei)args->a1, 0, (GLchar*)parg); - break; - case glfnGetShaderPrecisionFormat: - glGetShaderPrecisionFormat((GLenum)args->a0, (GLenum)args->a1, (GLint*)parg, &((GLint*)parg)[2]); - break; - case glfnGetShaderSource: - glGetShaderSource((GLuint)args->a0, (GLsizei)args->a1, 0, (GLchar*)parg); - break; - case glfnGetString: - ret = (uintptr_t)glGetString((GLenum)args->a0); - break; - case glfnGetTexParameterfv: - glGetTexParameterfv((GLenum)args->a0, (GLenum)args->a1, (GLfloat*)parg); - break; - case glfnGetTexParameteriv: - glGetTexParameteriv((GLenum)args->a0, (GLenum)args->a1, (GLint*)parg); - break; - case glfnGetUniformfv: - glGetUniformfv((GLuint)args->a0, (GLint)args->a1, (GLfloat*)parg); - break; - case glfnGetUniformiv: - glGetUniformiv((GLuint)args->a0, (GLint)args->a1, (GLint*)parg); - break; - case glfnGetUniformLocation: - ret = glGetUniformLocation((GLint)args->a0, (GLchar*)args->a1); - break; - case glfnGetVertexAttribfv: - glGetVertexAttribfv((GLuint)args->a0, (GLenum)args->a1, (GLfloat*)parg); - break; - case glfnGetVertexAttribiv: - glGetVertexAttribiv((GLuint)args->a0, (GLenum)args->a1, (GLint*)parg); - break; - case glfnHint: - glHint((GLenum)args->a0, (GLenum)args->a1); - break; - case glfnIsBuffer: - ret = glIsBuffer((GLint)args->a0); - break; - case glfnIsEnabled: - ret = glIsEnabled((GLenum)args->a0); - break; - case glfnIsFramebuffer: - ret = glIsFramebuffer((GLint)args->a0); - break; - case glfnIsProgram: - ret = glIsProgram((GLint)args->a0); - break; - case glfnIsRenderbuffer: - ret = glIsRenderbuffer((GLint)args->a0); - break; - case glfnIsShader: - ret = glIsShader((GLint)args->a0); - break; - case glfnIsTexture: - ret = glIsTexture((GLint)args->a0); - break; - case glfnLineWidth: - glLineWidth(*(GLfloat*)&args->a0); - break; - case glfnLinkProgram: - glLinkProgram((GLint)args->a0); - break; - case glfnPixelStorei: - glPixelStorei((GLenum)args->a0, (GLint)args->a1); - break; - case glfnPolygonOffset: - glPolygonOffset(*(GLfloat*)&args->a0, *(GLfloat*)&args->a1); - break; - case glfnReadPixels: - glReadPixels((GLint)args->a0, (GLint)args->a1, (GLsizei)args->a2, (GLsizei)args->a3, (GLenum)args->a4, (GLenum)args->a5, (void*)parg); - break; - case glfnReleaseShaderCompiler: - glReleaseShaderCompiler(); - break; - case glfnRenderbufferStorage: - glRenderbufferStorage((GLenum)args->a0, (GLenum)args->a1, (GLint)args->a2, (GLint)args->a3); - break; - case glfnSampleCoverage: - glSampleCoverage(*(GLfloat*)&args->a0, (GLboolean)args->a1); - break; - case glfnScissor: - glScissor((GLint)args->a0, (GLint)args->a1, (GLint)args->a2, (GLint)args->a3); - break; - case glfnShaderSource: -#if defined(os_ios) || defined(os_osx) - glShaderSource((GLuint)args->a0, (GLsizei)args->a1, (const GLchar *const *)args->a2, NULL); -#else - glShaderSource((GLuint)args->a0, (GLsizei)args->a1, (const GLchar **)args->a2, NULL); -#endif - break; - case glfnStencilFunc: - glStencilFunc((GLenum)args->a0, (GLint)args->a1, (GLuint)args->a2); - break; - case glfnStencilFuncSeparate: - glStencilFuncSeparate((GLenum)args->a0, (GLenum)args->a1, (GLint)args->a2, (GLuint)args->a3); - break; - case glfnStencilMask: - glStencilMask((GLuint)args->a0); - break; - case glfnStencilMaskSeparate: - glStencilMaskSeparate((GLenum)args->a0, (GLuint)args->a1); - break; - case glfnStencilOp: - glStencilOp((GLenum)args->a0, (GLenum)args->a1, (GLenum)args->a2); - break; - case glfnStencilOpSeparate: - glStencilOpSeparate((GLenum)args->a0, (GLenum)args->a1, (GLenum)args->a2, (GLenum)args->a3); - break; - case glfnTexImage2D: - glTexImage2D( - (GLenum)args->a0, - (GLint)args->a1, - (GLint)args->a2, - (GLsizei)args->a3, - (GLsizei)args->a4, - 0, // border - (GLenum)args->a5, - (GLenum)args->a6, - (const GLvoid*)parg); - break; - case glfnTexSubImage2D: - glTexSubImage2D( - (GLenum)args->a0, - (GLint)args->a1, - (GLint)args->a2, - (GLint)args->a3, - (GLsizei)args->a4, - (GLsizei)args->a5, - (GLenum)args->a6, - (GLenum)args->a7, - (const GLvoid*)parg); - break; - case glfnTexParameterf: - glTexParameterf((GLenum)args->a0, (GLenum)args->a1, *(GLfloat*)&args->a2); - break; - case glfnTexParameterfv: - glTexParameterfv((GLenum)args->a0, (GLenum)args->a1, (GLfloat*)parg); - break; - case glfnTexParameteri: - glTexParameteri((GLenum)args->a0, (GLenum)args->a1, (GLint)args->a2); - break; - case glfnTexParameteriv: - glTexParameteriv((GLenum)args->a0, (GLenum)args->a1, (GLint*)parg); - break; - case glfnUniform1f: - glUniform1f((GLint)args->a0, *(GLfloat*)&args->a1); - break; - case glfnUniform1fv: - glUniform1fv((GLint)args->a0, (GLsizeiptr)args->a1, (GLvoid*)parg); - break; - case glfnUniform1i: - glUniform1i((GLint)args->a0, (GLint)args->a1); - break; - case glfnUniform1ui: - glUniform1ui((GLint)args->a0, (GLuint)args->a1); - break; - case glfnUniform1uiv: - glUniform1uiv((GLint)args->a0, (GLsizeiptr)args->a1, (GLuint*)parg); - break; - case glfnUniform1iv: - glUniform1iv((GLint)args->a0, (GLsizeiptr)args->a1, (GLvoid*)parg); - break; - case glfnUniform2f: - glUniform2f((GLint)args->a0, *(GLfloat*)&args->a1, *(GLfloat*)&args->a2); - break; - case glfnUniform2fv: - glUniform2fv((GLint)args->a0, (GLsizeiptr)args->a1, (GLvoid*)parg); - break; - case glfnUniform2i: - glUniform2i((GLint)args->a0, (GLint)args->a1, (GLint)args->a2); - break; - case glfnUniform2ui: - glUniform2ui((GLint)args->a0, (GLuint)args->a1, (GLuint)args->a2); - break; - case glfnUniform2uiv: - glUniform2uiv((GLint)args->a0, (GLsizeiptr)args->a1, (GLuint*)parg); - break; - case glfnUniform2iv: - glUniform2iv((GLint)args->a0, (GLsizeiptr)args->a1, (GLvoid*)parg); - break; - case glfnUniform3f: - glUniform3f((GLint)args->a0, *(GLfloat*)&args->a1, *(GLfloat*)&args->a2, *(GLfloat*)&args->a3); - break; - case glfnUniform3fv: - glUniform3fv((GLint)args->a0, (GLsizeiptr)args->a1, (GLvoid*)parg); - break; - case glfnUniform3i: - glUniform3i((GLint)args->a0, (GLint)args->a1, (GLint)args->a2, (GLint)args->a3); - break; - case glfnUniform3ui: - glUniform3ui((GLint)args->a0, (GLuint)args->a1, (GLuint)args->a2, (GLuint)args->a3); - break; - case glfnUniform3uiv: - glUniform3uiv((GLint)args->a0, (GLsizeiptr)args->a1, (GLuint*)parg); - break; - case glfnUniform3iv: - glUniform3iv((GLint)args->a0, (GLsizeiptr)args->a1, (GLvoid*)parg); - break; - case glfnUniform4f: - glUniform4f((GLint)args->a0, *(GLfloat*)&args->a1, *(GLfloat*)&args->a2, *(GLfloat*)&args->a3, *(GLfloat*)&args->a4); - break; - case glfnUniform4fv: - glUniform4fv((GLint)args->a0, (GLsizeiptr)args->a1, (GLvoid*)parg); - break; - case glfnUniform4i: - glUniform4i((GLint)args->a0, (GLint)args->a1, (GLint)args->a2, (GLint)args->a3, (GLint)args->a4); - break; - case glfnUniform4ui: - glUniform4ui((GLint)args->a0, (GLuint)args->a1, (GLuint)args->a2, (GLuint)args->a3, (GLuint)args->a4); - break; - case glfnUniform4uiv: - glUniform4uiv((GLint)args->a0, (GLsizeiptr)args->a1, (GLuint*)parg); - break; - case glfnUniform4iv: - glUniform4iv((GLint)args->a0, (GLsizeiptr)args->a1, (GLvoid*)parg); - break; - case glfnUniformMatrix2fv: - glUniformMatrix2fv((GLint)args->a0, (GLsizeiptr)args->a1, 0, (GLvoid*)parg); - break; - case glfnUniformMatrix3fv: - glUniformMatrix3fv((GLint)args->a0, (GLsizeiptr)args->a1, 0, (GLvoid*)parg); - break; - case glfnUniformMatrix4fv: - glUniformMatrix4fv((GLint)args->a0, (GLsizeiptr)args->a1, 0, (GLvoid*)parg); - break; - case glfnUniformMatrix2x3fv: - glUniformMatrix2x3fv((GLint)args->a0, (GLsizeiptr)args->a1, 0, (GLvoid*)parg); - break; - case glfnUniformMatrix3x2fv: - glUniformMatrix3x2fv((GLint)args->a0, (GLsizeiptr)args->a1, 0, (GLvoid*)parg); - break; - case glfnUniformMatrix2x4fv: - glUniformMatrix2x4fv((GLint)args->a0, (GLsizeiptr)args->a1, 0, (GLvoid*)parg); - break; - case glfnUniformMatrix4x2fv: - glUniformMatrix4x2fv((GLint)args->a0, (GLsizeiptr)args->a1, 0, (GLvoid*)parg); - break; - case glfnUniformMatrix3x4fv: - glUniformMatrix3x4fv((GLint)args->a0, (GLsizeiptr)args->a1, 0, (GLvoid*)parg); - break; - case glfnUniformMatrix4x3fv: - glUniformMatrix4x3fv((GLint)args->a0, (GLsizeiptr)args->a1, 0, (GLvoid*)parg); - break; - case glfnUseProgram: - glUseProgram((GLint)args->a0); - break; - case glfnValidateProgram: - glValidateProgram((GLint)args->a0); - break; - case glfnVertexAttrib1f: - glVertexAttrib1f((GLint)args->a0, *(GLfloat*)&args->a1); - break; - case glfnVertexAttrib1fv: - glVertexAttrib1fv((GLint)args->a0, (GLfloat*)parg); - break; - case glfnVertexAttrib2f: - glVertexAttrib2f((GLint)args->a0, *(GLfloat*)&args->a1, *(GLfloat*)&args->a2); - break; - case glfnVertexAttrib2fv: - glVertexAttrib2fv((GLint)args->a0, (GLfloat*)parg); - break; - case glfnVertexAttrib3f: - glVertexAttrib3f((GLint)args->a0, *(GLfloat*)&args->a1, *(GLfloat*)&args->a2, *(GLfloat*)&args->a3); - break; - case glfnVertexAttrib3fv: - glVertexAttrib3fv((GLint)args->a0, (GLfloat*)parg); - break; - case glfnVertexAttrib4f: - glVertexAttrib4f((GLint)args->a0, *(GLfloat*)&args->a1, *(GLfloat*)&args->a2, *(GLfloat*)&args->a3, *(GLfloat*)&args->a4); - break; - case glfnVertexAttrib4fv: - glVertexAttrib4fv((GLint)args->a0, (GLfloat*)parg); - break; - case glfnVertexAttribPointer: - glVertexAttribPointer((GLuint)args->a0, (GLint)args->a1, (GLenum)args->a2, (GLboolean)args->a3, (GLsizei)args->a4, (const GLvoid*)args->a5); - break; - case glfnViewport: - glViewport((GLint)args->a0, (GLint)args->a1, (GLint)args->a2, (GLint)args->a3); - break; - } - return ret; -} diff --git a/vendor/golang.org/x/mobile/gl/work.go b/vendor/golang.org/x/mobile/gl/work.go deleted file mode 100644 index 3a8bacf..0000000 --- a/vendor/golang.org/x/mobile/gl/work.go +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin linux openbsd - -package gl - -/* -#cgo ios LDFLAGS: -framework OpenGLES -#cgo darwin,amd64,!ios LDFLAGS: -framework OpenGL -#cgo darwin,arm LDFLAGS: -framework OpenGLES -#cgo darwin,arm64 LDFLAGS: -framework OpenGLES -#cgo linux LDFLAGS: -lGLESv2 -#cgo openbsd LDFLAGS: -L/usr/X11R6/lib/ -lGLESv2 - -#cgo android CFLAGS: -Dos_android -#cgo ios CFLAGS: -Dos_ios -#cgo darwin,amd64,!ios CFLAGS: -Dos_osx -#cgo darwin,arm CFLAGS: -Dos_ios -#cgo darwin,arm64 CFLAGS: -Dos_ios -#cgo linux CFLAGS: -Dos_linux -#cgo openbsd CFLAGS: -Dos_openbsd - -#cgo openbsd CFLAGS: -I/usr/X11R6/include/ - -#include -#include "work.h" - -uintptr_t process(struct fnargs* cargs, char* parg0, char* parg1, char* parg2, int count) { - uintptr_t ret; - - ret = processFn(&cargs[0], parg0); - if (count > 1) { - ret = processFn(&cargs[1], parg1); - } - if (count > 2) { - ret = processFn(&cargs[2], parg2); - } - - return ret; -} -*/ -import "C" - -import "unsafe" - -const workbufLen = 3 - -type context struct { - cptr uintptr - debug int32 - - workAvailable chan struct{} - - // work is a queue of calls to execute. - work chan call - - // retvalue is sent a return value when blocking calls complete. - // It is safe to use a global unbuffered channel here as calls - // cannot currently be made concurrently. - // - // TODO: the comment above about concurrent calls isn't actually true: package - // app calls package gl, but it has to do so in a separate goroutine, which - // means that its gl calls (which may be blocking) can race with other gl calls - // in the main program. We should make it safe to issue blocking gl calls - // concurrently, or get the gl calls out of package app, or both. - retvalue chan C.uintptr_t - - cargs [workbufLen]C.struct_fnargs - parg [workbufLen]*C.char -} - -func (ctx *context) WorkAvailable() <-chan struct{} { return ctx.workAvailable } - -type context3 struct { - *context -} - -// NewContext creates a cgo OpenGL context. -// -// See the Worker interface for more details on how it is used. -func NewContext() (Context, Worker) { - glctx := &context{ - workAvailable: make(chan struct{}, 1), - work: make(chan call, workbufLen), - retvalue: make(chan C.uintptr_t), - } - if C.GLES_VERSION == "GL_ES_2_0" { - return glctx, glctx - } - return context3{glctx}, glctx -} - -// Version returns a GL ES version string, either "GL_ES_2_0" or "GL_ES_3_0". -// Future versions of the gl package may return "GL_ES_3_1". -func Version() string { - return C.GLES_VERSION -} - -func (ctx *context) enqueue(c call) uintptr { - ctx.work <- c - - select { - case ctx.workAvailable <- struct{}{}: - default: - } - - if c.blocking { - return uintptr(<-ctx.retvalue) - } - return 0 -} - -func (ctx *context) DoWork() { - queue := make([]call, 0, workbufLen) - for { - // Wait until at least one piece of work is ready. - // Accumulate work until a piece is marked as blocking. - select { - case w := <-ctx.work: - queue = append(queue, w) - default: - return - } - blocking := queue[len(queue)-1].blocking - enqueue: - for len(queue) < cap(queue) && !blocking { - select { - case w := <-ctx.work: - queue = append(queue, w) - blocking = queue[len(queue)-1].blocking - default: - break enqueue - } - } - - // Process the queued GL functions. - for i, q := range queue { - ctx.cargs[i] = *(*C.struct_fnargs)(unsafe.Pointer(&q.args)) - ctx.parg[i] = (*C.char)(q.parg) - } - ret := C.process(&ctx.cargs[0], ctx.parg[0], ctx.parg[1], ctx.parg[2], C.int(len(queue))) - - // Cleanup and signal. - queue = queue[:0] - if blocking { - ctx.retvalue <- ret - } - } -} - -func init() { - if unsafe.Sizeof(C.GLint(0)) != unsafe.Sizeof(int32(0)) { - panic("GLint is not an int32") - } -} - -// cString creates C string off the Go heap. -// ret is a *char. -func (ctx *context) cString(str string) (uintptr, func()) { - ptr := unsafe.Pointer(C.CString(str)) - return uintptr(ptr), func() { C.free(ptr) } -} - -// cString creates a pointer to a C string off the Go heap. -// ret is a **char. -func (ctx *context) cStringPtr(str string) (uintptr, func()) { - s, free := ctx.cString(str) - ptr := C.malloc(C.size_t(unsafe.Sizeof((*int)(nil)))) - *(*uintptr)(ptr) = s - return uintptr(ptr), func() { - free() - C.free(ptr) - } -} diff --git a/vendor/golang.org/x/mobile/gl/work.h b/vendor/golang.org/x/mobile/gl/work.h deleted file mode 100644 index cc2e48c..0000000 --- a/vendor/golang.org/x/mobile/gl/work.h +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -#ifdef os_android -// TODO(crawshaw): We could include and -// condition on __ANDROID_API__ to get GLES3 headers. However -// we also need to add -lGLESv3 to LDFLAGS, which we cannot do -// from inside an ifdef. -#include -#elif os_linux -#include // install on Ubuntu with: sudo apt-get install libegl1-mesa-dev libgles2-mesa-dev libx11-dev -#elif os_openbsd -#include -#endif - -#ifdef os_ios -#include -#endif - -#ifdef os_osx -#include -#define GL_ES_VERSION_3_0 1 -#endif - -#if defined(GL_ES_VERSION_3_0) && GL_ES_VERSION_3_0 -#define GLES_VERSION "GL_ES_3_0" -#else -#define GLES_VERSION "GL_ES_2_0" -#endif - -#include -#include - -// TODO: generate this enum from fn.go. -typedef enum { - glfnUNDEFINED, - - glfnActiveTexture, - glfnAttachShader, - glfnBindAttribLocation, - glfnBindBuffer, - glfnBindFramebuffer, - glfnBindRenderbuffer, - glfnBindTexture, - glfnBindVertexArray, - glfnBlendColor, - glfnBlendEquation, - glfnBlendEquationSeparate, - glfnBlendFunc, - glfnBlendFuncSeparate, - glfnBufferData, - glfnBufferSubData, - glfnCheckFramebufferStatus, - glfnClear, - glfnClearColor, - glfnClearDepthf, - glfnClearStencil, - glfnColorMask, - glfnCompileShader, - glfnCompressedTexImage2D, - glfnCompressedTexSubImage2D, - glfnCopyTexImage2D, - glfnCopyTexSubImage2D, - glfnCreateProgram, - glfnCreateShader, - glfnCullFace, - glfnDeleteBuffer, - glfnDeleteFramebuffer, - glfnDeleteProgram, - glfnDeleteRenderbuffer, - glfnDeleteShader, - glfnDeleteTexture, - glfnDeleteVertexArray, - glfnDepthFunc, - glfnDepthRangef, - glfnDepthMask, - glfnDetachShader, - glfnDisable, - glfnDisableVertexAttribArray, - glfnDrawArrays, - glfnDrawElements, - glfnEnable, - glfnEnableVertexAttribArray, - glfnFinish, - glfnFlush, - glfnFramebufferRenderbuffer, - glfnFramebufferTexture2D, - glfnFrontFace, - glfnGenBuffer, - glfnGenFramebuffer, - glfnGenRenderbuffer, - glfnGenTexture, - glfnGenVertexArray, - glfnGenerateMipmap, - glfnGetActiveAttrib, - glfnGetActiveUniform, - glfnGetAttachedShaders, - glfnGetAttribLocation, - glfnGetBooleanv, - glfnGetBufferParameteri, - glfnGetError, - glfnGetFloatv, - glfnGetFramebufferAttachmentParameteriv, - glfnGetIntegerv, - glfnGetProgramInfoLog, - glfnGetProgramiv, - glfnGetRenderbufferParameteriv, - glfnGetShaderInfoLog, - glfnGetShaderPrecisionFormat, - glfnGetShaderSource, - glfnGetShaderiv, - glfnGetString, - glfnGetTexParameterfv, - glfnGetTexParameteriv, - glfnGetUniformLocation, - glfnGetUniformfv, - glfnGetUniformiv, - glfnGetVertexAttribfv, - glfnGetVertexAttribiv, - glfnHint, - glfnIsBuffer, - glfnIsEnabled, - glfnIsFramebuffer, - glfnIsProgram, - glfnIsRenderbuffer, - glfnIsShader, - glfnIsTexture, - glfnLineWidth, - glfnLinkProgram, - glfnPixelStorei, - glfnPolygonOffset, - glfnReadPixels, - glfnReleaseShaderCompiler, - glfnRenderbufferStorage, - glfnSampleCoverage, - glfnScissor, - glfnShaderSource, - glfnStencilFunc, - glfnStencilFuncSeparate, - glfnStencilMask, - glfnStencilMaskSeparate, - glfnStencilOp, - glfnStencilOpSeparate, - glfnTexImage2D, - glfnTexParameterf, - glfnTexParameterfv, - glfnTexParameteri, - glfnTexParameteriv, - glfnTexSubImage2D, - glfnUniform1f, - glfnUniform1fv, - glfnUniform1i, - glfnUniform1iv, - glfnUniform2f, - glfnUniform2fv, - glfnUniform2i, - glfnUniform2iv, - glfnUniform3f, - glfnUniform3fv, - glfnUniform3i, - glfnUniform3iv, - glfnUniform4f, - glfnUniform4fv, - glfnUniform4i, - glfnUniform4iv, - glfnUniformMatrix2fv, - glfnUniformMatrix3fv, - glfnUniformMatrix4fv, - glfnUseProgram, - glfnValidateProgram, - glfnVertexAttrib1f, - glfnVertexAttrib1fv, - glfnVertexAttrib2f, - glfnVertexAttrib2fv, - glfnVertexAttrib3f, - glfnVertexAttrib3fv, - glfnVertexAttrib4f, - glfnVertexAttrib4fv, - glfnVertexAttribPointer, - glfnViewport, - - // ES 3.0 functions - glfnUniformMatrix2x3fv, - glfnUniformMatrix3x2fv, - glfnUniformMatrix2x4fv, - glfnUniformMatrix4x2fv, - glfnUniformMatrix3x4fv, - glfnUniformMatrix4x3fv, - glfnBlitFramebuffer, - glfnUniform1ui, - glfnUniform2ui, - glfnUniform3ui, - glfnUniform4ui, - glfnUniform1uiv, - glfnUniform2uiv, - glfnUniform3uiv, - glfnUniform4uiv, -} glfn; - -// TODO: generate this type from fn.go. -struct fnargs { - glfn fn; - - uintptr_t a0; - 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; -}; - -extern uintptr_t processFn(struct fnargs* args, char* parg); diff --git a/vendor/golang.org/x/mobile/gl/work_windows.go b/vendor/golang.org/x/mobile/gl/work_windows.go deleted file mode 100644 index 4119ac6..0000000 --- a/vendor/golang.org/x/mobile/gl/work_windows.go +++ /dev/null @@ -1,569 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gl - -import ( - "runtime" - "syscall" - "unsafe" -) - -// context is described in work.go. -type context struct { - debug int32 - workAvailable chan struct{} - work chan call - retvalue chan uintptr - - // TODO(crawshaw): will not work with a moving collector - cStringCounter int - cStrings map[int]unsafe.Pointer -} - -func (ctx *context) WorkAvailable() <-chan struct{} { return ctx.workAvailable } - -type context3 struct { - *context -} - -func NewContext() (Context, Worker) { - if err := findDLLs(); err != nil { - panic(err) - } - glctx := &context{ - workAvailable: make(chan struct{}, 1), - work: make(chan call, 3), - retvalue: make(chan uintptr), - cStrings: make(map[int]unsafe.Pointer), - } - return glctx, glctx -} - -func (ctx *context) enqueue(c call) uintptr { - ctx.work <- c - - select { - case ctx.workAvailable <- struct{}{}: - default: - } - - if c.blocking { - return <-ctx.retvalue - } - return 0 -} - -func (ctx *context) DoWork() { - // TODO: add a work queue - for { - select { - case w := <-ctx.work: - ret := ctx.doWork(w) - if w.blocking { - ctx.retvalue <- ret - } - default: - return - } - } -} - -func (ctx *context) cString(s string) (uintptr, func()) { - buf := make([]byte, len(s)+1) - for i := 0; i < len(s); i++ { - buf[i] = s[i] - } - ret := unsafe.Pointer(&buf[0]) - id := ctx.cStringCounter - ctx.cStringCounter++ - ctx.cStrings[id] = ret - return uintptr(ret), func() { delete(ctx.cStrings, id) } -} - -func (ctx *context) cStringPtr(str string) (uintptr, func()) { - s, sfree := ctx.cString(str) - sptr := [2]uintptr{s, 0} - ret := unsafe.Pointer(&sptr[0]) - id := ctx.cStringCounter - ctx.cStringCounter++ - ctx.cStrings[id] = ret - return uintptr(ret), func() { sfree(); delete(ctx.cStrings, id) } -} - -// fixFloat copies the first four arguments into the XMM registers. -// This is for the windows/amd64 calling convention, that wants -// floating point arguments to be passed in XMM. -// -// Mercifully, type information is not required to implement -// this calling convention. In particular see the mixed int/float -// examples: -// -// https://msdn.microsoft.com/en-us/library/zthk2dkh.aspx -// -// This means it could be fixed in syscall.Syscall. The relevant -// issue is -// -// https://golang.org/issue/6510 -func fixFloat(x0, x1, x2, x3 uintptr) - -func (ctx *context) doWork(c call) (ret uintptr) { - if runtime.GOARCH == "amd64" { - fixFloat(c.args.a0, c.args.a1, c.args.a2, c.args.a3) - } - - switch c.args.fn { - case glfnActiveTexture: - syscall.Syscall(glActiveTexture.Addr(), 1, c.args.a0, 0, 0) - case glfnAttachShader: - syscall.Syscall(glAttachShader.Addr(), 2, c.args.a0, c.args.a1, 0) - case glfnBindAttribLocation: - syscall.Syscall(glBindAttribLocation.Addr(), 3, c.args.a0, c.args.a1, c.args.a2) - case glfnBindBuffer: - syscall.Syscall(glBindBuffer.Addr(), 2, c.args.a0, c.args.a1, 0) - case glfnBindFramebuffer: - syscall.Syscall(glBindFramebuffer.Addr(), 2, c.args.a0, c.args.a1, 0) - case glfnBindRenderbuffer: - syscall.Syscall(glBindRenderbuffer.Addr(), 2, c.args.a0, c.args.a1, 0) - case glfnBindTexture: - syscall.Syscall(glBindTexture.Addr(), 2, c.args.a0, c.args.a1, 0) - case glfnBindVertexArray: - syscall.Syscall(glBindVertexArray.Addr(), 1, c.args.a0, 0, 0) - case glfnBlendColor: - syscall.Syscall6(glBlendColor.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, 0, 0) - case glfnBlendEquation: - syscall.Syscall(glBlendEquation.Addr(), 1, c.args.a0, 0, 0) - case glfnBlendEquationSeparate: - syscall.Syscall(glBlendEquationSeparate.Addr(), 2, c.args.a0, c.args.a1, 0) - case glfnBlendFunc: - syscall.Syscall(glBlendFunc.Addr(), 2, c.args.a0, c.args.a1, 0) - case glfnBlendFuncSeparate: - syscall.Syscall6(glBlendFuncSeparate.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, 0, 0) - case glfnBufferData: - syscall.Syscall6(glBufferData.Addr(), 4, c.args.a0, c.args.a1, uintptr(c.parg), c.args.a2, 0, 0) - case glfnBufferSubData: - syscall.Syscall6(glBufferSubData.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, uintptr(c.parg), 0, 0) - case glfnCheckFramebufferStatus: - ret, _, _ = syscall.Syscall(glCheckFramebufferStatus.Addr(), 1, c.args.a0, 0, 0) - case glfnClear: - syscall.Syscall(glClear.Addr(), 1, c.args.a0, 0, 0) - case glfnClearColor: - syscall.Syscall6(glClearColor.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, 0, 0) - case glfnClearDepthf: - syscall.Syscall6(glClearDepthf.Addr(), 1, c.args.a0, 0, 0, 0, 0, 0) - case glfnClearStencil: - syscall.Syscall(glClearStencil.Addr(), 1, c.args.a0, 0, 0) - case glfnColorMask: - syscall.Syscall6(glColorMask.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, 0, 0) - case glfnCompileShader: - syscall.Syscall(glCompileShader.Addr(), 1, c.args.a0, 0, 0) - case glfnCompressedTexImage2D: - syscall.Syscall9(glCompressedTexImage2D.Addr(), 8, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5, c.args.a6, uintptr(c.parg), 0) - case glfnCompressedTexSubImage2D: - syscall.Syscall9(glCompressedTexSubImage2D.Addr(), 9, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5, c.args.a6, c.args.a7, uintptr(c.parg)) - case glfnCopyTexImage2D: - syscall.Syscall9(glCopyTexImage2D.Addr(), 8, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5, c.args.a6, c.args.a7, 0) - case glfnCopyTexSubImage2D: - syscall.Syscall9(glCopyTexSubImage2D.Addr(), 8, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5, c.args.a6, c.args.a7, 0) - case glfnCreateProgram: - ret, _, _ = syscall.Syscall(glCreateProgram.Addr(), 0, 0, 0, 0) - case glfnCreateShader: - ret, _, _ = syscall.Syscall(glCreateShader.Addr(), 1, c.args.a0, 0, 0) - case glfnCullFace: - syscall.Syscall(glCullFace.Addr(), 1, c.args.a0, 0, 0) - case glfnDeleteBuffer: - syscall.Syscall(glDeleteBuffers.Addr(), 2, 1, uintptr(unsafe.Pointer(&c.args.a0)), 0) - case glfnDeleteFramebuffer: - syscall.Syscall(glDeleteFramebuffers.Addr(), 2, 1, uintptr(unsafe.Pointer(&c.args.a0)), 0) - case glfnDeleteProgram: - syscall.Syscall(glDeleteProgram.Addr(), 1, c.args.a0, 0, 0) - case glfnDeleteRenderbuffer: - syscall.Syscall(glDeleteRenderbuffers.Addr(), 2, 1, uintptr(unsafe.Pointer(&c.args.a0)), 0) - case glfnDeleteShader: - syscall.Syscall(glDeleteShader.Addr(), 1, c.args.a0, 0, 0) - case glfnDeleteVertexArray: - syscall.Syscall(glDeleteVertexArrays.Addr(), 2, 1, uintptr(unsafe.Pointer(&c.args.a0)), 0) - case glfnDeleteTexture: - syscall.Syscall(glDeleteTextures.Addr(), 2, 1, uintptr(unsafe.Pointer(&c.args.a0)), 0) - case glfnDepthFunc: - syscall.Syscall(glDepthFunc.Addr(), 1, c.args.a0, 0, 0) - case glfnDepthRangef: - syscall.Syscall6(glDepthRangef.Addr(), 2, c.args.a0, c.args.a1, 0, 0, 0, 0) - case glfnDepthMask: - syscall.Syscall(glDepthMask.Addr(), 1, c.args.a0, 0, 0) - case glfnDetachShader: - syscall.Syscall(glDetachShader.Addr(), 2, c.args.a0, c.args.a1, 0) - case glfnDisable: - syscall.Syscall(glDisable.Addr(), 1, c.args.a0, 0, 0) - case glfnDisableVertexAttribArray: - syscall.Syscall(glDisableVertexAttribArray.Addr(), 1, c.args.a0, 0, 0) - case glfnDrawArrays: - syscall.Syscall(glDrawArrays.Addr(), 3, c.args.a0, c.args.a1, c.args.a2) - case glfnDrawElements: - syscall.Syscall6(glDrawElements.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, 0, 0) - case glfnEnable: - syscall.Syscall(glEnable.Addr(), 1, c.args.a0, 0, 0) - case glfnEnableVertexAttribArray: - syscall.Syscall(glEnableVertexAttribArray.Addr(), 1, c.args.a0, 0, 0) - case glfnFinish: - syscall.Syscall(glFinish.Addr(), 0, 0, 0, 0) - case glfnFlush: - syscall.Syscall(glFlush.Addr(), 0, 0, 0, 0) - case glfnFramebufferRenderbuffer: - syscall.Syscall6(glFramebufferRenderbuffer.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, 0, 0) - case glfnFramebufferTexture2D: - syscall.Syscall6(glFramebufferTexture2D.Addr(), 5, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, 0) - case glfnFrontFace: - syscall.Syscall(glFrontFace.Addr(), 1, c.args.a0, 0, 0) - case glfnGenBuffer: - syscall.Syscall(glGenBuffers.Addr(), 2, 1, uintptr(unsafe.Pointer(&ret)), 0) - case glfnGenFramebuffer: - syscall.Syscall(glGenFramebuffers.Addr(), 2, 1, uintptr(unsafe.Pointer(&ret)), 0) - case glfnGenRenderbuffer: - syscall.Syscall(glGenRenderbuffers.Addr(), 2, 1, uintptr(unsafe.Pointer(&ret)), 0) - case glfnGenVertexArray: - syscall.Syscall(glGenVertexArrays.Addr(), 2, 1, uintptr(unsafe.Pointer(&ret)), 0) - case glfnGenTexture: - syscall.Syscall(glGenTextures.Addr(), 2, 1, uintptr(unsafe.Pointer(&ret)), 0) - case glfnGenerateMipmap: - syscall.Syscall(glGenerateMipmap.Addr(), 1, c.args.a0, 0, 0) - case glfnGetActiveAttrib: - syscall.Syscall9(glGetActiveAttrib.Addr(), 7, c.args.a0, c.args.a1, c.args.a2, 0, uintptr(unsafe.Pointer(&ret)), c.args.a3, uintptr(c.parg), 0, 0) - case glfnGetActiveUniform: - syscall.Syscall9(glGetActiveUniform.Addr(), 7, c.args.a0, c.args.a1, c.args.a2, 0, uintptr(unsafe.Pointer(&ret)), c.args.a3, uintptr(c.parg), 0, 0) - case glfnGetAttachedShaders: - syscall.Syscall6(glGetAttachedShaders.Addr(), 4, c.args.a0, c.args.a1, uintptr(unsafe.Pointer(&ret)), uintptr(c.parg), 0, 0) - case glfnGetAttribLocation: - ret, _, _ = syscall.Syscall(glGetAttribLocation.Addr(), 2, c.args.a0, c.args.a1, 0) - case glfnGetBooleanv: - syscall.Syscall(glGetBooleanv.Addr(), 2, c.args.a0, uintptr(c.parg), 0) - case glfnGetBufferParameteri: - syscall.Syscall(glGetBufferParameteri.Addr(), 3, c.args.a0, c.args.a1, uintptr(unsafe.Pointer(&ret))) - case glfnGetError: - ret, _, _ = syscall.Syscall(glGetError.Addr(), 0, 0, 0, 0) - case glfnGetFloatv: - syscall.Syscall(glGetFloatv.Addr(), 2, c.args.a0, uintptr(c.parg), 0) - case glfnGetFramebufferAttachmentParameteriv: - syscall.Syscall6(glGetFramebufferAttachmentParameteriv.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, uintptr(unsafe.Pointer(&ret)), 0, 0) - case glfnGetIntegerv: - syscall.Syscall(glGetIntegerv.Addr(), 2, c.args.a0, uintptr(c.parg), 0) - case glfnGetProgramInfoLog: - syscall.Syscall6(glGetProgramInfoLog.Addr(), 4, c.args.a0, c.args.a1, 0, uintptr(c.parg), 0, 0) - case glfnGetProgramiv: - syscall.Syscall(glGetProgramiv.Addr(), 3, c.args.a0, c.args.a1, uintptr(unsafe.Pointer(&ret))) - case glfnGetRenderbufferParameteriv: - syscall.Syscall(glGetRenderbufferParameteriv.Addr(), 3, c.args.a0, c.args.a1, uintptr(unsafe.Pointer(&ret))) - case glfnGetShaderInfoLog: - syscall.Syscall6(glGetShaderInfoLog.Addr(), 4, c.args.a0, c.args.a1, 0, uintptr(c.parg), 0, 0) - case glfnGetShaderPrecisionFormat: - // c.parg is a [3]int32. The first [2]int32 of the array is one - // parameter, the final *int32 is another parameter. - syscall.Syscall6(glGetShaderPrecisionFormat.Addr(), 4, c.args.a0, c.args.a1, uintptr(c.parg), uintptr(c.parg)+2*unsafe.Sizeof(uintptr(0)), 0, 0) - case glfnGetShaderSource: - syscall.Syscall6(glGetShaderSource.Addr(), 4, c.args.a0, c.args.a1, 0, uintptr(c.parg), 0, 0) - case glfnGetShaderiv: - syscall.Syscall(glGetShaderiv.Addr(), 3, c.args.a0, c.args.a1, uintptr(unsafe.Pointer(&ret))) - case glfnGetString: - ret, _, _ = syscall.Syscall(glGetString.Addr(), 1, c.args.a0, 0, 0) - case glfnGetTexParameterfv: - syscall.Syscall(glGetTexParameterfv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - case glfnGetTexParameteriv: - syscall.Syscall(glGetTexParameteriv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - case glfnGetUniformLocation: - ret, _, _ = syscall.Syscall(glGetUniformLocation.Addr(), 2, c.args.a0, c.args.a1, 0) - case glfnGetUniformfv: - syscall.Syscall(glGetUniformfv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - case glfnGetUniformiv: - syscall.Syscall(glGetUniformiv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - case glfnGetVertexAttribfv: - syscall.Syscall(glGetVertexAttribfv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - case glfnGetVertexAttribiv: - syscall.Syscall(glGetVertexAttribiv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - case glfnHint: - syscall.Syscall(glHint.Addr(), 2, c.args.a0, c.args.a1, 0) - case glfnIsBuffer: - syscall.Syscall(glIsBuffer.Addr(), 1, c.args.a0, 0, 0) - case glfnIsEnabled: - syscall.Syscall(glIsEnabled.Addr(), 1, c.args.a0, 0, 0) - case glfnIsFramebuffer: - syscall.Syscall(glIsFramebuffer.Addr(), 1, c.args.a0, 0, 0) - case glfnIsProgram: - ret, _, _ = syscall.Syscall(glIsProgram.Addr(), 1, c.args.a0, 0, 0) - case glfnIsRenderbuffer: - syscall.Syscall(glIsRenderbuffer.Addr(), 1, c.args.a0, 0, 0) - case glfnIsShader: - syscall.Syscall(glIsShader.Addr(), 1, c.args.a0, 0, 0) - case glfnIsTexture: - syscall.Syscall(glIsTexture.Addr(), 1, c.args.a0, 0, 0) - case glfnLineWidth: - syscall.Syscall(glLineWidth.Addr(), 1, c.args.a0, 0, 0) - case glfnLinkProgram: - syscall.Syscall(glLinkProgram.Addr(), 1, c.args.a0, 0, 0) - case glfnPixelStorei: - syscall.Syscall(glPixelStorei.Addr(), 2, c.args.a0, c.args.a1, 0) - case glfnPolygonOffset: - syscall.Syscall6(glPolygonOffset.Addr(), 2, c.args.a0, c.args.a1, 0, 0, 0, 0) - case glfnReadPixels: - syscall.Syscall9(glReadPixels.Addr(), 7, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5, uintptr(c.parg), 0, 0) - case glfnReleaseShaderCompiler: - syscall.Syscall(glReleaseShaderCompiler.Addr(), 0, 0, 0, 0) - case glfnRenderbufferStorage: - syscall.Syscall6(glRenderbufferStorage.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, 0, 0) - case glfnSampleCoverage: - syscall.Syscall6(glSampleCoverage.Addr(), 1, c.args.a0, 0, 0, 0, 0, 0) - case glfnScissor: - syscall.Syscall6(glScissor.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, 0, 0) - case glfnShaderSource: - syscall.Syscall6(glShaderSource.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, 0, 0, 0) - case glfnStencilFunc: - syscall.Syscall(glStencilFunc.Addr(), 3, c.args.a0, c.args.a1, c.args.a2) - case glfnStencilFuncSeparate: - syscall.Syscall6(glStencilFuncSeparate.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, 0, 0) - case glfnStencilMask: - syscall.Syscall(glStencilMask.Addr(), 1, c.args.a0, 0, 0) - case glfnStencilMaskSeparate: - syscall.Syscall(glStencilMaskSeparate.Addr(), 2, c.args.a0, c.args.a1, 0) - case glfnStencilOp: - syscall.Syscall(glStencilOp.Addr(), 3, c.args.a0, c.args.a1, c.args.a2) - case glfnStencilOpSeparate: - syscall.Syscall6(glStencilOpSeparate.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, 0, 0) - case glfnTexImage2D: - syscall.Syscall9(glTexImage2D.Addr(), 9, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, 0, c.args.a5, c.args.a6, uintptr(c.parg)) - case glfnTexParameterf: - syscall.Syscall6(glTexParameterf.Addr(), 3, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5) - case glfnTexParameterfv: - syscall.Syscall(glTexParameterfv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - case glfnTexParameteri: - syscall.Syscall(glTexParameteri.Addr(), 3, c.args.a0, c.args.a1, c.args.a2) - case glfnTexParameteriv: - syscall.Syscall(glTexParameteriv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - case glfnTexSubImage2D: - syscall.Syscall9(glTexSubImage2D.Addr(), 9, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5, c.args.a6, c.args.a7, uintptr(c.parg)) - case glfnUniform1f: - syscall.Syscall6(glUniform1f.Addr(), 2, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5) - case glfnUniform1fv: - syscall.Syscall(glUniform1fv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - case glfnUniform1i: - syscall.Syscall(glUniform1i.Addr(), 2, c.args.a0, c.args.a1, 0) - case glfnUniform1iv: - syscall.Syscall(glUniform1iv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - case glfnUniform2f: - syscall.Syscall6(glUniform2f.Addr(), 3, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5) - case glfnUniform2fv: - syscall.Syscall(glUniform2fv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - case glfnUniform2i: - syscall.Syscall(glUniform2i.Addr(), 3, c.args.a0, c.args.a1, c.args.a2) - case glfnUniform2iv: - syscall.Syscall(glUniform2iv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - case glfnUniform3f: - syscall.Syscall6(glUniform3f.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5) - case glfnUniform3fv: - syscall.Syscall(glUniform3fv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - case glfnUniform3i: - syscall.Syscall6(glUniform3i.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, 0, 0) - case glfnUniform3iv: - syscall.Syscall(glUniform3iv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - case glfnUniform4f: - syscall.Syscall6(glUniform4f.Addr(), 5, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5) - case glfnUniform4fv: - syscall.Syscall(glUniform4fv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - case glfnUniform4i: - syscall.Syscall6(glUniform4i.Addr(), 5, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, 0) - case glfnUniform4iv: - syscall.Syscall(glUniform4iv.Addr(), 3, c.args.a0, c.args.a1, uintptr(c.parg)) - case glfnUniformMatrix2fv: - syscall.Syscall6(glUniformMatrix2fv.Addr(), 4, c.args.a0, c.args.a1, 0, uintptr(c.parg), 0, 0) - case glfnUniformMatrix3fv: - syscall.Syscall6(glUniformMatrix3fv.Addr(), 4, c.args.a0, c.args.a1, 0, uintptr(c.parg), 0, 0) - case glfnUniformMatrix4fv: - syscall.Syscall6(glUniformMatrix4fv.Addr(), 4, c.args.a0, c.args.a1, 0, uintptr(c.parg), 0, 0) - case glfnUseProgram: - syscall.Syscall(glUseProgram.Addr(), 1, c.args.a0, 0, 0) - case glfnValidateProgram: - syscall.Syscall(glValidateProgram.Addr(), 1, c.args.a0, 0, 0) - case glfnVertexAttrib1f: - syscall.Syscall6(glVertexAttrib1f.Addr(), 2, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5) - case glfnVertexAttrib1fv: - syscall.Syscall(glVertexAttrib1fv.Addr(), 2, c.args.a0, uintptr(c.parg), 0) - case glfnVertexAttrib2f: - syscall.Syscall6(glVertexAttrib2f.Addr(), 3, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5) - case glfnVertexAttrib2fv: - syscall.Syscall(glVertexAttrib2fv.Addr(), 2, c.args.a0, uintptr(c.parg), 0) - case glfnVertexAttrib3f: - syscall.Syscall6(glVertexAttrib3f.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5) - case glfnVertexAttrib3fv: - syscall.Syscall(glVertexAttrib3fv.Addr(), 2, c.args.a0, uintptr(c.parg), 0) - case glfnVertexAttrib4f: - syscall.Syscall6(glVertexAttrib4f.Addr(), 5, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5) - case glfnVertexAttrib4fv: - syscall.Syscall(glVertexAttrib4fv.Addr(), 2, c.args.a0, uintptr(c.parg), 0) - case glfnVertexAttribPointer: - syscall.Syscall6(glVertexAttribPointer.Addr(), 6, c.args.a0, c.args.a1, c.args.a2, c.args.a3, c.args.a4, c.args.a5) - case glfnViewport: - syscall.Syscall6(glViewport.Addr(), 4, c.args.a0, c.args.a1, c.args.a2, c.args.a3, 0, 0) - default: - panic("unknown GL function") - } - - return ret -} - -// Exported libraries for a Windows GUI driver. -// -// LibEGL is not used directly by the gl package, but is needed by any -// driver hoping to use OpenGL ES. -// -// LibD3DCompiler is needed by libglesv2.dll for compiling shaders. -var ( - LibGLESv2 = syscall.NewLazyDLL("libglesv2.dll") - LibEGL = syscall.NewLazyDLL("libegl.dll") - LibD3DCompiler = syscall.NewLazyDLL("d3dcompiler_47.dll") -) - -var ( - libGLESv2 = LibGLESv2 - glActiveTexture = libGLESv2.NewProc("glActiveTexture") - glAttachShader = libGLESv2.NewProc("glAttachShader") - glBindAttribLocation = libGLESv2.NewProc("glBindAttribLocation") - glBindBuffer = libGLESv2.NewProc("glBindBuffer") - glBindFramebuffer = libGLESv2.NewProc("glBindFramebuffer") - glBindRenderbuffer = libGLESv2.NewProc("glBindRenderbuffer") - glBindTexture = libGLESv2.NewProc("glBindTexture") - glBindVertexArray = libGLESv2.NewProc("glBindVertexArray") - glBlendColor = libGLESv2.NewProc("glBlendColor") - glBlendEquation = libGLESv2.NewProc("glBlendEquation") - glBlendEquationSeparate = libGLESv2.NewProc("glBlendEquationSeparate") - glBlendFunc = libGLESv2.NewProc("glBlendFunc") - glBlendFuncSeparate = libGLESv2.NewProc("glBlendFuncSeparate") - glBufferData = libGLESv2.NewProc("glBufferData") - glBufferSubData = libGLESv2.NewProc("glBufferSubData") - glCheckFramebufferStatus = libGLESv2.NewProc("glCheckFramebufferStatus") - glClear = libGLESv2.NewProc("glClear") - glClearColor = libGLESv2.NewProc("glClearColor") - glClearDepthf = libGLESv2.NewProc("glClearDepthf") - glClearStencil = libGLESv2.NewProc("glClearStencil") - glColorMask = libGLESv2.NewProc("glColorMask") - glCompileShader = libGLESv2.NewProc("glCompileShader") - glCompressedTexImage2D = libGLESv2.NewProc("glCompressedTexImage2D") - glCompressedTexSubImage2D = libGLESv2.NewProc("glCompressedTexSubImage2D") - glCopyTexImage2D = libGLESv2.NewProc("glCopyTexImage2D") - glCopyTexSubImage2D = libGLESv2.NewProc("glCopyTexSubImage2D") - glCreateProgram = libGLESv2.NewProc("glCreateProgram") - glCreateShader = libGLESv2.NewProc("glCreateShader") - glCullFace = libGLESv2.NewProc("glCullFace") - glDeleteBuffers = libGLESv2.NewProc("glDeleteBuffers") - glDeleteFramebuffers = libGLESv2.NewProc("glDeleteFramebuffers") - glDeleteProgram = libGLESv2.NewProc("glDeleteProgram") - glDeleteRenderbuffers = libGLESv2.NewProc("glDeleteRenderbuffers") - glDeleteShader = libGLESv2.NewProc("glDeleteShader") - glDeleteTextures = libGLESv2.NewProc("glDeleteTextures") - glDeleteVertexArrays = libGLESv2.NewProc("glDeleteVertexArrays") - glDepthFunc = libGLESv2.NewProc("glDepthFunc") - glDepthRangef = libGLESv2.NewProc("glDepthRangef") - glDepthMask = libGLESv2.NewProc("glDepthMask") - glDetachShader = libGLESv2.NewProc("glDetachShader") - glDisable = libGLESv2.NewProc("glDisable") - glDisableVertexAttribArray = libGLESv2.NewProc("glDisableVertexAttribArray") - glDrawArrays = libGLESv2.NewProc("glDrawArrays") - glDrawElements = libGLESv2.NewProc("glDrawElements") - glEnable = libGLESv2.NewProc("glEnable") - glEnableVertexAttribArray = libGLESv2.NewProc("glEnableVertexAttribArray") - glFinish = libGLESv2.NewProc("glFinish") - glFlush = libGLESv2.NewProc("glFlush") - glFramebufferRenderbuffer = libGLESv2.NewProc("glFramebufferRenderbuffer") - glFramebufferTexture2D = libGLESv2.NewProc("glFramebufferTexture2D") - glFrontFace = libGLESv2.NewProc("glFrontFace") - glGenBuffers = libGLESv2.NewProc("glGenBuffers") - glGenFramebuffers = libGLESv2.NewProc("glGenFramebuffers") - glGenRenderbuffers = libGLESv2.NewProc("glGenRenderbuffers") - glGenTextures = libGLESv2.NewProc("glGenTextures") - glGenVertexArrays = libGLESv2.NewProc("glGenVertexArrays") - glGenerateMipmap = libGLESv2.NewProc("glGenerateMipmap") - glGetActiveAttrib = libGLESv2.NewProc("glGetActiveAttrib") - glGetActiveUniform = libGLESv2.NewProc("glGetActiveUniform") - glGetAttachedShaders = libGLESv2.NewProc("glGetAttachedShaders") - glGetAttribLocation = libGLESv2.NewProc("glGetAttribLocation") - glGetBooleanv = libGLESv2.NewProc("glGetBooleanv") - glGetBufferParameteri = libGLESv2.NewProc("glGetBufferParameteri") - glGetError = libGLESv2.NewProc("glGetError") - glGetFloatv = libGLESv2.NewProc("glGetFloatv") - glGetFramebufferAttachmentParameteriv = libGLESv2.NewProc("glGetFramebufferAttachmentParameteriv") - glGetIntegerv = libGLESv2.NewProc("glGetIntegerv") - glGetProgramInfoLog = libGLESv2.NewProc("glGetProgramInfoLog") - glGetProgramiv = libGLESv2.NewProc("glGetProgramiv") - glGetRenderbufferParameteriv = libGLESv2.NewProc("glGetRenderbufferParameteriv") - glGetShaderInfoLog = libGLESv2.NewProc("glGetShaderInfoLog") - glGetShaderPrecisionFormat = libGLESv2.NewProc("glGetShaderPrecisionFormat") - glGetShaderSource = libGLESv2.NewProc("glGetShaderSource") - glGetShaderiv = libGLESv2.NewProc("glGetShaderiv") - glGetString = libGLESv2.NewProc("glGetString") - glGetTexParameterfv = libGLESv2.NewProc("glGetTexParameterfv") - glGetTexParameteriv = libGLESv2.NewProc("glGetTexParameteriv") - glGetUniformLocation = libGLESv2.NewProc("glGetUniformLocation") - glGetUniformfv = libGLESv2.NewProc("glGetUniformfv") - glGetUniformiv = libGLESv2.NewProc("glGetUniformiv") - glGetVertexAttribfv = libGLESv2.NewProc("glGetVertexAttribfv") - glGetVertexAttribiv = libGLESv2.NewProc("glGetVertexAttribiv") - glHint = libGLESv2.NewProc("glHint") - glIsBuffer = libGLESv2.NewProc("glIsBuffer") - glIsEnabled = libGLESv2.NewProc("glIsEnabled") - glIsFramebuffer = libGLESv2.NewProc("glIsFramebuffer") - glIsProgram = libGLESv2.NewProc("glIsProgram") - glIsRenderbuffer = libGLESv2.NewProc("glIsRenderbuffer") - glIsShader = libGLESv2.NewProc("glIsShader") - glIsTexture = libGLESv2.NewProc("glIsTexture") - glLineWidth = libGLESv2.NewProc("glLineWidth") - glLinkProgram = libGLESv2.NewProc("glLinkProgram") - glPixelStorei = libGLESv2.NewProc("glPixelStorei") - glPolygonOffset = libGLESv2.NewProc("glPolygonOffset") - glReadPixels = libGLESv2.NewProc("glReadPixels") - glReleaseShaderCompiler = libGLESv2.NewProc("glReleaseShaderCompiler") - glRenderbufferStorage = libGLESv2.NewProc("glRenderbufferStorage") - glSampleCoverage = libGLESv2.NewProc("glSampleCoverage") - glScissor = libGLESv2.NewProc("glScissor") - glShaderSource = libGLESv2.NewProc("glShaderSource") - glStencilFunc = libGLESv2.NewProc("glStencilFunc") - glStencilFuncSeparate = libGLESv2.NewProc("glStencilFuncSeparate") - glStencilMask = libGLESv2.NewProc("glStencilMask") - glStencilMaskSeparate = libGLESv2.NewProc("glStencilMaskSeparate") - glStencilOp = libGLESv2.NewProc("glStencilOp") - glStencilOpSeparate = libGLESv2.NewProc("glStencilOpSeparate") - glTexImage2D = libGLESv2.NewProc("glTexImage2D") - glTexParameterf = libGLESv2.NewProc("glTexParameterf") - glTexParameterfv = libGLESv2.NewProc("glTexParameterfv") - glTexParameteri = libGLESv2.NewProc("glTexParameteri") - glTexParameteriv = libGLESv2.NewProc("glTexParameteriv") - glTexSubImage2D = libGLESv2.NewProc("glTexSubImage2D") - glUniform1f = libGLESv2.NewProc("glUniform1f") - glUniform1fv = libGLESv2.NewProc("glUniform1fv") - glUniform1i = libGLESv2.NewProc("glUniform1i") - glUniform1iv = libGLESv2.NewProc("glUniform1iv") - glUniform2f = libGLESv2.NewProc("glUniform2f") - glUniform2fv = libGLESv2.NewProc("glUniform2fv") - glUniform2i = libGLESv2.NewProc("glUniform2i") - glUniform2iv = libGLESv2.NewProc("glUniform2iv") - glUniform3f = libGLESv2.NewProc("glUniform3f") - glUniform3fv = libGLESv2.NewProc("glUniform3fv") - glUniform3i = libGLESv2.NewProc("glUniform3i") - glUniform3iv = libGLESv2.NewProc("glUniform3iv") - glUniform4f = libGLESv2.NewProc("glUniform4f") - glUniform4fv = libGLESv2.NewProc("glUniform4fv") - glUniform4i = libGLESv2.NewProc("glUniform4i") - glUniform4iv = libGLESv2.NewProc("glUniform4iv") - glUniformMatrix2fv = libGLESv2.NewProc("glUniformMatrix2fv") - glUniformMatrix3fv = libGLESv2.NewProc("glUniformMatrix3fv") - glUniformMatrix4fv = libGLESv2.NewProc("glUniformMatrix4fv") - glUseProgram = libGLESv2.NewProc("glUseProgram") - glValidateProgram = libGLESv2.NewProc("glValidateProgram") - glVertexAttrib1f = libGLESv2.NewProc("glVertexAttrib1f") - glVertexAttrib1fv = libGLESv2.NewProc("glVertexAttrib1fv") - glVertexAttrib2f = libGLESv2.NewProc("glVertexAttrib2f") - glVertexAttrib2fv = libGLESv2.NewProc("glVertexAttrib2fv") - glVertexAttrib3f = libGLESv2.NewProc("glVertexAttrib3f") - glVertexAttrib3fv = libGLESv2.NewProc("glVertexAttrib3fv") - glVertexAttrib4f = libGLESv2.NewProc("glVertexAttrib4f") - glVertexAttrib4fv = libGLESv2.NewProc("glVertexAttrib4fv") - glVertexAttribPointer = libGLESv2.NewProc("glVertexAttribPointer") - glViewport = libGLESv2.NewProc("glViewport") -) diff --git a/vendor/golang.org/x/mobile/gl/work_windows_386.s b/vendor/golang.org/x/mobile/gl/work_windows_386.s deleted file mode 100644 index c80e98a..0000000 --- a/vendor/golang.org/x/mobile/gl/work_windows_386.s +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -#include "textflag.h" - -// fixFloat is unnecessary for windows/386 -TEXT ·fixFloat(SB),NOSPLIT,$0-16 - RET diff --git a/vendor/golang.org/x/mobile/gl/work_windows_amd64.s b/vendor/golang.org/x/mobile/gl/work_windows_amd64.s deleted file mode 100644 index e74ac5c..0000000 --- a/vendor/golang.org/x/mobile/gl/work_windows_amd64.s +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -#include "textflag.h" - -TEXT ·fixFloat(SB),NOSPLIT,$0-32 - MOVQ x0+0(FP), X0 - MOVQ x1+8(FP), X1 - MOVQ x2+16(FP), X2 - MOVQ x3+24(FP), X3 - RET diff --git a/vendor/golang.org/x/mobile/internal/mobileinit/ctx_android.go b/vendor/golang.org/x/mobile/internal/mobileinit/ctx_android.go deleted file mode 100644 index b58881a..0000000 --- a/vendor/golang.org/x/mobile/internal/mobileinit/ctx_android.go +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mobileinit - -/* -#include -#include - -static char* lockJNI(JavaVM *vm, uintptr_t* envp, int* attachedp) { - JNIEnv* env; - - if (vm == NULL) { - return "no current JVM"; - } - - *attachedp = 0; - switch ((*vm)->GetEnv(vm, (void**)&env, JNI_VERSION_1_6)) { - case JNI_OK: - break; - case JNI_EDETACHED: - if ((*vm)->AttachCurrentThread(vm, &env, 0) != 0) { - return "cannot attach to JVM"; - } - *attachedp = 1; - break; - case JNI_EVERSION: - return "bad JNI version"; - default: - return "unknown JNI error from GetEnv"; - } - - *envp = (uintptr_t)env; - return NULL; -} - -static char* checkException(uintptr_t jnienv) { - jthrowable exc; - JNIEnv* env = (JNIEnv*)jnienv; - - if (!(*env)->ExceptionCheck(env)) { - return NULL; - } - - exc = (*env)->ExceptionOccurred(env); - (*env)->ExceptionClear(env); - - jclass clazz = (*env)->FindClass(env, "java/lang/Throwable"); - jmethodID toString = (*env)->GetMethodID(env, clazz, "toString", "()Ljava/lang/String;"); - jobject msgStr = (*env)->CallObjectMethod(env, exc, toString); - return (char*)(*env)->GetStringUTFChars(env, msgStr, 0); -} - -static void unlockJNI(JavaVM *vm) { - (*vm)->DetachCurrentThread(vm); -} -*/ -import "C" - -import ( - "errors" - "runtime" - "unsafe" -) - -// currentVM is stored to initialize other cgo packages. -// -// As all the Go packages in a program form a single shared library, -// there can only be one JNI_OnLoad function for initialization. In -// OpenJDK there is JNI_GetCreatedJavaVMs, but this is not available -// on android. -var currentVM *C.JavaVM - -// currentCtx is Android's android.context.Context. May be NULL. -var currentCtx C.jobject - -// SetCurrentContext populates the global Context object with the specified -// current JavaVM instance (vm) and android.context.Context object (ctx). -// The android.context.Context object must be a global reference. -func SetCurrentContext(vm unsafe.Pointer, ctx uintptr) { - currentVM = (*C.JavaVM)(vm) - currentCtx = (C.jobject)(ctx) -} - -// RunOnJVM runs fn on a new goroutine locked to an OS thread with a JNIEnv. -// -// RunOnJVM blocks until the call to fn is complete. Any Java -// exception or failure to attach to the JVM is returned as an error. -// -// The function fn takes vm, the current JavaVM*, -// env, the current JNIEnv*, and -// ctx, a jobject representing the global android.context.Context. -func RunOnJVM(fn func(vm, env, ctx uintptr) error) error { - errch := make(chan error) - go func() { - runtime.LockOSThread() - defer runtime.UnlockOSThread() - - env := C.uintptr_t(0) - attached := C.int(0) - if errStr := C.lockJNI(currentVM, &env, &attached); errStr != nil { - errch <- errors.New(C.GoString(errStr)) - return - } - if attached != 0 { - defer C.unlockJNI(currentVM) - } - - vm := uintptr(unsafe.Pointer(currentVM)) - if err := fn(vm, uintptr(env), uintptr(currentCtx)); err != nil { - errch <- err - return - } - - if exc := C.checkException(env); exc != nil { - errch <- errors.New(C.GoString(exc)) - C.free(unsafe.Pointer(exc)) - return - } - errch <- nil - }() - return <-errch -} diff --git a/vendor/golang.org/x/mobile/internal/mobileinit/mobileinit.go b/vendor/golang.org/x/mobile/internal/mobileinit/mobileinit.go deleted file mode 100644 index 65c0912..0000000 --- a/vendor/golang.org/x/mobile/internal/mobileinit/mobileinit.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package mobileinit contains common initialization logic for mobile platforms -// that is relevant to both all-Go apps and gobind-based apps. -// -// Long-term, some code in this package should consider moving into Go stdlib. -package mobileinit - -import "C" diff --git a/vendor/golang.org/x/mobile/internal/mobileinit/mobileinit_android.go b/vendor/golang.org/x/mobile/internal/mobileinit/mobileinit_android.go deleted file mode 100644 index cd73f43..0000000 --- a/vendor/golang.org/x/mobile/internal/mobileinit/mobileinit_android.go +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mobileinit - -/* -To view the log output run: -adb logcat GoLog:I *:S -*/ - -// Android redirects stdout and stderr to /dev/null. -// As these are common debugging utilities in Go, -// we redirect them to logcat. -// -// Unfortunately, logcat is line oriented, so we must buffer. - -/* -#cgo LDFLAGS: -landroid -llog - -#include -#include -#include -*/ -import "C" - -import ( - "bufio" - "log" - "os" - "syscall" - "unsafe" -) - -var ( - ctag = C.CString("GoLog") - // Store the writer end of the redirected stderr and stdout - // so that they are not garbage collected and closed. - stderr, stdout *os.File -) - -type infoWriter struct{} - -func (infoWriter) Write(p []byte) (n int, err error) { - cstr := C.CString(string(p)) - C.__android_log_write(C.ANDROID_LOG_INFO, ctag, cstr) - C.free(unsafe.Pointer(cstr)) - return len(p), nil -} - -func lineLog(f *os.File, priority C.int) { - const logSize = 1024 // matches android/log.h. - r := bufio.NewReaderSize(f, logSize) - for { - line, _, err := r.ReadLine() - str := string(line) - if err != nil { - str += " " + err.Error() - } - cstr := C.CString(str) - C.__android_log_write(priority, ctag, cstr) - C.free(unsafe.Pointer(cstr)) - if err != nil { - break - } - } -} - -func init() { - log.SetOutput(infoWriter{}) - // android logcat includes all of log.LstdFlags - log.SetFlags(log.Flags() &^ log.LstdFlags) - - r, w, err := os.Pipe() - if err != nil { - panic(err) - } - stderr = w - if err := syscall.Dup3(int(w.Fd()), int(os.Stderr.Fd()), 0); err != nil { - panic(err) - } - go lineLog(r, C.ANDROID_LOG_ERROR) - - r, w, err = os.Pipe() - if err != nil { - panic(err) - } - stdout = w - if err := syscall.Dup3(int(w.Fd()), int(os.Stdout.Fd()), 0); err != nil { - panic(err) - } - go lineLog(r, C.ANDROID_LOG_INFO) -} diff --git a/vendor/golang.org/x/mobile/internal/mobileinit/mobileinit_ios.go b/vendor/golang.org/x/mobile/internal/mobileinit/mobileinit_ios.go deleted file mode 100644 index dda9b0f..0000000 --- a/vendor/golang.org/x/mobile/internal/mobileinit/mobileinit_ios.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin -// +build arm arm64 - -package mobileinit - -import ( - "io" - "log" - "os" - "unsafe" -) - -/* -#include -#include - -void asl_log_wrap(const char *str) { - asl_log(NULL, NULL, ASL_LEVEL_NOTICE, "%s", str); -} -*/ -import "C" - -type aslWriter struct{} - -func (aslWriter) Write(p []byte) (n int, err error) { - cstr := C.CString(string(p)) - C.asl_log_wrap(cstr) - C.free(unsafe.Pointer(cstr)) - return len(p), nil -} - -func init() { - log.SetOutput(io.MultiWriter(os.Stderr, aslWriter{})) -} diff --git a/vendor/modules.txt b/vendor/modules.txt index c578806..5975652 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -6,10 +6,6 @@ github.com/anaskhan96/soup github.com/anmitsu/go-shlex # github.com/creack/pty v1.1.11 github.com/creack/pty -# github.com/faiface/beep v1.0.2 -github.com/faiface/beep -github.com/faiface/beep/mp3 -github.com/faiface/beep/speaker # github.com/fatih/color v1.9.0 github.com/fatih/color # github.com/gen2brain/beeep v0.0.0-20200526185328-e9c15c258e28 @@ -24,19 +20,6 @@ github.com/godbus/dbus/v5 github.com/gopherjs/gopherjs/js # github.com/gopherjs/gopherwasm v1.1.0 github.com/gopherjs/gopherwasm/js -# github.com/hajimehoshi/go-mp3 v0.1.1 -github.com/hajimehoshi/go-mp3 -github.com/hajimehoshi/go-mp3/internal/bits -github.com/hajimehoshi/go-mp3/internal/consts -github.com/hajimehoshi/go-mp3/internal/frame -github.com/hajimehoshi/go-mp3/internal/frameheader -github.com/hajimehoshi/go-mp3/internal/huffman -github.com/hajimehoshi/go-mp3/internal/imdct -github.com/hajimehoshi/go-mp3/internal/maindata -github.com/hajimehoshi/go-mp3/internal/sideinfo -# github.com/hajimehoshi/oto v0.3.1 -github.com/hajimehoshi/oto -github.com/hajimehoshi/oto/internal/mux # github.com/inconshreveable/mousetrap v1.0.0 github.com/inconshreveable/mousetrap # github.com/maruel/panicparse v1.5.0 @@ -63,8 +46,6 @@ github.com/nu7hatch/gouuid github.com/olekukonko/tablewriter # github.com/patrickmn/go-cache v2.1.0+incompatible github.com/patrickmn/go-cache -# github.com/pkg/errors v0.8.1 -github.com/pkg/errors # github.com/spf13/cobra v1.0.0 github.com/spf13/cobra # github.com/spf13/pflag v1.0.5 @@ -83,29 +64,6 @@ golang.org/x/crypto/internal/subtle golang.org/x/crypto/poly1305 golang.org/x/crypto/ssh golang.org/x/crypto/ssh/internal/bcrypt_pbkdf -# golang.org/x/exp v0.0.0-20180710024300-14dda7b62fcd -golang.org/x/exp/shiny/driver/gldriver -golang.org/x/exp/shiny/driver/internal/drawer -golang.org/x/exp/shiny/driver/internal/errscreen -golang.org/x/exp/shiny/driver/internal/event -golang.org/x/exp/shiny/driver/internal/lifecycler -golang.org/x/exp/shiny/driver/internal/win32 -golang.org/x/exp/shiny/driver/internal/x11key -golang.org/x/exp/shiny/screen -# golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81 -golang.org/x/image/math/f64 -# golang.org/x/mobile v0.0.0-20180806140643-507816974b79 -golang.org/x/mobile/app -golang.org/x/mobile/app/internal/callfn -golang.org/x/mobile/event/key -golang.org/x/mobile/event/lifecycle -golang.org/x/mobile/event/mouse -golang.org/x/mobile/event/paint -golang.org/x/mobile/event/size -golang.org/x/mobile/event/touch -golang.org/x/mobile/geom -golang.org/x/mobile/gl -golang.org/x/mobile/internal/mobileinit # golang.org/x/net v0.0.0-20200707034311-ab3426394381 golang.org/x/net/html golang.org/x/net/html/atom