GUI-FreeRDP/gui.patch

194 lines
5.4 KiB
Diff
Raw Permalink Normal View History

2023-02-02 16:33:19 +00:00
diff --git a/client/X11/CMakeLists.txt b/client/X11/CMakeLists.txt
index 869652c..ab6fe67 100644
2023-02-02 16:33:19 +00:00
--- a/client/X11/CMakeLists.txt
+++ b/client/X11/CMakeLists.txt
@@ -57,6 +57,39 @@ set(${MODULE_PREFIX}_SRCS
2023-02-02 16:33:19 +00:00
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/about.c
+ cli/keylang.c
2023-02-02 16:33:19 +00:00
+ 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 +107,7 @@ if(WITH_CLIENT_INTERFACE)
2023-02-02 16:33:19 +00:00
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 +259,33 @@ if(WITH_XFIXES)
2023-02-02 16:33:19 +00:00
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)
2023-02-02 16:33:19 +00:00
+endif()
+
+if(IUP_DESCRIPTION_ABOUT_ARCH_X32)
+ add_definitions(-DIUP_DESCRIPTION_ABOUT_ARCH_X32)
+endif()
+
+if(IUP_DESCRIPTION_ABOUT_MIRATORG)
+ add_definitions(-DIUP_DESCRIPTION_ABOUT_MIRATORG)
+endif()
+
+if(IUP_WITH_LANGUAGE_KEYBOARD_ICON)
+ add_definitions(-DIUP_WITH_LANGUAGE_KEYBOARD_ICON)
+endif()
2023-02-02 16:33:19 +00:00
+
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/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;
}