mfreerdp: fix icon file

This commit is contained in:
Marc-André Moreau 2013-03-11 00:35:15 -04:00
parent 5628927fc2
commit 1f335709b3
4 changed files with 46 additions and 42 deletions

View File

@ -10,13 +10,14 @@ include_directories(${FRAMEWORK_HEADERS_PATH} /System/Library/Frameworks)
# set(CMAKE_OSX_SYSROOT MacOSX10.7.sdk)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -mmacosx-version-min=10.4")
set(GUI_TYPE MACOSX_BUNDLE)
# Import libraries
find_library(FOUNDATION_LIBRARY Foundation)
find_library(COCOA_LIBRARY Cocoa)
find_library(APPKIT_LIBRARY AppKit)
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.Mac")
set(MACOSX_BUNDLE_LONG_VERSION_STRING "MacFreeRDP Version 1.0.1")
@ -27,35 +28,37 @@ set(MACOSX_BUNDLE_COPYRIGHT "Copyright 2012. All Rights Reserved.")
set(MACOSX_BUNDLE_NSMAIN_NIB_FILE "MainMenu")
set(MACOSX_BUNDLE_NSPRINCIPAL_CLASS "NSApplication")
mark_as_advanced(COCOA_LIBRARY FOUNDATION_LIBRARY APPKIT_LIBRARY)
set(EXTRA_LIBS ${COCOA_LIBRARY} ${FOUNDATION_LIBRARY} ${APPKIT_LIBRARY})
set(APP_TYPE MACOSX_BUNDLE)
# OS X Interface Builder files
file(GLOB MacFreeRDP_XIBS *.xib)
file(GLOB ${MODULE_NAME}_XIBS *.xib)
set(${MODULE_NAME}_RESOURCES ${${MODULE_NAME}_XIBS} ${MACOSX_BUNDLE_ICON_FILE})
# Headers
file(GLOB MacFreeRDP_Headers *.h)
file(GLOB ${MODULE_NAME}_HEADERS *.h)
# Source
file(GLOB MacFreeRDP_Source *.m)
file(GLOB ${MODULE_NAME}_SOURCES *.m)
add_executable(MacFreeRDP
add_executable(${MODULE_NAME}
${APP_TYPE}
${MacFreeRDP_Headers}
${MacFreeRDP_Source}
${MacFreeRDP_XIBS})
${${MODULE_NAME}_HEADERS}
${${MODULE_NAME}_SOURCES}
${${MODULE_NAME}_RESOURCES})
# This is necessary for the xib file part below
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Info.plist ${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
# This allows for automatic xib to nib ibitool
set_target_properties(MacFreeRDP PROPERTIES RESOURCE "${MacFreeRDP_XIBS}")
set_target_properties(${MODULE_NAME} PROPERTIES RESOURCE "${${MODULE_NAME}_RESOURCES}")
# Automatic ref counting
# temporary turn off for x86_64 build issue
# set_target_properties(MacFreeRDP PROPERTIES XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES)
# set_target_properties(${MODULE_NAME} PROPERTIES XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES)
# Support for automatic reference counting requires non-fragile abi.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fobjc-nonfragile-abi")
@ -67,10 +70,10 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fobjc-nonfragile-abi")
# In the future the FreeRDP Xcode project should be pulled in for a couple of reasons:
# 1) better step-into debugging 2) automatic dependency compilation and multi-arch compilation + linkage
# If you know the solutions for 1 and 2, please add below.
set_target_properties(MacFreeRDP PROPERTIES XCODE_ATTRIBUTE_ARCHS "$(NATIVE_ARCH_ACTUAL)")
set_target_properties(${MODULE_NAME} PROPERTIES XCODE_ATTRIBUTE_ARCHS "$(NATIVE_ARCH_ACTUAL)")
# Set the info plist to the custom instance
set_target_properties(MacFreeRDP PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
set_target_properties(${MODULE_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ${EXTRA_LIBS})
@ -82,8 +85,8 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHI
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHIC_BUILD}
MODULE winpr
MODULES winpr-crt)
MODULES winpr-input winpr-crt winpr-utils)
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
set_property(TARGET MacFreeRDP PROPERTY FOLDER "Client/Mac")
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Client/Mac")

BIN
client/Mac/FreeRDP.icns Normal file

Binary file not shown.

View File

@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string></string>
<key>CFBundleIconFile</key>
<string></string>
<string>FreeRDP</string>
<key>CFBundleIdentifier</key>
<string>FreeRDP.Mac</string>
<key>CFBundleInfoDictionaryVersion</key>

View File

@ -815,7 +815,7 @@ int rdp_connect()
instance->ContextNew = mac_context_new;
instance->ContextFree = mac_context_free;
instance->ReceiveChannelData = receive_channel_data;
instance->Authenticate = mac_authenticate;
instance->Authenticate = mac_authenticate;
freerdp_context_new(instance);
status = freerdp_connect(instance);
@ -929,13 +929,13 @@ BOOL mac_pre_connect(freerdp* instance)
freerdp_client_load_addins(instance->context->channels, instance->settings);
settings = instance->settings;
settings = instance->settings;
bitmap_cache = settings->BitmapCacheEnabled;
instance->settings->ColorDepth = 32;
instance->settings->SoftwareGdi = TRUE;
settings->OsMajorType = OSMAJORTYPE_UNIX;
settings->OsMajorType = OSMAJORTYPE_UNIX;
settings->OsMinorType = OSMINORTYPE_NATIVE_XSERVER;
settings->OrderSupport[NEG_DSTBLT_INDEX] = TRUE;
@ -966,12 +966,11 @@ BOOL mac_pre_connect(freerdp* instance)
settings->OrderSupport[NEG_ELLIPSE_SC_INDEX] = FALSE;
settings->OrderSupport[NEG_ELLIPSE_CB_INDEX] = FALSE;
[g_mrdpview setViewSize:instance->settings->DesktopWidth :instance->settings->DesktopHeight];
freerdp_channels_pre_connect(instance->context->channels, instance);
return TRUE;
}
@ -1008,11 +1007,10 @@ BOOL mac_post_connect(freerdp* instance)
flags = CLRBUF_32BPP;
gdi_init(instance, flags, NULL);
rdpGdi* gdi = instance->context->gdi;
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
g_mrdpview->bitmap_context = CGBitmapContextCreate(gdi->primary_buffer, gdi->width, gdi->height, 8, gdi->width * 4, colorSpace, kCGBitmapByteOrder32Little | kCGImageAlphaNoneSkipFirst);
rdpGdi* gdi = instance->context->gdi;
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
g_mrdpview->bitmap_context = CGBitmapContextCreate(gdi->primary_buffer, gdi->width, gdi->height, 8, gdi->width * 4, colorSpace, kCGBitmapByteOrder32Little | kCGImageAlphaNoneSkipFirst);
pointer_cache_register_callbacks(instance->update);
graphics_register_pointer(instance->context->graphics, &rdp_pointer);
@ -1062,27 +1060,30 @@ BOOL mac_post_connect(freerdp* instance)
BOOL mac_authenticate(freerdp* instance, char** username, char** password, char** domain)
{
PasswordDialog * dialog = [PasswordDialog new];
PasswordDialog * dialog = [PasswordDialog new];
dialog.serverName = [NSString stringWithCString:instance->settings->ServerHostname encoding:NSUTF8StringEncoding];
dialog.serverName = [NSString stringWithCString:instance->settings->ServerHostname encoding:NSUTF8StringEncoding];
if (*username)
dialog.userName = [NSString stringWithCString:*username encoding:NSUTF8StringEncoding];
if (*username)
dialog.userName = [NSString stringWithCString:*username encoding:NSUTF8StringEncoding];
if (*password)
dialog.password = [NSString stringWithCString:*password encoding:NSUTF8StringEncoding];
if (*password)
dialog.password = [NSString stringWithCString:*password encoding:NSUTF8StringEncoding];
BOOL ok = [dialog runModal];
if (ok) {
const char* submittedUsername = [dialog.userName cStringUsingEncoding:NSUTF8StringEncoding];
*username = malloc((strlen(submittedUsername) + 1) * sizeof(char));
strcpy(*username, submittedUsername);
BOOL ok = [dialog runModal];
if (ok)
{
const char* submittedUsername = [dialog.userName cStringUsingEncoding:NSUTF8StringEncoding];
*username = malloc((strlen(submittedUsername) + 1) * sizeof(char));
strcpy(*username, submittedUsername);
const char* submittedPassword = [dialog.password cStringUsingEncoding:NSUTF8StringEncoding];
*password = malloc((strlen(submittedPassword) + 1) * sizeof(char));
strcpy(*password, submittedPassword);
}
return ok;
const char* submittedPassword = [dialog.password cStringUsingEncoding:NSUTF8StringEncoding];
*password = malloc((strlen(submittedPassword) + 1) * sizeof(char));
strcpy(*password, submittedPassword);
}
return ok;
}
/** *********************************************************************