ui/wpf/UIwrapper/UIwrapper/toolkit.h

changeset 0
804d8803eade
equal deleted inserted replaced
-1:000000000000 0:804d8803eade
1 // UIwrapper.h
2
3 #pragma once
4
5 #include <vcclr.h>
6
7 using namespace System;
8 using namespace System::Runtime::InteropServices;
9 using namespace System::Threading;
10 using namespace System::Windows;
11 using namespace System::Windows::Controls;
12
13 #define UI_EXPORT extern "C" __declspec(dllexport)
14
15 extern "C" typedef void(*UIcallback)(void*, void*);
16
17 void* ObjectToPtr(Object ^obj);
18 Object^ PtrToObject(void *ptr);
19
20 public ref class ObjEventWrapper {
21 UIcallback callback = NULL;
22 void *eventdata = NULL;
23 Action<IntPtr> ^action;
24
25 public:
26 ObjEventWrapper(UIcallback callback, void *eventdata);
27
28 Action<IntPtr>^ GetAction();
29
30 void Callback(IntPtr uiobj);
31 };
32
33 public ref class EventWrapper {
34 UIcallback callback = NULL;
35 void *eventdata = NULL;
36
37
38 public:
39 EventWrapper(UIcallback callback, void *eventdata);
40 void Callback(Object ^sender, RoutedEventArgs ^e);
41 };
42

mercurial