ohos-window-manager-sys 0.1.3

Raw Bindings to the `window_manager` API of OpenHarmony
Documentation
// automatically generated by rust-bindgen 0.71.1

#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]

pub const OH_DISPLAY_NAME_LENGTH: u32 = 32;
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl NativeDisplayManager_Rotation {
    /// device rotation 0 degree
    pub const DISPLAY_MANAGER_ROTATION_0: NativeDisplayManager_Rotation =
        NativeDisplayManager_Rotation(0);
    /// device rotation 90 degrees
    pub const DISPLAY_MANAGER_ROTATION_90: NativeDisplayManager_Rotation =
        NativeDisplayManager_Rotation(1);
    /// device rotation 180 degrees
    pub const DISPLAY_MANAGER_ROTATION_180: NativeDisplayManager_Rotation =
        NativeDisplayManager_Rotation(2);
    /// device rotation 270 degree
    pub const DISPLAY_MANAGER_ROTATION_270: NativeDisplayManager_Rotation =
        NativeDisplayManager_Rotation(3);
}
#[repr(transparent)]
/// Enumerates rotations.
///
///
/// Available since API-level: 12
///
/// Version: 1.0
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct NativeDisplayManager_Rotation(pub ::core::ffi::c_uint);
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl NativeDisplayManager_Orientation {
    /// device portrait show
    pub const DISPLAY_MANAGER_PORTRAIT: NativeDisplayManager_Orientation =
        NativeDisplayManager_Orientation(0);
    /// device landscape show
    pub const DISPLAY_MANAGER_LANDSCAPE: NativeDisplayManager_Orientation =
        NativeDisplayManager_Orientation(1);
    /// device portrait inverted show
    pub const DISPLAY_MANAGER_PORTRAIT_INVERTED: NativeDisplayManager_Orientation =
        NativeDisplayManager_Orientation(2);
    /// device landscape inverted show
    pub const DISPLAY_MANAGER_LANDSCAPE_INVERTED: NativeDisplayManager_Orientation =
        NativeDisplayManager_Orientation(3);
    /// device unknow show
    pub const DISPLAY_MANAGER_UNKNOWN: NativeDisplayManager_Orientation =
        NativeDisplayManager_Orientation(4);
}
#[repr(transparent)]
/// Enumerates orientations.
///
///
/// Available since API-level: 12
///
/// Version: 1.0
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct NativeDisplayManager_Orientation(pub ::core::ffi::c_uint);
pub type NativeDisplayManagerResult = Result<(), NativeDisplayManagerErrorCode>;
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl NativeDisplayManagerErrorCode {
    /// Operation no permission
    pub const NO_PERMISSION: NativeDisplayManagerErrorCode =
        NativeDisplayManagerErrorCode(const { core::num::NonZero::new(201).unwrap() });
    /// Operation not system app
    pub const NOT_SYSTEM_APP: NativeDisplayManagerErrorCode =
        NativeDisplayManagerErrorCode(const { core::num::NonZero::new(202).unwrap() });
    /// Operation invalid param
    pub const INVALID_PARAM: NativeDisplayManagerErrorCode =
        NativeDisplayManagerErrorCode(const { core::num::NonZero::new(401).unwrap() });
    /// Operation device not supported
    pub const DEVICE_NOT_SUPPORTED: NativeDisplayManagerErrorCode =
        NativeDisplayManagerErrorCode(const { core::num::NonZero::new(801).unwrap() });
    /// Operation screen invalid
    pub const INVALID_SCREEN: NativeDisplayManagerErrorCode =
        NativeDisplayManagerErrorCode(const { core::num::NonZero::new(1400001).unwrap() });
    /// Operation invalid call
    pub const INVALID_CALL: NativeDisplayManagerErrorCode =
        NativeDisplayManagerErrorCode(const { core::num::NonZero::new(1400002).unwrap() });
    /// Operation system abnormal
    pub const SYSTEM_ABNORMAL: NativeDisplayManagerErrorCode =
        NativeDisplayManagerErrorCode(const { core::num::NonZero::new(1400003).unwrap() });
    /// Operation illegal param.
    ///
    ///
    /// Available since API-level: 20
    #[cfg(feature = "api-20")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
    pub const ILLEGAL_PARAM: NativeDisplayManagerErrorCode =
        NativeDisplayManagerErrorCode(const { core::num::NonZero::new(1400004).unwrap() });
}
#[repr(transparent)]
/// Enumerates the result types of the display manager interface.
///
///
/// Available since API-level: 12
///
/// Version: 1.0
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct NativeDisplayManagerErrorCode(pub core::num::NonZero<::core::ffi::c_uint>);
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl NativeDisplayManager_FoldDisplayMode {
    /// display mode unknown
    pub const DISPLAY_MANAGER_FOLD_DISPLAY_MODE_UNKNOWN: NativeDisplayManager_FoldDisplayMode =
        NativeDisplayManager_FoldDisplayMode(0);
    /// display mode full
    pub const DISPLAY_MANAGER_FOLD_DISPLAY_MODE_FULL: NativeDisplayManager_FoldDisplayMode =
        NativeDisplayManager_FoldDisplayMode(1);
    /// display mode main
    pub const DISPLAY_MANAGER_FOLD_DISPLAY_MODE_MAIN: NativeDisplayManager_FoldDisplayMode =
        NativeDisplayManager_FoldDisplayMode(2);
    /// display mode sub
    pub const DISPLAY_MANAGER_FOLD_DISPLAY_MODE_SUB: NativeDisplayManager_FoldDisplayMode =
        NativeDisplayManager_FoldDisplayMode(3);
    /// display mode coordination
    pub const DISPLAY_MANAGER_FOLD_DISPLAY_MODE_COORDINATION: NativeDisplayManager_FoldDisplayMode =
        NativeDisplayManager_FoldDisplayMode(4);
}
#[repr(transparent)]
/// Enumerates the fold display mode.
///
///
/// Available since API-level: 12
///
/// Version: 1.0
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct NativeDisplayManager_FoldDisplayMode(pub ::core::ffi::c_uint);
/// Defines the display rect data structure.
///
///
/// Available since API-level: 12
///
/// Version: 1.0
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct NativeDisplayManager_Rect {
    pub left: i32,
    pub top: i32,
    pub width: u32,
    pub height: u32,
}
/// Defines the display waterfallDisplayAreaRects data structure.
///
///
/// Available since API-level: 12
///
/// Version: 1.0
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct NativeDisplayManager_WaterfallDisplayAreaRects {
    pub left: NativeDisplayManager_Rect,
    pub top: NativeDisplayManager_Rect,
    pub right: NativeDisplayManager_Rect,
    pub bottom: NativeDisplayManager_Rect,
}
/// Defines the display cutout info data structure.
///
///
/// Available since API-level: 12
///
/// Version: 1.0
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct NativeDisplayManager_CutoutInfo {
    pub boundingRectsLength: i32,
    pub boundingRects: *mut NativeDisplayManager_Rect,
    pub waterfallDisplayAreaRects: NativeDisplayManager_WaterfallDisplayAreaRects,
}
#[cfg(feature = "api-14")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
impl NativeDisplayManager_DisplayState {
    /// display state unknown
    pub const DISPLAY_MANAGER_DISPLAY_STATE_UNKNOWN: NativeDisplayManager_DisplayState =
        NativeDisplayManager_DisplayState(0);
    /// display state off
    pub const DISPLAY_MANAGER_DISPLAY_STATE_OFF: NativeDisplayManager_DisplayState =
        NativeDisplayManager_DisplayState(1);
    /// display state on
    pub const DISPLAY_MANAGER_DISPLAY_STATE_ON: NativeDisplayManager_DisplayState =
        NativeDisplayManager_DisplayState(2);
    /// display state doze
    pub const DISPLAY_MANAGER_DISPLAY_STATE_DOZE: NativeDisplayManager_DisplayState =
        NativeDisplayManager_DisplayState(3);
    /// display state doze suspend
    pub const DISPLAY_MANAGER_DISPLAY_STATE_DOZE_SUSPEND: NativeDisplayManager_DisplayState =
        NativeDisplayManager_DisplayState(4);
    /// display state vr
    pub const DISPLAY_MANAGER_DISPLAY_STATE_VR: NativeDisplayManager_DisplayState =
        NativeDisplayManager_DisplayState(5);
    /// display state on suspend
    pub const DISPLAY_MANAGER_DISPLAY_STATE_ON_SUSPEND: NativeDisplayManager_DisplayState =
        NativeDisplayManager_DisplayState(6);
}
#[repr(transparent)]
/// Enumerates of the display state.
///
///
/// Available since API-level: 14
///
/// Version: 1.0
#[cfg(feature = "api-14")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct NativeDisplayManager_DisplayState(pub ::core::ffi::c_uint);
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
impl NativeDisplayManager_SourceMode {
    /// display is not in use
    pub const DISPLAY_SOURCE_MODE_NONE: NativeDisplayManager_SourceMode =
        NativeDisplayManager_SourceMode(0);
    /// display is in main mode
    pub const DISPLAY_SOURCE_MODE_MAIN: NativeDisplayManager_SourceMode =
        NativeDisplayManager_SourceMode(1);
    /// display is in mirror mode
    pub const DISPLAY_SOURCE_MODE_MIRROR: NativeDisplayManager_SourceMode =
        NativeDisplayManager_SourceMode(2);
    /// display is in extend mode
    pub const DISPLAY_SOURCE_MODE_EXTEND: NativeDisplayManager_SourceMode =
        NativeDisplayManager_SourceMode(3);
    /// display stands alone
    pub const DISPLAY_SOURCE_MODE_ALONE: NativeDisplayManager_SourceMode =
        NativeDisplayManager_SourceMode(4);
}
#[repr(transparent)]
/// Enumerates of the display source mode.
///
///
/// Available since API-level: 20
///
/// Version: 1.0
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct NativeDisplayManager_SourceMode(pub ::core::ffi::c_uint);
/// Defines the display hdr structure.
///
///
/// Available since API-level: 14
///
/// Version: 1.0
#[cfg(feature = "api-14")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct NativeDisplayManager_DisplayHdrFormat {
    /// hdrFormat length
    pub hdrFormatLength: u32,
    /// hdrFormat pointer
    pub hdrFormats: *mut u32,
}
/// Defines the display color space structure.
///
///
/// Available since API-level: 14
///
/// Version: 1.0
#[cfg(feature = "api-14")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct NativeDisplayManager_DisplayColorSpace {
    /// color space length
    pub colorSpaceLength: u32,
    /// color space pointer
    pub colorSpaces: *mut u32,
}
/// Defines the display structure.
///
///
/// Available since API-level: 14
///
/// Version: 1.0
#[cfg(feature = "api-14")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
#[repr(C)]
#[derive(Debug)]
pub struct NativeDisplayManager_DisplayInfo {
    /// display id
    pub id: u32,
    /// display name
    pub name: [::core::ffi::c_char; 33usize],
    /// display is alive
    pub isAlive: bool,
    /// display width
    pub width: i32,
    /// display height
    pub height: i32,
    /// display physical width
    pub physicalWidth: i32,
    /// display physical height
    pub physicalHeight: i32,
    /// display refresh rate
    pub refreshRate: u32,
    /// display available width
    pub availableWidth: u32,
    /// display available height
    pub availableHeight: u32,
    /// display density dpi
    pub densityDPI: f32,
    /// display density pixels
    pub densityPixels: f32,
    /// display scale density
    pub scaledDensity: f32,
    /// display xdpi
    pub xDPI: f32,
    /// display ydpi
    pub yDPI: f32,
    /// display rotation
    pub rotation: NativeDisplayManager_Rotation,
    /// display state
    pub state: NativeDisplayManager_DisplayState,
    /// display orientation
    pub orientation: NativeDisplayManager_Orientation,
    /// display hdr format
    pub hdrFormat: *mut NativeDisplayManager_DisplayHdrFormat,
    /// display color space
    pub colorSpace: *mut NativeDisplayManager_DisplayColorSpace,
}
/// Defines the displays structure.
///
///
/// Available since API-level: 14
///
/// Version: 1.0
#[cfg(feature = "api-14")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct NativeDisplayManager_DisplaysInfo {
    /// displays length
    pub displaysLength: u32,
    /// displays pointer
    pub displaysInfo: *mut NativeDisplayManager_DisplayInfo,
}