diff --git a/.gitignore b/.gitignore index 3054653b..e294c0af 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ screenshots.html *.log include lib/res +.DS_Store +*.userprefs diff --git a/README.md b/README.md index 994a91eb..a0e52c4b 100644 --- a/README.md +++ b/README.md @@ -196,6 +196,7 @@ Clone dependency libraries git clone https://github.com/gecko0307/dlib.git git clone https://github.com/Devisualization/image.git de_image git clone https://github.com/Dav1dde/gl3n.git + git clone https://github.com/p0nce/DerelictCocoa.git Open solution file with Mono-D diff --git a/dlangui-monod-osx.dproj b/dlangui-monod-osx.dproj index 8e78b236..f55e9e10 100644 --- a/dlangui-monod-osx.dproj +++ b/dlangui-monod-osx.dproj @@ -184,5 +184,12 @@ + + + + + + + \ No newline at end of file diff --git a/dlangui-monod-osx.sln b/dlangui-monod-osx.sln index 508eb7b9..9eb771d7 100644 --- a/dlangui-monod-osx.sln +++ b/dlangui-monod-osx.sln @@ -5,6 +5,8 @@ Project("{3947E667-4C90-4C3A-BEB9-7148D6FE0D7C}") = "dlangui-monod-osx", "dlangu EndProject Project("{3947E667-4C90-4C3A-BEB9-7148D6FE0D7C}") = "example1-monod-osx", "examples\example1\example1-monod-osx.dproj", "{079F4963-E637-4E8F-9EB3-BDC404F9DC1D}" EndProject +Project("{3947E667-4C90-4C3A-BEB9-7148D6FE0D7C}") = "derelictcocoatest-monod-osx", "examples\derelictcocoatest-monod-osx\derelictcocoatest-monod-osx.dproj", "{1F050D82-5245-4B51-A554-473194EA0DE9}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -12,17 +14,23 @@ Global Unittest|Any CPU = Unittest|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {079F4963-E637-4E8F-9EB3-BDC404F9DC1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {079F4963-E637-4E8F-9EB3-BDC404F9DC1D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {079F4963-E637-4E8F-9EB3-BDC404F9DC1D}.Debug|Any CPU.ActiveCfg = Debug|x64 + {079F4963-E637-4E8F-9EB3-BDC404F9DC1D}.Debug|Any CPU.Build.0 = Debug|x64 {079F4963-E637-4E8F-9EB3-BDC404F9DC1D}.Release|Any CPU.ActiveCfg = Release|Any CPU {079F4963-E637-4E8F-9EB3-BDC404F9DC1D}.Release|Any CPU.Build.0 = Release|Any CPU {079F4963-E637-4E8F-9EB3-BDC404F9DC1D}.Unittest|Any CPU.ActiveCfg = Unittest|Any CPU {079F4963-E637-4E8F-9EB3-BDC404F9DC1D}.Unittest|Any CPU.Build.0 = Unittest|Any CPU - {1CC7C43E-7B39-4AFC-A45B-F1D9F582CF6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1CC7C43E-7B39-4AFC-A45B-F1D9F582CF6D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1CC7C43E-7B39-4AFC-A45B-F1D9F582CF6D}.Debug|Any CPU.ActiveCfg = Debug|x64 + {1CC7C43E-7B39-4AFC-A45B-F1D9F582CF6D}.Debug|Any CPU.Build.0 = Debug|x64 {1CC7C43E-7B39-4AFC-A45B-F1D9F582CF6D}.Release|Any CPU.ActiveCfg = Release|Any CPU {1CC7C43E-7B39-4AFC-A45B-F1D9F582CF6D}.Release|Any CPU.Build.0 = Release|Any CPU {1CC7C43E-7B39-4AFC-A45B-F1D9F582CF6D}.Unittest|Any CPU.ActiveCfg = Unittest|Any CPU {1CC7C43E-7B39-4AFC-A45B-F1D9F582CF6D}.Unittest|Any CPU.Build.0 = Unittest|Any CPU + {1F050D82-5245-4B51-A554-473194EA0DE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F050D82-5245-4B51-A554-473194EA0DE9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F050D82-5245-4B51-A554-473194EA0DE9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F050D82-5245-4B51-A554-473194EA0DE9}.Release|Any CPU.Build.0 = Release|Any CPU + {1F050D82-5245-4B51-A554-473194EA0DE9}.Unittest|Any CPU.ActiveCfg = Unittest|Any CPU + {1F050D82-5245-4B51-A554-473194EA0DE9}.Unittest|Any CPU.Build.0 = Unittest|Any CPU EndGlobalSection EndGlobal diff --git a/examples/derelictcocoatest-monod-osx/derelictcocoatest-monod-osx.dproj b/examples/derelictcocoatest-monod-osx/derelictcocoatest-monod-osx.dproj new file mode 100644 index 00000000..6c640c5e --- /dev/null +++ b/examples/derelictcocoatest-monod-osx/derelictcocoatest-monod-osx.dproj @@ -0,0 +1,67 @@ + + + + Debug + AnyCPU + {1F050D82-5245-4B51-A554-473194EA0DE9} + DMD2 + true + true + true + + + {1CC7C43E-7B39-4AFC-A45B-F1D9F582CF6D} + + + + + ../../src + ../../deps/dlib + ../../deps/gl3n + ../../deps/DerelictGL3/source + ../../deps/DerelictCocoa/source + ../../deps/DerelictSDL2/source + ../../deps/DerelictFT/source + ../../deps/DerelictUtil/source + + + + + true + bin\Debug + obj/Debug + false + false + derelictcocoatest-monod-osx + Executable + true + 0 + + + bin\Release + obj/Release + false + false + derelictcocoatest-monod-osx + Executable + true + 0 + + + true + bin\Unittest + obj/Unittest + false + true + derelictcocoatest-monod-osx + Executable + true + 0 + + + + + + + + \ No newline at end of file diff --git a/examples/derelictcocoatest-monod-osx/src/cocoatest.d b/examples/derelictcocoatest-monod-osx/src/cocoatest.d new file mode 100644 index 00000000..0d3fc151 --- /dev/null +++ b/examples/derelictcocoatest-monod-osx/src/cocoatest.d @@ -0,0 +1,38 @@ +module cocoatest; + +import derelict.cocoa; + +import dlangui.core.logger; + +void main(string[] args) +{ + Log.setStderrLogger(); + Log.setLogLevel(LogLevel.Trace); + DerelictCocoa.load(); + + NSString appName = NSProcessInfo.processInfo().processName(); + Log.i("appName = %s", appName); + //writefln("appName = %s", appName); + + auto pool = new NSAutoreleasePool; + + auto NSApp = NSApplication.sharedApplication; + + NSApp.setActivationPolicy(NSApplicationActivationPolicyRegular); + + NSMenu menubar = NSMenu.alloc; + menubar.init_(); + NSMenuItem appMenuItem = NSMenuItem.alloc(); + appMenuItem.init_(); + menubar.addItem(appMenuItem); + NSApp.setMainMenu(menubar); + + NSWindow window = NSWindow.alloc(); + window.initWithContentRect(NSMakeRect(10, 10, 200, 200), + NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask, //NSBorderlessWindowMask, + NSBackingStoreBuffered, NO); + window.makeKeyAndOrderFront(); + + NSApp.activateIgnoringOtherApps(YES); + NSApp.run(); +}