libfreerdp-rail: remove

This commit is contained in:
Marc-André Moreau 2014-11-12 19:51:17 -05:00
parent b32341785e
commit 1c9231acf8
12 changed files with 0 additions and 1278 deletions

View File

@ -28,7 +28,6 @@ install(DIRECTORY freerdp/codec DESTINATION include/freerdp COMPONENT headers FI
install(DIRECTORY freerdp/crypto DESTINATION include/freerdp COMPONENT headers FILES_MATCHING PATTERN "*.h")
install(DIRECTORY freerdp/gdi DESTINATION include/freerdp COMPONENT headers FILES_MATCHING PATTERN "*.h")
install(DIRECTORY freerdp/locale DESTINATION include/freerdp COMPONENT headers FILES_MATCHING PATTERN "*.h")
install(DIRECTORY freerdp/rail DESTINATION include/freerdp COMPONENT headers FILES_MATCHING PATTERN "*.h")
install(DIRECTORY freerdp/utils DESTINATION include/freerdp COMPONENT headers FILES_MATCHING PATTERN "*.h")
install(DIRECTORY freerdp/client DESTINATION include/freerdp COMPONENT headers FILES_MATCHING PATTERN "*.h")
install(DIRECTORY freerdp/server DESTINATION include/freerdp COMPONENT headers FILES_MATCHING PATTERN "*.h")

View File

@ -1,70 +0,0 @@
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* Window Icon Cache
*
* 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 FREERDP_RAIL_ICON_CACHE_H
#define FREERDP_RAIL_ICON_CACHE_H
#include <freerdp/api.h>
#include <freerdp/rail.h>
#include <freerdp/types.h>
#include <freerdp/update.h>
#include <winpr/stream.h>
typedef struct rdp_icon rdpIcon;
typedef struct rdp_icon_cache rdpIconCache;
#include <freerdp/rail/rail.h>
struct rdp_icon
{
ICON_INFO* entry;
BOOL big;
void* extra;
};
struct _WINDOW_ICON_CACHE
{
rdpIcon* entries;
};
typedef struct _WINDOW_ICON_CACHE WINDOW_ICON_CACHE;
struct rdp_icon_cache
{
rdpRail* rail;
BYTE numCaches;
UINT16 numCacheEntries;
WINDOW_ICON_CACHE* caches;
};
#ifdef __cplusplus
extern "C" {
#endif
FREERDP_API ICON_INFO* icon_cache_get(rdpIconCache* cache, BYTE id, UINT16 index, void** extra);
FREERDP_API void icon_cache_put(rdpIconCache* cache, BYTE id, UINT16 index, ICON_INFO* entry, void* extra);
FREERDP_API rdpIconCache* icon_cache_new(rdpRail* rail);
FREERDP_API void icon_cache_free(rdpIconCache* cache);
#ifdef __cplusplus
}
#endif
#endif /* FREERDP_RAIL_ICON_CACHE_H */

View File

@ -1,77 +0,0 @@
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* Remote Applications Integrated Locally (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 FREERDP_RAIL_H
#define FREERDP_RAIL_H
#include <freerdp/api.h>
#include <freerdp/rail.h>
#include <freerdp/types.h>
#include <freerdp/update.h>
#include <freerdp/freerdp.h>
#include <freerdp/codec/color.h>
#include <winpr/stream.h>
#include <freerdp/rail/icon.h>
#include <freerdp/rail/window.h>
#include <freerdp/rail/window_list.h>
typedef void (*railCreateWindow)(rdpRail* rail, rdpWindow* window);
typedef void (*railDestroyWindow)(rdpRail* rail, rdpWindow* window);
typedef void (*railMoveWindow)(rdpRail* rail, rdpWindow* window);
typedef void (*railShowWindow)(rdpRail* rail, rdpWindow* window, BYTE state);
typedef void (*railSetWindowText)(rdpRail* rail, rdpWindow* window);
typedef void (*railSetWindowIcon)(rdpRail* rail, rdpWindow* window, rdpIcon* icon);
typedef void (*railSetWindowRects)(rdpRail* rail, rdpWindow* window);
typedef void (*railSetWindowVisibilityRects)(rdpRail* rail, rdpWindow* window);
typedef void (*railDesktopNonMonitored) (rdpRail* rail, rdpWindow* window);
struct rdp_rail
{
void* extra;
CLRCONV* clrconv;
rdpIconCache* cache;
rdpWindowList* list;
rdpSettings* settings;
railCreateWindow rail_CreateWindow;
railDestroyWindow rail_DestroyWindow;
railMoveWindow rail_MoveWindow;
railShowWindow rail_ShowWindow;
railSetWindowText rail_SetWindowText;
railSetWindowIcon rail_SetWindowIcon;
railSetWindowRects rail_SetWindowRects;
railSetWindowVisibilityRects rail_SetWindowVisibilityRects;
railDesktopNonMonitored rail_DesktopNonMonitored;
};
#ifdef __cplusplus
extern "C" {
#endif
FREERDP_API void rail_register_update_callbacks(rdpRail* rail, rdpUpdate* update);
FREERDP_API rdpRail* rail_new(rdpSettings* settings);
FREERDP_API void rail_free(rdpRail* rail);
#ifdef __cplusplus
}
#endif
#endif /* FREERDP_RAIL_H */

View File

@ -1,85 +0,0 @@
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* RAIL Windows
*
* 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 FREERDP_RAIL_WINDOW_H
#define FREERDP_RAIL_WINDOW_H
#include <freerdp/api.h>
#include <freerdp/rail.h>
#include <freerdp/types.h>
#include <freerdp/update.h>
#include <winpr/stream.h>
typedef struct rdp_window rdpWindow;
#include <freerdp/rail/rail.h>
#include <freerdp/rail/icon.h>
struct rdp_window
{
void* extra;
void* extraId;
char* title;
rdpIcon* bigIcon;
rdpIcon* smallIcon;
UINT32 fieldFlags;
rdpWindow* prev;
rdpWindow* next;
UINT32 windowId;
UINT32 ownerWindowId;
UINT32 style;
UINT32 extendedStyle;
BYTE showState;
RAIL_UNICODE_STRING titleInfo;
UINT32 clientOffsetX;
UINT32 clientOffsetY;
UINT32 clientAreaWidth;
UINT32 clientAreaHeight;
BYTE RPContent;
UINT32 rootParentHandle;
INT32 windowOffsetX;
INT32 windowOffsetY;
UINT32 windowClientDeltaX;
UINT32 windowClientDeltaY;
UINT32 windowWidth;
UINT32 windowHeight;
UINT16 numWindowRects;
RECTANGLE_16* windowRects;
UINT32 visibleOffsetX;
UINT32 visibleOffsetY;
UINT16 numVisibilityRects;
RECTANGLE_16* visibilityRects;
};
#ifdef __cplusplus
extern "C" {
#endif
FREERDP_API void window_state_update(rdpWindow* window, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* window_state);
FREERDP_API void rail_CreateWindow(rdpRail* rail, rdpWindow* window);
FREERDP_API void rail_UpdateWindow(rdpRail* rail, rdpWindow* window);
FREERDP_API void rail_DestroyWindow(rdpRail* rail, rdpWindow* window);
#ifdef __cplusplus
}
#endif
#endif /* FREERDP_RAIL_WINDOW_H */

View File

@ -1,65 +0,0 @@
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* RAIL Window List
*
* 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 FREERDP_RAIL_WINDOW_LIST_H
#define FREERDP_RAIL_WINDOW_LIST_H
#include <freerdp/api.h>
#include <freerdp/types.h>
#include <freerdp/update.h>
#include <winpr/stream.h>
typedef struct rdp_window_list rdpWindowList;
#include <freerdp/rail/rail.h>
#include <freerdp/rail/window.h>
struct rdp_window_list
{
rdpRail* rail;
rdpWindow* head;
rdpWindow* tail;
rdpWindow* iterator;
};
#ifdef __cplusplus
extern "C" {
#endif
FREERDP_API void window_list_rewind(rdpWindowList* list);
FREERDP_API BOOL window_list_has_next(rdpWindowList* list);
FREERDP_API rdpWindow* window_list_get_next(rdpWindowList* list);
FREERDP_API rdpWindow* window_list_get_by_id(rdpWindowList* list, UINT32 windowId);
FREERDP_API rdpWindow* window_list_get_by_extra_id(rdpWindowList* list, void* extraId);
FREERDP_API void window_list_create(rdpWindowList* list, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* window_state);
FREERDP_API void window_list_update(rdpWindowList* list, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* window_state);
FREERDP_API void window_list_delete(rdpWindowList* list, WINDOW_ORDER_INFO* orderInfo);
FREERDP_API void window_list_clear(rdpWindowList* list);
FREERDP_API rdpWindowList* window_list_new(rdpRail* rail);
FREERDP_API void window_list_free(rdpWindowList* list);
#ifdef __cplusplus
}
#endif
#endif /* FREERDP_RAIL_WINDOW_LIST_H */

View File

@ -83,7 +83,6 @@ set(${MODULE_PREFIX}_SUBMODULES
utils
common
gdi
rail
cache
crypto
locale

View File

@ -1,26 +0,0 @@
# FreeRDP: A Remote Desktop Protocol Implementation
# libfreerdp-rail cmake build script
#
# Copyright 2012 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.
set(MODULE_NAME "freerdp-rail")
set(MODULE_PREFIX "FREERDP_RAIL")
freerdp_module_add(
window_list.c
window.c
icon.c
rail.c
librail.h)

View File

@ -1,126 +0,0 @@
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* Window Icon Cache
*
* Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <winpr/crt.h>
#include <winpr/print.h>
#include <winpr/stream.h>
#include <freerdp/log.h>
#include <freerdp/rail/icon.h>
#define TAG FREERDP_TAG("rail")
ICON_INFO* icon_cache_get(rdpIconCache* cache, BYTE id, UINT16 index, void** extra)
{
ICON_INFO* entry;
if (id >= cache->numCaches)
{
WLog_ERR(TAG, "invalid window icon cache id:%d", id);
return (ICON_INFO*) NULL;
}
if (index >= cache->numCacheEntries)
{
WLog_ERR(TAG, "invalid window icon cache index:%d in cache id:%d", index, id);
return (ICON_INFO*) NULL;
}
entry = cache->caches[id].entries[index].entry;
if (extra)
*extra = cache->caches[id].entries[index].extra;
return entry;
}
void icon_cache_put(rdpIconCache* cache, BYTE id, UINT16 index, ICON_INFO* entry, void* extra)
{
if (id >= cache->numCaches)
{
WLog_ERR(TAG, "invalid window icon cache id:%d", id);
return;
}
if (index >= cache->numCacheEntries)
{
WLog_ERR(TAG, "invalid window icon cache index:%d in cache id:%d", index, id);
return;
}
cache->caches[id].entries[index].entry = entry;
if (extra != NULL)
cache->caches[id].entries[index].extra = extra;
}
rdpIconCache* icon_cache_new(rdpRail* rail)
{
rdpIconCache* cache;
cache = (rdpIconCache*) malloc(sizeof(rdpIconCache));
if (cache != NULL)
{
int i;
ZeroMemory(cache, sizeof(rdpIconCache));
cache->rail = rail;
cache->numCaches = (BYTE) rail->settings->RemoteAppNumIconCacheEntries;
cache->numCacheEntries = rail->settings->RemoteAppNumIconCacheEntries;
cache->caches = malloc(cache->numCaches * sizeof(WINDOW_ICON_CACHE));
ZeroMemory(cache->caches, cache->numCaches * sizeof(WINDOW_ICON_CACHE));
for (i = 0; i < cache->numCaches; i++)
{
if (cache->numCacheEntries)
{
cache->caches[i].entries = malloc(cache->numCacheEntries * sizeof(rdpIcon));
ZeroMemory(cache->caches[i].entries, cache->numCacheEntries * sizeof(rdpIcon));
}
}
}
return cache;
}
void icon_cache_free(rdpIconCache* cache)
{
if (cache)
{
int i;
for (i = 0; i < cache->numCaches; i++)
{
free(cache->caches[i].entries);
}
free(cache->caches);
free(cache);
}
}

View File

@ -1,36 +0,0 @@
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* Remote Applications Integrated Locally (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 __LIBRAIL_H
#define __LIBRAIL_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <freerdp/log.h>
#define RAIL_TAG FREERDP_TAG("rail")
#ifdef WITH_DEBUG_RAIL
#define DEBUG_RAIL(fmt, ...) WLog_DBG(RAIL_TAG, fmt, ## __VA_ARGS__)
#else
#define DEBUG_RAIL(fmt, ...) do { } while (0)
#endif
#endif /* __LIBRAIL_H */

View File

@ -1,175 +0,0 @@
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* Remote Applications Integrated Locally (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.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <winpr/crt.h>
#include <winpr/stream.h>
#include "librail.h"
#include <freerdp/rail/rail.h>
#include <freerdp/rail/window_list.h>
static void rail_WindowCreate(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* windowState)
{
rdpRail* rail = context->rail;
window_list_create(rail->list, orderInfo, windowState);
}
static void rail_WindowUpdate(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* windowState)
{
rdpRail* rail = context->rail;
window_list_update(rail->list, orderInfo, windowState);
}
static void rail_WindowDelete(rdpContext* context, WINDOW_ORDER_INFO* orderInfo)
{
rdpRail* rail = context->rail;
window_list_delete(rail->list, orderInfo);
}
static void rail_WindowIcon(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, WINDOW_ICON_ORDER* windowIcon)
{
rdpIcon* icon;
rdpWindow* window;
rdpRail* rail = context->rail;
if (windowIcon->iconInfo->cacheEntry != 0xFFFF)
{
/* cache icon */
}
window = window_list_get_by_id(rail->list, orderInfo->windowId);
if (!window)
return;
icon = (rdpIcon*) malloc(sizeof(rdpIcon));
ZeroMemory(icon, sizeof(rdpIcon));
icon->entry = windowIcon->iconInfo;
icon->big = (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_ICON_BIG) ? TRUE : FALSE;
DEBUG_RAIL("Window Icon: %dx%d@%dbpp cbBitsColor:%d cbBitsMask:%d cbColorTable:%d",
windowIcon->iconInfo->width, windowIcon->iconInfo->height, windowIcon->iconInfo->bpp,
windowIcon->iconInfo->cbBitsColor, windowIcon->iconInfo->cbBitsMask, windowIcon->iconInfo->cbColorTable);
if (icon->big)
window->bigIcon = icon;
else
window->smallIcon = icon;
IFCALL(rail->rail_SetWindowIcon, rail, window, icon);
}
static void rail_WindowCachedIcon(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, WINDOW_CACHED_ICON_ORDER* windowCachedIcon)
{
}
static void rail_NotifyIconCreate(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, NOTIFY_ICON_STATE_ORDER* notifyIconState)
{
}
static void rail_NotifyIconUpdate(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, NOTIFY_ICON_STATE_ORDER* notifyIconState)
{
}
static void rail_NotifyIconDelete(rdpContext* context, WINDOW_ORDER_INFO* orderInfo)
{
}
static void rail_MonitoredDesktop(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, MONITORED_DESKTOP_ORDER* monitoredDesktop)
{
}
/**
* This is used to switch FreeRDP back to showing the full desktop under remote app mode
* to handle cases where the screen is locked, etc. The rail server informs us that it is
* no longer monitoring the desktop. Once the desktop becomes monitored again. The full desktop
* window will be automatically destroyed and we will switch back into remote app mode.
*/
static void rail_NonMonitoredDesktop(rdpContext* context, WINDOW_ORDER_INFO* orderInfo)
{
rdpWindow* window;
rdpRail* rail = context->rail;
window = window_list_get_by_id(rail->list, orderInfo->windowId);
IFCALL(rail->rail_DesktopNonMonitored, rail, window);
window_list_clear(rail->list);
}
void rail_register_update_callbacks(rdpRail* rail, rdpUpdate* update)
{
rdpWindowUpdate* window = update->window;
window->WindowCreate = rail_WindowCreate;
window->WindowUpdate = rail_WindowUpdate;
window->WindowDelete = rail_WindowDelete;
window->WindowIcon = rail_WindowIcon;
window->WindowCachedIcon = rail_WindowCachedIcon;
window->NotifyIconCreate = rail_NotifyIconCreate;
window->NotifyIconUpdate = rail_NotifyIconUpdate;
window->NotifyIconDelete = rail_NotifyIconDelete;
window->MonitoredDesktop = rail_MonitoredDesktop;
window->NonMonitoredDesktop = rail_NonMonitoredDesktop;
}
rdpRail* rail_new(rdpSettings* settings)
{
rdpRail* rail;
rail = (rdpRail*) malloc(sizeof(rdpRail));
if (rail)
{
ZeroMemory(rail, sizeof(rdpRail));
rail->settings = settings;
rail->cache = icon_cache_new(rail);
rail->list = window_list_new(rail);
rail->clrconv = (CLRCONV*) malloc(sizeof(CLRCONV));
ZeroMemory(rail->clrconv, sizeof(CLRCONV));
}
return rail;
}
void rail_free(rdpRail* rail)
{
if (rail)
{
icon_cache_free(rail->cache);
window_list_free(rail->list);
free(rail->clrconv);
free(rail);
}
}

View File

@ -1,383 +0,0 @@
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* RAIL Windows
*
* Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <winpr/crt.h>
#include <winpr/print.h>
#include <winpr/windows.h>
#include <winpr/stream.h>
#include "librail.h"
#include <freerdp/rail/window.h>
#include <freerdp/log.h>
#define TAG FREERDP_TAG("rail")
struct _WINDOW_STYLE
{
UINT32 style;
const char* name;
BOOL multi;
};
typedef struct _WINDOW_STYLE WINDOW_STYLE;
static const WINDOW_STYLE WINDOW_STYLES[] =
{
{ WS_BORDER, "WS_BORDER", FALSE },
{ WS_CAPTION, "WS_CAPTION", FALSE },
{ WS_CHILD, "WS_CHILD", FALSE },
{ WS_CLIPCHILDREN, "WS_CLIPCHILDREN", FALSE },
{ WS_CLIPSIBLINGS, "WS_CLIPSIBLINGS", FALSE },
{ WS_DISABLED, "WS_DISABLED", FALSE },
{ WS_DLGFRAME, "WS_DLGFRAME", FALSE },
{ WS_GROUP, "WS_GROUP", FALSE },
{ WS_HSCROLL, "WS_HSCROLL", FALSE },
{ WS_ICONIC, "WS_ICONIC", FALSE },
{ WS_MAXIMIZE, "WS_MAXIMIZE", FALSE },
{ WS_MAXIMIZEBOX, "WS_MAXIMIZEBOX", FALSE },
{ WS_MINIMIZE, "WS_MINIMIZE", FALSE },
{ WS_MINIMIZEBOX, "WS_MINIMIZEBOX", FALSE },
{ WS_OVERLAPPED, "WS_OVERLAPPED", FALSE },
{ WS_OVERLAPPEDWINDOW, "WS_OVERLAPPEDWINDOW", TRUE },
{ WS_POPUP, "WS_POPUP", FALSE },
{ WS_POPUPWINDOW, "WS_POPUPWINDOW", TRUE },
{ WS_SIZEBOX, "WS_SIZEBOX", FALSE },
{ WS_SYSMENU, "WS_SYSMENU", FALSE },
{ WS_TABSTOP, "WS_TABSTOP", FALSE },
{ WS_THICKFRAME, "WS_THICKFRAME", FALSE },
{ WS_VISIBLE, "WS_VISIBLE", FALSE }
};
static const WINDOW_STYLE EXTENDED_WINDOW_STYLES[] =
{
{ WS_EX_ACCEPTFILES, "WS_EX_ACCEPTFILES", FALSE },
{ WS_EX_APPWINDOW, "WS_EX_APPWINDOW", FALSE },
{ WS_EX_CLIENTEDGE, "WS_EX_CLIENTEDGE", FALSE },
{ WS_EX_COMPOSITED, "WS_EX_COMPOSITED", FALSE },
{ WS_EX_CONTEXTHELP, "WS_EX_CONTEXTHELP", FALSE },
{ WS_EX_CONTROLPARENT, "WS_EX_CONTROLPARENT", FALSE },
{ WS_EX_DLGMODALFRAME, "WS_EX_DLGMODALFRAME", FALSE },
{ WS_EX_LAYERED, "WS_EX_LAYERED", FALSE },
{ WS_EX_LAYOUTRTL, "WS_EX_LAYOUTRTL", FALSE },
{ WS_EX_LEFT, "WS_EX_LEFT", FALSE },
{ WS_EX_LEFTSCROLLBAR, "WS_EX_LEFTSCROLLBAR", FALSE },
{ WS_EX_LTRREADING, "WS_EX_LTRREADING", FALSE },
{ WS_EX_MDICHILD, "WS_EX_MDICHILD", FALSE },
{ WS_EX_NOACTIVATE, "WS_EX_NOACTIVATE", FALSE },
{ WS_EX_NOINHERITLAYOUT, "WS_EX_NOINHERITLAYOUT", FALSE },
{ WS_EX_NOPARENTNOTIFY, "WS_EX_NOPARENTNOTIFY", FALSE },
{ WS_EX_OVERLAPPEDWINDOW, "WS_EX_OVERLAPPEDWINDOW", TRUE },
{ WS_EX_PALETTEWINDOW, "WS_EX_PALETTEWINDOW", TRUE },
{ WS_EX_RIGHT, "WS_EX_RIGHT", FALSE },
{ WS_EX_RIGHTSCROLLBAR, "WS_EX_RIGHTSCROLLBAR", FALSE },
{ WS_EX_RTLREADING, "WS_EX_RTLREADING", FALSE },
{ WS_EX_STATICEDGE, "WS_EX_STATICEDGE", FALSE },
{ WS_EX_TOOLWINDOW, "WS_EX_TOOLWINDOW", FALSE },
{ WS_EX_TOPMOST, "WS_EX_TOPMOST", FALSE },
{ WS_EX_TRANSPARENT, "WS_EX_TRANSPARENT", FALSE },
{ WS_EX_WINDOWEDGE, "WS_EX_WINDOWEDGE", FALSE }
};
void print_window_styles(UINT32 style)
{
int i;
WLog_INFO(TAG, "Window Styles:{");
for (i = 0; i < ARRAYSIZE(WINDOW_STYLES); i++)
{
if (style & WINDOW_STYLES[i].style)
{
if (WINDOW_STYLES[i].multi)
{
if ((style & WINDOW_STYLES[i].style) != WINDOW_STYLES[i].style)
continue;
}
WLog_INFO(TAG, "\t%s", WINDOW_STYLES[i].name);
}
}
WLog_INFO(TAG, "}");
}
void print_extended_window_styles(UINT32 style)
{
int i;
WLog_INFO(TAG, "Extended Window Styles:{");
for (i = 0; i < ARRAYSIZE(EXTENDED_WINDOW_STYLES); i++)
{
if (style & EXTENDED_WINDOW_STYLES[i].style)
{
if (EXTENDED_WINDOW_STYLES[i].multi)
{
if ((style & EXTENDED_WINDOW_STYLES[i].style) != EXTENDED_WINDOW_STYLES[i].style)
continue;
}
WLog_INFO(TAG, "\t%s", EXTENDED_WINDOW_STYLES[i].name);
}
}
WLog_INFO(TAG, "}");
}
void window_state_update(rdpWindow* window, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* window_state)
{
window->fieldFlags = orderInfo->fieldFlags;
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_OWNER)
{
window->ownerWindowId = window_state->ownerWindowId;
DEBUG_RAIL("ownerWindowId:0x%08X", window->ownerWindowId);
}
DEBUG_RAIL("windowId=0x%X ownerWindowId=0x%X",
window->windowId, window->ownerWindowId);
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_STYLE)
{
window->style = window_state->style;
window->extendedStyle = window_state->extendedStyle;
#ifdef WITH_DEBUG_RAIL
print_window_styles(window->style);
print_extended_window_styles(window->extendedStyle);
#endif
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_SHOW)
{
window->showState = window_state->showState;
DEBUG_RAIL("ShowState:%d", window->showState);
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_TITLE)
{
window->titleInfo.length = window_state->titleInfo.length;
window->titleInfo.string = malloc(window_state->titleInfo.length);
memcpy(window->titleInfo.string, window_state->titleInfo.string, window->titleInfo.length);
#ifdef WITH_DEBUG_RAIL
winpr_HexDump(TAG, WLOG_DEBUG, window->titleInfo.string, window->titleInfo.length);
#endif
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET)
{
window->clientOffsetX = window_state->clientOffsetX;
window->clientOffsetY = window_state->clientOffsetY;
DEBUG_RAIL("Client Area Offset: (%d, %d)",
window->clientOffsetX, window->clientOffsetY);
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_CLIENT_AREA_SIZE)
{
window->clientAreaWidth = window_state->clientAreaWidth;
window->clientAreaHeight = window_state->clientAreaHeight;
DEBUG_RAIL("Client Area Size: (%d, %d)",
window->clientAreaWidth, window->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;
DEBUG_RAIL("Window Offset: (%d, %d)",
window->windowOffsetX, window->windowOffsetY);
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_WND_CLIENT_DELTA)
{
window->windowClientDeltaX = window_state->windowClientDeltaX;
window->windowClientDeltaY = window_state->windowClientDeltaY;
DEBUG_RAIL("Window Client Delta: (%d, %d)",
window->windowClientDeltaX, window->windowClientDeltaY);
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_WND_SIZE)
{
window->windowWidth = window_state->windowWidth;
window->windowHeight = window_state->windowHeight;
DEBUG_RAIL("Window Size: (%d, %d)",
window->windowWidth, window->windowHeight);
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_WND_RECTS)
{
int i;
if (window->windowRects != NULL)
free(window->windowRects);
window->windowRects = window_state->windowRects;
window->numWindowRects = window_state->numWindowRects;
for (i = 0; i < (int) window_state->numWindowRects; i++)
{
DEBUG_RAIL("Window Rect #%d: left:%d top:%d right:%d bottom:%d", i,
window_state->windowRects[i].left, window_state->windowRects[i].top,
window_state->windowRects[i].right, window_state->windowRects[i].bottom);
}
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_VIS_OFFSET)
{
window->visibleOffsetX = window_state->visibleOffsetX;
window->visibleOffsetY = window_state->visibleOffsetY;
DEBUG_RAIL("Window Visible Offset: (%d, %d)",
window->visibleOffsetX, window->visibleOffsetY);
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_VISIBILITY)
{
int i;
if (window->visibilityRects != NULL)
free(window->visibilityRects);
window->visibilityRects = window_state->visibilityRects;
window->numVisibilityRects = window_state->numVisibilityRects;
for (i = 0; i < (int) window_state->numVisibilityRects; i++)
{
DEBUG_RAIL("Visibility Rect #%d: left:%d top:%d right:%d bottom:%d", i,
window_state->visibilityRects[i].left, window_state->visibilityRects[i].top,
window_state->visibilityRects[i].right, window_state->visibilityRects[i].bottom);
}
}
}
void rail_CreateWindow(rdpRail* rail, rdpWindow* window)
{
if (window->titleInfo.length > 0)
{
ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) window->titleInfo.string, window->titleInfo.length / 2,
&window->title, 0, NULL, NULL);
}
else
{
window->title = (char*) malloc(sizeof("RAIL"));
memcpy(window->title, "RAIL", sizeof("RAIL"));
}
IFCALL(rail->rail_CreateWindow, rail, window);
if (window->fieldFlags & WINDOW_ORDER_FIELD_WND_RECTS)
{
IFCALL(rail->rail_SetWindowRects, rail, window);
}
if (window->fieldFlags & WINDOW_ORDER_FIELD_VISIBILITY)
{
IFCALL(rail->rail_SetWindowVisibilityRects, rail, window);
}
}
void rail_UpdateWindow(rdpRail* rail, rdpWindow* window)
{
if (window->fieldFlags & WINDOW_ORDER_FIELD_OWNER)
{
}
if (window->fieldFlags & WINDOW_ORDER_FIELD_STYLE)
{
}
if (window->fieldFlags & WINDOW_ORDER_FIELD_SHOW)
{
IFCALL(rail->rail_ShowWindow, rail, window, window->showState);
}
if (window->fieldFlags & WINDOW_ORDER_FIELD_TITLE)
{
if (window->title != NULL)
{
free(window->title);
window->title = NULL;
}
ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) window->titleInfo.string, window->titleInfo.length / 2,
&window->title, 0, NULL, NULL);
IFCALL(rail->rail_SetWindowText, rail, window);
}
if (window->fieldFlags & WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET)
{
}
if (window->fieldFlags & WINDOW_ORDER_FIELD_CLIENT_AREA_SIZE)
{
}
if (window->fieldFlags & WINDOW_ORDER_FIELD_RP_CONTENT)
{
}
if (window->fieldFlags & WINDOW_ORDER_FIELD_ROOT_PARENT)
{
}
if ((window->fieldFlags & WINDOW_ORDER_FIELD_WND_OFFSET) ||
(window->fieldFlags & WINDOW_ORDER_FIELD_WND_SIZE))
{
IFCALL(rail->rail_MoveWindow, rail, window);
}
if (window->fieldFlags & WINDOW_ORDER_FIELD_WND_CLIENT_DELTA)
{
}
if (window->fieldFlags & WINDOW_ORDER_FIELD_WND_RECTS)
{
IFCALL(rail->rail_SetWindowRects, rail, window);
}
if (window->fieldFlags & WINDOW_ORDER_FIELD_VIS_OFFSET)
{
}
if (window->fieldFlags & WINDOW_ORDER_FIELD_VISIBILITY)
{
IFCALL(rail->rail_SetWindowVisibilityRects, rail, window);
}
}
void rail_DestroyWindow(rdpRail* rail, rdpWindow* window)
{
IFCALL(rail->rail_DestroyWindow, rail, window);
if (window)
{
free(window);
}
}

View File

@ -1,233 +0,0 @@
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* RAIL Window List
*
* Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <winpr/crt.h>
#include <winpr/stream.h>
#include "librail.h"
#include <freerdp/rail/window_list.h>
void window_list_rewind(rdpWindowList* list)
{
list->iterator = list->head;
}
BOOL window_list_has_next(rdpWindowList* list)
{
if (list->iterator != NULL)
{
if (list->iterator->next != NULL)
return TRUE;
}
return FALSE;
}
rdpWindow* window_list_get_next(rdpWindowList* list)
{
rdpWindow* next = NULL;
if (list->iterator != NULL)
{
next = list->iterator;
list->iterator = list->iterator->next;
}
return next;
}
rdpWindow* window_list_get_by_extra_id(rdpWindowList* list, void* extraId)
{
rdpWindow* window;
window = list->head;
if (window == NULL)
return NULL;
while (window != NULL)
{
if (window->extraId == extraId)
return window;
window = window->next;
}
return NULL;
}
rdpWindow* window_list_get_by_id(rdpWindowList* list, UINT32 windowId)
{
rdpWindow* window;
window = list->head;
if (window == NULL)
return NULL;
while (window != NULL)
{
if (window->windowId == windowId)
return window;
window = window->next;
}
return NULL;
}
void window_list_create(rdpWindowList* list, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* window_state)
{
rdpWindow* window;
/* See if the window already exists */
window = window_list_get_by_id(list, orderInfo->windowId);
/* If the window already exists, just update the existing window */
if (window != NULL)
{
window_list_update(list, orderInfo, window_state);
return;
}
window = (rdpWindow*) malloc(sizeof(rdpWindow));
if (window == NULL)
return;
ZeroMemory(window, sizeof(rdpWindow));
window->windowId = orderInfo->windowId;
if (list->head == NULL)
{
list->head = list->tail = window;
window->prev = NULL;
window->next = NULL;
}
else
{
window->prev = list->tail;
list->tail->next = window;
window->next = NULL;
list->tail = window;
}
window->windowId = orderInfo->windowId;
window_state_update(window, orderInfo, window_state);
rail_CreateWindow(list->rail, window);
}
void window_list_update(rdpWindowList* list, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* window_state)
{
rdpWindow* window;
window = window_list_get_by_id(list, orderInfo->windowId);
if (window == NULL)
return;
window_state_update(window, orderInfo, window_state);
rail_UpdateWindow(list->rail, window);
}
void window_list_delete(rdpWindowList* list, WINDOW_ORDER_INFO* orderInfo)
{
rdpWindow* prev;
rdpWindow* next;
rdpWindow* window;
window = window_list_get_by_id(list, orderInfo->windowId);
if (window == NULL)
return;
prev = window->prev;
next = window->next;
if (prev != NULL)
prev->next = next;
if (next != NULL)
next->prev = prev;
if (list->head == list->tail)
{
list->head = list->tail = NULL;
}
else
{
if (list->head == window)
list->head = next;
if (list->tail == window)
list->tail = prev;
}
rail_DestroyWindow(list->rail, window);
}
void window_list_clear(rdpWindowList* list)
{
rdpWindow* current = list->head;
while (current != NULL)
{
list->head = current->next;
rail_DestroyWindow(list->rail, current);
current = list->head;
}
list->tail = NULL;
}
rdpWindowList* window_list_new(rdpRail* rail)
{
rdpWindowList* list;
list = (rdpWindowList*) malloc(sizeof(rdpWindowList));
if (list != NULL)
{
ZeroMemory(list, sizeof(rdpWindowList));
list->head = NULL;
list->tail = NULL;
list->rail = rail;
}
return list;
}
void window_list_free(rdpWindowList* list)
{
if (list != NULL)
{
free(list);
}
}