dlangui/types.html

179 lines
6.4 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="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="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>&lt; 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>&lt; 4: width of glyph black box<br><br>
</dd>
<dt><big><a name="Glyph.blackBoxY"></a>ubyte <u>blackBoxY</u>;
</big></dt>
<dd>&lt; 5: height of glyph black box<br><br>
</dd>
<dt><big><a name="Glyph.originX"></a>byte <u>originX</u>;
</big></dt>
<dd>&lt; 6: X origin for glyph<br><br>
</dd>
<dt><big><a name="Glyph.originY"></a>byte <u>originY</u>;
</big></dt>
<dd>&lt; 7: Y origin for glyph<br><br>
</dd>
<dt><big><a name="Glyph.width"></a>ubyte <u>width</u>;
</big></dt>
<dd>&lt; 8: full <u>width</u> of glyph<br><br>
</dd>
<dt><big><a name="Glyph.lastUsage"></a>ubyte <u>lastUsage</u>;
</big></dt>
<dd>&lt; 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>&lt; 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") =&gt; "/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") =&gt; "/home/user/.myapp/config"<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>