Ddoc

Dlang UI

GUI for D programming language, written in D.

Alpha stage of development.

Widgets

Currently implemented widgets:

Layouts

Similar to layouts in Android

List Views

Lists are implemented similar to Android UI API.

TODOs:

Resources

Resources like fonts and images use reference counting. For proper resource freeing, always destroy widgets implicitly.

Styles and Themes

Styles and themes are a bit similar to ones in Android API.

Win32 builds

Build and run using DUB:

----------------------- git clone https://github.com/buggins/dlangui.git cd dlangui dub run dlangui:example1 -----------------------

To develop using Visual-D, download sources for dlabgui and dependencies into some directory:

----------------------- git clone https://github.com/buggins/dlangui.git git clone https://github.com/DerelictOrg/DerelictUtil.git git clone https://github.com/DerelictOrg/DerelictGL3.git git clone https://github.com/DerelictOrg/DerelictFI.git git clone https://github.com/DerelictOrg/DerelictFT.git git clone https://github.com/DerelictOrg/DerelictSDL2.git -----------------------

Then open .sln using Visual D.

Linux builds

For linux build with SDL2 backend, following libraries are required:

----------------------- libsdl2 -----------------------

To build dlangui apps with XCB backend, development packages for following libraries required for XCB backend build:

----------------------- xcb, xcb-util, xcb-shm, xcb-image, xcb-keysyms, X11-xcb, X11 -----------------------

E.g. in Ubuntu, you can use following command to enable SDL2 backend builds:

----------------------- sudo apt-get install libsdl2-dev -----------------------

or (for XCB backend)

----------------------- sudo apt-get install libxcb-image0-dev libxcb-shm0-dev libxcb-keysyms1-dev libfreeimage-dev -----------------------

In runtime, .so for following libraries are being loaded (binary packages required):

----------------------- freetype, opengl, freeimage -----------------------

Build and run on Linux using DUB:

----------------------- dub run dlangui:example1 -----------------------

Development using Mono-D:

You need fresh version of MonoDevelop to use Mono-D. It can be installed from PPA repository.

----------------------- sudo add-apt-repository ppa:ermshiperete/monodevelop sudo apt-get update sudo apt-get install monodevelop-current -----------------------

Other platforms

Third party components used

Hello World

------------------------------------------ // main.d import dlangui.all; mixin DLANGUI_ENTRY_POINT; /// entry point for dlangui based application extern (C) int UIAppMain(string[] args) { // resource directory search paths string[] resourceDirs = [ appendPath(exePath, "../res/"), // for Visual D and DUB builds appendPath(exePath, "../../res/") // for Mono-D builds ]; // setup resource directories - will use only existing directories Platform.instance.resourceDirs = resourceDirs; // select translation file - for english language Platform.instance.uiLanguage = "en"; // load theme from file "theme_default.xml" Platform.instance.uiTheme = "theme_default"; // create window Window window = Platform.instance.createWindow("My Window", null); // create some widget to show in window window.mainWidget = (new Button()).text("Hello world"d).textColor(0xFF0000); // red text // show window window.show(); // run message loop return Platform.instance.enterMessageLoop(); } --------------------------------