From 77f5994e1c6d364ba3938ceafbc291edd455a678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Wed, 26 Jun 2013 18:12:01 -0400 Subject: [PATCH 1/4] winpr: add _WINRT platform detection macro --- winpr/include/winpr/platform.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/winpr/include/winpr/platform.h b/winpr/include/winpr/platform.h index 63d1328b1..f178b0c95 100644 --- a/winpr/include/winpr/platform.h +++ b/winpr/include/winpr/platform.h @@ -128,6 +128,22 @@ /* Windows (_WIN32) */ +/* WinRT (_WINRT) */ + +#if defined(WINAPI_FAMILY) +#if (WINAPI_FAMILY == WINAPI_FAMILY_APP) +#ifndef _WINRT +#define _WINRT 1 +#endif +#endif +#endif + +#if defined(__cplusplus_winrt) +#ifndef _WINRT +#define _WINRT 1 +#endif +#endif + /* Linux (__linux__) */ #if defined(linux) || defined(__linux) From aa4ce5ee4b4a7310b5bac9c216cd25538770a8a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Wed, 26 Jun 2013 18:49:01 -0400 Subject: [PATCH 2/4] freerdp: add more settings for window panning and scaling --- include/freerdp/settings.h | 18 ++++++- libfreerdp/common/settings.c | 98 ++++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+), 2 deletions(-) diff --git a/include/freerdp/settings.h b/include/freerdp/settings.h index eb3541cf2..b6f34e6f7 100644 --- a/include/freerdp/settings.h +++ b/include/freerdp/settings.h @@ -609,6 +609,9 @@ typedef struct _RDPDR_PARALLEL RDPDR_PARALLEL; #define FreeRDP_WmClass 1549 #define FreeRDP_EmbeddedWindow 1550 #define FreeRDP_SmartSizing 1551 +#define FreeRDP_XPan 1552 +#define FreeRDP_YPan 1553 +#define FreeRDP_ScalingFactor 1554 #define FreeRDP_SoftwareGdi 1601 #define FreeRDP_LocalConnection 1602 #define FreeRDP_AuthenticationOnly 1603 @@ -677,6 +680,7 @@ typedef struct _RDPDR_PARALLEL RDPDR_PARALLEL; #define FreeRDP_UnicodeInput 2629 #define FreeRDP_FastPathInput 2630 #define FreeRDP_MultiTouchInput 2631 +#define FreeRDP_MultiTouchGestures 2632 #define FreeRDP_BrushSupportLevel 2688 #define FreeRDP_GlyphSupportLevel 2752 #define FreeRDP_GlyphCache 2753 @@ -976,7 +980,10 @@ struct rdp_settings ALIGN64 char* WmClass; /* 1549 */ ALIGN64 BOOL EmbeddedWindow; /* 1550 */ ALIGN64 BOOL SmartSizing; /* 1551 */ - UINT64 padding1600[1600 - 1552]; /* 1552 */ + ALIGN64 int XPan; /* 1552 */ + ALIGN64 int YPan; /* 1553 */ + ALIGN64 double ScalingFactor; /* 1554 */ + UINT64 padding1600[1600 - 1555]; /* 1555 */ /* Miscellaneous */ ALIGN64 BOOL SoftwareGdi; /* 1601 */ @@ -1101,7 +1108,8 @@ struct rdp_settings ALIGN64 BOOL UnicodeInput; /* 2629 */ ALIGN64 BOOL FastPathInput; /* 2630 */ ALIGN64 BOOL MultiTouchInput; /* 2631 */ - UINT64 padding2688[2688 - 2632]; /* 2632 */ + ALIGN64 BOOL MultiTouchGestures; /* 2632 */ + UINT64 padding2688[2688 - 2633]; /* 2633 */ /* Brush Capabilities */ ALIGN64 UINT32 BrushSupportLevel; /* 2688 */ @@ -1310,6 +1318,9 @@ FREERDP_API void freerdp_dynamic_channel_collection_free(rdpSettings* settings); FREERDP_API BOOL freerdp_get_param_bool(rdpSettings* settings, int id); FREERDP_API int freerdp_set_param_bool(rdpSettings* settings, int id, BOOL param); +FREERDP_API int freerdp_get_param_int(rdpSettings* settings, int id); +FREERDP_API int freerdp_set_param_int(rdpSettings* settings, int id, int param); + FREERDP_API UINT32 freerdp_get_param_uint32(rdpSettings* settings, int id); FREERDP_API int freerdp_set_param_uint32(rdpSettings* settings, int id, UINT32 param); @@ -1319,6 +1330,9 @@ FREERDP_API int freerdp_set_param_uint64(rdpSettings* settings, int id, UINT64 p FREERDP_API char* freerdp_get_param_string(rdpSettings* settings, int id); FREERDP_API int freerdp_set_param_string(rdpSettings* settings, int id, char* param); +FREERDP_API double freerdp_get_param_double(rdpSettings* settings, int id); +FREERDP_API int freerdp_set_param_double(rdpSettings* settings, int id, double param); + #ifdef __cplusplus } #endif diff --git a/libfreerdp/common/settings.c b/libfreerdp/common/settings.c index c85f2a120..e99066b15 100644 --- a/libfreerdp/common/settings.c +++ b/libfreerdp/common/settings.c @@ -658,6 +658,10 @@ BOOL freerdp_get_param_bool(rdpSettings* settings, int id) return settings->MultiTouchInput; break; + case FreeRDP_MultiTouchGestures: + return settings->MultiTouchGestures; + break; + case FreeRDP_SoundBeepsEnabled: return settings->SoundBeepsEnabled; break; @@ -1109,6 +1113,10 @@ int freerdp_set_param_bool(rdpSettings* settings, int id, BOOL param) settings->MultiTouchInput = param; break; + case FreeRDP_MultiTouchGestures: + settings->MultiTouchGestures = param; + break; + case FreeRDP_SoundBeepsEnabled: settings->SoundBeepsEnabled = param; break; @@ -1204,6 +1212,55 @@ int freerdp_set_param_bool(rdpSettings* settings, int id, BOOL param) return -1; } +int freerdp_get_param_int(rdpSettings* settings, int id) +{ + switch (id) + { + case FreeRDP_XPan: + return settings->XPan; + break; + + case FreeRDP_YPan: + return settings->YPan; + break; + + default: + return 0; + break; + } + + return 0; +} + +int freerdp_set_param_int(rdpSettings* settings, int id, int param) +{ + ParamChangeEventArgs e; + rdpContext* context = ((freerdp*) settings->instance)->context; + + switch (id) + { + case FreeRDP_XPan: + settings->XPan = param; + break; + + case FreeRDP_YPan: + settings->YPan = param; + break; + + default: + return -1; + break; + } + + settings->settings_modified[id] = 1; + + EventArgsInit(&e, "freerdp"); + e.id = id; + PubSub_OnParamChange(context->pubSub, context->instance, &e); + + return 0; +} + UINT32 freerdp_get_param_uint32(rdpSettings* settings, int id) { switch (id) @@ -2225,3 +2282,44 @@ int freerdp_set_param_string(rdpSettings* settings, int id, char* param) return 0; } + +double freerdp_get_param_double(rdpSettings* settings, int id) +{ + switch (id) + { + case FreeRDP_ScalingFactor: + return settings->ScalingFactor; + break; + + default: + return 0; + break; + } + + return 0; +} + +int freerdp_set_param_double(rdpSettings* settings, int id, double param) +{ + ParamChangeEventArgs e; + rdpContext* context = ((freerdp*) settings->instance)->context; + + switch (id) + { + case FreeRDP_ScalingFactor: + settings->ScalingFactor = param; + break; + + default: + return -1; + break; + } + + settings->settings_modified[id] = 1; + + EventArgsInit(&e, "freerdp"); + e.id = id; + PubSub_OnParamChange(context->pubSub, context->instance, &e); + + return 0; +} From c8a09f3f768b04163add55c823deb9ed6c99b31e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Wed, 26 Jun 2013 18:57:16 -0400 Subject: [PATCH 3/4] xfreerdp: add ParamChange event handler --- client/X11/xf_client.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/client/X11/xf_client.c b/client/X11/xf_client.c index 7e958feeb..1bc990262 100644 --- a/client/X11/xf_client.c +++ b/client/X11/xf_client.c @@ -1520,6 +1520,18 @@ void xf_TerminateEventHandler(rdpContext* context, TerminateEventArgs* e) } } +void xf_ParamChangeEventHandler(rdpContext* context, ParamChangeEventArgs* e) +{ + switch (e->id) + { + case FreeRDP_ScalingFactor: + break; + + default: + break; + } +} + /** * Client Interface */ @@ -1643,6 +1655,7 @@ int xfreerdp_client_new(freerdp* instance, rdpContext* context) settings->OrderSupport[NEG_ELLIPSE_CB_INDEX] = FALSE; PubSub_SubscribeTerminate(context->pubSub, (pTerminateEventHandler) xf_TerminateEventHandler); + PubSub_SubscribeParamChange(context->pubSub, (pParamChangeEventHandler) xf_ParamChangeEventHandler); return 0; } From aca13e5eac36cd86c53799ac1ca00c884dcd090e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Wed, 26 Jun 2013 19:05:44 -0400 Subject: [PATCH 4/4] freerdp: add new events for scaling and panning changes --- include/freerdp/event.h | 9 +++++++++ libfreerdp/core/freerdp.c | 2 ++ 2 files changed, 11 insertions(+) diff --git a/include/freerdp/event.h b/include/freerdp/event.h index 7753e133d..a41fe0a60 100644 --- a/include/freerdp/event.h +++ b/include/freerdp/event.h @@ -47,6 +47,15 @@ DEFINE_EVENT_BEGIN(EmbedWindow) void* handle; DEFINE_EVENT_END(EmbedWindow) +DEFINE_EVENT_BEGIN(PanningChange) + int XPan; + int YPan; +DEFINE_EVENT_END(PanningChange) + +DEFINE_EVENT_BEGIN(ScalingFactorChange) + double ScalingFactor; +DEFINE_EVENT_END(ScalingFactorChange) + DEFINE_EVENT_BEGIN(ErrorInfo) UINT32 code; DEFINE_EVENT_END(ErrorInfo) diff --git a/libfreerdp/core/freerdp.c b/libfreerdp/core/freerdp.c index 3c77b8e05..7d0c3c0ba 100644 --- a/libfreerdp/core/freerdp.c +++ b/libfreerdp/core/freerdp.c @@ -323,6 +323,8 @@ static wEventType FreeRDP_Events[] = DEFINE_EVENT_ENTRY(WindowStateChange) DEFINE_EVENT_ENTRY(ResizeWindow) DEFINE_EVENT_ENTRY(EmbedWindow) + DEFINE_EVENT_ENTRY(PanningChange) + DEFINE_EVENT_ENTRY(ScalingFactorChange) DEFINE_EVENT_ENTRY(ErrorInfo) DEFINE_EVENT_ENTRY(ParamChange) DEFINE_EVENT_ENTRY(Terminate)