// TextView1 demonstrates the basic text view.
328359
func TextView1(nextSlide func()) (title string, content tview.Primitive) {
	textView := tview.NewTextView().
		SetTextColor(tcell.ColorYellow).
		SetScrollable(false).
		SetDoneFunc(func(key tcell.Key) {
			nextSlide()
		})
	textView.SetChangedFunc(func() {
		if textView.HasFocus() {
			app.Draw()
		}
	})
	go func() {
		var n int
		for {
			n++
			fmt.Fprintf(textView, "%d ", n)
			time.Sleep(200 * time.Millisecond)
		}
	}()
	textView.SetBorder(true).SetTitle("TextView implements io.Writer")
	return "Text 1", Code(textView, 36, 13, textView1)
}
1049269
func (s *SimpleEmail) SetTextPart(v *SimpleEmailPart) *SimpleEmail {
	s.TextPart = v
	return s
}
210236
func (t *Tree) textOrAction() Node {
	switch token := t.nextNonSpace(); token.typ {
	case itemElideNewline:
		return t.elideNewline()
	case itemText:
		return t.newText(token.pos, token.val)
	case itemLeftDelim:
		return t.action()
	default:
		t.unexpected(token, "input")
	}
	return nil
}
238889
func Text(sel interface{}, text *string, opts ...QueryOption) Action {
	if text == nil {
		panic("text cannot be nil")
	}

	return QueryAfter(sel, func(ctx context.Context, nodes ...*cdp.Node) error {
		if len(nodes) < 1 {
			return fmt.Errorf("selector `%s` did not return any nodes", sel)
		}

		return EvaluateAsDevTools(fmt.Sprintf(textJS, nodes[0].FullXPath()), text).Do(ctx)
	}, opts...)
}
415800
func SnippetEllipsisTextEqual(o1, o2 *SnippetEllipsisTextOption) bool {
	if o1 != nil {
		return o1.Equal(o2)
	}
	if o2 != nil {
		return o2.Equal(o1)
	}
	return true
}
375682
func AlignText(txt string, width int, align TextAlignment) string {
	return AlignTextWithFill(txt, width, align, ' ')
}
262133
func (s Style) GetTextVerticalAlign(defaults ...TextVerticalAlign) TextVerticalAlign {
	if s.TextVerticalAlign == TextVerticalAlignUnset {
		if len(defaults) > 0 {
			return defaults[0]
		}
		return TextVerticalAlignUnset
	}
	return s.TextVerticalAlign
}
1026171
func (ui *UI) DisplayTextMenu(choices []string, promptTemplate string, templateValues ...map[string]interface{}) (string, error) {
	for i, c := range choices {
		t := fmt.Sprintf("%d. %s", i+1, c)
		ui.DisplayText(t)
	}

	translatedPrompt := ui.TranslateText(promptTemplate, templateValues...)

	interactivePrompt := ui.Interactor.NewInteraction(translatedPrompt)

	interactivePrompt.SetIn(ui.In)
	interactivePrompt.SetOut(ui.OutForInteration)

	var value string = "enter to skip"
	err := interactivePrompt.Resolve(&value)

	if isInterrupt(err) {
		ui.Exiter.Exit(sigIntExitCode)
	}

	if err != nil {
		return "", err
	}

	if value == "enter to skip" {
		return "", nil
	}

	i, err := strconv.Atoi(value)
	if err != nil {
		if contains(choices, value) {
			return value, nil
		}
		return "", InvalidChoiceError{Choice: value}
	}

	if i > len(choices) || i <= 0 {
		return "", ErrInvalidIndex
	}
	return choices[i-1], nil
}
668807
func (s *TableInput) SetViewExpandedText(v string) *TableInput {
	s.ViewExpandedText = &v
	return s
}
1196961
func (vr *vectorRenderer) Text(body string, x, y int) {
	vr.c.Text(x, y, body, vr.s.GetTextOptions())
}
548005
func (c *Ctx) TextBytes(code int, b []byte) (err error) {

	c.response.Header().Set(ContentType, TextPlainCharsetUTF8)
	c.response.WriteHeader(code)
	_, err = c.response.Write(b)
	return
}
42914
func (cr *Context) TextPath(utf8 string) {
	c_utf8 := C.CString(utf8)
	defer C.free(unsafe.Pointer(c_utf8))
	C.cairo_text_path(cr.Ptr, c_utf8)
	if err := cr.status(); err != nil {
		panic(err)
	}
}
721314
func TextItems(rpt *Report) ([]TextItem, []string) {
	g, origCount, droppedNodes, _ := rpt.newTrimmedGraph()
	rpt.selectOutputUnit(g)
	labels := reportLabels(rpt, g, origCount, droppedNodes, 0, false)

	var items []TextItem
	var flatSum int64
	for _, n := range g.Nodes {
		name, flat, cum := n.Info.PrintableName(), n.FlatValue(), n.CumValue()

		var inline, noinline bool
		for _, e := range n.In {
			if e.Inline {
				inline = true
			} else {
				noinline = true
			}
		}

		var inl string
		if inline {
			if noinline {
				inl = "(partial-inline)"
			} else {
				inl = "(inline)"
			}
		}

		flatSum += flat
		items = append(items, TextItem{
			Name:        name,
			InlineLabel: inl,
			Flat:        flat,
			Cum:         cum,
			FlatFormat:  rpt.formatValue(flat),
			CumFormat:   rpt.formatValue(cum),
		})
	}
	return items, labels
}
1285011
func AddrTxnViewTypeFromStr(txnType string) AddrTxnViewType {
	txnType = strings.ToLower(txnType)
	switch txnType {
	case "all":
		return AddrTxnAll
	case "credit", "credits":
		return AddrTxnCredit
	case "debit", "debits":
		return AddrTxnDebit
	case "merged_debit", "merged debit":
		return AddrMergedTxnDebit
	case "merged_credit", "merged credit":
		return AddrMergedTxnCredit
	case "merged":
		return AddrMergedTxn
	default:
		return AddrTxnUnknown
	}
}
741010
func (a *defaultAdapter) Text(res *Response) ([]byte, error) {
	r, err := res.Reader()
	if err != nil {
		return nil, err
	}
	text, err := ioutil.ReadAll(r)
	if err != nil {
		return nil, err
	}
	return text, nil
}
834146
func (f *Font) TextDimensions(text string) (int, int, int) {
	fnt := f.TTF
	size := f.Size
	var (
		totalWidth  = fixed.Int26_6(0)
		totalHeight = fixed.Int26_6(size)
		maxYBearing = fixed.Int26_6(0)
	)
	fupe := fixed.Int26_6(fnt.FUnitsPerEm())

	for _, char := range text {
		idx := fnt.Index(char)
		hm := fnt.HMetric(fupe, idx)
		vm := fnt.VMetric(fupe, idx)
		g := truetype.GlyphBuf{}
		err := g.Load(fnt, fupe, idx, font.HintingNone)
		if err != nil {
			log.Println(err)
			return 0, 0, 0
		}
		totalWidth += hm.AdvanceWidth

		yB := (vm.TopSideBearing * fixed.Int26_6(size)) / fupe
		if yB > maxYBearing {
			maxYBearing = yB
		}
		dY := (vm.AdvanceHeight * fixed.Int26_6(size)) / fupe
		if dY > totalHeight {
			totalHeight = dY
		}
	}

	// Scale to actual pixel size
	totalWidth *= fixed.Int26_6(size)
	totalWidth /= fupe

	return int(totalWidth), int(totalHeight), int(maxYBearing)
}
1182304
func (g *group) V1() v1.Interface {
	return v1.New(g.factory, g.namespace, g.tweakListOptions)
}