aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-07-05 21:53:47 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-07-09 20:55:54 +0800
commit690d4bb2fb9ec033299a057483019253f859fecb (patch)
tree52c2f6bfbca9c1c409bb4932c188efda9e468747
parent276d529fb837238cba3f1f51ba47ec4ec45d90b9 (diff)
downloadgsoc2013-empathy-690d4bb2fb9ec033299a057483019253f859fecb.tar
gsoc2013-empathy-690d4bb2fb9ec033299a057483019253f859fecb.tar.gz
gsoc2013-empathy-690d4bb2fb9ec033299a057483019253f859fecb.tar.bz2
gsoc2013-empathy-690d4bb2fb9ec033299a057483019253f859fecb.tar.lz
gsoc2013-empathy-690d4bb2fb9ec033299a057483019253f859fecb.tar.xz
gsoc2013-empathy-690d4bb2fb9ec033299a057483019253f859fecb.tar.zst
gsoc2013-empathy-690d4bb2fb9ec033299a057483019253f859fecb.zip
roster-view: add empathy_roster_view_get_group_at_y()
-rw-r--r--libempathy-gtk/empathy-roster-view.c19
-rw-r--r--libempathy-gtk/empathy-roster-view.h4
2 files changed, 23 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-roster-view.c b/libempathy-gtk/empathy-roster-view.c
index 3d55c3fa4..c9994f48f 100644
--- a/libempathy-gtk/empathy-roster-view.c
+++ b/libempathy-gtk/empathy-roster-view.c
@@ -1283,6 +1283,25 @@ empathy_roster_view_get_individual_at_y (EmpathyRosterView *self,
return empathy_roster_contact_get_individual (EMPATHY_ROSTER_CONTACT (child));
}
+/**
+ * @out_child: (out) (allow-none)
+ */
+const gchar *
+empathy_roster_view_get_group_at_y (EmpathyRosterView *self,
+ gint y)
+{
+ GtkWidget *child;
+
+ child = egg_list_box_get_child_at_y (EGG_LIST_BOX (self), y);
+
+ if (EMPATHY_IS_ROSTER_CONTACT (child))
+ return empathy_roster_contact_get_group (EMPATHY_ROSTER_CONTACT (child));
+ else if (EMPATHY_IS_ROSTER_GROUP (child))
+ return empathy_roster_group_get_name (EMPATHY_ROSTER_GROUP (child));
+
+ return NULL;
+}
+
static gboolean
empathy_roster_view_query_tooltip (GtkWidget *widget,
gint x,
diff --git a/libempathy-gtk/empathy-roster-view.h b/libempathy-gtk/empathy-roster-view.h
index 786e54d1f..9e795b176 100644
--- a/libempathy-gtk/empathy-roster-view.h
+++ b/libempathy-gtk/empathy-roster-view.h
@@ -81,6 +81,10 @@ FolksIndividual * empathy_roster_view_get_individual_at_y (
gint y,
GtkWidget **out_child);
+const gchar * empathy_roster_view_get_group_at_y (
+ EmpathyRosterView *self,
+ gint y);
+
FolksIndividual * empathy_roster_view_get_selected_individual (EmpathyRosterView *self);
G_END_DECLS