.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Gtk2::ImageView::Tool::Selector 3pm" .TH Gtk2::ImageView::Tool::Selector 3pm "2014-08-15" "perl v5.20.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Gtk2::ImageView::Tool::Selector \- Image tool for selecting rectangular regions .SH "HIERARCHY" .IX Header "HIERARCHY" .Vb 2 \& Glib::Object \& +\-\-\-\-Gtk2::ImageView::Tool::Selector .Ve .SH "INTERFACES" .IX Header "INTERFACES" .Vb 1 \& Gtk2::ImageView::Tool .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Gtk2::ImageView::Tool::Selector is a tool for selecting areas of an image. It is useful for cropping an image, for example. The tool is an implementor of the Gtk2::ImageView::Tool inteface which means that it can be plugged into a Gtk2::ImageView by using the \fIGtk2::ImageView::Tool::set_tool()\fR method. .PP Gtk2::ImageView::Tool::Selector changes the default display of the Gtk2::ImageView. It darkens down the unselected region of the image which provides a nice effect and makes it clearer what part of the image that is currently selected. Unfortunately, this effect is somewhat incompatible with how Gtk2::ImageView::Nav behaves because that widget will show the image without darkening it. .PP The tool also changes the default behaviour of the mouse. When a Gtk2::ImageView::Tool::Selector is set on a Gtk2::ImageView, mouse presses do not \*(L"grab\*(R" the image and you cannot scroll by dragging. Instead mouse presses and dragging is used to resize and move the selection rectangle. When the mouse drags the selection rectangle to the border of the widget, the view autoscrolls which is a convenient way for a user to position the selection. .PP Please note that Gtk2::ImageView::Tool::Selector draws the image in two layers. One darkened and the selection rectangle in normal luminosity. Because it uses two draw operations instead one one like Gtk2::ImageView::Tool::Dragger does, it is significantly slower than that tool. Therefore, it makes sense for a user of this library to set the interpolation to \s-1GDK_INTERP_NEAREST\s0 when using this tool to ensure that performance is acceptable to the users of the program. .SS "Zoom bug" .IX Subsection "Zoom bug" There is a small bug in Gtk2::ImageView::Tool::Selector that becomes apparent when the zoom factor is greater than about 30. The edge of the selection rectangle may in that case intersect a pixel. .PP The bug is caused by bug 389832 in gdk-pixbuf. There is no way to solve this bug on Gtk2::ImageView's level (but if someone knows how, I'd really like to know). .SH "METHODS" .IX Header "METHODS" .SS "tool = Gtk2::ImageView::Tool::Selector\->\fBnew\fP ($view)" .IX Subsection "tool = Gtk2::ImageView::Tool::Selector->new ($view)" .IP "\(bu" 4 \&\f(CW$view\fR (Gtk2::ImageView) .PP Returns a new selector tool for the specified view with the following default values: .IP "selection : (0, 0) \- [0, 0]" 4 .IX Item "selection : (0, 0) - [0, 0]" .ie n .SS "rectangle = $selector\->\fBget_selection\fP" .el .SS "rectangle = \f(CW$selector\fP\->\fBget_selection\fP" .IX Subsection "rectangle = $selector->get_selection" Returns a Gtk2::Gdk::Rectangle with the current selection. If either the width or the height of the selection is zero, then nothing is selected and undef is returned. See \*(L"selection-changed\*(R" for an example. .ie n .SS "$selector\->\fBset_selection\fP ($rect)" .el .SS "\f(CW$selector\fP\->\fBset_selection\fP ($rect)" .IX Subsection "$selector->set_selection ($rect)" .IP "\(bu" 4 \&\f(CW$rect\fR (Gtk2::Gdk::Rectangle) .PP Sets the selection rectangle for the tool. Setting this attribute will cause the widget to immidiately repaint itself if its view is realized. .PP This method does nothing under the following circumstances: .IP "If the views pixbuf is undef." 4 .IX Item "If the views pixbuf is undef." .PD 0 .IP "If rect is wider or taller than the size of the pixbuf" 4 .IX Item "If rect is wider or taller than the size of the pixbuf" .IP "If rect equals the current selection rectangle." 4 .IX Item "If rect equals the current selection rectangle." .PD .PP If the selection falls outside the pixbufs area, its position is moved so that it is within the pixbuf. .PP Calling this method causes the ::selection\-changed signal to be emitted. .PP The default selection is (0,0) \- [0,0]. .IP "selector : a Gtk2::ImageView::Tool::Selector" 4 .IX Item "selector : a Gtk2::ImageView::Tool::Selector" .PD 0 .IP "rect : Selection rectangle in image space coordinates." 4 .IX Item "rect : Selection rectangle in image space coordinates." .PD .SH "PROPERTIES" .IX Header "PROPERTIES" .IP "'view' (Gtk2::ImageView : default undef : writable / construct-only)" 4 .IX Item "'view' (Gtk2::ImageView : default undef : writable / construct-only)" Image View to navigate .SH "SIGNALS" .IX Header "SIGNALS" .IP "\fBselection-changed\fR (Gtk2::ImageView::Tool::Selector)" 4 .IX Item "selection-changed (Gtk2::ImageView::Tool::Selector)" .SH "SEE ALSO" .IX Header "SEE ALSO" Gtk2::ImageView, Glib::Object .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (C) 2007 by Jeffrey Ratcliffe. .PP This software is licensed under the \s-1GPL\-3\s0; see Gtk2::ImageView for a full notice.