// See cairo_surface_has_show_text_glyphs().
//
// C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-has-show-text-glyphs
555084
func (surface *Surface) HasShowTextGlyphs() bool {
	ret := C.cairo_surface_has_show_text_glyphs(surface.Ptr) != 0
	if err := surface.status(); err != nil {
		panic(err)
	}
	return ret
}
1089255
func TexBuffer(target uint32, internalformat uint32, buffer uint32) {
	C.glowTexBuffer(gpTexBuffer, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLuint)(buffer))
}
709139
func (device *Device) ObserverGlyphsElapsed() float64 {
	ret := float64(C.cairo_device_observer_glyphs_elapsed(device.Ptr))
	if err := device.status(); err != nil {
		panic(err)
	}
	return ret
}
1016069
func (g *Graph) Show() string {
	if g == nil {
		return ""
	}

	buffer := &bytes.Buffer{}

	g._text(0, buffer, true)

	// remove trailing \n

	s := buffer.String()

	if len(s) == 0 {
		return ""
	}

	if s[len(s)-1] == '\n' {
		s = s[0 : len(s)-1]
	}

	// unquote

	if s[0] == '"' {
		s = s[1 : len(s)-1]
		// But then also replace \"
		s = strings.Replace(s, "\\\"", "\"", -1)
	}

	return s
}
1262059
func (options *FontOptions) GetHintStyle() HintStyle {
	ret := HintStyle(C.cairo_font_options_get_hint_style(options.Ptr))
	if err := options.status(); err != nil {
		panic(err)
	}
	return ret
}
1177931
func PatternCreateForSurface(surface *Surface) *Pattern {
	ret := wrapPattern(C.cairo_pattern_create_for_surface(surface.Ptr))
	if err := ret.status(); err != nil {
		panic(err)
	}
	return ret
}
571455
func (t *Text) makeBufferData(indices []rune) {
	glyphs := t.Font.Config.Glyphs

	vboIndex := 0
	eboIndex := 0
	lineX := float32(0)
	eboOffset := int32(0)

	t.CharSpacing = make([]float32, 0)
	for i, r := range indices {
		glyphIndex := t.Font.Config.RuneRanges.GetGlyphIndex(r)
		if glyphIndex >= 0 {
			if gltext.IsDebug {
				prefix := gltext.DebugPrefix()
				fmt.Printf("%s png index %3d: %s rune %+v line at %f", prefix, glyphIndex, string(r), glyphs[glyphIndex], lineX)
			}
			advance := float32(glyphs[glyphIndex].Advance)

			// Originally the glyph Width was used, but that results in quads that overlap one another.
			vw := float32(glyphs[glyphIndex].Advance)
			vh := float32(glyphs[glyphIndex].Height)

			// used to determine which character inside of the text was clicked
			t.CharSpacing = append(t.CharSpacing, advance)

			// variable width characters will produce a bounding box that is just
			// a bit too long on the right-hand side unless we trim off the excess
			// when processing the right-most character
			trim := float32(0)
			if i == len(indices)-1 {
				trim = vw - advance
			}
			tP1, tP2 := glyphs[glyphIndex].GetTexturePositions(t.Font)

			// counter-clockwise quad
			// the bounding box value X2 is being expanded as characters are added

			// index (0,0)
			t.vboData[vboIndex] = lineX // position
			vboIndex++
			t.vboData[vboIndex] = 0
			vboIndex++
			t.vboData[vboIndex] = tP1.X // texture uv
			vboIndex++
			t.vboData[vboIndex] = tP2.Y
			vboIndex++

			// index (1,0) - expanding X2
			t.vboData[vboIndex], t.X2.X = lineX+vw, lineX+vw-trim
			vboIndex++
			t.vboData[vboIndex] = 0
			vboIndex++
			t.vboData[vboIndex] = tP2.X
			vboIndex++
			t.vboData[vboIndex] = tP2.Y
			vboIndex++

			// index (1,1) - expanding X2
			t.vboData[vboIndex] = lineX + vw
			vboIndex++
			t.vboData[vboIndex], t.X2.Y = vh, vh
			vboIndex++
			t.vboData[vboIndex] = tP2.X
			vboIndex++
			t.vboData[vboIndex] = tP1.Y
			vboIndex++

			// index (0,1)
			t.vboData[vboIndex] = lineX
			vboIndex++
			t.vboData[vboIndex] = vh
			vboIndex++
			t.vboData[vboIndex] = tP1.X
			vboIndex++
			t.vboData[vboIndex] = tP1.Y
			vboIndex++

			// ebo data
			t.eboData[eboIndex] = 0 + eboOffset
			eboIndex++
			t.eboData[eboIndex] = 1 + eboOffset
			eboIndex++
			t.eboData[eboIndex] = 2 + eboOffset
			eboIndex++

			t.eboData[eboIndex] = 0 + eboOffset
			eboIndex++
			t.eboData[eboIndex] = 2 + eboOffset
			eboIndex++
			t.eboData[eboIndex] = 3 + eboOffset
			eboIndex++
			eboOffset += 4

			// shift to the right
			lineX += advance
			if gltext.IsDebug {
				fmt.Printf("-> %f\n", lineX)
			}
		}
	}
	if gltext.IsDebug {
		gltext.PrintVBO(t.vboData, t.Font.GetTextureHeight(), t.Font.GetTextureWidth())
	}
	return
}
1234044
func (obj *Doc) GetTextMacrosRaw(ctx context.Context) (json.RawMessage, error) {
	result := &struct {
		Macros json.RawMessage	`json:"qMacros"`
	} {}
	err := obj.rpc(ctx, "GetTextMacros", result)
	return result.Macros, err 
}
194839
func Italic(arg interface{}) Value {
	if val, ok := arg.(Value); ok {
		return val.Italic()
	}
	return value{value: arg, color: ItalicFm}
}
1268721
func (scaledFont *ScaledFont) GetFontFace() *FontFace {
	ret := wrapFontFace(C.cairo_scaled_font_get_font_face(scaledFont.Ptr))
	if err := scaledFont.status(); err != nil {
		panic(err)
	}
	return ret
}
389147
func (options *FontOptions) Equal(other *FontOptions) bool {
	ret := C.cairo_font_options_equal(options.Ptr, other.Ptr) != 0
	if err := options.status(); err != nil {
		panic(err)
	}
	return ret
}
409723
func (c *CSS) GetStyleSheetText(styleSheetId string) (string, error) {
	var v CSSGetStyleSheetTextParams
	v.StyleSheetId = styleSheetId
	return c.GetStyleSheetTextWithParams(&v)
}
631693
func ShowCursor(toggle int) (int, error) {
	i := int(C.SDL_ShowCursor(C.int(toggle)))
	return i, errorFromInt(i)
}
1036812
func (fontFace *FontFace) status() error {
	ret := Status(C.cairo_font_face_status(fontFace.Ptr)).toError()
	return ret
}
1273409
func StyleTextDefaults() Style {
	font, _ := GetDefaultFont()
	return Style{
		Show:      true,
		Font:      font,
		FontColor: DefaultTextColor,
		FontSize:  DefaultTitleFontSize,
	}
}
484915
func (options *FontOptions) Hash() uint32 {
	ret := uint32(C.cairo_font_options_hash(options.Ptr))
	if err := options.status(); err != nil {
		panic(err)
	}
	return ret
}
165295
func (s GoSignature) AlphaBetas() []string {
	var retVal []string
	for _, p := range s.Params {
		if inList(p.Name, alphaBetaParams) {
			retVal = append(retVal, p.Name)
		}
	}
	return retVal
}