diff --git a/Cargo.toml b/Cargo.toml index 04dca64..8410adf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,12 +8,16 @@ repository = "https://github.com/openharmony-rs/ohos-sys" keywords = ["OpenHarmony", "HarmonyOS", "ffi"] exclude = ["src/**/*_api11.rs", "src/**/*_api12.rs"] +[workspace] +members = ["components/drawing"] + [dependencies] document-features = { version = "0.2", optional = true } +ohos-drawing-sys = { path = "components/drawing", version = "0.1"} [features] default = ["api-10"] -## Enables bindings to `native_drawing` +## Enables bindings to `native_drawing`. Re-exports `ohos-drawing-sys`. drawing = [] ## Enables bindings to `hilog` hilog = [] diff --git a/components/drawing/Cargo.toml b/components/drawing/Cargo.toml new file mode 100644 index 0000000..bfb3c41 --- /dev/null +++ b/components/drawing/Cargo.toml @@ -0,0 +1,36 @@ +[package] +name = "ohos-drawing-sys" +version = "0.1.0" +edition = "2021" +description = "Bindings to the `native_drawing` API of OpenHarmony OS" +license = "Apache-2.0" +repository = "https://github.com/openharmony-rs/ohos-sys" +keywords = ["OpenHarmony", "HarmonyOS", "ffi", "drawing"] +exclude = ["src/**/*_api11.rs", "src/**/*_api12.rs"] + +[dependencies] +document-features = { version = "0.2", optional = true } + +[features] +default = ["api-10"] + +#! ### OpenHarmony API level +#! This crate by default exposes bindings for API-level 10. +#! Optionally enable one of the `api-*` features to get access to bindings for newer +#! OpenHarmony versions. + +## Enables bindings for OpenHarmony API-level 10. Enabled by default. +## Note: this crate is empty if this feature is not selected. +api-10 = [] +## Enables bindings for OpenHarmony API-level 11 +api-11 = ["api-10"] +## **EXPERIMENTAL**: Enables bindings for OpenHarmony API-level 12 (beta-1). +## Will stabilize once the final version has been released. +api-12 = ["api-11"] +## Document available features when building the documentation +document-features = ["dep:document-features"] + +[package.metadata.docs.rs] +features = ["document-features"] +targets = ["aarch64-unknown-linux-ohos", "armv7-unknown-linux-ohos", "x86_64-unknown-linux-ohos"] +all-features = true diff --git a/src/drawing/bitmap.rs b/components/drawing/src/bitmap.rs similarity index 100% rename from src/drawing/bitmap.rs rename to components/drawing/src/bitmap.rs diff --git a/src/drawing/bitmap/api12_additions.rs b/components/drawing/src/bitmap/api12_additions.rs similarity index 99% rename from src/drawing/bitmap/api12_additions.rs rename to components/drawing/src/bitmap/api12_additions.rs index 6bdafa6..51d9dfb 100644 --- a/src/drawing/bitmap/api12_additions.rs +++ b/components/drawing/src/bitmap/api12_additions.rs @@ -1,4 +1,4 @@ -use crate::drawing::types::{ +use crate::types::{ OH_Drawing_AlphaFormat, OH_Drawing_Bitmap, OH_Drawing_ColorFormat, OH_Drawing_Image_Info, }; diff --git a/src/drawing/bitmap/bitmap_api10.rs b/components/drawing/src/bitmap/bitmap_api10.rs similarity index 99% rename from src/drawing/bitmap/bitmap_api10.rs rename to components/drawing/src/bitmap/bitmap_api10.rs index af08c0c..cf1fba0 100644 --- a/src/drawing/bitmap/bitmap_api10.rs +++ b/components/drawing/src/bitmap/bitmap_api10.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; /** @brief Defines the pixel format of a bitmap, including the color type and alpha type. diff --git a/src/drawing/bitmap/bitmap_api11.rs b/components/drawing/src/bitmap/bitmap_api11.rs similarity index 99% rename from src/drawing/bitmap/bitmap_api11.rs rename to components/drawing/src/bitmap/bitmap_api11.rs index af08c0c..cf1fba0 100644 --- a/src/drawing/bitmap/bitmap_api11.rs +++ b/components/drawing/src/bitmap/bitmap_api11.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; /** @brief Defines the pixel format of a bitmap, including the color type and alpha type. diff --git a/src/drawing/bitmap/bitmap_api12.rs b/components/drawing/src/bitmap/bitmap_api12.rs similarity index 99% rename from src/drawing/bitmap/bitmap_api12.rs rename to components/drawing/src/bitmap/bitmap_api12.rs index ac2d99d..d3ed775 100644 --- a/src/drawing/bitmap/bitmap_api12.rs +++ b/components/drawing/src/bitmap/bitmap_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; /** @brief Defines the pixel format of a bitmap, including the color type and alpha type. diff --git a/src/drawing/brush.rs b/components/drawing/src/brush.rs similarity index 100% rename from src/drawing/brush.rs rename to components/drawing/src/brush.rs diff --git a/src/drawing/brush/api11_additions.rs b/components/drawing/src/brush/api11_additions.rs similarity index 95% rename from src/drawing/brush/api11_additions.rs rename to components/drawing/src/brush/api11_additions.rs index 6e45d12..3250de2 100644 --- a/src/drawing/brush/api11_additions.rs +++ b/components/drawing/src/brush/api11_additions.rs @@ -1,6 +1,6 @@ #![allow(non_snake_case)] -use crate::drawing::types::{OH_Drawing_Brush, OH_Drawing_Filter, OH_Drawing_ShaderEffect}; +use crate::types::{OH_Drawing_Brush, OH_Drawing_Filter, OH_Drawing_ShaderEffect}; extern "C" { /** @brief Obtains the alpha of a brush. The alpha is used by the brush to fill in a shape. diff --git a/src/drawing/brush/api12_additions.rs b/components/drawing/src/brush/api12_additions.rs similarity index 98% rename from src/drawing/brush/api12_additions.rs rename to components/drawing/src/brush/api12_additions.rs index 0bf71b8..5df1be1 100644 --- a/src/drawing/brush/api12_additions.rs +++ b/components/drawing/src/brush/api12_additions.rs @@ -1,6 +1,6 @@ #![allow(non_snake_case)] -use crate::drawing::types::{ +use crate::types::{ OH_Drawing_BlendMode, OH_Drawing_Brush, OH_Drawing_Filter, OH_Drawing_ShadowLayer, }; diff --git a/src/drawing/brush/brush_api10.rs b/components/drawing/src/brush/brush_api10.rs similarity index 98% rename from src/drawing/brush/brush_api10.rs rename to components/drawing/src/brush/brush_api10.rs index a44ea28..4303921 100644 --- a/src/drawing/brush/brush_api10.rs +++ b/components/drawing/src/brush/brush_api10.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_Brush object. diff --git a/src/drawing/brush/brush_api11.rs b/components/drawing/src/brush/brush_api11.rs similarity index 99% rename from src/drawing/brush/brush_api11.rs rename to components/drawing/src/brush/brush_api11.rs index dbf393b..54556f1 100644 --- a/src/drawing/brush/brush_api11.rs +++ b/components/drawing/src/brush/brush_api11.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_Brush object. diff --git a/src/drawing/brush/brush_api12.rs b/components/drawing/src/brush/brush_api12.rs similarity index 99% rename from src/drawing/brush/brush_api12.rs rename to components/drawing/src/brush/brush_api12.rs index d92f714..60c25cb 100644 --- a/src/drawing/brush/brush_api12.rs +++ b/components/drawing/src/brush/brush_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_Brush object. diff --git a/src/drawing/canvas.rs b/components/drawing/src/canvas.rs similarity index 100% rename from src/drawing/canvas.rs rename to components/drawing/src/canvas.rs diff --git a/src/drawing/canvas/api11_additions.rs b/components/drawing/src/canvas/api11_additions.rs similarity index 99% rename from src/drawing/canvas/api11_additions.rs rename to components/drawing/src/canvas/api11_additions.rs index b3577ff..998995b 100644 --- a/src/drawing/canvas/api11_additions.rs +++ b/components/drawing/src/canvas/api11_additions.rs @@ -1,7 +1,7 @@ #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::{ +use crate::types::{ OH_Drawing_Bitmap, OH_Drawing_Canvas, OH_Drawing_Path, OH_Drawing_Point, OH_Drawing_Rect, OH_Drawing_RoundRect, OH_Drawing_TextBlob, }; diff --git a/src/drawing/canvas/api12_additions.rs b/components/drawing/src/canvas/api12_additions.rs similarity index 99% rename from src/drawing/canvas/api12_additions.rs rename to components/drawing/src/canvas/api12_additions.rs index a13086d..b32e231 100644 --- a/src/drawing/canvas/api12_additions.rs +++ b/components/drawing/src/canvas/api12_additions.rs @@ -2,8 +2,8 @@ #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::canvas::OH_Drawing_CanvasClipOp; -use crate::drawing::types::{ +use crate::canvas::OH_Drawing_CanvasClipOp; +use crate::types::{ OH_Drawing_Bitmap, OH_Drawing_BlendMode, OH_Drawing_Brush, OH_Drawing_Canvas, OH_Drawing_Image, OH_Drawing_Image_Info, OH_Drawing_Matrix, OH_Drawing_Path, OH_Drawing_PixelMap, OH_Drawing_Point2D, OH_Drawing_Point3D, OH_Drawing_Rect, OH_Drawing_Region, diff --git a/src/drawing/canvas/canvas_api10.rs b/components/drawing/src/canvas/canvas_api10.rs similarity index 99% rename from src/drawing/canvas/canvas_api10.rs rename to components/drawing/src/canvas/canvas_api10.rs index f769b15..4727a1a 100644 --- a/src/drawing/canvas/canvas_api10.rs +++ b/components/drawing/src/canvas/canvas_api10.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_Canvas object. diff --git a/src/drawing/canvas/canvas_api11.rs b/components/drawing/src/canvas/canvas_api11.rs similarity index 99% rename from src/drawing/canvas/canvas_api11.rs rename to components/drawing/src/canvas/canvas_api11.rs index 60bed72..7630dd9 100644 --- a/src/drawing/canvas/canvas_api11.rs +++ b/components/drawing/src/canvas/canvas_api11.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; impl OH_Drawing_CanvasClipOp { /// Clip with difference. diff --git a/src/drawing/canvas/canvas_api12.rs b/components/drawing/src/canvas/canvas_api12.rs similarity index 99% rename from src/drawing/canvas/canvas_api12.rs rename to components/drawing/src/canvas/canvas_api12.rs index 4630bc9..65e7930 100644 --- a/src/drawing/canvas/canvas_api12.rs +++ b/components/drawing/src/canvas/canvas_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; impl OH_Drawing_SrcRectConstraint { /// Using sampling only inside bounds in a slower manner. diff --git a/src/drawing/color.rs b/components/drawing/src/color.rs similarity index 100% rename from src/drawing/color.rs rename to components/drawing/src/color.rs diff --git a/src/drawing/color/color_api10.rs b/components/drawing/src/color/color_api10.rs similarity index 96% rename from src/drawing/color/color_api10.rs rename to components/drawing/src/color/color_api10.rs index 100bd20..5a244fb 100644 --- a/src/drawing/color/color_api10.rs +++ b/components/drawing/src/color/color_api10.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Converts four variables (alpha, red, green, and blue) into a 32-bit (ARGB) variable that describes a color. diff --git a/src/drawing/color/color_api11.rs b/components/drawing/src/color/color_api11.rs similarity index 96% rename from src/drawing/color/color_api11.rs rename to components/drawing/src/color/color_api11.rs index 100bd20..5a244fb 100644 --- a/src/drawing/color/color_api11.rs +++ b/components/drawing/src/color/color_api11.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Converts four variables (alpha, red, green, and blue) into a 32-bit (ARGB) variable that describes a color. diff --git a/src/drawing/color/color_api12.rs b/components/drawing/src/color/color_api12.rs similarity index 96% rename from src/drawing/color/color_api12.rs rename to components/drawing/src/color/color_api12.rs index 100bd20..5a244fb 100644 --- a/src/drawing/color/color_api12.rs +++ b/components/drawing/src/color/color_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Converts four variables (alpha, red, green, and blue) into a 32-bit (ARGB) variable that describes a color. diff --git a/src/drawing/color_filter.rs b/components/drawing/src/color_filter.rs similarity index 100% rename from src/drawing/color_filter.rs rename to components/drawing/src/color_filter.rs diff --git a/src/drawing/color_filter/color_filter_api11.rs b/components/drawing/src/color_filter/color_filter_api11.rs similarity index 99% rename from src/drawing/color_filter/color_filter_api11.rs rename to components/drawing/src/color_filter/color_filter_api11.rs index 05cb30e..0526fa3 100644 --- a/src/drawing/color_filter/color_filter_api11.rs +++ b/components/drawing/src/color_filter/color_filter_api11.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_ColorFilter with a blend mode. diff --git a/src/drawing/color_filter/color_filter_api12.rs b/components/drawing/src/color_filter/color_filter_api12.rs similarity index 99% rename from src/drawing/color_filter/color_filter_api12.rs rename to components/drawing/src/color_filter/color_filter_api12.rs index 05cb30e..0526fa3 100644 --- a/src/drawing/color_filter/color_filter_api12.rs +++ b/components/drawing/src/color_filter/color_filter_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_ColorFilter with a blend mode. diff --git a/src/drawing/color_space.rs b/components/drawing/src/color_space.rs similarity index 100% rename from src/drawing/color_space.rs rename to components/drawing/src/color_space.rs diff --git a/src/drawing/color_space/color_space_api12.rs b/components/drawing/src/color_space/color_space_api12.rs similarity index 97% rename from src/drawing/color_space/color_space_api12.rs rename to components/drawing/src/color_space/color_space_api12.rs index df9cd94..57bd935 100644 --- a/src/drawing/color_space/color_space_api12.rs +++ b/components/drawing/src/color_space/color_space_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_ColorSpace object that represents the SRGB color space. diff --git a/src/drawing/error_code.rs b/components/drawing/src/error_code.rs similarity index 100% rename from src/drawing/error_code.rs rename to components/drawing/src/error_code.rs diff --git a/src/drawing/error_code/error_code_api12.rs b/components/drawing/src/error_code/error_code_api12.rs similarity index 97% rename from src/drawing/error_code/error_code_api12.rs rename to components/drawing/src/error_code/error_code_api12.rs index 4e0bde9..9c8a968 100644 --- a/src/drawing/error_code/error_code_api12.rs +++ b/components/drawing/src/error_code/error_code_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; impl OH_Drawing_ErrorCode { /// @error Operation completed successfully. diff --git a/src/drawing/filter.rs b/components/drawing/src/filter.rs similarity index 100% rename from src/drawing/filter.rs rename to components/drawing/src/filter.rs diff --git a/src/drawing/filter/api12_additions.rs b/components/drawing/src/filter/api12_additions.rs similarity index 91% rename from src/drawing/filter/api12_additions.rs rename to components/drawing/src/filter/api12_additions.rs index 754e28e..4821d1b 100644 --- a/src/drawing/filter/api12_additions.rs +++ b/components/drawing/src/filter/api12_additions.rs @@ -1,6 +1,6 @@ #![allow(non_snake_case)] -use crate::drawing::types::{OH_Drawing_ColorFilter, OH_Drawing_Filter, OH_Drawing_ImageFilter}; +use crate::types::{OH_Drawing_ColorFilter, OH_Drawing_Filter, OH_Drawing_ImageFilter}; extern "C" { /** @brief Sets an OH_Drawing_ImageFilter object for an OH_Drawing_Filter object. diff --git a/src/drawing/filter/filter_api11.rs b/components/drawing/src/filter/filter_api11.rs similarity index 98% rename from src/drawing/filter/filter_api11.rs rename to components/drawing/src/filter/filter_api11.rs index 9baf4db..ce9b7c6 100644 --- a/src/drawing/filter/filter_api11.rs +++ b/components/drawing/src/filter/filter_api11.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_Filter object. diff --git a/src/drawing/filter/filter_api12.rs b/components/drawing/src/filter/filter_api12.rs similarity index 98% rename from src/drawing/filter/filter_api12.rs rename to components/drawing/src/filter/filter_api12.rs index 1de530b..ad5a563 100644 --- a/src/drawing/filter/filter_api12.rs +++ b/components/drawing/src/filter/filter_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_Filter object. diff --git a/src/drawing/font.rs b/components/drawing/src/font.rs similarity index 100% rename from src/drawing/font.rs rename to components/drawing/src/font.rs diff --git a/src/drawing/font/api12_additions.rs b/components/drawing/src/font/api12_additions.rs similarity index 99% rename from src/drawing/font/api12_additions.rs rename to components/drawing/src/font/api12_additions.rs index f37c83b..8ec9cae 100644 --- a/src/drawing/font/api12_additions.rs +++ b/components/drawing/src/font/api12_additions.rs @@ -1,7 +1,7 @@ #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::{OH_Drawing_Font, OH_Drawing_TextEncoding, OH_Drawing_Typeface}; +use crate::types::{OH_Drawing_Font, OH_Drawing_TextEncoding, OH_Drawing_Typeface}; impl OH_Drawing_FontHinting { /// glyph outlines unchanged diff --git a/src/drawing/font/font_api11.rs b/components/drawing/src/font/font_api11.rs similarity index 99% rename from src/drawing/font/font_api11.rs rename to components/drawing/src/font/font_api11.rs index ef5d24b..00ff79d 100644 --- a/src/drawing/font/font_api11.rs +++ b/components/drawing/src/font/font_api11.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_Font object. diff --git a/src/drawing/font/font_api12.rs b/components/drawing/src/font/font_api12.rs similarity index 99% rename from src/drawing/font/font_api12.rs rename to components/drawing/src/font/font_api12.rs index 1e1d4ff..e5dcbf5 100644 --- a/src/drawing/font/font_api12.rs +++ b/components/drawing/src/font/font_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; impl OH_Drawing_FontHinting { /// glyph outlines unchanged diff --git a/src/drawing/font_collection.rs b/components/drawing/src/font_collection.rs similarity index 100% rename from src/drawing/font_collection.rs rename to components/drawing/src/font_collection.rs diff --git a/src/drawing/font_collection/api12_additions.rs b/components/drawing/src/font_collection/api12_additions.rs similarity index 94% rename from src/drawing/font_collection/api12_additions.rs rename to components/drawing/src/font_collection/api12_additions.rs index 79ef002..304de4f 100644 --- a/src/drawing/font_collection/api12_additions.rs +++ b/components/drawing/src/font_collection/api12_additions.rs @@ -1,6 +1,6 @@ #![allow(non_snake_case)] -use crate::drawing::text_declaration::OH_Drawing_FontCollection; +use crate::text_declaration::OH_Drawing_FontCollection; extern "C" { /** @brief Disable the font collection fallback. diff --git a/src/drawing/font_collection/font_collection_api10.rs b/components/drawing/src/font_collection/font_collection_api10.rs similarity index 92% rename from src/drawing/font_collection/font_collection_api10.rs rename to components/drawing/src/font_collection/font_collection_api10.rs index eb059f3..13d35b8 100644 --- a/src/drawing/font_collection/font_collection_api10.rs +++ b/components/drawing/src/font_collection/font_collection_api10.rs @@ -3,8 +3,8 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::text_declaration::*; -use crate::drawing::types::*; +use crate::text_declaration::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_FontCollection object. diff --git a/src/drawing/font_collection/font_collection_api11.rs b/components/drawing/src/font_collection/font_collection_api11.rs similarity index 92% rename from src/drawing/font_collection/font_collection_api11.rs rename to components/drawing/src/font_collection/font_collection_api11.rs index eb059f3..13d35b8 100644 --- a/src/drawing/font_collection/font_collection_api11.rs +++ b/components/drawing/src/font_collection/font_collection_api11.rs @@ -3,8 +3,8 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::text_declaration::*; -use crate::drawing::types::*; +use crate::text_declaration::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_FontCollection object. diff --git a/src/drawing/font_collection/font_collection_api12.rs b/components/drawing/src/font_collection/font_collection_api12.rs similarity index 96% rename from src/drawing/font_collection/font_collection_api12.rs rename to components/drawing/src/font_collection/font_collection_api12.rs index 207552f..3165647 100644 --- a/src/drawing/font_collection/font_collection_api12.rs +++ b/components/drawing/src/font_collection/font_collection_api12.rs @@ -3,8 +3,8 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::text_declaration::*; -use crate::drawing::types::*; +use crate::text_declaration::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_FontCollection object. diff --git a/src/drawing/font_mgr.rs b/components/drawing/src/font_mgr.rs similarity index 100% rename from src/drawing/font_mgr.rs rename to components/drawing/src/font_mgr.rs diff --git a/src/drawing/font_mgr/font_mgr_api12.rs b/components/drawing/src/font_mgr/font_mgr_api12.rs similarity index 99% rename from src/drawing/font_mgr/font_mgr_api12.rs rename to components/drawing/src/font_mgr/font_mgr_api12.rs index 60c71c7..612a197 100644 --- a/src/drawing/font_mgr/font_mgr_api12.rs +++ b/components/drawing/src/font_mgr/font_mgr_api12.rs @@ -3,8 +3,8 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::text_typography::*; -use crate::drawing::types::*; +use crate::text_typography::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_FontMgr object. diff --git a/src/drawing/gpu_context.rs b/components/drawing/src/gpu_context.rs similarity index 100% rename from src/drawing/gpu_context.rs rename to components/drawing/src/gpu_context.rs diff --git a/src/drawing/gpu_context/gpu_context_api12.rs b/components/drawing/src/gpu_context/gpu_context_api12.rs similarity index 97% rename from src/drawing/gpu_context/gpu_context_api12.rs rename to components/drawing/src/gpu_context/gpu_context_api12.rs index b7b9e61..d11da53 100644 --- a/src/drawing/gpu_context/gpu_context_api12.rs +++ b/components/drawing/src/gpu_context/gpu_context_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; /** @brief Defines the options about GPU context. diff --git a/src/drawing/image.rs b/components/drawing/src/image.rs similarity index 100% rename from src/drawing/image.rs rename to components/drawing/src/image.rs diff --git a/src/drawing/image/image_api12.rs b/components/drawing/src/image/image_api12.rs similarity index 98% rename from src/drawing/image/image_api12.rs rename to components/drawing/src/image/image_api12.rs index 3c96933..7b50d09 100644 --- a/src/drawing/image/image_api12.rs +++ b/components/drawing/src/image/image_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_Image object. diff --git a/src/drawing/image_filter.rs b/components/drawing/src/image_filter.rs similarity index 100% rename from src/drawing/image_filter.rs rename to components/drawing/src/image_filter.rs diff --git a/src/drawing/image_filter/image_filter_api12.rs b/components/drawing/src/image_filter/image_filter_api12.rs similarity index 97% rename from src/drawing/image_filter/image_filter_api12.rs rename to components/drawing/src/image_filter/image_filter_api12.rs index ff5da22..a80f86a 100644 --- a/src/drawing/image_filter/image_filter_api12.rs +++ b/components/drawing/src/image_filter/image_filter_api12.rs @@ -3,8 +3,8 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::shader_effect::*; -use crate::drawing::types::*; +use crate::shader_effect::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_ImageFilter object that blurs its input by the separate x and y sigmas. diff --git a/src/drawing.rs b/components/drawing/src/lib.rs similarity index 100% rename from src/drawing.rs rename to components/drawing/src/lib.rs diff --git a/src/drawing/mask_filter.rs b/components/drawing/src/mask_filter.rs similarity index 100% rename from src/drawing/mask_filter.rs rename to components/drawing/src/mask_filter.rs diff --git a/src/drawing/mask_filter/mask_filter_api11.rs b/components/drawing/src/mask_filter/mask_filter_api11.rs similarity index 98% rename from src/drawing/mask_filter/mask_filter_api11.rs rename to components/drawing/src/mask_filter/mask_filter_api11.rs index 1821ea8..9cc0e60 100644 --- a/src/drawing/mask_filter/mask_filter_api11.rs +++ b/components/drawing/src/mask_filter/mask_filter_api11.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; impl OH_Drawing_BlurType { /// Fuzzy inside and outside. diff --git a/src/drawing/mask_filter/mask_filter_api12.rs b/components/drawing/src/mask_filter/mask_filter_api12.rs similarity index 98% rename from src/drawing/mask_filter/mask_filter_api12.rs rename to components/drawing/src/mask_filter/mask_filter_api12.rs index 1821ea8..9cc0e60 100644 --- a/src/drawing/mask_filter/mask_filter_api12.rs +++ b/components/drawing/src/mask_filter/mask_filter_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; impl OH_Drawing_BlurType { /// Fuzzy inside and outside. diff --git a/src/drawing/matrix.rs b/components/drawing/src/matrix.rs similarity index 100% rename from src/drawing/matrix.rs rename to components/drawing/src/matrix.rs diff --git a/src/drawing/matrix/api12_additions.rs b/components/drawing/src/matrix/api12_additions.rs similarity index 99% rename from src/drawing/matrix/api12_additions.rs rename to components/drawing/src/matrix/api12_additions.rs index c3e55c8..72c1f69 100644 --- a/src/drawing/matrix/api12_additions.rs +++ b/components/drawing/src/matrix/api12_additions.rs @@ -1,7 +1,7 @@ #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::{OH_Drawing_Matrix, OH_Drawing_Point2D, OH_Drawing_Rect}; +use crate::types::{OH_Drawing_Matrix, OH_Drawing_Point2D, OH_Drawing_Rect}; impl OH_Drawing_ScaleToFit { /// Scales in x and y to fill destination rect. diff --git a/src/drawing/matrix/matrix_api11.rs b/components/drawing/src/matrix/matrix_api11.rs similarity index 98% rename from src/drawing/matrix/matrix_api11.rs rename to components/drawing/src/matrix/matrix_api11.rs index 8c882df..244806f 100644 --- a/src/drawing/matrix/matrix_api11.rs +++ b/components/drawing/src/matrix/matrix_api11.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_Matrix object. diff --git a/src/drawing/matrix/matrix_api12.rs b/components/drawing/src/matrix/matrix_api12.rs similarity index 99% rename from src/drawing/matrix/matrix_api12.rs rename to components/drawing/src/matrix/matrix_api12.rs index 5db9e65..1e2d768 100644 --- a/src/drawing/matrix/matrix_api12.rs +++ b/components/drawing/src/matrix/matrix_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; impl OH_Drawing_ScaleToFit { /// Scales in x and y to fill destination rect. diff --git a/src/drawing/memory_stream.rs b/components/drawing/src/memory_stream.rs similarity index 100% rename from src/drawing/memory_stream.rs rename to components/drawing/src/memory_stream.rs diff --git a/src/drawing/memory_stream/memory_stream_api12.rs b/components/drawing/src/memory_stream/memory_stream_api12.rs similarity index 97% rename from src/drawing/memory_stream/memory_stream_api12.rs rename to components/drawing/src/memory_stream/memory_stream_api12.rs index 72f36c5..fe4c6e5 100644 --- a/src/drawing/memory_stream/memory_stream_api12.rs +++ b/components/drawing/src/memory_stream/memory_stream_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Creates a OH_Drawing_MemoryStream object. diff --git a/src/drawing/path.rs b/components/drawing/src/path.rs similarity index 100% rename from src/drawing/path.rs rename to components/drawing/src/path.rs diff --git a/src/drawing/path/api12_additions.rs b/components/drawing/src/path/api12_additions.rs similarity index 99% rename from src/drawing/path/api12_additions.rs rename to components/drawing/src/path/api12_additions.rs index 7e2487b..d0521c9 100644 --- a/src/drawing/path/api12_additions.rs +++ b/components/drawing/src/path/api12_additions.rs @@ -2,7 +2,7 @@ #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::{ +use crate::types::{ OH_Drawing_Matrix, OH_Drawing_Path, OH_Drawing_Point2D, OH_Drawing_Rect, OH_Drawing_RoundRect, }; diff --git a/src/drawing/path/path_api10.rs b/components/drawing/src/path/path_api10.rs similarity index 99% rename from src/drawing/path/path_api10.rs rename to components/drawing/src/path/path_api10.rs index 34d8cf9..b1fe9fa 100644 --- a/src/drawing/path/path_api10.rs +++ b/components/drawing/src/path/path_api10.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_Path object. diff --git a/src/drawing/path/path_api11.rs b/components/drawing/src/path/path_api11.rs similarity index 99% rename from src/drawing/path/path_api11.rs rename to components/drawing/src/path/path_api11.rs index 34d8cf9..b1fe9fa 100644 --- a/src/drawing/path/path_api11.rs +++ b/components/drawing/src/path/path_api11.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_Path object. diff --git a/src/drawing/path/path_api12.rs b/components/drawing/src/path/path_api12.rs similarity index 99% rename from src/drawing/path/path_api12.rs rename to components/drawing/src/path/path_api12.rs index 3070853..172aa64 100644 --- a/src/drawing/path/path_api12.rs +++ b/components/drawing/src/path/path_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; impl OH_Drawing_PathDirection { /// clockwise direction for adding closed contours diff --git a/src/drawing/path_effect.rs b/components/drawing/src/path_effect.rs similarity index 100% rename from src/drawing/path_effect.rs rename to components/drawing/src/path_effect.rs diff --git a/src/drawing/path_effect/path_effect_api12.rs b/components/drawing/src/path_effect/path_effect_api12.rs similarity index 97% rename from src/drawing/path_effect/path_effect_api12.rs rename to components/drawing/src/path_effect/path_effect_api12.rs index 0361615..caaff93 100644 --- a/src/drawing/path_effect/path_effect_api12.rs +++ b/components/drawing/src/path_effect/path_effect_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_PathEffect object. diff --git a/src/drawing/pen.rs b/components/drawing/src/pen.rs similarity index 100% rename from src/drawing/pen.rs rename to components/drawing/src/pen.rs diff --git a/src/drawing/pen/api11_additions.rs b/components/drawing/src/pen/api11_additions.rs similarity index 95% rename from src/drawing/pen/api11_additions.rs rename to components/drawing/src/pen/api11_additions.rs index 8a03389..f293de7 100644 --- a/src/drawing/pen/api11_additions.rs +++ b/components/drawing/src/pen/api11_additions.rs @@ -1,6 +1,6 @@ #![allow(non_snake_case)] -use crate::drawing::types::{OH_Drawing_Filter, OH_Drawing_Pen, OH_Drawing_ShaderEffect}; +use crate::types::{OH_Drawing_Filter, OH_Drawing_Pen, OH_Drawing_ShaderEffect}; extern "C" { /** @brief Obtains the alpha of a pen. The alpha is used by the pen to outline a shape. diff --git a/src/drawing/pen/api12_additions.rs b/components/drawing/src/pen/api12_additions.rs similarity index 99% rename from src/drawing/pen/api12_additions.rs rename to components/drawing/src/pen/api12_additions.rs index 6fd0914..f8cc0e0 100644 --- a/src/drawing/pen/api12_additions.rs +++ b/components/drawing/src/pen/api12_additions.rs @@ -2,7 +2,7 @@ #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::{ +use crate::types::{ OH_Drawing_BlendMode, OH_Drawing_Filter, OH_Drawing_Matrix, OH_Drawing_Path, OH_Drawing_PathEffect, OH_Drawing_Pen, OH_Drawing_Rect, OH_Drawing_ShadowLayer, }; diff --git a/src/drawing/pen/pen_api10.rs b/components/drawing/src/pen/pen_api10.rs similarity index 99% rename from src/drawing/pen/pen_api10.rs rename to components/drawing/src/pen/pen_api10.rs index 34afe61..b938226 100644 --- a/src/drawing/pen/pen_api10.rs +++ b/components/drawing/src/pen/pen_api10.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; impl OH_Drawing_PenLineCapStyle { /// There is no cap style. Both ends of the line segment are cut off square. diff --git a/src/drawing/pen/pen_api11.rs b/components/drawing/src/pen/pen_api11.rs similarity index 99% rename from src/drawing/pen/pen_api11.rs rename to components/drawing/src/pen/pen_api11.rs index 08e0f8a..d365414 100644 --- a/src/drawing/pen/pen_api11.rs +++ b/components/drawing/src/pen/pen_api11.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; impl OH_Drawing_PenLineCapStyle { /// There is no cap style. Both ends of the line segment are cut off square. diff --git a/src/drawing/pen/pen_api12.rs b/components/drawing/src/pen/pen_api12.rs similarity index 99% rename from src/drawing/pen/pen_api12.rs rename to components/drawing/src/pen/pen_api12.rs index d0a3405..1de6859 100644 --- a/src/drawing/pen/pen_api12.rs +++ b/components/drawing/src/pen/pen_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; impl OH_Drawing_PenLineCapStyle { /// There is no cap style. Both ends of the line segment are cut off square. diff --git a/src/drawing/pixel_map.rs b/components/drawing/src/pixel_map.rs similarity index 100% rename from src/drawing/pixel_map.rs rename to components/drawing/src/pixel_map.rs diff --git a/src/drawing/pixel_map/pixel_map_api12.rs b/components/drawing/src/pixel_map/pixel_map_api12.rs similarity index 98% rename from src/drawing/pixel_map/pixel_map_api12.rs rename to components/drawing/src/pixel_map/pixel_map_api12.rs index 77bf806..a79f144 100644 --- a/src/drawing/pixel_map/pixel_map_api12.rs +++ b/components/drawing/src/pixel_map/pixel_map_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; /** @brief Introduces the native pixel map information defined by image framework. @since 12 diff --git a/src/drawing/point.rs b/components/drawing/src/point.rs similarity index 100% rename from src/drawing/point.rs rename to components/drawing/src/point.rs diff --git a/src/drawing/point/point_api11.rs b/components/drawing/src/point/point_api11.rs similarity index 96% rename from src/drawing/point/point_api11.rs rename to components/drawing/src/point/point_api11.rs index d3a5929..024c745 100644 --- a/src/drawing/point/point_api11.rs +++ b/components/drawing/src/point/point_api11.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_Point object. diff --git a/src/drawing/point/point_api12.rs b/components/drawing/src/point/point_api12.rs similarity index 96% rename from src/drawing/point/point_api12.rs rename to components/drawing/src/point/point_api12.rs index d3a5929..024c745 100644 --- a/src/drawing/point/point_api12.rs +++ b/components/drawing/src/point/point_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_Point object. diff --git a/src/drawing/rect.rs b/components/drawing/src/rect.rs similarity index 100% rename from src/drawing/rect.rs rename to components/drawing/src/rect.rs diff --git a/src/drawing/rect/api12_additions.rs b/components/drawing/src/rect/api12_additions.rs similarity index 99% rename from src/drawing/rect/api12_additions.rs rename to components/drawing/src/rect/api12_additions.rs index 4eda63d..5beba74 100644 --- a/src/drawing/rect/api12_additions.rs +++ b/components/drawing/src/rect/api12_additions.rs @@ -1,5 +1,5 @@ #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief If rect intersects other, sets rect to intersection. diff --git a/src/drawing/rect/rect_api11.rs b/components/drawing/src/rect/rect_api11.rs similarity index 97% rename from src/drawing/rect/rect_api11.rs rename to components/drawing/src/rect/rect_api11.rs index 58085c3..170d67b 100644 --- a/src/drawing/rect/rect_api11.rs +++ b/components/drawing/src/rect/rect_api11.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_Rect object. diff --git a/src/drawing/rect/rect_api12.rs b/components/drawing/src/rect/rect_api12.rs similarity index 99% rename from src/drawing/rect/rect_api12.rs rename to components/drawing/src/rect/rect_api12.rs index 243ff22..6b8ab85 100644 --- a/src/drawing/rect/rect_api12.rs +++ b/components/drawing/src/rect/rect_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_Rect object. diff --git a/src/drawing/region/region_api12.rs b/components/drawing/src/region/region_api12.rs similarity index 99% rename from src/drawing/region/region_api12.rs rename to components/drawing/src/region/region_api12.rs index 5bc9afe..4af8190 100644 --- a/src/drawing/region/region_api12.rs +++ b/components/drawing/src/region/region_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; impl OH_Drawing_RegionOpMode { /// Difference operation. diff --git a/src/drawing/register_font.rs b/components/drawing/src/register_font.rs similarity index 100% rename from src/drawing/register_font.rs rename to components/drawing/src/register_font.rs diff --git a/src/drawing/register_font/register_font_api11.rs b/components/drawing/src/register_font/register_font_api11.rs similarity index 95% rename from src/drawing/register_font/register_font_api11.rs rename to components/drawing/src/register_font/register_font_api11.rs index 272e757..4dca410 100644 --- a/src/drawing/register_font/register_font_api11.rs +++ b/components/drawing/src/register_font/register_font_api11.rs @@ -3,8 +3,8 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::text_declaration::*; -use crate::drawing::types::*; +use crate::text_declaration::*; +use crate::types::*; extern "C" { /** @brief Defines an OH_Drawing_RegisterFont, which is used to register a customized font in the FontManager. diff --git a/src/drawing/register_font/register_font_api12.rs b/components/drawing/src/register_font/register_font_api12.rs similarity index 95% rename from src/drawing/register_font/register_font_api12.rs rename to components/drawing/src/register_font/register_font_api12.rs index 272e757..4dca410 100644 --- a/src/drawing/register_font/register_font_api12.rs +++ b/components/drawing/src/register_font/register_font_api12.rs @@ -3,8 +3,8 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::text_declaration::*; -use crate::drawing::types::*; +use crate::text_declaration::*; +use crate::types::*; extern "C" { /** @brief Defines an OH_Drawing_RegisterFont, which is used to register a customized font in the FontManager. diff --git a/src/drawing/round_rect.rs b/components/drawing/src/round_rect.rs similarity index 100% rename from src/drawing/round_rect.rs rename to components/drawing/src/round_rect.rs diff --git a/src/drawing/round_rect/api12_additions.rs b/components/drawing/src/round_rect/api12_additions.rs similarity index 96% rename from src/drawing/round_rect/api12_additions.rs rename to components/drawing/src/round_rect/api12_additions.rs index 01c1d6e..88785be 100644 --- a/src/drawing/round_rect/api12_additions.rs +++ b/components/drawing/src/round_rect/api12_additions.rs @@ -1,7 +1,7 @@ #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::{OH_Drawing_Corner_Radii, OH_Drawing_RoundRect}; +use crate::types::{OH_Drawing_Corner_Radii, OH_Drawing_RoundRect}; impl OH_Drawing_CornerPos { /// Index of top-left corner radii. diff --git a/src/drawing/round_rect/round_rect_api11.rs b/components/drawing/src/round_rect/round_rect_api11.rs similarity index 97% rename from src/drawing/round_rect/round_rect_api11.rs rename to components/drawing/src/round_rect/round_rect_api11.rs index cb4e285..b3f957c 100644 --- a/src/drawing/round_rect/round_rect_api11.rs +++ b/components/drawing/src/round_rect/round_rect_api11.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_RoundRect object. diff --git a/src/drawing/round_rect/round_rect_api12.rs b/components/drawing/src/round_rect/round_rect_api12.rs similarity index 99% rename from src/drawing/round_rect/round_rect_api12.rs rename to components/drawing/src/round_rect/round_rect_api12.rs index afa0601..6b19186 100644 --- a/src/drawing/round_rect/round_rect_api12.rs +++ b/components/drawing/src/round_rect/round_rect_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; impl OH_Drawing_CornerPos { /// Index of top-left corner radii. diff --git a/src/drawing/sampling_options.rs b/components/drawing/src/sampling_options.rs similarity index 100% rename from src/drawing/sampling_options.rs rename to components/drawing/src/sampling_options.rs diff --git a/src/drawing/sampling_options/sampling_options_api12.rs b/components/drawing/src/sampling_options/sampling_options_api12.rs similarity index 98% rename from src/drawing/sampling_options/sampling_options_api12.rs rename to components/drawing/src/sampling_options/sampling_options_api12.rs index 2ee7157..409af6c 100644 --- a/src/drawing/sampling_options/sampling_options_api12.rs +++ b/components/drawing/src/sampling_options/sampling_options_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; impl OH_Drawing_FilterMode { /// single sample point (nearest neighbor) diff --git a/src/drawing/shader_effect.rs b/components/drawing/src/shader_effect.rs similarity index 100% rename from src/drawing/shader_effect.rs rename to components/drawing/src/shader_effect.rs diff --git a/src/drawing/shader_effect/api12_additions.rs b/components/drawing/src/shader_effect/api12_additions.rs similarity index 98% rename from src/drawing/shader_effect/api12_additions.rs rename to components/drawing/src/shader_effect/api12_additions.rs index 03b2a33..f838dff 100644 --- a/src/drawing/shader_effect/api12_additions.rs +++ b/components/drawing/src/shader_effect/api12_additions.rs @@ -1,7 +1,7 @@ #![allow(non_snake_case)] -use crate::drawing::shader_effect::OH_Drawing_TileMode; -use crate::drawing::types::{ +use crate::shader_effect::OH_Drawing_TileMode; +use crate::types::{ OH_Drawing_Image, OH_Drawing_Matrix, OH_Drawing_Point2D, OH_Drawing_SamplingOptions, OH_Drawing_ShaderEffect, }; diff --git a/src/drawing/shader_effect/shader_effect_api11.rs b/components/drawing/src/shader_effect/shader_effect_api11.rs similarity index 99% rename from src/drawing/shader_effect/shader_effect_api11.rs rename to components/drawing/src/shader_effect/shader_effect_api11.rs index fea9128..ce2e4c5 100644 --- a/src/drawing/shader_effect/shader_effect_api11.rs +++ b/components/drawing/src/shader_effect/shader_effect_api11.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; impl OH_Drawing_TileMode { /// Replicate the edge color if the shader effect draws outside of its original bounds. diff --git a/src/drawing/shader_effect/shader_effect_api12.rs b/components/drawing/src/shader_effect/shader_effect_api12.rs similarity index 99% rename from src/drawing/shader_effect/shader_effect_api12.rs rename to components/drawing/src/shader_effect/shader_effect_api12.rs index cce7249..328c097 100644 --- a/src/drawing/shader_effect/shader_effect_api12.rs +++ b/components/drawing/src/shader_effect/shader_effect_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; impl OH_Drawing_TileMode { /// Replicate the edge color if the shader effect draws outside of its original bounds. diff --git a/src/drawing/shadow_layer.rs b/components/drawing/src/shadow_layer.rs similarity index 100% rename from src/drawing/shadow_layer.rs rename to components/drawing/src/shadow_layer.rs diff --git a/src/drawing/shadow_layer/shadow_layer_api12.rs b/components/drawing/src/shadow_layer/shadow_layer_api12.rs similarity index 97% rename from src/drawing/shadow_layer/shadow_layer_api12.rs rename to components/drawing/src/shadow_layer/shadow_layer_api12.rs index e1b0f47..997e1b7 100644 --- a/src/drawing/shadow_layer/shadow_layer_api12.rs +++ b/components/drawing/src/shadow_layer/shadow_layer_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_ShadowLayer object. diff --git a/src/drawing/surface.rs b/components/drawing/src/surface.rs similarity index 100% rename from src/drawing/surface.rs rename to components/drawing/src/surface.rs diff --git a/src/drawing/surface/surface_api12.rs b/components/drawing/src/surface/surface_api12.rs similarity index 98% rename from src/drawing/surface/surface_api12.rs rename to components/drawing/src/surface/surface_api12.rs index c353fb8..f7744ff 100644 --- a/src/drawing/surface/surface_api12.rs +++ b/components/drawing/src/surface/surface_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Creates an OH_Drawing_Surface object on GPU indicated by context. diff --git a/src/drawing/text_blob.rs b/components/drawing/src/text_blob.rs similarity index 100% rename from src/drawing/text_blob.rs rename to components/drawing/src/text_blob.rs diff --git a/src/drawing/text_blob/api12_additions.rs b/components/drawing/src/text_blob/api12_additions.rs similarity index 99% rename from src/drawing/text_blob/api12_additions.rs rename to components/drawing/src/text_blob/api12_additions.rs index 2796d93..5f5c7f7 100644 --- a/src/drawing/text_blob/api12_additions.rs +++ b/components/drawing/src/text_blob/api12_additions.rs @@ -1,6 +1,6 @@ #![allow(non_snake_case)] -use crate::drawing::types::{ +use crate::types::{ OH_Drawing_Font, OH_Drawing_Point2D, OH_Drawing_Rect, OH_Drawing_TextBlob, OH_Drawing_TextEncoding, }; diff --git a/src/drawing/text_blob/text_blob_api11.rs b/components/drawing/src/text_blob/text_blob_api11.rs similarity index 99% rename from src/drawing/text_blob/text_blob_api11.rs rename to components/drawing/src/text_blob/text_blob_api11.rs index 109a7d4..3dcfad0 100644 --- a/src/drawing/text_blob/text_blob_api11.rs +++ b/components/drawing/src/text_blob/text_blob_api11.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; /** @brief Defines a run, supplies storage for glyphs and positions. diff --git a/src/drawing/text_blob/text_blob_api12.rs b/components/drawing/src/text_blob/text_blob_api12.rs similarity index 99% rename from src/drawing/text_blob/text_blob_api12.rs rename to components/drawing/src/text_blob/text_blob_api12.rs index 0960954..82da7ed 100644 --- a/src/drawing/text_blob/text_blob_api12.rs +++ b/components/drawing/src/text_blob/text_blob_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; /** @brief Defines a run, supplies storage for glyphs and positions. diff --git a/src/drawing/text_declaration.rs b/components/drawing/src/text_declaration.rs similarity index 100% rename from src/drawing/text_declaration.rs rename to components/drawing/src/text_declaration.rs diff --git a/src/drawing/text_declaration/api11_additions.rs b/components/drawing/src/text_declaration/api11_additions.rs similarity index 100% rename from src/drawing/text_declaration/api11_additions.rs rename to components/drawing/src/text_declaration/api11_additions.rs diff --git a/src/drawing/text_declaration/api12_additions.rs b/components/drawing/src/text_declaration/api12_additions.rs similarity index 100% rename from src/drawing/text_declaration/api12_additions.rs rename to components/drawing/src/text_declaration/api12_additions.rs diff --git a/src/drawing/text_declaration/text_declaration_api10.rs b/components/drawing/src/text_declaration/text_declaration_api10.rs similarity index 94% rename from src/drawing/text_declaration/text_declaration_api10.rs rename to components/drawing/src/text_declaration/text_declaration_api10.rs index d7d4630..7ea5eea 100644 --- a/src/drawing/text_declaration/text_declaration_api10.rs +++ b/components/drawing/src/text_declaration/text_declaration_api10.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; #[repr(C)] pub struct OH_Drawing_FontCollection { diff --git a/src/drawing/text_declaration/text_declaration_api11.rs b/components/drawing/src/text_declaration/text_declaration_api11.rs similarity index 96% rename from src/drawing/text_declaration/text_declaration_api11.rs rename to components/drawing/src/text_declaration/text_declaration_api11.rs index cda86ff..9c51296 100644 --- a/src/drawing/text_declaration/text_declaration_api11.rs +++ b/components/drawing/src/text_declaration/text_declaration_api11.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; #[repr(C)] pub struct OH_Drawing_FontCollection { diff --git a/src/drawing/text_declaration/text_declaration_api12.rs b/components/drawing/src/text_declaration/text_declaration_api12.rs similarity index 96% rename from src/drawing/text_declaration/text_declaration_api12.rs rename to components/drawing/src/text_declaration/text_declaration_api12.rs index cfc4456..d38b24b 100644 --- a/src/drawing/text_declaration/text_declaration_api12.rs +++ b/components/drawing/src/text_declaration/text_declaration_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; #[repr(C)] pub struct OH_Drawing_FontCollection { diff --git a/src/drawing/text_typography.rs b/components/drawing/src/text_typography.rs similarity index 100% rename from src/drawing/text_typography.rs rename to components/drawing/src/text_typography.rs diff --git a/src/drawing/text_typography/api11_additions.rs b/components/drawing/src/text_typography/api11_additions.rs similarity index 99% rename from src/drawing/text_typography/api11_additions.rs rename to components/drawing/src/text_typography/api11_additions.rs index 7e8fb34..89d0b28 100644 --- a/src/drawing/text_typography/api11_additions.rs +++ b/components/drawing/src/text_typography/api11_additions.rs @@ -2,11 +2,11 @@ #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::text_declaration::{ +use crate::text_declaration::{ OH_Drawing_PositionAndAffinity, OH_Drawing_Range, OH_Drawing_TextBox, OH_Drawing_TextStyle, OH_Drawing_Typography, OH_Drawing_TypographyCreate, OH_Drawing_TypographyStyle, }; -use crate::drawing::text_typography::OH_Drawing_TextBaseline; +use crate::text_typography::OH_Drawing_TextBaseline; impl OH_Drawing_PlaceholderVerticalAlignment { /// Offset At Baseline diff --git a/src/drawing/text_typography/api12_additions.rs b/components/drawing/src/text_typography/api12_additions.rs similarity index 99% rename from src/drawing/text_typography/api12_additions.rs rename to components/drawing/src/text_typography/api12_additions.rs index 5858b13..4dbd763 100644 --- a/src/drawing/text_typography/api12_additions.rs +++ b/components/drawing/src/text_typography/api12_additions.rs @@ -1,17 +1,17 @@ #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::font::OH_Drawing_Font_Metrics; -use crate::drawing::text_declaration::{ +use crate::font::OH_Drawing_Font_Metrics; +use crate::text_declaration::{ OH_Drawing_FontParser, OH_Drawing_Range, OH_Drawing_TextBox, OH_Drawing_TextShadow, OH_Drawing_TextStyle, OH_Drawing_Typography, OH_Drawing_TypographyCreate, OH_Drawing_TypographyStyle, }; -use crate::drawing::text_typography::{ +use crate::text_typography::{ OH_Drawing_FontStyle, OH_Drawing_FontWeight, OH_Drawing_TextAlign, OH_Drawing_TextBaseline, OH_Drawing_TextDecorationStyle, OH_Drawing_TextDirection, }; -use crate::drawing::types::{ +use crate::types::{ OH_Drawing_Brush, OH_Drawing_Pen, OH_Drawing_Point, OH_Drawing_RectStyle_Info, }; diff --git a/src/drawing/text_typography/text_typography_api10.rs b/components/drawing/src/text_typography/text_typography_api10.rs similarity index 99% rename from src/drawing/text_typography/text_typography_api10.rs rename to components/drawing/src/text_typography/text_typography_api10.rs index f1d05f4..b4310b0 100644 --- a/src/drawing/text_typography/text_typography_api10.rs +++ b/components/drawing/src/text_typography/text_typography_api10.rs @@ -3,8 +3,8 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::text_declaration::*; -use crate::drawing::types::*; +use crate::text_declaration::*; +use crate::types::*; impl OH_Drawing_TextDirection { /// Right to left (RTL) diff --git a/src/drawing/text_typography/text_typography_api11.rs b/components/drawing/src/text_typography/text_typography_api11.rs similarity index 99% rename from src/drawing/text_typography/text_typography_api11.rs rename to components/drawing/src/text_typography/text_typography_api11.rs index 353cfae..73a55b4 100644 --- a/src/drawing/text_typography/text_typography_api11.rs +++ b/components/drawing/src/text_typography/text_typography_api11.rs @@ -3,8 +3,8 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::text_declaration::*; -use crate::drawing::types::*; +use crate::text_declaration::*; +use crate::types::*; impl OH_Drawing_TextDirection { /// Right to left (RTL) diff --git a/src/drawing/text_typography/text_typography_api12.rs b/components/drawing/src/text_typography/text_typography_api12.rs similarity index 99% rename from src/drawing/text_typography/text_typography_api12.rs rename to components/drawing/src/text_typography/text_typography_api12.rs index dc3f366..77acf72 100644 --- a/src/drawing/text_typography/text_typography_api12.rs +++ b/components/drawing/src/text_typography/text_typography_api12.rs @@ -3,8 +3,8 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::text_declaration::*; -use crate::drawing::types::*; +use crate::text_declaration::*; +use crate::types::*; impl OH_Drawing_TextDirection { /// Right to left (RTL) diff --git a/src/drawing/typeface.rs b/components/drawing/src/typeface.rs similarity index 100% rename from src/drawing/typeface.rs rename to components/drawing/src/typeface.rs diff --git a/src/drawing/typeface/api12_additions.rs b/components/drawing/src/typeface/api12_additions.rs similarity index 94% rename from src/drawing/typeface/api12_additions.rs rename to components/drawing/src/typeface/api12_additions.rs index e9997a5..f17e204 100644 --- a/src/drawing/typeface/api12_additions.rs +++ b/components/drawing/src/typeface/api12_additions.rs @@ -1,6 +1,6 @@ #![allow(non_snake_case)] -use crate::drawing::types::{OH_Drawing_MemoryStream, OH_Drawing_Typeface}; +use crate::types::{OH_Drawing_MemoryStream, OH_Drawing_Typeface}; extern "C" { /** @brief Creates a OH_Drawing_Typeface object by file. diff --git a/src/drawing/typeface/typeface_api11.rs b/components/drawing/src/typeface/typeface_api11.rs similarity index 96% rename from src/drawing/typeface/typeface_api11.rs rename to components/drawing/src/typeface/typeface_api11.rs index fa6d6c6..dcc2e05 100644 --- a/src/drawing/typeface/typeface_api11.rs +++ b/components/drawing/src/typeface/typeface_api11.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Creates a default OH_Drawing_Typeface object. diff --git a/src/drawing/typeface/typeface_api12.rs b/components/drawing/src/typeface/typeface_api12.rs similarity index 98% rename from src/drawing/typeface/typeface_api12.rs rename to components/drawing/src/typeface/typeface_api12.rs index d051e26..4a83c0a 100644 --- a/src/drawing/typeface/typeface_api12.rs +++ b/components/drawing/src/typeface/typeface_api12.rs @@ -3,7 +3,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::drawing::types::*; +use crate::types::*; extern "C" { /** @brief Creates a default OH_Drawing_Typeface object. diff --git a/src/drawing/types.rs b/components/drawing/src/types.rs similarity index 100% rename from src/drawing/types.rs rename to components/drawing/src/types.rs diff --git a/src/drawing/types/api11_additions.rs b/components/drawing/src/types/api11_additions.rs similarity index 100% rename from src/drawing/types/api11_additions.rs rename to components/drawing/src/types/api11_additions.rs diff --git a/src/drawing/types/api12_additions.rs b/components/drawing/src/types/api12_additions.rs similarity index 100% rename from src/drawing/types/api12_additions.rs rename to components/drawing/src/types/api12_additions.rs diff --git a/src/drawing/types/types_api10.rs b/components/drawing/src/types/types_api10.rs similarity index 100% rename from src/drawing/types/types_api10.rs rename to components/drawing/src/types/types_api10.rs diff --git a/src/drawing/types/types_api11.rs b/components/drawing/src/types/types_api11.rs similarity index 100% rename from src/drawing/types/types_api11.rs rename to components/drawing/src/types/types_api11.rs diff --git a/src/drawing/types/types_api12.rs b/components/drawing/src/types/types_api12.rs similarity index 100% rename from src/drawing/types/types_api12.rs rename to components/drawing/src/types/types_api12.rs diff --git a/scripts/generate_bindings.sh b/scripts/generate_bindings.sh index 0584025..fafa82c 100755 --- a/scripts/generate_bindings.sh +++ b/scripts/generate_bindings.sh @@ -138,11 +138,11 @@ for val in "${DRAWING_NOCOPY_STRUCTS[@]}"; do DRAWING_NOCOPY_ARGS+=("--no-copy=^${val}\$" "--no-debug=^${val}\$") done -DRAWING_font_collection_ADDITIONAL_ARGS=("--raw-line=use crate::drawing::text_declaration::*;") -DRAWING_text_typography_ADDITIONAL_ARGS=("--raw-line=use crate::drawing::text_declaration::*;" ) -DRAWING_register_font_ADDITIONAL_ARGS=("--raw-line=use crate::drawing::text_declaration::*;" ) -DRAWING_image_filter_ADDITIONAL_ARGS=("--raw-line=use crate::drawing::shader_effect::*;") -DRAWING_font_mgr_ADDITIONAL_ARGS=("--raw-line=use crate::drawing::text_typography::*;" ) +DRAWING_font_collection_ADDITIONAL_ARGS=("--raw-line=use crate::text_declaration::*;") +DRAWING_text_typography_ADDITIONAL_ARGS=("--raw-line=use crate::text_declaration::*;" ) +DRAWING_register_font_ADDITIONAL_ARGS=("--raw-line=use crate::text_declaration::*;" ) +DRAWING_image_filter_ADDITIONAL_ARGS=("--raw-line=use crate::shader_effect::*;") +DRAWING_font_mgr_ADDITIONAL_ARGS=("--raw-line=use crate::text_typography::*;" ) for abs_drawing_header in "${OHOS_SYSROOT_DIR}/usr/include/native_drawing"/* ; do drawing_header=$(basename "${abs_drawing_header}") @@ -154,7 +154,7 @@ for abs_drawing_header in "${OHOS_SYSROOT_DIR}/usr/include/native_drawing"/* ; d fi rs_includes=() if [[ "${rust_name}" != "types" ]]; then - rs_includes+=("--raw-line=use crate::drawing::types::*;") + rs_includes+=("--raw-line=use crate::types::*;") fi additional_args_var_name="DRAWING_${rust_name}_ADDITIONAL_ARGS" if [[ ! -z "${!additional_args_var_name+x}" ]]; then @@ -170,7 +170,7 @@ for abs_drawing_header in "${OHOS_SYSROOT_DIR}/usr/include/native_drawing"/* ; d --no-recursive-allowlist \ "${rs_includes[@]}" \ "${DRAWING_NOCOPY_ARGS[@]}" \ - --output "${ROOT_DIR}/src/drawing/${rust_name}/${rust_name}_api${OHOS_API_VERSION}.rs" \ + --output "${ROOT_DIR}/components/drawing/src/${rust_name}/${rust_name}_api${OHOS_API_VERSION}.rs" \ "${OHOS_SYSROOT_DIR}/usr/include/native_drawing/${drawing_header}" \ -- "${BASE_CLANG_ARGS[@]}" \ -x c++ \ diff --git a/src/lib.rs b/src/lib.rs index 94c1b76..7c58c49 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -16,8 +16,9 @@ #[cfg(feature = "drawing")] #[cfg_attr(docsrs, doc(cfg(feature = "drawing")))] -pub mod drawing; - +pub mod drawing { + pub use ohos_drawing_sys::*; +} #[cfg(feature = "hilog")] #[cfg_attr(docsrs, doc(cfg(feature = "hilog")))] pub mod hilog;