1 module app; 2 3 import dlangui.all; 4 import std.stdio; 5 import std.conv; 6 import dlangide.ui.frame; 7 import dlangide.ui.commands; 8 import dlangide.workspace.workspace; 9 10 11 mixin APP_ENTRY_POINT; 12 13 /// entry point for dlangui based application 14 extern (C) int UIAppMain(string[] args) { 15 // resource directory search paths 16 string[] resourceDirs = [ 17 appendPath(exePath, "res/"), // when res dir is located at the same directory as executable 18 appendPath(exePath, "../res/"), // when res dir is located at project directory 19 appendPath(exePath, "../../res/"), // when res dir is located at the same directory as executable 20 appendPath(exePath, "res/mdpi/"), // when res dir is located at the same directory as executable 21 appendPath(exePath, "../res/mdpi/"), // when res dir is located at project directory 22 appendPath(exePath, "../../res/mdpi/"), // when res dir is located at the same directory as executable 23 appendPath(exePath, "res/stdres/"), // when res dir is located at the same directory as executable 24 appendPath(exePath, "../res/stdres/"), // when res dir is located at project directory 25 appendPath(exePath, "../../res/stdres/"), // when res dir is located at the same directory as executable 26 appendPath(exePath, "res/stdres/mdpi/"), // when res dir is located at the same directory as executable 27 appendPath(exePath, "../res/stdres/mdpi/"), // when res dir is located at project directory 28 appendPath(exePath, "../../res/stdres/mdpi/") // when res dir is located at the same directory as executable 29 ]; 30 31 // setup resource directories - will use only existing directories 32 Platform.instance.resourceDirs = resourceDirs; 33 // select translation file - for english language 34 Platform.instance.uiLanguage = "en"; 35 // load theme from file "theme_default.xml" 36 Platform.instance.uiTheme = "theme_default"; 37 38 // you can override default hinting mode here 39 FontManager.instance.hintingMode = HintingMode.Normal; 40 // you can override antialiasing setting here 41 FontManager.instance.minAnitialiasedFontSize = 0; 42 43 // create window 44 Window window = Platform.instance.createWindow("Dlang IDE", null); 45 46 IDEFrame frame = new IDEFrame(window); 47 48 // create some widget to show in window 49 window.windowIcon = drawableCache.getImage("dlangui-logo1"); 50 51 frame.loadWorkspace(appendPath(exePath, "../workspaces/sample1/sample1.dlangidews")); 52 53 // show window 54 window.show(); 55 56 // run message loop 57 return Platform.instance.enterMessageLoop(); 58 }