From: Xavier Claessens Date: Mon, 7 May 2007 19:48:22 +0000 (+0000) Subject: [darcs-to-svn @ Use icon-name API instead of stock icons and update tango icons] X-Git-Url: https://git.0d.be/?p=empathy.git;a=commitdiff_plain;h=c7010d43264dafca66ff65540c5d6666f1c66e2a [darcs-to-svn @ Use icon-name API instead of stock icons and update tango icons] svn path=/trunk/; revision=32 --- diff --git a/Makefile.am b/Makefile.am index a14dcd11..cc530dd6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = po profiles pixmaps libempathy libempathy-gtk src +SUBDIRS = po data libempathy libempathy-gtk src DISTCHECK_CONFIGURE_FLAGS = \ --disable-scrollkeeper diff --git a/configure.ac b/configure.ac index d03973ce..bf331eee 100644 --- a/configure.ac +++ b/configure.ac @@ -84,9 +84,9 @@ PKG_CHECK_MODULES(MISSION_CONTROL_PLUGINS, dnl ----------------------------------------------------------- AC_OUTPUT([ Makefile + data/Makefile + data/16x16/Makefile po/Makefile.in - profiles/Makefile - pixmaps/Makefile libempathy/Makefile libempathy-gtk/Makefile src/Makefile diff --git a/data/16x16/Makefile.am b/data/16x16/Makefile.am new file mode 100644 index 00000000..1b12272c --- /dev/null +++ b/data/16x16/Makefile.am @@ -0,0 +1,13 @@ +icondir = $(datadir)/icons/hicolor/16x16/apps +icon_DATA = \ + empathy-available.png \ + empathy-offline.png \ + empathy-away.png \ + empathy-extended-away.png \ + empathy-busy.png \ + empathy-pending.png \ + empathy-message.png \ + empathy-message-new.png \ + empathy-typing.png + +EXTRA_DIST = $(icon_DATA) diff --git a/data/16x16/empathy-available.png b/data/16x16/empathy-available.png new file mode 100644 index 00000000..66b24967 Binary files /dev/null and b/data/16x16/empathy-available.png differ diff --git a/data/16x16/empathy-away.png b/data/16x16/empathy-away.png new file mode 100644 index 00000000..ff59e309 Binary files /dev/null and b/data/16x16/empathy-away.png differ diff --git a/data/16x16/empathy-busy.png b/data/16x16/empathy-busy.png new file mode 100644 index 00000000..fec554d8 Binary files /dev/null and b/data/16x16/empathy-busy.png differ diff --git a/data/16x16/empathy-extended-away.png b/data/16x16/empathy-extended-away.png new file mode 100644 index 00000000..9f74bd01 Binary files /dev/null and b/data/16x16/empathy-extended-away.png differ diff --git a/data/16x16/empathy-message-new.png b/data/16x16/empathy-message-new.png new file mode 100644 index 00000000..da01aff7 Binary files /dev/null and b/data/16x16/empathy-message-new.png differ diff --git a/data/16x16/empathy-message.png b/data/16x16/empathy-message.png new file mode 100644 index 00000000..be0e2e15 Binary files /dev/null and b/data/16x16/empathy-message.png differ diff --git a/data/16x16/empathy-offline.png b/data/16x16/empathy-offline.png new file mode 100644 index 00000000..0321dc6b Binary files /dev/null and b/data/16x16/empathy-offline.png differ diff --git a/data/16x16/empathy-pending.png b/data/16x16/empathy-pending.png new file mode 100644 index 00000000..4adfdb64 Binary files /dev/null and b/data/16x16/empathy-pending.png differ diff --git a/data/16x16/empathy-typing.png b/data/16x16/empathy-typing.png new file mode 100644 index 00000000..5c272a33 Binary files /dev/null and b/data/16x16/empathy-typing.png differ diff --git a/data/Makefile.am b/data/Makefile.am new file mode 100644 index 00000000..0f2e1b07 --- /dev/null +++ b/data/Makefile.am @@ -0,0 +1,27 @@ +SUBDIRS = 16x16 + +profiledir = $(datadir)/mission-control/profiles +profile_DATA = \ + jabber.profile \ + gtalk.profile \ + salut.profile \ + msn.profile + +gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor + +install-data-hook: update-icon-cache +uninstall-hook: update-icon-cache +update-icon-cache: + @-if test -z "$(DESTDIR)"; then \ + echo "Updating Gtk icon cache."; \ + $(gtk_update_icon_cache); \ + else \ + echo "*** Icon cache not updated. After (un)install, run this:"; \ + echo "*** $(gtk_update_icon_cache)"; \ + fi + +EXTRA_DIST = \ + $(image_DATA) \ + $(profile_DATA) + + diff --git a/data/gtalk.profile b/data/gtalk.profile new file mode 100644 index 00000000..c70bfa84 --- /dev/null +++ b/data/gtalk.profile @@ -0,0 +1,14 @@ +[Profile] +Manager=gabble +Protocol=jabber +DisplayName=Google Talk +IconName = im-jabber +ConfigurationUI = jabber +DefaultAccountDomain = gmail.com, googlemail.com +Default-server = talk.google.com +Default-port = 5223 +Default-old-ssl = 1 +Default-fallback-conference-server = conference.jabber.org +Default-randomize-resource = 1 +Default-ignore-ssl-errors = 1 +SupportsInvisible = 0 diff --git a/data/jabber.profile b/data/jabber.profile new file mode 100644 index 00000000..811132cd --- /dev/null +++ b/data/jabber.profile @@ -0,0 +1,8 @@ +[Profile] +Manager=gabble +Protocol=jabber +DisplayName=Jabber +IconName = im-jabber +ConfigurationUI = jabber +DefaultAccountDomain = jabber.org +SupportsInvisible = 0 diff --git a/data/msn.profile b/data/msn.profile new file mode 100644 index 00000000..599204c1 --- /dev/null +++ b/data/msn.profile @@ -0,0 +1,7 @@ +[Profile] +Manager=butterfly +Protocol=msn +DisplayName=MSN +IconName = im-msn +ConfigurationUI = msn +SupportsInvisible = 1 diff --git a/data/salut.profile b/data/salut.profile new file mode 100644 index 00000000..22c9c186 --- /dev/null +++ b/data/salut.profile @@ -0,0 +1,7 @@ +[Profile] +Manager=salut +Protocol=salut +DisplayName=Salut +IconName = im-jabber +ConfigurationUI = salut + diff --git a/data/scalable/message-new.xcf b/data/scalable/message-new.xcf new file mode 100644 index 00000000..57d57434 Binary files /dev/null and b/data/scalable/message-new.xcf differ diff --git a/data/scalable/message.xcf b/data/scalable/message.xcf new file mode 100644 index 00000000..c255be04 Binary files /dev/null and b/data/scalable/message.xcf differ diff --git a/data/scalable/process-typing.xcf b/data/scalable/process-typing.xcf new file mode 100644 index 00000000..d2fa5f44 Binary files /dev/null and b/data/scalable/process-typing.xcf differ diff --git a/data/scalable/status-avaible.svg b/data/scalable/status-avaible.svg new file mode 100644 index 00000000..8d4cc585 --- /dev/null +++ b/data/scalable/status-avaible.svg @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/data/scalable/status-away-extended.svg b/data/scalable/status-away-extended.svg new file mode 100644 index 00000000..3104dff5 --- /dev/null +++ b/data/scalable/status-away-extended.svg @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/data/scalable/status-away.svg b/data/scalable/status-away.svg new file mode 100644 index 00000000..7e7b0ed6 --- /dev/null +++ b/data/scalable/status-away.svg @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/data/scalable/status-busy.svg b/data/scalable/status-busy.svg new file mode 100644 index 00000000..66fc7094 --- /dev/null +++ b/data/scalable/status-busy.svg @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/data/scalable/status-offline.svg b/data/scalable/status-offline.svg new file mode 100644 index 00000000..975f7dc8 --- /dev/null +++ b/data/scalable/status-offline.svg @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/data/scalable/status-pending.svg b/data/scalable/status-pending.svg new file mode 100644 index 00000000..89c626c8 --- /dev/null +++ b/data/scalable/status-pending.svg @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/libempathy-gtk/Makefile.am b/libempathy-gtk/Makefile.am index 2818b2a2..c5b66b74 100644 --- a/libempathy-gtk/Makefile.am +++ b/libempathy-gtk/Makefile.am @@ -10,6 +10,7 @@ noinst_LTLIBRARIES = libempathy-gtk.la libempathy_gtk_la_SOURCES = \ ephy-spinner.c ephy-spinner.h \ + empathy-images.h \ empathy-main-window.c empathy-main-window.h \ gossip-accounts-dialog.c gossip-accounts-dialog.h \ gossip-account-widget-generic.c gossip-account-widget-generic.h \ @@ -17,7 +18,6 @@ libempathy_gtk_la_SOURCES = \ gossip-profile-chooser.c gossip-profile-chooser.h \ gossip-cell-renderer-expander.c gossip-cell-renderer-expander.h \ gossip-cell-renderer-text.c gossip-cell-renderer-text.h \ - gossip-stock.c gossip-stock.h \ gossip-spell.c gossip-spell.h \ gossip-contact-groups.c gossip-contact-groups.h \ gossip-contact-list.c gossip-contact-list.h \ diff --git a/libempathy-gtk/empathy-images.h b/libempathy-gtk/empathy-images.h new file mode 100644 index 00000000..439f4c92 --- /dev/null +++ b/libempathy-gtk/empathy-images.h @@ -0,0 +1,42 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Copyright (C) 2007 Collabora Ltd. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Xavier Claessens + */ + +#ifndef __EMPATHY_IMAGES_H__ +#define __EMPATHY_IMAGES_H__ + +G_BEGIN_DECLS + +#define EMPATHY_IMAGE_OFFLINE "empathy-offline" +#define EMPATHY_IMAGE_AVAILABLE "empathy-available" +#define EMPATHY_IMAGE_BUSY "empathy-busy" +#define EMPATHY_IMAGE_AWAY "empathy-away" +#define EMPATHY_IMAGE_EXT_AWAY "empathy-extended-away" +#define EMPATHY_IMAGE_PENDING "empathy-pending" + +#define EMPATHY_IMAGE_MESSAGE "empathy-message" +#define EMPATHY_IMAGE_TYPING "empathy-typing" +#define EMPATHY_IMAGE_CONTACT_INFORMATION "vcard_16" +#define EMPATHY_IMAGE_GROUP_MESSAGE "gossip-group-message" + +G_END_DECLS + +#endif /* __EMPATHY_IMAGES_ICONS_H__ */ diff --git a/libempathy-gtk/gossip-accounts-dialog.c b/libempathy-gtk/gossip-accounts-dialog.c index ad9f7976..449577ae 100644 --- a/libempathy-gtk/gossip-accounts-dialog.c +++ b/libempathy-gtk/gossip-accounts-dialog.c @@ -305,15 +305,12 @@ accounts_dialog_update_account (GossipAccountsDialog *dialog, if (account) { McProfile *profile; - GdkPixbuf *pixbuf; - - pixbuf = gossip_pixbuf_from_account (account, GTK_ICON_SIZE_DIALOG); - gtk_image_set_from_pixbuf (GTK_IMAGE (dialog->image_type), pixbuf); - if (pixbuf) { - g_object_unref (pixbuf); - } profile = mc_account_get_profile (account); + gtk_image_set_from_icon_name (GTK_IMAGE (dialog->image_type), + mc_profile_get_icon_name (profile), + GTK_ICON_SIZE_DIALOG); + gtk_label_set_text (GTK_LABEL (dialog->label_type), mc_profile_get_display_name (profile)); @@ -412,6 +409,7 @@ accounts_dialog_model_pixbuf_data_func (GtkTreeViewColumn *tree_column, GossipAccountsDialog *dialog) { McAccount *account; + const gchar *icon_name; GdkPixbuf *pixbuf; TelepathyConnectionStatus status; @@ -420,7 +418,8 @@ accounts_dialog_model_pixbuf_data_func (GtkTreeViewColumn *tree_column, COL_ACCOUNT_POINTER, &account, -1); - pixbuf = gossip_pixbuf_from_account (account, GTK_ICON_SIZE_BUTTON); + icon_name = gossip_icon_name_from_account (account); + pixbuf = gossip_pixbuf_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON); if (pixbuf) { if (status == TP_CONN_STATUS_DISCONNECTED || diff --git a/libempathy-gtk/gossip-chat-window.c b/libempathy-gtk/gossip-chat-window.c index 9f6f1a36..feeda5e0 100644 --- a/libempathy-gtk/gossip-chat-window.c +++ b/libempathy-gtk/gossip-chat-window.c @@ -40,6 +40,7 @@ #include #include "gossip-chat-window.h" +#include "empathy-images.h" //#include "gossip-add-contact-dialog.h" //#include "gossip-chat-invite.h" //#include "gossip-contact-info-dialog.h" @@ -48,7 +49,6 @@ #include "gossip-preferences.h" #include "gossip-private-chat.h" //#include "gossip-sound.h" -#include "gossip-stock.h" #include "gossip-ui-utils.h" #define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GOSSIP_TYPE_CHAT_WINDOW, GossipChatWindowPriv)) @@ -106,8 +106,6 @@ struct _GossipChatWindowPriv { static void gossip_chat_window_class_init (GossipChatWindowClass *klass); static void gossip_chat_window_init (GossipChatWindow *window); static void gossip_chat_window_finalize (GObject *object); -static GdkPixbuf *chat_window_get_status_pixbuf (GossipChatWindow *window, - GossipChat *chat); static void chat_window_accel_cb (GtkAccelGroup *accelgroup, GObject *object, guint key, @@ -354,9 +352,9 @@ gossip_chat_window_init (GossipChatWindow *window) * stock image */ image = gtk_image_menu_item_get_image (GTK_IMAGE_MENU_ITEM (priv->menu_conv_info)); - gtk_image_set_from_stock (GTK_IMAGE (image), - GOSSIP_STOCK_CONTACT_INFORMATION, - GTK_ICON_SIZE_MENU); + gtk_image_set_from_icon_name (GTK_IMAGE (image), + EMPATHY_IMAGE_CONTACT_INFORMATION, + GTK_ICON_SIZE_MENU); /* Set up smiley menu */ menu = gossip_chat_view_get_smiley_menu ( @@ -502,30 +500,6 @@ gossip_chat_window_finalize (GObject *object) G_OBJECT_CLASS (gossip_chat_window_parent_class)->finalize (object); } -static GdkPixbuf * -chat_window_get_status_pixbuf (GossipChatWindow *window, - GossipChat *chat) -{ - GossipChatWindowPriv *priv; - GdkPixbuf *pixbuf; - - priv = GET_PRIV (window); - - if (g_list_find (priv->chats_new_msg, chat)) { - pixbuf = gossip_stock_render (GOSSIP_STOCK_MESSAGE, - GTK_ICON_SIZE_MENU); - } - else if (g_list_find (priv->chats_composing, chat)) { - pixbuf = gossip_stock_render (GOSSIP_STOCK_TYPING, - GTK_ICON_SIZE_MENU); - } - else { - pixbuf = gossip_chat_get_status_pixbuf (chat); - } - - return pixbuf; -} - static void chat_window_accel_cb (GtkAccelGroup *accelgroup, GObject *object, @@ -668,15 +642,24 @@ static void chat_window_update_status (GossipChatWindow *window, GossipChat *chat) { - GtkImage *image; - GdkPixbuf *pixbuf; + GossipChatWindowPriv *priv; + GtkImage *image; + const gchar *icon_name = NULL; + + priv = GET_PRIV (window); - pixbuf = chat_window_get_status_pixbuf (window, chat); + if (g_list_find (priv->chats_new_msg, chat)) { + icon_name = EMPATHY_IMAGE_MESSAGE; + } + else if (g_list_find (priv->chats_composing, chat)) { + icon_name = EMPATHY_IMAGE_TYPING; + } + else { + icon_name = gossip_chat_get_status_icon_name (chat); + } image = g_object_get_data (G_OBJECT (chat), "chat-window-tab-image"); - gtk_image_set_from_pixbuf (image, pixbuf); + gtk_image_set_from_icon_name (image, icon_name, GTK_ICON_SIZE_MENU); - g_object_unref (pixbuf); - chat_window_update_title (window, chat); chat_window_update_tooltip (window, chat); } @@ -686,7 +669,6 @@ chat_window_update_title (GossipChatWindow *window, GossipChat *chat) { GossipChatWindowPriv *priv; - GdkPixbuf *pixbuf = NULL; const gchar *str; gchar *title; gint n_chats; @@ -742,16 +724,10 @@ chat_window_update_title (GossipChatWindow *window, g_free (title); if (priv->chats_new_msg) { - pixbuf = gossip_stock_render (GOSSIP_STOCK_MESSAGE, - GTK_ICON_SIZE_MENU); + gtk_window_set_icon_name (GTK_WINDOW (priv->dialog), + EMPATHY_IMAGE_MESSAGE); } else { - pixbuf = NULL; - } - - gtk_window_set_icon (GTK_WINDOW (priv->dialog), pixbuf); - - if (pixbuf) { - g_object_unref (pixbuf); + gtk_window_set_icon_name (GTK_WINDOW (priv->dialog), NULL); } } diff --git a/libempathy-gtk/gossip-chat.c b/libempathy-gtk/gossip-chat.c index 85aeee27..e8906dbd 100644 --- a/libempathy-gtk/gossip-chat.c +++ b/libempathy-gtk/gossip-chat.c @@ -1072,13 +1072,13 @@ gossip_chat_get_tooltip (GossipChat *chat) return NULL; } -GdkPixbuf * -gossip_chat_get_status_pixbuf (GossipChat *chat) +const gchar * +gossip_chat_get_status_icon_name (GossipChat *chat) { g_return_val_if_fail (GOSSIP_IS_CHAT (chat), NULL); - if (GOSSIP_CHAT_GET_CLASS (chat)->get_status_pixbuf) { - return GOSSIP_CHAT_GET_CLASS (chat)->get_status_pixbuf (chat); + if (GOSSIP_CHAT_GET_CLASS (chat)->get_status_icon_name) { + return GOSSIP_CHAT_GET_CLASS (chat)->get_status_icon_name (chat); } return NULL; diff --git a/libempathy-gtk/gossip-chat.h b/libempathy-gtk/gossip-chat.h index 3de788ee..8cbcee0b 100644 --- a/libempathy-gtk/gossip-chat.h +++ b/libempathy-gtk/gossip-chat.h @@ -66,27 +66,26 @@ struct _GossipChatClass { GObjectClass parent; /* VTable */ - const gchar * (*get_name) (GossipChat *chat); - gchar * (*get_tooltip) (GossipChat *chat); - GdkPixbuf * (*get_status_pixbuf)(GossipChat *chat); - GossipContact * (*get_contact) (GossipChat *chat); - GtkWidget * (*get_widget) (GossipChat *chat); - - gboolean (*get_show_contacts)(GossipChat *chat); - void (*set_show_contacts)(GossipChat *chat, - gboolean show); - - gboolean (*is_group_chat) (GossipChat *chat); - void (*save_geometry) (GossipChat *chat, - gint x, - gint y, - gint w, - gint h); - void (*load_geometry) (GossipChat *chat, - gint *x, - gint *y, - gint *w, - gint *h); + const gchar * (*get_name) (GossipChat *chat); + gchar * (*get_tooltip) (GossipChat *chat); + const gchar * (*get_status_icon_name)(GossipChat *chat); + GossipContact * (*get_contact) (GossipChat *chat); + GtkWidget * (*get_widget) (GossipChat *chat); + + gboolean (*get_show_contacts) (GossipChat *chat); + void (*set_show_contacts) (GossipChat *chat, + gboolean show); + gboolean (*is_group_chat) (GossipChat *chat); + void (*save_geometry) (GossipChat *chat, + gint x, + gint y, + gint w, + gint h); + void (*load_geometry) (GossipChat *chat, + gint *x, + gint *y, + gint *w, + gint *h); }; GType gossip_chat_get_type (void); @@ -103,14 +102,13 @@ void gossip_chat_copy (GossipChat *chat); void gossip_chat_paste (GossipChat *chat); const gchar * gossip_chat_get_name (GossipChat *chat); gchar * gossip_chat_get_tooltip (GossipChat *chat); -GdkPixbuf * gossip_chat_get_status_pixbuf (GossipChat *chat); +const gchar * gossip_chat_get_status_icon_name (GossipChat *chat); GossipContact * gossip_chat_get_contact (GossipChat *chat); GossipContact * gossip_chat_get_own_contact (GossipChat *chat); GtkWidget * gossip_chat_get_widget (GossipChat *chat); gboolean gossip_chat_get_show_contacts (GossipChat *chat); void gossip_chat_set_show_contacts (GossipChat *chat, gboolean show); - gboolean gossip_chat_is_group_chat (GossipChat *chat); gboolean gossip_chat_is_connected (GossipChat *chat); diff --git a/libempathy-gtk/gossip-contact-list.c b/libempathy-gtk/gossip-contact-list.c index bf0556dc..aa5eb385 100644 --- a/libempathy-gtk/gossip-contact-list.c +++ b/libempathy-gtk/gossip-contact-list.c @@ -37,11 +37,11 @@ #include #include +#include "empathy-images.h" #include "gossip-contact-list.h" #include "gossip-contact-groups.h" #include "gossip-cell-renderer-expander.h" #include "gossip-cell-renderer-text.h" -#include "gossip-stock.h" #include "gossip-ui-utils.h" //#include "gossip-chat-invite.h" //#include "gossip-contact-info-dialog.h" @@ -257,7 +257,7 @@ static gboolean contact_list_update_list_mode_foreach (GtkTreeModel GossipContactList *list); enum { - COL_PIXBUF_STATUS, + COL_ICON_STATUS, COL_PIXBUF_AVATAR, COL_PIXBUF_AVATAR_VISIBLE, COL_NAME, @@ -288,11 +288,11 @@ static const GtkActionEntry entries[] = { N_("_Group"),NULL, NULL, NULL }, - { "Chat", GOSSIP_STOCK_MESSAGE, + { "Chat", EMPATHY_IMAGE_MESSAGE, N_("_Chat"), NULL, N_("Chat with contact"), G_CALLBACK (contact_list_action_cb) }, - { "Information", GOSSIP_STOCK_CONTACT_INFORMATION, + { "Information", EMPATHY_IMAGE_CONTACT_INFORMATION, N_("Infor_mation"), "I", N_("View contact information"), G_CALLBACK (contact_list_action_cb) }, @@ -308,7 +308,7 @@ static const GtkActionEntry entries[] = { N_("_Remove"), NULL, N_("Remove contact"), G_CALLBACK (contact_list_action_cb) }, - { "Invite", GOSSIP_STOCK_GROUP_MESSAGE, + { "Invite", EMPATHY_IMAGE_GROUP_MESSAGE, N_("_Invite to Chat Room"), NULL, N_("Invite to a currently open chat room"), G_CALLBACK (contact_list_action_cb) }, @@ -602,7 +602,6 @@ contact_list_contact_update (GossipContactList *list, gboolean do_remove = FALSE; gboolean do_set_active = FALSE; gboolean do_set_refresh = FALSE; - GdkPixbuf *pixbuf_presence; GdkPixbuf *pixbuf_avatar; priv = GET_PRIV (list); @@ -701,11 +700,10 @@ contact_list_contact_update (GossipContactList *list, set_model = TRUE; } - pixbuf_presence = gossip_pixbuf_for_contact (contact); pixbuf_avatar = gossip_pixbuf_avatar_from_contact_scaled (contact, 32, 32); for (l = iters; l && set_model; l = l->next) { gtk_tree_store_set (priv->store, l->data, - COL_PIXBUF_STATUS, pixbuf_presence, + COL_ICON_STATUS, gossip_icon_name_for_contact (contact), COL_STATUS, gossip_contact_get_status (contact), COL_IS_ONLINE, now_online, COL_NAME, gossip_contact_get_name (contact), @@ -713,9 +711,6 @@ contact_list_contact_update (GossipContactList *list, -1); } - if (pixbuf_presence) { - g_object_unref (pixbuf_presence); - } if (pixbuf_avatar) { g_object_unref (pixbuf_avatar); } @@ -1036,7 +1031,7 @@ contact_list_get_group (GossipContactList *list, gtk_tree_store_append (priv->store, &iter_group, NULL); gtk_tree_store_set (priv->store, &iter_group, - COL_PIXBUF_STATUS, NULL, + COL_ICON_STATUS, NULL, COL_NAME, name, COL_IS_GROUP, TRUE, COL_IS_ACTIVE, FALSE, @@ -1102,11 +1097,9 @@ contact_list_add_contact (GossipContactList *list, /* If no groups just add it at the top level. */ groups = gossip_contact_get_groups (contact); if (!groups) { - GdkPixbuf *pixbuf_status; GdkPixbuf *pixbuf_avatar; gboolean show_avatar = FALSE; - pixbuf_status = gossip_pixbuf_for_contact (contact); pixbuf_avatar = gossip_pixbuf_avatar_from_contact_scaled (contact, 32, 32); if (priv->show_avatars && !priv->is_compact) { @@ -1125,7 +1118,7 @@ contact_list_add_contact (GossipContactList *list, gtk_tree_store_append (priv->store, &iter, NULL); gtk_tree_store_set (priv->store, &iter, - COL_PIXBUF_STATUS, pixbuf_status, + COL_ICON_STATUS, gossip_icon_name_for_contact (contact), COL_PIXBUF_AVATAR, pixbuf_avatar, COL_PIXBUF_AVATAR_VISIBLE, show_avatar, COL_NAME, gossip_contact_get_name (contact), @@ -1145,16 +1138,12 @@ contact_list_add_contact (GossipContactList *list, if (pixbuf_avatar) { g_object_unref (pixbuf_avatar); } - if (pixbuf_status) { - g_object_unref (pixbuf_status); - } } /* Else add to each group. */ for (l = groups; l; l = l->next) { GtkTreePath *path; GtkTreeIter model_iter_group; - GdkPixbuf *pixbuf_status; GdkPixbuf *pixbuf_avatar; const gchar *name; gboolean created; @@ -1166,7 +1155,6 @@ contact_list_add_contact (GossipContactList *list, continue; } - pixbuf_status = gossip_pixbuf_for_contact (contact); pixbuf_avatar = gossip_pixbuf_avatar_from_contact_scaled (contact, 32, 32); contact_list_get_group (list, name, &iter_group, &iter_separator, &created); @@ -1187,7 +1175,7 @@ contact_list_add_contact (GossipContactList *list, gtk_tree_store_insert_after (priv->store, &iter, &iter_group, NULL); gtk_tree_store_set (priv->store, &iter, - COL_PIXBUF_STATUS, pixbuf_status, + COL_ICON_STATUS, gossip_icon_name_for_contact (contact), COL_PIXBUF_AVATAR, pixbuf_avatar, COL_PIXBUF_AVATAR_VISIBLE, show_avatar, COL_NAME, gossip_contact_get_name (contact), @@ -1207,9 +1195,6 @@ contact_list_add_contact (GossipContactList *list, if (pixbuf_avatar) { g_object_unref (pixbuf_avatar); } - if (pixbuf_status) { - g_object_unref (pixbuf_status); - } if (!created) { continue; @@ -1303,7 +1288,7 @@ contact_list_create_model (GossipContactList *list) } priv->store = gtk_tree_store_new (COL_COUNT, - GDK_TYPE_PIXBUF, /* Status pixbuf */ + G_TYPE_STRING, /* Status icon-name */ GDK_TYPE_PIXBUF, /* Avatar pixbuf */ G_TYPE_BOOLEAN, /* Avatar pixbuf visible */ G_TYPE_STRING, /* Name */ @@ -1834,9 +1819,6 @@ contact_list_cell_set_background (GossipContactList *list, NULL); } } else { - g_object_set (cell, - "cell-background-gdk", NULL, - NULL); #if 0 gint color_sum_normal; gint color_sum_selected; @@ -1873,24 +1855,22 @@ contact_list_pixbuf_cell_data_func (GtkTreeViewColumn *tree_column, GtkTreeIter *iter, GossipContactList *list) { - GdkPixbuf *pixbuf; - gboolean is_group; - gboolean is_active; + gchar *icon_name; + gboolean is_group; + gboolean is_active; gtk_tree_model_get (model, iter, COL_IS_GROUP, &is_group, COL_IS_ACTIVE, &is_active, - COL_PIXBUF_STATUS, &pixbuf, + COL_ICON_STATUS, &icon_name, -1); g_object_set (cell, "visible", !is_group, - "pixbuf", pixbuf, + "icon-name", icon_name, NULL); - if (pixbuf) { - g_object_unref (pixbuf); - } + g_free (icon_name); contact_list_cell_set_background (list, cell, is_group, is_active); } diff --git a/libempathy-gtk/gossip-preferences.c b/libempathy-gtk/gossip-preferences.c index 2179a7ef..a02a4fa9 100644 --- a/libempathy-gtk/gossip-preferences.c +++ b/libempathy-gtk/gossip-preferences.c @@ -33,7 +33,6 @@ #include #include "gossip-preferences.h" -#include "gossip-stock.h" #include "gossip-ui-utils.h" #include "gossip-theme-manager.h" #include "gossip-spell.h" diff --git a/libempathy-gtk/gossip-presence-chooser.c b/libempathy-gtk/gossip-presence-chooser.c index e540c8a4..46b27545 100644 --- a/libempathy-gtk/gossip-presence-chooser.c +++ b/libempathy-gtk/gossip-presence-chooser.c @@ -34,7 +34,7 @@ #include #include "gossip-ui-utils.h" -#include "gossip-stock.h" +#include "empathy-images.h" #include "gossip-presence-chooser.h" #include "gossip-status-presets.h" @@ -321,7 +321,6 @@ presence_chooser_show_dialog (GossipPresenceChooser *chooser, GtkWidget *combo; GtkWidget *entry; GtkWidget *checkbutton; - GdkPixbuf *pixbuf; const gchar *default_status; priv = GET_PRIV (chooser); @@ -355,9 +354,9 @@ presence_chooser_show_dialog (GossipPresenceChooser *chooser, G_CALLBACK (presence_chooser_dialog_response_cb), chooser); - pixbuf = gossip_pixbuf_for_presence_state (state); - gtk_image_set_from_pixbuf (GTK_IMAGE (image), pixbuf); - g_object_unref (pixbuf); + gtk_image_set_from_icon_name (GTK_IMAGE (image), + gossip_icon_name_for_presence_state (state), + GTK_ICON_SIZE_MENU); if (!store[state]) { GList *presets, *l; @@ -486,10 +485,10 @@ presence_chooser_menu_add_item (GossipPresenceChooser *chooser, { GtkWidget *item; GtkWidget *image; - const gchar *stock; + const gchar *icon_name; item = gtk_image_menu_item_new_with_label (str); - stock = gossip_stock_for_state (state); + icon_name = gossip_icon_name_for_presence_state (state); if (custom) { g_signal_connect ( @@ -505,7 +504,7 @@ presence_chooser_menu_add_item (GossipPresenceChooser *chooser, chooser); } - image = gtk_image_new_from_stock (stock, GTK_ICON_SIZE_MENU); + image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU); gtk_widget_show (image); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image); @@ -943,7 +942,6 @@ presence_chooser_flash_timeout_cb (GossipPresenceChooser *chooser) { GossipPresenceChooserPriv *priv; McPresence state; - GdkPixbuf *pixbuf; static gboolean on = FALSE; priv = GET_PRIV (chooser); @@ -954,9 +952,9 @@ presence_chooser_flash_timeout_cb (GossipPresenceChooser *chooser) state = priv->flash_state_2; } - pixbuf = gossip_pixbuf_for_presence_state (state); - gtk_image_set_from_pixbuf (GTK_IMAGE (priv->image), pixbuf); - g_object_unref (pixbuf); + gtk_image_set_from_icon_name (GTK_IMAGE (priv->image), + gossip_icon_name_for_presence_state (state), + GTK_ICON_SIZE_MENU); on = !on; @@ -991,7 +989,6 @@ gossip_presence_chooser_flash_stop (GossipPresenceChooser *chooser, McPresence state) { GossipPresenceChooserPriv *priv; - GdkPixbuf *pixbuf; g_return_if_fail (GOSSIP_IS_PRESENCE_CHOOSER (chooser)); @@ -1002,9 +999,9 @@ gossip_presence_chooser_flash_stop (GossipPresenceChooser *chooser, priv->flash_timeout_id = 0; } - pixbuf = gossip_pixbuf_for_presence_state (state); - gtk_image_set_from_pixbuf (GTK_IMAGE (priv->image), pixbuf); - g_object_unref (pixbuf); + gtk_image_set_from_icon_name (GTK_IMAGE (priv->image), + gossip_icon_name_for_presence_state (state), + GTK_ICON_SIZE_MENU); priv->last_state = state; } diff --git a/libempathy-gtk/gossip-private-chat.c b/libempathy-gtk/gossip-private-chat.c index 17c55b19..a3bdbb6b 100644 --- a/libempathy-gtk/gossip-private-chat.c +++ b/libempathy-gtk/gossip-private-chat.c @@ -44,7 +44,7 @@ #include "gossip-chat.h" #include "gossip-preferences.h" //#include "gossip-sound.h" -#include "gossip-stock.h" +#include "empathy-images.h" #include "gossip-ui-utils.h" #define DEBUG_DOMAIN "PrivateChat" @@ -78,13 +78,9 @@ static void private_chat_widget_destroy_cb (GtkWidget GossipPrivateChat *chat); static const gchar * private_chat_get_name (GossipChat *chat); static gchar * private_chat_get_tooltip (GossipChat *chat); -static GdkPixbuf * private_chat_get_status_pixbuf (GossipChat *chat); +static const gchar * private_chat_get_status_icon_name (GossipChat *chat); static GossipContact *private_chat_get_contact (GossipChat *chat); static GtkWidget * private_chat_get_widget (GossipChat *chat); -/*static GdkPixbuf * private_chat_pad_to_size (GdkPixbuf *pixbuf, - gint width, - gint height, - gint extra_padding_right);*/ G_DEFINE_TYPE (GossipPrivateChat, gossip_private_chat, GOSSIP_TYPE_CHAT); @@ -96,14 +92,14 @@ gossip_private_chat_class_init (GossipPrivateChatClass *klass) object_class->finalize = private_chat_finalize; - chat_class->get_name = private_chat_get_name; - chat_class->get_tooltip = private_chat_get_tooltip; - chat_class->get_status_pixbuf = private_chat_get_status_pixbuf; - chat_class->get_contact = private_chat_get_contact; - chat_class->get_widget = private_chat_get_widget; - chat_class->get_show_contacts = NULL; - chat_class->set_show_contacts = NULL; - chat_class->is_group_chat = NULL; + chat_class->get_name = private_chat_get_name; + chat_class->get_tooltip = private_chat_get_tooltip; + chat_class->get_status_icon_name = private_chat_get_status_icon_name; + chat_class->get_contact = private_chat_get_contact; + chat_class->get_widget = private_chat_get_widget; + chat_class->get_show_contacts = NULL; + chat_class->set_show_contacts = NULL; + chat_class->is_group_chat = NULL; g_type_class_add_private (object_class, sizeof (GossipPrivateChatPriv)); } @@ -283,8 +279,8 @@ private_chat_get_tooltip (GossipChat *chat) status); } -static GdkPixbuf * -private_chat_get_status_pixbuf (GossipChat *chat) +static const gchar * +private_chat_get_status_icon_name (GossipChat *chat) { GossipPrivateChatPriv *priv; GossipContact *contact; @@ -295,7 +291,7 @@ private_chat_get_status_pixbuf (GossipChat *chat) contact = gossip_chat_get_contact (chat); - return gossip_pixbuf_for_contact (contact); + return gossip_icon_name_for_contact (contact); } static GossipContact * diff --git a/libempathy-gtk/gossip-profile-chooser.c b/libempathy-gtk/gossip-profile-chooser.c index 7accbefe..96c072c9 100644 --- a/libempathy-gtk/gossip-profile-chooser.c +++ b/libempathy-gtk/gossip-profile-chooser.c @@ -64,16 +64,16 @@ gossip_profile_chooser_new (void) /* set up combo box with new store */ store = gtk_list_store_new (COL_COUNT, - GDK_TYPE_PIXBUF, /* Icon */ - G_TYPE_STRING, /* Label */ - MC_TYPE_PROFILE); /* Profile */ + G_TYPE_STRING, /* Icon name */ + G_TYPE_STRING, /* Label */ + MC_TYPE_PROFILE); /* Profile */ combo_box = gtk_combo_box_new_with_model (GTK_TREE_MODEL (store)); renderer = gtk_cell_renderer_pixbuf_new (); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_box), renderer, FALSE); gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box), renderer, - "pixbuf", COL_ICON, + "icon-name", COL_ICON, NULL); renderer = gtk_cell_renderer_text_new (); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_box), renderer, TRUE); @@ -89,7 +89,7 @@ gossip_profile_chooser_new (void) gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, - COL_ICON, gossip_pixbuf_from_profile (profile, GTK_ICON_SIZE_BUTTON), + COL_ICON, mc_profile_get_icon_name (profile), COL_LABEL, mc_profile_get_display_name (profile), COL_PROFILE, profile, -1); diff --git a/libempathy-gtk/gossip-stock.c b/libempathy-gtk/gossip-stock.c deleted file mode 100644 index 1490e65e..00000000 --- a/libempathy-gtk/gossip-stock.c +++ /dev/null @@ -1,129 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Copyright (C) 2003-2007 Imendio AB - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Authors: Mikael Hallendal - * Richard Hult - * Martyn Russell - */ - -#include "config.h" - -#include - -#include - -#include "gossip-stock.h" - -static GtkIconFactory *icon_factory = NULL; -static GtkWidget *main_widget = NULL; - -static GtkStockItem stock_items[] = { - { GOSSIP_STOCK_OFFLINE, NULL }, - { GOSSIP_STOCK_AVAILABLE, NULL }, - { GOSSIP_STOCK_BUSY, NULL }, - { GOSSIP_STOCK_AWAY, NULL }, - { GOSSIP_STOCK_EXT_AWAY, NULL }, - { GOSSIP_STOCK_PENDING, NULL }, - { GOSSIP_STOCK_MESSAGE, NULL }, - { GOSSIP_STOCK_TYPING, NULL }, - { GOSSIP_STOCK_CONTACT_INFORMATION, NULL }, - { GOSSIP_STOCK_GROUP_MESSAGE, NULL } -}; - -void -gossip_stock_init (GtkWidget *widget) -{ - GtkIconSet *icon_set; - gint i; - - g_assert (icon_factory == NULL); - - main_widget = g_object_ref (widget); - - gtk_stock_add (stock_items, G_N_ELEMENTS (stock_items)); - - icon_factory = gtk_icon_factory_new (); - gtk_icon_factory_add_default (icon_factory); - g_object_unref (icon_factory); - - for (i = 0; i < G_N_ELEMENTS (stock_items); i++) { - gchar *path, *filename; - GdkPixbuf *pixbuf; - - filename = g_strdup_printf ("%s.png", stock_items[i].stock_id); - path = gossip_paths_get_image_path (filename); - pixbuf = gdk_pixbuf_new_from_file (path, NULL); - g_free (path); - g_free (filename); - - icon_set = gtk_icon_set_new_from_pixbuf (pixbuf); - - gtk_icon_factory_add (icon_factory, - stock_items[i].stock_id, - icon_set); - - gtk_icon_set_unref (icon_set); - - g_object_unref (pixbuf); - } -} - -void -gossip_stock_finalize (void) -{ - g_assert (icon_factory != NULL); - - gtk_icon_factory_remove_default (icon_factory); - g_object_unref (main_widget); - - main_widget = NULL; - icon_factory = NULL; -} - -GdkPixbuf * -gossip_stock_render (const gchar *stock, - GtkIconSize size) -{ - return gtk_widget_render_icon (main_widget, stock, size, NULL); -} - -const gchar * -gossip_stock_for_state (McPresence state) -{ - switch (state) { - case MC_PRESENCE_AVAILABLE: - return GOSSIP_STOCK_AVAILABLE; - case MC_PRESENCE_DO_NOT_DISTURB: - return GOSSIP_STOCK_BUSY; - case MC_PRESENCE_AWAY: - return GOSSIP_STOCK_AWAY; - case MC_PRESENCE_EXTENDED_AWAY: - return GOSSIP_STOCK_EXT_AWAY; - case MC_PRESENCE_HIDDEN: - case MC_PRESENCE_OFFLINE: - case MC_PRESENCE_UNSET: - return GOSSIP_STOCK_OFFLINE; - default: - g_assert_not_reached (); - } - - return NULL; -} - - diff --git a/libempathy-gtk/gossip-stock.h b/libempathy-gtk/gossip-stock.h deleted file mode 100644 index 8cf66eb6..00000000 --- a/libempathy-gtk/gossip-stock.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Copyright (C) 2003-2007 Imendio AB - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Authors: Mikael Hallendal - * Richard Hult - * Martyn Russell - */ - -#ifndef __GOSSIP_STOCK_H__ -#define __GOSSIP_STOCK_H__ - -#include -#include - -#include - -G_BEGIN_DECLS - -#define GOSSIP_STOCK_OFFLINE "gossip-offline" -#define GOSSIP_STOCK_AVAILABLE "gossip-available" -#define GOSSIP_STOCK_BUSY "gossip-busy" -#define GOSSIP_STOCK_AWAY "gossip-away" -#define GOSSIP_STOCK_EXT_AWAY "gossip-extended-away" -#define GOSSIP_STOCK_PENDING "gossip-pending" - -#define GOSSIP_STOCK_MESSAGE "gossip-message" -#define GOSSIP_STOCK_TYPING "gossip-typing" - - -#define GOSSIP_STOCK_CONTACT_INFORMATION "vcard_16" - -#define GOSSIP_STOCK_AIM "gossip-aim" -#define GOSSIP_STOCK_ICQ "gossip-icq" -#define GOSSIP_STOCK_MSN "gossip-msn" -#define GOSSIP_STOCK_YAHOO "gossip-yahoo" - -#define GOSSIP_STOCK_GROUP_MESSAGE "gossip-group-message" - -void gossip_stock_init (GtkWidget *widget); -void gossip_stock_finalize (void); -GdkPixbuf * gossip_stock_render (const gchar *stock, - GtkIconSize size); -const gchar * gossip_stock_for_state (McPresence state); - -G_END_DECLS - -#endif /* __GOSSIP_STOCK_ICONS_H__ */ diff --git a/libempathy-gtk/gossip-ui-utils.c b/libempathy-gtk/gossip-ui-utils.c index b6dfb8f9..9bf2fb36 100644 --- a/libempathy-gtk/gossip-ui-utils.c +++ b/libempathy-gtk/gossip-ui-utils.c @@ -41,7 +41,9 @@ #include #include "gossip-ui-utils.h" -#include "gossip-stock.h" +#include "empathy-images.h" + +#define DEBUG_DOMAIN "UiUtils" struct SizeData { gint width; @@ -200,24 +202,34 @@ gossip_glade_setup_size_group (GladeXML *gui, } GdkPixbuf * -gossip_pixbuf_from_smiley (GossipSmiley type, - GtkIconSize icon_size) +gossip_pixbuf_from_icon_name (const gchar *icon_name, + GtkIconSize icon_size) { GtkIconTheme *theme; GdkPixbuf *pixbuf = NULL; GError *error = NULL; - gint w, h; - gint size; - const gchar *icon_id; theme = gtk_icon_theme_get_default (); - if (!gtk_icon_size_lookup (icon_size, &w, &h)) { - size = 16; - } else { - size = (w + h) / 2; + pixbuf = gtk_icon_theme_load_icon (theme, + icon_name, + icon_size, + 0, + &error); + if (error) { + gossip_debug (DEBUG_DOMAIN, "Error loading icon: %s", error->message); + g_clear_error (&error); } + return pixbuf; +} + +GdkPixbuf * +gossip_pixbuf_from_smiley (GossipSmiley type, + GtkIconSize icon_size) +{ + const gchar *icon_id; + switch (type) { case GOSSIP_SMILEY_NORMAL: /* :) */ icon_id = "stock_smiley-1"; @@ -306,106 +318,79 @@ gossip_pixbuf_from_smiley (GossipSmiley type, icon_id = NULL; } - pixbuf = gtk_icon_theme_load_icon (theme, - icon_id, /* icon name */ - size, /* size */ - 0, /* flags */ - &error); - return pixbuf; + return gossip_pixbuf_from_icon_name (icon_id, icon_size); } -GdkPixbuf * -gossip_pixbuf_from_profile (McProfile *profile, - GtkIconSize icon_size) -{ - GtkIconTheme *theme; - gint size = 48; - gint w, h; - const gchar *icon_id = NULL; - GError *error = NULL; - - theme = gtk_icon_theme_get_default (); - - if (gtk_icon_size_lookup (icon_size, &w, &h)) { - size = (w + h) / 2; - } - - icon_id = mc_profile_get_icon_name (profile); - - theme = gtk_icon_theme_get_default (); - return gtk_icon_theme_load_icon (theme, - icon_id, /* Icon name */ - size, /* Size */ - 0, /* Flags */ - &error); -} - -GdkPixbuf * -gossip_pixbuf_from_account (McAccount *account, - GtkIconSize icon_size) +const gchar * +gossip_icon_name_from_account (McAccount *account) { McProfile *profile; profile = mc_account_get_profile (account); - return gossip_pixbuf_from_profile (profile, icon_size); + return mc_profile_get_icon_name (profile); } -GdkPixbuf * -gossip_pixbuf_for_presence_state (McPresence state) +const gchar * +gossip_icon_name_for_presence_state (McPresence state) { - const gchar *stock; - - stock = gossip_stock_for_state (state); + switch (state) { + case MC_PRESENCE_AVAILABLE: + return EMPATHY_IMAGE_AVAILABLE; + case MC_PRESENCE_DO_NOT_DISTURB: + return EMPATHY_IMAGE_BUSY; + case MC_PRESENCE_AWAY: + return EMPATHY_IMAGE_AWAY; + case MC_PRESENCE_EXTENDED_AWAY: + return EMPATHY_IMAGE_EXT_AWAY; + case MC_PRESENCE_HIDDEN: + case MC_PRESENCE_OFFLINE: + case MC_PRESENCE_UNSET: + return EMPATHY_IMAGE_OFFLINE; + default: + g_assert_not_reached (); + } - return gossip_stock_render (stock, GTK_ICON_SIZE_MENU); + return NULL; } -GdkPixbuf * -gossip_pixbuf_for_presence (GossipPresence *presence) +const gchar * +gossip_icon_name_for_presence (GossipPresence *presence) { McPresence state; g_return_val_if_fail (GOSSIP_IS_PRESENCE (presence), - gossip_pixbuf_offline ()); + EMPATHY_IMAGE_OFFLINE); state = gossip_presence_get_state (presence); - return gossip_pixbuf_for_presence_state (state); + return gossip_icon_name_for_presence_state (state); } -GdkPixbuf * -gossip_pixbuf_for_contact (GossipContact *contact) +const gchar * +gossip_icon_name_for_contact (GossipContact *contact) { GossipPresence *presence; GossipSubscription subscription; g_return_val_if_fail (GOSSIP_IS_CONTACT (contact), - gossip_pixbuf_offline ()); + EMPATHY_IMAGE_OFFLINE); presence = gossip_contact_get_presence (contact); if (presence) { - return gossip_pixbuf_for_presence (presence); + return gossip_icon_name_for_presence (presence); } subscription = gossip_contact_get_subscription (contact); if (subscription != GOSSIP_SUBSCRIPTION_BOTH && subscription != GOSSIP_SUBSCRIPTION_TO) { - return gossip_stock_render (GOSSIP_STOCK_PENDING, - GTK_ICON_SIZE_MENU); + return EMPATHY_IMAGE_PENDING; } - return gossip_pixbuf_offline (); -} - -GdkPixbuf * -gossip_pixbuf_offline (void) -{ - return gossip_stock_render (GOSSIP_STOCK_OFFLINE, - GTK_ICON_SIZE_MENU); + return EMPATHY_IMAGE_OFFLINE; } GdkPixbuf * diff --git a/libempathy-gtk/gossip-ui-utils.h b/libempathy-gtk/gossip-ui-utils.h index 1e1bb1ee..d1625cfe 100644 --- a/libempathy-gtk/gossip-ui-utils.h +++ b/libempathy-gtk/gossip-ui-utils.h @@ -67,16 +67,14 @@ void gossip_glade_setup_size_group (GladeXML *g gchar *first_widget, ...); /* Pixbufs */ -GdkPixbuf * gossip_pixbuf_from_smiley (GossipSmiley type, - GtkIconSize icon_size); -GdkPixbuf * gossip_pixbuf_from_profile (McProfile *account, +GdkPixbuf * gossip_pixbuf_from_icon_name (const gchar *icon_name, GtkIconSize icon_size); -GdkPixbuf * gossip_pixbuf_from_account (McAccount *account, +GdkPixbuf * gossip_pixbuf_from_smiley (GossipSmiley type, GtkIconSize icon_size); -GdkPixbuf * gossip_pixbuf_for_presence_state (McPresence state); -GdkPixbuf * gossip_pixbuf_for_presence (GossipPresence *presence); -GdkPixbuf * gossip_pixbuf_for_contact (GossipContact *contact); -GdkPixbuf * gossip_pixbuf_offline (void); +const gchar * gossip_icon_name_from_account (McAccount *account); +const gchar * gossip_icon_name_for_presence_state (McPresence state); +const gchar * gossip_icon_name_for_presence (GossipPresence *presence); +const gchar * gossip_icon_name_for_contact (GossipContact *contact); GdkPixbuf * gossip_pixbuf_from_avatar_scaled (GossipAvatar *avatar, gint width, gint height); diff --git a/pixmaps/Makefile.am b/pixmaps/Makefile.am deleted file mode 100644 index 6143ddc2..00000000 --- a/pixmaps/Makefile.am +++ /dev/null @@ -1,32 +0,0 @@ -imagedir = $(datadir)/empathy - -image_DATA = \ - gossip-offline.png \ - gossip-available.png \ - gossip-busy.png \ - gossip-away.png \ - gossip-extended-away.png \ - gossip-pending.png \ - gossip-message.png \ - gossip-typing.png \ - gossip-group-message.png \ - vcard_16.png \ - vcard_48.png - -gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor - -install-data-hook: update-icon-cache -uninstall-hook: update-icon-cache -update-icon-cache: - @-if test -z "$(DESTDIR)"; then \ - echo "Updating Gtk icon cache."; \ - $(gtk_update_icon_cache); \ - else \ - echo "*** Icon cache not updated. After (un)install, run this:"; \ - echo "*** $(gtk_update_icon_cache)"; \ - fi - -EXTRA_DIST = \ - $(image_DATA) - - diff --git a/pixmaps/gossip-available.png b/pixmaps/gossip-available.png deleted file mode 100644 index c2d074f5..00000000 Binary files a/pixmaps/gossip-available.png and /dev/null differ diff --git a/pixmaps/gossip-away.png b/pixmaps/gossip-away.png deleted file mode 100644 index ba9ed232..00000000 Binary files a/pixmaps/gossip-away.png and /dev/null differ diff --git a/pixmaps/gossip-busy.png b/pixmaps/gossip-busy.png deleted file mode 100644 index 190c5ae7..00000000 Binary files a/pixmaps/gossip-busy.png and /dev/null differ diff --git a/pixmaps/gossip-extended-away.png b/pixmaps/gossip-extended-away.png deleted file mode 100644 index 59dbe08f..00000000 Binary files a/pixmaps/gossip-extended-away.png and /dev/null differ diff --git a/pixmaps/gossip-group-message.png b/pixmaps/gossip-group-message.png deleted file mode 100644 index ed2d33b9..00000000 Binary files a/pixmaps/gossip-group-message.png and /dev/null differ diff --git a/pixmaps/gossip-message.png b/pixmaps/gossip-message.png deleted file mode 100644 index 84c3ceff..00000000 Binary files a/pixmaps/gossip-message.png and /dev/null differ diff --git a/pixmaps/gossip-offline.png b/pixmaps/gossip-offline.png deleted file mode 100644 index 528eae40..00000000 Binary files a/pixmaps/gossip-offline.png and /dev/null differ diff --git a/pixmaps/gossip-pending.png b/pixmaps/gossip-pending.png deleted file mode 100644 index f48de812..00000000 Binary files a/pixmaps/gossip-pending.png and /dev/null differ diff --git a/pixmaps/gossip-typing.png b/pixmaps/gossip-typing.png deleted file mode 100644 index defad7b0..00000000 Binary files a/pixmaps/gossip-typing.png and /dev/null differ diff --git a/pixmaps/vcard_16.png b/pixmaps/vcard_16.png deleted file mode 100644 index 0dfdb778..00000000 Binary files a/pixmaps/vcard_16.png and /dev/null differ diff --git a/pixmaps/vcard_48.png b/pixmaps/vcard_48.png deleted file mode 100644 index 776006cd..00000000 Binary files a/pixmaps/vcard_48.png and /dev/null differ diff --git a/profiles/Makefile.am b/profiles/Makefile.am deleted file mode 100644 index 53702835..00000000 --- a/profiles/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -profiledir = $(datadir)/mission-control/profiles - -profile_DATA = \ - jabber.profile \ - gtalk.profile \ - salut.profile \ - msn.profile - -EXTRA_DIST = $(profile_DATA) diff --git a/profiles/gtalk.profile b/profiles/gtalk.profile deleted file mode 100644 index c70bfa84..00000000 --- a/profiles/gtalk.profile +++ /dev/null @@ -1,14 +0,0 @@ -[Profile] -Manager=gabble -Protocol=jabber -DisplayName=Google Talk -IconName = im-jabber -ConfigurationUI = jabber -DefaultAccountDomain = gmail.com, googlemail.com -Default-server = talk.google.com -Default-port = 5223 -Default-old-ssl = 1 -Default-fallback-conference-server = conference.jabber.org -Default-randomize-resource = 1 -Default-ignore-ssl-errors = 1 -SupportsInvisible = 0 diff --git a/profiles/jabber.profile b/profiles/jabber.profile deleted file mode 100644 index 811132cd..00000000 --- a/profiles/jabber.profile +++ /dev/null @@ -1,8 +0,0 @@ -[Profile] -Manager=gabble -Protocol=jabber -DisplayName=Jabber -IconName = im-jabber -ConfigurationUI = jabber -DefaultAccountDomain = jabber.org -SupportsInvisible = 0 diff --git a/profiles/msn.profile b/profiles/msn.profile deleted file mode 100644 index 599204c1..00000000 --- a/profiles/msn.profile +++ /dev/null @@ -1,7 +0,0 @@ -[Profile] -Manager=butterfly -Protocol=msn -DisplayName=MSN -IconName = im-msn -ConfigurationUI = msn -SupportsInvisible = 1 diff --git a/profiles/salut.profile b/profiles/salut.profile deleted file mode 100644 index 22c9c186..00000000 --- a/profiles/salut.profile +++ /dev/null @@ -1,7 +0,0 @@ -[Profile] -Manager=salut -Protocol=salut -DisplayName=Salut -IconName = im-jabber -ConfigurationUI = salut - diff --git a/src/empathy-chat-main.c b/src/empathy-chat-main.c index 7fde26ae..91dd510b 100644 --- a/src/empathy-chat-main.c +++ b/src/empathy-chat-main.c @@ -37,7 +37,6 @@ #include #include #include -#include #define BUS_NAME "org.gnome.Empathy.Chat" #define OBJECT_PATH "/org/freedesktop/Telepathy/ChannelHandler" @@ -80,8 +79,6 @@ main (int argc, char *argv[]) EmpathyChandler *chandler; gtk_init (&argc, &argv); - /* FIXME: This is a horrible hack */ - gossip_stock_init (gtk_window_new (GTK_WINDOW_TOPLEVEL)); chandler = empathy_chandler_new (BUS_NAME, OBJECT_PATH); diff --git a/src/empathy-contact-list-main.c b/src/empathy-contact-list-main.c index 084649ba..8ea131c2 100644 --- a/src/empathy-contact-list-main.c +++ b/src/empathy-contact-list-main.c @@ -30,14 +30,12 @@ #include #include -#include #include static void destroy_cb (GtkWidget *window, gpointer user_data) { - gossip_stock_finalize (); gtk_main_quit (); } @@ -49,9 +47,6 @@ main (int argc, char *argv[]) gtk_init (&argc, &argv); - /* FIXME: This is a horrible hack */ - gossip_stock_init (gtk_window_new (GTK_WINDOW_TOPLEVEL)); - window = empathy_main_window_show (); g_signal_connect (window, "destroy", G_CALLBACK (destroy_cb), diff --git a/src/empathy-main.c b/src/empathy-main.c index 2aea589f..fb5684aa 100644 --- a/src/empathy-main.c +++ b/src/empathy-main.c @@ -35,8 +35,8 @@ #include #include +#include #include -#include #include #define DEBUG_DOMAIN "Empathy" @@ -104,7 +104,6 @@ static void destroy_cb (GtkWidget *window, gpointer user_data) { - gossip_stock_finalize (); gtk_main_quit (); } @@ -130,9 +129,6 @@ main (int argc, char *argv[]) gtk_init (&argc, &argv); - /* FIXME: This is a horrible hack */ - gossip_stock_init (gtk_window_new (GTK_WINDOW_TOPLEVEL)); - /* Setting up MC */ monitor = mc_account_monitor_new (); mc = mission_control_new (tp_get_bus ()); @@ -154,7 +150,7 @@ main (int argc, char *argv[]) NULL); /* Setting up the tray icon */ - icon = gtk_status_icon_new_from_stock (GOSSIP_STOCK_MESSAGE); + icon = gtk_status_icon_new_from_icon_name (EMPATHY_IMAGE_MESSAGE); gtk_status_icon_set_tooltip (icon, "Empathy - click here to show/hide the main window"); gtk_status_icon_set_visible (icon, TRUE); g_signal_connect (icon, "activate",