示例#1
0
var Env = gribble.New([]gribble.Command{
	&AddWorkspace{},
	&Close{},
	&Dale{},
	&Float{},
	&Focus{},
	&FocusRaise{},
	&FrameBorders{},
	&FrameFull{},
	&FrameNada{},
	&FrameSlim{},
	&HeadCycle{},
	&HeadFocus{},
	&HeadFocusWithClient{},
	&ToggleFloating{},
	&ToggleIconify{},
	&Iconify{},
	&Deiconify{},
	&ToggleMaximize{},
	&ToggleStackAbove{},
	&ToggleStackBelow{},
	&ToggleSticky{},
	&Maximize{},
	&MouseMove{},
	&MouseResize{},
	&Move{},
	&MoveRelative{},
	&MovePointer{},
	&MovePointerRelative{},
	&Raise{},
	&RemoveWorkspace{},
	&RenameWorkspace{},
	&Resize{},
	&Restart{},
	&Quit{},
	&SetLayout{},
	&SetOpacity{},
	&Script{},
	&ScriptConfig{},
	&Shell{},
	&Unfloat{},
	&Unmaximize{},
	&WingoExec{},
	&WingoHelp{},
	&Workspace{},
	&WorkspaceGreedy{},
	&WorkspaceHead{},
	&WorkspaceSendClient{},
	&WorkspaceToHead{},
	&WorkspaceWithClient{},
	&WorkspaceGreedyWithClient{},

	&AutoTile{},
	&AutoUntile{},
	&AutoCycle{},
	&AutoResizeMaster{},
	&AutoResizeWindow{},
	&AutoNext{},
	&AutoPrev{},
	&AutoSwitchNext{},
	&AutoSwitchPrev{},
	&AutoMaster{},
	&AutoMakeMaster{},
	&AutoMastersMore{},
	&AutoMastersFewer{},

	&CycleClientChoose{},
	&CycleClientHide{},
	&CycleClientNext{},
	&CycleClientPrev{},
	&Input{},
	&Message{},
	&SelectClient{},
	&SelectWorkspace{},

	&GetActive{},
	&GetAllClients{},
	&GetClientX{},
	&GetClientY{},
	&GetClientHeight{},
	&GetClientWidth{},
	&GetClientList{},
	&GetClientName{},
	&GetClientType{},
	&GetClientWorkspace{},
	&GetHead{},
	&GetNumHeads{},
	&GetNumHeadsConnected{},
	&GetHeadHeight{},
	&GetHeadWidth{},
	&GetHeadWorkspace{},
	&GetLayout{},
	&GetWorkspace{},
	&GetWorkspaceId{},
	&GetWorkspaceList{},
	&GetWorkspaceNext{},
	&GetWorkspacePrefix{},
	&GetWorkspacePrev{},
	&GetClientStatesList{},
	&HideClientFromPanels{},
	&ShowClientInPanels{},

	&TagGet{},
	&TagSet{},

	&True{},
	&False{},
	&MatchClientMapped{},
	&MatchClientClass{},
	&MatchClientInstance{},
	&MatchClientIsTransient{},
	&MatchClientName{},
	&MatchClientType{},
	&Not{},
	&And{},
	&Or{},
})
示例#2
0
var Env = gribble.New([]gribble.Command{
	&AddWorkspace{},
	&Close{},
	&Dale{},
	&Float{},
	&Focus{},
	&FocusRaise{},
	&FrameBorders{},
	&FrameFull{},
	&FrameNada{},
	&FrameSlim{},
	&HeadFocus{},
	&HeadFocusWithClient{},
	&ToggleFloating{},
	&ToggleIconify{},
	&ToggleMaximize{},
	&ToggleStackAbove{},
	&ToggleStackBelow{},
	&ToggleSticky{},
	&Maximize{},
	&MouseMove{},
	&MouseResize{},
	&Move{},
	&MoveRelative{},
	&MovePointer{},
	&MovePointerRelative{},
	&Raise{},
	&RemoveWorkspace{},
	&Resize{},
	&Restart{},
	&Quit{},
	&SetLayout{},
	&SetOpacity{},
	&Shell{},
	&Unfloat{},
	&Unmaximize{},
	&WingoExec{},
	&WingoHelp{},
	&Workspace{},
	&WorkspaceGreedy{},
	&WorkspaceSendClient{},
	&WorkspaceWithClient{},
	&WorkspaceGreedyWithClient{},

	&AutoTile{},
	&AutoUntile{},
	&AutoCycle{},
	&AutoResizeMaster{},
	&AutoResizeWindow{},
	&AutoNext{},
	&AutoPrev{},
	&AutoSwitchNext{},
	&AutoSwitchPrev{},
	&AutoMaster{},
	&AutoMakeMaster{},
	&AutoMastersMore{},
	&AutoMastersFewer{},

	&CycleClientChoose{},
	&CycleClientHide{},
	&CycleClientNext{},
	&CycleClientPrev{},
	&Input{},
	&SelectClient{},
	&SelectWorkspace{},

	&GetActive{},
	&GetClientList{},
	&GetClientName{},
	&GetClientType{},
	&GetClientWorkspace{},
	&GetLayout{},
	&GetWorkspace{},
	&GetWorkspaceList{},
	&GetWorkspaceNext{},
	&GetWorkspacePrefix{},
	&GetWorkspacePrev{},

	&True{},
	&False{},
	&MatchClientClass{},
	&MatchClientInstance{},
	&MatchClientIsTransient{},
	&MatchClientName{},
	&MatchClientType{},
	&Not{},
	&And{},
	&Or{},
})
示例#3
0
	"fmt"
	"os"
	"path"
	"strings"

	"github.com/BurntSushi/gribble"
)

// A Gribble environment is composed of Go struct types. Since the environment
// does not care about values, zero values of each command struct can be
// used in the gribble.Command slice.
//
// Note that these may also be specified as pointers.
var env *gribble.Environment = gribble.New([]gribble.Command{
	Add{},
	Subtract{},
	Multiply{},
	Divide{},
})

// Add implements the arithmetic '+' operation on integers.
type Add struct {
	// We can override the name of the command to use 'add' instead of 'Add'.
	// If the 'name' field is absent, then the name of the command is the same
	// as the name of type. (In this case, 'Add'.)
	name string `add`
	Op1  int    `param:"1"`
	Op2  int    `param:"2"`
}

// Run simply adds Op1 and Op2.
func (c Add) Run() gribble.Value {
示例#4
0
	"fmt"
	"os"
	"path"
	"strings"

	"github.com/BurntSushi/gribble"
)

// A Gribble environment is composed of Go struct types. Since the environment
// does not care about values, zero values of each command struct can be
// used in the gribble.Command slice.
//
// Note that these may also be specified as non-pointers.
var env *gribble.Environment = gribble.New([]gribble.Command{
	&Add{},
	&Subtract{},
	&Multiply{},
	&Divide{},
})

// Add implements the arithmetic '+' operation on decimals.
type Add struct {
	// We can override the name of the command to use 'add' instead of 'Add'.
	// If the 'name' field is absent, then the name of the command is the same
	// as the name of type. (In this case, 'Add'.)
	name string `add`

	// In the 'int-calc' example, the operators are defined using a conrete
	// type like 'Op1 int `param:"1"`'. In this case, we want to allow the
	// operators to be either floats or integers. To accomplish this, we
	// make the operators have type gribble.Any (which is just an empty
	// interface), and specify the allowable types using the 'types' struct