GNOME Bugzilla – Bug 650170
Add a readonly version of pango_layout_get_log_attrs
Last modified: 2011-05-16 13:38:05 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.
Created attachment 187810 [details] [review] patch
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.
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.