1Gtk2::ImageView::Tool(3U)ser Contributed Perl DocumentatiGotnk2::ImageView::Tool(3)
2
3
4
6 Gtk2::ImageView::Tool
7
9 Glib::Interface
10 +----Gtk2::ImageView::Tool
11
13 Gtk2::ImageView::Tool is an interface that defines how Gtk2::ImageView
14 interacts with objects that acts as tools. Gtk2::ImageView delegates
15 many of its most important tasks (such as drawing) to its tool which
16 carries out all the hard work. The Gtk2::ImageView package comes with
17 two tools; Gtk2::ImageView::Tool::Dragger and
18 Gtk2::ImageView::Tool::Selector, but by implementing your own tool it
19 is possible to extend Gtk2::ImageView to do stuff its author didn't
20 imagine.
21
22 Gtk2::ImageView uses Gtk2::ImageView::Tool::Dragger by default, as that
23 tool is he most generally useful one. However, it is trivial to make it
24 use another tool.
25
26 my $view = Gtk2::ImageView->new;
27 my $tool = Gtk2::ImageView::Tool::Selector ($view);
28 $view->set_tool ($tool);
29
30 Using the above code makes the view use the selector tool instead of
31 the default dragger tool.
32
34 boolean = $tool->button_press ($ev)
35 · $ev (Gtk2::Gdk::Event)
36
37 boolean = $tool->button_release ($ev)
38 · $ev (Gtk2::Gdk::Event)
39
40 cursor = $tool->cursor_at_point ($x, $y)
41 · $x (integer)
42
43 · $y (integer)
44
45 Ask the tool what cursor it wants displayed.
46
47 tool : the tool
48 x : the mouse pointers X-coordinate
49 y : the mouse pointers Y-coordinate
50
51 Returns
52
53 The appropriate cursor.
54
55 boolean = $tool->motion_notify ($ev)
56 · $ev (Gtk2::Gdk::Event)
57
58 $tool->paint_image ($opts, $drawable)
59 · $opts (Gtk2::Gdk::Pixbuf::Draw::Opts)
60
61 · $drawable (Gtk2::Gdk::Drawable)
62
63 Called whenever the image view decides that any part of the image
64 it shows needs to be redrawn.
65
66 tool : the tool
67 opts : the Gtk2::Gdk::Pixbuf::DrawOpts to use in this draw
68 drawable : a Gtk2::Gdk::Drawable to draw on
69
70 $tool->pixbuf_changed ($reset_fit, $rect)
71 · $reset_fit (boolean)
72
73 · $rect (Gtk2::Gdk::Rectangle)
74
75 Indicate to the tool that either a part of, or the whole pixbuf
76 that the image view shows has changed. This method is called by the
77 view whenever its pixbuf or its tool changes. That is, when any of
78 the following methods are used:
79
80 Gtk2::ImageView::set_pixbuf()
81 Gtk2::ImageView::set_tool()
82 Gtk2::ImageView::damage_pixels()
83
84 If the reset_fit parameter is TRUE, it means that a new pixbuf has
85 been loaded into the view.
86
87 tool : the tool
88 reset_fit : whether the view is resetting its fit mode or not
89 rect : rectangle containing the changed area or NULL
90
92 Gtk2::ImageView, Glib::Interface
93
95 Copyright (C) 2007 by Jeffrey Ratcliffe.
96
97 This software is licensed under the GPL-3; see Gtk2::ImageView for a
98 full notice.
99
101 Hey! The above document had some coding errors, which are explained
102 below:
103
104 Around line 80:
105 You forgot a '=back' before '=head3'
106
107 Around line 89:
108 =back without =over
109
110
111
112perl v5.12.0 2010-05-02 Gtk2::ImageView::Tool(3)