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 650170 - Add a readonly version of pango_layout_get_log_attrs
Add a readonly version of pango_layout_get_log_attrs
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2011-05-14 12:32 UTC by Matthias Clasen
Modified: 2011-05-16 13:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (2.76 KB, patch)
2011-05-14 12:34 UTC, Matthias Clasen
none Details | Review

Description Matthias Clasen 2011-05-14 12:32:57 UTC
Otherwise, we are forced to either make many unnecessary copies
or pass the log attrs around alongside the layout in APIs operating
on the attrs.
Comment 1 Matthias Clasen 2011-05-14 12:34:27 UTC
Created attachment 187810 [details] [review]
patch
Comment 2 Behdad Esfahbod 2011-05-14 22:34:06 UTC
1. "const" missing.
2. I have a slight preference for returning the array as function return value instead of as an out parameter.  Can't make my mind :)

Also need to document that modifying the layout invalidates the returned array.

In fact, since log_attrs only depends on text/attrs only, and not width/wrap/etc, it may be a good idea to separate it from other layout properties and not invalidate it as aggressively as we currently do.  But that would need more work.

Other than that, feel free to commit after hooking up the doc and adding to symbol list.
Comment 3 Matthias Clasen 2011-05-16 13:38:05 UTC
Pushed, thanks. I ended up making it

PangoLogAttr *pango_layout_get_log_attrs_readonly (PangoLayout *layout, gint *n_attrs)

I wasn't exactly sure where you wanted to stick a const there, so I left it out.
Let me know if you want further changes.