// See cairo_surface_get_content().
//
// C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-get-content
421441
func (surface *Surface) GetContent() Content {
	ret := Content(C.cairo_surface_get_content(surface.Ptr))
	if err := surface.status(); err != nil {
		panic(err)
	}
	return ret
}
486517
func (surface *ImageSurface) GetHeight() int {
	ret := int(C.cairo_image_surface_get_height(surface.Ptr))
	if err := surface.status(); err != nil {
		panic(err)
	}
	return ret
}
455278
func (surface *Surface) Pixels() []byte {
	var b []byte
	length := int(surface.W*surface.H) * int(surface.Format.BytesPerPixel)
	sliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&b))
	sliceHeader.Cap = int(length)
	sliceHeader.Len = int(length)
	sliceHeader.Data = uintptr(surface.pixels)
	return b
}
832979
func (i *InstallationPermissions) GetContents() string {
	if i == nil || i.Contents == nil {
		return ""
	}
	return *i.Contents
}
950675
func (cr *Context) GetTarget() *Surface {
	ret := wrapSurface(C.cairo_get_target(cr.Ptr))
	if err := cr.status(); err != nil {
		panic(err)
	}
	return ret
}
12910
func (t *TreeEntry) GetContent() string {
	if t == nil || t.Content == nil {
		return ""
	}
	return *t.Content
}
1018581
func (cr *Context) FillExtents() (float64, float64, float64, float64) {
	var x1 C.double
	var y1 C.double
	var x2 C.double
	var y2 C.double

	C.cairo_fill_extents(cr.Ptr, &x1, &y1, &x2, &y2)
	if err := cr.status(); err != nil {
		panic(err)
	}
	return float64(x1), float64(y1), float64(x2), float64(y2)
}
442430
func (c *Page) GetResourceContent(frameId string, url string) (string, bool, error) {
	var v PageGetResourceContentParams
	v.FrameId = frameId
	v.Url = url
	return c.GetResourceContentWithParams(&v)
}
329342
func (r *RepositoryContent) GetContent() (string, error) {
	var encoding string
	if r.Encoding != nil {
		encoding = *r.Encoding
	}

	switch encoding {
	case "base64":
		c, err := base64.StdEncoding.DecodeString(*r.Content)
		return string(c), err
	case "":
		if r.Content == nil {
			return "", nil
		}
		return *r.Content, nil
	default:
		return "", fmt.Errorf("unsupported content encoding: %v", encoding)
	}
}
57423
func (surface *Surface) GetDevice() *Device {
	ret := wrapDevice(C.cairo_surface_get_device(surface.Ptr))
	if err := surface.status(); err != nil {
		panic(err)
	}
	return ret
}
268730
func (surface *Surface) GetColorMod() (r, g, b uint8, err error) {
	_r := (*C.Uint8)(unsafe.Pointer(&r))
	_g := (*C.Uint8)(unsafe.Pointer(&g))
	_b := (*C.Uint8)(unsafe.Pointer(&b))
	if C.SDL_GetSurfaceColorMod(surface.cptr(), _r, _g, _b) != 0 {
		return r, g, b, GetError()
	}
	return r, g, b, nil
}
182084
func NewSurface(bound *Bound, width, height int) *Surface {
	s := &Surface{
		bound:  bound.Clone(),
		Width:  width,
		Height: height,
	}

	s.Grid = make([][]float64, width)
	points := make([]float64, width*height)

	for i := range s.Grid {
		s.Grid[i], points = points[:height], points[height:]
	}

	return s
}
959143
func (f *File) Contents() (content string, err error) {
	reader, err := f.Reader()
	if err != nil {
		return "", err
	}
	defer ioutil.CheckClose(reader, &err)

	buf := new(bytes.Buffer)
	if _, err := buf.ReadFrom(reader); err != nil {
		return "", err
	}

	return buf.String(), nil
}
157069
func FrameExtentsGet(xu *xgbutil.XUtil,
	win xproto.Window) (*FrameExtents, error) {

	raw, err := xprop.PropValNums(xprop.GetProperty(xu, win,
		"_NET_FRAME_EXTENTS"))
	if err != nil {
		return nil, err
	}

	return &FrameExtents{
		Left:   int(raw[0]),
		Right:  int(raw[1]),
		Top:    int(raw[2]),
		Bottom: int(raw[3]),
	}, nil
}
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
}
502948
func (scaledFont *ScaledFont) GetCTM(ctm *Matrix) {
	C.cairo_scaled_font_get_ctm(scaledFont.Ptr, (*C.cairo_matrix_t)(unsafe.Pointer(ctm)))
	if err := scaledFont.status(); err != nil {
		panic(err)
	}
}
368218
func (extr *ContentExtractor) GetTitle(document *goquery.Document) string {
	title := ""

	titleElement := document.Find("title")
	if titleElement != nil && titleElement.Size() > 0 {
		title = titleElement.Text()
	}

	if title == "" {
		ogTitleElement := document.Find(`meta[property="og:title"]`)
		if ogTitleElement != nil && ogTitleElement.Size() > 0 {
			title, _ = ogTitleElement.Attr("content")
		}
	}

	if title == "" {
		titleElement = document.Find("post-title,headline")
		if titleElement == nil || titleElement.Size() == 0 {
			return title
		}
		title = titleElement.Text()
	}

	for _, delimiter := range titleDelimiters {
		if strings.Contains(title, delimiter) {
			title = extr.splitTitle(strings.Split(title, delimiter))
			break
		}
	}

	title = strings.Replace(title, motleyReplacement, "", -1)

	if extr.config.debug {
		log.Printf("Page title is %s\n", title)
	}

	return strings.TrimSpace(title)
}