diff --git a/docs/all.html b/docs/all.html
new file mode 100644
index 00000000..30128744
--- /dev/null
+++ b/docs/all.html
@@ -0,0 +1,58 @@
+
+
+ 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();
+}
+
+
+
+
+
+License:
+Boost License 1.0
+
+Authors:
+Vadim Lopatin, coolreader.org@gmail.com
+
+
+
Page generated by Ddoc. Vadim Lopatin, 2014
+
+
diff --git a/docs/collections.html b/docs/collections.html
new file mode 100644
index 00000000..c304dc2c
--- /dev/null
+++ b/docs/collections.html
@@ -0,0 +1,154 @@
+
+
+ dlangui.core.collections
+
+ dlangui.core.collections
+
+DLANGUI library.
+
+This module implements array based collection.
+
+
+Synopsis:
+import dlangui.core.collections;
+
+// add
+Collection!Widget widgets;
+widgets ~= new Widget("id1");
+widgets ~= new Widget("id2");
+Widget w3 = new Widget("id3");
+widgets ~= w3;
+
+// remove by index
+widgets.remove(1);
+
+// foreach
+foreach(w; widgets)
+ writeln("widget: ", w.id);
+
+// remove by value
+widgets -= w3;
+writeln(widgets[0].id);
+
+
+
+
+
+License:
+Boost License 1.0
+
+Authors:
+Vadim Lopatin, coolreader.org@gmail.com
+
+- struct Collection(T, bool ownItems = false);
+
+- array based collection of items
+ retains item order when during add/remove operations
+
+- bool empty();
+
+- returns true if there are no items in collection
+
+
+- size_t length();
+
+- returns number of items in collection
+
+
+- size_t size();
+
+- returns currently allocated capacity (may be more than length)
+
+
+- void size(size_t newSize);
+
+- change capacity (e.g. to reserve big space to avoid multiple reallocations)
+
+
+- void length(size_t newSize);
+
+- returns number of items in collection
+
+
+- T opIndex(size_t index);
+
+- access item by index
+
+
+- void add(T item, size_t index = size_t.max);
+
+- insert new item in specified position
+
+
+- void addAll(ref Collection!(T, ownItems) v);
+
+- add all items from other collection
+
+
+- Collection opOpAssign(string op)(T item);
+
+- support for appending (~=, +=) and removing by value (-=)
+
+
+- size_t indexOf(T item);
+
+- returns index of first occurence of item, size_t.max if not found
+
+
+- T remove(size_t index);
+
+- remove single item, returning removed item
+
+
+- bool removeValue(T value);
+
+- remove single item by value - if present in collection, returning true if item was found and removed
+
+
+- int opApply(int delegate(ref T param) op);
+
+- support of foreach with reference
+
+
+- void clear();
+
+- remove all items
+
+
+- T popFront();
+
+- remove first item
+
+
+- void pushFront(T item);
+
+- insert item at beginning of collection
+
+
+- T popBack();
+
+- remove last item
+
+
+- void pushBack(T item);
+
+- insert item at end of collection
+
+
+- T front();
+
+- peek first item
+
+
+- T back();
+
+- peek last item
+
+
+
+
+
+
+
Page generated by Ddoc. Vadim Lopatin, 2014
+
+
diff --git a/docs/controls.html b/docs/controls.html
new file mode 100644
index 00000000..b6cd4a97
--- /dev/null
+++ b/docs/controls.html
@@ -0,0 +1,215 @@
+
+
+ dlangui.widgets.controls
+
+ dlangui.widgets.controls
+
+DLANGUI library.
+
+This module contains simple controls widgets implementation.
+
+
+TextWidget
+
+
+ImageWidget
+
+
+Button
+
+
+ImageButton
+
+
+ScrollBar
+
+
+
+
+Synopsis:
+import dlangui.widgets.controls;
+
+
+
+
+License:
+Boost License 1.0
+
+Authors:
+Vadim Lopatin, coolreader.org@gmail.com
+
+- class VSpacer: dlangui.widgets.widget.Widget;
+
+- vertical spacer to fill empty space in vertical layouts
+
+
+- class HSpacer: dlangui.widgets.widget.Widget;
+
+- horizontal spacer to fill empty space in horizontal layouts
+
+
+- class TextWidget: dlangui.widgets.widget.Widget;
+
+- static text widget
+
+- @property dstring text();
+
+- get widget text
+
+
+- @property Widget text(dstring s);
+
+- set text to show
+
+
+- @property Widget text(ref UIString s);
+
+- set text to show
+
+
+- @property Widget textResource(string s);
+
+- set text resource ID to show
+
+
+
+
+- class ImageWidget: dlangui.widgets.widget.Widget;
+
+- static image widget
+
+- @property string drawableId();
+
+- get drawable image id
+
+
+- @property ImageWidget drawableId(string id);
+
+- set drawable image id
+
+
+- @property ref DrawableRef drawable();
+
+- get drawable
+
+
+- @property ImageWidget drawable(DrawableRef img);
+
+- set custom drawable (not one from resources)
+
+
+
+
+- class ImageButton: dlangui.widgets.controls.ImageWidget;
+
+- button with image only
+
+
+- class ImageTextButton: dlangui.widgets.layouts.HorizontalLayout;
+
+- button with image and text
+
+
+- class CheckBox: dlangui.widgets.controls.ImageTextButton;
+
+- checkbox
+
+
+- class RadioButton: dlangui.widgets.controls.ImageTextButton;
+
+- radio button
+
+
+- class Button: dlangui.widgets.widget.Widget;
+
+- Text only button
+
+
+- interface OnScrollHandler;
+
+- scroll event handler interface
+
+- abstract bool onScrollEvent(AbstractSlider source, ScrollEvent event);
+
+- handle scroll event
+
+
+
+
+- class AbstractSlider: dlangui.widgets.widget.WidgetGroup;
+
+- base class for widgets like scrollbars and sliders
+
+- Signal!OnScrollHandler onScrollEventListener;
+
+- scroll event listeners
+
+
+- const @property int position();
+
+- returns slider position
+
+
+- @property AbstractSlider position(int newPosition);
+
+- sets new slider position
+
+
+- const @property int minValue();
+
+- returns slider range min value
+
+
+- const @property int maxValue();
+
+- returns slider range max value
+
+
+- const @property int pageSize();
+
+- page size (visible area size)
+
+
+- @property AbstractSlider pageSize(int size);
+
+- set page size (visible area size)
+
+
+- AbstractSlider setRange(int min, int max);
+
+- set new range (min and max values for slider)
+
+
+
+
+- class ScrollBar: dlangui.widgets.controls.AbstractSlider, dlangui.widgets.widget.OnClickHandler;
+
+- scroll bar - either vertical or horizontal
+
+- @property Orientation orientation();
+
+- returns scrollbar orientation (Vertical, Horizontal)
+
+
+- @property ScrollBar orientation(Orientation value);
+
+- sets scrollbar orientation
+
+
+- bool onMouseEvent(MouseEvent event);
+
+- handle mouse wheel events
+
+
+- void onDraw(DrawBuf buf);
+
+- Draw widget at its position to buffer
+
+
+
+
+
+
+
Page generated by Ddoc. Vadim Lopatin, 2014
+
+
diff --git a/docs/drawbuf.html b/docs/drawbuf.html
new file mode 100644
index 00000000..742cca5c
--- /dev/null
+++ b/docs/drawbuf.html
@@ -0,0 +1,223 @@
+
+
+ dlangui.graphics.drawbuf
+
+ dlangui.graphics.drawbuf
+
+DLANGUI library.
+
+This module contains drawing buffer implementation.
+
+
+
+
+Synopsis:
+import dlangui.graphics.drawbuf;
+
+
+
+
+License:
+Boost License 1.0
+
+Authors:
+Vadim Lopatin, coolreader.org@gmail.com
+
+- uint blendARGB(uint dst, uint src, uint alpha);
+
+- blend two RGB pixels using alpha
+
+
+- uint blendAlpha(uint a1, uint a2);
+
+- blend two alpha values 0..255 (255 is fully transparent, 0 is opaque)
+
+
+- ubyte blendGray(ubyte dst, ubyte src, uint alpha);
+
+- blend two RGB pixels using alpha
+
+
+- pure nothrow bool isFullyTransparentColor(uint color);
+
+- returns true if color is #FFxxxxxx (color alpha is 255)
+
+
+- struct NinePatch;
+
+- 9-patch image scaling information (see Android documentation).
+
+
+- Rect frame;
+
+- frame (non-scalable) part size for left, top, right, bottom edges.
+
+
+- Rect padding;
+
+- padding (distance to content area) for left, top, right, bottom edges.
+
+
+
+
+- abstract class DrawBuf: dlangui.core.types.RefCountedObject;
+
+- drawing buffer - image container which allows to perform some drawing operations
+
+- @property uint alpha();
+
+- get current alpha setting (to be applied to all drawing operations)
+
+
+- @property void alpha(uint alpha);
+
+- set new alpha setting (to be applied to all drawing operations)
+
+
+- void addAlpha(uint alpha);
+
+- apply additional transparency to current drawbuf alpha value
+
+
+- uint applyAlpha(uint argb);
+
+- applies current drawbuf alpha to argb color value
+
+
+- @property uint id();
+
+- unique ID of drawbug instance, for using with hardware accelerated rendering for caching
+
+
+- const @property const(NinePatch)* ninePatch();
+
+- get nine patch information pointer, null if this is not a nine patch image buffer
+
+
+- @property void ninePatch(NinePatch* ninePatch);
+
+- set nine patch information pointer, null if this is not a nine patch image buffer
+
+
+- @property bool hasNinePatch();
+
+- check whether there is nine-patch information available for drawing buffer
+
+
+- bool detectNinePatch();
+
+- override to detect nine patch using image 1-pixel border; returns true if 9-patch markup is found in image.
+
+
+- @property int width();
+
+- returns current width
+
+
+- @property int height();
+
+- returns current height
+
+
+- @property ref Rect clipRect();
+
+- returns clipping rectangle, when clipRect.isEmpty == true -- means no clipping.
+
+
+- @property Rect clipOrFullRect();
+
+- returns clipping rectangle, or (0,0,dx,dy) when no clipping.
+
+
+- @property void clipRect(ref const Rect rect);
+
+- sets new clipping rectangle, when clipRect.isEmpty == true -- means no clipping.
+
+
+- @property void intersectClipRect(ref const Rect rect);
+
+- sets new clipping rectangle, when clipRect.isEmpty == true -- means no clipping.
+
+
+- bool applyClipping(ref Rect rc);
+
+- apply clipRect and buffer bounds clipping to rectangle
+
+
+- bool applyClipping(ref Rect rc, ref Rect rc2);
+
+- apply clipRect and buffer bounds clipping to rectangle; if clippinup applied to first rectangle, reduce second rectangle bounds proportionally.
+
+
+- void beforeDrawing();
+
+- reserved for hardware-accelerated drawing - begins drawing batch
+
+
+- void afterDrawing();
+
+- reserved for hardware-accelerated drawing - ends drawing batch
+
+
+- @property int bpp();
+
+- returns buffer bits per pixel
+
+
+- abstract void resize(int width, int height);
+
+- resize buffer
+
+
+- abstract void fill(uint color);
+
+- fill the whole buffer with solid color (no clipping applied)
+
+
+- abstract void fillRect(Rect rc, uint color);
+
+- fill rectangle with solid color (clipping is applied)
+
+
+- abstract void drawGlyph(int x, int y, Glyph* glyph, uint color);
+
+- draw 8bit alpha image - usually font glyph using specified color (clipping is applied)
+
+
+- abstract void drawFragment(int x, int y, DrawBuf src, Rect srcrect);
+
+- draw source buffer rectangle contents to destination buffer
+
+
+- abstract void drawRescaled(Rect dstrect, DrawBuf src, Rect srcrect);
+
+- draw source buffer rectangle contents to destination buffer rectangle applying rescaling
+
+
+- void drawImage(int x, int y, DrawBuf src);
+
+- draw unscaled image at specified coordinates
+
+
+- void drawFrame(Rect rc, uint frameColor, Rect frameSideWidths, uint innerAreaColor = 4294967295u);
+
+- draws rectangle frame of specified color and widths (per side), and optinally fills inner area
+
+
+- DrawBuf transformColors(ref ColorTransform transform);
+
+- create drawbuf with copy of current buffer with changed colors (returns this if not supported)
+
+
+
+
+- struct ClipRectSaver;
+
+- RAII setting/restoring of clip rectangle
+
+
+
+
+
Page generated by Ddoc. Vadim Lopatin, 2014
+
+
diff --git a/docs/editors.html b/docs/editors.html
new file mode 100644
index 00000000..b9dd1714
--- /dev/null
+++ b/docs/editors.html
@@ -0,0 +1,752 @@
+
+
+ dlangui.widgets.editors
+
+ dlangui.widgets.editors
+
+DLANGUI library.
+
+This module contains implementation of editors.
+
+
+
+
+EditLine - single line editor.
+
+
+EditBox - multiline editor
+
+
+
+
+Synopsis:
+import dlangui.widgets.editors;
+
+
+
+
+License:
+Boost License 1.0
+
+Authors:
+Vadim Lopatin, coolreader.org@gmail.com
+
+- enum EditorActions: int;
+
+- Editor action codes
+
+- Left
+- move cursor one char left
+
+
+- SelectLeft
+- move cursor one char left with selection
+
+
+- Right
+- move cursor one char right
+
+
+- SelectRight
+- move cursor one char right with selection
+
+
+- Up
+- move cursor one line up
+
+
+- SelectUp
+- move cursor one line up with selection
+
+
+- Down
+- move cursor one line down
+
+
+- SelectDown
+- move cursor one line down with selection
+
+
+- WordLeft
+- move cursor one word left
+
+
+- SelectWordLeft
+- move cursor one word left with selection
+
+
+- WordRight
+- move cursor one word right
+
+
+- SelectWordRight
+- move cursor one word right with selection
+
+
+- PageUp
+- move cursor one page up
+
+
+- SelectPageUp
+- move cursor one page up with selection
+
+
+- PageDown
+- move cursor one page down
+
+
+- SelectPageDown
+- move cursor one page down with selection
+
+
+- PageBegin
+- move cursor to the beginning of page
+
+
+- SelectPageBegin
+- move cursor to the beginning of page with selection
+
+
+- PageEnd
+- move cursor to the end of page
+
+
+- SelectPageEnd
+- move cursor to the end of page with selection
+
+
+- LineBegin
+- move cursor to the beginning of line
+
+
+- SelectLineBegin
+- move cursor to the beginning of line with selection
+
+
+- LineEnd
+- move cursor to the end of line
+
+
+- SelectLineEnd
+- move cursor to the end of line with selection
+
+
+- DocumentBegin
+- move cursor to the beginning of document
+
+
+- SelectDocumentBegin
+- move cursor to the beginning of document with selection
+
+
+- DocumentEnd
+- move cursor to the end of document
+
+
+- SelectDocumentEnd
+- move cursor to the end of document with selection
+
+
+- DelPrevChar
+- delete char before cursor (backspace)
+
+
+- DelNextChar
+- delete char after cursor (del key)
+
+
+- DelPrevWord
+- delete word before cursor (ctrl + backspace)
+
+
+- DelNextWord
+- delete char after cursor (ctrl + del key)
+
+
+- InsertNewLine
+- insert new line (Enter)
+
+
+- PrependNewLine
+- insert new line after current position (Ctrl+Enter)
+
+
+- ToggleReplaceMode
+- Turn On/Off replace mode
+
+
+- Copy
+- Copy selection to clipboard
+
+
+- Cut
+- Cut selection to clipboard
+
+
+- Paste
+- Paste selection from clipboard
+
+
+- Undo
+- Undo last change
+
+
+- Redo
+- Redo last undoed change
+
+
+- Tab
+- Tab (e.g., Tab key to insert tab character or indent text)
+
+
+- BackTab
+- Tab (unindent text, or remove whitespace before cursor, usually Shift+Tab)
+
+
+- SelectAll
+- Select whole content (usually, Ctrl+A)
+
+
+- ScrollLineUp
+- Scroll one line up (not changing cursor)
+
+
+- ScrollLineDown
+- Scroll one line down (not changing cursor)
+
+
+- ScrollPageUp
+- Scroll one page up (not changing cursor)
+
+
+- ScrollPageDown
+- Scroll one page down (not changing cursor)
+
+
+- ScrollLeft
+- Scroll window left
+
+
+- ScrollRight
+- Scroll window right
+
+
+- ZoomIn
+- Zoom in editor font
+
+
+- ZoomOut
+- Zoom out editor font
+
+
+
+
+- dstring[] splitDString(dstring source, dchar delimiter = EOL);
+
+- split dstring by delimiters
+
+
+- dstring concatDStrings(dstring[] lines, dstring delimiter = SYSTEM_DEFAULT_EOL);
+
+- concat strings from array using delimiter
+
+
+- dstring replaceEolsWithSpaces(dstring source);
+
+- replace end of lines with spaces
+
+
+- struct TextPosition;
+
+- text content position
+
+- int line;
+
+- line number, zero based
+
+
+- int pos;
+
+- character position in line (0 == before first character)
+
+
+- const int opCmp(ref const TextPosition v);
+
+- compares two positions
+
+
+
+
+- struct TextRange;
+
+- text content range
+
+- const @property bool empty();
+
+- returns true if range is empty
+
+
+- const @property bool singleLine();
+
+- returns true if start and end located at the same line
+
+
+- const @property int lines();
+
+- returns count of lines in range
+
+
+
+
+- enum EditAction: int;
+
+- action performed with editable contents
+
+- Replace
+- insert content into specified position (range.start)
+ delete content in range
+ replace range content with new content
+
+
+
+
+- class EditOperation;
+
+- edit operation details for EditableContent
+
+- @property EditAction action();
+
+- action performed
+
+
+- @property ref TextRange range();
+
+- source range to replace with new content
+
+
+- @property ref TextRange newRange();
+
+- new range after operation applied
+
+
+- protected dstring[] _content;
+
+- new content for range (if required for this action)
+
+
+- protected dstring[] _oldContent;
+
+- old content for range
+
+
+- bool merge(EditOperation op);
+
+- try to merge two operations (simple entering of characters in the same line), return true if succeded
+
+
+
+
+- class UndoBuffer;
+
+- Undo/Redo buffer
+
+- @property bool hasUndo();
+
+- returns true if buffer contains any undo items
+
+
+- @property bool hasRedo();
+
+- returns true if buffer contains any redo items
+
+
+- void saveForUndo(EditOperation op);
+
+- adds undo operation
+
+
+- EditOperation undo();
+
+- returns operation to be undone (put it to redo), null if no undo ops available
+
+
+- EditOperation redo();
+
+- returns operation to be redone (put it to undo), null if no undo ops available
+
+
+- void clear();
+
+- clears both undo and redo buffers
+
+
+
+
+- interface EditableContentListener;
+
+- Editable Content change listener
+
+
+- class EditableContent;
+
+- editable plain text (singleline/multiline)
+
+- Signal!EditableContentListener contentChangeListeners;
+
+- listeners for edit operations
+
+
+- @property bool multiline();
+
+- returns true if miltyline content is supported
+
+
+- @property dstring text();
+
+- returns all lines concatenated delimited by '\n'
+
+
+- @property EditableContent text(dstring newContent);
+
+- replace whole text with another content
+
+
+- @property int length();
+
+- returns line text
+
+
+- dstring line(int index);
+
+- returns line text by index, "" if index is out of bounds
+
+
+- TextPosition lineEnd(int lineIndex);
+
+- returns text position for end of line lineIndex
+
+
+- TextPosition firstNonSpace(int lineIndex);
+
+- returns position before first non-space character of line, returns 0 position if no non-space chars
+
+
+- TextPosition lastNonSpace(int lineIndex);
+
+- returns position after last non-space character of line, returns 0 position if no non-space chars on line
+
+
+- int lineLength(int lineIndex);
+
+- returns text position for end of line lineIndex
+
+
+- int maxLineLength();
+
+- returns maximum length of line
+
+
+- dstring[] rangeText(TextRange range);
+
+- return text for specified range
+
+
+- void correctPosition(ref TextPosition position);
+
+- when position is out of content bounds, fix it to nearest valid position
+
+
+- void correctRange(ref TextRange range);
+
+- when range positions is out of content bounds, fix it to nearest valid position
+
+
+- protected void removeLines(int start, int removedCount);
+
+- removes removedCount lines starting from start
+
+
+- protected void insertLines(int start, int count);
+
+- inserts count empty lines at specified position
+
+
+- protected void replaceRange(TextRange before, TextRange after, dstring[] newContent);
+
+- inserts or removes lines, removes text in range
+
+
+- TextPosition moveByWord(TextPosition p, int direction, bool camelCasePartsAsWords);
+
+- change text position to nearest word bound (direction < 0 - back, > 0 - forward)
+
+
+- bool performOperation(EditOperation op, Object source);
+
+- edit content
+
+
+- @property bool hasUndo();
+
+- return true if there is at least one operation in undo buffer
+
+
+- @property bool hasRedo();
+
+- return true if there is at least one operation in redo buffer
+
+
+- bool undo();
+
+- undoes last change
+
+
+- bool redo();
+
+- redoes last undone change
+
+
+- void clearUndo();
+
+- clear undo/redp history
+
+
+
+
+- abstract class EditWidgetBase: dlangui.widgets.widget.WidgetGroup, dlangui.widgets.editors.EditableContentListener, dlangui.widgets.menu.MenuItemActionHandler;
+
+- base for all editor widgets
+
+- bool onMenuItemAction(const Action action);
+
+
+
+- bool canShowPopupMenu(int x, int y);
+
+- returns true if widget can show popup (e.g. by mouse right click at point x,y)
+
+
+- bool isActionEnabled(const Action action);
+
+- override to change popup menu items state
+
+
+- void showPopupMenu(int x, int y);
+
+- shows popup at (x,y)
+
+
+- uint getCursorType(int x, int y);
+
+- returns mouse cursor type for widget
+
+
+- @property bool wantTabs();
+
+- when true, Tab / Shift+Tab presses are processed internally in widget (e.g. insert tab character) instead of focus change navigation.
+
+
+- @property EditWidgetBase wantTabs(bool wantTabs);
+
+- sets tab size (in number of spaces)
+
+
+- @property bool readOnly();
+
+- readonly flag (when true, user cannot change content of editor)
+
+
+- @property EditWidgetBase readOnly(bool readOnly);
+
+- sets readonly flag
+
+
+- @property bool replaceMode();
+
+- replace mode flag (when true, entered character replaces character under cursor)
+
+
+- @property EditWidgetBase replaceMode(bool replaceMode);
+
+- sets replace mode flag
+
+
+- @property bool useSpacesForTabs();
+
+- when true, spaces will be inserted instead of tabs
+
+
+- @property EditWidgetBase useSpacesForTabs(bool useSpacesForTabs);
+
+- set new Tab key behavior flag: when true, spaces will be inserted instead of tabs
+
+
+- @property int tabSize();
+
+- returns tab size (in number of spaces)
+
+
+- @property EditWidgetBase tabSize(int newTabSize);
+
+- sets tab size (in number of spaces)
+
+
+- @property EditableContent content();
+
+- editor content object
+
+
+- protected bool _ownContent;
+
+- when ownContent is false, content should not be destroyed in editor destructor
+
+
+- @property EditWidgetBase content(EditableContent content);
+
+- set content object
+
+
+- @property dstring text();
+
+- get widget text
+
+
+- @property Widget text(dstring s);
+
+- set text
+
+
+- @property Widget text(ref UIString s);
+
+- set text
+
+
+- protected Rect caretRect();
+
+- returns cursor rectangle
+
+
+- protected void drawCaret(DrawBuf buf);
+
+- draws caret
+
+
+- protected void updateScrollbars();
+
+- override to update scrollbars - if necessary
+
+
+- protected void correctCaretPos();
+
+- when cursor position or selection is out of content bounds, fix it to nearest valid position
+
+
+- protected dstring spacesForTab(int currentPos);
+
+- generate string of spaces, to reach next tab position
+
+
+- protected bool wholeLinesSelected();
+
+- returns true if one or more lines selected fully
+
+
+- protected dstring indentLine(dstring src, bool back);
+
+- change line indent
+
+
+- protected void indentRange(bool back);
+
+- indent / unindent range
+
+
+- protected Action findKeyAction(uint keyCode, uint flags);
+
+- map key to action
+
+
+- bool onKeyEvent(KeyEvent event);
+
+- handle keys
+
+
+- bool onMouseEvent(MouseEvent event);
+
+- process mouse event; return true if event is processed by widget.
+
+
+
+
+- class EditLine: dlangui.widgets.editors.EditWidgetBase;
+
+- single line editor
+
+- void measure(int parentWidth, int parentHeight);
+
+- measure
+
+
+- bool onKeyEvent(KeyEvent event);
+
+- handle keys
+
+
+- bool onMouseEvent(MouseEvent event);
+
+- process mouse event; return true if event is processed by widget.
+
+
+- void layout(Rect rc);
+
+- Set widget rectangle to specified value and layout widget contents. (Step 2 of two phase layout).
+
+
+- protected void drawLineBackground(DrawBuf buf, Rect lineRect, Rect visibleRect);
+
+- override to custom highlight of line background
+
+
+- void onDraw(DrawBuf buf);
+
+- draw content
+
+
+
+
+- class EditBox: dlangui.widgets.editors.EditWidgetBase, dlangui.widgets.controls.OnScrollHandler;
+
+- single line editor
+
+- bool onScrollEvent(AbstractSlider source, ScrollEvent event);
+
+- handle scroll event
+
+
+- void measure(int parentWidth, int parentHeight);
+
+- measure
+
+
+- void layout(Rect rc);
+
+- Set widget rectangle to specified value and layout widget contents. (Step 2 of two phase layout).
+
+
+- protected void drawLineBackground(DrawBuf buf, int lineIndex, Rect lineRect, Rect visibleRect);
+
+- override to custom highlight of line background
+
+
+- void onDraw(DrawBuf buf);
+
+- draw content
+
+
+
+
+
+
+
Page generated by Ddoc. Vadim Lopatin, 2014
+
+
diff --git a/docs/events.html b/docs/events.html
new file mode 100644
index 00000000..4e34a858
--- /dev/null
+++ b/docs/events.html
@@ -0,0 +1,154 @@
+
+
+ dlangui.core.events
+
+ dlangui.core.events
+
+DLANGUI library.
+
+This module contains dlangui event types declarations.
+
+
+
+
+Synopsis:
+import dlangui.core.events;
+
+
+
+
+License:
+Boost License 1.0
+
+Authors:
+Vadim Lopatin, coolreader.org@gmail.com
+
+- class Action;
+
+- UI action
+
+- this(int id, uint keyCode, uint keyFlags = 0);
+
+- action with accelerator, w/o label
+
+
+- this(int id, dstring label, string iconResourceId = null, uint keyCode = 0, uint keyFlags = 0);
+
+- action with label, icon, and accelerator
+
+
+- @property Accelerator[] accelerators();
+
+- returs array of accelerators
+
+
+- @property dstring acceleratorText();
+
+- returns text description for first accelerator of action; null if no accelerators
+
+
+- bool checkAccelerator(uint keyCode, uint keyFlags);
+
+- returns true if accelerator matches provided key code and flags
+
+
+
+
+- struct ButtonDetails;
+
+- mouse button state details
+
+- long _downTs;
+
+- Clock.currStdTime() for down event of this button (0 if button is up).
+
+
+- long _upTs;
+
+- Clock.currStdTime() for up event of this button (0 if button is still down).
+
+
+- short _downX;
+
+- x coordinates of down event
+
+
+- short _downY;
+
+- y coordinates of down event
+
+
+- ushort _downFlags;
+
+- mouse button flags when down event occured
+
+
+- void down(short x, short y, ushort flags);
+
+- update for button down
+
+
+- void up(short x, short y, ushort flags);
+
+- update for button up
+
+
+- @property int downDuration();
+
+- returns button down state duration in hnsecs (1/10000 of second).
+
+
+
+
+- class KeyEvent;
+
+- keyboard event
+
+- @property KeyAction action();
+
+- key action (KeyDown, KeyUp, Text, Repeat)
+
+
+- @property uint keyCode();
+
+- key code
+
+
+- @property uint flags();
+
+- flags (shift, ctrl, alt...)
+
+
+- @property dstring text();
+
+- entered text, for Text action
+
+
+- this(KeyAction action, uint keyCode, uint flags, dstring text = null);
+
+- create key event
+
+
+
+
+- class ScrollEvent;
+
+- slider/scrollbar event
+
+- @property void position(int newPosition);
+
+- change position in event handler to update slider position
+
+
+- int defaultUpdatePosition();
+
+- default update position for actions like PageUp/PageDown, LineUp/LineDown
+
+
+
+
+
+
+
Page generated by Ddoc. Vadim Lopatin, 2014
+
+
diff --git a/docs/fonts.html b/docs/fonts.html
new file mode 100644
index 00000000..507d4b9f
--- /dev/null
+++ b/docs/fonts.html
@@ -0,0 +1,364 @@
+
+
+ dlangui.graphics.fonts
+
+ dlangui.graphics.fonts
+
+DLANGUI library.
+
+This module contains base fonts access interface and common implementation.
+
+
+Font - base class for fonts.
+
+
+FontManager - base class for font managers - provides access to available fonts.
+
+
+
+
+Actual implementation is:
+
+
+dlangui.graphics.ftfonts - FreeType based font manager.
+
+
+dlangui.platforms.windows.w32fonts - Win32 API based font manager.
+
+
+
+
+To enable OpenGL support, build with version(USE_OPENGL);
+
+
+See Also:
+dlangui.graphics.drawbuf, DrawBuf, drawbuf, drawbuf.html
+
+
+
+
+
+
+Synopsis:
+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);
+
+
+
+
+License:
+Boost License 1.0
+
+Authors:
+Vadim Lopatin, coolreader.org@gmail.com
+
+- enum FontFamily: ubyte;
+
+- font families enum
+
+- Unspecified
+- Unknown / not set / does not matter
+
+
+- SansSerif
+- Sans Serif font, e.g. Arial
+
+
+- Serif
+- Serif font, e.g. Times New Roman
+
+
+- Fantasy
+- Fantasy font
+
+
+- Cursive
+- Cursive font
+
+
+- MonoSpace
+- Monospace font (fixed pitch font), e.g. Courier New
+
+
+
+
+- enum FontWeight: int;
+
+- font weight constants (0..1000)
+
+- Normal
+- normal font weight
+
+
+- Bold
+- bold font
+
+
+
+
+- @property void function(uint id) glyphDestroyCallback();
+
+- get glyph destroy callback (to cleanup OpenGL caches)
+
+Used for resource management. Usually you don't have to call it manually.
+
+
+- @property void glyphDestroyCallback(void function(uint id) callback);
+
+- 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 widths text[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 |
+uint textFlags |
+set of TextFlag bit fields |
+
+
+
+- abstract Glyph* getCharGlyph(dchar ch, bool withImage = true);
+
+- get character glyph information
+
+
+- abstract void checkpoint();
+
+- clear usage flags for all entries
+
+
+- abstract void cleanup();
+
+- removes entries not used after last call of checkpoint() or cleanup()
+
+
+
+
+- struct FontList;
+
+- font instance collection - utility class, for font manager implementations
+
+
+- abstract class FontManager;
+
+- Access points to fonts.
+
+- static @property void instance(FontManager manager);
+
+- sets new font manager singleton instance
+
+
+- static @property FontManager instance();
+
+- returns font manager singleton instance
+
+
+- abstract ref FontRef getFont(int size, int weight, bool italic, FontFamily family, string face);
+
+- get font instance best matched specified parameters
+
+
+- abstract void checkpoint();
+
+- clear usage flags for all entries -- for cleanup of unused fonts
+
+
+- abstract void cleanup();
+
+- removes entries not used after last call of checkpoint() or cleanup()
+
+
+
+
+- struct GlyphCache;
+
+- Glyph image cache
+
+Recently used glyphs are marked with glyph.lastUsage = 1
+
+
+ checkpoint() call clears usage marks
+
+
+ cleanup() removes all items not accessed since last checkpoint()
+
+- Glyph* find(dchar ch);
+
+- try to find glyph for character in cache, returns null if not found
+
+
+- Glyph* put(dchar ch, Glyph* glyph);
+
+- put character glyph to cache
+
+
+- void cleanup();
+
+- removes entries not used after last call of checkpoint() or cleanup()
+
+
+- void checkpoint();
+
+- clear usage flags for all entries
+
+
+- void clear();
+
+- removes all entries (when built with USE_OPENGL version, notify OpenGL cache about removed glyphs)
+
+
+
+
+
+
+
Page generated by Ddoc. Vadim Lopatin, 2014
+
+
diff --git a/docs/ftfonts.html b/docs/ftfonts.html
new file mode 100644
index 00000000..968e5e21
--- /dev/null
+++ b/docs/ftfonts.html
@@ -0,0 +1,90 @@
+
+
+ dlangui.graphics.ftfonts
+
+ dlangui.graphics.ftfonts
+
+DLANGUI library.
+
+This file contains FontManager implementation based on FreeType library.
+
+
+
+
+
+
+
+
+License:
+Boost License 1.0
+
+Authors:
+Vadim Lopatin, coolreader.org@gmail.com
+
+- class FreeTypeFont: dlangui.graphics.fonts.Font;
+
+- Font implementation based on Win32 API system fonts.
+
+- this(FontFileItem item, int size);
+
+- need to call create() after construction to initialize font
+
+
+- void clear();
+
+- cleanup resources
+
+
+- bool findGlyph(dchar code, dchar def_char, ref FT_UInt index, ref FreeTypeFontFile file);
+
+- find glyph index for character
+
+
+- bool create();
+
+- load font files
+
+
+- void checkpoint();
+
+- clear usage flags for all entries
+
+
+- void cleanup();
+
+- removes entries not used after last call of checkpoint() or cleanup()
+
+
+
+
+- class FreeTypeFontManager: dlangui.graphics.fonts.FontManager;
+
+- FreeType based font manager.
+
+- ref FontRef getFont(int size, int weight, bool italic, FontFamily family, string face);
+
+- get font instance with specified parameters
+
+
+- void checkpoint();
+
+- clear usage flags for all entries
+
+
+- void cleanup();
+
+- removes entries not used after last call of checkpoint() or cleanup()
+
+
+- bool registerFont(string filename, FontFamily family = FontFamily.SansSerif, string face = null, bool italic = false, int weight = 0);
+
+- register freetype font by filename - optinally font properties can be passed if known (e.g. from libfontconfig).
+
+
+
+
+
+
+
Page generated by Ddoc. Vadim Lopatin, 2014
+
+
diff --git a/docs/gldrawbuf.html b/docs/gldrawbuf.html
new file mode 100644
index 00000000..eafa8fbe
--- /dev/null
+++ b/docs/gldrawbuf.html
@@ -0,0 +1,133 @@
+
+
+ dlangui.graphics.gldrawbuf
+
+ dlangui.graphics.gldrawbuf
+
+DLANGUI library.
+
+This module contains opengl based drawing buffer implementation.
+
+
+To enable OpenGL support, build with version(USE_OPENGL);
+
+
+Synopsis:
+import dlangui.graphics.gldrawbuf;
+
+
+
+
+License:
+Boost License 1.0
+
+Authors:
+Vadim Lopatin, coolreader.org@gmail.com
+
+- class GLDrawBuf: dlangui.graphics.drawbuf.DrawBuf;
+
+- drawing buffer - image container which allows to perform some drawing operations
+
+- @property Scene scene();
+
+- get current scene (exists only between beforeDrawing() and afterDrawing() calls)
+
+
+- @property int width();
+
+- returns current width
+
+
+- @property int height();
+
+- returns current height
+
+
+- void beforeDrawing();
+
+- reserved for hardware-accelerated drawing - begins drawing batch
+
+
+- void afterDrawing();
+
+- reserved for hardware-accelerated drawing - ends drawing batch
+
+
+- void resize(int width, int height);
+
+- resize buffer
+
+
+- void fill(uint color);
+
+- fill the whole buffer with solid color (no clipping applied)
+
+
+- void fillRect(Rect rc, uint color);
+
+- fill rectangle with solid color (clipping is applied)
+
+
+- void drawGlyph(int x, int y, Glyph* glyph, uint color);
+
+- draw 8bit alpha image - usually font glyph using specified color (clipping is applied)
+
+
+- void drawFragment(int x, int y, DrawBuf src, Rect srcrect);
+
+- draw source buffer rectangle contents to destination buffer
+
+
+- void drawRescaled(Rect dstrect, DrawBuf src, Rect srcrect);
+
+- draw source buffer rectangle contents to destination buffer rectangle applying rescaling
+
+
+- void clear();
+
+- cleanup resources
+
+
+
+
+- abstract class SceneItem;
+
+- base class for all drawing scene items.
+
+
+- class Scene;
+
+- Drawing scene (operations sheduled for drawing)
+
+- void add(SceneItem item);
+
+- add new scene item to scene
+
+
+- void draw();
+
+- draws all scene items and removes them from list
+
+
+- void reset();
+
+- resets scene for new drawing - deletes all items
+
+
+
+
+- void onObjectDestroyedCallback(uint pobject);
+
+- object deletion listener callback function type
+
+
+- void onGlyphDestroyedCallback(uint pobject);
+
+- object deletion listener callback function type
+
+
+
+
+
Page generated by Ddoc. Vadim Lopatin, 2014
+
+
diff --git a/docs/glsupport.html b/docs/glsupport.html
new file mode 100644
index 00000000..a6257d3f
--- /dev/null
+++ b/docs/glsupport.html
@@ -0,0 +1,51 @@
+
+
+ dlangui.graphics.glsupport
+
+ dlangui.graphics.glsupport
+
+DLANGUI library.
+
+This module contains OpenGL access layer.
+
+
+To enable OpenGL support, build with version(USE_OPENGL);
+
+
+Synopsis:
+import dlangui.graphics.glsupport;
+
+
+
+
+License:
+Boost License 1.0
+
+Authors:
+Vadim Lopatin, coolreader.org@gmail.com
+
+- uint genTexture();
+
+- generate new texture ID
+
+
+- void deleteTexture(ref uint textureId);
+
+- delete OpenGL texture
+
+
+- void flushGL();
+
+- call glFlush
+
+
+- bool createFramebuffer(ref uint textureId, ref uint framebufferId, int dx, int dy);
+
+- returns texture ID for buffer, 0 if failed
+
+
+
+
+
Page generated by Ddoc. Vadim Lopatin, 2014
+
+
diff --git a/docs/i18n.html b/docs/i18n.html
new file mode 100644
index 00000000..02712a80
--- /dev/null
+++ b/docs/i18n.html
@@ -0,0 +1,122 @@
+
+
+ dlangui.core.i18n
+
+ dlangui.core.i18n
+
+DLANGUI library.
+
+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;
+
+
+
+
+License:
+Boost License 1.0
+
+Authors:
+Vadim Lopatin, coolreader.org@gmail.com
+
+- struct UIString;
+
+- container for UI string - either raw value or string resource ID
+
+- this(string id);
+
+- create string with i18n resource id
+
+
+- this(dstring value);
+
+- create string with raw value
+
+
+- const @property dstring value();
+
+- get value (either raw or translated by id)
+
+
+- @property void value(dstring newValue);
+
+- set raw value
+
+
+- ref UIString opAssign(dstring rawValue);
+
+- assign raw value
+
+
+- ref UIString opAssign(string ID);
+
+- assign ID
+
+
+
+
+- class UIStringList;
+
+- UI string translator
+
+- void clear();
+
+- remove all items
+
+
+- void set(string id, dstring value);
+
+- set item value
+
+
+- const dstring get(string id);
+
+- get item value, null if translation is not found for id
+
+
+- bool load(std.stream.InputStream stream);
+
+- load strings from stream
+
+
+- bool load(string filename);
+
+- load strings from file (utf8, id=value lines)
+
+
+
+
+
+
+
Page generated by Ddoc. Vadim Lopatin, 2014
+
+
diff --git a/docs/images.html b/docs/images.html
new file mode 100644
index 00000000..e0f28ea3
--- /dev/null
+++ b/docs/images.html
@@ -0,0 +1,44 @@
+
+
+ dlangui.graphics.images
+
+ dlangui.graphics.images
+
+DLANGUI library.
+
+This module contains image loading functions.
+
+
+Currently uses FreeImage.
+
+
+Usage of libpng is not feasible under linux due to conflicts of library and binding versions.
+
+
+Synopsis:
+import dlangui.graphics.images;
+
+
+
+
+License:
+Boost License 1.0
+
+Authors:
+Vadim Lopatin, coolreader.org@gmail.com
+
+- ColorDrawBuf loadImage(string filename);
+
+- load and decode image from file to ColorDrawBuf, returns null if loading or decoding is failed
+
+
+- ColorDrawBuf loadImage(InputStream stream);
+
+- load and decode image from stream to ColorDrawBuf, returns null if loading or decoding is failed
+
+
+
+
+
Page generated by Ddoc. Vadim Lopatin, 2014
+
+
diff --git a/docs/layouts.html b/docs/layouts.html
new file mode 100644
index 00000000..4353db1d
--- /dev/null
+++ b/docs/layouts.html
@@ -0,0 +1,124 @@
+
+
+ dlangui.widgets.layouts
+
+ dlangui.widgets.layouts
+
+DLANGUI library.
+
+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
+
+
+
+
+Synopsis:
+import dlangui.widgets.layouts;
+
+
+
+
+License:
+Boost License 1.0
+
+Authors:
+Vadim Lopatin, coolreader.org@gmail.com
+
+- struct LayoutItem;
+
+- helper for layouts
+
+- void set(Widget widget, Orientation orientation);
+
+- sets item for widget
+
+
+- void measure(int parentWidth, int parentHeight);
+
+- set item and measure it
+
+
+
+
+- class LayoutItems;
+
+- helper class for layouts
+
+- Point measure(int parentWidth, int parentHeight);
+
+- fill widget layout list with Visible or Invisible items, measure them
+
+
+- void setWidgets(ref WidgetList widgets);
+
+- fill widget layout list with Visible or Invisible items, measure them
+
+
+
+
+- class FrameLayout: dlangui.widgets.widget.WidgetGroup;
+
+- place all children into same place (usually, only one child should be visible at a time)
+
+- 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
+
+
+- bool showChild(string ID, Visibility otherChildrenVisibility = Visibility.Invisible, bool updateFocus = false);
+
+- make one of children (with specified ID) visible, for the rest, set visibility to otherChildrenVisibility
+
+
+
+
+- class TableLayout: dlangui.widgets.widget.WidgetGroup;
+
+- layout children as table with rows and columns
+
+- @property int colCount();
+
+- number of columns
+
+
+- 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
+
+
+
+
+
+
+
Page generated by Ddoc. Vadim Lopatin, 2014
+
+
diff --git a/docs/linestream.html b/docs/linestream.html
new file mode 100644
index 00000000..20a1b035
--- /dev/null
+++ b/docs/linestream.html
@@ -0,0 +1,62 @@
+
+
+ dlangui.core.linestream
+
+ dlangui.core.linestream
+
+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.
+
+
+Low resource consuming. Doesn't flood with GC allocations. Dup line if you want to store it somewhere.
+
+
+Tracks line number.
+
+
+
+
+Synopsis:
+import dlangui.core.linestream;
+
+import std.stdio;
+import std.conv;
+import std.utf;
+string fname = "somefile.d";
+writeln("opening file");
+std.stream.File f = new std.stream.File(fname);
+scope(exit) { f.close(); }
+try {
+ LineStream lines = LineStream.create(f, fname);
+ for (;;) {
+ dchar[] s = lines.readLine();
+ if (s is null)
+ break;
+ writeln("line " ~ to!string(lines.line()) ~ ":" ~ toUTF8(s));
+ }
+ if (lines.errorCode != 0) {
+ writeln("Error ", lines.errorCode, " ", lines.errorMessage, " -- at line ", lines.errorLine, " position ", lines.errorPos);
+ } else {
+ writeln("EOF reached");
+ }
+} catch (Exception e) {
+ writeln("Exception " ~ e.toString);
+}
+
+
+
+
+License:
+Boost License 1.0
+
+Authors:
+Vadim Lopatin, coolreader.org@gmail.com
+
+
+
Page generated by Ddoc. Vadim Lopatin, 2014
+
+
diff --git a/docs/lists.html b/docs/lists.html
new file mode 100644
index 00000000..14ba22cd
--- /dev/null
+++ b/docs/lists.html
@@ -0,0 +1,279 @@
+
+
+ dlangui.widgets.lists
+
+ dlangui.widgets.lists
+
+DLANGUI library.
+
+This module contains list widgets implementation.
+
+
+Similar to lists implementation in Android UI API.
+
+
+Synopsis:
+import dlangui.widgets.lists;
+
+
+
+
+License:
+Boost License 1.0
+
+Authors:
+Vadim Lopatin, coolreader.org@gmail.com
+
+- interface ListAdapter;
+
+- list widget adapter provides items for list widgets
+
+- abstract @property int itemCount();
+
+- returns number of widgets in list
+
+
+- abstract Widget itemWidget(int index);
+
+- return list item widget by item index
+
+
+- abstract uint itemState(int index);
+
+- return list item's state flags
+
+
+- abstract uint setItemState(int index, uint flags);
+
+- set one or more list item's state flags, returns updated state
+
+
+- abstract uint resetItemState(int index, uint flags);
+
+- reset one or more list item's state flags, returns updated state
+
+
+
+
+- class WidgetListAdapter: dlangui.widgets.lists.ListAdapter;
+
+- List adapter for simple list of widget instances
+
+- @property ref WidgetList widgets();
+
+- list of widgets to display
+
+
+- @property int itemCount();
+
+- returns number of widgets in list
+
+
+- Widget itemWidget(int index);
+
+- return list item widget by item index
+
+
+- uint itemState(int index);
+
+- return list item's state flags
+
+
+- uint setItemState(int index, uint flags);
+
+- set one or more list item's state flags, returns updated state
+
+
+- uint resetItemState(int index, uint flags);
+
+- reset one or more list item's state flags, returns updated state
+
+
+
+
+- class ListWidget: dlangui.widgets.widget.WidgetGroup, dlangui.widgets.controls.OnScrollHandler;
+
+- List
+
+- @property Orientation orientation();
+
+- returns linear layout orientation (Vertical, Horizontal)
+
+
+- @property ListWidget orientation(Orientation value);
+
+- sets linear layout orientation
+
+
+- protected int _firstVisibleItem;
+
+- first visible item index
+
+
+- protected int _scrollPosition;
+
+- scroll position - offset of scroll area
+
+
+- protected int _maxScrollPosition;
+
+- maximum scroll position
+
+
+- protected Rect _clientRc;
+
+- client area rectangle (counting padding, margins, and scrollbar)
+
+
+- protected int _totalSize;
+
+- total height of all items for Vertical orientation, or width for Horizontal
+
+
+- protected int _hoverItemIndex;
+
+- item with Hover state, -1 if no such item
+
+
+- protected int _selectedItemIndex;
+
+- item with Selected state, -1 if no such item
+
+
+- protected bool _selectOnHover;
+
+- when true, mouse hover selects underlying item
+
+
+- @property bool selectOnHover();
+
+- when true, mouse hover selects underlying item
+
+
+- @property ListWidget selectOnHover(bool select);
+
+- when true, mouse hover selects underlying item
+
+
+- protected bool _clickOnButtonDown;
+
+- if true, generate itemClicked on mouse down instead mouse up event
+
+
+- Rect itemRectNoScroll(int index);
+
+- returns rectangle for item (not scrolled, first item starts at 0,0)
+
+
+- Rect itemRect(int index);
+
+- returns rectangle for item (scrolled)
+
+
+- int itemByPosition(int pos);
+
+- returns item index by 0-based offset from top/left of list content
+
+
+- protected bool _ownAdapter;
+
+- when true, need to destroy adapter on list destroy
+
+
+- @property ListAdapter adapter();
+
+- get adapter
+
+
+- @property ListWidget adapter(ListAdapter adapter);
+
+- set adapter
+
+
+- @property ListWidget ownAdapter(ListAdapter adapter);
+
+- set adapter, which will be owned by list (destroy will be called for adapter on widget destroy)
+
+
+- @property int itemCount();
+
+- returns number of widgets in list
+
+
+- Widget itemWidget(int index);
+
+- return list item widget by item index
+
+
+- bool itemEnabled(int index);
+
+- returns true if item with corresponding index is enabled
+
+
+- protected void selectionChanged(int index, int previouslySelectedItem = -1);
+
+- override to handle change of selection
+
+
+- protected void itemClicked(int index);
+
+- override to handle mouse up on item
+
+
+- protected void handleFocusChange(bool focused);
+
+- override to handle focus changes
+
+
+- void makeSelectionVisible();
+
+- ensure selected item is visible (scroll if necessary)
+
+
+- void makeItemVisible(int itemIndex);
+
+- ensure item is visible
+
+
+- bool moveSelection(int direction, bool wrapAround = true);
+
+- move selection
+
+
+- bool onScrollEvent(AbstractSlider source, ScrollEvent event);
+
+- handle scroll event
+
+
+- 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
+
+
+- bool onKeyEvent(KeyEvent event);
+
+- list navigation using keys
+
+
+- bool onMouseEvent(MouseEvent event);
+
+- process mouse event; return true if event is processed by widget.
+
+
+
+
+
+
+
Page generated by Ddoc. Vadim Lopatin, 2014
+
+
diff --git a/docs/logger.html b/docs/logger.html
new file mode 100644
index 00000000..94a37ead
--- /dev/null
+++ b/docs/logger.html
@@ -0,0 +1,40 @@
+
+
+ dlangui.core.logger
+
+ dlangui.core.logger
+
+DLANGUI library.
+
+This module contains logger implementation.
+
+
+
+
+
+
+Synopsis:
+import dlangui.core.logger;
+
+// use stderror for logging
+setStderrLogger();
+// set log level
+setLogLevel(LogLeve.Debug);
+// log debug message
+Log.d("mouse clicked at ", x, ",", y);
+// log error message
+Log.d("exception while reading file", e);
+
+
+
+
+License:
+Boost License 1.0
+
+Authors:
+Vadim Lopatin, coolreader.org@gmail.com
+
+
+
Page generated by Ddoc. Vadim Lopatin, 2014
+
+
diff --git a/docs/menu.html b/docs/menu.html
new file mode 100644
index 00000000..4827b73e
--- /dev/null
+++ b/docs/menu.html
@@ -0,0 +1,232 @@
+
+
+ dlangui.widgets.menu
+
+ dlangui.widgets.menu
+
+DLANGUI library.
+
+This module contains menu widgets implementation.
+
+
+MenuItem - menu item properties container - to hold hierarchy of menu.
+MainMenu - main menu widget
+PopupMenu - popup menu widget
+
+
+Synopsis:
+import dlangui.widgets.popup;
+
+
+
+
+License:
+Boost License 1.0
+
+Authors:
+Vadim Lopatin, coolreader.org@gmail.com
+
+- class MenuItem;
+
+- menu item properties
+
+- @property int id();
+
+- item action id, 0 if no action
+
+
+- @property int subitemCount();
+
+- returns count of submenu items
+
+
+- MenuItem subitem(int index);
+
+- returns submenu item by index
+
+
+- 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;
+
+- base class for menus
+
+- Signal!MenuItemClickHandler onMenuItemClickListener;
+
+- menu item click listener
+
+
+- Signal!MenuItemActionHandler onMenuItemActionListener;
+
+- menu item action listener
+
+
+- void measure(int parentWidth, int parentHeight);
+
+- Measure widget according to desired width and height constraints. (Step 1 of two phase layout).
+
+
+- protected void selectionChanged(int index, int previouslySelectedItem = -1);
+
+- override to handle change of selection
+
+
+- protected void itemClicked(int index);
+
+- override to handle mouse up on item
+
+
+- @property PopupWidget thisPopup();
+
+- returns popup this menu is located in
+
+
+- bool onKeyEvent(KeyEvent event);
+
+- list navigation using keys
+
+
+
+
+- class MainMenu: dlangui.widgets.menu.MenuWidgetBase;
+
+- main menu (horizontal)
+
+- @property bool wantsKeyTracking();
+
+- override and return true to track key events even when not focused
+
+
+- @property uint textFlags();
+
+- get text flags (bit set of TextFlag enum values)
+
+
+- @property bool activated();
+
+- return true if main menu is activated (focused or has open submenu)
+
+
+- void activate();
+
+- bring focus to main menu, if not yet activated
+
+
+- void deactivate(bool force = false);
+
+- close and remove focus, if activated
+
+
+- bool toggle();
+
+- activate or deactivate main menu, return true if it has been activated
+
+
+- protected void handleFocusChange(bool focused);
+
+- override to handle focus changes
+
+
+- bool onKeyEvent(KeyEvent event);
+
+- list navigation using keys
+
+
+
+
+- class PopupMenu: dlangui.widgets.menu.MenuWidgetBase;
+
+- popup menu widget (vertical layout of items)
+
+
+
+
+
Page generated by Ddoc. Vadim Lopatin, 2014
+
+
diff --git a/docs/platform.html b/docs/platform.html
new file mode 100644
index 00000000..b7630d0c
--- /dev/null
+++ b/docs/platform.html
@@ -0,0 +1,52 @@
+
+
+ dlangui.platforms.common.platform
+
+ dlangui.platforms.common.platform
+
+DLANGUI library.
+
+This module contains common Plaform definitions.
+
+
+Platform is abstraction layer for application.
+
+
+
+
+Synopsis:
+import dlangui.platforms.common.platform;
+
+
+
+
+License:
+Boost License 1.0
+
+Authors:
+Vadim Lopatin, coolreader.org@gmail.com
+
+- @property Platform platform();
+
+- get current platform object instance
+
+
+- @property bool openglEnabled();
+
+- check if hardware acceleration is enabled
+
+
+- void setOpenglEnabled();
+
+- call on app initialization if OpenGL support is detected
+
+
+- template APP_ENTRY_POINT()
+- put "mixin APP_ENTRY_POINT;" to main module of your dlangui based app
+
+
+
+
+
Page generated by Ddoc. Vadim Lopatin, 2014
+
+
diff --git a/docs/popup.html b/docs/popup.html
new file mode 100644
index 00000000..de697f9b
--- /dev/null
+++ b/docs/popup.html
@@ -0,0 +1,132 @@
+
+
+ dlangui.widgets.popup
+
+ dlangui.widgets.popup
+
+DLANGUI library.
+
+This module contains popup widgets implementation.
+
+
+Popups appear above other widgets inside window.
+
+
+Useful for popup menus, notification popups, etc.
+
+
+Synopsis:
+import dlangui.widgets.popup;
+
+
+
+
+License:
+Boost License 1.0
+
+Authors:
+Vadim Lopatin, coolreader.org@gmail.com
+
+- enum PopupAlign: uint;
+
+- popup alignment option flags
+
+- Center
+- center popup around anchor widget center
+
+
+- Below
+- place popup below anchor widget close to lower bound
+
+
+- Right
+- place popup below anchor widget close to right bound (when no space enough, align near left bound)
+
+
+- Point
+- align to specified point
+
+
+
+
+- enum PopupFlags: uint;
+
+- popup behavior flags - for PopupWidget.flags property
+
+- CloseOnClickOutside
+- close popup when mouse button clicked outside of its bounds
+
+
+
+
+- class PopupWidget: dlangui.widgets.layouts.LinearLayout;
+
+- popup widget container
+
+- @property void delegate(PopupWidget popup) onPopupCloseListener();
+
+- popup close listener (called right before closing)
+
+
+- @property PopupWidget onPopupCloseListener(void delegate(PopupWidget popup) listener);
+
+- set popup close listener (to call right before closing)
+
+
+- @property uint flags();
+
+- returns popup behavior flags (combination of PopupFlags)
+
+
+- @property PopupWidget flags(uint flags);
+
+- set popup behavior flags (combination of PopupFlags)
+
+
+- @property ref PopupAnchor anchor();
+
+- access to popup anchor
+
+
+- bool modal();
+
+- returns true if popup is modal
+
+
+- PopupWidget modal(bool modal);
+
+- set modality flag
+
+
+- void measure(int parentWidth, int parentHeight);
+
+- Measure widget according to desired width and height constraints. (Step 1 of two phase layout).
+
+
+- void close();
+
+- close and destroy popup
+
+
+- void onClose();
+
+- just call on close listener
+
+
+- void layout(Rect rc);
+
+- Set widget rectangle to specified value and layout widget contents. (Step 2 of two phase layout).
+
+
+- bool onMouseEventOutside(MouseEvent event);
+
+- called for mouse activity outside shown popup bounds
+
+
+
+
+
+
+
Page generated by Ddoc. Vadim Lopatin, 2014
+
+
diff --git a/docs/resources.html b/docs/resources.html
new file mode 100644
index 00000000..614fb3ba
--- /dev/null
+++ b/docs/resources.html
@@ -0,0 +1,127 @@
+
+
+ dlangui.graphics.resources
+
+ dlangui.graphics.resources
+
+DLANGUI library.
+
+This module contains resource management and drawables implementation.
+
+
+imageCache is RAM cache of decoded images (as DrawBuf).
+
+
+drawableCache is cache of Drawables.
+
+
+Supports nine-patch PNG images in .9.png files (like in Android).
+
+
+Supports state drawables using XML files similar to ones in Android.
+
+
+Synopsis:
+import dlangui.graphics.resources;
+
+
+
+
+License:
+Boost License 1.0
+
+Authors:
+Vadim Lopatin, coolreader.org@gmail.com
+
+- 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
+
+
+- void extractStateFlags(ref string[string] attr, ref uint stateMask, ref uint stateValue);
+
+- converts XML attribute name to State (see http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList)
+
+
+- class StateDrawable: dlangui.graphics.resources.Drawable;
+
+- Drawable which is drawn depending on state (see http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList)
+
+- bool parseList4(T)(string value, ref T[4] items);
+
+- parse 4 comma delimited integers
+
+
+- bool load(string filename);
+
+- load from XML file
+
+
+
+
+- class ImageCache;
+
+- decoded raster images cache (png, jpeg) -- access by filenames
+
+- ref DrawBufRef get(string filename);
+
+- get and cache image
+
+
+- ref DrawBufRef get(string filename, ref ColorTransform transform);
+
+- get and cache color transformed image
+
+
+
+
+- @property ImageCache imageCache();
+
+- image cache singleton
+
+
+- @property void imageCache(ImageCache cache);
+
+- image cache singleton
+
+
+- @property DrawableCache drawableCache();
+
+- drawable cache singleton
+
+
+- @property void drawableCache(DrawableCache cache);
+
+- drawable cache singleton
+
+
+
+
+
Page generated by Ddoc. Vadim Lopatin, 2014
+
+
diff --git a/docs/sdlapp.html b/docs/sdlapp.html
new file mode 100644
index 00000000..bf41162a
--- /dev/null
+++ b/docs/sdlapp.html
@@ -0,0 +1,29 @@
+
+
+ src.dlangui.platforms.sdl.sdlapp
+
+ src.dlangui.platforms.sdl.sdlapp
+
+DLANGUI library.
+
+This module contains implementation of SDL2 based backend for dlang library.
+
+
+
+
+Synopsis:
+import dlangui.platforms.sdl.sdlapp;
+
+
+
+
+License:
+Boost License 1.0
+
+Authors:
+Vadim Lopatin, coolreader.org@gmail.com
+
+
+
Page generated by Ddoc. Vadim Lopatin, 2014
+
+
diff --git a/docs/signals.html b/docs/signals.html
new file mode 100644
index 00000000..ae2118b8
--- /dev/null
+++ b/docs/signals.html
@@ -0,0 +1,236 @@
+
+
+ dlangui.core.signals
+
+ dlangui.core.signals
+
+DLANGUI library.
+
+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;
+
+
+
+
+License:
+Boost License 1.0
+
+Authors:
+Vadim Lopatin, coolreader.org@gmail.com
+
+- struct Listener(T1) if (is(T1 == interface) && __traits(allMembers, T1).length == 1);
+
+- Single listener; parameter is interface with single method
+
+- bool assigned();
+
+- returns true if listener is assigned
+
+
+- void opAssign(slot_t listenerDelegate);
+
+- assign delegate
+
+
+- void opAssign(T1 listenerObject);
+
+- assign object implementing interface
+
+
+
+
+- struct Listener(RETURN_T, T1...);
+
+- Single listener; implicitly specified return and parameter types
+
+- bool assigned();
+
+- returns true if listener is assigned
+
+
+
+
+- struct Signal(T1) if (is(T1 == interface) && __traits(allMembers, T1).length == 1);
+
+- Multiple listeners; implicitly specified return and parameter types
+
+- bool assigned();
+
+- returns true if listener is assigned
+
+
+- void opAssign(slot_t listener);
+
+- replace all previously assigned listeners with new one (if null passed, remove all listeners)
+
+
+- void opAssign(T1 listener);
+
+- replace all previously assigned listeners with new one (if null passed, remove all listeners)
+
+
+- return_t opCall(params_t params);
+
+- call all listeners; for signals having non-void return type, stop iterating when first return value is nonzero
+
+
+- return_t emit(params_t params);
+
+- call all listeners; for signals having non-void return type, stop iterating when first return value is nonzero
+
+
+- void connect(slot_t listener);
+
+- add listener
+
+
+- void disconnect(slot_t listener);
+
+- remove listener
+
+
+- void connect(T1 listener);
+
+- add listener - as interface member
+
+
+- void disconnect(T1 listener);
+
+- add listener - as interface member
+
+
+
+
+- struct Signal(RETURN_T, T1...);
+
+- Multiple listeners; implicitly specified return and parameter types
+
+- bool assigned();
+
+- returns true if listener is assigned
+
+
+- void opAssign(slot_t listener);
+
+- replace all previously assigned listeners with new one (if null passed, remove all listeners)
+
+
+- RETURN_T opCall(T1 params);
+
+- call all listeners; for signals having non-void return type, stop iterating when first return value is nonzero
+
+
+- RETURN_T emit(T1 params);
+
+- call all listeners; for signals having non-void return type, stop iterating when first return value is nonzero
+
+
+- void connect(slot_t listener);
+
+- add listener
+
+
+- void disconnect(slot_t listener);
+
+- remove listener
+
+
+
+
+
+
+
Page generated by Ddoc. Vadim Lopatin, 2014
+
+
diff --git a/docs/styles.html b/docs/styles.html
new file mode 100644
index 00000000..d1c923cd
--- /dev/null
+++ b/docs/styles.html
@@ -0,0 +1,420 @@
+
+
+ dlangui.widgets.styles
+
+ dlangui.widgets.styles
+
+DLANGUI library.
+
+This module contains declaration of themes and styles implementation.
+
+
+Style - style container
+Theme - parent for all styles
+
+
+
+
+Synopsis:
+import dlangui.widgets.styles;
+
+
+
+
+License:
+Boost License 1.0
+
+Authors:
+Vadim Lopatin, coolreader.org@gmail.com
+
+- immutable uint COLOR_TRANSPARENT;
+
+- transparent color constant
+
+
+- immutable ushort FONT_SIZE_UNSPECIFIED;
+
+- unspecified font size constant - to take parent style property value
+
+
+- immutable ushort FONT_WEIGHT_UNSPECIFIED;
+
+- unspecified font weight constant - to take parent style property value
+
+
+- immutable ubyte FONT_STYLE_UNSPECIFIED;
+
+- unspecified font style constant - to take parent style property value
+
+
+- immutable ubyte FONT_STYLE_NORMAL;
+
+- normal font style constant
+
+
+- immutable ubyte FONT_STYLE_ITALIC;
+
+- italic font style constant
+
+
+- immutable int SIZE_UNSPECIFIED;
+
+- use as widget.layout() param to avoid applying of parent size
+
+
+- immutable uint TEXT_FLAGS_UNSPECIFIED;
+
+- use text flags from parent style
+
+
+- immutable uint TEXT_FLAGS_USE_PARENT;
+
+- use text flags from parent widget
+
+
+- immutable int FILL_PARENT;
+
+- layout option, to occupy all available place
+
+
+- immutable int WRAP_CONTENT;
+
+- layout option, for size based on content
+
+
+- immutable int WEIGHT_UNSPECIFIED;
+
+- to take layout weight from parent
+
+
+- enum Align: ubyte;
+
+- Align option bit constants
+
+- Unspecified
+- alignment is not specified
+
+
+- Left
+- horizontally align to the left of box
+
+
+- Right
+- horizontally align to the right of box
+
+
+- HCenter
+- horizontally align to the center of box
+
+
+- Top
+- vertically align to the top of box
+
+
+- Bottom
+- vertically align to the bottom of box
+
+
+- VCenter
+- vertically align to the center of box
+
+
+- Center
+- align to the center of box (VCenter | HCenter)
+
+
+- TopLeft
+- align to the top left corner of box (Left | Top)
+
+
+
+
+- enum TextFlag: uint;
+
+- text drawing flag bits
+
+- HotKeys
+- text contains hot key prefixed with & char (e.g. "&File")
+
+
+- UnderlineHotKeys
+- underline hot key when drawing
+
+
+- UnderlineHotKeysWhenAltPressed
+- underline hot key when drawing
+
+
+- Underline
+- underline text when drawing
+
+
+
+
+- class DrawableAttribute;
+
+- custom drawable attribute container for styles
+
+
+- class Style;
+
+- style properties
+
+- const @property const(Style) parentStyle();
+
+- access to parent style for this style
+
+
+- @property Style parentStyle();
+
+- access to parent style for this style
+
+
+- @property ref DrawableRef customDrawable(string id);
+
+- get custom drawable attribute
+
+
+- const @property string customDrawableId(string id);
+
+- get custom drawable attribute
+
+
+- Style setCustomDrawable(string id, string resourceId);
+
+- sets custom drawable attribute for style
+
+
+- const @property FontFamily fontFamily();
+
+- font size
+
+
+- const @property string fontFace();
+
+- font size
+
+
+- const @property bool fontItalic();
+
+- font style - italic
+
+
+- const @property ushort fontWeight();
+
+- font weight
+
+
+- const @property ushort fontSize();
+
+- font size
+
+
+- const @property ref const(Rect) padding();
+
+- padding
+
+
+- const @property ref const(Rect) margins();
+
+- margins
+
+
+- const @property uint alpha();
+
+- alpha (0=opaque .. 255=transparent)
+
+
+- const @property uint textColor();
+
+- text color
+
+
+- const @property uint textFlags();
+
+- text flags
+
+
+- const @property uint backgroundColor();
+
+- background color
+
+
+- const @property string backgroundImageId();
+
+- font size
+
+
+- const @property uint minWidth();
+
+- minimal width constraint, 0 if limit is not set
+
+
+- const @property uint maxWidth();
+
+- max width constraint, returns SIZE_UNSPECIFIED if limit is not set
+
+
+- const @property uint minHeight();
+
+- minimal height constraint, 0 if limit is not set
+
+
+- const @property uint maxHeight();
+
+- max height constraint, SIZE_UNSPECIFIED if limit is not set
+
+
+- @property Style minWidth(int value);
+
+- set min width constraint
+
+
+- @property Style maxWidth(int value);
+
+- set max width constraint
+
+
+- @property Style minHeight(int value);
+
+- set min height constraint
+
+
+- @property Style maxHeight(int value);
+
+- set max height constraint
+
+
+- const @property uint layoutWidth();
+
+- layout width parameter
+
+
+- const @property uint layoutHeight();
+
+- layout height parameter
+
+
+- const @property uint layoutWeight();
+
+- layout weight parameter
+
+
+- @property Style layoutHeight(int value);
+
+- set layout height
+
+
+- @property Style layoutWidth(int value);
+
+- set layout width
+
+
+- @property Style layoutWeight(int value);
+
+- set layout weight
+
+
+- const @property ubyte alignment();
+
+- get full alignment (both vertical and horizontal)
+
+
+- const @property ubyte valign();
+
+- vertical alignment: Top / VCenter / Bottom
+
+
+- const @property ubyte halign();
+
+- horizontal alignment: Left / HCenter / Right
+
+
+- @property Style alignment(ubyte value);
+
+- set alignment
+
+
+- Style createSubstyle(string id);
+
+- create named substyle of this style
+
+
+- Style createState(uint stateMask = 0, uint stateValue = 0);
+
+- create state substyle for this style
+
+
+- const const(Style) forState(uint state);
+
+- find substyle based on widget state (e.g. focused, pressed, ...)
+
+
+
+
+- class Theme: dlangui.widgets.styles.Style;
+
+- Theme - root for style hierarhy.
+
+- Style modifyStyle(string id);
+
+- create wrapper style which will have currentTheme.get(id) as parent instead of fixed parent - to modify some base style properties in widget
+
+
+- const @property string backgroundImageId();
+
+- font size
+
+
+- const @property uint minWidth();
+
+- minimal width constraint, 0 if limit is not set
+
+
+- const @property uint maxWidth();
+
+- max width constraint, returns SIZE_UNSPECIFIED if limit is not set
+
+
+- const @property uint minHeight();
+
+- minimal height constraint, 0 if limit is not set
+
+
+- const @property uint maxHeight();
+
+- max height constraint, SIZE_UNSPECIFIED if limit is not set
+
+
+- Style createSubstyle(string id);
+
+- create new named style
+
+
+- @property Style get(string id);
+
+- find style by id, returns theme if not style with specified ID is not found
+
+
+- const const(Style) forState(uint state);
+
+- find substyle based on widget state (e.g. focused, pressed, ...)
+
+
+
+
+- @property Theme currentTheme();
+
+- current theme accessor
+
+
+- @property void currentTheme(Theme theme);
+
+- set new current theme
+
+
+
+
+
Page generated by Ddoc. Vadim Lopatin, 2014
+
+
diff --git a/docs/tabs.html b/docs/tabs.html
new file mode 100644
index 00000000..80150402
--- /dev/null
+++ b/docs/tabs.html
@@ -0,0 +1,205 @@
+
+
+ dlangui.widgets.tabs
+
+ dlangui.widgets.tabs
+
+DLANGUI library.
+
+This module contains declaration of tabbed view controls.
+
+
+TabItemWidget - single tab header in tab control
+TabWidget
+TabHost
+TabControl
+
+
+
+
+Synopsis:
+import dlangui.widgets.tabs;
+
+
+
+
+License:
+Boost License 1.0
+
+Authors:
+Vadim Lopatin, coolreader.org@gmail.com
+
+- class TabItem;
+
+- tab item metadata
+
+
+- class TabItemWidget: dlangui.widgets.layouts.HorizontalLayout;
+
+- tab item widget - to show tab header
+
+
+- class TabItemList;
+
+- tab item list helper class
+
+- TabItem get(int index);
+
+- get item by index
+
+
+- TabItem get(string id);
+
+- get item by id
+
+
+- TabItemList add(TabItem item);
+
+- append new item
+
+
+- TabItemList insert(TabItem item, int index);
+
+- insert new item to specified position
+
+
+- TabItem remove(int index);
+
+- remove item by index
+
+
+- int indexById(string id);
+
+- find tab index by id
+
+
+
+
+- class TabControl: dlangui.widgets.widget.WidgetGroup;
+
+- tab header - tab labels, with optional More button
+
+- const @property int tabCount();
+
+- returns tab count
+
+
+- TabItem tab(int index);
+
+- returns tab item by id (null if index out of range)
+
+
+- TabItem tab(string id);
+
+- returns tab item by id (null if not found)
+
+
+- int tabIndex(string id);
+
+- get tab index by tab id (-1 if not found)
+
+
+- TabControl removeTab(string id);
+
+- remove tab
+
+
+- TabControl addTab(TabItem item, int index = -1, bool enableCloseButton = false);
+
+- add new tab
+
+
+- TabControl addTab(string id, dstring label, string iconId = null, bool enableCloseButton = false);
+
+- add new tab by id and label string
+
+
+- TabControl addTab(string id, string labelResourceId, string iconId = null, bool enableCloseButton = false);
+
+- add new tab by id and label string resource id
+
+
+- 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 TabHost: dlangui.widgets.layouts.FrameLayout, dlangui.widgets.tabs.TabHandler;
+
+- container for widgets controlled by TabControl
+
+- @property TabControl tabControl();
+
+- get currently set control widget
+
+
+- @property TabHost tabControl(TabControl newWidget);
+
+- set new control widget
+
+
+- TabHost removeTab(string id);
+
+- remove tab
+
+
+- TabHost addTab(Widget widget, dstring label, string iconId = null, bool enableCloseButton = false);
+
+- add new tab by id and label string
+
+
+- TabHost addTab(Widget widget, string labelResourceId, string iconId = null, bool enableCloseButton = false);
+
+- add new tab by id and label string resource id
+
+
+- void selectTab(string ID);
+
+- select tab
+
+
+
+
+- class TabWidget: dlangui.widgets.layouts.VerticalLayout, dlangui.widgets.tabs.TabHandler;
+
+- compound widget - contains from TabControl widget (tabs header) and TabHost (content pages)
+
+- TabWidget addTab(Widget widget, string labelResourceId, string iconId = null, bool enableCloseButton = false);
+
+- add new tab by id and label string resource id
+
+
+- TabWidget addTab(Widget widget, dstring label, string iconId = null, bool enableCloseButton = false);
+
+- add new tab by id and label (raw value)
+
+
+- TabWidget removeTab(string id);
+
+- remove tab by id
+
+
+- void selectTab(string ID);
+
+- select tab
+
+
+
+
+
+
+
Page generated by Ddoc. Vadim Lopatin, 2014
+
+
diff --git a/docs/types.html b/docs/types.html
new file mode 100644
index 00000000..e0038109
--- /dev/null
+++ b/docs/types.html
@@ -0,0 +1,147 @@
+
+
+ dlangui.core.types
+
+ dlangui.core.types
+
+DLANGUI library.
+
+This module declares basic data types for usage in dlangui library.
+
+
+Synopsis:
+import dlangui.core.types;
+
+// points
+Point p(5, 10);
+
+// rectangles
+Rect r(5, 13, 120, 200);
+writeln(r);
+
+// reference counted objects, useful for RAII / resource management.
+class Foo : RefCountedObject {
+ int[] resource;
+ ~this() {
+ writeln("freeing Foo resources");
+ }
+}
+{
+ Ref!Foo ref1;
+ {
+ Ref!Foo fooRef = new RefCountedObject();
+ ref1 = fooRef;
+ }
+ // RAII: will destroy object when no more references
+}
+
+
+
+
+License:
+Boost License 1.0
+
+Authors:
+Vadim Lopatin, coolreader.org@gmail.com
+
+- struct Glyph;
+
+- character glyph
+
+- uint id;
+
+- < 0: unique id of glyph (for drawing in hardware accelerated scenes)
+
+
+- ubyte blackBoxX;
+
+- < 4: width of glyph black box
+
+
+- ubyte blackBoxY;
+
+- < 5: height of glyph black box
+
+
+- byte originX;
+
+- < 6: X origin for glyph
+
+
+- byte originY;
+
+- < 7: Y origin for glyph
+
+
+- ubyte width;
+
+- < 8: full width of glyph
+
+
+- ubyte lastUsage;
+
+- < 9: usage flag, to handle cleanup of unused glyphs
+
+
+- ubyte[] glyph;
+
+- < 12: glyph data, arbitrary size
+
+
+
+
+- class RefCountedObject;
+
+- base class for reference counted objects, maintains reference counter inplace.
+
+
+- enum State: uint;
+
+- widget state flags - bits
+
+- Normal
+- state not specified / normal
+
+
+
+
+- dchar dcharToUpper(dchar ch);
+
+- uppercase unicode character
+
+
+- bool isPathDelimiter(char ch);
+
+- returns true if char ch is / or \ slash
+
+
+- @property string exePath();
+
+- returns current executable path only, including last path delimiter
+
+
+- char[] convertPathDelimiters(char[] buf);
+
+- converts path delimiters to standard for platform inplace in buffer(e.g. / to \ on windows, \ to / on posix), returns buf
+
+
+- string convertPathDelimiters(string src);
+
+- converts path delimiters to standard for platform (e.g. / to \ on windows, \ to / on posix)
+
+
+- string appendPath(string[] pathItems...);
+
+- appends file path parts with proper delimiters e.g. appendPath("/home/user", ".myapp", "config") => "/home/user/.myapp/config"
+
+
+- char[] appendPath(char[] buf, string[] pathItems...);
+
+- 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"
+
+
+
+
+
Page generated by Ddoc. Vadim Lopatin, 2014
+
+
diff --git a/docs/widget.html b/docs/widget.html
new file mode 100644
index 00000000..ad689965
--- /dev/null
+++ b/docs/widget.html
@@ -0,0 +1,211 @@
+
+
+ dlangui.widgets.widget
+
+ dlangui.widgets.widget
+
+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.
+
+
+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));
+
+
+
+
+
+License:
+Boost License 1.0
+
+Authors:
+Vadim Lopatin, coolreader.org@gmail.com
+
+- enum Visibility: ubyte;
+
+- Visibility (see Android View Visibility)
+
+- Visible
+- Visible on screen (default)
+
+
+- Invisible
+- Not visible, but occupies a space in layout
+
+
+- Gone
+- Completely hidden, as not has been added
+
+
+
+
+- interface OnClickHandler;
+
+- interface - slot for onClick
+
+
+- interface OnCheckHandler;
+
+- interface - slot for onCheckChanged
+
+
+- interface OnFocusHandler;
+
+- interface - slot for onFocusChanged
+
+
+- enum FocusMovement: int;
+
+- focus movement options
+
+- None
+- no focus movement
+
+
+- Next
+- next focusable (Tab)
+
+
+- Previous
+- previous focusable (Shift+Tab)
+
+
+- Up
+- move to nearest above
+
+
+- Down
+- move to nearest below
+
+
+- Left
+- move to nearest at left
+
+
+- Right
+- move to nearest at right
+
+
+
+
+- enum CursorType: int;
+
+- standard mouse cursor types
+
+- Parent
+- use parent's cursor
+
+
+
+
+- struct WidgetList;
+
+- widget list holder
+
+- const @property int count();
+
+- returns count of items
+
+
+- Widget get(int index);
+
+- get item by index
+
+
+- Widget add(Widget item);
+
+- add item to list
+
+
+- Widget insert(Widget item, int index = -1);
+
+- add item to list
+
+
+- int indexOf(Widget item);
+
+- find child index for item, return -1 if not found
+
+
+- int indexOf(string id);
+
+- find child index for item by id, return -1 if not found
+
+
+- Widget remove(int index);
+
+- remove item from list, return removed item
+
+
+- void clear();
+
+- remove and destroy all items
+
+
+
+
+- class WidgetGroup: dlangui.widgets.widget.Widget;
+
+- base class for widgets which have children
+
+- @property int childCount();
+
+- returns number of children of this widget
+
+
+- Widget child(int index);
+
+- returns child by index
+
+
+- Widget addChild(Widget item);
+
+- adds child, returns added item
+
+
+- Widget removeChild(int index);
+
+- removes child, returns removed item
+
+
+- Widget removeChild(string ID);
+
+- removes child by ID, returns removed item
+
+
+- int childIndex(Widget item);
+
+- returns index of widget in child list, -1 if passed widget is not a child of this widget
+
+
+
+
+
+
+
Page generated by Ddoc. Vadim Lopatin, 2014
+
+