pidgin: f8cbd953: Add a WebView setup function.
qulogic at pidgin.im
qulogic at pidgin.im
Thu Jan 5 23:01:49 EST 2012
----------------------------------------------------------------------
Revision: f8cbd95346df8e53fb9bab967c3871456508c909
Parent: 2bb0694a8ce8d358259f7c40bdc99867245f3d11
Author: qulogic at pidgin.im
Date: 01/04/12 18:56:07
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/f8cbd95346df8e53fb9bab967c3871456508c909
Changelog:
Add a WebView setup function.
Changes against parent 2bb0694a8ce8d358259f7c40bdc99867245f3d11
patched pidgin/gtkutils.c
patched pidgin/gtkutils.h
-------------- next part --------------
============================================================
--- pidgin/gtkutils.c 95018761affa5cb36898d7aac9b73c55d1f6c31e
+++ pidgin/gtkutils.c db6a4b0ad8dce5b2895ec1a95d193bedd7225133
@@ -128,6 +128,32 @@ pidgin_setup_imhtml(GtkWidget *imhtml)
}
+void
+pidgin_setup_webview(GtkWidget *webview)
+{
+ g_return_if_fail(webview != NULL);
+ g_return_if_fail(GTK_IS_WEBVIEW(webview));
+
+#if 0
+/* TODO: WebKit this stuff... */
+ pidgin_themes_smiley_themeize(webview);
+#endif
+
+#ifdef _WIN32
+ if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/use_theme_font")) {
+ WebKitWebSettings *settings = webkit_web_settings_new();
+ g_object_set(G_OBJECT(settings), "default-font-size",
+ purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/font_size"),
+ NULL);
+ g_object_set(G_OBJECT(settings), "default-font-family",
+ purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/custom_font"),
+ NULL);
+
+ webkit_web_view_set_settings(WEBKIT_WEB_VIEW(webview), settings);
+ }
+#endif
+}
+
static
void pidgin_window_init(GtkWindow *wnd, const char *title, guint border_width, const char *role, gboolean resizable)
{
@@ -319,6 +345,7 @@ pidgin_create_webview(gboolean editable,
gtk_webviewtoolbar_attach(GTK_WEBVIEWTOOLBAR(toolbar), webview);
gtk_webviewtoolbar_associate_smileys(GTK_WEBVIEWTOOLBAR(toolbar), "default");
}
+ pidgin_setup_webview(webview);
sw = pidgin_make_scrollable(webview, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_NONE, -1, -1);
gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0);
============================================================
--- pidgin/gtkutils.h 4fb6e5ff6a3e59483be93f633c6d7ed89e3eedd8
+++ pidgin/gtkutils.h 58da843f168c9d8cba68d06e464df2b71adb76ea
@@ -107,6 +107,14 @@ GtkWidget *pidgin_create_imhtml(gboolean
GtkWidget *pidgin_create_imhtml(gboolean editable, GtkWidget **imhtml_ret, GtkWidget **toolbar_ret, GtkWidget **sw_ret);
/**
+ * Sets up a gtkwebview widget, loads it with smileys, and sets the
+ * default signal handlers.
+ *
+ * @param webview The gtkwebview widget to setup.
+ */
+void pidgin_setup_webview(GtkWidget *webview);
+
+/**
* Create an GtkWebView widget and associated GtkIMHtmlToolbar widget. This
* function puts both widgets in a nice GtkFrame. They're separated by an
* attractive GtkSeparator.
More information about the Commits
mailing list