API: Get rid of gtk_draw_insertion_cursor()

and rename gtk_cairo_draw_insertion_cursor() to
gtk_draw_insertion_cursor().
This commit is contained in:
Benjamin Otte 2010-09-11 01:54:48 +02:00
parent 1d3f6b30b0
commit 67284a57de
6 changed files with 13 additions and 67 deletions

View File

@ -1041,7 +1041,6 @@ gtk_style_new
gtk_style_render_icon
gtk_style_set_background
gtk_draw_insertion_cursor
gtk_cairo_draw_insertion_cursor
gtk_style_get_style_property
gtk_style_get_valist
gtk_style_get

View File

@ -5677,7 +5677,7 @@ draw_insertion_cursor (GtkEntry *entry,
else
text_dir = GTK_TEXT_DIR_RTL;
gtk_cairo_draw_insertion_cursor (widget, cr,
gtk_draw_insertion_cursor (widget, cr,
cursor_location,
is_primary, text_dir, draw_arrow);
}

View File

@ -3921,7 +3921,7 @@ draw_insertion_cursor (GtkLabel *label,
else
text_dir = GTK_TEXT_DIR_RTL;
gtk_cairo_draw_insertion_cursor (widget, cr, cursor_location,
gtk_draw_insertion_cursor (widget, cr, cursor_location,
is_primary, text_dir, draw_arrow);
}

View File

@ -5506,7 +5506,7 @@ _gtk_widget_get_cursor_color (GtkWidget *widget,
}
/**
* gtk_cairo_draw_insertion_cursor:
* gtk_draw_insertion_cursor:
* @widget: a #GtkWidget
* @cr: cairo context to draw to
* @location: location where to draw the cursor (@location->width is ignored)
@ -5522,12 +5522,12 @@ _gtk_widget_get_cursor_color (GtkWidget *widget,
* Since: 3.0
**/
void
gtk_cairo_draw_insertion_cursor (GtkWidget *widget,
cairo_t *cr,
const GdkRectangle *location,
gboolean is_primary,
GtkTextDirection direction,
gboolean draw_arrow)
gtk_draw_insertion_cursor (GtkWidget *widget,
cairo_t *cr,
const GdkRectangle *location,
gboolean is_primary,
GtkTextDirection direction,
gboolean draw_arrow)
{
gint stem_width;
gint arrow_width;
@ -5586,49 +5586,3 @@ gtk_cairo_draw_insertion_cursor (GtkWidget *widget,
}
}
}
/**
* gtk_draw_insertion_cursor:
* @widget: a #GtkWidget
* @drawable: a #GdkDrawable
* @area: (allow-none): rectangle to which the output is clipped, or %NULL if the
* output should not be clipped
* @location: location where to draw the cursor (@location->width is ignored)
* @is_primary: if the cursor should be the primary cursor color.
* @direction: whether the cursor is left-to-right or
* right-to-left. Should never be #GTK_TEXT_DIR_NONE
* @draw_arrow: %TRUE to draw a directional arrow on the
* cursor. Should be %FALSE unless the cursor is split.
*
* Draws a text caret on @drawable at @location. This is not a style function
* but merely a convenience function for drawing the standard cursor shape.
*
* Since: 2.4
**/
void
gtk_draw_insertion_cursor (GtkWidget *widget,
GdkDrawable *drawable,
const GdkRectangle *area,
const GdkRectangle *location,
gboolean is_primary,
GtkTextDirection direction,
gboolean draw_arrow)
{
cairo_t *cr;
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
g_return_if_fail (location != NULL);
g_return_if_fail (direction != GTK_TEXT_DIR_NONE);
cr = gdk_cairo_create (drawable);
if (area)
{
gdk_cairo_rectangle (cr, area);
cairo_clip (cr);
}
gtk_cairo_draw_insertion_cursor (widget, cr, location, is_primary, direction, draw_arrow);
cairo_destroy (cr);
}

View File

@ -670,18 +670,11 @@ void _gtk_style_shade (const GdkColor *a,
gdouble k);
void gtk_draw_insertion_cursor (GtkWidget *widget,
GdkDrawable *drawable,
const GdkRectangle *area,
cairo_t *cr,
const GdkRectangle *location,
gboolean is_primary,
GtkTextDirection direction,
gboolean draw_arrow);
void gtk_cairo_draw_insertion_cursor (GtkWidget *widget,
cairo_t *cr,
const GdkRectangle *location,
gboolean is_primary,
GtkTextDirection direction,
gboolean draw_arrow);
void _gtk_widget_get_cursor_color (GtkWidget *widget,
GdkColor *color);

View File

@ -924,9 +924,9 @@ gtk_text_layout_draw (GtkTextLayout *layout,
cursor_location.width = 0;
cursor_location.height = cursor->height;
gtk_cairo_draw_insertion_cursor (widget, cr, &cursor_location,
cursor->is_strong,
dir, have_strong && have_weak);
gtk_draw_insertion_cursor (widget, cr, &cursor_location,
cursor->is_strong,
dir, have_strong && have_weak);
cursor_list = cursor_list->next;
}