diff --git a/wpf/build.bat b/wpf/build.bat deleted file mode 100755 index f36ceea4..00000000 --- a/wpf/build.bat +++ /dev/null @@ -1,3 +0,0 @@ -cl /clr /AI "c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0" wpf.cpp /link /dll /out:wpf.dll ole32.lib - -cl /Tc program.c /link /out:program.exe wpf.lib diff --git a/wpf/sta.c b/wpf/init.c similarity index 97% rename from wpf/sta.c rename to wpf/init.c index c67355e3..2e5e0d2a 100644 --- a/wpf/sta.c +++ b/wpf/init.c @@ -2,7 +2,7 @@ #ifdef __cplusplus #error msbuild is being dumb and making this a C++ file #endif -#include "../windows/winapi.h" +#include "winapi.h" #include "../ui.h" // TODO to make sure wpfInit() is exported properly #include "wpf.h" diff --git a/wpf/wpf.vcxproj b/wpf/libui.msbuild similarity index 95% rename from wpf/wpf.vcxproj rename to wpf/libui.msbuild index a5a34cf2..9b1afa34 100755 --- a/wpf/wpf.vcxproj +++ b/wpf/libui.msbuild @@ -50,6 +50,7 @@ Level4 NotUsing + _UI_EXTERN=__declspec(dllexport) extern /wd4100 @@ -69,12 +70,11 @@ - - - + false - + + diff --git a/wpf/program.c b/wpf/program.c deleted file mode 100644 index 80c75d37..00000000 --- a/wpf/program.c +++ /dev/null @@ -1,22 +0,0 @@ -// 24 november 2015 -#include -#include "wpf.h" - -static void onClosing(wpfWindow *w, void *data) -{ - printf("exiting\n"); - wpfQuit(); -} - -int main(void) -{ - wpfWindow *w; - - wpfInit(); - w = wpfNewWindow("Hi", 320, 240); - wpfWindowOnClosing(w, onClosing, NULL); - - wpfRun(); - printf("out\n"); - return 0; -} diff --git a/wpf/winapi.h b/wpf/winapi.h new file mode 100644 index 00000000..8aa25e14 --- /dev/null +++ b/wpf/winapi.h @@ -0,0 +1,13 @@ +// 31 may 2015 +#define UNICODE +#define _UNICODE +#define STRICT +#define STRICT_TYPED_ITEMIDS +// get Windows version right; right now Windows Vista +#define WINVER 0x0600 /* according to Microsoft's winnls.h */ +#define _WIN32_WINNT 0x0600 /* according to Microsoft's sdkddkver.h */ +#define _WIN32_WINDOWS 0x0600 /* according to Microsoft's pdh.h */ +#define _WIN32_IE 0x0700 /* according to Microsoft's sdkddkver.h */ +#define NTDDI_VERSION 0x06000000 /* according to Microsoft's sdkddkver.h */ +#include +#include diff --git a/wpf/wpf.h b/wpf/wpf.h deleted file mode 100644 index a7f89d7d..00000000 --- a/wpf/wpf.h +++ /dev/null @@ -1,22 +0,0 @@ -// 24 november 2015 - -#ifndef EXPORT -#define EXPORT __declspec(dllimport) -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct wpfWindow wpfWindow; - -extern EXPORT wpfWindow *wpfNewWindow(const char *title, int width, int height); -extern EXPORT void wpfWindowOnClosing(wpfWindow *w, void (*f)(wpfWindow *w, void *data), void *data); - -extern EXPORT void wpfInit(void); -extern EXPORT void wpfRun(void); -extern EXPORT void wpfQuit(void); - -#ifdef __cplusplus -} -#endif diff --git a/wpf/xtest.cpp b/wpf/xtest.cpp deleted file mode 100644 index b4d2d972..00000000 --- a/wpf/xtest.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// 24 november 2015 -#using -#using -#using -#using -using namespace System; -using namespace System::ComponentModel; - -int main(void) -{ - System::ComponentModel::CancelEventArgs ^e; - - e = gcnew CancelEventArgs(); - e->Cancel = true; - System::Console::WriteLine(e->Cancel); - return 0; -}