xfreerdp: add support for RemoteApp round window corners

This commit is contained in:
Marc-André Moreau 2011-08-22 16:06:12 -04:00
parent 617fe7d7e5
commit 3e4331caa0
5 changed files with 53 additions and 1 deletions

View File

@ -140,6 +140,17 @@ void xf_rail_SetWindowIcon(rdpRail* rail, rdpWindow* window, rdpIcon* icon)
xf_SetWindowIcon(xfi, xfw, icon);
}
void xf_rail_SetWindowVisibilityRects(rdpRail* rail, rdpWindow* window)
{
xfInfo* xfi;
xfWindow* xfw;
xfi = (xfInfo*) rail->extra;
xfw = (xfWindow*) window->extra;
xf_SetWindowVisibilityRects(xfi, xfw, window->visibilityRects, window->numVisibilityRects);
}
void xf_rail_DestroyWindow(rdpRail* rail, rdpWindow* window)
{
xfWindow* xfw;
@ -155,6 +166,7 @@ void xf_rail_register_callbacks(xfInfo* xfi, rdpRail* rail)
rail->ShowWindow = xf_rail_ShowWindow;
rail->SetWindowText = xf_rail_SetWindowText;
rail->SetWindowIcon = xf_rail_SetWindowIcon;
rail->SetWindowVisibilityRects = xf_rail_SetWindowVisibilityRects;
rail->DestroyWindow = xf_rail_DestroyWindow;
}

View File

@ -18,6 +18,7 @@
*/
#include <X11/Xutil.h>
#include <X11/extensions/shape.h>
#include "xf_window.h"
@ -385,6 +386,25 @@ void xf_SetWindowIcon(xfInfo* xfi, xfWindow* window, rdpIcon* icon)
}
}
void xf_SetWindowVisibilityRects(xfInfo* xfi, xfWindow* window, RECTANGLE_16* rects, int nrects)
{
int i;
XRectangle* xrects;
xrects = xmalloc(sizeof(XRectangle) * nrects);
for (i = 0; i < nrects; i++)
{
xrects[i].x = rects[i].left;
xrects[i].y = rects[i].top;
xrects[i].width = rects[i].right - rects[i].left + 1;
xrects[i].height = rects[i].bottom - rects[i].top + 1;
}
XShapeCombineRectangles(xfi->display, window->handle, ShapeBounding, 0, 0, xrects, nrects, ShapeSet, 0);
xfree(xrects);
}
void xf_DestroyWindow(xfInfo* xfi, xfWindow* window)
{
if (window->gc)

View File

@ -53,6 +53,7 @@ xfWindow* xf_CreateWindow(xfInfo* xfi, int x, int y, int width, int height, uint
void xf_MoveWindow(xfInfo* xfi, xfWindow* window, int x, int y, int width, int height);
void xf_ShowWindow(xfInfo* xfi, xfWindow* window, uint8 state);
void xf_SetWindowIcon(xfInfo* xfi, xfWindow* window, rdpIcon* icon);
void xf_SetWindowVisibilityRects(xfInfo* xfi, xfWindow* window, RECTANGLE_16* rects, int nrects);
void xf_DestroyWindow(xfInfo* xfi, xfWindow* window);
#endif /* __XF_WINDOW_H */

View File

@ -39,6 +39,7 @@ typedef void (*railMoveWindow)(rdpRail* rail, rdpWindow* window);
typedef void (*railShowWindow)(rdpRail* rail, rdpWindow* window, uint8 state);
typedef void (*railSetWindowText)(rdpRail* rail, rdpWindow* window);
typedef void (*railSetWindowIcon)(rdpRail* rail, rdpWindow* window, rdpIcon* icon);
typedef void (*railSetWindowVisibilityRects)(rdpRail* rail, rdpWindow* window);
struct rdp_rail
{
@ -54,6 +55,7 @@ struct rdp_rail
railShowWindow ShowWindow;
railSetWindowText SetWindowText;
railSetWindowIcon SetWindowIcon;
railSetWindowVisibilityRects SetWindowVisibilityRects;
};
FREERDP_API void rail_register_update_callbacks(rdpRail* rail, rdpUpdate* update);

View File

@ -224,6 +224,12 @@ void window_state_update(rdpWindow* window, WINDOW_ORDER_INFO* orderInfo, WINDOW
{
int i;
if (window->windowRects != NULL)
xfree(window->windowRects);
window->windowRects = window_state->windowRects;
window->numWindowRects = window_state->numWindowRects;
for (i = 0; i < window_state->numWindowRects; i++)
{
printf("Window Rect #%d: left:%d top:%d right:%d bottom:%d\n", i,
@ -245,6 +251,12 @@ void window_state_update(rdpWindow* window, WINDOW_ORDER_INFO* orderInfo, WINDOW
{
int i;
if (window->visibilityRects != NULL)
xfree(window->visibilityRects);
window->visibilityRects = window_state->visibilityRects;
window->numVisibilityRects = window_state->numVisibilityRects;
for (i = 0; i < window_state->numVisibilityRects; i++)
{
printf("Visibility Rect #%d: left:%d top:%d right:%d bottom:%d\n", i,
@ -267,6 +279,11 @@ void rail_CreateWindow(rdpRail* rail, rdpWindow* window)
}
IFCALL(rail->CreateWindow, rail, window);
if (window->fieldFlags & WINDOW_ORDER_FIELD_VISIBILITY)
{
IFCALL(rail->SetWindowVisibilityRects, rail, window);
}
}
void rail_UpdateWindow(rdpRail* rail, rdpWindow* window)
@ -339,7 +356,7 @@ void rail_UpdateWindow(rdpRail* rail, rdpWindow* window)
if (window->fieldFlags & WINDOW_ORDER_FIELD_VISIBILITY)
{
IFCALL(rail->SetWindowVisibilityRects, rail, window);
}
}