diff --git a/client/Windows/CMakeLists.txt b/client/Windows/CMakeLists.txt index f9bd93a00..8de892fb4 100644 --- a/client/Windows/CMakeLists.txt +++ b/client/Windows/CMakeLists.txt @@ -29,16 +29,16 @@ set(${MODULE_PREFIX}_SRCS wf_gdi.h wf_event.c wf_event.h + wf_channels.c + wf_channels.h wf_graphics.c wf_graphics.h wf_cliprdr.c wf_cliprdr.h - wf_window.c - wf_window.h wf_rail.c wf_rail.h - wf_interface.c - wf_interface.h + wf_client.c + wf_client.h wf_floatbar.c wf_floatbar.h wfreerdp.rc diff --git a/client/Windows/cli/wfreerdp.c b/client/Windows/cli/wfreerdp.c index a661ce7fe..8a78cbf7c 100644 --- a/client/Windows/cli/wfreerdp.c +++ b/client/Windows/cli/wfreerdp.c @@ -39,7 +39,7 @@ #include "resource.h" -#include "wf_interface.h" +#include "wf_client.h" INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { diff --git a/client/Windows/wf_channels.c b/client/Windows/wf_channels.c new file mode 100644 index 000000000..664164c30 --- /dev/null +++ b/client/Windows/wf_channels.c @@ -0,0 +1,65 @@ +/** + * FreeRDP: A Remote Desktop Protocol Implementation + * + * Copyright 2014 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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "wf_channels.h" + +#include + +void wf_OnChannelConnectedEventHandler(rdpContext* context, ChannelConnectedEventArgs* e) +{ + wfContext* wfc = (wfContext*) context; + rdpSettings* settings = context->settings; + + if (strcmp(e->name, RDPEI_DVC_CHANNEL_NAME) == 0) + { + + } + else if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0) + { + if (settings->SoftwareGdi) + gdi_graphics_pipeline_init(context->gdi, (RdpgfxClientContext*) e->pInterface); + } + else if (strcmp(e->name, ENCOMSP_SVC_CHANNEL_NAME) == 0) + { + + } +} + +void wf_OnChannelDisconnectedEventHandler(rdpContext* context, ChannelDisconnectedEventArgs* e) +{ + wfContext* wfc = (wfContext*) context; + rdpSettings* settings = context->settings; + + if (strcmp(e->name, RDPEI_DVC_CHANNEL_NAME) == 0) + { + + } + else if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0) + { + if (settings->SoftwareGdi) + gdi_graphics_pipeline_uninit(context->gdi, (RdpgfxClientContext*) e->pInterface); + } + else if (strcmp(e->name, ENCOMSP_SVC_CHANNEL_NAME) == 0) + { + + } +} diff --git a/client/Windows/wf_window.h b/client/Windows/wf_channels.h similarity index 58% rename from client/Windows/wf_window.h rename to client/Windows/wf_channels.h index 5db681525..18d3ac402 100644 --- a/client/Windows/wf_window.h +++ b/client/Windows/wf_channels.h @@ -1,8 +1,7 @@ /** * FreeRDP: A Remote Desktop Protocol Implementation - * Windows RAIL * - * Copyright 2012 Jason Champion + * Copyright 2014 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. @@ -17,11 +16,18 @@ * limitations under the License. */ -#ifndef __WF_WINDOW_H -#define __WF_WINDOW_H +#ifndef __WF_CHANNELS_H +#define __WF_CHANNELS_H #include +#include +#include +#include +#include -#include "wf_interface.h" +#include "wf_client.h" + +void wf_OnChannelConnectedEventHandler(rdpContext* context, ChannelConnectedEventArgs* e); +void wf_OnChannelDisconnectedEventHandler(rdpContext* context, ChannelDisconnectedEventArgs* e); #endif diff --git a/client/Windows/wf_interface.c b/client/Windows/wf_client.c similarity index 98% rename from client/Windows/wf_interface.c rename to client/Windows/wf_client.c index 1d11ebda4..65527a636 100644 --- a/client/Windows/wf_interface.c +++ b/client/Windows/wf_client.c @@ -46,10 +46,11 @@ #include #include "wf_gdi.h" +#include "wf_channels.h" #include "wf_graphics.h" #include "wf_cliprdr.h" -#include "wf_interface.h" +#include "wf_client.h" #include "resource.h" @@ -293,6 +294,13 @@ BOOL wf_pre_connect(freerdp* instance) } freerdp_set_param_uint32(settings, FreeRDP_KeyboardLayout, (int) GetKeyboardLayout(0) & 0x0000FFFF); + + PubSub_SubscribeChannelConnected(instance->context->pubSub, + (pChannelConnectedEventHandler) wf_OnChannelConnectedEventHandler); + + PubSub_SubscribeChannelDisconnected(instance->context->pubSub, + (pChannelDisconnectedEventHandler) wf_OnChannelDisconnectedEventHandler); + freerdp_channels_pre_connect(instance->context->channels, instance); return TRUE; diff --git a/client/Windows/wf_interface.h b/client/Windows/wf_client.h similarity index 100% rename from client/Windows/wf_interface.h rename to client/Windows/wf_client.h diff --git a/client/Windows/wf_cliprdr.c b/client/Windows/wf_cliprdr.c index a98ab613d..d5e7aaeca 100644 --- a/client/Windows/wf_cliprdr.c +++ b/client/Windows/wf_cliprdr.c @@ -20,11 +20,13 @@ #ifdef HAVE_CONFIG_H #include "config.h" #endif + #include + #include +#include #include -#include #include #include diff --git a/client/Windows/wf_cliprdr.h b/client/Windows/wf_cliprdr.h index e967b02e3..3592fb9ae 100644 --- a/client/Windows/wf_cliprdr.h +++ b/client/Windows/wf_cliprdr.h @@ -24,7 +24,8 @@ #include #include -#include "wf_interface.h" + +#include "wf_client.h" #ifdef WITH_DEBUG_CLIPRDR #define DEBUG_CLIPRDR(fmt, ...) DEBUG_CLASS(WIN_CLIPRDR, fmt, ## __VA_ARGS__) diff --git a/client/Windows/wf_cliprdr_EnumFORMATETC.c b/client/Windows/wf_cliprdr_EnumFORMATETC.c index d988cf560..595132915 100644 --- a/client/Windows/wf_cliprdr_EnumFORMATETC.c +++ b/client/Windows/wf_cliprdr_EnumFORMATETC.c @@ -18,6 +18,7 @@ */ #include + #include "wf_cliprdr_EnumFORMATETC.h" static void cliprdr_format_deep_copy(FORMATETC *dest, FORMATETC *source) diff --git a/client/Windows/wf_event.c b/client/Windows/wf_event.c index 941ff5234..0a0c8569e 100644 --- a/client/Windows/wf_event.c +++ b/client/Windows/wf_event.c @@ -27,11 +27,12 @@ #include -#include "wf_interface.h" +#include "wf_client.h" #include "wf_gdi.h" #include "wf_event.h" -#include "freerdp/event.h" + +#include static HWND g_focus_hWnd; diff --git a/client/Windows/wf_event.h b/client/Windows/wf_event.h index e4f1a1d2c..588046d57 100644 --- a/client/Windows/wf_event.h +++ b/client/Windows/wf_event.h @@ -22,7 +22,7 @@ #ifndef __WF_EVENT_H #define __WF_EVENT_H -#include "wf_interface.h" +#include "wf_client.h" LRESULT CALLBACK wf_ll_kbd_proc(int nCode, WPARAM wParam, LPARAM lParam); LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); diff --git a/client/Windows/wf_floatbar.c b/client/Windows/wf_floatbar.c index a6e960166..e87815db8 100644 --- a/client/Windows/wf_floatbar.c +++ b/client/Windows/wf_floatbar.c @@ -17,15 +17,15 @@ * limitations under the License. */ -#include -#include +#include +#include -#include "wf_interface.h" -#include "wf_floatbar.h" -#include "wf_window.h" -#include "wf_gdi.h" #include "resource.h" +#include "wf_client.h" +#include "wf_floatbar.h" +#include "wf_gdi.h" + typedef struct _Button Button; /* TIMERs */ diff --git a/client/Windows/wf_gdi.c b/client/Windows/wf_gdi.c index e41b59a71..ab9329efe 100644 --- a/client/Windows/wf_gdi.c +++ b/client/Windows/wf_gdi.c @@ -35,7 +35,7 @@ #include #include -#include "wf_interface.h" +#include "wf_client.h" #include "wf_graphics.h" #include "wf_gdi.h" diff --git a/client/Windows/wf_gdi.h b/client/Windows/wf_gdi.h index bc966f052..218e1a38b 100644 --- a/client/Windows/wf_gdi.h +++ b/client/Windows/wf_gdi.h @@ -22,7 +22,7 @@ #ifndef __WF_GDI_H #define __WF_GDI_H -#include "wf_interface.h" +#include "wf_client.h" void wf_invalidate_region(wfContext* wfc, int x, int y, int width, int height); wfBitmap* wf_image_new(wfContext* wfc, int width, int height, int bpp, BYTE* data); diff --git a/client/Windows/wf_graphics.h b/client/Windows/wf_graphics.h index cfc2a9639..4b0dd69d0 100644 --- a/client/Windows/wf_graphics.h +++ b/client/Windows/wf_graphics.h @@ -20,7 +20,7 @@ #ifndef __WF_GRAPHICS_H #define __WF_GRAPHICS_H -#include "wf_interface.h" +#include "wf_client.h" HBITMAP wf_create_dib(wfContext* wfc, int width, int height, int bpp, BYTE* data, BYTE** pdata); wfBitmap* wf_image_new(wfContext* wfc, int width, int height, int bpp, BYTE* data); diff --git a/client/Windows/wf_rail.c b/client/Windows/wf_rail.c index a776828fc..f50ef63ae 100644 --- a/client/Windows/wf_rail.c +++ b/client/Windows/wf_rail.c @@ -21,12 +21,12 @@ #include "config.h" #endif -#include #include + +#include #include #include -#include "wf_window.h" #include "wf_rail.h" void wf_rail_paint(wfContext* wfc, rdpRail* rail, INT32 uleft, INT32 utop, UINT32 uright, UINT32 ubottom) diff --git a/client/Windows/wf_rail.h b/client/Windows/wf_rail.h index e4cbcec4a..16e505496 100644 --- a/client/Windows/wf_rail.h +++ b/client/Windows/wf_rail.h @@ -19,7 +19,7 @@ #ifndef __WF_RAIL_H #define __WF_RAIL_H -#include "wf_interface.h" +#include "wf_client.h" void wf_rail_paint(wfContext* wfc, rdpRail* rail, INT32 uleft, INT32 utop, UINT32 uright, UINT32 ubottom); void wf_rail_register_callbacks(wfContext* wfc, rdpRail* rail); diff --git a/client/Windows/wf_window.c b/client/Windows/wf_window.c deleted file mode 100644 index d15472ea4..000000000 --- a/client/Windows/wf_window.c +++ /dev/null @@ -1,24 +0,0 @@ -/** - * FreeRDP: A Remote Desktop Protocol Implementation - * Windows RAIL - * - * Copyright 2012 Jason Champion - * - * 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 "wf_window.h"