// Input interface
973069
func (is *InputStruct) PartCount() (int, error) {
	if is.PartCountF != nil {
		return is.PartCountF()
	}
	return 0, nil
}
47431
func (cutoff EnvCutoff) Inputs() []Input {
	(&cutoff).defaults()

	var (
		levels = []Input{cutoff.Level, C(0)}
		times  = []Input{cutoff.R}
		cts    = []Input{cutoff.CurveType}
	)
	return Env{
		Levels:      levels,
		Times:       times,
		Curve:       cts,
		ReleaseNode: C(0),
	}.Inputs()
}
786169
func getInput() (string, error) {
	text, err := reader.ReadString('\n')
	if err != nil {
		return "", err
	}

	return strings.TrimSpace(text), nil
}
342314
func (s *WorkflowExecutionContinuedAsNewEventAttributes) SetInput(v string) *WorkflowExecutionContinuedAsNewEventAttributes {
	s.Input = &v
	return s
}
134406
func input(filename string) (nm string, rc io.ReadCloser) {
	nm = "stdin"
	inf := os.Stdin
	if filename != "" {
		f, err := os.Open(filename)
		if err != nil {
			fmt.Fprintln(os.Stderr, err)
			exit(2)
		}
		inf = f
		nm = filename
	}
	r := bufio.NewReader(inf)
	return nm, makeReadCloser(r, inf)
}
735993
func Enter(fn func(res *Response) error) handler {
	return &Handler{Method: ENTER, Run: fn}
}
1095763
func (m ModuleInstance) InputVariable(name string) AbsInputVariableInstance {
	return AbsInputVariableInstance{
		Module: m,
		Variable: InputVariable{
			Name: name,
		},
	}
}
707225
func (sine EnvSine) Inputs() []Input {
	(&sine).defaults()

	d := sine.Dur.Mul(C(0.5))

	return Env{
		Levels: []Input{C(0), sine.Level, C(0)},
		Times:  []Input{d, d},
		Curve:  "sine",
	}.Inputs()
}
507857
func EvalInput(input interface{}) EvalOption {
	return func(e *EvalContext) {
		e.rawInput = &input
		e.hasInput = true
	}
}
1132846
func (m schemaMap) Input(
	input terraform.UIInput,
	c *terraform.ResourceConfig) (*terraform.ResourceConfig, error) {
	keys := make([]string, 0, len(m))
	for k, _ := range m {
		keys = append(keys, k)
	}
	sort.Strings(keys)

	for _, k := range keys {
		v := m[k]

		// Skip things that don't require config, if that is even valid
		// for a provider schema.
		// Required XOR Optional must always be true to validate, so we only
		// need to check one.
		if v.Optional {
			continue
		}

		// Deprecated fields should never prompt
		if v.Deprecated != "" {
			continue
		}

		// Skip things that have a value of some sort already
		if _, ok := c.Raw[k]; ok {
			continue
		}

		// Skip if it has a default value
		defaultValue, err := v.DefaultValue()
		if err != nil {
			return nil, fmt.Errorf("%s: error loading default: %s", k, err)
		}
		if defaultValue != nil {
			continue
		}

		var value interface{}
		switch v.Type {
		case TypeBool, TypeInt, TypeFloat, TypeSet, TypeList:
			continue
		case TypeString:
			value, err = m.inputString(input, k, v)
		default:
			panic(fmt.Sprintf("Unknown type for input: %#v", v.Type))
		}

		if err != nil {
			return nil, fmt.Errorf(
				"%s: %s", k, err)
		}

		c.Config[k] = value
	}

	return c, nil
}
650744
func (m *Meta) Input() bool {
	if test || !m.input {
		return false
	}

	if envVar := os.Getenv(InputModeEnvVar); envVar != "" {
		if v, err := strconv.ParseBool(envVar); err == nil && !v {
			return false
		}
	}

	return true
}
1254260
func (s *AddApplicationInputInput) SetInput(v *Input) *AddApplicationInputInput {
	s.Input = v
	return s
}
1258265
func (w *Window) UpdateInput() {
	mainthread.Call(func() {
		glfw.PollEvents()
	})

	w.prevInp = w.currInp
	w.currInp = w.tempInp

	w.tempInp.repeat = [KeyLast + 1]bool{}
	w.tempInp.scroll = pixel.ZV
	w.tempInp.typed = ""

	w.updateJoystickInput()
}
26888
func (d *DropDown) InputHandler() func(event *tcell.EventKey, setFocus func(p Primitive)) {
	return d.WrapInputHandler(func(event *tcell.EventKey, setFocus func(p Primitive)) {
		// A helper function which selects an item in the drop-down list based on
		// the current prefix.
		evalPrefix := func() {
			if len(d.prefix) > 0 {
				for index, option := range d.options {
					if strings.HasPrefix(strings.ToLower(option.Text), d.prefix) {
						d.list.SetCurrentItem(index)
						return
					}
				}
				// Prefix does not match any item. Remove last rune.
				r := []rune(d.prefix)
				d.prefix = string(r[:len(r)-1])
			}
		}

		// Process key event.
		switch key := event.Key(); key {
		case tcell.KeyEnter, tcell.KeyRune, tcell.KeyDown:
			d.prefix = ""

			// If the first key was a letter already, it becomes part of the prefix.
			if r := event.Rune(); key == tcell.KeyRune && r != ' ' {
				d.prefix += string(r)
				evalPrefix()
			}

			// Hand control over to the list.
			d.open = true
			optionBefore := d.currentOption
			d.list.SetSelectedFunc(func(index int, mainText, secondaryText string, shortcut rune) {
				// An option was selected. Close the list again.
				d.open = false
				setFocus(d)
				d.currentOption = index

				// Trigger "selected" event.
				if d.selected != nil {
					d.selected(d.options[d.currentOption].Text, d.currentOption)
				}
				if d.options[d.currentOption].Selected != nil {
					d.options[d.currentOption].Selected()
				}
			}).SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
				if event.Key() == tcell.KeyRune {
					d.prefix += string(event.Rune())
					evalPrefix()
				} else if event.Key() == tcell.KeyBackspace || event.Key() == tcell.KeyBackspace2 {
					if len(d.prefix) > 0 {
						r := []rune(d.prefix)
						d.prefix = string(r[:len(r)-1])
					}
					evalPrefix()
				} else if event.Key() == tcell.KeyEscape {
					d.open = false
					d.currentOption = optionBefore
					setFocus(d)
				} else {
					d.prefix = ""
				}
				return event
			})
			setFocus(d.list)
		case tcell.KeyEscape, tcell.KeyTab, tcell.KeyBacktab:
			if d.done != nil {
				d.done(key)
			}
			if d.finished != nil {
				d.finished(key)
			}
		}
	})
}
1206091
func (s *GetActivityTaskOutput) SetInput(v string) *GetActivityTaskOutput {
	s.Input = &v
	return s
}
59595
func (b *Button) InputHandler() func(event *tcell.EventKey, setFocus func(p Primitive)) {
	return b.WrapInputHandler(func(event *tcell.EventKey, setFocus func(p Primitive)) {
		// Process key event.
		switch key := event.Key(); key {
		case tcell.KeyEnter: // Selected.
			if b.selected != nil {
				b.selected()
			}
		case tcell.KeyBacktab, tcell.KeyTab, tcell.KeyEscape: // Leave. No action.
			if b.blur != nil {
				b.blur(key)
			}
		}
	})
}
151822
func (t *TreeView) InputHandler() func(event *tcell.EventKey, setFocus func(p Primitive)) {
	return t.WrapInputHandler(func(event *tcell.EventKey, setFocus func(p Primitive)) {
		// Because the tree is flattened into a list only at drawing time, we also
		// postpone the (selection) movement to drawing time.
		switch key := event.Key(); key {
		case tcell.KeyTab, tcell.KeyDown, tcell.KeyRight:
			t.movement = treeDown
		case tcell.KeyBacktab, tcell.KeyUp, tcell.KeyLeft:
			t.movement = treeUp
		case tcell.KeyHome:
			t.movement = treeHome
		case tcell.KeyEnd:
			t.movement = treeEnd
		case tcell.KeyPgDn, tcell.KeyCtrlF:
			t.movement = treePageDown
		case tcell.KeyPgUp, tcell.KeyCtrlB:
			t.movement = treePageUp
		case tcell.KeyRune:
			switch event.Rune() {
			case 'g':
				t.movement = treeHome
			case 'G':
				t.movement = treeEnd
			case 'j':
				t.movement = treeDown
			case 'k':
				t.movement = treeUp
			}
		case tcell.KeyEnter:
			if t.currentNode != nil {
				if t.selected != nil {
					t.selected(t.currentNode)
				}
				if t.currentNode.selected != nil {
					t.currentNode.selected()
				}
			}
		}

		t.process()
	})
}