[libgtk3-webkit2-perl] 08/10: Convert to perl-Gtk3-WebKit2 by patching perl-Gtk3-WebKit(1).
Mike Gabriel
sunweaver at debian.org
Mon Jun 26 11:05:53 UTC 2017
This is an automated email from the git hooks/post-receive script.
sunweaver pushed a commit to branch master
in repository libgtk3-webkit2-perl.
commit 00f51976eb559ee12bfabf8e8f7f857ccfef8d49
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Mon Jun 26 12:27:16 2017 +0200
Convert to perl-Gtk3-WebKit2 by patching perl-Gtk3-WebKit(1).
---
debian/changelog | 2 +-
debian/control | 20 +-
debian/copyright | 4 +-
debian/libgtk3-webkit2-perl.examples | 1 +
debian/patches/1001_build-against-webkit2.patch | 1050 +++++++++++++++++++++++
debian/patches/series | 1 +
6 files changed, 1067 insertions(+), 11 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 3bc9120..f914d1b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-libgtk3-webkit-perl (0.06-1) UNRELEASED; urgency=low
+libgtk3-webkit2-perl (0.06-1) UNRELEASED; urgency=low
* Initial Release. (Closes: #865642).
diff --git a/debian/control b/debian/control
index 57aae0f..0adb88c 100644
--- a/debian/control
+++ b/debian/control
@@ -1,4 +1,4 @@
-Source: libgtk3-webkit-perl
+Source: libgtk3-webkit2-perl
Section: perl
Testsuite: autopkgtest-pkg-perl
Priority: optional
@@ -6,7 +6,7 @@ Build-Depends: debhelper (>= 9),
xvfb,
xauth,
Build-Depends-Indep: libglib-object-introspection-perl,
- libwebkitgtk-3.0-dev,
+ libwebkit2gtk-4.0-dev,
libglib-object-introspection-perl,
libgtk3-perl,
libtest-needsdisplay-perl,
@@ -14,18 +14,20 @@ Build-Depends-Indep: libglib-object-introspection-perl,
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: Debian Remote Maintainers <pkg-remote-team at lists.alioth.debian.org>,
Mike Gabriel <sunweaver at debian.org>,
-Standards-Version: 3.9.8
-Vcs-Browser: https://anonscm.debian.org/git/pkg-perl/packages/libgtk3-webkit-perl.git
-Vcs-Git: https://anonscm.debian.org/git/pkg-perl/packages/libgtk3-webkit-perl.git
+Standards-Version: 4.0.0
+Vcs-Browser: https://anonscm.debian.org/git/pkg-perl/packages/libgtk3-webkit2-perl.git
+Vcs-Git: https://anonscm.debian.org/git/pkg-perl/packages/libgtk3-webkit2-perl.git
+# FIXME: this project was derived from WebKit(1), once upstream has adopted our changes,
+# let's fix the Homepage: field here and in debian/copyright accordingly.
Homepage: https://metacpan.org/release/Gtk3-WebKit
-Package: libgtk3-webkit-perl
+Package: libgtk3-webkit2-perl
Architecture: all
Depends: ${misc:Depends}, ${perl:Depends},
libglib-object-introspection-perl,
libgtk3-perl
-Description: WebKit bindings for Perl
- Gtk3::WebKit provides the Perl bindings for the Gtk3 port of WebKit.
+Description: WebKit2 bindings for Perl
+ Gtk3::WebKit2 provides the Perl bindings for the Gtk3 port of WebKit2.
.
- With this package you can easily write your own WebKit based web browser
+ With this package you can easily write your own WebKit2 based web browser
implementation in Perl.
diff --git a/debian/copyright b/debian/copyright
index 1775747..59e5714 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,7 +1,9 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+# FIXME: This project has been forked from Gtk3-WebKit(1), so when upstream
+# has adopted our changes, the below URL needs to be adapted.
Source: https://metacpan.org/release/Gtk3-WebKit
Upstream-Contact: Emmanuel Rodriguez <potyl at cpan.org>
-Upstream-Name: Gtk3::WebKit
+Upstream-Name: Gtk3::WebKit2
Files: *
Copyright: Emmanuel Rodriguez <potyl at cpan.org>
diff --git a/debian/libgtk3-webkit2-perl.examples b/debian/libgtk3-webkit2-perl.examples
new file mode 100644
index 0000000..e39721e
--- /dev/null
+++ b/debian/libgtk3-webkit2-perl.examples
@@ -0,0 +1 @@
+examples/*
diff --git a/debian/patches/1001_build-against-webkit2.patch b/debian/patches/1001_build-against-webkit2.patch
new file mode 100644
index 0000000..dc9784f
--- /dev/null
+++ b/debian/patches/1001_build-against-webkit2.patch
@@ -0,0 +1,1050 @@
+Description: Use Webkit2 rather than WebKit1
+Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
+
+--- a/lib/Gtk3/WebKit.pm
++++ /dev/null
+@@ -1,459 +0,0 @@
+-package Gtk3::WebKit;
+-{
+- $Gtk3::WebKit::VERSION = '0.06';
+-}
+-
+-=head1 NAME
+-
+-Gtk3::WebKit - WebKit bindings for Perl
+-
+-=head1 SYNOPSIS
+-
+- use Gtk3 -init;
+- use Gtk3::WebKit;
+-
+- my ($url) = shift @ARGV || 'http://search.cpan.org/';
+-
+- my $window = Gtk3::Window->new('toplevel');
+- $window->set_default_size(800, 600);
+- $window->signal_connect(destroy => sub { Gtk3->main_quit() });
+-
+- # Create a WebKit widget
+- my $view = Gtk3::WebKit::WebView->new();
+-
+- # Load a page
+- $view->load_uri($url);
+-
+- # Pack the widgets together
+- my $scrolls = Gtk3::ScrolledWindow->new();
+- $scrolls->add($view);
+- $window->add($scrolls);
+- $window->show_all();
+-
+- Gtk3->main();
+-
+-=head1 DESCRIPTION
+-
+-This module provides the Perl bindings for the Gtk3 port of WebKit.
+-
+-=cut
+-
+-use warnings;
+-use strict;
+-use base 'Exporter';
+-
+-use Glib::Object::Introspection;
+-
+-
+-use constant {
+- # XPath result types
+- ANY_TYPE => 0,
+- NUMBER_TYPE => 1,
+- STRING_TYPE => 2,
+- BOOLEAN_TYPE => 3,
+- UNORDERED_NODE_ITERATOR_TYPE => 4,
+- ORDERED_NODE_ITERATOR_TYPE => 5,
+- UNORDERED_NODE_SNAPSHOT_TYPE => 6,
+- ORDERED_NODE_SNAPSHOT_TYPE => 7,
+- ANY_UNORDERED_NODE_TYPE => 8,
+- FIRST_ORDERED_NODE_TYPE => 9,
+-
+- # Node type
+- ELEMENT_NODE => 1,
+- ATTRIBUTE_NODE => 2,
+- TEXT_NODE => 3,
+- CDATA_SECTION_NODE => 4,
+- ENTITY_REFERENCE_NODE => 5,
+- ENTITY_NODE => 6,
+- PROCESSING_INSTRUCTION_NODE => 7,
+- COMMENT_NODE => 8,
+- DOCUMENT_NODE => 9,
+- DOCUMENT_TYPE_NODE => 10,
+- DOCUMENT_FRAGMENT_NODE => 11,
+- NOTATION_NODE => 12,
+-
+- # Document position
+- DOCUMENT_POSITION_DISCONNECTED => 0x01,
+- DOCUMENT_POSITION_PRECEDING => 0x02,
+- DOCUMENT_POSITION_FOLLOWING => 0x04,
+- DOCUMENT_POSITION_CONTAINS => 0x08,
+- DOCUMENT_POSITION_CONTAINED_BY => 0x10,
+- DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC => 0x20,
+-
+- # Event - DOM PhaseType
+- CAPTURING_PHASE =>1,
+- AT_TARGET =>2,
+- BUBBLING_PHASE =>3,
+-
+- # Event - Reverse-engineered from Netscape
+- MOUSEDOWN =>1,
+- MOUSEUP =>2,
+- MOUSEOVER =>4,
+- MOUSEOUT =>8,
+- MOUSEMOVE =>16,
+- MOUSEDRAG =>32,
+- CLICK =>64,
+- DBLCLICK =>128,
+- KEYDOWN =>256,
+- KEYUP =>512,
+- KEYPRESS =>1024,
+- DRAGDROP =>2048,
+- FOCUS =>4096,
+- BLUR =>8192,
+- SELECT =>16384,
+- CHANGE =>32768,
+-
+- # Full screen api
+- ALLOW_KEYBOARD_INPUT => 1,
+-
+-
+- # ExceptionCode
+- INDEX_SIZE_ERR =>1,
+- DOMSTRING_SIZE_ERR =>2,
+- HIERARCHY_REQUEST_ERR =>3,
+- WRONG_DOCUMENT_ERR =>4,
+- INVALID_CHARACTER_ERR =>5,
+- NO_DATA_ALLOWED_ERR =>6,
+- NO_MODIFICATION_ALLOWED_ERR =>7,
+- NOT_FOUND_ERR =>8,
+- NOT_SUPPORTED_ERR =>9,
+- INUSE_ATTRIBUTE_ERR =>10,
+- # Introduced in DOM Level 2:
+- INVALID_STATE_ERR =>11,
+- # Introduced in DOM Level 2:
+- SYNTAX_ERR =>12,
+- # Introduced in DOM Level 2:
+- INVALID_MODIFICATION_ERR =>13,
+- # Introduced in DOM Level 2:
+- NAMESPACE_ERR =>14,
+- # Introduced in DOM Level 2:
+- INVALID_ACCESS_ERR =>15,
+- # Introduced in DOM Level 3:
+- VALIDATION_ERR =>16,
+- # Introduced in DOM Level 3:
+- TYPE_MISMATCH_ERR =>17,
+- # Introduced as an XHR extension:
+- SECURITY_ERR =>18,
+- # Introduced in HTML5:
+- NETWORK_ERR =>19,
+- ABORT_ERR =>20,
+- URL_MISMATCH_ERR =>21,
+- QUOTA_EXCEEDED_ERR =>22,
+- # TIMEOUT_ERR is currently unused but was added for completeness.
+- TIMEOUT_ERR =>23,
+- # INVALID_NODE_TYPE_ERR is currently unused but was added for completeness.
+- INVALID_NODE_TYPE_ERR =>24,
+- DATA_CLONE_ERR =>25,
+-
+- # EventExceptionCode
+- UNSPECIFIED_EVENT_TYPE_ERR => 0,
+- DISPATCH_REQUEST_ERR => 1,
+-
+- # KeyLocationCode
+- KEY_LOCATION_STANDARD => 0x00,
+- KEY_LOCATION_LEFT => 0x01,
+- KEY_LOCATION_RIGHT => 0x02,
+- KEY_LOCATION_NUMPAD => 0x03,
+-
+-
+- # Range compare how
+- START_TO_START => 0,
+- START_TO_END => 1,
+- END_TO_END => 2,
+- END_TO_START => 3,
+-
+- # Range compare results
+- NODE_BEFORE => 0,
+- NODE_AFTER => 1,
+- NODE_BEFORE_AND_AFTER => 2,
+- NODE_INSIDE => 3,
+-
+- # Range exceptions
+- BAD_BOUNDARYPOINTS_ERR => 1,
+- INVALID_NODE_TYPE_ERR => 2,
+-
+- # Overflow event
+- HORIZONTAL => 0,
+- VERTICAL => 1,
+- BOTH => 2,
+-
+- # NodeFilter acceptNode return values
+- FILTER_ACCEPT => 1,
+- FILTER_REJECT => 2,
+- FILTER_SKIP => 3,
+-
+- # NodeFilter whatToShow
+- SHOW_ALL => 0xFFFFFFFF,
+- SHOW_ELEMENT => 0x00000001,
+- SHOW_ATTRIBUTE => 0x00000002,
+- SHOW_TEXT => 0x00000004,
+- SHOW_CDATA_SECTION => 0x00000008,
+- SHOW_ENTITY_REFERENCE => 0x00000010,
+- SHOW_ENTITY => 0x00000020,
+- SHOW_PROCESSING_INSTRUCTION => 0x00000040,
+- SHOW_COMMENT => 0x00000080,
+- SHOW_DOCUMENT => 0x00000100,
+- SHOW_DOCUMENT_TYPE => 0x00000200,
+- SHOW_DOCUMENT_FRAGMENT => 0x00000400,
+- SHOW_NOTATION => 0x00000800,
+-
+-
+- # Attr change types
+- MODIFICATION =>1,
+- ADDITION =>2,
+- REMOVAL =>3,
+-
+-
+- # Media stream
+- LIVE => 1,
+- ENDED => 2,
+-};
+-
+-# export nothing by default.
+-# export functions and constants by request.
+-our %EXPORT_TAGS = (
+- xpath_results => [qw{
+- ANY_TYPE
+- NUMBER_TYPE
+- STRING_TYPE
+- BOOLEAN_TYPE
+- UNORDERED_NODE_ITERATOR_TYPE
+- ORDERED_NODE_ITERATOR_TYPE
+- UNORDERED_NODE_SNAPSHOT_TYPE
+- ORDERED_NODE_SNAPSHOT_TYPE
+- ANY_UNORDERED_NODE_TYPE
+- FIRST_ORDERED_NODE_TYPE
+- }],
+-
+- node_types => [qw{
+- ELEMENT_NODE
+- ATTRIBUTE_NODE
+- TEXT_NODE
+- CDATA_SECTION_NODE
+- ENTITY_REFERENCE_NODE
+- ENTITY_NODE
+- PROCESSING_INSTRUCTION_NODE
+- COMMENT_NODE
+- DOCUMENT_NODE
+- DOCUMENT_TYPE_NODE
+- DOCUMENT_FRAGMENT_NODE
+- NOTATION_NODE
+- }],
+-
+- document_positions => [qw{
+- DOCUMENT_POSITION_DISCONNECTED
+- DOCUMENT_POSITION_PRECEDING
+- DOCUMENT_POSITION_FOLLOWING
+- DOCUMENT_POSITION_CONTAINS
+- DOCUMENT_POSITION_CONTAINED_BY
+- DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
+- }],
+-
+- event_phase_types => [qw{
+- CAPTURING_PHASE
+- AT_TARGET
+- BUBBLING_PHASE
+- }],
+-
+- event_types => [qw{
+- MOUSEDOWN
+- MOUSEUP
+- MOUSEOVER
+- MOUSEOUT
+- MOUSEMOVE
+- MOUSEDRAG
+- CLICK
+- DBLCLICK
+- KEYDOWN
+- KEYUP
+- KEYPRESS
+- DRAGDROP
+- FOCUS
+- BLUR
+- SELECT
+- CHANGE
+- }],
+-
+- full_screen_api => [qw{
+- ALLOW_KEYBOARD_INPUT
+- }],
+-
+- dom_core_exceptions => [qw{
+- INDEX_SIZE_ERR
+- DOMSTRING_SIZE_ERR
+- HIERARCHY_REQUEST_ERR
+- WRONG_DOCUMENT_ERR
+- INVALID_CHARACTER_ERR
+- NO_DATA_ALLOWED_ERR
+- NO_MODIFICATION_ALLOWED_ERR
+- NOT_FOUND_ERR
+- NOT_SUPPORTED_ERR
+- INUSE_ATTRIBUTE_ERR
+- INVALID_STATE_ERR
+- SYNTAX_ERR
+- INVALID_MODIFICATION_ERR
+- NAMESPACE_ERR
+- INVALID_ACCESS_ERR
+- VALIDATION_ERR
+- TYPE_MISMATCH_ERR
+- SECURITY_ERR
+- NETWORK_ERR
+- ABORT_ERR
+- URL_MISMATCH_ERR
+- QUOTA_EXCEEDED_ERR
+- TIMEOUT_ERR
+- INVALID_NODE_TYPE_ERR
+- DATA_CLONE_ERR
+- }],
+-
+- event_exception_codes => [qw{
+- UNSPECIFIED_EVENT_TYPE_ERR
+- DISPATCH_REQUEST_ERR
+- }],
+-
+- key_location_codes => [qw{
+- KEY_LOCATION_STANDARD
+- KEY_LOCATION_LEFT
+- KEY_LOCATION_RIGHT
+- KEY_LOCATION_NUMPAD
+- }],
+-
+- range_compare_how => [qw{
+- START_TO_START
+- START_TO_END
+- END_TO_END
+- END_TO_START
+- }],
+-
+- range_compare_results => [qw{
+- NODE_BEFORE
+- NODE_AFTER
+- NODE_BEFORE_AND_AFTER
+- NODE_INSIDE
+- }],
+-
+- range_exceptions => [qw{
+- BAD_BOUNDARYPOINTS_ERR
+- INVALID_NODE_TYPE_ERR
+- }],
+-
+-
+- # Overflow event
+- overflow_event => [qw{
+- HORIZONTAL
+- VERTICAL
+- BOTH
+- }],
+-
+- node_filter => [qw{
+- FILTER_ACCEPT
+- FILTER_REJECT
+- FILTER_SKIP
+-
+- SHOW_ALL
+- SHOW_ELEMENT
+- SHOW_ATTRIBUTE
+- SHOW_TEXT
+- SHOW_CDATA_SECTION
+- SHOW_ENTITY_REFERENCE
+- SHOW_ENTITY
+- SHOW_PROCESSING_INSTRUCTION
+- SHOW_COMMENT
+- SHOW_DOCUMENT
+- SHOW_DOCUMENT_TYPE
+- SHOW_DOCUMENT_FRAGMENT
+- SHOW_NOTATION
+- }],
+-
+- attr_change_types => [qw{
+- MODIFICATION
+- ADDITION
+- REMOVAL
+- }],
+-
+- media_stream => [qw{
+- LIVE
+- ENDED
+- }],
+-);
+-our @EXPORT_OK = map { @$_ } values %EXPORT_TAGS;
+-$EXPORT_TAGS{all} = \@EXPORT_OK;
+-
+-
+-sub import {
+- my %setup = (
+- basename => 'WebKit',
+- version => '3.0',
+- package => __PACKAGE__,
+- );
+-
+- my @args;
+- for (my $i = 0; $i < @_; ++$i) {
+- my $arg = $_[$i];
+- if (exists $setup{$arg}) {
+- $setup{$arg} = $_[++$i];
+- }
+- else {
+- push @args, $arg;
+- }
+- }
+-
+- Glib::Object::Introspection->setup(%setup);
+-
+- # Pretend that we're calling Exporter's import
+- @_ = @args;
+- goto &Exporter::import;
+-}
+-
+-1;
+-
+-=head1 INSTALLATION
+-
+-=head2 "Headless" Debian based systems (inc Ubuntu)
+-
+-If you are running an X Server (desktop environment) then you should be fine.
+-If you are trying to install this on a "headless" server, then you will need a
+-framebuffer display to take the place of the X server.
+-
+-The xvfb-run command can do this for you.
+-
+-With Ubuntu 12.04 LTS, you'll need these (or more recent) extra deb packages:
+-
+- xvfb libgirepository1.0-dev pkg-config libgtk-3-dev libglib2.0-dev libglib2.0-0 gir1.2-webkit-3.0
+-
+-At which point everything should "just work".
+-
+-=head1 BUGS
+-
+-For any kind of help or support simply send a mail to the gtk-perl mailing
+-list (gtk-perl-list at gnome.org).
+-
+-=head1 AUTHORS
+-
+-Emmanuel Rodriguez E<lt>potyl at cpan.orgE<gt>.
+-
+-=head1 COPYRIGHT AND LICENSE
+-
+-Copyright (C) 2011, 2012 by Emmanuel Rodriguez.
+-
+-This library is free software; you can redistribute it and/or modify
+-it under the same terms of:
+-
+-=over 4
+-
+-=item the GNU Lesser General Public License, version 2.1; or
+-
+-=item the Artistic License, version 2.0.
+-
+-=back
+-
+-This module 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.
+-
+-You should have received a copy of the GNU Library General Public
+-License along with this module; if not, see L<http://www.gnu.org/licenses/>.
+-
+-For the terms of The Artistic License, see L<perlartistic>.
+-
+-=cut
+--- a/Changes
++++ b/Changes
+@@ -1,4 +1,4 @@
+-Revision history for Gtk3::WebKit
++Revision history for Gtk3::WebKit2
+
+ 0.06 Mon Apr 14 22:27:41 CEST 2014
+ Migrate to Dist::Zilla
+--- a/MANIFEST
++++ b/MANIFEST
+@@ -7,5 +7,5 @@
+ README
+ dist.ini
+ examples/browser.pl
+-lib/Gtk3/WebKit.pm
++lib/Gtk3/WebKit2.pm
+ t/webkit.t
+--- a/META.yml
++++ b/META.yml
+@@ -1,5 +1,5 @@
+ ---
+-abstract: 'WebKit bindings for Perl'
++abstract: 'WebKit2 bindings for Perl'
+ author:
+ - 'Emmanuel Rodriguez <potyl at cpan.org>'
+ build_requires:
+@@ -12,7 +12,7 @@
+ meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
+-name: Gtk3-WebKit
++name: Gtk3-WebKit2
+ requires:
+ Glib::Object::Introspection: 0
+ Gtk3: 0
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -9,16 +9,16 @@
+
+
+ my %WriteMakefileArgs = (
+- "ABSTRACT" => "WebKit bindings for Perl",
++ "ABSTRACT" => "WebKit2 bindings for Perl",
+ "AUTHOR" => "Emmanuel Rodriguez <potyl\@cpan.org>",
+ "BUILD_REQUIRES" => {},
+ "CONFIGURE_REQUIRES" => {
+ "ExtUtils::MakeMaker" => "6.30"
+ },
+- "DISTNAME" => "Gtk3-WebKit",
++ "DISTNAME" => "Gtk3-WebKit2",
+ "EXE_FILES" => [],
+ "LICENSE" => "lgpl",
+- "NAME" => "Gtk3::WebKit",
++ "NAME" => "Gtk3::WebKit2",
+ "PREREQ_PM" => {
+ "Glib::Object::Introspection" => 0,
+ "Gtk3" => 0
+--- a/README
++++ b/README
+@@ -1,9 +1,9 @@
+
+
+-This archive contains the distribution Gtk3-WebKit,
++This archive contains the distribution Gtk3-WebKit2,
+ version 0.06:
+
+- WebKit bindings for Perl
++ WebKit2 bindings for Perl
+
+ This software is Copyright (c) 2014 by Emmanuel Rodriguez.
+
+--- a/dist.ini
++++ b/dist.ini
+@@ -1,4 +1,4 @@
+-name = Gtk3-WebKit
++name = Gtk3-WebKit2
+ version = 0.06
+ author = Emmanuel Rodriguez <potyl at cpan.org>
+ license = LGPL_2_1
+--- a/examples/browser.pl
++++ b/examples/browser.pl
+@@ -22,7 +22,7 @@
+ use warnings;
+
+ use Gtk3 -init;
+-use Gtk3::WebKit;
++use Gtk3::WebKit2;
+
+
+ sub main {
+@@ -32,8 +32,8 @@
+ $window->set_default_size(800, 600);
+ $window->signal_connect(destroy => sub { Gtk3->main_quit() });
+
+- # Create a WebKit widget
+- my $view = Gtk3::WebKit::WebView->new();
++ # Create a WebKit2 widget
++ my $view = Gtk3::WebKit2::WebView->new();
+
+ # Load a page
+ $view->load_uri($url);
+--- /dev/null
++++ b/lib/Gtk3/WebKit2.pm
+@@ -0,0 +1,459 @@
++package Gtk3::WebKit2;
++{
++ $Gtk3::WebKit2::VERSION = '0.06';
++}
++
++=head1 NAME
++
++Gtk3::WebKit2 - WebKit2 bindings for Perl
++
++=head1 SYNOPSIS
++
++ use Gtk3 -init;
++ use Gtk3::WebKit2;
++
++ my ($url) = shift @ARGV || 'http://search.cpan.org/';
++
++ my $window = Gtk3::Window->new('toplevel');
++ $window->set_default_size(800, 600);
++ $window->signal_connect(destroy => sub { Gtk3->main_quit() });
++
++ # Create a WebKit2 widget
++ my $view = Gtk3::WebKit2::WebView->new();
++
++ # Load a page
++ $view->load_uri($url);
++
++ # Pack the widgets together
++ my $scrolls = Gtk3::ScrolledWindow->new();
++ $scrolls->add($view);
++ $window->add($scrolls);
++ $window->show_all();
++
++ Gtk3->main();
++
++=head1 DESCRIPTION
++
++This module provides the Perl bindings for the Gtk3 port of WebKit2.
++
++=cut
++
++use warnings;
++use strict;
++use base 'Exporter';
++
++use Glib::Object::Introspection;
++
++
++use constant {
++ # XPath result types
++ ANY_TYPE => 0,
++ NUMBER_TYPE => 1,
++ STRING_TYPE => 2,
++ BOOLEAN_TYPE => 3,
++ UNORDERED_NODE_ITERATOR_TYPE => 4,
++ ORDERED_NODE_ITERATOR_TYPE => 5,
++ UNORDERED_NODE_SNAPSHOT_TYPE => 6,
++ ORDERED_NODE_SNAPSHOT_TYPE => 7,
++ ANY_UNORDERED_NODE_TYPE => 8,
++ FIRST_ORDERED_NODE_TYPE => 9,
++
++ # Node type
++ ELEMENT_NODE => 1,
++ ATTRIBUTE_NODE => 2,
++ TEXT_NODE => 3,
++ CDATA_SECTION_NODE => 4,
++ ENTITY_REFERENCE_NODE => 5,
++ ENTITY_NODE => 6,
++ PROCESSING_INSTRUCTION_NODE => 7,
++ COMMENT_NODE => 8,
++ DOCUMENT_NODE => 9,
++ DOCUMENT_TYPE_NODE => 10,
++ DOCUMENT_FRAGMENT_NODE => 11,
++ NOTATION_NODE => 12,
++
++ # Document position
++ DOCUMENT_POSITION_DISCONNECTED => 0x01,
++ DOCUMENT_POSITION_PRECEDING => 0x02,
++ DOCUMENT_POSITION_FOLLOWING => 0x04,
++ DOCUMENT_POSITION_CONTAINS => 0x08,
++ DOCUMENT_POSITION_CONTAINED_BY => 0x10,
++ DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC => 0x20,
++
++ # Event - DOM PhaseType
++ CAPTURING_PHASE =>1,
++ AT_TARGET =>2,
++ BUBBLING_PHASE =>3,
++
++ # Event - Reverse-engineered from Netscape
++ MOUSEDOWN =>1,
++ MOUSEUP =>2,
++ MOUSEOVER =>4,
++ MOUSEOUT =>8,
++ MOUSEMOVE =>16,
++ MOUSEDRAG =>32,
++ CLICK =>64,
++ DBLCLICK =>128,
++ KEYDOWN =>256,
++ KEYUP =>512,
++ KEYPRESS =>1024,
++ DRAGDROP =>2048,
++ FOCUS =>4096,
++ BLUR =>8192,
++ SELECT =>16384,
++ CHANGE =>32768,
++
++ # Full screen api
++ ALLOW_KEYBOARD_INPUT => 1,
++
++
++ # ExceptionCode
++ INDEX_SIZE_ERR =>1,
++ DOMSTRING_SIZE_ERR =>2,
++ HIERARCHY_REQUEST_ERR =>3,
++ WRONG_DOCUMENT_ERR =>4,
++ INVALID_CHARACTER_ERR =>5,
++ NO_DATA_ALLOWED_ERR =>6,
++ NO_MODIFICATION_ALLOWED_ERR =>7,
++ NOT_FOUND_ERR =>8,
++ NOT_SUPPORTED_ERR =>9,
++ INUSE_ATTRIBUTE_ERR =>10,
++ # Introduced in DOM Level 2:
++ INVALID_STATE_ERR =>11,
++ # Introduced in DOM Level 2:
++ SYNTAX_ERR =>12,
++ # Introduced in DOM Level 2:
++ INVALID_MODIFICATION_ERR =>13,
++ # Introduced in DOM Level 2:
++ NAMESPACE_ERR =>14,
++ # Introduced in DOM Level 2:
++ INVALID_ACCESS_ERR =>15,
++ # Introduced in DOM Level 3:
++ VALIDATION_ERR =>16,
++ # Introduced in DOM Level 3:
++ TYPE_MISMATCH_ERR =>17,
++ # Introduced as an XHR extension:
++ SECURITY_ERR =>18,
++ # Introduced in HTML5:
++ NETWORK_ERR =>19,
++ ABORT_ERR =>20,
++ URL_MISMATCH_ERR =>21,
++ QUOTA_EXCEEDED_ERR =>22,
++ # TIMEOUT_ERR is currently unused but was added for completeness.
++ TIMEOUT_ERR =>23,
++ # INVALID_NODE_TYPE_ERR is currently unused but was added for completeness.
++ INVALID_NODE_TYPE_ERR =>24,
++ DATA_CLONE_ERR =>25,
++
++ # EventExceptionCode
++ UNSPECIFIED_EVENT_TYPE_ERR => 0,
++ DISPATCH_REQUEST_ERR => 1,
++
++ # KeyLocationCode
++ KEY_LOCATION_STANDARD => 0x00,
++ KEY_LOCATION_LEFT => 0x01,
++ KEY_LOCATION_RIGHT => 0x02,
++ KEY_LOCATION_NUMPAD => 0x03,
++
++
++ # Range compare how
++ START_TO_START => 0,
++ START_TO_END => 1,
++ END_TO_END => 2,
++ END_TO_START => 3,
++
++ # Range compare results
++ NODE_BEFORE => 0,
++ NODE_AFTER => 1,
++ NODE_BEFORE_AND_AFTER => 2,
++ NODE_INSIDE => 3,
++
++ # Range exceptions
++ BAD_BOUNDARYPOINTS_ERR => 1,
++ INVALID_NODE_TYPE_ERR => 2,
++
++ # Overflow event
++ HORIZONTAL => 0,
++ VERTICAL => 1,
++ BOTH => 2,
++
++ # NodeFilter acceptNode return values
++ FILTER_ACCEPT => 1,
++ FILTER_REJECT => 2,
++ FILTER_SKIP => 3,
++
++ # NodeFilter whatToShow
++ SHOW_ALL => 0xFFFFFFFF,
++ SHOW_ELEMENT => 0x00000001,
++ SHOW_ATTRIBUTE => 0x00000002,
++ SHOW_TEXT => 0x00000004,
++ SHOW_CDATA_SECTION => 0x00000008,
++ SHOW_ENTITY_REFERENCE => 0x00000010,
++ SHOW_ENTITY => 0x00000020,
++ SHOW_PROCESSING_INSTRUCTION => 0x00000040,
++ SHOW_COMMENT => 0x00000080,
++ SHOW_DOCUMENT => 0x00000100,
++ SHOW_DOCUMENT_TYPE => 0x00000200,
++ SHOW_DOCUMENT_FRAGMENT => 0x00000400,
++ SHOW_NOTATION => 0x00000800,
++
++
++ # Attr change types
++ MODIFICATION =>1,
++ ADDITION =>2,
++ REMOVAL =>3,
++
++
++ # Media stream
++ LIVE => 1,
++ ENDED => 2,
++};
++
++# export nothing by default.
++# export functions and constants by request.
++our %EXPORT_TAGS = (
++ xpath_results => [qw{
++ ANY_TYPE
++ NUMBER_TYPE
++ STRING_TYPE
++ BOOLEAN_TYPE
++ UNORDERED_NODE_ITERATOR_TYPE
++ ORDERED_NODE_ITERATOR_TYPE
++ UNORDERED_NODE_SNAPSHOT_TYPE
++ ORDERED_NODE_SNAPSHOT_TYPE
++ ANY_UNORDERED_NODE_TYPE
++ FIRST_ORDERED_NODE_TYPE
++ }],
++
++ node_types => [qw{
++ ELEMENT_NODE
++ ATTRIBUTE_NODE
++ TEXT_NODE
++ CDATA_SECTION_NODE
++ ENTITY_REFERENCE_NODE
++ ENTITY_NODE
++ PROCESSING_INSTRUCTION_NODE
++ COMMENT_NODE
++ DOCUMENT_NODE
++ DOCUMENT_TYPE_NODE
++ DOCUMENT_FRAGMENT_NODE
++ NOTATION_NODE
++ }],
++
++ document_positions => [qw{
++ DOCUMENT_POSITION_DISCONNECTED
++ DOCUMENT_POSITION_PRECEDING
++ DOCUMENT_POSITION_FOLLOWING
++ DOCUMENT_POSITION_CONTAINS
++ DOCUMENT_POSITION_CONTAINED_BY
++ DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
++ }],
++
++ event_phase_types => [qw{
++ CAPTURING_PHASE
++ AT_TARGET
++ BUBBLING_PHASE
++ }],
++
++ event_types => [qw{
++ MOUSEDOWN
++ MOUSEUP
++ MOUSEOVER
++ MOUSEOUT
++ MOUSEMOVE
++ MOUSEDRAG
++ CLICK
++ DBLCLICK
++ KEYDOWN
++ KEYUP
++ KEYPRESS
++ DRAGDROP
++ FOCUS
++ BLUR
++ SELECT
++ CHANGE
++ }],
++
++ full_screen_api => [qw{
++ ALLOW_KEYBOARD_INPUT
++ }],
++
++ dom_core_exceptions => [qw{
++ INDEX_SIZE_ERR
++ DOMSTRING_SIZE_ERR
++ HIERARCHY_REQUEST_ERR
++ WRONG_DOCUMENT_ERR
++ INVALID_CHARACTER_ERR
++ NO_DATA_ALLOWED_ERR
++ NO_MODIFICATION_ALLOWED_ERR
++ NOT_FOUND_ERR
++ NOT_SUPPORTED_ERR
++ INUSE_ATTRIBUTE_ERR
++ INVALID_STATE_ERR
++ SYNTAX_ERR
++ INVALID_MODIFICATION_ERR
++ NAMESPACE_ERR
++ INVALID_ACCESS_ERR
++ VALIDATION_ERR
++ TYPE_MISMATCH_ERR
++ SECURITY_ERR
++ NETWORK_ERR
++ ABORT_ERR
++ URL_MISMATCH_ERR
++ QUOTA_EXCEEDED_ERR
++ TIMEOUT_ERR
++ INVALID_NODE_TYPE_ERR
++ DATA_CLONE_ERR
++ }],
++
++ event_exception_codes => [qw{
++ UNSPECIFIED_EVENT_TYPE_ERR
++ DISPATCH_REQUEST_ERR
++ }],
++
++ key_location_codes => [qw{
++ KEY_LOCATION_STANDARD
++ KEY_LOCATION_LEFT
++ KEY_LOCATION_RIGHT
++ KEY_LOCATION_NUMPAD
++ }],
++
++ range_compare_how => [qw{
++ START_TO_START
++ START_TO_END
++ END_TO_END
++ END_TO_START
++ }],
++
++ range_compare_results => [qw{
++ NODE_BEFORE
++ NODE_AFTER
++ NODE_BEFORE_AND_AFTER
++ NODE_INSIDE
++ }],
++
++ range_exceptions => [qw{
++ BAD_BOUNDARYPOINTS_ERR
++ INVALID_NODE_TYPE_ERR
++ }],
++
++
++ # Overflow event
++ overflow_event => [qw{
++ HORIZONTAL
++ VERTICAL
++ BOTH
++ }],
++
++ node_filter => [qw{
++ FILTER_ACCEPT
++ FILTER_REJECT
++ FILTER_SKIP
++
++ SHOW_ALL
++ SHOW_ELEMENT
++ SHOW_ATTRIBUTE
++ SHOW_TEXT
++ SHOW_CDATA_SECTION
++ SHOW_ENTITY_REFERENCE
++ SHOW_ENTITY
++ SHOW_PROCESSING_INSTRUCTION
++ SHOW_COMMENT
++ SHOW_DOCUMENT
++ SHOW_DOCUMENT_TYPE
++ SHOW_DOCUMENT_FRAGMENT
++ SHOW_NOTATION
++ }],
++
++ attr_change_types => [qw{
++ MODIFICATION
++ ADDITION
++ REMOVAL
++ }],
++
++ media_stream => [qw{
++ LIVE
++ ENDED
++ }],
++);
++our @EXPORT_OK = map { @$_ } values %EXPORT_TAGS;
++$EXPORT_TAGS{all} = \@EXPORT_OK;
++
++
++sub import {
++ my %setup = (
++ basename => 'WebKit2',
++ version => '4.0',
++ package => __PACKAGE__,
++ );
++
++ my @args;
++ for (my $i = 0; $i < @_; ++$i) {
++ my $arg = $_[$i];
++ if (exists $setup{$arg}) {
++ $setup{$arg} = $_[++$i];
++ }
++ else {
++ push @args, $arg;
++ }
++ }
++
++ Glib::Object::Introspection->setup(%setup);
++
++ # Pretend that we're calling Exporter's import
++ @_ = @args;
++ goto &Exporter::import;
++}
++
++1;
++
++=head1 INSTALLATION
++
++=head2 "Headless" Debian based systems (inc Ubuntu)
++
++If you are running an X Server (desktop environment) then you should be fine.
++If you are trying to install this on a "headless" server, then you will need a
++framebuffer display to take the place of the X server.
++
++The xvfb-run command can do this for you.
++
++With Ubuntu 12.04 LTS, you'll need these (or more recent) extra deb packages:
++
++ xvfb libgirepository1.0-dev pkg-config libgtk-3-dev libglib2.0-dev libglib2.0-0 gir1.2-webkit2-4.0
++
++At which point everything should "just work".
++
++=head1 BUGS
++
++For any kind of help or support simply send a mail to the gtk-perl mailing
++list (gtk-perl-list at gnome.org).
++
++=head1 AUTHORS
++
++Emmanuel Rodriguez E<lt>potyl at cpan.orgE<gt>.
++
++=head1 COPYRIGHT AND LICENSE
++
++Copyright (C) 2011, 2012 by Emmanuel Rodriguez.
++
++This library is free software; you can redistribute it and/or modify
++it under the same terms of:
++
++=over 4
++
++=item the GNU Lesser General Public License, version 2.1; or
++
++=item the Artistic License, version 2.0.
++
++=back
++
++This module 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.
++
++You should have received a copy of the GNU Library General Public
++License along with this module; if not, see L<http://www.gnu.org/licenses/>.
++
++For the terms of The Artistic License, see L<perlartistic>.
++
++=cut
+--- a/t/webkit.t
++++ b/t/webkit.t
+@@ -12,16 +12,13 @@
+
+
+ BEGIN {
+- use_ok('Gtk3::WebKit');
++ use_ok('Gtk3::WebKit2');
+ }
+
+
+ sub main {
+- # Grab the session so that headless unit test don't crash, see RT 93421
+- my $session = Gtk3::WebKit::get_default_session();
+-
+- my $view = Gtk3::WebKit::WebView->new();
+- isa_ok($view, 'Gtk3::WebKit::WebView');
++ my $view = Gtk3::WebKit2::WebView->new();
++ isa_ok($view, 'Gtk3::WebKit2::WebView');
+ return 0;
+ }
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..08ab1ff
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+1001_build-against-webkit2.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libgtk3-webkit2-perl.git
More information about the Pkg-perl-cvs-commits
mailing list