[gtk+/overlay: 13/34] overlay: add get_offset
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/overlay: 13/34] overlay: add get_offset
- Date: Sat, 11 Jun 2011 00:59:45 +0000 (UTC)
commit c2e8866e33dc64d8ed07b36f2c25d8698475321c
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Thu May 26 23:07:44 2011 +0200
overlay: add get_offset
gtk/gtkoverlay.c | 28 ++++++++++++++++++++++++++++
gtk/gtkoverlay.h | 5 +++++
2 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkoverlay.c b/gtk/gtkoverlay.c
index 71429e8..b5847f6 100644
--- a/gtk/gtkoverlay.c
+++ b/gtk/gtkoverlay.c
@@ -776,3 +776,31 @@ gtk_overlay_set_offset (GtkOverlay *overlay,
gtk_overlay_set_offset_internal (overlay, get_child (overlay, widget), x_offset, y_offset);
}
+
+/**
+ * gtk_overlay_get_offset:
+ * @overlay: a #GtkOverlay
+ * @widget: a child of @overlay
+ * @x_offset: (out): returns the x offset of @widget
+ * @y_offset: (out): returns the y offset of @widget
+ *
+ * Gets the offset for @widget
+ */
+void
+gtk_overlay_get_offset (GtkOverlay *overlay,
+ GtkWidget *widget,
+ guint *x_offset,
+ guint *y_offset)
+{
+ GtkOverlayChild *child;
+
+ g_return_if_fail (GTK_IS_OVERLAY (overlay));
+
+ child = get_child (overlay, widget);
+
+ if (x_offset != NULL)
+ *x_offset = child->x_offset;
+
+ if (y_offset != NULL)
+ *y_offset = child->y_offset;
+}
diff --git a/gtk/gtkoverlay.h b/gtk/gtkoverlay.h
index bdc5bc5..161e688 100644
--- a/gtk/gtkoverlay.h
+++ b/gtk/gtkoverlay.h
@@ -85,6 +85,11 @@ void gtk_overlay_set_offset (GtkOverlay *overlay,
guint x_offset,
guint y_offset);
+void gtk_overlay_get_offset (GtkOverlay *overlay,
+ GtkWidget *widget,
+ guint *x_offset,
+ guint *y_offset);
+
G_END_DECLS
#endif /* __GTK_OVERLAY_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]