@cervisebas/nodegui-plugin-animation 1.0.0
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/.clang-format +8 -0
- package/CMakeLists.txt +37 -0
- package/README.md +47 -0
- package/config/tests/setup.js +7 -0
- package/config/tests/teardown.js +3 -0
- package/dist/demo.d.ts +1 -0
- package/dist/demo.js +19 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +15 -0
- package/dist/lib/QAbstractAnimation.d.ts +28 -0
- package/dist/lib/QAbstractAnimation.js +76 -0
- package/dist/lib/QPropertyAnimation.d.ts +158 -0
- package/dist/lib/QPropertyAnimation.js +33 -0
- package/dist/lib/QVariantAnimation.d.ts +159 -0
- package/dist/lib/QVariantAnimation.js +44 -0
- package/dist/lib/types/PropertyNames.d.ts +1 -0
- package/dist/lib/types/PropertyNames.js +2 -0
- package/dist/lib/utils/addon.d.ts +2 -0
- package/dist/lib/utils/addon.js +5 -0
- package/package.json +60 -0
- package/src/cpp/QAbstractAnimation/qabstractanimation_macro.h +150 -0
- package/src/cpp/QPropertyAnimation/npropertyanimation.hpp +13 -0
- package/src/cpp/QPropertyAnimation/qpropertyanimation_wrap.cpp +82 -0
- package/src/cpp/QPropertyAnimation/qpropertyanimation_wrap.h +26 -0
- package/src/cpp/QVariantAnimation/nvariantanimation.hpp +13 -0
- package/src/cpp/QVariantAnimation/qvariantanimation_macro.h +66 -0
- package/src/cpp/QVariantAnimation/qvariantanimation_wrap.cpp +47 -0
- package/src/cpp/QVariantAnimation/qvariantanimation_wrap.h +21 -0
- package/src/cpp/main.cpp +12 -0
- package/src/demo.ts +23 -0
- package/src/index.ts +4 -0
- package/src/lib/QAbstractAnimation.ts +57 -0
- package/src/lib/QPropertyAnimation.ts +36 -0
- package/src/lib/QVariantAnimation.ts +38 -0
- package/src/lib/types/PropertyNames.ts +8 -0
- package/src/lib/utils/addon.ts +4 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { WidgetEventTypes, QObject } from '@nodegui/nodegui';
|
|
2
|
+
import addon from './utils/addon';
|
|
3
|
+
import { QAbstractAnimation } from './QAbstractAnimation';
|
|
4
|
+
|
|
5
|
+
export const QVariantAnimationEvents = Object.freeze({
|
|
6
|
+
...WidgetEventTypes,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export abstract class NodeVariantAnimation extends QAbstractAnimation {
|
|
10
|
+
setDuration(duration: number): void {
|
|
11
|
+
this.native?.setDuration(duration);
|
|
12
|
+
}
|
|
13
|
+
setStartValue(value: string | number): void {
|
|
14
|
+
this.native?.setStartValue(value);
|
|
15
|
+
}
|
|
16
|
+
setEndValue(value: string | number): void {
|
|
17
|
+
this.native?.setEndValue(value);
|
|
18
|
+
}
|
|
19
|
+
setKeyValueAt(step: number, value: string | number): void {
|
|
20
|
+
this.native?.setKeyValueAt(step, value);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class QVariantAnimation extends NodeVariantAnimation {
|
|
25
|
+
public nodeParent?: QObject<never>;
|
|
26
|
+
|
|
27
|
+
constructor(parent?: QObject<never>) {
|
|
28
|
+
let native;
|
|
29
|
+
if (parent) {
|
|
30
|
+
native = new addon.QVariantAnimation(parent.native);
|
|
31
|
+
} else {
|
|
32
|
+
native = new addon.QVariantAnimation();
|
|
33
|
+
}
|
|
34
|
+
super(native);
|
|
35
|
+
this.native = native;
|
|
36
|
+
this.nodeParent = parent;
|
|
37
|
+
}
|
|
38
|
+
}
|