After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 528282 - Missing define for pango_context_new and pango_font_map_get_shape_engine_type
Missing define for pango_context_new and pango_font_map_get_shape_engine_type
Status: RESOLVED FIXED
Product: java-gnome
Classification: Bindings
Component: Pango
mainline
Other Linux
: Low major
: ---
Assigned To: Kenneth Prugh
java-gnome bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2008-04-15 19:12 UTC by Thomas Girard
Modified: 2008-08-16 02:13 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22



Description Thomas Girard 2008-04-15 19:12:34 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
Comment 1 Thomas Girard 2008-04-15 19:15:15 UTC
By the way: adding -DPANGO_ENABLE_BACKEND solves the compilation issue :-)
Comment 2 Andrew Cowie 2008-04-16 06:00:26 UTC
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
Comment 3 Loïc Minier 2008-04-16 08:28:20 UTC
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.
Comment 4 Loïc Minier 2008-04-16 08:57:20 UTC
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;
}
Comment 5 Kenneth Prugh 2008-07-30 01:45:57 UTC
I've implemented the fix for this while working on the 'deprecated' branch, which was suggested to me by Andrew when I encountered it.
Comment 6 Kenneth Prugh 2008-08-16 02:13:57 UTC
This issue has been resolved with the release of java-gnome 4.0.8, closing as fixed.