Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-export rawfile, image-kit and multimodal input #76

Merged
merged 4 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
api_feature_levels:
strategy:
matrix:
api_level: ["api-10", "api-11", "api-12", "api-13"]
api_level: ["api-10", "api-11", "api-12", "api-13", "api-14"]
name: Build with API feature levels
runs-on: ubuntu-latest
steps:
Expand All @@ -44,7 +44,22 @@ jobs:
api_minimal_featueres:
strategy:
matrix:
component: ["drawing", "hilog", "napi", "hitrace", "native_buffer", "native_image", "native_window", "xcomponent", "vsync"]
component:
- arkui
- deviceinfo
- drawing
- hilog
- hitrace
- inputmethod
- image-kit
- multimodal-input
- napi
- native_buffer
- native_image
- native_window
- rawfile
- vsync
- xcomponent
name: Build with minimal features
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 3 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 39 additions & 24 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ohos-sys"
version = "0.6.1"
version = "0.6.2"
edition = "2021"
description = "Bindings to the native API of OpenHarmony OS"
license = "Apache-2.0"
Expand All @@ -19,17 +19,19 @@ ohos-sys-opaque-types = { version = "0.1.4", path = "components/opaque-types" }


[dependencies]
arkui-sys = { version = "0.2.2", optional = true, path = "components/arkui" }
arkui-sys = { version = "0.2.4", optional = true, path = "components/arkui" }
document-features = { version = "0.2", optional = true }
ohos-drawing-sys = { path = "components/drawing", version = "0.2.1", optional = true}
ohos-deviceinfo-sys = { version = "0.1.2", optional = true, path = "components/deviceinfo"}
hitrace-sys = { version = "0.1.4", optional = true, path = "components/hitrace"}
ohos-ime-sys = { version = "0.1.3", optional = true, path = "components/inputmethod"}
hilog-sys = { version = "0.1.4", optional = true, path = "components/hilog"}
xcomponent-sys = {version = "0.3.0", optional = true, path = "components/xcomponent"}
hitrace-sys = { version = "0.1.4", optional = true, path = "components/hitrace"}
ohos-deviceinfo-sys = { version = "0.1.2", optional = true, path = "components/deviceinfo"}
ohos-drawing-sys = { path = "components/drawing", version = "0.2.2", optional = true}
ohos-image-kit-sys = {version = "0.2", optional = true, path = "components/multimedia/image_framework"}
ohos-ime-sys = { version = "0.1.4", optional = true, path = "components/inputmethod"}
ohos-input-sys = { version = "0.1.1", optional = true, path = "components/multimodal-input"}
ohos-rawfile-sys = { version = "0.1.0", optional = true, path = "components/rawfile"}
ohos-sys-opaque-types = { workspace = true}
ohos-vsync-sys = { version = "0.1.1", optional = true, path = "components/vsync"}
ohos-vsync-sys = { version = "0.1.2", optional = true, path = "components/vsync"}
xcomponent-sys = {version = "0.3.1", optional = true, path = "components/xcomponent"}


[features]
Expand All @@ -48,6 +50,8 @@ hitrace = ["dep:hitrace-sys"]
inputmethod = ["dep:ohos-ime-sys"]
## Bindings to the [Image Kit](https://docs.openharmony.cn/pages/v5.0/en/application-dev/media/image/image-overview.md)
image-kit = ["dep:ohos-image-kit-sys"]
## Bindings to the Multimodal Input kit.
multimodal-input = ["dep:ohos-input-sys"]
## Enables bindings to `napi`
napi = []
## Enables bindings to `native_buffer`
Expand All @@ -56,6 +60,8 @@ native_buffer = ['native_window']
native_image = ['native_window']
## Enables bindings to `native_window`
native_window = ['native_buffer']
## Enables bindings to `rawfile`
rawfile = ['ohos-rawfile-sys']
## Enables bindings to `native_vsync`
vsync = ["dep:ohos-vsync-sys"]
## Enables bindings to `native_xcomponent`
Expand All @@ -73,10 +79,12 @@ all-components = [
"image-kit-image-receiver",
"image-kit-image-source",
"image-kit-pixelmap",
"multimodal-input",
"napi",
"native_buffer",
"native_image",
"native_window",
"rawfile",
"xcomponent",
"vsync"]

Expand All @@ -89,50 +97,57 @@ all-components = [
api-10 = []
## Enables bindings for OpenHarmony API-level 11
api-11 = ["api-10",
"ohos-deviceinfo-sys?/api-11",
"ohos-drawing-sys?/api-11",
"hilog-sys?/api-11",
"hitrace-sys?/api-11",
"xcomponent-sys?/api-11",
"ohos-deviceinfo-sys?/api-11",
"ohos-drawing-sys?/api-11",
"ohos-vsync-sys?/api-11",
"ohos-rawfile-sys?/api-11",
"xcomponent-sys?/api-11",
]
## Enables bindings for OpenHarmony API-level 12
api-12 = ["api-11",
"arkui-sys?/api-12",
"ohos-deviceinfo-sys?/api-12",
"ohos-drawing-sys?/api-12",
"hilog-sys?/api-12",
"hitrace-sys?/api-12",
"ohos-ime-sys?/api-12",
"ohos-deviceinfo-sys?/api-12",
"ohos-drawing-sys?/api-12",
"ohos-image-kit-sys?/api-12",
"xcomponent-sys?/api-12",
"ohos-ime-sys?/api-12",
"ohos-input-sys?/api-12",
"ohos-rawfile-sys?/api-12",
"ohos-vsync-sys?/api-12",
"xcomponent-sys?/api-12",
]

## Enables bindings for OpenHarmony API-level 13
api-13 = ["api-12",
"arkui-sys?/api-13",
"ohos-deviceinfo-sys?/api-13",
"ohos-drawing-sys?/api-13",
"hilog-sys?/api-13",
"hitrace-sys?/api-13",
"ohos-ime-sys?/api-13",
"ohos-deviceinfo-sys?/api-13",
"ohos-drawing-sys?/api-13",
"ohos-image-kit-sys?/api-13",
"xcomponent-sys?/api-13",
"ohos-ime-sys?/api-13",
"ohos-input-sys?/api-13",
"ohos-rawfile-sys?/api-13",
"ohos-vsync-sys?/api-13",
"xcomponent-sys?/api-13",
]

## Enables bindings for OpenHarmony API-level 13
api-14 = ["api-13",
"arkui-sys?/api-14",
# "ohos-deviceinfo-sys?/api-14",
"ohos-drawing-sys?/api-14",
# "hilog-sys?/api-14",
# "hitrace-sys?/api-14",
"ohos-ime-sys?/api-14",
"ohos-image-kit-sys?/api-14",
"xcomponent-sys?/api-14",
"ohos-ime-sys?/api-14",
"ohos-input-sys?/api-14",
"ohos-vsync-sys?/api-14",
"xcomponent-sys?/api-14",
# "hilog-sys?/api-14",
# "hitrace-sys?/api-14",
# "ohos-rawfile-sys?/api-14",
# "ohos-deviceinfo-sys?/api-14",
]
#! ### Features of dependencies
#!
Expand Down
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ already been generated.
| inputmethod | ✅ | 14 |
| mindspore | | |
| multimedia | | |
| multimodalinput | | |
| multimodalinput | | 14 |
| napi | ✅ | 13 |
| native_buffer | ✅ | 14 |
| native_color_space_manager | | |
Expand Down
2 changes: 2 additions & 0 deletions components/multimedia/image_framework/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ image-packer = []
image-receiver = []
## Image decoding
image-source = ["dep:ohos-rawfile-sys"]
## Picture
picture = ["pixelmap"]
## Pixel Map
pixelmap = []
## Document available features when building the documentation
Expand Down
12 changes: 10 additions & 2 deletions components/multimedia/image_framework/src/native_image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@

pub mod common;
pub mod image;
#[cfg(feature = "image-packer")]
#[cfg_attr(docsrs, doc(cfg(feature = "image-packer")))]
pub mod image_packer;
#[cfg(feature = "image-receiver")]
#[cfg_attr(docsrs, doc(cfg(feature = "image-receiver")))]
pub mod image_receiver;
#[cfg(feature = "image-source")]
#[cfg_attr(docsrs, doc(cfg(feature = "image-source")))]
pub mod image_source;
#[cfg(feature = "api-13")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
#[cfg(all(feature = "api-13", feature = "pixelmap"))]
#[cfg_attr(docsrs, doc(cfg(all(feature = "api-13", feature = "pixelmap"))))]
pub mod picture;
#[cfg(feature = "pixelmap")]
#[cfg_attr(docsrs, doc(cfg(feature = "pixelmap")))]
pub mod pixelmap;
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
#[link(name = "picture")]
extern "C" {}

mod picture_ffi;
pub use picture_ffi::*;
4 changes: 2 additions & 2 deletions components/multimodal-input/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! Bindings to Input-kit API of OpenHarmony
//! Bindings to the Multimodal Input-kit API of OpenHarmony
//!
//! Available with API-level 12 and newer
//!
//! Official documentation: https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/_input_method-V5
//! Official documentation: <https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V14/input-V14>
//!
//! ## Feature flags
#![cfg_attr(
Expand Down
10 changes: 10 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ pub use hilog_sys as hilog;
#[cfg_attr(docsrs, doc(cfg(feature = "hitrace")))]
pub use hitrace_sys as hitrace;

#[cfg(feature = "inputmethod")]
#[cfg_attr(docsrs, doc(cfg(feature = "inputmethod")))]
pub use ohos_ime_sys as inputmethod;

#[cfg(feature = "multimodal-input")]
#[cfg_attr(docsrs, doc(cfg(feature = "multimodal-input")))]
pub use ohos_input_sys as multimodal_input;

pub mod multimedia;

#[cfg(feature = "napi")]
#[cfg_attr(docsrs, doc(cfg(feature = "napi")))]
pub mod napi;
Expand Down
3 changes: 3 additions & 0 deletions src/multimedia.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#[cfg(feature = "image-kit")]
#[cfg_attr(docsrs, doc(cfg(feature = "image-kit")))]
pub use ohos_image_kit_sys as image_kit;