ohos-window-sys 0.1.6

Raw Bindings to the OpenHarmony native window
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
// automatically generated by rust-bindgen 0.71.1

#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#[cfg(feature = "api-12")]
use crate::native_buffer::buffer_common::{
    OH_NativeBuffer_ColorSpace, OH_NativeBuffer_MetadataKey,
};
use crate::native_window::BufferHandle;
#[cfg(feature = "api-12")]
use ohos_sys_opaque_types::OHIPCParcel;
#[cfg(feature = "api-11")]
use ohos_sys_opaque_types::OH_NativeBuffer;
use ohos_sys_opaque_types::{OHNativeWindow, OHNativeWindowBuffer};

#[repr(C)]
#[derive(Default)]
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
impl<T> __IncompleteArrayField<T> {
    #[inline]
    pub const fn new() -> Self {
        __IncompleteArrayField(::core::marker::PhantomData, [])
    }
    #[inline]
    pub fn as_ptr(&self) -> *const T {
        self as *const _ as *const T
    }
    #[inline]
    pub fn as_mut_ptr(&mut self) -> *mut T {
        self as *mut _ as *mut T
    }
    #[inline]
    pub unsafe fn as_slice(&self, len: usize) -> &[T] {
        ::core::slice::from_raw_parts(self.as_ptr(), len)
    }
    #[inline]
    pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
        ::core::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
    }
}
impl<T> ::core::fmt::Debug for __IncompleteArrayField<T> {
    fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        fmt.write_str("__IncompleteArrayField")
    }
}
/// indicates a dirty region where content is updated.
///
/// Available since API-level: 8
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Region {
    pub rects: *mut Region_Rect,
    /// if rectNumber is 0, fill the Buffer dirty size by default
    pub rectNumber: i32,
}
/// if rects is nullptr, fill the Buffer dirty size by default
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Region_Rect {
    pub x: i32,
    pub y: i32,
    pub w: u32,
    pub h: u32,
}
pub mod NativeWindowOperation {
    /// Indicates the operation code in the function OH_NativeWindow_NativeWindowHandleOpt.
    ///
    /// Available since API-level: 8
    pub type Type = ::core::ffi::c_uint;
    /// set native window buffer geometry,
    /// variable parameter in function is
    /// [in] int32_t width, [in] int32_t height
    pub const SET_BUFFER_GEOMETRY: Type = 0;
    /// get native window buffer geometry,
    /// variable parameter in function is
    /// [out] int32_t *height, [out] int32_t *width
    pub const GET_BUFFER_GEOMETRY: Type = 1;
    /// get native window buffer format,
    /// variable parameter in function is
    /// [out] int32_t *format, the enumeration value refers to [`OH_NativeBuffer_Format`].
    pub const GET_FORMAT: Type = 2;
    /// set native window buffer format,
    /// variable parameter in function is
    /// [in] int32_t format, the enumeration value refers to [`OH_NativeBuffer_Format`].
    pub const SET_FORMAT: Type = 3;
    /// get native window buffer usage,
    /// variable parameter in function is
    /// [out] uint64_t *usage, the enumeration value refers to [`OH_NativeBuffer_Usage`].
    pub const GET_USAGE: Type = 4;
    /// set native window buffer usage,
    /// variable parameter in function is
    /// [in] uint64_t usage, the enumeration value refers to [`OH_NativeBuffer_Usage`].
    pub const SET_USAGE: Type = 5;
    /// set native window buffer stride,
    /// variable parameter in function is
    /// [in] int32_t stride.
    ///
    /// **Deprecated** since 16
    #[deprecated(since = "16")]
    pub const SET_STRIDE: Type = 6;
    /// get native window buffer stride,
    /// variable parameter in function is
    /// [out] int32_t *stride.
    ///
    /// **Deprecated** since 16
    /// Use [`OH_NativeWindow_GetBufferHandleFromNative`] to get a [`BufferHandleand`] from a buffer
    /// and then retrieve the stride from the [`BufferHandle`].
    #[deprecated(since = "16")]
    pub const GET_STRIDE: Type = 7;
    /// set native window buffer swap interval,
    /// variable parameter in function is
    /// [in] int32_t interval.
    pub const SET_SWAP_INTERVAL: Type = 8;
    /// get native window buffer swap interval,
    /// variable parameter in function is
    /// [out] int32_t *interval.
    pub const GET_SWAP_INTERVAL: Type = 9;
    /// set the timeout in milliseconds when the native window requests a buffer,
    /// the default value is 3000 milliseconds when not set,
    /// variable parameter in function is
    /// [in] int32_t timeout, in milliseconds.
    pub const SET_TIMEOUT: Type = 10;
    /// get the timeout in milliseconds when the native window requests a buffer,
    /// the default value is 3000 milliseconds when not set,
    /// variable parameter in function is
    /// [out] int32_t *timeout, in milliseconds.
    pub const GET_TIMEOUT: Type = 11;
    /// set native window buffer colorGamut,
    /// variable parameter in function is
    /// [in] int32_t colorGamut, the enumeration value refers to [`OH_NativeBuffer_ColorGamut`].
    pub const SET_COLOR_GAMUT: Type = 12;
    /// get native window buffer colorGamut,
    /// variable parameter in function is
    /// [out] int32_t *colorGamut, the enumeration value refers to [`OH_NativeBuffer_ColorGamut`].
    pub const GET_COLOR_GAMUT: Type = 13;
    /// set native window buffer transform,
    /// variable parameter in function is
    /// [in] int32_t transform, the enumeration value refers to [`OH_NativeBuffer_TransformType`].
    pub const SET_TRANSFORM: Type = 14;
    /// get native window buffer transform,
    /// variable parameter in function is
    /// [out] int32_t *transform, the enumeration value refers to [`OH_NativeBuffer_TransformType`].
    pub const GET_TRANSFORM: Type = 15;
    /// set native window buffer uiTimestamp,
    /// variable parameter in function is
    /// [in] uint64_t uiTimestamp.
    pub const SET_UI_TIMESTAMP: Type = 16;
    /// get native window bufferqueue size,
    /// variable parameter in function is
    /// [out] int32_t *size.
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub const GET_BUFFERQUEUE_SIZE: Type = 17;
    /// set surface source type,
    /// variable parameter in function is
    /// [in] int32_t sourceType, the enumeration value refers to [`OHSurfaceSource`].
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub const SET_SOURCE_TYPE: Type = 18;
    /// get surface source type,
    /// variable parameter in function is
    /// [out] int32_t *sourceType, the enumeration value refers to [`OHSurfaceSource`].
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub const GET_SOURCE_TYPE: Type = 19;
    /// set app framework type,
    /// variable parameter in function is
    /// [in] char* frameworkType. maximum length is 64 bytes, otherwise the setting fails.
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub const SET_APP_FRAMEWORK_TYPE: Type = 20;
    /// get app framework type,
    /// variable parameter in function is
    /// [out] char** frameworkType.
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub const GET_APP_FRAMEWORK_TYPE: Type = 21;
    /// set hdr white point brightness,
    /// variable parameter in function is
    /// [in] float brightness. the value range is 0.0f to 1.0f.
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub const SET_HDR_WHITE_POINT_BRIGHTNESS: Type = 22;
    /// set sdr white point brightness,
    /// variable parameter in function is
    /// [in] float brightness. the value range is 0.0f to 1.0f.
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub const SET_SDR_WHITE_POINT_BRIGHTNESS: Type = 23;
    /// Set native window buffer desiredPresentTimestamp, indicates the desired time to present the buffer.
    ///
    /// Which should be generated by std::chrono::steady_clock in nanoseconds.
    ///
    /// It is only effective when RenderService is the consumer.
    ///
    /// The buffer will wait until desiredPresentTimestamp is reached before being consumed and displayed.
    ///
    /// If multiple buffers reach desiredPresentTimestamp, the earlier buffer will be dropped.
    ///
    /// This Operation should be called before calling <b>OH_NativeWindow_NativeWindowFlushBuffer</b>.
    ///
    /// If desiredPresentTimestamp is greater than 1 second of the consumer-provided timestamp,
    /// the desiredPresentTimestamp will be ignored.
    ///
    /// Variable parameter in function is
    /// [in] int64_t desiredPresentTimestamp.
    ///
    /// Available since API-level: 13
    #[cfg(feature = "api-13")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
    pub const SET_DESIRED_PRESENT_TIMESTAMP: Type = 24;
}
impl OHScalingMode {
    /// the window content is not updated until a buffer of
    /// the window size is received
    pub const OH_SCALING_MODE_FREEZE: OHScalingMode = OHScalingMode(0);
    /// the buffer is scaled in two dimensions to match the window size
    pub const OH_SCALING_MODE_SCALE_TO_WINDOW: OHScalingMode = OHScalingMode(1);
    /// the buffer is uniformly scaled so that the smaller size of
    /// the buffer matches the window size
    pub const OH_SCALING_MODE_SCALE_CROP: OHScalingMode = OHScalingMode(2);
    /// the window is clipped to the size of the buffer's clipping rectangle
    /// pixels outside the clipping rectangle are considered fully transparent.
    pub const OH_SCALING_MODE_NO_SCALE_CROP: OHScalingMode = OHScalingMode(3);
}
#[repr(transparent)]
/// Indicates Scaling Mode.
///
/// Available since API-level: 9
/// = "10")
/// OHScalingModeV2
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OHScalingMode(pub ::core::ffi::c_uint);
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl OHScalingModeV2 {
    /// the window content is not updated until a buffer of
    /// the window size is received
    pub const OH_SCALING_MODE_FREEZE_V2: OHScalingModeV2 = OHScalingModeV2(0);
    /// the buffer is scaled in two dimensions to match the window size
    pub const OH_SCALING_MODE_SCALE_TO_WINDOW_V2: OHScalingModeV2 = OHScalingModeV2(1);
    /// the buffer is uniformly scaled so that the smaller size of
    /// the buffer matches the window size
    pub const OH_SCALING_MODE_SCALE_CROP_V2: OHScalingModeV2 = OHScalingModeV2(2);
    /// the window is clipped to the size of the buffer's clipping rectangle
    /// pixels outside the clipping rectangle are considered fully transparent.
    pub const OH_SCALING_MODE_NO_SCALE_CROP_V2: OHScalingModeV2 = OHScalingModeV2(3);
    /// Adapt to the buffer and scale proportionally to the buffer size. Prioritize displaying all buffer content.
    /// If the size is not the same as the window size, fill the unfilled area of the window with a background color.
    pub const OH_SCALING_MODE_SCALE_FIT_V2: OHScalingModeV2 = OHScalingModeV2(4);
}
#[repr(transparent)]
/// Indicates Scaling Mode.
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OHScalingModeV2(pub ::core::ffi::c_uint);
impl OHHDRMetadataKey {
    pub const OH_METAKEY_RED_PRIMARY_X: OHHDRMetadataKey = OHHDRMetadataKey(0);
    pub const OH_METAKEY_RED_PRIMARY_Y: OHHDRMetadataKey = OHHDRMetadataKey(1);
    pub const OH_METAKEY_GREEN_PRIMARY_X: OHHDRMetadataKey = OHHDRMetadataKey(2);
    pub const OH_METAKEY_GREEN_PRIMARY_Y: OHHDRMetadataKey = OHHDRMetadataKey(3);
    pub const OH_METAKEY_BLUE_PRIMARY_X: OHHDRMetadataKey = OHHDRMetadataKey(4);
    pub const OH_METAKEY_BLUE_PRIMARY_Y: OHHDRMetadataKey = OHHDRMetadataKey(5);
    pub const OH_METAKEY_WHITE_PRIMARY_X: OHHDRMetadataKey = OHHDRMetadataKey(6);
    pub const OH_METAKEY_WHITE_PRIMARY_Y: OHHDRMetadataKey = OHHDRMetadataKey(7);
    pub const OH_METAKEY_MAX_LUMINANCE: OHHDRMetadataKey = OHHDRMetadataKey(8);
    pub const OH_METAKEY_MIN_LUMINANCE: OHHDRMetadataKey = OHHDRMetadataKey(9);
    pub const OH_METAKEY_MAX_CONTENT_LIGHT_LEVEL: OHHDRMetadataKey = OHHDRMetadataKey(10);
    pub const OH_METAKEY_MAX_FRAME_AVERAGE_LIGHT_LEVEL: OHHDRMetadataKey = OHHDRMetadataKey(11);
    pub const OH_METAKEY_HDR10_PLUS: OHHDRMetadataKey = OHHDRMetadataKey(12);
    pub const OH_METAKEY_HDR_VIVID: OHHDRMetadataKey = OHHDRMetadataKey(13);
}
#[repr(transparent)]
/// Enumerates the HDR metadata keys.
///
/// Available since API-level: 9
/// = "10")
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OHHDRMetadataKey(pub ::core::ffi::c_uint);
/// Defines the HDR metadata.
///
/// Available since API-level: 9
/// = "10")
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OHHDRMetaData {
    pub key: OHHDRMetadataKey,
    pub value: f32,
}
/// Defines the ExtData Handle
///
/// Available since API-level: 9
/// = "10")
#[repr(C)]
#[derive(Debug)]
pub struct OHExtDataHandle {
    pub fd: i32,
    pub reserveInts: u32,
    pub reserve: __IncompleteArrayField<i32>,
}
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl OHSurfaceSource {
    pub const OH_SURFACE_SOURCE_DEFAULT: OHSurfaceSource = OHSurfaceSource(0);
    pub const OH_SURFACE_SOURCE_UI: OHSurfaceSource = OHSurfaceSource(1);
    pub const OH_SURFACE_SOURCE_GAME: OHSurfaceSource = OHSurfaceSource(2);
    pub const OH_SURFACE_SOURCE_CAMERA: OHSurfaceSource = OHSurfaceSource(3);
    pub const OH_SURFACE_SOURCE_VIDEO: OHSurfaceSource = OHSurfaceSource(4);
}
#[repr(transparent)]
/// Indicates the source type of surface.
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OHSurfaceSource(pub ::core::ffi::c_uint);
extern "C" {
    /// Creates a <b>OHNativeWindow</b> instance. A new <b>OHNativeWindow</b> instance is created each time this function is called.
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `pSurface` - Indicates the pointer to a <b>ProduceSurface</b>. The type is a pointer to <b>sptr<OHOS::Surface></b>.
    ///
    /// # Returns
    ///
    /// * Returns the pointer to the <b>OHNativeWindow</b> instance created.
    ///
    /// Available since API-level: 8
    ///
    /// Version: 1.0
    ///
    /// **Deprecated** since 12
    #[deprecated(since = "12")]
    pub fn OH_NativeWindow_CreateNativeWindow(
        pSurface: *mut ::core::ffi::c_void,
    ) -> *mut OHNativeWindow;
    /// Decreases the reference count of a <b>OHNativeWindow</b> instance by 1,
    /// and when the reference count reaches 0, destroys the instance.
    ///
    /// This interface is a non-thread-safe type interface.
    ///
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
    ///
    /// Available since API-level: 8
    ///
    /// Version: 1.0
    pub fn OH_NativeWindow_DestroyNativeWindow(window: *mut OHNativeWindow);
    /// Creates a <b>OHNativeWindowBuffer</b> instance. A new <b>OHNativeWindowBuffer</b> instance is created each time this function is called.
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `pSurfaceBuffer` - Indicates the pointer to a produce buffer. The type is <b>sptr<OHOS::SurfaceBuffer></b>.
    ///
    /// # Returns
    ///
    /// * Returns the pointer to the <b>OHNativeWindowBuffer</b> instance created.
    ///
    /// Available since API-level: 8
    ///
    /// Version: 1.0
    ///
    /// **Deprecated** since 12
    /// OH_NativeWindow_CreateNativeWindowBufferFromNativeBuffer
    #[deprecated(since = "12")]
    pub fn OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer(
        pSurfaceBuffer: *mut ::core::ffi::c_void,
    ) -> *mut OHNativeWindowBuffer;
    /// Creates a <b>OHNativeWindowBuffer</b> instance.
    ///
    /// A new <b>OHNativeWindowBuffer</b> instance is created each time this function is called.
    ///
    /// This interface needs to be used in conjunction with <b>OH_NativeWindow_DestroyNativeWindowBuffer</b>,
    /// otherwise memory leaks will occur.
    ///
    /// This interface is a non-thread-safe type interface.
    ///
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `nativeBuffer` - Indicates the pointer to a native buffer. The type is <b>OH_NativeBuffer*</b>.
    ///
    /// # Returns
    ///
    /// * Returns the pointer to the <b>OHNativeWindowBuffer</b> instance created.
    ///
    /// Available since API-level: 11
    ///
    /// Version: 1.0
    #[cfg(feature = "api-11")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
    pub fn OH_NativeWindow_CreateNativeWindowBufferFromNativeBuffer(
        nativeBuffer: *mut OH_NativeBuffer,
    ) -> *mut OHNativeWindowBuffer;
    /// Decreases the reference count of a <b>OHNativeWindowBuffer</b> instance by 1 and,
    /// when the reference count reaches 0, destroys the instance.
    ///
    /// This interface is a non-thread-safe type interface.
    ///
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `buffer` - Indicates the pointer to a <b>OHNativeWindowBuffer</b> instance.
    ///
    /// Available since API-level: 8
    ///
    /// Version: 1.0
    pub fn OH_NativeWindow_DestroyNativeWindowBuffer(buffer: *mut OHNativeWindowBuffer);
    /// Requests a <b>OHNativeWindowBuffer</b> through a <b>OHNativeWindow</b> instance for content production.
    ///
    /// Before calling this interface, you need to set the width and height of
    /// <b>OHNativeWindow</b> through <b>SET_BUFFER_GEOMETRY</b>.
    ///
    /// This interface needs to be used in conjunction with <b>OH_NativeWindow_NativeWindowFlushBuffer</b>,
    /// otherwise buffer will be exhausted.
    ///
    /// When the fenceFd is used up, you need to close it.
    ///
    /// This interface is a non-thread-safe type interface.
    ///
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
    ///
    /// * `buffer` - Indicates the double pointer to a <b>OHNativeWindowBuffer</b> instance.
    ///
    /// * `fenceFd` - Indicates the pointer to a file descriptor handle.
    ///
    /// # Returns
    ///
    /// * Returns an error code, 0 is success, otherwise, failed.
    ///
    /// Available since API-level: 8
    ///
    /// Version: 1.0
    pub fn OH_NativeWindow_NativeWindowRequestBuffer(
        window: *mut OHNativeWindow,
        buffer: *mut *mut OHNativeWindowBuffer,
        fenceFd: *mut ::core::ffi::c_int,
    ) -> i32;
    /// Flushes the <b>OHNativeWindowBuffer</b> filled with the content to the buffer queue
    /// through a <b>OHNativeWindow</b> instance for content consumption.
    ///
    /// The fenceFd will be close by system.
    ///
    /// This interface is a non-thread-safe type interface.
    ///
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
    ///
    /// * `buffer` - Indicates the pointer to a <b>OHNativeWindowBuffer</b> instance.
    ///
    /// * `fenceFd` - Indicates a file descriptor handle, which is used for timing synchronization.
    ///
    /// * `region` - Indicates a dirty region where content is updated.
    ///
    /// # Returns
    ///
    /// * Returns an error code, 0 is success, otherwise, failed.
    ///
    /// Available since API-level: 8
    ///
    /// Version: 1.0
    pub fn OH_NativeWindow_NativeWindowFlushBuffer(
        window: *mut OHNativeWindow,
        buffer: *mut OHNativeWindowBuffer,
        fenceFd: ::core::ffi::c_int,
        region: Region,
    ) -> i32;
    /// Get the last flushed <b>OHNativeWindowBuffer</b> from a <b>OHNativeWindow</b> instance.
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
    ///
    /// * `buffer` - Indicates the pointer to a <b>OHNativeWindowBuffer</b> pointer.
    ///
    /// * `fenceFd` - Indicates the pointer to a file descriptor handle.
    ///
    /// * `matrix` - Indicates the retrieved 4*4 transform matrix.
    ///
    /// # Returns
    ///
    /// * Returns an error code, 0 is success, otherwise, failed.
    ///
    /// Available since API-level: 11
    ///
    /// Version: 1.0
    ///
    /// **Deprecated** since 12
    /// OH_NativeWindow_GetLastFlushedBufferV2
    #[cfg(feature = "api-11")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
    #[deprecated(since = "12")]
    pub fn OH_NativeWindow_GetLastFlushedBuffer(
        window: *mut OHNativeWindow,
        buffer: *mut *mut OHNativeWindowBuffer,
        fenceFd: *mut ::core::ffi::c_int,
        matrix: *mut f32,
    ) -> i32;
    /// Returns the <b>OHNativeWindowBuffer</b> to the buffer queue through a <b>OHNativeWindow</b> instance,
    /// without filling in any content. The <b>OHNativeWindowBuffer</b> can be used for another request.
    ///
    /// This interface is a non-thread-safe type interface.
    ///
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
    ///
    /// * `buffer` - Indicates the pointer to a <b>OHNativeWindowBuffer</b> instance.
    ///
    /// # Returns
    ///
    /// * Returns an error code, 0 is success, otherwise, failed.
    ///
    /// Available since API-level: 8
    ///
    /// Version: 1.0
    pub fn OH_NativeWindow_NativeWindowAbortBuffer(
        window: *mut OHNativeWindow,
        buffer: *mut OHNativeWindowBuffer,
    ) -> i32;
    /// Sets or obtains the attributes of a native window, including the width, height, and content format.
    ///
    /// This interface is a non-thread-safe type interface.
    ///
    ///
    /// <p><strong>API Note</strong>
    ///
    /// <strong>Performance Note</strong>
    /// <p>By default, the window buffer in the current operating system is accessed via the CPU. If an application
    /// does not need to access the window buffer data using the CPU, it can proactively disable CPU access to
    /// enhance energy efficiency and reduce power consumption.
    /// </p>
    /// <p>For details about how to optimize power consumption for data read/write operations in data buffers,
    /// 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>
    /// </p>
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
    ///
    /// * `code` - Indicates the operation code, pointer to <b>NativeWindowOperation</b>.
    ///
    /// * `...` - variable parameter, must correspond to code one-to-one.
    ///
    /// # Returns
    ///
    /// * Returns an error code, 0 is success, otherwise, failed.
    ///
    /// Available since API-level: 8
    ///
    /// Version: 1.0
    pub fn OH_NativeWindow_NativeWindowHandleOpt(
        window: *mut OHNativeWindow,
        code: ::core::ffi::c_int,
        ...
    ) -> i32;
    /// Obtains the pointer to a <b>BufferHandle</b> of a <b>OHNativeWindowBuffer</b> instance.
    ///
    /// This interface is a non-thread-safe type interface.
    ///
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `buffer` - Indicates the pointer to a <b>OHNativeWindowBuffer</b> instance.
    ///
    /// # Returns
    ///
    /// * Returns the pointer to the <b>BufferHandle</b> instance obtained.
    ///
    /// Available since API-level: 8
    ///
    /// Version: 1.0
    pub fn OH_NativeWindow_GetBufferHandleFromNative(
        buffer: *mut OHNativeWindowBuffer,
    ) -> *mut BufferHandle;
    /// Adds the reference count of a native object.
    ///
    /// This interface needs to be used in conjunction with <b>OH_NativeWindow_NativeObjectUnreference</b>,
    /// otherwise memory leaks will occur.
    ///
    /// This interface is a non-thread-safe type interface.
    ///
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `obj` - Indicates the pointer to a <b>OHNativeWindow</b> or <b>OHNativeWindowBuffer</b> instance.
    ///
    /// # Returns
    ///
    /// * Returns an error code, 0 is success, otherwise, failed.
    ///
    /// Available since API-level: 8
    ///
    /// Version: 1.0
    pub fn OH_NativeWindow_NativeObjectReference(obj: *mut ::core::ffi::c_void) -> i32;
    /// Decreases the reference count of a native object and,
    /// when the reference count reaches 0, destroys this object.
    ///
    /// This interface is a non-thread-safe type interface.
    ///
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `obj` - Indicates the pointer to a <b>OHNativeWindow</b> or <b>OHNativeWindowBuffer</b> instance.
    ///
    /// # Returns
    ///
    /// * Returns an error code, 0 is success, otherwise, failed.
    ///
    /// Available since API-level: 8
    ///
    /// Version: 1.0
    pub fn OH_NativeWindow_NativeObjectUnreference(obj: *mut ::core::ffi::c_void) -> i32;
    /// Obtains the magic ID of a native object.
    ///
    /// This interface is a non-thread-safe type interface.
    ///
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `obj` - Indicates the pointer to a <b>OHNativeWindow</b> or <b>OHNativeWindowBuffer</b> instance.
    ///
    /// # Returns
    ///
    /// * Returns the magic ID, which is unique for each native object.
    ///
    /// Available since API-level: 8
    ///
    /// Version: 1.0
    pub fn OH_NativeWindow_GetNativeObjectMagic(obj: *mut ::core::ffi::c_void) -> i32;
    /// Sets scalingMode of a native window.
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
    ///
    /// * `sequence` - Indicates the sequence to a produce buffer.
    ///
    /// * `scalingMode` - Indicates the enum value to <b>OHScalingMode</b>
    ///
    /// # Returns
    ///
    /// * Returns an error code, 0 is success, otherwise, failed.
    ///
    /// Available since API-level: 9
    ///
    /// Version: 1.0
    /// = "10")
    /// OH_NativeWindow_NativeWindowSetScalingModeV2
    pub fn OH_NativeWindow_NativeWindowSetScalingMode(
        window: *mut OHNativeWindow,
        sequence: u32,
        scalingMode: OHScalingMode,
    ) -> i32;
    /// Sets metaData of a native window.
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
    ///
    /// * `sequence` - Indicates the sequence to a produce buffer.
    ///
    /// * `size` - Indicates the size of a <b>OHHDRMetaData</b> vector.
    ///
    /// * `metaDate` - Indicates the pointer to a <b>OHHDRMetaData</b> vector.
    ///
    /// # Returns
    ///
    /// * Returns an error code, 0 is success, otherwise, failed.
    ///
    /// Available since API-level: 9
    ///
    /// Version: 1.0
    /// = "10")
    pub fn OH_NativeWindow_NativeWindowSetMetaData(
        window: *mut OHNativeWindow,
        sequence: u32,
        size: i32,
        metaData: *const OHHDRMetaData,
    ) -> i32;
    /// Sets metaDataSet of a native window.
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
    ///
    /// * `sequence` - Indicates the sequence to a produce buffer.
    ///
    /// * `key` - Indicates the enum value to <b>OHHDRMetadataKey</b>
    ///
    /// * `size` - Indicates the size of a uint8_t vector.
    ///
    /// * `metaDate` - Indicates the pointer to a uint8_t vector.
    ///
    /// # Returns
    ///
    /// * Returns an error code, 0 is success, otherwise, failed.
    ///
    /// Available since API-level: 9
    ///
    /// Version: 1.0
    /// = "10")
    pub fn OH_NativeWindow_NativeWindowSetMetaDataSet(
        window: *mut OHNativeWindow,
        sequence: u32,
        key: OHHDRMetadataKey,
        size: i32,
        metaData: *const u8,
    ) -> i32;
    /// Sets tunnel handle of a native window.
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
    ///
    /// * `handle` - Indicates the pointer to a <b>OHExtDataHandle</b>.
    ///
    /// # Returns
    ///
    /// * Returns an error code, 0 is success, otherwise, failed.
    ///
    /// Available since API-level: 9
    ///
    /// Version: 1.0
    /// = "10")
    pub fn OH_NativeWindow_NativeWindowSetTunnelHandle(
        window: *mut OHNativeWindow,
        handle: *const OHExtDataHandle,
    ) -> i32;
    /// Attach a buffer to an <b>OHNativeWindow</b> instance.
    ///
    /// This interface needs to be used in conjunction with <b>OH_NativeWindow_NativeWindowDetachBuffer</b>,
    /// otherwise buffer management will be chaotic.
    ///
    /// This interface is a non-thread-safe type interface.
    ///
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `window` - Indicates the pointer to an <b>OHNativeWindow</b> instance.
    ///
    /// * `buffer` - Indicates the pointer to a <b>OHNativeWindowBuffer</b> instance.
    ///
    /// # Returns
    ///
    /// * Returns an error code, 0 is success, otherwise, failed.
    ///
    /// Available since API-level: 12
    ///
    /// Version: 1.0
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_NativeWindow_NativeWindowAttachBuffer(
        window: *mut OHNativeWindow,
        buffer: *mut OHNativeWindowBuffer,
    ) -> i32;
    /// Detach a buffer from an <b>OHNativeWindow</b> instance.
    ///
    /// This interface is a non-thread-safe type interface.
    ///
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `window` - Indicates the pointer to an <b>OHNativeWindow</b> instance.
    ///
    /// * `buffer` - Indicates the pointer to a <b>OHNativeWindowBuffer</b> instance.
    ///
    /// # Returns
    ///
    /// * Returns an error code, 0 is success, otherwise, failed.
    ///
    /// Available since API-level: 12
    ///
    /// Version: 1.0
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_NativeWindow_NativeWindowDetachBuffer(
        window: *mut OHNativeWindow,
        buffer: *mut OHNativeWindowBuffer,
    ) -> i32;
    /// Get surfaceId from native window.
    ///
    /// This interface is a non-thread-safe type interface.
    ///
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `window` - Indicates the pointer to an <b>OHNativeWindow</b> instance.
    ///
    /// * `surfaceId` - Indicates the pointer to a surfaceId.
    ///
    /// # Returns
    ///
    /// * Returns an error code, 0 is success, otherwise, failed.
    ///
    /// Available since API-level: 12
    ///
    /// Version: 1.0
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_NativeWindow_GetSurfaceId(window: *mut OHNativeWindow, surfaceId: *mut u64) -> i32;
    /// Creates an <b>OHNativeWindow</b> instance.
    ///
    /// This interface needs to be used in conjunction with <b>OH_NativeWindow_DestroyNativeWindow</b>,
    /// otherwise memory leaks will occur.
    ///
    /// If there is a concurrent destroy OHNativeWindow, you need to add once and decrement once to the
    /// OHNativeWindow reference count through <b>OH_NativeWindow_NativeObjectReference</b> and
    /// <b>OH_NativeWindow_NativeObjectUnreference</b>.
    ///
    /// If the surface obtained through surfaceId is created in this process, the surface cannot be obtained
    /// across processes.
    ///
    /// This interface is a non-thread-safe type interface.
    ///
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `surfaceId` - Indicates the surfaceId to a surface.
    ///
    /// * `window` - indicates the pointer to an <b>OHNativeWindow</b> instance.
    ///
    /// # Returns
    ///
    /// * Returns an error code, 0 is Success, otherwise, failed.
    ///
    /// Available since API-level: 12
    ///
    /// Version: 1.0
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_NativeWindow_CreateNativeWindowFromSurfaceId(
        surfaceId: u64,
        window: *mut *mut OHNativeWindow,
    ) -> i32;
    /// Sets scalingMode of a native window.
    ///
    /// This interface is a non-thread-safe type interface.
    ///
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `window` - indicates the pointer to an <b>OHNativeWindow</b> instance.
    ///
    /// * `scalingMode` - Indicates the enum value to <b>OHScalingModeV2</b>
    ///
    /// # Returns
    ///
    /// * Returns an error code, 0 is Success, otherwise, failed.
    ///
    /// Available since API-level: 12
    ///
    /// Version: 1.0
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_NativeWindow_NativeWindowSetScalingModeV2(
        window: *mut OHNativeWindow,
        scalingMode: OHScalingModeV2,
    ) -> i32;
    /// Set native window buffer hold.
    ///
    /// This interface is a non-thread-safe type interface.
    ///
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `window` - Indicates the pointer to an <b>OHNativeWindow</b> instance.
    ///
    /// Available since API-level: 12
    ///
    /// Version: 1.0
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_NativeWindow_SetBufferHold(window: *mut OHNativeWindow);
    /// Write an OHNativeWindow to an OHIPCParcel.
    ///
    /// This interface is a non-thread-safe type interface.
    ///
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `window` - Indicates the pointer to an <b>OHNativeWindow</b> instance.
    ///
    /// * `parcel` - Indicates the pointer to an <b>OHIPCParcel</b> instance.
    ///
    /// # Returns
    ///
    /// * [`NATIVE_ERROR_OK`] 0 - Success.
    /// [`NATIVE_ERROR_INVALID_ARGUMENTS`] 40001000 - parcel is NULL or window is NULL.
    ///
    /// Available since API-level: 12
    ///
    /// Version: 1.0
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_NativeWindow_WriteToParcel(
        window: *mut OHNativeWindow,
        parcel: *mut OHIPCParcel,
    ) -> i32;
    /// Read an OHNativeWindow from an OHIPCParcel.
    ///
    /// This interface is a non-thread-safe type interface.
    ///
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `parcel` - Indicates the pointer to an <b>OHIPCParcel</b> instance.
    ///
    /// * `window` - Indicates the pointer to an <b>OHNativeWindow</b> instance.
    ///
    /// # Returns
    ///
    /// * [`NATIVE_ERROR_OK`] 0 - Success.
    /// [`NATIVE_ERROR_INVALID_ARGUMENTS`] 40001000 - parcel is NULL or parcel does not contain the window.
    ///
    /// Available since API-level: 12
    ///
    /// Version: 1.0
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_NativeWindow_ReadFromParcel(
        parcel: *mut OHIPCParcel,
        window: *mut *mut OHNativeWindow,
    ) -> i32;
    /// Get the last flushed <b>OHNativeWindowBuffer</b> from an <b>OHNativeWindow</b> instance.
    ///
    /// When the fenceFd is used up, you need to close it.
    ///
    /// This interface needs to be used in conjunction with <b>OH_NativeWindow_NativeObjectUnreference</b>,
    /// otherwise memory leaks will occur.
    ///
    /// This interface is a non-thread-safe type interface.
    ///
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `window` - Indicates the pointer to an <b>OHNativeWindow</b> instance.
    ///
    /// * `buffer` - Indicates the pointer to an <b>OHNativeWindowBuffer</b> pointer.
    ///
    /// * `fenceFd` - Indicates the pointer to a file descriptor handle.
    ///
    /// * `matrix` - Indicates the retrieved 4*4 transform matrix.
    ///
    /// # Returns
    ///
    /// * [`NATIVE_ERROR_OK`] 0 - Success.
    /// [`NATIVE_ERROR_INVALID_ARGUMENTS`] 40001000 - window is NULL or buffer is NULL or fenceFd is NULL.
    /// [`NATIVE_ERROR_BUFFER_STATE_INVALID`] 41207000 - buffer state is wrong.
    ///
    /// Available since API-level: 12
    ///
    /// Version: 1.0
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_NativeWindow_GetLastFlushedBufferV2(
        window: *mut OHNativeWindow,
        buffer: *mut *mut OHNativeWindowBuffer,
        fenceFd: *mut ::core::ffi::c_int,
        matrix: *mut f32,
    ) -> i32;
    /// Set the color space of the native window.
    ///
    /// This interface is a non-thread-safe type interface.
    ///
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
    ///
    /// * `colorSpace` - Indicates the color space of native window, see <b>OH_NativeBuffer_ColorSpace</b>.
    ///
    /// # Returns
    ///
    /// * [`NATIVE_ERROR_OK`] 0 - Success.
    /// [`NATIVE_ERROR_INVALID_ARGUMENTS`] 40001000 - window is NULL.
    /// [`NATIVE_ERROR_BUFFER_STATE_INVALID`] 41207000 - Incorrect colorSpace state.
    ///
    /// Available since API-level: 12
    ///
    /// Version: 1.0
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_NativeWindow_SetColorSpace(
        window: *mut OHNativeWindow,
        colorSpace: OH_NativeBuffer_ColorSpace,
    ) -> i32;
    /// Get the color space of the native window.
    ///
    /// This interface is a non-thread-safe type interface.
    ///
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
    ///
    /// * `colorSpace` - Indicates the color space of native window, see <b>OH_NativeBuffer_ColorSpace</b>.
    ///
    /// # Returns
    ///
    /// * [`NATIVE_ERROR_OK`] 0 - Success.
    /// [`NATIVE_ERROR_INVALID_ARGUMENTS`] 40001000 - window is NULL.
    /// [`NATIVE_ERROR_BUFFER_STATE_INVALID`] 41207000 - Incorrect colorSpace state.
    ///
    /// Available since API-level: 12
    ///
    /// Version: 1.0
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_NativeWindow_GetColorSpace(
        window: *mut OHNativeWindow,
        colorSpace: *mut OH_NativeBuffer_ColorSpace,
    ) -> i32;
    /// Set the metadata type of the native window.
    ///
    /// This interface is a non-thread-safe type interface.
    ///
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
    ///
    /// * `metadataKey` - Indicates the metadata type of native window, see <b>OH_NativeBuffer_MetadataKey</b>.
    ///
    /// * `size` - Indicates the size of a uint8_t vector.
    ///
    /// * `metadata` - Indicates the pointer to a uint8_t vector.
    ///
    /// # Returns
    ///
    /// * [`NATIVE_ERROR_OK`] 0 - Success.
    /// [`NATIVE_ERROR_INVALID_ARGUMENTS`] 40001000 - window or metadata is NULL.
    /// [`NATIVE_ERROR_BUFFER_STATE_INVALID`] 41207000 - Incorrect metadata state.
    /// [`NATIVE_ERROR_UNSUPPORTED`] 50102000 - Unsupported metadata key.
    ///
    /// Available since API-level: 12
    ///
    /// Version: 1.0
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_NativeWindow_SetMetadataValue(
        window: *mut OHNativeWindow,
        metadataKey: OH_NativeBuffer_MetadataKey,
        size: i32,
        metadata: *mut u8,
    ) -> i32;
    /// Set the metadata type of the native window.
    ///
    /// This interface is a non-thread-safe type interface.
    ///
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
    ///
    /// * `metadataKey` - Indicates the metadata type of native window, see <b>OH_NativeBuffer_MetadataKey</b>.
    ///
    /// * `size` - Indicates the size of a uint8_t vector.
    ///
    /// * `metadata` - Indicates the pointer to a uint8_t vector.
    ///
    /// # Returns
    ///
    /// * [`NATIVE_ERROR_OK`] 0 - Success.
    /// [`NATIVE_ERROR_INVALID_ARGUMENTS`] 40001000 - window, metadata, or size is NULL.
    /// [`NATIVE_ERROR_BUFFER_STATE_INVALID`] 41207000 - Incorrect metadata state.
    /// [`NATIVE_ERROR_UNSUPPORTED`] 50102000 - Unsupported metadata key.
    ///
    /// Available since API-level: 12
    ///
    /// Version: 1.0
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_NativeWindow_GetMetadataValue(
        window: *mut OHNativeWindow,
        metadataKey: OH_NativeBuffer_MetadataKey,
        size: *mut i32,
        metadata: *mut *mut u8,
    ) -> i32;
    /// Clean all <b>OHNativeWindowBuffer</b> caches of this <b>OHNativeWindow</b>
    /// This interface is a non-thread-safe type interface.
    ///
    ///
    ///
    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow
    /// # Arguments
    ///
    /// * `window` - Indicates the pointer to a <b>OHNativeWindow</b> instance.
    ///
    /// # Returns
    ///
    /// * [`NATIVE_ERROR_OK`] 0 - Success.
    /// [`NATIVE_ERROR_INVALID_ARGUMENTS`] 40001000 - window is NULL.
    /// [`NATIVE_ERROR_CONSUMER_DISCONNECTED`] 41211000 - the consumer is disconnected.
    /// [`NATIVE_ERROR_BINDER_ERROR`] 50401000 - ipc send failed.
    ///
    /// Available since API-level: 19
    ///
    /// Version: 1.0
    #[cfg(feature = "api-19")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
    pub fn OH_NativeWindow_CleanCache(window: *mut OHNativeWindow) -> i32;
}