Gtk2-ImageView
view release on metacpan or search on metacpan
ImageView.xs view on Meta::CPAN
=for apidoc
Returns a rectangle with the current viewport. If pixbuf is NULL or there is no
viewport, undef is returned.
The current viewport is defined as the rectangle, in zoomspace coordinates as
the area of the loaded pixbuf the Gtk2::ImageView is currently showing.
=cut
## call as $viewport = $view->get_viewport
## gboolean gtk_image_view_get_viewport (GtkImageView *view, GdkRectangle *rect);
GdkRectangle_copy *
gtk_image_view_get_viewport (view)
GtkImageView * view
PREINIT:
GdkRectangle rect;
CODE:
if (!gtk_image_view_get_viewport(view, &rect))
XSRETURN_UNDEF;
RETVAL = ▭
OUTPUT:
RETVAL
=for apidoc
Get the rectangle in the widget where the pixbuf is painted, or undef if the
view is not allocated or has no pixbuf.
For example, if the widgets allocated size is 100, 100 and the pixbufs size is
50, 50 and the zoom factor is 1.0, then the pixbuf will be drawn centered on the
widget. rect will then be (25,25)-[50,50].
This method is useful when converting from widget to image or zoom space
coordinates.
=cut
## call as $rectangle = $view->get_draw_rect
GdkRectangle_copy *
gtk_image_view_get_draw_rect (view);
GtkImageView * view
PREINIT:
GdkRectangle rect;
CODE:
if (!gtk_image_view_get_draw_rect(view, &rect))
XSRETURN_UNDEF;
RETVAL = ▭
OUTPUT:
RETVAL
=for apidoc
Reads the two colors used to draw transparent parts of images with an alpha
channel. Note that if the transp setting of the view is
GTK_IMAGE_TRANSP_BACKGROUND or GTK_IMAGE_TRANSP_COLOR, then both colors will be
equal.
=cut
## call as @check_colors = $view->get_check_colors
void
gtk_image_view_get_check_colors (view)
GtkImageView * view
PREINIT:
int check_color1;
int check_color2;
PPCODE:
gtk_image_view_get_check_colors (view, &check_color1, &check_color2);
XPUSHs(sv_2mortal(newSViv(check_color1)));
XPUSHs(sv_2mortal(newSViv(check_color2)));
=for apidoc
Converts a rectangle in image space coordinates to widget space coordinates.
If the view is not realized, or if it contains no pixbuf, then the conversion
was unsuccessful, FALSE is returned and rect_out is left unmodified.
Note that this function may return a rectangle that is not visible on the
widget.
=cut
## call as $rect_out = $view->image_to_widget_rect($rect_in)
## gboolean gtk_image_view_image_to_widget_rect (GtkImageView *view, GdkRectangle *rect_in, GdkRectangle *rect_out);
GdkRectangle_copy *
gtk_image_view_image_to_widget_rect (view, rect_in)
GtkImageView * view
GdkRectangle * rect_in
PREINIT:
GdkRectangle rect_out;
CODE:
if (!gtk_image_view_image_to_widget_rect(view, rect_in, &rect_out))
XSRETURN_UNDEF;
RETVAL = &rect_out;
OUTPUT:
RETVAL
=for apidoc
Sets the offset of where in the image the GtkImageView should begin displaying
image data.
The offset is clamped so that it will never cause the GtkImageView to display
pixels outside the pixbuf. Setting this attribute causes the widget to repaint
itself if it is realized.
If invalidate is TRUE, the views entire area will be invalidated instead of
redrawn immidiately. The view is then queued for redraw, which means that
additional operations can be performed on it before it is redrawn.
The difference can sometimes be important like when you are overlaying data and
get flicker or artifacts when setting the offset. If that happens, setting
invalidate to TRUE could fix the problem. See the source code to
GtkImageToolSelector for an example.
Normally, invalidate should always be FALSE because it is much faster to repaint
immidately than invalidating.
=over
=item view : a Gtk2::ImageView
=item x : X-component of the offset in zoom space coordinates.
=item y : Y-component of the offset in zoom space coordinates.
=item invalidate : whether to invalidate the view or redraw immediately,
default=FALSE.
( run in 0.517 second using v1.01-cache-2.11-cpan-5511b514fd6 )