[pangomm/pangomm-2-42] LayoutIter: Fix get_run()
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pangomm/pangomm-2-42] LayoutIter: Fix get_run()
- Date: Sun, 17 Jan 2021 09:50:38 +0000 (UTC)
commit d6ef962ece4ae071e29aa9e657862c1bba2cc11c
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Sat Jan 16 10:39:34 2021 +0100
LayoutIter: Fix get_run()
get_run() shall call pango_layout_iter_get_run_readonly() and
take a copy of the returned PangoLayoutRun.
pango/src/layoutiter.hg | 27 ++++++++++++++++++++-------
1 file changed, 20 insertions(+), 7 deletions(-)
---
diff --git a/pango/src/layoutiter.hg b/pango/src/layoutiter.hg
index 3049ba0..9668a3f 100644
--- a/pango/src/layoutiter.hg
+++ b/pango/src/layoutiter.hg
@@ -1,5 +1,3 @@
-/* $Id: layoutiter.hg,v 1.2 2003/12/14 11:54:05 murrayc Exp $ */
-
/* layoutiter.h
*
* Copyright 2001-2002 The gtkmm Development Team
@@ -38,12 +36,28 @@ class PANGOMM_API LayoutIter
public:
_WRAP_METHOD(int get_index() const, pango_layout_iter_get_index)
- _WRAP_METHOD(LayoutRun get_run() const, pango_layout_iter_get_run)
- //TODO: Use pango_layout_iter_get_run_readonly()?
- _WRAP_METHOD(Glib::RefPtr<LayoutLine> get_line() const, pango_layout_iter_get_line, refreturn)
- //TODO: We should really have a const and non-const version: _WRAP_METHOD(Glib::RefPtr<const LayoutLine>
get_line() const, pango_layout_iter_get_line_readonly, refreturn)
+#m4 _CONVERSION(`PangoLayoutRun*',`LayoutRun',`Glib::wrap($3, true)')
+ /** Gets the current run.
+ *
+ * When iterating by run, at the end of each line, there's a position with
+ * a <tt>nullptr</tt> run, so this function can return an invalid GlyphItem.
+ * The <tt>nullptr</tt> run at the end of each line ensures that all lines have
+ * at least one run, even lines consisting of only a newline.
+ *
+ * @return The current run.
+ */
+ _WRAP_METHOD(LayoutRun get_run() const, pango_layout_iter_get_run_readonly)
+ _IGNORE(pango_layout_iter_get_run)
+ /** Gets the current line.
+ *
+ * @return The current line.
+ */
+ _WRAP_METHOD(Glib::RefPtr<LayoutLine> get_line() const, pango_layout_iter_get_line, refreturn)
+ //TODO: We should really have a const and non-const version. This would break API and perhaps ABI.
+ //_WRAP_METHOD(Glib::RefPtr<LayoutLine> get_line(), pango_layout_iter_get_line, refreturn)
+ //_WRAP_METHOD(Glib::RefPtr<const LayoutLine> get_line() const, pango_layout_iter_get_line_readonly,
refreturn)
_WRAP_METHOD(bool at_last_line() const, pango_layout_iter_at_last_line)
@@ -123,4 +137,3 @@ public:
};
} //namespace Pango
-
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]