Index: python/exomodule.c =================================================================== --- python/exomodule.c (revision 21698) +++ python/exomodule.c (working copy) @@ -29,11 +29,9 @@ /* mark internal symbols with G_GNUC_INTERNAL */ -void exo_add_constants (PyObject *module, - const gchar *strip_prefix) G_GNUC_INTERNAL; -void exo_register_classes (PyObject *d) G_GNUC_INTERNAL; -GtkTreePath *pygtk_tree_path_from_pyobject (PyObject *object) G_GNUC_INTERNAL; -PyObject *pygtk_tree_path_to_pyobject (GtkTreePath *path) G_GNUC_INTERNAL; +void exo_add_constants (PyObject *module, + const gchar *strip_prefix) G_GNUC_INTERNAL; +void exo_register_classes (PyObject *d) G_GNUC_INTERNAL; extern PyMethodDef exo_functions[]; @@ -42,21 +40,7 @@ * that are required for the IconView, so we have to duplicate * them here. */ -PyObject* -pygtk_tree_path_to_pyobject (GtkTreePath *path) -{ - gint len, i, *indices; - PyObject *ret; - - len = gtk_tree_path_get_depth (path); - indices = gtk_tree_path_get_indices (path); - - ret = PyTuple_New (len); - for (i = 0; i < len; i++) - PyTuple_SetItem (ret, i, PyInt_FromLong (indices[i])); - return ret; -} - +#if !defined(pygtk_tree_path_from_pyobject) GtkTreePath* pygtk_tree_path_from_pyobject (PyObject *object) { @@ -104,9 +88,27 @@ return NULL; } +#endif +#if !defined(pygtk_tree_path_to_pyobject) +PyObject* +pygtk_tree_path_to_pyobject (GtkTreePath *path) +{ + gint len, i, *indices; + PyObject *ret; + len = gtk_tree_path_get_depth (path); + indices = gtk_tree_path_get_indices (path); + ret = PyTuple_New (len); + for (i = 0; i < len; i++) + PyTuple_SetItem (ret, i, PyInt_FromLong (indices[i])); + return ret; +} +#endif + + + DL_EXPORT(void) init_exo (void) { Index: python/exo.override =================================================================== --- python/exo.override (revision 21698) +++ python/exo.override (working copy) @@ -25,14 +25,12 @@ headers #include #include -#include +#include "pyexo.h" /* mark internal symbols with G_GNUC_INTERNAL */ -void exo_add_constants (PyObject *module, - const gchar *strip_prefix) G_GNUC_INTERNAL; -void exo_register_classes (PyObject *d) G_GNUC_INTERNAL; -GtkTreePath *pygtk_tree_path_from_pyobject (PyObject *object) G_GNUC_INTERNAL; -PyObject *pygtk_tree_path_to_pyobject (GtkTreePath *path) G_GNUC_INTERNAL; +void exo_add_constants (PyObject *module, + const gchar *strip_prefix) G_GNUC_INTERNAL; +void exo_register_classes (PyObject *d) G_GNUC_INTERNAL; %% modulename exo Index: python/pyexo.h =================================================================== --- python/pyexo.h (revision 21698) +++ python/pyexo.h (working copy) @@ -51,6 +51,15 @@ extern PyTypeObject PyExoMutualBinding_Type; +/* ---------- PyGTK helpers ---------- */ +#if !defined(pygtk_tree_path_from_pyobject) +GtkTreePath *pygtk_tree_path_from_pyobject (PyObject *object) G_GNUC_INTERNAL; +#endif + +#if !defined(pygtk_tree_path_to_pyobject) +PyObject *pygtk_tree_path_to_pyobject (GtkTreePath *path) G_GNUC_INTERNAL; +#endif + G_END_DECLS; #endif /* !__PYEXO_H__ */