mirror of https://github.com/FreeRDP/FreeRDP
libfreerdp-utils: get rid of rect utils
This commit is contained in:
parent
6dcc8e73ee
commit
c7719e9982
|
@ -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:
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 */
|
|
@ -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)
|
||||
|
|
|
@ -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) */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,6 @@ set(FREERDP_UTILS_SRCS
|
|||
pcap.c
|
||||
profiler.c
|
||||
rail.c
|
||||
rect.c
|
||||
signal.c
|
||||
sleep.c
|
||||
stopwatch.c
|
||||
|
|
|
@ -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);
|
||||
}
|
Loading…
Reference in New Issue