21#include <freerdp/config.h>
23#include <winpr/assert.h>
24#include <winpr/wlog.h>
26#include <freerdp/channels/disp.h>
27#include <freerdp/client/disp.h>
33#define TAG CLIENT_TAG("ios.disp")
36static UINT ios_disp_caps(DispClientContext *disp, UINT32 maxNumMonitors,
37 UINT32 maxMonitorAreaFactorA, UINT32 maxMonitorAreaFactorB)
44 afc->dispActivated = TRUE;
47 [afc->mfi->session performSelectorOnMainThread:@selector(sessionDidActivateDisplayControl)
52 "DisplayControlCaps: MaxNumMonitors: %" PRIu32
" MaxMonitorAreaFactorA: %" PRIu32
53 " MaxMonitorAreaFactorB: %" PRIu32,
54 maxNumMonitors, maxMonitorAreaFactorA, maxMonitorAreaFactorB);
58BOOL ios_disp_init(
mfContext *afc, DispClientContext *disp)
64 afc->dispActivated = FALSE;
66 disp->DisplayControlCaps = ios_disp_caps;
68 WLog_DBG(TAG,
"disp channel connected");
72BOOL ios_disp_uninit(
mfContext *afc, DispClientContext *disp)
78 afc->dispActivated = FALSE;
79 WLog_DBG(TAG,
"disp channel disconnected");
83BOOL ios_disp_send_monitor_layout(
mfContext *afc, UINT32 width, UINT32 height)
87 DispClientContext *disp = afc->disp;
88 if (!disp || !disp->SendMonitorLayout || !afc->dispActivated)
90 WLog_WARN(TAG,
"disp channel not available");
94 rdpSettings *settings = afc->_p.settings;
97 layout.Flags = DISPLAY_CONTROL_MONITOR_PRIMARY;
102 layout.PhysicalHeight = 0;
107 UINT rc = disp->SendMonitorLayout(disp, 1, &layout);
108 if (rc != CHANNEL_RC_OK)
110 WLog_ERR(TAG,
"SendMonitorLayout failed: %" PRIu32, rc);
114 WLog_DBG(TAG,
"SendMonitorLayout: %" PRIu32
"x%" PRIu32, width, height);
WINPR_ATTR_NODISCARD FREERDP_API UINT16 freerdp_settings_get_uint16(const rdpSettings *settings, FreeRDP_Settings_Keys_UInt16 id)
Returns a UINT16 settings value.
WINPR_ATTR_NODISCARD FREERDP_API UINT32 freerdp_settings_get_uint32(const rdpSettings *settings, FreeRDP_Settings_Keys_UInt32 id)
Returns a UINT32 settings value.
Layout layout(float leftWidth, float leftHeight, float rightWidth, float rightHeight, float width, float margin)