@@ -15,11 +15,11 @@ import pointer from '@ohos.multimodalInput.pointer';
...
@@ -15,11 +15,11 @@ import pointer from '@ohos.multimodalInput.pointer';
The following table lists the common APIs for mouse pointer management. For details about the APIs, see [ohos.multimodalInput.pointer](../reference/apis/js-apis-pointer.md).
The following table lists the common APIs for mouse pointer management. For details about the APIs, see [ohos.multimodalInput.pointer](../reference/apis/js-apis-pointer.md).
| pointer | function isPointerVisible(callback: AsyncCallback\<boolean>): void; | Checks the visible status of the mouse pointer. |
| pointer | function isPointerVisible(callback: AsyncCallback\<boolean>): void; | Checks the visible status of the mouse pointer. |
| pointer | function setPointerVisible(visible: boolean, callback: AsyncCallback\<void>): void; | Sets the visible status of the mouse pointer. This setting takes effect for the mouse pointer globally.|
| pointer | function setPointerVisible(visible: boolean, callback: AsyncCallback\<void>): void; | Sets the visible status of the mouse pointer. This setting takes effect for the mouse pointer globally.|
| pointer | function setPointerStyle(windowId: number, pointerStyle: PointerStyle, callback: AsyncCallback\<void>): void; | Sets the mouse pointer style. This setting takes effect for the mouse pointer style of a specified window. |
| pointer | function setPointerStyle(windowId: number, pointerStyle: PointerStyle, callback: AsyncCallback\<void>): void; | Sets the mouse pointer style. This setting takes effect for the mouse pointer style of a specified window. |
| pointer | function getPointerStyle(windowId: number, callback: AsyncCallback\<PointerStyle>): void; | Obtains the mouse pointer style. |
| pointer | function getPointerStyle(windowId: number, callback: AsyncCallback\<PointerStyle>): void; | Obtains the mouse pointer style. |
## Hiding the Mouse Pointer
## Hiding the Mouse Pointer
...
@@ -77,43 +77,48 @@ When designing a color picker, you can have the mouse pointer switched to the co
...
@@ -77,43 +77,48 @@ When designing a color picker, you can have the mouse pointer switched to the co
The **pointer** module provides APIs related to pointer attribute management.
The **pointer** module provides APIs related to pointer attribute management.
> **NOTE**<br>
> **NOTE**
>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
## Modules to Import
...
@@ -237,6 +238,8 @@ Obtains the mouse movement speed. This API uses a promise to return the result.
...
@@ -237,6 +238,8 @@ Obtains the mouse movement speed. This API uses a promise to return the result.
| const.product.devicetype | const char\* GetDeviceType(void) | Obtains the device type.|
| const.product.manufacturer | const char\* GetManufacture(void) | Obtains the device manufacturer.|
| const.product.brand | const char\* GetBrand(void) | Obtains the device brand.|
| const.product.name | const char\* GetMarketName(void) | Obtains the device marketing name.|
| const.build.product | const char\* GetProductSeries(void) | Obtains the device series name.|
| const.product.model | const char\* GetProductModel(void) | Obtains the device authentication model.|
| const.software.model | const char\* GetSoftwareModel(void) | Obtains the device software model.|
| const.product.hardwareversion | const char\* GetHardwareModel(void) | Obtains the device hardware model.|
| const.product.hardwareprofile | const char\* GetHardwareProfile(void) | Obtains the device hardware profile.|
| ohos.boot.sn | const char\* GetSerial(void) | Obtains the serial number (SN) of the device.|
| const.product.software.version | const char\* GetDisplayVersion(void) | Obtains the software version visible to users.|
| const.product.bootloader.version | const char\* GetBootloaderVersion(void) | Obtains the bootloader version of the device.|
| const.product.udid | int GetDevUdid(char \*udid, int size) | Obtains the UDID of the device through **DeviceInfo** or through calculation if the attempt to obtain the UDID through **DeviceInfo** fails.|
| | const char *AclGetSerial(void); | Obtains the SN of the device (with ACL check).|
| | int AclGetDevUdid(char *udid, int size); | Obtains the UDID of the device (with ACL check).|
## DeviceInfo Source
### Adaptation of OHOS Fixed-value Parameters
- OHOS fixed-value parameters:
```
const.ohos.version.security_patch
const.ohos.releasetype
const.ohos.apiversion
const.ohos.fullname
```
- Description of adaptation:
OHOS fixed-value parameters are filled by the OHOS and do not need to be adapted by vendors. Currently, these parameters are defined in the **/base/startup/init/services/etc/param/ohos_const/ohos.para** file.
### Adaptation of Vendor Fixed-value Parameters
- Vendor fixed-value parameters:
```
const.product.devicetype
const.product.manufacturer
const.product.brand
const.product.name
const.build.product
const.product.model
const.software.model
const.product.hardwareversion
const.product.hardwareprofile
const.product.software.version
const.product.bootloader.version
const.build.characteristics
... ...
```
- Description of adaptation:
Adapt parameters in the **vendor** directory based on actual requirements.
(1) Take RK3568 as an example for standard-system devices. Adapt parameters in the **/vendor/hihope/rk3568/etc/para/hardware_rk3568.para** file and install the file to the specified directory.
```
ohos_prebuilt_etc("para_for_chip_prod") {
source = "./para/hardware_rk3568.para"
install_images = [ chip_prod_base_dir ]
relative_install_dir = "para"
part_name = "product_rk3568"
}
```
(2) For mini- and small-system devices, adapt parameters in the respective **hals/utils/sys_param/vendor.para** file. For example:
- Currently, three ways are provided to obtain vendor dynamic-value parameters: cmdline, macro definition, and **BUILD.gn** definition.
1. cmdline: Values that are read from cmdline include **ohos.boot.hardware**, **ohos.boot.bootslots**, and **ohos.boot.sn**. The way to obtain **ohos.boot.sn** differs according to the system type as follows:
(1) For standard-system devices: **ohos.boot.sn** is read from cmdline (generated by U-Boot). If the SN is obtained, the value is directly read; if the file path is obtained, the value is read from the file. If the preceding attempt fails, the value is read from the default SN files; that is, **/sys/block/mmcblk0/device/cid** and **/proc/bootdevice/cid**.
(2) For mini- and small-system devices: These devices may come with their own special algorithms. Therefore, **HalGetSerial()** can be used to obtain the SN from the **hal_sys_param.c** file in the **hals/utils/sys_param** directory.
2. Macro definition: Obtain parameter values by compiling macro definitions. Currently, this mode is available only for mini- and small-system devices. For example:
```
defines = [
"INCREMENTAL_VERSION=\"${ohos_version}\"",
"BUILD_TYPE=\"${ohos_build_type}\"",
"BUILD_USER=\"${ohos_build_user}\"",
"BUILD_TIME=\"${ohos_build_time}\"",
"BUILD_HOST=\"${ohos_build_host}\"",
"BUILD_ROOTHASH=\"${ohos_build_roothash}\"",
]
```
3.**BUILD.gn** definition: Obtain parameter values from the **/base/startup/init/services/etc/BUILD.gn** file. For example:
(2) For mini-system devices, a file system is not available and therefore, the **hal_sys_param.c** and **vendor.para** files are converted into header files and are compiled to the system during compilation.