[gtkmm] Two optional return values in pango functions: what to do?



Hi!

The pangomm API review is almost complete. A last question for the list:

Quite a number of functions in pango have two optional return values,
i.e. the function is void but you can pass pointers to two objects or
NULL to obtain the return values.

So far only for one pango function this has been completely implemented in
pangomm: There are three wrapper functions for pango_font_get_glyph_extents:

1) void Font::get_glyph_extents(Glyph glyph, Rectangle& ink_rect, Rectangle& logical_rect) 2) void Font::get_glyph_extents_ink_rect_only (Glyph glyph, Rectangle& ink_rect) 3) void Font::get_glyph_extents_logical_rect_only (Glyph glyph, Rectangle& logical_rect)

So the return values are really optional here.

For other funtions, like GlyphString::extents(), that also return two
rectangles we only have 1). Now, in my opinion, it would be an overkill to
add 2) and 3) for every such function. E.g. GlyphString::extents() already
has an overload because some parameters are optional. If we added 2) and 3)
for both overloads, we would have 6 functions in the whole that wrap the same
single pango function.

On the other hand, if people agreed that it isn't desirable to add 2) and 3) whereever possible, I would want to know whether anyone has some need for the
existing functions 2) and 3) in Pango::Font. Otherwise, I would just remove
them to be consistent with the other wrapper functions that only have 1).

Regards,

  Martin



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