Commit 5221f9a7 authored by Juan Pablo Ugarte's avatar Juan Pablo Ugarte Committed by Juan Pablo Ugarte
Browse files

plugins/webkit2gtk: added initial support for WebKit2GTK+ library.

parent 41e12655
......@@ -207,6 +207,22 @@ fi
AM_CONDITIONAL(BUILD_PYTHON, test x"$have_python" = "xyes")
dnl ================================================================
dnl WebKit2GTK support
dnl ================================================================
WEBKIT2GTK_REQUIRED=2.12.0
AC_ARG_ENABLE(webkit2gtk,
AS_HELP_STRING([--disable-webkit2gtk], [disable webkit2gtk catalog]),
check_webkit2gtk=$enableval, check_webkit2gtk=yes)
if test x"$check_webkit2gtk" = x"yes"; then
PKG_CHECK_MODULES([WEBKIT2GTK],[webkit2gtk-4.0 >= $WEBKIT2GTK_REQUIRED],[have_webkit2gtk=yes],[have_webkit2gtk=no])
else
have_webkit2gtk=no
fi
AM_CONDITIONAL(BUILD_WEBKIT2GTK, test x"$have_webkit2gtk" = "xyes")
# ==================================================================
# Glade User Manual (requires yelp-tools)
# ==================================================================
......@@ -342,6 +358,7 @@ plugins/gtk+/icons/16x16/Makefile
plugins/gtk+/icons/22x22/Makefile
plugins/python/Makefile
plugins/gladeui/Makefile
plugins/webkit2gtk/Makefile
po/Makefile.in
doc/Makefile
doc/version.xml
......@@ -363,6 +380,7 @@ Configuration:
GTK+ UNIX Print Widgets: ${have_unix_print}
PYTHON Widgets support: ${have_python}
Gladeui Catalog: ${enable_gladeui}
WebKit2GTK+ Catalog: ${have_webkit2gtk}
Introspection Data: ${found_introspection}
Build Reference Manual: ${enable_gtk_doc}
......
......@@ -10,6 +10,10 @@ if BUILD_GLADEUI
SUBDIRS += gladeui
endif
if BUILD_WEBKIT2GTK
SUBDIRS += webkit2gtk
endif
dtddir = $(pkgdatadir)/catalogs
dtd_DATA = glade-catalog.dtd
......
/.deps
/.libs
/Makefile
/Makefile.in
/webkit2gtk.xml
## Process this file with automake to produce Makefile.in
libgladeui = $(top_builddir)/gladeui/libgladeui-2.la
# libgladewebkit2gtk
gladewebkit2gtk_LTLIBRARIES = libgladewebkit2gtk.la
gladewebkit2gtkdir = $(pkglibdir)/modules
libgladewebkit2gtk_la_CPPFLAGS = \
-DG_LOG_DOMAIN=\"GladeUI-WEBKIT2GTK\" \
-I$(top_srcdir) \
-I$(top_builddir) \
$(WEBKIT2GTK_INCLUDES)
libgladewebkit2gtk_la_CFLAGS = \
$(AM_CFLAGS) \
$(PLUGINS_WARN_CFLAGS) \
$(WEBKIT2GTK_CFLAGS)
libgladewebkit2gtk_la_SOURCES = glade-webkit2gtk.c
libgladewebkit2gtk_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS) $(WEBKIT2GTK_LDFLAGS)
libgladewebkit2gtk_la_LIBADD = $(libgladeui) $(WEBKIT2GTK_LIBS)
if PLATFORM_WIN32
libgladewebkit2gtk_la_LDFLAGS += -no-undefined
endif
# catalog data
catalogsdir = $(pkgdatadir)/catalogs
catalogs_DATA = webkit2gtk.xml
@INTLTOOL_XML_NOMERGE_RULE@
EXTRA_DIST = webkit2gtk.xml webkit2gtk.xml.in
CLEANFILES = webkit2gtk.xml
\ No newline at end of file
/*
* Copyright (C) 2011 Juan Pablo Ugarte
* 2016 Endless Mobile Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Authors:
* Juan Pablo Ugarte <juanpablougarte@gmail.com>
* Juan Pablo Ugarte <ugarte@endlessm.com>
*/
#include "config.h"
#include <webkit2/webkit2.h>
#include <gladeui/glade.h>
void
glade_webkit_web_view_set_property (GladeWidgetAdaptor *adaptor,
GObject *object,
const gchar *id,
const GValue *value)
{
if (g_str_equal(id, "glade-url"))
{
const gchar *url = g_value_get_string (value);
gchar *scheme = g_uri_parse_scheme (url);
if (scheme)
{
webkit_web_view_load_uri (WEBKIT_WEB_VIEW (object), url);
g_free (scheme);
return;
}
gchar *full_url = g_strconcat ("http://", url, NULL);
webkit_web_view_load_uri (WEBKIT_WEB_VIEW (object), full_url);
g_free (full_url);
}
else
GWA_GET_CLASS(G_TYPE_OBJECT)->set_property (adaptor, object, id, value);
}
<?xml version="1.0" encoding="UTF-8"?>
<glade-catalog name="webkit2gtk"
version="2.12"
library="gladewebkit2gtk"
domain="glade"
depends="gtk+"
book="WebKit2GTK">
<glade-widget-classes>
<glade-widget-class name="WebKitWebView"
generic-name="webview"
title="WebKit Web View"
get-type-function="webkit_web_view_get_type">
<set-property-function>glade_webkit_web_view_set_property</set-property-function>
<properties>
<property save="False" id="glade-url" name="URL" weight="1.1">
<parameter-spec>
<type>GParamString</type>
</parameter-spec>
<tooltip>The URL to load in Glade (this property will not be saved)</tooltip>
</property>
<property id="user-content-manager" disabled="True" />
<property id="web-context" disabled="True" />
</properties>
</glade-widget-class>
<glade-widget-class name="WebKitSettings"
generic-name="settings"
title="WebKit Settings"
toplevel="True"
get-type-function="webkit_settings_get_type"/>
</glade-widget-classes>
<glade-widget-group name="webkit2gtk" title="WebKit2GTK+ Widgets">
<glade-widget-class-ref name="WebKitWebView"/>
<glade-widget-class-ref name="WebKitSettings"/>
</glade-widget-group>
</glade-catalog>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment