wfreerdp: add RDP8 graphics pipeline support
authorMarc-André Moreau <marcandre.moreau@gmail.com>
Fri, 12 Sep 2014 20:30:57 +0000 (16:30 -0400)
committerMarc-André Moreau <marcandre.moreau@gmail.com>
Fri, 12 Sep 2014 20:30:57 +0000 (16:30 -0400)
18 files changed:
client/Windows/CMakeLists.txt
client/Windows/cli/wfreerdp.c
client/Windows/wf_channels.c [new file with mode: 0644]
client/Windows/wf_channels.h [moved from client/Windows/wf_window.h with 58% similarity]
client/Windows/wf_client.c [moved from client/Windows/wf_interface.c with 98% similarity]
client/Windows/wf_client.h [moved from client/Windows/wf_interface.h with 100% similarity]
client/Windows/wf_cliprdr.c
client/Windows/wf_cliprdr.h
client/Windows/wf_cliprdr_EnumFORMATETC.c
client/Windows/wf_event.c
client/Windows/wf_event.h
client/Windows/wf_floatbar.c
client/Windows/wf_gdi.c
client/Windows/wf_gdi.h
client/Windows/wf_graphics.h
client/Windows/wf_rail.c
client/Windows/wf_rail.h
client/Windows/wf_window.c [deleted file]

index f9bd93a..8de892f 100644 (file)
@@ -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
index a661ce7..8a78cbf 100644 (file)
@@ -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 (file)
index 0000000..664164c
--- /dev/null
@@ -0,0 +1,65 @@
+/**
+ * FreeRDP: A Remote Desktop Protocol Implementation
+ *
+ * Copyright 2014 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 "wf_channels.h"
+
+#include <freerdp/gdi/gfx.h>
+
+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)
+       {
+               
+       }
+}
similarity index 58%
rename from client/Windows/wf_window.h
rename to client/Windows/wf_channels.h
index 5db6815..18d3ac4 100644 (file)
@@ -1,8 +1,7 @@
 /**
  * FreeRDP: A Remote Desktop Protocol Implementation
- * Windows RAIL
  *
- * Copyright 2012 Jason Champion <jchampion@zetacentauri.com>
+ * Copyright 2014 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.
  * limitations under the License.
  */
 
-#ifndef __WF_WINDOW_H
-#define __WF_WINDOW_H
+#ifndef __WF_CHANNELS_H
+#define __WF_CHANNELS_H
 
 #include <freerdp/freerdp.h>
+#include <freerdp/client/channels.h>
+#include <freerdp/client/rdpei.h>
+#include <freerdp/client/rdpgfx.h>
+#include <freerdp/client/encomsp.h>
 
-#include "wf_interface.h"
+#include "wf_client.h"
+
+void wf_OnChannelConnectedEventHandler(rdpContext* context, ChannelConnectedEventArgs* e);
+void wf_OnChannelDisconnectedEventHandler(rdpContext* context, ChannelDisconnectedEventArgs* e);
 
 #endif
similarity index 98%
rename from client/Windows/wf_interface.c
rename to client/Windows/wf_client.c
index 1d11ebd..65527a6 100644 (file)
 #include <freerdp/event.h>
 
 #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;
index a98ab61..d5e7aae 100644 (file)
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
+
 #include <assert.h>
+
 #include <winpr/crt.h>
+#include <winpr/stream.h>
 
 #include <freerdp/utils/event.h>
-#include <winpr/stream.h>
 #include <freerdp/client/cliprdr.h>
 
 #include <Strsafe.h>
index e967b02..3592fb9 100644 (file)
@@ -24,7 +24,8 @@
 
 #include <Ole2.h>
 #include <ShlObj.h>
-#include "wf_interface.h"
+
+#include "wf_client.h"
 
 #ifdef WITH_DEBUG_CLIPRDR
 #define DEBUG_CLIPRDR(fmt, ...) DEBUG_CLASS(WIN_CLIPRDR, fmt, ## __VA_ARGS__)
index d988cf5..5951329 100644 (file)
@@ -18,6 +18,7 @@
  */
 
 #include <stdio.h>
+
 #include "wf_cliprdr_EnumFORMATETC.h"
 
 static void cliprdr_format_deep_copy(FORMATETC *dest, FORMATETC *source)
index 941ff52..0a0c856 100644 (file)
 
 #include <freerdp/freerdp.h>
 
-#include "wf_interface.h"
+#include "wf_client.h"
 
 #include "wf_gdi.h"
 #include "wf_event.h"
-#include "freerdp/event.h"
+
+#include <freerdp/event.h>
 
 static HWND g_focus_hWnd;
 
index e4f1a1d..588046d 100644 (file)
@@ -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);
index a6e9601..e87815d 100644 (file)
  * limitations under the License.
  */
 
-#include <Windows.h>
-#include <stdlib.h>
+#include <winpr/crt.h>
+#include <winpr/windows.h>
 
-#include "wf_interface.h"
+#include "resource.h"
+
+#include "wf_client.h"
 #include "wf_floatbar.h"
-#include "wf_window.h"
 #include "wf_gdi.h"
-#include "resource.h"
 
 typedef struct _Button Button;
 
index e41b59a..ab9329e 100644 (file)
@@ -35,7 +35,7 @@
 #include <freerdp/codec/rfx.h>
 #include <freerdp/codec/nsc.h>
 
-#include "wf_interface.h"
+#include "wf_client.h"
 #include "wf_graphics.h"
 #include "wf_gdi.h"
 
index bc966f0..218e1a3 100644 (file)
@@ -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);
index cfc2a96..4b0dd69 100644 (file)
@@ -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);
index a776828..f50ef63 100644 (file)
 #include "config.h"
 #endif
 
-#include <freerdp/utils/event.h>
 #include <winpr/print.h>
+
+#include <freerdp/utils/event.h>
 #include <freerdp/utils/rail.h>
 #include <freerdp/rail/rail.h>
 
-#include "wf_window.h"
 #include "wf_rail.h"
 
 void wf_rail_paint(wfContext* wfc, rdpRail* rail, INT32 uleft, INT32 utop, UINT32 uright, UINT32 ubottom)
index e4cbcec..16e5054 100644 (file)
@@ -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 (file)
index d15472e..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * FreeRDP: A Remote Desktop Protocol Implementation
- * Windows RAIL
- *
- * Copyright 2012 Jason Champion <jchampion@zetacentauri.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 "wf_window.h"