From 6724f68dcf78c6a44f22f7e8297ff4e76e8d7e9a Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Tue, 8 Jul 2014 21:04:45 +0200 Subject: [PATCH] Started transitioning to Webkit 2.0 Unfortunately, webkit_web_view_load_string() is not implemented in the 2.0 API, so trying with load_html() for now. Seems not to work with SVG images without tweaking. --- configure.ac | 2 +- src/ag-window.c | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index ada3c9d..a4531a5 100644 --- a/configure.ac +++ b/configure.ac @@ -32,7 +32,7 @@ PKG_CHECK_MODULES([GOBJECT], [gobject-2.0]) PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= 3.8]) PKG_CHECK_MODULES([LIBXML], [libxml-2.0]) PKG_CHECK_MODULES([LIBXSLT], [libexslt]) -PKG_CHECK_MODULES([WEBKIT], [webkitgtk-3.0]) +PKG_CHECK_MODULES([WEBKIT], [webkit2gtk-3.0]) PKG_CHECK_MODULES([SWE_GLIB], [swe-glib >= 2.0.0]) AC_CONFIG_FILES([ diff --git a/src/ag-window.c b/src/ag-window.c index 068aa65..82b9251 100644 --- a/src/ag-window.c +++ b/src/ag-window.c @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include @@ -511,9 +511,9 @@ ag_window_redraw_chart(AgWindow *window) gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); } else { - webkit_web_view_load_string( + webkit_web_view_load_html( WEBKIT_WEB_VIEW(priv->chart_web_view), - svg_content, "image/svg+xml", "UTF-8", "file://"); + svg_content, NULL); g_free(svg_content); } @@ -682,7 +682,8 @@ ag_window_init(AgWindow *window) g_signal_connect(G_OBJECT(main_settings), "changed::planets-char", G_CALLBACK(ag_window_display_changed), window); g_signal_connect(G_OBJECT(main_settings), "changed::aspects-char", G_CALLBACK(ag_window_display_changed), window); - webkit_web_view_load_string( + // TODO: translate this error message! + webkit_web_view_load_html( WEBKIT_WEB_VIEW(priv->chart_web_view), "" \ "" \ @@ -693,7 +694,7 @@ ag_window_init(AgWindow *window) "

No chart is loaded. Create one on the edit view, or open one from the application menu!

" \ "" \ "", - "text/html", "UTF-8", NULL); + NULL); gtk_stack_set_visible_child_name(GTK_STACK(priv->stack), "edit"); priv->current_tab = priv->tab_edit;