[seed] Start writing the mapping documentation



commit 066b57ac90721617763d75f7d7d815d86bf25796
Author: Robert Carr <racarr svn gnome org>
Date:   Sat Apr 25 15:08:40 2009 -0400

    Start writing the mapping documentation
---
 configure.ac                 |    4 ++-
 doc/Makefile.am              |    2 +-
 doc/mapping.html.in          |   27 -----------------
 doc/mapping/Makefile.am      |   10 ++++++
 doc/mapping/enum-mapping.png |  Bin 0 -> 10652 bytes
 doc/mapping/mapping.html.in  |   64 ++++++++++++++++++++++++++++++++++++++++++
 doc/style.css                |   13 ++++++++-
 7 files changed, 90 insertions(+), 30 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9ee2202..8eba9e5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -254,7 +254,6 @@ seed.pc
 Makefile
 
 doc/conventions.html
-doc/mapping.html
 doc/runtime.html
 doc/tutorial-standalone/tutorial.html
 doc/modules/canvas.html
@@ -262,6 +261,8 @@ doc/modules/multiprocessing.html
 doc/modules/readline.html
 doc/modules/sqlite.html
 
+doc/mapping/mapping.html
+
 scripts/shave
 scripts/shave-libtool
 
@@ -276,6 +277,7 @@ doc/Makefile
 doc/modules/Makefile
 doc/tutorial-standalone/Makefile
 doc/reference/Makefile
+doc/mapping/Makefile
 examples/Makefile
 examples/clutter-shader/Makefile
 examples/clutter-transitions/Makefile
diff --git a/doc/Makefile.am b/doc/Makefile.am
index ab607e2..a1e11f2 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = tutorial-standalone reference modules
+SUBDIRS = tutorial-standalone reference modules mapping
 
 EXTRA_DIST = \
 	runtime.html.in \
diff --git a/doc/mapping.html.in b/doc/mapping.html.in
deleted file mode 100644
index bba9860..0000000
--- a/doc/mapping.html.in
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
-<html xmlns="http://www.w3.org/1999/xhtml"; lang="en" xml:lang="en">
-<head>
-    <title>Seed C Mapping Conventions</title>
-    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-    <link rel="stylesheet" href="style.css" type="text/css" charset="utf-8" />
-    <script type="text/javascript" src="sh.js"></script>
-    <script type="text/javascript" src="sh_js.js"></script>
-    <link type="text/css" rel="stylesheet" href="sh.css" />
-    <style type="text/css">
-    div.section
-    {
-        font-weight: bold;
-    }
-    </style>
-
-</head>
-<body onload="sh_highlightDocument();">
-<div id="header">Seed C Mapping Conventions</div>
-<div id="subheader">v  VERSION@</div>
-<div class="section">Enums and Flags</div>
-<p>
-
-</p>
-</body>
-</html>
diff --git a/doc/mapping/Makefile.am b/doc/mapping/Makefile.am
new file mode 100644
index 0000000..a899177
--- /dev/null
+++ b/doc/mapping/Makefile.am
@@ -0,0 +1,10 @@
+
+tutorialdir=$(datadir)/doc/seed/mapping
+tutorial_DATA = \
+	mapping.html \
+	enum-mapping.png
+EXTRA_DIST = \
+	mapping.html.in
+
+## File created by the gnome-build tools
+
diff --git a/doc/mapping/enum-mapping.png b/doc/mapping/enum-mapping.png
new file mode 100644
index 0000000..eb675fa
Binary files /dev/null and b/doc/mapping/enum-mapping.png differ
diff --git a/doc/mapping/mapping.html.in b/doc/mapping/mapping.html.in
new file mode 100644
index 0000000..b0fd884
--- /dev/null
+++ b/doc/mapping/mapping.html.in
@@ -0,0 +1,64 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
+<html xmlns="http://www.w3.org/1999/xhtml"; lang="en" xml:lang="en">
+<head>
+    <title>Seed C Mapping Conventions</title>
+    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+    <link rel="stylesheet" href="../style.css" type="text/css" charset="utf-8" />
+    <script type="text/javascript" src="../sh.js"></script>
+    <script type="text/javascript" src="../sh_js.js"></script>
+    <link type="text/css" rel="stylesheet" href="../sh.css" />
+    <style type="text/css">
+    div.section
+    {
+        font-weight: bold;
+    }
+    </style>
+
+</head>
+<body onload="sh_highlightDocument();">
+<div id="header">Seed C Mapping Conventions</div>
+<div id="subheader">v  VERSION@</div>
+<div class="section">Enums and Flags</div>
+<p>
+The mapping of enum types to JavaScript is straightforward.
+</p>
+<div style="text-align: center;">
+<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.
+
+It is worth noting that this is the same convention as Vala.
+
+<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>.
+</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>.
+</p>
+<div class="subsection">Constructors</div>
+<p>
+Struct and Union constructors, accept as their only argument, a pair of initialization parameters for fields, paired to values.
+
+As an example,
+
+ <pre class="javascript">c = new Clutter.Color({red: 0xff, alpha: 0xff});</pre>
+
+All other fields are "zeroed" in the C sense that the memory is allocated with g_slice_alloc0.
+
+It is interesting to note, that <code>Clutter.Color.prototype</code> is the prototype of all ClutterColor instances.
+</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");
+</pre>
+</p>
+<div class="subsection">Implicit creation</div>
+</body>
+</html>
diff --git a/doc/style.css b/doc/style.css
index 92acbb5..a5a0813 100644
--- a/doc/style.css
+++ b/doc/style.css
@@ -29,6 +29,17 @@ div.section
 	margin-bottom: 10px;
 }
 
+div.subsection
+{
+	font-size: 12pt;
+	width: 100%;
+	border-bottom: 1px solid #ccc;
+	margin-bottom: 10px;
+	margin-left: 10px;
+}
+
+
+
 p
 {
 	margin-left: 10px;
@@ -54,4 +65,4 @@ div.filename
 code
 {
     font-weight: bold;
-}
\ No newline at end of file
+}



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