[seed] Making seed gjs-compatible by default



commit e64dbd22f8db5bda917978755f5d7f5c62f406fc
Author: Danilo Cesar Lemes de Paula <danilo cesar collabora co uk>
Date:   Mon Mar 14 11:38:18 2016 -0300

    Making seed gjs-compatible by default

 Makefile.am                    |    7 -------
 configure.ac                   |   14 --------------
 extensions/Makefile.am         |    2 --
 libseed/seed-engine.c          |   18 +-----------------
 libseed/seed-importer.c        |   20 ++++++++------------
 libseed/seed-private.h         |    4 ----
 modules/Makefile.am            |    2 --
 modules/gjs/Makefile.am        |    4 ----
 modules/gjs/system/Makefile.am |    6 ------
 9 files changed, 9 insertions(+), 68 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 15c4472..5a68b12 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -58,22 +58,15 @@ if PROFILE_MODULES
        cd modules/sqlite/.libs ; gcov *.c
 endif
 
-#gjs compat
 if PROFILE_MODULES
-if SEED_ENABLE_GJSCOMPAT
        cp modules/gjs/system/*.c modules/system/.libs/
 endif
-endif
 
 profile-gui: profile
 
 if PROFILE_MODULES
-if SEED_ENABLE_GJSCOMPAT
        lcov --directory libseed/.libs --directory modules/cairo/.libs --directory modules/canvas/.libs 
--directory modules/dbus/.libs --directory modules/example/.libs --directory modules/system/.libs --directory 
modules/gettext/.libs --directory modules/gtkbuilder/.libs --directory modules/libxml/.libs --directory 
modules/os/.libs --directory modules/readline/.libs --directory modules/sandbox/.libs --directory 
modules/sqlite/.libs --capture --output-file seed.info
 else
-       lcov --directory libseed/.libs --directory modules/cairo/.libs --directory modules/canvas/.libs 
--directory modules/dbus/.libs --directory modules/example/.libs --directory modules/gettext/.libs 
--directory modules/gtkbuilder/.libs --directory modules/libxml/.libs --directory modules/os/.libs 
--directory modules/readline/.libs --directory modules/sandbox/.libs --directory modules/sqlite/.libs 
--capture --output-file seed.info
-endif
-else
        lcov --directory libseed/.libs --capture --output-file seed.info
 endif
 
diff --git a/configure.ac b/configure.ac
index 02613b2..e0004a4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -447,19 +447,6 @@ AC_SUBST(SEED_DEBUG_CFLAGS)
 
 AC_CHECK_HEADERS(pty.h)
 
-dnl =============================Gjs-Compatibility=============================
-AC_ARG_ENABLE(gjs-compatibility,
-                         AC_HELP_STRING([--enable-gjs-compatibility],
-                                                        [enable gjs compatibility. [default=no]]),
-                         [enable_gjscompat="yes"],[enable_gjscompat="no"])
-
-if test "x$enable_gjscompat" = "xyes"; then
-       SEED_GJSCOMPAT_CFLAGS="-DSEED_ENABLE_GJSCOMPAT"
-fi
-
-AC_SUBST(SEED_GJSCOMPAT_CFLAGS)
-AM_CONDITIONAL(SEED_ENABLE_GJSCOMPAT, test "x$enable_gjscompat" = "xyes")
-
 dnl =============================gtk-doc=======================================
 GTK_DOC_CHECK(1.9)
 
@@ -537,7 +524,6 @@ Build Configuration:
    Profiling/Coverage.........$enable_profile
    Profiling for Modules......$enable_profile_modules
    gtk-doc....................$enable_gtk_doc
-   Gjs compatiblity...........$enable_gjscompat
 
 Installation:
    Prefix.....................$prefix
diff --git a/extensions/Makefile.am b/extensions/Makefile.am
index 241c9d9..dbb9b63 100644
--- a/extensions/Makefile.am
+++ b/extensions/Makefile.am
@@ -1,6 +1,4 @@
-if SEED_ENABLE_GJSCOMPAT
 SUBDIRS = gjs
-endif
 
 EXTRA_DIST= GLib.js Gio.js Seed.js.in Gtk.js GObject.js Clutter.js Gst.js repl.js
 
diff --git a/libseed/seed-engine.c b/libseed/seed-engine.c
index d08d57c..3e1fe7b 100644
--- a/libseed/seed-engine.c
+++ b/libseed/seed-engine.c
@@ -32,10 +32,8 @@
 JSObjectRef function_proto;
 
 JSObjectRef seed_obj_ref;
-#ifdef SEED_ENABLE_GJSCOMPAT
 JSObjectRef ARGV_obj_ref;
 JSObjectRef window_obj_ref;
-#endif
 
 GQuark qname;
 GQuark qprototype;
@@ -56,9 +54,6 @@ GQuark js_ref_quark;
 
 guint seed_debug_flags = 0;              /* global seed debug flag */
 gboolean seed_arg_print_version = FALSE; // Flag to print version and quit
-#ifdef SEED_ENABLE_GJSCOMPAT
-gboolean seed_arg_gjs_compatiblity = FALSE;
-#endif
 
 pthread_key_t seed_next_gobject_wrapper_key;
 
@@ -112,10 +107,8 @@ seed_prepare_global_context(JSContextRef ctx)
     seed_object_set_property(ctx, global, "imports", importer);
     seed_object_set_property(ctx, global, "GType", seed_gtype_constructor);
     seed_object_set_property(ctx, global, "Seed", seed_obj_ref);
-#ifdef SEED_ENABLE_GJSCOMPAT
     seed_object_set_property(ctx, global, "ARGV", ARGV_obj_ref);
     seed_object_set_property(ctx, global, "window", window_obj_ref);
-#endif
     seed_object_set_property(ctx, global, "print", seed_print_ref);
     seed_object_set_property(ctx, global, "printerr", seed_printerr_ref);
 
@@ -720,10 +713,7 @@ seed_gobject_method_invoked(JSContextRef ctx,
     // There's one out_arg AND tag != GI_TYPE_TAG_VOID
     // AND, of course, if it's not an INTERFACE.
     gboolean force_return_array = false;
-#ifdef SEED_ENABLE_GJSCOMPAT
-    if (seed_arg_gjs_compatiblity)
-        force_return_array = (tag != GI_TYPE_TAG_INTERFACE);
-#endif
+    force_return_array = (tag != GI_TYPE_TAG_INTERFACE);
 
     if (force_return_array) {
         if (n_out_args + !!(tag != GI_TYPE_TAG_VOID) > 1) {
@@ -1640,10 +1630,6 @@ static GOptionEntry seed_args[] = {
     { "seed-no-debug", 0, 0, G_OPTION_ARG_CALLBACK, seed_arg_no_debug_cb,
       "Disable Seed debugging", "FLAGS" },
 #endif /* SEED_ENABLE_DEBUG */
-#ifdef SEED_ENABLE_GJSCOMPAT
-    { "seed-gjs-compatibility", 0, 0, G_OPTION_ARG_NONE,
-      &seed_arg_gjs_compatiblity, "Enable gjs compatibility", 0 },
-#endif /* SEED_ENABLE_GJSCOMPAT */
     { "seed-version", 0, 0, G_OPTION_ARG_NONE, &seed_arg_print_version,
       "Print libseed version", 0 },
     {
@@ -1795,12 +1781,10 @@ seed_init_constrained_with_context_and_group(gint* argc,
     seed_object_set_property(eng->context, eng->global, "Seed", seed_obj_ref);
     JSValueProtect(eng->context, seed_obj_ref);
 
-#ifdef SEED_ENABLE_GJSCOMPAT
     window_obj_ref = JSObjectMake(eng->context, NULL, NULL);
     seed_object_set_property(eng->context, eng->global, "window",
                              window_obj_ref);
     JSValueProtect(eng->context, window_obj_ref);
-#endif
     g_irepository_require(g_irepository_get_default(), "GObject", NULL, 0, 0);
     g_irepository_require(g_irepository_get_default(), "GIRepository", NULL, 0,
                           0);
diff --git a/libseed/seed-importer.c b/libseed/seed-importer.c
index 0f30f38..2a66fbf 100644
--- a/libseed/seed-importer.c
+++ b/libseed/seed-importer.c
@@ -862,21 +862,17 @@ seed_importer_search_dirs(JSContextRef ctx,
 
     ret = NULL;
     walk = path;
-#ifdef SEED_ENABLE_GJSCOMPAT
-    if (seed_arg_gjs_compatiblity) {
-        while (walk) {
-            gchar* test_path = g_strconcat(walk->data, "/gjs", NULL);
+    while (walk) {
+        gchar* test_path = g_strconcat(walk->data, "/gjs", NULL);
 
-            ret = seed_importer_try_load(ctx, test_path, script_path, prop,
-                                         prop_as_js, prop_as_lib, exception);
-            g_free(test_path);
-            walk = walk->next;
+        ret = seed_importer_try_load(ctx, test_path, script_path, prop,
+                                     prop_as_js, prop_as_lib, exception);
+        g_free(test_path);
+        walk = walk->next;
 
-            if (ret)
-                break;
-        }
+        if (ret)
+            break;
     }
-#endif
     if (!ret) {
         walk = path;
         while (walk) {
diff --git a/libseed/seed-private.h b/libseed/seed-private.h
index 17627b7..6fde94e 100644
--- a/libseed/seed-private.h
+++ b/libseed/seed-private.h
@@ -54,8 +54,4 @@ struct _SeedEngine
 #include "seed-exceptions.h"
 #include "seed-importer.h"
 
-#ifdef SEED_ENABLE_GJSCOMPAT
-extern gboolean seed_arg_gjs_compatiblity;
-#endif
-
 #endif
diff --git a/modules/Makefile.am b/modules/Makefile.am
index 3ed114d..d363381 100644
--- a/modules/Makefile.am
+++ b/modules/Makefile.am
@@ -1,5 +1,3 @@
 SUBDIRS = example sqlite canvas multiprocessing readline os sandbox dbus libxml cairo gtkbuilder gettext 
mpfr ffi DynamicObject xorg
 
-if SEED_ENABLE_GJSCOMPAT
 SUBDIRS += gjs
-endif
diff --git a/modules/gjs/Makefile.am b/modules/gjs/Makefile.am
index a2f2e0b..3ab87eb 100644
--- a/modules/gjs/Makefile.am
+++ b/modules/gjs/Makefile.am
@@ -1,10 +1,6 @@
-if SEED_ENABLE_GJSCOMPAT
-
 SUBDIRS = system
 
 EXTRA_DIST= cairo.js coverage.js format.js gettext.js jsUnit.js lang.js mainloop.js package.js signals.js
 
 gjs_extensiondir=$(datadir)/seed SEED_GTK_VERSION@/gjs
 gjs_extension_DATA = cairo.js coverage.js format.js gettext.js jsUnit.js lang.js mainloop.js package.js 
signals.js
-
-endif
\ No newline at end of file
diff --git a/modules/gjs/system/Makefile.am b/modules/gjs/system/Makefile.am
index 22f63af..20167d7 100644
--- a/modules/gjs/system/Makefile.am
+++ b/modules/gjs/system/Makefile.am
@@ -1,5 +1,3 @@
-if SEED_ENABLE_GJSCOMPAT
-
 seedlibdir = ${libdir}/seed SEED_GTK_VERSION@/gjs
 
 seedlib_LTLIBRARIES = \
@@ -22,7 +20,3 @@ libseed_system_la_LIBADD = \
        $(top_builddir)/libseed/libseed SEED_GTK_VERSION@.la \
        $(SEED_PROFILE_LIBS)
 
-endif
-
-
-


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