// See cairo_surface_get_device_offset().
//
// C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-get-device-offset
435789
func (surface *Surface) GetDeviceOffset() (float64, float64) {
	var xOffset C.double
	var yOffset C.double

	C.cairo_surface_get_device_offset(surface.Ptr, &xOffset, &yOffset)
	if err := surface.status(); err != nil {
		panic(err)
	}
	return float64(xOffset), float64(yOffset)
}
1248998
func (s *Matrix) offset(dims []int) int {
	if len(dims) != len(s.dims) {
		panic("incorrect dimensions")
	}

	i := 0
	for n, v := range dims {
		if v > s.dims[n] {
			panic("incorrect dimensions")
		}

		i += v * s.offsets[n]
	}

	return i
}
319567
func (bldr *aeBackupInformationKindTypeInfoQueryBuilder) Offset(offset int) *aeBackupInformationKindTypeInfoQueryBuilder {
	bldr.q = bldr.q.Offset(offset)
	if bldr.plugin != nil {
		bldr.plugin.Offset(offset)
	}
	return bldr
}
394605
func GetDevice(db sqlx.Queryer, devEUI lorawan.EUI64) (Device, error) {
	var d Device
	err := sqlx.Get(db, &d, "select * from device where dev_eui = $1", devEUI[:])
	if err != nil {
		return d, handlePSQLError(err, "select error")
	}

	return d, nil
}
1263227
func (v *Scale) GetLayoutOffsets() (x int, y int) {
	var xx, yy C.gint
	C.gtk_scale_get_layout_offsets(SCALE(v), &xx, &yy)
	return int(xx), int(yy)
}
1130512
func (surface *ImageSurface) GetFormat() Format {
	ret := Format(C.cairo_image_surface_get_format(surface.Ptr))
	if err := surface.status(); err != nil {
		panic(err)
	}
	return ret
}
380417
func (surface *XlibSurface) GetScreen() unsafe.Pointer {
	ret := unsafe.Pointer(C.cairo_xlib_surface_get_screen(surface.Ptr))
	if err := surface.status(); err != nil {
		panic(err)
	}
	return ret
}
175809
func (device *XlibDevice) DebugGetPrecision() int {
	ret := int(C.cairo_xlib_device_debug_get_precision(device.Ptr))
	if err := device.status(); err != nil {
		panic(err)
	}
	return ret
}
1031260
func (p *PdfDictionaryObj) GetOffset(glyph int) int {
	ttfp := p.PtrToSubsetFontObj.GetTTFParser()
	glyf := ttfp.GetTables()["glyf"]
	offset := int(glyf.Offset + ttfp.LocaTable[glyph])
	return offset
}
1297973
func (a *HistogramAggregation) Offset(offset float64) *HistogramAggregation {
	a.offset = &offset
	return a
}
751452
func (m *PoolMetadata) GetDevice(ctx context.Context, name string) (*DeviceInfo, error) {
	var (
		dev DeviceInfo
		err error
	)

	err = m.db.View(func(tx *bolt.Tx) error {
		bucket := tx.Bucket(devicesBucketName)
		return getObject(bucket, name, &dev)
	})

	return &dev, err
}
969234
func (this *SiestaClient) GetAvailableOffset(topic string, partition int32, offsetTime string) (int64, error) {
	time := siesta.LatestTime
	if offsetTime == "smallest" {
		time = siesta.EarliestTime
	}
	return this.connector.GetAvailableOffset(topic, partition, time)
}
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
}
740759
func (bldr *fooBarQueryBuilder) Offset(offset int) *fooBarQueryBuilder {
	bldr.q = bldr.q.Offset(offset)
	if bldr.plugin != nil {
		bldr.plugin.Offset(offset)
	}
	return bldr
}
1109148
func (_m *DBClient) GetDeviceByName(n string) (models.Device, error) {
	ret := _m.Called(n)

	var r0 models.Device
	if rf, ok := ret.Get(0).(func(string) models.Device); ok {
		r0 = rf(n)
	} else {
		r0 = ret.Get(0).(models.Device)
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(string) error); ok {
		r1 = rf(n)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
916471
func AddOffset(x *Bitmap, offset uint32) (answer *Bitmap) {
	containerOffset := highbits(offset)
	inOffset := lowbits(offset)
	if inOffset == 0 {
		answer = x.Clone()
		for pos := 0; pos < answer.highlowcontainer.size(); pos++ {
			key := answer.highlowcontainer.getKeyAtIndex(pos)
			key += containerOffset
			answer.highlowcontainer.keys[pos] = key
		}
	} else {
		answer = New()
		for pos := 0; pos < x.highlowcontainer.size(); pos++ {
			key := x.highlowcontainer.getKeyAtIndex(pos)
			key += containerOffset
			c := x.highlowcontainer.getContainerAtIndex(pos)
			offsetted := c.addOffset(inOffset)
			if offsetted[0].getCardinality() > 0 {
				curSize := answer.highlowcontainer.size()
				lastkey := uint16(0)
				if curSize > 0 {
					lastkey = answer.highlowcontainer.getKeyAtIndex(curSize - 1)
				}
				if curSize > 0 && lastkey == key {
					prev := answer.highlowcontainer.getContainerAtIndex(curSize - 1)
					orrseult := prev.ior(offsetted[0])
					answer.highlowcontainer.setContainerAtIndex(curSize-1, orrseult)
				} else {
					answer.highlowcontainer.appendContainer(key, offsetted[0], false)
				}
			}
			if offsetted[1].getCardinality() > 0 {
				answer.highlowcontainer.appendContainer(key+1, offsetted[1], false)
			}
		}
	}
	return answer
}
1069721
func GetOffsetCtx(r *http.Request) int {
	offset, ok := r.Context().Value(ctxOffset).(int)
	if !ok {
		apiLog.Warn("offset is not set or is not an int")
		return 0
	}
	return offset
}