[gtk+/rendering-cleanup-next: 151/203] API: Get rid of gtk_draw_insertion_cursor()



commit af878004adbdb5daaa4312e7c3a99cc114051417
Author: Benjamin Otte <otte redhat com>
Date:   Sat Sep 11 01:54:48 2010 +0200

    API: Get rid of gtk_draw_insertion_cursor()
    
    and rename gtk_cairo_draw_insertion_cursor() to
    gtk_draw_insertion_cursor().

 gtk/gtk.symbols      |    1 -
 gtk/gtkentry.c       |    2 +-
 gtk/gtklabel.c       |    2 +-
 gtk/gtkstyle.c       |   60 +++++--------------------------------------------
 gtk/gtkstyle.h       |    9 +------
 gtk/gtktextdisplay.c |    6 ++--
 6 files changed, 13 insertions(+), 67 deletions(-)
---
diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols
index 109ba89..c2b6353 100644
--- a/gtk/gtk.symbols
+++ b/gtk/gtk.symbols
@@ -1039,7 +1039,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 4015392..d63627b 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -5683,7 +5683,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 ea27460..aa7c748 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 d9ae319..9f49f27 100644
--- a/gtk/gtkstyle.c
+++ b/gtk/gtkstyle.c
@@ -5504,7 +5504,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)
@@ -5520,12 +5520,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;
@@ -5584,49 +5584,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 bd156c3..84a018c 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 1f4e558..93be053 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;
             }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]