Removed duplicate code.
authorArmin Novak <armin.novak@thincast.com>
Thu, 21 Jul 2016 09:57:51 +0000 (11:57 +0200)
committerArmin Novak <armin.novak@thincast.com>
Thu, 6 Oct 2016 11:43:03 +0000 (13:43 +0200)
client/X11/xf_client.c
client/X11/xf_gdi.c
client/X11/xf_gdi.h

index d99d13e..c2733b3 100644 (file)
@@ -153,7 +153,7 @@ static void xf_draw_screen_scaled(xfContext* xfc, int x, int y, int w, int h)
                {
                        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);
                }
 
@@ -163,9 +163,9 @@ static void xf_draw_screen_scaled(xfContext* xfc, int x, int y, int w, int h)
        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);
@@ -185,7 +185,7 @@ static void xf_draw_screen_scaled(xfContext* xfc, int x, int y, int w, int h)
        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);
 }
@@ -223,7 +223,7 @@ void xf_draw_screen(xfContext* xfc, int x, int y, int w, int h)
 
 #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)
@@ -238,9 +238,9 @@ 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)
@@ -260,7 +260,7 @@ static BOOL xf_desktop_resize(rdpContext* context)
        if (!xfc->fullscreen)
        {
                xf_ResizeDesktopWindow(xfc, xfc->window, settings->DesktopWidth,
-                                      settings->DesktopHeight);
+                                      settings->DesktopHeight);
        }
        else
        {
@@ -279,7 +279,7 @@ static BOOL xf_desktop_resize(rdpContext* context)
                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;
@@ -318,7 +318,7 @@ static BOOL xf_sw_end_paint(rdpContext* context)
 
                        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);
                }
@@ -336,7 +336,7 @@ static BOOL xf_sw_end_paint(rdpContext* context)
                                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);
                        }
 
@@ -375,8 +375,8 @@ static BOOL xf_sw_desktop_resize(rdpContext* context)
        }
 
        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;
        }
@@ -537,15 +537,15 @@ BOOL xf_create_window(xfContext* xfc)
                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
@@ -590,8 +590,8 @@ BOOL xf_create_window(xfContext* xfc)
 
        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;
 
@@ -600,24 +600,24 @@ BOOL xf_create_window(xfContext* xfc)
 
        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;
@@ -719,7 +719,7 @@ void xf_toggle_control(xfContext* xfc)
  * @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;
 }
@@ -808,14 +808,14 @@ static BOOL xf_get_pixmap_info(xfContext* xfc)
        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)
        {
@@ -850,9 +850,9 @@ static BOOL xf_get_pixmap_info(xfContext* xfc)
                /* 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);
@@ -891,7 +891,7 @@ static int _xf_error_handler(Display* d, XErrorEvent* ev)
 }
 
 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);
@@ -906,7 +906,7 @@ static void xf_check_extensions(xfContext* context)
 
        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;
        }
@@ -917,7 +917,7 @@ static void xf_check_extensions(xfContext* context)
                int xrender_error_base;
 
                if (XRenderQueryExtension(context->display, &xrender_event_base,
-                                         &xrender_error_base))
+                                         &xrender_error_base))
                {
                        context->xrenderAvailable = TRUE;
                }
@@ -1061,7 +1061,7 @@ static void xf_button_map_init(xfContext* xfc)
                else
                {
                        WLog_ERR(TAG, "Mouse physical button %d is mapped to logical button %d",
-                                physical, logical);
+                                physical, logical);
                }
        }
 }
@@ -1119,9 +1119,9 @@ static BOOL xf_pre_connect(freerdp* instance)
        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;
@@ -1269,17 +1269,6 @@ static BOOL xf_post_connect(freerdp* instance)
        }
 
        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;
 
@@ -1504,7 +1493,7 @@ static void* xf_client_thread(void* param)
        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;
@@ -1512,7 +1501,7 @@ static void* xf_client_thread(void* param)
                }
 
                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;
@@ -1576,7 +1565,7 @@ static void* xf_client_thread(void* param)
                        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;
@@ -1589,7 +1578,7 @@ static void* xf_client_thread(void* param)
        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);
@@ -1609,17 +1598,17 @@ disconnect:
 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;
 }
@@ -1632,7 +1621,7 @@ static void xf_TerminateEventHandler(rdpContext* context, TerminateEventArgs* e)
        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);
@@ -1645,7 +1634,7 @@ static void xf_TerminateEventHandler(rdpContext* context, TerminateEventArgs* e)
 
 #ifdef WITH_XRENDER
 static void xf_ZoomingChangeEventHandler(rdpContext* context,
-       ZoomingChangeEventArgs* e)
+        ZoomingChangeEventArgs* e)
 {
        xfContext* xfc = (xfContext*) context;
        rdpSettings* settings = context->settings;
@@ -1670,7 +1659,7 @@ static void xf_ZoomingChangeEventHandler(rdpContext* context,
 }
 
 static void xf_PanningChangeEventHandler(rdpContext* context,
-       PanningChangeEventArgs* e)
+        PanningChangeEventArgs* e)
 {
        xfContext* xfc = (xfContext*) context;
        rdpSettings* settings = context->settings;
@@ -1710,15 +1699,15 @@ static int xfreerdp_client_start(rdpContext* context)
        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;
@@ -1735,7 +1724,7 @@ static int xfreerdp_client_stop(rdpContext* context)
        {
                wMessageQueue* queue;
                queue = freerdp_get_message_queue(context->instance,
-                                                 FREERDP_INPUT_MESSAGE_QUEUE);
+                                                 FREERDP_INPUT_MESSAGE_QUEUE);
 
                if (queue)
                        MessageQueue_PostQuit(queue, 0);
@@ -1780,12 +1769,12 @@ static BOOL xfreerdp_client_new(freerdp* instance, rdpContext* context)
        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;
@@ -1805,7 +1794,7 @@ static BOOL xfreerdp_client_new(freerdp* instance, rdpContext* context)
        {
                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;
        }
 
@@ -1820,39 +1809,39 @@ static BOOL xfreerdp_client_new(freerdp* instance, rdpContext* context)
        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);
@@ -1865,7 +1854,7 @@ static BOOL xfreerdp_client_new(freerdp* instance, rdpContext* context)
        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)
        {
index 9188414..1f86f45 100644 (file)
@@ -265,97 +265,6 @@ static Pixmap xf_mono_bitmap_new(xfContext* xfc, int width, int height,
        return bitmap;
 }
 
-BOOL xf_gdi_bitmap_update(rdpContext* context,
-                          const BITMAP_UPDATE* bitmapUpdate)
-{
-       UINT32 index;
-       rdpCodecs* codecs = context->codecs;
-       xfContext* xfc = (xfContext*) context;
-       rdpSettings* settings = context->settings;
-       BOOL ret = TRUE;
-
-       for (index = 0; index < bitmapUpdate->number; index++)
-       {
-               BYTE* pDstData;
-               XImage* image;
-               BITMAP_DATA* bitmap = &(bitmapUpdate->rectangles[index]);
-               UINT32 bitsPerPixel = bitmap->bitsPerPixel;
-               UINT32 nXDst = bitmap->destLeft;
-               UINT32 nYDst = bitmap->destTop;
-               UINT32 nWidth = MIN(bitmap->destRight,
-                                   settings->DesktopWidth - 1) - bitmap->destLeft + 1; /* clip width */
-               UINT32 nHeight = MIN(bitmap->destBottom,
-                                    settings->DesktopHeight - 1) - bitmap->destTop + 1; /* clip height */
-               const BYTE* pSrcData = bitmap->bitmapDataStream;
-               UINT32 SrcSize = bitmap->bitmapLength;
-               BOOL compressed = bitmap->compressed;
-               UINT32 SrcFormat = gdi_get_pixel_format(bitsPerPixel, TRUE);
-
-               if (compressed)
-               {
-                       pDstData = xfc->bitmap_buffer;
-
-                       if (bitsPerPixel < 32)
-                       {
-                               if (!interleaved_decompress(codecs->interleaved,
-                                                           pSrcData, SrcSize,
-                                                           bitmap->width, bitmap->height,
-                                                           bitsPerPixel,
-                                                           pDstData,
-                                                           xfc->format, 0,
-                                                           0, 0,
-                                                           nWidth, nHeight,
-                                                           &xfc->context.gdi->palette))
-                                       return FALSE;
-                       }
-                       else
-                       {
-                               if (!planar_decompress(codecs->planar, pSrcData, SrcSize,
-                                                      bitmap->width, bitmap->height, pDstData,
-                                                      xfc->format, 0, 0, 0, nWidth, nHeight, TRUE))
-                                       return FALSE;
-                       }
-
-                       pSrcData = xfc->bitmap_buffer;
-               }
-               else
-               {
-                       pDstData = xfc->bitmap_buffer;
-
-                       if (!freerdp_image_copy(pDstData, xfc->format, 0, 0, 0,
-                                               nWidth, nHeight, pSrcData, SrcFormat,
-                                               0, 0, 0, &xfc->context.gdi->palette))
-                               return FALSE;
-
-                       pSrcData = xfc->bitmap_buffer;
-               }
-
-               xf_lock_x11(xfc, FALSE);
-               XSetFunction(xfc->display, xfc->gc, GXcopy);
-               image = XCreateImage(xfc->display, xfc->visual, xfc->depth, ZPixmap, 0,
-                                    (char*) pSrcData, nWidth, nHeight, xfc->scanline_pad, 0);
-
-               if (!image)
-               {
-                       xf_unlock_x11(xfc, FALSE);
-                       return FALSE;
-               }
-
-               nWidth = bitmap->destRight - bitmap->destLeft + 1; /* clip width */
-               nHeight = bitmap->destBottom - bitmap->destTop + 1; /* clip height */
-               XPutImage(xfc->display, xfc->primary, xfc->gc,
-                         image, 0, 0, nXDst, nYDst, nWidth, nHeight);
-               XFree(image);
-               ret = gdi_InvalidateRegion(xfc->hdc, nXDst, nYDst, nWidth, nHeight);
-               xf_unlock_x11(xfc, FALSE);
-
-               if (!ret)
-                       break;
-       }
-
-       return ret;
-}
-
 static BOOL xf_gdi_set_bounds(rdpContext* context,
                               const rdpBounds* bounds)
 {
index f300d7b..f11bd0b 100644 (file)
@@ -28,7 +28,5 @@
 #include "xfreerdp.h"
 
 void xf_gdi_register_update_callbacks(rdpUpdate* update);
-BOOL xf_gdi_bitmap_update(rdpContext* context,
-                          const BITMAP_UPDATE* bitmapUpdate);
 
 #endif /* __XF_GDI_H */