Re: DlangUI
On Monday, 13 April 2015 at 18:35:59 UTC, Vadim Lopatin wrote: On Monday, 13 April 2015 at 17:51:54 UTC, John Colvin wrote: 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 https://github.com/buggins/dlangui.git 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.createWindow(My Window, null); // create some widget to show in window window.mainWidget = (new Button()).text(Hello worldd).textColor(0xFF); // red text // show window window.show(); // run message loop return Platform.instance.enterMessageLoop(); } DDOC 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 coolreader@gmail.com Is there any way I can debug a unittest build? Start Debugging seems bound to the debug build. Are asking about DlangIDE? There is no debugging here at all. Start Debugging currently just exdecutes
Re: Implementing cent/ucent...
On Monday, 13 April 2015 at 09:00:30 UTC, Dominikus Dittes Scherkl wrote: I once had added cent/ucent to std/traits.d TypeInfo for cent/ucent is now in druntime. std.traits has cent/ucent support. I need to address some comments in std.format before it can be merged. Other modules (e.g. std.conv) still miss support. Regards, Kai
Re: DlangUI
On Monday, 13 April 2015 at 17:51:54 UTC, John Colvin wrote: 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 https://github.com/buggins/dlangui.git 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.createWindow(My Window, null); // create some widget to show in window window.mainWidget = (new Button()).text(Hello worldd).textColor(0xFF); // red text // show window window.show(); // run message loop return Platform.instance.enterMessageLoop(); } DDOC 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 coolreader@gmail.com Is there any way I can debug a unittest build? Start Debugging seems bound to the debug build. Are asking about DlangIDE? There is no debugging here at all. Start Debugging currently just exdecutes `dub run`
Re: Updated D TextMate bundle for D2 and TM2
On Monday, 13 April 2015 at 15:08:47 UTC, Jacob Carlborg wrote: On 2015-04-13 13:39, biozic wrote: Awesome! The only quirk I can see so far is that `xxx yyy(` is always parsed so that yyy is considered to be the symbol of a function, is highlighted as such, and appears in the symbol tree. Is it a limitation of Textmate? No, it's more the order of how rules implemented. I know I had this problem with static assert. The solution I used was to added the rule for static assert before the rule for a method. What particular code is there a problem with? For example: --- version (all) { struct foo { int i; } auto bar() { static if (true) {} static assert(true); return foo(1); } } --- In the body of the bar function, `if`, `assert` and `foo` are parsed as a method definition and appear in the symbol tree. Perhaps I should just move the rule for a method to be the last rule. Not enough I think. Rather, the method rule shouldn't match if the method name is a keyword or if it starts with `return`. This seems to work around these problems: { name = 'meta.definition.method.d'; begin = '(?x)^\s*(?!\breturn\b) ((?:\b(?:public|private|protected|package|static|final|synchronized|abstract|export|override|auto|nothrow|immutable|const|inout|ref|shared)\b\s*)*) # modifier (?:([^\s]+))\s+ # return type ((?!\bif\b)(?!\bassert\b)\w+)\s* # identifier (?=\()'; end = '(?={|;)'; beginCaptures = { 1 = { name = 'storage.modifier.d'; }; 2 = { patterns = ( { include = '$base'; } ); }; 3 = { name = 'entity.name.function.d'; }; }; patterns = ( { include = '$base'; }, { include = '#block'; }, ); }, Also, you forgot the `package` protection keyword (plus optional identifier list) in several places.
cdb reader and creator
here is Cdb[1] reader and creator, in two small modules. reader: [2] creator: [3] sample: [4] it's totally untested, but i believe that is works. at least for the given sample. Public Domain, based on tinycdb[5]. [1] http://cr.yp.to/cdb.html [2] http://repo.or.cz/w/iv.d.git/blob_plain/HEAD:/tinycdb.d [3] http://repo.or.cz/w/iv.d.git/blob_plain/HEAD:/tinycdbmk.d [4] http://repo.or.cz/w/iv.d.git/blob_plain/HEAD:/tinycdb_test/cdbtest.d [5] http://www.corpit.ru/mjt/tinycdb.html signature.asc Description: PGP signature
Re: DlangUI
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 https://github.com/buggins/dlangui.git 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.createWindow(My Window, null); // create some widget to show in window window.mainWidget = (new Button()).text(Hello worldd).textColor(0xFF); // red text // show window window.show(); // run message loop return Platform.instance.enterMessageLoop(); } DDOC 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 coolreader@gmail.com Is there any way I can debug a unittest build? Start Debugging seems bound to the debug build.
Re: Implementing cent/ucent...
On Tuesday, 7 April 2015 at 15:55:24 UTC, Kai Nacke wrote: Hi all! I started to work on cent/ucent support in LDC (and possible in upstream DMD). Here is the current state: Hurray! I missed that. If you like to help: - clone test - Druntime/Phobos should support cent/ucent. I already updated/created some modules but more work is needed here - add support to the DMD backend I once had added cent/ucent to std/traits.d
Re: This week in D #13: =void tip, ddmd, if(arr) warn, dconf registration
On Monday, 13 April 2015 at 03:37:17 UTC, Adam D. Ruppe wrote: http://arsdnet.net/this-week-in-d/apr-12.html http://www.reddit.com/r/d_language/comments/32ek17/this_week_in_d_13_void_tip_ddmd_ifarr_warn_dconf/ https://twitter.com/adamdruppe/status/587459000729473024 The example in the first point of void initialization is wrong: YourStruct s = YourStruct(); With `@disable this()`, this doesn't work either. But this does: YourStruct s = YourStruct.init; About point 3, the following should be added so as not to mislead beginners: This is assignment, not construction! This is an important distinction, because your type's opAssign() and ~this() can then be invoked on an uninitialized object. They need to be aware of that possibility.
Updated D TextMate bundle for D2 and TM2
I would like to announced that I have recently updated the D TextMate bundle to support D2 and TextMate 2. On a high level what's changed: * The language grammar is up to date with D2 (I probably forgot something) * Commands for building/running with RDMD and Dub * Cleanup obsolete snippets and commands * Some minor adjustments to make it compatible with TextMate 2 * Takes advantage of the new gutter marks in TextMate 2 for compiler messages * Completely new internals for the build and run commands * Update snippets to follow Phobos style guides The build/run commands will create links in the output window which points back to the editor for compile errors, warnings and deprecation messages. When running an application it will also do the same thing for any exceptions that are thrown. It will also add these messages as marks in the gutter view. For information about the build/run commands and how to configure the compiler (if needed) see the built-in help command for the bundle (Bundles - D - Help), also present here [1]. I would say that this bundle has a pretty good foundation now but it doesn't contain any advanced/fancy features, like autocompletion with DCD. The bundle is available through TextMate's built-in bundle/package manger (TextMate - Preferences - Bundles). For those who already have the bundle the update should be automatic. [1] https://github.com/textmate/d.tmbundle/blob/master/Support/help.md -- /Jacob Carlborg
Re: Updated D TextMate bundle for D2 and TM2
On Monday, 13 April 2015 at 06:56:16 UTC, Jacob Carlborg wrote: I would like to announced that I have recently updated the D TextMate bundle to support D2 and TextMate 2. On a high level what's changed: * The language grammar is up to date with D2 (I probably forgot something) * Commands for building/running with RDMD and Dub * Cleanup obsolete snippets and commands * Some minor adjustments to make it compatible with TextMate 2 * Takes advantage of the new gutter marks in TextMate 2 for compiler messages * Completely new internals for the build and run commands * Update snippets to follow Phobos style guides [...] I would say that this bundle has a pretty good foundation now but it doesn't contain any advanced/fancy features, like autocompletion with DCD. Awesome! The only quirk I can see so far is that `xxx yyy(` is always parsed so that yyy is considered to be the symbol of a function, is highlighted as such, and appears in the symbol tree. Is it a limitation of Textmate?
Re: DlangUI
Hi Vadim, I just want to say that your work is awesome and very promising. Отличная работа!
Re: Updated D TextMate bundle for D2 and TM2
On 2015-04-13 13:39, biozic wrote: Awesome! The only quirk I can see so far is that `xxx yyy(` is always parsed so that yyy is considered to be the symbol of a function, is highlighted as such, and appears in the symbol tree. Is it a limitation of Textmate? No, it's more the order of how rules implemented. I know I had this problem with static assert. The solution I used was to added the rule for static assert before the rule for a method. What particular code is there a problem with? Perhaps I should just move the rule for a method to be the last rule. -- /Jacob Carlborg