{
XSetRegion(xfc->display, xfc->gc, reg1);
XFillRectangle(xfc->display, xfc->window->handle, xfc->gc, 0, 0,
- xfc->window->width, xfc->window->height);
+ xfc->window->width, xfc->window->height);
XSetClipMask(xfc->display, xfc->gc, None);
}
picFormat = XRenderFindVisualFormat(xfc->display, xfc->visual);
pa.subwindow_mode = IncludeInferiors;
primaryPicture = XRenderCreatePicture(xfc->display, xfc->primary, picFormat,
- CPSubwindowMode, &pa);
+ CPSubwindowMode, &pa);
windowPicture = XRenderCreatePicture(xfc->display, xfc->window->handle,
- picFormat, CPSubwindowMode, &pa);
+ picFormat, CPSubwindowMode, &pa);
XRenderSetPictureFilter(xfc->display, primaryPicture, FilterBilinear, 0, 0);
transform.matrix[0][0] = XDoubleToFixed(xScalingFactor);
transform.matrix[0][1] = XDoubleToFixed(0.0);
h = ceil(y2 / yScalingFactor) + 1 - y;
XRenderSetPictureTransform(xfc->display, primaryPicture, &transform);
XRenderComposite(xfc->display, PictOpSrc, primaryPicture, 0, windowPicture, x,
- y, 0, 0, xfc->offset_x + x, xfc->offset_y + y, w, h);
+ y, 0, 0, xfc->offset_x + x, xfc->offset_y + y, w, h);
XRenderFreePicture(xfc->display, primaryPicture);
XRenderFreePicture(xfc->display, windowPicture);
}
#endif
XCopyArea(xfc->display, xfc->primary, xfc->window->handle, xfc->gc, x, y, w, h,
- x, y);
+ x, y);
}
static BOOL xf_desktop_resize(rdpContext* context)
XFreePixmap(xfc->display, xfc->primary);
if (!(xfc->primary = XCreatePixmap(
- xfc->display, xfc->drawable,
- settings->DesktopWidth,
- settings->DesktopHeight, xfc->depth)))
+ xfc->display, xfc->drawable,
+ settings->DesktopWidth,
+ settings->DesktopHeight, xfc->depth)))
return FALSE;
if (same)
if (!xfc->fullscreen)
{
xf_ResizeDesktopWindow(xfc, xfc->window, settings->DesktopWidth,
- settings->DesktopHeight);
+ settings->DesktopHeight);
}
else
{
XSetFillStyle(xfc->display, xfc->gc, FillSolid);
XSetForeground(xfc->display, xfc->gc, 0);
XFillRectangle(xfc->display, xfc->drawable, xfc->gc, 0, 0, xfc->window->width,
- xfc->window->height);
+ xfc->window->height);
}
return TRUE;
xf_lock_x11(xfc, FALSE);
XPutImage(xfc->display, xfc->primary, xfc->gc, xfc->image,
- x, y, x, y, w, h);
+ x, y, x, y, w, h);
xf_draw_screen(xfc, x, y, w, h);
xf_unlock_x11(xfc, FALSE);
}
w = cinvalid[i].w;
h = cinvalid[i].h;
XPutImage(xfc->display, xfc->primary, xfc->gc,
- xfc->image, x, y, x, y, w, h);
+ xfc->image, x, y, x, y, w, h);
xf_draw_screen(xfc, x, y, w, h);
}
}
if (!(xfc->image = XCreateImage(xfc->display, xfc->visual, xfc->depth, ZPixmap,
- 0,
- (char*) gdi->primary_buffer, gdi->width, gdi->height, xfc->scanline_pad, 0)))
+ 0,
+ (char*) gdi->primary_buffer, gdi->width, gdi->height, xfc->scanline_pad, 0)))
{
goto out;
}
else if (settings->ServerPort == 3389)
{
windowTitle = malloc(1 + sizeof("FreeRDP: ") + strlen(
- settings->ServerHostname));
+ settings->ServerHostname));
sprintf(windowTitle, "FreeRDP: %s", settings->ServerHostname);
}
else
{
windowTitle = malloc(1 + sizeof("FreeRDP: ") + strlen(settings->ServerHostname)
- + sizeof(":00000"));
+ + sizeof(":00000"));
sprintf(windowTitle, "FreeRDP: %s:%i", settings->ServerHostname,
- settings->ServerPort);
+ settings->ServerPort);
}
#ifdef WITH_XRENDER
if (!xfc->primary)
xfc->primary = XCreatePixmap(xfc->display, xfc->drawable,
- settings->DesktopWidth,
- settings->DesktopHeight, xfc->depth);
+ settings->DesktopWidth,
+ settings->DesktopHeight, xfc->depth);
xfc->drawing = xfc->primary;
if (!xfc->gc_mono)
xfc->gc_mono = XCreateGC(xfc->display, xfc->bitmap_mono, GCGraphicsExposures,
- &gcv);
+ &gcv);
XSetFunction(xfc->display, xfc->gc, GXcopy);
XSetFillStyle(xfc->display, xfc->gc, FillSolid);
XSetForeground(xfc->display, xfc->gc, BlackPixelOfScreen(xfc->screen));
XFillRectangle(xfc->display, xfc->primary, xfc->gc, 0, 0,
- settings->DesktopWidth,
- settings->DesktopHeight);
+ settings->DesktopWidth,
+ settings->DesktopHeight);
XFlush(xfc->display);
if (!xfc->image)
{
rdpGdi* gdi = xfc->context.gdi;
xfc->image = XCreateImage(xfc->display, xfc->visual,
- xfc->depth,
- ZPixmap, 0, (char*) gdi->primary_buffer,
- settings->DesktopWidth, settings->DesktopHeight,
- xfc->scanline_pad, 0);
+ xfc->depth,
+ ZPixmap, 0, (char*) gdi->primary_buffer,
+ settings->DesktopWidth, settings->DesktopHeight,
+ xfc->scanline_pad, 0);
}
return TRUE;
* @return 0 on success, otherwise a Win32 error code
*/
static UINT xf_encomsp_participant_created(EncomspClientContext* context,
- ENCOMSP_PARTICIPANT_CREATED_PDU* participantCreated)
+ ENCOMSP_PARTICIPANT_CREATED_PDU* participantCreated)
{
return CHANNEL_RC_OK;
}
template.screen = xfc->screen_number;
if (XGetWindowAttributes(xfc->display, RootWindowOfScreen(xfc->screen),
- &window_attributes) == 0)
+ &window_attributes) == 0)
{
WLog_ERR(TAG, "XGetWindowAttributes failed");
return FALSE;
}
vis = XGetVisualInfo(xfc->display, VisualClassMask | VisualScreenMask,
- &template, &vi_count);
+ &template, &vi_count);
if (!vis)
{
/* calculate color shifts required for rdp order color conversion */
xf_calculate_color_shifts(vi->red_mask, &xfc->red_shift_r, &xfc->red_shift_l);
xf_calculate_color_shifts(vi->green_mask, &xfc->green_shift_r,
- &xfc->green_shift_l);
+ &xfc->green_shift_l);
xf_calculate_color_shifts(vi->blue_mask, &xfc->blue_shift_r,
- &xfc->blue_shift_l);
+ &xfc->blue_shift_l);
}
XFree(vis);
}
static BOOL xf_play_sound(rdpContext* context,
- const PLAY_SOUND_UPDATE* play_sound)
+ const PLAY_SOUND_UPDATE* play_sound)
{
xfContext* xfc = (xfContext*) context;
XkbBell(xfc->display, None, 100, 0);
if (XkbLibraryVersion(&xkb_major, &xkb_minor)
&& XkbQueryExtension(context->display, &xkb_opcode, &xkb_event,
- &xkb_error, &xkb_major, &xkb_minor))
+ &xkb_error, &xkb_major, &xkb_minor))
{
context->xkbAvailable = TRUE;
}
int xrender_error_base;
if (XRenderQueryExtension(context->display, &xrender_event_base,
- &xrender_error_base))
+ &xrender_error_base))
{
context->xrenderAvailable = TRUE;
}
else
{
WLog_ERR(TAG, "Mouse physical button %d is mapped to logical button %d",
- physical, logical);
+ physical, logical);
}
}
}
settings->OrderSupport[NEG_ELLIPSE_SC_INDEX] = FALSE;
settings->OrderSupport[NEG_ELLIPSE_CB_INDEX] = FALSE;
PubSub_SubscribeChannelConnected(instance->context->pubSub,
- (pChannelConnectedEventHandler) xf_OnChannelConnectedEventHandler);
+ (pChannelConnectedEventHandler) xf_OnChannelConnectedEventHandler);
PubSub_SubscribeChannelDisconnected(instance->context->pubSub,
- (pChannelDisconnectedEventHandler) xf_OnChannelDisconnectedEventHandler);
+ (pChannelDisconnectedEventHandler) xf_OnChannelDisconnectedEventHandler);
if (!freerdp_client_load_addins(channels, instance->settings))
return FALSE;
}
pointer_cache_register_callbacks(update);
-
- if (!settings->SoftwareGdi)
- {
- glyph_cache_register_callbacks(update);
- brush_cache_register_callbacks(update);
- bitmap_cache_register_callbacks(update);
- offscreen_cache_register_callbacks(update);
- palette_cache_register_callbacks(update);
- update->BitmapUpdate = xf_gdi_bitmap_update;
- }
-
update->PlaySound = xf_play_sound;
update->SetKeyboardIndicators = xf_keyboard_set_indicators;
else
{
if (!(inputEvent = freerdp_get_message_queue_event_handle(instance,
- FREERDP_INPUT_MESSAGE_QUEUE)))
+ FREERDP_INPUT_MESSAGE_QUEUE)))
{
WLog_ERR(TAG, "async input: failed to get input event handle");
exit_code = XF_EXIT_UNKNOWN;
}
if (!(inputThread = CreateThread(NULL, 0,
- (LPTHREAD_START_ROUTINE) xf_input_thread, instance, 0, NULL)))
+ (LPTHREAD_START_ROUTINE) xf_input_thread, instance, 0, NULL)))
{
WLog_ERR(TAG, "async input: failed to create input thread");
exit_code = XF_EXIT_UNKNOWN;
if (WaitForSingleObject(inputEvent, 0) == WAIT_OBJECT_0)
{
if (!freerdp_message_queue_process_pending_messages(instance,
- FREERDP_INPUT_MESSAGE_QUEUE))
+ FREERDP_INPUT_MESSAGE_QUEUE))
{
WLog_INFO(TAG, "User Disconnect");
xfc->disconnect = TRUE;
if (settings->AsyncInput)
{
wMessageQueue* inputQueue = freerdp_get_message_queue(instance,
- FREERDP_INPUT_MESSAGE_QUEUE);
+ FREERDP_INPUT_MESSAGE_QUEUE);
if (MessageQueue_PostQuit(inputQueue, 0))
WaitForSingleObject(inputThread, INFINITE);
DWORD xf_exit_code_from_disconnect_reason(DWORD reason)
{
if (reason == 0 || (reason >= XF_EXIT_PARSE_ARGUMENTS
- && reason <= XF_EXIT_AUTH_FAILURE))
+ && reason <= XF_EXIT_AUTH_FAILURE))
return reason;
/* License error set */
else if (reason >= 0x100 && reason <= 0x10A)
- reason -= 0x100 + XF_EXIT_LICENSE_INTERNAL;
+ reason -= 0x100 + XF_EXIT_LICENSE_INTERNAL;
/* RDP protocol error set */
else if (reason >= 0x10c9 && reason <= 0x1193)
- reason = XF_EXIT_RDP;
+ reason = XF_EXIT_RDP;
/* There's no need to test protocol-independent codes: they match */
else if (!(reason <= 0xC))
- reason = XF_EXIT_UNKNOWN;
+ reason = XF_EXIT_UNKNOWN;
return reason;
}
if (context->settings->AsyncInput)
{
queue = freerdp_get_message_queue(context->instance,
- FREERDP_INPUT_MESSAGE_QUEUE);
+ FREERDP_INPUT_MESSAGE_QUEUE);
if (queue)
MessageQueue_PostQuit(queue, 0);
#ifdef WITH_XRENDER
static void xf_ZoomingChangeEventHandler(rdpContext* context,
- ZoomingChangeEventArgs* e)
+ ZoomingChangeEventArgs* e)
{
xfContext* xfc = (xfContext*) context;
rdpSettings* settings = context->settings;
}
static void xf_PanningChangeEventHandler(rdpContext* context,
- PanningChangeEventArgs* e)
+ PanningChangeEventArgs* e)
{
xfContext* xfc = (xfContext*) context;
rdpSettings* settings = context->settings;
if (!settings->ServerHostname)
{
WLog_ERR(TAG,
- "error: server hostname was not specified with /v:<server>[:port]");
+ "error: server hostname was not specified with /v:<server>[:port]");
return -1;
}
xfc->disconnect = FALSE;
if (!(xfc->thread = CreateThread(NULL, 0,
- (LPTHREAD_START_ROUTINE) xf_client_thread,
- context->instance, 0, NULL)))
+ (LPTHREAD_START_ROUTINE) xf_client_thread,
+ context->instance, 0, NULL)))
{
WLog_ERR(TAG, "failed to create client thread");
return -1;
{
wMessageQueue* queue;
queue = freerdp_get_message_queue(context->instance,
- FREERDP_INPUT_MESSAGE_QUEUE);
+ FREERDP_INPUT_MESSAGE_QUEUE);
if (queue)
MessageQueue_PostQuit(queue, 0);
settings = instance->settings;
xfc->settings = instance->context->settings;
PubSub_SubscribeTerminate(context->pubSub,
- (pTerminateEventHandler) xf_TerminateEventHandler);
+ (pTerminateEventHandler) xf_TerminateEventHandler);
#ifdef WITH_XRENDER
PubSub_SubscribeZoomingChange(context->pubSub,
- (pZoomingChangeEventHandler) xf_ZoomingChangeEventHandler);
+ (pZoomingChangeEventHandler) xf_ZoomingChangeEventHandler);
PubSub_SubscribePanningChange(context->pubSub,
- (pPanningChangeEventHandler) xf_PanningChangeEventHandler);
+ (pPanningChangeEventHandler) xf_PanningChangeEventHandler);
#endif
xfc->UseXThreads = TRUE;
//xfc->debug = TRUE;
{
WLog_ERR(TAG, "failed to open display: %s", XDisplayName(NULL));
WLog_ERR(TAG,
- "Please check that the $DISPLAY environment variable is properly set.");
+ "Please check that the $DISPLAY environment variable is properly set.");
goto fail_open_display;
}
xfc->_NET_WM_ICON = XInternAtom(xfc->display, "_NET_WM_ICON", False);
xfc->_MOTIF_WM_HINTS = XInternAtom(xfc->display, "_MOTIF_WM_HINTS", False);
xfc->_NET_CURRENT_DESKTOP = XInternAtom(xfc->display, "_NET_CURRENT_DESKTOP",
- False);
+ False);
xfc->_NET_WORKAREA = XInternAtom(xfc->display, "_NET_WORKAREA", False);
xfc->_NET_WM_STATE = XInternAtom(xfc->display, "_NET_WM_STATE", False);
xfc->_NET_WM_STATE_FULLSCREEN = XInternAtom(xfc->display,
- "_NET_WM_STATE_FULLSCREEN", False);
+ "_NET_WM_STATE_FULLSCREEN", False);
xfc->_NET_WM_STATE_MAXIMIZED_HORZ = XInternAtom(xfc->display,
- "_NET_WM_STATE_MAXIMIZED_HORZ", False);
+ "_NET_WM_STATE_MAXIMIZED_HORZ", False);
xfc->_NET_WM_STATE_MAXIMIZED_VERT = XInternAtom(xfc->display,
- "_NET_WM_STATE_MAXIMIZED_VERT", False);
+ "_NET_WM_STATE_MAXIMIZED_VERT", False);
xfc->_NET_WM_FULLSCREEN_MONITORS = XInternAtom(xfc->display,
- "_NET_WM_FULLSCREEN_MONITORS", False);
+ "_NET_WM_FULLSCREEN_MONITORS", False);
xfc->_NET_WM_NAME = XInternAtom(xfc->display, "_NET_WM_NAME", False);
xfc->_NET_WM_PID = XInternAtom(xfc->display, "_NET_WM_PID", False);
xfc->_NET_WM_WINDOW_TYPE = XInternAtom(xfc->display, "_NET_WM_WINDOW_TYPE",
- False);
+ False);
xfc->_NET_WM_WINDOW_TYPE_NORMAL = XInternAtom(xfc->display,
- "_NET_WM_WINDOW_TYPE_NORMAL", False);
+ "_NET_WM_WINDOW_TYPE_NORMAL", False);
xfc->_NET_WM_WINDOW_TYPE_DIALOG = XInternAtom(xfc->display,
- "_NET_WM_WINDOW_TYPE_DIALOG", False);
+ "_NET_WM_WINDOW_TYPE_DIALOG", False);
xfc->_NET_WM_WINDOW_TYPE_POPUP = XInternAtom(xfc->display,
- "_NET_WM_WINDOW_TYPE_POPUP", False);
+ "_NET_WM_WINDOW_TYPE_POPUP", False);
xfc->_NET_WM_WINDOW_TYPE_UTILITY = XInternAtom(xfc->display,
- "_NET_WM_WINDOW_TYPE_UTILITY", False);
+ "_NET_WM_WINDOW_TYPE_UTILITY", False);
xfc->_NET_WM_WINDOW_TYPE_DROPDOWN_MENU = XInternAtom(xfc->display,
- "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU", False);
+ "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU", False);
xfc->_NET_WM_STATE_SKIP_TASKBAR = XInternAtom(xfc->display,
- "_NET_WM_STATE_SKIP_TASKBAR", False);
+ "_NET_WM_STATE_SKIP_TASKBAR", False);
xfc->_NET_WM_STATE_SKIP_PAGER = XInternAtom(xfc->display,
- "_NET_WM_STATE_SKIP_PAGER", False);
+ "_NET_WM_STATE_SKIP_PAGER", False);
xfc->_NET_WM_MOVERESIZE = XInternAtom(xfc->display, "_NET_WM_MOVERESIZE",
- False);
+ False);
xfc->_NET_MOVERESIZE_WINDOW = XInternAtom(xfc->display,
- "_NET_MOVERESIZE_WINDOW", False);
+ "_NET_MOVERESIZE_WINDOW", False);
xfc->UTF8_STRING = XInternAtom(xfc->display, "UTF8_STRING", FALSE);
xfc->WM_PROTOCOLS = XInternAtom(xfc->display, "WM_PROTOCOLS", False);
xfc->WM_DELETE_WINDOW = XInternAtom(xfc->display, "WM_DELETE_WINDOW", False);
xfc->invert = (ImageByteOrder(xfc->display) == MSBFirst) ? TRUE : FALSE;
xfc->complex_regions = TRUE;
xfc->x11event = CreateFileDescriptorEvent(NULL, FALSE, FALSE, xfc->xfds,
- WINPR_FD_READ);
+ WINPR_FD_READ);
if (!xfc->x11event)
{