@react-native-ohos/react-native-clippathview 1.2.0 → 1.3.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/harmony/clipPath/BuildProfile.ets +16 -5
- package/harmony/clipPath/index.ets +2 -0
- package/harmony/clipPath/oh-package.json5 +1 -1
- package/harmony/clipPath/src/main/cpp/ClipPathProps.h +15 -0
- package/harmony/clipPath/src/main/cpp/ClipPathViewNoneNode.cpp +17 -1
- package/harmony/clipPath/src/main/cpp/ClipPathViewNoneNode.h +14 -0
- package/harmony/clipPath/src/main/cpp/ClipPathViewPackage.h +4 -2
- package/harmony/clipPath/src/main/cpp/pen_style_node.h +14 -0
- package/harmony/clipPath/src/main/ets/{ClipPathPackage.ts → ClipPathPackage.ets} +3 -2
- package/harmony/clipPath/src/main/ets/{ClipPathTurboModule.ts → ClipPathTurboModule.ets} +5 -1
- package/harmony/clipPath.har +0 -0
- package/package.json +8 -2
- /package/harmony/clipPath/{ts.ts → ts.ets} +0 -0
package/README.md
CHANGED
|
@@ -4,9 +4,9 @@ This project is based on [react-native-clippathview v1.1.8](https://github.com/O
|
|
|
4
4
|
|
|
5
5
|
## Documentation
|
|
6
6
|
|
|
7
|
-
[中文](https://gitcode.com/
|
|
7
|
+
[中文](https://gitcode.com/CPF-RN/usage-docs/blob/master/zh-cn/react-native-clippath-capi.md)
|
|
8
8
|
|
|
9
|
-
[English](https://gitcode.com/
|
|
9
|
+
[English](https://gitcode.com/CPF-RN/usage-docs/blob/master/en/react-native-clippath-capi.md)
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
## License
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Use these variables when you tailor your ArkTS code. They must be of the const type.
|
|
3
|
+
*/
|
|
4
|
+
export const HAR_VERSION = '1.3.0-beta.1';
|
|
5
|
+
export const BUILD_MODE_NAME = 'debug';
|
|
6
|
+
export const DEBUG = true;
|
|
7
|
+
export const TARGET_NAME = 'default';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* BuildProfile Class is used only for compatibility purposes.
|
|
11
|
+
*/
|
|
12
|
+
export default class BuildProfile {
|
|
13
|
+
static readonly HAR_VERSION = HAR_VERSION;
|
|
14
|
+
static readonly BUILD_MODE_NAME = BUILD_MODE_NAME;
|
|
15
|
+
static readonly DEBUG = DEBUG;
|
|
16
|
+
static readonly TARGET_NAME = TARGET_NAME;
|
|
6
17
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"name": "@react-native-ohos/react-native-clippathview",
|
|
7
7
|
"description": "Please describe the basic information.",
|
|
8
8
|
"main": "index.ets",
|
|
9
|
-
"version": "1.
|
|
9
|
+
"version": "1.3.0-beta.1",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@rnoh/react-native-openharmony": "file:../react_native_openharmony"
|
|
12
12
|
},
|
|
@@ -4,6 +4,21 @@
|
|
|
4
4
|
// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
|
|
5
5
|
// please include "napi/native_api.h".
|
|
6
6
|
|
|
7
|
+
/*
|
|
8
|
+
* Copyright (C) 2022 Huawei Device Co., Ltd.
|
|
9
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
* you may not use this file except in compliance with the License.
|
|
11
|
+
* You may obtain a copy of the License at
|
|
12
|
+
*
|
|
13
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
+
* See the License for the specific language governing permissions and
|
|
19
|
+
* limitations under the License.
|
|
20
|
+
*/
|
|
21
|
+
|
|
7
22
|
#pragma once
|
|
8
23
|
#include "ModUtil.h"
|
|
9
24
|
#include <native_drawing/drawing_path.h>
|
|
@@ -3,7 +3,20 @@
|
|
|
3
3
|
//
|
|
4
4
|
// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
|
|
5
5
|
// please include "napi/native_api.h".
|
|
6
|
-
|
|
6
|
+
/*
|
|
7
|
+
* Copyright (C) 2022 Huawei Device Co., Ltd.
|
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
* you may not use this file except in compliance with the License.
|
|
10
|
+
* You may obtain a copy of the License at
|
|
11
|
+
*
|
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
* See the License for the specific language governing permissions and
|
|
18
|
+
* limitations under the License.
|
|
19
|
+
*/
|
|
7
20
|
#include "ModUtil.h"
|
|
8
21
|
#include "RNOH/arkui/NativeNodeApi.h"
|
|
9
22
|
#include "ClipPathViewNoneNode.h"
|
|
@@ -106,6 +119,9 @@ void ClipPathViewNoneNode::setPanStyleMode(OH_Drawing_Canvas *canvas, int type)
|
|
|
106
119
|
}
|
|
107
120
|
|
|
108
121
|
void ClipPathViewNoneNode::OnDraw(ArkUI_NodeCustomEvent *event) {
|
|
122
|
+
if (mD.empty()) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
109
125
|
auto *drawContext = OH_ArkUI_NodeCustomEvent_GetDrawContextInDraw(event);
|
|
110
126
|
canvas = reinterpret_cast<OH_Drawing_Canvas *>(OH_ArkUI_DrawContext_GetCanvas(drawContext));
|
|
111
127
|
auto width_ = OH_Drawing_CanvasGetWidth(canvas);
|
|
@@ -3,6 +3,20 @@
|
|
|
3
3
|
//
|
|
4
4
|
// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
|
|
5
5
|
// please include "napi/native_api.h".
|
|
6
|
+
/*
|
|
7
|
+
* Copyright (C) 2022 Huawei Device Co., Ltd.
|
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
* you may not use this file except in compliance with the License.
|
|
10
|
+
* You may obtain a copy of the License at
|
|
11
|
+
*
|
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
* See the License for the specific language governing permissions and
|
|
18
|
+
* limitations under the License.
|
|
19
|
+
*/
|
|
6
20
|
#pragma once
|
|
7
21
|
|
|
8
22
|
#include "RNOH/arkui/ArkUINode.h"
|
|
@@ -60,8 +60,10 @@ namespace rnoh {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
std::vector<facebook::react::ComponentDescriptorProvider> createComponentDescriptorProviders() override {
|
|
63
|
-
return {
|
|
64
|
-
facebook::react::RNCClipPathViewNoneComponentDescriptor>()
|
|
63
|
+
return {
|
|
64
|
+
facebook::react::concreteComponentDescriptorProvider<facebook::react::RNCClipPathViewNoneComponentDescriptor>(),
|
|
65
|
+
facebook::react::concreteComponentDescriptorProvider<facebook::react::RNCClipPathViewComponentDescriptor>()
|
|
66
|
+
};
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
std::unique_ptr<TurboModuleFactoryDelegate> createTurboModuleFactoryDelegate() override {
|
|
@@ -4,6 +4,20 @@
|
|
|
4
4
|
// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
|
|
5
5
|
// please include "napi/native_api.h".
|
|
6
6
|
|
|
7
|
+
/*
|
|
8
|
+
* Copyright (C) 2022 Huawei Device Co., Ltd.
|
|
9
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
* you may not use this file except in compliance with the License.
|
|
11
|
+
* You may obtain a copy of the License at
|
|
12
|
+
*
|
|
13
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
+
* See the License for the specific language governing permissions and
|
|
19
|
+
* limitations under the License.
|
|
20
|
+
*/
|
|
7
21
|
typedef enum {
|
|
8
22
|
CLIP_PEN_STYLE_FILL = 1 << 0,
|
|
9
23
|
CLIP_PEN_STYLE_STROKE = 1 << 1,
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import {
|
|
25
|
+
import { TurboModulesFactory } from '@rnoh/react-native-openharmony/ts';
|
|
26
|
+
import { RNOHPackage } from '@rnoh/react-native-openharmony'
|
|
26
27
|
import type { TurboModule, TurboModuleContext } from '@rnoh/react-native-openharmony/ts';
|
|
27
28
|
import { ClipPathTurboModule } from './ClipPathTurboModule';
|
|
28
29
|
|
|
@@ -39,7 +40,7 @@ class ClipPathTurboModulesFactory extends TurboModulesFactory {
|
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
export class ClipPathPackage extends
|
|
43
|
+
export class ClipPathPackage extends RNOHPackage {
|
|
43
44
|
createTurboModulesFactory(ctx: TurboModuleContext): TurboModulesFactory {
|
|
44
45
|
return new ClipPathTurboModulesFactory(ctx);
|
|
45
46
|
}
|
|
@@ -22,10 +22,14 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import { TurboModule } from "@rnoh/react-native-openharmony/ts";
|
|
25
|
+
import { TurboModule, TurboModuleContext } from "@rnoh/react-native-openharmony/ts";
|
|
26
26
|
import display from '@ohos.display';
|
|
27
27
|
|
|
28
28
|
export class ClipPathTurboModule extends TurboModule {
|
|
29
|
+
constructor(ctx: TurboModuleContext) {
|
|
30
|
+
super(ctx);
|
|
31
|
+
}
|
|
32
|
+
|
|
29
33
|
getDensity(): number {
|
|
30
34
|
return display.getDefaultDisplaySync().densityPixels;
|
|
31
35
|
}
|
package/harmony/clipPath.har
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-ohos/react-native-clippathview",
|
|
3
3
|
"title": "React Native ClipPath",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.3.0-beta.1",
|
|
5
5
|
"description": "ClipPath Android Web IOS Harmony",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"types": "index.d.ts",
|
|
@@ -55,6 +55,12 @@
|
|
|
55
55
|
"svgpath": "^2.3.1"
|
|
56
56
|
},
|
|
57
57
|
"harmony": {
|
|
58
|
-
"alias": "react-native-clippathview"
|
|
58
|
+
"alias": "react-native-clippathview",
|
|
59
|
+
"autolinking": {
|
|
60
|
+
"etsPackageClassName":"ClipPathPackage",
|
|
61
|
+
"cppPackageClassName":"ClipPathViewPackage",
|
|
62
|
+
"cmakeLibraryTargetName": "rnoh_clip_path",
|
|
63
|
+
"ohPackageName": "@react-native-ohos/react-native-clippathview"
|
|
64
|
+
}
|
|
59
65
|
}
|
|
60
66
|
}
|
|
File without changes
|