summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-09-11 01:54:48 +0200
committerBenjamin Otte <otte@redhat.com>2010-09-26 15:11:43 +0200
commit67284a57de3a3fa8054c6bcc88bea0b688d5908b (patch)
tree3eff32cc555022b81d9d058c9f55913b23747f12
parent1d3f6b30b0100c96adbca9acb6c6cd49b18d2298 (diff)
downloadgtk+-67284a57de3a3fa8054c6bcc88bea0b688d5908b.tar.gz
API: Get rid of gtk_draw_insertion_cursor()
and rename gtk_cairo_draw_insertion_cursor() to gtk_draw_insertion_cursor().
-rw-r--r--gtk/gtk.symbols1
-rw-r--r--gtk/gtkentry.c2
-rw-r--r--gtk/gtklabel.c2
-rw-r--r--gtk/gtkstyle.c60
-rw-r--r--gtk/gtkstyle.h9
-rw-r--r--gtk/gtktextdisplay.c6
6 files changed, 13 insertions, 67 deletions
diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols
index 345e1e429a..60053a5e34 100644
--- a/gtk/gtk.symbols
+++ b/gtk/gtk.symbols
@@ -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
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 392f2cf536..9ce703488b 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -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);
}
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 45f089a899..15ecef89c3 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -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);
}
diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c
index e613d8b376..2e0ad1ce43 100644
--- a/gtk/gtkstyle.c
+++ b/gtk/gtkstyle.c
@@ -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);
-}
diff --git a/gtk/gtkstyle.h b/gtk/gtkstyle.h
index bd156c3b19..84a018ce1a 100644
--- a/gtk/gtkstyle.h
+++ b/gtk/gtkstyle.h
@@ -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);
diff --git a/gtk/gtktextdisplay.c b/gtk/gtktextdisplay.c
index 1f4e5580fc..93be053064 100644
--- a/gtk/gtktextdisplay.c
+++ b/gtk/gtktextdisplay.c
@@ -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;
}