From c8938c357a1b743ad8ba967a644db67510d57f37 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Thu, 29 Nov 2018 15:46:37 +0100 Subject: [PATCH] Updated mac build. --- client/Mac/CMakeLists.txt | 16 +++++++++------- client/Mac/Keyboard.h | 2 +- client/Mac/Keyboard.m | 5 +++-- client/Mac/MRDPView.h | 2 ++ client/Mac/MRDPView.m | 8 +++++--- client/Mac/PasswordDialog.m | 2 ++ client/Mac/cli/CMakeLists.txt | 9 +++++---- client/Mac/mf_client.m | 10 +++++----- client/Mac/mfreerdp.h | 2 +- 9 files changed, 33 insertions(+), 23 deletions(-) diff --git a/client/Mac/CMakeLists.txt b/client/Mac/CMakeLists.txt index 6865781ac..29f98b3c1 100644 --- a/client/Mac/CMakeLists.txt +++ b/client/Mac/CMakeLists.txt @@ -15,18 +15,20 @@ find_library(FOUNDATION_LIBRARY Foundation) find_library(COCOA_LIBRARY Cocoa) find_library(APPKIT_LIBRARY AppKit) find_library(IOKIT_LIBRARY IOKit) +find_library(COREGRAPHICS_LIBRARY CoreGraphics) mark_as_advanced(COCOA_LIBRARY FOUNDATION_LIBRARY APPKIT_LIBRARY) set(EXTRA_LIBS ${COCOA_LIBRARY} ${FOUNDATION_LIBRARY} ${APPKIT_LIBRARY} ${IOKIT_LIBRARY}) +string(TIMESTAMP VERSION_YEAR "%Y") set(MACOSX_BUNDLE_INFO_STRING "${MODULE_OUTPUT_NAME}") set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.freerdp.mac") set(MACOSX_BUNDLE_BUNDLE_IDENTIFIER "FreeRDP-library.Mac") -set(MACOSX_BUNDLE_LONG_VERSION_STRING "MacFreeRDP library Version 1.1") +set(MACOSX_BUNDLE_LONG_VERSION_STRING "MacFreeRDP library Version ${FREERDP_VERSION}") set(MACOSX_BUNDLE_BUNDLE_NAME "${MODULE_OUTPUT_NAME}") -set(MACOSX_BUNDLE_SHORT_VERSION_STRING 1.1.0) -set(MACOSX_BUNDLE_BUNDLE_VERSION 1.1.0) -set(MACOSX_BUNDLE_COPYRIGHT "Copyright 2013. All Rights Reserved.") +set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${FREERDP_VERSION}) +set(MACOSX_BUNDLE_BUNDLE_VERSION ${FREERDP_VERSION}) +set(MACOSX_BUNDLE_COPYRIGHT "Copyright 2013-${VERSION_YEAR}. All Rights Reserved.") set(${MODULE_PREFIX}_XIBS PasswordDialog.xib) @@ -79,9 +81,9 @@ set_target_properties(${MODULE_NAME} PROPERTIES set_target_properties(${MODULE_NAME} PROPERTIES FRAMEWORK TRUE MACOSX_FRAMEWORK_IDENTIFIER com.awakecoding.${MODULE_NAME} - FRAMEWORK_VERSION 1.1.0 - MACOSX_FRAMEWORK_SHORT_VERSION_STRING 1.1.0 - MACOSX_FRAMEWORK_BUNDLE_BUNDLE_VERSION 1.1.0 + FRAMEWORK_VERSION ${FREERDP_VERSION} + MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${FREERDP_VERSION} + MACOSX_FRAMEWORK_BUNDLE_BUNDLE_VERSION ${FREERDP_VERSION} INSTALL_NAME_DIR "@executable_path/../Frameworks" MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_BINARY_DIR}/Info.plist) diff --git a/client/Mac/Keyboard.h b/client/Mac/Keyboard.h index cc6f85964..27efcdf34 100644 --- a/client/Mac/Keyboard.h +++ b/client/Mac/Keyboard.h @@ -24,4 +24,4 @@ enum APPLE_KEYBOARD_TYPE APPLE_KEYBOARD_TYPE_JIS }; -enum APPLE_KEYBOARD_TYPE mac_detect_keyboard_type(); +enum APPLE_KEYBOARD_TYPE mac_detect_keyboard_type(void); diff --git a/client/Mac/Keyboard.m b/client/Mac/Keyboard.m index 98574b792..90eb5381d 100644 --- a/client/Mac/Keyboard.m +++ b/client/Mac/Keyboard.m @@ -21,7 +21,8 @@ #include -#include +#include +#include struct _APPLE_KEYBOARD_DESC { @@ -158,7 +159,7 @@ static enum APPLE_KEYBOARD_TYPE mac_identify_keyboard_type(uint32_t vendorID, return type; } -enum APPLE_KEYBOARD_TYPE mac_detect_keyboard_type() +enum APPLE_KEYBOARD_TYPE mac_detect_keyboard_type(void) { CFSetRef deviceCFSetRef = NULL; IOHIDDeviceRef inIOHIDDeviceRef = NULL; diff --git a/client/Mac/MRDPView.h b/client/Mac/MRDPView.h index 60e47d8f1..30217d895 100644 --- a/client/Mac/MRDPView.h +++ b/client/Mac/MRDPView.h @@ -26,6 +26,8 @@ #import "mf_client.h" #import "Keyboard.h" +#import + @interface MRDPView : NSView { mfContext* mfc; diff --git a/client/Mac/MRDPView.m b/client/Mac/MRDPView.m index ad8ef2620..4b863805e 100644 --- a/client/Mac/MRDPView.m +++ b/client/Mac/MRDPView.m @@ -44,6 +44,8 @@ #import "freerdp/client/cmdline.h" #import "freerdp/log.h" +#import + #define TAG CLIENT_TAG("mac") static BOOL mf_Pointer_New(rdpContext* context, rdpPointer* pointer); @@ -60,7 +62,7 @@ static BOOL mac_desktop_resize(rdpContext* context); static void update_activity_cb(freerdp* instance); static void input_activity_cb(freerdp* instance); -static DWORD mac_client_thread(void* param); +static DWORD WINAPI mac_client_thread(void* param); @implementation MRDPView @@ -106,7 +108,7 @@ static DWORD mac_client_thread(void* param); return 0; } -static DWORD mac_client_update_thread(void* param) +static DWORD WINAPI mac_client_update_thread(void* param) { int status; wMessage message; @@ -164,7 +166,7 @@ static DWORD WINAPI mac_client_input_thread(LPVOID param) return 0; } -DWORD mac_client_thread(void* param) +DWORD WINAPI mac_client_thread(void* param) { @autoreleasepool { diff --git a/client/Mac/PasswordDialog.m b/client/Mac/PasswordDialog.m index 01de275b2..ab73699d7 100644 --- a/client/Mac/PasswordDialog.m +++ b/client/Mac/PasswordDialog.m @@ -20,6 +20,8 @@ #import "PasswordDialog.h" #import +#import + @interface PasswordDialog() @property BOOL modalCode; diff --git a/client/Mac/cli/CMakeLists.txt b/client/Mac/cli/CMakeLists.txt index d7b7b41db..b481ab5f7 100644 --- a/client/Mac/cli/CMakeLists.txt +++ b/client/Mac/cli/CMakeLists.txt @@ -10,15 +10,16 @@ find_library(FOUNDATION_LIBRARY Foundation) find_library(COCOA_LIBRARY Cocoa) find_library(APPKIT_LIBRARY AppKit) +string(TIMESTAMP VERSION_YEAR "%Y") set(MACOSX_BUNDLE_INFO_STRING "MacFreeRDP") set(MACOSX_BUNDLE_ICON_FILE "FreeRDP.icns") set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.freerdp.mac") set(MACOSX_BUNDLE_BUNDLE_IDENTIFIER "FreeRDP-client.Mac") -set(MACOSX_BUNDLE_LONG_VERSION_STRING "MacFreeRDP Client Version 1.1.0") +set(MACOSX_BUNDLE_LONG_VERSION_STRING "MacFreeRDP Client Version ${FREERDP_VERSION}") set(MACOSX_BUNDLE_BUNDLE_NAME "MacFreeRDP") -set(MACOSX_BUNDLE_SHORT_VERSION_STRING 1.1.0) -set(MACOSX_BUNDLE_BUNDLE_VERSION 1.1.0) -set(MACOSX_BUNDLE_COPYRIGHT "Copyright 2013. All Rights Reserved.") +set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${FREERDP_VERSION}) +set(MACOSX_BUNDLE_BUNDLE_VERSION ${FREERDP_VERSION}) +set(MACOSX_BUNDLE_COPYRIGHT "Copyright 2013-${VERSION_YEAR}. All Rights Reserved.") set(MACOSX_BUNDLE_NSMAIN_NIB_FILE "MainMenu") set(MACOSX_BUNDLE_NSPRINCIPAL_CLASS "NSApplication") diff --git a/client/Mac/mf_client.m b/client/Mac/mf_client.m index 575d44861..71eb4ffa9 100644 --- a/client/Mac/mf_client.m +++ b/client/Mac/mf_client.m @@ -30,13 +30,13 @@ * Client Interface */ -static BOOL mfreerdp_client_global_init() +static BOOL mfreerdp_client_global_init(void) { freerdp_handle_signals(); return TRUE; } -static void mfreerdp_client_global_uninit() +static void mfreerdp_client_global_uninit(void) { } @@ -98,7 +98,6 @@ static BOOL mfreerdp_client_new(freerdp* instance, rdpContext* context) static void mfreerdp_client_free(freerdp* instance, rdpContext* context) { mfContext* mfc; - rdpSettings* settings; if (!instance || !context) return; @@ -110,7 +109,7 @@ static void mfreerdp_client_free(freerdp* instance, rdpContext* context) static void freerdp_client_mouse_event(rdpContext* cfc, DWORD flags, int x, int y) { - int width, height; + UINT32 width, height; rdpInput* input = cfc->instance->input; rdpSettings* settings = cfc->instance->settings; width = settings->DesktopWidth; @@ -119,7 +118,8 @@ static void freerdp_client_mouse_event(rdpContext* cfc, DWORD flags, int x, if (x < 0) x = 0; - x = width - 1; + if (x >= width) + x = width - 1; if (y < 0) y = 0; diff --git a/client/Mac/mfreerdp.h b/client/Mac/mfreerdp.h index 1d21a9655..75e5b7322 100644 --- a/client/Mac/mfreerdp.h +++ b/client/Mac/mfreerdp.h @@ -28,7 +28,7 @@ typedef struct mf_context mfContext; #include "MRDPView.h" #include "Keyboard.h" -#include +#include struct mf_context {