pidgin/android/libpurple

Parents acd48a8a0b3b
Children 999cd2afb976
win32: hack for webkit's feature of replacing backslash with yen sign; silencing some warnings in gtkconv.c; consistent messages in proxy.c
--- a/libpurple/proxy.c Thu Apr 11 14:37:09 2013 +0200
+++ b/libpurple/proxy.c Fri Apr 12 03:33:42 2013 +0200
@@ -775,7 +775,7 @@
{
if ((errno == EINPROGRESS) || (errno == EINTR))
{
- purple_debug_info("proxy", "UDP Connection in progress\n");
+ purple_debug_info("proxy", "UDP connection in progress\n");
connect_data->inpa = purple_input_add(connect_data->fd,
PURPLE_INPUT_WRITE, socket_ready_cb, connect_data);
}
@@ -1276,7 +1276,7 @@
if (connect(connect_data->fd, addr, addrlen) != 0) {
if (errno == EINPROGRESS || errno == EINTR) {
- purple_debug_info("proxy", "Connection in progress\n");
+ purple_debug_info("proxy", "HTTP connection in progress\n");
connect_data->inpa = purple_input_add(connect_data->fd,
PURPLE_INPUT_WRITE, http_canwrite, connect_data);
@@ -1472,7 +1472,7 @@
{
if ((errno == EINPROGRESS) || (errno == EINTR))
{
- purple_debug_info("proxy", "Connection in progress.\n");
+ purple_debug_info("proxy", "SOCKS4 connection in progress\n");
connect_data->inpa = purple_input_add(connect_data->fd,
PURPLE_INPUT_WRITE, s4_canwrite, connect_data);
}
@@ -2131,7 +2131,7 @@
{
if ((errno == EINPROGRESS) || (errno == EINTR))
{
- purple_debug_info("socks5 proxy", "Connection in progress\n");
+ purple_debug_info("proxy", "SOCKS5 connection in progress\n");
connect_data->inpa = purple_input_add(connect_data->fd,
PURPLE_INPUT_WRITE, s5_canwrite, connect_data);
}
--- a/pidgin/gtkconv.c Thu Apr 11 14:37:09 2013 +0200
+++ b/pidgin/gtkconv.c Fri Apr 12 03:33:42 2013 +0200
@@ -197,7 +197,9 @@
/* Prototypes. <-- because Paco-Paco hates this comment. */
static void load_conv_theme(PidginConversation *gtkconv);
static gboolean infopane_entry_activate(PidginConversation *gtkconv);
+#if 0
static void got_typing_keypress(PidginConversation *gtkconv, gboolean first);
+#endif
static void gray_stuff_out(PidginConversation *gtkconv);
static void add_chat_buddy_common(PurpleConversation *conv, PurpleConvChatBuddy *cb, const char *old_name);
static gboolean tab_complete(PurpleConversation *conv);
@@ -2439,6 +2441,7 @@
pidgin_conv_switch_active_conversation(conv);
}
+#if 0
static void
insert_text_cb(GtkTextBuffer *textbuffer, GtkTextIter *position,
gchar *new_text, gint new_text_length, gpointer user_data)
@@ -2485,6 +2488,7 @@
got_typing_keypress(gtkconv, FALSE);
}
}
+#endif
/**************************************************************************
* A bunch of buddy icon functions
@@ -3738,6 +3742,7 @@
* Utility functions
**************************************************************************/
+#if 0
static void
got_typing_keypress(PidginConversation *gtkconv, gboolean first)
{
@@ -3766,7 +3771,6 @@
}
}
-#if 0
static gboolean
typing_animation(gpointer data) {
PidginConversation *gtkconv = data;
@@ -4248,6 +4252,7 @@
g_free(alias_key);
}
+#if 0
/**
* @param most_matched Used internally by this function.
* @param entered The partial string that the user types before hitting the
@@ -4303,6 +4308,7 @@
*matches = g_list_insert_sorted(*matches, g_strdup(name),
(GCompareFunc)purple_utf8_strcasecmp);
}
+#endif
static gboolean
tab_complete(PurpleConversation *conv)
@@ -5267,12 +5273,23 @@
{
WebKitWebSettings *settings;
const GValue *val;
-
+
g_object_get(G_OBJECT(webview), "settings", &settings, NULL);
val = pidgin_conversation_theme_lookup(theme, "DefaultFontFamily", TRUE);
if (val && G_VALUE_HOLDS_STRING(val))
- g_object_set(G_OBJECT(settings), "default-font-family", g_value_get_string(val), NULL);
+ {
+ const gchar *font_family = g_value_get_string(val);
+#ifdef _WIN32
+ /* XXX: a hack for not converting backslash to yen sign.
+ * See gtkwebview.c: gtk_webview_new.
+ */
+ if (g_ascii_strcasecmp(font_family, "sans-serif") == 0)
+ font_family = NULL;
+#endif
+ if (font_family)
+ g_object_set(G_OBJECT(settings), "default-font-family", font_family, NULL);
+ }
val = pidgin_conversation_theme_lookup(theme, "DefaultFontSize", TRUE);
if (val && G_VALUE_HOLDS_INT(val))
@@ -6376,8 +6393,8 @@
char *str;
char *with_font_tag;
char *sml_attrib = NULL;
+ size_t length;
#endif
- size_t length;
PurpleConversationType type;
char *displaying;
gboolean plugin_return;
@@ -6446,7 +6463,9 @@
g_free(displaying);
return;
}
+#if 0
length = strlen(displaying) + 1;
+#endif
old_flags = gtkconv->last_flags;
if ((flags & PURPLE_MESSAGE_SEND) && (old_flags & PURPLE_MESSAGE_SEND)) {
--- a/pidgin/gtkwebview.c Thu Apr 11 14:37:09 2013 +0200
+++ b/pidgin/gtkwebview.c Fri Apr 12 03:33:42 2013 +0200
@@ -1354,7 +1354,21 @@
GtkWidget *
gtk_webview_new(void)
{
- return GTK_WIDGET(g_object_new(gtk_webview_get_type(), NULL));
+ WebKitWebView *webview = WEBKIT_WEB_VIEW(g_object_new(gtk_webview_get_type(), NULL));
+ WebKitWebSettings *settings = webkit_web_view_get_settings(webview);
+
+ g_object_set(G_OBJECT(settings), "default-encoding", "utf-8", NULL);
+#ifdef _WIN32
+ /* XXX: win32 WebKitGTK replaces backslash with yen sign for
+ * "sans-serif" font. We should figure out, how to disable this
+ * behavior, but for now I will just apply this simple hack (using other
+ * font family).
+ */
+ g_object_set(G_OBJECT(settings), "default-font-family", "Verdana", NULL);
+#endif
+ webkit_web_view_set_settings(webview, settings);
+
+ return GTK_WIDGET(webview);
}
static void