mirror of https://github.com/buggins/dlangui.git
328 lines
11 KiB
HTML
328 lines
11 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
|
<html>
|
|
<head>
|
|
<meta charset='utf-8'>
|
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
|
<link href='https://fonts.googleapis.com/css?family=Chivo:900' rel='stylesheet' type='text/css'>
|
|
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen" />
|
|
<link rel="stylesheet" type="text/css" href="stylesheets/pygment_trac.css" media="screen" />
|
|
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print" />
|
|
<!--[if lt IE 9]>
|
|
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
<![endif]-->
|
|
<title>DlangUI - cross platform GUI library for D programming language - dlangui.core.types</title>
|
|
</head>
|
|
<body>
|
|
<div id="container">
|
|
<div class="inner">
|
|
<header>
|
|
<h1>DlangUI</h1>
|
|
<h2>Cross Platform GUI for D programming language</h2>
|
|
</header>
|
|
<section id="downloads" class="clearfix">
|
|
<a href="index.html" id="home" class="button"><span>Home</span></a>
|
|
<a href="api.html" id="home" class="button"><span>API Docs</span></a>
|
|
<a href="screenshots.html" id="home" class="button"><span>Screenshots</span></a>
|
|
<a href="https://github.com/buggins/dlangui/zipball/master" id="download-zip" class="button"><span>Download .zip</span></a>
|
|
<!--a href="https://github.com/buggins/dlangui/tarball/master" id="download-tar-gz" class="button"><span>Download .tar.gz</span></a-->
|
|
<a href="https://github.com/buggins/dlangui" id="view-on-github" class="button"><span>View on GitHub</span></a>
|
|
</section>
|
|
|
|
<hr>
|
|
<section id="main_content">
|
|
<h1>dlangui.core.types</h1>
|
|
<!-- Generated by Ddoc from src\dlangui\core\types.d -->
|
|
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="Point"></a>struct <u>Point</u>;
|
|
</big></dt>
|
|
<dd>2D point<br><br>
|
|
|
|
<dl><dt><big><a name="Point.x"></a>int <u>x</u>;
|
|
</big></dt>
|
|
<dd><u>x</u> coordinate<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Point.y"></a>int <u>y</u>;
|
|
</big></dt>
|
|
<dd><u>y</u> coordinate<br><br>
|
|
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt><big><a name="Rect"></a>struct <u>Rect</u>;
|
|
</big></dt>
|
|
<dd>2D rectangle<br><br>
|
|
|
|
<dl><dt><big><a name="Rect.left"></a>int <u>left</u>;
|
|
</big></dt>
|
|
<dd>x coordinate of top <u>left</u> corner<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Rect.top"></a>int <u>top</u>;
|
|
</big></dt>
|
|
<dd>y coordinate of <u>top</u> left corner<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Rect.right"></a>int <u>right</u>;
|
|
</big></dt>
|
|
<dd>x coordinate of bottom <u>right</u> corner<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Rect.bottom"></a>int <u>bottom</u>;
|
|
</big></dt>
|
|
<dd>y coordinate of <u>bottom</u> right corner<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Rect.middlex"></a>@property int <u>middlex</u>();
|
|
</big></dt>
|
|
<dd>returns average of left, right<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Rect.middley"></a>@property int <u>middley</u>();
|
|
</big></dt>
|
|
<dd>returns average of top, bottom<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Rect.offset"></a>void <u>offset</u>(int <i>dx</i>, int <i>dy</i>);
|
|
</big></dt>
|
|
<dd>add <u>offset</u> to horizontal and vertical coordinates<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Rect.expand"></a>void <u>expand</u>(int <i>dx</i>, int <i>dy</i>);
|
|
</big></dt>
|
|
<dd><u>expand</u> rectangle dimensions<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Rect.shrink"></a>void <u>shrink</u>(int <i>dx</i>, int <i>dy</i>);
|
|
</big></dt>
|
|
<dd><u>shrink</u> rectangle dimensions<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Rect.setMax"></a>void <u>setMax</u>(Rect <i>rc</i>);
|
|
</big></dt>
|
|
<dd>for all fields, sets this.field to <i>rc</i>.field if <i>rc</i>.field > this.field<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Rect.moveBy"></a>void <u>moveBy</u>(int <i>deltax</i>, int <i>deltay</i>);
|
|
</big></dt>
|
|
<dd>translate rectangle coordinates by (x,y) - add <i>deltax</i> to x coordinates, and <i>deltay</i> to y coordinates<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Rect.moveToFit"></a>void <u>moveToFit</u>(ref Rect <i>rc</i>);
|
|
</big></dt>
|
|
<dd>moves this rect to fit <i>rc</i> bounds, retaining the same size<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Rect.intersect"></a>bool <u>intersect</u>(Rect <i>rc</i>);
|
|
</big></dt>
|
|
<dd>updates this rect to intersection with <i>rc</i>, returns <b>true</b> if result is non empty<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Rect.intersects"></a>bool <u>intersects</u>(Rect <i>rc</i>);
|
|
</big></dt>
|
|
<dd>returns <b>true</b> if this rect has nonempty intersection with <i>rc</i><br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Rect.isPointInside"></a>bool <u>isPointInside</u>(Point <i>pt</i>);
|
|
</big></dt>
|
|
<dd>returns <b>true</b> if point is inside of this rectangle<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Rect.isPointInside"></a>bool <u>isPointInside</u>(int <i>x</i>, int <i>y</i>);
|
|
</big></dt>
|
|
<dd>returns <b>true</b> if point is inside of this rectangle<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Rect.isInsideOf"></a>bool <u>isInsideOf</u>(Rect <i>rc</i>);
|
|
</big></dt>
|
|
<dd>this rectangle is completely inside <i>rc</i><br><br>
|
|
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt><big><a name="Glyph"></a>struct <u>Glyph</u>;
|
|
</big></dt>
|
|
<dd>character glyph<br><br>
|
|
|
|
<dl><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="Ref"></a>struct <u>Ref</u>(T);
|
|
</big></dt>
|
|
<dd>reference counting support<br><br>
|
|
|
|
<dl><dt><big><a name="Ref.isNull"></a>const @property bool <u>isNull</u>();
|
|
</big></dt>
|
|
<dd>returns <b>true</b> if object is not assigned<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Ref.refCount"></a>const @property int <u>refCount</u>();
|
|
</big></dt>
|
|
<dd>returns counter of references<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Ref.clear"></a>void <u>clear</u>();
|
|
</big></dt>
|
|
<dd>clears reference<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Ref.get"></a>@property T <u>get</u>();
|
|
</big></dt>
|
|
<dd>returns object reference (<b>null</b> if not assigned)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="Ref.get"></a>const @property const(T) <u>get</u>();
|
|
</big></dt>
|
|
<dd>returns const reference from const object<br><br>
|
|
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt><big><a name="fromWStringz"></a>wstring <u>fromWStringz</u>(const(wchar[]) <i>s</i>);
|
|
</big></dt>
|
|
<dd>conversion from wchar z-string<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="fromWStringz"></a>wstring <u>fromWStringz</u>(const(wchar)* <i>s</i>);
|
|
</big></dt>
|
|
<dd>conversion from wchar z-string<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>
|
|
<dt><big><a name="splitPath"></a>string[] <u>splitPath</u>(string <i>path</i>);
|
|
</big></dt>
|
|
<dd>split <i>path</i> into elements, e.g. /home/user/dir1 -> ["home", "user", "dir1"], "c:\dir1\dir2" -> ["c:", "dir1", "dir2"]<br><br>
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
</section>
|
|
<footer>
|
|
Dlangui is maintained by <a href="https://github.com/buggins">buggins</a><br>
|
|
This page was generated by <a href="http://pages.github.com">GitHub Pages</a>. Tactile theme by <a href="https://twitter.com/jasonlong">Jason Long</a>.
|
|
</footer>
|
|
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|