On Tuesday, 20 May 2014 at 18:13:36 UTC, Vadim Lopatin wrote: > Hello! > > I would like to announce my project, DlangUI library - cross-platform GUI for D. > https:// github.com/ buggins/ dlangui > License: Boost License 1.0 > > Native library written in D (not a wrapper to other GUI library) - easy to extend. > As a backend, uses SDL2 on any platform, Win32 API on Windows, XCB on Linux. Other backends can be added easy. > Tested on Windows and Linux. > Supports hardware acceleration - drawing using OpenGL when built with version=USE_OPENGL. > Unicode support. > Internationalization support. > Uses Win32 API fonts on Windows, and FreeType on other platforms. > Same look and feel can be achieved on all platforms. > Flexible look and feel - themes and styles. > API is a bit similar to Android UI. > Flexible layout, support of different screen DPI, scaling. > Uses two phase layout like in Android. > Supports drawable resources in .png and .jpeg, nine-patch pngs and state drawables like in Android. > Single threaded. Use other threads for performing slow tasks. > Mouse oriented. > > Actually, it's a port (with major redesign) of my library used for cross-platform version of my application CoolReader from C++. > > > State of project: alpha. But, already can be used for simple 2D games and simple GUI apps. > I'm keeping in mind a goal to write D language IDE based on dlangui. :) > Adding support of 3D graphics is planned. > > > Currently implemented widgets: > > TextWidget - simple static text (TODO: implement multiline formatting) > ImageWidget - static image > Button - simple button with text label > ImageButton - image only button > TextImageButton - button with icon and label > CheckBox - check button with label > RadioButton - radio button with label > EditLine - single line edit > EditBox - multiline editor > VSpacer - vertical spacer - just an empty widget with layoutHeight == FILL_PARENT, to fill vertical space in layouts > HSpacer - horizontal spacer - just an empty widget with layoutWidth == FILL_PARENT, to fill horizontal space in layouts > ScrollBar - scroll bar > TabControl - tabs widget, allows to select one of tabs > TabHost - container for pages controlled by TabControl > TabWidget - combination of TabControl and TabHost > > Layouts - Similar to layouts in Android > > LinearLayout - layout children horizontally or vertically depending on orientation > VerticalLayout - just a LinearLayout with vertical orientation > HorizontalLayout - just a LinearLayout with vertical orientation > FrameLayout - all children occupy the same place; usually onle one of them is visible > TableLayout - children are aligned into rows and columns of table > > List Views - similar to lists in Android UI API. > ListWidget - layout dynamic items horizontally or vertically (one in row/column) with automatic scrollbar; can reuse widgets for similar items > ListAdapter - interface to provide data and widgets for ListWidget > WidgetListAdapter - simple implementation of ListAdapter interface - just a list of widgets (one per list item) to show > > > Sample project, example1 contains demo code for most of dlangui API. > > Try it using DUB: > > git clone > cd dlangui > dub run dlangui:example1 > > Fonts note: on Linux, several .TTFs are loaded from hardcoded paths (suitable for Ubuntu). > TODO: add fontconfig support to access all available system fonts. > > Helloworld: > > // 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. createW indow("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. enterMess ageLoop(); > } > > DDOC generated documentation can be found there: > For more info see readme and example1 code. > > I would be glad to see any feedback. > Can this project be useful for someone? What features/widgets are must have for you? > > > Best regards, > Vadim <coolreader.org@gmail.com> > Hello!I would like to announce my project, DlangUI library - cross-platform GUI for D.License: Boost License 1.0Native library written in D (not a wrapper to other GUI library) - easy to extend.As a backend, uses SDL2 on any platform, Win32 API on Windows, XCB on Linux. Other backends can be added easy.Tested on Windows and Linux.Supports hardware acceleration - drawing using OpenGL when built with version=USE_OPENGL.Unicode support.Internationalization support.Uses Win32 API fonts on Windows, and FreeType on other platforms.Same look and feel can be achieved on all platforms.Flexible look and feel - themes and styles.API is a bit similar to Android UI.Flexible layout, support of different screen DPI, scaling.Uses two phase layout like in Android.Supports drawable resources in .png and .jpeg, nine-patch pngs and state drawables like in Android.Single threaded. Use other threads for performing slow tasks.Mouse oriented.Actually, it's a port (with major redesign) of my library used for cross-platform version of my application CoolReader from C++.State of project: alpha. But, already can be used for simple 2D games and simple GUI apps.I'm keeping in mind a goal to write D language IDE based on dlangui. :)Adding support of 3D graphics is planned.Currently implemented widgets:TextWidget - simple static text (TODO: implement multiline formatting)ImageWidget - static imageButton - simple button with text labelImageButton - image only buttonTextImageButton - button with icon and labelCheckBox - check button with labelRadioButton - radio button with labelEditLine - single line editEditBox - multiline editorVSpacer - vertical spacer - just an empty widget with layoutHeight == FILL_PARENT, to fill vertical space in layoutsHSpacer - horizontal spacer - just an empty widget with layoutWidth == FILL_PARENT, to fill horizontal space in layoutsScrollBar - scroll barTabControl - tabs widget, allows to select one of tabsTabHost - container for pages controlled by TabControlTabWidget - combination of TabControl and TabHostLayouts - Similar to layouts in AndroidLinearLayout - layout children horizontally or vertically depending on orientationVerticalLayout - just a LinearLayout with vertical orientationHorizontalLayout - just a LinearLayout with vertical orientationFrameLayout - all children occupy the same place; usually onle one of them is visibleTableLayout - children are aligned into rows and columns of tableList Views - similar to lists in Android UI API.ListWidget - layout dynamic items horizontally or vertically (one in row/column) with automatic scrollbar; can reuse widgets for similar itemsListAdapter - interface to provide data and widgets for ListWidgetWidgetListAdapter - simple implementation of ListAdapter interface - just a list of widgets (one per list item) to showSample project, example1 contains demo code for most of dlangui API.Try it using DUB:git clone https:// github.com/ buggins/ dlangui.git cd dlanguidub run dlangui:example1Fonts note: on Linux, several .TTFs are loaded from hardcoded paths (suitable for Ubuntu).TODO: add fontconfig support to access all available system fonts.Helloworld:// main.dimport dlangui.all;mixin DLANGUI_ENTRY_POINT;/// entry point for dlangui based applicationextern (C) int UIAppMain(string[] args) {// resource directory search pathsstring[] resourceDirs = [appendPath(exePath, "../res/"), // for Visual D and DUB buildsappendPath(exePath, "../../res/") // for Mono-D builds];// setup resource directories - will use only existing directoriesPlatform.instance.resourceDirs = resourceDirs;// select translation file - for english languagePlatform.instance.uiLanguage = "en";// load theme from file "theme_default.xml"Platform.instance.uiTheme = "theme_default";// create windowWindow window =Window", null);// create some widget to show in windowwindow.mainWidget = (new Button()).text("Hello world"d).textColor(0xFF0000); // red text// show windowwindow.show();// run message loopreturnDDOC generated documentation can be found there: https:// github.com/ buggins/ dlangui/tree/ master/docs For more info see readme and example1 code.I would be glad to see any feedback.Can this project be useful for someone? What features/widgets are must have for you?Best regards,Vadim