/usr/lib/perl5/Gnome2/Canvas.pod is in libgnome2-canvas-perl 1.002-2build4.
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 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 | =head1 NAME
Gnome2::Canvas - A structured graphics canvas
=cut
=for position SYNOPSIS
=head1 SYNOPSIS
use strict;
use Gtk2 -init;
use Gnome2::Canvas;
my $window = Gtk2::Window->new;
my $scroller = Gtk2::ScrolledWindow->new;
my $canvas = Gnome2::Canvas->new;
$scroller->add ($canvas);
$window->add ($scroller);
$window->set_default_size (150, 150);
$canvas->set_scroll_region (0, 0, 200, 200);
$window->show_all;
my $root = $canvas->root;
Gnome2::Canvas::Item->new ($root, 'Gnome2::Canvas::Text',
x => 20,
y => 15,
fill_color => 'black',
font => 'Sans 14',
anchor => 'GTK_ANCHOR_NW',
text => 'Hello, World!');
my $box = Gnome2::Canvas::Item->new ($root, 'Gnome2::Canvas::Rect',
x1 => 10, y1 => 5,
x2 => 150, y2 => 135,
fill_color => 'red',
outline_color => 'black');
$box->lower_to_bottom;
$box->signal_connect (event => sub {
my ($item, $event) = @_;
warn "event ".$event->type."\n";
});
Gtk2->main;
=cut
=for position DESCRIPTION
=head1 DESCRIPTION
The Gnome Canvas is an engine for structured graphics that offers a
rich imaging model, high-performance rendering, and a powerful,
high level API. It offers a choice of two rendering back-ends,
one based on GDK for extremely fast display, and another based on
Libart, a sophisticated, antialiased, alpha-compositing engine.
This widget can be used for flexible display of graphics and for
creating interactive user interface elements.
To create a new Gnome2::Canvas widget call C<< Gnome2::Canvas->new >> or
C<< Gnome2::Canvas->new_aa >> for an anti-aliased mode canvas.
A Gnome2::Canvas contains one or more Gnome2::CanvasItem
objects. Items consist of graphing elements like lines, ellipses,
polygons, images, text, and curves. These items are organized using
Gnome2::CanvasGroup objects, which are themselves derived from
Gnome2::CanvasItem. Since a group is an item it can be contained within
other groups, forming a tree of canvas items. Certain operations, like
translating and scaling, can be performed on all items in a group.
There is a special root group created by a Gnome2::Canvas. This is the top
level group under which all items in a canvas are contained. The root group
is available as C<< $canvas->root >>.
There are several different coordinate systems used by Gnome2::Canvas
widgets. The primary system is a logical, abstract coordinate space
called world coordinates. World coordinates are expressed as unbounded
double floating point numbers. When it comes to rendering to a screen
the canvas pixel coordinate system (also referred to as just canvas
coordinates) is used. This system uses integers to specify screen
pixel positions. A user defined scaling factor and offset are used to
convert between world coordinates and canvas coordinates. Each item in
a canvas has its own coordinate system called item coordinates. This
system is specified in world coordinates but they are relative to an
item (0.0, 0.0 would be the top left corner of the item). The final
coordinate system of interest is window coordinates. These are like
canvas coordinates but are offsets from within a window a canvas is
displayed in. This last system is rarely used, but is useful when
manually handling GDK events (such as drag and drop) which are
specified in window coordinates (the events processed by the canvas
are already converted for you).
Along with different coordinate systems come methods to convert
between them. C<< $canvas->w2c >> converts world to canvas pixel
coordinates and C<< canvas->c2w >> converts from canvas to
world. To get the affine transform matrix for converting
from world coordinates to canvas coordinates call C<< $canvas->w2c_affine >>.
C<< $canvas->window_to_world >> converts from window to world
coordinates and C<< $canvas->world_to_window >> converts in the other
direction. There are no methods for converting between canvas and
window coordinates, since this is just a matter of subtracting the
canvas scrolling offset. To convert to/from item coordinates use the
methods defined for Gnome2::CanvasItem objects.
To set the canvas zoom factor (canvas pixels per world unit, the
scaling factor) call C<< $canvas->set_pixels_per_unit >>; setting this
to 1.0 will cause the two coordinate systems to correspond (e.g., [5, 6]
in pixel units would be [5.0, 6.0] in world units).
Defining the scrollable area of a canvas widget is done by calling
C<< $canvas->set_scroll_region >> and to get the current region
C<< $canvas->get_scroll_region >> can be used. If the window is
larger than the canvas scrolling region it can optionally be centered
in the window. Use C<< $canvas->set_center_scroll_region >> to enable or
disable this behavior. To scroll to a particular canvas pixel coordinate
use C<< $canvas->scroll_to >> (typically not used since scrollbars are
usually set up to handle the scrolling), and to get the current canvas pixel
scroll offset call C<< $canvas->get_scroll_offsets >>.
=cut
=head1 HIERARCHY
Glib::Object
+----Glib::InitiallyUnowned
+----Gtk2::Object
+----Gtk2::Widget
+----Gtk2::Container
+----Gtk2::Layout
+----Gnome2::Canvas
=cut
=head1 INTERFACES
Glib::Object::_Unregistered::AtkImplementorIface
Gtk2::Buildable
=cut
=for object Gnome2::Canvas A structured graphics canvas
=cut
=head1 METHODS
=head2 widget = Gnome2::Canvas-E<gt>B<new>
Create a new empty canvas in non-antialiased mode.
=head2 widget = Gnome2::Canvas-E<gt>B<new_aa>
Create a new empty canvas in antialiased mode.
=head2 boolean = $canvas->B<aa>
Returns true if I<$canvas> was created in anti-aliased mode.
=head2 ($bx1, $by1, $bx2, $by2) = Gnome2::Canvas->B<get_butt_points> ($x1, $y1, $x2, $y2, $width, $project)
=over
=item * $x1 (double)
=item * $y1 (double)
=item * $x2 (double)
=item * $y2 (double)
=item * $width (double)
=item * $project (integer)
=back
=head2 (wx, wy) = $canvas-E<gt>B<c2w> ($cx, $cy)
=over
=item * $cx (integer)
=item * $cy (integer)
=back
=head2 boolean = $canvas-E<gt>B<get_center_scroll_region>
=head2 $canvas-E<gt>B<set_center_scroll_region> ($center_scroll_region)
=over
=item * $center_scroll_region (boolean)
=back
=head2 list = $canvas-E<gt>B<get_color> ($spec)
=over
=item * $spec (string)
=back
Returns an integer indicating the success of the color allocation and a
GdkColor.
=head2 unsigned = $canvas-E<gt>B<get_color_pixel> ($rgba)
=over
=item * $rgba (integer)
=back
=head2 rgbdither = $canvas-E<gt>B<get_dither>
=head2 $canvas-E<gt>B<set_dither> ($dither)
=over
=item * $dither (Gtk2::Gdk::RgbDither)
=back
=head2 item = $canvas-E<gt>B<get_item_at> ($x, $y)
=over
=item * $x (double)
=item * $y (double)
=back
=head2 ($mx1, $my1, $mx2, $my2) = Gnome2::Canvas->B<get_miter_points> ($x1, $y1, $x2, $y2, $x3, $y3, $width)
=over
=item * $x1 (double)
=item * $y1 (double)
=item * $x2 (double)
=item * $y2 (double)
=item * $x3 (double)
=item * $y3 (double)
=item * $width (double)
=back
=head2 double = $canvas->B<get_pixels_per_unit>
Fetch I<$canvas>' scale factor.
=head2 $canvas-E<gt>B<set_pixels_per_unit> ($n)
=over
=item * $n (double)
=back
Set the zooming factor of I<$canvas> by specifying the number of screen
pixels that correspond to one canvas unit.
=head2 double = Gnome2::Canvas-E<gt>B<polygon_to_point> ($poly_ref, $x, $y)
=over
=item * $poly_ref (arrayref) coordinate pairs that make up the polygon
=item * $x (double)
=item * $y (double)
=back
Return the distance from the point I<$x>,I<$y> to the polygon described by
the vertices in I<$poly_ref>, or zero if the point is inside the polygon.
=head2 $canvas-E<gt>B<request_redraw> ($x1, $y1, $x2, $y2)
=over
=item * $x1 (integer)
=item * $y1 (integer)
=item * $x2 (integer)
=item * $y2 (integer)
=back
=head2 group = $canvas-E<gt>B<root>
=head2 (cx, cy) = $canvas-E<gt>B<get_scroll_offsets>
=head2 (x1, y1, x2, y2) = $canvas-E<gt>B<get_scroll_region>
=head2 $canvas-E<gt>B<set_scroll_region> ($x1, $y1, $x2, $y2)
=over
=item * $x1 (double)
=item * $y1 (double)
=item * $x2 (double)
=item * $y2 (double)
=back
=head2 $canvas-E<gt>B<scroll_to> ($cx, $cy)
=over
=item * $cx (integer)
=item * $cy (integer)
=back
=head2 $canvas-E<gt>B<set_stipple_origin> ($gc)
=over
=item * $gc (Gtk2::Gdk::GC)
=back
=head2 $canvas-E<gt>B<update_now>
=head2 (cx, cy) = $canvas-E<gt>B<w2c> ($wx, $wy)
=over
=item * $wx (double)
=item * $wy (double)
=back
=head2 $affine = $canvas->B<w2c_affine>
=over
=back
Fetch the affine transform that converts from world coordinates to canvas
pixel coordinates.
Note: This method was completely broken for all
$Gnome2::Canvas::VERSION < 1.002.
=head2 (cx, cy) = $canvas-E<gt>B<w2c_d> ($wx, $wy)
=over
=item * $wx (double)
=item * $wy (double)
=back
=head2 (worldx, worldy) = $canvas-E<gt>B<window_to_world> ($winx, $winy)
=over
=item * $winx (double)
=item * $winy (double)
=back
=head2 (winx, winy) = $canvas-E<gt>B<world_to_window> ($worldx, $worldy)
=over
=item * $worldx (double)
=item * $worldy (double)
=back
=cut
=head1 PROPERTIES
=over
=item 'aa' (boolean : default false : readable / writable / construct-only)
The antialiasing mode of the canvas.
=item 'focused-item' (Gnome2::Canvas::Item : default undef : readable / writable)
=back
=cut
=head1 SIGNALS
=over
=item B<draw-background> (Gnome2::Canvas, Gtk2::Gdk::Drawable, integer, integer, integer, integer)
=item B<render-background> (Gnome2::Canvas, gpointer)
=back
=cut
=head1 ENUMS AND FLAGS
=head2 enum Gtk2::Gdk::RgbDither
=over
=item * 'none' / 'GDK_RGB_DITHER_NONE'
=item * 'normal' / 'GDK_RGB_DITHER_NORMAL'
=item * 'max' / 'GDK_RGB_DITHER_MAX'
=back
=cut
=for position SEE_ALSO
=head1 SEE ALSO
Gnome2::Canvas::index(3pm) lists the generated Perl API reference PODs.
Frederico Mena Quintero's whitepaper on the GNOME Canvas:
http://developer.gnome.org/doc/whitepapers/canvas/canvas.html
The real GnomeCanvas is implemented in a C library; the Gnome2::Canvas module
allows a Perl developer to use the canvas like a normal gtk2-perl object.
Like the Gtk2 module on which it depends, Gnome2::Canvas follows the C API of
libgnomecanvas-2.0 as closely as possible while still being perlish.
Thus, the C API reference remains the canonical documentation; the Perl
reference documentation lists call signatures and argument types, and is
meant to be used in conjunction with the C API reference.
GNOME Canvas Library Reference Manual
http://developer.gnome.org/doc/API/2.0/libgnomecanvas/index.html
perl(1), Glib(3pm), Gtk2(3pm).
To discuss gtk2-perl, ask questions and flame/praise the authors,
join gtk-perl-list@gnome.org at lists.gnome.org.
=cut
=for position COPYRIGHT
=head1 AUTHOR
muppet <scott at asofyet dot org>, with patches from
Torsten Schoenfeld <kaffetisch at web dot de>.
The DESCRIPTION section of this page is adapted from the documentation of
libgnomecanvas.
=head1 COPYRIGHT AND LICENSE
Copyright 2003-2004 by the gtk2-perl team.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library 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
Library General Public License for more details.
You should have received a copy of the GNU Library 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.
=cut
|