GNOME Bugzilla – Bug 528282
Missing define for pango_context_new and pango_font_map_get_shape_engine_type
Last modified: 2008-08-16 02:13:57 UTC
Hello, http://bugs.debian.org/476295 was just reported by dann frazier against java-gnome 4.0.6. pango_context_new() and pango_font_map_get_shape_engine_type() are protected by an #ifdef PANGO_ENABLE_BACKEND. On the #gnome-debian IRC channel, I was pointed out by Loïc Minier to the pango_context_new documentation[1]: This function is only useful when implementing a new backend for Pango, something applications won't do. Does java-gnome really want to use (and expose) that API? These methods are explicitely required to be JNI-wrapped (in PangoContext.defs and PangoFontMap.defs). [1] http://library.gnome.org/devel/pango/unstable/pango-Text-Processing.html#pango-context-new
By the way: adding -DPANGO_ENABLE_BACKEND solves the compilation issue :-)
As discussed with Thomas, this is not *yet* a problem because there is no Pango binding and so nothing whatsoever calling this area of the generated code. A Pango binding is being worked on currently and I expect that to be welcomed during the 4.0.8 development cycle. I'll assign this to that milestone and to the person doing that work. Vreixo, for your consideration. Thank you very much for the information in these reports. AfC
Currently, this code is included by default in the builds and triggers the warning bells of our automatic build log filter; clearly, pango_context_new is referenced in the (generated) code, but no corresponding prototype can be found because the prototype is protected with #ifdef PANGO_ENABLE_BACKEND. If you think the underlying issue of whether to wrap pango_context_new() or not wont be addressed soon, may I suggest to comment out the wrapper or to not include this code/defs in the default build (or in tarballs)? Concerning the long term fix, the question is really whether you'd like people to be able to implement pango backends and can live with the corresponding unstable API, or whether it just was a mistake to wrap this generic constructor and you only really wanted to use the other (recommended) constructors -- but this is all covered in the pango documentation.
As you inherit the .defs from pygtk, I checked what they were doing and they listed it in pango.override with a function returning an error instead; see also bug #472908. r2901 | gjc | 2007-09-02 21:59:44 +0200 (dim, 02 sep 2007) | 1 line Bug 472908 – Make pango.Context non-instantiable %% override pango_context_new kwargs static int _wrap_pango_context_new(PyObject *self, PyObject *args, PyObject *kwargs) { PyErr_SetString(PyExc_TypeError, "pango.Context cannot be instantiated directly"); return -1; }
I've implemented the fix for this while working on the 'deprecated' branch, which was suggested to me by Andrew when I encountered it.
This issue has been resolved with the release of java-gnome 4.0.8, closing as fixed.