예제 #1
0
파일: shapedemo.go 프로젝트: Ebiroll/openvg
// imgtest draws images at the corners and center
func imagetest(w, h int) {
	openvg.Start(w, h)
	imgw := 422
	imgh := 238
	fiw := openvg.VGfloat(imgw)
	fih := openvg.VGfloat(imgh)
	fw := openvg.VGfloat(w)
	fh := openvg.VGfloat(h)
	vgzero := openvg.VGfloat(0.0)
	cx := (fw / 2) - (fiw / 2)
	cy := (fh / 2) - (fih / 2)
	ulx := vgzero
	uly := fh - fih
	urx := fw - fiw
	ury := uly
	llx := vgzero
	lly := vgzero
	lrx := urx
	lry := lly
	openvg.Start(w, h)
	openvg.Background(0, 0, 0)
	openvg.Image(cx, cy, imgw, imgh, "desert1.jpg")
	openvg.Image(ulx, uly, imgw, imgh, "desert2.jpg")
	openvg.Image(urx, ury, imgw, imgh, "desert3.jpg")
	openvg.Image(llx, lly, imgw, imgh, "desert4.jpg")
	openvg.Image(lrx, lry, imgw, imgh, "desert5.jpg")
	openvg.End()
}
예제 #2
0
파일: clip.go 프로젝트: Ebiroll/openvg
func main() {
	var cx, cy, cw, ch, midy int
	message := "Now is the time for all good men to come to the aid of the party"

	w, h := openvg.Init()
	var speed openvg.VGfloat = 0.5
	var x openvg.VGfloat = 0
	midy = (h / 2)
	fontsize := w / 50
	cx = 0
	ch = fontsize * 2
	cw = w
	cy = midy - (ch / 2)

	rx, ry, rw, rh := openvg.VGfloat(cx), openvg.VGfloat(cy), openvg.VGfloat(cw), openvg.VGfloat(ch)
	// scroll the text, only in the clipping rectangle
	for x = 0; x < rw+speed; x += speed {
		openvg.Start(w, h)
		openvg.Background(255, 255, 255)
		openvg.FillRGB(0, 0, 0, .2)
		openvg.Rect(rx, ry, rw, rh)
		openvg.ClipRect(cx, cy, cw, ch)
		openvg.Translate(x, ry+openvg.VGfloat(fontsize/2))
		openvg.FillRGB(0, 0, 0, 1)
		openvg.Text(0, 0, message, "sans", fontsize)
		openvg.ClipEnd()
		openvg.End()
	}
	bufio.NewReader(os.Stdin).ReadBytes('\n')
	openvg.Finish()
	os.Exit(0)
}
예제 #3
0
파일: bubtrail.go 프로젝트: Ebiroll/openvg
func main() {
	var color string
	openvg.Start(width, height)
	openvg.Background(200, 200, 200)
	for i := 0; i < niter; i++ {
		x := random(0, width)
		y := random(height/3, (height*2)/3)
		r := random(0, 10000)
		switch {
		case r >= 0 && r <= 2500:
			color = "white"
		case r > 2500 && r <= 5000:
			color = "maroon"
		case r > 5000 && r <= 7500:
			color = "gray"
		case r > 7500 && r <= 10000:
			color = "black"
		}
		openvg.FillColor(color, openvg.VGfloat(opacity))
		openvg.Circle(openvg.VGfloat(x), openvg.VGfloat(y), openvg.VGfloat(size))
	}
	openvg.End()
	bufio.NewReader(os.Stdin).ReadByte()
	openvg.Finish()
}
예제 #4
0
파일: particles.go 프로젝트: Ebiroll/openvg
func paintBG(w, h openvg.VGfloat) {
	if !showTrails {
		openvg.Background(0, 0, 0)
		return
	}
	openvg.FillRGB(0, 0, 0, 0.3)
	openvg.Rect(0, 0, w, h)
}
예제 #5
0
파일: shapedemo.go 프로젝트: Ebiroll/openvg
// raspberry pi, scaled to the screen dimensions
func raspi(w, h int, s string) {
	midx := openvg.VGfloat(w) / 2
	midy := openvg.VGfloat(h) / 2
	rw := midx
	rh := (rw * 2) / 3
	fontsize := w / 25
	openvg.Start(w, h)
	openvg.Background(255, 255, 255)
	makepi(midx-(rw/2), midy-(rh/2), rw, rh)
	openvg.FillRGB(128, 0, 0, 1)
	openvg.TextMid(midx, midy-(rh/2)-openvg.VGfloat(fontsize*2), s, "sans", fontsize)
	openvg.End()
}
예제 #6
0
파일: raspi.go 프로젝트: Ebiroll/openvg
// raspberry pi, scaled to the screen dimensions
func main() {
	w, h := openvg.Init()
	midx := openvg.VGfloat(w) / 2
	midy := openvg.VGfloat(h) / 2
	rw := midx
	rh := (rw * 2) / 3
	fontsize := w / 25
	openvg.Start(w, h)
	openvg.Background(255, 255, 255)
	makepi(midx-(rw/2), midy-(rh/2), rw, rh)
	makepi(200, 100, 75, 50)
	openvg.FillRGB(128, 0, 0, 1)
	openvg.TextMid(midx, midy-(rh/2)-openvg.VGfloat(fontsize*2), "The Raspberry Pi", "sans", fontsize)
	WaitEnd()
}
예제 #7
0
파일: shapedemo.go 프로젝트: Ebiroll/openvg
// rotext draws text, rotated around the center of the screen, progressively faded
func rotext(w, h, n int, s string) {
	fade := (100.0 / openvg.VGfloat(n)) / 100.0
	deg := 360.0 / openvg.VGfloat(n)
	x := openvg.VGfloat(w) / 2.0
	y := openvg.VGfloat(h) / 2.0
	alpha := openvg.VGfloat(1.0)
	size := w / 8

	openvg.Start(w, h)
	openvg.Background(0, 0, 0)
	openvg.Translate(x, y)
	for i := 0; i < n; i++ {
		openvg.FillRGB(255, 255, 255, alpha)
		openvg.Text(0, 0, s, "serif", size)
		alpha -= fade // fade
		size += n     // enlarge
		openvg.Rotate(deg)
	}
	openvg.End()
}
예제 #8
0
파일: shapedemo.go 프로젝트: Ebiroll/openvg
// fontrange shows a range of fonts
func fontrange(w, h int) {
	var x, lx, length openvg.VGfloat
	y := openvg.VGfloat(h) / 2.0
	w2 := openvg.VGfloat(w) / 2.0
	spacing := openvg.VGfloat(50.0)
	s2 := spacing / 2.0
	sizes := []int{6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 21, 24, 36, 48, 60, 72, 96}

	openvg.Start(w, h)
	openvg.Background(255, 255, 255)

	// compute the length so we can center
	length = 0.0
	for _, s := range sizes {
		length += openvg.VGfloat(s) + spacing
	}
	length -= spacing
	lx = w2 - (length / 2) // center point

	// for each size, display a character and label
	x = lx
	for _, s := range sizes {
		openvg.FillRGB(128, 0, 0, 1)
		openvg.TextMid(x, y, "a", "serif", s)
		openvg.FillRGB(128, 128, 128, 1)
		openvg.TextMid(x, y-spacing, fmt.Sprintf("%d", s), "sans", 16)
		x += openvg.VGfloat(s) + spacing
	}
	// draw a openvg.Line below the characters, a curve above
	x -= spacing
	openvg.StrokeRGB(150, 150, 150, 0.5)
	openvg.StrokeWidth(2)
	openvg.Line(lx, y-s2, x, y-s2)
	openvg.FillRGB(255, 255, 255, 1)
	openvg.Qbezier(lx, y+s2, x, y+s2, x, y+(spacing*3))
	openvg.End()
}
예제 #9
0
파일: sl.go 프로젝트: Ebiroll/openvg
func main() {
	var sreenHeight, cx, cy, cw, ch, midy int
	message := "Scrolling texts could be useful if the information does not fit on screen"

	w, h := openvg.Init()
	sreenHeight = h
	var speed openvg.VGfloat = 0.5
	var x openvg.VGfloat = 0
	midy = (h / 2)
	fontsize := w / 50
	cx = 0
	ch = fontsize * 2
	cw = w
	cy = midy - (ch / 2)
	var jsonData SLData

	for {
		response, err := http.Get("http://localhost:8000")

		if err == nil {
			defer response.Body.Close()
			contents, err := ioutil.ReadAll(response.Body)
			if err != nil {
				fmt.Printf("Error reading http data, %s", err)
			} else {
				fmt.Printf("Got: %s\n", string(contents))
				if err := json.Unmarshal(contents, &jsonData); err != nil {
					panic(err)
				}
				fmt.Println(jsonData)
			}
		}

		openvg.Start(w, h)
		imgw, imgh := 0, 0
		openvg.Background(255, 255, 255)

		//SLHeight = 60
		var imgPosY = openvg.VGfloat(sreenHeight - 70)
		openvg.Image(4, imgPosY, imgw, imgh, "SL.jpg")

		var TAB1 = openvg.VGfloat(4 * w / 20)
		var TAB2 = openvg.VGfloat(8 * w / 20)

		rx1, rw1, rh1 := openvg.VGfloat(cx), openvg.VGfloat(cw), openvg.VGfloat(ch)
		ty := 0
		rix := 0

		// Buses
		for ty = sreenHeight - (80 + int(rh1)); ty > 0 && rix < len(jsonData.ResponseData.Buses); ty -= ch {
			tempy := openvg.VGfloat(ty)
			//ry := openvg.VGfloat(ty)
			if rix%2 == 0 {
				openvg.FillRGB(0, 0, 0, .2)
				//openvg.Rect(rx1, tempy, rw1, rh1)
				openvg.FillRGB(0, 0, 0, 1)
				tempy = tempy + 6.0
			} else {
				openvg.FillRGB(0, 0, 0, .4)
				openvg.Rect(rx1, tempy, rw1, rh1)
				tempy = tempy + 6.0
				openvg.FillRGB(0, 0, 0, 1)
			}
			openvg.Text(rx1, tempy, jsonData.ResponseData.Buses[rix].LineNumber, "sans", fontsize)
			drawTypeOfTransport(rx1+60, tempy+2, rw1, ch-20, jsonData.ResponseData.Buses[rix].TransportMode)

			openvg.Text(rx1+100, tempy, jsonData.ResponseData.Buses[rix].StopPointDesignation, "sans", fontsize)
			openvg.Text(rx1+TAB1, tempy, jsonData.ResponseData.Buses[rix].DisplayTime, "sans", fontsize)
			var dest = jsonData.ResponseData.Buses[rix].Destination
			dest = replaceAO(dest)
			openvg.Text(rx1+TAB2, tempy, dest, "sans", fontsize)

			//openvg.Translate(x, ry+openvg.VGfloat(fontsize/2))
			//openvg.Background(255,255,0)
			rix = rix + 1
		}
		var trainIx = 0
		for ty = ty - 20; ty > 0 && trainIx < len(jsonData.ResponseData.Trains); ty -= ch {
			tempy := openvg.VGfloat(ty)
			//ry := openvg.VGfloat(ty)
			if rix%2 == 0 {
				openvg.FillRGB(0, 0, 0, .2)
				//openvg.Rect(rx1, tempy, rw1, rh1)
				openvg.FillRGB(0, 0, 0, 1)
				tempy = tempy + 6.0
			} else {
				openvg.FillRGB(0, 0, 0, .4)
				openvg.Rect(rx1, tempy, rw1, rh1)
				tempy = tempy + 6.0
				openvg.FillRGB(0, 0, 0, 1)
			}
			openvg.Text(rx1, tempy, jsonData.ResponseData.Trains[trainIx].LineNumber, "sans", fontsize)
			drawTypeOfTransport(rx1+55, tempy+4, rw1, ch-20, jsonData.ResponseData.Trains[trainIx].TransportMode)
			openvg.Text(rx1+TAB1, tempy, jsonData.ResponseData.Trains[trainIx].DisplayTime, "sans", fontsize)
			var dest = jsonData.ResponseData.Trains[trainIx].Destination
			dest = replaceAO(dest)
			openvg.Text(rx1+TAB2, tempy, dest, "sans", fontsize)

			//openvg.Translate(x, ry+openvg.VGfloat(fontsize/2))
			//openvg.Background(255,255,0)
			trainIx = trainIx + 1
			rix = rix + 1
		}

		//openvg.End()
		openvg.SaveEnd("dump.raw")

		time.Sleep(60 * time.Second)
	}

	bufio.NewReader(os.Stdin).ReadBytes('\n')

	rx, ry, rw, rh := openvg.VGfloat(cx), openvg.VGfloat(cy), openvg.VGfloat(cw), openvg.VGfloat(ch)
	// scroll the text, only in the clipping rectangle
	for x = 0; x < rw+speed; x += speed {
		openvg.Start(w, h)
		openvg.Background(255, 255, 255)
		openvg.FillRGB(0, 0, 0, .2)
		openvg.Rect(rx, ry, rw, rh)
		openvg.ClipRect(cx, cy, cw, ch)
		openvg.Translate(x, ry+openvg.VGfloat(fontsize/2))
		openvg.FillRGB(0, 0, 0, 1)
		openvg.Text(0, 0, message, "sans", fontsize)
		openvg.ClipEnd()
		openvg.End()
	}
	bufio.NewReader(os.Stdin).ReadBytes('\n')
	openvg.Finish()
	os.Exit(0)
}
예제 #10
0
파일: halloween.go 프로젝트: Ebiroll/openvg
func main() {
	var cy, ch, midy int
	var message []string
	message = []string{" Black", "cats", "skitter", "and", "ghouls", "patter", "Happy", "Halloween"}

	w, h := openvg.Init()
	//var speed openvg.VGfloat = 0.5
	var x openvg.VGfloat = 0
	var vw, vh openvg.VGfloat
	var midxx openvg.VGfloat = openvg.VGfloat(w / 2)
	midy = (h / 2)
	fontsize := w / 8
	//cx = 0
	ch = fontsize * 2
	//cw = w
	cy = midy - (ch / 2)
	var redness uint8
	var index int

	//rx , rw, rh := openvg.VGfloat(cx) , openvg.VGfloat(cw), openvg.VGfloat(ch)
	ry := openvg.VGfloat(cy)
	// scroll the text, only in the clipping rectangle
	index = 0
	for {
		for redness = 255; redness > 16; redness -= 2 {

			ch = fontsize * 2
			//cw = w
			cy = midy - (ch / 2)
			openvg.Start(w, h)
			openvg.Background(redness, 0, 0)
			openvg.FillRGB(0, 0, 0, .2)
			//openvg.Rect(rx, ry, rw, rh)
			//openvg.ClipRect(cx, cy, cw, ch)
			openvg.Translate(x, ry+openvg.VGfloat(fontsize/2))
			openvg.FillRGB(0, 0, 0, 1)
			var fsiz int
			fsiz = int(255 - redness)
			openvg.TextMid(midxx, 0, message[index], "shf", fsiz)
			openvg.ClipEnd()
			openvg.End()
		}
		index = (index + 1) % 8
		if index == 0 {
			vw = openvg.VGfloat(w) - 200
			vh = openvg.VGfloat(h) - 200
			openvg.Video(100.0, 100.0, vw, vh, "test.h264")
		}
		if index == 0 {
			var test, oix int
			var xpos [40]float32
			var ypos [40]float32
			var rotate [40]float32
			var spdx [40]float32
			var spdy [40]float32

			// Init positions
			for test = 0; test < 40; test++ {
				var rot = rand.Float32()
				var rax = rand.Float32()
				rax = float32(w) * rax
				var ray = rand.Float32()
				ray = float32(h) * ray

				spdx[test] = float32(test) * rand.Float32()
				spdy[test] = float32(test) * rand.Float32()

				ypos[test] = ray
				xpos[test] = rax
				rot = 0
				rotate[test] = rot

			}

			// Move around
			for oix = 0; oix < 100; oix++ {
				openvg.Start(w, h)
				openvg.Background(0, 0, 0)
				openvg.FillColor("red")

				for test = 0; test < 40; test++ {
					var rot = rand.Float32()
					var rax = rand.Float32()*float32(4.0) - float32(2.0)
					var ray = float32(4.0)*rand.Float32() - float32(2.0)

					spdy[test] += ray
					spdx[test] += rax

					xpos[test] = xpos[test] + spdx[test]
					ypos[test] = ypos[test] + spdy[test]
					rotate[test] = rotate[test] + float32(rot*4-2)

					openvg.Rotate(openvg.VGfloat(rotate[test]))
					openvg.Translate(openvg.VGfloat(xpos[test]), openvg.VGfloat(ypos[test]))

					openvg.TextMid(0, 0, "Happy Halloween", "shf", 30)

					openvg.Translate(-openvg.VGfloat(xpos[test]), -openvg.VGfloat(ypos[test]))
					openvg.Rotate(-openvg.VGfloat(rotate[test]))

				}
				openvg.End()
			}

		}
	}
	bufio.NewReader(os.Stdin).ReadBytes('\n')
	openvg.Finish()
	os.Exit(0)
}
예제 #11
0
파일: viwer.go 프로젝트: Ebiroll/openvg
func main() {
	var sreenHeight, cx, cy, cw, ch int
	message := "Hej Sandra tack forden mysiga kramen ..... <3 <3 Puss puss"
	w, h := openvg.Init()
	sreenHeight = h
	var speed openvg.VGfloat = 4.0
	var x openvg.VGfloat = 0
	//midy = (h / 2)
	fontsize := w / 50
	cx = 0
	ch = fontsize * 2
	cw = w
	//cy = midy - (ch / 2)
	cy = h - 80
	var jsonData SLData
	var lastmill = makeTimestamp()

	response, err := http.Get("http://localhost:8000")

	if err == nil {
		defer response.Body.Close()
		contents, err := ioutil.ReadAll(response.Body)
		if err != nil {
			fmt.Printf("Error reading http data, %s", err)
		} else {
			fmt.Printf("Got: %s\n", string(contents))
			if err := json.Unmarshal(contents, &jsonData); err != nil {
				panic(err)
			}
			fmt.Println(jsonData)
		}
	}

	openvg.Start(w, h)
	openvg.End()
	go PlayVideo(w, h)

	for {

		openvg.Start(w, h)
		//fmt.Println("W,H",w,h)

		rx, ry, rw, rh := openvg.VGfloat(cx), openvg.VGfloat(cy), openvg.VGfloat(cw), openvg.VGfloat(ch)
		// scroll the text, only in the clipping rectangle

		for x = 0; x < rw+speed; x += speed {

			var mill = makeTimestamp()
			var delta = (mill - lastmill) / 5
			//fmt.Println("delta ", delta)
			//speed

			x = openvg.VGfloat(delta)

			imgw, imgh := 0, 0
			openvg.Background(0, 0, 0)

			//SLHeight = 60
			var imgPosY = openvg.VGfloat(sreenHeight - 120)
			openvg.Image(8, imgPosY, imgw, imgh, "DA4FID.png")

			var TAB1 = openvg.VGfloat(4 * w / 20)
			//var TAB2 = openvg.VGfloat(8*w/20)

			rx1, rw1, rh1 := openvg.VGfloat(cx), openvg.VGfloat(cw), openvg.VGfloat(ch)
			ty := 0
			rix := 0

			// - (120 + int(rh1))
			ty = sreenHeight - 140

			var trainIx = 0
			for ty = ty - 20; ty > 0 && trainIx < len(jsonData.ResponseData.Trains); ty -= ch {
				tempy := openvg.VGfloat(ty)
				//ry := openvg.VGfloat(ty)
				if rix%2 == 0 {
					openvg.FillRGB(255, 255, 255, .2)
					//openvg.Rect(rx1, tempy, rw1, rh1)
					tempy = tempy + 6.0
				} else {
					openvg.FillRGB(255, 255, 255, .4)
					openvg.Rect(rx1, tempy, rw1/3, rh1)
					tempy = tempy + 6.0
				}
				openvg.FillRGB(255, 255, 255, 1)
				//openvg.Text(rx1, tempy, jsonData.ResponseData.Trains[trainIx].LineNumber , "sans", fontsize)
				//drawTypeOfTransport(rx1+55,tempy+4,rw1,ch-20,jsonData.ResponseData.Trains[trainIx].TransportMode)
				openvg.Text(rx1, tempy, jsonData.ResponseData.Trains[trainIx].DisplayTime, "sans", fontsize)
				var dest = jsonData.ResponseData.Trains[trainIx].Destination
				dest = replaceAO(dest)
				openvg.Text(rx1+TAB1, tempy, dest, "sans", fontsize)

				//openvg.Translate(x, ry+openvg.VGfloat(fontsize/2))
				//openvg.Background(255,255,0)
				trainIx = trainIx + 1
				rix = rix + 1
			}

			imgw = 20
			imgh = 20

			//openvg.Image(8, 100 , imgw, imgh, "no_smoking.png")

			// openvg.Start(w, h)
			//openvg.Background(255, 255, 255)
			openvg.FillRGB(100, 0, 0, 1)
			openvg.Rect(rx, ry, rw, rh)
			//openvg.ClipRect(cx, cy, cw, ch)
			//openvg.Translate(x, ry+openvg.VGfloat(fontsize/2))
			openvg.FillRGB(255, 255, 255, 1)
			var pxp openvg.VGfloat = openvg.VGfloat(w) - openvg.VGfloat(x)
			var pyp openvg.VGfloat = openvg.VGfloat(h) - openvg.VGfloat(58)
			openvg.Text(pxp, pyp, message, "sans", fontsize)
			//openvg.ClipEnd()
			openvg.End()
		}

		//openvg.SaveEnd("dump.raw")

		//time.Sleep(60*time.Second);
	}

	bufio.NewReader(os.Stdin).ReadBytes('\n')

	bufio.NewReader(os.Stdin).ReadBytes('\n')
	openvg.Finish()
	os.Exit(0)
}
예제 #12
0
파일: xmlview.go 프로젝트: Ebiroll/openvg
// interact controls the display of the deck
func interact(filename, searchterm string, w, h, slidenum int, gp float64) {
	openvg.SaveTerm()
	defer openvg.RestoreTerm()
	var d deck.Deck
	var err error
	d, err = deck.Read(filename, w, h)
	if err != nil {
		fmt.Fprintf(os.Stderr, "%v\n", err)
		return
	}
	openvg.RawTerm()
	r := bufio.NewReader(os.Stdin)
	lastslide := len(d.Slide) - 1
	if slidenum > lastslide {
		slidenum = lastslide
	}
	if slidenum < 0 {
		slidenum = 0
	}
	if len(searchterm) > 0 {
		sr := deck.Search(d, searchterm)
		if sr >= 0 {
			slidenum = sr
		}
	}
	n := slidenum
	xray := 1
	initial := 0
	imap := make(map[string]image.Image)
	// respond to keyboard commands, 'q' to exit
	for cmd := byte('0'); cmd != 'q'; cmd = readcmd(r) {
		switch cmd {
		// read/reload
		case 'r', 18: // r, Ctrl-R
			d, err = deck.Read(filename, w, h)
			if err != nil {
				fmt.Fprintf(os.Stderr, "%v\n", err)
				return
			}
			loadimage(d, imap)
			openvg.Background(0, 0, 0)
			xray = 1
			showslide(d, imap, n)

		// save slide
		case 's', 19: // s, Ctrl-S
			openvg.SaveEnd(fmt.Sprintf("%s-slide-%04d", filename, n))

		// first slide
		case '0', '1', 1, '^': // 0,1,Ctrl-A,^
			initial++
			if initial == 1 {
				loadimage(d, imap)
				n = slidenum
			} else {
				n = 0
			}
			showslide(d, imap, n)

		// last slide
		case '*', 5, '$': // *, Crtl-E, $
			n = lastslide
			showslide(d, imap, n)

		// next slide
		case '+', 'n', '\n', ' ', '\t', '=', 14: // +,n,newline,space,tab,equal,Crtl-N
			n++
			if n > lastslide {
				n = 0
			}
			showslide(d, imap, n)

		// previous slide
		case '-', 'p', 8, 16, 127: // -,p,Backspace,Ctrl-P,Del
			n--
			if n < 0 {
				n = lastslide
			}
			showslide(d, imap, n)

		// x-ray
		case 'x', 24: // x, Ctrl-X
			xray++
			showslide(d, imap, n)
			if xray%2 == 0 {
				showgrid(d, n, gp)
			}
		// Escape sequence from remotes
		case 27:
			remote, rerr := r.ReadString('~')
			if len(remote) > 2 && rerr == nil {
				switch remote[1] {
				case '3': // blank screen
					openvg.Start(d.Canvas.Width, d.Canvas.Height)
					openvg.FillColor("black")
					openvg.Rect(0, 0, openvg.VGfloat(d.Canvas.Width), openvg.VGfloat(d.Canvas.Height))
					openvg.End()

				case '5': // back
					n--
					if n < 0 {
						n = lastslide
					}
					showslide(d, imap, n)
				case '6': // forward
					n++
					if n > lastslide {
						n = 0
					}
					showslide(d, imap, n)
				}
			}
		// search
		case '/', 6: // slash, Ctrl-F
			openvg.RestoreTerm()
			searchterm, serr := r.ReadString('\n')
			openvg.RawTerm()
			if serr != nil {
				continue
			}
			if len(searchterm) > 2 {
				ns := deck.Search(d, searchterm[0:len(searchterm)-1])
				if ns >= 0 {
					showslide(d, imap, ns)
					n = ns
				}
			}
		}
	}
}