pidgin/gtkconv.c

changeset 33877
d33b4fa5ea06
parent 33796
4854740e5277
child 33941
80fcf7f86e4a
equal deleted inserted replaced
33876:acd48a8a0b3b 33877:d33b4fa5ea06
195 static void generate_send_to_items(PidginWindow *win); 195 static void generate_send_to_items(PidginWindow *win);
196 196
197 /* Prototypes. <-- because Paco-Paco hates this comment. */ 197 /* Prototypes. <-- because Paco-Paco hates this comment. */
198 static void load_conv_theme(PidginConversation *gtkconv); 198 static void load_conv_theme(PidginConversation *gtkconv);
199 static gboolean infopane_entry_activate(PidginConversation *gtkconv); 199 static gboolean infopane_entry_activate(PidginConversation *gtkconv);
200 #if 0
200 static void got_typing_keypress(PidginConversation *gtkconv, gboolean first); 201 static void got_typing_keypress(PidginConversation *gtkconv, gboolean first);
202 #endif
201 static void gray_stuff_out(PidginConversation *gtkconv); 203 static void gray_stuff_out(PidginConversation *gtkconv);
202 static void add_chat_buddy_common(PurpleConversation *conv, PurpleConvChatBuddy *cb, const char *old_name); 204 static void add_chat_buddy_common(PurpleConversation *conv, PurpleConvChatBuddy *cb, const char *old_name);
203 static gboolean tab_complete(PurpleConversation *conv); 205 static gboolean tab_complete(PurpleConversation *conv);
204 static void pidgin_conv_updated(PurpleConversation *conv, PurpleConvUpdateType type); 206 static void pidgin_conv_updated(PurpleConversation *conv, PurpleConvUpdateType type);
205 static void conv_set_unseen(PurpleConversation *gtkconv, PidginUnseenState state); 207 static void conv_set_unseen(PurpleConversation *gtkconv, PidginUnseenState state);
2437 2439
2438 conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, name); 2440 conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, name);
2439 pidgin_conv_switch_active_conversation(conv); 2441 pidgin_conv_switch_active_conversation(conv);
2440 } 2442 }
2441 2443
2444 #if 0
2442 static void 2445 static void
2443 insert_text_cb(GtkTextBuffer *textbuffer, GtkTextIter *position, 2446 insert_text_cb(GtkTextBuffer *textbuffer, GtkTextIter *position,
2444 gchar *new_text, gint new_text_length, gpointer user_data) 2447 gchar *new_text, gint new_text_length, gpointer user_data)
2445 { 2448 {
2446 PidginConversation *gtkconv = (PidginConversation *)user_data; 2449 PidginConversation *gtkconv = (PidginConversation *)user_data;
2483 else { 2486 else {
2484 /* We're deleting, but not all of it, so it counts as typing. */ 2487 /* We're deleting, but not all of it, so it counts as typing. */
2485 got_typing_keypress(gtkconv, FALSE); 2488 got_typing_keypress(gtkconv, FALSE);
2486 } 2489 }
2487 } 2490 }
2491 #endif
2488 2492
2489 /************************************************************************** 2493 /**************************************************************************
2490 * A bunch of buddy icon functions 2494 * A bunch of buddy icon functions
2491 **************************************************************************/ 2495 **************************************************************************/
2492 2496
3736 3740
3737 /************************************************************************** 3741 /**************************************************************************
3738 * Utility functions 3742 * Utility functions
3739 **************************************************************************/ 3743 **************************************************************************/
3740 3744
3745 #if 0
3741 static void 3746 static void
3742 got_typing_keypress(PidginConversation *gtkconv, gboolean first) 3747 got_typing_keypress(PidginConversation *gtkconv, gboolean first)
3743 { 3748 {
3744 PurpleConversation *conv = gtkconv->active_conv; 3749 PurpleConversation *conv = gtkconv->active_conv;
3745 PurpleConvIm *im; 3750 PurpleConvIm *im;
3764 PURPLE_TYPING); 3769 PURPLE_TYPING);
3765 purple_conv_im_set_type_again(im, timeout); 3770 purple_conv_im_set_type_again(im, timeout);
3766 } 3771 }
3767 } 3772 }
3768 3773
3769 #if 0
3770 static gboolean 3774 static gboolean
3771 typing_animation(gpointer data) { 3775 typing_animation(gpointer data) {
3772 PidginConversation *gtkconv = data; 3776 PidginConversation *gtkconv = data;
3773 PidginWindow *gtkwin = gtkconv->win; 3777 PidginWindow *gtkwin = gtkconv->win;
3774 const char *stock_id = NULL; 3778 const char *stock_id = NULL;
4246 if (is_me && color) 4250 if (is_me && color)
4247 gdk_color_free(color); 4251 gdk_color_free(color);
4248 g_free(alias_key); 4252 g_free(alias_key);
4249 } 4253 }
4250 4254
4255 #if 0
4251 /** 4256 /**
4252 * @param most_matched Used internally by this function. 4257 * @param most_matched Used internally by this function.
4253 * @param entered The partial string that the user types before hitting the 4258 * @param entered The partial string that the user types before hitting the
4254 * tab key. 4259 * tab key.
4255 * @param entered_bytes The length of entered. 4260 * @param entered_bytes The length of entered.
4301 } 4306 }
4302 4307
4303 *matches = g_list_insert_sorted(*matches, g_strdup(name), 4308 *matches = g_list_insert_sorted(*matches, g_strdup(name),
4304 (GCompareFunc)purple_utf8_strcasecmp); 4309 (GCompareFunc)purple_utf8_strcasecmp);
4305 } 4310 }
4311 #endif
4306 4312
4307 static gboolean 4313 static gboolean
4308 tab_complete(PurpleConversation *conv) 4314 tab_complete(PurpleConversation *conv)
4309 { 4315 {
4310 #if 0 4316 #if 0
5265 static void 5271 static void
5266 set_theme_webkit_settings(WebKitWebView *webview, PidginConvTheme *theme) 5272 set_theme_webkit_settings(WebKitWebView *webview, PidginConvTheme *theme)
5267 { 5273 {
5268 WebKitWebSettings *settings; 5274 WebKitWebSettings *settings;
5269 const GValue *val; 5275 const GValue *val;
5270 5276
5271 g_object_get(G_OBJECT(webview), "settings", &settings, NULL); 5277 g_object_get(G_OBJECT(webview), "settings", &settings, NULL);
5272 5278
5273 val = pidgin_conversation_theme_lookup(theme, "DefaultFontFamily", TRUE); 5279 val = pidgin_conversation_theme_lookup(theme, "DefaultFontFamily", TRUE);
5274 if (val && G_VALUE_HOLDS_STRING(val)) 5280 if (val && G_VALUE_HOLDS_STRING(val))
5275 g_object_set(G_OBJECT(settings), "default-font-family", g_value_get_string(val), NULL); 5281 {
5282 const gchar *font_family = g_value_get_string(val);
5283 #ifdef _WIN32
5284 /* XXX: a hack for not converting backslash to yen sign.
5285 * See gtkwebview.c: gtk_webview_new.
5286 */
5287 if (g_ascii_strcasecmp(font_family, "sans-serif") == 0)
5288 font_family = NULL;
5289 #endif
5290 if (font_family)
5291 g_object_set(G_OBJECT(settings), "default-font-family", font_family, NULL);
5292 }
5276 5293
5277 val = pidgin_conversation_theme_lookup(theme, "DefaultFontSize", TRUE); 5294 val = pidgin_conversation_theme_lookup(theme, "DefaultFontSize", TRUE);
5278 if (val && G_VALUE_HOLDS_INT(val)) 5295 if (val && G_VALUE_HOLDS_INT(val))
5279 g_object_set(G_OBJECT(settings), "default-font-size", GINT_TO_POINTER(g_value_get_int(val)), NULL); 5296 g_object_set(G_OBJECT(settings), "default-font-size", GINT_TO_POINTER(g_value_get_int(val)), NULL);
5280 5297
6374 gboolean show_date; 6391 gboolean show_date;
6375 char *mdate; 6392 char *mdate;
6376 char *str; 6393 char *str;
6377 char *with_font_tag; 6394 char *with_font_tag;
6378 char *sml_attrib = NULL; 6395 char *sml_attrib = NULL;
6396 size_t length;
6379 #endif 6397 #endif
6380 size_t length;
6381 PurpleConversationType type; 6398 PurpleConversationType type;
6382 char *displaying; 6399 char *displaying;
6383 gboolean plugin_return; 6400 gboolean plugin_return;
6384 #if 0 6401 #if 0
6385 gboolean is_rtl_message = FALSE; 6402 gboolean is_rtl_message = FALSE;
6444 if (plugin_return) 6461 if (plugin_return)
6445 { 6462 {
6446 g_free(displaying); 6463 g_free(displaying);
6447 return; 6464 return;
6448 } 6465 }
6466 #if 0
6449 length = strlen(displaying) + 1; 6467 length = strlen(displaying) + 1;
6468 #endif
6450 6469
6451 old_flags = gtkconv->last_flags; 6470 old_flags = gtkconv->last_flags;
6452 if ((flags & PURPLE_MESSAGE_SEND) && (old_flags & PURPLE_MESSAGE_SEND)) { 6471 if ((flags & PURPLE_MESSAGE_SEND) && (old_flags & PURPLE_MESSAGE_SEND)) {
6453 message_html = pidgin_conversation_theme_get_template(gtkconv->theme, 6472 message_html = pidgin_conversation_theme_get_template(gtkconv->theme,
6454 PIDGIN_CONVERSATION_THEME_TEMPLATE_OUTGOING_NEXT_CONTENT); 6473 PIDGIN_CONVERSATION_THEME_TEMPLATE_OUTGOING_NEXT_CONTENT);

mercurial