[gtksourceview] Added gtk_source_gutter_get_renderer_at_pos



commit 501f8e70cdbc32d75d072194903c2378798436c2
Author: Garrett Regier <garrettregier gmail com>
Date:   Sat Jul 23 03:17:06 2011 -0700

    Added gtk_source_gutter_get_renderer_at_pos

 gtksourceview/gtksourcegutter.c |   29 +++++++++++++++++++++++++++++
 gtksourceview/gtksourcegutter.h |    5 +++++
 2 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/gtksourceview/gtksourcegutter.c b/gtksourceview/gtksourcegutter.c
index edda6f4..65b49f2 100644
--- a/gtksourceview/gtksourcegutter.c
+++ b/gtksourceview/gtksourcegutter.c
@@ -1610,3 +1610,32 @@ gtk_source_gutter_get_padding (GtkSourceGutter *gutter,
 		*ypad = gutter->priv->ypad;
 	}
 }
+
+/**
+ * gtk_source_gutter_get_renderer_at_pos:
+ * @gutter: A #GtkSourceGutter.
+ * @x: The x position to get identified.
+ * @y: The y position to get identified.
+ *
+ * Finds the #GtkSourceGutterRenderer at (x, y).
+ *
+ * Returns: (transfer full): the renderer at (x, y) or %NULL.
+ */
+GtkSourceGutterRenderer *
+gtk_source_gutter_get_renderer_at_pos (GtkSourceGutter *gutter,
+                                       gint             x,
+                                       gint             y)
+{
+	Renderer *renderer;
+
+	g_return_val_if_fail (GTK_SOURCE_IS_GUTTER (gutter), NULL);
+
+	renderer = renderer_at_x (gutter, x, NULL, NULL);
+
+	if (renderer == NULL)
+	{
+		return NULL;
+	}
+
+	return renderer->renderer;
+}
diff --git a/gtksourceview/gtksourcegutter.h b/gtksourceview/gtksourcegutter.h
index b8192aa..a27d18b 100644
--- a/gtksourceview/gtksourcegutter.h
+++ b/gtksourceview/gtksourcegutter.h
@@ -78,6 +78,11 @@ void gtk_source_gutter_get_padding              (GtkSourceGutter         *gutter
                                                  gint                    *xpad,
                                                  gint                    *ypad);
 
+GtkSourceGutterRenderer *
+     gtk_source_gutter_get_renderer_at_pos      (GtkSourceGutter         *gutter,
+                                                 gint                     x,
+                                                 gint                     y);
+
 G_END_DECLS
 
 #endif /* __GTK_SOURCE_GUTTER_H__ */



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