Example #1
0
int
vnc_copyrect(struct connection *cx)
{
	uint16_t x, y;

	debug(2, "copyrect\n");

	if (cx->input.wpos < cx->input.rpos + 4)
		return 0;

	x = get16_hilo(&cx->input.data[cx->input.rpos + 0]);
	y = get16_hilo(&cx->input.data[cx->input.rpos + 2]);

	if (cx->wire_stem)
		ggiCopyBox(cx->wire_stem, x, y, cx->w, cx->h, cx->x, cx->y);
	else
		ggiCopyBox(cx->stem, x, y, cx->w, cx->h, cx->x, cx->y);

	--cx->rects;
	cx->input.rpos += 4;

	remove_dead_data(&cx->input);
	cx->action = vnc_update_rect;
	return 1;
}
Example #2
0
static void perf_COPYBOX(TeleUser *u, TeleCmdCopyBoxData *d)
{
	/* Copy a box on-screen */

	if ((d->sx < 0) || (d->sy < 0) ||
	    (d->dx < 0) || (d->dy < 0) ||
	    (d->width <= 0) || (d->height <= 0) ||
	    (d->sx + d->width  > vis_mode.virt.x) ||
	    (d->sy + d->height > vis_mode.virt.y) ||
	    (d->dx + d->width  > vis_mode.virt.x) ||
	    (d->dy + d->height > vis_mode.virt.y))
	{
		fprintf(stderr, "teleserver: ILLEGAL COPYBOX.\n");
		return;
	}	/* if */

	ggiCopyBox(vis, d->sx, d->sy, d->width, d->height, d->dx, d->dy);
}	/* perf_COPYBOX */
Example #3
0
static void animate_one_frame(ggi_visual_t vis, int x, int y, int w, int h,
			      ggi_pixel * buf, int x2)
{

	ggiDrawHLine(vis, x, y, w);
	ggiDrawHLine(vis, x, y + h - 1, w);
	ggiDrawVLine(vis, x, y, h);
	ggiDrawVLine(vis, x + w - 1, y, h);
	ggiDrawBox(vis, x + 2, y + 2, w - 4, h - 4);
	ggiGetBox(vis, x + 5, y + 5, w - 10, h / 2 - 7, buf);
	ggiPutBox(vis, x + 5, y + 5, w - 10, h / 2 - 7, buf);
	ggiCopyBox(vis, x + 5, y + h / 2, w - 10, h / 2 - 5, x + 5,
		   y + h / 2);
	ggiPuts(vis, x + 7, y + 7, "Get/Put");
	ggiPuts(vis, x + 7, y + h / 2 + 2, "Copy");

	ggiDrawBox(vis, x2, y, 5, 5);

}