chore(v2): vendor dependencies for offline/China builds
go mod vendor pins onnxruntime_go v1.12.1, Gio and the rest into v2/vendor so go run/build work without hitting proxy.golang.org (blocked/slow in China). Verified: CGO_ENABLED=1 go build -mod=vendor ./internal/spike and GOOS=windows go build -mod=vendor ./internal/ui both pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+77
@@ -0,0 +1,77 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"gioui.org/internal/ops"
|
||||
"gioui.org/op"
|
||||
)
|
||||
|
||||
// ActionAreaOp makes the current clip area available for
|
||||
// system gestures.
|
||||
//
|
||||
// Note: only ActionMove is supported.
|
||||
type ActionInputOp Action
|
||||
|
||||
// Action is a set of window decoration actions.
|
||||
type Action uint
|
||||
|
||||
const (
|
||||
// ActionMinimize minimizes a window.
|
||||
ActionMinimize Action = 1 << iota
|
||||
// ActionMaximize maximizes a window.
|
||||
ActionMaximize
|
||||
// ActionUnmaximize restores a maximized window.
|
||||
ActionUnmaximize
|
||||
// ActionFullscreen makes a window fullscreen.
|
||||
ActionFullscreen
|
||||
// ActionRaise requests that the platform bring this window to the top of all open windows.
|
||||
// Some platforms do not allow this except under certain circumstances, such as when
|
||||
// a window from the same application already has focus. If the platform does not
|
||||
// support it, this method will do nothing.
|
||||
ActionRaise
|
||||
// ActionCenter centers the window on the screen.
|
||||
// It is ignored in Fullscreen mode and on Wayland.
|
||||
ActionCenter
|
||||
// ActionClose closes a window.
|
||||
// Only applicable on macOS, Windows, X11 and Wayland.
|
||||
ActionClose
|
||||
// ActionMove moves a window directed by the user.
|
||||
ActionMove
|
||||
)
|
||||
|
||||
func (op ActionInputOp) Add(o *op.Ops) {
|
||||
data := ops.Write(&o.Internal, ops.TypeActionInputLen)
|
||||
data[0] = byte(ops.TypeActionInput)
|
||||
data[1] = byte(op)
|
||||
}
|
||||
|
||||
func (a Action) String() string {
|
||||
var buf strings.Builder
|
||||
for b := Action(1); a != 0; b <<= 1 {
|
||||
if a&b != 0 {
|
||||
if buf.Len() > 0 {
|
||||
buf.WriteByte('|')
|
||||
}
|
||||
buf.WriteString(b.string())
|
||||
a &^= b
|
||||
}
|
||||
}
|
||||
return buf.String()
|
||||
}
|
||||
|
||||
func (a Action) string() string {
|
||||
switch a {
|
||||
case ActionMinimize:
|
||||
return "ActionMinimize"
|
||||
case ActionMaximize:
|
||||
return "ActionMaximize"
|
||||
case ActionUnmaximize:
|
||||
return "ActionUnmaximize"
|
||||
case ActionClose:
|
||||
return "ActionClose"
|
||||
case ActionMove:
|
||||
return "ActionMove"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package system
|
||||
|
||||
// Locale provides language information for the current system.
|
||||
type Locale struct {
|
||||
// Language is the BCP-47 tag for the primary language of the system.
|
||||
Language string
|
||||
// Direction indicates the primary direction of text and layout
|
||||
// flow for the system.
|
||||
Direction TextDirection
|
||||
}
|
||||
|
||||
const (
|
||||
axisShift = iota
|
||||
progressionShift
|
||||
)
|
||||
|
||||
// TextDirection defines a direction for text flow.
|
||||
type TextDirection byte
|
||||
|
||||
const (
|
||||
// LTR is left-to-right text.
|
||||
LTR TextDirection = TextDirection(Horizontal<<axisShift) | TextDirection(FromOrigin<<progressionShift)
|
||||
// RTL is right-to-left text.
|
||||
RTL TextDirection = TextDirection(Horizontal<<axisShift) | TextDirection(TowardOrigin<<progressionShift)
|
||||
)
|
||||
|
||||
// Axis returns the axis of the text layout.
|
||||
func (d TextDirection) Axis() TextAxis {
|
||||
return TextAxis((d & (1 << axisShift)) >> axisShift)
|
||||
}
|
||||
|
||||
// Progression returns the way that the text flows relative to the origin.
|
||||
func (d TextDirection) Progression() TextProgression {
|
||||
return TextProgression((d & (1 << progressionShift)) >> progressionShift)
|
||||
}
|
||||
|
||||
func (d TextDirection) String() string {
|
||||
switch d {
|
||||
case RTL:
|
||||
return "RTL"
|
||||
default:
|
||||
return "LTR"
|
||||
}
|
||||
}
|
||||
|
||||
// TextAxis defines the layout axis of text.
|
||||
type TextAxis byte
|
||||
|
||||
const (
|
||||
// Horizontal indicates text that flows along the X axis.
|
||||
Horizontal TextAxis = iota
|
||||
// Vertical indicates text that flows along the Y axis.
|
||||
Vertical
|
||||
)
|
||||
|
||||
// TextProgression indicates how text flows along an axis relative to the
|
||||
// origin. For these purposes, the origin is defined as the upper-left
|
||||
// corner of coordinate space.
|
||||
type TextProgression byte
|
||||
|
||||
const (
|
||||
// FromOrigin indicates text that flows along its axis away from the
|
||||
// origin (upper left corner).
|
||||
FromOrigin TextProgression = iota
|
||||
// TowardOrigin indicates text that flows along its axis towards the
|
||||
// origin (upper left corner).
|
||||
TowardOrigin
|
||||
)
|
||||
Reference in New Issue
Block a user