summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Feltman <sfeltman@src.gnome.org>2013-10-31 02:22:03 -0700
committerSimon Feltman <sfeltman@src.gnome.org>2014-01-14 10:19:32 -0800
commitd3e8946dbb23197a2e9d7de351a7b9cd04d360b9 (patch)
treef5d586dc95a51dd26e313ec55aa245a9b5ede9c2
parenta329f559002f2be0898309c9d81cdf2c34aef158 (diff)
downloadpygobject-d3e8946dbb23197a2e9d7de351a7b9cd04d360b9.tar.gz
Merge gobject static code into the gi module
Remove gi._gobject._gobject as a separately compiled static module and move all the files into gi._gi. Remove dead module initialization macros from "pyglib-python-compat.h" https://bugzilla.gnome.org/show_bug.cgi?id=712197
-rw-r--r--gi/Makefile.am31
-rw-r--r--gi/_glib/pyglib-python-compat.h62
-rw-r--r--gi/_gobject/Makefile.am69
-rw-r--r--gi/_gobject/__init__.py4
-rw-r--r--gi/_gobject/constants.py3
-rw-r--r--gi/_gobject/propertyhelper.py16
-rw-r--r--gi/_gobject/signalhelper.py3
-rw-r--r--gi/gimodule.c13
-rw-r--r--gi/gobjectmodule.c (renamed from gi/_gobject/gobjectmodule.c)0
-rw-r--r--gi/module.py4
-rw-r--r--gi/pygboxed.c (renamed from gi/_gobject/pygboxed.c)0
-rw-r--r--gi/pygboxed.h (renamed from gi/_gobject/pygboxed.h)0
-rw-r--r--gi/pygenum.c (renamed from gi/_gobject/pygenum.c)0
-rw-r--r--gi/pygenum.h (renamed from gi/_gobject/pygenum.h)0
-rw-r--r--gi/pygflags.c (renamed from gi/_gobject/pygflags.c)0
-rw-r--r--gi/pygflags.h (renamed from gi/_gobject/pygflags.h)0
-rw-r--r--gi/pygi-argument.c3
-rw-r--r--gi/pygi-boxed.c2
-rw-r--r--gi/pygi-ccallback.c2
-rw-r--r--gi/pygi-foreign.c2
-rw-r--r--gi/pygi-info.c2
-rw-r--r--gi/pygi-marshal-to-py.c3
-rw-r--r--gi/pygi-private.h2
-rw-r--r--gi/pygi-source.c3
-rw-r--r--gi/pygi-struct.c2
-rw-r--r--gi/pygi.h3
-rw-r--r--gi/pyginterface.c (renamed from gi/_gobject/pyginterface.c)0
-rw-r--r--gi/pyginterface.h (renamed from gi/_gobject/pyginterface.h)0
-rw-r--r--gi/pygobject-private.h (renamed from gi/_gobject/pygobject-private.h)5
-rw-r--r--gi/pygobject.c (renamed from gi/_gobject/pygobject.c)0
-rw-r--r--gi/pygobject.h (renamed from gi/_gobject/pygobject.h)0
-rw-r--r--gi/pygparamspec.c (renamed from gi/_gobject/pygparamspec.c)0
-rw-r--r--gi/pygparamspec.h (renamed from gi/_gobject/pygparamspec.h)2
-rw-r--r--gi/pygpointer.c (renamed from gi/_gobject/pygpointer.c)0
-rw-r--r--gi/pygpointer.h (renamed from gi/_gobject/pygpointer.h)0
-rw-r--r--gi/pygtype.c (renamed from gi/_gobject/pygtype.c)0
-rw-r--r--gi/pygtype.h (renamed from gi/_gobject/pygtype.h)0
-rw-r--r--gi/types.py3
-rw-r--r--tests/Makefile.am2
39 files changed, 93 insertions, 148 deletions
diff --git a/gi/Makefile.am b/gi/Makefile.am
index aa91a464..e4b18196 100644
--- a/gi/Makefile.am
+++ b/gi/Makefile.am
@@ -24,11 +24,32 @@ extension_ldflags += \
-no-undefined
endif
+pkgincludedir = $(includedir)/pygobject-$(PLATFORM_VERSION)
+pkginclude_HEADERS = pygobject.h
+
pygidir = $(pyexecdir)/gi
pygi_LTLIBRARIES = _gi.la
_gi_la_SOURCES = \
+ gobjectmodule.c \
+ pygboxed.c \
+ pygboxed.h \
+ pygenum.c \
+ pygenum.h \
+ pygflags.c \
+ pygflags.h \
+ pyginterface.c \
+ pyginterface.h \
+ pygobject.c \
+ pygobject.h \
+ pygobject-private.h \
+ pygparamspec.c \
+ pygparamspec.h \
+ pygpointer.c \
+ pygpointer.h \
+ pygtype.c \
+ pygtype.h \
pygi-repository.c \
pygi-repository.h \
pygi-info.c \
@@ -69,13 +90,16 @@ _gi_la_SOURCES = \
pygi-marshal-cleanup.c \
pygi-marshal-cleanup.h
_gi_la_CFLAGS = \
+ $(extension_cppflags) \
+ -I$(top_srcdir)/gi/_glib \
+ $(GLIB_CFLAGS) \
$(GI_CFLAGS)
_gi_la_CPPFLAGS = \
$(extension_cppflags) \
- -I$(top_srcdir)/gi/_glib \
- -I$(top_srcdir)/gi/_gobject
+ -I$(top_srcdir)/gi/_glib
_gi_la_LIBADD = \
$(extension_libadd) \
+ $(GLIB_LIBS) \
$(GI_LIBS) \
$(top_builddir)/gi/_glib/libpyglib-gi-2.0-@PYTHON_BASENAME@.la
_gi_la_LDFLAGS = \
@@ -93,8 +117,7 @@ _gi_cairo_la_CFLAGS = \
$(PYCAIRO_CFLAGS)
_gi_cairo_la_CPPFLAGS = \
$(extension_cppflags) \
- -I$(top_srcdir)/gi/_glib \
- -I$(top_srcdir)/gi/_gobject
+ -I$(top_srcdir)/gi/_glib
_gi_cairo_la_LIBADD = \
$(extension_libadd) \
$(GI_LIBS) \
diff --git a/gi/_glib/pyglib-python-compat.h b/gi/_glib/pyglib-python-compat.h
index 844bc55b..5365b208 100644
--- a/gi/_glib/pyglib-python-compat.h
+++ b/gi/_glib/pyglib-python-compat.h
@@ -29,46 +29,6 @@
# define PYGLIB_CPointer_Import(module, symbol) \
PyCapsule_Import(##module##.##symbol##, FALSE)
-#if PY_VERSION_HEX < 0x03000000
-
-#define PYGLIB_INIT_FUNCTION(modname, fullpkgname, functions) \
-static int _pyglib_init_##modname(PyObject *module); \
-void init##modname(void) \
-{ \
- PyObject *module = Py_InitModule(fullpkgname, functions); \
- _pyglib_init_##modname(module); \
-} \
-static int _pyglib_init_##modname(PyObject *module)
-
-#else
-
-#define PYGLIB_INIT_FUNCTION(modname, fullpkgname, functions) \
-static struct PyModuleDef _##modname##module = { \
- PyModuleDef_HEAD_INIT, \
- fullpkgname, \
- NULL, \
- -1, \
- functions, \
- NULL, \
- NULL, \
- NULL, \
- NULL \
-}; \
-static int _pyglib_init_##modname(PyObject *module); \
-PyObject *PyInit_##modname(void) \
-{ \
- PyObject *module = PyModule_Create(&_##modname##module); \
- if (module == NULL) \
- return NULL; \
- if (_pyglib_init_##modname(module) != 0 ) {\
- Py_DECREF(module); \
- return NULL; \
- } \
- return module; \
-} \
-static int _pyglib_init_##modname(PyObject *module)
-
-#endif
/* Compilation on Python 2.x */
#if PY_VERSION_HEX < 0x03000000
@@ -121,12 +81,18 @@ static int _pyglib_init_##modname(PyObject *module)
#endif
#define PYGLIB_MODULE_START(symbol, modname) \
-DL_EXPORT(void) init##symbol(void); \
-DL_EXPORT(void) init##symbol(void) \
+PyObject * pyglib_##symbol##_module_create(void); \
+DL_EXPORT(void) init##symbol(void); \
+DL_EXPORT(void) init##symbol(void) { \
+ pyglib_##symbol##_module_create(); \
+}; \
+PyObject * pyglib_##symbol##_module_create(void) \
{ \
PyObject *module; \
module = Py_InitModule(modname, symbol##_functions);
-#define PYGLIB_MODULE_END }
+
+#define PYGLIB_MODULE_END return module; }
+
#define PYGLIB_DEFINE_TYPE(typename, symbol, csymbol) \
PyTypeObject symbol = { \
PyObject_HEAD_INIT(NULL) \
@@ -135,6 +101,7 @@ PyTypeObject symbol = { \
sizeof(csymbol), \
0, \
};
+
#define PYGLIB_REGISTER_TYPE(d, type, name) \
if (!type.tp_alloc) \
type.tp_alloc = PyType_GenericAlloc; \
@@ -160,18 +127,25 @@ PyTypeObject symbol = { \
NULL, \
NULL \
}; \
+PyObject * pyglib_##symbol##_module_create(void); \
PyMODINIT_FUNC PyInit_##symbol(void); \
-PyMODINIT_FUNC PyInit_##symbol(void) \
+PyMODINIT_FUNC PyInit_##symbol(void) { \
+ return pyglib_##symbol##_module_create(); \
+}; \
+PyObject * pyglib_##symbol##_module_create(void) \
{ \
PyObject *module; \
module = PyModule_Create(&_##symbol##module);
+
#define PYGLIB_MODULE_END return module; }
+
#define PYGLIB_DEFINE_TYPE(typename, symbol, csymbol) \
PyTypeObject symbol = { \
PyVarObject_HEAD_INIT(NULL, 0) \
typename, \
sizeof(csymbol) \
};
+
#define PYGLIB_REGISTER_TYPE(d, type, name) \
if (!type.tp_alloc) \
type.tp_alloc = PyType_GenericAlloc; \
diff --git a/gi/_gobject/Makefile.am b/gi/_gobject/Makefile.am
index 5059ea75..b128acc1 100644
--- a/gi/_gobject/Makefile.am
+++ b/gi/_gobject/Makefile.am
@@ -1,29 +1,6 @@
AUTOMAKE_OPTIONS = 1.7
PLATFORM_VERSION = 3.0
-pkgincludedir = $(includedir)/pygobject-$(PLATFORM_VERSION)
-pkginclude_HEADERS = pygobject.h
-
-extension_cppflags = \
- $(PYTHON_INCLUDES) \
- -DPY_SSIZE_T_CLEAN
-
-extension_ldflags = \
- -module \
- -avoid-version \
- -shrext $(PYTHON_SO)
-
-if OS_WIN32
-# Windows requires Python modules to be explicitly linked to libpython.
-# Extension modules are shared libaries (.dll), but need to be
-# called .pyd for Python to load it as an extension module.
-extension_libadd = \
- $(PYTHON_LIBS)
-
-extension_ldflags += \
- -no-undefined
-endif
-
pygobjectdir = $(pyexecdir)/gi/_gobject
pygobject_PYTHON = \
@@ -32,44 +9,6 @@ pygobject_PYTHON = \
propertyhelper.py \
signalhelper.py
-pygobject_LTLIBRARIES = _gobject.la
-
-_gobject_la_SOURCES = \
- gobjectmodule.c \
- pygboxed.c \
- pygboxed.h \
- pygenum.c \
- pygenum.h \
- pygflags.c \
- pygflags.h \
- pyginterface.c \
- pyginterface.h \
- pygobject.c \
- pygobject.h \
- pygobject-private.h \
- pygparamspec.c \
- pygparamspec.h \
- pygpointer.c \
- pygpointer.h \
- pygtype.c \
- pygtype.h
-_gobject_la_CFLAGS = \
- $(extension_cppflags) \
- -I$(top_srcdir)/gi/_glib \
- -I$(top_srcdir)/gi \
- $(GLIB_CFLAGS) \
- $(GI_CFLAGS)
-_gi_la_CPPFLAGS = \
- $(extension_cppflags)
-_gobject_la_LIBADD = \
- $(extension_libadd) \
- $(GLIB_LIBS) \
- $(GI_LIBS) \
- $(top_builddir)/gi/_glib/libpyglib-gi-2.0-@PYTHON_BASENAME@.la
-_gobject_la_LDFLAGS = \
- $(extension_ldflags) \
- -export-symbols-regex "_gobject|PyInit__gobject"
-
# if we build in a separate tree, we need to symlink the *.py files from the
# source tree; Python does not accept the extensions and modules in different
# paths
@@ -79,9 +18,5 @@ build_pylinks:
done
-all: $(pygobject_LTLIBRARIES:.la=$(PYTHON_SO)) build_pylinks
-check-local: $(pygobject_LTLIBRARIES:.la=$(PYTHON_SO)) build_pylinks
-clean-local:
- rm -f $(pygobject_LTLIBRARIES:.la=$(PYTHON_SO))
-%$(PYTHON_SO): %.la
- $(LN_S) -f .libs/$@ $@
+all: build_pylinks
+check-local: build_pylinks
diff --git a/gi/_gobject/__init__.py b/gi/_gobject/__init__.py
index d3ea0e0b..0bd57425 100644
--- a/gi/_gobject/__init__.py
+++ b/gi/_gobject/__init__.py
@@ -27,7 +27,9 @@ import sys
if 'gobject' in sys.modules:
raise ImportError('When using gi.repository you must not import static modules like "gobject". Please change all occurrences of "import gobject" to "from gi.repository import GObject".')
-from . import _gobject
+import gi._gi
+_gobject = gi._gi._gobject
+
from . import propertyhelper
from . import signalhelper
diff --git a/gi/_gobject/constants.py b/gi/_gobject/constants.py
index 9565a662..5bb8665c 100644
--- a/gi/_gobject/constants.py
+++ b/gi/_gobject/constants.py
@@ -19,7 +19,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
# USA
-from . import _gobject
+import gi._gi
+_gobject = gi._gi._gobject
TYPE_INVALID = _gobject.TYPE_INVALID
TYPE_NONE = _gobject.type_from_name('void')
diff --git a/gi/_gobject/propertyhelper.py b/gi/_gobject/propertyhelper.py
index c9400df0..0ee0d373 100644
--- a/gi/_gobject/propertyhelper.py
+++ b/gi/_gobject/propertyhelper.py
@@ -21,7 +21,8 @@
import sys
-from . import _gobject
+import gi._gi
+_gobject = gi._gi._gobject
from .constants import \
TYPE_NONE, TYPE_INTERFACE, TYPE_CHAR, TYPE_UCHAR, \
@@ -30,10 +31,15 @@ from .constants import \
TYPE_FLOAT, TYPE_DOUBLE, TYPE_STRING, \
TYPE_POINTER, TYPE_BOXED, TYPE_PARAM, TYPE_OBJECT, \
TYPE_PYOBJECT, TYPE_GTYPE, TYPE_STRV, TYPE_VARIANT
-from ._gobject import \
- G_MAXFLOAT, G_MAXDOUBLE, \
- G_MININT, G_MAXINT, G_MAXUINT, G_MINLONG, G_MAXLONG, \
- G_MAXULONG
+
+G_MAXFLOAT = _gobject.G_MAXFLOAT
+G_MAXDOUBLE = _gobject.G_MAXDOUBLE
+G_MININT = _gobject.G_MININT
+G_MAXINT = _gobject.G_MAXINT
+G_MAXUINT = _gobject.G_MAXUINT
+G_MINLONG = _gobject.G_MINLONG
+G_MAXLONG = _gobject.G_MAXLONG
+G_MAXULONG = _gobject.G_MAXULONG
if sys.version_info >= (3, 0):
_basestring = str
diff --git a/gi/_gobject/signalhelper.py b/gi/_gobject/signalhelper.py
index b630158b..19207cc3 100644
--- a/gi/_gobject/signalhelper.py
+++ b/gi/_gobject/signalhelper.py
@@ -22,7 +22,8 @@
import sys
import inspect
-from . import _gobject
+import gi._gi
+_gobject = gi._gi._gobject
# Callable went away in python 3.0 and came back in 3.2.
# Use versioning to figure out when to define it, otherwise we have to deal with
diff --git a/gi/gimodule.c b/gi/gimodule.c
index 12addbcc..0ca6d40c 100644
--- a/gi/gimodule.c
+++ b/gi/gimodule.c
@@ -21,11 +21,12 @@
* USA
*/
+#include "pygobject-private.h"
+#include "pyginterface.h"
#include "pygi-private.h"
#include "pygi.h"
#include "pyglib.h"
-#include <pygobject.h>
#include <pyglib-python-compat.h>
PyObject *PyGIDeprecationWarning;
@@ -627,6 +628,7 @@ static struct PyGI_API CAPI = {
PYGLIB_MODULE_START(_gi, "_gi")
{
PyObject *api;
+ PyObject *_gobject_module;
/* Always enable Python threads since we cannot predict which GI repositories
* might accept Python callbacks run within non-Python threads or might trigger
@@ -635,13 +637,12 @@ PYGLIB_MODULE_START(_gi, "_gi")
*/
PyEval_InitThreads ();
- if (pygobject_init (-1, -1, -1) == NULL) {
- return PYGLIB_MODULE_ERROR_RETURN;
- }
-
- if (_pygobject_import() < 0) {
+ _gobject_module = pyglib__gobject_module_create ();
+ if (_gobject_module == NULL) {
return PYGLIB_MODULE_ERROR_RETURN;
}
+ PyModule_AddObject (module, "_gobject", _gobject_module);
+ PyModule_AddStringConstant(module, "__package__", "gi._gi");
_pygi_repository_register_types (module);
_pygi_info_register_types (module);
diff --git a/gi/_gobject/gobjectmodule.c b/gi/gobjectmodule.c
index e982107a..e982107a 100644
--- a/gi/_gobject/gobjectmodule.c
+++ b/gi/gobjectmodule.c
diff --git a/gi/module.py b/gi/module.py
index 89969267..22ae551b 100644
--- a/gi/module.py
+++ b/gi/module.py
@@ -59,8 +59,8 @@ from .types import \
GObjectMeta, \
StructMeta
-from ._gobject._gobject import \
- GInterface
+import gi._gi
+GInterface = gi._gi._gobject.GInterface
from ._gobject.constants import \
TYPE_NONE, \
diff --git a/gi/_gobject/pygboxed.c b/gi/pygboxed.c
index 541e77b1..541e77b1 100644
--- a/gi/_gobject/pygboxed.c
+++ b/gi/pygboxed.c
diff --git a/gi/_gobject/pygboxed.h b/gi/pygboxed.h
index 8433b9de..8433b9de 100644
--- a/gi/_gobject/pygboxed.h
+++ b/gi/pygboxed.h
diff --git a/gi/_gobject/pygenum.c b/gi/pygenum.c
index 89e3a066..89e3a066 100644
--- a/gi/_gobject/pygenum.c
+++ b/gi/pygenum.c
diff --git a/gi/_gobject/pygenum.h b/gi/pygenum.h
index 05588312..05588312 100644
--- a/gi/_gobject/pygenum.h
+++ b/gi/pygenum.h
diff --git a/gi/_gobject/pygflags.c b/gi/pygflags.c
index bdeaae74..bdeaae74 100644
--- a/gi/_gobject/pygflags.c
+++ b/gi/pygflags.c
diff --git a/gi/_gobject/pygflags.h b/gi/pygflags.h
index e93265cd..e93265cd 100644
--- a/gi/_gobject/pygflags.h
+++ b/gi/pygflags.h
diff --git a/gi/pygi-argument.c b/gi/pygi-argument.c
index 63788922..67367a02 100644
--- a/gi/pygi-argument.c
+++ b/gi/pygi-argument.c
@@ -22,12 +22,12 @@
*/
#include "pygi-private.h"
+#include "pygobject-private.h"
#include <string.h>
#include <time.h>
#include <datetime.h>
-#include <pygobject.h>
#include <pyglib-python-compat.h>
#include <pyglib.h>
@@ -1981,6 +1981,5 @@ void
_pygi_argument_init (void)
{
PyDateTime_IMPORT;
- _pygobject_import();
}
diff --git a/gi/pygi-boxed.c b/gi/pygi-boxed.c
index ea798ff6..a9b39c14 100644
--- a/gi/pygi-boxed.c
+++ b/gi/pygi-boxed.c
@@ -22,8 +22,8 @@
*/
#include "pygi-private.h"
+#include "pygobject-private.h"
-#include <pygobject.h>
#include <girepository.h>
#include <pyglib-python-compat.h>
diff --git a/gi/pygi-ccallback.c b/gi/pygi-ccallback.c
index 82777fb7..7a35e609 100644
--- a/gi/pygi-ccallback.c
+++ b/gi/pygi-ccallback.c
@@ -22,8 +22,8 @@
*/
#include "pygi-private.h"
+#include "pygobject-private.h"
-#include <pygobject.h>
#include <girepository.h>
#include <pyglib-python-compat.h>
diff --git a/gi/pygi-foreign.c b/gi/pygi-foreign.c
index 75373992..c046d0fa 100644
--- a/gi/pygi-foreign.c
+++ b/gi/pygi-foreign.c
@@ -26,7 +26,7 @@
# include <config.h>
#endif
-#include "pygobject.h"
+#include "pygobject-private.h"
#include "pygi-foreign.h"
#include <girepository.h>
diff --git a/gi/pygi-info.c b/gi/pygi-info.c
index af893ec6..d0d21582 100644
--- a/gi/pygi-info.c
+++ b/gi/pygi-info.c
@@ -24,8 +24,8 @@
#include "pygi-private.h"
#include "pygi-cache.h"
+#include "pygobject-private.h"
-#include <pygobject.h>
#include <pyglib-python-compat.h>
diff --git a/gi/pygi-marshal-to-py.c b/gi/pygi-marshal-to-py.c
index 2c7a8de2..9427754a 100644
--- a/gi/pygi-marshal-to-py.c
+++ b/gi/pygi-marshal-to-py.c
@@ -22,12 +22,13 @@
*/
#include "pygi-private.h"
+#include "pygobject-private.h"
+#include "pygparamspec.h"
#include <string.h>
#include <time.h>
#include <pyglib.h>
-#include <pygobject.h>
#include <pyglib-python-compat.h>
#include "pygi-cache.h"
diff --git a/gi/pygi-private.h b/gi/pygi-private.h
index 97eced59..af12f1ca 100644
--- a/gi/pygi-private.h
+++ b/gi/pygi-private.h
@@ -16,7 +16,7 @@
#include "pygi.h"
-#include "pygobject-external.h"
+#include "pygobject-private.h"
#include "pygi-repository.h"
#include "pygi-info.h"
diff --git a/gi/pygi-source.c b/gi/pygi-source.c
index 66bbc3c2..d2f39c6f 100644
--- a/gi/pygi-source.c
+++ b/gi/pygi-source.c
@@ -23,8 +23,7 @@
* IN THE SOFTWARE.
*/
-#define NO_IMPORT
-#include "pygobject.h"
+#include "pygobject-private.h"
#include "pygi-private.h"
#include "pyglib.h"
diff --git a/gi/pygi-struct.c b/gi/pygi-struct.c
index 296c47c0..40bfb6da 100644
--- a/gi/pygi-struct.c
+++ b/gi/pygi-struct.c
@@ -22,8 +22,8 @@
*/
#include "pygi-private.h"
+#include "pygobject-private.h"
-#include <pygobject.h>
#include <girepository.h>
#include <pyglib-python-compat.h>
diff --git a/gi/pygi.h b/gi/pygi.h
index dcd91b3d..3a1591f8 100644
--- a/gi/pygi.h
+++ b/gi/pygi.h
@@ -26,8 +26,7 @@
# include <config.h>
#endif
-#define NO_IMPORT_PYGOBJECT
-#include <pygobject.h>
+#include <pygobject-private.h>
#include <girepository.h>
#include "pygi-cache.h"
diff --git a/gi/_gobject/pyginterface.c b/gi/pyginterface.c
index eb76ba08..eb76ba08 100644
--- a/gi/_gobject/pyginterface.c
+++ b/gi/pyginterface.c
diff --git a/gi/_gobject/pyginterface.h b/gi/pyginterface.h
index 0f390c28..0f390c28 100644
--- a/gi/_gobject/pyginterface.h
+++ b/gi/pyginterface.h
diff --git a/gi/_gobject/pygobject-private.h b/gi/pygobject-private.h
index 294b0f65..f48d073b 100644
--- a/gi/_gobject/pygobject-private.h
+++ b/gi/pygobject-private.h
@@ -199,6 +199,7 @@ gboolean pygobject_prepare_construct_properties (GObjectClass *class,
PyObject *kwargs,
guint *n_params,
GParameter **params);
+/* Defined by PYGLIB_MODULE_START */
+extern PyObject *pyglib__gobject_module_create (void);
-
-#endif
+#endif /*_PYGOBJECT_PRIVATE_H_*/
diff --git a/gi/_gobject/pygobject.c b/gi/pygobject.c
index 129f29ab..129f29ab 100644
--- a/gi/_gobject/pygobject.c
+++ b/gi/pygobject.c
diff --git a/gi/_gobject/pygobject.h b/gi/pygobject.h
index 76b8b118..76b8b118 100644
--- a/gi/_gobject/pygobject.h
+++ b/gi/pygobject.h
diff --git a/gi/_gobject/pygparamspec.c b/gi/pygparamspec.c
index 938f7975..938f7975 100644
--- a/gi/_gobject/pygparamspec.c
+++ b/gi/pygparamspec.c
diff --git a/gi/_gobject/pygparamspec.h b/gi/pygparamspec.h
index 64aab0ce..b3ba8ca8 100644
--- a/gi/_gobject/pygparamspec.h
+++ b/gi/pygparamspec.h
@@ -23,6 +23,8 @@
#ifndef __PYGOBJECT_PARAMSPEC_H__
#define __PYGOBJECT_PARAMSPEC_H__
+#include <glib-object.h>
+
extern PyTypeObject PyGParamSpec_Type;
PyObject * pyg_param_spec_new (GParamSpec *pspec);
diff --git a/gi/_gobject/pygpointer.c b/gi/pygpointer.c
index 575c7511..575c7511 100644
--- a/gi/_gobject/pygpointer.c
+++ b/gi/pygpointer.c
diff --git a/gi/_gobject/pygpointer.h b/gi/pygpointer.h
index f2923daa..f2923daa 100644
--- a/gi/_gobject/pygpointer.h
+++ b/gi/pygpointer.h
diff --git a/gi/_gobject/pygtype.c b/gi/pygtype.c
index 9dc1153e..9dc1153e 100644
--- a/gi/_gobject/pygtype.c
+++ b/gi/pygtype.c
diff --git a/gi/_gobject/pygtype.h b/gi/pygtype.h
index 2f9e7add..2f9e7add 100644
--- a/gi/_gobject/pygtype.h
+++ b/gi/pygtype.h
diff --git a/gi/types.py b/gi/types.py
index 41efc051..c5b4bd5a 100644
--- a/gi/types.py
+++ b/gi/types.py
@@ -26,7 +26,6 @@ import sys
import warnings
from . import _gobject
-from ._gobject._gobject import GInterface
from ._gobject.constants import TYPE_INVALID
from .docstring import generate_doc_string
@@ -38,6 +37,8 @@ from ._gi import \
register_interface_info, \
hook_up_vfunc_implementation
+import gi._gi
+GInterface = gi._gi._gobject.GInterface
StructInfo # pyflakes
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a687bbd4..02063d07 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -54,7 +54,7 @@ CLEANFILES += Regress-1.0.gir Regress-1.0.typelib GIMarshallingTests-1.0.gir GIM
check_LTLIBRARIES += testhelper.la
-testhelper_la_CFLAGS = -I$(top_srcdir)/gi/_gobject -I$(top_srcdir)/gi/_glib $(PYTHON_INCLUDES) $(GLIB_CFLAGS)
+testhelper_la_CFLAGS = -I$(top_srcdir)/gi -I$(top_srcdir)/gi/_glib $(PYTHON_INCLUDES) $(GLIB_CFLAGS)
testhelper_la_LDFLAGS = -module -avoid-version
testhelper_la_LIBADD = $(GLIB_LIBS)
testhelper_la_SOURCES = \