示例#1
0
文件: curses.go 项目: infokiller/fzf
func (w *Window) CFill(str string, fg int, bg int, a Attr) bool {
	attr := _color(PairFor(fg, bg), a)
	C.wattron(w.win, attr)
	ret := w.Fill(str)
	C.wattroff(w.win, attr)
	return ret
}
示例#2
0
文件: ncurses.go 项目: junegunn/fzf
func (w *CursesWindow) CPrint(color ColorPair, attr Attr, text string) {
	p, a := _colorFn(color, attr)
	C.wcolor_set(w.impl, p, nil)
	C.wattron(w.impl, a)
	w.Print(text)
	C.wattroff(w.impl, a)
	C.wcolor_set(w.impl, 0, nil)
}
示例#3
0
func (w *Window) CPrint(pair ColorPair, attr Attr, text string) {
	p, a := _colorFn(pair, attr)
	C.wcolor_set(w.win(), p, nil)
	C.wattron(w.win(), a)
	w.Print(text)
	C.wattroff(w.win(), a)
	C.wcolor_set(w.win(), 0, nil)
}
示例#4
0
文件: ncurses.go 项目: junegunn/fzf
func (w *CursesWindow) CFill(fg Color, bg Color, attr Attr, str string) FillReturn {
	index := ColorPair{fg, bg, -1}.index()
	C.wcolor_set(w.impl, C.short(index), nil)
	C.wattron(w.impl, C.int(attr))
	ret := w.Fill(str)
	C.wattroff(w.impl, C.int(attr))
	C.wcolor_set(w.impl, 0, nil)
	return ret
}
示例#5
0
func (w *Window) CFill(str string, fg Color, bg Color, attr Attr) bool {
	pair := PairFor(fg, bg)
	C.wcolor_set(w.win(), C.short(pair), nil)
	C.wattron(w.win(), C.int(attr))
	ret := w.Fill(str)
	C.wattroff(w.win(), C.int(attr))
	C.wcolor_set(w.win(), 0, nil)
	return ret
}
示例#6
0
文件: curses.go 项目: infokiller/fzf
func NewWindow(top int, left int, width int, height int, border bool) *Window {
	win := C.newwin(C.int(height), C.int(width), C.int(top), C.int(left))
	if border {
		attr := _color(ColBorder, 0)
		C.wattron(win, attr)
		C.box(win, 0, 0)
		C.wattroff(win, attr)
	}
	return &Window{
		win:    win,
		Top:    top,
		Left:   left,
		Width:  width,
		Height: height,
	}
}
示例#7
0
文件: ncurses.go 项目: junegunn/fzf
func (r *FullscreenRenderer) NewWindow(top int, left int, width int, height int, border bool) Window {
	win := C.newwin(C.int(height), C.int(width), C.int(top), C.int(left))
	if r.theme != nil {
		C.wbkgd(win, C.chtype(C.COLOR_PAIR(C.int(ColNormal.index()))))
	}
	if border {
		pair, attr := _colorFn(ColBorder, 0)
		C.wcolor_set(win, pair, nil)
		C.wattron(win, attr)
		C.box(win, 0, 0)
		C.wattroff(win, attr)
		C.wcolor_set(win, 0, nil)
	}

	return &CursesWindow{
		impl:   win,
		top:    top,
		left:   left,
		width:  width,
		height: height,
	}
}
示例#8
0
func NewWindow(top int, left int, width int, height int, border bool) *Window {
	win := C.newwin(C.int(height), C.int(width), C.int(top), C.int(left))
	if _color {
		C.wbkgd(win, C.chtype(C.COLOR_PAIR(C.int(ColNormal))))
	}
	if border {
		pair, attr := _colorFn(ColBorder, 0)
		C.wcolor_set(win, pair, nil)
		C.wattron(win, attr)
		C.box(win, 0, 0)
		C.wattroff(win, attr)
		C.wcolor_set(win, 0, nil)
	}

	return &Window{
		impl:   (*WindowImpl)(win),
		Top:    top,
		Left:   left,
		Width:  width,
		Height: height,
	}
}
示例#9
0
func (win *Window) AttrOff(flags int32) {
	C.wattroff((*C.WINDOW)(win), C.int(flags))
}
示例#10
0
文件: curses.go 项目: infokiller/fzf
func (w *Window) CPrint(pair int, a Attr, text string) {
	attr := _color(pair, a)
	C.wattron(w.win, attr)
	w.Print(text)
	C.wattroff(w.win, attr)
}
示例#11
0
文件: curses.go 项目: zozor/gocurse
//Attributes
func (w *Window) Attroff(attrs int) error {
	if C.wattroff(w.win, C.int(attrs)) == ERR {
		return Error
	}
	return nil
}
示例#12
0
func (window *Window) Attroff(attr int) {
	C.wattroff(window.cwin, C.int(attr))
}
示例#13
0
/* Turns an attribute off */
func (w *Window) AttrOff(attr int) {
	C.wattroff((*C.WINDOW)(w), C.int(attr))
}
示例#14
0
文件: curses.go 项目: kablamo/yadm
func (w *Window) CPrint(pair int, bold bool, text string) {
	attr := _color(pair, bold)
	C.wattron(w.win, attr)
	w.Print(text)
	C.wattroff(w.win, attr)
}