152 lines
3.7 KiB
Go
152 lines
3.7 KiB
Go
package window
|
|
|
|
type WindowInfo struct {
|
|
Name string `json:"name"`
|
|
Title string `json:"title"`
|
|
X int `json:"x"`
|
|
Y int `json:"y"`
|
|
Width int `json:"width"`
|
|
Height int `json:"height"`
|
|
Visible bool `json:"visible"`
|
|
Minimized bool `json:"minimized"`
|
|
Maximized bool `json:"maximized"`
|
|
Focused bool `json:"focused"`
|
|
}
|
|
|
|
type QueryWindowList struct{}
|
|
|
|
type QueryWindowByName struct{ Name string }
|
|
|
|
type QueryConfig struct{}
|
|
|
|
type QuerySavedWindowStates struct{}
|
|
|
|
// Example: c.PERFORM(TaskOpenWindow{Window: Window{Name: "editor", URL: "/"}})
|
|
type TaskOpenWindow struct {
|
|
Window Window
|
|
}
|
|
|
|
type TaskCloseWindow struct{ Name string }
|
|
|
|
// Example: c.PERFORM(TaskSetPosition{Name: "editor", X: 100, Y: 200})
|
|
type TaskSetPosition struct {
|
|
Name string
|
|
X, Y int
|
|
}
|
|
|
|
// Example: c.PERFORM(TaskSetBounds{Name: "editor", X: 100, Y: 200, Width: 1280, Height: 720})
|
|
type TaskSetBounds struct {
|
|
Name string
|
|
X, Y int
|
|
Width, Height int
|
|
}
|
|
|
|
// Example: c.PERFORM(TaskSetSize{Name: "editor", Width: 1280, Height: 720})
|
|
type TaskSetSize struct {
|
|
Name string
|
|
Width, Height int
|
|
}
|
|
|
|
// Example: c.PERFORM(TaskMaximize{Name: "editor"})
|
|
type TaskMaximize struct{ Name string }
|
|
|
|
// Example: c.PERFORM(TaskMinimize{Name: "editor"})
|
|
type TaskMinimize struct{ Name string }
|
|
|
|
type TaskFocus struct{ Name string }
|
|
|
|
type TaskRestore struct{ Name string }
|
|
|
|
type TaskSetTitle struct {
|
|
Name string
|
|
Title string
|
|
}
|
|
|
|
type TaskSetAlwaysOnTop struct {
|
|
Name string
|
|
AlwaysOnTop bool
|
|
}
|
|
|
|
type TaskSetBackgroundColour struct {
|
|
Name string
|
|
Red uint8
|
|
Green uint8
|
|
Blue uint8
|
|
Alpha uint8
|
|
}
|
|
|
|
type TaskSetVisibility struct {
|
|
Name string
|
|
Visible bool
|
|
}
|
|
|
|
type TaskFullscreen struct {
|
|
Name string
|
|
Fullscreen bool
|
|
}
|
|
|
|
type QueryLayoutList struct{}
|
|
|
|
type QueryLayoutGet struct{ Name string }
|
|
|
|
// Example: c.PERFORM(TaskSaveLayout{Name: "coding"})
|
|
type TaskSaveLayout struct{ Name string }
|
|
|
|
// Example: c.PERFORM(TaskRestoreLayout{Name: "coding"})
|
|
type TaskRestoreLayout struct{ Name string }
|
|
|
|
// Example: c.PERFORM(TaskDeleteLayout{Name: "coding"})
|
|
type TaskDeleteLayout struct{ Name string }
|
|
|
|
// Example: c.PERFORM(TaskResetWindowState{})
|
|
type TaskResetWindowState struct{}
|
|
|
|
// Example: c.PERFORM(TaskTileWindows{Mode: "left-right", Windows: []string{"editor", "terminal"}})
|
|
type TaskTileWindows struct {
|
|
Mode string // "left-right", "grid", "left-half", "right-half", etc.
|
|
Windows []string // window names; empty = all
|
|
}
|
|
|
|
// Example: c.PERFORM(TaskStackWindows{Windows: []string{"editor", "terminal"}, OffsetX: 24, OffsetY: 24})
|
|
type TaskStackWindows struct {
|
|
Windows []string // window names; empty = all
|
|
OffsetX int
|
|
OffsetY int
|
|
}
|
|
|
|
// Example: c.PERFORM(TaskSnapWindow{Name: "editor", Position: "right"})
|
|
type TaskSnapWindow struct {
|
|
Name string // window name
|
|
Position string // "left", "right", "top", "bottom", "top-left", "top-right", "bottom-left", "bottom-right", "center"
|
|
}
|
|
|
|
// Example: c.PERFORM(TaskApplyWorkflow{Workflow: "coding"})
|
|
type TaskApplyWorkflow struct {
|
|
Workflow string
|
|
Windows []string // window names; empty = all
|
|
}
|
|
|
|
// Example: c.PERFORM(TaskSaveConfig{Config: map[string]any{"default_width": 800}})
|
|
type TaskSaveConfig struct{ Config map[string]any }
|
|
|
|
type ActionWindowOpened struct{ Name string }
|
|
type ActionWindowClosed struct{ Name string }
|
|
|
|
type ActionWindowMoved struct {
|
|
Name string
|
|
X, Y int
|
|
}
|
|
|
|
type ActionWindowResized struct {
|
|
Name string
|
|
Width, Height int
|
|
}
|
|
|
|
type ActionWindowFocused struct{ Name string }
|
|
type ActionWindowBlurred struct{ Name string }
|
|
|
|
type ActionFilesDropped struct {
|
|
Name string `json:"name"` // window name
|
|
Paths []string `json:"paths"`
|
|
TargetID string `json:"targetId,omitempty"`
|
|
}
|