ohos_window_manager_sys/display_info/
display_info_ffi.rs

1// automatically generated by rust-bindgen 0.71.1
2
3#![allow(non_upper_case_globals)]
4#![allow(non_camel_case_types)]
5#![allow(non_snake_case)]
6
7pub const OH_DISPLAY_NAME_LENGTH: u32 = 32;
8#[cfg(feature = "api-12")]
9#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
10impl NativeDisplayManager_Rotation {
11    /// device rotation 0 degree
12    pub const DISPLAY_MANAGER_ROTATION_0: NativeDisplayManager_Rotation =
13        NativeDisplayManager_Rotation(0);
14    /// device rotation 90 degrees
15    pub const DISPLAY_MANAGER_ROTATION_90: NativeDisplayManager_Rotation =
16        NativeDisplayManager_Rotation(1);
17    /// device rotation 180 degrees
18    pub const DISPLAY_MANAGER_ROTATION_180: NativeDisplayManager_Rotation =
19        NativeDisplayManager_Rotation(2);
20    /// device rotation 270 degree
21    pub const DISPLAY_MANAGER_ROTATION_270: NativeDisplayManager_Rotation =
22        NativeDisplayManager_Rotation(3);
23}
24#[repr(transparent)]
25/// Enumerates rotations.
26///
27///
28/// Available since API-level: 12
29///
30/// Version: 1.0
31#[cfg(feature = "api-12")]
32#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
33#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
34pub struct NativeDisplayManager_Rotation(pub ::core::ffi::c_uint);
35#[cfg(feature = "api-12")]
36#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
37impl NativeDisplayManager_Orientation {
38    /// device portrait show
39    pub const DISPLAY_MANAGER_PORTRAIT: NativeDisplayManager_Orientation =
40        NativeDisplayManager_Orientation(0);
41    /// device landscape show
42    pub const DISPLAY_MANAGER_LANDSCAPE: NativeDisplayManager_Orientation =
43        NativeDisplayManager_Orientation(1);
44    /// device portrait inverted show
45    pub const DISPLAY_MANAGER_PORTRAIT_INVERTED: NativeDisplayManager_Orientation =
46        NativeDisplayManager_Orientation(2);
47    /// device landscape inverted show
48    pub const DISPLAY_MANAGER_LANDSCAPE_INVERTED: NativeDisplayManager_Orientation =
49        NativeDisplayManager_Orientation(3);
50    /// device unknow show
51    pub const DISPLAY_MANAGER_UNKNOWN: NativeDisplayManager_Orientation =
52        NativeDisplayManager_Orientation(4);
53}
54#[repr(transparent)]
55/// Enumerates orientations.
56///
57///
58/// Available since API-level: 12
59///
60/// Version: 1.0
61#[cfg(feature = "api-12")]
62#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
63#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
64pub struct NativeDisplayManager_Orientation(pub ::core::ffi::c_uint);
65pub type NativeDisplayManagerResult = Result<(), NativeDisplayManagerErrorCode>;
66#[cfg(feature = "api-12")]
67#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
68impl NativeDisplayManagerErrorCode {
69    /// Operation no permission
70    pub const NO_PERMISSION: NativeDisplayManagerErrorCode =
71        NativeDisplayManagerErrorCode(const { core::num::NonZero::new(201).unwrap() });
72    /// Operation not system app
73    pub const NOT_SYSTEM_APP: NativeDisplayManagerErrorCode =
74        NativeDisplayManagerErrorCode(const { core::num::NonZero::new(202).unwrap() });
75    /// Operation invalid param
76    pub const INVALID_PARAM: NativeDisplayManagerErrorCode =
77        NativeDisplayManagerErrorCode(const { core::num::NonZero::new(401).unwrap() });
78    /// Operation device not supported
79    pub const DEVICE_NOT_SUPPORTED: NativeDisplayManagerErrorCode =
80        NativeDisplayManagerErrorCode(const { core::num::NonZero::new(801).unwrap() });
81    /// Operation screen invalid
82    pub const INVALID_SCREEN: NativeDisplayManagerErrorCode =
83        NativeDisplayManagerErrorCode(const { core::num::NonZero::new(1400001).unwrap() });
84    /// Operation invalid call
85    pub const INVALID_CALL: NativeDisplayManagerErrorCode =
86        NativeDisplayManagerErrorCode(const { core::num::NonZero::new(1400002).unwrap() });
87    /// Operation system abnormal
88    pub const SYSTEM_ABNORMAL: NativeDisplayManagerErrorCode =
89        NativeDisplayManagerErrorCode(const { core::num::NonZero::new(1400003).unwrap() });
90    /// Operation illegal param.
91    ///
92    ///
93    /// Available since API-level: 20
94    #[cfg(feature = "api-20")]
95    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
96    pub const ILLEGAL_PARAM: NativeDisplayManagerErrorCode =
97        NativeDisplayManagerErrorCode(const { core::num::NonZero::new(1400004).unwrap() });
98}
99#[repr(transparent)]
100/// Enumerates the result types of the display manager interface.
101///
102///
103/// Available since API-level: 12
104///
105/// Version: 1.0
106#[cfg(feature = "api-12")]
107#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
108#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
109pub struct NativeDisplayManagerErrorCode(pub core::num::NonZero<::core::ffi::c_uint>);
110#[cfg(feature = "api-12")]
111#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
112impl NativeDisplayManager_FoldDisplayMode {
113    /// display mode unknown
114    pub const DISPLAY_MANAGER_FOLD_DISPLAY_MODE_UNKNOWN: NativeDisplayManager_FoldDisplayMode =
115        NativeDisplayManager_FoldDisplayMode(0);
116    /// display mode full
117    pub const DISPLAY_MANAGER_FOLD_DISPLAY_MODE_FULL: NativeDisplayManager_FoldDisplayMode =
118        NativeDisplayManager_FoldDisplayMode(1);
119    /// display mode main
120    pub const DISPLAY_MANAGER_FOLD_DISPLAY_MODE_MAIN: NativeDisplayManager_FoldDisplayMode =
121        NativeDisplayManager_FoldDisplayMode(2);
122    /// display mode sub
123    pub const DISPLAY_MANAGER_FOLD_DISPLAY_MODE_SUB: NativeDisplayManager_FoldDisplayMode =
124        NativeDisplayManager_FoldDisplayMode(3);
125    /// display mode coordination
126    pub const DISPLAY_MANAGER_FOLD_DISPLAY_MODE_COORDINATION: NativeDisplayManager_FoldDisplayMode =
127        NativeDisplayManager_FoldDisplayMode(4);
128}
129#[repr(transparent)]
130/// Enumerates the fold display mode.
131///
132///
133/// Available since API-level: 12
134///
135/// Version: 1.0
136#[cfg(feature = "api-12")]
137#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
138#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
139pub struct NativeDisplayManager_FoldDisplayMode(pub ::core::ffi::c_uint);
140/// Defines the display rect data structure.
141///
142///
143/// Available since API-level: 12
144///
145/// Version: 1.0
146#[cfg(feature = "api-12")]
147#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
148#[repr(C)]
149#[derive(Debug, Copy, Clone)]
150pub struct NativeDisplayManager_Rect {
151    pub left: i32,
152    pub top: i32,
153    pub width: u32,
154    pub height: u32,
155}
156/// Defines the display waterfallDisplayAreaRects data structure.
157///
158///
159/// Available since API-level: 12
160///
161/// Version: 1.0
162#[cfg(feature = "api-12")]
163#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
164#[repr(C)]
165#[derive(Debug, Copy, Clone)]
166pub struct NativeDisplayManager_WaterfallDisplayAreaRects {
167    pub left: NativeDisplayManager_Rect,
168    pub top: NativeDisplayManager_Rect,
169    pub right: NativeDisplayManager_Rect,
170    pub bottom: NativeDisplayManager_Rect,
171}
172/// Defines the display cutout info data structure.
173///
174///
175/// Available since API-level: 12
176///
177/// Version: 1.0
178#[cfg(feature = "api-12")]
179#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
180#[repr(C)]
181#[derive(Debug, Copy, Clone)]
182pub struct NativeDisplayManager_CutoutInfo {
183    pub boundingRectsLength: i32,
184    pub boundingRects: *mut NativeDisplayManager_Rect,
185    pub waterfallDisplayAreaRects: NativeDisplayManager_WaterfallDisplayAreaRects,
186}
187#[cfg(feature = "api-14")]
188#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
189impl NativeDisplayManager_DisplayState {
190    /// display state unknown
191    pub const DISPLAY_MANAGER_DISPLAY_STATE_UNKNOWN: NativeDisplayManager_DisplayState =
192        NativeDisplayManager_DisplayState(0);
193    /// display state off
194    pub const DISPLAY_MANAGER_DISPLAY_STATE_OFF: NativeDisplayManager_DisplayState =
195        NativeDisplayManager_DisplayState(1);
196    /// display state on
197    pub const DISPLAY_MANAGER_DISPLAY_STATE_ON: NativeDisplayManager_DisplayState =
198        NativeDisplayManager_DisplayState(2);
199    /// display state doze
200    pub const DISPLAY_MANAGER_DISPLAY_STATE_DOZE: NativeDisplayManager_DisplayState =
201        NativeDisplayManager_DisplayState(3);
202    /// display state doze suspend
203    pub const DISPLAY_MANAGER_DISPLAY_STATE_DOZE_SUSPEND: NativeDisplayManager_DisplayState =
204        NativeDisplayManager_DisplayState(4);
205    /// display state vr
206    pub const DISPLAY_MANAGER_DISPLAY_STATE_VR: NativeDisplayManager_DisplayState =
207        NativeDisplayManager_DisplayState(5);
208    /// display state on suspend
209    pub const DISPLAY_MANAGER_DISPLAY_STATE_ON_SUSPEND: NativeDisplayManager_DisplayState =
210        NativeDisplayManager_DisplayState(6);
211}
212#[repr(transparent)]
213/// Enumerates of the display state.
214///
215///
216/// Available since API-level: 14
217///
218/// Version: 1.0
219#[cfg(feature = "api-14")]
220#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
221#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
222pub struct NativeDisplayManager_DisplayState(pub ::core::ffi::c_uint);
223#[cfg(feature = "api-20")]
224#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
225impl NativeDisplayManager_SourceMode {
226    /// display is not in use
227    pub const DISPLAY_SOURCE_MODE_NONE: NativeDisplayManager_SourceMode =
228        NativeDisplayManager_SourceMode(0);
229    /// display is in main mode
230    pub const DISPLAY_SOURCE_MODE_MAIN: NativeDisplayManager_SourceMode =
231        NativeDisplayManager_SourceMode(1);
232    /// display is in mirror mode
233    pub const DISPLAY_SOURCE_MODE_MIRROR: NativeDisplayManager_SourceMode =
234        NativeDisplayManager_SourceMode(2);
235    /// display is in extend mode
236    pub const DISPLAY_SOURCE_MODE_EXTEND: NativeDisplayManager_SourceMode =
237        NativeDisplayManager_SourceMode(3);
238    /// display stands alone
239    pub const DISPLAY_SOURCE_MODE_ALONE: NativeDisplayManager_SourceMode =
240        NativeDisplayManager_SourceMode(4);
241}
242#[repr(transparent)]
243/// Enumerates of the display source mode.
244///
245///
246/// Available since API-level: 20
247///
248/// Version: 1.0
249#[cfg(feature = "api-20")]
250#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
251#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
252pub struct NativeDisplayManager_SourceMode(pub ::core::ffi::c_uint);
253/// Defines the display hdr structure.
254///
255///
256/// Available since API-level: 14
257///
258/// Version: 1.0
259#[cfg(feature = "api-14")]
260#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
261#[repr(C)]
262#[derive(Debug, Copy, Clone)]
263pub struct NativeDisplayManager_DisplayHdrFormat {
264    /// hdrFormat length
265    pub hdrFormatLength: u32,
266    /// hdrFormat pointer
267    pub hdrFormats: *mut u32,
268}
269/// Defines the display color space structure.
270///
271///
272/// Available since API-level: 14
273///
274/// Version: 1.0
275#[cfg(feature = "api-14")]
276#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
277#[repr(C)]
278#[derive(Debug, Copy, Clone)]
279pub struct NativeDisplayManager_DisplayColorSpace {
280    /// color space length
281    pub colorSpaceLength: u32,
282    /// color space pointer
283    pub colorSpaces: *mut u32,
284}
285/// Defines the display structure.
286///
287///
288/// Available since API-level: 14
289///
290/// Version: 1.0
291#[cfg(feature = "api-14")]
292#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
293#[repr(C)]
294#[derive(Debug)]
295pub struct NativeDisplayManager_DisplayInfo {
296    /// display id
297    pub id: u32,
298    /// display name
299    pub name: [::core::ffi::c_char; 33usize],
300    /// display is alive
301    pub isAlive: bool,
302    /// display width
303    pub width: i32,
304    /// display height
305    pub height: i32,
306    /// display physical width
307    pub physicalWidth: i32,
308    /// display physical height
309    pub physicalHeight: i32,
310    /// display refresh rate
311    pub refreshRate: u32,
312    /// display available width
313    pub availableWidth: u32,
314    /// display available height
315    pub availableHeight: u32,
316    /// display density dpi
317    pub densityDPI: f32,
318    /// display density pixels
319    pub densityPixels: f32,
320    /// display scale density
321    pub scaledDensity: f32,
322    /// display xdpi
323    pub xDPI: f32,
324    /// display ydpi
325    pub yDPI: f32,
326    /// display rotation
327    pub rotation: NativeDisplayManager_Rotation,
328    /// display state
329    pub state: NativeDisplayManager_DisplayState,
330    /// display orientation
331    pub orientation: NativeDisplayManager_Orientation,
332    /// display hdr format
333    pub hdrFormat: *mut NativeDisplayManager_DisplayHdrFormat,
334    /// display color space
335    pub colorSpace: *mut NativeDisplayManager_DisplayColorSpace,
336}
337/// Defines the displays structure.
338///
339///
340/// Available since API-level: 14
341///
342/// Version: 1.0
343#[cfg(feature = "api-14")]
344#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
345#[repr(C)]
346#[derive(Debug, Copy, Clone)]
347pub struct NativeDisplayManager_DisplaysInfo {
348    /// displays length
349    pub displaysLength: u32,
350    /// displays pointer
351    pub displaysInfo: *mut NativeDisplayManager_DisplayInfo,
352}