diff -r 000000000000 -r 804d8803eade ui/wpf/UIwrapper/UIwrapper/toolkit.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/wpf/UIwrapper/UIwrapper/toolkit.h Wed Dec 09 11:32:01 2020 +0100 @@ -0,0 +1,42 @@ +// UIwrapper.h + +#pragma once + +#include + +using namespace System; +using namespace System::Runtime::InteropServices; +using namespace System::Threading; +using namespace System::Windows; +using namespace System::Windows::Controls; + +#define UI_EXPORT extern "C" __declspec(dllexport) + +extern "C" typedef void(*UIcallback)(void*, void*); + +void* ObjectToPtr(Object ^obj); +Object^ PtrToObject(void *ptr); + +public ref class ObjEventWrapper { + UIcallback callback = NULL; + void *eventdata = NULL; + Action ^action; + +public: + ObjEventWrapper(UIcallback callback, void *eventdata); + + Action^ GetAction(); + + void Callback(IntPtr uiobj); +}; + +public ref class EventWrapper { + UIcallback callback = NULL; + void *eventdata = NULL; + + +public: + EventWrapper(UIcallback callback, void *eventdata); + void Callback(Object ^sender, RoutedEventArgs ^e); +}; +