[seed] Update mapping documentation to be twice as colorful, and by that I mean more consistently colorful



commit 3cfd3234ce61ce746f9797618595a8395137c991
Author: Robert Carr <racarr svn gnome org>
Date:   Thu Apr 30 01:04:06 2009 -0400

    Update mapping documentation to be twice as colorful, and by that I mean more consistently colorful
---
 doc/mapping/mapping.html.in |   52 +++++++++++++++++++++---------------------
 doc/style.css               |   15 ++++++++++++
 2 files changed, 41 insertions(+), 26 deletions(-)

diff --git a/doc/mapping/mapping.html.in b/doc/mapping/mapping.html.in
index 308ebbf..36d578b 100644
--- a/doc/mapping/mapping.html.in
+++ b/doc/mapping/mapping.html.in
@@ -27,7 +27,7 @@ The mapping of enum types to JavaScript is straightforward.
 <img src="./enum-mapping.png">
 </div>
 <p>
-In this example, <span style="color:#ef2929">Gtk</span> is the namespace, <span style="color:#73d216">WindowType</span> is the enum class, and <span style="color:#729fcf">NORMAL</span> is the enum member. Note that the enum member is always UPPERCASE, and the enum class is CasedLikeTypes.
+In this example, <namespace>Gtk</namespace> is the namespace, <type>WindowType</type> is the enum class, and <member>NORMAL</member> is the enum member. Note that the enum member is always UPPERCASE, and the enum class is CasedLikeTypes.
 
 It is worth noting that this is the same convention as Vala.
 
@@ -36,17 +36,17 @@ When passing enums in to functions, the enum will be checked (to ensure it is in
 
 <div class="section">Toplevel Functions</div>
 <p>
-Toplevel library functions are mapped exactly as you would expect, with <span style="color:#ef2929">gtk</span>_<span style="color:#729fcf">main</span> mapping to <span style="color:#ef2929">Gtk</span>.<span style="color:#729fcf">main</span>.
+Toplevel library functions are mapped exactly as you would expect, with <namespace>gtk</namespace>_<member>main</member> mapping to <namespace>Gtk</namespace>.<member>main</member>.
 </p>
 <div class="section">Constants</div>
 Constants are placed directly on the namespace, with the same casing as present in the C library.
 <pre style="javascript">
-Clutter.COGL_FIXED_0_5
-Clutter.Alt_L
+<namespace>Clutter</namespace>.<member>COGL_FIXED_0_5</member>
+<namespace>Clutter</namespace>.<member>Alt_L</member>
 </pre>
 <div class="section">Objects</div>
 <p>
-Objects are given a constructor on the namespace. <span style="color:#ef2929">Clutter</span><span style="color:#729fcf">Texture</span> having a constructor at <span style="color:#ef2929">Clutter</span>.<span style="color:#729fcf">Texture</span>
+Objects are given a constructor on the namespace. <namespace>Clutter</namespace><member>Texture</member> having a constructor at <namespace>Clutter</namespace>.<member>Texture</member>
 </p>
 <div class="subsection">Constructors</div>
 <p>
@@ -54,36 +54,36 @@ Object constructors, accept as their only argument, a JavaScript object pairing
 
 As an example,
 <pre class="javascript">
-w = new Gtk.Window({title: "Hello"});
-c = new Clutter.Texture({width: 300, height:300});
+w = new <namespace>Gtk</namespace>.<type>Window</type>({title: "Hello"});
+c = new <namespace>Clutter</namespace>.<type>Texture</type>({width: 300, height:300});
 </pre>
-All other properties are left to their default values. Note, Gtk.Window.prototype is the prototype of all Gtk.Window instances. It is also possible for objects to have "named" constructors which take specific arguments, i.e. for <code><span style="color:#ef2929">clutter</span>_<span style="color:#73d216">texture</span>_new_<span style="color:#729fcf">from_file</span</code> we have
-<pre class="javascript">t = new <span style="color:#ef2929">Clutter</span>.<span style="color:#73d216">Texture</span>.<span style="color:#729fcf">from_file</span>("/tmp/cat.png");</pre>
+All other properties are left to their default values. Note, <code><namespace>Gtk</namespace>.<type>Window</type>.<member>prototype</member></code> is the prototype of all <code><namespace>Gtk</namespace>.<type>Window</type></code> instances. It is also possible for objects to have "named" constructors which take specific arguments, i.e. for <code><namespace>clutter</namespace>_<type>texture</type>_new_<member>from_file</member</code> we have
+<pre class="javascript">t = new <namespace>Clutter</namespace>.<type>Texture</type>.<member>from_file</member>("/tmp/cat.png");</pre>
 
-In addition <code>gtk_window_new</code> maps to <code>Gtk.Window.c_new</code> (because <code>new</code> is a JavaScript keyword). This however is rarely used.
+In addition <code><namespace>gtk</namespace>_<type>window</type>_<member>new</member></code> maps to <code><namespace>Gtk</namespace>.<type>Window</type>.<member>c_new</member></code> (because <code>new</code> is a JavaScript keyword). This however is rarely used.
 </p>
 <div class="subsection">Methods & Static Methods </div>
 <p>
 Non static methods (or "instance" methods) are accessible from the object, as you would expect.
 <pre class="javascript">
-w = new Gtk.Window();
-w.resize(300, 300);
+w = new <namespace>Gtk</namespace>.<type>Window</type>();
+w.<member>resize</member>(300, 300);
 </pre>
 
-Static methods are accessible from the constructor, so for <span style="color:#ef2929">clutter</span>_<span style="color:#73d216">stage</span>_<span style="color:#729fcf">get_default</span>.
+Static methods are accessible from the constructor, so for <namespace>clutter</namespace>_<type>stage</type>_<member>get_default</member>.
 <pre class="javascript">
-c = <span style="color:#ef2929">Clutter</span>.<span style="color:#73d216">Stage</span>.<span style="color:#729fcf">get_default</span>();
+c = <namespace>Clutter</namespace>.<type>Stage</type>.<member>get_default</member>();
 </pre>
 
 The type conversion, is fairly sophisticated, so where C methods expect non-basic types, like function pointers, GLists, or C arrays, you are able to just pass in JavaScript functions and arrays.
 <pre class="javascript">
-w = new Gtk.Window();
-w.add (new Gtk.VBox());
+w = new <namespace>Gtk</namespace>.<type>Window</type>();
+w.add (new <namespace>Gtk</namespace>.<type>VBox</type>());
 w.foreach(function (widget) {
               Seed.print(widget);
          });
 
-children = w.get_children();
+children = w.<member>get_children</member>();
 for (i in children) {
     Seed.print(children[i]);
 }
@@ -127,7 +127,7 @@ Sometimes, it may be desirable to check that the functions you are connecting to
 </p>
 <div class="section">Structs and Unions</div>
 <p>
-Structs and Union's are given a constructor on the namespace. <span style="color:#ef2929">Gdk</span><span style="color:#729fcf">EventKey</span> simply having a constructor at <span style="color:#ef2929">Gdk</span>.<span style="color:#729fcf">EventKey</span>.
+Structs and Union's are given a constructor on the namespace. <namespace>Gdk</namespace><member>EventKey</member> simply having a constructor at <namespace>Gdk</namespace>.<member>EventKey</member>.
 </p>
 <div class="subsection">Constructors</div>
 <p>
@@ -135,23 +135,23 @@ Struct and Union constructors, accept as their only argument, a pair of initiali
 
 As an example,
 
- <pre class="javascript">c = new Clutter.Color({red: 0xff, alpha: 0xff});</pre>
+ <pre class="javascript">c = new <namespace>Clutter</namespace>.<type>Color</type>({red: 0xff, alpha: 0xff});</pre>
 
 All other fields are "zeroed" in the C sense that the memory is allocated with g_slice_alloc0.
 
-Like objects <code>Clutter.Color.prototype</code> is the prototype of all ClutterColor instances.
+Like objects <code><namespace>Clutter</namespace>.<type>Color</type>.<member>prototype</member></code> is the prototype of all ClutterColor instances.
 
-Again like objects, structs can have "named" constructors which take specific arguments, i.e. for <code><span style="color:#ef2929">soup</span>_<span style="color:#73d216">date</span>_new_<span style="color:#729fcf">from_now</span></code>
-<pre class="javascript">d = new <span style="color:#ef2929">Soup</span>.<span style="color:#73d216">Date</span>.<span style="color:#729fcf">from_now</span>(0)</pre>
+Again like objects, structs can have "named" constructors which take specific arguments, i.e. for <code><namespace>soup</namespace>_<type>date</type>_new_<member>from_now</member></code>
+<pre class="javascript">d = new <namespace>Soup</namespace>.<type>Date</type>.<member>from_now</member>(0)</pre>
 
-Once again <code>soup_date_new</code> would map to <code>Soup.Date.c_new</code>.
+Once again <code><namespace>soup</namespace>_<type>date</type>_<member>new</member></code> would map to <code><namespace>Soup</namespace>.<type>Date</type>.<member>c_new</member></code>.
 </p>
 <div class="subsection">Methods & Static Methods</div>
 <p>
 Non static methods are directly accessible from the object, i.e.
 <pre class="javascript">
-c = new Clutter.Color ({red: 0xff, alpha: 0xff});
-c.from_string ("purple");
+c = new <namespace>Clutter</namespace>.<type>Color</type> ({red: 0xff, alpha: 0xff});
+c.<member>from_string</member> ("purple");
 </pre>
 </p>
 <b>TODO: Static methods</b>
@@ -159,7 +159,7 @@ c.from_string ("purple");
 <p>
 Anywhere where a struct is expected, (property assignment, or a method call), a JavaScript object describing the struct can be used.
 <pre style="javascript">
-stage.color = {red: 0xff, blue: 0xcc, alpha: 0xff};
+stage.<member>color</member> = {red: 0xff, blue: 0xcc, alpha: 0xff};
 </pre>
 The semantics are identical to constructors, in that uninitialized fields will be zeroed.
 </p>
diff --git a/doc/style.css b/doc/style.css
index a5a0813..7faa315 100644
--- a/doc/style.css
+++ b/doc/style.css
@@ -66,3 +66,18 @@ code
 {
     font-weight: bold;
 }
+
+namespace
+{
+    color:#ef2929;
+}
+
+type
+{
+    color:#73d216;
+}
+
+member
+{
+    color:#729fcf;
+}



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