2
2
//!
3
3
//! [1]: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpedisp/d2954508-f487-48bc-8731-39743e0854a9
4
4
5
+ use ironrdp_dvc:: DvcPduEncode ;
5
6
use ironrdp_pdu:: cursor:: { ReadCursor , WriteCursor } ;
6
7
use ironrdp_pdu:: { ensure_fixed_part_size, invalid_message_err, PduDecode , PduEncode , PduResult } ;
7
8
@@ -73,6 +74,8 @@ impl PduEncode for DisplayControlPdu {
73
74
}
74
75
}
75
76
77
+ impl DvcPduEncode for DisplayControlPdu { }
78
+
76
79
impl < ' de > PduDecode < ' de > for DisplayControlPdu {
77
80
fn decode ( src : & mut ReadCursor < ' de > ) -> PduResult < Self > {
78
81
ensure_fixed_part_size ! ( in: src) ;
@@ -99,12 +102,28 @@ impl<'de> PduDecode<'de> for DisplayControlPdu {
99
102
}
100
103
}
101
104
105
+ impl From < DisplayControlCapabilities > for DisplayControlPdu {
106
+ fn from ( caps : DisplayControlCapabilities ) -> Self {
107
+ Self :: Caps ( caps)
108
+ }
109
+ }
110
+
111
+ impl From < DisplayControlMonitorLayout > for DisplayControlPdu {
112
+ fn from ( layout : DisplayControlMonitorLayout ) -> Self {
113
+ Self :: MonitorLayout ( layout)
114
+ }
115
+ }
116
+
117
+ /// 2.2.2.1 DISPLAYCONTROL_CAPS_PDU
118
+ ///
102
119
/// Display control channel capabilities PDU.
103
120
///
104
121
/// INVARIANTS:
105
122
/// 0 <= max_num_monitors <= MAX_SUPPORTED_MONITORS
106
123
/// 0 <= max_monitor_area_factor_a <= MAX_MONITOR_AREA_FACTOR
107
124
/// 0 <= max_monitor_area_factor_b <= MAX_MONITOR_AREA_FACTOR
125
+ ///
126
+ /// [2.2.2.1]: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpedisp/8989a211-984e-4ecc-80f3-60694fc4b476
108
127
#[ derive( Debug , Clone , PartialEq , Eq ) ]
109
128
pub struct DisplayControlCapabilities {
110
129
max_num_monitors : u32 ,
@@ -179,10 +198,14 @@ impl<'de> PduDecode<'de> for DisplayControlCapabilities {
179
198
}
180
199
}
181
200
201
+ /// [2.2.2.2] DISPLAYCONTROL_MONITOR_LAYOUT_PDU
202
+ ///
182
203
/// Sent from client to server to notify about new monitor layout (e.g screen resize).
183
204
///
184
205
/// INVARIANTS:
185
206
/// 0 <= monitors.length() <= MAX_SUPPORTED_MONITORS
207
+ ///
208
+ /// [2.2.2.2]: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpedisp/22741217-12a0-4fb8-b5a0-df43905aaf06
186
209
#[ derive( Debug , Clone , PartialEq , Eq ) ]
187
210
pub struct DisplayControlMonitorLayout {
188
211
monitors : Vec < MonitorLayoutEntry > ,
@@ -280,6 +303,9 @@ impl<'de> PduDecode<'de> for DisplayControlMonitorLayout {
280
303
}
281
304
}
282
305
306
+ /// [2.2.2.2.1] DISPLAYCONTROL_MONITOR_LAYOUT_PDU
307
+ ///
308
+ /// [2.2.2.2.2]: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpedisp/ea2de591-9203-42cd-9908-be7a55237d1c
283
309
#[ derive( Debug , Clone , PartialEq , Eq ) ]
284
310
pub struct MonitorLayoutEntry {
285
311
is_primary : bool ,
0 commit comments