[gnome-builder] libide/webkit: add helper to get webkit web view
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide/webkit: add helper to get webkit web view
- Date: Fri, 16 Sep 2022 23:02:21 +0000 (UTC)
commit ad3bf4c4fc5ce5d1cf565888cf32192dcc2c98c3
Author: Christian Hergert <chergert redhat com>
Date: Fri Sep 16 16:01:31 2022 -0700
libide/webkit: add helper to get webkit web view
src/libide/webkit/ide-webkit-page.c | 17 +++++++++++++++++
src/libide/webkit/ide-webkit-page.h | 2 ++
2 files changed, 19 insertions(+)
---
diff --git a/src/libide/webkit/ide-webkit-page.c b/src/libide/webkit/ide-webkit-page.c
index 2d0ddfc4d..9709104b6 100644
--- a/src/libide/webkit/ide-webkit-page.c
+++ b/src/libide/webkit/ide-webkit-page.c
@@ -717,3 +717,20 @@ ide_webkit_page_has_generator (IdeWebkitPage *self)
return priv->generator != NULL;
}
+/**
+ * ide_webkit_page_get_view:
+ * @self: a #IdeWebkitPage
+ *
+ * Gets the underlying #WebKitWebView.
+ *
+ * Returns: (transfer none): a #WebKitWebView
+ */
+GtkWidget *
+ide_webkit_page_get_view (IdeWebkitPage *self)
+{
+ IdeWebkitPagePrivate *priv = ide_webkit_page_get_instance_private (self);
+
+ g_return_val_if_fail (IDE_IS_WEBKIT_PAGE (self), NULL);
+
+ return GTK_WIDGET (priv->web_view);
+}
diff --git a/src/libide/webkit/ide-webkit-page.h b/src/libide/webkit/ide-webkit-page.h
index 5b2504ea5..b74071ad3 100644
--- a/src/libide/webkit/ide-webkit-page.h
+++ b/src/libide/webkit/ide-webkit-page.h
@@ -45,6 +45,8 @@ IdeWebkitPage *ide_webkit_page_new (void);
IDE_AVAILABLE_IN_ALL
IdeWebkitPage *ide_webkit_page_new_for_generator (IdeHtmlGenerator *generator);
IDE_AVAILABLE_IN_ALL
+GtkWidget *ide_webkit_page_get_view (IdeWebkitPage *self);
+IDE_AVAILABLE_IN_ALL
void ide_webkit_page_load_uri (IdeWebkitPage *self,
const char *uri);
IDE_AVAILABLE_IN_ALL
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]