vala r1331 - in trunk: . doc/vala



Author: juergbi
Date: Thu May  1 17:12:01 2008
New Revision: 1331
URL: http://svn.gnome.org/viewvc/vala?rev=1331&view=rev

Log:
2008-05-01  Juerg Billeter  <j bitron ch>

	* doc/vala/types.xml:
	* doc/vala/default.css:
	* doc/vala/xhtml.xsl:

	Extend types section, based on patch by Phil Housley


Modified:
   trunk/ChangeLog
   trunk/doc/vala/default.css
   trunk/doc/vala/types.xml
   trunk/doc/vala/xhtml.xsl

Modified: trunk/doc/vala/default.css
==============================================================================
--- trunk/doc/vala/default.css	(original)
+++ trunk/doc/vala/default.css	Thu May  1 17:12:01 2008
@@ -8,7 +8,7 @@
 	color: #005a9c;
 }
 
-a {
+a:link, a:visited, a:hover, a:active {
 	color: #005a9c;
 	text-decoration: none;
 }
@@ -69,3 +69,8 @@
 	white-space: pre;
 }
 
+blockquote span.literal {
+	font-family: monospace;
+	font-style: normal;
+	font-weight: bold;
+}

Modified: trunk/doc/vala/types.xml
==============================================================================
--- trunk/doc/vala/types.xml	(original)
+++ trunk/doc/vala/types.xml	Thu May  1 17:12:01 2008
@@ -1,15 +1,166 @@
 <?xml version="1.0"?>
 <section id="types">
 	<h>Types</h>
-	<p>Vala supports two kinds of data types: value types and reference types. Value types include simple types (e.g. char, int, and float), enum types, and struct types. Reference types include class types, interface types, and array types.</p>
+	<p>Vala supports four kinds of data types: value types, reference types, type parameters, and pointer types. Value types include simple types (e.g. char, int, and float), enum types, and struct types. Reference types include object types, array types, delegate types, and error types. Type parameters are parameters used in generic types.</p>
 	<p>Value types differ from reference types in that variables of the value types directly contain their data, whereas variables of the reference types store references to their data, the latter being known as objects. With reference types, it is possible for two variables to reference the same object, and thus possible for operations on one variable to affect the object referenced by the other variable. With value types, the variables each have their own copy of the data, and it is not possible for operations on one to affect the other.</p>
+	<blockquote>
+type:
+	value-type
+	reference-type
+	nullable-type
+	type-parameter
+	pointer-type
+	</blockquote>
 	<section id="valuetypes">
 		<h>Value types</h>
-		<p>Documentation</p>
+		<p>Instances of value types are stored directly in variables.  They are duplicated whenever assigned to another variable (e.g. passed to a method).  For local variables, value types are stored on the stack.</p>
+		<blockquote>
+value-type:
+	struct-type
+	enum-type
+
+struct-type:
+	type-name
+	integral-type
+	floating-point-type
+	<l>bool</l>
+
+integral-type:
+	<l>char</l>
+	<l>uchar</l>
+	<l>short</l>
+	<l>ushort</l>
+	<l>int</l>
+	<l>uint</l>
+	<l>long</l>
+	<l>ulong</l>
+	<l>size_t</l>
+	<l>ssize_t</l>
+	<l>int8</l>
+	<l>uint8</l>
+	<l>int16</l>
+	<l>uint16</l>
+	<l>int32</l>
+	<l>uint32</l>
+	<l>int64</l>
+	<l>uint64</l>
+	<l>unichar</l>
+
+floating-point-type:
+	<l>float</l>
+	<l>double</l>
+
+enum-type:
+	type-name
+		</blockquote>
+		<section id="structtypes">
+			<h>Struct types</h>
+			<p>Documentation</p>
+		</section>
+		<section id="simpletypes">
+			<h>Simple types</h>
+			<p>Documentation</p>
+		</section>
+		<section id="integraltypes">
+			<h>Integral types</h>
+			<p>Documentation</p>
+		</section>
+		<section id="floatingpointtypes">
+			<h>Floating point types</h>
+			<p>Documentation</p>
+		</section>
+		<section id="booltype">
+			<h>The bool type</h>
+			<p>Documentation</p>
+		</section>
+		<section id="enumtypes">
+			<h>Enumeration types</h>
+			<p>An enumeration type is a type containing named constants.</p>
+			<p>See enums.</p>
+		</section>
 	</section>
 	<section id="referencetypes">
 		<h>Reference types</h>
-		<p>Documentation</p>
+		<p>Instances of reference types are always stored on the heap. Variables contain references to them. Assigning to another variable duplicates reference, not object.</p>
+		<blockquote>
+reference-type:
+	object-type
+	class-type
+	array-type
+	delegate-type
+	error-type
+	weak-reference-type
+
+weak-reference-type:
+	<l>weak</l> object-type
+	<l>weak</l> class-type
+	<l>weak</l> array-type
+	<l>weak</l> delegate-type
+	<l>weak</l> error-type
+
+object-type:
+	type-name
+	<l>string</l>
+
+class-type:
+	type-name <l>. Class</l>
+
+array-type:
+	non-array-type <l>[]</l>
+	non-array-type <l>[</l> dim-seperators <l>]</l>
+
+non-array-type:
+	value-type
+	object-type
+	class-type
+	delegate-type
+	error-type
+
+dim-separators:
+	<l>,</l>
+	dim-separators <l>,</l>
+
+delegate-type:
+	type-name
+
+error-type:
+	type-name
+		</blockquote>
+		<section id="weakreferencetypes">
+			<h>Weak reference types</h>
+			<p>Documentation</p>
+		</section>
+		<section id="arraytypes">
+			<h>Array types</h>
+			<p>An array is a data structure that contains zero or more elements of the same type.</p>
+		</section>
+		<section id="delegatetypes">
+			<h>Delegate types</h>
+			<p>A delegate is a data structure that refers to a method, and for instance methods, it also refers to the corresponding object instance.</p>
+		</section>
+		<section id="errortypes">
+			<h>Error types</h>
+			<p>Instances of error types represent recoverable runtime errors.</p>
+		</section>
+	</section>
+	<section id="nullabletypes">
+		<h>Nullable types</h>
+		<p>An instance of a nullable type <code>T?</code> can either be a value of type <code>T</code> or <code>null</code>.</p>
+		<blockquote>
+nullable-type:
+	value-type <l>?</l>
+	reference-type <l>?</l>
+		</blockquote>
+	</section>
+	<section id="pointertypes">
+		<h>Pointer types</h>
+		<p>Unlike references, pointers are not tracked by the memory manager. The value of a pointer having type T* represents the address of a variable of type T. The pointer indirection operator * can be used to access this variable. Like a nullable object reference, a pointer can be null. The <code>void*</code> type represents a pointer to an unknown type. As the referent type is unknown, the indirection operator cannot be applied to a pointer of type <code>void*</code>, nor can any arithmetic be performed on such a pointer. However, a pointer of type <code>void*</code> can be cast to any other pointer type (and vice versa) and compared to values of other pointer types.</p>
+		<blockquote>
+pointer-type:
+	type-name <l>*</l>
+	pointer-type <l>*</l>
+	<l>void*</l>
+		</blockquote>
 	</section>
 </section>
 

Modified: trunk/doc/vala/xhtml.xsl
==============================================================================
--- trunk/doc/vala/xhtml.xsl	(original)
+++ trunk/doc/vala/xhtml.xsl	Thu May  1 17:12:01 2008
@@ -1,6 +1,7 @@
 <?xml version="1.0"?>
 <xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"; xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.1">
 	<xsl:output method="xml" indent="yes" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"; doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"/>
+	<xsl:strip-space elements="blockquote/l"/>
 	<xsl:template match="/">
 		<xsl:apply-templates select="html"/>
 	</xsl:template>
@@ -52,7 +53,7 @@
 					<div class="header">
 						<a href="index.html"><xsl:value-of select="//title/text()"/></a>
 					</div>
-					<xsl:apply-templates select="h|p|section"/>
+					<xsl:apply-templates select="h|p|section|div|blockcode|blockquote|ol|ul"/>
 				</body>
 			</html>
 		</xsl:document>
@@ -61,11 +62,17 @@
 		<h2><xsl:value-of select="text()"/></h2>
 	</xsl:template>
 	<xsl:template match="body/section/section">
-		<xsl:apply-templates select="h|p|div|blockcode|blockquote|section"/>
+		<xsl:apply-templates select="h|p|div|blockcode|blockquote|section|ol|ul"/>
 	</xsl:template>
 	<xsl:template match="body/section/section/h">
 		<h3><xsl:value-of select="text()"/><a id="{../@id}"><xsl:text> </xsl:text></a></h3>
 	</xsl:template>
+	<xsl:template match="body/section/section/section">
+		<xsl:apply-templates select="h|p|div|blockcode|blockquote|section|ol|ul"/>
+	</xsl:template>
+	<xsl:template match="body/section/section/section/h">
+		<h4><xsl:value-of select="text()"/><a id="{../@id}"><xsl:text> </xsl:text></a></h4>
+	</xsl:template>
 	<xsl:template match="div[ role='note']">
 		<div class="note"><xsl:apply-templates select="h|p|blockcode|blockquote"/></div>
 	</xsl:template>
@@ -82,7 +89,19 @@
 		<pre><xsl:value-of select="text()"/></pre>
 	</xsl:template>
 	<xsl:template match="blockquote">
-		<blockquote><xsl:value-of select="text()"/></blockquote>
+		<blockquote><xsl:apply-templates select="text()|l"/></blockquote>
+	</xsl:template>
+	<xsl:template match="blockquote/l">
+		<span class="literal"><xsl:value-of select="text()"/></span>
+	</xsl:template>
+	<xsl:template match="ol">
+		<ol><xsl:apply-templates select="item"/></ol>
+	</xsl:template>
+	<xsl:template match="ul">
+		<ul><xsl:apply-templates select="item"/></ul>
+	</xsl:template>
+	<xsl:template match="ol/item|ul/item">
+		<li><xsl:value-of select="text()"/></li>
 	</xsl:template>
 </xsl:stylesheet>
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]