diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-10-30 05:21:41 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-10-30 05:21:41 (EDT) |
commit | d60a212d3206486b831d0fb7ec8959e3d9a5b0d8 (patch) | |
tree | 867ab94c5be313fc1dffc3aed6de3f28bdad417d /src | |
parent | cbc51b45aae6e7342c5892ed63980292f1a0734b (diff) | |
download | marquee-d60a212d3206486b831d0fb7ec8959e3d9a5b0d8.zip marquee-d60a212d3206486b831d0fb7ec8959e3d9a5b0d8.tar.gz marquee-d60a212d3206486b831d0fb7ec8959e3d9a5b0d8.tar.bz2 |
MqWebViewSchemeMethods: Add (MqWebView *) param to *_uri() methods
Diffstat (limited to 'src')
-rw-r--r-- | src/web-view-schemes/normal.c | 6 | ||||
-rw-r--r-- | src/web-view-schemes/schemes.h | 4 | ||||
-rw-r--r-- | src/web-view-schemes/view-source.c | 5 | ||||
-rw-r--r-- | src/web-view.c | 8 |
4 files changed, 13 insertions, 10 deletions
diff --git a/src/web-view-schemes/normal.c b/src/web-view-schemes/normal.c index ec3ad80..4b07100 100644 --- a/src/web-view-schemes/normal.c +++ b/src/web-view-schemes/normal.c @@ -33,7 +33,8 @@ #include "../web-view.h" static gchar * -rewrite_uri(MqWebViewScheme G_GNUC_UNUSED *scheme, const gchar *uri) +rewrite_uri(MqWebView G_GNUC_UNUSED *web_view, + MqWebViewScheme G_GNUC_UNUSED *scheme, const gchar *uri) { if (g_str_has_prefix(uri, "about:")) { return g_strconcat("mq-about:", uri + strlen("about:"), NULL); @@ -43,7 +44,8 @@ rewrite_uri(MqWebViewScheme G_GNUC_UNUSED *scheme, const gchar *uri) } static gchar * -display_uri(MqWebViewScheme G_GNUC_UNUSED *scheme, const gchar *uri) +display_uri(MqWebView G_GNUC_UNUSED *web_view, + MqWebViewScheme G_GNUC_UNUSED *scheme, const gchar *uri) { if (g_str_has_prefix(uri, "mq-about:")) { return g_strconcat("about:", uri + strlen("mq-about:"), NULL); diff --git a/src/web-view-schemes/schemes.h b/src/web-view-schemes/schemes.h index ee9139f..4412069 100644 --- a/src/web-view-schemes/schemes.h +++ b/src/web-view-schemes/schemes.h @@ -49,8 +49,8 @@ union _MqWebViewScheme { }; typedef struct { - gchar * (*rewrite_uri) (MqWebViewScheme *, const gchar *); - gchar * (*display_uri) (MqWebViewScheme *, const gchar *); + gchar * (*rewrite_uri) (MqWebView *, MqWebViewScheme *, const gchar *); + gchar * (*display_uri) (MqWebView *, MqWebViewScheme *, const gchar *); gboolean (*context_menu)(MqWebView *, MqWebViewScheme *, WebKitContextMenu *, GdkEvent *, WebKitHitTestResult *); diff --git a/src/web-view-schemes/view-source.c b/src/web-view-schemes/view-source.c index 435aa96..4a2f910 100644 --- a/src/web-view-schemes/view-source.c +++ b/src/web-view-schemes/view-source.c @@ -34,7 +34,7 @@ #include "../web-view.h" static gchar * -rewrite_uri(MqWebViewScheme *scheme, const gchar *uri) +rewrite_uri(MqWebView *web_view, MqWebViewScheme *scheme, const gchar *uri) { MqTabPage *origin_tab; @@ -60,7 +60,8 @@ rewrite_uri(MqWebViewScheme *scheme, const gchar *uri) } static gchar * -display_uri(MqWebViewScheme *scheme, const gchar G_GNUC_UNUSED *uri) +display_uri(MqWebView G_GNUC_UNUSED *web_view, MqWebViewScheme *scheme, + const gchar G_GNUC_UNUSED *uri) { return g_strdup_printf("view-source:%s", scheme->view_source.uri); } diff --git a/src/web-view.c b/src/web-view.c index 3fab3d2..eded264 100644 --- a/src/web-view.c +++ b/src/web-view.c @@ -79,8 +79,8 @@ uri_cb(MqWebView *web_view, GParamSpec G_GNUC_UNUSED *param_spec) uri = webkit_web_view_get_uri(WEBKIT_WEB_VIEW(web_view)); - web_view->uri = web_view->scheme_methods->display_uri(&web_view->scheme, - uri); + web_view->uri = web_view->scheme_methods->display_uri( + web_view, &web_view->scheme, uri); g_object_notify_by_pspec(G_OBJECT(web_view), obj_properties[PROP_DISPLAY_URI]); @@ -206,7 +206,7 @@ constructed(GObject *object) if (web_view->uri) { rw_uri = web_view->scheme_methods->rewrite_uri( - &web_view->scheme, web_view->uri); + web_view, &web_view->scheme, web_view->uri); webkit_web_view_load_uri(WEBKIT_WEB_VIEW(web_view), rw_uri); g_free(rw_uri); } else { @@ -386,7 +386,7 @@ mq_web_view_load_uri(MqWebView *web_view, const gchar *uri) if (g_str_has_prefix(uri, "about:")) { rw_uri = web_view->scheme_methods->rewrite_uri( - &web_view->scheme, web_view->uri); + web_view, &web_view->scheme, web_view->uri); webkit_web_view_load_uri(WEBKIT_WEB_VIEW(web_view), rw_uri); g_free(rw_uri); } else { |