libfreerdp-utils: get rid of rect utils
authorMarc-André Moreau <marcandre.moreau@gmail.com>
Mon, 24 Sep 2012 08:59:18 +0000 (04:59 -0400)
committerMarc-André Moreau <marcandre.moreau@gmail.com>
Mon, 24 Sep 2012 08:59:18 +0000 (04:59 -0400)
channels/rail/client/rail_orders.c
include/freerdp/utils/rail.h
include/freerdp/utils/rect.h [deleted file]
libfreerdp/core/update.c
libfreerdp/core/window.c
libfreerdp/utils/CMakeLists.txt
libfreerdp/utils/rect.c [deleted file]

index ee9bf01..db99515 100644 (file)
@@ -254,15 +254,24 @@ void rail_write_client_sysparam_order(STREAM* s, RAIL_SYSPARAM_ORDER* sysparam)
                        break;
 
                case SPI_SET_WORK_AREA:
-                       freerdp_write_rectangle_16(s, &sysparam->workArea);
+                       stream_write_uint16(s, sysparam->workArea.left); /* left (2 bytes) */
+                       stream_write_uint16(s, sysparam->workArea.top); /* top (2 bytes) */
+                       stream_write_uint16(s, sysparam->workArea.right); /* right (2 bytes) */
+                       stream_write_uint16(s, sysparam->workArea.bottom); /* bottom (2 bytes) */
                        break;
 
                case SPI_DISPLAY_CHANGE:
-                       freerdp_write_rectangle_16(s, &sysparam->displayChange);
+                       stream_write_uint16(s, sysparam->displayChange.left); /* left (2 bytes) */
+                       stream_write_uint16(s, sysparam->displayChange.top); /* top (2 bytes) */
+                       stream_write_uint16(s, sysparam->displayChange.right); /* right (2 bytes) */
+                       stream_write_uint16(s, sysparam->displayChange.bottom); /* bottom (2 bytes) */
                        break;
 
                case SPI_TASKBAR_POS:
-                       freerdp_write_rectangle_16(s, &sysparam->taskbarPos);
+                       stream_write_uint16(s, sysparam->taskbarPos.left); /* left (2 bytes) */
+                       stream_write_uint16(s, sysparam->taskbarPos.top); /* top (2 bytes) */
+                       stream_write_uint16(s, sysparam->taskbarPos.right); /* right (2 bytes) */
+                       stream_write_uint16(s, sysparam->taskbarPos.bottom); /* bottom (2 bytes) */
                        break;
 
                case SPI_SET_HIGH_CONTRAST:
index 8ad2129..0db550b 100644 (file)
@@ -22,7 +22,6 @@
 
 #include <freerdp/api.h>
 #include <freerdp/rail.h>
-#include <freerdp/utils/rect.h>
 #include <freerdp/utils/stream.h>
 
 FREERDP_API void rail_unicode_string_alloc(RAIL_UNICODE_STRING* unicode_string, uint16 cbString);
diff --git a/include/freerdp/utils/rect.h b/include/freerdp/utils/rect.h
deleted file mode 100644 (file)
index 530dfbb..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * FreeRDP: A Remote Desktop Protocol Client
- * Rectangle Utils
- *
- * Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __RECT_UTILS_H
-#define __RECT_UTILS_H
-
-#include <freerdp/api.h>
-#include <freerdp/types.h>
-#include <freerdp/utils/stream.h>
-
-FREERDP_API void freerdp_read_rectangle_16(STREAM* s, RECTANGLE_16* rectangle_16);
-FREERDP_API void freerdp_write_rectangle_16(STREAM* s, RECTANGLE_16* rectangle_16);
-
-FREERDP_API RECTANGLE_16* freerdp_rectangle_16_new(uint16 left, uint16 top, uint16 right, uint16 bottom);
-FREERDP_API void freerdp_rectangle_16_free(RECTANGLE_16* rectangle_16);
-
-#endif /* __RECT_UTILS_H */
index 7b9648c..dbfb067 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "update.h"
 #include "surface.h"
-#include <freerdp/utils/rect.h>
+
 #include <freerdp/codec/bitmap.h>
 
 /*
@@ -355,7 +355,12 @@ static void update_write_refresh_rect(STREAM* s, uint8 count, RECTANGLE_16* area
        stream_seek(s, 3); /* pad3Octets (3 bytes) */
 
        for (i = 0; i < count; i++)
-               freerdp_write_rectangle_16(s, &areas[i]);
+       {
+               stream_write_uint16(s, areas[i].left); /* left (2 bytes) */
+               stream_write_uint16(s, areas[i].top); /* top (2 bytes) */
+               stream_write_uint16(s, areas[i].right); /* right (2 bytes) */
+               stream_write_uint16(s, areas[i].bottom); /* bottom (2 bytes) */
+       }
 }
 
 static void update_send_refresh_rect(rdpContext* context, uint8 count, RECTANGLE_16* areas)
@@ -378,7 +383,12 @@ static void update_write_suppress_output(STREAM* s, uint8 allow, RECTANGLE_16* a
        stream_seek(s, 3); /* pad3Octets (3 bytes) */
 
        if (allow > 0)
-               freerdp_write_rectangle_16(s, area);
+       {
+               stream_write_uint16(s, area->left); /* left (2 bytes) */
+               stream_write_uint16(s, area->top); /* top (2 bytes) */
+               stream_write_uint16(s, area->right); /* right (2 bytes) */
+               stream_write_uint16(s, area->bottom); /* bottom (2 bytes) */
+       }
 }
 
 static void update_send_suppress_output(rdpContext* context, uint8 allow, RECTANGLE_16* area)
index a0de29f..b80a8ce 100644 (file)
@@ -146,7 +146,10 @@ void update_read_window_state_order(STREAM* s, WINDOW_ORDER_INFO* orderInfo, WIN
                /* windowRects */
                for (i = 0; i < (int) window_state->numWindowRects; i++)
                {
-                       freerdp_read_rectangle_16(s, &window_state->windowRects[i]);
+                       stream_read_uint16(s, window_state->windowRects[i].left); /* left (2 bytes) */
+                       stream_read_uint16(s, window_state->windowRects[i].top); /* top (2 bytes) */
+                       stream_read_uint16(s, window_state->windowRects[i].right); /* right (2 bytes) */
+                       stream_read_uint16(s, window_state->windowRects[i].bottom); /* bottom (2 bytes) */
                }
        }
 
@@ -166,7 +169,10 @@ void update_read_window_state_order(STREAM* s, WINDOW_ORDER_INFO* orderInfo, WIN
                /* visibilityRects */
                for (i = 0; i < (int) window_state->numVisibilityRects; i++)
                {
-                       freerdp_read_rectangle_16(s, &window_state->visibilityRects[i]);
+                       stream_read_uint16(s, window_state->visibilityRects[i].left); /* left (2 bytes) */
+                       stream_read_uint16(s, window_state->visibilityRects[i].top); /* top (2 bytes) */
+                       stream_read_uint16(s, window_state->visibilityRects[i].right); /* right (2 bytes) */
+                       stream_read_uint16(s, window_state->visibilityRects[i].bottom); /* bottom (2 bytes) */
                }
        }
 }
index 84d4713..0d3c83b 100644 (file)
@@ -34,7 +34,6 @@ set(FREERDP_UTILS_SRCS
        pcap.c
        profiler.c
        rail.c
-       rect.c
        signal.c
        sleep.c
        stopwatch.c
diff --git a/libfreerdp/utils/rect.c b/libfreerdp/utils/rect.c
deleted file mode 100644 (file)
index e8ee55d..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * FreeRDP: A Remote Desktop Protocol Client
- * Rectangle Utils
- *
- * Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <freerdp/types.h>
-#include <freerdp/utils/memory.h>
-
-#include <freerdp/utils/rect.h>
-
-void freerdp_read_rectangle_16(STREAM* s, RECTANGLE_16* rectangle_16)
-{
-       stream_read_uint16(s, rectangle_16->left); /* left (2 bytes) */
-       stream_read_uint16(s, rectangle_16->top); /* top (2 bytes) */
-       stream_read_uint16(s, rectangle_16->right); /* right (2 bytes) */
-       stream_read_uint16(s, rectangle_16->bottom); /* bottom (2 bytes) */
-}
-
-void freerdp_write_rectangle_16(STREAM* s, RECTANGLE_16* rectangle_16)
-{
-       stream_write_uint16(s, rectangle_16->left); /* left (2 bytes) */
-       stream_write_uint16(s, rectangle_16->top); /* top (2 bytes) */
-       stream_write_uint16(s, rectangle_16->right); /* right (2 bytes) */
-       stream_write_uint16(s, rectangle_16->bottom); /* bottom (2 bytes) */
-}
-
-RECTANGLE_16* freerdp_rectangle_16_new(uint16 left, uint16 top, uint16 right, uint16 bottom)
-{
-       RECTANGLE_16* rectangle_16 = xnew(RECTANGLE_16);
-
-       rectangle_16->left = left;
-       rectangle_16->top = top;
-       rectangle_16->right = right;
-       rectangle_16->bottom = bottom;
-
-       return rectangle_16;
-}
-
-void freerdp_rectangle_16_free(RECTANGLE_16* rectangle_16)
-{
-       xfree(rectangle_16);
-}