FreeRDP
Loading...
Searching...
No Matches
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#import <freerdp/client/disp.h>
20
22
23// FreeRDP extended structs
24typedef struct mf_info mfInfo;
25
26typedef struct mf_context
27{
28 rdpContext _p;
29
30 mfInfo *mfi;
31 rdpSettings *settings;
32
33 BOOL clipboardSync;
34 BOOL clipboardHasText;
35 wClipboard *clipboard;
36 UINT32 numServerFormats;
37 UINT32 requestedFormatId;
38 HANDLE clipboardRequestEvent;
39 CLIPRDR_FORMAT *serverFormats;
40 CliprdrClientContext *cliprdr;
41 UINT32 clipboardCapabilities;
42
43 DispClientContext *disp;
44 BOOL dispActivated;
45} mfContext;
46
47struct mf_info
48{
49 // RDP
50 freerdp *instance;
51 mfContext *context;
52 rdpContext *_context;
53
54 // UI
55 RDPSession *session;
56
57 // Graphics
58 CGContextRef bitmap_context;
59
60 // Events
61 int event_pipe_producer;
62 int event_pipe_consumer;
63 HANDLE handle;
64
65 // Tracking connection state
66 volatile TSXConnectionState connection_state;
67 volatile BOOL
68 unwanted; // set when controlling Session no longer wants the connection to continue
69};
70
71#define MFI_FROM_INSTANCE(inst) (((mfContext *)((inst)->context))->mfi)
72
73enum MF_EXIT_CODE
74{
75 MF_EXIT_SUCCESS = 0,
76
77 MF_EXIT_CONN_FAILED = 128,
78 MF_EXIT_CONN_CANCELED = 129,
79 MF_EXIT_LOGON_TIMEOUT = 130,
80
81 MF_EXIT_UNKNOWN = 255
82};
83
84void ios_init_freerdp(void);
85void ios_uninit_freerdp(void);
86
87void ios_freerdp_free(freerdp *instance);
88
89WINPR_ATTR_MALLOC(ios_freerdp_free, 1)
90freerdp *ios_freerdp_new(void);
91int ios_run_freerdp(freerdp *instance);