mirror of https://github.com/buggins/dlangui.git
166 lines
6.3 KiB
HTML
166 lines
6.3 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.graphics.resources</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.graphics.resources</h1>
|
|
<!-- Generated by Ddoc from src\dlangui\graphics\resources.d -->
|
|
This module contains resource management and drawables implementation.
|
|
<br><br>
|
|
imageCache is RAM cache of decoded images (as DrawBuf).
|
|
<br><br>
|
|
|
|
drawableCache is cache of Drawables.
|
|
<br><br>
|
|
|
|
Supports nine-patch PNG images in .9.png files (like in Android).
|
|
<br><br>
|
|
|
|
Supports state drawables using XML files similar to ones in Android.
|
|
|
|
<br><br>
|
|
<b>Synopsis:</b><br>
|
|
<pre class="d_code"><font color=blue>import</font> dlangui.graphics.<u>resources</u>;
|
|
|
|
</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="FrameDrawable"></a>class <u>FrameDrawable</u>: <u>dlangui.graphics.resources.Drawable</u>;
|
|
</big></dt>
|
|
<dd>solid borders (may be of different width) and, optionally, solid inner area<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="decodeHexColor"></a>static uint <u>decodeHexColor</u>(string <i>s</i>);
|
|
</big></dt>
|
|
<dd>decode color string #AARRGGBB, e.g. #5599AA<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="decodeDimension"></a>static uint <u>decodeDimension</u>(string <i>s</i>);
|
|
</big></dt>
|
|
<dd>decode size string, e.g. 1px or 2 or 3pt<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="createColorDrawable"></a>static Drawable <u>createColorDrawable</u>(string <i>s</i>);
|
|
</big></dt>
|
|
<dd>decode solid color / gradient / frame drawable from string like #AARRGGBB, e.g. #5599AA
|
|
<br><br>
|
|
<b>SolidFillDrawable:</b><br>
|
|
#AARRGGBB - e.g. #8090A0 or #80ffffff
|
|
|
|
<br><br>
|
|
<b>FrameDrawable:</b><br>
|
|
#frameColor,frameWidth[,#middleColor]
|
|
<br><br>
|
|
|
|
or #frameColor,leftBorderWidth,topBorderWidth,rightBorderWidth,bottomBorderWidth[,#middleColor]
|
|
<br><br>
|
|
|
|
e.g. #000000,2,#C0FFFFFF - black frame of width 2 with 75% transparent white middle
|
|
<br><br>
|
|
|
|
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<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="extractStateFlags"></a>void <u>extractStateFlags</u>(ref string[string] <i>attr</i>, ref uint <i>stateMask</i>, ref uint <i>stateValue</i>);
|
|
</big></dt>
|
|
<dd>converts XML attribute name to State (see http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="StateDrawable"></a>class <u>StateDrawable</u>: <u>dlangui.graphics.resources.Drawable</u>;
|
|
</big></dt>
|
|
<dd>Drawable which is drawn depending on state (see http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList)<br><br>
|
|
|
|
<dl><dt><big><a name="StateDrawable.parseList4"></a>bool <u>parseList4</u>(T)(string <i>value</i>, ref T[4] <i>items</i>);
|
|
</big></dt>
|
|
<dd>parse 4 comma delimited integers<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="StateDrawable.load"></a>bool <u>load</u>(string <i>filename</i>);
|
|
</big></dt>
|
|
<dd><u>load</u> from XML file<br><br>
|
|
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt><big><a name="ImageCache"></a>class <u>ImageCache</u>;
|
|
</big></dt>
|
|
<dd>decoded raster images cache (png, jpeg) -- access by filenames<br><br>
|
|
|
|
<dl><dt><big><a name="ImageCache.get"></a>ref DrawBufRef <u>get</u>(string <i>filename</i>);
|
|
</big></dt>
|
|
<dd><u>get</u> and cache image<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="ImageCache.get"></a>ref DrawBufRef <u>get</u>(string <i>filename</i>, ref ColorTransform <i>transform</i>);
|
|
</big></dt>
|
|
<dd><u>get</u> and cache color transformed image<br><br>
|
|
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt><big><a name="imageCache"></a>@property ImageCache <u>imageCache</u>();
|
|
</big></dt>
|
|
<dd>image cache singleton<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="imageCache"></a>@property void <u>imageCache</u>(ImageCache <i>cache</i>);
|
|
</big></dt>
|
|
<dd>image <i>cache</i> singleton<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="drawableCache"></a>@property DrawableCache <u>drawableCache</u>();
|
|
</big></dt>
|
|
<dd>drawable cache singleton<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="drawableCache"></a>@property void <u>drawableCache</u>(DrawableCache <i>cache</i>);
|
|
</big></dt>
|
|
<dd>drawable <i>cache</i> singleton<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>
|