[anjal] Move away from e-icon stuff and use standard gtk. Now compiles against
- From: Srinivasa Ragavan <sragavan src gnome org>
- To: svn-commits-list gnome org
- Subject: [anjal] Move away from e-icon stuff and use standard gtk. Now compiles against
- Date: Thu, 4 Jun 2009 00:07:43 -0400 (EDT)
commit b99e69a7943f64421170d0b05b792806f6f4dcb1
Author: Srinivasa Ragavan <sragavan novell com>
Date: Wed Jun 3 19:41:26 2009 +0530
Move away from e-icon stuff and use standard gtk. Now compiles against
Evo/trunk.
---
src/Makefile.am | 4 +++-
src/em-format-webkit-display.c | 4 +++-
src/em-format-webkit.c | 4 ++--
src/mail-account-view.c | 8 ++++----
src/mail-composer-view.c | 4 ++--
src/mail-conv-view.c | 4 ++--
src/mail-folder-view.c | 20 ++++++++++++--------
src/mail-message-view.c | 9 +++++----
src/mail-search.c | 2 +-
src/mail-settings-view.c | 4 ++--
src/mail-view.c | 1 -
src/main.c | 3 ---
12 files changed, 36 insertions(+), 31 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index cd5e3c0..3272527 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -59,7 +59,9 @@ anjal_SOURCES = \
mail-search.c \
mail-search.h \
mail-decoration.c \
- mail-decoration.h
+ mail-decoration.h \
+ mail-utils.c \
+ mail-utils.h
if ENABLE_WEBKIT
anjal_SOURCES += em-webkit-stream.c \
diff --git a/src/em-format-webkit-display.c b/src/em-format-webkit-display.c
index f0ab5de..2172084 100644
--- a/src/em-format-webkit-display.c
+++ b/src/em-format-webkit-display.c
@@ -84,6 +84,7 @@
#include <misc/e-attachment.h>
#include <misc/e-icon-entry.h>
#include "mail-message-view.h"
+#include "mail-utils.h"
#ifdef G_OS_WIN32
/* Undefine the similar macro from <pthread.h>,it doesn't check if
@@ -1389,7 +1390,8 @@ static void efwd_message_prefix(EMFormat *emf, CamelStream *stream, CamelMimePar
camel_stream_printf(stream, "<table border=1 width=\"100%%\" cellspacing=2 cellpadding=2><tr>");
comp = camel_folder_get_message_user_tag(emf->folder, emf->uid, "completed-on");
- iconpath = e_icon_factory_get_icon_filename (comp && comp[0] ? "stock_flag-for-followup-done" : "stock_flag-for-followup", E_ICON_SIZE_MENU);
+
+ iconpath = mail_utils_get_icon_path (comp && comp[0] ? "stock_flag-for-followup-done" : "stock_flag-for-followup", GTK_ICON_SIZE_MENU);
if (iconpath) {
CamelMimePart *iconpart;
diff --git a/src/em-format-webkit.c b/src/em-format-webkit.c
index 2f21c31..56dd2ab 100644
--- a/src/em-format-webkit.c
+++ b/src/em-format-webkit.c
@@ -43,7 +43,6 @@
#include <libedataserver/e-data-server-util.h> /* for e_utf8_strftime, what about e_time_format_time? */
#include <libedataserver/e-time-utils.h>
-#include "e-util/e-icon-factory.h"
#include "e-util/e-util.h"
#include <glib/gi18n.h>
@@ -86,6 +85,7 @@
#include "mail/em-utils.h"
#include "mail-message-view.h"
+#include "mail-utils.h"
#define d(x)
@@ -464,7 +464,7 @@ efw_format_secure(EMFormat *emf, CamelStream *stream, CamelMimePart *part, Camel
icon = smime_sign_table[valid->sign.status].icon;
else
icon = smime_encrypt_table[valid->encrypt.status].icon;
- iconpath = e_icon_factory_get_icon_filename(icon, E_ICON_SIZE_DIALOG);
+ iconpath = mail_utils_get_icon_path (icon, GTK_ICON_SIZE_DIALOG);
iconpart = em_format_webkit_file_part((EMFormatWebKit *)emf, "image/png", iconpath);
if (iconpart) {
(void)em_format_add_puri(emf, sizeof(EMFormatPURI), classid, iconpart, efw_write_image);
diff --git a/src/mail-account-view.c b/src/mail-account-view.c
index f7f9a6c..aaf6d31 100644
--- a/src/mail-account-view.c
+++ b/src/mail-account-view.c
@@ -29,7 +29,6 @@
#include <libedataserver/e-account-list.h>
#include "mail-component.h"
#include "mail-view.h"
-#include "e-util/e-icon-factory.h"
#include "e-util/e-config.h"
#include "mail/mail-config.h"
@@ -502,7 +501,7 @@ mav_construct_page(MailAccountView *view, MAVPageType type)
if (mail_account_pages[type].prev) {
box = gtk_hbox_new(FALSE, 0);
- tmp = gtk_image_new_from_pixbuf (e_icon_factory_get_icon("go-previous", E_ICON_SIZE_BUTTON));
+ tmp = gtk_image_new_from_icon_name ("go-previous", GTK_ICON_SIZE_BUTTON);
gtk_box_pack_start((GtkBox *)box, tmp, FALSE, FALSE, 0);
tmp = gtk_label_new (mail_account_pages[type].prev);
gtk_box_pack_start((GtkBox *)box, tmp, FALSE, FALSE, 3);
@@ -516,7 +515,7 @@ mav_construct_page(MailAccountView *view, MAVPageType type)
box = gtk_hbox_new(FALSE, 0);
tmp = gtk_label_new (mail_account_pages[type].next);
gtk_box_pack_start((GtkBox *)box, tmp, FALSE, FALSE, 3);
- tmp = gtk_image_new_from_pixbuf (e_icon_factory_get_icon("go-next", E_ICON_SIZE_BUTTON));
+ tmp = gtk_image_new_from_icon_name ("go-next", GTK_ICON_SIZE_BUTTON);
gtk_box_pack_start((GtkBox *)box, tmp, FALSE, FALSE, 0);
page->next = gtk_button_new ();
gtk_container_add ((GtkContainer *)page->next, box);
@@ -601,7 +600,8 @@ mav_close (GtkButton *w, MailAccountView *mfv)
GtkWidget *
mail_account_view_get_tab_widget(MailAccountView *mcv)
{
- GdkPixbuf *pbuf = e_icon_factory_get_icon ("gtk-close", E_ICON_SIZE_MENU);
+ GdkPixbuf *pbuf = gtk_widget_render_icon ((GtkWidget *)mcv, "gtk-close", GTK_ICON_SIZE_MENU, NULL);
+
GtkWidget *tool, *box, *img;
int w=-1, h=-1;
GtkWidget *tab_label;
diff --git a/src/mail-composer-view.c b/src/mail-composer-view.c
index 7e03298..e9afb1b 100644
--- a/src/mail-composer-view.c
+++ b/src/mail-composer-view.c
@@ -25,7 +25,6 @@
#endif
#include <glib/gi18n.h>
-#include <e-util/e-icon-factory.h>
#include "mail-view.h"
#include "mail-composer-view.h"
@@ -122,7 +121,8 @@ mail_composer_view_construct (MailComposerView *shell, struct _EMsgComposer *new
/*Tab Label*/
close_button = gtk_button_new ();
- icon = e_icon_factory_get_icon ("gtk-close", E_ICON_SIZE_MENU);
+ icon = gtk_widget_render_icon ((GtkWidget *)shell, "gtk-close", GTK_ICON_SIZE_MENU, NULL);
+
img = gtk_image_new_from_pixbuf (icon);
gtk_button_set_image ((GtkButton *)close_button, img);
gtk_widget_show_all (close_button);
diff --git a/src/mail-conv-view.c b/src/mail-conv-view.c
index f265ccc..55d9bbd 100644
--- a/src/mail-conv-view.c
+++ b/src/mail-conv-view.c
@@ -25,7 +25,6 @@
#endif
#include <glib/gi18n.h>
#include "mail-conv-view.h"
-#include "e-util/e-icon-factory.h"
#include <gdk/gdkkeysyms.h>
@@ -476,7 +475,8 @@ mcv_close (GtkButton *w, MailConvView *mfv)
GtkWidget *
mail_conv_view_get_tab_widget(MailConvView *mcv)
{
- GdkPixbuf *pbuf = e_icon_factory_get_icon ("gtk-close", E_ICON_SIZE_MENU);
+ GdkPixbuf *pbuf = gtk_widget_render_icon ((GtkWidget *)mcv, "gtk-close", GTK_ICON_SIZE_MENU, NULL);
+
GtkWidget *tool, *box, *img;
int w=-1, h=-1;
GtkWidget *tab_label;
diff --git a/src/mail-folder-view.c b/src/mail-folder-view.c
index 9f5be4e..54a560a 100644
--- a/src/mail-folder-view.c
+++ b/src/mail-folder-view.c
@@ -41,8 +41,8 @@
#include "custom-cell-renderer-hbox.h"
#include "custom-cell-renderer-vbox.h"
#include "custom-cell-renderer-toggle-pixbuf.h"
-#include <e-util/e-icon-factory.h>
#include <e-util/e-util.h>
+#include "mail-utils.h"
#include <gdk/gdkkeysyms.h>
@@ -79,7 +79,6 @@ static void mfv_message_activated (GtkTreeView *tree_view, GtkTreePath
static void mfv_delete (MailFolderView *mfv, gboolean del);
static void mfv_read (MailFolderView *mfv, gboolean del);
static void mfv_junk (MailFolderView *mfv, gboolean junk);
-
static guint signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (MailFolderView, mail_folder_view, GTK_TYPE_VBOX)
@@ -194,7 +193,7 @@ mfv_close (GtkButton *w, MailFolderView *mfv)
static void
mail_folder_view_init (MailFolderView *shell)
{
- GdkPixbuf *pbuf = e_icon_factory_get_icon ("gtk-close", E_ICON_SIZE_MENU);
+ GdkPixbuf *pbuf = gtk_widget_render_icon ((GtkWidget *)shell, "gtk-close", GTK_ICON_SIZE_MENU, NULL);
GtkWidget *tool, *box, *img;
int w=-1, h=-1;
@@ -557,7 +556,8 @@ draw_img (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *t
{
CustomCellRendererVBox *cellprogress = CUSTOM_CELL_RENDERER_VBOX (cell);
GList *tmp = cellprogress->children;
-
+ GtkWidget *wid = g_object_get_data ((GObject *)tree_column, "widget");
+
while (tmp) {
GtkCellRenderer *child = (GtkCellRenderer *)tmp->data;
char *data = g_object_get_data ((GObject *)child, "data");
@@ -568,7 +568,7 @@ draw_img (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *t
continue;
}
if (data) {
- img = e_icon_factory_get_icon (data, E_ICON_SIZE_MENU);
+ img = gtk_widget_render_icon (wid, data, GTK_ICON_SIZE_MENU, NULL);
g_object_set ((GObject *)child, "pixbuf", img, NULL);
} else {
g_object_set ((GObject *)child, "pixbuf", gdk_pixbuf_new_from_xpm_data ((const char **) empty_xpm), NULL);
@@ -1427,14 +1427,17 @@ mail_folder_view_construct (MailFolderView *shell)
g_object_set_data ((GObject *)vbox, "mfv", shell);
g_object_set ((GObject *)vbox, "mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE, NULL);
gtk_tree_view_column_pack_end (column, vbox, FALSE);
+ g_object_set_data ((GObject * )column, "widget", shell);
gtk_tree_view_column_set_cell_data_func (column, vbox, (GtkTreeCellDataFunc)draw_img, NULL, NULL);
/* Cell rendere for Delete */
- cell = custom_cell_renderer_toggle_pixbuf_new (e_icon_factory_get_icon ("stock_delete", E_ICON_SIZE_MENU), e_icon_factory_get_icon ("stock_delete", E_ICON_SIZE_MENU));
+ cell = custom_cell_renderer_toggle_pixbuf_new (gtk_widget_render_icon ((GtkWidget *)shell, "gtk-delete", GTK_ICON_SIZE_MENU, NULL), gtk_widget_render_icon ((GtkWidget *)shell, "gtk-delete", GTK_ICON_SIZE_MENU, NULL));
g_object_set_data ((GObject *)cell, "mfv", shell);
custom_cell_renderer_vbox_append (vbox, cell);
- g_object_set_data ((GObject *)cell, "data", "stock_delete");
+ g_object_set_data ((GObject *)cell, "data", "gtk-delete");
+ g_object_set_data ((GObject *)cell, "data", "gtk-delete");
+
g_object_set_data ((GObject *)cell, "sel-highlight", GINT_TO_POINTER(1));
g_object_set_data ((GObject *)cell, "activate_func", mfv_msg_delete);
@@ -1448,7 +1451,7 @@ mail_folder_view_construct (MailFolderView *shell)
}
/* Cell rendere for Junk */
- cell = custom_cell_renderer_toggle_pixbuf_new (e_icon_factory_get_icon ("mail-mark-junk", E_ICON_SIZE_MENU), e_icon_factory_get_icon ("mail-mark-junk", E_ICON_SIZE_MENU));
+ cell = custom_cell_renderer_toggle_pixbuf_new (mail_utils_get_icon ("mail-mark-junk", GTK_ICON_SIZE_MENU), mail_utils_get_icon ("mail-mark-junk", GTK_ICON_SIZE_MENU));
g_object_set_data ((GObject *)cell, "mfv", shell);
custom_cell_renderer_vbox_append (vbox, cell);
g_object_set_data ((GObject *)cell, "sel-highlight", GINT_TO_POINTER(1));
@@ -1619,3 +1622,4 @@ mail_folder_view_set_folder_pane (MailFolderView *mfv, GtkWidget *pane)
{
mfv->priv->folder_pane = pane;
}
+
diff --git a/src/mail-message-view.c b/src/mail-message-view.c
index f8841ae..d2c6bf4 100644
--- a/src/mail-message-view.c
+++ b/src/mail-message-view.c
@@ -39,12 +39,12 @@
#include "mail/mail-ops.h"
#include "misc/e-spinner.h"
#include <gdk/gdkkeysyms.h>
-#include "e-util/e-icon-factory.h"
#include "mail/em-composer-utils.h"
#include "mail-shell.h"
#include <math.h>
#include <e-util/e-util.h>
#include <composer/e-composer-header-table.h>
+#include "mail-utils.h"
extern char *scolor_norm;
extern char *scolor_sel;
@@ -1206,7 +1206,7 @@ mail_message_view_set_message (MailMessageView *mmview, CamelFolder *folder, con
g_object_set (tmp, "focus-on-click", FALSE, NULL);
g_signal_connect (tmp, "clicked", G_CALLBACK(delete_clicked), mmview);
gtk_button_set_relief((GtkButton *)tmp, GTK_RELIEF_NONE);
- img = e_icon_factory_get_icon ("stock_delete", E_ICON_SIZE_BUTTON);
+ img = mail_utils_get_icon ("stock_delete", GTK_ICON_SIZE_BUTTON);
gtk_button_set_label ((GtkButton *)tmp, _("Delete"));
gtk_button_set_image ((GtkButton *)tmp, gtk_image_new_from_pixbuf(img));
gtk_box_pack_start ((GtkBox *)vbox, tmp, FALSE, FALSE, 0);
@@ -1214,7 +1214,8 @@ mail_message_view_set_message (MailMessageView *mmview, CamelFolder *folder, con
g_object_set (tmp, "focus-on-click", FALSE, NULL);
g_signal_connect (tmp, "clicked", G_CALLBACK(junk_clicked), mmview);
gtk_button_set_relief((GtkButton *)tmp, GTK_RELIEF_NONE);
- img = e_icon_factory_get_icon ("mail-mark-junk", E_ICON_SIZE_BUTTON);
+ img = mail_utils_get_icon ("mail-mark-junk", GTK_ICON_SIZE_BUTTON);
+
gtk_button_set_label ((GtkButton *)tmp, _("Junk"));
gtk_button_set_image ((GtkButton *)tmp, gtk_image_new_from_pixbuf(img));
gtk_box_pack_start ((GtkBox *)vbox, tmp, FALSE, FALSE, 0);
@@ -1275,7 +1276,7 @@ mail_message_view_set_message (MailMessageView *mmview, CamelFolder *folder, con
gtk_box_pack_end ((GtkBox *)mmview->footer, mmview->discard, FALSE, FALSE, 12);
box = gtk_hbox_new (FALSE, 0);
- img = e_icon_factory_get_icon ("tab-new", E_ICON_SIZE_BUTTON);
+ img = mail_utils_get_icon ("tab-new", GTK_ICON_SIZE_BUTTON);
tmp = gtk_image_new_from_pixbuf (img);
gtk_box_pack_start((GtkBox *)box, tmp, FALSE, FALSE, 0);
mmview->pop_out = gtk_button_new ();
diff --git a/src/mail-search.c b/src/mail-search.c
index 809d180..054ec99 100644
--- a/src/mail-search.c
+++ b/src/mail-search.c
@@ -186,8 +186,8 @@ mail_search_set_state (MailSearch *search, const char *word, const char *state)
return;
g_signal_handlers_block_by_func (search->priv->bar, mail_search_activate, search);
- g_object_set(search->priv->bar, "state", state, NULL);
e_search_bar_set_text ((ESearchBar *)search->priv->bar, (word && *word) ? word : "");
+ g_object_set(search->priv->bar, "state", state, NULL);
g_signal_handlers_unblock_by_func (search->priv->bar, mail_search_activate, search);
}
diff --git a/src/mail-settings-view.c b/src/mail-settings-view.c
index 04d1bc5..c33f78b 100644
--- a/src/mail-settings-view.c
+++ b/src/mail-settings-view.c
@@ -29,7 +29,6 @@
#include "mail-component.h"
#include <libedataserver/e-account-list.h>
#include "mail-view.h"
-#include "e-util/e-icon-factory.h"
#include "mail/mail-config.h"
struct _MailSettingsViewPrivate {
@@ -164,7 +163,8 @@ msv_close (GtkButton *w, MailSettingsView *mfv)
GtkWidget *
mail_settings_view_get_tab_widget(MailSettingsView *mcv)
{
- GdkPixbuf *pbuf = e_icon_factory_get_icon ("gtk-close", E_ICON_SIZE_MENU);
+ GdkPixbuf *pbuf = gtk_widget_render_icon ((GtkWidget *)mcv, "gtk-close", GTK_ICON_SIZE_MENU, NULL);
+
GtkWidget *tool, *box, *img;
int w=-1, h=-1;
GtkWidget *tab_label;
diff --git a/src/mail-view.c b/src/mail-view.c
index f966efd..e4f3fa7 100644
--- a/src/mail-view.c
+++ b/src/mail-view.c
@@ -33,7 +33,6 @@
#include "mail-account-view.h"
#include "mail-search.h"
#include "mail/em-folder-tree.h"
-#include <e-util/e-icon-factory.h>
struct _MailViewPrivate {
diff --git a/src/main.c b/src/main.c
index 70f2f10..f2be642 100644
--- a/src/main.c
+++ b/src/main.c
@@ -32,7 +32,6 @@
#include <glade/glade.h>
#include <glib/gi18n.h>
#include <misc/e-cursors.h>
-#include <e-util/e-icon-factory.h>
#include <libedataserverui/e-passwords.h>
#include <mail/mail-mt.h>
#include "mail-shell.h"
@@ -103,7 +102,6 @@ main (int argc, char *argv[])
}
glade_init ();
e_cursors_init ();
- e_icon_factory_init ();
e_passwords_init();
if (!g_thread_supported ())
g_thread_init (NULL);
@@ -117,7 +115,6 @@ main (int argc, char *argv[])
gtk_main ();
- e_icon_factory_shutdown ();
gnome_sound_shutdown ();
e_cursors_shutdown ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]