FreeRDP
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
ios_freerdp.h
1/*
2 RDP run-loop
3
4 Copyright 2013 Thincast Technologies GmbH, Authors: Martin Fleisz, Dorian Johnson
5 Copyright 2023 Iordan Iordanov
6
7 This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
8 If a copy of the MPL was not distributed with this file, You can obtain one at
9 http://mozilla.org/MPL/2.0/.
10 */
11
12#import <CoreGraphics/CoreGraphics.h>
13
14#import <freerdp/freerdp.h>
15#import <freerdp/channels/channels.h>
16#import "TSXTypes.h"
17#import <winpr/clipboard.h>
18#import <freerdp/client/cliprdr.h>
19
21
22typedef BOOL (*pServerCutText)(rdpContext *context, UINT8 *data, UINT32 size);
23
24// FreeRDP extended structs
25typedef struct mf_info mfInfo;
26
27typedef struct mf_context
28{
29 rdpContext _p;
30
31 mfInfo *mfi;
32 rdpSettings *settings;
33
34 BOOL clipboardSync;
35 wClipboard *clipboard;
36 UINT32 numServerFormats;
37 UINT32 requestedFormatId;
38 HANDLE clipboardRequestEvent;
39 CLIPRDR_FORMAT *serverFormats;
40 CliprdrClientContext *cliprdr;
41 UINT32 clipboardCapabilities;
42 pServerCutText ServerCutText;
43} mfContext;
44
45struct mf_info
46{
47 // RDP
48 freerdp *instance;
49 mfContext *context;
50 rdpContext *_context;
51
52 // UI
53 RDPSession *session;
54
55 // Graphics
56 CGContextRef bitmap_context;
57
58 // Events
59 int event_pipe_producer;
60 int event_pipe_consumer;
61 HANDLE handle;
62
63 // Tracking connection state
64 volatile TSXConnectionState connection_state;
65 volatile BOOL
66 unwanted; // set when controlling Session no longer wants the connection to continue
67};
68
69#define MFI_FROM_INSTANCE(inst) (((mfContext *)((inst)->context))->mfi)
70
71enum MF_EXIT_CODE
72{
73 MF_EXIT_SUCCESS = 0,
74
75 MF_EXIT_CONN_FAILED = 128,
76 MF_EXIT_CONN_CANCELED = 129,
77 MF_EXIT_LOGON_TIMEOUT = 130,
78
79 MF_EXIT_UNKNOWN = 255
80};
81
82void ios_init_freerdp(void);
83void ios_uninit_freerdp(void);
84freerdp *ios_freerdp_new(void);
85int ios_run_freerdp(freerdp *instance);
86void ios_freerdp_free(freerdp *instance);
87void ios_send_clipboard_data(void *context, const void *data, UINT32 size);