[pangomm] AttrList: Add to_string() and from_string()



commit 570c0961ea18a569328e1ef131179d4b9f179e11
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Mon Dec 6 16:52:42 2021 +0100

    AttrList: Add to_string() and from_string()
    
    and require pango >= 1.49.4.

 configure.ac          |  2 +-
 meson.build           |  2 +-
 pango/src/attrlist.hg | 15 ++++++++++-----
 3 files changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 6ff0591..38fff1f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -49,7 +49,7 @@ MM_AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory])
 AC_DISABLE_STATIC
 LT_INIT([win32-dll])
 
-AC_SUBST([PANGOMM_MODULES], ['giomm-2.68 >= 2.68.0 cairomm-1.16 >= 1.15.1 pangocairo >= 1.45.1'])
+AC_SUBST([PANGOMM_MODULES], ['giomm-2.68 >= 2.68.0 cairomm-1.16 >= 1.15.1 pangocairo >= 1.49.4'])
 AC_SUBST([MSVC_TOOLSET_VER], [''])
 PKG_CHECK_MODULES([PANGOMM], [$PANGOMM_MODULES])
 
diff --git a/meson.build b/meson.build
index 633c729..23482dd 100644
--- a/meson.build
+++ b/meson.build
@@ -101,7 +101,7 @@ glibmm_req = '>= 2.68.0'
 
 # Pango supported pkg-config files on MSVC files for a good while,
 # so just use that
-pangocairo_req = '>= 1.45.1'
+pangocairo_req = '>= 1.49.4'
 pangocairo_dep = dependency('pangocairo', version: pangocairo_req)
 
 glibmm_req_minor_ver = '68'
diff --git a/pango/src/attrlist.hg b/pango/src/attrlist.hg
index 4ddfcb9..d001398 100644
--- a/pango/src/attrlist.hg
+++ b/pango/src/attrlist.hg
@@ -26,14 +26,14 @@ _DEFS(pangomm,pango)
 namespace Pango
 {
 
-/** A Pango::AttrList represents a list of attributes that apply to a section of text.
+/** A %Pango::AttrList represents a list of attributes that apply to a section of text.
  * The attributes are, in general, allowed to overlap in an arbitrary fashion, however,
  * if the attributes are manipulated only through Pango::AttrList::change(), the overlap between properties 
will meet stricter criteria.
  *
- * Since the Pango::AttrList structure is stored as a linear list, it is not suitable for storing attributes 
for large amounts of text.
- * In general, you should not use a single Pango::AttrList for more than one paragraph of text.
+ * Since the %Pango::AttrList structure is stored as a linear list, it is not suitable for storing 
attributes for large amounts of text.
+ * In general, you should not use a single %Pango::AttrList for more than one paragraph of text.
  *
- * When obtaining an AttrList, you should check that it is valid. For instance, if(attrlist).
+ * When obtaining an %AttrList, you should check that it is valid. For instance, if(attrlist).
  */
 class PANGOMM_API AttrList
 {
@@ -69,7 +69,7 @@ public:
    */
   AttrList(const Glib::ustring& markup_text, gunichar accel_marker, Glib::ustring& text, gunichar& 
accel_char);
 
-  ///Tests whether the AttrList is valid.
+  ///Tests whether the %AttrList is valid.
   explicit operator bool() const;
 
   void insert(Attribute& attr);
@@ -85,6 +85,11 @@ public:
   _WRAP_METHOD(std::vector<Attribute> get_attributes() const, pango_attr_list_get_attributes, newin "2,50")
 
   _WRAP_METHOD(bool equal(const AttrList& other_list) const, pango_attr_list_equal, newin "2,50")
+  _WRAP_METHOD(Glib::ustring to_string() const, pango_attr_list_to_string, newin "2,50")
+  // Don't replace from_string() by a constructor. A call to such a constructor would be
+  // ambiguous because of AttrList(markup_text, accel_marker=0).
+#m4 _CONVERSION(`PangoAttrList*',`AttrList',`AttrList($3, false)')
+  _WRAP_METHOD(static AttrList from_string(const Glib::ustring& text), pango_attr_list_from_string, newin 
"2,50")
   _WRAP_METHOD(AttrIter get_iter(), pango_attr_list_get_iterator)
 
   //TODO: Though it doesn't seem important:


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