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 417777 - convenience API for creation of PangoAttrList
convenience API for creation of PangoAttrList
Status: RESOLVED OBSOLETE
Product: pango
Classification: Platform
Component: general
unspecified
Other All
: Normal enhancement
: Small API
Assigned To: pango-maint
pango-maint
Depends on: 469641
Blocks:
 
 
Reported: 2007-03-13 08:06 UTC by Sven Neumann
Modified: 2018-05-22 12:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to add pango_attr_list_new_full (6.17 KB, patch)
2007-09-14 13:28 UTC, Sven Neumann
none Details | Review
patch with improved documentation (9.40 KB, patch)
2008-02-18 16:06 UTC, Sven Neumann
none Details | Review

Description Sven Neumann 2007-03-13 08:06:23 UTC
libgimpwidgets includes an API for conveniently applying a PangoAttrList to
a GtkLabel and I would like to propose it for inclusion in GTK+. It would make sense though to have most of this code in Pango, so I am filing this bug report asking for an API addition to Pango.

The implementation of gimp_label_set_attributes can be reviewed in
http://svn.gnome.org/viewcvs/gimp/trunk/libgimpwidgets/gimpwidgets.c?view=markup

I propose adding pango_attr_list_new_full(...). Perhaps also add pango_attr_new(type, ...).
Comment 1 Behdad Esfahbod 2007-09-07 18:50:34 UTC
Got a patch?
Comment 2 Sven Neumann 2007-09-14 13:28:29 UTC
Created attachment 95586 [details] [review]
patch to add pango_attr_list_new_full
Comment 3 Behdad Esfahbod 2007-10-24 06:12:27 UTC
Ok, almost ready to commit this.  There are two problems with it though, none are solvable but still:

  - PangoColor attr is passed as PangoColor* which is different from r,g,b that is passed to normal constructors.

  - User-defined attribute types don't work.  One way this one can be fixed is to add pango_attr_type_register_full() that takes either a "gpointer data" or a variadic constructor for the attribute type.  variadic will be more flexible but more work to implement for user.  "gpointer data" version limits user attributes to taking a pointer when parsed by pango_attr_list_new_full() which is not very limiting IMO. YMMV.  If we go with the latter, pango_attr_new() can take a pointer instead of being variadic too.

Comments?
Comment 4 Sven Neumann 2008-02-13 16:31:01 UTC
I don't have very strong opinions on this except that I would really like to see this API being added to Pango so that it can be wrapped into a GtkLabel convenience API in GTK+ so that people finally stop to use PangoMarkup for simple things like bold labels.
Comment 5 Sven Neumann 2008-02-18 16:06:08 UTC
Created attachment 105511 [details] [review]
patch with improved documentation

This updated patch tries to solve the remaining issues by improving the documentation.
Comment 6 Sven Neumann 2008-02-24 13:38:55 UTC
Of course for use from GTK+ we would have to add a variant that takes a va_list argument. I can provide a patch that does this if you are otherwise happy with the new API.
Comment 7 GNOME Infrastructure Team 2018-05-22 12:26:48 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/pango/issues/70.