pidgin/gtkconv.c

changeset 41096
8883d8d17678
parent 41093
13d97dcd0e67
child 41097
e0b11d28b39e
equal deleted inserted replaced
41095:c2471cdf5a4e 41096:8883d8d17678
131 131
132 static GtkWidget *invite_dialog = NULL; 132 static GtkWidget *invite_dialog = NULL;
133 static GtkWidget *warn_close_dialog = NULL; 133 static GtkWidget *warn_close_dialog = NULL;
134 134
135 static GList *window_list = NULL; 135 static GList *window_list = NULL;
136
137 /* Lists of status icons at all available sizes for use as window icons */
138 static GList *available_list = NULL;
139 static GList *away_list = NULL;
140 static GList *busy_list = NULL;
141 static GList *xa_list = NULL;
142 static GList *offline_list = NULL;
143 static GHashTable *protocol_lists = NULL;
144 136
145 static gboolean update_send_to_selection(PidginConvWindow *win); 137 static gboolean update_send_to_selection(PidginConvWindow *win);
146 static void generate_send_to_items(PidginConvWindow *win); 138 static void generate_send_to_items(PidginConvWindow *win);
147 139
148 /* Prototypes. <-- because Paco-Paco hates this comment. */ 140 /* Prototypes. <-- because Paco-Paco hates this comment. */
5012 pidgin_conv_windows_get_list() 5004 pidgin_conv_windows_get_list()
5013 { 5005 {
5014 return window_list; 5006 return window_list;
5015 } 5007 }
5016 5008
5017 static GList*
5018 make_status_icon_list(const char *stock, GtkWidget *w)
5019 {
5020 GList *l = NULL;
5021 l = g_list_append(l,
5022 gtk_widget_render_icon(w, stock,
5023 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL), "GtkWindow"));
5024 l = g_list_append(l,
5025 gtk_widget_render_icon(w, stock,
5026 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_SMALL), "GtkWindow"));
5027 l = g_list_append(l,
5028 gtk_widget_render_icon(w, stock,
5029 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_MEDIUM), "GtkWindow"));
5030 l = g_list_append(l,
5031 gtk_widget_render_icon(w, stock,
5032 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_LARGE), "GtkWindow"));
5033 return l;
5034 }
5035
5036 static void
5037 create_icon_lists(GtkWidget *w)
5038 {
5039 available_list = make_status_icon_list(PIDGIN_STOCK_STATUS_AVAILABLE, w);
5040 busy_list = make_status_icon_list(PIDGIN_STOCK_STATUS_BUSY, w);
5041 xa_list = make_status_icon_list(PIDGIN_STOCK_STATUS_XA, w);
5042 offline_list = make_status_icon_list(PIDGIN_STOCK_STATUS_OFFLINE, w);
5043 away_list = make_status_icon_list(PIDGIN_STOCK_STATUS_AWAY, w);
5044 protocol_lists = g_hash_table_new(g_str_hash, g_str_equal);
5045 }
5046
5047 static void 5009 static void
5048 plugin_changed_cb(GObject *manager, GPluginPlugin *p, gpointer data) 5010 plugin_changed_cb(GObject *manager, GPluginPlugin *p, gpointer data)
5049 { 5011 {
5050 regenerate_plugins_items(data); 5012 regenerate_plugins_items(data);
5051 } 5013 }
5156 * to save the window position we stored the window size, so I'm 5118 * to save the window position we stored the window size, so I'm
5157 * leaving it for now. */ 5119 * leaving it for now. */
5158 #if TRUE || defined(_WIN32) 5120 #if TRUE || defined(_WIN32)
5159 pidgin_conv_restore_position(win); 5121 pidgin_conv_restore_position(win);
5160 #endif 5122 #endif
5161
5162 if (available_list == NULL) {
5163 create_icon_lists(win->window);
5164 }
5165 5123
5166 g_signal_connect(G_OBJECT(win->window), "delete_event", 5124 g_signal_connect(G_OBJECT(win->window), "delete_event",
5167 G_CALLBACK(close_win_cb), win); 5125 G_CALLBACK(close_win_cb), win);
5168 g_signal_connect(G_OBJECT(win->window), "focus_in_event", 5126 g_signal_connect(G_OBJECT(win->window), "focus_in_event",
5169 G_CALLBACK(focus_win_cb), win); 5127 G_CALLBACK(focus_win_cb), win);

mercurial