Ejemplo n.º 1
0
void xf_sw_begin_paint(rdpUpdate* update)
{
	GDI* gdi;
	gdi = GET_GDI(update);
	gdi->primary->hdc->hwnd->invalid->null = 1;
	gdi->primary->hdc->hwnd->ninvalid = 0;
}
Ejemplo n.º 2
0
int
dfb_post_connect(rdpInst * inst)
{
	GDI *gdi;
	dfbInfo *dfbi = GET_DFBI(inst);

	gdi_init(inst);
	gdi = GET_GDI(inst);
	
	dfbi->err = DirectFBCreate(&(dfbi->dfb));

	dfbi->dsc.flags = DSDESC_CAPS;
	dfbi->dsc.caps = DSCAPS_PRIMARY;
	dfbi->err = dfbi->dfb->CreateSurface(dfbi->dfb, &(dfbi->dsc), &(dfbi->primary));
	dfbi->err = dfbi->primary->GetSize(dfbi->primary, &(gdi->width), &(gdi->height));
	dfbi->dfb->SetVideoMode(dfbi->dfb, gdi->width, gdi->height, gdi->dstBpp);
	dfbi->dfb->CreateInputEventBuffer(dfbi->dfb, DICAPS_ALL, DFB_TRUE, &(dfbi->event_buffer));
	dfbi->event_buffer->CreateFileDescriptor(dfbi->event_buffer, &(dfbi->read_fds));
	
	dfbi->dfb->GetDisplayLayer(dfbi->dfb, 0, &(dfbi->layer));
	dfbi->layer->EnableCursor(dfbi->layer, 1);
	
	dfbi->dsc.flags = DSDESC_CAPS | DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PREALLOCATED | DSDESC_PIXELFORMAT;
	dfbi->dsc.caps = DSCAPS_SYSTEMONLY;
	dfbi->dsc.width = gdi->width;
	dfbi->dsc.height = gdi->height;
	dfbi->dsc.pixelformat = DSPF_AiRGB;
	dfbi->dsc.preallocated[0].data = gdi->primary_buffer;
	dfbi->dsc.preallocated[0].pitch = gdi->width * 4;
	dfbi->dfb->CreateSurface(dfbi->dfb, &(dfbi->dsc), &(dfbi->surface));

	return 0;
}
Ejemplo n.º 3
0
static void
l_ui_move_pointer(struct rdp_inst * inst, int x, int y)
{
	GDI *gdi = GET_GDI(inst);

	gdi->cursor_x = x;
	gdi->cursor_y = y;
	
	inst->rdp_send_input(inst, RDP_INPUT_MOUSE, PTRFLAGS_MOVE, x, y);
}
Ejemplo n.º 4
0
void tf_end_paint(rdpUpdate* update)
{
	GDI* gdi;
	tfInfo* tfi;

	gdi = GET_GDI(update);
	tfi = GET_TFI(update);

	if (gdi->primary->hdc->hwnd->invalid->null)
		return;
}
Ejemplo n.º 5
0
void test_gdi_init(void)
{
	CU_ASSERT(gdi_init(inst) == 0);

	gdi = GET_GDI(inst);
	CU_ASSERT(gdi != NULL);

	CU_ASSERT(gdi->width == test_width);
	CU_ASSERT(gdi->height == test_height);
	CU_ASSERT(gdi->srcBpp == test_depth);
}
Ejemplo n.º 6
0
static void
l_ui_end_update(struct rdp_inst * inst)
{
	dfbInfo *dfbi = GET_DFBI(inst);
	GDI *gdi = GET_GDI(inst);
	
	if (gdi->primary->hdc->hwnd->invalid->null)
		return;
	
	dfbi->update_rect.x = gdi->primary->hdc->hwnd->invalid->x;
	dfbi->update_rect.y = gdi->primary->hdc->hwnd->invalid->y;
	dfbi->update_rect.w = gdi->primary->hdc->hwnd->invalid->w;
	dfbi->update_rect.h = gdi->primary->hdc->hwnd->invalid->h;
	
	dfbi->primary->Blit(dfbi->primary, dfbi->surface, &(dfbi->update_rect), dfbi->update_rect.x, dfbi->update_rect.y);
	gdi->primary->hdc->hwnd->invalid->null = 1;
}
Ejemplo n.º 7
0
boolean tf_post_connect(freerdp* instance)
{
	GDI* gdi;
	tfInfo* tfi;

	tfi = GET_TFI(instance);
	SET_TFI(instance->update, tfi);

	gdi_init(instance, CLRCONV_ALPHA | CLRBUF_16BPP | CLRBUF_32BPP);
	gdi = GET_GDI(instance->update);

	instance->update->BeginPaint = tf_begin_paint;
	instance->update->EndPaint = tf_end_paint;

	freerdp_chanman_post_connect(GET_CHANMAN(instance), instance);

	return True;
}
Ejemplo n.º 8
0
void xf_desktop_resize(rdpUpdate* update)
{
	GDI* gdi;
	xfInfo* xfi;
	boolean same;
	rdpSettings* settings;

	xfi = GET_XFI(update);
	gdi = GET_GDI(update);
	settings = xfi->instance->settings;

	if (!xfi->fullscreen)
	{
		xfi->width = settings->width;
		xfi->height = settings->height;

		if (xfi->window)
			xf_ResizeDesktopWindow(xfi, xfi->window, settings->width, settings->height);

		if (xfi->primary)
		{
			same = (xfi->primary == xfi->drawing ? True : False);
			XFreePixmap(xfi->display, xfi->primary);
			xfi->primary = XCreatePixmap(xfi->display, DefaultRootWindow(xfi->display),
				xfi->width, xfi->height, xfi->depth);
			if (same)
				xfi->drawing = xfi->primary;
		}

		if (gdi)
			gdi_resize(gdi, xfi->width, xfi->height);

		if (gdi && xfi->image)
		{
			xfi->image->data = NULL;
			XDestroyImage(xfi->image);
			xfi->image = XCreateImage(xfi->display, xfi->visual, xfi->depth, ZPixmap, 0,
					(char*) gdi->primary_buffer, gdi->width, gdi->height, xfi->scanline_pad, 0);
		}
	}
}
Ejemplo n.º 9
0
void xf_sw_desktop_resize(rdpUpdate* update)
{
	xfInfo* xfi;
	rdpSettings* settings;

	xfi = GET_XFI(update);
	settings = xfi->instance->settings;

	if (xfi->fullscreen != True)
	{
		GDI* gdi = GET_GDI(update);
		gdi_resize(gdi, xfi->width, xfi->height);

		if (xfi->image)
		{
			xfi->image->data = NULL;
			XDestroyImage(xfi->image);
			xfi->image = XCreateImage(xfi->display, xfi->visual, xfi->depth, ZPixmap, 0,
					(char*) gdi->primary_buffer, gdi->width, gdi->height, xfi->scanline_pad, 0);
		}
	}
}
Ejemplo n.º 10
0
void xf_end_paint(rdpUpdate* update)
{
	GDI* gdi;
	xfInfo* xfi;
	sint32 x, y;
	uint32 w, h;

	gdi = GET_GDI(update);
	xfi = GET_XFI(update);

	if (gdi->primary->hdc->hwnd->invalid->null)
		return;

	x = gdi->primary->hdc->hwnd->invalid->x;
	y = gdi->primary->hdc->hwnd->invalid->y;
	w = gdi->primary->hdc->hwnd->invalid->w;
	h = gdi->primary->hdc->hwnd->invalid->h;

	XPutImage(xfi->display, xfi->primary, xfi->gc_default, xfi->image, x, y, x, y, w, h);
	XCopyArea(xfi->display, xfi->primary, xfi->window->handle, xfi->gc_default, x, y, w, h, x, y);
	XFlush(xfi->display);
}
Ejemplo n.º 11
0
void xf_sw_end_paint(rdpUpdate* update)
{
	GDI* gdi;
	xfInfo* xfi;
	sint32 x, y;
	uint32 w, h;

	gdi = GET_GDI(update);
	xfi = GET_XFI(update);

	if (xfi->remote_app != True)
	{
		if (xfi->complex_regions != True)
		{
			if (gdi->primary->hdc->hwnd->invalid->null)
				return;

			x = gdi->primary->hdc->hwnd->invalid->x;
			y = gdi->primary->hdc->hwnd->invalid->y;
			w = gdi->primary->hdc->hwnd->invalid->w;
			h = gdi->primary->hdc->hwnd->invalid->h;

			XPutImage(xfi->display, xfi->primary, xfi->gc, xfi->image, x, y, x, y, w, h);
			XCopyArea(xfi->display, xfi->primary, xfi->window->handle, xfi->gc, x, y, w, h, x, y);
		}
		else
		{
			int i;
			int ninvalid;
			HGDI_RGN cinvalid;

			if (gdi->primary->hdc->hwnd->ninvalid < 1)
				return;

			ninvalid = gdi->primary->hdc->hwnd->ninvalid;
			cinvalid = gdi->primary->hdc->hwnd->cinvalid;

			for (i = 0; i < ninvalid; i++)
			{
				x = cinvalid[i].x;
				y = cinvalid[i].y;
				w = cinvalid[i].w;
				h = cinvalid[i].h;

				XPutImage(xfi->display, xfi->primary, xfi->gc, xfi->image, x, y, x, y, w, h);
				XCopyArea(xfi->display, xfi->primary, xfi->window->handle, xfi->gc, x, y, w, h, x, y);
			}

			XFlush(xfi->display);
		}
	}
	else
	{
		if (gdi->primary->hdc->hwnd->invalid->null)
			return;

		x = gdi->primary->hdc->hwnd->invalid->x;
		y = gdi->primary->hdc->hwnd->invalid->y;
		w = gdi->primary->hdc->hwnd->invalid->w;
		h = gdi->primary->hdc->hwnd->invalid->h;

		xf_rail_paint(xfi, update->rail, x, y, x + w - 1, y + h - 1);
	}
}