ui/wpf/UIwrapper/UIwrapper/toolkit.h

changeset 83
a38aec91bd66
parent 82
0cdb8089a29f
child 135
b9dc9cdfa23a
equal deleted inserted replaced
82:0cdb8089a29f 83:a38aec91bd66
1 // UIwrapper.h 1 // UIwrapper.h
2 2
3 #pragma once 3 #pragma once
4
5 #include <vcclr.h>
4 6
5 using namespace System; 7 using namespace System;
6 using namespace System::Runtime::InteropServices; 8 using namespace System::Runtime::InteropServices;
7 using namespace System::Threading; 9 using namespace System::Threading;
8 using namespace System::Windows; 10 using namespace System::Windows;
11 #define UI_EXPORT extern "C" __declspec(dllexport) 13 #define UI_EXPORT extern "C" __declspec(dllexport)
12 14
13 extern "C" typedef void(*UIcallback)(void*, void*); 15 extern "C" typedef void(*UIcallback)(void*, void*);
14 16
15 void* ObjectToPtr(Object ^obj); 17 void* ObjectToPtr(Object ^obj);
18 Object^ PtrToObject(void *ptr);
16 19
17 public ref class EventWrapper { 20 public ref class ObjEventWrapper {
18 UIcallback callback = NULL; 21 UIcallback callback = NULL;
19 void *userdata = NULL; 22 void *eventdata = NULL;
20 Action<IntPtr> ^action; 23 Action<IntPtr> ^action;
21 24
22 public: 25 public:
23 EventWrapper(UIcallback callback, void *userdata); 26 ObjEventWrapper(UIcallback callback, void *eventdata);
24 27
25 Action<IntPtr>^ GetAction(); 28 Action<IntPtr>^ GetAction();
26 29
27 void Callback(IntPtr uiobj); 30 void Callback(IntPtr uiobj);
28 }; 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 };

mercurial