From 72fc75b5a68726cf61480940a2cfdf44eb73ae0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Thu, 28 Jul 2011 00:38:25 -0400 Subject: [PATCH] libfreerdp-core: exporting new interface --- CMakeLists.txt | 2 +- client/test/freerdp.c | 27 +- cunit/CMakeLists.txt | 14 +- cunit/test_freerdp.c | 12 +- include/freerdp/api.h | 2 + include/freerdp/freerdp.h | 35 ++- include/freerdp/input.h | 76 +++++ include/freerdp/update.h | 465 +++++++++++++++++++++++++++++++ libfreerdp-core/CMakeLists.txt | 1 + libfreerdp-core/freerdp.c | 48 ++++ libfreerdp-core/input.h | 52 +--- libfreerdp-core/orders.c | 489 +++++++++++++++++---------------- libfreerdp-core/orders.h | 358 +----------------------- libfreerdp-core/rdp.c | 8 +- libfreerdp-core/rdp.h | 4 +- libfreerdp-core/update.c | 34 +-- libfreerdp-core/update.h | 93 +------ libfreerdp-gdi/gdi.c | 5 + 18 files changed, 942 insertions(+), 783 deletions(-) create mode 100644 include/freerdp/input.h create mode 100644 include/freerdp/update.h create mode 100644 libfreerdp-core/freerdp.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 17873e5eb..4e0a3ec12 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,7 +85,7 @@ add_subdirectory(include) add_subdirectory(libfreerdp-utils) add_subdirectory(libfreerdp-kbd) add_subdirectory(libfreerdp-gdi) -add_subdirectory(libfreerdp-chanman) +# add_subdirectory(libfreerdp-chanman) add_subdirectory(libfreerdp-core) add_subdirectory(channels) diff --git a/client/test/freerdp.c b/client/test/freerdp.c index 2c831c0b5..56bad48c8 100644 --- a/client/test/freerdp.c +++ b/client/test/freerdp.c @@ -22,9 +22,14 @@ #include "connection.h" +#include #include #include +rdpRdp* rdp; +freerdp* instance; +rdpSettings* settings; + #define PARAM_EQUALS(_param) (strcmp(_param, argv[*i]) == 0) #define CHECK_VALUE_PRESENT(_msg) do { \ @@ -185,14 +190,26 @@ boolean freerdp_process_params(int argc, char* argv[], rdpSettings* settings, in return True; } +int bitmap_update(rdpUpdate* update, BITMAP_UPDATE* bitmap) +{ + printf("received bitmap update from core\n"); + return 0; +} + +void register_update_callbacks(rdpUpdate* update) +{ + update->Bitmap = bitmap_update; +} + int main(int argc, char* argv[]) { - rdpRdp* rdp; int index = 1; - rdpSettings* settings; - rdp = rdp_new(); - settings = rdp->settings; + instance = freerdp_new(); + register_update_callbacks(instance->update); + + settings = instance->settings; + rdp = (rdpRdp*) instance->rdp; if (freerdp_process_params(argc, argv, settings, &index) != True) { @@ -205,5 +222,7 @@ int main(int argc, char* argv[]) rdp_client_connect(rdp); + freerdp_free(instance); + return 0; } diff --git a/cunit/CMakeLists.txt b/cunit/CMakeLists.txt index 0785bac89..2335b40bd 100644 --- a/cunit/CMakeLists.txt +++ b/cunit/CMakeLists.txt @@ -48,12 +48,12 @@ add_executable(test_freerdp test_utils.h test_transport.c test_transport.h - test_chanman.c - test_chanman.h - test_cliprdr.c - test_cliprdr.h - test_drdynvc.c - test_drdynvc.h + #test_chanman.c + #test_chanman.h + #test_cliprdr.c + #test_cliprdr.h + #test_drdynvc.c + #test_drdynvc.h test_freerdp.c test_freerdp.h) @@ -62,6 +62,6 @@ target_link_libraries(test_freerdp ${CUNIT_LIBRARIES}) target_link_libraries(test_freerdp freerdp-core) target_link_libraries(test_freerdp freerdp-gdi) target_link_libraries(test_freerdp freerdp-utils) -target_link_libraries(test_freerdp freerdp-chanman) +#target_link_libraries(test_freerdp freerdp-chanman) add_test(CUnitTests ${EXECUTABLE_OUTPUT_PATH}/test_freerdp) diff --git a/cunit/test_freerdp.c b/cunit/test_freerdp.c index cbd4ee12d..d7806bc4a 100644 --- a/cunit/test_freerdp.c +++ b/cunit/test_freerdp.c @@ -126,9 +126,9 @@ int main(int argc, char* argv[]) add_stream_suite(); add_utils_suite(); add_transport_suite(); - add_chanman_suite(); - add_cliprdr_suite(); - add_drdynvc_suite(); + //add_chanman_suite(); + //add_cliprdr_suite(); + //add_drdynvc_suite(); } else { @@ -168,15 +168,15 @@ int main(int argc, char* argv[]) } else if (strcmp("chanman", argv[*pindex]) == 0) { - add_chanman_suite(); + //add_chanman_suite(); } else if (strcmp("cliprdr", argv[*pindex]) == 0) { - add_cliprdr_suite(); + //add_cliprdr_suite(); } else if (strcmp("drdynvc", argv[*pindex]) == 0) { - add_drdynvc_suite(); + //add_drdynvc_suite(); } else if (strcmp("per", argv[*pindex]) == 0) { diff --git a/include/freerdp/api.h b/include/freerdp/api.h index 7905e6a64..44b9f642f 100644 --- a/include/freerdp/api.h +++ b/include/freerdp/api.h @@ -50,4 +50,6 @@ #define FREERDP_CC #endif +#define IFCALL(_cb, ...) do { if (_cb != NULL) { _cb( __VA_ARGS__ ); } } while (0) + #endif diff --git a/include/freerdp/freerdp.h b/include/freerdp/freerdp.h index e611c248d..5a94882fc 100644 --- a/include/freerdp/freerdp.h +++ b/include/freerdp/freerdp.h @@ -25,10 +25,32 @@ #include #include +#include +#include + #ifdef __cplusplus extern "C" { #endif +/* New Interface */ + +FREERDP_API boolean freerdp_global_init(); +FREERDP_API void freerdp_global_finish(); + +typedef struct +{ + void* rdp; + rdpInput* input; + rdpUpdate* update; + rdpSettings* settings; +} freerdp; + +FREERDP_API freerdp* freerdp_new(); +FREERDP_API void freerdp_free(freerdp* instance); + +#if 0 +/* Old Interface */ + FREERDP_API boolean freerdp_global_init(void); FREERDP_API void @@ -38,12 +60,12 @@ struct rdp_inst { int version; int size; - rdpSettings * settings; - void * rdp; - void * param1; - void * param2; - void * param3; - void * param4; + rdpSettings* settings; + void* rdp; + void* param1; + void* param2; + void* param3; + void* param4; uint32 disc_reason; /* calls from ui to library */ int (* rdp_connect)(rdpInst * inst); @@ -126,6 +148,7 @@ FREERDP_API rdpInst * freerdp_new(rdpSettings * settings); FREERDP_API void freerdp_free(rdpInst * inst); +#endif #ifdef __cplusplus } diff --git a/include/freerdp/input.h b/include/freerdp/input.h new file mode 100644 index 000000000..ec28db012 --- /dev/null +++ b/include/freerdp/input.h @@ -0,0 +1,76 @@ +/** + * FreeRDP: A Remote Desktop Protocol Client + * Input Interface API + * + * Copyright 2011 Marc-Andre Moreau + * + * 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 __INPUT_API_H +#define __INPUT_API_H + +/* Input Events */ +#define INPUT_EVENT_SYNC 0x0000 +#define INPUT_EVENT_SCANCODE 0x0004 +#define INPUT_EVENT_UNICODE 0x0005 +#define INPUT_EVENT_MOUSE 0x8001 +#define INPUT_EVENT_MOUSEX 0x8002 + +/* keyboard Flags */ +#define KBD_FLAGS_EXTENDED 0x0100 +#define KBD_FLAGS_DOWN 0x4000 +#define KBD_FLAGS_RELEASE 0x8000 + +/* Pointer Flags */ +#define PTR_FLAGS_WHEEL 0x0200 +#define PTR_FLAGS_WHEEL_NEGATIVE 0x0100 +#define PTR_FLAGS_MOVE 0x0800 +#define PTR_FLAGS_DOWN 0x8000 +#define PTR_FLAGS_BUTTON1 0x1000 +#define PTR_FLAGS_BUTTON2 0x2000 +#define PTR_FLAGS_BUTTON3 0x4000 +#define WheelRotationMask 0x01FF + +/* Extended Pointer Flags */ +#define PTR_XFLAGS_DOWN 0x8000 +#define PTR_XFLAGS_BUTTON1 0x0001 +#define PTR_XFLAGS_BUTTON2 0x0002 + +/* Keyboard Toggle Flags */ +#define KBD_SYNC_SCROLL_LOCK 0x00000001 +#define KBD_SYNC_NUM_LOCK 0x00000002 +#define KBD_SYNC_CAPS_LOCK 0x00000004 +#define KBD_SYNC_KANA_LOCK 0x00000008 + +#define RDP_CLIENT_INPUT_PDU_HEADER_LENGTH 4 + +typedef struct rdp_input rdpInput; + +typedef void (*pcSynchronizeEvent)(rdpInput* input, uint32 flags); +typedef void (*pcKeyboardEvent)(rdpInput* input, uint16 flags, uint16 code); +typedef void (*pcUnicodeKeyboardEvent)(rdpInput* input, uint16 code); +typedef void (*pcMouseEvent)(rdpInput* input, uint16 flags, uint16 x, uint16 y); +typedef void (*pcExtendedMouseEvent)(rdpInput* input, uint16 flags, uint16 x, uint16 y); + +struct rdp_input +{ + void* rdp; + pcSynchronizeEvent SynchronizeEvent; + pcKeyboardEvent KeyboardEvent; + pcUnicodeKeyboardEvent UnicodeKeyboardEvent; + pcMouseEvent MouseEvent; + pcExtendedMouseEvent ExtendedMouseEvent; +}; + +#endif /* __INPUT_API_H */ diff --git a/include/freerdp/update.h b/include/freerdp/update.h new file mode 100644 index 000000000..46dba06f7 --- /dev/null +++ b/include/freerdp/update.h @@ -0,0 +1,465 @@ +/** + * FreeRDP: A Remote Desktop Protocol Client + * Update Interface API + * + * Copyright 2011 Marc-Andre Moreau + * + * 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 __UPDATE_API_H +#define __UPDATE_API_H + +#include + +/* Bitmap Updates */ + +typedef struct +{ + uint16 left; + uint16 top; + uint16 right; + uint16 bottom; + uint16 width; + uint16 height; + uint16 bpp; + uint16 flags; + uint16 length; + uint8* data; +} BITMAP_DATA; + +typedef struct +{ + uint16 number; + BITMAP_DATA* bitmaps; +} BITMAP_UPDATE; + +/* Palette Updates */ + +typedef struct +{ + uint32 number; + uint32 entries[256]; +} PALETTE_UPDATE; + +/* Orders Updates */ + +typedef struct +{ + uint8 orderType; + uint32 fieldFlags; + uint16 boundLeft; + uint16 boundTop; + uint16 boundRight; + uint16 boundBottom; + sint8 deltaBoundLeft; + sint8 deltaBoundTop; + sint8 deltaBoundRight; + sint8 deltaBoundBottom; + boolean deltaCoordinates; +} ORDER_INFO; + +typedef struct +{ + sint16 nLeftRect; + sint16 nTopRect; + sint16 nWidth; + sint16 nHeight; + uint8 bRop; +} DSTBLT_ORDER; + +typedef struct +{ + sint16 nLeftRect; + sint16 nTopRect; + sint16 nWidth; + sint16 nHeight; + uint8 bRop; + uint32 backColor; + uint32 foreColor; + uint8 brushOrgX; + uint8 brushOrgY; + uint8 brushStyle; + uint8 brushHatch; + uint8 brushExtra[7]; +} PATBLT_ORDER; + +typedef struct +{ + sint16 nLeftRect; + sint16 nTopRect; + sint16 nWidth; + sint16 nHeight; + uint8 bRop; + sint16 nXSrc; + sint16 nYSrc; +} SCRBLT_ORDER; + +typedef struct +{ + sint16 srcLeft; + sint16 srcTop; + sint16 srcRight; + sint16 srcBottom; + uint16 bitmapId; +} DRAW_NINE_GRID_ORDER; + +typedef struct +{ + sint16 srcLeft; + sint16 srcTop; + sint16 srcRight; + sint16 srcBottom; + uint16 bitmapId; + uint8 nDeltaEntries; + uint8* codeDeltaList; +} MULTI_DRAW_NINE_GRID_ORDER; + +typedef struct +{ + uint16 backMode; + sint16 nXStart; + sint16 nYStart; + sint16 nXEnd; + sint16 nYEnd; + uint32 backColor; + uint8 bRop2; + uint8 penStyle; + uint8 penWidth; + uint32 penColor; +} LINE_TO_ORDER; + +typedef struct +{ + sint16 nLeftRect; + sint16 nTopRect; + sint16 nWidth; + sint16 nHeight; + uint32 color; +} OPAQUE_RECT_ORDER; + +typedef struct +{ + uint32 savedBitmapPosition; + sint16 nLeftRect; + sint16 nTopRect; + sint16 nRightRect; + sint16 nBottomRect; + uint8 operation; +} SAVE_BITMAP_ORDER; + +typedef struct +{ + uint16 cacheId; + sint16 nLeftRect; + sint16 nTopRect; + sint16 nWidth; + sint16 nHeight; + uint8 bRop; + sint16 nXSrc; + sint16 nYSrc; + uint16 cacheIndex; +} MEMBLT_ORDER; + +typedef struct +{ + uint16 cacheId; + sint16 nLeftRect; + sint16 nTopRect; + sint16 nWidth; + sint16 nHeight; + uint8 bRop; + sint16 nXSrc; + sint16 nYSrc; + uint32 backColor; + uint32 foreColor; + uint8 brushOrgX; + uint8 brushOrgY; + uint8 brushStyle; + uint8 brushHatch; + uint8 brushExtra[7]; + uint16 cacheIndex; +} MEM3BLT_ORDER; + +typedef struct +{ + sint16 nLeftRect; + sint16 nTopRect; + sint16 nWidth; + sint16 nHeight; + uint8 bRop; + uint8 nDeltaEntries; + uint8* codeDeltaList; +} MULTI_DSTBLT_ORDER; + +typedef struct +{ + sint16 nLeftRect; + sint16 nTopRect; + sint16 nWidth; + sint16 nHeight; + uint8 bRop; + uint32 backColor; + uint32 foreColor; + uint8 brushOrgX; + uint8 brushOrgY; + uint8 brushStyle; + uint8 brushHatch; + uint8 brushExtra[7]; + uint8 nDeltaEntries; + uint8* codeDeltaList; +} MULTI_PATBLT_ORDER; + +typedef struct +{ + sint16 nLeftRect; + sint16 nTopRect; + sint16 nWidth; + sint16 nHeight; + uint8 bRop; + sint16 nXSrc; + sint16 nYSrc; + uint8 nDeltaEntries; + uint8* codeDeltaList; +} MULTI_SCRBLT_ORDER; + +typedef struct +{ + sint16 nLeftRect; + sint16 nTopRect; + sint16 nWidth; + sint16 nHeight; + uint32 color; + uint8 nDeltaEntries; + uint8* codeDeltaList; +} MULTI_OPAQUE_RECT_ORDER; + +typedef struct +{ + uint8 cacheId; + uint16 fDrawing; + uint32 backColor; + uint32 foreColor; + sint16 bkLeft; + sint16 bkTop; + sint16 bkRight; + sint16 bkBottom; + sint16 opLeft; + sint16 opTop; + sint16 opRight; + sint16 opBottom; + uint16 x; + uint16 y; + uint8* data; +} FAST_INDEX_ORDER; + +typedef struct +{ + sint16 xStart; + sint16 yStart; + uint8 bRop2; + uint8 fillMode; + uint32 brushColor; + uint8 nDeltaEntries; + uint8* codeDeltaList; +} POLYGON_SC_ORDER; + +typedef struct +{ + sint16 xStart; + sint16 yStart; + uint8 bRop2; + uint8 fillMode; + uint32 backColor; + uint32 foreColor; + uint8 brushOrgX; + uint8 brushOrgY; + uint8 brushStyle; + uint8 brushHatch; + uint8 brushExtra[7]; + uint8 nDeltaEntries; + uint8* codeDeltaList; +} POLYGON_CB_ORDER; + +typedef struct +{ + sint16 xStart; + sint16 yStart; + uint8 bRop2; + uint32 penColor; + uint8 nDeltaEntries; + uint8* codeDeltaList; +} POLYLINE_ORDER; + +typedef struct +{ + uint8 cacheId; + uint16 fDrawing; + uint32 backColor; + uint32 foreColor; + sint16 bkLeft; + sint16 bkTop; + sint16 bkRight; + sint16 bkBottom; + sint16 opLeft; + sint16 opTop; + sint16 opRight; + sint16 opBottom; + uint16 x; + uint16 y; + uint8* data; +} FAST_GLYPH_ORDER; + +typedef struct +{ + sint16 leftRect; + sint16 topRect; + sint16 rightRect; + sint16 bottomRect; + uint8 bRop2; + uint8 fillMode; + uint32 color; +} ELLIPSE_SC_ORDER; + +typedef struct +{ + sint16 leftRect; + sint16 topRect; + sint16 rightRect; + sint16 bottomRect; + uint8 bRop2; + uint8 fillMode; + uint32 backColor; + uint32 foreColor; + uint8 brushOrgX; + uint8 brushOrgY; + uint8 brushStyle; + uint8 brushHatch; + uint8 brushExtra[7]; +} ELLIPSE_CB_ORDER; + +typedef struct +{ + uint8 cacheId; + uint8 flAccel; + uint8 ulCharInc; + uint8 fOpRedundant; + uint32 backColor; + uint32 foreColor; + sint16 bkLeft; + sint16 bkTop; + sint16 bkRight; + sint16 bkBottom; + sint16 opLeft; + sint16 opTop; + sint16 opRight; + sint16 opBottom; + uint8 brushOrgX; + uint8 brushOrgY; + uint8 brushStyle; + uint8 brushHatch; + uint8 brushExtra[7]; + sint16 x; + sint16 y; + uint8* data; +} GLYPH_INDEX_ORDER; + +/* Update Interface */ + +typedef struct rdp_update rdpUpdate; + +typedef int (*pcSynchronize)(rdpUpdate* update); +typedef int (*pcBitmap)(rdpUpdate* update, BITMAP_UPDATE* bitmap); +typedef int (*pcPalette)(rdpUpdate* update, PALETTE_UPDATE* palette); +typedef int (*pcDstBlt)(rdpUpdate* update, DSTBLT_ORDER* dstblt); +typedef int (*pcPatBlt)(rdpUpdate* update, PATBLT_ORDER* patblt); +typedef int (*pcScrBlt)(rdpUpdate* update, SCRBLT_ORDER* scrblt); +typedef int (*pcDrawNineGrid)(rdpUpdate* update, DRAW_NINE_GRID_ORDER* draw_nine_grid); +typedef int (*pcMultiDrawNineGrid)(rdpUpdate* update, MULTI_DRAW_NINE_GRID_ORDER* multi_draw_nine_grid); +typedef int (*pcLineTo)(rdpUpdate* update, LINE_TO_ORDER* line_to); +typedef int (*pcOpaqueRect)(rdpUpdate* update, OPAQUE_RECT_ORDER* opaque_rect); +typedef int (*pcSaveBitmap)(rdpUpdate* update, SAVE_BITMAP_ORDER* save_bitmap); +typedef int (*pcMemBlt)(rdpUpdate* update, MEMBLT_ORDER* memblt); +typedef int (*pcMem3Blt)(rdpUpdate* update, MEM3BLT_ORDER* memblt); +typedef int (*pcMultiDstBlt)(rdpUpdate* update, MULTI_DSTBLT_ORDER* multi_dstblt); +typedef int (*pcMultiPatBlt)(rdpUpdate* update, MULTI_PATBLT_ORDER* multi_patblt); +typedef int (*pcMultiScrBlt)(rdpUpdate* update, MULTI_SCRBLT_ORDER* multi_scrblt); +typedef int (*pcMultiOpaqueRect)(rdpUpdate* update, MULTI_OPAQUE_RECT_ORDER* multi_opaque_rect); +typedef int (*pcFastIndex)(rdpUpdate* update, FAST_INDEX_ORDER* fast_index); +typedef int (*pcPolygonSC)(rdpUpdate* update, POLYGON_SC_ORDER* polygon_sc); +typedef int (*pcPolygonCB)(rdpUpdate* update, POLYGON_CB_ORDER* polygon_cb); +typedef int (*pcPolyline)(rdpUpdate* update, POLYLINE_ORDER* polyline); +typedef int (*pcFastGlyph)(rdpUpdate* update, FAST_GLYPH_ORDER* fast_glyph); +typedef int (*pcEllipseSC)(rdpUpdate* update, ELLIPSE_SC_ORDER* ellipse_sc); +typedef int (*pcEllipseCB)(rdpUpdate* update, ELLIPSE_CB_ORDER* ellipse_cb); +typedef int (*pcGlyphIndex)(rdpUpdate* update, GLYPH_INDEX_ORDER* glyph_index); + +struct rdp_update +{ + void* rdp; + + pcSynchronize Synchronize; + pcBitmap Bitmap; + pcPalette Palette; + pcDstBlt DstBlt; + pcPatBlt PatBlt; + pcScrBlt ScrBlt; + pcDrawNineGrid DrawNineGrid; + pcMultiDrawNineGrid MultiDrawNineGrid; + pcLineTo LineTo; + pcOpaqueRect OpaqueRect; + pcSaveBitmap SaveBitmap; + pcMemBlt MemBlt; + pcMem3Blt Mem3Blt; + pcMultiDstBlt MultiDstBlt; + pcMultiPatBlt MultiPatBlt; + pcMultiScrBlt MultiScrBlt; + pcMultiOpaqueRect MultiOpaqueRect; + pcFastIndex FastIndex; + pcPolygonSC PolygonSC; + pcPolygonCB PolygonCB; + pcPolyline Polyline; + pcFastGlyph FastGlyph; + pcEllipseSC EllipseSC; + pcEllipseCB EllipseCB; + pcGlyphIndex GlyphIndex; + + BITMAP_UPDATE bitmap_update; + PALETTE_UPDATE palette_update; + ORDER_INFO order_info; + DSTBLT_ORDER dstblt; + PATBLT_ORDER patblt; + SCRBLT_ORDER scrblt; + DRAW_NINE_GRID_ORDER draw_nine_grid; + MULTI_DRAW_NINE_GRID_ORDER multi_draw_nine_grid; + LINE_TO_ORDER line_to; + OPAQUE_RECT_ORDER opaque_rect; + SAVE_BITMAP_ORDER save_bitmap; + MEMBLT_ORDER memblt; + MEM3BLT_ORDER mem3blt; + MULTI_DSTBLT_ORDER multi_dstblt; + MULTI_PATBLT_ORDER multi_patblt; + MULTI_SCRBLT_ORDER multi_scrblt; + MULTI_OPAQUE_RECT_ORDER multi_opaque_rect; + FAST_INDEX_ORDER fast_index; + POLYGON_SC_ORDER polygon_sc; + POLYGON_CB_ORDER polygon_cb; + POLYLINE_ORDER polyline; + FAST_GLYPH_ORDER fast_glyph; + ELLIPSE_SC_ORDER ellipse_sc; + ELLIPSE_CB_ORDER ellipse_cb; + GLYPH_INDEX_ORDER glyph_index; +}; + +#endif /* __UPDATE_API_H */ + diff --git a/libfreerdp-core/CMakeLists.txt b/libfreerdp-core/CMakeLists.txt index d0a68f3c6..3608d4e8c 100644 --- a/libfreerdp-core/CMakeLists.txt +++ b/libfreerdp-core/CMakeLists.txt @@ -51,6 +51,7 @@ set(LIBFREERDP_CORE_SRCS settings.c orders.c orders.h + freerdp.c capabilities.c capabilities.h certificate.c diff --git a/libfreerdp-core/freerdp.c b/libfreerdp-core/freerdp.c new file mode 100644 index 000000000..35b414df8 --- /dev/null +++ b/libfreerdp-core/freerdp.c @@ -0,0 +1,48 @@ +/** + * FreeRDP: A Remote Desktop Protocol Client + * FreeRDP Core + * + * Copyright 2011 Marc-Andre Moreau + * + * 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. + */ + +#include "rdp.h" +#include "input.h" +#include "update.h" + +#include +#include + +freerdp* freerdp_new() +{ + freerdp* instance; + + instance = xzalloc(sizeof(freerdp)); + + if (instance != NULL) + { + rdpRdp* rdp = rdp_new(); + instance->rdp = (void*) rdp; + instance->input = rdp->input; + instance->update = rdp->update; + instance->settings = rdp->settings; + } + + return instance; +} + +void freerdp_free(freerdp* freerdp) +{ + xfree(freerdp); +} diff --git a/libfreerdp-core/input.h b/libfreerdp-core/input.h index 3e7c43c59..da042f0c6 100644 --- a/libfreerdp-core/input.h +++ b/libfreerdp-core/input.h @@ -22,63 +22,13 @@ #include "rdp.h" +#include #include #include #include -/* Input Events */ -#define INPUT_EVENT_SYNC 0x0000 -#define INPUT_EVENT_SCANCODE 0x0004 -#define INPUT_EVENT_UNICODE 0x0005 -#define INPUT_EVENT_MOUSE 0x8001 -#define INPUT_EVENT_MOUSEX 0x8002 - -/* keyboard Flags */ -#define KBD_FLAGS_EXTENDED 0x0100 -#define KBD_FLAGS_DOWN 0x4000 -#define KBD_FLAGS_RELEASE 0x8000 - -/* Pointer Flags */ -#define PTR_FLAGS_WHEEL 0x0200 -#define PTR_FLAGS_WHEEL_NEGATIVE 0x0100 -#define PTR_FLAGS_MOVE 0x0800 -#define PTR_FLAGS_DOWN 0x8000 -#define PTR_FLAGS_BUTTON1 0x1000 -#define PTR_FLAGS_BUTTON2 0x2000 -#define PTR_FLAGS_BUTTON3 0x4000 -#define WheelRotationMask 0x01FF - -/* Extended Pointer Flags */ -#define PTR_XFLAGS_DOWN 0x8000 -#define PTR_XFLAGS_BUTTON1 0x0001 -#define PTR_XFLAGS_BUTTON2 0x0002 - -/* Keyboard Toggle Flags */ -#define KBD_SYNC_SCROLL_LOCK 0x00000001 -#define KBD_SYNC_NUM_LOCK 0x00000002 -#define KBD_SYNC_CAPS_LOCK 0x00000004 -#define KBD_SYNC_KANA_LOCK 0x00000008 - #define RDP_CLIENT_INPUT_PDU_HEADER_LENGTH 4 -typedef struct rdp_input rdpInput; - -typedef void (*pcSynchronizeEvent)(rdpInput* input, uint32 flags); -typedef void (*pcKeyboardEvent)(rdpInput* input, uint16 flags, uint16 code); -typedef void (*pcUnicodeKeyboardEvent)(rdpInput* input, uint16 code); -typedef void (*pcMouseEvent)(rdpInput* input, uint16 flags, uint16 x, uint16 y); -typedef void (*pcExtendedMouseEvent)(rdpInput* input, uint16 flags, uint16 x, uint16 y); - -struct rdp_input -{ - struct rdp_rdp* rdp; - pcSynchronizeEvent SynchronizeEvent; - pcKeyboardEvent KeyboardEvent; - pcUnicodeKeyboardEvent UnicodeKeyboardEvent; - pcMouseEvent MouseEvent; - pcExtendedMouseEvent ExtendedMouseEvent; -}; - void input_send_synchronize_event(rdpInput* input, uint32 flags); void input_send_keyboard_event(rdpInput* input, uint16 flags, uint16 code); void input_send_unicode_keyboard_event(rdpInput* input, uint16 code); diff --git a/libfreerdp-core/orders.c b/libfreerdp-core/orders.c index 67426edc4..a45864f96 100644 --- a/libfreerdp-core/orders.c +++ b/libfreerdp-core/orders.c @@ -104,7 +104,7 @@ uint8 PRIMARY_DRAWING_ORDER_FIELD_BYTES[] = GLYPH_INDEX_ORDER_FIELD_BYTES }; -void rdp_read_coord(STREAM* s, sint16* coord, boolean delta) +void update_read_coord(STREAM* s, sint16* coord, boolean delta) { sint8 byte; @@ -119,7 +119,7 @@ void rdp_read_coord(STREAM* s, sint16* coord, boolean delta) } } -void rdp_read_color(STREAM* s, uint32* color) +void update_read_color(STREAM* s, uint32* color) { uint8 byte; @@ -133,46 +133,46 @@ void rdp_read_color(STREAM* s, uint32* color) /* Primary Drawing Orders */ -void rdp_read_dstblt_order(STREAM* s, ORDER_INFO* orderInfo, DSTBLT_ORDER* dstblt) +void update_read_dstblt_order(STREAM* s, ORDER_INFO* orderInfo, DSTBLT_ORDER* dstblt) { if (orderInfo->fieldFlags & ORDER_FIELD_01) - rdp_read_coord(s, &dstblt->nLeftRect, orderInfo->deltaCoordinates); + update_read_coord(s, &dstblt->nLeftRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_02) - rdp_read_coord(s, &dstblt->nTopRect, orderInfo->deltaCoordinates); + update_read_coord(s, &dstblt->nTopRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_03) - rdp_read_coord(s, &dstblt->nWidth, orderInfo->deltaCoordinates); + update_read_coord(s, &dstblt->nWidth, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_04) - rdp_read_coord(s, &dstblt->nHeight, orderInfo->deltaCoordinates); + update_read_coord(s, &dstblt->nHeight, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_05) stream_read_uint8(s, dstblt->bRop); } -void rdp_read_patblt_order(STREAM* s, ORDER_INFO* orderInfo, PATBLT_ORDER* patblt) +void update_read_patblt_order(STREAM* s, ORDER_INFO* orderInfo, PATBLT_ORDER* patblt) { if (orderInfo->fieldFlags & ORDER_FIELD_01) - rdp_read_coord(s, &patblt->nLeftRect, orderInfo->deltaCoordinates); + update_read_coord(s, &patblt->nLeftRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_02) - rdp_read_coord(s, &patblt->nTopRect, orderInfo->deltaCoordinates); + update_read_coord(s, &patblt->nTopRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_03) - rdp_read_coord(s, &patblt->nWidth, orderInfo->deltaCoordinates); + update_read_coord(s, &patblt->nWidth, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_04) - rdp_read_coord(s, &patblt->nHeight, orderInfo->deltaCoordinates); + update_read_coord(s, &patblt->nHeight, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_05) stream_read_uint8(s, patblt->bRop); if (orderInfo->fieldFlags & ORDER_FIELD_06) - rdp_read_color(s, &patblt->backColor); + update_read_color(s, &patblt->backColor); if (orderInfo->fieldFlags & ORDER_FIELD_07) - rdp_read_color(s, &patblt->foreColor); + update_read_color(s, &patblt->foreColor); if (orderInfo->fieldFlags & ORDER_FIELD_08) stream_read_uint8(s, patblt->brushOrgX); @@ -190,59 +190,59 @@ void rdp_read_patblt_order(STREAM* s, ORDER_INFO* orderInfo, PATBLT_ORDER* patbl stream_read(s, patblt->brushExtra, 7); } -void rdp_read_scrblt_order(STREAM* s, ORDER_INFO* orderInfo, SCRBLT_ORDER* scrblt) +void update_read_scrblt_order(STREAM* s, ORDER_INFO* orderInfo, SCRBLT_ORDER* scrblt) { if (orderInfo->fieldFlags & ORDER_FIELD_01) - rdp_read_coord(s, &scrblt->nLeftRect, orderInfo->deltaCoordinates); + update_read_coord(s, &scrblt->nLeftRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_02) - rdp_read_coord(s, &scrblt->nTopRect, orderInfo->deltaCoordinates); + update_read_coord(s, &scrblt->nTopRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_03) - rdp_read_coord(s, &scrblt->nWidth, orderInfo->deltaCoordinates); + update_read_coord(s, &scrblt->nWidth, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_04) - rdp_read_coord(s, &scrblt->nHeight, orderInfo->deltaCoordinates); + update_read_coord(s, &scrblt->nHeight, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_05) stream_read_uint8(s, scrblt->bRop); if (orderInfo->fieldFlags & ORDER_FIELD_06) - rdp_read_coord(s, &scrblt->nXSrc, orderInfo->deltaCoordinates); + update_read_coord(s, &scrblt->nXSrc, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_07) - rdp_read_coord(s, &scrblt->nYSrc, orderInfo->deltaCoordinates); + update_read_coord(s, &scrblt->nYSrc, orderInfo->deltaCoordinates); } -void rdp_read_draw_nine_grid_order(STREAM* s, ORDER_INFO* orderInfo, DRAW_NINE_GRID_ORDER* draw_nine_grid) +void update_read_draw_nine_grid_order(STREAM* s, ORDER_INFO* orderInfo, DRAW_NINE_GRID_ORDER* draw_nine_grid) { } -void rdp_read_multi_draw_nine_grid_order(STREAM* s, ORDER_INFO* orderInfo, MULTI_DRAW_NINE_GRID_ORDER* multi_draw_nine_grid) +void update_read_multi_draw_nine_grid_order(STREAM* s, ORDER_INFO* orderInfo, MULTI_DRAW_NINE_GRID_ORDER* multi_draw_nine_grid) { } -void rdp_read_line_to_order(STREAM* s, ORDER_INFO* orderInfo, LINE_TO_ORDER* line_to) +void update_read_line_to_order(STREAM* s, ORDER_INFO* orderInfo, LINE_TO_ORDER* line_to) { if (orderInfo->fieldFlags & ORDER_FIELD_01) stream_read_uint16(s, line_to->backMode); if (orderInfo->fieldFlags & ORDER_FIELD_02) - rdp_read_coord(s, &line_to->nXStart, orderInfo->deltaCoordinates); + update_read_coord(s, &line_to->nXStart, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_03) - rdp_read_coord(s, &line_to->nYStart, orderInfo->deltaCoordinates); + update_read_coord(s, &line_to->nYStart, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_04) - rdp_read_coord(s, &line_to->nXEnd, orderInfo->deltaCoordinates); + update_read_coord(s, &line_to->nXEnd, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_05) - rdp_read_coord(s, &line_to->nYEnd, orderInfo->deltaCoordinates); + update_read_coord(s, &line_to->nYEnd, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_06) - rdp_read_color(s, &line_to->backColor); + update_read_color(s, &line_to->backColor); if (orderInfo->fieldFlags & ORDER_FIELD_07) stream_read_uint8(s, line_to->bRop2); @@ -254,24 +254,24 @@ void rdp_read_line_to_order(STREAM* s, ORDER_INFO* orderInfo, LINE_TO_ORDER* lin stream_read_uint8(s, line_to->penWidth); if (orderInfo->fieldFlags & ORDER_FIELD_10) - rdp_read_color(s, &line_to->penColor); + update_read_color(s, &line_to->penColor); } -void rdp_read_opaque_rect_order(STREAM* s, ORDER_INFO* orderInfo, OPAQUE_RECT_ORDER* opaque_rect) +void update_read_opaque_rect_order(STREAM* s, ORDER_INFO* orderInfo, OPAQUE_RECT_ORDER* opaque_rect) { uint8 byte; if (orderInfo->fieldFlags & ORDER_FIELD_01) - rdp_read_coord(s, &opaque_rect->nLeftRect, orderInfo->deltaCoordinates); + update_read_coord(s, &opaque_rect->nLeftRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_02) - rdp_read_coord(s, &opaque_rect->nTopRect, orderInfo->deltaCoordinates); + update_read_coord(s, &opaque_rect->nTopRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_03) - rdp_read_coord(s, &opaque_rect->nWidth, orderInfo->deltaCoordinates); + update_read_coord(s, &opaque_rect->nWidth, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_04) - rdp_read_coord(s, &opaque_rect->nHeight, orderInfo->deltaCoordinates); + update_read_coord(s, &opaque_rect->nHeight, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_05) { @@ -292,88 +292,88 @@ void rdp_read_opaque_rect_order(STREAM* s, ORDER_INFO* orderInfo, OPAQUE_RECT_OR } } -void rdp_read_save_bitmap_order(STREAM* s, ORDER_INFO* orderInfo, SAVE_BITMAP_ORDER* save_bitmap) +void update_read_save_bitmap_order(STREAM* s, ORDER_INFO* orderInfo, SAVE_BITMAP_ORDER* save_bitmap) { if (orderInfo->fieldFlags & ORDER_FIELD_01) stream_read_uint32(s, save_bitmap->savedBitmapPosition); if (orderInfo->fieldFlags & ORDER_FIELD_02) - rdp_read_coord(s, &save_bitmap->nLeftRect, orderInfo->deltaCoordinates); + update_read_coord(s, &save_bitmap->nLeftRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_03) - rdp_read_coord(s, &save_bitmap->nTopRect, orderInfo->deltaCoordinates); + update_read_coord(s, &save_bitmap->nTopRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_04) - rdp_read_coord(s, &save_bitmap->nRightRect, orderInfo->deltaCoordinates); + update_read_coord(s, &save_bitmap->nRightRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_05) - rdp_read_coord(s, &save_bitmap->nBottomRect, orderInfo->deltaCoordinates); + update_read_coord(s, &save_bitmap->nBottomRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_06) stream_read_uint8(s, save_bitmap->operation); } -void rdp_read_memblt_order(STREAM* s, ORDER_INFO* orderInfo, MEMBLT_ORDER* memblt) +void update_read_memblt_order(STREAM* s, ORDER_INFO* orderInfo, MEMBLT_ORDER* memblt) { if (orderInfo->fieldFlags & ORDER_FIELD_01) stream_read_uint16(s, memblt->cacheId); if (orderInfo->fieldFlags & ORDER_FIELD_02) - rdp_read_coord(s, &memblt->nLeftRect, orderInfo->deltaCoordinates); + update_read_coord(s, &memblt->nLeftRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_03) - rdp_read_coord(s, &memblt->nTopRect, orderInfo->deltaCoordinates); + update_read_coord(s, &memblt->nTopRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_04) - rdp_read_coord(s, &memblt->nWidth, orderInfo->deltaCoordinates); + update_read_coord(s, &memblt->nWidth, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_05) - rdp_read_coord(s, &memblt->nHeight, orderInfo->deltaCoordinates); + update_read_coord(s, &memblt->nHeight, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_06) stream_read_uint8(s, memblt->bRop); if (orderInfo->fieldFlags & ORDER_FIELD_07) - rdp_read_coord(s, &memblt->nXSrc, orderInfo->deltaCoordinates); + update_read_coord(s, &memblt->nXSrc, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_08) - rdp_read_coord(s, &memblt->nYSrc, orderInfo->deltaCoordinates); + update_read_coord(s, &memblt->nYSrc, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_09) stream_read_uint16(s, memblt->cacheIndex); } -void rdp_read_mem3blt_order(STREAM* s, ORDER_INFO* orderInfo, MEM3BLT_ORDER* mem3blt) +void update_read_mem3blt_order(STREAM* s, ORDER_INFO* orderInfo, MEM3BLT_ORDER* mem3blt) { if (orderInfo->fieldFlags & ORDER_FIELD_01) stream_read_uint16(s, mem3blt->cacheId); if (orderInfo->fieldFlags & ORDER_FIELD_02) - rdp_read_coord(s, &mem3blt->nLeftRect, orderInfo->deltaCoordinates); + update_read_coord(s, &mem3blt->nLeftRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_03) - rdp_read_coord(s, &mem3blt->nTopRect, orderInfo->deltaCoordinates); + update_read_coord(s, &mem3blt->nTopRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_04) - rdp_read_coord(s, &mem3blt->nWidth, orderInfo->deltaCoordinates); + update_read_coord(s, &mem3blt->nWidth, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_05) - rdp_read_coord(s, &mem3blt->nHeight, orderInfo->deltaCoordinates); + update_read_coord(s, &mem3blt->nHeight, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_06) stream_read_uint8(s, mem3blt->bRop); if (orderInfo->fieldFlags & ORDER_FIELD_07) - rdp_read_coord(s, &mem3blt->nXSrc, orderInfo->deltaCoordinates); + update_read_coord(s, &mem3blt->nXSrc, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_08) - rdp_read_coord(s, &mem3blt->nYSrc, orderInfo->deltaCoordinates); + update_read_coord(s, &mem3blt->nYSrc, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_09) - rdp_read_color(s, &mem3blt->backColor); + update_read_color(s, &mem3blt->backColor); if (orderInfo->fieldFlags & ORDER_FIELD_10) - rdp_read_color(s, &mem3blt->foreColor); + update_read_color(s, &mem3blt->foreColor); if (orderInfo->fieldFlags & ORDER_FIELD_11) stream_read_uint8(s, mem3blt->brushOrgX); @@ -394,19 +394,19 @@ void rdp_read_mem3blt_order(STREAM* s, ORDER_INFO* orderInfo, MEM3BLT_ORDER* mem stream_read_uint16(s, mem3blt->cacheIndex); } -void rdp_read_multi_dstblt_order(STREAM* s, ORDER_INFO* orderInfo, MULTI_DSTBLT_ORDER* multi_dstblt) +void update_read_multi_dstblt_order(STREAM* s, ORDER_INFO* orderInfo, MULTI_DSTBLT_ORDER* multi_dstblt) { if (orderInfo->fieldFlags & ORDER_FIELD_01) - rdp_read_coord(s, &multi_dstblt->nLeftRect, orderInfo->deltaCoordinates); + update_read_coord(s, &multi_dstblt->nLeftRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_02) - rdp_read_coord(s, &multi_dstblt->nTopRect, orderInfo->deltaCoordinates); + update_read_coord(s, &multi_dstblt->nTopRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_03) - rdp_read_coord(s, &multi_dstblt->nWidth, orderInfo->deltaCoordinates); + update_read_coord(s, &multi_dstblt->nWidth, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_04) - rdp_read_coord(s, &multi_dstblt->nHeight, orderInfo->deltaCoordinates); + update_read_coord(s, &multi_dstblt->nHeight, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_05) stream_read_uint8(s, multi_dstblt->bRop); @@ -417,28 +417,28 @@ void rdp_read_multi_dstblt_order(STREAM* s, ORDER_INFO* orderInfo, MULTI_DSTBLT_ /* codeDeltaList */ } -void rdp_read_multi_patblt_order(STREAM* s, ORDER_INFO* orderInfo, MULTI_PATBLT_ORDER* multi_patblt) +void update_read_multi_patblt_order(STREAM* s, ORDER_INFO* orderInfo, MULTI_PATBLT_ORDER* multi_patblt) { if (orderInfo->fieldFlags & ORDER_FIELD_01) - rdp_read_coord(s, &multi_patblt->nLeftRect, orderInfo->deltaCoordinates); + update_read_coord(s, &multi_patblt->nLeftRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_02) - rdp_read_coord(s, &multi_patblt->nTopRect, orderInfo->deltaCoordinates); + update_read_coord(s, &multi_patblt->nTopRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_03) - rdp_read_coord(s, &multi_patblt->nWidth, orderInfo->deltaCoordinates); + update_read_coord(s, &multi_patblt->nWidth, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_04) - rdp_read_coord(s, &multi_patblt->nHeight, orderInfo->deltaCoordinates); + update_read_coord(s, &multi_patblt->nHeight, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_05) stream_read_uint8(s, multi_patblt->bRop); if (orderInfo->fieldFlags & ORDER_FIELD_06) - rdp_read_color(s, &multi_patblt->backColor); + update_read_color(s, &multi_patblt->backColor); if (orderInfo->fieldFlags & ORDER_FIELD_07) - rdp_read_color(s, &multi_patblt->foreColor); + update_read_color(s, &multi_patblt->foreColor); if (orderInfo->fieldFlags & ORDER_FIELD_08) stream_read_uint8(s, multi_patblt->brushOrgX); @@ -461,28 +461,28 @@ void rdp_read_multi_patblt_order(STREAM* s, ORDER_INFO* orderInfo, MULTI_PATBLT_ /* codeDeltaList */ } -void rdp_read_multi_scrblt_order(STREAM* s, ORDER_INFO* orderInfo, MULTI_SCRBLT_ORDER* multi_scrblt) +void update_read_multi_scrblt_order(STREAM* s, ORDER_INFO* orderInfo, MULTI_SCRBLT_ORDER* multi_scrblt) { if (orderInfo->fieldFlags & ORDER_FIELD_01) - rdp_read_coord(s, &multi_scrblt->nLeftRect, orderInfo->deltaCoordinates); + update_read_coord(s, &multi_scrblt->nLeftRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_02) - rdp_read_coord(s, &multi_scrblt->nTopRect, orderInfo->deltaCoordinates); + update_read_coord(s, &multi_scrblt->nTopRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_03) - rdp_read_coord(s, &multi_scrblt->nWidth, orderInfo->deltaCoordinates); + update_read_coord(s, &multi_scrblt->nWidth, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_04) - rdp_read_coord(s, &multi_scrblt->nHeight, orderInfo->deltaCoordinates); + update_read_coord(s, &multi_scrblt->nHeight, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_05) stream_read_uint8(s, multi_scrblt->bRop); if (orderInfo->fieldFlags & ORDER_FIELD_06) - rdp_read_coord(s, &multi_scrblt->nXSrc, orderInfo->deltaCoordinates); + update_read_coord(s, &multi_scrblt->nXSrc, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_07) - rdp_read_coord(s, &multi_scrblt->nYSrc, orderInfo->deltaCoordinates); + update_read_coord(s, &multi_scrblt->nYSrc, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_08) stream_read_uint8(s, multi_scrblt->nDeltaEntries); @@ -490,21 +490,21 @@ void rdp_read_multi_scrblt_order(STREAM* s, ORDER_INFO* orderInfo, MULTI_SCRBLT_ /* codeDeltaList */ } -void rdp_read_multi_opaque_rect_order(STREAM* s, ORDER_INFO* orderInfo, MULTI_OPAQUE_RECT_ORDER* multi_opaque_rect) +void update_read_multi_opaque_rect_order(STREAM* s, ORDER_INFO* orderInfo, MULTI_OPAQUE_RECT_ORDER* multi_opaque_rect) { uint8 byte; if (orderInfo->fieldFlags & ORDER_FIELD_01) - rdp_read_coord(s, &multi_opaque_rect->nLeftRect, orderInfo->deltaCoordinates); + update_read_coord(s, &multi_opaque_rect->nLeftRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_02) - rdp_read_coord(s, &multi_opaque_rect->nTopRect, orderInfo->deltaCoordinates); + update_read_coord(s, &multi_opaque_rect->nTopRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_03) - rdp_read_coord(s, &multi_opaque_rect->nWidth, orderInfo->deltaCoordinates); + update_read_coord(s, &multi_opaque_rect->nWidth, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_04) - rdp_read_coord(s, &multi_opaque_rect->nHeight, orderInfo->deltaCoordinates); + update_read_coord(s, &multi_opaque_rect->nHeight, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_05) { @@ -530,7 +530,7 @@ void rdp_read_multi_opaque_rect_order(STREAM* s, ORDER_INFO* orderInfo, MULTI_OP /* codeDeltaList */ } -void rdp_read_fast_index_order(STREAM* s, ORDER_INFO* orderInfo, FAST_INDEX_ORDER* fast_index) +void update_read_fast_index_order(STREAM* s, ORDER_INFO* orderInfo, FAST_INDEX_ORDER* fast_index) { if (orderInfo->fieldFlags & ORDER_FIELD_01) stream_read_uint8(s, fast_index->cacheId); @@ -539,51 +539,51 @@ void rdp_read_fast_index_order(STREAM* s, ORDER_INFO* orderInfo, FAST_INDEX_ORDE stream_read_uint16(s, fast_index->fDrawing); if (orderInfo->fieldFlags & ORDER_FIELD_03) - rdp_read_color(s, &fast_index->backColor); + update_read_color(s, &fast_index->backColor); if (orderInfo->fieldFlags & ORDER_FIELD_04) - rdp_read_color(s, &fast_index->foreColor); + update_read_color(s, &fast_index->foreColor); if (orderInfo->fieldFlags & ORDER_FIELD_05) - rdp_read_coord(s, &fast_index->bkLeft, orderInfo->deltaCoordinates); + update_read_coord(s, &fast_index->bkLeft, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_06) - rdp_read_coord(s, &fast_index->bkTop, orderInfo->deltaCoordinates); + update_read_coord(s, &fast_index->bkTop, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_07) - rdp_read_coord(s, &fast_index->bkRight, orderInfo->deltaCoordinates); + update_read_coord(s, &fast_index->bkRight, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_08) - rdp_read_coord(s, &fast_index->bkBottom, orderInfo->deltaCoordinates); + update_read_coord(s, &fast_index->bkBottom, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_09) - rdp_read_coord(s, &fast_index->opLeft, orderInfo->deltaCoordinates); + update_read_coord(s, &fast_index->opLeft, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_10) - rdp_read_coord(s, &fast_index->opTop, orderInfo->deltaCoordinates); + update_read_coord(s, &fast_index->opTop, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_11) - rdp_read_coord(s, &fast_index->opRight, orderInfo->deltaCoordinates); + update_read_coord(s, &fast_index->opRight, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_12) - rdp_read_coord(s, &fast_index->opBottom, orderInfo->deltaCoordinates); + update_read_coord(s, &fast_index->opBottom, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_13) - rdp_read_coord(s, &fast_index->x, orderInfo->deltaCoordinates); + update_read_coord(s, &fast_index->x, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_14) - rdp_read_coord(s, &fast_index->y, orderInfo->deltaCoordinates); + update_read_coord(s, &fast_index->y, orderInfo->deltaCoordinates); /* bytes */ } -void rdp_read_polygon_sc_order(STREAM* s, ORDER_INFO* orderInfo, POLYGON_SC_ORDER* polygon_sc) +void update_read_polygon_sc_order(STREAM* s, ORDER_INFO* orderInfo, POLYGON_SC_ORDER* polygon_sc) { if (orderInfo->fieldFlags & ORDER_FIELD_01) - rdp_read_coord(s, &polygon_sc->xStart, orderInfo->deltaCoordinates); + update_read_coord(s, &polygon_sc->xStart, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_02) - rdp_read_coord(s, &polygon_sc->yStart, orderInfo->deltaCoordinates); + update_read_coord(s, &polygon_sc->yStart, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_03) stream_read_uint8(s, polygon_sc->bRop2); @@ -592,7 +592,7 @@ void rdp_read_polygon_sc_order(STREAM* s, ORDER_INFO* orderInfo, POLYGON_SC_ORDE stream_read_uint8(s, polygon_sc->fillMode); if (orderInfo->fieldFlags & ORDER_FIELD_05) - rdp_read_color(s, &polygon_sc->brushColor); + update_read_color(s, &polygon_sc->brushColor); if (orderInfo->fieldFlags & ORDER_FIELD_06) stream_read_uint8(s, polygon_sc->nDeltaEntries); @@ -600,13 +600,13 @@ void rdp_read_polygon_sc_order(STREAM* s, ORDER_INFO* orderInfo, POLYGON_SC_ORDE /* codeDeltaList */ } -void rdp_read_polygon_cb_order(STREAM* s, ORDER_INFO* orderInfo, POLYGON_CB_ORDER* polygon_cb) +void update_read_polygon_cb_order(STREAM* s, ORDER_INFO* orderInfo, POLYGON_CB_ORDER* polygon_cb) { if (orderInfo->fieldFlags & ORDER_FIELD_01) - rdp_read_coord(s, &polygon_cb->xStart, orderInfo->deltaCoordinates); + update_read_coord(s, &polygon_cb->xStart, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_02) - rdp_read_coord(s, &polygon_cb->yStart, orderInfo->deltaCoordinates); + update_read_coord(s, &polygon_cb->yStart, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_03) stream_read_uint8(s, polygon_cb->bRop2); @@ -615,10 +615,10 @@ void rdp_read_polygon_cb_order(STREAM* s, ORDER_INFO* orderInfo, POLYGON_CB_ORDE stream_read_uint8(s, polygon_cb->fillMode); if (orderInfo->fieldFlags & ORDER_FIELD_05) - rdp_read_color(s, &polygon_cb->backColor); + update_read_color(s, &polygon_cb->backColor); if (orderInfo->fieldFlags & ORDER_FIELD_06) - rdp_read_color(s, &polygon_cb->foreColor); + update_read_color(s, &polygon_cb->foreColor); if (orderInfo->fieldFlags & ORDER_FIELD_07) stream_read_uint8(s, polygon_cb->brushOrgX); @@ -641,19 +641,19 @@ void rdp_read_polygon_cb_order(STREAM* s, ORDER_INFO* orderInfo, POLYGON_CB_ORDE /* codeDeltaList */ } -void rdp_read_polyline_order(STREAM* s, ORDER_INFO* orderInfo, POLYLINE_ORDER* polyline) +void update_read_polyline_order(STREAM* s, ORDER_INFO* orderInfo, POLYLINE_ORDER* polyline) { if (orderInfo->fieldFlags & ORDER_FIELD_01) - rdp_read_coord(s, &polyline->xStart, orderInfo->deltaCoordinates); + update_read_coord(s, &polyline->xStart, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_02) - rdp_read_coord(s, &polyline->yStart, orderInfo->deltaCoordinates); + update_read_coord(s, &polyline->yStart, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_03) stream_read_uint8(s, polyline->bRop2); if (orderInfo->fieldFlags & ORDER_FIELD_04) - rdp_read_color(s, &polyline->penColor); + update_read_color(s, &polyline->penColor); if (orderInfo->fieldFlags & ORDER_FIELD_05) stream_read_uint8(s, polyline->nDeltaEntries); @@ -661,7 +661,7 @@ void rdp_read_polyline_order(STREAM* s, ORDER_INFO* orderInfo, POLYLINE_ORDER* p /* codeDeltaList */ } -void rdp_read_fast_glyph_order(STREAM* s, ORDER_INFO* orderInfo, FAST_GLYPH_ORDER* fast_glyph) +void update_read_fast_glyph_order(STREAM* s, ORDER_INFO* orderInfo, FAST_GLYPH_ORDER* fast_glyph) { if (orderInfo->fieldFlags & ORDER_FIELD_01) stream_read_uint8(s, fast_glyph->cacheId); @@ -670,57 +670,57 @@ void rdp_read_fast_glyph_order(STREAM* s, ORDER_INFO* orderInfo, FAST_GLYPH_ORDE stream_read_uint16(s, fast_glyph->fDrawing); if (orderInfo->fieldFlags & ORDER_FIELD_03) - rdp_read_color(s, &fast_glyph->backColor); + update_read_color(s, &fast_glyph->backColor); if (orderInfo->fieldFlags & ORDER_FIELD_04) - rdp_read_color(s, &fast_glyph->foreColor); + update_read_color(s, &fast_glyph->foreColor); if (orderInfo->fieldFlags & ORDER_FIELD_05) - rdp_read_coord(s, &fast_glyph->bkLeft, orderInfo->deltaCoordinates); + update_read_coord(s, &fast_glyph->bkLeft, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_06) - rdp_read_coord(s, &fast_glyph->bkTop, orderInfo->deltaCoordinates); + update_read_coord(s, &fast_glyph->bkTop, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_07) - rdp_read_coord(s, &fast_glyph->bkRight, orderInfo->deltaCoordinates); + update_read_coord(s, &fast_glyph->bkRight, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_08) - rdp_read_coord(s, &fast_glyph->bkBottom, orderInfo->deltaCoordinates); + update_read_coord(s, &fast_glyph->bkBottom, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_09) - rdp_read_coord(s, &fast_glyph->opLeft, orderInfo->deltaCoordinates); + update_read_coord(s, &fast_glyph->opLeft, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_10) - rdp_read_coord(s, &fast_glyph->opTop, orderInfo->deltaCoordinates); + update_read_coord(s, &fast_glyph->opTop, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_11) - rdp_read_coord(s, &fast_glyph->opRight, orderInfo->deltaCoordinates); + update_read_coord(s, &fast_glyph->opRight, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_12) - rdp_read_coord(s, &fast_glyph->opBottom, orderInfo->deltaCoordinates); + update_read_coord(s, &fast_glyph->opBottom, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_13) - rdp_read_coord(s, &fast_glyph->x, orderInfo->deltaCoordinates); + update_read_coord(s, &fast_glyph->x, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_14) - rdp_read_coord(s, &fast_glyph->y, orderInfo->deltaCoordinates); + update_read_coord(s, &fast_glyph->y, orderInfo->deltaCoordinates); /* bytes */ } -void rdp_read_ellipse_sc_order(STREAM* s, ORDER_INFO* orderInfo, ELLIPSE_SC_ORDER* ellipse_sc) +void update_read_ellipse_sc_order(STREAM* s, ORDER_INFO* orderInfo, ELLIPSE_SC_ORDER* ellipse_sc) { if (orderInfo->fieldFlags & ORDER_FIELD_01) - rdp_read_coord(s, &ellipse_sc->leftRect, orderInfo->deltaCoordinates); + update_read_coord(s, &ellipse_sc->leftRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_02) - rdp_read_coord(s, &ellipse_sc->topRect, orderInfo->deltaCoordinates); + update_read_coord(s, &ellipse_sc->topRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_03) - rdp_read_coord(s, &ellipse_sc->rightRect, orderInfo->deltaCoordinates); + update_read_coord(s, &ellipse_sc->rightRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_04) - rdp_read_coord(s, &ellipse_sc->bottomRect, orderInfo->deltaCoordinates); + update_read_coord(s, &ellipse_sc->bottomRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_05) stream_read_uint8(s, ellipse_sc->bRop2); @@ -729,22 +729,22 @@ void rdp_read_ellipse_sc_order(STREAM* s, ORDER_INFO* orderInfo, ELLIPSE_SC_ORDE stream_read_uint8(s, ellipse_sc->fillMode); if (orderInfo->fieldFlags & ORDER_FIELD_07) - rdp_read_color(s, &ellipse_sc->color); + update_read_color(s, &ellipse_sc->color); } -void rdp_read_ellipse_cb_order(STREAM* s, ORDER_INFO* orderInfo, ELLIPSE_CB_ORDER* ellipse_cb) +void update_read_ellipse_cb_order(STREAM* s, ORDER_INFO* orderInfo, ELLIPSE_CB_ORDER* ellipse_cb) { if (orderInfo->fieldFlags & ORDER_FIELD_01) - rdp_read_coord(s, &ellipse_cb->leftRect, orderInfo->deltaCoordinates); + update_read_coord(s, &ellipse_cb->leftRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_02) - rdp_read_coord(s, &ellipse_cb->topRect, orderInfo->deltaCoordinates); + update_read_coord(s, &ellipse_cb->topRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_03) - rdp_read_coord(s, &ellipse_cb->rightRect, orderInfo->deltaCoordinates); + update_read_coord(s, &ellipse_cb->rightRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_04) - rdp_read_coord(s, &ellipse_cb->bottomRect, orderInfo->deltaCoordinates); + update_read_coord(s, &ellipse_cb->bottomRect, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_05) stream_read_uint8(s, ellipse_cb->bRop2); @@ -753,10 +753,10 @@ void rdp_read_ellipse_cb_order(STREAM* s, ORDER_INFO* orderInfo, ELLIPSE_CB_ORDE stream_read_uint8(s, ellipse_cb->fillMode); if (orderInfo->fieldFlags & ORDER_FIELD_07) - rdp_read_color(s, &ellipse_cb->backColor); + update_read_color(s, &ellipse_cb->backColor); if (orderInfo->fieldFlags & ORDER_FIELD_08) - rdp_read_color(s, &ellipse_cb->foreColor); + update_read_color(s, &ellipse_cb->foreColor); if (orderInfo->fieldFlags & ORDER_FIELD_09) stream_read_uint8(s, ellipse_cb->brushOrgX); @@ -774,7 +774,7 @@ void rdp_read_ellipse_cb_order(STREAM* s, ORDER_INFO* orderInfo, ELLIPSE_CB_ORDE stream_read(s, ellipse_cb->brushExtra, 7); } -void rdp_read_glyph_index_order(STREAM* s, ORDER_INFO* orderInfo, GLYPH_INDEX_ORDER* glyph_index) +void update_read_glyph_index_order(STREAM* s, ORDER_INFO* orderInfo, GLYPH_INDEX_ORDER* glyph_index) { if (orderInfo->fieldFlags & ORDER_FIELD_01) stream_read_uint8(s, glyph_index->cacheId); @@ -789,34 +789,34 @@ void rdp_read_glyph_index_order(STREAM* s, ORDER_INFO* orderInfo, GLYPH_INDEX_OR stream_read_uint8(s, glyph_index->fOpRedundant); if (orderInfo->fieldFlags & ORDER_FIELD_05) - rdp_read_color(s, &glyph_index->backColor); + update_read_color(s, &glyph_index->backColor); if (orderInfo->fieldFlags & ORDER_FIELD_06) - rdp_read_color(s, &glyph_index->foreColor); + update_read_color(s, &glyph_index->foreColor); if (orderInfo->fieldFlags & ORDER_FIELD_07) - rdp_read_coord(s, &glyph_index->bkLeft, orderInfo->deltaCoordinates); + update_read_coord(s, &glyph_index->bkLeft, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_08) - rdp_read_coord(s, &glyph_index->bkTop, orderInfo->deltaCoordinates); + update_read_coord(s, &glyph_index->bkTop, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_09) - rdp_read_coord(s, &glyph_index->bkRight, orderInfo->deltaCoordinates); + update_read_coord(s, &glyph_index->bkRight, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_10) - rdp_read_coord(s, &glyph_index->bkBottom, orderInfo->deltaCoordinates); + update_read_coord(s, &glyph_index->bkBottom, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_10) - rdp_read_coord(s, &glyph_index->opLeft, orderInfo->deltaCoordinates); + update_read_coord(s, &glyph_index->opLeft, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_11) - rdp_read_coord(s, &glyph_index->opTop, orderInfo->deltaCoordinates); + update_read_coord(s, &glyph_index->opTop, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_12) - rdp_read_coord(s, &glyph_index->opRight, orderInfo->deltaCoordinates); + update_read_coord(s, &glyph_index->opRight, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_13) - rdp_read_coord(s, &glyph_index->opBottom, orderInfo->deltaCoordinates); + update_read_coord(s, &glyph_index->opBottom, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_14) stream_read_uint8(s, glyph_index->brushOrgX); @@ -834,129 +834,129 @@ void rdp_read_glyph_index_order(STREAM* s, ORDER_INFO* orderInfo, GLYPH_INDEX_OR stream_read(s, glyph_index->brushExtra, 7); if (orderInfo->fieldFlags & ORDER_FIELD_19) - rdp_read_coord(s, &glyph_index->x, orderInfo->deltaCoordinates); + update_read_coord(s, &glyph_index->x, orderInfo->deltaCoordinates); if (orderInfo->fieldFlags & ORDER_FIELD_20) - rdp_read_coord(s, &glyph_index->y, orderInfo->deltaCoordinates); + update_read_coord(s, &glyph_index->y, orderInfo->deltaCoordinates); /* bytes */ } /* Secondary Drawing Orders */ -void rdp_recv_cache_bitmap_order(rdpRdp* rdp, STREAM* s) +void update_recv_cache_bitmap_order(rdpUpdate* update, STREAM* s) { } -void rdp_recv_cache_color_table_order(rdpRdp* rdp, STREAM* s) +void update_recv_cache_color_table_order(rdpUpdate* update, STREAM* s) { } -void rdp_recv_cache_bitmap_compressed_order(rdpRdp* rdp, STREAM* s) +void update_recv_cache_bitmap_compressed_order(rdpUpdate* update, STREAM* s) { } -void rdp_recv_cache_glyph_order(rdpRdp* rdp, STREAM* s) +void update_recv_cache_glyph_order(rdpUpdate* update, STREAM* s) { } -void rdp_recv_cache_bitmap_v2_order(rdpRdp* rdp, STREAM* s) +void update_recv_cache_bitmap_v2_order(rdpUpdate* update, STREAM* s) { } -void rdp_recv_cache_bitmap_v2_compressed_order(rdpRdp* rdp, STREAM* s) +void update_recv_cache_bitmap_v2_compressed_order(rdpUpdate* update, STREAM* s) { } -void rdp_recv_cache_brush_order(rdpRdp* rdp, STREAM* s) +void update_recv_cache_brush_order(rdpUpdate* update, STREAM* s) { } -void rdp_recv_cache_bitmap_v3_order(rdpRdp* rdp, STREAM* s) +void update_recv_cache_bitmap_v3_order(rdpUpdate* update, STREAM* s) { } /* Alternate Secondary Drawing Orders */ -void rdp_recv_switch_surface_order(rdpRdp* rdp, STREAM* s) +void update_recv_switch_surface_order(rdpUpdate* update, STREAM* s) { } -void rdp_recv_create_offscreen_bitmap_order(rdpRdp* rdp, STREAM* s) +void update_recv_create_offscreen_bitmap_order(rdpUpdate* update, STREAM* s) { } -void rdp_recv_stream_bitmap_first_order(rdpRdp* rdp, STREAM* s) +void update_recv_stream_bitmap_first_order(rdpUpdate* update, STREAM* s) { } -void rdp_recv_stream_bitmap_next_order(rdpRdp* rdp, STREAM* s) +void update_recv_stream_bitmap_next_order(rdpUpdate* update, STREAM* s) { } -void rdp_recv_create_nine_grid_bitmap_order(rdpRdp* rdp, STREAM* s) +void update_recv_create_nine_grid_bitmap_order(rdpUpdate* update, STREAM* s) { } -void rdp_recv_draw_gdiplus_first_order(rdpRdp* rdp, STREAM* s) +void update_recv_draw_gdiplus_first_order(rdpUpdate* update, STREAM* s) { } -void rdp_recv_draw_gdiplus_next_order(rdpRdp* rdp, STREAM* s) +void update_recv_draw_gdiplus_next_order(rdpUpdate* update, STREAM* s) { } -void rdp_recv_draw_gdiplus_end_order(rdpRdp* rdp, STREAM* s) +void update_recv_draw_gdiplus_end_order(rdpUpdate* update, STREAM* s) { } -void rdp_recv_draw_gdiplus_cache_first_order(rdpRdp* rdp, STREAM* s) +void update_recv_draw_gdiplus_cache_first_order(rdpUpdate* update, STREAM* s) { } -void rdp_recv_draw_gdiplus_cache_next_order(rdpRdp* rdp, STREAM* s) +void update_recv_draw_gdiplus_cache_next_order(rdpUpdate* update, STREAM* s) { } -void rdp_recv_draw_gdiplus_cache_end_order(rdpRdp* rdp, STREAM* s) +void update_recv_draw_gdiplus_cache_end_order(rdpUpdate* update, STREAM* s) { } -void rdp_recv_windowing_order(rdpRdp* rdp, STREAM* s) +void update_recv_windowing_order(rdpUpdate* update, STREAM* s) { } -void rdp_recv_desktop_composition_order(rdpRdp* rdp, STREAM* s) +void update_recv_desktop_composition_order(rdpUpdate* update, STREAM* s) { } -void rdp_recv_frame_marker_order(rdpRdp* rdp, STREAM* s) +void update_recv_frame_marker_order(rdpUpdate* update, STREAM* s) { } -void rdp_read_field_flags(STREAM* s, uint32* fieldFlags, uint8 flags, uint8 fieldBytes) +void update_read_field_flags(STREAM* s, uint32* fieldFlags, uint8 flags, uint8 fieldBytes) { int i; uint8 byte; @@ -980,7 +980,7 @@ void rdp_read_field_flags(STREAM* s, uint32* fieldFlags, uint8 flags, uint8 fiel } } -void rdp_read_bounds(STREAM* s, ORDER_INFO* orderInfo) +void update_read_bounds(STREAM* s, ORDER_INFO* orderInfo) { uint8 flags; @@ -1007,21 +1007,21 @@ void rdp_read_bounds(STREAM* s, ORDER_INFO* orderInfo) stream_read_uint16(s, orderInfo->boundBottom); } -void rdp_recv_primary_order(rdpOrders* orders, STREAM* s, uint8 flags) +void update_recv_primary_order(rdpUpdate* update, STREAM* s, uint8 flags) { - ORDER_INFO* orderInfo = &(orders->order_info); + ORDER_INFO* orderInfo = &(update->order_info); if (flags & ORDER_TYPE_CHANGE) stream_read_uint8(s, orderInfo->orderType); /* orderType (1 byte) */ - rdp_read_field_flags(s, &(orderInfo->fieldFlags), flags, + update_read_field_flags(s, &(orderInfo->fieldFlags), flags, PRIMARY_DRAWING_ORDER_FIELD_BYTES[orderInfo->orderType]); if (flags & ORDER_BOUNDS) { if (!(flags & ORDER_ZERO_BOUNDS_DELTAS)) { - rdp_read_bounds(s, orderInfo); + update_read_bounds(s, orderInfo); } } @@ -1032,91 +1032,113 @@ void rdp_recv_primary_order(rdpOrders* orders, STREAM* s, uint8 flags) switch (orderInfo->orderType) { case ORDER_TYPE_DSTBLT: - rdp_read_dstblt_order(s, orderInfo, &(orders->dstblt)); + update_read_dstblt_order(s, orderInfo, &(update->dstblt)); + IFCALL(update->DstBlt, update, &update->dstblt); break; case ORDER_TYPE_PATBLT: - rdp_read_patblt_order(s, orderInfo, &(orders->patblt)); + update_read_patblt_order(s, orderInfo, &(update->patblt)); + IFCALL(update->PatBlt, update, &update->patblt); break; case ORDER_TYPE_SCRBLT: - rdp_read_scrblt_order(s, orderInfo, &(orders->scrblt)); + update_read_scrblt_order(s, orderInfo, &(update->scrblt)); + IFCALL(update->ScrBlt, update, &update->scrblt); break; case ORDER_TYPE_DRAW_NINE_GRID: - rdp_read_draw_nine_grid_order(s, orderInfo, &(orders->draw_nine_grid)); + update_read_draw_nine_grid_order(s, orderInfo, &(update->draw_nine_grid)); + IFCALL(update->DrawNineGrid, update, &update->draw_nine_grid); break; case ORDER_TYPE_MULTI_DRAW_NINE_GRID: - rdp_read_multi_draw_nine_grid_order(s, orderInfo, &(orders->multi_draw_nine_grid)); + update_read_multi_draw_nine_grid_order(s, orderInfo, &(update->multi_draw_nine_grid)); + IFCALL(update->MultiDrawNineGrid, update, &update->multi_draw_nine_grid); break; case ORDER_TYPE_LINE_TO: - rdp_read_line_to_order(s, orderInfo, &(orders->line_to)); + update_read_line_to_order(s, orderInfo, &(update->line_to)); + IFCALL(update->LineTo, update, &update->line_to); break; case ORDER_TYPE_OPAQUE_RECT: - rdp_read_opaque_rect_order(s, orderInfo, &(orders->opaque_rect)); + update_read_opaque_rect_order(s, orderInfo, &(update->opaque_rect)); + IFCALL(update->OpaqueRect, update, &update->opaque_rect); break; case ORDER_TYPE_SAVE_BITMAP: - rdp_read_save_bitmap_order(s, orderInfo, &(orders->save_bitmap)); + update_read_save_bitmap_order(s, orderInfo, &(update->save_bitmap)); + IFCALL(update->SaveBitmap, update, &update->save_bitmap); break; case ORDER_TYPE_MEMBLT: - rdp_read_memblt_order(s, orderInfo, &(orders->memblt)); + update_read_memblt_order(s, orderInfo, &(update->memblt)); + IFCALL(update->MemBlt, update, &update->memblt); break; case ORDER_TYPE_MEM3BLT: - rdp_read_mem3blt_order(s, orderInfo, &(orders->mem3blt)); + update_read_mem3blt_order(s, orderInfo, &(update->mem3blt)); + IFCALL(update->Mem3Blt, update, &update->mem3blt); break; case ORDER_TYPE_MULTI_DSTBLT: - rdp_read_multi_dstblt_order(s, orderInfo, &(orders->multi_dstblt)); + update_read_multi_dstblt_order(s, orderInfo, &(update->multi_dstblt)); + IFCALL(update->MultiDstBlt, update, &update->multi_dstblt); break; case ORDER_TYPE_MULTI_PATBLT: - rdp_read_multi_patblt_order(s, orderInfo, &(orders->multi_patblt)); + update_read_multi_patblt_order(s, orderInfo, &(update->multi_patblt)); + IFCALL(update->MultiPatBlt, update, &update->multi_patblt); break; case ORDER_TYPE_MULTI_SCRBLT: - rdp_read_multi_scrblt_order(s, orderInfo, &(orders->multi_scrblt)); + update_read_multi_scrblt_order(s, orderInfo, &(update->multi_scrblt)); + IFCALL(update->MultiScrBlt, update, &update->multi_scrblt); break; case ORDER_TYPE_MULTI_OPAQUE_RECT: - rdp_read_multi_opaque_rect_order(s, orderInfo, &(orders->multi_opaque_rect)); + update_read_multi_opaque_rect_order(s, orderInfo, &(update->multi_opaque_rect)); + IFCALL(update->MultiOpaqueRect, update, &update->multi_opaque_rect); break; case ORDER_TYPE_FAST_INDEX: - rdp_read_fast_index_order(s, orderInfo, &(orders->fast_index)); + update_read_fast_index_order(s, orderInfo, &(update->fast_index)); + IFCALL(update->FastIndex, update, &update->fast_index); break; case ORDER_TYPE_POLYGON_SC: - rdp_read_polygon_sc_order(s, orderInfo, &(orders->polygon_sc)); + update_read_polygon_sc_order(s, orderInfo, &(update->polygon_sc)); + IFCALL(update->PolygonSC, update, &update->polygon_sc); break; case ORDER_TYPE_POLYGON_CB: - rdp_read_polygon_cb_order(s, orderInfo, &(orders->polygon_cb)); + update_read_polygon_cb_order(s, orderInfo, &(update->polygon_cb)); + IFCALL(update->PolygonCB, update, &update->polygon_cb); break; case ORDER_TYPE_POLYLINE: - rdp_read_polyline_order(s, orderInfo, &(orders->polyline)); + update_read_polyline_order(s, orderInfo, &(update->polyline)); + IFCALL(update->Polyline, update, &update->polyline); break; case ORDER_TYPE_FAST_GLYPH: - rdp_read_fast_glyph_order(s, orderInfo, &(orders->fast_glyph)); + update_read_fast_glyph_order(s, orderInfo, &(update->fast_glyph)); + IFCALL(update->FastGlyph, update, &update->fast_glyph); break; case ORDER_TYPE_ELLIPSE_SC: - rdp_read_ellipse_sc_order(s, orderInfo, &(orders->ellipse_sc)); + update_read_ellipse_sc_order(s, orderInfo, &(update->ellipse_sc)); + IFCALL(update->EllipseSC, update, &update->ellipse_sc); break; case ORDER_TYPE_ELLIPSE_CB: - rdp_read_ellipse_cb_order(s, orderInfo, &(orders->ellipse_cb)); + update_read_ellipse_cb_order(s, orderInfo, &(update->ellipse_cb)); + IFCALL(update->EllipseCB, update, &update->ellipse_cb); break; case ORDER_TYPE_GLYPH_INDEX: - rdp_read_glyph_index_order(s, orderInfo, &(orders->glyph_index)); + update_read_glyph_index_order(s, orderInfo, &(update->glyph_index)); + IFCALL(update->GlyphIndex, update, &update->glyph_index); break; default: @@ -1124,7 +1146,7 @@ void rdp_recv_primary_order(rdpOrders* orders, STREAM* s, uint8 flags) } } -void rdp_recv_secondary_order(rdpRdp* rdp, STREAM* s, uint8 flags) +void update_recv_secondary_order(rdpUpdate* update, STREAM* s, uint8 flags) { uint8* next; uint8 orderType; @@ -1144,35 +1166,35 @@ void rdp_recv_secondary_order(rdpRdp* rdp, STREAM* s, uint8 flags) switch (orderType) { case ORDER_TYPE_BITMAP_UNCOMPRESSED: - rdp_recv_cache_bitmap_order(rdp, s); + update_recv_cache_bitmap_order(update, s); break; case ORDER_TYPE_CACHE_COLOR_TABLE: - rdp_recv_cache_color_table_order(rdp, s); + update_recv_cache_color_table_order(update, s); break; case ORDER_TYPE_CACHE_BITMAP_COMPRESSED: - rdp_recv_cache_bitmap_compressed_order(rdp, s); + update_recv_cache_bitmap_compressed_order(update, s); break; case ORDER_TYPE_CACHE_GLYPH: - rdp_recv_cache_glyph_order(rdp, s); + update_recv_cache_glyph_order(update, s); break; case ORDER_TYPE_BITMAP_UNCOMPRESSED_V2: - rdp_recv_cache_bitmap_v2_order(rdp, s); + update_recv_cache_bitmap_v2_order(update, s); break; case ORDER_TYPE_BITMAP_COMPRESSED_V2: - rdp_recv_cache_bitmap_v2_compressed_order(rdp, s); + update_recv_cache_bitmap_v2_compressed_order(update, s); break; case ORDER_TYPE_CACHE_BRUSH: - rdp_recv_cache_brush_order(rdp, s); + update_recv_cache_brush_order(update, s); break; case ORDER_TYPE_BITMAP_COMPRESSED_V3: - rdp_recv_cache_bitmap_v3_order(rdp, s); + update_recv_cache_bitmap_v3_order(update, s); break; default: @@ -1182,7 +1204,7 @@ void rdp_recv_secondary_order(rdpRdp* rdp, STREAM* s, uint8 flags) stream_set_mark(s, next); } -void rdp_recv_altsec_order(rdpRdp* rdp, STREAM* s, uint8 flags) +void update_recv_altsec_order(rdpUpdate* update, STREAM* s, uint8 flags) { uint8 orderType; @@ -1193,59 +1215,59 @@ void rdp_recv_altsec_order(rdpRdp* rdp, STREAM* s, uint8 flags) switch (orderType) { case ORDER_TYPE_SWITCH_SURFACE: - rdp_recv_switch_surface_order(rdp, s); + update_recv_switch_surface_order(update, s); break; case ORDER_TYPE_CREATE_OFFSCR_BITMAP: - rdp_recv_create_offscreen_bitmap_order(rdp, s); + update_recv_create_offscreen_bitmap_order(update, s); break; case ORDER_TYPE_STREAM_BITMAP_FIRST: - rdp_recv_stream_bitmap_first_order(rdp, s); + update_recv_stream_bitmap_first_order(update, s); break; case ORDER_TYPE_STREAM_BITMAP_NEXT: - rdp_recv_stream_bitmap_next_order(rdp, s); + update_recv_stream_bitmap_next_order(update, s); break; case ORDER_TYPE_CREATE_NINE_GRID_BITMAP: - rdp_recv_create_nine_grid_bitmap_order(rdp, s); + update_recv_create_nine_grid_bitmap_order(update, s); break; case ORDER_TYPE_GDIPLUS_FIRST: - rdp_recv_draw_gdiplus_first_order(rdp, s); + update_recv_draw_gdiplus_first_order(update, s); break; case ORDER_TYPE_GDIPLUS_NEXT: - rdp_recv_draw_gdiplus_next_order(rdp, s); + update_recv_draw_gdiplus_next_order(update, s); break; case ORDER_TYPE_GDIPLUS_END: - rdp_recv_draw_gdiplus_end_order(rdp, s); + update_recv_draw_gdiplus_end_order(update, s); break; case ORDER_TYPE_GDIPLUS_CACHE_FIRST: - rdp_recv_draw_gdiplus_cache_first_order(rdp, s); + update_recv_draw_gdiplus_cache_first_order(update, s); break; case ORDER_TYPE_GDIPLUS_CACHE_NEXT: - rdp_recv_draw_gdiplus_cache_next_order(rdp, s); + update_recv_draw_gdiplus_cache_next_order(update, s); break; case ORDER_TYPE_GDIPLUS_CACHE_END: - rdp_recv_draw_gdiplus_cache_end_order(rdp, s); + update_recv_draw_gdiplus_cache_end_order(update, s); break; case ORDER_TYPE_WINDOW: - rdp_recv_windowing_order(rdp, s); + update_recv_windowing_order(update, s); break; case ORDER_TYPE_COMPDESK_FIRST: - rdp_recv_desktop_composition_order(rdp, s); + update_recv_desktop_composition_order(update, s); break; case ORDER_TYPE_FRAME_MARKER: - rdp_recv_frame_marker_order(rdp, s); + update_recv_frame_marker_order(update, s); break; default: @@ -1253,7 +1275,7 @@ void rdp_recv_altsec_order(rdpRdp* rdp, STREAM* s, uint8 flags) } } -void rdp_recv_order(rdpRdp* rdp, STREAM* s) +void update_recv_order(rdpUpdate* update, STREAM* s) { uint8 controlFlags; @@ -1262,37 +1284,16 @@ void rdp_recv_order(rdpRdp* rdp, STREAM* s) switch (controlFlags & ORDER_CLASS_MASK) { case ORDER_PRIMARY_CLASS: - rdp_recv_primary_order(rdp->orders, s, controlFlags); + update_recv_primary_order(update, s, controlFlags); break; case ORDER_SECONDARY_CLASS: - rdp_recv_secondary_order(rdp, s, controlFlags); + update_recv_secondary_order(update, s, controlFlags); break; case ORDER_ALTSEC_CLASS: - rdp_recv_altsec_order(rdp, s, controlFlags); + update_recv_altsec_order(update, s, controlFlags); break; } } -rdpOrders* orders_new() -{ - rdpOrders* orders; - - orders = (rdpOrders*) xzalloc(sizeof(rdpOrders)); - - if (orders != NULL) - { - - } - - return orders; -} - -void orders_free(rdpOrders* orders) -{ - if (orders != NULL) - { - xfree(orders); - } -} diff --git a/libfreerdp-core/orders.h b/libfreerdp-core/orders.h index 735e5f9ea..00e0f363e 100644 --- a/libfreerdp-core/orders.h +++ b/libfreerdp-core/orders.h @@ -20,358 +20,9 @@ #ifndef __ORDERS_H #define __ORDERS_H -#include - -typedef struct rdp_orders rdpOrders; - -typedef struct -{ - uint8 orderType; - uint32 fieldFlags; - uint16 boundLeft; - uint16 boundTop; - uint16 boundRight; - uint16 boundBottom; - sint8 deltaBoundLeft; - sint8 deltaBoundTop; - sint8 deltaBoundRight; - sint8 deltaBoundBottom; - boolean deltaCoordinates; -} ORDER_INFO; - -typedef struct -{ - sint16 nLeftRect; - sint16 nTopRect; - sint16 nWidth; - sint16 nHeight; - uint8 bRop; -} DSTBLT_ORDER; - -typedef struct -{ - sint16 nLeftRect; - sint16 nTopRect; - sint16 nWidth; - sint16 nHeight; - uint8 bRop; - uint32 backColor; - uint32 foreColor; - uint8 brushOrgX; - uint8 brushOrgY; - uint8 brushStyle; - uint8 brushHatch; - uint8 brushExtra[7]; -} PATBLT_ORDER; - -typedef struct -{ - sint16 nLeftRect; - sint16 nTopRect; - sint16 nWidth; - sint16 nHeight; - uint8 bRop; - sint16 nXSrc; - sint16 nYSrc; -} SCRBLT_ORDER; - -typedef struct -{ - sint16 srcLeft; - sint16 srcTop; - sint16 srcRight; - sint16 srcBottom; - uint16 bitmapId; -} DRAW_NINE_GRID_ORDER; - -typedef struct -{ - sint16 srcLeft; - sint16 srcTop; - sint16 srcRight; - sint16 srcBottom; - uint16 bitmapId; - uint8 nDeltaEntries; - uint8* codeDeltaList; -} MULTI_DRAW_NINE_GRID_ORDER; - -typedef struct -{ - uint16 backMode; - sint16 nXStart; - sint16 nYStart; - sint16 nXEnd; - sint16 nYEnd; - uint32 backColor; - uint8 bRop2; - uint8 penStyle; - uint8 penWidth; - uint32 penColor; -} LINE_TO_ORDER; - -typedef struct -{ - sint16 nLeftRect; - sint16 nTopRect; - sint16 nWidth; - sint16 nHeight; - uint32 color; -} OPAQUE_RECT_ORDER; - -typedef struct -{ - uint32 savedBitmapPosition; - sint16 nLeftRect; - sint16 nTopRect; - sint16 nRightRect; - sint16 nBottomRect; - uint8 operation; -} SAVE_BITMAP_ORDER; - -typedef struct -{ - uint16 cacheId; - sint16 nLeftRect; - sint16 nTopRect; - sint16 nWidth; - sint16 nHeight; - uint8 bRop; - sint16 nXSrc; - sint16 nYSrc; - uint16 cacheIndex; -} MEMBLT_ORDER; - -typedef struct -{ - uint16 cacheId; - sint16 nLeftRect; - sint16 nTopRect; - sint16 nWidth; - sint16 nHeight; - uint8 bRop; - sint16 nXSrc; - sint16 nYSrc; - uint32 backColor; - uint32 foreColor; - uint8 brushOrgX; - uint8 brushOrgY; - uint8 brushStyle; - uint8 brushHatch; - uint8 brushExtra[7]; - uint16 cacheIndex; -} MEM3BLT_ORDER; - -typedef struct -{ - sint16 nLeftRect; - sint16 nTopRect; - sint16 nWidth; - sint16 nHeight; - uint8 bRop; - uint8 nDeltaEntries; - uint8* codeDeltaList; -} MULTI_DSTBLT_ORDER; - -typedef struct -{ - sint16 nLeftRect; - sint16 nTopRect; - sint16 nWidth; - sint16 nHeight; - uint8 bRop; - uint32 backColor; - uint32 foreColor; - uint8 brushOrgX; - uint8 brushOrgY; - uint8 brushStyle; - uint8 brushHatch; - uint8 brushExtra[7]; - uint8 nDeltaEntries; - uint8* codeDeltaList; -} MULTI_PATBLT_ORDER; - -typedef struct -{ - sint16 nLeftRect; - sint16 nTopRect; - sint16 nWidth; - sint16 nHeight; - uint8 bRop; - sint16 nXSrc; - sint16 nYSrc; - uint8 nDeltaEntries; - uint8* codeDeltaList; -} MULTI_SCRBLT_ORDER; - -typedef struct -{ - sint16 nLeftRect; - sint16 nTopRect; - sint16 nWidth; - sint16 nHeight; - uint32 color; - uint8 nDeltaEntries; - uint8* codeDeltaList; -} MULTI_OPAQUE_RECT_ORDER; - -typedef struct -{ - uint8 cacheId; - uint16 fDrawing; - uint32 backColor; - uint32 foreColor; - sint16 bkLeft; - sint16 bkTop; - sint16 bkRight; - sint16 bkBottom; - sint16 opLeft; - sint16 opTop; - sint16 opRight; - sint16 opBottom; - uint16 x; - uint16 y; - uint8* data; -} FAST_INDEX_ORDER; - -typedef struct -{ - sint16 xStart; - sint16 yStart; - uint8 bRop2; - uint8 fillMode; - uint32 brushColor; - uint8 nDeltaEntries; - uint8* codeDeltaList; -} POLYGON_SC_ORDER; - -typedef struct -{ - sint16 xStart; - sint16 yStart; - uint8 bRop2; - uint8 fillMode; - uint32 backColor; - uint32 foreColor; - uint8 brushOrgX; - uint8 brushOrgY; - uint8 brushStyle; - uint8 brushHatch; - uint8 brushExtra[7]; - uint8 nDeltaEntries; - uint8* codeDeltaList; -} POLYGON_CB_ORDER; - -typedef struct -{ - sint16 xStart; - sint16 yStart; - uint8 bRop2; - uint32 penColor; - uint8 nDeltaEntries; - uint8* codeDeltaList; -} POLYLINE_ORDER; - -typedef struct -{ - uint8 cacheId; - uint16 fDrawing; - uint32 backColor; - uint32 foreColor; - sint16 bkLeft; - sint16 bkTop; - sint16 bkRight; - sint16 bkBottom; - sint16 opLeft; - sint16 opTop; - sint16 opRight; - sint16 opBottom; - uint16 x; - uint16 y; - uint8* data; -} FAST_GLYPH_ORDER; - -typedef struct -{ - sint16 leftRect; - sint16 topRect; - sint16 rightRect; - sint16 bottomRect; - uint8 bRop2; - uint8 fillMode; - uint32 color; -} ELLIPSE_SC_ORDER; - -typedef struct -{ - sint16 leftRect; - sint16 topRect; - sint16 rightRect; - sint16 bottomRect; - uint8 bRop2; - uint8 fillMode; - uint32 backColor; - uint32 foreColor; - uint8 brushOrgX; - uint8 brushOrgY; - uint8 brushStyle; - uint8 brushHatch; - uint8 brushExtra[7]; -} ELLIPSE_CB_ORDER; - -typedef struct -{ - uint8 cacheId; - uint8 flAccel; - uint8 ulCharInc; - uint8 fOpRedundant; - uint32 backColor; - uint32 foreColor; - sint16 bkLeft; - sint16 bkTop; - sint16 bkRight; - sint16 bkBottom; - sint16 opLeft; - sint16 opTop; - sint16 opRight; - sint16 opBottom; - uint8 brushOrgX; - uint8 brushOrgY; - uint8 brushStyle; - uint8 brushHatch; - uint8 brushExtra[7]; - sint16 x; - sint16 y; - uint8* data; -} GLYPH_INDEX_ORDER; - -struct rdp_orders -{ - ORDER_INFO order_info; - DSTBLT_ORDER dstblt; - PATBLT_ORDER patblt; - SCRBLT_ORDER scrblt; - DRAW_NINE_GRID_ORDER draw_nine_grid; - MULTI_DRAW_NINE_GRID_ORDER multi_draw_nine_grid; - LINE_TO_ORDER line_to; - OPAQUE_RECT_ORDER opaque_rect; - SAVE_BITMAP_ORDER save_bitmap; - MEMBLT_ORDER memblt; - MEM3BLT_ORDER mem3blt; - MULTI_DSTBLT_ORDER multi_dstblt; - MULTI_PATBLT_ORDER multi_patblt; - MULTI_SCRBLT_ORDER multi_scrblt; - MULTI_OPAQUE_RECT_ORDER multi_opaque_rect; - FAST_INDEX_ORDER fast_index; - POLYGON_SC_ORDER polygon_sc; - POLYGON_CB_ORDER polygon_cb; - POLYLINE_ORDER polyline; - FAST_GLYPH_ORDER fast_glyph; - ELLIPSE_SC_ORDER ellipse_sc; - ELLIPSE_CB_ORDER ellipse_cb; - GLYPH_INDEX_ORDER glyph_index; -}; - #include "rdp.h" +#include +#include #include /* Order Control Flags */ @@ -523,9 +174,6 @@ struct rdp_orders #define ORDER_TYPE_COMPDESK_FIRST 0x0C #define ORDER_TYPE_FRAME_MARKER 0x0D -rdpOrders* orders_new(); -void orders_free(rdpOrders* orders); - -void rdp_recv_order(rdpRdp* rdp, STREAM* s); +void update_recv_order(rdpUpdate* update, STREAM* s); #endif /* __ORDERS_H */ diff --git a/libfreerdp-core/rdp.c b/libfreerdp-core/rdp.c index 403dc769c..3729ef9a0 100644 --- a/libfreerdp-core/rdp.c +++ b/libfreerdp-core/rdp.c @@ -261,7 +261,7 @@ void rdp_read_data_pdu(rdpRdp* rdp, STREAM* s) switch (type) { case DATA_PDU_TYPE_UPDATE: - rdp_recv_update_data_pdu(rdp, s); + update_recv(rdp->update, s); break; case DATA_PDU_TYPE_CONTROL: @@ -439,8 +439,8 @@ rdpRdp* rdp_new() rdp->registry = registry_new(rdp->settings); rdp->transport = transport_new(rdp->settings); rdp->license = license_new(rdp); - rdp->orders = orders_new(); - rdp->update = update_new(); + rdp->input = input_new(rdp); + rdp->update = update_new(rdp); rdp->nego = nego_new(rdp->transport); rdp->mcs = mcs_new(rdp->transport); } @@ -460,7 +460,7 @@ void rdp_free(rdpRdp* rdp) settings_free(rdp->settings); transport_free(rdp->transport); license_free(rdp->license); - orders_free(rdp->orders); + input_free(rdp->input); update_free(rdp->update); mcs_free(rdp->mcs); xfree(rdp); diff --git a/libfreerdp-core/rdp.h b/libfreerdp-core/rdp.h index 162f80dc6..162c40ad7 100644 --- a/libfreerdp-core/rdp.h +++ b/libfreerdp-core/rdp.h @@ -26,8 +26,8 @@ typedef struct rdp_rdp rdpRdp; #include "tpkt.h" #include "tpdu.h" #include "nego.h" +#include "input.h" #include "update.h" -#include "orders.h" #include "license.h" #include "security.h" #include "registry.h" @@ -207,7 +207,7 @@ struct rdp_rdp boolean activated; struct rdp_mcs* mcs; struct rdp_nego* nego; - struct rdp_orders* orders; + struct rdp_input* input; struct rdp_update* update; struct rdp_license* license; struct rdp_settings* settings; diff --git a/libfreerdp-core/update.c b/libfreerdp-core/update.c index 6174d82d7..891281c66 100644 --- a/libfreerdp-core/update.c +++ b/libfreerdp-core/update.c @@ -28,7 +28,7 @@ uint8 UPDATE_TYPE_STRINGS[][32] = "Synchronize" }; -void rdp_recv_orders_update(rdpRdp* rdp, STREAM* s) +void update_recv_orders(rdpUpdate* update, STREAM* s) { uint16 numberOrders; @@ -38,12 +38,12 @@ void rdp_recv_orders_update(rdpRdp* rdp, STREAM* s) while (numberOrders > 0) { - rdp_recv_order(rdp, s); + update_recv_order(update, s); numberOrders--; } } -void rdp_read_bitmap_data(STREAM* s, BITMAP_DATA* bitmap_data) +void update_read_bitmap_data(STREAM* s, BITMAP_DATA* bitmap_data) { uint8* srcData; uint16 dstSize; @@ -95,7 +95,7 @@ void rdp_read_bitmap_data(STREAM* s, BITMAP_DATA* bitmap_data) printf("bitmap decompression failed\n"); } -void rdp_read_bitmap_update(rdpRdp* rdp, STREAM* s, BITMAP_UPDATE* bitmap_update) +void update_read_bitmap(rdpUpdate* update, STREAM* s, BITMAP_UPDATE* bitmap_update) { int i; @@ -106,11 +106,11 @@ void rdp_read_bitmap_update(rdpRdp* rdp, STREAM* s, BITMAP_UPDATE* bitmap_update /* rectangles */ for (i = 0; i < bitmap_update->number; i++) { - rdp_read_bitmap_data(s, &bitmap_update->bitmaps[i]); + update_read_bitmap_data(s, &bitmap_update->bitmaps[i]); } } -void rdp_read_palette_update(rdpRdp* rdp, STREAM* s, PALETTE_UPDATE* palette_update) +void update_read_palette(rdpUpdate* update, STREAM* s, PALETTE_UPDATE* palette_update) { int i; uint8 byte; @@ -135,7 +135,7 @@ void rdp_read_palette_update(rdpRdp* rdp, STREAM* s, PALETTE_UPDATE* palette_upd } } -void rdp_read_synchronize_update(rdpRdp* rdp, STREAM* s) +void update_read_synchronize(rdpUpdate* update, STREAM* s) { stream_seek_uint16(s); /* pad2Octets (2 bytes) */ @@ -145,36 +145,38 @@ void rdp_read_synchronize_update(rdpRdp* rdp, STREAM* s) */ } -void rdp_recv_update_data_pdu(rdpRdp* rdp, STREAM* s) +void update_recv(rdpUpdate* update, STREAM* s) { uint16 updateType; stream_read_uint16(s, updateType); /* updateType (2 bytes) */ - if (updateType != UPDATE_TYPE_ORDERS) - printf("%s Update Data PDU\n", UPDATE_TYPE_STRINGS[updateType]); + //printf("%s Update Data PDU\n", UPDATE_TYPE_STRINGS[updateType]); switch (updateType) { case UPDATE_TYPE_ORDERS: - rdp_recv_orders_update(rdp, s); + update_recv_orders(update, s); break; case UPDATE_TYPE_BITMAP: - rdp_read_bitmap_update(rdp, s, &rdp->update->bitmap_update); + update_read_bitmap(update, s, &update->bitmap_update); + IFCALL(update->Bitmap, update, &update->bitmap_update); break; case UPDATE_TYPE_PALETTE: - rdp_read_palette_update(rdp, s, &rdp->update->palette_update); + update_read_palette(update, s, &update->palette_update); + IFCALL(update->Palette, update, &update->palette_update); break; case UPDATE_TYPE_SYNCHRONIZE: - rdp_read_synchronize_update(rdp, s); + update_read_synchronize(update, s); + IFCALL(update->Synchronize, update); break; } } -rdpUpdate* update_new() +rdpUpdate* update_new(rdpRdp* rdp) { rdpUpdate* update; @@ -182,7 +184,7 @@ rdpUpdate* update_new() if (update != NULL) { - + update->rdp = (void*) rdp; } return update; diff --git a/libfreerdp-core/update.h b/libfreerdp-core/update.h index a1b7b87f0..53d24160d 100644 --- a/libfreerdp-core/update.h +++ b/libfreerdp-core/update.h @@ -22,8 +22,9 @@ #include "rdp.h" #include "orders.h" -#include #include +#include +#include #include #define UPDATE_TYPE_ORDERS 0x0000 @@ -31,96 +32,14 @@ #define UPDATE_TYPE_PALETTE 0x0002 #define UPDATE_TYPE_SYNCHRONIZE 0x0003 -typedef struct -{ - uint16 left; - uint16 top; - uint16 right; - uint16 bottom; - uint16 width; - uint16 height; - uint16 bpp; - uint16 flags; - uint16 length; - uint8* data; -} BITMAP_DATA; - -typedef struct -{ - uint16 number; - BITMAP_DATA* bitmaps; -} BITMAP_UPDATE; - #define BITMAP_COMPRESSION 0x0001 #define NO_BITMAP_COMPRESSION_HDR 0x0400 -typedef struct -{ - uint32 number; - uint32 entries[256]; -} PALETTE_UPDATE; - -typedef struct rdp_update rdpUpdate; - -typedef int (*pcBitmap)(rdpUpdate* update, BITMAP_UPDATE* bitmap); -typedef int (*pcDstBlt)(rdpUpdate* update, DSTBLT_ORDER* dstblt); -typedef int (*pcPatBlt)(rdpUpdate* update, PATBLT_ORDER* patblt); -typedef int (*pcScrBlt)(rdpUpdate* update, PATBLT_ORDER* scrblt); -typedef int (*pcDrawNineGrid)(rdpUpdate* update, DRAW_NINE_GRID_ORDER* draw_nine_grid); -typedef int (*pcMultiDrawNineGrid)(rdpUpdate* update, MULTI_DRAW_NINE_GRID_ORDER* multi_draw_nine_grid); -typedef int (*pcLineTo)(rdpUpdate* update, LINE_TO_ORDER* line_to); -typedef int (*pcOpaqueRect)(rdpUpdate* update, OPAQUE_RECT_ORDER* opaque_rect); -typedef int (*pcSaveBitmap)(rdpUpdate* update, SAVE_BITMAP_ORDER* save_bitmap); -typedef int (*pcMemBlt)(rdpUpdate* update, MEMBLT_ORDER* memblt); -typedef int (*pcMem3Blt)(rdpUpdate* update, MEM3BLT_ORDER* memblt); -typedef int (*pcMultiDstBlt)(rdpUpdate* update, MULTI_DSTBLT_ORDER* dstblt); -typedef int (*pcMultiPatBlt)(rdpUpdate* update, MULTI_PATBLT_ORDER* patblt); -typedef int (*pcMultiScrBlt)(rdpUpdate* update, MULTI_PATBLT_ORDER* scrblt); -typedef int (*pcMultiOpaqueRect)(rdpUpdate* update, MULTI_OPAQUE_RECT_ORDER* multi_opaque_rect); -typedef int (*pcFastIndex)(rdpUpdate* update, FAST_INDEX_ORDER* fast_index); -typedef int (*pcPolygonSC)(rdpUpdate* update, POLYGON_SC_ORDER* polygon_sc); -typedef int (*pcPolygonCB)(rdpUpdate* update, POLYGON_CB_ORDER* polygon_cb); -typedef int (*pcPolyline)(rdpUpdate* update, POLYLINE_ORDER* polyline); -typedef int (*pcFastGlyph)(rdpUpdate* update, FAST_GLYPH_ORDER* fast_glyph); -typedef int (*pcEllipseSC)(rdpUpdate* update, ELLIPSE_SC_ORDER* ellipse_sc); -typedef int (*pcEllipseCB)(rdpUpdate* update, ELLIPSE_CB_ORDER* ellipse_cb); -typedef int (*pcGlyphIndex)(rdpUpdate* update, GLYPH_INDEX_ORDER* glyph_index); - -struct rdp_update -{ - BITMAP_UPDATE bitmap_update; - PALETTE_UPDATE palette_update; - - pcBitmap Bitmap; - pcDstBlt DstBlt; - pcPatBlt PatBlt; - pcScrBlt ScrBlt; - pcDrawNineGrid DrawNineGrid; - pcMultiDrawNineGrid MultiDrawNineGrid; - pcLineTo LineTo; - pcOpaqueRect OpaqueRect; - pcSaveBitmap SaveBitmap; - pcMemBlt MemBlt; - pcMem3Blt Mem3Blt; - pcMultiDstBlt MultiDstBlt; - pcMultiPatBlt MultiPatBlt; - pcMultiScrBlt MultiScrBlt; - pcMultiOpaqueRect MultiOpaqueRect; - pcFastIndex FastIndex; - pcPolygonSC PolygonSC; - pcPolygonCB PolygonCB; - pcPolyline Polyline; - pcFastGlyph FastGlyph; - pcEllipseSC EllipseSC; - pcEllipseCB EllipseCB; - pcGlyphIndex GlyphIndex; -}; - -rdpUpdate* update_new(); +rdpUpdate* update_new(rdpRdp* rdp); void update_free(rdpUpdate* update); -void rdp_read_bitmap_update(rdpRdp* rdp, STREAM* s, BITMAP_UPDATE* bitmap_update); -void rdp_read_palette_update(rdpRdp* rdp, STREAM* s, PALETTE_UPDATE* palette_update); -void rdp_recv_update_data_pdu(rdpRdp* rdp, STREAM* s); +void update_read_bitmap(rdpUpdate* update, STREAM* s, BITMAP_UPDATE* bitmap_update); +void update_read_palette(rdpUpdate* update, STREAM* s, PALETTE_UPDATE* palette_update); +void update_recv(rdpUpdate* update, STREAM* s); #endif /* __UPDATE_H */ diff --git a/libfreerdp-gdi/gdi.c b/libfreerdp-gdi/gdi.c index 3a3d2e3f4..0f4c58347 100644 --- a/libfreerdp-gdi/gdi.c +++ b/libfreerdp-gdi/gdi.c @@ -444,6 +444,8 @@ gdi_bitmap_free(GDI_IMAGE *gdi_bmp) } } +#if 0 + /* GDI callbacks registered in libfreerdp */ static void @@ -1193,3 +1195,6 @@ void gdi_free(rdpInst* inst) SET_GDI(inst, NULL); } + +#endif +