summaryrefslogtreecommitdiff
path: root/gtk/gtkstylecontext.c
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2020-10-11 11:40:31 +0200
committerMatthias Clasen <mclasen@redhat.com>2020-10-14 15:06:12 -0400
commit2bcef7f03058dac7cbac59af152271d8c43ad1ef (patch)
treeec449950aec35663f59a603d2bff9067cb8d1ffe /gtk/gtkstylecontext.c
parent18c4bdad6fbe6c2b17e971f4be0f76482bc7af74 (diff)
downloadgtk+-2bcef7f03058dac7cbac59af152271d8c43ad1ef.tar.gz
stylecontext: Remove render_insertion_cursor()
This is unused and there already is a snapshot alternative.
Diffstat (limited to 'gtk/gtkstylecontext.c')
-rw-r--r--gtk/gtkstylecontext.c97
1 files changed, 0 insertions, 97 deletions
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 6bd587c927..4150df3ae7 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -1115,103 +1115,6 @@ snapshot_insertion_cursor (GtkSnapshot *snapshot,
}
/**
- * gtk_render_insertion_cursor:
- * @context: a #GtkStyleContext
- * @cr: a #cairo_t
- * @x: X origin
- * @y: Y origin
- * @layout: the #PangoLayout of the text
- * @index: the index in the #PangoLayout
- * @direction: the #PangoDirection of the text
- *
- * Draws a text caret on @cr at the specified index of @layout.
- **/
-void
-gtk_render_insertion_cursor (GtkStyleContext *context,
- cairo_t *cr,
- double x,
- double y,
- PangoLayout *layout,
- int index,
- PangoDirection direction)
-{
- GtkStyleContextPrivate *priv = gtk_style_context_get_instance_private (context);
- gboolean split_cursor;
- float aspect_ratio;
- PangoRectangle strong_pos, weak_pos;
- PangoRectangle *cursor1, *cursor2;
- GdkSeat *seat;
- GdkDevice *keyboard;
- PangoDirection keyboard_direction;
- PangoDirection direction2;
-
- g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
- g_return_if_fail (cr != NULL);
- g_return_if_fail (PANGO_IS_LAYOUT (layout));
- g_return_if_fail (index >= 0);
-
- g_object_get (gtk_settings_get_for_display (priv->display),
- "gtk-split-cursor", &split_cursor,
- "gtk-cursor-aspect-ratio", &aspect_ratio,
- NULL);
-
- seat = gdk_display_get_default_seat (priv->display);
- if (seat)
- keyboard = gdk_seat_get_keyboard (seat);
- else
- keyboard = NULL;
- if (keyboard)
- keyboard_direction = gdk_device_get_direction (keyboard);
- else
- keyboard_direction = PANGO_DIRECTION_LTR;
-
- pango_layout_get_cursor_pos (layout, index, &strong_pos, &weak_pos);
-
- direction2 = PANGO_DIRECTION_NEUTRAL;
-
- if (split_cursor)
- {
- cursor1 = &strong_pos;
-
- if (strong_pos.x != weak_pos.x || strong_pos.y != weak_pos.y)
- {
- direction2 = (direction == PANGO_DIRECTION_LTR) ? PANGO_DIRECTION_RTL : PANGO_DIRECTION_LTR;
- cursor2 = &weak_pos;
- }
- }
- else
- {
- if (keyboard_direction == direction)
- cursor1 = &strong_pos;
- else
- cursor1 = &weak_pos;
- }
-
- draw_insertion_cursor (context,
- cr,
- x + PANGO_PIXELS (cursor1->x),
- y + PANGO_PIXELS (cursor1->y),
- PANGO_PIXELS (cursor1->height),
- aspect_ratio,
- TRUE,
- direction,
- direction2 != PANGO_DIRECTION_NEUTRAL);
-
- if (direction2 != PANGO_DIRECTION_NEUTRAL)
- {
- draw_insertion_cursor (context,
- cr,
- x + PANGO_PIXELS (cursor2->x),
- y + PANGO_PIXELS (cursor2->y),
- PANGO_PIXELS (cursor2->height),
- aspect_ratio,
- FALSE,
- direction2,
- TRUE);
- }
-}
-
-/**
* gtk_snapshot_render_insertion_cursor:
* @snapshot: snapshot to render to
* @context: a #GtkStyleContext