mirror of https://github.com/buggins/dlangui.git
148 lines
4.5 KiB
HTML
148 lines
4.5 KiB
HTML
<html><head>
|
|
<META http-equiv="content-type" content="text/html; charset=utf-8">
|
|
<title>dlangui.core.types</title>
|
|
</head><body>
|
|
<h1>dlangui.core.types</h1>
|
|
<!-- Generated by Ddoc from src/dlangui/core/types.d -->
|
|
DLANGUI library.
|
|
<br><br>
|
|
This module declares basic data <u>types</u> for usage in dlangui library.
|
|
|
|
<br><br>
|
|
<b>Synopsis:</b><br>
|
|
<pre class="d_code"><font color=blue>import</font> dlangui.core.<u>types</u>;
|
|
|
|
<font color=green>// points
|
|
</font>Point p(5, 10);
|
|
|
|
<font color=green>// rectangles
|
|
</font>Rect r(5, 13, 120, 200);
|
|
writeln(r);
|
|
|
|
<font color=green>// reference counted objects, useful for RAII / resource management.
|
|
</font><font color=blue>class</font> Foo : RefCountedObject {
|
|
<font color=blue>int</font>[] resource;
|
|
~<font color=blue>this</font>() {
|
|
writeln(<font color=red>"freeing Foo resources"</font>);
|
|
}
|
|
}
|
|
{
|
|
Ref!Foo ref1;
|
|
{
|
|
Ref!Foo fooRef = <font color=blue>new</font> RefCountedObject();
|
|
ref1 = fooRef;
|
|
}
|
|
<font color=green>// RAII: will destroy object when no more references
|
|
</font>}
|
|
|
|
</pre>
|
|
|
|
<br><br>
|
|
<b>License:</b><br>
|
|
Boost License 1.0
|
|
<br><br>
|
|
<b>Authors:</b><br>
|
|
Vadim Lopatin, coolreader.org@gmail.com<br><br>
|
|
|
|
<dl><dt><big><a name="Glyph"></a>struct <u>Glyph</u>;
|
|
</big></dt>
|
|
<dd>character glyph<br><br>
|
|
|
|
<dl><dt><big><a name="Glyph.id"></a>uint <u>id</u>;
|
|
</big></dt>
|
|
<dd>< 0: unique <u>id</u> of glyph (for drawing in hardware accelerated scenes)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Glyph.blackBoxX"></a>ubyte <u>blackBoxX</u>;
|
|
</big></dt>
|
|
<dd>< 4: width of glyph black box<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Glyph.blackBoxY"></a>ubyte <u>blackBoxY</u>;
|
|
</big></dt>
|
|
<dd>< 5: height of glyph black box<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Glyph.originX"></a>byte <u>originX</u>;
|
|
</big></dt>
|
|
<dd>< 6: X origin for glyph<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Glyph.originY"></a>byte <u>originY</u>;
|
|
</big></dt>
|
|
<dd>< 7: Y origin for glyph<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Glyph.width"></a>ubyte <u>width</u>;
|
|
</big></dt>
|
|
<dd>< 8: full <u>width</u> of glyph<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Glyph.lastUsage"></a>ubyte <u>lastUsage</u>;
|
|
</big></dt>
|
|
<dd>< 9: usage flag, to handle cleanup of unused glyphs<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Glyph.glyph"></a>ubyte[] <u>glyph</u>;
|
|
</big></dt>
|
|
<dd>< 12: <u>glyph</u> data, arbitrary size<br><br>
|
|
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt><big><a name="RefCountedObject"></a>class <u>RefCountedObject</u>;
|
|
</big></dt>
|
|
<dd>base class for reference counted objects, maintains reference counter inplace.<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="State"></a>enum <u>State</u>: uint;
|
|
</big></dt>
|
|
<dd>widget state flags - bits<br><br>
|
|
|
|
<dl><dt><big><a name="State.Normal"></a><u>Normal</u></big></dt>
|
|
<dd>state not specified / normal<br><br>
|
|
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt><big><a name="dcharToUpper"></a>dchar <u>dcharToUpper</u>(dchar <i>ch</i>);
|
|
</big></dt>
|
|
<dd>uppercase unicode character<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="isPathDelimiter"></a>bool <u>isPathDelimiter</u>(char <i>ch</i>);
|
|
</big></dt>
|
|
<dd>returns <b>true</b> if char <i>ch</i> is / or \ slash<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="exePath"></a>@property string <u>exePath</u>();
|
|
</big></dt>
|
|
<dd>returns current executable path only, including last path delimiter<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="convertPathDelimiters"></a>char[] <u>convertPathDelimiters</u>(char[] <i>buf</i>);
|
|
</big></dt>
|
|
<dd>converts path delimiters to standard for platform inplace in buffer(e.g. / to \ on windows, \ to / on posix), returns <i>buf</i><br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="convertPathDelimiters"></a>string <u>convertPathDelimiters</u>(string <i>src</i>);
|
|
</big></dt>
|
|
<dd>converts path delimiters to standard for platform (e.g. / to \ on windows, \ to / on posix)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="appendPath"></a>string <u>appendPath</u>(string[] <i>pathItems</i>...);
|
|
</big></dt>
|
|
<dd>appends file path parts with proper delimiters e.g. <u>appendPath</u>("/home/user", ".myapp", "config") => "/home/user/.myapp/config"<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="appendPath"></a>char[] <u>appendPath</u>(char[] <i>buf</i>, string[] <i>pathItems</i>...);
|
|
</big></dt>
|
|
<dd>appends file path parts with proper delimiters (as well converts delimiters inside path to system) to buffer e.g. <u>appendPath</u>("/home/user", ".myapp", "config") => "/home/user/.myapp/config"<br><br>
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
<hr><small>Page generated by <a href="http://dlang.org/ddoc.html">Ddoc</a>. Vadim Lopatin, 2014
|
|
</small>
|
|
</body></html>
|