libfreerdp-rail: processing window altsec orders

This commit is contained in:
Marc-André Moreau 2011-08-16 00:22:00 -04:00
parent 75423d28ae
commit 2b4cd32390
13 changed files with 227 additions and 50 deletions

View File

@ -20,6 +20,8 @@
include_directories(${X11_INCLUDE_DIRS})
add_executable(xfreerdp
xf_rail.c
xf_rail.h
xf_event.c
xf_event.h
xf_keyboard.c
@ -32,6 +34,7 @@ add_executable(xfreerdp
target_link_libraries(xfreerdp freerdp-core)
target_link_libraries(xfreerdp freerdp-gdi)
target_link_libraries(xfreerdp freerdp-kbd)
target_link_libraries(xfreerdp freerdp-rail)
target_link_libraries(xfreerdp freerdp-chanman)
target_link_libraries(xfreerdp freerdp-utils)
target_link_libraries(xfreerdp ${X11_LIBRARIES})

25
client/X11/xf_rail.c Normal file
View File

@ -0,0 +1,25 @@
/**
* FreeRDP: A Remote Desktop Protocol Client
* X11 RAIL
*
* 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.
*/
#include "xf_rail.h"
void xf_process_rail_event(rdpChanMan* chanman, freerdp* instance)
{
}

27
client/X11/xf_rail.h Normal file
View File

@ -0,0 +1,27 @@
/**
* FreeRDP: A Remote Desktop Protocol Client
* X11 RAIL
*
* 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 __XF_RAIL_H
#define __XF_RAIL_H
#include "xfreerdp.h"
void xf_process_rail_event(rdpChanMan* chanman, freerdp* instance);
#endif /* __XF_RAIL_H */

View File

@ -32,6 +32,7 @@
#include <freerdp/plugins/cliprdr.h>
#include <freerdp/rail.h>
#include "xf_rail.h"
#include "xf_event.h"
#include "xfreerdp.h"
@ -310,6 +311,9 @@ boolean xf_post_connect(freerdp* instance)
instance->update->BeginPaint = xf_begin_paint;
instance->update->EndPaint = xf_end_paint;
instance->update->rail = (void*) rail_new();
rail_register_update_callbacks((rdpRail*) instance->update->rail, instance->update);
freerdp_chanman_post_connect(GET_CHANMAN(instance), instance);
return True;
@ -343,11 +347,6 @@ void xf_process_cb_sync_event(rdpChanMan* chanman, freerdp* instance)
freerdp_chanman_send_event(chanman, event);
}
void xf_process_rail_event(rdpChanMan* chanman, freerdp* instance)
{
}
void xf_process_channel_event(rdpChanMan* chanman, freerdp* instance)
{
FRDP_EVENT* event;

View File

@ -25,6 +25,7 @@
#include <freerdp/freerdp.h>
#include <freerdp/chanman/chanman.h>
#include <freerdp/gdi/gdi.h>
#include <freerdp/rail/rail.h>
typedef struct xf_info xfInfo;

View File

@ -37,13 +37,13 @@ extern "C" {
FREERDP_API boolean freerdp_global_init();
FREERDP_API void freerdp_global_finish();
typedef boolean (*pcConnect)(freerdp* freerdp);
typedef boolean (*pcPreConnect)(freerdp* freerdp);
typedef boolean (*pcPostConnect)(freerdp* freerdp);
typedef boolean (*pcGetFileDescriptor)(freerdp* freerdp, void** rfds, int* rcount, void** wfds, int* wcount);
typedef boolean (*pcCheckFileDescriptor)(freerdp* freerdp);
typedef int (*pcSendChannelData)(freerdp* freerdp, int channelId, uint8* data, int size);
typedef int (*pcReceiveChannelData)(freerdp* freerdp, int channelId, uint8* data, int size, int flags, int total_size);
typedef boolean (*pcConnect)(freerdp* instance);
typedef boolean (*pcPreConnect)(freerdp* instance);
typedef boolean (*pcPostConnect)(freerdp* instance);
typedef boolean (*pcGetFileDescriptor)(freerdp* instance, void** rfds, int* rcount, void** wfds, int* wcount);
typedef boolean (*pcCheckFileDescriptor)(freerdp* instance);
typedef int (*pcSendChannelData)(freerdp* instance, int channelId, uint8* data, int size);
typedef int (*pcReceiveChannelData)(freerdp* instance, int channelId, uint8* data, int size, int flags, int total_size);
struct rdp_freerdp
{

View File

@ -35,6 +35,8 @@ struct rdp_rail
rdpWindowList* list;
};
void rail_register_update_callbacks(rdpRail* rail, rdpUpdate* update);
rdpRail* rail_new();
void rail_free(rdpRail* rail);

View File

@ -22,6 +22,7 @@
#include <freerdp/rail.h>
#include <freerdp/types.h>
#include <freerdp/update.h>
#include <freerdp/utils/stream.h>
typedef struct rdp_window rdpWindow;
@ -56,7 +57,9 @@ struct rdp_window
RECTANGLE_16* visibilityRects;
};
rdpWindow* rail_CreateWindow();
void window_state_update(rdpWindow* window, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* window_state);
rdpWindow* rail_CreateWindow(uint32 windowId);
void rail_DestroyWindow(rdpWindow* window);
#endif /* __WINDOW_H */

View File

@ -833,6 +833,40 @@ typedef struct _SURFACE_BITS_COMMAND SURFACE_BITS_COMMAND;
#define SCREEN_BITMAP_SURFACE 0xFFFF
/* Window Order Header Flags */
#define WINDOW_ORDER_TYPE_WINDOW 0x01000000
#define WINDOW_ORDER_TYPE_NOTIFY 0x02000000
#define WINDOW_ORDER_TYPE_DESKTOP 0x04000000
#define WINDOW_ORDER_STATE_NEW 0x10000000
#define WINDOW_ORDER_STATE_DELETED 0x20000000
#define WINDOW_ORDER_FIELD_OWNER 0x00000002
#define WINDOW_ORDER_FIELD_STYLE 0x00000008
#define WINDOW_ORDER_FIELD_SHOW 0x00000010
#define WINDOW_ORDER_FIELD_TITLE 0x00000004
#define WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET 0x00004000
#define WINDOW_ORDER_FIELD_CLIENT_AREA_SIZE 0x00010000
#define WINDOW_ORDER_FIELD_RP_CONTENT 0x00020000
#define WINDOW_ORDER_FIELD_ROOT_PARENT 0x00040000
#define WINDOW_ORDER_FIELD_WND_OFFSET 0x00000800
#define WINDOW_ORDER_FIELD_WND_CLIENT_DELTA 0x00008000
#define WINDOW_ORDER_FIELD_WND_SIZE 0x00000400
#define WINDOW_ORDER_FIELD_WND_RECTS 0x00000100
#define WINDOW_ORDER_FIELD_VIS_OFFSET 0x00001000
#define WINDOW_ORDER_FIELD_VISIBILITY 0x00000200
#define WINDOW_ORDER_FIELD_ICON_BIG 0x00002000
#define WINDOW_ORDER_ICON 0x40000000
#define WINDOW_ORDER_CACHED_ICON 0x80000000
#define WINDOW_ORDER_FIELD_NOTIFY_VERSION 0x00000008
#define WINDOW_ORDER_FIELD_NOTIFY_TIP 0x00000001
#define WINDOW_ORDER_FIELD_NOTIFY_INFO_TIP 0x00000002
#define WINDOW_ORDER_FIELD_NOTIFY_STATE 0x00000004
#define WINDOW_ORDER_FIELD_DESKTOP_NONE 0x00000001
#define WINDOW_ORDER_FIELD_DESKTOP_HOOKED 0x00000002
#define WINDOW_ORDER_FIELD_DESKTOP_ARC_COMPLETED 0x00000004
#define WINDOW_ORDER_FIELD_DESKTOP_ARC_BEGAN 0x00000008
#define WINDOW_ORDER_FIELD_DESKTOP_ZORDER 0x00000010
#define WINDOW_ORDER_FIELD_DESKTOP_ACTIVE_WND 0x00000020
/* Update Interface */
typedef struct rdp_update rdpUpdate;
@ -905,6 +939,7 @@ struct rdp_update
{
void* rdp;
void* gdi;
void* rail;
void* param1;
void* param2;

View File

@ -25,40 +25,6 @@
#include <freerdp/utils/stream.h>
/* Window Order Header Flags */
#define WINDOW_ORDER_TYPE_WINDOW 0x01000000
#define WINDOW_ORDER_TYPE_NOTIFY 0x02000000
#define WINDOW_ORDER_TYPE_DESKTOP 0x04000000
#define WINDOW_ORDER_STATE_NEW 0x10000000
#define WINDOW_ORDER_STATE_DELETED 0x20000000
#define WINDOW_ORDER_FIELD_OWNER 0x00000002
#define WINDOW_ORDER_FIELD_STYLE 0x00000008
#define WINDOW_ORDER_FIELD_SHOW 0x00000010
#define WINDOW_ORDER_FIELD_TITLE 0x00000004
#define WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET 0x00004000
#define WINDOW_ORDER_FIELD_CLIENT_AREA_SIZE 0x00010000
#define WINDOW_ORDER_FIELD_RP_CONTENT 0x00020000
#define WINDOW_ORDER_FIELD_ROOT_PARENT 0x00040000
#define WINDOW_ORDER_FIELD_WND_OFFSET 0x00000800
#define WINDOW_ORDER_FIELD_WND_CLIENT_DELTA 0x00008000
#define WINDOW_ORDER_FIELD_WND_SIZE 0x00000400
#define WINDOW_ORDER_FIELD_WND_RECTS 0x00000100
#define WINDOW_ORDER_FIELD_VIS_OFFSET 0x00001000
#define WINDOW_ORDER_FIELD_VISIBILITY 0x00000200
#define WINDOW_ORDER_FIELD_ICON_BIG 0x00002000
#define WINDOW_ORDER_ICON 0x40000000
#define WINDOW_ORDER_CACHED_ICON 0x80000000
#define WINDOW_ORDER_FIELD_NOTIFY_VERSION 0x00000008
#define WINDOW_ORDER_FIELD_NOTIFY_TIP 0x00000001
#define WINDOW_ORDER_FIELD_NOTIFY_INFO_TIP 0x00000002
#define WINDOW_ORDER_FIELD_NOTIFY_STATE 0x00000004
#define WINDOW_ORDER_FIELD_DESKTOP_NONE 0x00000001
#define WINDOW_ORDER_FIELD_DESKTOP_HOOKED 0x00000002
#define WINDOW_ORDER_FIELD_DESKTOP_ARC_COMPLETED 0x00000004
#define WINDOW_ORDER_FIELD_DESKTOP_ARC_BEGAN 0x00000008
#define WINDOW_ORDER_FIELD_DESKTOP_ZORDER 0x00000010
#define WINDOW_ORDER_FIELD_DESKTOP_ACTIVE_WND 0x00000020
void update_recv_altsec_window_order(rdpUpdate* update, STREAM* s);
#ifdef WITH_DEBUG_WND

View File

@ -22,6 +22,34 @@
#include <freerdp/rail/rail.h>
static void rail_WindowCreate(rdpUpdate* update, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* window_state)
{
rdpRail* rail;
rail = (rdpRail*) update->rail;
window_list_create(rail->list, orderInfo, window_state);
}
static void rail_WindowUpdate(rdpUpdate* update, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* window_state)
{
rdpRail* rail;
rail = (rdpRail*) update->rail;
window_list_update(rail->list, orderInfo, window_state);
}
static void rail_WindowDelete(rdpUpdate* update, WINDOW_ORDER_INFO* orderInfo)
{
rdpRail* rail;
rail = (rdpRail*) update->rail;
window_list_delete(rail->list, orderInfo);
}
void rail_register_update_callbacks(rdpRail* rail, rdpUpdate* update)
{
update->WindowCreate = rail_WindowCreate;
update->WindowUpdate = rail_WindowUpdate;
update->WindowDelete = rail_WindowDelete;
}
rdpRail* rail_new()
{
rdpRail* rail;

View File

@ -22,7 +22,88 @@
#include <freerdp/rail/window.h>
rdpWindow* rail_CreateWindow()
void window_state_update(rdpWindow* window, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* window_state)
{
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_OWNER)
{
window->ownerWindowId = window_state->ownerWindowId;
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_STYLE)
{
window->style = window_state->style;
window->extendedStyle = window_state->extendedStyle;
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_SHOW)
{
window->showState = window_state->showState;
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_TITLE)
{
window->clientOffsetX = window_state->clientOffsetX;
window->clientOffsetY = window_state->clientOffsetY;
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET)
{
window->clientOffsetX = window_state->clientOffsetX;
window->clientOffsetY = window_state->clientOffsetY;
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_CLIENT_AREA_SIZE)
{
window->clientAreaWidth = window_state->clientAreaWidth;
window->clientAreaHeight = window_state->clientAreaHeight;
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_RP_CONTENT)
{
window->RPContent = window_state->RPContent;
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_ROOT_PARENT)
{
window->rootParentHandle = window_state->rootParentHandle;
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_WND_OFFSET)
{
window->windowOffsetX = window_state->windowOffsetX;
window->windowOffsetY = window_state->windowOffsetY;
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_WND_CLIENT_DELTA)
{
window->windowClientDeltaX = window_state->windowClientDeltaX;
window->windowClientDeltaY = window_state->windowClientDeltaY;
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_WND_SIZE)
{
window->windowWidth = window_state->windowWidth;
window->windowHeight = window_state->windowHeight;
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_WND_RECTS)
{
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_VIS_OFFSET)
{
window->visibleOffsetX = window_state->visibleOffsetX;
window->visibleOffsetY = window_state->visibleOffsetY;
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_VISIBILITY)
{
}
}
rdpWindow* rail_CreateWindow(uint32 windowId)
{
rdpWindow* window;
@ -30,7 +111,7 @@ rdpWindow* rail_CreateWindow()
if (window != NULL)
{
window->windowId = windowId;
}
return window;

View File

@ -46,7 +46,7 @@ void window_list_create(rdpWindowList* list, WINDOW_ORDER_INFO* orderInfo, WINDO
{
rdpWindow* window;
window = rail_CreateWindow();
window = rail_CreateWindow(orderInfo->windowId);
if (list->head == NULL)
{
@ -62,6 +62,8 @@ void window_list_create(rdpWindowList* list, WINDOW_ORDER_INFO* orderInfo, WINDO
}
window->windowId = orderInfo->windowId;
window_state_update(window, orderInfo, window_state);
}
void window_list_update(rdpWindowList* list, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* window_state)
@ -72,6 +74,8 @@ void window_list_update(rdpWindowList* list, WINDOW_ORDER_INFO* orderInfo, WINDO
if (window == NULL)
return;
window_state_update(window, orderInfo, window_state);
}
void window_list_delete(rdpWindowList* list, WINDOW_ORDER_INFO* orderInfo)
@ -82,6 +86,9 @@ void window_list_delete(rdpWindowList* list, WINDOW_ORDER_INFO* orderInfo)
window = window_list_get_by_id(list, orderInfo->windowId);
if (window == NULL)
return;
prev = window->prev;
next = window->next;