Commit d3e2f861 authored by Philip Chimento's avatar Philip Chimento

module: Get rid of internals API

This removes gjs-internals-1.0.pc and gjs-module.h, and makes all the
module header files private, that were previously installed.

Removes "do not include separately" guards from those files, and makes
sure they are included with quotes instead of angle brackets. Untangles
any header inclusion problems resulting from the removal of gjs-module.h.

https://bugzilla.gnome.org/show_bug.cgi?id=772386
parent ce2b82ee
......@@ -30,48 +30,16 @@ gjsjsdir = @gjsjsdir@
gjsoverridedir = $(gjsjsdir)/overrides
gjs_public_includedir = $(includedir)/gjs-1.0
gjs_module_includedir = $(includedir)/gjs-1.0
########################################################################
nobase_gjs_public_include_HEADERS = \
gjs/context.h \
gjs/gjs.h
nobase_gjs_module_include_HEADERS = \
gjs/gjs-module.h \
gjs/compat.h \
gjs/coverage.h \
gjs/byteArray.h \
gjs/importer.h \
gjs/jsapi-util.h \
gjs/runtime.h \
gjs/type-module.h \
gjs/mem.h \
gjs/native.h \
gi/ns.h \
gi/object.h \
gi/foreign.h \
gi/fundamental.h \
gi/param.h \
gi/repo.h \
gi/union.h \
gi/value.h \
gi/arg.h \
gi/boxed.h \
gi/closure.h \
gi/enumeration.h \
gi/function.h \
gi/keep-alive.h \
gi/interface.h \
gi/gtype.h \
gi/gerror.h
########################################################################
pkgconfig_DATA = gjs-1.0.pc gjs-internals-1.0.pc
pkgconfig_DATA = gjs-1.0.pc
EXTRA_DIST += \
gjs-1.0.pc.in \
gjs-internals-1.0.pc.in
EXTRA_DIST += gjs-1.0.pc.in
########################################################################
gjs_directory_defines = \
......@@ -177,6 +145,36 @@ endif
libgjs_la_SOURCES += $(libgjs_private_source_files)
# These used to be public headers for external modules
libgjs_la_SOURCES += \
gjs/compat.h \
gjs/coverage.h \
gjs/byteArray.h \
gjs/importer.h \
gjs/jsapi-util.h \
gjs/runtime.h \
gjs/type-module.h \
gjs/mem.h \
gjs/native.h \
gi/ns.h \
gi/object.h \
gi/foreign.h \
gi/fundamental.h \
gi/param.h \
gi/repo.h \
gi/union.h \
gi/value.h \
gi/arg.h \
gi/boxed.h \
gi/closure.h \
gi/enumeration.h \
gi/function.h \
gi/keep-alive.h \
gi/interface.h \
gi/gtype.h \
gi/gerror.h \
$(NULL)
GjsPrivate-1.0.gir: libgjs.la
GjsPrivate_1_0_gir_LIBS = libgjs.la
GjsPrivate_1_0_gir_INCLUDES = GObject-2.0 Gio-2.0
......
......@@ -196,7 +196,7 @@ AC_SUBST([gjsjsdir], [\${datadir}/gjs-1.0])
dnl automake 1.11/1.12 defines this but does not substitute it
AC_SUBST([pkglibexecdir], ["${libexecdir}/${PACKAGE}"])
AC_CONFIG_FILES([Makefile gjs-1.0.pc gjs-internals-1.0.pc])
AC_CONFIG_FILES([Makefile gjs-1.0.pc])
dnl Symlink the files from gobject-introspection's test libraries into the tree;
dnl Automake plans to drop support for compiling them in-place.
AC_CONFIG_LINKS([
......
......@@ -35,8 +35,7 @@
#include "value.h"
#include "gerror.h"
#include "gjs/byteArray.h"
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include "gjs/compat.h"
#include <util/log.h>
......
......@@ -28,8 +28,8 @@
#include "boxed.h"
#include "arg.h"
#include "object.h"
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include "gjs/compat.h"
#include "gjs/mem.h"
#include "repo.h"
#include "proxyutils.h"
#include "function.h"
......
......@@ -28,9 +28,9 @@
#include <util/log.h>
#include "closure.h"
#include "gjs/compat.h"
#include "gjs/mem.h"
#include "keep-alive.h"
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
typedef struct {
GClosure base;
......
......@@ -25,8 +25,7 @@
#include <string.h>
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include "gjs/compat.h"
#include "repo.h"
#include "gtype.h"
#include "function.h"
......
......@@ -24,12 +24,11 @@
#include <config.h>
#include <string.h>
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include <girepository.h>
#include "arg.h"
#include "foreign.h"
#include "gjs/compat.h"
static struct {
char *gi_namespace;
......
......@@ -33,9 +33,9 @@
#include "closure.h"
#include "gtype.h"
#include "param.h"
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include <gjs/jsapi-private.h>
#include "gjs/compat.h"
#include "gjs/jsapi-private.h"
#include "gjs/mem.h"
#include <util/log.h>
......
......@@ -33,9 +33,10 @@
#include "gtype.h"
#include "proxyutils.h"
#include "repo.h"
#include "gjs/compat.h"
#include "gjs/mem.h"
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include <gjs/context.h>
#include <util/log.h>
#include <girepository.h>
......
......@@ -25,10 +25,10 @@
#include <string.h>
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include "boxed.h"
#include "enumeration.h"
#include "gjs/compat.h"
#include "gjs/mem.h"
#include "repo.h"
#include "gerror.h"
......
......@@ -26,8 +26,7 @@
#include "gtype.h"
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include "gjs/compat.h"
#include <util/log.h>
#include <girepository.h>
......
......@@ -28,9 +28,9 @@
#include "gtype.h"
#include "interface.h"
#include "repo.h"
#include "gjs/compat.h"
#include "gjs/mem.h"
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include <util/log.h>
#include <girepository.h>
......
......@@ -23,11 +23,9 @@
#include <config.h>
#include "gjs/compat.h"
#include "keep-alive.h"
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include <util/log.h>
#include <util/glib.h>
......
......@@ -26,8 +26,8 @@
#include "ns.h"
#include "repo.h"
#include "param.h"
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include "gjs/compat.h"
#include "gjs/mem.h"
#include <util/log.h>
#include <girepository.h>
......
......@@ -26,7 +26,7 @@
#include <memory>
#include <string.h>
#include <gjs/gi.h>
#include "gjs/gi.h"
#include "object.h"
#include "gtype.h"
#include "interface.h"
......@@ -40,11 +40,10 @@
#include "keep-alive.h"
#include "closure.h"
#include "gjs_gi_trace.h"
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include <gjs/type-module.h>
#include <gjs/context-private.h>
#include "gjs/compat.h"
#include "gjs/context-private.h"
#include "gjs/mem.h"
#include "gjs/type-module.h"
#include <util/log.h>
#include <util/hash-x32.h>
......
......@@ -31,8 +31,8 @@
#include "repo.h"
#include "gtype.h"
#include "function.h"
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include "gjs/compat.h"
#include "gjs/mem.h"
#include <util/log.h>
......
......@@ -24,8 +24,8 @@
#ifndef __GJS_PROXYUTILS_H__
#define __GJS_PROXYUTILS_H__
#include "gjs/gi.h"
#include "gjs/jsapi-util.h"
#include <gjs/gi.h>
G_BEGIN_DECLS
......
......@@ -37,8 +37,9 @@
#include "interface.h"
#include "gerror.h"
#include <gjs/compat.h>
#include <gjs/jsapi-private.h>
#include "gjs/compat.h"
#include "gjs/jsapi-private.h"
#include "gjs/mem.h"
#include <util/misc.h>
......
......@@ -29,7 +29,7 @@
#include <girepository.h>
#include <gjs/gjs-module.h>
#include "gjs/compat.h"
#include <util/log.h>
G_BEGIN_DECLS
......
......@@ -31,8 +31,8 @@
#include "union.h"
#include "arg.h"
#include "object.h"
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include "gjs/compat.h"
#include "gjs/mem.h"
#include "repo.h"
#include "proxyutils.h"
#include "function.h"
......
......@@ -36,8 +36,7 @@
#include "union.h"
#include "gtype.h"
#include "gerror.h"
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include "gjs/compat.h"
#include <girepository.h>
......
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
bindir=@bindir@
includedir=@includedir@
datarootdir=@datarootdir@
datadir=@datadir@
jsdir=@gjsjsdir@
Cflags: -I${includedir}/gjs-1.0
Requires: gjs-1.0 gobject-introspection-1.0 mozjs-24
Name: gjs-internals-1.0
Description: Internal API for gjs (for modules and embedders); uses mozjs
Version: @VERSION@
......@@ -25,9 +25,8 @@
#include <string.h>
#include <glib.h>
#include "byteArray.h"
#include "../gi/boxed.h"
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include "gi/boxed.h"
#include "compat.h"
#include <girepository.h>
#include <util/log.h>
......
......@@ -24,10 +24,6 @@
#ifndef __GJS_BYTE_ARRAY_H__
#define __GJS_BYTE_ARRAY_H__
#if !defined (__GJS_GJS_H__) && !defined (GJS_COMPILATION)
#error "Only <gjs/gjs.h> can be included directly."
#endif
#include <stdbool.h>
#include <glib.h>
#include "gjs/jsapi-util.h"
......
......@@ -22,10 +22,6 @@
* IN THE SOFTWARE.
*/
#if !defined (__GJS_GJS_MODULE_H__) && !defined (GJS_COMPILATION)
#error "Only <gjs/gjs-module.h> can be included directly."
#endif
#ifndef __GJS_COMPAT_H__
#define __GJS_COMPAT_H__
......@@ -48,7 +44,7 @@ _Pragma("GCC diagnostic pop")
#include <stdbool.h>
#include <glib.h>
#include <gjs/jsapi-util.h>
#include "jsapi-util.h"
G_BEGIN_DECLS
......
......@@ -27,7 +27,8 @@
#include <locale.h>
#include <gjs/gjs.h>
#include <gjs/coverage.h>
#include "coverage.h"
static char **include_path = NULL;
static char **coverage_prefixes = NULL;
......
......@@ -21,10 +21,6 @@
#ifndef _GJS_COVERAGE_INTERNAL_H
#define _GJS_COVERAGE_INTERNAL_H
#ifndef GJS_COMPILATION
#error This file is for internal use and use in the tests only
#endif
#include "jsapi-util.h"
#include "coverage.h"
......
......@@ -21,10 +21,11 @@
#include <sys/stat.h>
#include <gio/gio.h>
#include "gjs-module.h"
#include <gjs/context.h>
#include "coverage.h"
#include "coverage-internal.h"
#include "importer.h"
#include "util/error.h"
struct _GjsCoveragePrivate {
......
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
/*
* Copyright (c) 2010 Red Hat, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#ifndef __GJS_GJS_MODULE_H__
#define __GJS_GJS_MODULE_H__
#include <gjs/gjs.h>
#include <gjs/native.h>
#include <gjs/mem.h>
#include <gjs/importer.h>
#include <gjs/runtime.h>
#include <gjs/jsapi-util.h>
#endif /* __GJS_GJS_umodule_H__ */
......@@ -26,9 +26,10 @@
#include <util/log.h>
#include <util/glib.h>
#include <gjs/gjs-module.h>
#include <gjs/importer.h>
#include <gjs/compat.h>
#include "compat.h"
#include "importer.h"
#include "mem.h"
#include "native.h"
#include <gio/gio.h>
......
......@@ -24,10 +24,6 @@
#ifndef __GJS_IMPORTER_H__
#define __GJS_IMPORTER_H__
#if !defined (__GJS_GJS_MODULE_H__) && !defined (GJS_COMPILATION)
#error "Only <gjs/gjs-module.h> can be included directly."
#endif
#include <stdbool.h>
#include <glib.h>
#include "gjs/jsapi-util.h"
......
......@@ -24,16 +24,13 @@
#ifndef __GJS_JSAPI_UTIL_H__
#define __GJS_JSAPI_UTIL_H__
#if !defined (__GJS_GJS_MODULE_H__) && !defined (GJS_COMPILATION)
#error "Only <gjs/gjs-module.h> can be included directly."
#endif
#include <stdbool.h>
#include <gjs/compat.h>
#include <gjs/runtime.h>
#include <glib-object.h>
#include <gi/gtype.h>
#include "gjs/compat.h"
#include "gjs/runtime.h"
#include "gi/gtype.h"
G_BEGIN_DECLS
......
......@@ -24,10 +24,6 @@
#ifndef __GJS_MEM_H__
#define __GJS_MEM_H__
#if !defined (__GJS_GJS_MODULE_H__) && !defined (GJS_COMPILATION)
#error "Only <gjs/gjs-module.h> can be included directly."
#endif
#include <stdbool.h>
#include <glib.h>
#include "gjs/jsapi-util.h"
......
......@@ -24,10 +24,6 @@
#ifndef __GJS_NATIVE_H__
#define __GJS_NATIVE_H__
#if !defined (__GJS_GJS_MODULE_H__) && !defined (GJS_COMPILATION)
#error "Only <gjs/gjs-module.h> can be included directly."
#endif
#include <stdbool.h>
#include <glib.h>
#include "gjs/jsapi-util.h"
......
......@@ -26,12 +26,15 @@
#include <glib.h>
#include <glib/gstdio.h>
#include <girepository.h>
#include <gjs/gjs-module.h>
#include <gjs/coverage.h>
#include <locale.h>
#include <string.h>
#include <gjs/gjs.h>
#include "gjs/coverage.h"
#include "gjs/mem.h"
typedef struct {
const char *coverage_prefix;
const char *coverage_output_path;
......
......@@ -22,9 +22,8 @@
#include <config.h>
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include <gi/foreign.h>
#include "gjs/compat.h"
#include "gi/foreign.h"
#include <cairo.h>
#include <cairo-gobject.h>
......
......@@ -22,8 +22,7 @@
#include <config.h>
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include "gjs/compat.h"
#include <cairo.h>
#include "cairo-private.h"
......
......@@ -22,8 +22,7 @@
#include <config.h>
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include "gjs/compat.h"
#include <cairo.h>
#include "cairo-private.h"
......
......@@ -22,8 +22,7 @@
#include <config.h>
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include "gjs/compat.h"
#include <cairo.h>
#include "cairo-private.h"
......
......@@ -22,8 +22,7 @@
#include <config.h>
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include "gjs/compat.h"
#include <cairo.h>
#include "cairo-private.h"
......
......@@ -22,8 +22,7 @@
#include <config.h>
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include "gjs/compat.h"
#include <cairo.h>
#include <cairo-gobject.h>
#include "cairo-private.h"
......
......@@ -22,8 +22,7 @@
#include <config.h>
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include "gjs/compat.h"
#include <cairo.h>
#include "cairo-private.h"
......
......@@ -22,8 +22,7 @@
#include <config.h>
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include "gjs/compat.h"
#include <cairo.h>
#include "cairo-private.h"
......
......@@ -22,8 +22,7 @@
#include <config.h>
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include "gjs/compat.h"
#include <cairo.h>
#include "cairo-private.h"
......
......@@ -22,9 +22,8 @@
#include <config.h>
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include <gi/foreign.h>
#include "gjs/compat.h"
#include "gi/foreign.h"
#include <cairo.h>
#include <cairo-gobject.h>
......
......@@ -22,8 +22,7 @@
#include <config.h>
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include "gjs/compat.h"
#include <cairo.h>
#include "cairo-private.h"
......
......@@ -22,8 +22,7 @@
#include <config.h>
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include "gjs/compat.h"
#include <cairo.h>
#include "cairo-private.h"
......
......@@ -22,9 +22,8 @@
#include <config.h>
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include <gi/foreign.h>
#include "gjs/compat.h"
#include "gi/foreign.h"
#include <cairo.h>
#include <cairo-gobject.h>
#include "cairo-private.h"
......
......@@ -22,8 +22,7 @@
#include <config.h>
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include "gjs/compat.h"
#include <cairo.h>
#include "cairo-private.h"
......
......@@ -22,9 +22,7 @@
#include <config.h>
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include "gjs/compat.h"
#include "cairo-private.h"
#if CAIRO_HAS_XLIB_SURFACE
......
......@@ -51,11 +51,10 @@
#include <glib.h>
#include <glib/gprintf.h>
#include <gjs/gjs-module.h>
#include <gjs/compat.h>
#include <gjs/jsapi-private.h>
#include "console.h"
#include "gjs/compat.h"
#include "gjs/jsapi-private.h"
static void
gjs_console_error_reporter(JSContext *cx, const char *message, JSErrorReport *report)
......
......@@ -23,7 +23,7 @@
#include <config.h>
#include <gjs/native.h>
#include "gjs/native.h"
#include "modules.h"
#ifdef ENABLE_CAIRO
......
......@@ -28,8 +28,9 @@
#include <unistd.h>
#include <time.h>
#include <gjs/gjs-module.h>
#include <gi/object.h>
#include <gjs/context.h>
#include "gi/object.h"
#include "system.h"
static JSBool
......