[seed] [docs] Scan seed-header.h; install seed-header.h; docs for seed-header.h



commit ad5feadbd8a0b3f8f8d1551a1e9263fcada58061
Author: Tim Horton <hortont424 gmail com>
Date:   Thu Jul 9 00:14:26 2009 -0400

    [docs] Scan seed-header.h; install seed-header.h; docs for seed-header.h

 doc/reference/seed-sections.txt      |    3 +
 doc/reference/tmpl/seed-modules.sgml |   28 +++++++++++++
 libseed/Makefile.am                  |    2 +-
 libseed/seed-module.h                |   72 ++++++++++++++++++++++++++++++++++
 modules/Makefile.am                  |    2 -
 modules/cairo/Makefile.am            |    1 -
 modules/canvas/Makefile.am           |    1 -
 modules/dbus/Makefile.am             |    1 -
 modules/example/Makefile.am          |    1 -
 modules/gettext/Makefile.am          |    1 -
 modules/gtkbuilder/Makefile.am       |    1 -
 modules/libxml/Makefile.am           |    1 -
 modules/mpfr/Makefile.am             |    1 -
 modules/multiprocessing/Makefile.am  |    3 +-
 modules/os/Makefile.am               |    3 +-
 modules/readline/Makefile.am         |    2 +-
 modules/sandbox/Makefile.am          |    1 -
 modules/seed-module.h                |   33 ---------------
 modules/sqlite/Makefile.am           |    2 +-
 19 files changed, 108 insertions(+), 51 deletions(-)
---
diff --git a/doc/reference/seed-sections.txt b/doc/reference/seed-sections.txt
index 0b06988..83d1d07 100644
--- a/doc/reference/seed-sections.txt
+++ b/doc/reference/seed-sections.txt
@@ -180,5 +180,8 @@ seed_closure_warn_exception
 <SECTION>
 <TITLE>Modules</TITLE>
 <FILE>seed-modules</FILE>
+CHECK_ARG_COUNT
+DEFINE_ENUM_MEMBER
+DEFINE_ENUM_MEMBER_EXT
 SeedModuleInitCallback
 </SECTION>
diff --git a/doc/reference/tmpl/seed-modules.sgml b/doc/reference/tmpl/seed-modules.sgml
index 4f446dc..25c423c 100644
--- a/doc/reference/tmpl/seed-modules.sgml
+++ b/doc/reference/tmpl/seed-modules.sgml
@@ -104,6 +104,34 @@ hello.say_hello_to("Tim");
 <!-- ##### SECTION Stability_Level ##### -->
 
 
+<!-- ##### MACRO CHECK_ARG_COUNT ##### -->
+<para>
+
+</para>
+
+ name: 
+ argnum: 
+
+
+<!-- ##### MACRO DEFINE_ENUM_MEMBER ##### -->
+<para>
+
+</para>
+
+ holder: 
+ member: 
+
+
+<!-- ##### MACRO DEFINE_ENUM_MEMBER_EXT ##### -->
+<para>
+
+</para>
+
+ holder: 
+ name: 
+ val: 
+
+
 <!-- ##### USER_FUNCTION SeedModuleInitCallback ##### -->
 <para>
 
diff --git a/libseed/Makefile.am b/libseed/Makefile.am
index 9b87d67..909aa2a 100644
--- a/libseed/Makefile.am
+++ b/libseed/Makefile.am
@@ -42,7 +42,7 @@ libseed_la_LDFLAGS = \
 	$(SEED_OSX_LIBS) \
 	$(FFI_LDFLAGS)
 
-seedheaders_HEADERS = seed.h seed-debug.h
+seedheaders_HEADERS = seed.h seed-debug.h seed-module.h
 
 seedheadersdir = $(pkgincludedir)
 
diff --git a/libseed/seed-module.h b/libseed/seed-module.h
new file mode 100644
index 0000000..ae64356
--- /dev/null
+++ b/libseed/seed-module.h
@@ -0,0 +1,72 @@
+#ifndef _SEED_MODULE_H_
+#define _SEED_MODULE_H_
+
+#include "../libseed/seed.h"
+
+// TODO: Move [example sqlite canvas Multiprocessing
+//             os sandbox dbus libxml cairo]
+//       towards utilization of this header.
+
+/**
+ * CHECK_ARG_COUNT:
+ * @name: The name of the function being called from, pretty-printed
+ * @argnum: The number of arguments which should be passed into the function
+ *
+ * Check that the required number of arguments were passed into a
+ * #SeedFunctionCallback. If this is not true, raise an exception and
+ * return %NULL. This requires the callback to use "argument_count",
+ * "ctx", and "exception" as the names of the various function arguments.
+ *
+ * @name should be of form "namespace.function_name"
+ *
+ * At the moment, there is no way to specify more than one acceptable
+ * argument count.
+ *
+ */
+
+#define CHECK_ARG_COUNT(name, argnum) \
+	if ( argument_count != argnum ) \
+	{ \
+		seed_make_exception (ctx, exception, "ArgumentError", \
+		                     "wrong number of arguments; expected %s, got %Zd", \
+		                     #argnum, argument_count); \
+		return seed_make_undefined (ctx); \
+	}
+
+/**
+ * DEFINE_ENUM_MEMBER:
+ * @holder: The object on which to define the enum member
+ * @member: The enum member, as it is named in C
+ *
+ * Defines a property on @holder which is named the same as @member, and
+ * is assigned the value that @member has in C.
+ *
+ * This macro works for defining properties from constants and defines as well.
+ *
+ */
+#define DEFINE_ENUM_MEMBER(holder, member) \
+	seed_object_set_property(ctx, holder, #member, \
+	                         seed_value_from_long(ctx, member, NULL))
+
+/**
+ * DEFINE_ENUM_MEMBER_EXT:
+ * @holder: The object on which to define the enum member
+ * @name: The enum member, as it should be named in JavaScript
+ * @val: The enum member, as it is named in C
+ *
+ * Defines a property on @holder which is named @name, and is assigned the
+ * value that @member has in C. This allows for an override of the enum
+ * member's name, most often to remove a common prefix. For example, to declare
+ * a property named VERSION_MAJOR on the namespace from mfpr's version
+ * constant MPFR_VERSION_MAJOR:
+ *
+ * <programlisting>
+ * DEFINE_ENUM_MEMBER_EXT(ns, "VERSION_MAJOR", MPFR_VERSION_MAJOR);
+ * </programlisting>
+ *
+ */
+#define DEFINE_ENUM_MEMBER_EXT(holder, name, val) \
+	seed_object_set_property(ctx, holder, name, \
+	                         seed_value_from_long(ctx, val, NULL))
+
+#endif
diff --git a/modules/Makefile.am b/modules/Makefile.am
index d90f8a5..1871e3d 100644
--- a/modules/Makefile.am
+++ b/modules/Makefile.am
@@ -1,3 +1 @@
 SUBDIRS = example sqlite canvas multiprocessing readline os sandbox dbus libxml cairo gtkbuilder gettext mpfr
-
-EXTRA_DIST = seed-module.h
diff --git a/modules/cairo/Makefile.am b/modules/cairo/Makefile.am
index 8a1e205..c0867b4 100644
--- a/modules/cairo/Makefile.am
+++ b/modules/cairo/Makefile.am
@@ -26,7 +26,6 @@ libseed_cairo_la_CFLAGS = \
 	-Wall \
 	$(GOBJECT_INTROSPECTION_CFLAGS) \
 	-I top_srcdir@/libseed/ \
-	-I top_srcdir@/modules/ \
 	$(CAIRO_CFLAGS) \
 	$(GDK_CFLAGS) \
 	$(SEED_DEBUG_CFLAGS) \
diff --git a/modules/canvas/Makefile.am b/modules/canvas/Makefile.am
index d66c1d1..8c436d7 100644
--- a/modules/canvas/Makefile.am
+++ b/modules/canvas/Makefile.am
@@ -12,7 +12,6 @@ libseed_canvas_la_SOURCES = \
 libseed_canvas_la_CFLAGS = \
 	$(GOBJECT_INTROSPECTION_CFLAGS) \
 	-I top_srcdir@/libseed/ \
-	-I top_srcdir@/modules/ \
 	$(CAIRO_CFLAGS) \
 	$(SEED_DEBUG_CFLAGS) \
 	$(SEED_PROFILE_CFLAGS)
diff --git a/modules/dbus/Makefile.am b/modules/dbus/Makefile.am
index d366526..d23497e 100644
--- a/modules/dbus/Makefile.am
+++ b/modules/dbus/Makefile.am
@@ -28,7 +28,6 @@ libseed_dbusnative_la_SOURCES = \
 libseed_dbusnative_la_CFLAGS = \
 	-Wall \
 	-I top_srcdir@/libseed/ \
-	-I top_srcdir@/modules/ \
 	$(GOBJECT_INTROSPECTION_CFLAGS) \
 	$(DBUS_CFLAGS) \
 	$(SEED_DEBUG_CFLAGS) \
diff --git a/modules/example/Makefile.am b/modules/example/Makefile.am
index 4cd6060..a01a0de 100644
--- a/modules/example/Makefile.am
+++ b/modules/example/Makefile.am
@@ -10,7 +10,6 @@ libseed_example_la_SOURCES = \
 
 AM_CPPFLAGS = \
 	-I top_srcdir@/libseed/ \
-	-I top_srcdir@/modules/ \
 	$(GOBJECT_INTROSPECTION_CFLAGS) \
 	$(SEED_DEBUG_CFLAGS) \
 	$(SEED_PROFILE_CFLAGS)
diff --git a/modules/gettext/Makefile.am b/modules/gettext/Makefile.am
index ffd7b9e..4b739c9 100644
--- a/modules/gettext/Makefile.am
+++ b/modules/gettext/Makefile.am
@@ -10,7 +10,6 @@ libseed_gettext_la_SOURCES = \
 
 AM_CPPFLAGS = \
 	-I top_srcdir@/libseed/ \
-	-I top_srcdir@/modules/ \
 	$(GOBJECT_INTROSPECTION_CFLAGS) \
 	$(SEED_DEBUG_CFLAGS) \
 	$(SEED_PROFILE_CFLAGS)
diff --git a/modules/gtkbuilder/Makefile.am b/modules/gtkbuilder/Makefile.am
index eb6d2af..d1629a8 100644
--- a/modules/gtkbuilder/Makefile.am
+++ b/modules/gtkbuilder/Makefile.am
@@ -11,7 +11,6 @@ libseed_gtkbuilder_la_SOURCES = \
 
 AM_CPPFLAGS = \
 	-I top_srcdir@/libseed/ \
-	-I top_srcdir@/modules/ \
 	$(GOBJECT_INTROSPECTION_CFLAGS) \
 	$(GTK_CFLAGS) \
 	$(SEED_DEBUG_CFLAGS) \
diff --git a/modules/libxml/Makefile.am b/modules/libxml/Makefile.am
index 95202e3..a2570ea 100644
--- a/modules/libxml/Makefile.am
+++ b/modules/libxml/Makefile.am
@@ -12,7 +12,6 @@ libseed_libxml_la_SOURCES = \
 
 AM_CPPFLAGS = \
 	-I top_srcdir@/libseed/ \
-	-I top_srcdir@/modules/ \
 	$(LIBXML_CFLAGS) \
 	$(GOBJECT_INTROSPECTION_CFLAGS) \
 	$(SEED_DEBUG_CFLAGS) \
diff --git a/modules/mpfr/Makefile.am b/modules/mpfr/Makefile.am
index 83026a8..1aebedd 100644
--- a/modules/mpfr/Makefile.am
+++ b/modules/mpfr/Makefile.am
@@ -13,7 +13,6 @@ libseed_mpfr_la_SOURCES = \
 
 AM_CPPFLAGS = \
 	-I top_srcdir@/libseed/ \
-	-I top_srcdir@/modules/ \
 	$(GOBJECT_INTROSPECTION_CFLAGS) \
 	$(SEED_DEBUG_CFLAGS) \
 	$(SEED_PROFILE_CFLAGS)
diff --git a/modules/multiprocessing/Makefile.am b/modules/multiprocessing/Makefile.am
index 0ea9866..914aead 100644
--- a/modules/multiprocessing/Makefile.am
+++ b/modules/multiprocessing/Makefile.am
@@ -11,9 +11,8 @@ libseed_multiprocessing_la_SOURCES = \
 	seed-multiprocessing.c
 
 libseed_multiprocessing_la_CFLAGS = \
-	$(GOBJECT_INTROSPECTION_CFLAGS) \
 	-I top_srcdir@/libseed/ \
-	-I top_srcdir@/modules/ \
+	$(GOBJECT_INTROSPECTION_CFLAGS) \
 	$(SEED_DEBUG_CFLAGS) \
 	$(SEED_PROFILE_CFLAGS)
 
diff --git a/modules/os/Makefile.am b/modules/os/Makefile.am
index 528804f..4d877a3 100644
--- a/modules/os/Makefile.am
+++ b/modules/os/Makefile.am
@@ -9,9 +9,8 @@ libseed_os_la_SOURCES = \
 	seed-os.c
 
 libseed_os_la_CFLAGS = \
-	$(GOBJECT_INTROSPECTION_CFLAGS) \
 	-I top_srcdir@/libseed/ \
-	-I top_srcdir@/modules/ \
+	$(GOBJECT_INTROSPECTION_CFLAGS) \
 	$(SEED_DEBUG_CFLAGS) \
 	$(SEED_PROFILE_CFLAGS)
 
diff --git a/modules/readline/Makefile.am b/modules/readline/Makefile.am
index 3380d04..d36c83d 100644
--- a/modules/readline/Makefile.am
+++ b/modules/readline/Makefile.am
@@ -9,9 +9,9 @@ libseed_readline_la_SOURCES = \
 	seed-readline.c
 
 libseed_readline_la_CFLAGS = \
+	-I top_srcdir@/libseed/ \
 	$(GOBJECT_INTROSPECTION_CFLAGS) \
 	$(FFI_CFLAGS) \
-	-I top_srcdir@/modules/ \
 	$(SEED_DEBUG_CFLAGS) \
 	$(SEED_PROFILE_CFLAGS)
 
diff --git a/modules/sandbox/Makefile.am b/modules/sandbox/Makefile.am
index 39e60b1..cea9b0a 100644
--- a/modules/sandbox/Makefile.am
+++ b/modules/sandbox/Makefile.am
@@ -9,7 +9,6 @@ libseed_sandbox_la_SOURCES = \
 
 AM_CPPFLAGS = \
 	-I top_srcdir@/libseed/ \
-	-I top_srcdir@/modules/ \
 	$(GOBJECT_INTROSPECTION_CFLAGS) \
 	$(SEED_DEBUG_CFLAGS) \
 	$(SEED_PROFILE_CFLAGS)
diff --git a/modules/sqlite/Makefile.am b/modules/sqlite/Makefile.am
index 8732d09..b12455f 100644
--- a/modules/sqlite/Makefile.am
+++ b/modules/sqlite/Makefile.am
@@ -10,7 +10,7 @@ libseed_sqlite_la_SOURCES = \
 	seed-sqlite.c
 
 libseed_sqlite_la_CFLAGS = \
-	-I top_srcdir@/modules/ \
+	-I top_srcdir@/libseed/ \
 	$(GOBJECT_INTROSPECTION_CFLAGS) \
 	$(SQLITE_CFLAGS) \
 	$(SEED_DEBUG_CFLAGS) \



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