2013-02-22 08:42:36 +04:00
|
|
|
/**
|
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
|
|
|
* MacFreeRDP
|
|
|
|
*
|
|
|
|
* Copyright 2012 Thomas Goddard
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
2012-05-03 07:15:27 +04:00
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
|
2013-05-31 20:48:40 +04:00
|
|
|
/*
|
|
|
|
#import "freerdp/freerdp.h"
|
2012-06-20 20:57:20 +04:00
|
|
|
#import "freerdp/types.h"
|
|
|
|
#import "freerdp/channels/channels.h"
|
|
|
|
#import "freerdp/gdi/gdi.h"
|
|
|
|
#import "freerdp/graphics.h"
|
|
|
|
#import "freerdp/utils/event.h"
|
2012-10-09 04:33:58 +04:00
|
|
|
#import "freerdp/client/cliprdr.h"
|
2012-11-23 00:32:21 +04:00
|
|
|
#import "freerdp/client/file.h"
|
|
|
|
#import "freerdp/client/cmdline.h"
|
2012-06-20 20:57:20 +04:00
|
|
|
#import "freerdp/rail/rail.h"
|
|
|
|
#import "freerdp/rail.h"
|
|
|
|
#import "freerdp/utils/rail.h"
|
2013-05-31 20:48:40 +04:00
|
|
|
|
2013-06-11 22:56:43 +04:00
|
|
|
#import "mf_interface.h"
|
|
|
|
*/
|
2012-05-03 07:15:27 +04:00
|
|
|
|
2013-06-18 22:30:21 +04:00
|
|
|
#import "mfreerdp.h"
|
|
|
|
#import "mf_client.h"
|
|
|
|
|
2012-05-03 07:15:27 +04:00
|
|
|
@interface MRDPView : NSView
|
|
|
|
{
|
2013-02-22 06:42:47 +04:00
|
|
|
CFRunLoopSourceRef run_loop_src;
|
|
|
|
CFRunLoopSourceRef run_loop_src_channels;
|
2013-02-22 08:42:36 +04:00
|
|
|
NSBitmapImageRep* bmiRep;
|
|
|
|
NSMutableArray* cursors;
|
|
|
|
NSMutableArray* windows;
|
|
|
|
NSTimer* pasteboard_timer;
|
|
|
|
NSRect prevWinPosition;
|
|
|
|
int titleBarHeight;
|
2013-05-31 20:48:40 +04:00
|
|
|
void* rdp_instance;
|
|
|
|
void* rdp_context;
|
2013-03-11 20:14:44 +04:00
|
|
|
CGContextRef bitmap_context;
|
2013-02-22 08:42:36 +04:00
|
|
|
char* pixel_data;
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
int argc;
|
|
|
|
char** argv;
|
2013-05-31 20:48:40 +04:00
|
|
|
|
2013-02-22 08:42:36 +04:00
|
|
|
NSPoint savedDragLocation;
|
|
|
|
BOOL mouseInClientArea;
|
|
|
|
BOOL firstCreateWindow;
|
|
|
|
BOOL isMoveSizeInProgress;
|
|
|
|
BOOL skipResizeOnce;
|
|
|
|
BOOL saveInitialDragLoc;
|
|
|
|
BOOL skipMoveWindowOnce;
|
2013-05-31 20:48:40 +04:00
|
|
|
|
2013-03-11 20:14:44 +04:00
|
|
|
/* store state info for some keys */
|
2013-02-22 08:42:36 +04:00
|
|
|
int kdlshift;
|
|
|
|
int kdrshift;
|
|
|
|
int kdlctrl;
|
|
|
|
int kdrctrl;
|
|
|
|
int kdlalt;
|
|
|
|
int kdralt;
|
|
|
|
int kdlmeta;
|
|
|
|
int kdrmeta;
|
|
|
|
int kdcapslock;
|
2013-02-22 06:42:47 +04:00
|
|
|
|
2012-05-03 07:15:27 +04:00
|
|
|
@public
|
2013-05-31 20:48:40 +04:00
|
|
|
NSPasteboard* pasteboard_rd; /* for reading from clipboard */
|
|
|
|
NSPasteboard* pasteboard_wr; /* for writing to clipboard */
|
2013-02-22 08:42:36 +04:00
|
|
|
int pasteboard_changecount;
|
|
|
|
int pasteboard_format;
|
2013-03-11 20:14:44 +04:00
|
|
|
int is_connected;
|
2012-05-03 07:15:27 +04:00
|
|
|
}
|
|
|
|
|
2013-06-18 22:30:21 +04:00
|
|
|
- (int) rdpStart :(rdpContext*) context;
|
2012-11-01 05:49:36 +04:00
|
|
|
- (void) rdpConnectError;
|
2012-06-20 20:57:20 +04:00
|
|
|
- (void) rdpRemoteAppError;
|
2013-05-31 20:48:40 +04:00
|
|
|
- (void) saveStateInfo :(void *) instance :(void *) context;
|
2012-05-03 07:15:27 +04:00
|
|
|
- (void) onPasteboardTimerFired :(NSTimer *) timer;
|
|
|
|
- (void) releaseResources;
|
2012-06-20 20:57:20 +04:00
|
|
|
- (void) setViewSize : (int) width : (int) height;
|
2012-05-03 07:15:27 +04:00
|
|
|
|
|
|
|
@property (assign) int is_connected;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
/* Pointer Flags */
|
2013-05-31 20:48:40 +04:00
|
|
|
#define PTR_FLAGS_WHEEL 0x0200
|
|
|
|
#define PTR_FLAGS_WHEEL_NEGATIVE 0x0100
|
|
|
|
#define PTR_FLAGS_MOVE 0x0800
|
|
|
|
#define PTR_FLAGS_DOWN 0x8000
|
|
|
|
#define PTR_FLAGS_BUTTON1 0x1000
|
|
|
|
#define PTR_FLAGS_BUTTON2 0x2000
|
|
|
|
#define PTR_FLAGS_BUTTON3 0x4000
|
|
|
|
#define WheelRotationMask 0x01FF
|