205 lines
5.7 KiB
Diff
205 lines
5.7 KiB
Diff
diff --git a/client/X11/CMakeLists.txt b/client/X11/CMakeLists.txt
|
|
index 869652c..e30acc5 100644
|
|
--- a/client/X11/CMakeLists.txt
|
|
+++ b/client/X11/CMakeLists.txt
|
|
@@ -57,6 +57,37 @@ set(${MODULE_PREFIX}_SRCS
|
|
xf_client.c
|
|
xf_client.h)
|
|
|
|
+set(${GUI_IUP}_SRCS
|
|
+ cli/xfreerdp.c
|
|
+ cli/images.c
|
|
+ xfreerdp.h
|
|
+ cli/xrdp.h
|
|
+ cli/arguments.c
|
|
+ cli/concat.c
|
|
+ cli/gui.c
|
|
+ cli/node_settings.c
|
|
+ cli/rxrandr_broker.c
|
|
+ cli/rxrandr.c
|
|
+ cli/settings.c
|
|
+ cli/db.c
|
|
+ cli/address.c
|
|
+ cli/monitor.c
|
|
+ cli/xrdp.c)
|
|
+
|
|
+set(IUP_FEATURE_TYPE "REQUIRED")
|
|
+set(IUP_FEATURE_PURPOSE "IUP extension")
|
|
+set(IUP_FEATURE_DESCRIPTION "Multi-platform toolkit")
|
|
+
|
|
+include_directories(${IUP_INCLUDE_DIRS})
|
|
+find_feature(IUP ${IUP_FEATURE_TYPE} ${IUP_FEATURE_PURPOSE} ${IUP_FEATURE_DESCRIPTION})
|
|
+
|
|
+set(SQLITE_FEATURE_TYPE "REQUIRED")
|
|
+set(SQLITE_FEATURE_PURPOSE "SQLite extension")
|
|
+set(SQLITE_FEATURE_DESCRIPTION "C-language library SQL database engine")
|
|
+
|
|
+include_directories(${SQLITE_INCLUDE_DIRS})
|
|
+find_feature(SQLite ${SQLITE_FEATURE_TYPE} ${SQLITE_FEATURE_PURPOSE} ${SQLITE_FEATURE_DESCRIPTION})
|
|
+
|
|
if (CHANNEL_TSMF_CLIENT)
|
|
set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS}
|
|
xf_tsmf.c
|
|
@@ -74,7 +105,7 @@ if(WITH_CLIENT_INTERFACE)
|
|
endif()
|
|
|
|
else()
|
|
- set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} cli/xfreerdp.c xfreerdp.h)
|
|
+ set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} ${${GUI_IUP}_SRCS})
|
|
add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
|
|
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME "xfreerdp")
|
|
include_directories(..)
|
|
@@ -226,13 +257,21 @@ if(WITH_XFIXES)
|
|
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ${XFIXES_LIBRARIES})
|
|
endif()
|
|
|
|
+if(IUP_WITH_COLOR_BUTTONS)
|
|
+ add_definitions(-DIUP_WITH_COLOR_BUTTONS)
|
|
+endif()
|
|
+
|
|
+if(IUP_WITH_SOUND_CHECKBOX)
|
|
+ add_definitions(-DIUP_WITH_SOUND_CHECKBOX)
|
|
+endif()
|
|
+
|
|
include_directories(${CMAKE_SOURCE_DIR}/resources)
|
|
|
|
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} freerdp-client freerdp m)
|
|
if (NOT APPLE)
|
|
list(APPEND ${MODULE_PREFIX}_LIBS rt)
|
|
endif()
|
|
-target_link_libraries(${MODULE_NAME} ${PRIVATE_KEYWORD} ${${MODULE_PREFIX}_LIBS})
|
|
+target_link_libraries(${MODULE_NAME} ${PRIVATE_KEYWORD} ${${MODULE_PREFIX}_LIBS} ${IUP_LIBRARIES} ${SQLITE_LIBRARIES})
|
|
|
|
if(WITH_IPP)
|
|
target_link_libraries(${MODULE_NAME} ${PRIVATE_KEYWORD} ${IPP_LIBRARY_LIST})
|
|
diff --git a/client/X11/cli/CMakeLists.txt b/client/X11/cli/CMakeLists.txt
|
|
index 5f805c2..1e7d1c4 100644
|
|
--- a/client/X11/cli/CMakeLists.txt
|
|
+++ b/client/X11/cli/CMakeLists.txt
|
|
@@ -19,7 +19,19 @@ set(MODULE_NAME "xfreerdp-cli")
|
|
set(MODULE_PREFIX "FREERDP_CLIENT_X11")
|
|
|
|
set(${MODULE_PREFIX}_SRCS
|
|
- xfreerdp.c)
|
|
+ xfreerdp.c
|
|
+ images.c
|
|
+ arguments.c
|
|
+ concat.c
|
|
+ gui.c
|
|
+ node_settings.c
|
|
+ rxrandr_broker.c
|
|
+ rxrandr.c
|
|
+ settings.c
|
|
+ db.c
|
|
+ address.c
|
|
+ monitor.c
|
|
+ xrdp.c)
|
|
|
|
add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
|
|
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME "xfreerdp" RUNTIME_OUTPUT_DIRECTORY "..")
|
|
diff --git a/client/X11/cli/xfreerdp.c b/client/X11/cli/xfreerdp.c
|
|
index 8db4d39..abdf3ca 100644
|
|
--- a/client/X11/cli/xfreerdp.c
|
|
+++ b/client/X11/cli/xfreerdp.c
|
|
@@ -1,85 +1,24 @@
|
|
-/**
|
|
- * FreeRDP: A Remote Desktop Protocol Implementation
|
|
- * X11 Client
|
|
- *
|
|
- * Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
|
- * Copyright 2012 HP Development Company, LLC
|
|
- *
|
|
- * 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 <stdlib.h>
|
|
+#include "gui.h"
|
|
+#include "arguments.h"
|
|
|
|
-#ifdef HAVE_CONFIG_H
|
|
-#include "config.h"
|
|
-#endif
|
|
+#include <stdio.h>
|
|
|
|
-#include <winpr/crt.h>
|
|
-#include <winpr/synch.h>
|
|
-#include <winpr/thread.h>
|
|
-
|
|
-#include <freerdp/freerdp.h>
|
|
-#include <freerdp/client/cmdline.h>
|
|
-
|
|
-#include "../xf_client.h"
|
|
-#include "../xfreerdp.h"
|
|
-
|
|
-int main(int argc, char* argv[])
|
|
+int main(int argc, char **argv)
|
|
{
|
|
- int rc = 1;
|
|
- int status;
|
|
- HANDLE thread;
|
|
- xfContext* xfc;
|
|
- DWORD dwExitCode;
|
|
- rdpContext* context;
|
|
- rdpSettings* settings;
|
|
- RDP_CLIENT_ENTRY_POINTS clientEntryPoints;
|
|
-
|
|
- ZeroMemory(&clientEntryPoints, sizeof(RDP_CLIENT_ENTRY_POINTS));
|
|
- clientEntryPoints.Size = sizeof(RDP_CLIENT_ENTRY_POINTS);
|
|
- clientEntryPoints.Version = RDP_CLIENT_INTERFACE_VERSION;
|
|
-
|
|
- RdpClientEntry(&clientEntryPoints);
|
|
-
|
|
- context = freerdp_client_context_new(&clientEntryPoints);
|
|
- if (!context)
|
|
- return 1;
|
|
-
|
|
- settings = context->settings;
|
|
- xfc = (xfContext*)context;
|
|
-
|
|
- status = freerdp_client_settings_parse_command_line(context->settings, argc, argv, FALSE);
|
|
- if (status)
|
|
- {
|
|
- rc = freerdp_client_settings_command_line_status_print(settings, status, argc, argv);
|
|
-
|
|
- if (settings->ListMonitors)
|
|
- xf_list_monitors(xfc);
|
|
-
|
|
- goto out;
|
|
- }
|
|
-
|
|
- if (freerdp_client_start(context) != 0)
|
|
- goto out;
|
|
+ if (argc > 1)
|
|
+ settingsLoad(argv[1]);
|
|
+ else
|
|
+ settingsLoad("/etc/freerdp/freerdp.db");
|
|
|
|
- thread = freerdp_client_get_thread(context);
|
|
+ IupOpen(&argc, &argv);
|
|
|
|
- WaitForSingleObject(thread, INFINITE);
|
|
- GetExitCodeThread(thread, &dwExitCode);
|
|
- rc = xf_exit_code_from_disconnect_reason(dwExitCode);
|
|
+ IupShowXY(guiStart(), IUP_CENTER, IUP_CENTER);
|
|
+ IupMainLoop();
|
|
|
|
- freerdp_client_stop(context);
|
|
+ IupClose();
|
|
|
|
-out:
|
|
- freerdp_client_context_free(context);
|
|
+ settingsFree();
|
|
|
|
- return rc;
|
|
+ return EXIT_SUCCESS;
|
|
}
|