libfreerdp-rail: initial commit
This commit is contained in:
parent
c5ed8b67fe
commit
3316fde2e8
@ -108,6 +108,7 @@ add_subdirectory(include)
|
||||
add_subdirectory(libfreerdp-utils)
|
||||
add_subdirectory(libfreerdp-kbd)
|
||||
add_subdirectory(libfreerdp-gdi)
|
||||
add_subdirectory(libfreerdp-rail)
|
||||
add_subdirectory(libfreerdp-cache)
|
||||
add_subdirectory(libfreerdp-chanman)
|
||||
add_subdirectory(libfreerdp-core)
|
||||
|
@ -18,8 +18,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __RAIL_H
|
||||
#define __RAIL_H
|
||||
#ifndef __RAIL_GLOBAL_H
|
||||
#define __RAIL_GLOBAL_H
|
||||
|
||||
#include <freerdp/types.h>
|
||||
|
||||
@ -325,5 +325,5 @@ typedef struct _RAIL_UI_EVENT
|
||||
}
|
||||
RAIL_UI_EVENT;
|
||||
|
||||
#endif /* __RAIL_H */
|
||||
#endif /* __RAIL_GLOBAL_H */
|
||||
|
||||
|
41
include/freerdp/rail/rail.h
Normal file
41
include/freerdp/rail/rail.h
Normal file
@ -0,0 +1,41 @@
|
||||
/**
|
||||
* FreeRDP: A Remote Desktop Protocol Client
|
||||
* 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 __RAIL_H
|
||||
#define __RAIL_H
|
||||
|
||||
#include <freerdp/rail.h>
|
||||
#include <freerdp/types.h>
|
||||
#include <freerdp/update.h>
|
||||
#include <freerdp/utils/stream.h>
|
||||
|
||||
typedef struct rdp_rail rdpRail;
|
||||
|
||||
#include <freerdp/rail/window.h>
|
||||
#include <freerdp/rail/window_list.h>
|
||||
|
||||
struct rdp_rail
|
||||
{
|
||||
rdpWindowList* list;
|
||||
};
|
||||
|
||||
rdpRail* rail_new();
|
||||
void rail_free(rdpRail* rail);
|
||||
|
||||
#endif /* __RAIL_H */
|
62
include/freerdp/rail/window.h
Normal file
62
include/freerdp/rail/window.h
Normal file
@ -0,0 +1,62 @@
|
||||
/**
|
||||
* FreeRDP: A Remote Desktop Protocol Client
|
||||
* 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 __WINDOW_H
|
||||
#define __WINDOW_H
|
||||
|
||||
#include <freerdp/rail.h>
|
||||
#include <freerdp/types.h>
|
||||
#include <freerdp/utils/stream.h>
|
||||
|
||||
typedef struct rdp_window rdpWindow;
|
||||
|
||||
struct rdp_window
|
||||
{
|
||||
rdpWindow* prev;
|
||||
rdpWindow* next;
|
||||
uint32 windowId;
|
||||
uint32 ownerWindowId;
|
||||
uint32 style;
|
||||
uint32 extendedStyle;
|
||||
uint8 showState;
|
||||
UNICODE_STRING titleInfo;
|
||||
uint32 clientOffsetX;
|
||||
uint32 clientOffsetY;
|
||||
uint32 clientAreaWidth;
|
||||
uint32 clientAreaHeight;
|
||||
uint8 RPContent;
|
||||
uint32 rootParentHandle;
|
||||
uint32 windowOffsetX;
|
||||
uint32 windowOffsetY;
|
||||
uint32 windowClientDeltaX;
|
||||
uint32 windowClientDeltaY;
|
||||
uint32 windowWidth;
|
||||
uint32 windowHeight;
|
||||
uint16 numWindowRects;
|
||||
RECTANGLE_16* windowRects;
|
||||
uint32 visibleOffsetX;
|
||||
uint32 visibleOffsetY;
|
||||
uint16 numVisibilityRects;
|
||||
RECTANGLE_16* visibilityRects;
|
||||
};
|
||||
|
||||
rdpWindow* rail_CreateWindow();
|
||||
void rail_DestroyWindow(rdpWindow* window);
|
||||
|
||||
#endif /* __WINDOW_H */
|
44
include/freerdp/rail/window_list.h
Normal file
44
include/freerdp/rail/window_list.h
Normal file
@ -0,0 +1,44 @@
|
||||
/**
|
||||
* FreeRDP: A Remote Desktop Protocol Client
|
||||
* 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 __WINDOW_LIST_H
|
||||
#define __WINDOW_LIST_H
|
||||
|
||||
#include <freerdp/types.h>
|
||||
#include <freerdp/update.h>
|
||||
#include <freerdp/utils/stream.h>
|
||||
|
||||
#include <freerdp/rail/window.h>
|
||||
|
||||
typedef struct rdp_window_list rdpWindowList;
|
||||
|
||||
struct rdp_window_list
|
||||
{
|
||||
rdpWindow* head;
|
||||
rdpWindow* tail;
|
||||
};
|
||||
|
||||
void window_list_create(rdpWindowList* list, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* window_state);
|
||||
void window_list_update(rdpWindowList* list, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* window_state);
|
||||
void window_list_delete(rdpWindowList* list, WINDOW_ORDER_INFO* orderInfo);
|
||||
|
||||
rdpWindowList* window_list_new();
|
||||
void window_list_free(rdpWindowList* list);
|
||||
|
||||
#endif /* __WINDOW_LIST_H */
|
@ -888,12 +888,14 @@ typedef void (*pcDrawGdiPlusCacheFirst)(rdpUpdate* update, DRAW_GDIPLUS_CACHE_FI
|
||||
typedef void (*pcDrawGdiPlusCacheNext)(rdpUpdate* update, DRAW_GDIPLUS_CACHE_NEXT_ORDER* draw_gdiplus_cache_next);
|
||||
typedef void (*pcDrawGdiPlusCacheEnd)(rdpUpdate* update, DRAW_GDIPLUS_CACHE_END_ORDER* draw_gdiplus_cache_end);
|
||||
|
||||
typedef void (*pcWindowState)(rdpUpdate* update, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* window_state);
|
||||
typedef void (*pcWindowCreate)(rdpUpdate* update, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* window_state);
|
||||
typedef void (*pcWindowUpdate)(rdpUpdate* update, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* window_state);
|
||||
typedef void (*pcWindowIcon)(rdpUpdate* update, WINDOW_ORDER_INFO* orderInfo, WINDOW_ICON_ORDER* window_icon);
|
||||
typedef void (*pcWindowCachedIcon)(rdpUpdate* update, WINDOW_ORDER_INFO* orderInfo, WINDOW_CACHED_ICON_ORDER* window_cached_icon);
|
||||
typedef void (*pcWindowDeleted)(rdpUpdate* update, WINDOW_ORDER_INFO* orderInfo);
|
||||
typedef void (*pcNotifyIconState)(rdpUpdate* update, WINDOW_ORDER_INFO* orderInfo, NOTIFY_ICON_STATE_ORDER* notify_icon_state);
|
||||
typedef void (*pcNotifyIconDeleted)(rdpUpdate* update, WINDOW_ORDER_INFO* orderInfo);
|
||||
typedef void (*pcWindowDelete)(rdpUpdate* update, WINDOW_ORDER_INFO* orderInfo);
|
||||
typedef void (*pcNotifyIconCreate)(rdpUpdate* update, WINDOW_ORDER_INFO* orderInfo, NOTIFY_ICON_STATE_ORDER* notify_icon_state);
|
||||
typedef void (*pcNotifyIconUpdate)(rdpUpdate* update, WINDOW_ORDER_INFO* orderInfo, NOTIFY_ICON_STATE_ORDER* notify_icon_state);
|
||||
typedef void (*pcNotifyIconDelete)(rdpUpdate* update, WINDOW_ORDER_INFO* orderInfo);
|
||||
typedef void (*pcMonitoredDesktop)(rdpUpdate* update, WINDOW_ORDER_INFO* orderInfo, MONITORED_DESKTOP_ORDER* monitored_desktop);
|
||||
typedef void (*pcNonMonitoredDesktop)(rdpUpdate* update, WINDOW_ORDER_INFO* orderInfo);
|
||||
|
||||
@ -958,12 +960,14 @@ struct rdp_update
|
||||
pcDrawGdiPlusCacheNext DrawGdiPlusCacheNext;
|
||||
pcDrawGdiPlusCacheEnd DrawGdiPlusCacheEnd;
|
||||
|
||||
pcWindowState WindowState;
|
||||
pcWindowCreate WindowCreate;
|
||||
pcWindowUpdate WindowUpdate;
|
||||
pcWindowIcon WindowIcon;
|
||||
pcWindowCachedIcon WindowCachedIcon;
|
||||
pcWindowDeleted WindowDeleted;
|
||||
pcNotifyIconState NotifyIconState;
|
||||
pcNotifyIconDeleted NotifyIconDeleted;
|
||||
pcWindowDelete WindowDelete;
|
||||
pcNotifyIconCreate NotifyIconCreate;
|
||||
pcNotifyIconUpdate NotifyIconUpdate;
|
||||
pcNotifyIconDelete NotifyIconDelete;
|
||||
pcMonitoredDesktop MonitoredDesktop;
|
||||
pcNonMonitoredDesktop NonMonitoredDesktop;
|
||||
|
||||
|
@ -210,13 +210,17 @@ void update_recv_window_info_order(rdpUpdate* update, STREAM* s, WINDOW_ORDER_IN
|
||||
{
|
||||
DEBUG_WND("Window Deleted Order");
|
||||
update_read_window_deleted_order(s, orderInfo);
|
||||
IFCALL(update->WindowDeleted, update, orderInfo);
|
||||
IFCALL(update->WindowDelete, update, orderInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WND("Window State Order");
|
||||
update_read_window_state_order(s, orderInfo, &update->window_state);
|
||||
IFCALL(update->WindowState, update, orderInfo, &update->window_state);
|
||||
|
||||
if (orderInfo->fieldFlags & WINDOW_ORDER_STATE_NEW)
|
||||
IFCALL(update->WindowCreate, update, orderInfo, &update->window_state);
|
||||
else
|
||||
IFCALL(update->WindowUpdate, update, orderInfo, &update->window_state);
|
||||
}
|
||||
}
|
||||
|
||||
@ -253,15 +257,19 @@ void update_recv_notification_icon_info_order(rdpUpdate* update, STREAM* s, WIND
|
||||
|
||||
if (orderInfo->fieldFlags & WINDOW_ORDER_STATE_DELETED)
|
||||
{
|
||||
DEBUG_WND("Deleted Notification Icon Deleted Order");
|
||||
DEBUG_WND("Delete Notification Icon Deleted Order");
|
||||
update_read_notification_icon_deleted_order(s, orderInfo);
|
||||
IFCALL(update->NotifyIconDeleted, update, orderInfo);
|
||||
IFCALL(update->NotifyIconDelete, update, orderInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WND("Notification Icon State Order");
|
||||
update_read_notification_icon_state_order(s, orderInfo, &update->notify_icon_state);
|
||||
IFCALL(update->NotifyIconState, update, orderInfo, &update->notify_icon_state);
|
||||
|
||||
if (orderInfo->fieldFlags & WINDOW_ORDER_STATE_NEW)
|
||||
IFCALL(update->NotifyIconCreate, update, orderInfo, &update->notify_icon_state);
|
||||
else
|
||||
IFCALL(update->NotifyIconUpdate, update, orderInfo, &update->notify_icon_state);
|
||||
}
|
||||
}
|
||||
|
||||
|
29
libfreerdp-rail/CMakeLists.txt
Normal file
29
libfreerdp-rail/CMakeLists.txt
Normal file
@ -0,0 +1,29 @@
|
||||
# FreeRDP: A Remote Desktop Protocol Client
|
||||
# libfreerdp-rail cmake build script
|
||||
#
|
||||
# Copyright 2011 O.S. Systems Software Ltda.
|
||||
# Copyright 2011 Otavio Salvador <otavio@ossystems.com.br>
|
||||
# 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.
|
||||
|
||||
set(FREERDP_RAIL_SRCS
|
||||
window_list.c
|
||||
window.c
|
||||
rail.c)
|
||||
|
||||
add_library(freerdp-rail SHARED ${FREERDP_RAIL_SRCS})
|
||||
|
||||
set_target_properties(freerdp-rail PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION})
|
||||
|
||||
install(TARGETS freerdp-rail DESTINATION lib)
|
45
libfreerdp-rail/rail.c
Normal file
45
libfreerdp-rail/rail.c
Normal file
@ -0,0 +1,45 @@
|
||||
/**
|
||||
* FreeRDP: A Remote Desktop Protocol Client
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <freerdp/utils/stream.h>
|
||||
#include <freerdp/utils/memory.h>
|
||||
|
||||
#include <freerdp/rail/rail.h>
|
||||
|
||||
rdpRail* rail_new()
|
||||
{
|
||||
rdpRail* rail;
|
||||
|
||||
rail = (rdpRail*) xzalloc(sizeof(rdpRail));
|
||||
|
||||
if (rail != NULL)
|
||||
{
|
||||
rail->list = window_list_new();
|
||||
}
|
||||
|
||||
return rail;
|
||||
}
|
||||
|
||||
void rail_free(rdpRail* rail)
|
||||
{
|
||||
if (rail != NULL)
|
||||
{
|
||||
xfree(rail);
|
||||
}
|
||||
}
|
45
libfreerdp-rail/window.c
Normal file
45
libfreerdp-rail/window.c
Normal file
@ -0,0 +1,45 @@
|
||||
/**
|
||||
* FreeRDP: A Remote Desktop Protocol Client
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <freerdp/utils/stream.h>
|
||||
#include <freerdp/utils/memory.h>
|
||||
|
||||
#include <freerdp/rail/window.h>
|
||||
|
||||
rdpWindow* rail_CreateWindow()
|
||||
{
|
||||
rdpWindow* window;
|
||||
|
||||
window = (rdpWindow*) xzalloc(sizeof(rdpWindow));
|
||||
|
||||
if (window != NULL)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
void rail_DestroyWindow(rdpWindow* window)
|
||||
{
|
||||
if (window != NULL)
|
||||
{
|
||||
xfree(window);
|
||||
}
|
||||
}
|
131
libfreerdp-rail/window_list.c
Normal file
131
libfreerdp-rail/window_list.c
Normal file
@ -0,0 +1,131 @@
|
||||
/**
|
||||
* FreeRDP: A Remote Desktop Protocol Client
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <freerdp/utils/stream.h>
|
||||
#include <freerdp/utils/memory.h>
|
||||
|
||||
#include <freerdp/rail/window_list.h>
|
||||
|
||||
rdpWindow* window_list_get_by_id(rdpWindowList* list, uint32 windowId)
|
||||
{
|
||||
rdpWindow* window;
|
||||
|
||||
window = list->head;
|
||||
|
||||
if (window == NULL)
|
||||
return NULL;
|
||||
|
||||
while (window->next != 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;
|
||||
|
||||
window = rail_CreateWindow();
|
||||
|
||||
if (list->head == NULL)
|
||||
{
|
||||
list->head = list->tail = window;
|
||||
window->prev = NULL;
|
||||
window->next = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
window->prev = list->tail;
|
||||
window->next = NULL;
|
||||
list->tail = window;
|
||||
}
|
||||
|
||||
window->windowId = orderInfo->windowId;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
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(window);
|
||||
}
|
||||
|
||||
rdpWindowList* window_list_new()
|
||||
{
|
||||
rdpWindowList* list;
|
||||
|
||||
list = (rdpWindowList*) xzalloc(sizeof(rdpWindowList));
|
||||
|
||||
if (list != NULL)
|
||||
{
|
||||
list->head = NULL;
|
||||
list->tail = NULL;
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
void window_list_free(rdpWindowList* list)
|
||||
{
|
||||
if (list != NULL)
|
||||
{
|
||||
xfree(list);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user