/usr/share/perl5/Gtk3/WebKit2.pm is in libgtk3-webkit2-perl 0.06-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 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@gnome.org).
=head1 AUTHORS
Emmanuel Rodriguez E<lt>potyl@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
|