5#ifndef LIB_TONIC_DART_BINDING_MACROS_H_
6#define LIB_TONIC_DART_BINDING_MACROS_H_
10#define DART_NATIVE_NO_UI_CHECK_CALLBACK(CLASS, METHOD) \
11 static void CLASS##_##METHOD(Dart_NativeArguments args) { \
12 tonic::DartCall(&CLASS::METHOD, args); \
15#define DART_NATIVE_CALLBACK(CLASS, METHOD) \
16 static void CLASS##_##METHOD(Dart_NativeArguments args) { \
17 UIDartState::ThrowIfUIOperationsProhibited(); \
18 tonic::DartCall(&CLASS::METHOD, args); \
21#define DART_NATIVE_CALLBACK_STATIC(CLASS, METHOD) \
22 static void CLASS##_##METHOD(Dart_NativeArguments args) { \
23 tonic::DartCallStatic(&CLASS::METHOD, args); \
26#define DART_REGISTER_NATIVE(CLASS, METHOD) \
27 {#CLASS "_" #METHOD, CLASS##_##METHOD, \
28 tonic::IndicesForSignature<decltype(&CLASS::METHOD)>::count + 1, true},
30#define DART_REGISTER_NATIVE_STATIC(CLASS, METHOD) \
32 #CLASS "_" #METHOD, CLASS##_##METHOD, \
33 tonic::IndicesForSignature<decltype(&CLASS::METHOD)>::count, true \
36#define DART_BIND_ALL(CLASS, FOR_EACH) \
37 FOR_EACH(DART_NATIVE_CALLBACK) \
38 void CLASS::RegisterNatives(tonic::DartLibraryNatives* natives) { \
39 natives->Register({FOR_EACH(DART_REGISTER_NATIVE)}); \