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