diff --git a/client/Android/FreeRDPCore/jni/android_freerdp.c b/client/Android/FreeRDPCore/jni/android_freerdp.c index cf7945374..8a4165a06 100644 --- a/client/Android/FreeRDPCore/jni/android_freerdp.c +++ b/client/Android/FreeRDPCore/jni/android_freerdp.c @@ -796,15 +796,15 @@ JNIEXPORT jboolean JNICALL jni_freerdp_update_graphics( JNIEXPORT void JNICALL jni_freerdp_send_key_event( JNIEnv *env, jclass cls, jint instance, jint keycode, jboolean down) { - RDP_SCANCODE scancode; + DWORD scancode; ANDROID_EVENT* event; freerdp* inst = (freerdp*)instance; - scancode = freerdp_keyboard_get_rdp_scancode_from_virtual_key_code(keycode); + scancode = GetVirtualScanCodeFromVirtualKeyCode(keycode, 4); int flags = (down == JNI_TRUE) ? KBD_FLAGS_DOWN : KBD_FLAGS_RELEASE; - flags |= (RDP_SCANCODE_EXTENDED(scancode)) ? KBD_FLAGS_EXTENDED : 0; - event = (ANDROID_EVENT*) android_event_key_new(flags, RDP_SCANCODE_CODE(scancode)); + flags |= (scancode & KBDEXT) ? KBD_FLAGS_EXTENDED : 0; + event = (ANDROID_EVENT*) android_event_key_new(flags, scancode & 0xFF); android_push_event(inst, event); diff --git a/client/Android/FreeRDPCore/src/com/freerdp/freerdpcore/domain/ConnectionReference.java b/client/Android/FreeRDPCore/src/com/freerdp/freerdpcore/domain/ConnectionReference.java index 270139c51..4e4442dd7 100644 --- a/client/Android/FreeRDPCore/src/com/freerdp/freerdpcore/domain/ConnectionReference.java +++ b/client/Android/FreeRDPCore/src/com/freerdp/freerdpcore/domain/ConnectionReference.java @@ -14,6 +14,7 @@ public class ConnectionReference public static final String PATH_MANUAL_BOOKMARK_ID = "MBMID/"; public static final String PATH_HOSTNAME = "HOST/"; public static final String PATH_PLACEHOLDER = "PLCHLD/"; + public static final String PATH_FILE = "FILE/"; public static String getManualBookmarkReference(long bookmarkId) { return (PATH_MANUAL_BOOKMARK_ID + bookmarkId); @@ -27,6 +28,10 @@ public class ConnectionReference return (PATH_PLACEHOLDER + name); } + public static String getFileReference(String uri) { + return (PATH_FILE + uri); + } + public static boolean isBookmarkReference(String refStr) { return refStr.startsWith(PATH_MANUAL_BOOKMARK_ID); } @@ -43,6 +48,10 @@ public class ConnectionReference return refStr.startsWith(PATH_PLACEHOLDER); } + public static boolean isFileReference(String refStr) { + return refStr.startsWith(PATH_FILE); + } + public static long getManualBookmarkId(String refStr) { return Integer.parseInt(refStr.substring(PATH_MANUAL_BOOKMARK_ID.length())); } @@ -54,4 +63,8 @@ public class ConnectionReference public static String getPlaceholder(String refStr) { return refStr.substring(PATH_PLACEHOLDER.length()); } + + public static String getFile(String refStr) { + return refStr.substring(PATH_FILE.length()); + } } diff --git a/client/Android/FreeRDPCore/src/com/freerdp/freerdpcore/presentation/BookmarkActivity.java b/client/Android/FreeRDPCore/src/com/freerdp/freerdpcore/presentation/BookmarkActivity.java index 078852f3b..4d938f419 100644 --- a/client/Android/FreeRDPCore/src/com/freerdp/freerdpcore/presentation/BookmarkActivity.java +++ b/client/Android/FreeRDPCore/src/com/freerdp/freerdpcore/presentation/BookmarkActivity.java @@ -9,12 +9,16 @@ package com.freerdp.freerdpcore.presentation; +import java.io.File; +import java.io.IOException; + import com.freerdp.freerdpcore.R; import com.freerdp.freerdpcore.application.GlobalApp; import com.freerdp.freerdpcore.domain.BookmarkBase; import com.freerdp.freerdpcore.domain.ConnectionReference; import com.freerdp.freerdpcore.domain.ManualBookmark; import com.freerdp.freerdpcore.services.BookmarkBaseGateway; +import com.freerdp.freerdpcore.utils.RDPFileParser; import android.app.AlertDialog; import android.content.ComponentName; @@ -25,11 +29,14 @@ import android.os.Bundle; import android.preference.ListPreference; import android.preference.Preference; import android.preference.PreferenceActivity; +import android.util.Log; public class BookmarkActivity extends PreferenceActivity implements OnSharedPreferenceChangeListener { public static final String PARAM_CONNECTION_REFERENCE = "conRef"; + private static final String TAG = "BookmarkActivity"; + private int current_preferences; private static final int PREFERENCES_BOOKMARK = 1; private static final int PREFERENCES_CREDENTIALS = 2; @@ -78,6 +85,26 @@ public class BookmarkActivity extends PreferenceActivity implements OnSharedPref bookmark.get().setHostname(ConnectionReference.getHostname(refStr)); new_bookmark = true; } + else if (ConnectionReference.isFileReference(refStr)) + { + String file = ConnectionReference.getFile(refStr); + + bookmark = new ManualBookmark(); + bookmark.setLabel(file); + + try + { + RDPFileParser rdpFile = new RDPFileParser(file); + updateBookmarkFromFile((ManualBookmark)bookmark, rdpFile); + + bookmark.setLabel(new File(file).getName()); + new_bookmark = true; + } + catch (IOException e) + { + Log.e(TAG, "Failed reading RDP file", e); + } + } } } @@ -144,6 +171,54 @@ public class BookmarkActivity extends PreferenceActivity implements OnSharedPref setIntentComponentNames(); } + private void updateBookmarkFromFile(ManualBookmark bookmark, RDPFileParser rdpFile) + { + String s; + Integer i; + + s = rdpFile.getString("full address"); + if (s != null) + { + // this gets complicated as it can include port + if (s.lastIndexOf(":") > s.lastIndexOf("]")) + { + try + { + String port = s.substring(s.lastIndexOf(":") + 1); + bookmark.setPort(Integer.parseInt(port)); + } + catch (NumberFormatException e) + { + Log.e(TAG, "Malformed address"); + } + + s = s.substring(0, s.lastIndexOf(":")); + } + + // or even be an ipv6 address + if (s.startsWith("[") && s.endsWith("]")) + s = s.substring(1, s.length() - 1); + + bookmark.setHostname(s); + } + + i = rdpFile.getInteger("server port"); + if (i != null) + bookmark.setPort(i); + + s = rdpFile.getString("username"); + if (s != null) + bookmark.setUsername(s); + + s = rdpFile.getString("domain"); + if (s != null) + bookmark.setDomain(s); + + i = rdpFile.getInteger("connect to console"); + if (i != null) + bookmark.getAdvancedSettings().setConsoleMode(i == 1); + } + private void setIntentComponentNames() { // we set the component name for our sub-activity calls here because we don't know the package diff --git a/client/Android/FreeRDPCore/src/com/freerdp/freerdpcore/presentation/HomeActivity.java b/client/Android/FreeRDPCore/src/com/freerdp/freerdpcore/presentation/HomeActivity.java index 8abd471c9..6330cb18e 100644 --- a/client/Android/FreeRDPCore/src/com/freerdp/freerdpcore/presentation/HomeActivity.java +++ b/client/Android/FreeRDPCore/src/com/freerdp/freerdpcore/presentation/HomeActivity.java @@ -26,26 +26,27 @@ import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.content.res.Configuration; +import android.net.Uri; import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; import android.util.Log; +import android.view.ContextMenu; +import android.view.ContextMenu.ContextMenuInfo; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; -import android.view.ContextMenu; import android.view.View.OnClickListener; -import android.view.ContextMenu.ContextMenuInfo; import android.view.View.OnCreateContextMenuListener; import android.webkit.WebView; import android.webkit.WebViewClient; +import android.widget.AdapterView; +import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.Button; import android.widget.CheckBox; import android.widget.EditText; import android.widget.ListView; -import android.widget.AdapterView; -import android.widget.AdapterView.AdapterContextMenuInfo; public class HomeActivity extends Activity { @@ -87,6 +88,21 @@ public class HomeActivity extends Activity addBookmarkPlaceholder.setName(ADD_BOOKMARK_PLACEHOLDER); addBookmarkPlaceholder.setLabel(getResources().getString(R.string.list_placeholder_add_bookmark)); + // check for passed .rdp file and open it in a new bookmark + Intent caller = getIntent(); + Uri callParameter = caller.getData(); + + if (Intent.ACTION_VIEW.equals(caller.getAction()) && callParameter != null) + { + String refStr = ConnectionReference.getFileReference(callParameter.getPath()); + Bundle bundle = new Bundle(); + bundle.putString(BookmarkActivity.PARAM_CONNECTION_REFERENCE, refStr); + + Intent bookmarkIntent = new Intent(this.getApplicationContext(), BookmarkActivity.class); + bookmarkIntent.putExtras(bundle); + startActivity(bookmarkIntent); + } + // load views clearTextButton = (Button) findViewById(R.id.clear_search_btn); superBarEditText = (EditText) findViewById(R.id.superBarEditText); diff --git a/client/Android/FreeRDPCore/src/com/freerdp/freerdpcore/utils/RDPFileParser.java b/client/Android/FreeRDPCore/src/com/freerdp/freerdpcore/utils/RDPFileParser.java new file mode 100644 index 000000000..a903ed2eb --- /dev/null +++ b/client/Android/FreeRDPCore/src/com/freerdp/freerdpcore/utils/RDPFileParser.java @@ -0,0 +1,101 @@ +/* + Simple .RDP file parser + + Copyright 2013 Blaz Bacnik + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. +*/ + +package com.freerdp.freerdpcore.utils; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.util.HashMap; +import java.util.Locale; + +public class RDPFileParser { + + private static final int MAX_ERRORS = 20; + private static final int MAX_LINES = 500; + + private HashMap options; + + private void init() + { + options = new HashMap(); + } + + public RDPFileParser() + { + init(); + } + + public RDPFileParser(String filename) throws IOException + { + init(); + parse(filename); + } + + public void parse(String filename) throws IOException + { + BufferedReader br = new BufferedReader(new FileReader(filename)); + String line = null; + + int errors = 0; + int lines = 0; + boolean ok; + + while ((line = br.readLine()) != null) + { + lines++; ok = false; + + if (errors > MAX_ERRORS || lines > MAX_LINES) + throw new IOException("Parsing limits exceeded"); + + String[] fields = line.split(":", 3); + + if (fields.length == 3) + { + if (fields[1].equals("s")) + { + options.put(fields[0].toLowerCase(Locale.ENGLISH), fields[2]); + ok = true; + } + else if (fields[1].equals("i")) + { + try + { + Integer i = Integer.parseInt(fields[2]); + options.put(fields[0].toLowerCase(Locale.ENGLISH), i); + ok = true; + } + catch (NumberFormatException e) { } + } + else if (fields[1].equals("b")) + { + ok = true; + } + } + + if (!ok) errors++; + } + } + + public String getString(String optionName) + { + if (options.get(optionName) instanceof String) + return (String) options.get(optionName); + else + return null; + } + + public Integer getInteger(String optionName) + { + if (options.get(optionName) instanceof Integer) + return (Integer) options.get(optionName); + else + return null; + } +} diff --git a/client/Android/aFreeRDP/AndroidManifest.xml.cmake b/client/Android/aFreeRDP/AndroidManifest.xml.cmake index e0d01c824..f63717dd8 100644 --- a/client/Android/aFreeRDP/AndroidManifest.xml.cmake +++ b/client/Android/aFreeRDP/AndroidManifest.xml.cmake @@ -23,6 +23,21 @@ + + + + + + + + + + diff --git a/client/Android/aFreeRDP/CMakeLists.txt b/client/Android/aFreeRDP/CMakeLists.txt index 9dd3b6179..d17533b75 100644 --- a/client/Android/aFreeRDP/CMakeLists.txt +++ b/client/Android/aFreeRDP/CMakeLists.txt @@ -38,7 +38,7 @@ if(ANDROID_BUILD_JAVA) COMMAND ${ANT_COMMAND} ${ANDROID_BUILD_TYPE} WORKING_DIRECTORY "${ANDROID_SOURCE_DIR}" MAIN_DEPENDENCY AndroidManifest.xml - DEPENDS freerdp-android local.properties android-lib + DEPENDS freerdp-android local.properties #android-lib ) add_custom_target(android-package ALL SOURCES "${APK}") SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "gen;bin") diff --git a/client/Mac/CMakeLists.txt b/client/Mac/CMakeLists.txt index 734b66933..2183eb9d2 100644 --- a/client/Mac/CMakeLists.txt +++ b/client/Mac/CMakeLists.txt @@ -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") diff --git a/client/Mac/FreeRDP.icns b/client/Mac/FreeRDP.icns new file mode 100644 index 000000000..88bd44ca0 Binary files /dev/null and b/client/Mac/FreeRDP.icns differ diff --git a/client/Mac/Info.plist b/client/Mac/Info.plist index 119d3fec6..cb6976502 100644 --- a/client/Mac/Info.plist +++ b/client/Mac/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable CFBundleIconFile - + FreeRDP CFBundleIdentifier FreeRDP.Mac CFBundleInfoDictionaryVersion diff --git a/client/Mac/MRDPCursor.h b/client/Mac/MRDPCursor.h index 7c193e684..767ccbc52 100644 --- a/client/Mac/MRDPCursor.h +++ b/client/Mac/MRDPCursor.h @@ -24,11 +24,11 @@ @interface MRDPCursor : NSObject { @public - rdpPointer *pointer; - BYTE *cursor_data; // bitmapped pixel data - NSBitmapImageRep *bmiRep; - NSCursor *nsCursor; - NSImage *nsImage; + rdpPointer* pointer; + BYTE* cursor_data; + NSBitmapImageRep* bmiRep; + NSCursor* nsCursor; + NSImage* nsImage; } @end diff --git a/client/Mac/MRDPCursor.m b/client/Mac/MRDPCursor.m index 86e1c2d9b..6df626769 100644 --- a/client/Mac/MRDPCursor.m +++ b/client/Mac/MRDPCursor.m @@ -20,4 +20,5 @@ #import "MRDPCursor.h" @implementation MRDPCursor + @end diff --git a/client/Mac/MRDPRailView.m b/client/Mac/MRDPRailView.m index f9e0e0655..7c9220dfb 100644 --- a/client/Mac/MRDPRailView.m +++ b/client/Mac/MRDPRailView.m @@ -27,14 +27,6 @@ MRDPRailView* g_mrdpRailView; -struct kkey -{ - int key_code; - int flags; -}; - -extern struct kkey g_keys[]; - - (void) updateDisplay { BOOL moveWindow = NO; @@ -553,9 +545,17 @@ extern struct kkey g_keys[]; - (void) keyDown:(NSEvent *) event { int key; + BOOL extended; + DWORD vkcode; + DWORD scancode; - key = [event keyCode]; - rdp_instance->input->KeyboardEvent(rdp_instance->input, g_keys[key].flags | KBD_FLAGS_DOWN, g_keys[key].key_code); + key = [event keyCode] + 8; + + vkcode = GetVirtualKeyCodeFromKeycode(key, KEYCODE_TYPE_APPLE); + scancode = GetVirtualScanCodeFromVirtualKeyCode(vkcode, 4); + extended = (scancode & KBDEXT) ? KBDEXT : 0; + + rdp_instance->input->KeyboardEvent(rdp_instance->input, extended | KBD_FLAGS_DOWN, scancode & 0xFF); } /** ********************************************************************* @@ -565,9 +565,17 @@ extern struct kkey g_keys[]; - (void) keyUp:(NSEvent *) event { int key; + BOOL extended; + DWORD vkcode; + DWORD scancode; - key = [event keyCode]; - rdp_instance->input->KeyboardEvent(rdp_instance->input, g_keys[key].flags | KBD_FLAGS_RELEASE, g_keys[key].key_code); + key = [event keyCode] + 8; + + vkcode = GetVirtualKeyCodeFromKeycode(key, KEYCODE_TYPE_APPLE); + scancode = GetVirtualScanCodeFromVirtualKeyCode(vkcode, 4); + extended = (scancode & KBDEXT) ? KBDEXT : 0; + + rdp_instance->input->KeyboardEvent(rdp_instance->input, extended | KBD_FLAGS_RELEASE, scancode & 0xFF); } /** ********************************************************************* diff --git a/client/Mac/MRDPView.h b/client/Mac/MRDPView.h index e8bb0f153..08b3b42cf 100644 --- a/client/Mac/MRDPView.h +++ b/client/Mac/MRDPView.h @@ -41,18 +41,18 @@ NSMutableArray* cursors; NSMutableArray* windows; NSTimer* pasteboard_timer; - NSRect rect; NSRect prevWinPosition; int titleBarHeight; freerdp* rdp_instance; rdpContext* rdp_context; + CGContextRef bitmap_context; char* pixel_data; int width; int height; int argc; char** argv; - // RAIL stuff + /* RemoteApp */ MRDPWindow* currentWindow; NSPoint savedDragLocation; BOOL mouseInClientArea; @@ -63,7 +63,7 @@ BOOL saveInitialDragLoc; BOOL skipMoveWindowOnce; - // store state info for some keys + /* store state info for some keys */ int kdlshift; int kdrshift; int kdlctrl; @@ -76,18 +76,17 @@ @public NSWindow* ourMainWindow; - NSPasteboard* pasteboard_rd; // for reading from clipboard - NSPasteboard* pasteboard_wr; // for writing to clipboard + NSPasteboard* pasteboard_rd; /* for reading from clipboard */ + NSPasteboard* pasteboard_wr; /* for writing to clipboard */ int pasteboard_changecount; int pasteboard_format; - int is_connected; // true when connected to RDP server + int is_connected; } - (void) rdpConnectError; - (void) rdpRemoteAppError; - (void) saveStateInfo :(freerdp *) instance :(rdpContext *) context; - (void) onPasteboardTimerFired :(NSTimer *) timer; -- (void) my_draw_rect :(void *) context; - (void) releaseResources; - (void) setViewSize : (int) width : (int) height; @@ -113,6 +112,7 @@ void pointer_setDefault(rdpContext* context); int rdp_connect(void); BOOL mac_pre_connect(freerdp* instance); BOOL mac_post_connect(freerdp* instance); +BOOL mac_authenticate(freerdp* instance, char** username, char** password, char** domain); void mac_context_new(freerdp* instance, rdpContext* context); void mac_context_free(freerdp* instance, rdpContext* context); void mac_set_bounds(rdpContext* context, rdpBounds* bounds); @@ -165,10 +165,10 @@ struct mac_context struct cursor { rdpPointer* pointer; - BYTE* cursor_data; // bitmapped pixel data - void* bmiRep; // NSBitmapImageRep - void* nsCursor; // NSCursor - void* nsImage; // NSImage + BYTE* cursor_data; + void* bmiRep; /* NSBitmapImageRep */ + void* nsCursor; /* NSCursor */ + void* nsImage; /* NSImage */ }; struct rgba_data @@ -179,9 +179,3 @@ struct rgba_data char alpha; }; -struct kkey -{ - int key_code; - int flags; -}; - diff --git a/client/Mac/MRDPView.m b/client/Mac/MRDPView.m index d4f79c1ff..d0d1fc19d 100644 --- a/client/Mac/MRDPView.m +++ b/client/Mac/MRDPView.m @@ -44,6 +44,12 @@ #import "MRDPView.h" #import "MRDPCursor.h" +#import "PasswordDialog.h" + +#include +#include + +#include // RAIL_TODO DELETE WHEN DONE TESTING #define MRDP_DRAW_INDIVIDUAL_RECTS @@ -54,10 +60,6 @@ MRDPView *g_mrdpview; @synthesize is_connected; -struct kkey g_keys[]; - -void convert_color_space(char *dest, char *src, NSRect* drawRect, int width, int height); - const char* error_code_names[] = { "RAIL_EXEC_S_OK", @@ -69,166 +71,6 @@ const char* error_code_names[] = "RAIL_EXEC_E_SESSION_LOCKED" }; -struct kkey g_keys[256] = -{ - { 0x1e, 0 }, // a 0 - { 0x1f, 0 }, // s - { 0x20, 0 }, // d - { 0x21, 0 }, // f - { 0x23, 0 }, // h - { 0x22, 0 }, // g - { 0x2c, 0 }, // z - { 0x2d, 0 }, // x - { 0x2e, 0 }, // c - { 0x2f, 0 }, // v - { 0x00, 0 }, // 10 - { 0x30, 0 }, // b - { 0x10, 0 }, // q - { 0x11, 0 }, // w - { 0x12, 0 }, // e - { 0x13, 0 }, // r - { 0x15, 0 }, // y - { 0x14, 0 }, // t - { 0x02, 0 }, // 1 - { 0x03, 0 }, // 2 - { 0x04, 0 }, // 3 20 - { 0x05, 0 }, // 4 - { 0x07, 0 }, // 6 - { 0x06, 0 }, // 5 - { 0x0d, 0 }, // = or + - { 0x0a, 0 }, // 9 - { 0x08, 0 }, // 7 - { 0x0c, 0 }, // - or _ - { 0x09, 0 }, // 8 - { 0x0b, 0 }, // 0 - { 0x1b, 0 }, // ] or } 30 - { 0x18, 0 }, // o - { 0x16, 0 }, // u - { 0x1a, 0 }, // [ or { - { 0x17, 0 }, // i - { 0x19, 0 }, // p - { 0x1c, 0 }, // enter - { 0x26, 0 }, // l - { 0x24, 0 }, // j - { 0x28, 0 }, // ' or " - { 0x25, 0 }, // k 40 - { 0x27, 0 }, // ; or : - { 0x2b, 0 }, // \ or | - { 0x33, 0 }, // , or < - { 0x35, 0 }, // / or ? - { 0x31, 0 }, // n - { 0x32, 0 }, // m - { 0x34, 0 }, // . or > - { 0x0f, 0 }, // tab - { 0x39, 0 }, // space - { 0x29, 0 }, // ` or ~ 50 - { 0x0e, 0 }, // backspace - { 0x00, 0 }, // - { 0x01, 0 }, // esc - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, // 60 - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x53, 0 }, // KP. - { 0x00, 0 }, - { 0x37, 0 }, // KP* - { 0x00, 0 }, - { 0x4e, 0 }, // KP+ - { 0x00, 0 }, // 70 - { 0x45, 0 }, // num lock - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x35, 1 }, // KP/ - { 0x1c, 1 }, // KPEnter - { 0x00, 0 }, - { 0x4a, 0 }, // KP- - { 0x00, 0 }, - { 0x00, 0 }, // 80 - { 0x00, 0 }, - { 0x52, 0 }, // KP0 - { 0x4f, 0 }, // KP1 - { 0x50, 0 }, // KP2 - { 0x51, 0 }, // KP3 - { 0x4b, 0 }, // KP4 - { 0x4c, 0 }, // KP5 - { 0x4d, 0 }, // KP6 - { 0x47, 0 }, // KP7 - { 0x00, 0 }, // 90 - { 0x48, 0 }, // KP8 - { 0x49, 0 }, // KP9 - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, // 100 - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x5d, 1 }, // menu 110 - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x52, 1 }, // Insert - { 0x47, 1 }, // Home - { 0x49, 1 }, // PgUp - { 0x53, 1 }, // Delete - { 0x00, 0 }, - { 0x4f, 1 }, // End - { 0x00, 0 }, // 120 - { 0x51, 1 }, // PgDown - { 0x3b, 0 }, // f1 - { 0x4b, 1 }, // left - { 0x4d, 1 }, // right - { 0x50, 1 }, // down - { 0x48, 1 }, // up - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, - { 0x00, 0 }, -}; - /************************************************************************ methods we override ************************************************************************/ @@ -528,12 +370,20 @@ struct kkey g_keys[256] = - (void) keyDown:(NSEvent *) event { int key; + BOOL extended; + DWORD vkcode; + DWORD scancode; if (!is_connected) return; - key = [event keyCode]; - rdp_instance->input->KeyboardEvent(rdp_instance->input, g_keys[key].flags | KBD_FLAGS_DOWN, g_keys[key].key_code); + key = [event keyCode] + 8; + + vkcode = GetVirtualKeyCodeFromKeycode(key, KEYCODE_TYPE_APPLE); + scancode = GetVirtualScanCodeFromVirtualKeyCode(vkcode, 4); + extended = (scancode & KBDEXT) ? KBDEXT : 0; + + rdp_instance->input->KeyboardEvent(rdp_instance->input, extended | KBD_FLAGS_DOWN, scancode & 0xFF); } /** ********************************************************************* @@ -543,12 +393,20 @@ struct kkey g_keys[256] = - (void) keyUp:(NSEvent *) event { int key; + BOOL extended; + DWORD vkcode; + DWORD scancode; if (!is_connected) return; - key = [event keyCode]; - rdp_instance->input->KeyboardEvent(rdp_instance->input, g_keys[key].flags | KBD_FLAGS_RELEASE, g_keys[key].key_code); + key = [event keyCode] + 8; + + vkcode = GetVirtualKeyCodeFromKeycode(key, KEYCODE_TYPE_APPLE); + scancode = GetVirtualScanCodeFromVirtualKeyCode(vkcode, 4); + extended = (scancode & KBDEXT) ? KBDEXT : 0; + + rdp_instance->input->KeyboardEvent(rdp_instance->input, extended | KBD_FLAGS_RELEASE, scancode & 0xFF); } /** ********************************************************************* @@ -703,96 +561,36 @@ struct kkey g_keys[256] = * called when our view needs refreshing ***********************************************************************/ -- (void) drawRect:(NSRect)dirtyRect +- (void) drawRect:(NSRect)rect { if (!rdp_context) return; - + if (g_mrdpview->isRemoteApp && g_mrdpview->currentWindow) return; - - if (!bmiRep) - { - pixel_data = (char *) malloc(width * height * sizeof(struct rgba_data)); - bmiRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:(unsigned char **) &pixel_data - pixelsWide:width - pixelsHigh:height - bitsPerSample:8 - samplesPerPixel:sizeof(struct rgba_data) - hasAlpha:YES - isPlanar:NO - colorSpaceName:NSDeviceRGBColorSpace - bitmapFormat:0 //NSAlphaFirstBitmapFormat - bytesPerRow:width * sizeof(struct rgba_data) - bitsPerPixel:0]; - } - - [bmiRep drawInRect:dirtyRect fromRect:dirtyRect operation:NSCompositeCopy fraction:1.0 respectFlipped:NO hints:nil]; + + if(g_mrdpview->bitmap_context) + { + CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort]; + CGImageRef cgImage = CGBitmapContextCreateImage(g_mrdpview->bitmap_context); + + CGContextClipToRect(context, CGRectMake(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height)); + CGContextDrawImage(context, CGRectMake(0, 0, [self bounds].size.width, [self bounds].size.height), cgImage); + + CGImageRelease(cgImage); + } + else + { + // just clear the screen with black + [[NSColor redColor] set]; + NSRectFill([self bounds]); + } } /************************************************************************ instance methods ************************************************************************/ -/** ********************************************************************* - * called when RDP server wants us to update a rect with new data - ***********************************************************************/ - -- (void) my_draw_rect:(void*)context -{ - int w; - int h; - - rdpContext* ctx = (rdpContext*) context; - - struct rgba_data - { - char red; - char green; - char blue; - char alpha; - }; - - if (isRemoteApp && currentWindow) - { - NSRect vrect = [ [currentWindow view] frame]; - [[currentWindow view] setNeedsDisplayInRect:vrect]; - // actual drawing will be done in MRDPRailView:drawRect() - return; - } - - w = width; - h = height; - rect.origin.x = 0; - rect.origin.y = 0; - rect.size.width = w; - rect.size.height = h; - - if (!bmiRep) - { - pixel_data = (char *) malloc(w * h * sizeof(struct rgba_data)); - bmiRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:(unsigned char **) &pixel_data - pixelsWide:w - pixelsHigh:h - bitsPerSample:8 - samplesPerPixel:sizeof(struct rgba_data) - hasAlpha:YES - isPlanar:NO - colorSpaceName:NSDeviceRGBColorSpace - bitmapFormat:0 //NSAlphaFirstBitmapFormat - bytesPerRow:w * sizeof(struct rgba_data) - bitsPerPixel:0]; - } - -#ifdef MRDP_DRAW_INDIVIDUAL_RECTS - [self setNeedsDisplayInRect:rect]; - return; -#endif - - convert_color_space(pixel_data, (char *) ctx->gdi->primary_buffer, &rect, w, h); - [self setNeedsDisplayInRect:rect]; -} - /** ********************************************************************* * save state info for use by other methods later on ***********************************************************************/ @@ -854,9 +652,14 @@ struct kkey g_keys[256] = - (void) rdpConnectError { - + NSString* message = @"Error connecting to server"; + if (connectErrorCode == AUTHENTICATIONERROR) + { + message = [NSString stringWithFormat:@"%@:\n%@", message, @"Authentication failure, check credentials."]; + } + NSAlert *alert = [[NSAlert alloc] init]; - [alert setMessageText:@"Error connecting to server"]; + [alert setMessageText:message]; [alert beginSheetModalForWindow:[g_mrdpview window] modalDelegate:g_mrdpview didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) @@ -1012,6 +815,7 @@ int rdp_connect() instance->ContextNew = mac_context_new; instance->ContextFree = mac_context_free; instance->ReceiveChannelData = receive_channel_data; + instance->Authenticate = mac_authenticate; freerdp_context_new(instance); status = freerdp_connect(instance); @@ -1044,45 +848,14 @@ BOOL mac_pre_connect(freerdp* instance) int len; int status; char* cptr; - - instance->settings->OffscreenSupportLevel = FALSE; - instance->settings->GlyphSupportLevel = GLYPH_SUPPORT_FULL; - instance->settings->OrderSupport[NEG_GLYPH_INDEX_INDEX] = TRUE; - instance->settings->OrderSupport[NEG_FAST_GLYPH_INDEX] = FALSE; - instance->settings->OrderSupport[NEG_FAST_INDEX_INDEX] = FALSE; - instance->settings->OrderSupport[NEG_SCRBLT_INDEX] = TRUE; - instance->settings->OrderSupport[NEG_SAVEBITMAP_INDEX] = FALSE; - - instance->settings->BitmapCacheEnabled = TRUE; - instance->settings->OrderSupport[NEG_MEMBLT_INDEX] = TRUE; - instance->settings->OrderSupport[NEG_MEMBLT_V2_INDEX] = TRUE; - instance->settings->OrderSupport[NEG_MEM3BLT_INDEX] = FALSE; - instance->settings->OrderSupport[NEG_MEM3BLT_V2_INDEX] = FALSE; - instance->settings->BitmapCacheV2NumCells = 3; // 5; - instance->settings->BitmapCacheV2CellInfo[0].numEntries = 0x78; // 600; - instance->settings->BitmapCacheV2CellInfo[0].persistent = FALSE; - instance->settings->BitmapCacheV2CellInfo[1].numEntries = 0x78; // 600; - instance->settings->BitmapCacheV2CellInfo[1].persistent = FALSE; - instance->settings->BitmapCacheV2CellInfo[2].numEntries = 0x150; // 2048; - instance->settings->BitmapCacheV2CellInfo[2].persistent = FALSE; - instance->settings->BitmapCacheV2CellInfo[3].numEntries = 0; // 4096; - instance->settings->BitmapCacheV2CellInfo[3].persistent = FALSE; - instance->settings->BitmapCacheV2CellInfo[4].numEntries = 0; // 2048; - instance->settings->BitmapCacheV2CellInfo[4].persistent = FALSE; - - instance->settings->OrderSupport[NEG_MULTIDSTBLT_INDEX] = FALSE; - instance->settings->OrderSupport[NEG_MULTIPATBLT_INDEX] = FALSE; - instance->settings->OrderSupport[NEG_MULTISCRBLT_INDEX] = FALSE; - instance->settings->OrderSupport[NEG_MULTIOPAQUERECT_INDEX] = FALSE; - instance->settings->OrderSupport[NEG_POLYLINE_INDEX] = FALSE; - instance->settings->ColorDepth = 24; - instance->settings->SoftwareGdi = 1; - + rdpSettings* settings; + BOOL bitmap_cache; + // setup callbacks instance->update->BeginPaint = mac_begin_paint; instance->update->EndPaint = mac_end_paint; instance->update->SetBounds = mac_set_bounds; - instance->update->BitmapUpdate = mac_bitmap_update; + //instance->update->BitmapUpdate = mac_bitmap_update; NSArray *args = [[NSProcessInfo processInfo] arguments]; @@ -1153,12 +926,51 @@ BOOL mac_pre_connect(freerdp* instance) [NSApp terminate:nil]; return TRUE; } - + freerdp_client_load_addins(instance->context->channels, instance->settings); - + + settings = instance->settings; + bitmap_cache = settings->BitmapCacheEnabled; + + instance->settings->ColorDepth = 32; + instance->settings->SoftwareGdi = TRUE; + + settings->OsMajorType = OSMAJORTYPE_UNIX; + settings->OsMinorType = OSMINORTYPE_NATIVE_XSERVER; + + settings->OrderSupport[NEG_DSTBLT_INDEX] = TRUE; + settings->OrderSupport[NEG_PATBLT_INDEX] = TRUE; + settings->OrderSupport[NEG_SCRBLT_INDEX] = TRUE; + settings->OrderSupport[NEG_OPAQUE_RECT_INDEX] = TRUE; + settings->OrderSupport[NEG_DRAWNINEGRID_INDEX] = FALSE; + settings->OrderSupport[NEG_MULTIDSTBLT_INDEX] = FALSE; + settings->OrderSupport[NEG_MULTIPATBLT_INDEX] = FALSE; + settings->OrderSupport[NEG_MULTISCRBLT_INDEX] = FALSE; + settings->OrderSupport[NEG_MULTIOPAQUERECT_INDEX] = TRUE; + settings->OrderSupport[NEG_MULTI_DRAWNINEGRID_INDEX] = FALSE; + settings->OrderSupport[NEG_LINETO_INDEX] = TRUE; + settings->OrderSupport[NEG_POLYLINE_INDEX] = TRUE; + settings->OrderSupport[NEG_MEMBLT_INDEX] = bitmap_cache; + + settings->OrderSupport[NEG_MEM3BLT_INDEX] = (settings->SoftwareGdi) ? TRUE : FALSE; + + settings->OrderSupport[NEG_MEMBLT_V2_INDEX] = bitmap_cache; + settings->OrderSupport[NEG_MEM3BLT_V2_INDEX] = FALSE; + settings->OrderSupport[NEG_SAVEBITMAP_INDEX] = FALSE; + settings->OrderSupport[NEG_GLYPH_INDEX_INDEX] = TRUE; + settings->OrderSupport[NEG_FAST_INDEX_INDEX] = TRUE; + settings->OrderSupport[NEG_FAST_GLYPH_INDEX] = TRUE; + + settings->OrderSupport[NEG_POLYGON_SC_INDEX] = (settings->SoftwareGdi) ? FALSE : TRUE; + settings->OrderSupport[NEG_POLYGON_CB_INDEX] = (settings->SoftwareGdi) ? FALSE : TRUE; + + 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; } @@ -1184,22 +996,25 @@ BOOL mac_post_connect(freerdp* instance) void* wr_fds[32]; rdpPointer rdp_pointer; - memset(&rdp_pointer, 0, sizeof(rdpPointer)); + ZeroMemory(&rdp_pointer, sizeof(rdpPointer)); rdp_pointer.size = sizeof(rdpPointer); - rdp_pointer.New = pointer_new; - rdp_pointer.Free = pointer_free; - rdp_pointer.Set = pointer_set; - rdp_pointer.SetNull = pointer_setNull; - rdp_pointer.SetDefault = pointer_setDefault; - - flags = CLRCONV_ALPHA; - flags |= CLRBUF_32BPP; - + rdp_pointer.New = mf_Pointer_New; + rdp_pointer.Free = mf_Pointer_Free; + rdp_pointer.Set = mf_Pointer_Set; + rdp_pointer.SetNull = mf_Pointer_SetNull; + rdp_pointer.SetDefault = mf_Pointer_SetDefault; + + 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); + pointer_cache_register_callbacks(instance->update); graphics_register_pointer(instance->context->graphics, &rdp_pointer); - // register file descriptors with the RunLoop + /* register file descriptors with the RunLoop */ if (!freerdp_get_fds(instance, rd_fds, &rd_count, 0, 0)) { printf("mac_post_connect: freerdp_get_fds() failed!\n"); @@ -1211,7 +1026,7 @@ BOOL mac_post_connect(freerdp* instance) } register_fds(fds, rd_count, instance); - // register channel manager file descriptors with the RunLoop + /* register channel manager file descriptors with the RunLoop */ if (!freerdp_channels_get_fds(instance->context->channels, instance, rd_fds, &rd_count, wr_fds, &wr_count)) { printf("ERROR: freerdp_channels_get_fds() failed\n"); @@ -1224,25 +1039,53 @@ BOOL mac_post_connect(freerdp* instance) register_channel_fds(fds, rd_count, instance); freerdp_channels_post_connect(instance->context->channels, instance); - // setup RAIL (remote app) + /* setup RemoteApp */ instance->context->rail = rail_new(instance->settings); rail_register_update_callbacks(instance->context->rail, instance->update); mac_rail_register_callbacks(instance, instance->context->rail); - // setup pasteboard (aka clipboard) for copy operations (write only) + /* setup pasteboard (aka clipboard) for copy operations (write only) */ g_mrdpview->pasteboard_wr = [NSPasteboard generalPasteboard]; - // setup pasteboard for read operations + /* setup pasteboard for read operations */ g_mrdpview->pasteboard_rd = [NSPasteboard generalPasteboard]; g_mrdpview->pasteboard_changecount = (int) [g_mrdpview->pasteboard_rd changeCount]; g_mrdpview->pasteboard_timer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:g_mrdpview selector:@selector(onPasteboardTimerFired:) userInfo:nil repeats:YES]; - // we want to be notified when window resizes + /* we want to be notified when window resizes */ [[NSNotificationCenter defaultCenter] addObserver:g_mrdpview selector:@selector(windowDidResize:) name:NSWindowDidResizeNotification object:nil]; return TRUE; } +BOOL mac_authenticate(freerdp* instance, char** username, char** password, char** domain) +{ + PasswordDialog* dialog = [PasswordDialog new]; + + dialog.serverName = [NSString stringWithCString:instance->settings->ServerHostname encoding:NSUTF8StringEncoding]; + + if (*username) + dialog.userName = [NSString stringWithCString:*username 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); + + const char* submittedPassword = [dialog.password cStringUsingEncoding:NSUTF8StringEncoding]; + *password = malloc((strlen(submittedPassword) + 1) * sizeof(char)); + strcpy(*password, submittedPassword); + } + + return ok; +} + /** ********************************************************************* * create a new mouse cursor * @@ -1251,18 +1094,23 @@ BOOL mac_post_connect(freerdp* instance) * ************************************************************************/ -void pointer_new(rdpContext* context, rdpPointer* pointer) +void mf_Pointer_New(rdpContext* context, rdpPointer* pointer) { - BYTE* cursor_data; - MRDPCursor *mrdpCursor = [[MRDPCursor alloc] init]; - NSRect rect; + NSImage* image; + NSPoint hotSpot; + NSCursor* cursor; + BYTE* cursor_data; + NSMutableArray* ma; + NSBitmapImageRep* bmiRep; + MRDPCursor* mrdpCursor = [[MRDPCursor alloc] init]; + rect.size.width = pointer->width; rect.size.height = pointer->height; rect.origin.x = pointer->xPos; rect.origin.y = pointer->yPos; - cursor_data = (BYTE *) malloc(rect.size.width * rect.size.height * 4); + cursor_data = (BYTE*) malloc(rect.size.width * rect.size.height * 4); mrdpCursor->cursor_data = cursor_data; freerdp_alpha_cursor_convert(cursor_data, pointer->xorMaskData, pointer->andMaskData, @@ -1271,13 +1119,12 @@ void pointer_new(rdpContext* context, rdpPointer* pointer) // TODO if xorBpp is > 24 need to call freerdp_image_swap_color_order // see file df_graphics.c - // store cursor bitmap image in representation - required by NSImage - NSBitmapImageRep *bmiRep; + /* store cursor bitmap image in representation - required by NSImage */ bmiRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:(unsigned char **) &cursor_data - pixelsWide:rect.size.width + pixelsWide:rect.size.width pixelsHigh:rect.size.height bitsPerSample:8 - samplesPerPixel:sizeof(struct rgba_data) + samplesPerPixel:4 hasAlpha:YES isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace @@ -1286,23 +1133,22 @@ void pointer_new(rdpContext* context, rdpPointer* pointer) bitsPerPixel:0]; mrdpCursor->bmiRep = bmiRep; - // create an image using above representation - NSImage *image = [[NSImage alloc] initWithSize:[bmiRep size]]; + /* create an image using above representation */ + image = [[NSImage alloc] initWithSize:[bmiRep size]]; [image addRepresentation: bmiRep]; [image setFlipped:NO]; mrdpCursor->nsImage = image; - // need hotspot to create cursor - NSPoint hotSpot; + /* need hotspot to create cursor */ hotSpot.x = pointer->xPos; hotSpot.y = pointer->yPos; - NSCursor *cursor = [[NSCursor alloc] initWithImage: image hotSpot:hotSpot]; + cursor = [[NSCursor alloc] initWithImage: image hotSpot:hotSpot]; mrdpCursor->nsCursor = cursor; mrdpCursor->pointer = pointer; - // save cursor for later use in pointer_set() - NSMutableArray *ma = g_mrdpview->cursors; + /* save cursor for later use in mf_Pointer_Set() */ + ma = g_mrdpview->cursors; [ma addObject:mrdpCursor]; } @@ -1310,7 +1156,7 @@ void pointer_new(rdpContext* context, rdpPointer* pointer) * release resources on specified cursor ************************************************************************/ -void pointer_free(rdpContext* context, rdpPointer* pointer) +void mf_Pointer_Free(rdpContext* context, rdpPointer* pointer) { NSMutableArray* ma = g_mrdpview->cursors; @@ -1332,7 +1178,7 @@ void pointer_free(rdpContext* context, rdpPointer* pointer) * set specified cursor as the current cursor ************************************************************************/ -void pointer_set(rdpContext* context, rdpPointer* pointer) +void mf_Pointer_Set(rdpContext* context, rdpPointer* pointer) { NSMutableArray* ma = g_mrdpview->cursors; @@ -1353,7 +1199,7 @@ void pointer_set(rdpContext* context, rdpPointer* pointer) * do not display any mouse cursor ***********************************************************************/ -void pointer_setNull(rdpContext* context) +void mf_Pointer_SetNull(rdpContext* context) { } @@ -1361,7 +1207,7 @@ void pointer_setNull(rdpContext* context) * display default mouse cursor ***********************************************************************/ -void pointer_setDefault(rdpContext* context) +void mf_Pointer_SetDefault(rdpContext* context) { } @@ -1442,9 +1288,7 @@ void mac_end_paint(rdpContext* context) drawRect.origin.y = gdi->primary->hdc->hwnd->cinvalid[i].y; drawRect.size.width = gdi->primary->hdc->hwnd->cinvalid[i].w; drawRect.size.height = gdi->primary->hdc->hwnd->cinvalid[i].h; - - convert_color_space(g_mrdpview->pixel_data, (char *) gdi->primary_buffer, &drawRect, g_mrdpview->width, g_mrdpview->height); - + windows_to_apple_cords(&drawRect); [g_mrdpview setNeedsDisplayInRect:drawRect]; } @@ -1460,7 +1304,7 @@ void skt_activity_cb(CFSocketRef s, CFSocketCallBackType callbackType, { if (!freerdp_check_fds(info)) { - // lost connection or did not connect + /* lost connection or did not connect */ [NSApp terminate:nil]; } } @@ -1544,52 +1388,6 @@ int receive_channel_data(freerdp* instance, int chan_id, BYTE* data, int size, i return freerdp_channels_data(instance, chan_id, data, size, flags, total_size); } -/** ********************************************************************* - * convert an array containing ARGB data to RGBA - ***********************************************************************/ - -void convert_color_space(char* dest, char* src, NSRect* drawRect, int width, int height) -{ - int i; - int j; - int x; - int y; - int cx; - int cy; - int pixel; - int pixel1; - int pixel2; - int* src32; - int* dst32; - - if ((!dest) || (!src)) - return; - - x = drawRect->origin.x; - y = drawRect->origin.y; - cx = drawRect->size.width; - cy = drawRect->size.height; - - for (j = 0; j < cy; j++) - { - src32 = (int*)(src + ((y + j) * width + x) * 4); - dst32 = (int*)(dest + ((y + j) * width + x) * 4); - - for (i = 0; i < cx; i++) - { - pixel = *src32; - pixel1 = (pixel & 0x00ff0000) >> 16; - pixel2 = (pixel & 0x000000ff) << 16; - pixel = (pixel & 0xff00ff00) | pixel1 | pixel2; - *dst32 = pixel; - src32++; - dst32++; - } - } - - drawRect->origin.y = height - drawRect->origin.y - drawRect->size.height; -} - /** * Used to load plugins based on the commandline parameters. * This function is provided as a parameter to freerdp_parse_args(), that will call it @@ -1689,7 +1487,7 @@ void cliprdr_process_cb_monitor_ready_event(freerdp* instance) event = freerdp_event_new(RDP_EVENT_CLASS_CLIPRDR, RDP_EVENT_TYPE_CB_FORMAT_LIST, NULL, NULL); - format_list_event = (RDP_CB_FORMAT_LIST_EVENT*)event; + format_list_event = (RDP_CB_FORMAT_LIST_EVENT*) event; format_list_event->num_formats = 0; freerdp_channels_send_event(instance->context->channels, event); @@ -1752,32 +1550,40 @@ void process_cliprdr_event(freerdp* instance, RDP_EVENT* event) { switch (event->event_type) { - // Monitor Ready PDU is sent by server to indicate that it has been - // inited and is ready. This PDU is transmitted by the server after it has sent - // Clipboard Capabilities PDU + /* + * Monitor Ready PDU is sent by server to indicate that it has been + * initialized and is ready. This PDU is transmitted by the server after it has sent + * Clipboard Capabilities PDU + */ case RDP_EVENT_TYPE_CB_MONITOR_READY: cliprdr_process_cb_monitor_ready_event(instance); break; - // The Format List PDU is sent either by the client or the server when its - // local system clipboard is updated with new clipboard data. This PDU - // contains the Clipboard Format ID and name pairs of the new Clipboard - // Formats on the clipboard + /* + * The Format List PDU is sent either by the client or the server when its + * local system clipboard is updated with new clipboard data. This PDU + * contains the Clipboard Format ID and name pairs of the new Clipboard + * Formats on the clipboard + */ case RDP_EVENT_TYPE_CB_FORMAT_LIST: cliprdr_process_cb_format_list_event(instance, (RDP_CB_FORMAT_LIST_EVENT*) event); break; - // The Format Data Request PDU is sent by the receipient of the Format List PDU. - // It is used to request the data for one of the formats that was listed in the - // Format List PDU + /* + * The Format Data Request PDU is sent by the receipient of the Format List PDU. + * It is used to request the data for one of the formats that was listed in the + * Format List PDU + */ case RDP_EVENT_TYPE_CB_DATA_REQUEST: cliprdr_process_cb_data_request_event(instance); break; - // The Format Data Response PDU is sent as a reply to the Format Data Request PDU. - // It is used to indicate whether processing of the Format Data Request PDU - // was successful. If the processing was successful, the Format Data Response PDU - // includes the contents of the requested clipboard data + /* + * The Format Data Response PDU is sent as a reply to the Format Data Request PDU. + * It is used to indicate whether processing of the Format Data Request PDU + * was successful. If the processing was successful, the Format Data Response PDU + * includes the contents of the requested clipboard data + */ case RDP_EVENT_TYPE_CB_DATA_RESPONSE: cliprdr_process_cb_data_response_event(instance, (RDP_CB_DATA_RESPONSE_EVENT*) event); break; @@ -1853,14 +1659,14 @@ void mac_rail_CreateWindow(rdpRail* rail, rdpWindow* window) BOOL displayAsModal = NO; NSMutableArray * ma = g_mrdpview->windows; - // make sure window fits resolution + /* make sure window fits resolution */ if (window->windowWidth > g_mrdpview->width) window->windowWidth = g_mrdpview->width; if (window->windowHeight > g_mrdpview->height) window->windowHeight = g_mrdpview->height; - // center main window, which is the first to be created + /* center main window, which is the first to be created */ if ([ma count] == 0) { centerWindow = YES; @@ -1882,7 +1688,7 @@ void mac_rail_CreateWindow(rdpRail* rail, rdpWindow* window) } - // create NSWindow + /* create NSWindow */ NSRect winFrame = NSMakeRect(window->windowOffsetX, window->windowOffsetY, window->windowWidth, window->windowHeight); if (centerWindow) @@ -1893,18 +1699,19 @@ void mac_rail_CreateWindow(rdpRail* rail, rdpWindow* window) backing:NSBackingStoreBuffered defer:NO]; - // this does not work if specified during window creation in above code + /* this does not work if specified during window creation in above code */ [newWindow setStyleMask:NSBorderlessWindowMask]; - if (moveWindow) { - // let RDP server know that window has moved + if (moveWindow) + { + /* let RDP server know that window has moved */ RAIL_WINDOW_MOVE_ORDER windowMove; apple_to_windowMove(&winFrame, &windowMove); windowMove.windowId = window->windowId; mac_send_rail_client_event(g_mrdpview->rdp_instance->context->channels, RDP_EVENT_TYPE_RAIL_CLIENT_WINDOW_MOVE, &windowMove); } - // create MRDPRailView and add to above window + /* create MRDPRailView and add to above window */ NSRect viewFrame = NSMakeRect(window->clientOffsetX, window->clientOffsetY, window->clientAreaWidth, window->clientAreaHeight); @@ -1912,30 +1719,33 @@ void mac_rail_CreateWindow(rdpRail* rail, rdpWindow* window) [newView setRdpInstance:g_mrdpview->rdp_instance width:g_mrdpview->width andHeight:g_mrdpview->height windowID: window->windowId]; [newWindow setContentView:newView]; - // save new window + /* save new window */ MRDPWindow * mrdpWindow = [[MRDPWindow alloc] init]; [mrdpWindow setWindowID:window->windowId]; [mrdpWindow setWindow:newWindow]; [mrdpWindow setView:newView]; - // add to list of windows + /* add to list of windows */ [ma addObject:mrdpWindow]; - // make new window current + /* make new window current */ g_mrdpview->currentWindow = mrdpWindow; if (displayAsModal) { - // display as modal window + /* display as modal window */ NSModalSession session = [NSApp beginModalSessionForWindow:newWindow]; + while (1) { if ([NSApp runModalSession:session] != NSRunContinuesResponse) break; } + [NSApp endModalSession:session]; } - else { + else + { [newWindow makeKeyAndOrderFront:NSApp]; [[g_mrdpview window] resignFirstResponder]; [g_mrdpview resignFirstResponder]; @@ -1956,22 +1766,27 @@ void mac_rail_MoveWindow(rdpRail* rail, rdpWindow* window) void mac_rail_ShowWindow(rdpRail* rail, rdpWindow* window, BYTE state) { + } void mac_rail_SetWindowText(rdpRail* rail, rdpWindow* window) { + } void mac_rail_SetWindowIcon(rdpRail* rail, rdpWindow* window, rdpIcon* icon) { + } void mac_rail_SetWindowRects(rdpRail* rail, rdpWindow* window) { + } void mac_rail_SetWindowVisibilityRects(rdpRail* rail, rdpWindow* window) { + } /** ********************************************************************* @@ -2149,21 +1964,21 @@ void mac_process_rail_server_localmovesize_event(freerdp* instance, RDP_EVENT *e case RAIL_WMSZ_MOVE: if (moveSize->isMoveSizeStart) { - // local window move in progress + /* local window move in progress */ [g_mrdpview->currentWindow view]->isMoveSizeInProgress = YES; [g_mrdpview->currentWindow view]->saveInitialDragLoc = YES; return; } - // local move has completed + /* local move has completed */ [g_mrdpview->currentWindow view]->isMoveSizeInProgress = NO; [g_mrdpview->currentWindow view]->saveInitialDragLoc = NO; - // let RDP server know where this window is located + /* let RDP server know where this window is located */ mac_send_rail_client_event(instance->context->channels, RDP_EVENT_TYPE_RAIL_CLIENT_WINDOW_MOVE, &windowMove); - // the event we just sent will cause an extra MoveWindow() to be invoked which we need to ignore + /* the event we just sent will cause an extra MoveWindow() to be invoked which we need to ignore */ [g_mrdpview->currentWindow view]->skipMoveWindowOnce = YES; break; diff --git a/client/Mac/MainMenu.xib b/client/Mac/MainMenu.xib index bff95a9d5..e535cbe12 100755 --- a/client/Mac/MainMenu.xib +++ b/client/Mac/MainMenu.xib @@ -2,22 +2,22 @@ 1070 - 11D50b - 2177 - 1138.32 - 568.00 + 12C60 + 3084 + 1187.34 + 625.00 com.apple.InterfaceBuilder.CocoaPlugin - 2177 + 3084 - NSView - NSMenu - NSWindowTemplate - NSMenuItem - NSCustomView IBNSLayoutConstraint NSCustomObject + NSCustomView + NSMenu + NSMenuItem + NSView + NSWindowTemplate com.apple.InterfaceBuilder.CocoaPlugin @@ -264,6 +264,7 @@ {1024, 768} + _NS:9 MRDPView @@ -273,7 +274,7 @@ - {{0, 0}, {1366, 746}} + {{0, 0}, {1440, 878}} {1024, 790} {1024, 790} 128 @@ -563,10 +564,10 @@ 0.0 1000 + 8 29 3 - @@ -579,10 +580,10 @@ 0.0 1000 + 8 29 3 - @@ -595,10 +596,10 @@ 0.0 1000 + 8 29 3 - @@ -611,10 +612,10 @@ 0.0 1000 + 8 29 3 - @@ -769,14 +770,6 @@ ./Classes/MRDPView.h - - NSLayoutConstraint - NSObject - - IBProjectSource - ./Classes/NSLayoutConstraint.h - - 0 diff --git a/client/Mac/PasswordDialog.h b/client/Mac/PasswordDialog.h new file mode 100644 index 000000000..db294d667 --- /dev/null +++ b/client/Mac/PasswordDialog.h @@ -0,0 +1,26 @@ +// +// PasswordDialog.h +// FreeRDP +// +// Created by Christian Hofstaedtler on 3/10/13. +// +// + +#import + +@interface PasswordDialog : NSWindowController + +@property (retain) IBOutlet NSTextField* userNameText; +@property (retain) IBOutlet NSTextField* passwordText; +@property (retain) IBOutlet NSTextField* messageLabel; + +- (IBAction)onOK:(NSObject*)sender; +- (IBAction)onCancel:(NSObject*)sender; + +@property (retain) NSString* serverName; +@property (retain) NSString* userName; +@property (retain) NSString* password; + +- (BOOL) runModal; + +@end diff --git a/client/Mac/PasswordDialog.m b/client/Mac/PasswordDialog.m new file mode 100644 index 000000000..757ee0732 --- /dev/null +++ b/client/Mac/PasswordDialog.m @@ -0,0 +1,56 @@ +// +// PasswordDialog.m +// FreeRDP +// +// Created by Christian Hofstaedtler on 3/10/13. +// +// + +#import "PasswordDialog.h" + +@interface PasswordDialog () + +@end + +@implementation PasswordDialog + +@synthesize userNameText; +@synthesize passwordText; +@synthesize messageLabel; +@synthesize serverName; +@synthesize userName; +@synthesize password; + +- (id)init { + return [self initWithWindowNibName:@"PasswordDialog"]; +} + +- (void)windowDidLoad +{ + [super windowDidLoad]; + // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file. + [self.window setTitle:self.serverName]; + [messageLabel setStringValue:[NSString stringWithFormat:@"Authenticate to %@", self.serverName]]; + if (self.userName != nil) { + [userNameText setStringValue:self.userName]; + [self.window makeFirstResponder:passwordText]; + } +} + +- (IBAction)onOK:(NSObject *)sender { + self.userName = self.userNameText.stringValue; + self.password = self.passwordText.stringValue; + [self.window orderOut:nil]; + [NSApp stopModalWithCode:TRUE]; +} + +- (IBAction)onCancel:(NSObject *)sender { + [self.window orderOut:nil]; + [NSApp stopModalWithCode:FALSE]; +} + +- (BOOL) runModal { + return [NSApp runModalForWindow:self.window]; +} + +@end diff --git a/client/Mac/PasswordDialog.xib b/client/Mac/PasswordDialog.xib new file mode 100644 index 000000000..3e1e08673 --- /dev/null +++ b/client/Mac/PasswordDialog.xib @@ -0,0 +1,976 @@ + + + + 1080 + 12C60 + 3084 + 1187.34 + 625.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 3084 + + + IBNSLayoutConstraint + NSButton + NSButtonCell + NSCustomObject + NSSecureTextField + NSSecureTextFieldCell + NSTextField + NSTextFieldCell + NSView + NSWindowTemplate + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + PasswordDialog + + + FirstResponder + + + NSApplication + + + 257 + 2 + {{196, 240}, {480, 270}} + 544735232 + Window + NSWindow + + + + + 256 + + + + 268 + {{46, 127}, {108, 17}} + + + _NS:1535 + YES + + 68157504 + 272630784 + Password: + + LucidaGrande + 13 + 1044 + + _NS:1535 + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + NO + + + + 268 + {{159, 124}, {233, 22}} + + + _NS:9 + YES + + 342884416 + 272630848 + + + Password + _NS:9 + + YES + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + + + NSAllRomanInputSourcesLocaleIdentifier + + + NO + + + + 268 + {{46, 206}, {346, 17}} + + + _NS:1535 + YES + + 68157504 + 272630784 + Connect to SERVER_NAME + + + _NS:1535 + + + + + NO + + + + 268 + {{384, 13}, {82, 32}} + + + _NS:9 + YES + + 67108864 + 134217728 + Cancel + + _NS:9 + + -2038284288 + 129 + + Gw + 200 + 25 + + NO + + + + 268 + {{302, 13}, {82, 32}} + + + _NS:9 + YES + + 67108864 + 134217728 + OK + + _NS:9 + + -2038284288 + 129 + + + DQ + 200 + 25 + + NO + + + + 268 + {{46, 158}, {108, 17}} + + + _NS:1535 + YES + + 68157504 + 272630784 + Username: + + _NS:1535 + + + + + NO + + + + 268 + {{159, 156}, {233, 22}} + + + _NS:9 + YES + + -1804599231 + 272630784 + + + billg + _NS:9 + + YES + + + + NO + + + {480, 270} + + + + {{0, 0}, {1440, 878}} + {10000000000000, 10000000000000} + YES + + + + + + + window + + + + 3 + + + + passwordText + + + + 48 + + + + usernameText + + + + 49 + + + + messageLabel + + + + 50 + + + + onOK: + + + + 51 + + + + onCancel: + + + + 52 + + + + userNameText + + + + 53 + + + + delegate + + + + 4 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + + + + + + 2 + + + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 4 + 0 + + 4 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 6 + 1 + + 12 + + 1000 + + 6 + 24 + 3 + + + + 4 + 0 + + 4 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 3 + 0 + + 4 + 1 + + 10 + + 1000 + + 6 + 24 + 3 + + + + 6 + 0 + + 6 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 5 + 0 + + 5 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 10 + 0 + + 10 + 1 + + 0.0 + + 1000 + + 5 + 22 + 2 + + + + 10 + 0 + + 10 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 11 + 0 + + 11 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 5 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 5 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 3 + 0 + + 3 + 1 + + 47 + + 1000 + + 3 + 9 + 3 + + + + 5 + 0 + + 5 + 1 + + 49 + + 1000 + + 3 + 9 + 3 + + + + + + + + + + + + + 5 + + + + + + + + 6 + + + + + + + + 7 + + + + + 7 + 0 + + 0 + 1 + + 340 + + 1000 + + 3 + 9 + 1 + + + + + + + 8 + + + + + + + + 9 + + + + + 7 + 0 + + 0 + 1 + + 70 + + 1000 + + 3 + 9 + 1 + + + + + + + 10 + + + + + 7 + 0 + + 0 + 1 + + 102 + + 1000 + + 3 + 9 + 1 + + + + + + + 11 + + + + + 7 + 0 + + 0 + 1 + + 233 + + 1000 + + 3 + 9 + 1 + + + + + + + 12 + + + + + 13 + + + + + 14 + + + + + 15 + + + + + 16 + + + + + 17 + + + + + 18 + + + + + 19 + + + + + 20 + + + + + 21 + + + + + 22 + + + + + 25 + + + + + 27 + + + + + 28 + + + + + 30 + + + + + 31 + + + + + 32 + + + + + 34 + + + + + 37 + + + + + 39 + + + + + 41 + + + + + 42 + + + + + 43 + + + + + 44 + + + + + 45 + + + + + 46 + + + + + 47 + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{357, 418}, {480, 270}} + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + + + + + + + + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + 53 + + + 0 + IBCocoaFramework + YES + 3 + YES + + diff --git a/libfreerdp/locale/keyboard.c b/libfreerdp/locale/keyboard.c index e28ea5a5f..30c14a49a 100644 --- a/libfreerdp/locale/keyboard.c +++ b/libfreerdp/locale/keyboard.c @@ -47,7 +47,6 @@ DWORD X11_KEYCODE_TO_VIRTUAL_SCANCODE[256]; int freerdp_detect_keyboard(DWORD* keyboardLayoutId) { - #ifdef WITH_X11 if (*keyboardLayoutId == 0) freerdp_detect_keyboard_layout_from_xkb(keyboardLayoutId);