-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Diffs= 75823467d databinding (#7341) Co-authored-by: hernan <hernan@rive.app>
- Loading branch information
Showing
64 changed files
with
2,662 additions
and
328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
61f935eedc45f667f74ed7c7be2640d9a0880062 | ||
75823467d0c007983e66df245f1e9c27d707728c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import 'package:rive/src/core/core.dart'; | ||
import 'package:rive/src/rive_core/viewmodel/viewmodel_instance.dart'; | ||
import 'package:rive/src/rive_core/viewmodel/viewmodel_instance_value.dart'; | ||
|
||
class ViewModelInstanceImporter extends ImportStackObject { | ||
final ViewModelInstance viewModelInstance; | ||
ViewModelInstanceImporter(this.viewModelInstance); | ||
|
||
void addValue(ViewModelInstanceValue value) { | ||
viewModelInstance.addPropertyValue(value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import 'dart:collection'; | ||
|
||
import 'package:rive/src/rive_core/viewmodel/data_enum_value.dart'; | ||
|
||
class DataEnumValues<T extends DataEnumValue> extends ListBase<T> { | ||
final List<T?> _values = []; | ||
List<T> get values => _values.cast<T>(); | ||
|
||
@override | ||
int get length => _values.length; | ||
|
||
@override | ||
set length(int value) => _values.length = value; | ||
|
||
@override | ||
T operator [](int index) => _values[index]!; | ||
|
||
@override | ||
void operator []=(int index, T value) => _values[index] = value; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
// Core automatically generated | ||
// lib/src/generated/data_bind/data_bind_base.dart. | ||
// Do not modify manually. | ||
|
||
import 'package:rive/src/core/core.dart'; | ||
import 'package:rive/src/rive_core/component.dart'; | ||
|
||
abstract class DataBindBase extends Component { | ||
static const int typeKey = 446; | ||
@override | ||
int get coreType => DataBindBase.typeKey; | ||
@override | ||
Set<int> get coreTypes => {DataBindBase.typeKey, ComponentBase.typeKey}; | ||
|
||
/// -------------------------------------------------------------------------- | ||
/// TargetId field with key 585. | ||
static const int targetIdPropertyKey = 585; | ||
static const int targetIdInitialValue = -1; | ||
int _targetId = targetIdInitialValue; | ||
|
||
/// Identifier used to track the object that is targetted. | ||
int get targetId => _targetId; | ||
|
||
/// Change the [_targetId] field value. | ||
/// [targetIdChanged] will be invoked only if the field's value has changed. | ||
set targetId(int value) { | ||
if (_targetId == value) { | ||
return; | ||
} | ||
int from = _targetId; | ||
_targetId = value; | ||
if (hasValidated) { | ||
targetIdChanged(from, value); | ||
} | ||
} | ||
|
||
void targetIdChanged(int from, int to); | ||
|
||
/// -------------------------------------------------------------------------- | ||
/// PropertyKey field with key 586. | ||
static const int propertyKeyPropertyKey = 586; | ||
static const int propertyKeyInitialValue = CoreContext.invalidPropertyKey; | ||
int _propertyKey = propertyKeyInitialValue; | ||
|
||
/// The property that is targeted. | ||
int get propertyKey => _propertyKey; | ||
|
||
/// Change the [_propertyKey] field value. | ||
/// [propertyKeyChanged] will be invoked only if the field's value has | ||
/// changed. | ||
set propertyKey(int value) { | ||
if (_propertyKey == value) { | ||
return; | ||
} | ||
int from = _propertyKey; | ||
_propertyKey = value; | ||
if (hasValidated) { | ||
propertyKeyChanged(from, value); | ||
} | ||
} | ||
|
||
void propertyKeyChanged(int from, int to); | ||
|
||
/// -------------------------------------------------------------------------- | ||
/// ModeValue field with key 587. | ||
static const int modeValuePropertyKey = 587; | ||
static const int modeValueInitialValue = 0; | ||
int _modeValue = modeValueInitialValue; | ||
|
||
/// Backing enum value for the binding mode. | ||
int get modeValue => _modeValue; | ||
|
||
/// Change the [_modeValue] field value. | ||
/// [modeValueChanged] will be invoked only if the field's value has changed. | ||
set modeValue(int value) { | ||
if (_modeValue == value) { | ||
return; | ||
} | ||
int from = _modeValue; | ||
_modeValue = value; | ||
if (hasValidated) { | ||
modeValueChanged(from, value); | ||
} | ||
} | ||
|
||
void modeValueChanged(int from, int to); | ||
|
||
@override | ||
void copy(Core source) { | ||
super.copy(source); | ||
if (source is DataBindBase) { | ||
_targetId = source._targetId; | ||
_propertyKey = source._propertyKey; | ||
_modeValue = source._modeValue; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Core automatically generated | ||
// lib/src/generated/data_bind/data_bind_context_base.dart. | ||
// Do not modify manually. | ||
|
||
import 'package:rive/src/core/core.dart'; | ||
import 'package:rive/src/generated/component_base.dart'; | ||
import 'package:rive/src/rive_core/data_bind/data_bind.dart'; | ||
|
||
abstract class DataBindContextBase extends DataBind { | ||
static const int typeKey = 447; | ||
@override | ||
int get coreType => DataBindContextBase.typeKey; | ||
@override | ||
Set<int> get coreTypes => { | ||
DataBindContextBase.typeKey, | ||
DataBindBase.typeKey, | ||
ComponentBase.typeKey | ||
}; | ||
|
||
/// -------------------------------------------------------------------------- | ||
/// SourcePathIds field with key 588. | ||
static const int sourcePathIdsPropertyKey = 588; | ||
static final Uint8List sourcePathIdsInitialValue = Uint8List(0); | ||
Uint8List _sourcePathIds = sourcePathIdsInitialValue; | ||
|
||
/// Path to the selected property. | ||
Uint8List get sourcePathIds => _sourcePathIds; | ||
|
||
/// Change the [_sourcePathIds] field value. | ||
/// [sourcePathIdsChanged] will be invoked only if the field's value has | ||
/// changed. | ||
set sourcePathIds(Uint8List value) { | ||
if (listEquals(_sourcePathIds, value)) { | ||
return; | ||
} | ||
Uint8List from = _sourcePathIds; | ||
_sourcePathIds = value; | ||
if (hasValidated) { | ||
sourcePathIdsChanged(from, value); | ||
} | ||
} | ||
|
||
void sourcePathIdsChanged(Uint8List from, Uint8List to); | ||
|
||
@override | ||
void copy(Core source) { | ||
super.copy(source); | ||
if (source is DataBindContextBase) { | ||
_sourcePathIds = source._sourcePathIds; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.