diff options
-rw-r--r-- | libempathy-gtk/Makefile.am | 4 | ||||
-rw-r--r-- | libempathy-gtk/empathy-roster-contact.c (renamed from libempathy-gtk/empathy-roster-item.c) | 82 | ||||
-rw-r--r-- | libempathy-gtk/empathy-roster-contact.h | 58 | ||||
-rw-r--r-- | libempathy-gtk/empathy-roster-item.h | 58 | ||||
-rw-r--r-- | libempathy-gtk/empathy-roster-view.c | 18 |
5 files changed, 110 insertions, 110 deletions
diff --git a/libempathy-gtk/Makefile.am b/libempathy-gtk/Makefile.am index ee33a60ca..7a9d01dfa 100644 --- a/libempathy-gtk/Makefile.am +++ b/libempathy-gtk/Makefile.am @@ -78,7 +78,7 @@ libempathy_gtk_handwritten_source = \ empathy-password-dialog.c \ empathy-presence-chooser.c \ empathy-protocol-chooser.c \ - empathy-roster-item.c \ + empathy-roster-contact.c \ empathy-roster-view.c \ empathy-search-bar.c \ empathy-share-my-desktop.c \ @@ -148,7 +148,7 @@ libempathy_gtk_headers = \ empathy-password-dialog.h \ empathy-presence-chooser.h \ empathy-protocol-chooser.h \ - empathy-roster-item.h \ + empathy-roster-contact.h \ empathy-roster-view.h \ empathy-search-bar.h \ empathy-share-my-desktop.h \ diff --git a/libempathy-gtk/empathy-roster-item.c b/libempathy-gtk/empathy-roster-contact.c index d3138b780..3b30d2517 100644 --- a/libempathy-gtk/empathy-roster-item.c +++ b/libempathy-gtk/empathy-roster-contact.c @@ -1,6 +1,6 @@ #include "config.h" -#include "empathy-roster-item.h" +#include "empathy-roster-contact.h" #include <telepathy-glib/util.h> @@ -9,7 +9,7 @@ #include <libempathy-gtk/empathy-images.h> #include <libempathy-gtk/empathy-ui-utils.h> -G_DEFINE_TYPE (EmpathyRosterItem, empathy_roster_item, GTK_TYPE_ALIGNMENT) +G_DEFINE_TYPE (EmpathyRosterContact, empathy_roster_contact, GTK_TYPE_ALIGNMENT) #define AVATAR_SIZE 48 @@ -30,7 +30,7 @@ enum static guint signals[LAST_SIGNAL]; */ -struct _EmpathyRosterItemPriv +struct _EmpathyRosterContactPriv { FolksIndividual *individual; @@ -45,19 +45,19 @@ struct _EmpathyRosterItemPriv }; static const gchar * -get_alias (EmpathyRosterItem *self) +get_alias (EmpathyRosterContact *self) { return folks_alias_details_get_alias (FOLKS_ALIAS_DETAILS ( self->priv->individual)); } static void -empathy_roster_item_get_property (GObject *object, +empathy_roster_contact_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { - EmpathyRosterItem *self = EMPATHY_ROSTER_ITEM (object); + EmpathyRosterContact *self = EMPATHY_ROSTER_CONTACT (object); switch (property_id) { @@ -77,12 +77,12 @@ empathy_roster_item_get_property (GObject *object, } static void -empathy_roster_item_set_property (GObject *object, +empathy_roster_contact_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { - EmpathyRosterItem *self = EMPATHY_ROSTER_ITEM (object); + EmpathyRosterContact *self = EMPATHY_ROSTER_CONTACT (object); switch (property_id) { @@ -102,7 +102,7 @@ avatar_loaded_cb (GObject *source, gpointer user_data) { TpWeakRef *wr = user_data; - EmpathyRosterItem *self; + EmpathyRosterContact *self; GdkPixbuf *pixbuf; self = tp_weak_ref_dup_object (wr); @@ -128,7 +128,7 @@ out: } static void -update_avatar (EmpathyRosterItem *self) +update_avatar (EmpathyRosterContact *self) { empathy_pixbuf_avatar_from_individual_scaled_async (self->priv->individual, AVATAR_SIZE, AVATAR_SIZE, NULL, avatar_loaded_cb, @@ -138,13 +138,13 @@ update_avatar (EmpathyRosterItem *self) static void avatar_changed_cb (FolksIndividual *individual, GParamSpec *spec, - EmpathyRosterItem *self) + EmpathyRosterContact *self) { update_avatar (self); } static void -update_alias (EmpathyRosterItem *self) +update_alias (EmpathyRosterContact *self) { gtk_label_set_text (GTK_LABEL (self->priv->alias), get_alias (self)); @@ -154,7 +154,7 @@ update_alias (EmpathyRosterItem *self) static void alias_changed_cb (FolksIndividual *individual, GParamSpec *spec, - EmpathyRosterItem *self) + EmpathyRosterContact *self) { update_alias (self); } @@ -175,7 +175,7 @@ is_phone (FolksIndividual *individual) } static void -update_presence_msg (EmpathyRosterItem *self) +update_presence_msg (EmpathyRosterContact *self) { const gchar *msg; @@ -208,13 +208,13 @@ update_presence_msg (EmpathyRosterItem *self) static void presence_message_changed_cb (FolksIndividual *individual, GParamSpec *spec, - EmpathyRosterItem *self) + EmpathyRosterContact *self) { update_presence_msg (self); } static void -update_presence_icon (EmpathyRosterItem *self) +update_presence_icon (EmpathyRosterContact *self) { const gchar *icon; @@ -225,7 +225,7 @@ update_presence_icon (EmpathyRosterItem *self) } static void -update_online (EmpathyRosterItem *self) +update_online (EmpathyRosterContact *self) { FolksPresenceType presence; gboolean online; @@ -265,18 +265,18 @@ update_online (EmpathyRosterItem *self) static void presence_status_changed_cb (FolksIndividual *individual, GParamSpec *spec, - EmpathyRosterItem *self) + EmpathyRosterContact *self) { update_presence_icon (self); update_online (self); } static void -empathy_roster_item_constructed (GObject *object) +empathy_roster_contact_constructed (GObject *object) { - EmpathyRosterItem *self = EMPATHY_ROSTER_ITEM (object); + EmpathyRosterContact *self = EMPATHY_ROSTER_CONTACT (object); void (*chain_up) (GObject *) = - ((GObjectClass *) empathy_roster_item_parent_class)->constructed; + ((GObjectClass *) empathy_roster_contact_parent_class)->constructed; if (chain_up != NULL) chain_up (object); @@ -302,11 +302,11 @@ empathy_roster_item_constructed (GObject *object) } static void -empathy_roster_item_dispose (GObject *object) +empathy_roster_contact_dispose (GObject *object) { - EmpathyRosterItem *self = EMPATHY_ROSTER_ITEM (object); + EmpathyRosterContact *self = EMPATHY_ROSTER_CONTACT (object); void (*chain_up) (GObject *) = - ((GObjectClass *) empathy_roster_item_parent_class)->dispose; + ((GObjectClass *) empathy_roster_contact_parent_class)->dispose; g_clear_object (&self->priv->individual); @@ -315,28 +315,28 @@ empathy_roster_item_dispose (GObject *object) } static void -empathy_roster_item_finalize (GObject *object) +empathy_roster_contact_finalize (GObject *object) { - //EmpathyRosterItem *self = EMPATHY_ROSTER_ITEM (object); + //EmpathyRosterContact *self = EMPATHY_ROSTER_CONTACT (object); void (*chain_up) (GObject *) = - ((GObjectClass *) empathy_roster_item_parent_class)->finalize; + ((GObjectClass *) empathy_roster_contact_parent_class)->finalize; if (chain_up != NULL) chain_up (object); } static void -empathy_roster_item_class_init ( - EmpathyRosterItemClass *klass) +empathy_roster_contact_class_init ( + EmpathyRosterContactClass *klass) { GObjectClass *oclass = G_OBJECT_CLASS (klass); GParamSpec *spec; - oclass->get_property = empathy_roster_item_get_property; - oclass->set_property = empathy_roster_item_set_property; - oclass->constructed = empathy_roster_item_constructed; - oclass->dispose = empathy_roster_item_dispose; - oclass->finalize = empathy_roster_item_finalize; + oclass->get_property = empathy_roster_contact_get_property; + oclass->set_property = empathy_roster_contact_set_property; + oclass->constructed = empathy_roster_contact_constructed; + oclass->dispose = empathy_roster_contact_dispose; + oclass->finalize = empathy_roster_contact_finalize; spec = g_param_spec_object ("individual", "Individual", "FolksIndividual", @@ -356,17 +356,17 @@ empathy_roster_item_class_init ( G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (oclass, PROP_ALIAS, spec); - g_type_class_add_private (klass, sizeof (EmpathyRosterItemPriv)); + g_type_class_add_private (klass, sizeof (EmpathyRosterContactPriv)); } static void -empathy_roster_item_init (EmpathyRosterItem *self) +empathy_roster_contact_init (EmpathyRosterContact *self) { GtkWidget *main_box, *box, *first_line_box; GtkStyleContext *context; self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, - EMPATHY_TYPE_ROSTER_ITEM, EmpathyRosterItemPriv); + EMPATHY_TYPE_ROSTER_CONTACT, EmpathyRosterContactPriv); gtk_widget_set_size_request (GTK_WIDGET (self), 300, 64); @@ -426,11 +426,11 @@ empathy_roster_item_init (EmpathyRosterItem *self) } GtkWidget * -empathy_roster_item_new (FolksIndividual *individual) +empathy_roster_contact_new (FolksIndividual *individual) { g_return_val_if_fail (FOLKS_IS_INDIVIDUAL (individual), NULL); - return g_object_new (EMPATHY_TYPE_ROSTER_ITEM, + return g_object_new (EMPATHY_TYPE_ROSTER_CONTACT, "individual", individual, "bottom-padding", 8, "top-padding", 8, @@ -440,13 +440,13 @@ empathy_roster_item_new (FolksIndividual *individual) } FolksIndividual * -empathy_roster_item_get_individual (EmpathyRosterItem *self) +empathy_roster_contact_get_individual (EmpathyRosterContact *self) { return self->priv->individual; } gboolean -empathy_roster_item_is_online (EmpathyRosterItem *self) +empathy_roster_contact_is_online (EmpathyRosterContact *self) { return self->priv->online; } diff --git a/libempathy-gtk/empathy-roster-contact.h b/libempathy-gtk/empathy-roster-contact.h new file mode 100644 index 000000000..09a791874 --- /dev/null +++ b/libempathy-gtk/empathy-roster-contact.h @@ -0,0 +1,58 @@ +#ifndef __EMPATHY_ROSTER_CONTACT_H__ +#define __EMPATHY_ROSTER_CONTACT_H__ + +#include <gtk/gtk.h> +#include <folks/folks.h> + +G_BEGIN_DECLS + +typedef struct _EmpathyRosterContact EmpathyRosterContact; +typedef struct _EmpathyRosterContactClass EmpathyRosterContactClass; +typedef struct _EmpathyRosterContactPriv EmpathyRosterContactPriv; + +struct _EmpathyRosterContactClass +{ + /*<private>*/ + GtkAlignmentClass parent_class; +}; + +struct _EmpathyRosterContact +{ + /*<private>*/ + GtkAlignment parent; + EmpathyRosterContactPriv *priv; +}; + +GType empathy_roster_contact_get_type (void); + +/* TYPE MACROS */ +#define EMPATHY_TYPE_ROSTER_CONTACT \ + (empathy_roster_contact_get_type ()) +#define EMPATHY_ROSTER_CONTACT(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), \ + EMPATHY_TYPE_ROSTER_CONTACT, \ + EmpathyRosterContact)) +#define EMPATHY_ROSTER_CONTACT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), \ + EMPATHY_TYPE_ROSTER_CONTACT, \ + EmpathyRosterContactClass)) +#define EMPATHY_IS_ROSTER_CONTACT(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ + EMPATHY_TYPE_ROSTER_CONTACT)) +#define EMPATHY_IS_ROSTER_CONTACT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), \ + EMPATHY_TYPE_ROSTER_CONTACT)) +#define EMPATHY_ROSTER_CONTACT_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), \ + EMPATHY_TYPE_ROSTER_CONTACT, \ + EmpathyRosterContactClass)) + +GtkWidget * empathy_roster_contact_new (FolksIndividual *individual); + +FolksIndividual * empathy_roster_contact_get_individual (EmpathyRosterContact *self); + +gboolean empathy_roster_contact_is_online (EmpathyRosterContact *self); + +G_END_DECLS + +#endif /* #ifndef __EMPATHY_ROSTER_CONTACT_H__*/ diff --git a/libempathy-gtk/empathy-roster-item.h b/libempathy-gtk/empathy-roster-item.h deleted file mode 100644 index 2b0b8cbdc..000000000 --- a/libempathy-gtk/empathy-roster-item.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef __EMPATHY_ROSTER_ITEM_H__ -#define __EMPATHY_ROSTER_ITEM_H__ - -#include <gtk/gtk.h> -#include <folks/folks.h> - -G_BEGIN_DECLS - -typedef struct _EmpathyRosterItem EmpathyRosterItem; -typedef struct _EmpathyRosterItemClass EmpathyRosterItemClass; -typedef struct _EmpathyRosterItemPriv EmpathyRosterItemPriv; - -struct _EmpathyRosterItemClass -{ - /*<private>*/ - GtkAlignmentClass parent_class; -}; - -struct _EmpathyRosterItem -{ - /*<private>*/ - GtkAlignment parent; - EmpathyRosterItemPriv *priv; -}; - -GType empathy_roster_item_get_type (void); - -/* TYPE MACROS */ -#define EMPATHY_TYPE_ROSTER_ITEM \ - (empathy_roster_item_get_type ()) -#define EMPATHY_ROSTER_ITEM(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), \ - EMPATHY_TYPE_ROSTER_ITEM, \ - EmpathyRosterItem)) -#define EMPATHY_ROSTER_ITEM_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), \ - EMPATHY_TYPE_ROSTER_ITEM, \ - EmpathyRosterItemClass)) -#define EMPATHY_IS_ROSTER_ITEM(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ - EMPATHY_TYPE_ROSTER_ITEM)) -#define EMPATHY_IS_ROSTER_ITEM_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass), \ - EMPATHY_TYPE_ROSTER_ITEM)) -#define EMPATHY_ROSTER_ITEM_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - EMPATHY_TYPE_ROSTER_ITEM, \ - EmpathyRosterItemClass)) - -GtkWidget * empathy_roster_item_new (FolksIndividual *individual); - -FolksIndividual * empathy_roster_item_get_individual (EmpathyRosterItem *self); - -gboolean empathy_roster_item_is_online (EmpathyRosterItem *self); - -G_END_DECLS - -#endif /* #ifndef __EMPATHY_ROSTER_ITEM_H__*/ diff --git a/libempathy-gtk/empathy-roster-view.c b/libempathy-gtk/empathy-roster-view.c index 793832ad6..f557c3454 100644 --- a/libempathy-gtk/empathy-roster-view.c +++ b/libempathy-gtk/empathy-roster-view.c @@ -3,7 +3,7 @@ #include "empathy-roster-view.h" -#include <libempathy-gtk/empathy-roster-item.h> +#include <libempathy-gtk/empathy-roster-contact.h> G_DEFINE_TYPE (EmpathyRosterView, empathy_roster_view, EGG_TYPE_LIST_BOX) @@ -28,7 +28,7 @@ struct _EmpathyRosterViewPriv { EmpathyIndividualManager *manager; - /* FolksIndividual (borrowed) -> EmpathyRosterItem (borrowed) */ + /* FolksIndividual (borrowed) -> EmpathyRosterContact (borrowed) */ GHashTable *items; gboolean show_offline; @@ -104,7 +104,7 @@ individual_added (EmpathyRosterView *self, if (item != NULL) return; - item = empathy_roster_item_new (individual); + item = empathy_roster_contact_new (individual); /* Need to refilter if online is changed */ g_signal_connect (item, "notify::online", @@ -161,15 +161,15 @@ members_changed_cb (EmpathyIndividualManager *manager, } static gint -roster_view_sort (EmpathyRosterItem *a, - EmpathyRosterItem *b, +roster_view_sort (EmpathyRosterContact *a, + EmpathyRosterContact *b, EmpathyRosterView *self) { FolksIndividual *ind_a, *ind_b; const gchar *alias_a, *alias_b; - ind_a = empathy_roster_item_get_individual (a); - ind_b = empathy_roster_item_get_individual (b); + ind_a = empathy_roster_contact_get_individual (a); + ind_b = empathy_roster_contact_get_individual (b); alias_a = folks_alias_details_get_alias (FOLKS_ALIAS_DETAILS (ind_a)); alias_b = folks_alias_details_get_alias (FOLKS_ALIAS_DETAILS (ind_b)); @@ -202,12 +202,12 @@ filter_list (GtkWidget *child, gpointer user_data) { EmpathyRosterView *self = user_data; - EmpathyRosterItem *item = EMPATHY_ROSTER_ITEM (child); + EmpathyRosterContact *item = EMPATHY_ROSTER_CONTACT (child); if (self->priv->show_offline) return TRUE; - return empathy_roster_item_is_online (item); + return empathy_roster_contact_is_online (item); } static void |