5
/* include this first, before NO_IMPORT_PYGOBJECT is defined */
7
#include <pygtk/pygtk.h>
10
#include "gtkmozembed_glue.cpp"
14
void initgtkmozembed(void);
15
void pygtkmozembed_add_constants(PyObject *module, const gchar *strip_prefix);
16
void pygtkmozembed_register_classes (PyObject *d);
19
extern PyMethodDef pygtkmozembed_functions[];
30
static const GREVersionRange greVersion = {
34
char xpcomLocation[4096];
35
nsresult rv = GRE_GetGREPathWithProperties(&greVersion, 1, nsnull, 0, xpcomLocation, 4096);
37
printf("GRE_GetGREPathWithProperties failed\n");
41
// Startup the XPCOM Glue that links us up with XPCOM.
42
XPCOMGlueStartup(xpcomLocation);
44
printf("XPCOMGlueStartup failed\n");
48
rv = GTKEmbedGlueStartup();
49
if (NS_FAILED(rv)) {printf("location: %s \n", xpcomLocation);
50
printf("GTKEmbedGlueStartup failed\n");
54
rv = GTKEmbedGlueStartupInternal();
56
printf ("GTKEmbedGlueStartupInternal failed\n");
60
//gtk_moz_embed_set_comp_path(xpcomLocation);
62
char *lastSlash = strrchr(xpcomLocation, '/');
66
gtk_moz_embed_set_path(xpcomLocation);
69
m = Py_InitModule ("gtkmozembed", pygtkmozembed_functions);
70
d = PyModule_GetDict (m);
72
pygtkmozembed_add_constants(m, "GTK_MOZ_EMBED_");
73
pygtkmozembed_register_classes (d);
75
if (PyErr_Occurred ()) {
76
Py_FatalError ("can't initialise module gtkmozembed");