// Blur blurs the window
765955
func (w *Window) Blur() (err error) {
	if err = w.isActionable(); err != nil {
		return
	}
	_, err = synchronousEvent(w.c, w, w.w, Event{Name: EventNameWindowCmdBlur, TargetID: w.id}, EventNameWindowEventBlur)
	return
}
1374148
func (g *Grid) HasFocus() bool {
	for _, item := range g.items {
		if item.visible && item.Item.GetFocusable().HasFocus() {
			return true
		}
	}
	return g.hasFocus
}
1132107
func blend(bg image.Image, fg image.Image, fn func(fcolor.RGBAF64, fcolor.RGBAF64) fcolor.RGBAF64) *image.RGBA {
	bgBounds := bg.Bounds()
	fgBounds := fg.Bounds()

	var w, h int
	if bgBounds.Dx() < fgBounds.Dx() {
		w = bgBounds.Dx()
	} else {
		w = fgBounds.Dx()
	}
	if bgBounds.Dy() < fgBounds.Dy() {
		h = bgBounds.Dy()
	} else {
		h = fgBounds.Dy()
	}

	bgSrc := clone.AsRGBA(bg)
	fgSrc := clone.AsRGBA(fg)
	dst := image.NewRGBA(image.Rect(0, 0, w, h))

	parallel.Line(h, func(start, end int) {
		for y := start; y < end; y++ {
			for x := 0; x < w; x++ {
				bgPos := y*bgSrc.Stride + x*4
				fgPos := y*fgSrc.Stride + x*4
				result := fn(
					fcolor.NewRGBAF64(bgSrc.Pix[bgPos+0], bgSrc.Pix[bgPos+1], bgSrc.Pix[bgPos+2], bgSrc.Pix[bgPos+3]),
					fcolor.NewRGBAF64(fgSrc.Pix[fgPos+0], fgSrc.Pix[fgPos+1], fgSrc.Pix[fgPos+2], fgSrc.Pix[fgPos+3]))

				result.Clamp()
				dstPos := y*dst.Stride + x*4
				dst.Pix[dstPos+0] = uint8(result.R * 255)
				dst.Pix[dstPos+1] = uint8(result.G * 255)
				dst.Pix[dstPos+2] = uint8(result.B * 255)
				dst.Pix[dstPos+3] = uint8(result.A * 255)
			}

		}
	})

	return dst
}
1122829
func NewWindowsLcowDiff(store content.Store) (CompareApplier, error) {
	return windowsLcowDiff{
		store: store,
	}, nil
}
610436
func (g *Grid) Focus(delegate func(p Primitive)) {
	for _, item := range g.items {
		if item.Focus {
			delegate(item.Item)
			return
		}
	}
	g.hasFocus = true
}
52603
func (window *Window) WarpMouseInWindow(x, y int32) {
	C.SDL_WarpMouseInWindow(window.cptr(), C.int(x), C.int(y))
}
733811
func (self *Commands) Focus(selector dom.Selector) (*dom.Element, error) {
	if elements, err := self.Select(selector, nil); err == nil && len(elements) == 1 {
		if _, err := self.browser.Tab().Evaluate(fmt.Sprintf(
			"document.querySelector(%q).focus()",
			selector,
		)); err == nil {
			return elements[0], nil
		} else {
			return nil, err
		}
	} else if l := len(elements); l > 1 {
		return nil, dom.TooManyMatchesErr(selector, 1, l)
	} else {
		return nil, err
	}
}
75440
func (d *compressor) fillBlock(b []byte) int {
	n := copy(d.window[d.windowEnd:], b)
	d.windowEnd += n
	return n
}
983254
func (w *Window) Focused() bool {
	var focused bool
	mainthread.Call(func() {
		focused = w.window.GetAttrib(glfw.Focused) == glfw.True
	})
	return focused
}
14171
func (f *imdctFilter) filter(input, output []float32, typ int) {
	copy(output, f[18:])

	if typ != 2 {
		imdct36(input, f[:])
		for t := 0; t < 36; t++ {
			f[t] *= mdctWindows[typ][t]
		}
	} else {
		var wInput [6]float32
		var wOutput [12]float32
		for t := 0; t < 36; t++ {
			f[t] = 0
		}
		for w := 0; w < 3; w++ {
			for f := 0; f < 6; f++ {
				wInput[f] = input[3*f+w]
			}
			imdct12(wInput[:], wOutput[:])
			for t := 0; t < 12; t++ {
				f[6+6*w+t] += mdctWindows[2][t] * wOutput[t]
			}
		}
	}

	for i := 0; i < 18; i++ {
		output[i] += f[i]
	}
}
180241
func (d *DropDown) Focus(delegate func(p Primitive)) {
	d.Box.Focus(delegate)
	if d.open {
		delegate(d.list)
	}
}
1139631
func (a *Application) GetFocus() Primitive {
	a.RLock()
	defer a.RUnlock()
	return a.focus
}
525041
func (d *compressor) fillWindow(b []byte) {
	// Do not fill window if we are in store-only mode,
	// use constant or Snappy compression.
	switch d.compressionLevel.level {
	case 0, 1, 2:
		return
	}
	// If we are given too much, cut it.
	if len(b) > windowSize {
		b = b[len(b)-windowSize:]
	}
	// Add all to window.
	n := copy(d.window[d.windowEnd:], b)

	// Calculate 256 hashes at the time (more L1 cache hits)
	loops := (n + 256 - minMatchLength) / 256
	for j := 0; j < loops; j++ {
		startindex := j * 256
		end := startindex + 256 + minMatchLength - 1
		if end > n {
			end = n
		}
		tocheck := d.window[startindex:end]
		dstSize := len(tocheck) - minMatchLength + 1

		if dstSize <= 0 {
			continue
		}

		dst := d.hashMatch[:dstSize]
		d.bulkHasher(tocheck, dst)
		var newH uint32
		for i, val := range dst {
			di := i + startindex
			newH = val & hashMask
			// Get previous value with the same hash.
			// Our chain should point to the previous value.
			d.hashPrev[di&windowMask] = d.hashHead[newH]
			// Set the head of the hash chain to us.
			d.hashHead[newH] = uint32(di + d.hashOffset)
		}
		d.hash = newH
	}
	// Update window information.
	d.windowEnd += n
	d.index = n
}
1656
func (w *Window) Geometry() (xrect.Rect, error) {
	geom, err := RawGeometry(w.X, xproto.Drawable(w.Id))
	if err != nil {
		return nil, err
	}
	w.Geom = geom
	return geom, err
}
1305891
func (w *Window) GetX11Window() C.Window {
	ret := C.glfwGetX11Window(w.data)
	panicError()
	return ret
}
291262
func NewWindow(options WindowOptions) *window.Window {
	return window.NewWindow(window.Options(options))
}
1355943
func Focus(t *testing.T, text string, f func(*testing.T, G, S), opts ...Option) bool {
	t.Helper()
	return Run(t, text, f, append(opts, func(c *config) { c.focus = true })...)
}