ohos_window_sys/native_window/external_window/
external_window_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#[cfg(feature = "api-12")]
7use crate::native_buffer::buffer_common::{
8    OH_NativeBuffer_ColorSpace, OH_NativeBuffer_MetadataKey,
9};
10use crate::native_window::BufferHandle;
11#[cfg(feature = "api-12")]
12use ohos_sys_opaque_types::OHIPCParcel;
13#[cfg(feature = "api-11")]
14use ohos_sys_opaque_types::OH_NativeBuffer;
15use ohos_sys_opaque_types::{OHNativeWindow, OHNativeWindowBuffer};
16
17#[repr(C)]
18#[derive(Default)]
19pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
20impl<T> __IncompleteArrayField<T> {
21    #[inline]
22    pub const fn new() -> Self {
23        __IncompleteArrayField(::core::marker::PhantomData, [])
24    }
25    #[inline]
26    pub fn as_ptr(&self) -> *const T {
27        self as *const _ as *const T
28    }
29    #[inline]
30    pub fn as_mut_ptr(&mut self) -> *mut T {
31        self as *mut _ as *mut T
32    }
33    #[inline]
34    pub unsafe fn as_slice(&self, len: usize) -> &[T] {
35        ::core::slice::from_raw_parts(self.as_ptr(), len)
36    }
37    #[inline]
38    pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
39        ::core::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
40    }
41}
42impl<T> ::core::fmt::Debug for __IncompleteArrayField<T> {
43    fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
44        fmt.write_str("__IncompleteArrayField")
45    }
46}
47/// indicates a dirty region where content is updated.
48///
49/// Available since API-level: 8
50#[repr(C)]
51#[derive(Debug, Copy, Clone)]
52pub struct Region {
53    pub rects: *mut Region_Rect,
54    /// if rectNumber is 0, fill the Buffer dirty size by default
55    pub rectNumber: i32,
56}
57/// if rects is nullptr, fill the Buffer dirty size by default
58#[repr(C)]
59#[derive(Debug, Copy, Clone)]
60pub struct Region_Rect {
61    pub x: i32,
62    pub y: i32,
63    pub w: u32,
64    pub h: u32,
65}
66pub mod NativeWindowOperation {
67    /// Indicates the operation code in the function OH_NativeWindow_NativeWindowHandleOpt.
68    ///
69    /// Available since API-level: 8
70    pub type Type = ::core::ffi::c_uint;
71    /// set native window buffer geometry,
72    /// variable parameter in function is
73    /// [in] int32_t width, [in] int32_t height
74    pub const SET_BUFFER_GEOMETRY: Type = 0;
75    /// get native window buffer geometry,
76    /// variable parameter in function is
77    /// [out] int32_t *height, [out] int32_t *width
78    pub const GET_BUFFER_GEOMETRY: Type = 1;
79    /// get native window buffer format,
80    /// variable parameter in function is
81    /// [out] int32_t *format, the enumeration value refers to [`OH_NativeBuffer_Format`].
82    pub const GET_FORMAT: Type = 2;
83    /// set native window buffer format,
84    /// variable parameter in function is
85    /// [in] int32_t format, the enumeration value refers to [`OH_NativeBuffer_Format`].
86    pub const SET_FORMAT: Type = 3;
87    /// get native window buffer usage,
88    /// variable parameter in function is
89    /// [out] uint64_t *usage, the enumeration value refers to [`OH_NativeBuffer_Usage`].
90    pub const GET_USAGE: Type = 4;
91    /// set native window buffer usage,
92    /// variable parameter in function is
93    /// [in] uint64_t usage, the enumeration value refers to [`OH_NativeBuffer_Usage`].
94    pub const SET_USAGE: Type = 5;
95    /// set native window buffer stride,
96    /// variable parameter in function is
97    /// [in] int32_t stride.
98    ///
99    /// **Deprecated** since 16
100    #[deprecated(since = "16")]
101    pub const SET_STRIDE: Type = 6;
102    /// get native window buffer stride,
103    /// variable parameter in function is
104    /// [out] int32_t *stride.
105    ///
106    /// **Deprecated** since 16
107    /// Use [`OH_NativeWindow_GetBufferHandleFromNative`] to get a [`BufferHandleand`] from a buffer
108    /// and then retrieve the stride from the [`BufferHandle`].
109    #[deprecated(since = "16")]
110    pub const GET_STRIDE: Type = 7;
111    /// set native window buffer swap interval,
112    /// variable parameter in function is
113    /// [in] int32_t interval.
114    pub const SET_SWAP_INTERVAL: Type = 8;
115    /// get native window buffer swap interval,
116    /// variable parameter in function is
117    /// [out] int32_t *interval.
118    pub const GET_SWAP_INTERVAL: Type = 9;
119    /// set the timeout in milliseconds when the native window requests a buffer,
120    /// the default value is 3000 milliseconds when not set,
121    /// variable parameter in function is
122    /// [in] int32_t timeout, in milliseconds.
123    pub const SET_TIMEOUT: Type = 10;
124    /// get the timeout in milliseconds when the native window requests a buffer,
125    /// the default value is 3000 milliseconds when not set,
126    /// variable parameter in function is
127    /// [out] int32_t *timeout, in milliseconds.
128    pub const GET_TIMEOUT: Type = 11;
129    /// set native window buffer colorGamut,
130    /// variable parameter in function is
131    /// [in] int32_t colorGamut, the enumeration value refers to [`OH_NativeBuffer_ColorGamut`].
132    pub const SET_COLOR_GAMUT: Type = 12;
133    /// get native window buffer colorGamut,
134    /// variable parameter in function is
135    /// [out] int32_t *colorGamut, the enumeration value refers to [`OH_NativeBuffer_ColorGamut`].
136    pub const GET_COLOR_GAMUT: Type = 13;
137    /// set native window buffer transform,
138    /// variable parameter in function is
139    /// [in] int32_t transform, the enumeration value refers to [`OH_NativeBuffer_TransformType`].
140    pub const SET_TRANSFORM: Type = 14;
141    /// get native window buffer transform,
142    /// variable parameter in function is
143    /// [out] int32_t *transform, the enumeration value refers to [`OH_NativeBuffer_TransformType`].
144    pub const GET_TRANSFORM: Type = 15;
145    /// set native window buffer uiTimestamp,
146    /// variable parameter in function is
147    /// [in] uint64_t uiTimestamp.
148    pub const SET_UI_TIMESTAMP: Type = 16;
149    /// get native window bufferqueue size,
150    /// variable parameter in function is
151    /// [out] int32_t *size.
152    ///
153    /// Available since API-level: 12
154    #[cfg(feature = "api-12")]
155    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
156    pub const GET_BUFFERQUEUE_SIZE: Type = 17;
157    /// set surface source type,
158    /// variable parameter in function is
159    /// [in] int32_t sourceType, the enumeration value refers to [`OHSurfaceSource`].
160    ///
161    /// Available since API-level: 12
162    #[cfg(feature = "api-12")]
163    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
164    pub const SET_SOURCE_TYPE: Type = 18;
165    /// get surface source type,
166    /// variable parameter in function is
167    /// [out] int32_t *sourceType, the enumeration value refers to [`OHSurfaceSource`].
168    ///
169    /// Available since API-level: 12
170    #[cfg(feature = "api-12")]
171    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
172    pub const GET_SOURCE_TYPE: Type = 19;
173    /// set app framework type,
174    /// variable parameter in function is
175    /// [in] char* frameworkType. maximum length is 64 bytes, otherwise the setting fails.
176    ///
177    /// Available since API-level: 12
178    #[cfg(feature = "api-12")]
179    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
180    pub const SET_APP_FRAMEWORK_TYPE: Type = 20;
181    /// get app framework type,
182    /// variable parameter in function is
183    /// [out] char** frameworkType.
184    ///
185    /// Available since API-level: 12
186    #[cfg(feature = "api-12")]
187    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
188    pub const GET_APP_FRAMEWORK_TYPE: Type = 21;
189    /// set hdr white point brightness,
190    /// variable parameter in function is
191    /// [in] float brightness. the value range is 0.0f to 1.0f.
192    ///
193    /// Available since API-level: 12
194    #[cfg(feature = "api-12")]
195    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
196    pub const SET_HDR_WHITE_POINT_BRIGHTNESS: Type = 22;
197    /// set sdr white point brightness,
198    /// variable parameter in function is
199    /// [in] float brightness. the value range is 0.0f to 1.0f.
200    ///
201    /// Available since API-level: 12
202    #[cfg(feature = "api-12")]
203    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
204    pub const SET_SDR_WHITE_POINT_BRIGHTNESS: Type = 23;
205    /// Set native window buffer desiredPresentTimestamp, indicates the desired time to present the buffer.
206    ///
207    /// Which should be generated by std::chrono::steady_clock in nanoseconds.
208    ///
209    /// It is only effective when RenderService is the consumer.
210    ///
211    /// The buffer will wait until desiredPresentTimestamp is reached before being consumed and displayed.
212    ///
213    /// If multiple buffers reach desiredPresentTimestamp, the earlier buffer will be dropped.
214    ///
215    /// This Operation should be called before calling <b>OH_NativeWindow_NativeWindowFlushBuffer</b>.
216    ///
217    /// If desiredPresentTimestamp is greater than 1 second of the consumer-provided timestamp,
218    /// the desiredPresentTimestamp will be ignored.
219    ///
220    /// Variable parameter in function is
221    /// [in] int64_t desiredPresentTimestamp.
222    ///
223    /// Available since API-level: 13
224    #[cfg(feature = "api-13")]
225    #[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
226    pub const SET_DESIRED_PRESENT_TIMESTAMP: Type = 24;
227}
228impl OHScalingMode {
229    /// the window content is not updated until a buffer of
230    /// the window size is received
231    pub const OH_SCALING_MODE_FREEZE: OHScalingMode = OHScalingMode(0);
232    /// the buffer is scaled in two dimensions to match the window size
233    pub const OH_SCALING_MODE_SCALE_TO_WINDOW: OHScalingMode = OHScalingMode(1);
234    /// the buffer is uniformly scaled so that the smaller size of
235    /// the buffer matches the window size
236    pub const OH_SCALING_MODE_SCALE_CROP: OHScalingMode = OHScalingMode(2);
237    /// the window is clipped to the size of the buffer's clipping rectangle
238    /// pixels outside the clipping rectangle are considered fully transparent.
239    pub const OH_SCALING_MODE_NO_SCALE_CROP: OHScalingMode = OHScalingMode(3);
240}
241#[repr(transparent)]
242/// Indicates Scaling Mode.
243///
244/// Available since API-level: 9
245/// = "10")
246/// OHScalingModeV2
247#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
248pub struct OHScalingMode(pub ::core::ffi::c_uint);
249#[cfg(feature = "api-12")]
250#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
251impl OHScalingModeV2 {
252    /// the window content is not updated until a buffer of
253    /// the window size is received
254    pub const OH_SCALING_MODE_FREEZE_V2: OHScalingModeV2 = OHScalingModeV2(0);
255    /// the buffer is scaled in two dimensions to match the window size
256    pub const OH_SCALING_MODE_SCALE_TO_WINDOW_V2: OHScalingModeV2 = OHScalingModeV2(1);
257    /// the buffer is uniformly scaled so that the smaller size of
258    /// the buffer matches the window size
259    pub const OH_SCALING_MODE_SCALE_CROP_V2: OHScalingModeV2 = OHScalingModeV2(2);
260    /// the window is clipped to the size of the buffer's clipping rectangle
261    /// pixels outside the clipping rectangle are considered fully transparent.
262    pub const OH_SCALING_MODE_NO_SCALE_CROP_V2: OHScalingModeV2 = OHScalingModeV2(3);
263    /// Adapt to the buffer and scale proportionally to the buffer size. Prioritize displaying all buffer content.
264    /// If the size is not the same as the window size, fill the unfilled area of the window with a background color.
265    pub const OH_SCALING_MODE_SCALE_FIT_V2: OHScalingModeV2 = OHScalingModeV2(4);
266}
267#[repr(transparent)]
268/// Indicates Scaling Mode.
269///
270/// Available since API-level: 12
271#[cfg(feature = "api-12")]
272#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
273#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
274pub struct OHScalingModeV2(pub ::core::ffi::c_uint);
275impl OHHDRMetadataKey {
276    pub const OH_METAKEY_RED_PRIMARY_X: OHHDRMetadataKey = OHHDRMetadataKey(0);
277    pub const OH_METAKEY_RED_PRIMARY_Y: OHHDRMetadataKey = OHHDRMetadataKey(1);
278    pub const OH_METAKEY_GREEN_PRIMARY_X: OHHDRMetadataKey = OHHDRMetadataKey(2);
279    pub const OH_METAKEY_GREEN_PRIMARY_Y: OHHDRMetadataKey = OHHDRMetadataKey(3);
280    pub const OH_METAKEY_BLUE_PRIMARY_X: OHHDRMetadataKey = OHHDRMetadataKey(4);
281    pub const OH_METAKEY_BLUE_PRIMARY_Y: OHHDRMetadataKey = OHHDRMetadataKey(5);
282    pub const OH_METAKEY_WHITE_PRIMARY_X: OHHDRMetadataKey = OHHDRMetadataKey(6);
283    pub const OH_METAKEY_WHITE_PRIMARY_Y: OHHDRMetadataKey = OHHDRMetadataKey(7);
284    pub const OH_METAKEY_MAX_LUMINANCE: OHHDRMetadataKey = OHHDRMetadataKey(8);
285    pub const OH_METAKEY_MIN_LUMINANCE: OHHDRMetadataKey = OHHDRMetadataKey(9);
286    pub const OH_METAKEY_MAX_CONTENT_LIGHT_LEVEL: OHHDRMetadataKey = OHHDRMetadataKey(10);
287    pub const OH_METAKEY_MAX_FRAME_AVERAGE_LIGHT_LEVEL: OHHDRMetadataKey = OHHDRMetadataKey(11);
288    pub const OH_METAKEY_HDR10_PLUS: OHHDRMetadataKey = OHHDRMetadataKey(12);
289    pub const OH_METAKEY_HDR_VIVID: OHHDRMetadataKey = OHHDRMetadataKey(13);
290}
291#[repr(transparent)]
292/// Enumerates the HDR metadata keys.
293///
294/// Available since API-level: 9
295/// = "10")
296#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
297pub struct OHHDRMetadataKey(pub ::core::ffi::c_uint);
298/// Defines the HDR metadata.
299///
300/// Available since API-level: 9
301/// = "10")
302#[repr(C)]
303#[derive(Debug, Copy, Clone)]
304pub struct OHHDRMetaData {
305    pub key: OHHDRMetadataKey,
306    pub value: f32,
307}
308/// Defines the ExtData Handle
309///
310/// Available since API-level: 9
311/// = "10")
312#[repr(C)]
313#[derive(Debug)]
314pub struct OHExtDataHandle {
315    pub fd: i32,
316    pub reserveInts: u32,
317    pub reserve: __IncompleteArrayField<i32>,
318}
319#[cfg(feature = "api-12")]
320#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
321impl OHSurfaceSource {
322    pub const OH_SURFACE_SOURCE_DEFAULT: OHSurfaceSource = OHSurfaceSource(0);
323    pub const OH_SURFACE_SOURCE_UI: OHSurfaceSource = OHSurfaceSource(1);
324    pub const OH_SURFACE_SOURCE_GAME: OHSurfaceSource = OHSurfaceSource(2);
325    pub const OH_SURFACE_SOURCE_CAMERA: OHSurfaceSource = OHSurfaceSource(3);
326    pub const OH_SURFACE_SOURCE_VIDEO: OHSurfaceSource = OHSurfaceSource(4);
327}
328#[repr(transparent)]
329/// Indicates the source type of surface.
330///
331/// Available since API-level: 12
332#[cfg(feature = "api-12")]
333#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
334#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
335pub struct OHSurfaceSource(pub ::core::ffi::c_uint);
336extern "C" {
337    /// Creates a <b>OHNativeWindow</b> instance. A new <b>OHNativeWindow</b> instance is created each time this function is called.
338    ///
339    ///
340    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
341    /// # Arguments
342    ///
343    /// * `pSurface` - Indicates the pointer to a <b>ProduceSurface</b>. The type is a pointer to <b>sptr<OHOS::Surface></b>.
344    ///
345    /// # Returns
346    ///
347    /// * Returns the pointer to the <b>OHNativeWindow</b> instance created.
348    ///
349    /// Available since API-level: 8
350    ///
351    /// Version: 1.0
352    ///
353    /// **Deprecated** since 12
354    #[deprecated(since = "12")]
355    pub fn OH_NativeWindow_CreateNativeWindow(
356        pSurface: *mut ::core::ffi::c_void,
357    ) -> *mut OHNativeWindow;
358    /// Decreases the reference count of a <b>OHNativeWindow</b> instance by 1,
359    /// and when the reference count reaches 0, destroys the instance.
360    ///
361    /// This interface is a non-thread-safe type interface.
362    ///
363    ///
364    ///
365    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
366    /// # Arguments
367    ///
368    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
369    ///
370    /// Available since API-level: 8
371    ///
372    /// Version: 1.0
373    pub fn OH_NativeWindow_DestroyNativeWindow(window: *mut OHNativeWindow);
374    /// Creates a <b>OHNativeWindowBuffer</b> instance. A new <b>OHNativeWindowBuffer</b> instance is created each time this function is called.
375    ///
376    ///
377    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
378    /// # Arguments
379    ///
380    /// * `pSurfaceBuffer` - Indicates the pointer to a produce buffer. The type is <b>sptr<OHOS::SurfaceBuffer></b>.
381    ///
382    /// # Returns
383    ///
384    /// * Returns the pointer to the <b>OHNativeWindowBuffer</b> instance created.
385    ///
386    /// Available since API-level: 8
387    ///
388    /// Version: 1.0
389    ///
390    /// **Deprecated** since 12
391    /// OH_NativeWindow_CreateNativeWindowBufferFromNativeBuffer
392    #[deprecated(since = "12")]
393    pub fn OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer(
394        pSurfaceBuffer: *mut ::core::ffi::c_void,
395    ) -> *mut OHNativeWindowBuffer;
396    /// Creates a <b>OHNativeWindowBuffer</b> instance.
397    ///
398    /// A new <b>OHNativeWindowBuffer</b> instance is created each time this function is called.
399    ///
400    /// This interface needs to be used in conjunction with <b>OH_NativeWindow_DestroyNativeWindowBuffer</b>,
401    /// otherwise memory leaks will occur.
402    ///
403    /// This interface is a non-thread-safe type interface.
404    ///
405    ///
406    ///
407    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
408    /// # Arguments
409    ///
410    /// * `nativeBuffer` - Indicates the pointer to a native buffer. The type is <b>OH_NativeBuffer*</b>.
411    ///
412    /// # Returns
413    ///
414    /// * Returns the pointer to the <b>OHNativeWindowBuffer</b> instance created.
415    ///
416    /// Available since API-level: 11
417    ///
418    /// Version: 1.0
419    #[cfg(feature = "api-11")]
420    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
421    pub fn OH_NativeWindow_CreateNativeWindowBufferFromNativeBuffer(
422        nativeBuffer: *mut OH_NativeBuffer,
423    ) -> *mut OHNativeWindowBuffer;
424    /// Decreases the reference count of a <b>OHNativeWindowBuffer</b> instance by 1 and,
425    /// when the reference count reaches 0, destroys the instance.
426    ///
427    /// This interface is a non-thread-safe type interface.
428    ///
429    ///
430    ///
431    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
432    /// # Arguments
433    ///
434    /// * `buffer` - Indicates the pointer to a <b>OHNativeWindowBuffer</b> instance.
435    ///
436    /// Available since API-level: 8
437    ///
438    /// Version: 1.0
439    pub fn OH_NativeWindow_DestroyNativeWindowBuffer(buffer: *mut OHNativeWindowBuffer);
440    /// Requests a <b>OHNativeWindowBuffer</b> through a <b>OHNativeWindow</b> instance for content production.
441    ///
442    /// Before calling this interface, you need to set the width and height of
443    /// <b>OHNativeWindow</b> through <b>SET_BUFFER_GEOMETRY</b>.
444    ///
445    /// This interface needs to be used in conjunction with <b>OH_NativeWindow_NativeWindowFlushBuffer</b>,
446    /// otherwise buffer will be exhausted.
447    ///
448    /// When the fenceFd is used up, you need to close it.
449    ///
450    /// This interface is a non-thread-safe type interface.
451    ///
452    ///
453    ///
454    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
455    /// # Arguments
456    ///
457    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
458    ///
459    /// * `buffer` - Indicates the double pointer to a <b>OHNativeWindowBuffer</b> instance.
460    ///
461    /// * `fenceFd` - Indicates the pointer to a file descriptor handle.
462    ///
463    /// # Returns
464    ///
465    /// * Returns an error code, 0 is success, otherwise, failed.
466    ///
467    /// Available since API-level: 8
468    ///
469    /// Version: 1.0
470    pub fn OH_NativeWindow_NativeWindowRequestBuffer(
471        window: *mut OHNativeWindow,
472        buffer: *mut *mut OHNativeWindowBuffer,
473        fenceFd: *mut ::core::ffi::c_int,
474    ) -> i32;
475    /// Flushes the <b>OHNativeWindowBuffer</b> filled with the content to the buffer queue
476    /// through a <b>OHNativeWindow</b> instance for content consumption.
477    ///
478    /// The fenceFd will be close by system.
479    ///
480    /// This interface is a non-thread-safe type interface.
481    ///
482    ///
483    ///
484    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
485    /// # Arguments
486    ///
487    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
488    ///
489    /// * `buffer` - Indicates the pointer to a <b>OHNativeWindowBuffer</b> instance.
490    ///
491    /// * `fenceFd` - Indicates a file descriptor handle, which is used for timing synchronization.
492    ///
493    /// * `region` - Indicates a dirty region where content is updated.
494    ///
495    /// # Returns
496    ///
497    /// * Returns an error code, 0 is success, otherwise, failed.
498    ///
499    /// Available since API-level: 8
500    ///
501    /// Version: 1.0
502    pub fn OH_NativeWindow_NativeWindowFlushBuffer(
503        window: *mut OHNativeWindow,
504        buffer: *mut OHNativeWindowBuffer,
505        fenceFd: ::core::ffi::c_int,
506        region: Region,
507    ) -> i32;
508    /// Get the last flushed <b>OHNativeWindowBuffer</b> from a <b>OHNativeWindow</b> instance.
509    ///
510    ///
511    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
512    /// # Arguments
513    ///
514    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
515    ///
516    /// * `buffer` - Indicates the pointer to a <b>OHNativeWindowBuffer</b> pointer.
517    ///
518    /// * `fenceFd` - Indicates the pointer to a file descriptor handle.
519    ///
520    /// * `matrix` - Indicates the retrieved 4*4 transform matrix.
521    ///
522    /// # Returns
523    ///
524    /// * Returns an error code, 0 is success, otherwise, failed.
525    ///
526    /// Available since API-level: 11
527    ///
528    /// Version: 1.0
529    ///
530    /// **Deprecated** since 12
531    /// OH_NativeWindow_GetLastFlushedBufferV2
532    #[cfg(feature = "api-11")]
533    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
534    #[deprecated(since = "12")]
535    pub fn OH_NativeWindow_GetLastFlushedBuffer(
536        window: *mut OHNativeWindow,
537        buffer: *mut *mut OHNativeWindowBuffer,
538        fenceFd: *mut ::core::ffi::c_int,
539        matrix: *mut f32,
540    ) -> i32;
541    /// Returns the <b>OHNativeWindowBuffer</b> to the buffer queue through a <b>OHNativeWindow</b> instance,
542    /// without filling in any content. The <b>OHNativeWindowBuffer</b> can be used for another request.
543    ///
544    /// This interface is a non-thread-safe type interface.
545    ///
546    ///
547    ///
548    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
549    /// # Arguments
550    ///
551    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
552    ///
553    /// * `buffer` - Indicates the pointer to a <b>OHNativeWindowBuffer</b> instance.
554    ///
555    /// # Returns
556    ///
557    /// * Returns an error code, 0 is success, otherwise, failed.
558    ///
559    /// Available since API-level: 8
560    ///
561    /// Version: 1.0
562    pub fn OH_NativeWindow_NativeWindowAbortBuffer(
563        window: *mut OHNativeWindow,
564        buffer: *mut OHNativeWindowBuffer,
565    ) -> i32;
566    /// Sets or obtains the attributes of a native window, including the width, height, and content format.
567    ///
568    /// This interface is a non-thread-safe type interface.
569    ///
570    ///
571    /// <p><strong>API Note</strong>
572    ///
573    /// <strong>Performance Note</strong>
574    /// <p>By default, the window buffer in the current operating system is accessed via the CPU. If an application
575    /// does not need to access the window buffer data using the CPU, it can proactively disable CPU access to
576    /// enhance energy efficiency and reduce power consumption.
577    /// </p>
578    /// <p>For details about how to optimize power consumption for data read/write operations in data buffers,
579    /// see [How do I proactively disable CPU access to window buffers to reduce power consumption?][`https://developer.huawei.com/consumer/en/doc/harmonyos-faqs/faqs-arkgraphics-2d-14`].</p>
580    /// </p>
581    ///
582    ///
583    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
584    /// # Arguments
585    ///
586    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
587    ///
588    /// * `code` - Indicates the operation code, pointer to <b>NativeWindowOperation</b>.
589    ///
590    /// * `...` - variable parameter, must correspond to code one-to-one.
591    ///
592    /// # Returns
593    ///
594    /// * Returns an error code, 0 is success, otherwise, failed.
595    ///
596    /// Available since API-level: 8
597    ///
598    /// Version: 1.0
599    pub fn OH_NativeWindow_NativeWindowHandleOpt(
600        window: *mut OHNativeWindow,
601        code: ::core::ffi::c_int,
602        ...
603    ) -> i32;
604    /// Obtains the pointer to a <b>BufferHandle</b> of a <b>OHNativeWindowBuffer</b> instance.
605    ///
606    /// This interface is a non-thread-safe type interface.
607    ///
608    ///
609    ///
610    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
611    /// # Arguments
612    ///
613    /// * `buffer` - Indicates the pointer to a <b>OHNativeWindowBuffer</b> instance.
614    ///
615    /// # Returns
616    ///
617    /// * Returns the pointer to the <b>BufferHandle</b> instance obtained.
618    ///
619    /// Available since API-level: 8
620    ///
621    /// Version: 1.0
622    pub fn OH_NativeWindow_GetBufferHandleFromNative(
623        buffer: *mut OHNativeWindowBuffer,
624    ) -> *mut BufferHandle;
625    /// Adds the reference count of a native object.
626    ///
627    /// This interface needs to be used in conjunction with <b>OH_NativeWindow_NativeObjectUnreference</b>,
628    /// otherwise memory leaks will occur.
629    ///
630    /// This interface is a non-thread-safe type interface.
631    ///
632    ///
633    ///
634    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
635    /// # Arguments
636    ///
637    /// * `obj` - Indicates the pointer to a <b>OHNativeWindow</b> or <b>OHNativeWindowBuffer</b> instance.
638    ///
639    /// # Returns
640    ///
641    /// * Returns an error code, 0 is success, otherwise, failed.
642    ///
643    /// Available since API-level: 8
644    ///
645    /// Version: 1.0
646    pub fn OH_NativeWindow_NativeObjectReference(obj: *mut ::core::ffi::c_void) -> i32;
647    /// Decreases the reference count of a native object and,
648    /// when the reference count reaches 0, destroys this object.
649    ///
650    /// This interface is a non-thread-safe type interface.
651    ///
652    ///
653    ///
654    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
655    /// # Arguments
656    ///
657    /// * `obj` - Indicates the pointer to a <b>OHNativeWindow</b> or <b>OHNativeWindowBuffer</b> instance.
658    ///
659    /// # Returns
660    ///
661    /// * Returns an error code, 0 is success, otherwise, failed.
662    ///
663    /// Available since API-level: 8
664    ///
665    /// Version: 1.0
666    pub fn OH_NativeWindow_NativeObjectUnreference(obj: *mut ::core::ffi::c_void) -> i32;
667    /// Obtains the magic ID of a native object.
668    ///
669    /// This interface is a non-thread-safe type interface.
670    ///
671    ///
672    ///
673    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
674    /// # Arguments
675    ///
676    /// * `obj` - Indicates the pointer to a <b>OHNativeWindow</b> or <b>OHNativeWindowBuffer</b> instance.
677    ///
678    /// # Returns
679    ///
680    /// * Returns the magic ID, which is unique for each native object.
681    ///
682    /// Available since API-level: 8
683    ///
684    /// Version: 1.0
685    pub fn OH_NativeWindow_GetNativeObjectMagic(obj: *mut ::core::ffi::c_void) -> i32;
686    /// Sets scalingMode of a native window.
687    ///
688    ///
689    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
690    /// # Arguments
691    ///
692    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
693    ///
694    /// * `sequence` - Indicates the sequence to a produce buffer.
695    ///
696    /// * `scalingMode` - Indicates the enum value to <b>OHScalingMode</b>
697    ///
698    /// # Returns
699    ///
700    /// * Returns an error code, 0 is success, otherwise, failed.
701    ///
702    /// Available since API-level: 9
703    ///
704    /// Version: 1.0
705    /// = "10")
706    /// OH_NativeWindow_NativeWindowSetScalingModeV2
707    pub fn OH_NativeWindow_NativeWindowSetScalingMode(
708        window: *mut OHNativeWindow,
709        sequence: u32,
710        scalingMode: OHScalingMode,
711    ) -> i32;
712    /// Sets metaData of a native window.
713    ///
714    ///
715    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
716    /// # Arguments
717    ///
718    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
719    ///
720    /// * `sequence` - Indicates the sequence to a produce buffer.
721    ///
722    /// * `size` - Indicates the size of a <b>OHHDRMetaData</b> vector.
723    ///
724    /// * `metaDate` - Indicates the pointer to a <b>OHHDRMetaData</b> vector.
725    ///
726    /// # Returns
727    ///
728    /// * Returns an error code, 0 is success, otherwise, failed.
729    ///
730    /// Available since API-level: 9
731    ///
732    /// Version: 1.0
733    /// = "10")
734    pub fn OH_NativeWindow_NativeWindowSetMetaData(
735        window: *mut OHNativeWindow,
736        sequence: u32,
737        size: i32,
738        metaData: *const OHHDRMetaData,
739    ) -> i32;
740    /// Sets metaDataSet of a native window.
741    ///
742    ///
743    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
744    /// # Arguments
745    ///
746    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
747    ///
748    /// * `sequence` - Indicates the sequence to a produce buffer.
749    ///
750    /// * `key` - Indicates the enum value to <b>OHHDRMetadataKey</b>
751    ///
752    /// * `size` - Indicates the size of a uint8_t vector.
753    ///
754    /// * `metaDate` - Indicates the pointer to a uint8_t vector.
755    ///
756    /// # Returns
757    ///
758    /// * Returns an error code, 0 is success, otherwise, failed.
759    ///
760    /// Available since API-level: 9
761    ///
762    /// Version: 1.0
763    /// = "10")
764    pub fn OH_NativeWindow_NativeWindowSetMetaDataSet(
765        window: *mut OHNativeWindow,
766        sequence: u32,
767        key: OHHDRMetadataKey,
768        size: i32,
769        metaData: *const u8,
770    ) -> i32;
771    /// Sets tunnel handle of a native window.
772    ///
773    ///
774    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
775    /// # Arguments
776    ///
777    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
778    ///
779    /// * `handle` - Indicates the pointer to a <b>OHExtDataHandle</b>.
780    ///
781    /// # Returns
782    ///
783    /// * Returns an error code, 0 is success, otherwise, failed.
784    ///
785    /// Available since API-level: 9
786    ///
787    /// Version: 1.0
788    /// = "10")
789    pub fn OH_NativeWindow_NativeWindowSetTunnelHandle(
790        window: *mut OHNativeWindow,
791        handle: *const OHExtDataHandle,
792    ) -> i32;
793    /// Attach a buffer to an <b>OHNativeWindow</b> instance.
794    ///
795    /// This interface needs to be used in conjunction with <b>OH_NativeWindow_NativeWindowDetachBuffer</b>,
796    /// otherwise buffer management will be chaotic.
797    ///
798    /// This interface is a non-thread-safe type interface.
799    ///
800    ///
801    ///
802    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
803    /// # Arguments
804    ///
805    /// * `window` - Indicates the pointer to an <b>OHNativeWindow</b> instance.
806    ///
807    /// * `buffer` - Indicates the pointer to a <b>OHNativeWindowBuffer</b> instance.
808    ///
809    /// # Returns
810    ///
811    /// * Returns an error code, 0 is success, otherwise, failed.
812    ///
813    /// Available since API-level: 12
814    ///
815    /// Version: 1.0
816    #[cfg(feature = "api-12")]
817    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
818    pub fn OH_NativeWindow_NativeWindowAttachBuffer(
819        window: *mut OHNativeWindow,
820        buffer: *mut OHNativeWindowBuffer,
821    ) -> i32;
822    /// Detach a buffer from an <b>OHNativeWindow</b> instance.
823    ///
824    /// This interface is a non-thread-safe type interface.
825    ///
826    ///
827    ///
828    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
829    /// # Arguments
830    ///
831    /// * `window` - Indicates the pointer to an <b>OHNativeWindow</b> instance.
832    ///
833    /// * `buffer` - Indicates the pointer to a <b>OHNativeWindowBuffer</b> instance.
834    ///
835    /// # Returns
836    ///
837    /// * Returns an error code, 0 is success, otherwise, failed.
838    ///
839    /// Available since API-level: 12
840    ///
841    /// Version: 1.0
842    #[cfg(feature = "api-12")]
843    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
844    pub fn OH_NativeWindow_NativeWindowDetachBuffer(
845        window: *mut OHNativeWindow,
846        buffer: *mut OHNativeWindowBuffer,
847    ) -> i32;
848    /// Get surfaceId from native window.
849    ///
850    /// This interface is a non-thread-safe type interface.
851    ///
852    ///
853    ///
854    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
855    /// # Arguments
856    ///
857    /// * `window` - Indicates the pointer to an <b>OHNativeWindow</b> instance.
858    ///
859    /// * `surfaceId` - Indicates the pointer to a surfaceId.
860    ///
861    /// # Returns
862    ///
863    /// * Returns an error code, 0 is success, otherwise, failed.
864    ///
865    /// Available since API-level: 12
866    ///
867    /// Version: 1.0
868    #[cfg(feature = "api-12")]
869    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
870    pub fn OH_NativeWindow_GetSurfaceId(window: *mut OHNativeWindow, surfaceId: *mut u64) -> i32;
871    /// Creates an <b>OHNativeWindow</b> instance.
872    ///
873    /// This interface needs to be used in conjunction with <b>OH_NativeWindow_DestroyNativeWindow</b>,
874    /// otherwise memory leaks will occur.
875    ///
876    /// If there is a concurrent destroy OHNativeWindow, you need to add once and decrement once to the
877    /// OHNativeWindow reference count through <b>OH_NativeWindow_NativeObjectReference</b> and
878    /// <b>OH_NativeWindow_NativeObjectUnreference</b>.
879    ///
880    /// If the surface obtained through surfaceId is created in this process, the surface cannot be obtained
881    /// across processes.
882    ///
883    /// This interface is a non-thread-safe type interface.
884    ///
885    ///
886    ///
887    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
888    /// # Arguments
889    ///
890    /// * `surfaceId` - Indicates the surfaceId to a surface.
891    ///
892    /// * `window` - indicates the pointer to an <b>OHNativeWindow</b> instance.
893    ///
894    /// # Returns
895    ///
896    /// * Returns an error code, 0 is Success, otherwise, failed.
897    ///
898    /// Available since API-level: 12
899    ///
900    /// Version: 1.0
901    #[cfg(feature = "api-12")]
902    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
903    pub fn OH_NativeWindow_CreateNativeWindowFromSurfaceId(
904        surfaceId: u64,
905        window: *mut *mut OHNativeWindow,
906    ) -> i32;
907    /// Sets scalingMode of a native window.
908    ///
909    /// This interface is a non-thread-safe type interface.
910    ///
911    ///
912    ///
913    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
914    /// # Arguments
915    ///
916    /// * `window` - indicates the pointer to an <b>OHNativeWindow</b> instance.
917    ///
918    /// * `scalingMode` - Indicates the enum value to <b>OHScalingModeV2</b>
919    ///
920    /// # Returns
921    ///
922    /// * Returns an error code, 0 is Success, otherwise, failed.
923    ///
924    /// Available since API-level: 12
925    ///
926    /// Version: 1.0
927    #[cfg(feature = "api-12")]
928    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
929    pub fn OH_NativeWindow_NativeWindowSetScalingModeV2(
930        window: *mut OHNativeWindow,
931        scalingMode: OHScalingModeV2,
932    ) -> i32;
933    /// Set native window buffer hold.
934    ///
935    /// This interface is a non-thread-safe type interface.
936    ///
937    ///
938    ///
939    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
940    /// # Arguments
941    ///
942    /// * `window` - Indicates the pointer to an <b>OHNativeWindow</b> instance.
943    ///
944    /// Available since API-level: 12
945    ///
946    /// Version: 1.0
947    #[cfg(feature = "api-12")]
948    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
949    pub fn OH_NativeWindow_SetBufferHold(window: *mut OHNativeWindow);
950    /// Write an OHNativeWindow to an OHIPCParcel.
951    ///
952    /// This interface is a non-thread-safe type interface.
953    ///
954    ///
955    ///
956    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
957    /// # Arguments
958    ///
959    /// * `window` - Indicates the pointer to an <b>OHNativeWindow</b> instance.
960    ///
961    /// * `parcel` - Indicates the pointer to an <b>OHIPCParcel</b> instance.
962    ///
963    /// # Returns
964    ///
965    /// * [`NATIVE_ERROR_OK`] 0 - Success.
966    /// [`NATIVE_ERROR_INVALID_ARGUMENTS`] 40001000 - parcel is NULL or window is NULL.
967    ///
968    /// Available since API-level: 12
969    ///
970    /// Version: 1.0
971    #[cfg(feature = "api-12")]
972    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
973    pub fn OH_NativeWindow_WriteToParcel(
974        window: *mut OHNativeWindow,
975        parcel: *mut OHIPCParcel,
976    ) -> i32;
977    /// Read an OHNativeWindow from an OHIPCParcel.
978    ///
979    /// This interface is a non-thread-safe type interface.
980    ///
981    ///
982    ///
983    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
984    /// # Arguments
985    ///
986    /// * `parcel` - Indicates the pointer to an <b>OHIPCParcel</b> instance.
987    ///
988    /// * `window` - Indicates the pointer to an <b>OHNativeWindow</b> instance.
989    ///
990    /// # Returns
991    ///
992    /// * [`NATIVE_ERROR_OK`] 0 - Success.
993    /// [`NATIVE_ERROR_INVALID_ARGUMENTS`] 40001000 - parcel is NULL or parcel does not contain the window.
994    ///
995    /// Available since API-level: 12
996    ///
997    /// Version: 1.0
998    #[cfg(feature = "api-12")]
999    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1000    pub fn OH_NativeWindow_ReadFromParcel(
1001        parcel: *mut OHIPCParcel,
1002        window: *mut *mut OHNativeWindow,
1003    ) -> i32;
1004    /// Get the last flushed <b>OHNativeWindowBuffer</b> from an <b>OHNativeWindow</b> instance.
1005    ///
1006    /// When the fenceFd is used up, you need to close it.
1007    ///
1008    /// This interface needs to be used in conjunction with <b>OH_NativeWindow_NativeObjectUnreference</b>,
1009    /// otherwise memory leaks will occur.
1010    ///
1011    /// This interface is a non-thread-safe type interface.
1012    ///
1013    ///
1014    ///
1015    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
1016    /// # Arguments
1017    ///
1018    /// * `window` - Indicates the pointer to an <b>OHNativeWindow</b> instance.
1019    ///
1020    /// * `buffer` - Indicates the pointer to an <b>OHNativeWindowBuffer</b> pointer.
1021    ///
1022    /// * `fenceFd` - Indicates the pointer to a file descriptor handle.
1023    ///
1024    /// * `matrix` - Indicates the retrieved 4*4 transform matrix.
1025    ///
1026    /// # Returns
1027    ///
1028    /// * [`NATIVE_ERROR_OK`] 0 - Success.
1029    /// [`NATIVE_ERROR_INVALID_ARGUMENTS`] 40001000 - window is NULL or buffer is NULL or fenceFd is NULL.
1030    /// [`NATIVE_ERROR_BUFFER_STATE_INVALID`] 41207000 - buffer state is wrong.
1031    ///
1032    /// Available since API-level: 12
1033    ///
1034    /// Version: 1.0
1035    #[cfg(feature = "api-12")]
1036    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1037    pub fn OH_NativeWindow_GetLastFlushedBufferV2(
1038        window: *mut OHNativeWindow,
1039        buffer: *mut *mut OHNativeWindowBuffer,
1040        fenceFd: *mut ::core::ffi::c_int,
1041        matrix: *mut f32,
1042    ) -> i32;
1043    /// Set the color space of the native window.
1044    ///
1045    /// This interface is a non-thread-safe type interface.
1046    ///
1047    ///
1048    ///
1049    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
1050    /// # Arguments
1051    ///
1052    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
1053    ///
1054    /// * `colorSpace` - Indicates the color space of native window, see <b>OH_NativeBuffer_ColorSpace</b>.
1055    ///
1056    /// # Returns
1057    ///
1058    /// * [`NATIVE_ERROR_OK`] 0 - Success.
1059    /// [`NATIVE_ERROR_INVALID_ARGUMENTS`] 40001000 - window is NULL.
1060    /// [`NATIVE_ERROR_BUFFER_STATE_INVALID`] 41207000 - Incorrect colorSpace state.
1061    ///
1062    /// Available since API-level: 12
1063    ///
1064    /// Version: 1.0
1065    #[cfg(feature = "api-12")]
1066    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1067    pub fn OH_NativeWindow_SetColorSpace(
1068        window: *mut OHNativeWindow,
1069        colorSpace: OH_NativeBuffer_ColorSpace,
1070    ) -> i32;
1071    /// Get the color space of the native window.
1072    ///
1073    /// This interface is a non-thread-safe type interface.
1074    ///
1075    ///
1076    ///
1077    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
1078    /// # Arguments
1079    ///
1080    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
1081    ///
1082    /// * `colorSpace` - Indicates the color space of native window, see <b>OH_NativeBuffer_ColorSpace</b>.
1083    ///
1084    /// # Returns
1085    ///
1086    /// * [`NATIVE_ERROR_OK`] 0 - Success.
1087    /// [`NATIVE_ERROR_INVALID_ARGUMENTS`] 40001000 - window is NULL.
1088    /// [`NATIVE_ERROR_BUFFER_STATE_INVALID`] 41207000 - Incorrect colorSpace state.
1089    ///
1090    /// Available since API-level: 12
1091    ///
1092    /// Version: 1.0
1093    #[cfg(feature = "api-12")]
1094    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1095    pub fn OH_NativeWindow_GetColorSpace(
1096        window: *mut OHNativeWindow,
1097        colorSpace: *mut OH_NativeBuffer_ColorSpace,
1098    ) -> i32;
1099    /// Set the metadata type of the native window.
1100    ///
1101    /// This interface is a non-thread-safe type interface.
1102    ///
1103    ///
1104    ///
1105    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
1106    /// # Arguments
1107    ///
1108    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
1109    ///
1110    /// * `metadataKey` - Indicates the metadata type of native window, see <b>OH_NativeBuffer_MetadataKey</b>.
1111    ///
1112    /// * `size` - Indicates the size of a uint8_t vector.
1113    ///
1114    /// * `metadata` - Indicates the pointer to a uint8_t vector.
1115    ///
1116    /// # Returns
1117    ///
1118    /// * [`NATIVE_ERROR_OK`] 0 - Success.
1119    /// [`NATIVE_ERROR_INVALID_ARGUMENTS`] 40001000 - window or metadata is NULL.
1120    /// [`NATIVE_ERROR_BUFFER_STATE_INVALID`] 41207000 - Incorrect metadata state.
1121    /// [`NATIVE_ERROR_UNSUPPORTED`] 50102000 - Unsupported metadata key.
1122    ///
1123    /// Available since API-level: 12
1124    ///
1125    /// Version: 1.0
1126    #[cfg(feature = "api-12")]
1127    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1128    pub fn OH_NativeWindow_SetMetadataValue(
1129        window: *mut OHNativeWindow,
1130        metadataKey: OH_NativeBuffer_MetadataKey,
1131        size: i32,
1132        metadata: *mut u8,
1133    ) -> i32;
1134    /// Set the metadata type of the native window.
1135    ///
1136    /// This interface is a non-thread-safe type interface.
1137    ///
1138    ///
1139    ///
1140    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
1141    /// # Arguments
1142    ///
1143    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
1144    ///
1145    /// * `metadataKey` - Indicates the metadata type of native window, see <b>OH_NativeBuffer_MetadataKey</b>.
1146    ///
1147    /// * `size` - Indicates the size of a uint8_t vector.
1148    ///
1149    /// * `metadata` - Indicates the pointer to a uint8_t vector.
1150    ///
1151    /// # Returns
1152    ///
1153    /// * [`NATIVE_ERROR_OK`] 0 - Success.
1154    /// [`NATIVE_ERROR_INVALID_ARGUMENTS`] 40001000 - window, metadata, or size is NULL.
1155    /// [`NATIVE_ERROR_BUFFER_STATE_INVALID`] 41207000 - Incorrect metadata state.
1156    /// [`NATIVE_ERROR_UNSUPPORTED`] 50102000 - Unsupported metadata key.
1157    ///
1158    /// Available since API-level: 12
1159    ///
1160    /// Version: 1.0
1161    #[cfg(feature = "api-12")]
1162    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1163    pub fn OH_NativeWindow_GetMetadataValue(
1164        window: *mut OHNativeWindow,
1165        metadataKey: OH_NativeBuffer_MetadataKey,
1166        size: *mut i32,
1167        metadata: *mut *mut u8,
1168    ) -> i32;
1169    /// Clean all <b>OHNativeWindowBuffer</b> caches of this <b>OHNativeWindow</b>
1170    /// This interface is a non-thread-safe type interface.
1171    ///
1172    ///
1173    ///
1174    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
1175    /// # Arguments
1176    ///
1177    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
1178    ///
1179    /// # Returns
1180    ///
1181    /// * [`NATIVE_ERROR_OK`] 0 - Success.
1182    /// [`NATIVE_ERROR_INVALID_ARGUMENTS`] 40001000 - window is NULL.
1183    /// [`NATIVE_ERROR_CONSUMER_DISCONNECTED`] 41211000 - the consumer is disconnected.
1184    /// [`NATIVE_ERROR_BINDER_ERROR`] 50401000 - ipc send failed.
1185    ///
1186    /// Available since API-level: 19
1187    ///
1188    /// Version: 1.0
1189    #[cfg(feature = "api-19")]
1190    #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1191    pub fn OH_NativeWindow_CleanCache(window: *mut OHNativeWindow) -> i32;
1192}