[seed] Add seed_importer_set_search_path to the API
- From: Robert Carr <racarr src gnome org>
- To: svn-commits-list gnome org
- Subject: [seed] Add seed_importer_set_search_path to the API
- Date: Fri, 17 Apr 2009 04:07:16 -0400 (EDT)
commit df6af1b41e14bfc4a256880b3318a30feb2e280c
Author: Robert Carr <racarr svn gnome org>
Date: Fri Apr 17 03:39:44 2009 -0400
Add seed_importer_set_search_path to the API
---
RELEASE | 7 ++++++-
libseed/seed-importer.c | 21 +++++++++++++++++++++
libseed/seed.h | 3 +++
3 files changed, 30 insertions(+), 1 deletions(-)
diff --git a/RELEASE b/RELEASE
index e2d9fa8..04a26c1 100644
--- a/RELEASE
+++ b/RELEASE
@@ -2,6 +2,10 @@ Today I am happy to announce the release of Seed 0.5. In keeping
with the naming of Seed releases after albums, Seed 0.5 is
designated "Transformer".
+Tarballs are available at http://ftp.gnome.org/pub/GNOME/sources/seed/0.5/
+it is also worth noting that Seed has moved to git.gnome.org since
+the last release.
+
For those not familiar, Seed (http://live.gnome.org/Seed), is a
library that bridges WebKit's JavaScriptCore interpreter, with
the GNOME platform. Using GObject-introspection, Seed provides
@@ -27,7 +31,8 @@ The new imports system, combined with changes to enum casing, makes it
significantly easier to port GJS code to Seed, and I now believe a port
of GNOME shell could be accomplished in an afternoon (by someone familiar).
-Seed now also has a bug tracker, at http://bugzilla.gnome.org/browse.cgi?product=seed.
+Seed now also has a bug tracker, at
+http://bugzilla.gnome.org/browse.cgi?product=seed.
A "full" changelog (it's pretty possible some things have been forgotten) is below.
diff --git a/libseed/seed-importer.c b/libseed/seed-importer.c
index 2a1a840..61571d8 100644
--- a/libseed/seed-importer.c
+++ b/libseed/seed-importer.c
@@ -845,6 +845,27 @@ seed_importer_add_global(JSObjectRef global,
g_hash_table_insert (file_imports, seed_importer_canonicalize_path (name), global);
}
+void
+seed_importer_set_search_path(JSContextRef ctx,
+ gchar **search_path)
+{
+ JSObjectRef imports, array;
+ JSValueRef *array_elem;
+ guint length = g_strv_length (search_path), i;
+
+ array_elem = g_alloca (length * sizeof (array_elem));
+ imports = (JSObjectRef) seed_object_get_property (ctx, JSContextGetGlobalObject (ctx), "imports");
+
+ for (i = 0; i < length; i++)
+ {
+ array_elem[i] = seed_value_from_string (ctx, search_path[i], NULL);
+ }
+
+ array = JSObjectMakeArray (ctx, length, array_elem, NULL);
+ seed_object_set_property (ctx, imports, "searchPath", array);
+
+}
+
void seed_initialize_importer(JSContextRef ctx,
JSObjectRef global)
{
diff --git a/libseed/seed.h b/libseed/seed.h
index 7797a58..974bbcf 100644
--- a/libseed/seed.h
+++ b/libseed/seed.h
@@ -369,5 +369,8 @@ seed_signal_connect_value (SeedContext ctx,
SeedObject seed_context_get_global_object (SeedContext ctx);
void seed_importer_add_global(SeedContext ctx, gchar *name);
+void seed_importer_set_search_path (JSContextRef ctx,
+ gchar **search_path);
+
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]