Ejemplo n.º 1
0
//export primaryScrBlt
func primaryScrBlt(rawContext *C.rdpContext, scrblt *C.SCRBLT_ORDER) {
	context := (*rdpContext)(unsafe.Pointer(rawContext))

	meta := primaryScrBltMeta{
		WSOP_SC_SCRBLT,
		uint32(C.gdi_rop3_code(C.uint8(scrblt.bRop))),
		int32(scrblt.nLeftRect),
		int32(scrblt.nTopRect),
		int32(scrblt.nWidth),
		int32(scrblt.nHeight),
		int32(scrblt.nXSrc),
		int32(scrblt.nYSrc),
	}

	buf := new(bytes.Buffer)
	binary.Write(buf, binary.LittleEndian, meta)
	sendBinary(context.sendq, buf)
}
Ejemplo n.º 2
0
//export primaryPatBlt
func primaryPatBlt(rawContext *C.rdpContext, patblt *C.PATBLT_ORDER) {
	context := (*rdpContext)(unsafe.Pointer(rawContext))

	hclrconv := context.clrconv

	if C.GDI_BS_SOLID == patblt.brush.style {
		meta := primaryPatBltMeta{
			WSOP_SC_PATBLT,
			int32(patblt.nLeftRect),
			int32(patblt.nTopRect),
			int32(patblt.nWidth),
			int32(patblt.nHeight),
			uint32(C.freerdp_color_convert_var(patblt.foreColor, 16, 32, hclrconv)),
			uint32(C.gdi_rop3_code(C.uint8(patblt.bRop))),
		}

		buf := new(bytes.Buffer)
		binary.Write(buf, binary.LittleEndian, meta)
		sendBinary(context.sendq, buf)
	}
}