Skip to main content

ohos_drawing_sys/path_iterator/
path_iterator_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)]
6use crate::types::*;
7
8#[cfg(feature = "api-23")]
9#[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
10impl OH_Drawing_PathIteratorVerb {
11    /// Sets the start point.
12    pub const MOVE: OH_Drawing_PathIteratorVerb = OH_Drawing_PathIteratorVerb(0);
13    /// Adds a line segment.
14    pub const LINE: OH_Drawing_PathIteratorVerb = OH_Drawing_PathIteratorVerb(1);
15    /// Adds a quadratic Bezier curve for smooth transitions.
16    pub const QUAD: OH_Drawing_PathIteratorVerb = OH_Drawing_PathIteratorVerb(2);
17    /// Adds a conic curve.
18    pub const CONIC: OH_Drawing_PathIteratorVerb = OH_Drawing_PathIteratorVerb(3);
19    /// Adds a cubic Bezier curve for smooth transitions.
20    pub const CUBIC: OH_Drawing_PathIteratorVerb = OH_Drawing_PathIteratorVerb(4);
21    /// Closes a path.
22    pub const CLOSE: OH_Drawing_PathIteratorVerb = OH_Drawing_PathIteratorVerb(5);
23    /// The path setting is complete.
24    pub const DONE: OH_Drawing_PathIteratorVerb = OH_Drawing_PathIteratorVerb(6);
25}
26#[repr(transparent)]
27/// Enumerates the path operation types contained in an iterator. It is used to read path operation instructions.
28///
29///
30/// Available since API-level: 23
31#[cfg(feature = "api-23")]
32#[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
33#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
34pub struct OH_Drawing_PathIteratorVerb(pub ::core::ffi::c_uint);
35extern "C" {
36    /// Creates an <b>OH_Drawing_PathIterator</b> object from a path.
37    ///
38    /// # Arguments
39    ///
40    /// * `path` - Indicates the pointer to an <b>OH_Drawing_Path</b> object.
41    ///
42    /// * `pathIterator` - The pointer to the <b>OH_Drawing_PathIterator</b> object created returned to the caller.
43    ///
44    /// # Returns
45    ///
46    /// * Returns the error code.
47    /// Returns [`OH_DRAWING_SUCCESS`] if the operation is successful.
48    /// Returns [`OH_DRAWING_ERROR_INCORRECT_PARAMETER`] if path or pathIterator is nullptr.
49    ///
50    /// Available since API-level: 23
51    #[cfg(feature = "api-23")]
52    #[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
53    pub fn OH_Drawing_PathIteratorCreate(
54        path: *const OH_Drawing_Path,
55        pathIterator: *mut *mut OH_Drawing_PathIterator,
56    ) -> crate::error_code::DrawingResult;
57    /// Destroys an <b>OH_Drawing_PathIterator</b> object and reclaims the memory occupied by the object.
58    ///
59    /// # Arguments
60    ///
61    /// * `pathIterator` - Indicates the pointer to an <b>OH_Drawing_PathIterator</b> object.
62    ///
63    /// # Returns
64    ///
65    /// * Returns the error code.
66    /// Returns [`OH_DRAWING_SUCCESS`] if the operation is successful.
67    /// Returns [`OH_DRAWING_ERROR_INCORRECT_PARAMETER`] if pathIterator is nullptr.
68    ///
69    /// Available since API-level: 23
70    #[cfg(feature = "api-23")]
71    #[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
72    pub fn OH_Drawing_PathIteratorDestroy(
73        pathIterator: *mut OH_Drawing_PathIterator,
74    ) -> crate::error_code::DrawingResult;
75    /// Checks if there is a next operation in the path operation iterator.
76    ///
77    /// # Arguments
78    ///
79    /// * `pathIterator` - Indicates the pointer to an <b>OH_Drawing_PathIterator</b> object.
80    ///
81    /// * `hasNext` - Indicates if there is a next operation in the path operation iterator.
82    ///
83    /// # Returns
84    ///
85    /// * Returns the error code.
86    /// Returns [`OH_DRAWING_SUCCESS`] if the operation is successful.
87    /// Returns [`OH_DRAWING_ERROR_INCORRECT_PARAMETER`] if pathIterator or hasNext is nullptr.
88    ///
89    /// Available since API-level: 23
90    #[cfg(feature = "api-23")]
91    #[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
92    pub fn OH_Drawing_PathIteratorHasNext(
93        pathIterator: *const OH_Drawing_PathIterator,
94        hasNext: *mut bool,
95    ) -> crate::error_code::DrawingResult;
96    /// Retrieves the next operation in the path and moves the iterator to that operation.
97    ///
98    /// # Arguments
99    ///
100    /// * `pathIterator` - Indicates the pointer to an <b>OH_Drawing_PathIterator</b> object.
101    ///
102    /// * `points` - Indicates the point array.
103    ///
104    /// * `count` - Indicates the size of the point array.
105    ///
106    /// * `offset` - Indicates the offset into the array where entries should be placed.
107    ///
108    /// * `verb` - Indicates the next operation in the path.
109    ///
110    /// # Returns
111    ///
112    /// * Returns the error code.
113    /// Returns [`OH_DRAWING_SUCCESS`] if the operation is successful.
114    /// Returns [`OH_DRAWING_ERROR_INCORRECT_PARAMETER`] if any of pathIterator, points and verb is nullptr.
115    /// Returns [`OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE`] if count is less than offset plus 4.
116    ///
117    /// Available since API-level: 23
118    #[cfg(feature = "api-23")]
119    #[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
120    pub fn OH_Drawing_PathIteratorNext(
121        pathIterator: *mut OH_Drawing_PathIterator,
122        points: *mut OH_Drawing_Point2D,
123        count: u32,
124        offset: u32,
125        verb: *mut OH_Drawing_PathIteratorVerb,
126    ) -> crate::error_code::DrawingResult;
127    /// Retrieves the next operation in this path, without moving the iterator.
128    ///
129    /// # Arguments
130    ///
131    /// * `pathIterator` - Indicates the pointer to an <b>OH_Drawing_PathIterator</b> object.
132    ///
133    /// * `verb` - Indicates the next operation in the path.
134    ///
135    /// # Returns
136    ///
137    /// * Returns the error code.
138    /// Returns [`OH_DRAWING_SUCCESS`] if the operation is successful.
139    /// Returns [`OH_DRAWING_ERROR_INCORRECT_PARAMETER`] if pathIterator or verb is nullptr.
140    ///
141    /// Available since API-level: 23
142    #[cfg(feature = "api-23")]
143    #[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
144    pub fn OH_Drawing_PathIteratorPeek(
145        pathIterator: *const OH_Drawing_PathIterator,
146        verb: *mut OH_Drawing_PathIteratorVerb,
147    ) -> crate::error_code::DrawingResult;
148}