]> git.0d.be Git - empathy.git/commitdiff
roster-view: add empathy_roster_view_get_group_at_y()
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 5 Jul 2012 13:53:47 +0000 (15:53 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 9 Jul 2012 12:55:54 +0000 (14:55 +0200)
libempathy-gtk/empathy-roster-view.c
libempathy-gtk/empathy-roster-view.h

index 3d55c3fa43efdfb3c655ad95a2f8b00835f6e7b2..c9994f48fb67bb5b460a9b79a0b9da70940c1e53 100644 (file)
@@ -1283,6 +1283,25 @@ empathy_roster_view_get_individual_at_y (EmpathyRosterView *self,
   return empathy_roster_contact_get_individual (EMPATHY_ROSTER_CONTACT (child));
 }
 
   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,
 static gboolean
 empathy_roster_view_query_tooltip (GtkWidget *widget,
     gint x,
index 786e54d1fdfb00280439513b1e919f535d03b466..9e795b176d0b0f2c528c307ecb8c5d1de1355e30 100644 (file)
@@ -81,6 +81,10 @@ FolksIndividual * empathy_roster_view_get_individual_at_y (
     gint y,
     GtkWidget **out_child);
 
     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
 FolksIndividual * empathy_roster_view_get_selected_individual (EmpathyRosterView *self);
 
 G_END_DECLS