pango r2605 - in trunk: . docs pango
- From: behdad svn gnome org
- To: svn-commits-list gnome org
- Subject: pango r2605 - in trunk: . docs pango
- Date: Mon, 21 Apr 2008 23:16:44 +0100 (BST)
Author: behdad
Date: Mon Apr 21 22:16:44 2008
New Revision: 2605
URL: http://svn.gnome.org/viewvc/pango?rev=2605&view=rev
Log:
2008-04-21 Behdad Esfahbod <behdad gnome org>
Bug 404416 â pango_layout_get_baseline or something
* docs/pango-sections.txt:
* pango/pango-layout.c (pango_layout_get_baseline):
* pango/pango-layout.h:
* pango/pango.def:
New public API:
pango_layout_get_baseline()
Modified:
trunk/ChangeLog
trunk/docs/pango-sections.txt
trunk/pango/pango-layout.c
trunk/pango/pango-layout.h
trunk/pango/pango.def
Modified: trunk/docs/pango-sections.txt
==============================================================================
--- trunk/docs/pango-sections.txt (original)
+++ trunk/docs/pango-sections.txt Mon Apr 21 22:16:44 2008
@@ -491,6 +491,7 @@
pango_layout_get_pixel_extents
pango_layout_get_size
pango_layout_get_pixel_size
+pango_layout_get_baseline
pango_layout_get_line_count
pango_layout_get_line
pango_layout_get_line_readonly
Modified: trunk/pango/pango-layout.c
==============================================================================
--- trunk/pango/pango-layout.c (original)
+++ trunk/pango/pango-layout.c Mon Apr 21 22:16:44 2008
@@ -2669,6 +2669,29 @@
*height = logical_rect.height;
}
+/**
+ * pango_layout_get_baseline:
+ * @layout: a #PangoLayout
+ *
+ * Gets the Y position of baseline of the first line in @layout.
+ *
+ * Return value: baseline of first line, from top of @layout.
+ *
+ * Since: 1.22
+ **/
+int
+pango_layout_get_baseline (PangoLayout *layout)
+{
+ int baseline;
+
+ /* XXX this is so inefficient */
+ PangoLayoutIter *iter = pango_layout_get_iter (layout);
+ baseline = pango_layout_iter_get_baseline (iter);
+ pango_layout_iter_free (iter);
+
+ return baseline;
+}
+
static void
pango_layout_clear_lines (PangoLayout *layout)
{
Modified: trunk/pango/pango-layout.h
==============================================================================
--- trunk/pango/pango-layout.h (original)
+++ trunk/pango/pango-layout.h Mon Apr 21 22:16:44 2008
@@ -202,6 +202,7 @@
void pango_layout_get_pixel_size (PangoLayout *layout,
int *width,
int *height);
+int pango_layout_get_baseline (PangoLayout *layout);
int pango_layout_get_line_count (PangoLayout *layout);
PangoLayoutLine *pango_layout_get_line (PangoLayout *layout,
Modified: trunk/pango/pango.def
==============================================================================
--- trunk/pango/pango.def (original)
+++ trunk/pango/pango.def Mon Apr 21 22:16:44 2008
@@ -217,6 +217,7 @@
pango_layout_get_alignment
pango_layout_get_attributes
pango_layout_get_auto_dir
+ pango_layout_get_baseline
pango_layout_get_context
pango_layout_get_cursor_pos
pango_layout_get_ellipsize
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]