rosenrot/webview.h

27 lines
718 B
C
Raw Permalink Normal View History

2022-05-10 15:35:37 +00:00
#pragma once
2022-05-13 10:30:15 +00:00
#include "rose.h"
2022-05-10 15:35:37 +00:00
#include <webkit2/webkit2.h>
#include <gdk/gdk.h>
#define ROSE_TYPE_WEBVIEW rose_webview_get_type()
G_DECLARE_FINAL_TYPE(RoseWebView, rose_webview, ROSE, WEBVIEW, WebKitWebView)
typedef enum {
2022-05-10 15:35:37 +00:00
ROSE_WEBVIEW_NAV_BACK = 1 << 0,
ROSE_WEBVIEW_FORWARD = 1 << 1
} RoseWebViewNavigationFlags;
/* Create a new webview in the form of a Gtk Object. */
2022-05-10 15:35:37 +00:00
GtkWidget* rose_webview_new();
/* Load the given `url` into the webview. */
void rose_webview_load_url(WebKitWebView *webview, const char *url);
2022-05-10 15:35:37 +00:00
/* Called when the URL changes, adds a new entry to the history
file. */
2022-05-13 18:37:50 +00:00
void rose_load_changed_callback(WebKitWebView *webview,
WebKitLoadEvent event);