From 6337547b082fd10f00d3362fc54c3fc920098bf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=20=C5=A0e=C5=A1ko?= Date: Sun, 26 Nov 2023 18:39:27 +0100 Subject: [PATCH] Update gitignore, push generated files --- .gitignore | 10 +- .../lib/src/command_factory_provider.g.dart | 25 + .../lib/src/command_manager_provider.g.dart | 25 + .../test/draw_path_command_test.mocks.dart | 616 ++++++++++ .../lib/src/graphic_factory_provider.g.dart | 25 + .../database/lib/src/project_database.g.dart | 204 ++++ .../test/landing_page_test.mocks.dart | 413 +++++++ .../src/states/canvas_state_data.freezed.dart | 221 ++++ .../src/states/canvas_state_provider.g.dart | 25 + .../render_image_for_export_test.mocks.dart | 676 +++++++++++ .../proto/output/catrobat_image.pb.dart | 134 ++ .../proto/output/catrobat_image.pbenum.dart | 11 + .../proto/output/catrobat_image.pbjson.dart | 36 + .../proto/output/catrobat_image.pbserver.dart | 14 + .../command/graphic/draw_path_command.pb.dart | 89 ++ .../graphic/draw_path_command.pbenum.dart | 11 + .../graphic/draw_path_command.pbjson.dart | 29 + .../graphic/draw_path_command.pbserver.dart | 14 + .../proto/output/google/protobuf/any.pb.dart | 208 ++++ .../output/google/protobuf/any.pbenum.dart | 11 + .../output/google/protobuf/any.pbjson.dart | 28 + .../output/google/protobuf/any.pbserver.dart | 14 + .../proto/output/graphic/paint.pb.dart | 142 +++ .../proto/output/graphic/paint.pbenum.dart | 81 ++ .../proto/output/graphic/paint.pbjson.dart | 81 ++ .../proto/output/graphic/paint.pbserver.dart | 14 + .../proto/output/graphic/path.pb.dart | 341 ++++++ .../proto/output/graphic/path.pbenum.dart | 32 + .../proto/output/graphic/path.pbjson.dart | 84 ++ .../proto/output/graphic/path.pbserver.dart | 14 + ...d_image_from_photo_library_test.mocks.dart | 212 ++++ .../photo_library_service_test.mocks.dart | 480 ++++++++ .../test/save_as_raster_image_test.mocks.dart | 334 +++++ .../src/brush_tool/brush_tool_provider.g.dart | 24 + .../brush_tool_state_data.freezed.dart | 134 ++ .../brush_tool_state_provider.g.dart | 26 + .../eraser_tool/eraser_tool_provider.g.dart | 24 + .../toolbox/toolbox_state_data.freezed.dart | 173 +++ .../src/toolbox/toolbox_state_provider.g.dart | 25 + .../tools/test/brush_tool_test.mocks.dart | 1079 +++++++++++++++++ 40 files changed, 6135 insertions(+), 4 deletions(-) create mode 100644 packages/command/lib/src/command_factory_provider.g.dart create mode 100644 packages/command/lib/src/command_manager_provider.g.dart create mode 100644 packages/command/test/draw_path_command_test.mocks.dart create mode 100644 packages/component_library/lib/src/graphic_factory_provider.g.dart create mode 100644 packages/database/lib/src/project_database.g.dart create mode 100644 packages/features/landing_page_screen/test/landing_page_test.mocks.dart create mode 100644 packages/features/workspace_screen/lib/src/states/canvas_state_data.freezed.dart create mode 100644 packages/features/workspace_screen/lib/src/states/canvas_state_provider.g.dart create mode 100644 packages/features/workspace_screen/test/render_image_for_export_test.mocks.dart create mode 100644 packages/io_library/lib/src/serialization/proto/output/catrobat_image.pb.dart create mode 100644 packages/io_library/lib/src/serialization/proto/output/catrobat_image.pbenum.dart create mode 100644 packages/io_library/lib/src/serialization/proto/output/catrobat_image.pbjson.dart create mode 100644 packages/io_library/lib/src/serialization/proto/output/catrobat_image.pbserver.dart create mode 100644 packages/io_library/lib/src/serialization/proto/output/command/graphic/draw_path_command.pb.dart create mode 100644 packages/io_library/lib/src/serialization/proto/output/command/graphic/draw_path_command.pbenum.dart create mode 100644 packages/io_library/lib/src/serialization/proto/output/command/graphic/draw_path_command.pbjson.dart create mode 100644 packages/io_library/lib/src/serialization/proto/output/command/graphic/draw_path_command.pbserver.dart create mode 100644 packages/io_library/lib/src/serialization/proto/output/google/protobuf/any.pb.dart create mode 100644 packages/io_library/lib/src/serialization/proto/output/google/protobuf/any.pbenum.dart create mode 100644 packages/io_library/lib/src/serialization/proto/output/google/protobuf/any.pbjson.dart create mode 100644 packages/io_library/lib/src/serialization/proto/output/google/protobuf/any.pbserver.dart create mode 100644 packages/io_library/lib/src/serialization/proto/output/graphic/paint.pb.dart create mode 100644 packages/io_library/lib/src/serialization/proto/output/graphic/paint.pbenum.dart create mode 100644 packages/io_library/lib/src/serialization/proto/output/graphic/paint.pbjson.dart create mode 100644 packages/io_library/lib/src/serialization/proto/output/graphic/paint.pbserver.dart create mode 100644 packages/io_library/lib/src/serialization/proto/output/graphic/path.pb.dart create mode 100644 packages/io_library/lib/src/serialization/proto/output/graphic/path.pbenum.dart create mode 100644 packages/io_library/lib/src/serialization/proto/output/graphic/path.pbjson.dart create mode 100644 packages/io_library/lib/src/serialization/proto/output/graphic/path.pbserver.dart create mode 100644 packages/io_library/test/load_image_from_photo_library_test.mocks.dart create mode 100644 packages/io_library/test/photo_library_service_test.mocks.dart create mode 100644 packages/io_library/test/save_as_raster_image_test.mocks.dart create mode 100644 packages/tools/lib/src/brush_tool/brush_tool_provider.g.dart create mode 100644 packages/tools/lib/src/brush_tool/brush_tool_state_data.freezed.dart create mode 100644 packages/tools/lib/src/brush_tool/brush_tool_state_provider.g.dart create mode 100644 packages/tools/lib/src/eraser_tool/eraser_tool_provider.g.dart create mode 100644 packages/tools/lib/src/toolbox/toolbox_state_data.freezed.dart create mode 100644 packages/tools/lib/src/toolbox/toolbox_state_provider.g.dart create mode 100644 packages/tools/test/brush_tool_test.mocks.dart diff --git a/.gitignore b/.gitignore index 94948df9..ee9b9053 100644 --- a/.gitignore +++ b/.gitignore @@ -30,10 +30,12 @@ migrate_working_dir/ .pub/ /build/ coverage -*.mocks.dart -*.pb*.dart -*.g.dart -*.freezed.dart + +# Commented out to push generated code: +# *.mocks.dart +# *.pb*.dart +# *.g.dart +# *.freezed.dart # Web related lib/generated_plugin_registrant.dart diff --git a/packages/command/lib/src/command_factory_provider.g.dart b/packages/command/lib/src/command_factory_provider.g.dart new file mode 100644 index 00000000..c851d50b --- /dev/null +++ b/packages/command/lib/src/command_factory_provider.g.dart @@ -0,0 +1,25 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'command_factory_provider.dart'; + +// ************************************************************************** +// RiverpodGenerator +// ************************************************************************** + +String _$commandFactoryHash() => r'9274f1b9adb5d973abccec2e14a55c11b299f52c'; + +/// See also [commandFactory]. +@ProviderFor(commandFactory) +final commandFactoryProvider = Provider.internal( + commandFactory, + name: r'commandFactoryProvider', + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') + ? null + : _$commandFactoryHash, + dependencies: null, + allTransitiveDependencies: null, +); + +typedef CommandFactoryRef = ProviderRef; +// ignore_for_file: type=lint +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member diff --git a/packages/command/lib/src/command_manager_provider.g.dart b/packages/command/lib/src/command_manager_provider.g.dart new file mode 100644 index 00000000..528fd2be --- /dev/null +++ b/packages/command/lib/src/command_manager_provider.g.dart @@ -0,0 +1,25 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'command_manager_provider.dart'; + +// ************************************************************************** +// RiverpodGenerator +// ************************************************************************** + +String _$commandManagerHash() => r'cd76374b9414ebebac1eead0d28106cb9fcd4eea'; + +/// See also [commandManager]. +@ProviderFor(commandManager) +final commandManagerProvider = Provider.internal( + commandManager, + name: r'commandManagerProvider', + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') + ? null + : _$commandManagerHash, + dependencies: null, + allTransitiveDependencies: null, +); + +typedef CommandManagerRef = ProviderRef; +// ignore_for_file: type=lint +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member diff --git a/packages/command/test/draw_path_command_test.mocks.dart b/packages/command/test/draw_path_command_test.mocks.dart new file mode 100644 index 00000000..c99dba38 --- /dev/null +++ b/packages/command/test/draw_path_command_test.mocks.dart @@ -0,0 +1,616 @@ +// Mocks generated by Mockito 5.4.2 from annotations +// in command/test/draw_path_command_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i3; +import 'dart:ui' as _i2; + +import 'package:mockito/mockito.dart' as _i1; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeRect_0 extends _i1.SmartFake implements _i2.Rect { + _FakeRect_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [Canvas]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockCanvas extends _i1.Mock implements _i2.Canvas { + MockCanvas() { + _i1.throwOnMissingStub(this); + } + + @override + void save() => super.noSuchMethod( + Invocation.method( + #save, + [], + ), + returnValueForMissingStub: null, + ); + + @override + void saveLayer( + _i2.Rect? bounds, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #saveLayer, + [ + bounds, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void restore() => super.noSuchMethod( + Invocation.method( + #restore, + [], + ), + returnValueForMissingStub: null, + ); + + @override + void restoreToCount(int? count) => super.noSuchMethod( + Invocation.method( + #restoreToCount, + [count], + ), + returnValueForMissingStub: null, + ); + + @override + int getSaveCount() => (super.noSuchMethod( + Invocation.method( + #getSaveCount, + [], + ), + returnValue: 0, + ) as int); + + @override + void translate( + double? dx, + double? dy, + ) => + super.noSuchMethod( + Invocation.method( + #translate, + [ + dx, + dy, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void scale( + double? sx, [ + double? sy, + ]) => + super.noSuchMethod( + Invocation.method( + #scale, + [ + sx, + sy, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void rotate(double? radians) => super.noSuchMethod( + Invocation.method( + #rotate, + [radians], + ), + returnValueForMissingStub: null, + ); + + @override + void skew( + double? sx, + double? sy, + ) => + super.noSuchMethod( + Invocation.method( + #skew, + [ + sx, + sy, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void transform(_i3.Float64List? matrix4) => super.noSuchMethod( + Invocation.method( + #transform, + [matrix4], + ), + returnValueForMissingStub: null, + ); + + @override + _i3.Float64List getTransform() => (super.noSuchMethod( + Invocation.method( + #getTransform, + [], + ), + returnValue: _i3.Float64List(0), + ) as _i3.Float64List); + + @override + void clipRect( + _i2.Rect? rect, { + _i2.ClipOp? clipOp = _i2.ClipOp.intersect, + bool? doAntiAlias = true, + }) => + super.noSuchMethod( + Invocation.method( + #clipRect, + [rect], + { + #clipOp: clipOp, + #doAntiAlias: doAntiAlias, + }, + ), + returnValueForMissingStub: null, + ); + + @override + void clipRRect( + _i2.RRect? rrect, { + bool? doAntiAlias = true, + }) => + super.noSuchMethod( + Invocation.method( + #clipRRect, + [rrect], + {#doAntiAlias: doAntiAlias}, + ), + returnValueForMissingStub: null, + ); + + @override + void clipPath( + _i2.Path? path, { + bool? doAntiAlias = true, + }) => + super.noSuchMethod( + Invocation.method( + #clipPath, + [path], + {#doAntiAlias: doAntiAlias}, + ), + returnValueForMissingStub: null, + ); + + @override + _i2.Rect getLocalClipBounds() => (super.noSuchMethod( + Invocation.method( + #getLocalClipBounds, + [], + ), + returnValue: _FakeRect_0( + this, + Invocation.method( + #getLocalClipBounds, + [], + ), + ), + ) as _i2.Rect); + + @override + _i2.Rect getDestinationClipBounds() => (super.noSuchMethod( + Invocation.method( + #getDestinationClipBounds, + [], + ), + returnValue: _FakeRect_0( + this, + Invocation.method( + #getDestinationClipBounds, + [], + ), + ), + ) as _i2.Rect); + + @override + void drawColor( + _i2.Color? color, + _i2.BlendMode? blendMode, + ) => + super.noSuchMethod( + Invocation.method( + #drawColor, + [ + color, + blendMode, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawLine( + _i2.Offset? p1, + _i2.Offset? p2, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawLine, + [ + p1, + p2, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawPaint(_i2.Paint? paint) => super.noSuchMethod( + Invocation.method( + #drawPaint, + [paint], + ), + returnValueForMissingStub: null, + ); + + @override + void drawRect( + _i2.Rect? rect, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawRect, + [ + rect, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawRRect( + _i2.RRect? rrect, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawRRect, + [ + rrect, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawDRRect( + _i2.RRect? outer, + _i2.RRect? inner, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawDRRect, + [ + outer, + inner, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawOval( + _i2.Rect? rect, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawOval, + [ + rect, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawCircle( + _i2.Offset? c, + double? radius, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawCircle, + [ + c, + radius, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawArc( + _i2.Rect? rect, + double? startAngle, + double? sweepAngle, + bool? useCenter, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawArc, + [ + rect, + startAngle, + sweepAngle, + useCenter, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawPath( + _i2.Path? path, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawPath, + [ + path, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawImage( + _i2.Image? image, + _i2.Offset? offset, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawImage, + [ + image, + offset, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawImageRect( + _i2.Image? image, + _i2.Rect? src, + _i2.Rect? dst, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawImageRect, + [ + image, + src, + dst, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawImageNine( + _i2.Image? image, + _i2.Rect? center, + _i2.Rect? dst, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawImageNine, + [ + image, + center, + dst, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawPicture(_i2.Picture? picture) => super.noSuchMethod( + Invocation.method( + #drawPicture, + [picture], + ), + returnValueForMissingStub: null, + ); + + @override + void drawParagraph( + _i2.Paragraph? paragraph, + _i2.Offset? offset, + ) => + super.noSuchMethod( + Invocation.method( + #drawParagraph, + [ + paragraph, + offset, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawPoints( + _i2.PointMode? pointMode, + List<_i2.Offset>? points, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawPoints, + [ + pointMode, + points, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawRawPoints( + _i2.PointMode? pointMode, + _i3.Float32List? points, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawRawPoints, + [ + pointMode, + points, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawVertices( + _i2.Vertices? vertices, + _i2.BlendMode? blendMode, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawVertices, + [ + vertices, + blendMode, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawAtlas( + _i2.Image? atlas, + List<_i2.RSTransform>? transforms, + List<_i2.Rect>? rects, + List<_i2.Color>? colors, + _i2.BlendMode? blendMode, + _i2.Rect? cullRect, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawAtlas, + [ + atlas, + transforms, + rects, + colors, + blendMode, + cullRect, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawRawAtlas( + _i2.Image? atlas, + _i3.Float32List? rstTransforms, + _i3.Float32List? rects, + _i3.Int32List? colors, + _i2.BlendMode? blendMode, + _i2.Rect? cullRect, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawRawAtlas, + [ + atlas, + rstTransforms, + rects, + colors, + blendMode, + cullRect, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawShadow( + _i2.Path? path, + _i2.Color? color, + double? elevation, + bool? transparentOccluder, + ) => + super.noSuchMethod( + Invocation.method( + #drawShadow, + [ + path, + color, + elevation, + transparentOccluder, + ], + ), + returnValueForMissingStub: null, + ); +} diff --git a/packages/component_library/lib/src/graphic_factory_provider.g.dart b/packages/component_library/lib/src/graphic_factory_provider.g.dart new file mode 100644 index 00000000..af0d0b89 --- /dev/null +++ b/packages/component_library/lib/src/graphic_factory_provider.g.dart @@ -0,0 +1,25 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'graphic_factory_provider.dart'; + +// ************************************************************************** +// RiverpodGenerator +// ************************************************************************** + +String _$graphicFactoryHash() => r'a32ae8670aee6a5741031a48a68bac61b3aa411a'; + +/// See also [graphicFactory]. +@ProviderFor(graphicFactory) +final graphicFactoryProvider = Provider.internal( + graphicFactory, + name: r'graphicFactoryProvider', + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') + ? null + : _$graphicFactoryHash, + dependencies: null, + allTransitiveDependencies: null, +); + +typedef GraphicFactoryRef = ProviderRef; +// ignore_for_file: type=lint +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member diff --git a/packages/database/lib/src/project_database.g.dart b/packages/database/lib/src/project_database.g.dart new file mode 100644 index 00000000..ea36ed0d --- /dev/null +++ b/packages/database/lib/src/project_database.g.dart @@ -0,0 +1,204 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'project_database.dart'; + +// ************************************************************************** +// FloorGenerator +// ************************************************************************** + +// ignore: avoid_classes_with_only_static_members +class $FloorProjectDatabase { + /// Creates a database builder for a persistent database. + /// Once a database is built, you should keep a reference to it and re-use it. + static _$ProjectDatabaseBuilder databaseBuilder(String name) => + _$ProjectDatabaseBuilder(name); + + /// Creates a database builder for an in memory database. + /// Information stored in an in memory database disappears when the process is killed. + /// Once a database is built, you should keep a reference to it and re-use it. + static _$ProjectDatabaseBuilder inMemoryDatabaseBuilder() => + _$ProjectDatabaseBuilder(null); +} + +class _$ProjectDatabaseBuilder { + _$ProjectDatabaseBuilder(this.name); + + final String? name; + + final List _migrations = []; + + Callback? _callback; + + /// Adds migrations to the builder. + _$ProjectDatabaseBuilder addMigrations(List migrations) { + _migrations.addAll(migrations); + return this; + } + + /// Adds a database [Callback] to the builder. + _$ProjectDatabaseBuilder addCallback(Callback callback) { + _callback = callback; + return this; + } + + /// Creates the database and initializes it. + Future build() async { + final path = name != null + ? await sqfliteDatabaseFactory.getDatabasePath(name!) + : ':memory:'; + final database = _$ProjectDatabase(); + database.database = await database.open( + path, + _migrations, + _callback, + ); + return database; + } +} + +class _$ProjectDatabase extends ProjectDatabase { + _$ProjectDatabase([StreamController? listener]) { + changeListener = listener ?? StreamController.broadcast(); + } + + ProjectDAO? _projectDAOInstance; + + Future open( + String path, + List migrations, [ + Callback? callback, + ]) async { + final databaseOptions = sqflite.OpenDatabaseOptions( + version: 1, + onConfigure: (database) async { + await database.execute('PRAGMA foreign_keys = ON'); + await callback?.onConfigure?.call(database); + }, + onOpen: (database) async { + await callback?.onOpen?.call(database); + }, + onUpgrade: (database, startVersion, endVersion) async { + await MigrationAdapter.runMigrations( + database, startVersion, endVersion, migrations); + + await callback?.onUpgrade?.call(database, startVersion, endVersion); + }, + onCreate: (database, version) async { + await database.execute( + 'CREATE TABLE IF NOT EXISTS `Project` (`name` TEXT NOT NULL, `path` TEXT NOT NULL, `lastModified` INTEGER NOT NULL, `creationDate` INTEGER NOT NULL, `resolution` TEXT, `format` TEXT, `size` INTEGER, `imagePreviewPath` TEXT, `id` INTEGER PRIMARY KEY AUTOINCREMENT)'); + + await callback?.onCreate?.call(database, version); + }, + ); + return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); + } + + @override + ProjectDAO get projectDAO { + return _projectDAOInstance ??= _$ProjectDAO(database, changeListener); + } +} + +class _$ProjectDAO extends ProjectDAO { + _$ProjectDAO( + this.database, + this.changeListener, + ) : _queryAdapter = QueryAdapter(database), + _projectInsertionAdapter = InsertionAdapter( + database, + 'Project', + (Project item) => { + 'name': item.name, + 'path': item.path, + 'lastModified': _dateTimeConverter.encode(item.lastModified), + 'creationDate': _dateTimeConverter.encode(item.creationDate), + 'resolution': item.resolution, + 'format': item.format, + 'size': item.size, + 'imagePreviewPath': item.imagePreviewPath, + 'id': item.id + }), + _projectDeletionAdapter = DeletionAdapter( + database, + 'Project', + ['id'], + (Project item) => { + 'name': item.name, + 'path': item.path, + 'lastModified': _dateTimeConverter.encode(item.lastModified), + 'creationDate': _dateTimeConverter.encode(item.creationDate), + 'resolution': item.resolution, + 'format': item.format, + 'size': item.size, + 'imagePreviewPath': item.imagePreviewPath, + 'id': item.id + }); + + final sqflite.DatabaseExecutor database; + + final StreamController changeListener; + + final QueryAdapter _queryAdapter; + + final InsertionAdapter _projectInsertionAdapter; + + final DeletionAdapter _projectDeletionAdapter; + + @override + Future deleteProject(int id) async { + await _queryAdapter + .queryNoReturn('DELETE FROM Project WHERE id = ?1', arguments: [id]); + } + + @override + Future> getProjects() async { + return _queryAdapter.queryList( + 'SELECT * FROM Project order by lastModified desc', + mapper: (Map row) => Project( + name: row['name'] as String, + path: row['path'] as String, + lastModified: _dateTimeConverter.decode(row['lastModified'] as int), + creationDate: _dateTimeConverter.decode(row['creationDate'] as int), + resolution: row['resolution'] as String?, + format: row['format'] as String?, + size: row['size'] as int?, + imagePreviewPath: row['imagePreviewPath'] as String?, + id: row['id'] as int?)); + } + + @override + Future getProjectByName(String name) async { + return _queryAdapter.query('SELECT * FROM Project WHERE name = ?1', + mapper: (Map row) => Project( + name: row['name'] as String, + path: row['path'] as String, + lastModified: _dateTimeConverter.decode(row['lastModified'] as int), + creationDate: _dateTimeConverter.decode(row['creationDate'] as int), + resolution: row['resolution'] as String?, + format: row['format'] as String?, + size: row['size'] as int?, + imagePreviewPath: row['imagePreviewPath'] as String?, + id: row['id'] as int?), + arguments: [name]); + } + + @override + Future insertProject(Project project) { + return _projectInsertionAdapter.insertAndReturnId( + project, OnConflictStrategy.replace); + } + + @override + Future> insertProjects(List projects) { + return _projectInsertionAdapter.insertListAndReturnIds( + projects, OnConflictStrategy.replace); + } + + @override + Future deleteProjects(List projects) async { + await _projectDeletionAdapter.deleteList(projects); + } +} + +// ignore_for_file: unused_element +final _dateTimeConverter = DateTimeConverter(); diff --git a/packages/features/landing_page_screen/test/landing_page_test.mocks.dart b/packages/features/landing_page_screen/test/landing_page_test.mocks.dart new file mode 100644 index 00000000..043d792f --- /dev/null +++ b/packages/features/landing_page_screen/test/landing_page_test.mocks.dart @@ -0,0 +1,413 @@ +// Mocks generated by Mockito 5.4.2 from annotations +// in landing_page_screen/test/landing_page_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i3; +import 'dart:io' as _i12; +import 'dart:typed_data' as _i11; +import 'dart:ui' as _i9; + +import 'package:component_library/component_library.dart' as _i10; +import 'package:database/src/models/project.dart' as _i7; +import 'package:database/src/project_dao.dart' as _i2; +import 'package:database/src/project_database.dart' as _i6; +import 'package:io_library/io_library.dart' as _i8; +import 'package:mockito/mockito.dart' as _i1; +import 'package:oxidized/oxidized.dart' as _i5; +import 'package:sqflite/sqflite.dart' as _i4; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeProjectDAO_0 extends _i1.SmartFake implements _i2.ProjectDAO { + _FakeProjectDAO_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeStreamController_1 extends _i1.SmartFake + implements _i3.StreamController { + _FakeStreamController_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeDatabaseExecutor_2 extends _i1.SmartFake + implements _i4.DatabaseExecutor { + _FakeDatabaseExecutor_2( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeResult_3 extends _i1.SmartFake + implements _i5.Result { + _FakeResult_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [ProjectDatabase]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockProjectDatabase extends _i1.Mock implements _i6.ProjectDatabase { + MockProjectDatabase() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.ProjectDAO get projectDAO => (super.noSuchMethod( + Invocation.getter(#projectDAO), + returnValue: _FakeProjectDAO_0( + this, + Invocation.getter(#projectDAO), + ), + ) as _i2.ProjectDAO); + + @override + _i3.StreamController get changeListener => (super.noSuchMethod( + Invocation.getter(#changeListener), + returnValue: _FakeStreamController_1( + this, + Invocation.getter(#changeListener), + ), + ) as _i3.StreamController); + + @override + set changeListener(_i3.StreamController? _changeListener) => + super.noSuchMethod( + Invocation.setter( + #changeListener, + _changeListener, + ), + returnValueForMissingStub: null, + ); + + @override + _i4.DatabaseExecutor get database => (super.noSuchMethod( + Invocation.getter(#database), + returnValue: _FakeDatabaseExecutor_2( + this, + Invocation.getter(#database), + ), + ) as _i4.DatabaseExecutor); + + @override + set database(_i4.DatabaseExecutor? _database) => super.noSuchMethod( + Invocation.setter( + #database, + _database, + ), + returnValueForMissingStub: null, + ); + + @override + _i3.Future close() => (super.noSuchMethod( + Invocation.method( + #close, + [], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); +} + +/// A class which mocks [ProjectDAO]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockProjectDAO extends _i1.Mock implements _i2.ProjectDAO { + MockProjectDAO() { + _i1.throwOnMissingStub(this); + } + + @override + _i3.Future insertProject(_i7.Project? project) => (super.noSuchMethod( + Invocation.method( + #insertProject, + [project], + ), + returnValue: _i3.Future.value(0), + ) as _i3.Future); + + @override + _i3.Future> insertProjects(List<_i7.Project>? projects) => + (super.noSuchMethod( + Invocation.method( + #insertProjects, + [projects], + ), + returnValue: _i3.Future>.value([]), + ) as _i3.Future>); + + @override + _i3.Future deleteProject(int? id) => (super.noSuchMethod( + Invocation.method( + #deleteProject, + [id], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); + + @override + _i3.Future deleteProjects(List<_i7.Project>? projects) => + (super.noSuchMethod( + Invocation.method( + #deleteProjects, + [projects], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); + + @override + _i3.Future> getProjects() => (super.noSuchMethod( + Invocation.method( + #getProjects, + [], + ), + returnValue: _i3.Future>.value(<_i7.Project>[]), + ) as _i3.Future>); + + @override + _i3.Future<_i7.Project?> getProjectByName(String? name) => + (super.noSuchMethod( + Invocation.method( + #getProjectByName, + [name], + ), + returnValue: _i3.Future<_i7.Project?>.value(), + ) as _i3.Future<_i7.Project?>); +} + +/// A class which mocks [IImageService]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockIImageService extends _i1.Mock implements _i8.IImageService { + MockIImageService() { + _i1.throwOnMissingStub(this); + } + + @override + _i3.Future<_i5.Result<_i9.Image, _i10.Failure>> import( + _i11.Uint8List? fileData) => + (super.noSuchMethod( + Invocation.method( + #import, + [fileData], + ), + returnValue: _i3.Future<_i5.Result<_i9.Image, _i10.Failure>>.value( + _FakeResult_3<_i9.Image, _i10.Failure>( + this, + Invocation.method( + #import, + [fileData], + ), + )), + ) as _i3.Future<_i5.Result<_i9.Image, _i10.Failure>>); + + @override + _i3.Future<_i5.Result<_i11.Uint8List, _i10.Failure>> exportAsJpg( + _i9.Image? image, + int? quality, + ) => + (super.noSuchMethod( + Invocation.method( + #exportAsJpg, + [ + image, + quality, + ], + ), + returnValue: _i3.Future<_i5.Result<_i11.Uint8List, _i10.Failure>>.value( + _FakeResult_3<_i11.Uint8List, _i10.Failure>( + this, + Invocation.method( + #exportAsJpg, + [ + image, + quality, + ], + ), + )), + ) as _i3.Future<_i5.Result<_i11.Uint8List, _i10.Failure>>); + + @override + _i3.Future<_i5.Result<_i11.Uint8List, _i10.Failure>> exportAsPng( + _i9.Image? image) => + (super.noSuchMethod( + Invocation.method( + #exportAsPng, + [image], + ), + returnValue: _i3.Future<_i5.Result<_i11.Uint8List, _i10.Failure>>.value( + _FakeResult_3<_i11.Uint8List, _i10.Failure>( + this, + Invocation.method( + #exportAsPng, + [image], + ), + )), + ) as _i3.Future<_i5.Result<_i11.Uint8List, _i10.Failure>>); + + @override + _i5.Result<_i11.Uint8List, _i10.Failure> getProjectPreview(String? path) => + (super.noSuchMethod( + Invocation.method( + #getProjectPreview, + [path], + ), + returnValue: _FakeResult_3<_i11.Uint8List, _i10.Failure>( + this, + Invocation.method( + #getProjectPreview, + [path], + ), + ), + ) as _i5.Result<_i11.Uint8List, _i10.Failure>); +} + +/// A class which mocks [IFileService]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockIFileService extends _i1.Mock implements _i8.IFileService { + MockIFileService() { + _i1.throwOnMissingStub(this); + } + + @override + _i3.Future<_i5.Result<_i12.File, _i10.Failure>> save( + String? filename, + _i11.Uint8List? data, + ) => + (super.noSuchMethod( + Invocation.method( + #save, + [ + filename, + data, + ], + ), + returnValue: _i3.Future<_i5.Result<_i12.File, _i10.Failure>>.value( + _FakeResult_3<_i12.File, _i10.Failure>( + this, + Invocation.method( + #save, + [ + filename, + data, + ], + ), + )), + ) as _i3.Future<_i5.Result<_i12.File, _i10.Failure>>); + + @override + _i3.Future<_i5.Result<_i12.File, _i10.Failure>> saveToApplicationDirectory( + String? filename, + _i11.Uint8List? data, + ) => + (super.noSuchMethod( + Invocation.method( + #saveToApplicationDirectory, + [ + filename, + data, + ], + ), + returnValue: _i3.Future<_i5.Result<_i12.File, _i10.Failure>>.value( + _FakeResult_3<_i12.File, _i10.Failure>( + this, + Invocation.method( + #saveToApplicationDirectory, + [ + filename, + data, + ], + ), + )), + ) as _i3.Future<_i5.Result<_i12.File, _i10.Failure>>); + + @override + _i3.Future<_i5.Result<_i12.File, _i10.Failure>> pick() => (super.noSuchMethod( + Invocation.method( + #pick, + [], + ), + returnValue: _i3.Future<_i5.Result<_i12.File, _i10.Failure>>.value( + _FakeResult_3<_i12.File, _i10.Failure>( + this, + Invocation.method( + #pick, + [], + ), + )), + ) as _i3.Future<_i5.Result<_i12.File, _i10.Failure>>); + + @override + _i5.Result<_i12.File, _i10.Failure> getFile(String? path) => + (super.noSuchMethod( + Invocation.method( + #getFile, + [path], + ), + returnValue: _FakeResult_3<_i12.File, _i10.Failure>( + this, + Invocation.method( + #getFile, + [path], + ), + ), + ) as _i5.Result<_i12.File, _i10.Failure>); + + @override + _i3.Future checkIfFileExistsInApplicationDirectory(String? fileName) => + (super.noSuchMethod( + Invocation.method( + #checkIfFileExistsInApplicationDirectory, + [fileName], + ), + returnValue: _i3.Future.value(false), + ) as _i3.Future); + + @override + _i3.Future<_i5.Result<_i12.FileSystemEntity, _i10.Failure>> + deleteFileInApplicationDirectory(String? fileName) => (super.noSuchMethod( + Invocation.method( + #deleteFileInApplicationDirectory, + [fileName], + ), + returnValue: _i3 + .Future<_i5.Result<_i12.FileSystemEntity, _i10.Failure>>.value( + _FakeResult_3<_i12.FileSystemEntity, _i10.Failure>( + this, + Invocation.method( + #deleteFileInApplicationDirectory, + [fileName], + ), + )), + ) as _i3.Future<_i5.Result<_i12.FileSystemEntity, _i10.Failure>>); +} diff --git a/packages/features/workspace_screen/lib/src/states/canvas_state_data.freezed.dart b/packages/features/workspace_screen/lib/src/states/canvas_state_data.freezed.dart new file mode 100644 index 00000000..63ce1189 --- /dev/null +++ b/packages/features/workspace_screen/lib/src/states/canvas_state_data.freezed.dart @@ -0,0 +1,221 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'canvas_state_data.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + +/// @nodoc +mixin _$CanvasStateData { + ui.Image? get backgroundImage => throw _privateConstructorUsedError; + ui.Image? get cachedImage => throw _privateConstructorUsedError; + ui.Size get size => throw _privateConstructorUsedError; + CommandManager get commandManager => throw _privateConstructorUsedError; + GraphicFactory get graphicFactory => throw _privateConstructorUsedError; + + @JsonKey(ignore: true) + $CanvasStateDataCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $CanvasStateDataCopyWith<$Res> { + factory $CanvasStateDataCopyWith( + CanvasStateData value, $Res Function(CanvasStateData) then) = + _$CanvasStateDataCopyWithImpl<$Res, CanvasStateData>; + @useResult + $Res call( + {ui.Image? backgroundImage, + ui.Image? cachedImage, + ui.Size size, + CommandManager commandManager, + GraphicFactory graphicFactory}); +} + +/// @nodoc +class _$CanvasStateDataCopyWithImpl<$Res, $Val extends CanvasStateData> + implements $CanvasStateDataCopyWith<$Res> { + _$CanvasStateDataCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? backgroundImage = freezed, + Object? cachedImage = freezed, + Object? size = null, + Object? commandManager = null, + Object? graphicFactory = null, + }) { + return _then(_value.copyWith( + backgroundImage: freezed == backgroundImage + ? _value.backgroundImage + : backgroundImage // ignore: cast_nullable_to_non_nullable + as ui.Image?, + cachedImage: freezed == cachedImage + ? _value.cachedImage + : cachedImage // ignore: cast_nullable_to_non_nullable + as ui.Image?, + size: null == size + ? _value.size + : size // ignore: cast_nullable_to_non_nullable + as ui.Size, + commandManager: null == commandManager + ? _value.commandManager + : commandManager // ignore: cast_nullable_to_non_nullable + as CommandManager, + graphicFactory: null == graphicFactory + ? _value.graphicFactory + : graphicFactory // ignore: cast_nullable_to_non_nullable + as GraphicFactory, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_CanvasStateDataCopyWith<$Res> + implements $CanvasStateDataCopyWith<$Res> { + factory _$$_CanvasStateDataCopyWith( + _$_CanvasStateData value, $Res Function(_$_CanvasStateData) then) = + __$$_CanvasStateDataCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {ui.Image? backgroundImage, + ui.Image? cachedImage, + ui.Size size, + CommandManager commandManager, + GraphicFactory graphicFactory}); +} + +/// @nodoc +class __$$_CanvasStateDataCopyWithImpl<$Res> + extends _$CanvasStateDataCopyWithImpl<$Res, _$_CanvasStateData> + implements _$$_CanvasStateDataCopyWith<$Res> { + __$$_CanvasStateDataCopyWithImpl( + _$_CanvasStateData _value, $Res Function(_$_CanvasStateData) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? backgroundImage = freezed, + Object? cachedImage = freezed, + Object? size = null, + Object? commandManager = null, + Object? graphicFactory = null, + }) { + return _then(_$_CanvasStateData( + backgroundImage: freezed == backgroundImage + ? _value.backgroundImage + : backgroundImage // ignore: cast_nullable_to_non_nullable + as ui.Image?, + cachedImage: freezed == cachedImage + ? _value.cachedImage + : cachedImage // ignore: cast_nullable_to_non_nullable + as ui.Image?, + size: null == size + ? _value.size + : size // ignore: cast_nullable_to_non_nullable + as ui.Size, + commandManager: null == commandManager + ? _value.commandManager + : commandManager // ignore: cast_nullable_to_non_nullable + as CommandManager, + graphicFactory: null == graphicFactory + ? _value.graphicFactory + : graphicFactory // ignore: cast_nullable_to_non_nullable + as GraphicFactory, + )); + } +} + +/// @nodoc + +class _$_CanvasStateData implements _CanvasStateData { + const _$_CanvasStateData( + {this.backgroundImage, + this.cachedImage, + required this.size, + required this.commandManager, + required this.graphicFactory}); + + @override + final ui.Image? backgroundImage; + @override + final ui.Image? cachedImage; + @override + final ui.Size size; + @override + final CommandManager commandManager; + @override + final GraphicFactory graphicFactory; + + @override + String toString() { + return 'CanvasStateData(backgroundImage: $backgroundImage, cachedImage: $cachedImage, size: $size, commandManager: $commandManager, graphicFactory: $graphicFactory)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_CanvasStateData && + (identical(other.backgroundImage, backgroundImage) || + other.backgroundImage == backgroundImage) && + (identical(other.cachedImage, cachedImage) || + other.cachedImage == cachedImage) && + (identical(other.size, size) || other.size == size) && + (identical(other.commandManager, commandManager) || + other.commandManager == commandManager) && + (identical(other.graphicFactory, graphicFactory) || + other.graphicFactory == graphicFactory)); + } + + @override + int get hashCode => Object.hash(runtimeType, backgroundImage, cachedImage, + size, commandManager, graphicFactory); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_CanvasStateDataCopyWith<_$_CanvasStateData> get copyWith => + __$$_CanvasStateDataCopyWithImpl<_$_CanvasStateData>(this, _$identity); +} + +abstract class _CanvasStateData implements CanvasStateData { + const factory _CanvasStateData( + {final ui.Image? backgroundImage, + final ui.Image? cachedImage, + required final ui.Size size, + required final CommandManager commandManager, + required final GraphicFactory graphicFactory}) = _$_CanvasStateData; + + @override + ui.Image? get backgroundImage; + @override + ui.Image? get cachedImage; + @override + ui.Size get size; + @override + CommandManager get commandManager; + @override + GraphicFactory get graphicFactory; + @override + @JsonKey(ignore: true) + _$$_CanvasStateDataCopyWith<_$_CanvasStateData> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/packages/features/workspace_screen/lib/src/states/canvas_state_provider.g.dart b/packages/features/workspace_screen/lib/src/states/canvas_state_provider.g.dart new file mode 100644 index 00000000..870eb159 --- /dev/null +++ b/packages/features/workspace_screen/lib/src/states/canvas_state_provider.g.dart @@ -0,0 +1,25 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'canvas_state_provider.dart'; + +// ************************************************************************** +// RiverpodGenerator +// ************************************************************************** + +String _$canvasStateHash() => r'90efe9797953e15366a523a27d015f733d8597db'; + +/// See also [CanvasState]. +@ProviderFor(CanvasState) +final canvasStateProvider = + NotifierProvider.internal( + CanvasState.new, + name: r'canvasStateProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') ? null : _$canvasStateHash, + dependencies: null, + allTransitiveDependencies: null, +); + +typedef _$CanvasState = Notifier; +// ignore_for_file: type=lint +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member diff --git a/packages/features/workspace_screen/test/render_image_for_export_test.mocks.dart b/packages/features/workspace_screen/test/render_image_for_export_test.mocks.dart new file mode 100644 index 00000000..4981b04a --- /dev/null +++ b/packages/features/workspace_screen/test/render_image_for_export_test.mocks.dart @@ -0,0 +1,676 @@ +// Mocks generated by Mockito 5.4.2 from annotations +// in workspace_screen/test/render_image_for_export_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i3; +import 'dart:ui' as _i2; + +import 'package:command/command.dart' as _i4; +import 'package:mockito/mockito.dart' as _i1; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeRect_0 extends _i1.SmartFake implements _i2.Rect { + _FakeRect_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [Canvas]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockCanvas extends _i1.Mock implements _i2.Canvas { + @override + void save() => super.noSuchMethod( + Invocation.method( + #save, + [], + ), + returnValueForMissingStub: null, + ); + + @override + void saveLayer( + _i2.Rect? bounds, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #saveLayer, + [ + bounds, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void restore() => super.noSuchMethod( + Invocation.method( + #restore, + [], + ), + returnValueForMissingStub: null, + ); + + @override + void restoreToCount(int? count) => super.noSuchMethod( + Invocation.method( + #restoreToCount, + [count], + ), + returnValueForMissingStub: null, + ); + + @override + int getSaveCount() => (super.noSuchMethod( + Invocation.method( + #getSaveCount, + [], + ), + returnValue: 0, + ) as int); + + @override + void translate( + double? dx, + double? dy, + ) => + super.noSuchMethod( + Invocation.method( + #translate, + [ + dx, + dy, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void scale( + double? sx, [ + double? sy, + ]) => + super.noSuchMethod( + Invocation.method( + #scale, + [ + sx, + sy, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void rotate(double? radians) => super.noSuchMethod( + Invocation.method( + #rotate, + [radians], + ), + returnValueForMissingStub: null, + ); + + @override + void skew( + double? sx, + double? sy, + ) => + super.noSuchMethod( + Invocation.method( + #skew, + [ + sx, + sy, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void transform(_i3.Float64List? matrix4) => super.noSuchMethod( + Invocation.method( + #transform, + [matrix4], + ), + returnValueForMissingStub: null, + ); + + @override + _i3.Float64List getTransform() => (super.noSuchMethod( + Invocation.method( + #getTransform, + [], + ), + returnValue: _i3.Float64List(0), + ) as _i3.Float64List); + + @override + void clipRect( + _i2.Rect? rect, { + _i2.ClipOp? clipOp = _i2.ClipOp.intersect, + bool? doAntiAlias = true, + }) => + super.noSuchMethod( + Invocation.method( + #clipRect, + [rect], + { + #clipOp: clipOp, + #doAntiAlias: doAntiAlias, + }, + ), + returnValueForMissingStub: null, + ); + + @override + void clipRRect( + _i2.RRect? rrect, { + bool? doAntiAlias = true, + }) => + super.noSuchMethod( + Invocation.method( + #clipRRect, + [rrect], + {#doAntiAlias: doAntiAlias}, + ), + returnValueForMissingStub: null, + ); + + @override + void clipPath( + _i2.Path? path, { + bool? doAntiAlias = true, + }) => + super.noSuchMethod( + Invocation.method( + #clipPath, + [path], + {#doAntiAlias: doAntiAlias}, + ), + returnValueForMissingStub: null, + ); + + @override + _i2.Rect getLocalClipBounds() => (super.noSuchMethod( + Invocation.method( + #getLocalClipBounds, + [], + ), + returnValue: _FakeRect_0( + this, + Invocation.method( + #getLocalClipBounds, + [], + ), + ), + ) as _i2.Rect); + + @override + _i2.Rect getDestinationClipBounds() => (super.noSuchMethod( + Invocation.method( + #getDestinationClipBounds, + [], + ), + returnValue: _FakeRect_0( + this, + Invocation.method( + #getDestinationClipBounds, + [], + ), + ), + ) as _i2.Rect); + + @override + void drawColor( + _i2.Color? color, + _i2.BlendMode? blendMode, + ) => + super.noSuchMethod( + Invocation.method( + #drawColor, + [ + color, + blendMode, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawLine( + _i2.Offset? p1, + _i2.Offset? p2, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawLine, + [ + p1, + p2, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawPaint(_i2.Paint? paint) => super.noSuchMethod( + Invocation.method( + #drawPaint, + [paint], + ), + returnValueForMissingStub: null, + ); + + @override + void drawRect( + _i2.Rect? rect, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawRect, + [ + rect, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawRRect( + _i2.RRect? rrect, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawRRect, + [ + rrect, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawDRRect( + _i2.RRect? outer, + _i2.RRect? inner, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawDRRect, + [ + outer, + inner, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawOval( + _i2.Rect? rect, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawOval, + [ + rect, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawCircle( + _i2.Offset? c, + double? radius, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawCircle, + [ + c, + radius, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawArc( + _i2.Rect? rect, + double? startAngle, + double? sweepAngle, + bool? useCenter, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawArc, + [ + rect, + startAngle, + sweepAngle, + useCenter, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawPath( + _i2.Path? path, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawPath, + [ + path, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawImage( + _i2.Image? image, + _i2.Offset? offset, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawImage, + [ + image, + offset, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawImageRect( + _i2.Image? image, + _i2.Rect? src, + _i2.Rect? dst, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawImageRect, + [ + image, + src, + dst, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawImageNine( + _i2.Image? image, + _i2.Rect? center, + _i2.Rect? dst, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawImageNine, + [ + image, + center, + dst, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawPicture(_i2.Picture? picture) => super.noSuchMethod( + Invocation.method( + #drawPicture, + [picture], + ), + returnValueForMissingStub: null, + ); + + @override + void drawParagraph( + _i2.Paragraph? paragraph, + _i2.Offset? offset, + ) => + super.noSuchMethod( + Invocation.method( + #drawParagraph, + [ + paragraph, + offset, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawPoints( + _i2.PointMode? pointMode, + List<_i2.Offset>? points, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawPoints, + [ + pointMode, + points, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawRawPoints( + _i2.PointMode? pointMode, + _i3.Float32List? points, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawRawPoints, + [ + pointMode, + points, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawVertices( + _i2.Vertices? vertices, + _i2.BlendMode? blendMode, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawVertices, + [ + vertices, + blendMode, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawAtlas( + _i2.Image? atlas, + List<_i2.RSTransform>? transforms, + List<_i2.Rect>? rects, + List<_i2.Color>? colors, + _i2.BlendMode? blendMode, + _i2.Rect? cullRect, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawAtlas, + [ + atlas, + transforms, + rects, + colors, + blendMode, + cullRect, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawRawAtlas( + _i2.Image? atlas, + _i3.Float32List? rstTransforms, + _i3.Float32List? rects, + _i3.Int32List? colors, + _i2.BlendMode? blendMode, + _i2.Rect? cullRect, + _i2.Paint? paint, + ) => + super.noSuchMethod( + Invocation.method( + #drawRawAtlas, + [ + atlas, + rstTransforms, + rects, + colors, + blendMode, + cullRect, + paint, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void drawShadow( + _i2.Path? path, + _i2.Color? color, + double? elevation, + bool? transparentOccluder, + ) => + super.noSuchMethod( + Invocation.method( + #drawShadow, + [ + path, + color, + elevation, + transparentOccluder, + ], + ), + returnValueForMissingStub: null, + ); +} + +/// A class which mocks [CommandManager]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockCommandManager extends _i1.Mock implements _i4.CommandManager { + @override + Iterable<_i4.Command> get history => (super.noSuchMethod( + Invocation.getter(#history), + returnValue: <_i4.Command>[], + ) as Iterable<_i4.Command>); + + @override + int get count => (super.noSuchMethod( + Invocation.getter(#count), + returnValue: 0, + ) as int); + + @override + void addGraphicCommand(_i4.GraphicCommand? command) => super.noSuchMethod( + Invocation.method( + #addGraphicCommand, + [command], + ), + returnValueForMissingStub: null, + ); + + @override + void executeLastCommand(_i2.Canvas? canvas) => super.noSuchMethod( + Invocation.method( + #executeLastCommand, + [canvas], + ), + returnValueForMissingStub: null, + ); + + @override + void executeAllCommands(_i2.Canvas? canvas) => super.noSuchMethod( + Invocation.method( + #executeAllCommands, + [canvas], + ), + returnValueForMissingStub: null, + ); + + @override + void discardLastCommand() => super.noSuchMethod( + Invocation.method( + #discardLastCommand, + [], + ), + returnValueForMissingStub: null, + ); + + @override + void clearHistory({Iterable<_i4.Command>? newCommands}) => super.noSuchMethod( + Invocation.method( + #clearHistory, + [], + {#newCommands: newCommands}, + ), + returnValueForMissingStub: null, + ); +} diff --git a/packages/io_library/lib/src/serialization/proto/output/catrobat_image.pb.dart b/packages/io_library/lib/src/serialization/proto/output/catrobat_image.pb.dart new file mode 100644 index 00000000..b51cbf3a --- /dev/null +++ b/packages/io_library/lib/src/serialization/proto/output/catrobat_image.pb.dart @@ -0,0 +1,134 @@ +// +// Generated code. Do not modify. +// source: catrobat_image.proto +// +// @dart = 2.12 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + +import 'dart:core' as $core; + +import 'package:protobuf/protobuf.dart' as $pb; + +import 'google/protobuf/any.pb.dart' as $2; + +class SerializableCatrobatImage extends $pb.GeneratedMessage { + factory SerializableCatrobatImage({ + $core.String? magicValue, + $core.int? version, + $core.int? width, + $core.int? height, + $core.Iterable<$2.Any>? commands, + $core.List<$core.int>? backgroundImage, + }) { + final $result = create(); + if (magicValue != null) { + $result.magicValue = magicValue; + } + if (version != null) { + $result.version = version; + } + if (width != null) { + $result.width = width; + } + if (height != null) { + $result.height = height; + } + if (commands != null) { + $result.commands.addAll(commands); + } + if (backgroundImage != null) { + $result.backgroundImage = backgroundImage; + } + return $result; + } + SerializableCatrobatImage._() : super(); + factory SerializableCatrobatImage.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory SerializableCatrobatImage.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'SerializableCatrobatImage', createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'magicValue', protoName: 'magicValue') + ..a<$core.int>(2, _omitFieldNames ? '' : 'version', $pb.PbFieldType.O3) + ..a<$core.int>(3, _omitFieldNames ? '' : 'width', $pb.PbFieldType.OU3) + ..a<$core.int>(4, _omitFieldNames ? '' : 'height', $pb.PbFieldType.OU3) + ..pc<$2.Any>(5, _omitFieldNames ? '' : 'commands', $pb.PbFieldType.PM, subBuilder: $2.Any.create) + ..a<$core.List<$core.int>>(6, _omitFieldNames ? '' : 'backgroundImage', $pb.PbFieldType.OY, protoName: 'backgroundImage') + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + SerializableCatrobatImage clone() => SerializableCatrobatImage()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + SerializableCatrobatImage copyWith(void Function(SerializableCatrobatImage) updates) => super.copyWith((message) => updates(message as SerializableCatrobatImage)) as SerializableCatrobatImage; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static SerializableCatrobatImage create() => SerializableCatrobatImage._(); + SerializableCatrobatImage createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static SerializableCatrobatImage getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static SerializableCatrobatImage? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get magicValue => $_getSZ(0); + @$pb.TagNumber(1) + set magicValue($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasMagicValue() => $_has(0); + @$pb.TagNumber(1) + void clearMagicValue() => clearField(1); + + @$pb.TagNumber(2) + $core.int get version => $_getIZ(1); + @$pb.TagNumber(2) + set version($core.int v) { $_setSignedInt32(1, v); } + @$pb.TagNumber(2) + $core.bool hasVersion() => $_has(1); + @$pb.TagNumber(2) + void clearVersion() => clearField(2); + + @$pb.TagNumber(3) + $core.int get width => $_getIZ(2); + @$pb.TagNumber(3) + set width($core.int v) { $_setUnsignedInt32(2, v); } + @$pb.TagNumber(3) + $core.bool hasWidth() => $_has(2); + @$pb.TagNumber(3) + void clearWidth() => clearField(3); + + @$pb.TagNumber(4) + $core.int get height => $_getIZ(3); + @$pb.TagNumber(4) + set height($core.int v) { $_setUnsignedInt32(3, v); } + @$pb.TagNumber(4) + $core.bool hasHeight() => $_has(3); + @$pb.TagNumber(4) + void clearHeight() => clearField(4); + + @$pb.TagNumber(5) + $core.List<$2.Any> get commands => $_getList(4); + + @$pb.TagNumber(6) + $core.List<$core.int> get backgroundImage => $_getN(5); + @$pb.TagNumber(6) + set backgroundImage($core.List<$core.int> v) { $_setBytes(5, v); } + @$pb.TagNumber(6) + $core.bool hasBackgroundImage() => $_has(5); + @$pb.TagNumber(6) + void clearBackgroundImage() => clearField(6); +} + + +const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names'); +const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names'); diff --git a/packages/io_library/lib/src/serialization/proto/output/catrobat_image.pbenum.dart b/packages/io_library/lib/src/serialization/proto/output/catrobat_image.pbenum.dart new file mode 100644 index 00000000..020619fc --- /dev/null +++ b/packages/io_library/lib/src/serialization/proto/output/catrobat_image.pbenum.dart @@ -0,0 +1,11 @@ +// +// Generated code. Do not modify. +// source: catrobat_image.proto +// +// @dart = 2.12 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + diff --git a/packages/io_library/lib/src/serialization/proto/output/catrobat_image.pbjson.dart b/packages/io_library/lib/src/serialization/proto/output/catrobat_image.pbjson.dart new file mode 100644 index 00000000..fe636776 --- /dev/null +++ b/packages/io_library/lib/src/serialization/proto/output/catrobat_image.pbjson.dart @@ -0,0 +1,36 @@ +// +// Generated code. Do not modify. +// source: catrobat_image.proto +// +// @dart = 2.12 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + +import 'dart:convert' as $convert; +import 'dart:core' as $core; +import 'dart:typed_data' as $typed_data; + +@$core.Deprecated('Use serializableCatrobatImageDescriptor instead') +const SerializableCatrobatImage$json = { + '1': 'SerializableCatrobatImage', + '2': [ + {'1': 'magicValue', '3': 1, '4': 1, '5': 9, '10': 'magicValue'}, + {'1': 'version', '3': 2, '4': 1, '5': 5, '10': 'version'}, + {'1': 'width', '3': 3, '4': 1, '5': 13, '10': 'width'}, + {'1': 'height', '3': 4, '4': 1, '5': 13, '10': 'height'}, + {'1': 'commands', '3': 5, '4': 3, '5': 11, '6': '.google.protobuf.Any', '10': 'commands'}, + {'1': 'backgroundImage', '3': 6, '4': 1, '5': 12, '10': 'backgroundImage'}, + ], +}; + +/// Descriptor for `SerializableCatrobatImage`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List serializableCatrobatImageDescriptor = $convert.base64Decode( + 'ChlTZXJpYWxpemFibGVDYXRyb2JhdEltYWdlEh4KCm1hZ2ljVmFsdWUYASABKAlSCm1hZ2ljVm' + 'FsdWUSGAoHdmVyc2lvbhgCIAEoBVIHdmVyc2lvbhIUCgV3aWR0aBgDIAEoDVIFd2lkdGgSFgoG' + 'aGVpZ2h0GAQgASgNUgZoZWlnaHQSMAoIY29tbWFuZHMYBSADKAsyFC5nb29nbGUucHJvdG9idW' + 'YuQW55Ughjb21tYW5kcxIoCg9iYWNrZ3JvdW5kSW1hZ2UYBiABKAxSD2JhY2tncm91bmRJbWFn' + 'ZQ=='); + diff --git a/packages/io_library/lib/src/serialization/proto/output/catrobat_image.pbserver.dart b/packages/io_library/lib/src/serialization/proto/output/catrobat_image.pbserver.dart new file mode 100644 index 00000000..75f5da5c --- /dev/null +++ b/packages/io_library/lib/src/serialization/proto/output/catrobat_image.pbserver.dart @@ -0,0 +1,14 @@ +// +// Generated code. Do not modify. +// source: catrobat_image.proto +// +// @dart = 2.12 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names +// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + +export 'catrobat_image.pb.dart'; + diff --git a/packages/io_library/lib/src/serialization/proto/output/command/graphic/draw_path_command.pb.dart b/packages/io_library/lib/src/serialization/proto/output/command/graphic/draw_path_command.pb.dart new file mode 100644 index 00000000..9cc011d9 --- /dev/null +++ b/packages/io_library/lib/src/serialization/proto/output/command/graphic/draw_path_command.pb.dart @@ -0,0 +1,89 @@ +// +// Generated code. Do not modify. +// source: command/graphic/draw_path_command.proto +// +// @dart = 2.12 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + +import 'dart:core' as $core; + +import 'package:protobuf/protobuf.dart' as $pb; + +import '../../graphic/paint.pb.dart' as $0; +import '../../graphic/path.pb.dart' as $1; + +class SerializableDrawPathCommand extends $pb.GeneratedMessage { + factory SerializableDrawPathCommand({ + $0.SerializablePaint? paint, + $1.SerializablePath? path, + }) { + final $result = create(); + if (paint != null) { + $result.paint = paint; + } + if (path != null) { + $result.path = path; + } + return $result; + } + SerializableDrawPathCommand._() : super(); + factory SerializableDrawPathCommand.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory SerializableDrawPathCommand.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'SerializableDrawPathCommand', createEmptyInstance: create) + ..aOM<$0.SerializablePaint>(1, _omitFieldNames ? '' : 'paint', subBuilder: $0.SerializablePaint.create) + ..aOM<$1.SerializablePath>(2, _omitFieldNames ? '' : 'path', subBuilder: $1.SerializablePath.create) + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + SerializableDrawPathCommand clone() => SerializableDrawPathCommand()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + SerializableDrawPathCommand copyWith(void Function(SerializableDrawPathCommand) updates) => super.copyWith((message) => updates(message as SerializableDrawPathCommand)) as SerializableDrawPathCommand; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static SerializableDrawPathCommand create() => SerializableDrawPathCommand._(); + SerializableDrawPathCommand createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static SerializableDrawPathCommand getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static SerializableDrawPathCommand? _defaultInstance; + + @$pb.TagNumber(1) + $0.SerializablePaint get paint => $_getN(0); + @$pb.TagNumber(1) + set paint($0.SerializablePaint v) { setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasPaint() => $_has(0); + @$pb.TagNumber(1) + void clearPaint() => clearField(1); + @$pb.TagNumber(1) + $0.SerializablePaint ensurePaint() => $_ensure(0); + + @$pb.TagNumber(2) + $1.SerializablePath get path => $_getN(1); + @$pb.TagNumber(2) + set path($1.SerializablePath v) { setField(2, v); } + @$pb.TagNumber(2) + $core.bool hasPath() => $_has(1); + @$pb.TagNumber(2) + void clearPath() => clearField(2); + @$pb.TagNumber(2) + $1.SerializablePath ensurePath() => $_ensure(1); +} + + +const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names'); +const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names'); diff --git a/packages/io_library/lib/src/serialization/proto/output/command/graphic/draw_path_command.pbenum.dart b/packages/io_library/lib/src/serialization/proto/output/command/graphic/draw_path_command.pbenum.dart new file mode 100644 index 00000000..25118e12 --- /dev/null +++ b/packages/io_library/lib/src/serialization/proto/output/command/graphic/draw_path_command.pbenum.dart @@ -0,0 +1,11 @@ +// +// Generated code. Do not modify. +// source: command/graphic/draw_path_command.proto +// +// @dart = 2.12 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + diff --git a/packages/io_library/lib/src/serialization/proto/output/command/graphic/draw_path_command.pbjson.dart b/packages/io_library/lib/src/serialization/proto/output/command/graphic/draw_path_command.pbjson.dart new file mode 100644 index 00000000..0bef27d5 --- /dev/null +++ b/packages/io_library/lib/src/serialization/proto/output/command/graphic/draw_path_command.pbjson.dart @@ -0,0 +1,29 @@ +// +// Generated code. Do not modify. +// source: command/graphic/draw_path_command.proto +// +// @dart = 2.12 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + +import 'dart:convert' as $convert; +import 'dart:core' as $core; +import 'dart:typed_data' as $typed_data; + +@$core.Deprecated('Use serializableDrawPathCommandDescriptor instead') +const SerializableDrawPathCommand$json = { + '1': 'SerializableDrawPathCommand', + '2': [ + {'1': 'paint', '3': 1, '4': 1, '5': 11, '6': '.SerializablePaint', '10': 'paint'}, + {'1': 'path', '3': 2, '4': 1, '5': 11, '6': '.SerializablePath', '10': 'path'}, + ], +}; + +/// Descriptor for `SerializableDrawPathCommand`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List serializableDrawPathCommandDescriptor = $convert.base64Decode( + 'ChtTZXJpYWxpemFibGVEcmF3UGF0aENvbW1hbmQSKAoFcGFpbnQYASABKAsyEi5TZXJpYWxpem' + 'FibGVQYWludFIFcGFpbnQSJQoEcGF0aBgCIAEoCzIRLlNlcmlhbGl6YWJsZVBhdGhSBHBhdGg='); + diff --git a/packages/io_library/lib/src/serialization/proto/output/command/graphic/draw_path_command.pbserver.dart b/packages/io_library/lib/src/serialization/proto/output/command/graphic/draw_path_command.pbserver.dart new file mode 100644 index 00000000..9ee81ce5 --- /dev/null +++ b/packages/io_library/lib/src/serialization/proto/output/command/graphic/draw_path_command.pbserver.dart @@ -0,0 +1,14 @@ +// +// Generated code. Do not modify. +// source: command/graphic/draw_path_command.proto +// +// @dart = 2.12 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names +// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + +export 'draw_path_command.pb.dart'; + diff --git a/packages/io_library/lib/src/serialization/proto/output/google/protobuf/any.pb.dart b/packages/io_library/lib/src/serialization/proto/output/google/protobuf/any.pb.dart new file mode 100644 index 00000000..212e7c74 --- /dev/null +++ b/packages/io_library/lib/src/serialization/proto/output/google/protobuf/any.pb.dart @@ -0,0 +1,208 @@ +// +// Generated code. Do not modify. +// source: google/protobuf/any.proto +// +// @dart = 2.12 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + +import 'dart:core' as $core; + +import 'package:protobuf/protobuf.dart' as $pb; +import 'package:protobuf/src/protobuf/mixins/well_known.dart' as $mixin; + +/// `Any` contains an arbitrary serialized protocol buffer message along with a +/// URL that describes the type of the serialized message. +/// +/// Protobuf library provides support to pack/unpack Any values in the form +/// of utility functions or additional generated methods of the Any type. +/// +/// Example 1: Pack and unpack a message in C++. +/// +/// Foo foo = ...; +/// Any any; +/// any.PackFrom(foo); +/// ... +/// if (any.UnpackTo(&foo)) { +/// ... +/// } +/// +/// Example 2: Pack and unpack a message in Java. +/// +/// Foo foo = ...; +/// Any any = Any.pack(foo); +/// ... +/// if (any.is(Foo.class)) { +/// foo = any.unpack(Foo.class); +/// } +/// // or ... +/// if (any.isSameTypeAs(Foo.getDefaultInstance())) { +/// foo = any.unpack(Foo.getDefaultInstance()); +/// } +/// +/// Example 3: Pack and unpack a message in Python. +/// +/// foo = Foo(...) +/// any = Any() +/// any.Pack(foo) +/// ... +/// if any.Is(Foo.DESCRIPTOR): +/// any.Unpack(foo) +/// ... +/// +/// Example 4: Pack and unpack a message in Go +/// +/// foo := &pb.Foo{...} +/// any, err := anypb.New(foo) +/// if err != nil { +/// ... +/// } +/// ... +/// foo := &pb.Foo{} +/// if err := any.UnmarshalTo(foo); err != nil { +/// ... +/// } +/// +/// The pack methods provided by protobuf library will by default use +/// 'type.googleapis.com/full.type.name' as the type URL and the unpack +/// methods only use the fully qualified type name after the last '/' +/// in the type URL, for example "foo.bar.com/x/y.z" will yield type +/// name "y.z". +/// +/// JSON +/// ==== +/// The JSON representation of an `Any` value uses the regular +/// representation of the deserialized, embedded message, with an +/// additional field `@type` which contains the type URL. Example: +/// +/// package google.profile; +/// message Person { +/// string first_name = 1; +/// string last_name = 2; +/// } +/// +/// { +/// "@type": "type.googleapis.com/google.profile.Person", +/// "firstName": , +/// "lastName": +/// } +/// +/// If the embedded message type is well-known and has a custom JSON +/// representation, that representation will be embedded adding a field +/// `value` which holds the custom JSON in addition to the `@type` +/// field. Example (for message [google.protobuf.Duration][]): +/// +/// { +/// "@type": "type.googleapis.com/google.protobuf.Duration", +/// "value": "1.212s" +/// } +class Any extends $pb.GeneratedMessage with $mixin.AnyMixin { + factory Any({ + $core.String? typeUrl, + $core.List<$core.int>? value, + }) { + final $result = create(); + if (typeUrl != null) { + $result.typeUrl = typeUrl; + } + if (value != null) { + $result.value = value; + } + return $result; + } + Any._() : super(); + factory Any.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Any.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Any', package: const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'), createEmptyInstance: create, toProto3Json: $mixin.AnyMixin.toProto3JsonHelper, fromProto3Json: $mixin.AnyMixin.fromProto3JsonHelper) + ..aOS(1, _omitFieldNames ? '' : 'typeUrl') + ..a<$core.List<$core.int>>(2, _omitFieldNames ? '' : 'value', $pb.PbFieldType.OY) + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Any clone() => Any()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Any copyWith(void Function(Any) updates) => super.copyWith((message) => updates(message as Any)) as Any; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static Any create() => Any._(); + Any createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static Any getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Any? _defaultInstance; + + /// A URL/resource name that uniquely identifies the type of the serialized + /// protocol buffer message. This string must contain at least + /// one "/" character. The last segment of the URL's path must represent + /// the fully qualified name of the type (as in + /// `path/google.protobuf.Duration`). The name should be in a canonical form + /// (e.g., leading "." is not accepted). + /// + /// In practice, teams usually precompile into the binary all types that they + /// expect it to use in the context of Any. However, for URLs which use the + /// scheme `http`, `https`, or no scheme, one can optionally set up a type + /// server that maps type URLs to message definitions as follows: + /// + /// * If no scheme is provided, `https` is assumed. + /// * An HTTP GET on the URL must yield a [google.protobuf.Type][] + /// value in binary format, or produce an error. + /// * Applications are allowed to cache lookup results based on the + /// URL, or have them precompiled into a binary to avoid any + /// lookup. Therefore, binary compatibility needs to be preserved + /// on changes to types. (Use versioned type names to manage + /// breaking changes.) + /// + /// Note: this functionality is not currently available in the official + /// protobuf release, and it is not used for type URLs beginning with + /// type.googleapis.com. As of May 2023, there are no widely used type server + /// implementations and no plans to implement one. + /// + /// Schemes other than `http`, `https` (or the empty scheme) might be + /// used with implementation specific semantics. + @$pb.TagNumber(1) + $core.String get typeUrl => $_getSZ(0); + @$pb.TagNumber(1) + set typeUrl($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasTypeUrl() => $_has(0); + @$pb.TagNumber(1) + void clearTypeUrl() => clearField(1); + + /// Must be a valid serialized protocol buffer of the above specified type. + @$pb.TagNumber(2) + $core.List<$core.int> get value => $_getN(1); + @$pb.TagNumber(2) + set value($core.List<$core.int> v) { $_setBytes(1, v); } + @$pb.TagNumber(2) + $core.bool hasValue() => $_has(1); + @$pb.TagNumber(2) + void clearValue() => clearField(2); + /// Creates a new [Any] encoding [message]. + /// + /// The [typeUrl] will be [typeUrlPrefix]/`fullName` where `fullName` is + /// the fully qualified name of the type of [message]. + static Any pack($pb.GeneratedMessage message, + {$core.String typeUrlPrefix = 'type.googleapis.com'}) { + final result = create(); + $mixin.AnyMixin.packIntoAny(result, message, + typeUrlPrefix: typeUrlPrefix); + return result; + } +} + + +const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names'); +const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names'); diff --git a/packages/io_library/lib/src/serialization/proto/output/google/protobuf/any.pbenum.dart b/packages/io_library/lib/src/serialization/proto/output/google/protobuf/any.pbenum.dart new file mode 100644 index 00000000..effdb475 --- /dev/null +++ b/packages/io_library/lib/src/serialization/proto/output/google/protobuf/any.pbenum.dart @@ -0,0 +1,11 @@ +// +// Generated code. Do not modify. +// source: google/protobuf/any.proto +// +// @dart = 2.12 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + diff --git a/packages/io_library/lib/src/serialization/proto/output/google/protobuf/any.pbjson.dart b/packages/io_library/lib/src/serialization/proto/output/google/protobuf/any.pbjson.dart new file mode 100644 index 00000000..beaeb5fa --- /dev/null +++ b/packages/io_library/lib/src/serialization/proto/output/google/protobuf/any.pbjson.dart @@ -0,0 +1,28 @@ +// +// Generated code. Do not modify. +// source: google/protobuf/any.proto +// +// @dart = 2.12 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + +import 'dart:convert' as $convert; +import 'dart:core' as $core; +import 'dart:typed_data' as $typed_data; + +@$core.Deprecated('Use anyDescriptor instead') +const Any$json = { + '1': 'Any', + '2': [ + {'1': 'type_url', '3': 1, '4': 1, '5': 9, '10': 'typeUrl'}, + {'1': 'value', '3': 2, '4': 1, '5': 12, '10': 'value'}, + ], +}; + +/// Descriptor for `Any`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List anyDescriptor = $convert.base64Decode( + 'CgNBbnkSGQoIdHlwZV91cmwYASABKAlSB3R5cGVVcmwSFAoFdmFsdWUYAiABKAxSBXZhbHVl'); + diff --git a/packages/io_library/lib/src/serialization/proto/output/google/protobuf/any.pbserver.dart b/packages/io_library/lib/src/serialization/proto/output/google/protobuf/any.pbserver.dart new file mode 100644 index 00000000..b332b59d --- /dev/null +++ b/packages/io_library/lib/src/serialization/proto/output/google/protobuf/any.pbserver.dart @@ -0,0 +1,14 @@ +// +// Generated code. Do not modify. +// source: google/protobuf/any.proto +// +// @dart = 2.12 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names +// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + +export 'any.pb.dart'; + diff --git a/packages/io_library/lib/src/serialization/proto/output/graphic/paint.pb.dart b/packages/io_library/lib/src/serialization/proto/output/graphic/paint.pb.dart new file mode 100644 index 00000000..99681da6 --- /dev/null +++ b/packages/io_library/lib/src/serialization/proto/output/graphic/paint.pb.dart @@ -0,0 +1,142 @@ +// +// Generated code. Do not modify. +// source: graphic/paint.proto +// +// @dart = 2.12 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + +import 'dart:core' as $core; + +import 'package:protobuf/protobuf.dart' as $pb; + +import 'paint.pbenum.dart'; + +export 'paint.pbenum.dart'; + +class SerializablePaint extends $pb.GeneratedMessage { + factory SerializablePaint({ + $core.int? color, + $core.double? strokeWidth, + SerializablePaint_StrokeCap? cap, + SerializablePaint_PaintingStyle? style, + SerializablePaint_BlendMode? blendMode, + SerializablePaint_StrokeJoin? strokeJoin, + }) { + final $result = create(); + if (color != null) { + $result.color = color; + } + if (strokeWidth != null) { + $result.strokeWidth = strokeWidth; + } + if (cap != null) { + $result.cap = cap; + } + if (style != null) { + $result.style = style; + } + if (blendMode != null) { + $result.blendMode = blendMode; + } + if (strokeJoin != null) { + $result.strokeJoin = strokeJoin; + } + return $result; + } + SerializablePaint._() : super(); + factory SerializablePaint.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory SerializablePaint.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'SerializablePaint', createEmptyInstance: create) + ..a<$core.int>(1, _omitFieldNames ? '' : 'color', $pb.PbFieldType.OU3) + ..a<$core.double>(2, _omitFieldNames ? '' : 'strokeWidth', $pb.PbFieldType.OF, protoName: 'strokeWidth') + ..e(3, _omitFieldNames ? '' : 'cap', $pb.PbFieldType.OE, defaultOrMaker: SerializablePaint_StrokeCap.STROKE_CAP_ROUND, valueOf: SerializablePaint_StrokeCap.valueOf, enumValues: SerializablePaint_StrokeCap.values) + ..e(4, _omitFieldNames ? '' : 'style', $pb.PbFieldType.OE, defaultOrMaker: SerializablePaint_PaintingStyle.PAINTING_STYLE_FILL, valueOf: SerializablePaint_PaintingStyle.valueOf, enumValues: SerializablePaint_PaintingStyle.values) + ..e(5, _omitFieldNames ? '' : 'blendMode', $pb.PbFieldType.OE, protoName: 'blendMode', defaultOrMaker: SerializablePaint_BlendMode.BLEND_MODE_SCR_OVER, valueOf: SerializablePaint_BlendMode.valueOf, enumValues: SerializablePaint_BlendMode.values) + ..e(6, _omitFieldNames ? '' : 'strokeJoin', $pb.PbFieldType.OE, protoName: 'strokeJoin', defaultOrMaker: SerializablePaint_StrokeJoin.STROKE_JOIN_MITER, valueOf: SerializablePaint_StrokeJoin.valueOf, enumValues: SerializablePaint_StrokeJoin.values) + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + SerializablePaint clone() => SerializablePaint()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + SerializablePaint copyWith(void Function(SerializablePaint) updates) => super.copyWith((message) => updates(message as SerializablePaint)) as SerializablePaint; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static SerializablePaint create() => SerializablePaint._(); + SerializablePaint createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static SerializablePaint getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static SerializablePaint? _defaultInstance; + + @$pb.TagNumber(1) + $core.int get color => $_getIZ(0); + @$pb.TagNumber(1) + set color($core.int v) { $_setUnsignedInt32(0, v); } + @$pb.TagNumber(1) + $core.bool hasColor() => $_has(0); + @$pb.TagNumber(1) + void clearColor() => clearField(1); + + @$pb.TagNumber(2) + $core.double get strokeWidth => $_getN(1); + @$pb.TagNumber(2) + set strokeWidth($core.double v) { $_setFloat(1, v); } + @$pb.TagNumber(2) + $core.bool hasStrokeWidth() => $_has(1); + @$pb.TagNumber(2) + void clearStrokeWidth() => clearField(2); + + @$pb.TagNumber(3) + SerializablePaint_StrokeCap get cap => $_getN(2); + @$pb.TagNumber(3) + set cap(SerializablePaint_StrokeCap v) { setField(3, v); } + @$pb.TagNumber(3) + $core.bool hasCap() => $_has(2); + @$pb.TagNumber(3) + void clearCap() => clearField(3); + + @$pb.TagNumber(4) + SerializablePaint_PaintingStyle get style => $_getN(3); + @$pb.TagNumber(4) + set style(SerializablePaint_PaintingStyle v) { setField(4, v); } + @$pb.TagNumber(4) + $core.bool hasStyle() => $_has(3); + @$pb.TagNumber(4) + void clearStyle() => clearField(4); + + @$pb.TagNumber(5) + SerializablePaint_BlendMode get blendMode => $_getN(4); + @$pb.TagNumber(5) + set blendMode(SerializablePaint_BlendMode v) { setField(5, v); } + @$pb.TagNumber(5) + $core.bool hasBlendMode() => $_has(4); + @$pb.TagNumber(5) + void clearBlendMode() => clearField(5); + + @$pb.TagNumber(6) + SerializablePaint_StrokeJoin get strokeJoin => $_getN(5); + @$pb.TagNumber(6) + set strokeJoin(SerializablePaint_StrokeJoin v) { setField(6, v); } + @$pb.TagNumber(6) + $core.bool hasStrokeJoin() => $_has(5); + @$pb.TagNumber(6) + void clearStrokeJoin() => clearField(6); +} + + +const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names'); +const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names'); diff --git a/packages/io_library/lib/src/serialization/proto/output/graphic/paint.pbenum.dart b/packages/io_library/lib/src/serialization/proto/output/graphic/paint.pbenum.dart new file mode 100644 index 00000000..04db3968 --- /dev/null +++ b/packages/io_library/lib/src/serialization/proto/output/graphic/paint.pbenum.dart @@ -0,0 +1,81 @@ +// +// Generated code. Do not modify. +// source: graphic/paint.proto +// +// @dart = 2.12 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + +import 'dart:core' as $core; + +import 'package:protobuf/protobuf.dart' as $pb; + +class SerializablePaint_StrokeCap extends $pb.ProtobufEnum { + static const SerializablePaint_StrokeCap STROKE_CAP_ROUND = SerializablePaint_StrokeCap._(0, _omitEnumNames ? '' : 'STROKE_CAP_ROUND'); + static const SerializablePaint_StrokeCap STROKE_CAP_BUTT = SerializablePaint_StrokeCap._(1, _omitEnumNames ? '' : 'STROKE_CAP_BUTT'); + static const SerializablePaint_StrokeCap STROKE_CAP_SQUARE = SerializablePaint_StrokeCap._(2, _omitEnumNames ? '' : 'STROKE_CAP_SQUARE'); + + static const $core.List values = [ + STROKE_CAP_ROUND, + STROKE_CAP_BUTT, + STROKE_CAP_SQUARE, + ]; + + static final $core.Map<$core.int, SerializablePaint_StrokeCap> _byValue = $pb.ProtobufEnum.initByValue(values); + static SerializablePaint_StrokeCap? valueOf($core.int value) => _byValue[value]; + + const SerializablePaint_StrokeCap._($core.int v, $core.String n) : super(v, n); +} + +class SerializablePaint_PaintingStyle extends $pb.ProtobufEnum { + static const SerializablePaint_PaintingStyle PAINTING_STYLE_FILL = SerializablePaint_PaintingStyle._(0, _omitEnumNames ? '' : 'PAINTING_STYLE_FILL'); + static const SerializablePaint_PaintingStyle PAINTING_STYLE_STROKE = SerializablePaint_PaintingStyle._(1, _omitEnumNames ? '' : 'PAINTING_STYLE_STROKE'); + + static const $core.List values = [ + PAINTING_STYLE_FILL, + PAINTING_STYLE_STROKE, + ]; + + static final $core.Map<$core.int, SerializablePaint_PaintingStyle> _byValue = $pb.ProtobufEnum.initByValue(values); + static SerializablePaint_PaintingStyle? valueOf($core.int value) => _byValue[value]; + + const SerializablePaint_PaintingStyle._($core.int v, $core.String n) : super(v, n); +} + +class SerializablePaint_BlendMode extends $pb.ProtobufEnum { + static const SerializablePaint_BlendMode BLEND_MODE_SCR_OVER = SerializablePaint_BlendMode._(0, _omitEnumNames ? '' : 'BLEND_MODE_SCR_OVER'); + static const SerializablePaint_BlendMode BLEND_MODE_CLEAR = SerializablePaint_BlendMode._(1, _omitEnumNames ? '' : 'BLEND_MODE_CLEAR'); + + static const $core.List values = [ + BLEND_MODE_SCR_OVER, + BLEND_MODE_CLEAR, + ]; + + static final $core.Map<$core.int, SerializablePaint_BlendMode> _byValue = $pb.ProtobufEnum.initByValue(values); + static SerializablePaint_BlendMode? valueOf($core.int value) => _byValue[value]; + + const SerializablePaint_BlendMode._($core.int v, $core.String n) : super(v, n); +} + +class SerializablePaint_StrokeJoin extends $pb.ProtobufEnum { + static const SerializablePaint_StrokeJoin STROKE_JOIN_MITER = SerializablePaint_StrokeJoin._(0, _omitEnumNames ? '' : 'STROKE_JOIN_MITER'); + static const SerializablePaint_StrokeJoin STROKE_JOIN_ROUND = SerializablePaint_StrokeJoin._(1, _omitEnumNames ? '' : 'STROKE_JOIN_ROUND'); + static const SerializablePaint_StrokeJoin STROKE_JOIN_BEVEL = SerializablePaint_StrokeJoin._(2, _omitEnumNames ? '' : 'STROKE_JOIN_BEVEL'); + + static const $core.List values = [ + STROKE_JOIN_MITER, + STROKE_JOIN_ROUND, + STROKE_JOIN_BEVEL, + ]; + + static final $core.Map<$core.int, SerializablePaint_StrokeJoin> _byValue = $pb.ProtobufEnum.initByValue(values); + static SerializablePaint_StrokeJoin? valueOf($core.int value) => _byValue[value]; + + const SerializablePaint_StrokeJoin._($core.int v, $core.String n) : super(v, n); +} + + +const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names'); diff --git a/packages/io_library/lib/src/serialization/proto/output/graphic/paint.pbjson.dart b/packages/io_library/lib/src/serialization/proto/output/graphic/paint.pbjson.dart new file mode 100644 index 00000000..ea6cdca5 --- /dev/null +++ b/packages/io_library/lib/src/serialization/proto/output/graphic/paint.pbjson.dart @@ -0,0 +1,81 @@ +// +// Generated code. Do not modify. +// source: graphic/paint.proto +// +// @dart = 2.12 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + +import 'dart:convert' as $convert; +import 'dart:core' as $core; +import 'dart:typed_data' as $typed_data; + +@$core.Deprecated('Use serializablePaintDescriptor instead') +const SerializablePaint$json = { + '1': 'SerializablePaint', + '2': [ + {'1': 'color', '3': 1, '4': 1, '5': 13, '10': 'color'}, + {'1': 'strokeWidth', '3': 2, '4': 1, '5': 2, '10': 'strokeWidth'}, + {'1': 'cap', '3': 3, '4': 1, '5': 14, '6': '.SerializablePaint.StrokeCap', '10': 'cap'}, + {'1': 'style', '3': 4, '4': 1, '5': 14, '6': '.SerializablePaint.PaintingStyle', '10': 'style'}, + {'1': 'blendMode', '3': 5, '4': 1, '5': 14, '6': '.SerializablePaint.BlendMode', '10': 'blendMode'}, + {'1': 'strokeJoin', '3': 6, '4': 1, '5': 14, '6': '.SerializablePaint.StrokeJoin', '10': 'strokeJoin'}, + ], + '4': [SerializablePaint_StrokeCap$json, SerializablePaint_PaintingStyle$json, SerializablePaint_BlendMode$json, SerializablePaint_StrokeJoin$json], +}; + +@$core.Deprecated('Use serializablePaintDescriptor instead') +const SerializablePaint_StrokeCap$json = { + '1': 'StrokeCap', + '2': [ + {'1': 'STROKE_CAP_ROUND', '2': 0}, + {'1': 'STROKE_CAP_BUTT', '2': 1}, + {'1': 'STROKE_CAP_SQUARE', '2': 2}, + ], +}; + +@$core.Deprecated('Use serializablePaintDescriptor instead') +const SerializablePaint_PaintingStyle$json = { + '1': 'PaintingStyle', + '2': [ + {'1': 'PAINTING_STYLE_FILL', '2': 0}, + {'1': 'PAINTING_STYLE_STROKE', '2': 1}, + ], +}; + +@$core.Deprecated('Use serializablePaintDescriptor instead') +const SerializablePaint_BlendMode$json = { + '1': 'BlendMode', + '2': [ + {'1': 'BLEND_MODE_SCR_OVER', '2': 0}, + {'1': 'BLEND_MODE_CLEAR', '2': 1}, + ], +}; + +@$core.Deprecated('Use serializablePaintDescriptor instead') +const SerializablePaint_StrokeJoin$json = { + '1': 'StrokeJoin', + '2': [ + {'1': 'STROKE_JOIN_MITER', '2': 0}, + {'1': 'STROKE_JOIN_ROUND', '2': 1}, + {'1': 'STROKE_JOIN_BEVEL', '2': 2}, + ], +}; + +/// Descriptor for `SerializablePaint`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List serializablePaintDescriptor = $convert.base64Decode( + 'ChFTZXJpYWxpemFibGVQYWludBIUCgVjb2xvchgBIAEoDVIFY29sb3ISIAoLc3Ryb2tlV2lkdG' + 'gYAiABKAJSC3N0cm9rZVdpZHRoEi4KA2NhcBgDIAEoDjIcLlNlcmlhbGl6YWJsZVBhaW50LlN0' + 'cm9rZUNhcFIDY2FwEjYKBXN0eWxlGAQgASgOMiAuU2VyaWFsaXphYmxlUGFpbnQuUGFpbnRpbm' + 'dTdHlsZVIFc3R5bGUSOgoJYmxlbmRNb2RlGAUgASgOMhwuU2VyaWFsaXphYmxlUGFpbnQuQmxl' + 'bmRNb2RlUglibGVuZE1vZGUSPQoKc3Ryb2tlSm9pbhgGIAEoDjIdLlNlcmlhbGl6YWJsZVBhaW' + '50LlN0cm9rZUpvaW5SCnN0cm9rZUpvaW4iTQoJU3Ryb2tlQ2FwEhQKEFNUUk9LRV9DQVBfUk9V' + 'TkQQABITCg9TVFJPS0VfQ0FQX0JVVFQQARIVChFTVFJPS0VfQ0FQX1NRVUFSRRACIkMKDVBhaW' + '50aW5nU3R5bGUSFwoTUEFJTlRJTkdfU1RZTEVfRklMTBAAEhkKFVBBSU5USU5HX1NUWUxFX1NU' + 'Uk9LRRABIjoKCUJsZW5kTW9kZRIXChNCTEVORF9NT0RFX1NDUl9PVkVSEAASFAoQQkxFTkRfTU' + '9ERV9DTEVBUhABIlEKClN0cm9rZUpvaW4SFQoRU1RST0tFX0pPSU5fTUlURVIQABIVChFTVFJP' + 'S0VfSk9JTl9ST1VORBABEhUKEVNUUk9LRV9KT0lOX0JFVkVMEAI='); + diff --git a/packages/io_library/lib/src/serialization/proto/output/graphic/paint.pbserver.dart b/packages/io_library/lib/src/serialization/proto/output/graphic/paint.pbserver.dart new file mode 100644 index 00000000..7a27594e --- /dev/null +++ b/packages/io_library/lib/src/serialization/proto/output/graphic/paint.pbserver.dart @@ -0,0 +1,14 @@ +// +// Generated code. Do not modify. +// source: graphic/paint.proto +// +// @dart = 2.12 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names +// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + +export 'paint.pb.dart'; + diff --git a/packages/io_library/lib/src/serialization/proto/output/graphic/path.pb.dart b/packages/io_library/lib/src/serialization/proto/output/graphic/path.pb.dart new file mode 100644 index 00000000..838e0fd6 --- /dev/null +++ b/packages/io_library/lib/src/serialization/proto/output/graphic/path.pb.dart @@ -0,0 +1,341 @@ +// +// Generated code. Do not modify. +// source: graphic/path.proto +// +// @dart = 2.12 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + +import 'dart:core' as $core; + +import 'package:protobuf/protobuf.dart' as $pb; + +import 'path.pbenum.dart'; + +export 'path.pbenum.dart'; + +class SerializablePath_Action_MoveTo extends $pb.GeneratedMessage { + factory SerializablePath_Action_MoveTo({ + $core.double? x, + $core.double? y, + }) { + final $result = create(); + if (x != null) { + $result.x = x; + } + if (y != null) { + $result.y = y; + } + return $result; + } + SerializablePath_Action_MoveTo._() : super(); + factory SerializablePath_Action_MoveTo.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory SerializablePath_Action_MoveTo.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'SerializablePath.Action.MoveTo', createEmptyInstance: create) + ..a<$core.double>(1, _omitFieldNames ? '' : 'x', $pb.PbFieldType.OD) + ..a<$core.double>(2, _omitFieldNames ? '' : 'y', $pb.PbFieldType.OD) + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + SerializablePath_Action_MoveTo clone() => SerializablePath_Action_MoveTo()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + SerializablePath_Action_MoveTo copyWith(void Function(SerializablePath_Action_MoveTo) updates) => super.copyWith((message) => updates(message as SerializablePath_Action_MoveTo)) as SerializablePath_Action_MoveTo; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static SerializablePath_Action_MoveTo create() => SerializablePath_Action_MoveTo._(); + SerializablePath_Action_MoveTo createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static SerializablePath_Action_MoveTo getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static SerializablePath_Action_MoveTo? _defaultInstance; + + @$pb.TagNumber(1) + $core.double get x => $_getN(0); + @$pb.TagNumber(1) + set x($core.double v) { $_setDouble(0, v); } + @$pb.TagNumber(1) + $core.bool hasX() => $_has(0); + @$pb.TagNumber(1) + void clearX() => clearField(1); + + @$pb.TagNumber(2) + $core.double get y => $_getN(1); + @$pb.TagNumber(2) + set y($core.double v) { $_setDouble(1, v); } + @$pb.TagNumber(2) + $core.bool hasY() => $_has(1); + @$pb.TagNumber(2) + void clearY() => clearField(2); +} + +class SerializablePath_Action_LineTo extends $pb.GeneratedMessage { + factory SerializablePath_Action_LineTo({ + $core.double? x, + $core.double? y, + }) { + final $result = create(); + if (x != null) { + $result.x = x; + } + if (y != null) { + $result.y = y; + } + return $result; + } + SerializablePath_Action_LineTo._() : super(); + factory SerializablePath_Action_LineTo.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory SerializablePath_Action_LineTo.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'SerializablePath.Action.LineTo', createEmptyInstance: create) + ..a<$core.double>(1, _omitFieldNames ? '' : 'x', $pb.PbFieldType.OD) + ..a<$core.double>(2, _omitFieldNames ? '' : 'y', $pb.PbFieldType.OD) + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + SerializablePath_Action_LineTo clone() => SerializablePath_Action_LineTo()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + SerializablePath_Action_LineTo copyWith(void Function(SerializablePath_Action_LineTo) updates) => super.copyWith((message) => updates(message as SerializablePath_Action_LineTo)) as SerializablePath_Action_LineTo; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static SerializablePath_Action_LineTo create() => SerializablePath_Action_LineTo._(); + SerializablePath_Action_LineTo createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static SerializablePath_Action_LineTo getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static SerializablePath_Action_LineTo? _defaultInstance; + + @$pb.TagNumber(1) + $core.double get x => $_getN(0); + @$pb.TagNumber(1) + set x($core.double v) { $_setDouble(0, v); } + @$pb.TagNumber(1) + $core.bool hasX() => $_has(0); + @$pb.TagNumber(1) + void clearX() => clearField(1); + + @$pb.TagNumber(2) + $core.double get y => $_getN(1); + @$pb.TagNumber(2) + set y($core.double v) { $_setDouble(1, v); } + @$pb.TagNumber(2) + $core.bool hasY() => $_has(1); + @$pb.TagNumber(2) + void clearY() => clearField(2); +} + +class SerializablePath_Action_Close extends $pb.GeneratedMessage { + factory SerializablePath_Action_Close() => create(); + SerializablePath_Action_Close._() : super(); + factory SerializablePath_Action_Close.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory SerializablePath_Action_Close.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'SerializablePath.Action.Close', createEmptyInstance: create) + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + SerializablePath_Action_Close clone() => SerializablePath_Action_Close()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + SerializablePath_Action_Close copyWith(void Function(SerializablePath_Action_Close) updates) => super.copyWith((message) => updates(message as SerializablePath_Action_Close)) as SerializablePath_Action_Close; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static SerializablePath_Action_Close create() => SerializablePath_Action_Close._(); + SerializablePath_Action_Close createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static SerializablePath_Action_Close getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static SerializablePath_Action_Close? _defaultInstance; +} + +enum SerializablePath_Action_Action { + moveTo, + lineTo, + close, + notSet +} + +class SerializablePath_Action extends $pb.GeneratedMessage { + factory SerializablePath_Action({ + SerializablePath_Action_MoveTo? moveTo, + SerializablePath_Action_LineTo? lineTo, + SerializablePath_Action_Close? close, + }) { + final $result = create(); + if (moveTo != null) { + $result.moveTo = moveTo; + } + if (lineTo != null) { + $result.lineTo = lineTo; + } + if (close != null) { + $result.close = close; + } + return $result; + } + SerializablePath_Action._() : super(); + factory SerializablePath_Action.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory SerializablePath_Action.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static const $core.Map<$core.int, SerializablePath_Action_Action> _SerializablePath_Action_ActionByTag = { + 1 : SerializablePath_Action_Action.moveTo, + 2 : SerializablePath_Action_Action.lineTo, + 3 : SerializablePath_Action_Action.close, + 0 : SerializablePath_Action_Action.notSet + }; + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'SerializablePath.Action', createEmptyInstance: create) + ..oo(0, [1, 2, 3]) + ..aOM(1, _omitFieldNames ? '' : 'moveTo', subBuilder: SerializablePath_Action_MoveTo.create) + ..aOM(2, _omitFieldNames ? '' : 'lineTo', subBuilder: SerializablePath_Action_LineTo.create) + ..aOM(3, _omitFieldNames ? '' : 'close', subBuilder: SerializablePath_Action_Close.create) + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + SerializablePath_Action clone() => SerializablePath_Action()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + SerializablePath_Action copyWith(void Function(SerializablePath_Action) updates) => super.copyWith((message) => updates(message as SerializablePath_Action)) as SerializablePath_Action; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static SerializablePath_Action create() => SerializablePath_Action._(); + SerializablePath_Action createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static SerializablePath_Action getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static SerializablePath_Action? _defaultInstance; + + SerializablePath_Action_Action whichAction() => _SerializablePath_Action_ActionByTag[$_whichOneof(0)]!; + void clearAction() => clearField($_whichOneof(0)); + + @$pb.TagNumber(1) + SerializablePath_Action_MoveTo get moveTo => $_getN(0); + @$pb.TagNumber(1) + set moveTo(SerializablePath_Action_MoveTo v) { setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasMoveTo() => $_has(0); + @$pb.TagNumber(1) + void clearMoveTo() => clearField(1); + @$pb.TagNumber(1) + SerializablePath_Action_MoveTo ensureMoveTo() => $_ensure(0); + + @$pb.TagNumber(2) + SerializablePath_Action_LineTo get lineTo => $_getN(1); + @$pb.TagNumber(2) + set lineTo(SerializablePath_Action_LineTo v) { setField(2, v); } + @$pb.TagNumber(2) + $core.bool hasLineTo() => $_has(1); + @$pb.TagNumber(2) + void clearLineTo() => clearField(2); + @$pb.TagNumber(2) + SerializablePath_Action_LineTo ensureLineTo() => $_ensure(1); + + @$pb.TagNumber(3) + SerializablePath_Action_Close get close => $_getN(2); + @$pb.TagNumber(3) + set close(SerializablePath_Action_Close v) { setField(3, v); } + @$pb.TagNumber(3) + $core.bool hasClose() => $_has(2); + @$pb.TagNumber(3) + void clearClose() => clearField(3); + @$pb.TagNumber(3) + SerializablePath_Action_Close ensureClose() => $_ensure(2); +} + +class SerializablePath extends $pb.GeneratedMessage { + factory SerializablePath({ + $core.Iterable? actions, + SerializablePath_FillType? fillType, + }) { + final $result = create(); + if (actions != null) { + $result.actions.addAll(actions); + } + if (fillType != null) { + $result.fillType = fillType; + } + return $result; + } + SerializablePath._() : super(); + factory SerializablePath.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory SerializablePath.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'SerializablePath', createEmptyInstance: create) + ..pc(1, _omitFieldNames ? '' : 'actions', $pb.PbFieldType.PM, subBuilder: SerializablePath_Action.create) + ..e(2, _omitFieldNames ? '' : 'fillType', $pb.PbFieldType.OE, defaultOrMaker: SerializablePath_FillType.NON_ZERO, valueOf: SerializablePath_FillType.valueOf, enumValues: SerializablePath_FillType.values) + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + SerializablePath clone() => SerializablePath()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + SerializablePath copyWith(void Function(SerializablePath) updates) => super.copyWith((message) => updates(message as SerializablePath)) as SerializablePath; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static SerializablePath create() => SerializablePath._(); + SerializablePath createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static SerializablePath getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static SerializablePath? _defaultInstance; + + @$pb.TagNumber(1) + $core.List get actions => $_getList(0); + + @$pb.TagNumber(2) + SerializablePath_FillType get fillType => $_getN(1); + @$pb.TagNumber(2) + set fillType(SerializablePath_FillType v) { setField(2, v); } + @$pb.TagNumber(2) + $core.bool hasFillType() => $_has(1); + @$pb.TagNumber(2) + void clearFillType() => clearField(2); +} + + +const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names'); +const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names'); diff --git a/packages/io_library/lib/src/serialization/proto/output/graphic/path.pbenum.dart b/packages/io_library/lib/src/serialization/proto/output/graphic/path.pbenum.dart new file mode 100644 index 00000000..9e428ed9 --- /dev/null +++ b/packages/io_library/lib/src/serialization/proto/output/graphic/path.pbenum.dart @@ -0,0 +1,32 @@ +// +// Generated code. Do not modify. +// source: graphic/path.proto +// +// @dart = 2.12 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + +import 'dart:core' as $core; + +import 'package:protobuf/protobuf.dart' as $pb; + +class SerializablePath_FillType extends $pb.ProtobufEnum { + static const SerializablePath_FillType NON_ZERO = SerializablePath_FillType._(0, _omitEnumNames ? '' : 'NON_ZERO'); + static const SerializablePath_FillType EVEN_ODD = SerializablePath_FillType._(1, _omitEnumNames ? '' : 'EVEN_ODD'); + + static const $core.List values = [ + NON_ZERO, + EVEN_ODD, + ]; + + static final $core.Map<$core.int, SerializablePath_FillType> _byValue = $pb.ProtobufEnum.initByValue(values); + static SerializablePath_FillType? valueOf($core.int value) => _byValue[value]; + + const SerializablePath_FillType._($core.int v, $core.String n) : super(v, n); +} + + +const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names'); diff --git a/packages/io_library/lib/src/serialization/proto/output/graphic/path.pbjson.dart b/packages/io_library/lib/src/serialization/proto/output/graphic/path.pbjson.dart new file mode 100644 index 00000000..65d26144 --- /dev/null +++ b/packages/io_library/lib/src/serialization/proto/output/graphic/path.pbjson.dart @@ -0,0 +1,84 @@ +// +// Generated code. Do not modify. +// source: graphic/path.proto +// +// @dart = 2.12 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + +import 'dart:convert' as $convert; +import 'dart:core' as $core; +import 'dart:typed_data' as $typed_data; + +@$core.Deprecated('Use serializablePathDescriptor instead') +const SerializablePath$json = { + '1': 'SerializablePath', + '2': [ + {'1': 'actions', '3': 1, '4': 3, '5': 11, '6': '.SerializablePath.Action', '10': 'actions'}, + {'1': 'fill_type', '3': 2, '4': 1, '5': 14, '6': '.SerializablePath.FillType', '10': 'fillType'}, + ], + '3': [SerializablePath_Action$json], + '4': [SerializablePath_FillType$json], +}; + +@$core.Deprecated('Use serializablePathDescriptor instead') +const SerializablePath_Action$json = { + '1': 'Action', + '2': [ + {'1': 'move_to', '3': 1, '4': 1, '5': 11, '6': '.SerializablePath.Action.MoveTo', '9': 0, '10': 'moveTo'}, + {'1': 'line_to', '3': 2, '4': 1, '5': 11, '6': '.SerializablePath.Action.LineTo', '9': 0, '10': 'lineTo'}, + {'1': 'close', '3': 3, '4': 1, '5': 11, '6': '.SerializablePath.Action.Close', '9': 0, '10': 'close'}, + ], + '3': [SerializablePath_Action_MoveTo$json, SerializablePath_Action_LineTo$json, SerializablePath_Action_Close$json], + '8': [ + {'1': 'action'}, + ], +}; + +@$core.Deprecated('Use serializablePathDescriptor instead') +const SerializablePath_Action_MoveTo$json = { + '1': 'MoveTo', + '2': [ + {'1': 'x', '3': 1, '4': 1, '5': 1, '10': 'x'}, + {'1': 'y', '3': 2, '4': 1, '5': 1, '10': 'y'}, + ], +}; + +@$core.Deprecated('Use serializablePathDescriptor instead') +const SerializablePath_Action_LineTo$json = { + '1': 'LineTo', + '2': [ + {'1': 'x', '3': 1, '4': 1, '5': 1, '10': 'x'}, + {'1': 'y', '3': 2, '4': 1, '5': 1, '10': 'y'}, + ], +}; + +@$core.Deprecated('Use serializablePathDescriptor instead') +const SerializablePath_Action_Close$json = { + '1': 'Close', +}; + +@$core.Deprecated('Use serializablePathDescriptor instead') +const SerializablePath_FillType$json = { + '1': 'FillType', + '2': [ + {'1': 'NON_ZERO', '2': 0}, + {'1': 'EVEN_ODD', '2': 1}, + ], +}; + +/// Descriptor for `SerializablePath`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List serializablePathDescriptor = $convert.base64Decode( + 'ChBTZXJpYWxpemFibGVQYXRoEjIKB2FjdGlvbnMYASADKAsyGC5TZXJpYWxpemFibGVQYXRoLk' + 'FjdGlvblIHYWN0aW9ucxI3CglmaWxsX3R5cGUYAiABKA4yGi5TZXJpYWxpemFibGVQYXRoLkZp' + 'bGxUeXBlUghmaWxsVHlwZRqXAgoGQWN0aW9uEjoKB21vdmVfdG8YASABKAsyHy5TZXJpYWxpem' + 'FibGVQYXRoLkFjdGlvbi5Nb3ZlVG9IAFIGbW92ZVRvEjoKB2xpbmVfdG8YAiABKAsyHy5TZXJp' + 'YWxpemFibGVQYXRoLkFjdGlvbi5MaW5lVG9IAFIGbGluZVRvEjYKBWNsb3NlGAMgASgLMh4uU2' + 'VyaWFsaXphYmxlUGF0aC5BY3Rpb24uQ2xvc2VIAFIFY2xvc2UaJAoGTW92ZVRvEgwKAXgYASAB' + 'KAFSAXgSDAoBeRgCIAEoAVIBeRokCgZMaW5lVG8SDAoBeBgBIAEoAVIBeBIMCgF5GAIgASgBUg' + 'F5GgcKBUNsb3NlQggKBmFjdGlvbiImCghGaWxsVHlwZRIMCghOT05fWkVSTxAAEgwKCEVWRU5f' + 'T0REEAE='); + diff --git a/packages/io_library/lib/src/serialization/proto/output/graphic/path.pbserver.dart b/packages/io_library/lib/src/serialization/proto/output/graphic/path.pbserver.dart new file mode 100644 index 00000000..0683a289 --- /dev/null +++ b/packages/io_library/lib/src/serialization/proto/output/graphic/path.pbserver.dart @@ -0,0 +1,14 @@ +// +// Generated code. Do not modify. +// source: graphic/path.proto +// +// @dart = 2.12 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names +// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + +export 'path.pb.dart'; + diff --git a/packages/io_library/test/load_image_from_photo_library_test.mocks.dart b/packages/io_library/test/load_image_from_photo_library_test.mocks.dart new file mode 100644 index 00000000..d12b6955 --- /dev/null +++ b/packages/io_library/test/load_image_from_photo_library_test.mocks.dart @@ -0,0 +1,212 @@ +// Mocks generated by Mockito 5.4.2 from annotations +// in io_library/test/load_image_from_photo_library_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i4; +import 'dart:typed_data' as _i7; +import 'dart:ui' as _i5; + +import 'package:component_library/component_library.dart' as _i6; +import 'package:io_library/io_library.dart' as _i3; +import 'package:mockito/mockito.dart' as _i1; +import 'package:oxidized/oxidized.dart' as _i2; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeResult_0 extends _i1.SmartFake + implements _i2.Result { + _FakeResult_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [IImageService]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockIImageService extends _i1.Mock implements _i3.IImageService { + MockIImageService() { + _i1.throwOnMissingStub(this); + } + + @override + _i4.Future<_i2.Result<_i5.Image, _i6.Failure>> import( + _i7.Uint8List? fileData) => + (super.noSuchMethod( + Invocation.method( + #import, + [fileData], + ), + returnValue: _i4.Future<_i2.Result<_i5.Image, _i6.Failure>>.value( + _FakeResult_0<_i5.Image, _i6.Failure>( + this, + Invocation.method( + #import, + [fileData], + ), + )), + ) as _i4.Future<_i2.Result<_i5.Image, _i6.Failure>>); + + @override + _i4.Future<_i2.Result<_i7.Uint8List, _i6.Failure>> exportAsJpg( + _i5.Image? image, + int? quality, + ) => + (super.noSuchMethod( + Invocation.method( + #exportAsJpg, + [ + image, + quality, + ], + ), + returnValue: _i4.Future<_i2.Result<_i7.Uint8List, _i6.Failure>>.value( + _FakeResult_0<_i7.Uint8List, _i6.Failure>( + this, + Invocation.method( + #exportAsJpg, + [ + image, + quality, + ], + ), + )), + ) as _i4.Future<_i2.Result<_i7.Uint8List, _i6.Failure>>); + + @override + _i4.Future<_i2.Result<_i7.Uint8List, _i6.Failure>> exportAsPng( + _i5.Image? image) => + (super.noSuchMethod( + Invocation.method( + #exportAsPng, + [image], + ), + returnValue: _i4.Future<_i2.Result<_i7.Uint8List, _i6.Failure>>.value( + _FakeResult_0<_i7.Uint8List, _i6.Failure>( + this, + Invocation.method( + #exportAsPng, + [image], + ), + )), + ) as _i4.Future<_i2.Result<_i7.Uint8List, _i6.Failure>>); + + @override + _i2.Result<_i7.Uint8List, _i6.Failure> getProjectPreview(String? path) => + (super.noSuchMethod( + Invocation.method( + #getProjectPreview, + [path], + ), + returnValue: _FakeResult_0<_i7.Uint8List, _i6.Failure>( + this, + Invocation.method( + #getProjectPreview, + [path], + ), + ), + ) as _i2.Result<_i7.Uint8List, _i6.Failure>); +} + +/// A class which mocks [IPermissionService]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockIPermissionService extends _i1.Mock + implements _i3.IPermissionService { + MockIPermissionService() { + _i1.throwOnMissingStub(this); + } + + @override + _i4.Future requestAccessToPickPhotos() => (super.noSuchMethod( + Invocation.method( + #requestAccessToPickPhotos, + [], + ), + returnValue: _i4.Future.value(false), + ) as _i4.Future); + + @override + _i4.Future requestAccessForSavingToPhotos() => (super.noSuchMethod( + Invocation.method( + #requestAccessForSavingToPhotos, + [], + ), + returnValue: _i4.Future.value(false), + ) as _i4.Future); + + @override + _i4.Future requestAccessToSharedFileStorage() => (super.noSuchMethod( + Invocation.method( + #requestAccessToSharedFileStorage, + [], + ), + returnValue: _i4.Future.value(false), + ) as _i4.Future); +} + +/// A class which mocks [IPhotoLibraryService]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockIPhotoLibraryService extends _i1.Mock + implements _i3.IPhotoLibraryService { + MockIPhotoLibraryService() { + _i1.throwOnMissingStub(this); + } + + @override + _i4.Future<_i2.Result<_i2.Unit, _i6.Failure>> save( + String? filename, + _i7.Uint8List? data, + ) => + (super.noSuchMethod( + Invocation.method( + #save, + [ + filename, + data, + ], + ), + returnValue: _i4.Future<_i2.Result<_i2.Unit, _i6.Failure>>.value( + _FakeResult_0<_i2.Unit, _i6.Failure>( + this, + Invocation.method( + #save, + [ + filename, + data, + ], + ), + )), + ) as _i4.Future<_i2.Result<_i2.Unit, _i6.Failure>>); + + @override + _i4.Future<_i2.Result<_i7.Uint8List, _i6.Failure>> pick() => + (super.noSuchMethod( + Invocation.method( + #pick, + [], + ), + returnValue: _i4.Future<_i2.Result<_i7.Uint8List, _i6.Failure>>.value( + _FakeResult_0<_i7.Uint8List, _i6.Failure>( + this, + Invocation.method( + #pick, + [], + ), + )), + ) as _i4.Future<_i2.Result<_i7.Uint8List, _i6.Failure>>); +} diff --git a/packages/io_library/test/photo_library_service_test.mocks.dart b/packages/io_library/test/photo_library_service_test.mocks.dart new file mode 100644 index 00000000..2875d637 --- /dev/null +++ b/packages/io_library/test/photo_library_service_test.mocks.dart @@ -0,0 +1,480 @@ +// Mocks generated by Mockito 5.4.2 from annotations +// in io_library/test/photo_library_service_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i6; +import 'dart:convert' as _i8; +import 'dart:typed_data' as _i9; + +import 'package:flutter/src/services/binary_messenger.dart' as _i4; +import 'package:flutter/src/services/message_codec.dart' as _i3; +import 'package:flutter/src/services/platform_channel.dart' as _i7; +import 'package:image_picker/image_picker.dart' as _i5; +import 'package:image_picker_platform_interface/image_picker_platform_interface.dart' + as _i2; +import 'package:mockito/mockito.dart' as _i1; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeLostData_0 extends _i1.SmartFake implements _i2.LostData { + _FakeLostData_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeLostDataResponse_1 extends _i1.SmartFake + implements _i2.LostDataResponse { + _FakeLostDataResponse_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeMethodCodec_2 extends _i1.SmartFake implements _i3.MethodCodec { + _FakeMethodCodec_2( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeBinaryMessenger_3 extends _i1.SmartFake + implements _i4.BinaryMessenger { + _FakeBinaryMessenger_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeDateTime_4 extends _i1.SmartFake implements DateTime { + _FakeDateTime_4( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [ImagePicker]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockImagePicker extends _i1.Mock implements _i5.ImagePicker { + MockImagePicker() { + _i1.throwOnMissingStub(this); + } + + @override + _i6.Future<_i2.PickedFile?> getImage({ + required _i2.ImageSource? source, + double? maxWidth, + double? maxHeight, + int? imageQuality, + _i2.CameraDevice? preferredCameraDevice = _i2.CameraDevice.rear, + }) => + (super.noSuchMethod( + Invocation.method( + #getImage, + [], + { + #source: source, + #maxWidth: maxWidth, + #maxHeight: maxHeight, + #imageQuality: imageQuality, + #preferredCameraDevice: preferredCameraDevice, + }, + ), + returnValue: _i6.Future<_i2.PickedFile?>.value(), + ) as _i6.Future<_i2.PickedFile?>); + + @override + _i6.Future?> getMultiImage({ + double? maxWidth, + double? maxHeight, + int? imageQuality, + }) => + (super.noSuchMethod( + Invocation.method( + #getMultiImage, + [], + { + #maxWidth: maxWidth, + #maxHeight: maxHeight, + #imageQuality: imageQuality, + }, + ), + returnValue: _i6.Future?>.value(), + ) as _i6.Future?>); + + @override + _i6.Future<_i2.PickedFile?> getVideo({ + required _i2.ImageSource? source, + _i2.CameraDevice? preferredCameraDevice = _i2.CameraDevice.rear, + Duration? maxDuration, + }) => + (super.noSuchMethod( + Invocation.method( + #getVideo, + [], + { + #source: source, + #preferredCameraDevice: preferredCameraDevice, + #maxDuration: maxDuration, + }, + ), + returnValue: _i6.Future<_i2.PickedFile?>.value(), + ) as _i6.Future<_i2.PickedFile?>); + + @override + _i6.Future<_i2.LostData> getLostData() => (super.noSuchMethod( + Invocation.method( + #getLostData, + [], + ), + returnValue: _i6.Future<_i2.LostData>.value(_FakeLostData_0( + this, + Invocation.method( + #getLostData, + [], + ), + )), + ) as _i6.Future<_i2.LostData>); + + @override + _i6.Future<_i2.XFile?> pickImage({ + required _i2.ImageSource? source, + double? maxWidth, + double? maxHeight, + int? imageQuality, + _i2.CameraDevice? preferredCameraDevice = _i2.CameraDevice.rear, + bool? requestFullMetadata = true, + }) => + (super.noSuchMethod( + Invocation.method( + #pickImage, + [], + { + #source: source, + #maxWidth: maxWidth, + #maxHeight: maxHeight, + #imageQuality: imageQuality, + #preferredCameraDevice: preferredCameraDevice, + #requestFullMetadata: requestFullMetadata, + }, + ), + returnValue: _i6.Future<_i2.XFile?>.value(), + ) as _i6.Future<_i2.XFile?>); + + @override + _i6.Future> pickMultiImage({ + double? maxWidth, + double? maxHeight, + int? imageQuality, + bool? requestFullMetadata = true, + }) => + (super.noSuchMethod( + Invocation.method( + #pickMultiImage, + [], + { + #maxWidth: maxWidth, + #maxHeight: maxHeight, + #imageQuality: imageQuality, + #requestFullMetadata: requestFullMetadata, + }, + ), + returnValue: _i6.Future>.value(<_i2.XFile>[]), + ) as _i6.Future>); + + @override + _i6.Future<_i2.XFile?> pickMedia({ + double? maxWidth, + double? maxHeight, + int? imageQuality, + bool? requestFullMetadata = true, + }) => + (super.noSuchMethod( + Invocation.method( + #pickMedia, + [], + { + #maxWidth: maxWidth, + #maxHeight: maxHeight, + #imageQuality: imageQuality, + #requestFullMetadata: requestFullMetadata, + }, + ), + returnValue: _i6.Future<_i2.XFile?>.value(), + ) as _i6.Future<_i2.XFile?>); + + @override + _i6.Future> pickMultipleMedia({ + double? maxWidth, + double? maxHeight, + int? imageQuality, + bool? requestFullMetadata = true, + }) => + (super.noSuchMethod( + Invocation.method( + #pickMultipleMedia, + [], + { + #maxWidth: maxWidth, + #maxHeight: maxHeight, + #imageQuality: imageQuality, + #requestFullMetadata: requestFullMetadata, + }, + ), + returnValue: _i6.Future>.value(<_i2.XFile>[]), + ) as _i6.Future>); + + @override + _i6.Future<_i2.XFile?> pickVideo({ + required _i2.ImageSource? source, + _i2.CameraDevice? preferredCameraDevice = _i2.CameraDevice.rear, + Duration? maxDuration, + }) => + (super.noSuchMethod( + Invocation.method( + #pickVideo, + [], + { + #source: source, + #preferredCameraDevice: preferredCameraDevice, + #maxDuration: maxDuration, + }, + ), + returnValue: _i6.Future<_i2.XFile?>.value(), + ) as _i6.Future<_i2.XFile?>); + + @override + _i6.Future<_i2.LostDataResponse> retrieveLostData() => (super.noSuchMethod( + Invocation.method( + #retrieveLostData, + [], + ), + returnValue: + _i6.Future<_i2.LostDataResponse>.value(_FakeLostDataResponse_1( + this, + Invocation.method( + #retrieveLostData, + [], + ), + )), + ) as _i6.Future<_i2.LostDataResponse>); + + @override + bool supportsImageSource(_i2.ImageSource? source) => (super.noSuchMethod( + Invocation.method( + #supportsImageSource, + [source], + ), + returnValue: false, + ) as bool); +} + +/// A class which mocks [MethodChannel]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockMethodChannel extends _i1.Mock implements _i7.MethodChannel { + MockMethodChannel() { + _i1.throwOnMissingStub(this); + } + + @override + String get name => (super.noSuchMethod( + Invocation.getter(#name), + returnValue: '', + ) as String); + + @override + _i3.MethodCodec get codec => (super.noSuchMethod( + Invocation.getter(#codec), + returnValue: _FakeMethodCodec_2( + this, + Invocation.getter(#codec), + ), + ) as _i3.MethodCodec); + + @override + _i4.BinaryMessenger get binaryMessenger => (super.noSuchMethod( + Invocation.getter(#binaryMessenger), + returnValue: _FakeBinaryMessenger_3( + this, + Invocation.getter(#binaryMessenger), + ), + ) as _i4.BinaryMessenger); + + @override + _i6.Future invokeMethod( + String? method, [ + dynamic arguments, + ]) => + (super.noSuchMethod( + Invocation.method( + #invokeMethod, + [ + method, + arguments, + ], + ), + returnValue: _i6.Future.value(), + ) as _i6.Future); + + @override + _i6.Future?> invokeListMethod( + String? method, [ + dynamic arguments, + ]) => + (super.noSuchMethod( + Invocation.method( + #invokeListMethod, + [ + method, + arguments, + ], + ), + returnValue: _i6.Future?>.value(), + ) as _i6.Future?>); + + @override + _i6.Future?> invokeMapMethod( + String? method, [ + dynamic arguments, + ]) => + (super.noSuchMethod( + Invocation.method( + #invokeMapMethod, + [ + method, + arguments, + ], + ), + returnValue: _i6.Future?>.value(), + ) as _i6.Future?>); + + @override + void setMethodCallHandler( + _i6.Future Function(_i3.MethodCall)? handler) => + super.noSuchMethod( + Invocation.method( + #setMethodCallHandler, + [handler], + ), + returnValueForMissingStub: null, + ); +} + +/// A class which mocks [XFile]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockXFile extends _i1.Mock implements _i2.XFile { + MockXFile() { + _i1.throwOnMissingStub(this); + } + + @override + String get path => (super.noSuchMethod( + Invocation.getter(#path), + returnValue: '', + ) as String); + + @override + String get name => (super.noSuchMethod( + Invocation.getter(#name), + returnValue: '', + ) as String); + + @override + _i6.Future saveTo(String? path) => (super.noSuchMethod( + Invocation.method( + #saveTo, + [path], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + + @override + _i6.Future length() => (super.noSuchMethod( + Invocation.method( + #length, + [], + ), + returnValue: _i6.Future.value(0), + ) as _i6.Future); + + @override + _i6.Future readAsString( + {_i8.Encoding? encoding = const _i8.Utf8Codec()}) => + (super.noSuchMethod( + Invocation.method( + #readAsString, + [], + {#encoding: encoding}, + ), + returnValue: _i6.Future.value(''), + ) as _i6.Future); + + @override + _i6.Future<_i9.Uint8List> readAsBytes() => (super.noSuchMethod( + Invocation.method( + #readAsBytes, + [], + ), + returnValue: _i6.Future<_i9.Uint8List>.value(_i9.Uint8List(0)), + ) as _i6.Future<_i9.Uint8List>); + + @override + _i6.Stream<_i9.Uint8List> openRead([ + int? start, + int? end, + ]) => + (super.noSuchMethod( + Invocation.method( + #openRead, + [ + start, + end, + ], + ), + returnValue: _i6.Stream<_i9.Uint8List>.empty(), + ) as _i6.Stream<_i9.Uint8List>); + + @override + _i6.Future lastModified() => (super.noSuchMethod( + Invocation.method( + #lastModified, + [], + ), + returnValue: _i6.Future.value(_FakeDateTime_4( + this, + Invocation.method( + #lastModified, + [], + ), + )), + ) as _i6.Future); +} diff --git a/packages/io_library/test/save_as_raster_image_test.mocks.dart b/packages/io_library/test/save_as_raster_image_test.mocks.dart new file mode 100644 index 00000000..298cf6df --- /dev/null +++ b/packages/io_library/test/save_as_raster_image_test.mocks.dart @@ -0,0 +1,334 @@ +// Mocks generated by Mockito 5.4.2 from annotations +// in io_library/test/save_as_raster_image_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i4; +import 'dart:io' as _i8; +import 'dart:typed_data' as _i7; +import 'dart:ui' as _i5; + +import 'package:component_library/component_library.dart' as _i6; +import 'package:io_library/io_library.dart' as _i3; +import 'package:mockito/mockito.dart' as _i1; +import 'package:oxidized/oxidized.dart' as _i2; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeResult_0 extends _i1.SmartFake + implements _i2.Result { + _FakeResult_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [IImageService]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockIImageService extends _i1.Mock implements _i3.IImageService { + MockIImageService() { + _i1.throwOnMissingStub(this); + } + + @override + _i4.Future<_i2.Result<_i5.Image, _i6.Failure>> import( + _i7.Uint8List? fileData) => + (super.noSuchMethod( + Invocation.method( + #import, + [fileData], + ), + returnValue: _i4.Future<_i2.Result<_i5.Image, _i6.Failure>>.value( + _FakeResult_0<_i5.Image, _i6.Failure>( + this, + Invocation.method( + #import, + [fileData], + ), + )), + ) as _i4.Future<_i2.Result<_i5.Image, _i6.Failure>>); + + @override + _i4.Future<_i2.Result<_i7.Uint8List, _i6.Failure>> exportAsJpg( + _i5.Image? image, + int? quality, + ) => + (super.noSuchMethod( + Invocation.method( + #exportAsJpg, + [ + image, + quality, + ], + ), + returnValue: _i4.Future<_i2.Result<_i7.Uint8List, _i6.Failure>>.value( + _FakeResult_0<_i7.Uint8List, _i6.Failure>( + this, + Invocation.method( + #exportAsJpg, + [ + image, + quality, + ], + ), + )), + ) as _i4.Future<_i2.Result<_i7.Uint8List, _i6.Failure>>); + + @override + _i4.Future<_i2.Result<_i7.Uint8List, _i6.Failure>> exportAsPng( + _i5.Image? image) => + (super.noSuchMethod( + Invocation.method( + #exportAsPng, + [image], + ), + returnValue: _i4.Future<_i2.Result<_i7.Uint8List, _i6.Failure>>.value( + _FakeResult_0<_i7.Uint8List, _i6.Failure>( + this, + Invocation.method( + #exportAsPng, + [image], + ), + )), + ) as _i4.Future<_i2.Result<_i7.Uint8List, _i6.Failure>>); + + @override + _i2.Result<_i7.Uint8List, _i6.Failure> getProjectPreview(String? path) => + (super.noSuchMethod( + Invocation.method( + #getProjectPreview, + [path], + ), + returnValue: _FakeResult_0<_i7.Uint8List, _i6.Failure>( + this, + Invocation.method( + #getProjectPreview, + [path], + ), + ), + ) as _i2.Result<_i7.Uint8List, _i6.Failure>); +} + +/// A class which mocks [IPhotoLibraryService]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockIPhotoLibraryService extends _i1.Mock + implements _i3.IPhotoLibraryService { + MockIPhotoLibraryService() { + _i1.throwOnMissingStub(this); + } + + @override + _i4.Future<_i2.Result<_i2.Unit, _i6.Failure>> save( + String? filename, + _i7.Uint8List? data, + ) => + (super.noSuchMethod( + Invocation.method( + #save, + [ + filename, + data, + ], + ), + returnValue: _i4.Future<_i2.Result<_i2.Unit, _i6.Failure>>.value( + _FakeResult_0<_i2.Unit, _i6.Failure>( + this, + Invocation.method( + #save, + [ + filename, + data, + ], + ), + )), + ) as _i4.Future<_i2.Result<_i2.Unit, _i6.Failure>>); + + @override + _i4.Future<_i2.Result<_i7.Uint8List, _i6.Failure>> pick() => + (super.noSuchMethod( + Invocation.method( + #pick, + [], + ), + returnValue: _i4.Future<_i2.Result<_i7.Uint8List, _i6.Failure>>.value( + _FakeResult_0<_i7.Uint8List, _i6.Failure>( + this, + Invocation.method( + #pick, + [], + ), + )), + ) as _i4.Future<_i2.Result<_i7.Uint8List, _i6.Failure>>); +} + +/// A class which mocks [IFileService]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockIFileService extends _i1.Mock implements _i3.IFileService { + MockIFileService() { + _i1.throwOnMissingStub(this); + } + + @override + _i4.Future<_i2.Result<_i8.File, _i6.Failure>> save( + String? filename, + _i7.Uint8List? data, + ) => + (super.noSuchMethod( + Invocation.method( + #save, + [ + filename, + data, + ], + ), + returnValue: _i4.Future<_i2.Result<_i8.File, _i6.Failure>>.value( + _FakeResult_0<_i8.File, _i6.Failure>( + this, + Invocation.method( + #save, + [ + filename, + data, + ], + ), + )), + ) as _i4.Future<_i2.Result<_i8.File, _i6.Failure>>); + + @override + _i4.Future<_i2.Result<_i8.File, _i6.Failure>> saveToApplicationDirectory( + String? filename, + _i7.Uint8List? data, + ) => + (super.noSuchMethod( + Invocation.method( + #saveToApplicationDirectory, + [ + filename, + data, + ], + ), + returnValue: _i4.Future<_i2.Result<_i8.File, _i6.Failure>>.value( + _FakeResult_0<_i8.File, _i6.Failure>( + this, + Invocation.method( + #saveToApplicationDirectory, + [ + filename, + data, + ], + ), + )), + ) as _i4.Future<_i2.Result<_i8.File, _i6.Failure>>); + + @override + _i4.Future<_i2.Result<_i8.File, _i6.Failure>> pick() => (super.noSuchMethod( + Invocation.method( + #pick, + [], + ), + returnValue: _i4.Future<_i2.Result<_i8.File, _i6.Failure>>.value( + _FakeResult_0<_i8.File, _i6.Failure>( + this, + Invocation.method( + #pick, + [], + ), + )), + ) as _i4.Future<_i2.Result<_i8.File, _i6.Failure>>); + + @override + _i2.Result<_i8.File, _i6.Failure> getFile(String? path) => + (super.noSuchMethod( + Invocation.method( + #getFile, + [path], + ), + returnValue: _FakeResult_0<_i8.File, _i6.Failure>( + this, + Invocation.method( + #getFile, + [path], + ), + ), + ) as _i2.Result<_i8.File, _i6.Failure>); + + @override + _i4.Future checkIfFileExistsInApplicationDirectory(String? fileName) => + (super.noSuchMethod( + Invocation.method( + #checkIfFileExistsInApplicationDirectory, + [fileName], + ), + returnValue: _i4.Future.value(false), + ) as _i4.Future); + + @override + _i4.Future<_i2.Result<_i8.FileSystemEntity, _i6.Failure>> + deleteFileInApplicationDirectory(String? fileName) => (super.noSuchMethod( + Invocation.method( + #deleteFileInApplicationDirectory, + [fileName], + ), + returnValue: + _i4.Future<_i2.Result<_i8.FileSystemEntity, _i6.Failure>>.value( + _FakeResult_0<_i8.FileSystemEntity, _i6.Failure>( + this, + Invocation.method( + #deleteFileInApplicationDirectory, + [fileName], + ), + )), + ) as _i4.Future<_i2.Result<_i8.FileSystemEntity, _i6.Failure>>); +} + +/// A class which mocks [IPermissionService]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockIPermissionService extends _i1.Mock + implements _i3.IPermissionService { + MockIPermissionService() { + _i1.throwOnMissingStub(this); + } + + @override + _i4.Future requestAccessToPickPhotos() => (super.noSuchMethod( + Invocation.method( + #requestAccessToPickPhotos, + [], + ), + returnValue: _i4.Future.value(false), + ) as _i4.Future); + + @override + _i4.Future requestAccessForSavingToPhotos() => (super.noSuchMethod( + Invocation.method( + #requestAccessForSavingToPhotos, + [], + ), + returnValue: _i4.Future.value(false), + ) as _i4.Future); + + @override + _i4.Future requestAccessToSharedFileStorage() => (super.noSuchMethod( + Invocation.method( + #requestAccessToSharedFileStorage, + [], + ), + returnValue: _i4.Future.value(false), + ) as _i4.Future); +} diff --git a/packages/tools/lib/src/brush_tool/brush_tool_provider.g.dart b/packages/tools/lib/src/brush_tool/brush_tool_provider.g.dart new file mode 100644 index 00000000..b08cd4a0 --- /dev/null +++ b/packages/tools/lib/src/brush_tool/brush_tool_provider.g.dart @@ -0,0 +1,24 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'brush_tool_provider.dart'; + +// ************************************************************************** +// RiverpodGenerator +// ************************************************************************** + +String _$brushToolHash() => r'dfa4f2e7a9cb8734828ec99dd983c7904c231e46'; + +/// See also [brushTool]. +@ProviderFor(brushTool) +final brushToolProvider = AutoDisposeProvider.internal( + brushTool, + name: r'brushToolProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') ? null : _$brushToolHash, + dependencies: null, + allTransitiveDependencies: null, +); + +typedef BrushToolRef = AutoDisposeProviderRef; +// ignore_for_file: type=lint +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member diff --git a/packages/tools/lib/src/brush_tool/brush_tool_state_data.freezed.dart b/packages/tools/lib/src/brush_tool/brush_tool_state_data.freezed.dart new file mode 100644 index 00000000..f48b047f --- /dev/null +++ b/packages/tools/lib/src/brush_tool/brush_tool_state_data.freezed.dart @@ -0,0 +1,134 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'brush_tool_state_data.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + +/// @nodoc +mixin _$BrushToolStateData { + Paint get paint => throw _privateConstructorUsedError; + + @JsonKey(ignore: true) + $BrushToolStateDataCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $BrushToolStateDataCopyWith<$Res> { + factory $BrushToolStateDataCopyWith( + BrushToolStateData value, $Res Function(BrushToolStateData) then) = + _$BrushToolStateDataCopyWithImpl<$Res, BrushToolStateData>; + @useResult + $Res call({Paint paint}); +} + +/// @nodoc +class _$BrushToolStateDataCopyWithImpl<$Res, $Val extends BrushToolStateData> + implements $BrushToolStateDataCopyWith<$Res> { + _$BrushToolStateDataCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? paint = null, + }) { + return _then(_value.copyWith( + paint: null == paint + ? _value.paint + : paint // ignore: cast_nullable_to_non_nullable + as Paint, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_BrushToolStateDataCopyWith<$Res> + implements $BrushToolStateDataCopyWith<$Res> { + factory _$$_BrushToolStateDataCopyWith(_$_BrushToolStateData value, + $Res Function(_$_BrushToolStateData) then) = + __$$_BrushToolStateDataCopyWithImpl<$Res>; + @override + @useResult + $Res call({Paint paint}); +} + +/// @nodoc +class __$$_BrushToolStateDataCopyWithImpl<$Res> + extends _$BrushToolStateDataCopyWithImpl<$Res, _$_BrushToolStateData> + implements _$$_BrushToolStateDataCopyWith<$Res> { + __$$_BrushToolStateDataCopyWithImpl( + _$_BrushToolStateData _value, $Res Function(_$_BrushToolStateData) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? paint = null, + }) { + return _then(_$_BrushToolStateData( + paint: null == paint + ? _value.paint + : paint // ignore: cast_nullable_to_non_nullable + as Paint, + )); + } +} + +/// @nodoc + +class _$_BrushToolStateData implements _BrushToolStateData { + const _$_BrushToolStateData({required this.paint}); + + @override + final Paint paint; + + @override + String toString() { + return 'BrushToolStateData(paint: $paint)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_BrushToolStateData && + (identical(other.paint, paint) || other.paint == paint)); + } + + @override + int get hashCode => Object.hash(runtimeType, paint); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_BrushToolStateDataCopyWith<_$_BrushToolStateData> get copyWith => + __$$_BrushToolStateDataCopyWithImpl<_$_BrushToolStateData>( + this, _$identity); +} + +abstract class _BrushToolStateData implements BrushToolStateData { + const factory _BrushToolStateData({required final Paint paint}) = + _$_BrushToolStateData; + + @override + Paint get paint; + @override + @JsonKey(ignore: true) + _$$_BrushToolStateDataCopyWith<_$_BrushToolStateData> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/packages/tools/lib/src/brush_tool/brush_tool_state_provider.g.dart b/packages/tools/lib/src/brush_tool/brush_tool_state_provider.g.dart new file mode 100644 index 00000000..4bffdbde --- /dev/null +++ b/packages/tools/lib/src/brush_tool/brush_tool_state_provider.g.dart @@ -0,0 +1,26 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'brush_tool_state_provider.dart'; + +// ************************************************************************** +// RiverpodGenerator +// ************************************************************************** + +String _$brushToolStateHash() => r'1dbb16d53ddafba863e739874849eb790b4db667'; + +/// See also [BrushToolState]. +@ProviderFor(BrushToolState) +final brushToolStateProvider = + AutoDisposeNotifierProvider.internal( + BrushToolState.new, + name: r'brushToolStateProvider', + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') + ? null + : _$brushToolStateHash, + dependencies: null, + allTransitiveDependencies: null, +); + +typedef _$BrushToolState = AutoDisposeNotifier; +// ignore_for_file: type=lint +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member diff --git a/packages/tools/lib/src/eraser_tool/eraser_tool_provider.g.dart b/packages/tools/lib/src/eraser_tool/eraser_tool_provider.g.dart new file mode 100644 index 00000000..6de891a9 --- /dev/null +++ b/packages/tools/lib/src/eraser_tool/eraser_tool_provider.g.dart @@ -0,0 +1,24 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'eraser_tool_provider.dart'; + +// ************************************************************************** +// RiverpodGenerator +// ************************************************************************** + +String _$eraserToolHash() => r'a92e9502cc061e5298bc9c8a20fcb30f8759e1e4'; + +/// See also [eraserTool]. +@ProviderFor(eraserTool) +final eraserToolProvider = AutoDisposeProvider.internal( + eraserTool, + name: r'eraserToolProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') ? null : _$eraserToolHash, + dependencies: null, + allTransitiveDependencies: null, +); + +typedef EraserToolRef = AutoDisposeProviderRef; +// ignore_for_file: type=lint +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member diff --git a/packages/tools/lib/src/toolbox/toolbox_state_data.freezed.dart b/packages/tools/lib/src/toolbox/toolbox_state_data.freezed.dart new file mode 100644 index 00000000..a7c007ad --- /dev/null +++ b/packages/tools/lib/src/toolbox/toolbox_state_data.freezed.dart @@ -0,0 +1,173 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'toolbox_state_data.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + +/// @nodoc +mixin _$ToolBoxStateData { + Tool get currentTool => throw _privateConstructorUsedError; + ToolType get currentToolType => throw _privateConstructorUsedError; + bool get isDown => throw _privateConstructorUsedError; + + @JsonKey(ignore: true) + $ToolBoxStateDataCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $ToolBoxStateDataCopyWith<$Res> { + factory $ToolBoxStateDataCopyWith( + ToolBoxStateData value, $Res Function(ToolBoxStateData) then) = + _$ToolBoxStateDataCopyWithImpl<$Res, ToolBoxStateData>; + @useResult + $Res call({Tool currentTool, ToolType currentToolType, bool isDown}); +} + +/// @nodoc +class _$ToolBoxStateDataCopyWithImpl<$Res, $Val extends ToolBoxStateData> + implements $ToolBoxStateDataCopyWith<$Res> { + _$ToolBoxStateDataCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? currentTool = null, + Object? currentToolType = null, + Object? isDown = null, + }) { + return _then(_value.copyWith( + currentTool: null == currentTool + ? _value.currentTool + : currentTool // ignore: cast_nullable_to_non_nullable + as Tool, + currentToolType: null == currentToolType + ? _value.currentToolType + : currentToolType // ignore: cast_nullable_to_non_nullable + as ToolType, + isDown: null == isDown + ? _value.isDown + : isDown // ignore: cast_nullable_to_non_nullable + as bool, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$_ToolBoxStateDataCopyWith<$Res> + implements $ToolBoxStateDataCopyWith<$Res> { + factory _$$_ToolBoxStateDataCopyWith( + _$_ToolBoxStateData value, $Res Function(_$_ToolBoxStateData) then) = + __$$_ToolBoxStateDataCopyWithImpl<$Res>; + @override + @useResult + $Res call({Tool currentTool, ToolType currentToolType, bool isDown}); +} + +/// @nodoc +class __$$_ToolBoxStateDataCopyWithImpl<$Res> + extends _$ToolBoxStateDataCopyWithImpl<$Res, _$_ToolBoxStateData> + implements _$$_ToolBoxStateDataCopyWith<$Res> { + __$$_ToolBoxStateDataCopyWithImpl( + _$_ToolBoxStateData _value, $Res Function(_$_ToolBoxStateData) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? currentTool = null, + Object? currentToolType = null, + Object? isDown = null, + }) { + return _then(_$_ToolBoxStateData( + currentTool: null == currentTool + ? _value.currentTool + : currentTool // ignore: cast_nullable_to_non_nullable + as Tool, + currentToolType: null == currentToolType + ? _value.currentToolType + : currentToolType // ignore: cast_nullable_to_non_nullable + as ToolType, + isDown: null == isDown + ? _value.isDown + : isDown // ignore: cast_nullable_to_non_nullable + as bool, + )); + } +} + +/// @nodoc + +class _$_ToolBoxStateData implements _ToolBoxStateData { + const _$_ToolBoxStateData( + {required this.currentTool, + required this.currentToolType, + required this.isDown}); + + @override + final Tool currentTool; + @override + final ToolType currentToolType; + @override + final bool isDown; + + @override + String toString() { + return 'ToolBoxStateData(currentTool: $currentTool, currentToolType: $currentToolType, isDown: $isDown)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_ToolBoxStateData && + (identical(other.currentTool, currentTool) || + other.currentTool == currentTool) && + (identical(other.currentToolType, currentToolType) || + other.currentToolType == currentToolType) && + (identical(other.isDown, isDown) || other.isDown == isDown)); + } + + @override + int get hashCode => + Object.hash(runtimeType, currentTool, currentToolType, isDown); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_ToolBoxStateDataCopyWith<_$_ToolBoxStateData> get copyWith => + __$$_ToolBoxStateDataCopyWithImpl<_$_ToolBoxStateData>(this, _$identity); +} + +abstract class _ToolBoxStateData implements ToolBoxStateData { + const factory _ToolBoxStateData( + {required final Tool currentTool, + required final ToolType currentToolType, + required final bool isDown}) = _$_ToolBoxStateData; + + @override + Tool get currentTool; + @override + ToolType get currentToolType; + @override + bool get isDown; + @override + @JsonKey(ignore: true) + _$$_ToolBoxStateDataCopyWith<_$_ToolBoxStateData> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/packages/tools/lib/src/toolbox/toolbox_state_provider.g.dart b/packages/tools/lib/src/toolbox/toolbox_state_provider.g.dart new file mode 100644 index 00000000..c3db77a8 --- /dev/null +++ b/packages/tools/lib/src/toolbox/toolbox_state_provider.g.dart @@ -0,0 +1,25 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'toolbox_state_provider.dart'; + +// ************************************************************************** +// RiverpodGenerator +// ************************************************************************** + +String _$toolBoxStateHash() => r'f60ea8348555ae648ab83a23be5abfebd81ab000'; + +/// See also [ToolBoxState]. +@ProviderFor(ToolBoxState) +final toolBoxStateProvider = + AutoDisposeNotifierProvider.internal( + ToolBoxState.new, + name: r'toolBoxStateProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') ? null : _$toolBoxStateHash, + dependencies: null, + allTransitiveDependencies: null, +); + +typedef _$ToolBoxState = AutoDisposeNotifier; +// ignore_for_file: type=lint +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member diff --git a/packages/tools/test/brush_tool_test.mocks.dart b/packages/tools/test/brush_tool_test.mocks.dart new file mode 100644 index 00000000..235c8dcc --- /dev/null +++ b/packages/tools/test/brush_tool_test.mocks.dart @@ -0,0 +1,1079 @@ +// Mocks generated by Mockito 5.4.2 from annotations +// in tools/test/brush_tool_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i5; +import 'dart:ui' as _i2; + +import 'package:command/command.dart' as _i4; +import 'package:component_library/component_library.dart' as _i3; +import 'package:mockito/mockito.dart' as _i1; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakePath_0 extends _i1.SmartFake implements _i2.Path { + _FakePath_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeRect_1 extends _i1.SmartFake implements _i2.Rect { + _FakeRect_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakePathMetrics_2 extends _i1.SmartFake implements _i2.PathMetrics { + _FakePathMetrics_2( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeOffset_3 extends _i1.SmartFake implements _i2.Offset { + _FakeOffset_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakePathWithActionHistory_4 extends _i1.SmartFake + implements _i3.PathWithActionHistory { + _FakePathWithActionHistory_4( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakePaint_5 extends _i1.SmartFake implements _i2.Paint { + _FakePaint_5( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeDrawPathCommand_6 extends _i1.SmartFake + implements _i4.DrawPathCommand { + _FakeDrawPathCommand_6( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakePictureRecorder_7 extends _i1.SmartFake + implements _i2.PictureRecorder { + _FakePictureRecorder_7( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeCanvas_8 extends _i1.SmartFake implements _i2.Canvas { + _FakeCanvas_8( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [PathWithActionHistory]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockPathWithActionHistory extends _i1.Mock + implements _i3.PathWithActionHistory { + MockPathWithActionHistory() { + _i1.throwOnMissingStub(this); + } + + @override + List<_i3.PathAction> get actions => (super.noSuchMethod( + Invocation.getter(#actions), + returnValue: <_i3.PathAction>[], + ) as List<_i3.PathAction>); + + @override + _i2.PathFillType get fillType => (super.noSuchMethod( + Invocation.getter(#fillType), + returnValue: _i2.PathFillType.nonZero, + ) as _i2.PathFillType); + + @override + set fillType(_i2.PathFillType? value) => super.noSuchMethod( + Invocation.setter( + #fillType, + value, + ), + returnValueForMissingStub: null, + ); + + @override + void moveTo( + double? x, + double? y, + ) => + super.noSuchMethod( + Invocation.method( + #moveTo, + [ + x, + y, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void lineTo( + double? x, + double? y, + ) => + super.noSuchMethod( + Invocation.method( + #lineTo, + [ + x, + y, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void close() => super.noSuchMethod( + Invocation.method( + #close, + [], + ), + returnValueForMissingStub: null, + ); + + @override + void relativeMoveTo( + double? dx, + double? dy, + ) => + super.noSuchMethod( + Invocation.method( + #relativeMoveTo, + [ + dx, + dy, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void relativeLineTo( + double? dx, + double? dy, + ) => + super.noSuchMethod( + Invocation.method( + #relativeLineTo, + [ + dx, + dy, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void quadraticBezierTo( + double? x1, + double? y1, + double? x2, + double? y2, + ) => + super.noSuchMethod( + Invocation.method( + #quadraticBezierTo, + [ + x1, + y1, + x2, + y2, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void relativeQuadraticBezierTo( + double? x1, + double? y1, + double? x2, + double? y2, + ) => + super.noSuchMethod( + Invocation.method( + #relativeQuadraticBezierTo, + [ + x1, + y1, + x2, + y2, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void cubicTo( + double? x1, + double? y1, + double? x2, + double? y2, + double? x3, + double? y3, + ) => + super.noSuchMethod( + Invocation.method( + #cubicTo, + [ + x1, + y1, + x2, + y2, + x3, + y3, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void relativeCubicTo( + double? x1, + double? y1, + double? x2, + double? y2, + double? x3, + double? y3, + ) => + super.noSuchMethod( + Invocation.method( + #relativeCubicTo, + [ + x1, + y1, + x2, + y2, + x3, + y3, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void conicTo( + double? x1, + double? y1, + double? x2, + double? y2, + double? w, + ) => + super.noSuchMethod( + Invocation.method( + #conicTo, + [ + x1, + y1, + x2, + y2, + w, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void relativeConicTo( + double? x1, + double? y1, + double? x2, + double? y2, + double? w, + ) => + super.noSuchMethod( + Invocation.method( + #relativeConicTo, + [ + x1, + y1, + x2, + y2, + w, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void arcTo( + _i2.Rect? rect, + double? startAngle, + double? sweepAngle, + bool? forceMoveTo, + ) => + super.noSuchMethod( + Invocation.method( + #arcTo, + [ + rect, + startAngle, + sweepAngle, + forceMoveTo, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void arcToPoint( + _i2.Offset? arcEnd, { + _i2.Radius? radius = _i2.Radius.zero, + double? rotation = 0.0, + bool? largeArc = false, + bool? clockwise = true, + }) => + super.noSuchMethod( + Invocation.method( + #arcToPoint, + [arcEnd], + { + #radius: radius, + #rotation: rotation, + #largeArc: largeArc, + #clockwise: clockwise, + }, + ), + returnValueForMissingStub: null, + ); + + @override + void relativeArcToPoint( + _i2.Offset? arcEndDelta, { + _i2.Radius? radius = _i2.Radius.zero, + double? rotation = 0.0, + bool? largeArc = false, + bool? clockwise = true, + }) => + super.noSuchMethod( + Invocation.method( + #relativeArcToPoint, + [arcEndDelta], + { + #radius: radius, + #rotation: rotation, + #largeArc: largeArc, + #clockwise: clockwise, + }, + ), + returnValueForMissingStub: null, + ); + + @override + void addRect(_i2.Rect? rect) => super.noSuchMethod( + Invocation.method( + #addRect, + [rect], + ), + returnValueForMissingStub: null, + ); + + @override + void addOval(_i2.Rect? oval) => super.noSuchMethod( + Invocation.method( + #addOval, + [oval], + ), + returnValueForMissingStub: null, + ); + + @override + void addArc( + _i2.Rect? oval, + double? startAngle, + double? sweepAngle, + ) => + super.noSuchMethod( + Invocation.method( + #addArc, + [ + oval, + startAngle, + sweepAngle, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void addPolygon( + List<_i2.Offset>? points, + bool? close, + ) => + super.noSuchMethod( + Invocation.method( + #addPolygon, + [ + points, + close, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void addRRect(_i2.RRect? rrect) => super.noSuchMethod( + Invocation.method( + #addRRect, + [rrect], + ), + returnValueForMissingStub: null, + ); + + @override + void addPath( + _i2.Path? path, + _i2.Offset? offset, { + _i5.Float64List? matrix4, + }) => + super.noSuchMethod( + Invocation.method( + #addPath, + [ + path, + offset, + ], + {#matrix4: matrix4}, + ), + returnValueForMissingStub: null, + ); + + @override + void extendWithPath( + _i2.Path? path, + _i2.Offset? offset, { + _i5.Float64List? matrix4, + }) => + super.noSuchMethod( + Invocation.method( + #extendWithPath, + [ + path, + offset, + ], + {#matrix4: matrix4}, + ), + returnValueForMissingStub: null, + ); + + @override + void reset() => super.noSuchMethod( + Invocation.method( + #reset, + [], + ), + returnValueForMissingStub: null, + ); + + @override + bool contains(_i2.Offset? point) => (super.noSuchMethod( + Invocation.method( + #contains, + [point], + ), + returnValue: false, + ) as bool); + + @override + _i2.Path shift(_i2.Offset? offset) => (super.noSuchMethod( + Invocation.method( + #shift, + [offset], + ), + returnValue: _FakePath_0( + this, + Invocation.method( + #shift, + [offset], + ), + ), + ) as _i2.Path); + + @override + _i2.Path transform(_i5.Float64List? matrix4) => (super.noSuchMethod( + Invocation.method( + #transform, + [matrix4], + ), + returnValue: _FakePath_0( + this, + Invocation.method( + #transform, + [matrix4], + ), + ), + ) as _i2.Path); + + @override + _i2.Rect getBounds() => (super.noSuchMethod( + Invocation.method( + #getBounds, + [], + ), + returnValue: _FakeRect_1( + this, + Invocation.method( + #getBounds, + [], + ), + ), + ) as _i2.Rect); + + @override + _i2.PathMetrics computeMetrics({bool? forceClosed = false}) => + (super.noSuchMethod( + Invocation.method( + #computeMetrics, + [], + {#forceClosed: forceClosed}, + ), + returnValue: _FakePathMetrics_2( + this, + Invocation.method( + #computeMetrics, + [], + {#forceClosed: forceClosed}, + ), + ), + ) as _i2.PathMetrics); +} + +/// A class which mocks [Offset]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockOffset extends _i1.Mock implements _i2.Offset { + MockOffset() { + _i1.throwOnMissingStub(this); + } + + @override + double get dx => (super.noSuchMethod( + Invocation.getter(#dx), + returnValue: 0.0, + ) as double); + + @override + double get dy => (super.noSuchMethod( + Invocation.getter(#dy), + returnValue: 0.0, + ) as double); + + @override + double get distance => (super.noSuchMethod( + Invocation.getter(#distance), + returnValue: 0.0, + ) as double); + + @override + double get distanceSquared => (super.noSuchMethod( + Invocation.getter(#distanceSquared), + returnValue: 0.0, + ) as double); + + @override + double get direction => (super.noSuchMethod( + Invocation.getter(#direction), + returnValue: 0.0, + ) as double); + + @override + bool get isInfinite => (super.noSuchMethod( + Invocation.getter(#isInfinite), + returnValue: false, + ) as bool); + + @override + bool get isFinite => (super.noSuchMethod( + Invocation.getter(#isFinite), + returnValue: false, + ) as bool); + + @override + _i2.Offset scale( + double? scaleX, + double? scaleY, + ) => + (super.noSuchMethod( + Invocation.method( + #scale, + [ + scaleX, + scaleY, + ], + ), + returnValue: _FakeOffset_3( + this, + Invocation.method( + #scale, + [ + scaleX, + scaleY, + ], + ), + ), + ) as _i2.Offset); + + @override + _i2.Offset translate( + double? translateX, + double? translateY, + ) => + (super.noSuchMethod( + Invocation.method( + #translate, + [ + translateX, + translateY, + ], + ), + returnValue: _FakeOffset_3( + this, + Invocation.method( + #translate, + [ + translateX, + translateY, + ], + ), + ), + ) as _i2.Offset); + + @override + _i2.Offset operator -() => (super.noSuchMethod( + Invocation.method( + #-, + [], + ), + returnValue: _FakeOffset_3( + this, + Invocation.method( + #-, + [], + ), + ), + ) as _i2.Offset); + + @override + _i2.Offset operator -(_i2.Offset? other) => (super.noSuchMethod( + Invocation.method( + #-, + [other], + ), + returnValue: _FakeOffset_3( + this, + Invocation.method( + #-, + [other], + ), + ), + ) as _i2.Offset); + + @override + _i2.Offset operator +(_i2.Offset? other) => (super.noSuchMethod( + Invocation.method( + #+, + [other], + ), + returnValue: _FakeOffset_3( + this, + Invocation.method( + #+, + [other], + ), + ), + ) as _i2.Offset); + + @override + _i2.Offset operator *(double? operand) => (super.noSuchMethod( + Invocation.method( + #*, + [operand], + ), + returnValue: _FakeOffset_3( + this, + Invocation.method( + #*, + [operand], + ), + ), + ) as _i2.Offset); + + @override + _i2.Offset operator /(double? operand) => (super.noSuchMethod( + Invocation.method( + #/, + [operand], + ), + returnValue: _FakeOffset_3( + this, + Invocation.method( + #/, + [operand], + ), + ), + ) as _i2.Offset); + + @override + _i2.Offset operator ~/(double? operand) => (super.noSuchMethod( + Invocation.method( + #~/, + [operand], + ), + returnValue: _FakeOffset_3( + this, + Invocation.method( + #~/, + [operand], + ), + ), + ) as _i2.Offset); + + @override + _i2.Offset operator %(double? operand) => (super.noSuchMethod( + Invocation.method( + #%, + [operand], + ), + returnValue: _FakeOffset_3( + this, + Invocation.method( + #%, + [operand], + ), + ), + ) as _i2.Offset); + + @override + _i2.Rect operator &(_i2.Size? other) => (super.noSuchMethod( + Invocation.method( + #&, + [other], + ), + returnValue: _FakeRect_1( + this, + Invocation.method( + #&, + [other], + ), + ), + ) as _i2.Rect); + + @override + bool operator <(_i2.OffsetBase? other) => (super.noSuchMethod( + Invocation.method( + #<, + [other], + ), + returnValue: false, + ) as bool); + + @override + bool operator <=(_i2.OffsetBase? other) => (super.noSuchMethod( + Invocation.method( + #<=, + [other], + ), + returnValue: false, + ) as bool); + + @override + bool operator >(_i2.OffsetBase? other) => (super.noSuchMethod( + Invocation.method( + #>, + [other], + ), + returnValue: false, + ) as bool); + + @override + bool operator >=(_i2.OffsetBase? other) => (super.noSuchMethod( + Invocation.method( + #>=, + [other], + ), + returnValue: false, + ) as bool); +} + +/// A class which mocks [DrawPathCommand]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockDrawPathCommand extends _i1.Mock implements _i4.DrawPathCommand { + MockDrawPathCommand() { + _i1.throwOnMissingStub(this); + } + + @override + _i3.PathWithActionHistory get path => (super.noSuchMethod( + Invocation.getter(#path), + returnValue: _FakePathWithActionHistory_4( + this, + Invocation.getter(#path), + ), + ) as _i3.PathWithActionHistory); + + @override + List get props => (super.noSuchMethod( + Invocation.getter(#props), + returnValue: [], + ) as List); + + @override + _i2.Paint get paint => (super.noSuchMethod( + Invocation.getter(#paint), + returnValue: _FakePaint_5( + this, + Invocation.getter(#paint), + ), + ) as _i2.Paint); + + @override + void call(_i2.Canvas? canvas) => super.noSuchMethod( + Invocation.method( + #call, + [canvas], + ), + returnValueForMissingStub: null, + ); +} + +/// A class which mocks [CommandManager]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockCommandManager extends _i1.Mock implements _i4.CommandManager { + MockCommandManager() { + _i1.throwOnMissingStub(this); + } + + @override + Iterable<_i4.Command> get history => (super.noSuchMethod( + Invocation.getter(#history), + returnValue: <_i4.Command>[], + ) as Iterable<_i4.Command>); + + @override + int get count => (super.noSuchMethod( + Invocation.getter(#count), + returnValue: 0, + ) as int); + + @override + void addGraphicCommand(_i4.GraphicCommand? command) => super.noSuchMethod( + Invocation.method( + #addGraphicCommand, + [command], + ), + returnValueForMissingStub: null, + ); + + @override + void executeLastCommand(_i2.Canvas? canvas) => super.noSuchMethod( + Invocation.method( + #executeLastCommand, + [canvas], + ), + returnValueForMissingStub: null, + ); + + @override + void executeAllCommands(_i2.Canvas? canvas) => super.noSuchMethod( + Invocation.method( + #executeAllCommands, + [canvas], + ), + returnValueForMissingStub: null, + ); + + @override + void discardLastCommand() => super.noSuchMethod( + Invocation.method( + #discardLastCommand, + [], + ), + returnValueForMissingStub: null, + ); + + @override + void clearHistory({Iterable<_i4.Command>? newCommands}) => super.noSuchMethod( + Invocation.method( + #clearHistory, + [], + {#newCommands: newCommands}, + ), + returnValueForMissingStub: null, + ); +} + +/// A class which mocks [CommandFactory]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockCommandFactory extends _i1.Mock implements _i4.CommandFactory { + MockCommandFactory() { + _i1.throwOnMissingStub(this); + } + + @override + _i4.DrawPathCommand createDrawPathCommand( + _i3.PathWithActionHistory? path, + _i2.Paint? paint, + ) => + (super.noSuchMethod( + Invocation.method( + #createDrawPathCommand, + [ + path, + paint, + ], + ), + returnValue: _FakeDrawPathCommand_6( + this, + Invocation.method( + #createDrawPathCommand, + [ + path, + paint, + ], + ), + ), + ) as _i4.DrawPathCommand); +} + +/// A class which mocks [GraphicFactory]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockGraphicFactory extends _i1.Mock implements _i3.GraphicFactory { + MockGraphicFactory() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.Paint createPaint() => (super.noSuchMethod( + Invocation.method( + #createPaint, + [], + ), + returnValue: _FakePaint_5( + this, + Invocation.method( + #createPaint, + [], + ), + ), + ) as _i2.Paint); + + @override + _i3.PathWithActionHistory createPathWithActionHistory() => + (super.noSuchMethod( + Invocation.method( + #createPathWithActionHistory, + [], + ), + returnValue: _FakePathWithActionHistory_4( + this, + Invocation.method( + #createPathWithActionHistory, + [], + ), + ), + ) as _i3.PathWithActionHistory); + + @override + _i2.PictureRecorder createPictureRecorder() => (super.noSuchMethod( + Invocation.method( + #createPictureRecorder, + [], + ), + returnValue: _FakePictureRecorder_7( + this, + Invocation.method( + #createPictureRecorder, + [], + ), + ), + ) as _i2.PictureRecorder); + + @override + _i2.Canvas createCanvasWithRecorder(_i2.PictureRecorder? recorder) => + (super.noSuchMethod( + Invocation.method( + #createCanvasWithRecorder, + [recorder], + ), + returnValue: _FakeCanvas_8( + this, + Invocation.method( + #createCanvasWithRecorder, + [recorder], + ), + ), + ) as _i2.Canvas); + + @override + _i2.Paint copyPaint(_i2.Paint? original) => (super.noSuchMethod( + Invocation.method( + #copyPaint, + [original], + ), + returnValue: _FakePaint_5( + this, + Invocation.method( + #copyPaint, + [original], + ), + ), + ) as _i2.Paint); +}