#ifdef HAVE_CONFIG_H
#  include "config.h"
#endif
#include <Python.h>
#include <pygobject.h>

#include <pango/pangocairo.h>
#include <pycairo.h>

void pycluttercairo_register_classes (PyObject *d);
void pycluttercairo_add_constants (PyObject *module, const gchar *strip_prefix);

extern PyMethodDef pycluttercairo_functions[];

#if 0
extern PyTypeObject PyClutterCairoContext_Type;
#endif

Pycairo_CAPI_t *Pycairo_CAPI;

DL_EXPORT(void)
initcluttercairo (void)
{
    PyObject *m, *d;

    /* perform any initialisation required by the library here */

    m = Py_InitModule ("cluttercairo", pycluttercairo_functions);
    d = PyModule_GetDict (m);

    Pycairo_IMPORT;
    if (Pycairo_CAPI == NULL)
        return;

#if 0
    PyClutterCairoContext_Type.tp_base = &PycairoContext_Type;
    if (PyType_Ready(&PyClutterCairoContext_Type) < 0) {
        g_return_if_reached ();
    }
#endif

    init_pygobject ();

    pycluttercairo_register_classes (d);

#if 0
    Py_INCREF (&PyClutterCairoContext_Type);
    PyModule_AddObject (m, "CairoContext",
                        (PyObject *) &PyClutterCairoContext_Type)
;
#endif

    if (PyErr_Occurred ()) {
        Py_FatalError ("unable to initialise cluttercairo module");
    }
}

#ifdef HAVE_CONFIG_H
#  include "config.h"
#endif
#include <Python.h>
#include <pygobject.h>

#include <pango/pangocairo.h>
#include <pycairo.h>

void pycluttercairo_register_classes (PyObject *d);
void pycluttercairo_add_constants (PyObject *module, const gchar *strip_prefix);

extern PyMethodDef pycluttercairo_functions[];
extern PyTypeObject PyClutterCairoContext_Type;

Pycairo_CAPI_t *Pycairo_CAPI;

DL_EXPORT(void)
initcluttercairo (void)
{
    PyObject *m, *d;

    /* perform any initialisation required by the library here */

    m = Py_InitModule ("cluttercairo", pycluttercairo_functions);
    d = PyModule_GetDict (m);

    Pycairo_IMPORT;
    if (Pycairo_CAPI == NULL)
        return;

#if 0
    PyClutterCairoContext_Type.tp_base = &PycairoContext_Type;
    if (PyType_Ready(&PyClutterCairoContext_Type) < 0) {
        g_return_if_reached ();
    }
#endif

    init_pygobject ();

    pycluttercairo_register_classes (d);

    Py_INCREF (&PyClutterCairoContext_Type);
    PyModule_AddObject (m, "CairoContext",
                        (PyObject *) &PyClutterCairoContext_Type)
;
}

--- 
+++ 
@@ -11,7 +11,10 @@
 void pycluttercairo_add_constants (PyObject *module, const gchar *strip_prefix);
 
 extern PyMethodDef pycluttercairo_functions[];
+
+#if 0
 extern PyTypeObject PyClutterCairoContext_Type;
+#endif
 
 Pycairo_CAPI_t *Pycairo_CAPI;
 
@@ -40,8 +43,14 @@
 
     pycluttercairo_register_classes (d);
 
+#if 0
     Py_INCREF (&PyClutterCairoContext_Type);
     PyModule_AddObject (m, "CairoContext",
                         (PyObject *) &PyClutterCairoContext_Type)
 ;
+#endif
+
+    if (PyErr_Occurred ()) {
+        Py_FatalError ("unable to initialise cluttercairo module");
+    }
 }
Comment out the code to subclass CairoContext

We don't have any method on the cairo_t returned by ClutterCairo::create()
at the moment, so we don't need the machinery to register it as our own
subclass type. I prefer to leave it in place, so that we can use it later.
