aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-06-22 15:40:15 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-06-26 17:16:26 +0800
commit3a0dc8812d6c720499e34882b499f1cd9447c57c (patch)
tree8fd8e43d0c2b31500c3f5791ff9560b2fcb8ae5b /libempathy-gtk
parent9b18c84ccde2ff7231baddab7dd53403fc4df2d9 (diff)
downloadgsoc2013-empathy-3a0dc8812d6c720499e34882b499f1cd9447c57c.tar
gsoc2013-empathy-3a0dc8812d6c720499e34882b499f1cd9447c57c.tar.gz
gsoc2013-empathy-3a0dc8812d6c720499e34882b499f1cd9447c57c.tar.bz2
gsoc2013-empathy-3a0dc8812d6c720499e34882b499f1cd9447c57c.tar.lz
gsoc2013-empathy-3a0dc8812d6c720499e34882b499f1cd9447c57c.tar.xz
gsoc2013-empathy-3a0dc8812d6c720499e34882b499f1cd9447c57c.tar.zst
gsoc2013-empathy-3a0dc8812d6c720499e34882b499f1cd9447c57c.zip
roster-view: export empathy_roster_view_get_individual_at_y()
https://bugzilla.gnome.org/show_bug.cgi?id=678524
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-roster-view.c31
-rw-r--r--libempathy-gtk/empathy-roster-view.h5
2 files changed, 29 insertions, 7 deletions
diff --git a/libempathy-gtk/empathy-roster-view.c b/libempathy-gtk/empathy-roster-view.c
index 111b643b6..8dc739fde 100644
--- a/libempathy-gtk/empathy-roster-view.c
+++ b/libempathy-gtk/empathy-roster-view.c
@@ -1262,6 +1262,27 @@ empathy_roster_view_key_press_event (GtkWidget *widget,
return chain_up (widget, event);
}
+/**
+ * @out_child: (out) (allow-none)
+ */
+FolksIndividual *
+empathy_roster_view_get_individual_at_y (EmpathyRosterView *self,
+ gint y,
+ GtkWidget **out_child)
+{
+ GtkWidget *child;
+
+ child = egg_list_box_get_child_at_y (EGG_LIST_BOX (self), y);
+
+ if (out_child != NULL)
+ *out_child = child;
+
+ if (!EMPATHY_IS_ROSTER_CONTACT (child))
+ return NULL;
+
+ return empathy_roster_contact_get_individual (EMPATHY_ROSTER_CONTACT (child));
+}
+
static gboolean
empathy_roster_view_query_tooltip (GtkWidget *widget,
gint x,
@@ -1270,18 +1291,14 @@ empathy_roster_view_query_tooltip (GtkWidget *widget,
GtkTooltip *tooltip)
{
EmpathyRosterView *self = EMPATHY_ROSTER_VIEW (widget);
- GtkWidget *child;
- EmpathyRosterContact *contact;
FolksIndividual *individual;
gboolean result;
+ GtkWidget *child;
- child = egg_list_box_get_child_at_y (EGG_LIST_BOX (self), y);
- if (!EMPATHY_IS_ROSTER_CONTACT (child))
+ individual = empathy_roster_view_get_individual_at_y (self, y, &child);
+ if (individual == NULL)
return FALSE;
- contact = EMPATHY_ROSTER_CONTACT (child);
- individual = empathy_roster_contact_get_individual (contact);
-
g_signal_emit (self, signals[SIG_INDIVIDUAL_TOOLTIP], 0,
individual, keyboard_mode, tooltip, &result);
diff --git a/libempathy-gtk/empathy-roster-view.h b/libempathy-gtk/empathy-roster-view.h
index a0ed77515..ff9ba6c57 100644
--- a/libempathy-gtk/empathy-roster-view.h
+++ b/libempathy-gtk/empathy-roster-view.h
@@ -76,6 +76,11 @@ guint empathy_roster_view_add_event (EmpathyRosterView *self,
void empathy_roster_view_remove_event (EmpathyRosterView *self,
guint event_id);
+FolksIndividual * empathy_roster_view_get_individual_at_y (
+ EmpathyRosterView *self,
+ gint y,
+ GtkWidget **out_child);
+
G_END_DECLS
#endif /* #ifndef __EMPATHY_ROSTER_VIEW_H__*/