mirror of https://github.com/FreeRDP/FreeRDP
commit
3d92392699
|
@ -19,9 +19,6 @@ CPackSourceConfig.cmake
|
||||||
docs/api
|
docs/api
|
||||||
client/X11/xfreerdp.1
|
client/X11/xfreerdp.1
|
||||||
|
|
||||||
# Extensions
|
|
||||||
extensions/**
|
|
||||||
|
|
||||||
# Mac OS X
|
# Mac OS X
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
|
|
@ -95,6 +95,12 @@ if(MSVC)
|
||||||
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
|
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# config.h definition for installable headers
|
||||||
|
check_include_files(limits.h FREERDP_HAVE_LIMITS_H)
|
||||||
|
check_include_files(stdint.h FREERDP_HAVE_STDINT_H)
|
||||||
|
check_include_files(stdbool.h FREERDP_HAVE_STDBOOL_H)
|
||||||
|
check_include_files(inttypes.h FREERDP_HAVE_INTTYPES_H)
|
||||||
|
|
||||||
# Include files
|
# Include files
|
||||||
check_include_files(fcntl.h HAVE_FCNTL_H)
|
check_include_files(fcntl.h HAVE_FCNTL_H)
|
||||||
check_include_files(unistd.h HAVE_UNISTD_H)
|
check_include_files(unistd.h HAVE_UNISTD_H)
|
||||||
|
@ -117,7 +123,6 @@ if(APPLE)
|
||||||
link_directories(/opt/local/lib)
|
link_directories(/opt/local/lib)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(WITH_CLANG "Build using clang" OFF)
|
|
||||||
if(WITH_CLANG)
|
if(WITH_CLANG)
|
||||||
set(CMAKE_C_COMPILER "clang")
|
set(CMAKE_C_COMPILER "clang")
|
||||||
endif()
|
endif()
|
||||||
|
@ -159,6 +164,7 @@ include_directories(${CMAKE_SOURCE_DIR}/include)
|
||||||
|
|
||||||
# Configure files
|
# Configure files
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||||
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/freerdp/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/freerdp/config.h)
|
||||||
|
|
||||||
# Generate pkg-config
|
# Generate pkg-config
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
|
@ -169,8 +175,8 @@ endif()
|
||||||
# Build CUnit
|
# Build CUnit
|
||||||
find_optional_package(CUnit)
|
find_optional_package(CUnit)
|
||||||
if(WITH_CUNIT)
|
if(WITH_CUNIT)
|
||||||
enable_testing()
|
enable_testing()
|
||||||
add_subdirectory(cunit)
|
add_subdirectory(cunit)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Sub-directories
|
# Sub-directories
|
||||||
|
@ -188,25 +194,24 @@ add_subdirectory(libfreerdp-channels)
|
||||||
add_subdirectory(libfreerdp-locale)
|
add_subdirectory(libfreerdp-locale)
|
||||||
add_subdirectory(libfreerdp-core)
|
add_subdirectory(libfreerdp-core)
|
||||||
|
|
||||||
add_subdirectory(channels)
|
if(WITH_CHANNELS)
|
||||||
|
add_subdirectory(channels)
|
||||||
|
endif()
|
||||||
|
|
||||||
option(WITH_CLIENT "Build client binaries" ON)
|
|
||||||
if(WITH_CLIENT)
|
if(WITH_CLIENT)
|
||||||
add_subdirectory(client)
|
add_subdirectory(client)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(WITH_SERVER "Build server binaries" OFF)
|
|
||||||
if(WITH_SERVER)
|
if(WITH_SERVER)
|
||||||
add_subdirectory(server)
|
add_subdirectory(server)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT MSVC)
|
if(WITH_THIRD_PARTY)
|
||||||
add_subdirectory(keymaps)
|
add_subdirectory(third-party)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(WITH_EXTENSIONS "Build extensions" ON)
|
if(NOT MSVC)
|
||||||
if(WITH_EXTENSIONS)
|
add_subdirectory(keymaps)
|
||||||
add_subdirectory(extensions)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Source package
|
# Source package
|
||||||
|
|
|
@ -33,8 +33,6 @@
|
||||||
|
|
||||||
#include "rdpsnd_main.h"
|
#include "rdpsnd_main.h"
|
||||||
|
|
||||||
#define GOT_HERE printf(">>>>> got here: %s %s %d\n", __FILE__, __func__, __LINE__)
|
|
||||||
|
|
||||||
#define AQ_NUM_BUFFERS 10
|
#define AQ_NUM_BUFFERS 10
|
||||||
#define AQ_BUF_SIZE (32 * 1024)
|
#define AQ_BUF_SIZE (32 * 1024)
|
||||||
|
|
||||||
|
@ -63,8 +61,6 @@ static void rdpsnd_audio_close(rdpsndDevicePlugin* device)
|
||||||
{
|
{
|
||||||
rdpsndAudioQPlugin* aq_plugin_p = (rdpsndAudioQPlugin*) device;
|
rdpsndAudioQPlugin* aq_plugin_p = (rdpsndAudioQPlugin*) device;
|
||||||
|
|
||||||
GOT_HERE;
|
|
||||||
|
|
||||||
AudioQueueStop(aq_plugin_p->aq_ref, 0);
|
AudioQueueStop(aq_plugin_p->aq_ref, 0);
|
||||||
aq_plugin_p->is_open = 0;
|
aq_plugin_p->is_open = 0;
|
||||||
}
|
}
|
||||||
|
@ -74,8 +70,6 @@ static void rdpsnd_audio_open(rdpsndDevicePlugin* device, rdpsndFormat* format,
|
||||||
int rv;
|
int rv;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
GOT_HERE;
|
|
||||||
|
|
||||||
rdpsndAudioQPlugin* aq_plugin_p = (rdpsndAudioQPlugin *) device;
|
rdpsndAudioQPlugin* aq_plugin_p = (rdpsndAudioQPlugin *) device;
|
||||||
if (aq_plugin_p->is_open) {
|
if (aq_plugin_p->is_open) {
|
||||||
return;
|
return;
|
||||||
|
@ -123,13 +117,10 @@ static void rdpsnd_audio_open(rdpsndDevicePlugin* device, rdpsndFormat* format,
|
||||||
|
|
||||||
static void rdpsnd_audio_free(rdpsndDevicePlugin* device)
|
static void rdpsnd_audio_free(rdpsndDevicePlugin* device)
|
||||||
{
|
{
|
||||||
GOT_HERE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean rdpsnd_audio_format_supported(rdpsndDevicePlugin* device, rdpsndFormat* format)
|
static boolean rdpsnd_audio_format_supported(rdpsndDevicePlugin* device, rdpsndFormat* format)
|
||||||
{
|
{
|
||||||
GOT_HERE;
|
|
||||||
|
|
||||||
switch (format->wFormatTag)
|
switch (format->wFormatTag)
|
||||||
{
|
{
|
||||||
case 1: /* PCM */
|
case 1: /* PCM */
|
||||||
|
@ -147,12 +138,10 @@ static boolean rdpsnd_audio_format_supported(rdpsndDevicePlugin* device, rdpsndF
|
||||||
|
|
||||||
static void rdpsnd_audio_set_format(rdpsndDevicePlugin* device, rdpsndFormat* format, int latency)
|
static void rdpsnd_audio_set_format(rdpsndDevicePlugin* device, rdpsndFormat* format, int latency)
|
||||||
{
|
{
|
||||||
GOT_HERE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rdpsnd_audio_set_volume(rdpsndDevicePlugin* device, uint32 value)
|
static void rdpsnd_audio_set_volume(rdpsndDevicePlugin* device, uint32 value)
|
||||||
{
|
{
|
||||||
GOT_HERE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rdpsnd_audio_play(rdpsndDevicePlugin* device, uint8* data, int size)
|
static void rdpsnd_audio_play(rdpsndDevicePlugin* device, uint8* data, int size)
|
||||||
|
@ -161,8 +150,6 @@ static void rdpsnd_audio_play(rdpsndDevicePlugin* device, uint8* data, int size)
|
||||||
AudioQueueBufferRef aq_buf_ref;
|
AudioQueueBufferRef aq_buf_ref;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
GOT_HERE;
|
|
||||||
|
|
||||||
if (!aq_plugin_p->is_open) {
|
if (!aq_plugin_p->is_open) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -188,8 +175,6 @@ static void rdpsnd_audio_play(rdpsndDevicePlugin* device, uint8* data, int size)
|
||||||
|
|
||||||
static void rdpsnd_audio_start(rdpsndDevicePlugin* device)
|
static void rdpsnd_audio_start(rdpsndDevicePlugin* device)
|
||||||
{
|
{
|
||||||
GOT_HERE;
|
|
||||||
|
|
||||||
rdpsndAudioQPlugin* aq_plugin_p = (rdpsndAudioQPlugin *) device;
|
rdpsndAudioQPlugin* aq_plugin_p = (rdpsndAudioQPlugin *) device;
|
||||||
|
|
||||||
AudioQueueStart(aq_plugin_p->aq_ref, NULL);
|
AudioQueueStart(aq_plugin_p->aq_ref, NULL);
|
||||||
|
@ -206,7 +191,6 @@ static void aq_playback_cb(void *user_data,
|
||||||
AudioQueueBufferRef aq_buf_ref
|
AudioQueueBufferRef aq_buf_ref
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
GOT_HERE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int FreeRDPRdpsndDeviceEntry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints)
|
int FreeRDPRdpsndDeviceEntry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints)
|
||||||
|
@ -214,8 +198,6 @@ int FreeRDPRdpsndDeviceEntry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints)
|
||||||
rdpsndAudioQPlugin* aqPlugin;
|
rdpsndAudioQPlugin* aqPlugin;
|
||||||
RDP_PLUGIN_DATA* data;
|
RDP_PLUGIN_DATA* data;
|
||||||
|
|
||||||
GOT_HERE;
|
|
||||||
|
|
||||||
aqPlugin = xnew(rdpsndAudioQPlugin);
|
aqPlugin = xnew(rdpsndAudioQPlugin);
|
||||||
|
|
||||||
aqPlugin->device.Open = rdpsnd_audio_open;
|
aqPlugin->device.Open = rdpsnd_audio_open;
|
||||||
|
|
|
@ -87,23 +87,19 @@ if(APPLE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# OS X Interface Builder files
|
# OS X Interface Builder files
|
||||||
set (MacFreeRDP_XIBS
|
file (GLOB MacFreeRDP_XIBS
|
||||||
MainMenu.xib
|
*.xib
|
||||||
Credits.rtf
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Headers
|
# Headers
|
||||||
set (MacFreeRDP_Headers
|
file (GLOB MacFreeRDP_Headers
|
||||||
MRDPCursor.h
|
*.h
|
||||||
MRDPView.h
|
)
|
||||||
AppDelegate.h)
|
|
||||||
|
|
||||||
# Source
|
# Source
|
||||||
set (MacFreeRDP_Source
|
file (GLOB MacFreeRDP_Source
|
||||||
MRDPCursor.m
|
*.m
|
||||||
MRDPView.m
|
)
|
||||||
AppDelegate.m
|
|
||||||
main.m)
|
|
||||||
|
|
||||||
add_executable(MacFreeRDP
|
add_executable(MacFreeRDP
|
||||||
${APP_TYPE}
|
${APP_TYPE}
|
||||||
|
@ -147,3 +143,4 @@ target_link_libraries(MacFreeRDP ${CMAKE_SOURCE_DIR}/../../xcode/libfreerdp-cach
|
||||||
target_link_libraries(MacFreeRDP ${CMAKE_SOURCE_DIR}/../../xcode/libfreerdp-gdi/Debug/libfreerdp-gdi.dylib)
|
target_link_libraries(MacFreeRDP ${CMAKE_SOURCE_DIR}/../../xcode/libfreerdp-gdi/Debug/libfreerdp-gdi.dylib)
|
||||||
target_link_libraries(MacFreeRDP ${CMAKE_SOURCE_DIR}/../../xcode/libfreerdp-utils/Debug/libfreerdp-utils.dylib)
|
target_link_libraries(MacFreeRDP ${CMAKE_SOURCE_DIR}/../../xcode/libfreerdp-utils/Debug/libfreerdp-utils.dylib)
|
||||||
target_link_libraries(MacFreeRDP ${CMAKE_SOURCE_DIR}/../../xcode/libfreerdp-codec/Debug/libfreerdp-codec.dylib)
|
target_link_libraries(MacFreeRDP ${CMAKE_SOURCE_DIR}/../../xcode/libfreerdp-codec/Debug/libfreerdp-codec.dylib)
|
||||||
|
target_link_libraries(MacFreeRDP ${CMAKE_SOURCE_DIR}/../../xcode/libfreerdp-rail/Debug/libfreerdp-rail.dylib)
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#import "freerdp/gdi/gdi.h"
|
#import "freerdp/gdi/gdi.h"
|
||||||
#import "freerdp/rail/rail.h"
|
#import "freerdp/rail/rail.h"
|
||||||
|
#import "MRDPRailWindow.h"
|
||||||
|
|
||||||
@interface MRDPRailView : NSView
|
@interface MRDPRailView : NSView
|
||||||
{
|
{
|
||||||
|
@ -14,9 +15,11 @@
|
||||||
char * pixelData;
|
char * pixelData;
|
||||||
boolean mouseInClientArea;
|
boolean mouseInClientArea;
|
||||||
boolean titleBarClicked;
|
boolean titleBarClicked;
|
||||||
|
boolean gestureEventInProgress;
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
int savedWindowId;
|
int savedWindowId;
|
||||||
|
int scrollWheelCount;
|
||||||
|
|
||||||
// store state info for some keys
|
// store state info for some keys
|
||||||
int kdlshift;
|
int kdlshift;
|
||||||
|
@ -36,16 +39,23 @@
|
||||||
int localMoveType;
|
int localMoveType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@property (assign) MRDPRailWindow * mrdpRailWindow;
|
||||||
|
@property (assign) int windowIndex;
|
||||||
|
@property (assign) boolean activateWindow;
|
||||||
|
|
||||||
|
- (void) windowDidMove:(NSNotification *) notification;
|
||||||
- (void) updateDisplay;
|
- (void) updateDisplay;
|
||||||
- (void) setRdpInstance:(freerdp *) instance width:(int) w andHeight:(int) h windowID:(int) windowID;
|
- (void) setRdpInstance:(freerdp *) instance width:(int) w andHeight:(int) h windowID:(int) windowID;
|
||||||
- (BOOL) eventIsInClientArea :(NSEvent *) event :(int *) xptr :(int *) yptr;
|
- (BOOL) eventIsInClientArea :(NSEvent *) event :(int *) xptr :(int *) yptr;
|
||||||
- (void) setupBmiRep:(int) width :(int) height;
|
- (void) setupBmiRep:(int) width :(int) height;
|
||||||
|
- (void) releaseResources;
|
||||||
|
|
||||||
void mac_rail_MoveWindow(rdpRail *rail, rdpWindow *window);
|
void mac_rail_MoveWindow(rdpRail *rail, rdpWindow *window);
|
||||||
void apple_to_windowMove(NSRect * r, RAIL_WINDOW_MOVE_ORDER * windowMove);
|
void apple_to_windowMove(NSRect * r, RAIL_WINDOW_MOVE_ORDER * windowMove);
|
||||||
void mac_send_rail_client_event(rdpChannels *channels, uint16 event_type, void *param);
|
void mac_send_rail_client_event(rdpChannels *channels, uint16 event_type, void *param);
|
||||||
void windows_to_apple_cords(NSRect * r);
|
void windows_to_apple_cords(NSRect * r);
|
||||||
void rail_MoveWindow(rdpRail * rail, rdpWindow * window);
|
void rail_MoveWindow(rdpRail * rail, rdpWindow * window);
|
||||||
|
void mac_rail_send_activate(int window_id);
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
@implementation MRDPRailView
|
@implementation MRDPRailView
|
||||||
|
|
||||||
|
@synthesize mrdpRailWindow, windowIndex, activateWindow;
|
||||||
|
|
||||||
MRDPRailView * g_mrdpRailView;
|
MRDPRailView * g_mrdpRailView;
|
||||||
|
|
||||||
struct kkey
|
struct kkey
|
||||||
|
@ -19,20 +21,20 @@ extern struct kkey g_keys[];
|
||||||
boolean moveWindow = NO;
|
boolean moveWindow = NO;
|
||||||
NSRect srcRectOuter;
|
NSRect srcRectOuter;
|
||||||
NSRect destRectOuter;
|
NSRect destRectOuter;
|
||||||
|
|
||||||
rdpGdi * gdi;
|
rdpGdi * gdi;
|
||||||
|
|
||||||
if ((context == 0) || (context->gdi == 0))
|
if ((context == 0) || (context->gdi == 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (context->gdi->primary->hdc->hwnd->invalid->null)
|
if (context->gdi->primary->hdc->hwnd->invalid->null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (context->gdi->drawing != context->gdi->primary)
|
if (context->gdi->drawing != context->gdi->primary)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gdi = context->gdi;
|
gdi = context->gdi;
|
||||||
|
|
||||||
srcRectOuter = NSMakeRect(0, 0, self->width, self->height);
|
srcRectOuter = NSMakeRect(0, 0, self->width, self->height);
|
||||||
destRectOuter = [[self window] frame];
|
destRectOuter = [[self window] frame];
|
||||||
|
|
||||||
|
@ -42,15 +44,15 @@ extern struct kkey g_keys[];
|
||||||
destRectOuter.size.width = screenSize.size.width;
|
destRectOuter.size.width = screenSize.size.width;
|
||||||
moveWindow = YES;
|
moveWindow = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (destRectOuter.size.height > screenSize.size.height) {
|
if (destRectOuter.size.height > screenSize.size.height) {
|
||||||
destRectOuter.size.height = screenSize.size.height;
|
destRectOuter.size.height = screenSize.size.height;
|
||||||
moveWindow = YES;
|
moveWindow = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (destRectOuter.origin.x + destRectOuter.size.width > width)
|
if (destRectOuter.origin.x + destRectOuter.size.width > width)
|
||||||
destRectOuter.size.width = width - destRectOuter.origin.x;
|
destRectOuter.size.width = width - destRectOuter.origin.x;
|
||||||
|
|
||||||
[self setupBmiRep:destRectOuter.size.width :destRectOuter.size.height];
|
[self setupBmiRep:destRectOuter.size.width :destRectOuter.size.height];
|
||||||
|
|
||||||
if (moveWindow) {
|
if (moveWindow) {
|
||||||
|
@ -61,12 +63,12 @@ extern struct kkey g_keys[];
|
||||||
//skipMoveWindowOnce = TRUE;
|
//skipMoveWindowOnce = TRUE;
|
||||||
//mac_send_rail_client_event(g_mrdpRailView->rdp_instance->context->channels, RDP_EVENT_TYPE_RAIL_CLIENT_WINDOW_MOVE, &newWndLoc);
|
//mac_send_rail_client_event(g_mrdpRailView->rdp_instance->context->channels, RDP_EVENT_TYPE_RAIL_CLIENT_WINDOW_MOVE, &newWndLoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
destRectOuter.origin.y = height - destRectOuter.origin.y - destRectOuter.size.height;
|
destRectOuter.origin.y = height - destRectOuter.origin.y - destRectOuter.size.height;
|
||||||
rail_convert_color_space(pixelData, (char *) gdi->primary_buffer,
|
rail_convert_color_space(pixelData, (char *) gdi->primary_buffer,
|
||||||
&destRectOuter, self->width, self->height);
|
&destRectOuter, self->width, self->height);
|
||||||
|
|
||||||
if (moveWindow)
|
if (moveWindow)
|
||||||
[self setNeedsDisplayInRect:destRectOuter];
|
[self setNeedsDisplayInRect:destRectOuter];
|
||||||
else
|
else
|
||||||
[self setNeedsDisplayInRect:[self frame]];
|
[self setNeedsDisplayInRect:[self frame]];
|
||||||
|
@ -81,7 +83,7 @@ extern struct kkey g_keys[];
|
||||||
- (void) drawRect:(NSRect)dirtyRect
|
- (void) drawRect:(NSRect)dirtyRect
|
||||||
{
|
{
|
||||||
[bmiRep drawInRect:dirtyRect fromRect:dirtyRect operation:NSCompositeCopy fraction:1.0 respectFlipped:NO hints:nil];
|
[bmiRep drawInRect:dirtyRect fromRect:dirtyRect operation:NSCompositeCopy fraction:1.0 respectFlipped:NO hints:nil];
|
||||||
|
|
||||||
if (pixelData) {
|
if (pixelData) {
|
||||||
free(pixelData);
|
free(pixelData);
|
||||||
pixelData = NULL;
|
pixelData = NULL;
|
||||||
|
@ -93,19 +95,24 @@ extern struct kkey g_keys[];
|
||||||
* become first responder so we can get keyboard and mouse events
|
* become first responder so we can get keyboard and mouse events
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
- (BOOL)acceptsFirstResponder
|
- (BOOL)acceptsFirstResponder
|
||||||
|
{
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent
|
||||||
{
|
{
|
||||||
return YES;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** *********************************************************************
|
/** *********************************************************************
|
||||||
* called when a mouse move event occurrs
|
* called when a mouse move event occurrs
|
||||||
*
|
*
|
||||||
* ideally we want to be called when the mouse moves over NSView client area,
|
* ideally we want to be called when the mouse moves over NSView client area,
|
||||||
* but in reality we get called any time the mouse moves anywhere on the screen;
|
* but in reality we get called any time the mouse moves anywhere on the screen;
|
||||||
* we could use NSTrackingArea class to handle this but this class is available
|
* we could use NSTrackingArea class to handle this but this class is available
|
||||||
* on Mac OS X v10.5 and higher; since we want to be compatible with older
|
* on Mac OS X v10.5 and higher; since we want to be compatible with older
|
||||||
* versions, we do this manually.
|
* versions, we do this manually.
|
||||||
*
|
*
|
||||||
* TODO: here is how it can be done using legacy methods
|
* TODO: here is how it can be done using legacy methods
|
||||||
* http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/EventOverview/MouseTrackingEvents/MouseTrackingEvents.html#//apple_ref/doc/uid/10000060i-CH11-SW1
|
* http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/EventOverview/MouseTrackingEvents/MouseTrackingEvents.html#//apple_ref/doc/uid/10000060i-CH11-SW1
|
||||||
|
@ -114,15 +121,15 @@ extern struct kkey g_keys[];
|
||||||
- (void) mouseMoved:(NSEvent *)event
|
- (void) mouseMoved:(NSEvent *)event
|
||||||
{
|
{
|
||||||
[super mouseMoved:event];
|
[super mouseMoved:event];
|
||||||
|
|
||||||
NSRect winFrame = [[self window] frame];
|
NSRect winFrame = [[self window] frame];
|
||||||
NSPoint loc = [event locationInWindow];
|
NSPoint loc = [event locationInWindow];
|
||||||
|
|
||||||
int x = (int) (winFrame.origin.x + loc.x);
|
int x = (int) (winFrame.origin.x + loc.x);
|
||||||
int y = (int) (winFrame.origin.y + loc.y);
|
int y = (int) (winFrame.origin.y + loc.y);
|
||||||
|
|
||||||
y = height - y;
|
y = height - y;
|
||||||
|
|
||||||
// send mouse motion event to RDP server
|
// send mouse motion event to RDP server
|
||||||
rdp_instance->input->MouseEvent(rdp_instance->input, PTR_FLAGS_MOVE, x, y);
|
rdp_instance->input->MouseEvent(rdp_instance->input, PTR_FLAGS_MOVE, x, y);
|
||||||
}
|
}
|
||||||
|
@ -134,7 +141,7 @@ extern struct kkey g_keys[];
|
||||||
- (void)mouseDown:(NSEvent *) event
|
- (void)mouseDown:(NSEvent *) event
|
||||||
{
|
{
|
||||||
[super mouseDown:event];
|
[super mouseDown:event];
|
||||||
|
|
||||||
NSRect winFrame = [[self window] frame];
|
NSRect winFrame = [[self window] frame];
|
||||||
NSPoint loc = [event locationInWindow];
|
NSPoint loc = [event locationInWindow];
|
||||||
int x = (int) (winFrame.origin.x + loc.x);
|
int x = (int) (winFrame.origin.x + loc.x);
|
||||||
|
@ -146,12 +153,12 @@ extern struct kkey g_keys[];
|
||||||
|
|
||||||
if ((yPos >= 4) && (yPos <= 20))
|
if ((yPos >= 4) && (yPos <= 20))
|
||||||
titleBarClicked = YES;
|
titleBarClicked = YES;
|
||||||
else
|
else
|
||||||
titleBarClicked = NO;
|
titleBarClicked = NO;
|
||||||
|
|
||||||
savedDragLocation.x = loc.x;
|
savedDragLocation.x = loc.x;
|
||||||
savedDragLocation.y = loc.y;
|
savedDragLocation.y = loc.y;
|
||||||
|
|
||||||
rdp_instance->input->MouseEvent(rdp_instance->input, PTR_FLAGS_DOWN | PTR_FLAGS_BUTTON1, x, y);
|
rdp_instance->input->MouseEvent(rdp_instance->input, PTR_FLAGS_DOWN | PTR_FLAGS_BUTTON1, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,7 +175,7 @@ extern struct kkey g_keys[];
|
||||||
int x = (int) (winFrame.origin.x + loc.x);
|
int x = (int) (winFrame.origin.x + loc.x);
|
||||||
int y = (int) (winFrame.origin.y + loc.y);
|
int y = (int) (winFrame.origin.y + loc.y);
|
||||||
y = height - y;
|
y = height - y;
|
||||||
|
|
||||||
rdp_instance->input->MouseEvent(rdp_instance->input, PTR_FLAGS_BUTTON1, x, y);
|
rdp_instance->input->MouseEvent(rdp_instance->input, PTR_FLAGS_BUTTON1, x, y);
|
||||||
titleBarClicked = NO;
|
titleBarClicked = NO;
|
||||||
}
|
}
|
||||||
|
@ -203,7 +210,7 @@ extern struct kkey g_keys[];
|
||||||
int x = (int) (winFrame.origin.x + loc.x);
|
int x = (int) (winFrame.origin.x + loc.x);
|
||||||
int y = (int) (winFrame.origin.y + loc.y);
|
int y = (int) (winFrame.origin.y + loc.y);
|
||||||
y = height - y;
|
y = height - y;
|
||||||
|
|
||||||
rdp_instance->input->MouseEvent(rdp_instance->input, PTR_FLAGS_BUTTON2, x, y);
|
rdp_instance->input->MouseEvent(rdp_instance->input, PTR_FLAGS_BUTTON2, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,33 +244,33 @@ extern struct kkey g_keys[];
|
||||||
int x = (int) (winFrame.origin.x + loc.x);
|
int x = (int) (winFrame.origin.x + loc.x);
|
||||||
int y = (int) (winFrame.origin.y + loc.y);
|
int y = (int) (winFrame.origin.y + loc.y);
|
||||||
y = height - y;
|
y = height - y;
|
||||||
|
|
||||||
rdp_instance->input->MouseEvent(rdp_instance->input, PTR_FLAGS_BUTTON3, x, y);
|
rdp_instance->input->MouseEvent(rdp_instance->input, PTR_FLAGS_BUTTON3, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) scrollWheel:(NSEvent *)event
|
- (void) scrollWheel:(NSEvent *)event
|
||||||
{
|
{
|
||||||
uint16 flags;
|
uint16 flags;
|
||||||
|
|
||||||
[super scrollWheel:event];
|
[super scrollWheel:event];
|
||||||
|
|
||||||
NSRect winFrame = [[self window] frame];
|
// we get more two finger trackpad scroll events
|
||||||
NSPoint loc = [event locationInWindow];
|
// than scrollWheel events, so we drop some
|
||||||
int x = (int) (winFrame.origin.x + loc.x);
|
|
||||||
int y = (int) (winFrame.origin.y + loc.y);
|
if (gestureEventInProgress) {
|
||||||
y = height - y;
|
scrollWheelCount++;
|
||||||
|
if (scrollWheelCount % 8 != 0)
|
||||||
flags = PTR_FLAGS_WHEEL;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ([event scrollingDeltaY] < 0) {
|
if ([event scrollingDeltaY] < 0) {
|
||||||
flags |= PTR_FLAGS_WHEEL_NEGATIVE | 0x0088;
|
flags = PTR_FLAGS_WHEEL | PTR_FLAGS_WHEEL_NEGATIVE | 0x0088;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
flags |= 0x0078;
|
flags = PTR_FLAGS_WHEEL | 0x78;
|
||||||
}
|
}
|
||||||
x += (int) [event scrollingDeltaX];
|
|
||||||
y += (int) [event scrollingDeltaY];
|
rdp_instance->input->MouseEvent(rdp_instance->input, flags, 0, 0);
|
||||||
|
|
||||||
rdp_instance->input->MouseEvent(rdp_instance->input, flags, x, y);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** *********************************************************************
|
/** *********************************************************************
|
||||||
|
@ -273,7 +280,7 @@ extern struct kkey g_keys[];
|
||||||
- (void) mouseDragged:(NSEvent *)event
|
- (void) mouseDragged:(NSEvent *)event
|
||||||
{
|
{
|
||||||
[super mouseDragged:event];
|
[super mouseDragged:event];
|
||||||
|
|
||||||
NSRect winFrame = [[self window] frame];
|
NSRect winFrame = [[self window] frame];
|
||||||
NSPoint loc = [event locationInWindow];
|
NSPoint loc = [event locationInWindow];
|
||||||
int x = (int) loc.x;
|
int x = (int) loc.x;
|
||||||
|
@ -283,13 +290,13 @@ extern struct kkey g_keys[];
|
||||||
// window is being dragged to a new location
|
// window is being dragged to a new location
|
||||||
int newX = x - savedDragLocation.x;
|
int newX = x - savedDragLocation.x;
|
||||||
int newY = y - savedDragLocation.y;
|
int newY = y - savedDragLocation.y;
|
||||||
|
|
||||||
if ((newX == 0) && (newY == 0))
|
if ((newX == 0) && (newY == 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
winFrame.origin.x += newX;
|
winFrame.origin.x += newX;
|
||||||
winFrame.origin.y += newY;
|
winFrame.origin.y += newY;
|
||||||
|
|
||||||
[[self window] setFrame:winFrame display:YES];
|
[[self window] setFrame:winFrame display:YES];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -299,7 +306,7 @@ extern struct kkey g_keys[];
|
||||||
int diff = (int) (loc.x - savedDragLocation.x);
|
int diff = (int) (loc.x - savedDragLocation.x);
|
||||||
if (diff == 0)
|
if (diff == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (diff < 0) {
|
if (diff < 0) {
|
||||||
diff = abs(diff);
|
diff = abs(diff);
|
||||||
winFrame.origin.x -= diff;
|
winFrame.origin.x -= diff;
|
||||||
|
@ -309,7 +316,7 @@ extern struct kkey g_keys[];
|
||||||
winFrame.origin.x += diff;
|
winFrame.origin.x += diff;
|
||||||
winFrame.size.width -= diff;
|
winFrame.size.width -= diff;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[self window] setFrame:winFrame display:YES];
|
[[self window] setFrame:winFrame display:YES];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -319,10 +326,10 @@ extern struct kkey g_keys[];
|
||||||
int diff = (int) (loc.x - savedDragLocation.x);
|
int diff = (int) (loc.x - savedDragLocation.x);
|
||||||
if (diff == 0)
|
if (diff == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
savedDragLocation.x = loc.x;
|
savedDragLocation.x = loc.x;
|
||||||
savedDragLocation.y = loc.y;
|
savedDragLocation.y = loc.y;
|
||||||
|
|
||||||
winFrame.size.width += diff;
|
winFrame.size.width += diff;
|
||||||
[[self window] setFrame:winFrame display:YES];
|
[[self window] setFrame:winFrame display:YES];
|
||||||
return;
|
return;
|
||||||
|
@ -333,21 +340,21 @@ extern struct kkey g_keys[];
|
||||||
int diff = (int) (loc.y - savedDragLocation.y);
|
int diff = (int) (loc.y - savedDragLocation.y);
|
||||||
if (diff == 0)
|
if (diff == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
savedDragLocation.x = loc.x;
|
savedDragLocation.x = loc.x;
|
||||||
savedDragLocation.y = loc.y;
|
savedDragLocation.y = loc.y;
|
||||||
|
|
||||||
winFrame.size.height += diff;
|
winFrame.size.height += diff;
|
||||||
[[self window] setFrame:winFrame display:YES];
|
[[self window] setFrame:winFrame display:YES];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (localMoveType == RAIL_WMSZ_BOTTOM) {
|
if (localMoveType == RAIL_WMSZ_BOTTOM) {
|
||||||
// bottom border resize taking place
|
// bottom border resize taking place
|
||||||
int diff = (int) (loc.y - savedDragLocation.y);
|
int diff = (int) (loc.y - savedDragLocation.y);
|
||||||
if (diff == 0)
|
if (diff == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (diff < 0) {
|
if (diff < 0) {
|
||||||
diff = abs(diff);
|
diff = abs(diff);
|
||||||
winFrame.origin.y -= diff;
|
winFrame.origin.y -= diff;
|
||||||
|
@ -357,11 +364,11 @@ extern struct kkey g_keys[];
|
||||||
winFrame.origin.y += diff;
|
winFrame.origin.y += diff;
|
||||||
winFrame.size.height -= diff;
|
winFrame.size.height -= diff;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[self window] setFrame:winFrame display:YES];
|
[[self window] setFrame:winFrame display:YES];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (localMoveType == RAIL_WMSZ_TOPLEFT) {
|
if (localMoveType == RAIL_WMSZ_TOPLEFT) {
|
||||||
// top left border resize taking place
|
// top left border resize taking place
|
||||||
int diff = (int) (loc.x - savedDragLocation.x);
|
int diff = (int) (loc.x - savedDragLocation.x);
|
||||||
|
@ -382,7 +389,7 @@ extern struct kkey g_keys[];
|
||||||
savedDragLocation.y = loc.y;
|
savedDragLocation.y = loc.y;
|
||||||
winFrame.size.height += diff;
|
winFrame.size.height += diff;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[self window] setFrame:winFrame display:YES];
|
[[self window] setFrame:winFrame display:YES];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -393,7 +400,7 @@ extern struct kkey g_keys[];
|
||||||
if (diff != 0) {
|
if (diff != 0) {
|
||||||
winFrame.size.width += diff;
|
winFrame.size.width += diff;
|
||||||
}
|
}
|
||||||
|
|
||||||
diff = (int) (loc.y - savedDragLocation.y);
|
diff = (int) (loc.y - savedDragLocation.y);
|
||||||
if (diff != 0) {
|
if (diff != 0) {
|
||||||
winFrame.size.height += diff;
|
winFrame.size.height += diff;
|
||||||
|
@ -405,7 +412,7 @@ extern struct kkey g_keys[];
|
||||||
[[self window] setFrame:winFrame display:YES];
|
[[self window] setFrame:winFrame display:YES];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (localMoveType == RAIL_WMSZ_BOTTOMLEFT) {
|
if (localMoveType == RAIL_WMSZ_BOTTOMLEFT) {
|
||||||
// bottom left border resize taking place
|
// bottom left border resize taking place
|
||||||
int diff = (int) (loc.x - savedDragLocation.x);
|
int diff = (int) (loc.x - savedDragLocation.x);
|
||||||
|
@ -420,7 +427,7 @@ extern struct kkey g_keys[];
|
||||||
winFrame.size.width -= diff;
|
winFrame.size.width -= diff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
diff = (int) (loc.y - savedDragLocation.y);
|
diff = (int) (loc.y - savedDragLocation.y);
|
||||||
if (diff != 0) {
|
if (diff != 0) {
|
||||||
if (diff < 0) {
|
if (diff < 0) {
|
||||||
|
@ -433,11 +440,11 @@ extern struct kkey g_keys[];
|
||||||
winFrame.size.height -= diff;
|
winFrame.size.height -= diff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[[self window] setFrame:winFrame display:YES];
|
[[self window] setFrame:winFrame display:YES];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (localMoveType == RAIL_WMSZ_BOTTOMRIGHT) {
|
if (localMoveType == RAIL_WMSZ_BOTTOMRIGHT) {
|
||||||
// bottom right border resize taking place
|
// bottom right border resize taking place
|
||||||
int diff = (int) (loc.x - savedDragLocation.x);
|
int diff = (int) (loc.x - savedDragLocation.x);
|
||||||
|
@ -446,7 +453,7 @@ extern struct kkey g_keys[];
|
||||||
//savedDragLocation.y = loc.y;
|
//savedDragLocation.y = loc.y;
|
||||||
winFrame.size.width += diff;
|
winFrame.size.width += diff;
|
||||||
}
|
}
|
||||||
|
|
||||||
diff = (int) (loc.y - savedDragLocation.y);
|
diff = (int) (loc.y - savedDragLocation.y);
|
||||||
if (diff != 0) {
|
if (diff != 0) {
|
||||||
if (diff < 0) {
|
if (diff < 0) {
|
||||||
|
@ -459,15 +466,15 @@ extern struct kkey g_keys[];
|
||||||
winFrame.size.height -= diff;
|
winFrame.size.height -= diff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[[self window] setFrame:winFrame display:YES];
|
[[self window] setFrame:winFrame display:YES];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
x = (int) (winFrame.origin.x + loc.x);
|
x = (int) (winFrame.origin.x + loc.x);
|
||||||
y = (int) (winFrame.origin.y + loc.y);
|
y = (int) (winFrame.origin.y + loc.y);
|
||||||
y = height - y;
|
y = height - y;
|
||||||
|
|
||||||
// send mouse motion event to RDP server
|
// send mouse motion event to RDP server
|
||||||
rdp_instance->input->MouseEvent(rdp_instance->input, PTR_FLAGS_MOVE, x, y);
|
rdp_instance->input->MouseEvent(rdp_instance->input, PTR_FLAGS_MOVE, x, y);
|
||||||
}
|
}
|
||||||
|
@ -479,7 +486,7 @@ extern struct kkey g_keys[];
|
||||||
- (void) keyDown:(NSEvent *) event
|
- (void) keyDown:(NSEvent *) event
|
||||||
{
|
{
|
||||||
int key;
|
int key;
|
||||||
|
|
||||||
key = [event keyCode];
|
key = [event keyCode];
|
||||||
rdp_instance->input->KeyboardEvent(rdp_instance->input, g_keys[key].flags | KBD_FLAGS_DOWN, g_keys[key].key_code);
|
rdp_instance->input->KeyboardEvent(rdp_instance->input, g_keys[key].flags | KBD_FLAGS_DOWN, g_keys[key].key_code);
|
||||||
}
|
}
|
||||||
|
@ -503,7 +510,7 @@ extern struct kkey g_keys[];
|
||||||
- (void) flagsChanged:(NSEvent *) event
|
- (void) flagsChanged:(NSEvent *) event
|
||||||
{
|
{
|
||||||
NSUInteger mf = [event modifierFlags];
|
NSUInteger mf = [event modifierFlags];
|
||||||
|
|
||||||
// caps lock
|
// caps lock
|
||||||
if (mf == 0x10100) {
|
if (mf == 0x10100) {
|
||||||
printf("TODO: caps lock is on\n");
|
printf("TODO: caps lock is on\n");
|
||||||
|
@ -524,7 +531,7 @@ extern struct kkey g_keys[];
|
||||||
rdp_instance->input->KeyboardEvent(rdp_instance->input, KBD_FLAGS_RELEASE, 0x2a);
|
rdp_instance->input->KeyboardEvent(rdp_instance->input, KBD_FLAGS_RELEASE, 0x2a);
|
||||||
kdlshift = 0;
|
kdlshift = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// right shift
|
// right shift
|
||||||
if ((kdrshift == 0) && ((mf & 4) != 0)) {
|
if ((kdrshift == 0) && ((mf & 4) != 0)) {
|
||||||
// right shift went down
|
// right shift went down
|
||||||
|
@ -536,7 +543,7 @@ extern struct kkey g_keys[];
|
||||||
rdp_instance->input->KeyboardEvent(rdp_instance->input, KBD_FLAGS_RELEASE, 0x36);
|
rdp_instance->input->KeyboardEvent(rdp_instance->input, KBD_FLAGS_RELEASE, 0x36);
|
||||||
kdrshift = 0;
|
kdrshift = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// left ctrl
|
// left ctrl
|
||||||
if ((kdlctrl == 0) && ((mf & 1) != 0)) {
|
if ((kdlctrl == 0) && ((mf & 1) != 0)) {
|
||||||
// left ctrl went down
|
// left ctrl went down
|
||||||
|
@ -548,7 +555,7 @@ extern struct kkey g_keys[];
|
||||||
rdp_instance->input->KeyboardEvent(rdp_instance->input, KBD_FLAGS_RELEASE, 0x1d);
|
rdp_instance->input->KeyboardEvent(rdp_instance->input, KBD_FLAGS_RELEASE, 0x1d);
|
||||||
kdlctrl = 0;
|
kdlctrl = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// right ctrl
|
// right ctrl
|
||||||
if ((kdrctrl == 0) && ((mf & 0x2000) != 0)) {
|
if ((kdrctrl == 0) && ((mf & 0x2000) != 0)) {
|
||||||
// right ctrl went down
|
// right ctrl went down
|
||||||
|
@ -560,7 +567,7 @@ extern struct kkey g_keys[];
|
||||||
rdp_instance->input->KeyboardEvent(rdp_instance->input, 1 | KBD_FLAGS_RELEASE, 0x1d);
|
rdp_instance->input->KeyboardEvent(rdp_instance->input, 1 | KBD_FLAGS_RELEASE, 0x1d);
|
||||||
kdrctrl = 0;
|
kdrctrl = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// left alt
|
// left alt
|
||||||
if ((kdlalt == 0) && ((mf & 0x20) != 0)) {
|
if ((kdlalt == 0) && ((mf & 0x20) != 0)) {
|
||||||
// left alt went down
|
// left alt went down
|
||||||
|
@ -572,7 +579,7 @@ extern struct kkey g_keys[];
|
||||||
rdp_instance->input->KeyboardEvent(rdp_instance->input, KBD_FLAGS_RELEASE, 0x38);
|
rdp_instance->input->KeyboardEvent(rdp_instance->input, KBD_FLAGS_RELEASE, 0x38);
|
||||||
kdlalt = 0;
|
kdlalt = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// right alt
|
// right alt
|
||||||
if ((kdralt == 0) && ((mf & 0x40) != 0)) {
|
if ((kdralt == 0) && ((mf & 0x40) != 0)) {
|
||||||
// right alt went down
|
// right alt went down
|
||||||
|
@ -584,7 +591,7 @@ extern struct kkey g_keys[];
|
||||||
rdp_instance->input->KeyboardEvent(rdp_instance->input, 1 | KBD_FLAGS_RELEASE, 0x38);
|
rdp_instance->input->KeyboardEvent(rdp_instance->input, 1 | KBD_FLAGS_RELEASE, 0x38);
|
||||||
kdralt = 0;
|
kdralt = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// left meta
|
// left meta
|
||||||
if ((kdlmeta == 0) && ((mf & 0x08) != 0)) {
|
if ((kdlmeta == 0) && ((mf & 0x08) != 0)) {
|
||||||
// left meta went down
|
// left meta went down
|
||||||
|
@ -596,7 +603,7 @@ extern struct kkey g_keys[];
|
||||||
rdp_instance->input->KeyboardEvent(rdp_instance->input, 1 | KBD_FLAGS_RELEASE, 0x5b);
|
rdp_instance->input->KeyboardEvent(rdp_instance->input, 1 | KBD_FLAGS_RELEASE, 0x5b);
|
||||||
kdlmeta = 0;
|
kdlmeta = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// right meta
|
// right meta
|
||||||
if ((kdrmeta == 0) && ((mf & 0x10) != 0)) {
|
if ((kdrmeta == 0) && ((mf & 0x10) != 0)) {
|
||||||
// right meta went down
|
// right meta went down
|
||||||
|
@ -617,18 +624,28 @@ extern struct kkey g_keys[];
|
||||||
width = w;
|
width = w;
|
||||||
height = h;
|
height = h;
|
||||||
savedWindowId = windowID;
|
savedWindowId = windowID;
|
||||||
|
|
||||||
NSRect tr = NSMakeRect(0, 0,
|
NSRect tr = NSMakeRect(0, 0,
|
||||||
[[NSScreen mainScreen] frame].size.width,
|
[[NSScreen mainScreen] frame].size.width,
|
||||||
[[NSScreen mainScreen] frame].size.height);
|
[[NSScreen mainScreen] frame].size.height);
|
||||||
|
|
||||||
NSTrackingArea * trackingArea = [[NSTrackingArea alloc] initWithRect:tr options:NSTrackingMouseEnteredAndExited | NSTrackingMouseMoved | NSTrackingCursorUpdate | NSTrackingEnabledDuringMouseDrag | NSTrackingActiveAlways owner:self userInfo:nil];
|
NSTrackingArea * trackingArea = [[NSTrackingArea alloc] initWithRect:tr options:NSTrackingMouseEnteredAndExited | NSTrackingMouseMoved | NSTrackingCursorUpdate | NSTrackingEnabledDuringMouseDrag | NSTrackingActiveAlways owner:self userInfo:nil];
|
||||||
|
|
||||||
[self addTrackingArea:trackingArea];
|
[self addTrackingArea:trackingArea];
|
||||||
|
|
||||||
g_mrdpRailView = self;
|
g_mrdpRailView = self;
|
||||||
|
|
||||||
[self becomeFirstResponder];
|
[self becomeFirstResponder];
|
||||||
|
[self setAcceptsTouchEvents:YES];
|
||||||
|
|
||||||
|
// we want to be notified when window resizes....
|
||||||
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidResize:) name:NSWindowDidResizeNotification object:nil];
|
||||||
|
|
||||||
|
// ...moves
|
||||||
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidMove:) name:NSWindowDidMoveNotification object:nil];
|
||||||
|
|
||||||
|
// ...and becomes the key window
|
||||||
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification object:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setupBmiRep:(int) frameWidth :(int) frameHeight
|
- (void) setupBmiRep:(int) frameWidth :(int) frameHeight
|
||||||
|
@ -640,10 +657,10 @@ extern struct kkey g_keys[];
|
||||||
char blue;
|
char blue;
|
||||||
char alpha;
|
char alpha;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (pixelData)
|
if (pixelData)
|
||||||
free(pixelData);
|
free(pixelData);
|
||||||
|
|
||||||
pixelData = (char *) malloc(frameWidth * frameHeight * sizeof(struct rgba_data));
|
pixelData = (char *) malloc(frameWidth * frameHeight * sizeof(struct rgba_data));
|
||||||
bmiRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:(unsigned char **) &pixelData
|
bmiRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:(unsigned char **) &pixelData
|
||||||
pixelsWide:frameWidth
|
pixelsWide:frameWidth
|
||||||
|
@ -657,6 +674,85 @@ extern struct kkey g_keys[];
|
||||||
bytesPerRow:frameWidth * sizeof(struct rgba_data)
|
bytesPerRow:frameWidth * sizeof(struct rgba_data)
|
||||||
bitsPerPixel:0];
|
bitsPerPixel:0];
|
||||||
}
|
}
|
||||||
|
- (void) beginGestureWithEvent:(NSEvent *)event
|
||||||
|
{
|
||||||
|
gestureEventInProgress = YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) endGestureWithEvent:(NSEvent *)event
|
||||||
|
{
|
||||||
|
gestureEventInProgress = NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* called when a bordered window changes size
|
||||||
|
*/
|
||||||
|
|
||||||
|
- (void) windowDidResize:(NSNotification *) notification
|
||||||
|
{
|
||||||
|
// if we are not the source of this notification, just return
|
||||||
|
if ([notification object] != [self mrdpRailWindow])
|
||||||
|
return;
|
||||||
|
|
||||||
|
// let RDP server know that window has moved
|
||||||
|
RAIL_WINDOW_MOVE_ORDER windowMove;
|
||||||
|
NSRect r = [[self window] frame];
|
||||||
|
|
||||||
|
int diffInHeight = [[self window] frame].size.height - [self frame].size.height;
|
||||||
|
r.size.height -= diffInHeight;
|
||||||
|
|
||||||
|
apple_to_windowMove(&r, &windowMove);
|
||||||
|
windowMove.windowId = self->savedWindowId;
|
||||||
|
mac_send_rail_client_event(self->context->channels, RDP_EVENT_TYPE_RAIL_CLIENT_WINDOW_MOVE, &windowMove);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* called when user moves a bordered window
|
||||||
|
*/
|
||||||
|
|
||||||
|
- (void) windowDidMove:(NSNotification *) notification
|
||||||
|
{
|
||||||
|
// if we are not the source of this notification, just return
|
||||||
|
if ([notification object] != [self mrdpRailWindow])
|
||||||
|
return;
|
||||||
|
|
||||||
|
// let RDP server know that window has moved
|
||||||
|
RAIL_WINDOW_MOVE_ORDER windowMove;
|
||||||
|
NSRect r = [[self window] frame];
|
||||||
|
|
||||||
|
int diffInHeight = [[self window] frame].size.height - [self frame].size.height;
|
||||||
|
r.size.height -= diffInHeight;
|
||||||
|
|
||||||
|
apple_to_windowMove(&r, &windowMove);
|
||||||
|
windowMove.windowId = self->savedWindowId;
|
||||||
|
mac_send_rail_client_event(self->context->channels, RDP_EVENT_TYPE_RAIL_CLIENT_WINDOW_MOVE, &windowMove);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* called when a NSWindow becomes the key window
|
||||||
|
*/
|
||||||
|
|
||||||
|
- (void) windowDidBecomeKey:(NSNotification *) notification
|
||||||
|
{
|
||||||
|
// if we are not the source of this notification, just return
|
||||||
|
if ([notification object] != [self mrdpRailWindow])
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (![self activateWindow])
|
||||||
|
return;
|
||||||
|
|
||||||
|
[[self window] setAcceptsMouseMovedEvents: YES];
|
||||||
|
|
||||||
|
//if ([self activateWindow])
|
||||||
|
mac_rail_send_activate(savedWindowId);
|
||||||
|
|
||||||
|
set_current_window(windowIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) releaseResources
|
||||||
|
{
|
||||||
|
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||||
|
}
|
||||||
|
|
||||||
void rail_cvt_from_rect(char *dest, char *src, NSRect destRect, int destWidth, int destHeight, NSRect srcRect)
|
void rail_cvt_from_rect(char *dest, char *src, NSRect destRect, int destWidth, int destHeight, NSRect srcRect)
|
||||||
{
|
{
|
||||||
|
@ -665,7 +761,7 @@ void rail_cvt_from_rect(char *dest, char *src, NSRect destRect, int destWidth, i
|
||||||
/** *********************************************************************
|
/** *********************************************************************
|
||||||
* color space conversion used specifically in RAIL
|
* color space conversion used specifically in RAIL
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
void rail_convert_color_space(char *destBuf, char * srcBuf,
|
void rail_convert_color_space(char *destBuf, char * srcBuf,
|
||||||
NSRect * destRect, int width, int height)
|
NSRect * destRect, int width, int height)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -681,10 +777,10 @@ void rail_convert_color_space(char *destBuf, char * srcBuf,
|
||||||
int pixel2;
|
int pixel2;
|
||||||
int * src32;
|
int * src32;
|
||||||
int * dest32;
|
int * dest32;
|
||||||
|
|
||||||
int destWidth = destRect->size.width;
|
int destWidth = destRect->size.width;
|
||||||
int destHeight = destRect->size.height;
|
int destHeight = destRect->size.height;
|
||||||
|
|
||||||
if ((!destBuf) || (!srcBuf)) {
|
if ((!destBuf) || (!srcBuf)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -696,12 +792,12 @@ void rail_convert_color_space(char *destBuf, char * srcBuf,
|
||||||
srcY = destRect->origin.y;
|
srcY = destRect->origin.y;
|
||||||
destX = 0;
|
destX = 0;
|
||||||
destY = 0;
|
destY = 0;
|
||||||
|
|
||||||
for (i = 0; i < numRows; i++)
|
for (i = 0; i < numRows; i++)
|
||||||
{
|
{
|
||||||
src32 = (int *) (srcBuf + ((srcY + i) * width + srcX) * 4);
|
src32 = (int *) (srcBuf + ((srcY + i) * width + srcX) * 4);
|
||||||
dest32 = (int *) (destBuf + ((destY + i) * destWidth + destX) * 4);
|
dest32 = (int *) (destBuf + ((destY + i) * destWidth + destX) * 4);
|
||||||
|
|
||||||
for (j = 0; j < pixelsPerRow; j++)
|
for (j = 0; j < pixelsPerRow; j++)
|
||||||
{
|
{
|
||||||
pixel = *src32;
|
pixel = *src32;
|
||||||
|
@ -715,7 +811,7 @@ void rail_convert_color_space(char *destBuf, char * srcBuf,
|
||||||
dest32++;
|
dest32++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
destRect->origin.y = destHeight - destRect->origin.y - destRect->size.height;
|
destRect->origin.y = destHeight - destRect->origin.y - destRect->size.height;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -729,12 +825,12 @@ void rail_MoveWindow(rdpRail * rail, rdpWindow * window)
|
||||||
if (g_mrdpRailView->isMoveSizeInProgress) {
|
if (g_mrdpRailView->isMoveSizeInProgress) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_mrdpRailView->skipMoveWindowOnce) {
|
if (g_mrdpRailView->skipMoveWindowOnce) {
|
||||||
g_mrdpRailView->skipMoveWindowOnce = NO;
|
g_mrdpRailView->skipMoveWindowOnce = NO;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// this rect is based on Windows co-ordinates...
|
// this rect is based on Windows co-ordinates...
|
||||||
NSRect r;
|
NSRect r;
|
||||||
r.origin.x = window->windowOffsetX;
|
r.origin.x = window->windowOffsetX;
|
||||||
|
@ -746,4 +842,16 @@ void rail_MoveWindow(rdpRail * rail, rdpWindow * window)
|
||||||
[[g_mrdpRailView window] setFrame:r display:YES];
|
[[g_mrdpRailView window] setFrame:r display:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void mac_rail_send_activate(int window_id)
|
||||||
|
{
|
||||||
|
RAIL_ACTIVATE_ORDER activate;
|
||||||
|
|
||||||
|
activate.windowId = window_id;
|
||||||
|
activate.enabled = 1;
|
||||||
|
|
||||||
|
mac_send_rail_client_event(g_mrdpRailView->context->channels, RDP_EVENT_TYPE_RAIL_CLIENT_ACTIVATE, &activate);
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,7 @@
|
||||||
#import "MRDPView.h"
|
#import "MRDPView.h"
|
||||||
#import "MRDPCursor.h"
|
#import "MRDPCursor.h"
|
||||||
|
|
||||||
// Should be defined in Makefile
|
#define RUN_IN_XCODE
|
||||||
// #define RUN_IN_XCODE
|
|
||||||
|
|
||||||
// LK_TODO
|
// LK_TODO
|
||||||
#define GOT_HERE //printf("### got here: %s : %s() : %d\n", __FILE__, __func__, __LINE__)
|
#define GOT_HERE //printf("### got here: %s : %s() : %d\n", __FILE__, __func__, __LINE__)
|
||||||
|
@ -1870,6 +1869,7 @@ void cliprdr_send_supported_format_list(freerdp *inst)
|
||||||
freerdp_channels_send_event(inst->context->channels, (RDP_EVENT*) event);
|
freerdp_channels_send_event(inst->context->channels, (RDP_EVENT*) event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
* *
|
* *
|
||||||
* *
|
* *
|
||||||
|
|
|
@ -8,4 +8,3 @@
|
||||||
@synthesize view;
|
@synthesize view;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
option(WITH_MANPAGES "Generate manpages." ON)
|
option(WITH_MANPAGES "Generate manpages." ON)
|
||||||
option(WITH_NEON "Enable NEON optimization for rfx decoder" OFF)
|
option(WITH_NEON "Enable NEON optimization for rfx decoder" OFF)
|
||||||
option(WITH_PROFILER "Compile profiler." OFF)
|
option(WITH_PROFILER "Compile profiler." OFF)
|
||||||
|
@ -5,6 +6,15 @@ option(WITH_SSE2_TARGET "Allow compiler to generate SSE2 instructions." OFF)
|
||||||
option(WITH_SSE2 "Use SSE2 optimization." OFF)
|
option(WITH_SSE2 "Use SSE2 optimization." OFF)
|
||||||
option(WITH_JPEG "Use JPEG decoding." OFF)
|
option(WITH_JPEG "Use JPEG decoding." OFF)
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
option(WITH_CLANG "Build using clang" OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
option(WITH_CLIENT "Build client binaries" ON)
|
||||||
|
option(WITH_SERVER "Build server binaries" OFF)
|
||||||
|
option(WITH_CHANNELS "Build virtual channel plugins" ON)
|
||||||
|
option(WITH_THIRD_PARTY "Build third-party components" OFF)
|
||||||
|
|
||||||
option(WITH_DEBUG_CERTIFICATE "Print certificate related debug messages." OFF)
|
option(WITH_DEBUG_CERTIFICATE "Print certificate related debug messages." OFF)
|
||||||
option(WITH_DEBUG_CHANNELS "Print channel manager debug messages." OFF)
|
option(WITH_DEBUG_CHANNELS "Print channel manager debug messages." OFF)
|
||||||
option(WITH_DEBUG_CLIPRDR "Print clipboard redirection debug messages" OFF)
|
option(WITH_DEBUG_CLIPRDR "Print clipboard redirection debug messages" OFF)
|
||||||
|
@ -29,3 +39,4 @@ option(WITH_DEBUG_X11_CLIPRDR "Print X11 clipboard redirection debug messages" O
|
||||||
option(WITH_DEBUG_X11_LOCAL_MOVESIZE "Print X11 Client local movesize debug messages" OFF)
|
option(WITH_DEBUG_X11_LOCAL_MOVESIZE "Print X11 Client local movesize debug messages" OFF)
|
||||||
option(WITH_DEBUG_X11 "Print X11 Client debug messages" OFF)
|
option(WITH_DEBUG_X11 "Print X11 Client debug messages" OFF)
|
||||||
option(WITH_DEBUG_XV "Print XVideo debug messages" OFF)
|
option(WITH_DEBUG_XV "Print XVideo debug messages" OFF)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
/**
|
||||||
|
* FreeRDP: A Remote Desktop Protocol Client
|
||||||
|
* config.h definitions for installable headers
|
||||||
|
*
|
||||||
|
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef FREERDP_CONFIG_H
|
||||||
|
#define FREERDP_CONFIG_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This generated config.h header is meant for installation, which is why
|
||||||
|
* all definitions MUST be prefixed to avoid conflicting with third-party
|
||||||
|
* libraries. Only add configurable definitions which really must be used
|
||||||
|
* from installable headers, such as the base type definition types.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#cmakedefine FREERDP_HAVE_LIMITS_H
|
||||||
|
#cmakedefine FREERDP_HAVE_STDINT_H
|
||||||
|
#cmakedefine FREERDP_HAVE_STDBOOL_H
|
||||||
|
#cmakedefine FREERDP_HAVE_INTTYPES_H
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -18,25 +18,24 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __RDP_TYPES_H
|
#ifndef FREERDP_TYPES_H
|
||||||
#define __RDP_TYPES_H
|
#define FREERDP_TYPES_H
|
||||||
|
|
||||||
|
#include <freerdp/config.h>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <windef.h>
|
#include <windef.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Base Types */
|
#ifdef FREERDP_HAVE_LIMITS_H
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#ifdef HAVE_LIMITS_H
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_STDINT_H
|
#ifdef FREERDP_HAVE_STDINT_H
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_INTTYPES_H
|
#ifdef FREERDP_HAVE_INTTYPES_H
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
typedef uint8_t uint8;
|
typedef uint8_t uint8;
|
||||||
|
@ -66,7 +65,7 @@ typedef signed long long sint64;
|
||||||
|
|
||||||
#endif /* HAVE_INTTYPES_H */
|
#endif /* HAVE_INTTYPES_H */
|
||||||
|
|
||||||
#ifdef HAVE_STDBOOL_H
|
#ifdef FREERDP_HAVE_STDBOOL_H
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
@ -108,7 +107,7 @@ typedef int boolean;
|
||||||
|
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
#endif /* HAVE_STDBOOL_H */
|
#endif /* FREERDP_HAVE_STDBOOL_H */
|
||||||
|
|
||||||
#ifndef MIN
|
#ifndef MIN
|
||||||
#define MIN(x,y) (((x) < (y)) ? (x) : (y))
|
#define MIN(x,y) (((x) < (y)) ? (x) : (y))
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
**/**
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
# Third-Party Extensions
|
||||||
|
#
|
||||||
|
# Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
# The third-party directory is meant for third-party components to be built
|
||||||
|
# as part of the main FreeRDP build system, making separate maintenance easier.
|
||||||
|
# Subdirectories of the third-party directory are ignored by git, but are
|
||||||
|
# automatically included by CMake when the -DWITH_THIRD_PARTY=on option is used.
|
||||||
|
|
||||||
|
file(GLOB all_valid_subdirs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*/CMakeLists.txt")
|
||||||
|
|
||||||
|
foreach(dir ${all_valid_subdirs})
|
||||||
|
message(STATUS "path = ${dir}")
|
||||||
|
if(${dir} MATCHES "^([^/]*)//CMakeLists.txt")
|
||||||
|
string(REGEX REPLACE "^([^/]*)//CMakeLists.txt" "\\1" dir_trimmed ${dir})
|
||||||
|
add_subdirectory(${dir_trimmed})
|
||||||
|
endif()
|
||||||
|
endforeach(dir)
|
||||||
|
|
Loading…
Reference in New Issue