Re: Pango library seems to be really hard for gobject-introspection?



On Sat, 2017-09-09 at 21:46 +0000, Emmanuele Bassi wrote:
Boxed types use g_boxed_free() to release resources, and
g_boxed_copy() to copy them:
https://developer.gnome.org/gobject/stable/gobject-Boxed-Types.html

Ciao,
 Emmanuele.

Yes I know :-)

But from

https://developer.gnome.org/pango/stable/pango-Fonts.html#pango-font-description-new

PangoFontDescription is a boxed type (from Object Hierarchy), and we
shall use pango_font_description_free() for freeing.

Do you suggest just using g_boxed_free() instead?

I don't think that is right?

What I found out in the last few hours at least: Pango data types which
needs a ...destroy() function for freeing seems to be mostly marked
with introspectable="0". So my current impression is, that for all the
data types which I "see" from gobject introspection with transfer-
ownership="full", I have to use ...free() for freeing.

For other data types, which needs ...destroy() I have to manually
create the glue code, when they should be needed at all.

But there are also data types like PangoFontMetrics which may need an
unref instead -- maybe that ones are used internally only.

But pango is really hard to understand. For example

https://developer.gnome.org/pango/stable/pango-Layout-Objects.html#pango-layout-get-line

For that we have transfer == none, but we can modify the result, and we
can ref and unref the result. To make it even more complicated there is
also pango_layout_get_line_readonly()




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]