mirror of https://github.com/FreeRDP/FreeRDP
Completed (almost) System Pointer Update (MS-RDPBCGR 2.2.9.1.1.4.3)
Todo: - Windows client: wf_Pointer_SetNull and wf_Pointer_SetDefault are just skeletons like all the other wf_Pointer functions. - DirectFB client: only df_Pointer_SetNull is implemented and tested
This commit is contained in:
parent
a99e21ad1f
commit
b224126cc7
|
@ -90,18 +90,33 @@ void df_Pointer_Set(rdpContext* context, rdpPointer* pointer)
|
|||
|
||||
dfi->layer->SetCooperativeLevel(dfi->layer, DLSCL_ADMINISTRATIVE);
|
||||
|
||||
result = dfi->layer->SetCursorShape(dfi->layer,
|
||||
dfi->layer->SetCursorOpacity(dfi->layer, df_pointer ? 255: 0);
|
||||
|
||||
if(df_pointer != NULL)
|
||||
{
|
||||
result = dfi->layer->SetCursorShape(dfi->layer,
|
||||
df_pointer->surface, df_pointer->xhot, df_pointer->yhot);
|
||||
|
||||
if (result != DFB_OK)
|
||||
{
|
||||
DirectFBErrorFatal("SetCursorShape Error", result);
|
||||
return;
|
||||
if (result != DFB_OK)
|
||||
{
|
||||
DirectFBErrorFatal("SetCursorShape Error", result);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
dfi->layer->SetCooperativeLevel(dfi->layer, DLSCL_SHARED);
|
||||
}
|
||||
|
||||
void df_Pointer_SetNull(rdpContext* context)
|
||||
{
|
||||
df_Pointer_Set(context, NULL);
|
||||
}
|
||||
|
||||
void df_Pointer_SetDefault(rdpContext* context)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/* Graphics Module */
|
||||
|
||||
void df_register_graphics(rdpGraphics* graphics)
|
||||
|
@ -114,6 +129,8 @@ void df_register_graphics(rdpGraphics* graphics)
|
|||
pointer->New = df_Pointer_New;
|
||||
pointer->Free = df_Pointer_Free;
|
||||
pointer->Set = df_Pointer_Set;
|
||||
pointer->SetNull = df_Pointer_SetNull;
|
||||
pointer->SetDefault = df_Pointer_SetDefault;
|
||||
|
||||
graphics_register_pointer(graphics, pointer);
|
||||
xfree(pointer);
|
||||
|
|
|
@ -216,6 +216,16 @@ void wf_Pointer_Set(rdpContext* context, rdpPointer* pointer)
|
|||
|
||||
}
|
||||
|
||||
void wf_Pointer_SetNull(rdpContext* context)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void wf_Pointer_SetDefault(rdpContext* context)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/* Graphics Module */
|
||||
|
||||
void wf_register_graphics(rdpGraphics* graphics)
|
||||
|
@ -236,6 +246,8 @@ void wf_register_graphics(rdpGraphics* graphics)
|
|||
pointer.New = wf_Pointer_New;
|
||||
pointer.Free = wf_Pointer_Free;
|
||||
pointer.Set = wf_Pointer_Set;
|
||||
pointer.SetNull = wf_Pointer_SetNull;
|
||||
pointer.SetDefault = wf_Pointer_SetDefault;
|
||||
|
||||
graphics_register_bitmap(graphics, &bitmap);
|
||||
graphics_register_pointer(graphics, &pointer);
|
||||
|
|
|
@ -191,6 +191,36 @@ void xf_Pointer_Set(rdpContext* context, rdpPointer* pointer)
|
|||
if (xfi->window != NULL)
|
||||
XDefineCursor(xfi->display, xfi->window->handle, ((xfPointer*) pointer)->cursor);
|
||||
}
|
||||
|
||||
void xf_Pointer_SetNull(rdpContext* context)
|
||||
{
|
||||
xfInfo* xfi = ((xfContext*) context)->xfi;
|
||||
static Cursor nullcursor = None;
|
||||
|
||||
if (nullcursor == None)
|
||||
{
|
||||
XcursorImage ci;
|
||||
XcursorPixel xp = 0;
|
||||
memset(&ci, 0, sizeof(ci));
|
||||
ci.version = XCURSOR_IMAGE_VERSION;
|
||||
ci.size = sizeof(ci);
|
||||
ci.width = ci.height = 1;
|
||||
ci.xhot = ci.yhot = 0;
|
||||
ci.pixels = &xp;
|
||||
nullcursor = XcursorImageLoadCursor(xfi->display, &ci);
|
||||
}
|
||||
if (xfi->window != NULL && nullcursor != None)
|
||||
XDefineCursor(xfi->display, xfi->window->handle, nullcursor);
|
||||
}
|
||||
|
||||
void xf_Pointer_SetDefault(rdpContext* context)
|
||||
{
|
||||
xfInfo* xfi = ((xfContext*) context)->xfi;
|
||||
|
||||
if (xfi->window != NULL)
|
||||
XUndefineCursor(xfi->display, xfi->window->handle);
|
||||
}
|
||||
|
||||
/* Glyph Class */
|
||||
|
||||
void xf_Glyph_New(rdpContext* context, rdpGlyph* glyph)
|
||||
|
@ -302,6 +332,8 @@ void xf_register_graphics(rdpGraphics* graphics)
|
|||
pointer->New = xf_Pointer_New;
|
||||
pointer->Free = xf_Pointer_Free;
|
||||
pointer->Set = xf_Pointer_Set;
|
||||
pointer->SetNull = xf_Pointer_SetNull;
|
||||
pointer->SetDefault = xf_Pointer_SetDefault;
|
||||
|
||||
graphics_register_pointer(graphics, pointer);
|
||||
xfree(pointer);
|
||||
|
|
|
@ -81,6 +81,8 @@ FREERDP_API void Bitmap_SetSurface(rdpContext* context, rdpBitmap* bitmap, boole
|
|||
typedef void (*pPointer_New)(rdpContext* context, rdpPointer* pointer);
|
||||
typedef void (*pPointer_Free)(rdpContext* context, rdpPointer* pointer);
|
||||
typedef void (*pPointer_Set)(rdpContext* context, rdpPointer* pointer);
|
||||
typedef void (*pPointer_SetNull)(rdpContext* context);
|
||||
typedef void (*pPointer_SetDefault)(rdpContext* context);
|
||||
|
||||
struct rdp_pointer
|
||||
{
|
||||
|
@ -88,7 +90,9 @@ struct rdp_pointer
|
|||
pPointer_New New; /* 1 */
|
||||
pPointer_Free Free; /* 2 */
|
||||
pPointer_Set Set; /* 3 */
|
||||
uint32 paddingA[16 - 4]; /* 4 */
|
||||
pPointer_SetNull SetNull; /* 4*/
|
||||
pPointer_SetDefault SetDefault; /* 5 */
|
||||
uint32 paddingA[16 - 6]; /* 6 */
|
||||
|
||||
uint32 xPos; /* 16 */
|
||||
uint32 yPos; /* 17 */
|
||||
|
@ -106,6 +110,8 @@ FREERDP_API rdpPointer* Pointer_Alloc(rdpContext* context);
|
|||
FREERDP_API void Pointer_New(rdpContext* context, rdpPointer* pointer);
|
||||
FREERDP_API void Pointer_Free(rdpContext* context, rdpPointer* pointer);
|
||||
FREERDP_API void Pointer_Set(rdpContext* context, rdpPointer* pointer);
|
||||
FREERDP_API void Pointer_SetNull(rdpContext* context);
|
||||
FREERDP_API void Pointer_SetDefault(rdpContext* context);
|
||||
|
||||
/* Glyph Class */
|
||||
|
||||
|
|
|
@ -29,7 +29,19 @@ void update_pointer_position(rdpContext* context, POINTER_POSITION_UPDATE* point
|
|||
|
||||
void update_pointer_system(rdpContext* context, POINTER_SYSTEM_UPDATE* pointer_system)
|
||||
{
|
||||
switch (pointer_system->type)
|
||||
{
|
||||
case SYSPTR_NULL:
|
||||
Pointer_SetNull(context);
|
||||
break;
|
||||
|
||||
case SYSPTR_DEFAULT:
|
||||
Pointer_SetDefault(context);
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("Unknown system pointer type (0x%08X)\n", pointer_system->type);
|
||||
}
|
||||
}
|
||||
|
||||
void update_pointer_color(rdpContext* context, POINTER_COLOR_UPDATE* pointer_color)
|
||||
|
|
|
@ -128,6 +128,16 @@ void Pointer_Set(rdpContext* context, rdpPointer* pointer)
|
|||
context->graphics->Pointer_Prototype->Set(context, pointer);
|
||||
}
|
||||
|
||||
void Pointer_SetNull(rdpContext* context)
|
||||
{
|
||||
context->graphics->Pointer_Prototype->SetNull(context);
|
||||
}
|
||||
|
||||
void Pointer_SetDefault(rdpContext* context)
|
||||
{
|
||||
context->graphics->Pointer_Prototype->SetDefault(context);
|
||||
}
|
||||
|
||||
void graphics_register_pointer(rdpGraphics* graphics, rdpPointer* pointer)
|
||||
{
|
||||
memcpy(graphics->Pointer_Prototype, pointer, sizeof(rdpPointer));
|
||||
|
|
Loading…
Reference in New Issue