Skip to content

Commit

Permalink
fmt: fix Dart formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
evdokimovs committed Dec 5, 2024
1 parent c31b07f commit d260c6c
Show file tree
Hide file tree
Showing 22 changed files with 2,749 additions and 1,172 deletions.
73 changes: 49 additions & 24 deletions flutter/lib/src/native/ffi/callback.g.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:ffi';
import 'package:ffi/ffi.dart';
import 'package:medea_jason/src/native/ffi/foreign_value.dart';

typedef _ErrorSetterFnC = Void Function(Handle);
typedef _ErrorSetterFnDart = void Function(Object);

Expand All @@ -10,27 +11,51 @@ Object Function(Pointer)? _callProxy;
_ErrorSetterFnDart? _callback__call_two_arg_proxy__set_error;
_ErrorSetterFnDart? _callback__call_proxy__set_error;

void registerFunction(DynamicLibrary dl, {
required Object Function(Pointer) callTwoArgProxy,
required Object Function(Pointer) callProxy,
} ) {
_callTwoArgProxy = callTwoArgProxy;
_callProxy = callProxy;

_callback__call_two_arg_proxy__set_error = dl.lookupFunction<_ErrorSetterFnC,_ErrorSetterFnDart>('callback__call_two_arg_proxy__set_error');
_callback__call_proxy__set_error = dl.lookupFunction<_ErrorSetterFnC,_ErrorSetterFnDart>('callback__call_proxy__set_error');

Pointer<NativeFunction<Handle Function(Pointer)>> callTwoArgProxy_native = Pointer.fromFunction(_callTwoArgProxyProxy,);
Pointer<NativeFunction<Handle Function(Pointer)>> callProxy_native = Pointer.fromFunction(_callProxyProxy,);

dl.lookupFunction<Void Function(Pointer, Pointer), void Function(Pointer, Pointer)>('register_callback')(

callTwoArgProxy_native,
callProxy_native,
);}
Object _callTwoArgProxyProxy(Pointer arg0) {try {
return _callTwoArgProxy!(arg0); } catch (e) { _callback__call_two_arg_proxy__set_error!(e); return 0;
} }
Object _callProxyProxy(Pointer arg0) {try {
return _callProxy!(arg0); } catch (e) { _callback__call_proxy__set_error!(e); return 0;
} }
void registerFunction(
DynamicLibrary dl, {
required Object Function(Pointer) callTwoArgProxy,
required Object Function(Pointer) callProxy,
}) {
_callTwoArgProxy = callTwoArgProxy;
_callProxy = callProxy;

_callback__call_two_arg_proxy__set_error =
dl.lookupFunction<_ErrorSetterFnC, _ErrorSetterFnDart>(
'callback__call_two_arg_proxy__set_error');
_callback__call_proxy__set_error =
dl.lookupFunction<_ErrorSetterFnC, _ErrorSetterFnDart>(
'callback__call_proxy__set_error');

Pointer<NativeFunction<Handle Function(Pointer)>> callTwoArgProxy_native =
Pointer.fromFunction(
_callTwoArgProxyProxy,
);
Pointer<NativeFunction<Handle Function(Pointer)>> callProxy_native =
Pointer.fromFunction(
_callProxyProxy,
);

dl.lookupFunction<Void Function(Pointer, Pointer),
void Function(Pointer, Pointer)>('register_callback')(
callTwoArgProxy_native,
callProxy_native,
);
}

Object _callTwoArgProxyProxy(Pointer arg0) {
try {
return _callTwoArgProxy!(arg0);
} catch (e) {
_callback__call_two_arg_proxy__set_error!(e);
return 0;
}
}

Object _callProxyProxy(Pointer arg0) {
try {
return _callProxy!(arg0);
} catch (e) {
_callback__call_proxy__set_error!(e);
return 0;
}
}
147 changes: 103 additions & 44 deletions flutter/lib/src/native/ffi/completer.g.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:ffi';
import 'package:ffi/ffi.dart';
import 'package:medea_jason/src/native/ffi/foreign_value.dart';

typedef _ErrorSetterFnC = Void Function(Handle);
typedef _ErrorSetterFnDart = void Function(Object);

Expand All @@ -16,51 +17,109 @@ _ErrorSetterFnDart? _completer__complete_error__set_error;
_ErrorSetterFnDart? _completer__future__set_error;
_ErrorSetterFnDart? _completer__delayed__set_error;

void registerFunction(DynamicLibrary dl, {
required Object Function() init,
required void Function(Object, ForeignValue) complete,
required void Function(Object, Pointer<Handle>) completeError,
required Object Function(Object) future,
required Object Function(int) delayed,
} ) {
_init = init;
_complete = complete;
_completeError = completeError;
_future = future;
_delayed = delayed;
void registerFunction(
DynamicLibrary dl, {
required Object Function() init,
required void Function(Object, ForeignValue) complete,
required void Function(Object, Pointer<Handle>) completeError,
required Object Function(Object) future,
required Object Function(int) delayed,
}) {
_init = init;
_complete = complete;
_completeError = completeError;
_future = future;
_delayed = delayed;

_completer__init__set_error =
dl.lookupFunction<_ErrorSetterFnC, _ErrorSetterFnDart>(
'completer__init__set_error');
_completer__complete__set_error =
dl.lookupFunction<_ErrorSetterFnC, _ErrorSetterFnDart>(
'completer__complete__set_error');
_completer__complete_error__set_error =
dl.lookupFunction<_ErrorSetterFnC, _ErrorSetterFnDart>(
'completer__complete_error__set_error');
_completer__future__set_error =
dl.lookupFunction<_ErrorSetterFnC, _ErrorSetterFnDart>(
'completer__future__set_error');
_completer__delayed__set_error =
dl.lookupFunction<_ErrorSetterFnC, _ErrorSetterFnDart>(
'completer__delayed__set_error');

Pointer<NativeFunction<Handle Function()>> init_native = Pointer.fromFunction(
_initProxy,
);
Pointer<NativeFunction<Void Function(Handle, ForeignValue)>> complete_native =
Pointer.fromFunction(
_completeProxy,
);
Pointer<NativeFunction<Void Function(Handle, Pointer<Handle>)>>
completeError_native = Pointer.fromFunction(
_completeErrorProxy,
);
Pointer<NativeFunction<Handle Function(Handle)>> future_native =
Pointer.fromFunction(
_futureProxy,
);
Pointer<NativeFunction<Handle Function(Int32)>> delayed_native =
Pointer.fromFunction(
_delayedProxy,
);

dl.lookupFunction<
Void Function(Pointer, Pointer, Pointer, Pointer, Pointer),
void Function(
Pointer, Pointer, Pointer, Pointer, Pointer)>('register_completer')(
init_native,
complete_native,
completeError_native,
future_native,
delayed_native,
);
}

Object _initProxy() {
try {
return _init!();
} catch (e) {
_completer__init__set_error!(e);
return 0;
}
}

_completer__init__set_error = dl.lookupFunction<_ErrorSetterFnC,_ErrorSetterFnDart>('completer__init__set_error');
_completer__complete__set_error = dl.lookupFunction<_ErrorSetterFnC,_ErrorSetterFnDart>('completer__complete__set_error');
_completer__complete_error__set_error = dl.lookupFunction<_ErrorSetterFnC,_ErrorSetterFnDart>('completer__complete_error__set_error');
_completer__future__set_error = dl.lookupFunction<_ErrorSetterFnC,_ErrorSetterFnDart>('completer__future__set_error');
_completer__delayed__set_error = dl.lookupFunction<_ErrorSetterFnC,_ErrorSetterFnDart>('completer__delayed__set_error');
void _completeProxy(Object arg0, ForeignValue arg1) {
try {
return _complete!(arg0, arg1);
} catch (e) {
_completer__complete__set_error!(e);
return;
}
}

Pointer<NativeFunction<Handle Function()>> init_native = Pointer.fromFunction(_initProxy,);
Pointer<NativeFunction<Void Function(Handle, ForeignValue)>> complete_native = Pointer.fromFunction(_completeProxy,);
Pointer<NativeFunction<Void Function(Handle, Pointer<Handle>)>> completeError_native = Pointer.fromFunction(_completeErrorProxy,);
Pointer<NativeFunction<Handle Function(Handle)>> future_native = Pointer.fromFunction(_futureProxy,);
Pointer<NativeFunction<Handle Function(Int32)>> delayed_native = Pointer.fromFunction(_delayedProxy,);
void _completeErrorProxy(Object arg0, Pointer<Handle> arg1) {
try {
return _completeError!(arg0, arg1);
} catch (e) {
_completer__complete_error__set_error!(e);
return;
}
}

dl.lookupFunction<Void Function(Pointer, Pointer, Pointer, Pointer, Pointer), void Function(Pointer, Pointer, Pointer, Pointer, Pointer)>('register_completer')(
Object _futureProxy(Object arg0) {
try {
return _future!(arg0);
} catch (e) {
_completer__future__set_error!(e);
return 0;
}
}

init_native,
complete_native,
completeError_native,
future_native,
delayed_native,
);}
Object _initProxy() {try {
return _init!(); } catch (e) { _completer__init__set_error!(e); return 0;
} }
void _completeProxy(Object arg0, ForeignValue arg1) {try {
return _complete!(arg0, arg1); } catch (e) { _completer__complete__set_error!(e); return ;
} }
void _completeErrorProxy(Object arg0, Pointer<Handle> arg1) {try {
return _completeError!(arg0, arg1); } catch (e) { _completer__complete_error__set_error!(e); return ;
} }
Object _futureProxy(Object arg0) {try {
return _future!(arg0); } catch (e) { _completer__future__set_error!(e); return 0;
} }
Object _delayedProxy(int arg0) {try {
return _delayed!(arg0); } catch (e) { _completer__delayed__set_error!(e); return 0;
} }
Object _delayedProxy(int arg0) {
try {
return _delayed!(arg0);
} catch (e) {
_completer__delayed__set_error!(e);
return 0;
}
}
Loading

0 comments on commit d260c6c

Please sign in to comment.