summaryrefslogtreecommitdiff
path: root/gtk/gtktextlayout.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2002-01-17 22:38:18 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-01-17 22:38:18 +0000
commit9e404f2a1e04e9ea17742b9e2823b50189104a54 (patch)
tree2362e3efce1cc927610984593457b8a1224f222d /gtk/gtktextlayout.c
parentcf25093441d43b9225ae0a1a7eceaa31ef3a3d49 (diff)
downloadgtk+-9e404f2a1e04e9ea17742b9e2823b50189104a54.tar.gz
new function (which I then decided not to use but I think it's needed to
2002-01-17 Havoc Pennington <hp@redhat.com> * gtk/gtktextlayout.c (_gtk_text_layout_get_line_xrange): new function (which I then decided not to use but I think it's needed to fix #68963 * gtk/gtktextview.c: add page_horizontally action signal and implement Ctrl+PgUp, Ctrl+PgDown based on patch from Padraig, hackily modified to avoid adding GTK_MOVEMENT_ API. Part of #53934 * gtk/gtkmarshalers.list: add NONE:INT,BOOL
Diffstat (limited to 'gtk/gtktextlayout.c')
-rw-r--r--gtk/gtktextlayout.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c
index 4a85903a6b..d6bfbd0877 100644
--- a/gtk/gtktextlayout.c
+++ b/gtk/gtktextlayout.c
@@ -2249,6 +2249,45 @@ gtk_text_layout_get_line_yrange (GtkTextLayout *layout,
}
}
+/**
+ * _gtk_text_layout_get_line_xrange:
+ * @layout: a #GtkTextLayout
+ * @iter: a #GtkTextIter
+ * @x: location to store the top of the paragraph in pixels,
+ * or %NULL.
+ * @width location to store the height of the paragraph in pixels,
+ * or %NULL.
+ *
+ * Find the range of X coordinates for the paragraph containing
+ * the given iter. Private for 2.0 due to API freeze, could
+ * be made public for 2.2.
+ **/
+void
+_gtk_text_layout_get_line_xrange (GtkTextLayout *layout,
+ const GtkTextIter *iter,
+ gint *x,
+ gint *width)
+{
+ GtkTextLine *line;
+
+ g_return_if_fail (GTK_IS_TEXT_LAYOUT (layout));
+ g_return_if_fail (_gtk_text_iter_get_btree (iter) == _gtk_text_buffer_get_btree (layout->buffer));
+
+ line = _gtk_text_iter_get_text_line (iter);
+
+ if (x)
+ *x = 0; /* FIXME This is wrong; should represent the first available cursor position */
+
+ if (width)
+ {
+ GtkTextLineData *line_data = _gtk_text_line_get_data (line, layout);
+ if (line_data)
+ *width = line_data->width;
+ else
+ *width = 0;
+ }
+}
+
void
gtk_text_layout_get_iter_location (GtkTextLayout *layout,
const GtkTextIter *iter,