diff --git a/.gitignore b/.gitignore
index 863ad45e..a8c992ea 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
Debug
Release
Unittest
+docs
ui.log
obj
*.suo
@@ -8,3 +9,5 @@ Thumbs.db
.dub
bin
*.obj
+*.~*
+*.*~
diff --git a/README.md b/README.md
index 11ad8a62..74379964 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,10 @@ Dlang UI
GUI for D programming language, written in D.
-Alpha stage of development.
+Project page: http://buggins.github.io/dlangui/
+
+Some screenshots: http://buggins.github.io/dlangui/screenshots.html
+
* Crossplatform (Win32 and Linux are supported in current version); can use SDL2 as a backend.
* Mostly inspired by Android UI API (layouts, styles, two phase layout, ...)
@@ -17,7 +20,6 @@ Alpha stage of development.
* Non thread safe
-
Widgets
-------
diff --git a/dlangui-monod-lib.dproj b/dlangui-monod-lib.dproj
index de7587fb..0713c5f1 100644
--- a/dlangui-monod-lib.dproj
+++ b/dlangui-monod-lib.dproj
@@ -45,6 +45,8 @@
USE_OPENGL
+ project.ddoc -c -Dddocs
+ docsbin\Release
@@ -94,5 +96,11 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/all.html b/docs/all.html
deleted file mode 100644
index 30128744..00000000
--- a/docs/all.html
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
- dlangui.all
-
-
dlangui.all
-
-DLANGUI library.
-
-This module is just to simplify import of most useful DLANGUI modules.
-
-
-Synopsis:
-
// helloworld
-import dlangui.all;
-// required in one of modules
-mixin APP_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
- appendPath(exePath, "res/") // when res dir is located at the same directory as executable
- ];
-
- // setup resource directories - will use only existing directories
- drawableCache.setResourcePaths(resourceDirs);
-
- // setup i18n - look for i18n directory inside one of passed directories
- i18n.findTranslationsDir(resourceDirs);
- // select translation file - for english language
- i18n.load("en.ini"); //"ru.ini", "en.ini"
-
- // 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);
- // show window
- window.show();
- // run message loop
- return Platform.instance.enterMessageLoop();
-}
-
-
-
import dlangui.graphics.fonts;
-
-// find suitable font of size 25, normal, preferrable Arial, or, if not available, any SansSerif font
-FontRef font = FontManager.instance.getFont(25, FontWeight.Normal, false, FontFamily.SansSerif, "Arial");
-
-dstring sampleText = "Sample text to draw"d;
-// measure text string width and height (one line)
-Point sz = font.textSize(sampleText);
-// draw red text at center of DrawBuf buf
-font.drawText(buf, buf.width / 2 - sz.x/2, buf.height / 2 - sz.y / 2, sampleText, 0xFF0000);
-
-
Set glyph destroy callback (to cleanup OpenGL caches)
- This callback is used to tell OpenGL glyph cache that glyph is not more used - to let OpenGL glyph cache delete texture if all glyphs in it are no longer used.
-
-Used for resource management. Usually you don't have to call it manually.
-
-
-
uint nextGlyphId();
-
-
ID generator for glyphs
-
-Generates next glyph ID. Unique IDs are being used to control OpenGL glyph cache items lifetime.
-
-
- Used for resource management. Usually you don't have to call it manually.
-
-
-
immutable int MAX_WIDTH_UNSPECIFIED;
-
-
constant for measureText maxWidth paramenter - to tell that all characters of text string should be measured.
-
-
-
abstract class Font: dlangui.core.types.RefCountedObject;
-
-
Instance of font with specific size, weight, face, etc.
-
-Allows to measure text string and draw it on DrawBuf
-
-
- Use FontManager.instance.getFont() to retrieve font instance.
-
-
abstract @property int size();
-
-
returns font size (as requested from font engine)
-
-
-
abstract @property int height();
-
-
returns actual font height including interline space
-
-
-
abstract @property int weight();
-
-
returns font weight
-
-
-
abstract @property int baseline();
-
-
returns baseline offset
-
-
-
abstract @property bool italic();
-
-
returns true if font is italic
-
-
-
abstract @property string face();
-
-
returns font face name
-
-
-
abstract @property FontFamily family();
-
-
returns font family
-
-
-
abstract @property bool isNull();
-
-
returns true if font object is not yet initialized / loaded
-
-
-
@property bool isFixed();
-
-
returns true if font has fixed pitch (all characters have equal width)
-
-
-
@property int spaceWidth();
-
-
returns true if font is fixed
-
-
-
int charWidth(dchar ch);
-
-
returns character width
-
-
-
int measureText(const dchar[] text, ref int[] widths, int maxWidth = MAX_WIDTH_UNSPECIFIED, int tabSize = 4, int tabOffset = 0, uint textFlags = 0);
-
-
Measure text string, return accumulated widths[] (distance to end of n-th character), returns number of measured chars.
-
-Supports Tab character processing and processing of menu item labels like '&File'.
-
-
-Params:
-
dchar[] text
-
text string to measure
-
int[] widths
-
output buffer to put measured widths (widths[i] will be set to cumulative widthstext[0..i])
-
int maxWidth
-
maximum width to measure - measure is stopping if max width is reached (pass MAX_WIDTH_UNSPECIFIED to measure all characters)
-
int tabSize
-
tabulation size, in number of spaces
-
int tabOffset
-
when string is drawn not from left position, use to move tab stops left/right
-
uint textFlags
-
TextFlag bit set - to control underline, hotkey label processing, etc...
-
-Returns:
-number of characters measured (may be less than text.length if maxWidth is reached)
-
-
-
Point textSize(const dchar[] text, int maxWidth = MAX_WIDTH_UNSPECIFIED, int tabSize = 4, int tabOffset = 0, uint textFlags = 0);
-
-
Measure text string as single line, returns width and height
-
-Params:
-
dchar[] text
-
text string to measure
-
int maxWidth
-
maximum width - measure is stopping if max width is reached
-
int tabSize
-
tabulation size, in number of spaces
-
int tabOffset
-
when string is drawn not from left position, use to move tab stops left/right
-
uint textFlags
-
TextFlag bit set - to control underline, hotkey label processing, etc...
-
-
-
-
void drawText(DrawBuf buf, int x, int y, const dchar[] text, uint color, int tabSize = 4, int tabOffset = 0, uint textFlags = 0);
-
-
Draw text string to buffer.
-
-Params:
-
DrawBuf buf
-
graphics buffer to draw text to
-
int x
-
x coordinate to draw first character at
-
int y
-
y coordinate to draw first character at
-
dchar[] text
-
text string to draw
-
uint color
-
color for drawing of glyphs
-
int tabSize
-
tabulation size, in number of spaces
-
int tabOffset
-
when string is drawn not from left position, use to move tab stops left/right
-This module contains internationalization support implementation.
-
-
-Translation files contain of simple key=value pair lines.
-
-
-STRING_RESOURCE_ID=Translation text.
-
-
-Supports fallback to another translation file (e.g. default language).
-
-
-
-
-
-
-Synopsis:
-
import dlangui.core.i18n;
-
-// use global i18n object to get translation for string ID
-dstring translated = i18n.get("STR_FILE_OPEN");
-
-// UIString type can hold either string resource id or dstring raw value.
-UIString text;
-
-// assign resource id as string
-text = "ID_FILE_EXIT";
-// or assign raw value as dstring
-text = "some text"d;
-
-// i18n.get() will automatically be invoked when getting UIString value (e.g. using alias this).
-dstring translated = text;
-
-
-This module contains common layouts implementations.
-
-
-Layouts are similar to the same in Android.
-
-
-LinearLayout - either VerticalLayout or HorizontalLayout.
-VerticalLayout - just LinearLayout with orientation=Orientation.Vertical
-HorizontalLayout - just LinearLayout with orientation=Orientation.Vertical
-FrameLayout - children occupy the same place, usually one one is visible at a time
-TableLayout - children aligned into rows and columns
-
handle menu item click action (parameter is Action)
-
-
-
@property int id();
-
-
item action id, 0 if no action
-
-
-
@property int subitemCount();
-
-
returns count of submenu items
-
-
-
@property int subitemIndex(MenuItem item);
-
-
returns subitem index for item, -1 if item is not direct subitem of this
-
-
-
MenuItem subitem(int index);
-
-
returns submenu item by index
-
-
-
@property MenuItem type(MenuItemType type);
-
-
set new MenuItemType
-
-
-
@property bool checked();
-
-
get check for checkbox or radio button item
-
-
-
protected void checkRadioButton(int index);
-
-
check radio button with specified index, uncheck other radio buttons in group (group consists of sequence of radio button items; other item type - end of group)
-
-
-
@property MenuItem checked(bool flg);
-
-
set check for checkbox or radio button item
-
-
-
dchar getHotkey();
-
-
get hotkey character from label (e.g. 'F' for item labeled "&File"), 0 if no hotkey
-
-
-
int findSubitemByHotkey(dchar ch);
-
-
find subitem by hotkey character, returns subitem index, -1 if not found
-
-
-
MenuItem add(MenuItem subitem);
-
-
adds submenu item
-
-
-
MenuItem add(Action subitemAction);
-
-
adds submenu item from action
-
-
-
@property dstring acceleratorText();
-
-
returns text description for first accelerator of action; null if no accelerators
-
-
-
@property bool isSubmenu();
-
-
returns true if item is submenu (contains subitems)
-
-
-
@property UIString label();
-
-
returns item label
-
-
-
const @property const(Action) action();
-
-
returns item action
-
-
-
@property MenuItem action(Action a);
-
-
sets item action
-
-
-
@property bool enabled();
-
-
menu item Enabled flag
-
-
-
@property MenuItem enabled(bool enabled);
-
-
menu item Enabled flag
-
-
-
Signal!(void, MenuItem) onMenuItem;
-
-
handle menu item click
-
-
-
Signal!(bool, MenuItem) onBeforeOpeningSubmenu;
-
-
prepare for opening of submenu, return true if opening is allowed
-
-
-
-
-
class MenuItemWidget: dlangui.widgets.widget.WidgetGroup;
-
-
widget to draw menu item
-
-
void measure(int parentWidth, int parentHeight);
-
-
Measure widget according to desired width and height constraints. (Step 1 of two phase layout).
-
-
-
void layout(Rect rc);
-
-
Set widget rectangle to specified value and layout widget contents. (Step 2 of two phase layout).
-
-
-
void onDraw(DrawBuf buf);
-
-
Draw widget at its position to buffer
-
-
-
-
-
class MenuWidgetBase: dlangui.widgets.lists.ListWidget;
-
-Args:
-windowCaption = window caption text
- parent = parent Window, or null if no parent
- flags = WindowFlag bit set, combination of Resizable, Modal, Fullscreen
-
-
- Window w/o Resizable nor Fullscreen will be created with size based on measurement of its content widget
-
-
-
abstract void closeWindow(Window w);
-
-
close window
-
-Closes window earlier created with createWindow()
-
-
-
abstract int enterMessageLoop();
-
-
Starts application message loop.
-
-When returned from this method, application is shutting down.
class FrameDrawable: dlangui.graphics.resources.Drawable;
-
-
solid borders (may be of different width) and, optionally, solid inner area
-
-
-
static uint decodeHexColor(string s);
-
-
decode color string #AARRGGBB, e.g. #5599AA
-
-
-
static uint decodeDimension(string s);
-
-
decode size string, e.g. 1px or 2 or 3pt
-
-
-
static Drawable createColorDrawable(string s);
-
-
decode solid color / gradient / frame drawable from string like #AARRGGBB, e.g. #5599AA
-
-
-SolidFillDrawable:
-#AARRGGBB - e.g. #8090A0 or #80ffffff
-
-FrameDrawable:
-#frameColor,frameWidth[,#middleColor]
- or #frameColor,leftBorderWidth,topBorderWidth,rightBorderWidth,bottomBorderWidth[,#middleColor]
- e.g. #000000,2,#C0FFFFFF - black frame of width 2 with 75% transparent white middle
- e.g. #0000FF,2,3,4,5,#FFFFFF - blue frame with left,top,right,bottom borders of width 2,3,4,5 and white inner area
-This module contains definition of signals / listeners.
-
-
-Similar to std.signals.
-
-
-Unlike std.signals, supports any types of delegates, and as well interfaces with single method.
-
-
-Unlike std.signals, can support return types for slots.
-
-
-Caution:
-unlike std.signals, does not disconnect signal from slots belonging to destroyed objects.
-
-
-Listener here stand for holder of single delegate (slot).
-Signal is the same but supports multiple slots.
-
-
-Can be declared either using list of result value and argument types, or by interface name with single method.
-
-
-
-
-Synopsis:
-
import dlangui.core.signals;
-
-interface SomeInterface {
- bool someMethod(string s, int n);
-}
-class Foo : SomeInterface {
- override bool someMethod(string s, int n) {
- writeln("someMethod called ", s, ", ", n);
- return n > 10; // can return value
- }
-}
-
-// Listener! can hold arbitrary number of connected slots
-
-// declare using list of return value and parameter types
-Listener!(bool, string, n) signal1;
-
-Foo f = new Foo();
-// when signal is defined as type list, you can use delegate
-signal1 = bool delegate(string s, int n) { writeln("inside delegate - ", s, n); return false; }
-// or method reference
-signal1 = &f.someMethod;
-
-// declare using interface with single method
-Listener!SomeInterface signal2;
-// you still can use any delegate
-signal2 = bool delegate(string s, int n) { writeln("inside delegate - ", s, n); return false; }
-// but for class method which overrides interface method, you can use simple syntax
-signal2 = f; // it will automatically take &f.someMethod
-
-
-// call listener(s) either by opcall or explicit emit
-signal1("text", 1);
-signal1.emit("text", 2);
-signal2.emit("text", 3);
-
-// check if any slit is connected
-if (signal1.assigned)
- writeln("has listeners");
-
-// Signal! can hold arbitrary number of connected slots
-
-// declare using list of return value and parameter types
-Signal!(bool, string, n) signal3;
-
-// add listeners via connect call
-signal3.connect(bool delegate(string, int) { return false; });
-// or via ~= operator
-signal3 ~= bool delegate(string, int) { return false; };
-
-// declare using interface with single method
-Signal!SomeInterface signal4;
-
-// you can connect several slots to signal
-signal4 ~= f;
-signal4 ~= bool delegate(string, int) { return true; }
-
-// calling of listeners of Signal! is similar to Listener!
-// using opCall
-bool res = signal4("blah", 5);
-// call listeners using emit
-bool res = signal4.emit("blah", 5);
-
-// you can disconnect individual slots
-// using disconnect()
-signal4.disconnect(f);
-// or -= operator
-signal4 -= f;
-
-
appends file path parts with proper delimiters (as well converts delimiters inside path to system) to buffer e.g. appendPath("/home/user", ".myapp", "config") => "/home/user/.myapp/config"
-This module contains declaration of Widget class - base class for all widgets.
-
-
-Widgets are styleable. Use styleId property to set style to use from current Theme.
-
-
-When any of styleable attributes is being overriden, widget's own copy of style is being created to hold modified attributes (defaults to parent style).
-
-
-Two phase layout model (like in Android UI) is used - measure() call is followed by layout() is used to measure and layout widget and its children.abstract
-
-
-Method onDraw will be called to draw widget on some surface. Widget.onDraw() draws widget background (if any).
-
-
-
-
-Synopsis:
-
import dlangui.widgets.widget;
-
-// access attributes as properties
-auto w = new Widget("id1");
-w.backgroundColor = 0xFFFF00;
-w.layoutWidth = FILL_PARENT;
-w.layoutHeight = FILL_PARENT;
-w.padding(Rect(10,10,10,10));
-// same, but using chained method call
-auto w = new Widget("id1").backgroundColor(0xFFFF00).layoutWidth(FILL_PARENT).layoutHeight(FILL_PARENT).padding(Rect(10,10,10,10));
-
-
-
+ $(MODULE_TREE)
+
diff --git a/src/dlangui/all.d b/src/dlangui/all.d
index f1add033..4da25f03 100644
--- a/src/dlangui/all.d
+++ b/src/dlangui/all.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module is just to simplify import of most useful DLANGUI modules.
Synopsis:
@@ -23,12 +21,11 @@ extern (C) int UIAppMain(string[] args) {
];
// setup resource directories - will use only existing directories
- drawableCache.setResourcePaths(resourceDirs);
-
- // setup i18n - look for i18n directory inside one of passed directories
- i18n.findTranslationsDir(resourceDirs);
+ Platform.instance.resourceDirs = resourceDirs;
// select translation file - for english language
- i18n.load("en.ini"); //"ru.ini", "en.ini"
+ 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);
diff --git a/src/dlangui/core/collections.d b/src/dlangui/core/collections.d
index e919f3fb..ee0cc485 100644
--- a/src/dlangui/core/collections.d
+++ b/src/dlangui/core/collections.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module implements array based collection.
Synopsis:
diff --git a/src/dlangui/core/events.d b/src/dlangui/core/events.d
index 1fd5a990..5e9f9eea 100644
--- a/src/dlangui/core/events.d
+++ b/src/dlangui/core/events.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module contains dlangui event types declarations.
diff --git a/src/dlangui/core/i18n.d b/src/dlangui/core/i18n.d
index 134fa23c..79fa11a6 100644
--- a/src/dlangui/core/i18n.d
+++ b/src/dlangui/core/i18n.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module contains internationalization support implementation.
Translation files contain of simple key=value pair lines.
diff --git a/src/dlangui/core/linestream.d b/src/dlangui/core/linestream.d
index a7c7f32a..1e7e0d63 100644
--- a/src/dlangui/core/linestream.d
+++ b/src/dlangui/core/linestream.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module contains text file reader implementation.
Support utf8, utf16, utf32 be and le encodings, and line endings - according to D language source file specification.
diff --git a/src/dlangui/core/logger.d b/src/dlangui/core/logger.d
index 5d728320..9cd91ea1 100644
--- a/src/dlangui/core/logger.d
+++ b/src/dlangui/core/logger.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module contains logger implementation.
diff --git a/src/dlangui/core/signals.d b/src/dlangui/core/signals.d
index 5783d9d1..5dca939b 100644
--- a/src/dlangui/core/signals.d
+++ b/src/dlangui/core/signals.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module contains definition of signals / listeners.
Similar to std.signals.
diff --git a/src/dlangui/core/stdaction.d b/src/dlangui/core/stdaction.d
index 2be04078..0cc005a7 100644
--- a/src/dlangui/core/stdaction.d
+++ b/src/dlangui/core/stdaction.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
Definition of standard actions commonly used in dialogs and controls.
Synopsis:
diff --git a/src/dlangui/core/types.d b/src/dlangui/core/types.d
index f7a167da..7a90cd6c 100644
--- a/src/dlangui/core/types.d
+++ b/src/dlangui/core/types.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module declares basic data types for usage in dlangui library.
Synopsis:
diff --git a/src/dlangui/dialogs/dialog.d b/src/dlangui/dialogs/dialog.d
index 2a6fead8..4908ce86 100644
--- a/src/dlangui/dialogs/dialog.d
+++ b/src/dlangui/dialogs/dialog.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module contains common Dialog implementation.
diff --git a/src/dlangui/dialogs/filedlg.d b/src/dlangui/dialogs/filedlg.d
index 1c1e36fb..813b93e6 100644
--- a/src/dlangui/dialogs/filedlg.d
+++ b/src/dlangui/dialogs/filedlg.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module contains FileDialog implementation.
Can show dialog for open / save.
diff --git a/src/dlangui/graphics/drawbuf.d b/src/dlangui/graphics/drawbuf.d
index 0bd84e5f..cc58b6a6 100644
--- a/src/dlangui/graphics/drawbuf.d
+++ b/src/dlangui/graphics/drawbuf.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module contains drawing buffer implementation.
diff --git a/src/dlangui/graphics/fonts.d b/src/dlangui/graphics/fonts.d
index c2b43c79..c1ed472d 100644
--- a/src/dlangui/graphics/fonts.d
+++ b/src/dlangui/graphics/fonts.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module contains base fonts access interface and common implementation.
Font - base class for fonts.
diff --git a/src/dlangui/graphics/ftfonts.d b/src/dlangui/graphics/ftfonts.d
index fb7878b6..313fe4fd 100644
--- a/src/dlangui/graphics/ftfonts.d
+++ b/src/dlangui/graphics/ftfonts.d
@@ -1,13 +1,8 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This file contains FontManager implementation based on FreeType library.
-
-
-
Copyright: Vadim Lopatin, 2014
License: Boost License 1.0
Authors: Vadim Lopatin, coolreader.org@gmail.com
diff --git a/src/dlangui/graphics/gldrawbuf.d b/src/dlangui/graphics/gldrawbuf.d
index aa2457a6..8ee96b30 100644
--- a/src/dlangui/graphics/gldrawbuf.d
+++ b/src/dlangui/graphics/gldrawbuf.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module contains opengl based drawing buffer implementation.
To enable OpenGL support, build with version(USE_OPENGL);
diff --git a/src/dlangui/graphics/glsupport.d b/src/dlangui/graphics/glsupport.d
index 27f6864a..1ddc1961 100644
--- a/src/dlangui/graphics/glsupport.d
+++ b/src/dlangui/graphics/glsupport.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module contains OpenGL access layer.
To enable OpenGL support, build with version(USE_OPENGL);
diff --git a/src/dlangui/graphics/images.d b/src/dlangui/graphics/images.d
index 2ce3ead1..cdb0c3c2 100644
--- a/src/dlangui/graphics/images.d
+++ b/src/dlangui/graphics/images.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module contains image loading functions.
Currently uses FreeImage.
diff --git a/src/dlangui/graphics/resources.d b/src/dlangui/graphics/resources.d
index b030c289..132cd97d 100644
--- a/src/dlangui/graphics/resources.d
+++ b/src/dlangui/graphics/resources.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module contains resource management and drawables implementation.
imageCache is RAM cache of decoded images (as DrawBuf).
diff --git a/src/dlangui/platforms/common/platform.d b/src/dlangui/platforms/common/platform.d
index 6fd3fb42..c82874ae 100644
--- a/src/dlangui/platforms/common/platform.d
+++ b/src/dlangui/platforms/common/platform.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module contains common Plaform definitions.
Platform is abstraction layer for application.
diff --git a/src/dlangui/platforms/sdl/sdlapp.d b/src/dlangui/platforms/sdl/sdlapp.d
index 76608312..970ae110 100644
--- a/src/dlangui/platforms/sdl/sdlapp.d
+++ b/src/dlangui/platforms/sdl/sdlapp.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module contains implementation of SDL2 based backend for dlang library.
diff --git a/src/dlangui/widgets/controls.d b/src/dlangui/widgets/controls.d
index ac3199bb..93380383 100644
--- a/src/dlangui/widgets/controls.d
+++ b/src/dlangui/widgets/controls.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module contains simple controls widgets implementation.
TextWidget
diff --git a/src/dlangui/widgets/editors.d b/src/dlangui/widgets/editors.d
index 5578f480..3e1bb993 100644
--- a/src/dlangui/widgets/editors.d
+++ b/src/dlangui/widgets/editors.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module contains implementation of editors.
diff --git a/src/dlangui/widgets/layouts.d b/src/dlangui/widgets/layouts.d
index 9447a9f7..9e288347 100644
--- a/src/dlangui/widgets/layouts.d
+++ b/src/dlangui/widgets/layouts.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module contains common layouts implementations.
Layouts are similar to the same in Android.
diff --git a/src/dlangui/widgets/lists.d b/src/dlangui/widgets/lists.d
index a5250aa9..401b557d 100644
--- a/src/dlangui/widgets/lists.d
+++ b/src/dlangui/widgets/lists.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module contains list widgets implementation.
Similar to lists implementation in Android UI API.
diff --git a/src/dlangui/widgets/menu.d b/src/dlangui/widgets/menu.d
index cfc8d334..02526269 100644
--- a/src/dlangui/widgets/menu.d
+++ b/src/dlangui/widgets/menu.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module contains menu widgets implementation.
MenuItem - menu item properties container - to hold hierarchy of menu.
diff --git a/src/dlangui/widgets/popup.d b/src/dlangui/widgets/popup.d
index 46d44b0d..6d874652 100644
--- a/src/dlangui/widgets/popup.d
+++ b/src/dlangui/widgets/popup.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module contains popup widgets implementation.
Popups appear above other widgets inside window.
diff --git a/src/dlangui/widgets/styles.d b/src/dlangui/widgets/styles.d
index 027be2d4..44cab43a 100644
--- a/src/dlangui/widgets/styles.d
+++ b/src/dlangui/widgets/styles.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module contains declaration of themes and styles implementation.
Style - style container
diff --git a/src/dlangui/widgets/tabs.d b/src/dlangui/widgets/tabs.d
index 6fa62bdd..5af2e68e 100644
--- a/src/dlangui/widgets/tabs.d
+++ b/src/dlangui/widgets/tabs.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module contains declaration of tabbed view controls.
TabItemWidget - single tab header in tab control
diff --git a/src/dlangui/widgets/widget.d b/src/dlangui/widgets/widget.d
index 05028209..60d8847f 100644
--- a/src/dlangui/widgets/widget.d
+++ b/src/dlangui/widgets/widget.d
@@ -1,8 +1,6 @@
// Written in the D programming language.
/**
-DLANGUI library.
-
This module contains declaration of Widget class - base class for all widgets.
Widgets are styleable. Use styleId property to set style to use from current Theme.
diff --git a/src/index.d b/src/index.d
new file mode 100644
index 00000000..5da60150
--- /dev/null
+++ b/src/index.d
@@ -0,0 +1,232 @@
+Ddoc
+
+
+Dlang UI
+
+
GUI for D programming language, written in D.
+
+ Alpha stage of development.
+
+
+
Crossplatform (Win32 and Linux are supported in current version); can use SDL2 as a backend.
+
Mostly inspired by Android UI API (layouts, styles, two phase layout, ...)
+
Supports highly customizable UI themes and styles
+
Supports internationalization
+
Hardware acceleration using OpenGL (when built with version USE_OPENGL)
+
Fallback to Win32 API / XCB when OpenGL is not available
+
Actually it's a port (with major refactoring) of GUI library for cross platform OpenGL based implementation of Cool Reader app project from C++.
+
Almost ready for 2D games development
+
Goal: provide set of widgets suitable for building of IDE.
+
Non thread safe
+
+
+
Widgets
+
+
+
Widget - base class for all widgets and widget containers, similar to Android's View
+
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
+
+
Lists are implemented similar to 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
+
TODOs:
+
+
+
Multicolumn lists
+
Tree view
+
+Resources
+
+
Resources like fonts and images use reference counting. For proper resource freeing, always destroy widgets implicitly.
+
+
+
FontManager: provides access to fonts
+
Images: .png or .jpg images; if filename ends with .9.png, it's autodetected as nine-patch image (see Android drawables description)
+
StateDrawables: .xml file can describe list of other drawables to choose based on widget's State (.xml files from android themes can be used directly)
+
imageCache allows to cache unpacked images
+
drawableCache provides access by resource id (string, usually filename w/o extension) to drawables located in specified list of resource directories.
+
+Styles and Themes
+
+
Styles and themes are a bit similar to ones in Android API.
+
+
+
Theme is a container for styles. Can be load from XML theme resource file.
+
Styles are accessible in theme by string ID.
+
Styles can be nested to form hiararchy - when some attribute is missing in style, value from base style will be used.
+
State substyles are supported: allow to change widget appearance dynamically based on its state.
+
Widgets use style attributes directly from assigned style. When some attribute is being changed in widget, it creates its own copy of base style,
+which allows to modify some of attributes, while getting base style attributes if they are not changed in widget. This trick can minimize memory usage for widget attributes when
+standard values are used.
+
+Win32 builds
+
+
+
Under windows, uses SDL2 or Win32 API as backend.
+
Optionally, may use OpenGL acceleration via DerelictGL3/WGL.
+
Uses Win32 API for font rendering.
+
Optinally can use FreeType for font rendering.
+
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: